ManaPlus
|
#include <flooritem.h>
Public Member Functions | |
FloorItem (const BeingId id, const int itemId, const int x, const int y, const ItemTypeT itemType, const int amount, const int refine, const ItemColor color, const Identified identified, const Damaged damaged, const int *const cards) | |
void | postInit (Map *const map, int subX, int subY) |
ActorTypeT | getType () const |
void | draw (Graphics *const graphics, const int offsetX, const int offsetY) const |
int | getItemId () const |
const ItemInfo & | getInfo () const |
std::string | getName () const |
int | getTileX () const |
int | getTileY () const |
void | incrementPickup () |
unsigned | getPickupCount () const |
ItemColor | getColor () const |
bool | getShowMsg () const |
void | setShowMsg (const bool n) |
void | disableHightlight () |
CursorT | getHoverCursor () const |
void | setCards (const int *const cards, int sz) |
int | getCard (const int index) const |
int | getRefine () const |
ItemTypeT | getItemType () const |
Identified | getIdentified () const |
Damaged | getDamaged () const |
Public Member Functions inherited from ActorSprite | |
ActorSprite (const BeingId id) | |
~ActorSprite () | |
BeingId | getId () const |
void | setId (const BeingId id) |
virtual void | logic () |
void | setMap (Map *const map) |
virtual BlockTypeT | getBlockType () const |
void | controlAutoParticle (Particle *const particle) |
void | controlCustomParticle (Particle *const particle) |
virtual TargetCursorSizeT | getTargetCursorSize () const |
virtual int | getTargetOffsetX () const |
virtual int | getTargetOffsetY () const |
void | setTargetType (const TargetCursorTypeT type) |
void | untarget () |
void | setStatusEffect (const int32_t index, const Enable active, const IsStart start) |
void | setStatusEffectOpitons (const uint32_t option, const uint32_t opt1, const uint32_t opt2, const uint32_t opt3) |
void | setStatusEffectOpitons (const uint32_t option, const uint32_t opt1, const uint32_t opt2) |
void | setStatusEffectOpiton0 (const uint32_t option) |
void | setAlpha (const float alpha) |
float | getAlpha () const |
int | getWidth () const |
int | getHeight () const |
void | addActorSpriteListener (ActorSpriteListener *const listener) |
void | removeActorSpriteListener (ActorSpriteListener *const listener) |
int | getActorX () const |
int | getActorY () const |
void | setPoison (const bool b) |
bool | getPoison () const |
void | setHaveCart (const bool b) |
bool | getHaveCart () const |
virtual void | setRiding (const bool b) |
virtual void | setTrickDead (const bool b) |
bool | isTrickDead () const |
const std::set< int32_t > & | getStatusEffects () const |
std::string | getStatusEffectsString () const |
virtual void | stopCast (const bool b) |
size_t | getParticlesCount () const |
void | controlParticleDeleted (const Particle *const particle) |
Public Member Functions inherited from CompoundSprite | |
CompoundSprite () | |
~CompoundSprite () | |
bool | reset () |
bool | play (const std::string &action) |
bool | update (const int time) |
void | drawSimple (Graphics *const graphics, const int posX, const int posY) const |
int | getWidth () const |
int | getHeight () const |
const Image * | getImage () const |
bool | setSpriteDirection (const SpriteDirection::Type direction) |
int | getNumberOfLayers () const |
unsigned int | getCurrentFrame () const |
unsigned int | getFrameCount () const |
void | addSprite (Sprite *const sprite) |
void | setSprite (const size_t layer, Sprite *const sprite) |
void | removeSprite (const int layer) |
void | clear () |
void | ensureSize (const size_t layerCount) |
void | drawSprites (Graphics *const graphics, const int posX, const int posY) const |
virtual void | drawSpritesSDL (Graphics *const graphics, const int posX, const int posY) const |
void | setAlpha (float alpha) |
bool | updateNumber (const unsigned num) |
int | getLastTime () const |
int | getStartTime () const |
Public Member Functions inherited from Sprite | |
virtual | ~Sprite () |
virtual const void * | getHash () const |
virtual const void * | getHash2 () const |
Public Member Functions inherited from Actor | |
virtual | ~Actor () |
const Vector & | getPixelPositionF () const |
virtual void | setPixelPositionF (const Vector &pos) |
int | getPixelX () const |
virtual int | getPixelY () const |
virtual int | getSortPixelY () const |
virtual int | getNumberOfLayers () const |
const Map * | getMap () const |
Private Attributes | |
int | mCards [4] |
int | mItemId |
int | mX |
int | mY |
time_t | mDropTime |
int | mAmount |
int | mRefine |
int | mHeightPosDiff |
ItemTypeT | mItemType |
unsigned int | mPickupCount |
CursorT | mCursor |
ItemColor | mColor |
Identified | mIdentified |
Damaged | mDamaged |
bool | mShowMsg |
bool | mHighlight |
Additional Inherited Members | |
Public Types inherited from CompoundSprite | |
typedef std::vector< Sprite * >::iterator | SpriteIterator |
typedef std::vector< Sprite * >::const_iterator | SpriteConstIterator |
Static Public Member Functions inherited from ActorSprite | |
static void | load () |
static void | unload () |
Static Public Member Functions inherited from CompoundSprite | |
static void | setEnableDelay (bool b) |
Data Fields inherited from CompoundSprite | |
std::vector< Sprite * > | mSprites |
Data Fields inherited from Actor | |
int | mPixelX |
int | mPixelY |
Protected Types inherited from ActorSprite | |
typedef std::list< ActorSpriteListener * > | ActorSpriteListeners |
typedef ActorSpriteListeners::iterator | ActorSpriteListenerIterator |
Protected Types inherited from CompoundSprite | |
typedef std::list< CompoundItem * > | ImagesCache |
Protected Member Functions inherited from ActorSprite | |
virtual void | updateStatusEffect (const int32_t index, const Enable newStatus, const IsStart start) |
virtual void | handleStatusEffect (const StatusEffect *const effect, const int32_t effectId, const Enable newStatus, const IsStart start) |
void | setupSpriteDisplay (const SpriteDisplay &display, const ForceDisplay forceDisplay, const DisplayTypeT displayType, const std::string &color) |
Protected Member Functions inherited from CompoundSprite | |
void | redraw () const |
void | updateImages () const |
bool | updateFromCache () const |
void | initCurrentCacheItem () const |
Protected Member Functions inherited from Sprite | |
Sprite () | |
Protected Member Functions inherited from Actor | |
Actor () | |
Static Protected Member Functions inherited from ActorSprite | |
static void | initTargetCursor () |
static void | cleanupTargetCursors () |
Protected Attributes inherited from ActorSprite | |
std::set< int32_t > | mStatusEffects |
ParticleVector | mStatusParticleEffects |
ParticleList | mChildParticleEffects |
int | mHorseId |
BeingId | mId |
AnimatedSprite * | mUsedTargetCursor |
ActorSpriteListeners | mActorSpriteListeners |
int | mCursorPaddingX |
int | mCursorPaddingY |
bool | mMustResetParticles |
bool | mPoison |
bool | mHaveCart |
bool | mTrickDead |
Protected Attributes inherited from CompoundSprite | |
ImagesCache | imagesCache |
CompoundItem * | mCacheItem |
Image * | mImage |
Image * | mAlphaImage |
int | mOffsetX |
int | mOffsetY |
int | mStartTime |
int | mLastTime |
int | mNextRedrawTime |
bool | mNeedsRedraw |
bool | mEnableAlphaFix |
bool | mDisableAdvBeingCaching |
bool | mDisableBeingCaching |
Protected Attributes inherited from Sprite | |
float | mAlpha |
Protected Attributes inherited from Actor | |
Map * | mMap |
Vector | mPos |
int | mYDiff |
Static Protected Attributes inherited from ActorSprite | |
static AnimatedSprite * | targetCursor [static_cast< size_t >(TargetCursorType::NUM_TCT)][static_cast< size_t >(TargetCursorSize::NUM_TC)] |
static bool | loaded = false |
Static Protected Attributes inherited from CompoundSprite | |
static bool | mEnableDelay = true |
An item lying on the floor.
Definition at line 44 of file flooritem.h.
FloorItem::FloorItem | ( | const BeingId | id, |
const int | itemId, | ||
const int | x, | ||
const int | y, | ||
const ItemTypeT | itemType, | ||
const int | amount, | ||
const int | refine, | ||
const ItemColor | color, | ||
const Identified | identified, | ||
const Damaged | damaged, | ||
const int *const | cards | ||
) |
Constructor.
id | the unique ID of this item instance |
itemId | the item ID |
x | the x position in tiles |
y | the y position in tiles |
amount | the item amount |
color | the item color |
Definition at line 50 of file flooritem.cpp.
References maxCards, and setCards().
|
inline |
Definition at line 114 of file flooritem.h.
References mHighlight.
Referenced by ActorManager::createItem().
|
virtual |
Draws the Actor to the given graphics context.
Note: this function could be simplified if the graphics context would support setting a translation offset. It already does this partly with the clipping rectangle support.
Implements Actor.
Definition at line 159 of file flooritem.cpp.
References BLOCK_END, BLOCK_START, CAST_S32, cur_time, CompoundSprite::drawSimple(), Font::drawString(), Graphics::fillRectangle(), UserColorId::FLOOR_ITEM_TEXT, ActorSprite::getActorX(), ActorSprite::getActorY(), UserPalette::getColor(), Gui::getFont(), Map::getTileHeight(), Map::getTileWidth(), gui, mAmount, mapTileSize, mDropTime, mHeightPosDiff, mHighlight, Actor::mMap, mX, mY, Graphics::setColor(), Catch::toString(), userPalette, x, and y.
int FloorItem::getCard | ( | const int | index | ) | const |
Definition at line 222 of file flooritem.cpp.
References maxCards, and mCards.
Referenced by PopupMenu::handleLink(), and PopupMenu::showPopup().
|
inline |
|
inline |
|
inline |
|
inline |
const ItemInfo & FloorItem::getInfo | ( | ) | const |
Returns the item info for this floor item. Useful for adding an item link for the floor item to chat.
Definition at line 141 of file flooritem.cpp.
References ItemDB::get(), and mItemId.
|
inline |
Returns the item ID.
Definition at line 82 of file flooritem.h.
References mItemId.
Referenced by PopupMenu::handleLink(), ItemSoundManager::playSfx(), and PopupMenu::showPopup().
|
inline |
std::string FloorItem::getName | ( | ) | const |
Definition at line 146 of file flooritem.cpp.
References ItemDB::get(), Net::getNetworkType(), Actions::info(), mColor, mItemId, and ServerType::TMWATHENA.
Referenced by ActorManager::checkForPickup(), ActorManager::pickUpAll(), ActorManager::pickUpNearest(), and PopupMenu::showPopup().
|
inline |
Definition at line 102 of file flooritem.h.
References mPickupCount.
Referenced by ActorManager::pickUpAll().
|
inline |
|
inline |
Definition at line 108 of file flooritem.h.
References mShowMsg.
Referenced by LocalPlayer::pickedUp().
|
inlinevirtual |
Returns the x coordinate in tiles of the actor.
Reimplemented from Actor.
Definition at line 93 of file flooritem.h.
References mX.
Referenced by LocalPlayer::pickUp(), and ActorManager::pickUpNearest().
|
inlinevirtual |
Returns the y coordinate in tiles of the actor.
Reimplemented from Actor.
Definition at line 96 of file flooritem.h.
References mY.
Referenced by LocalPlayer::pickUp(), and ActorManager::pickUpNearest().
|
inlinevirtual |
Returns the type of the ActorSprite.
Reimplemented from ActorSprite.
Definition at line 72 of file flooritem.h.
References ActorType::FloorItem.
|
inline |
Definition at line 99 of file flooritem.h.
References mPickupCount.
Referenced by ActorManager::pickUpAll().
void FloorItem::postInit | ( | Map *const | map, |
int | subX, | ||
int | subY | ||
) |
Definition at line 81 of file flooritem.cpp.
References DisplayType::Floor, ForceDisplay_true, ItemDB::get(), Map::getHeightOffset(), Map::getTileHeight(), Map::getTileWidth(), Net::ServerFeatures::haveExtendedDropsPosition(), Actions::info(), mapTileSize, mColor, mCursor, mHeightPosDiff, mItemId, Actor::mPixelX, Actor::mPixelY, Actor::mPos, mX, mY, Actor::mYDiff, serverFeatures, ActorSprite::setMap(), ActorSprite::setupSpriteDisplay(), Vector::x, and Vector::y.
Referenced by ActorManager::createItem().
void FloorItem::setCards | ( | const int *const | cards, |
int | sz | ||
) |
Definition at line 130 of file flooritem.cpp.
References maxCards, and mCards.
Referenced by FloorItem().
|
inline |
Definition at line 111 of file flooritem.h.
References mShowMsg.
Referenced by LocalPlayer::pickedUp().
|
private |
Definition at line 141 of file flooritem.h.
Referenced by draw().
|
private |
Definition at line 137 of file flooritem.h.
Referenced by getCard(), and setCards().
|
private |
Definition at line 147 of file flooritem.h.
Referenced by getColor(), getName(), and postInit().
|
private |
Definition at line 146 of file flooritem.h.
Referenced by getHoverCursor(), and postInit().
|
private |
Definition at line 149 of file flooritem.h.
Referenced by getDamaged().
|
private |
Definition at line 140 of file flooritem.h.
Referenced by draw().
|
private |
Definition at line 143 of file flooritem.h.
Referenced by draw(), and postInit().
|
private |
Definition at line 151 of file flooritem.h.
Referenced by disableHightlight(), and draw().
|
private |
Definition at line 148 of file flooritem.h.
Referenced by getIdentified().
|
private |
Definition at line 138 of file flooritem.h.
Referenced by getInfo(), getItemId(), getName(), and postInit().
|
private |
Definition at line 144 of file flooritem.h.
Referenced by getItemType().
|
private |
Definition at line 145 of file flooritem.h.
Referenced by getPickupCount(), and incrementPickup().
|
private |
Definition at line 142 of file flooritem.h.
Referenced by getRefine().
|
private |
Definition at line 150 of file flooritem.h.
Referenced by getShowMsg(), and setShowMsg().
|
private |
Definition at line 139 of file flooritem.h.
Referenced by draw(), getTileX(), and postInit().
|
private |
Definition at line 139 of file flooritem.h.
Referenced by draw(), getTileY(), and postInit().