32 #include "gui/theme.h"
49 #include "utils/timer.h"
53 #define for_each_cursors() \
54 for (int size = CAST_S32(TargetCursorSize::SMALL); \
55 size < CAST_S32(TargetCursorSize::NUM_TC); \
58 for (int type = CAST_S32(TargetCursorType::NORMAL); \
59 type < CAST_S32(TargetCursorType::NUM_TCT); \
73 mStatusParticleEffects(
nullptr, true),
74 mChildParticleEffects(&mStatusParticleEffects, false),
78 mActorSpriteListeners(),
81 mMustResetParticles(false),
106 (*iter)->actorSpriteDestroyed(*
this);
124 if (effect !=
nullptr &&
150 if (particle !=
nullptr)
159 if (particle !=
nullptr)
169 if (particle !=
nullptr)
188 static const int targetHeights[
CAST_SIZE(
205 if (active != wasActive)
221 const char *
const name,
226 const uint32_t opt = (*it).first;
227 const int32_t
id = (*it).second;
239 "Error: unknown effect by %s. "
250 const char *
const name,
255 const uint32_t opt = (*it).first;
256 const int32_t
id = (*it).second;
275 "Error: unknown effect by %s. "
323 if (effect ==
nullptr)
339 const int32_t effectId,
343 if (effect ==
nullptr)
353 if (particle ==
nullptr)
355 if (particle !=
nullptr)
368 const std::string &color)
379 const int variant = (*it)->variant;
386 if (display.
image.empty())
395 std::string imagePath;
496 static const std::string targetCursorFile(
"target-cursor-%s-%s.xml");
503 targetCursorFile.c_str(),
522 std::string effectsStr;
531 if (effect ==
nullptr)
533 if (!effectsStr.empty())
534 effectsStr.append(
", ");
535 effectsStr.append(effect->
mName);
static void applyEffectByOption1(ActorSprite *const actor, uint32_t option, const char *const name, const OptionsMap &options)
static void applyEffectByOption(ActorSprite *const actor, uint32_t option, const char *const name, const OptionsMap &options)
#define for_each_cursors()
static const char * cursorType(const TargetCursorTypeT type)
static const char * cursorSize(const TargetCursorSizeT size)
#define fromBool(val, name)
AnimatedSprite * mUsedTargetCursor
ParticleList mChildParticleEffects
void setStatusEffectOpitons(const uint32_t option, const uint32_t opt1, const uint32_t opt2, const uint32_t opt3)
ActorSpriteListeners mActorSpriteListeners
void setMap(Map *const map)
static void initTargetCursor()
void setupSpriteDisplay(const SpriteDisplay &display, const ForceDisplay forceDisplay, const DisplayTypeT displayType, const std::string &color)
void setPoison(const bool b)
virtual TargetCursorSizeT getTargetCursorSize() const
ActorSprite(const BeingId id)
void setStatusEffectOpiton0(const uint32_t option)
virtual void setRiding(const bool b)
virtual ActorTypeT getType() const
ParticleVector mStatusParticleEffects
static void cleanupTargetCursors()
static AnimatedSprite * targetCursor[static_cast< size_t >(TargetCursorType::NUM_TCT)][static_cast< size_t >(TargetCursorSize::NUM_TC)]
virtual void stopCast(const bool b)
ActorSpriteListeners::iterator ActorSpriteListenerIterator
virtual void setTrickDead(const bool b)
void controlParticleDeleted(const Particle *const particle)
std::set< int32_t > mStatusEffects
void setTargetType(const TargetCursorTypeT type)
void controlCustomParticle(Particle *const particle)
void controlAutoParticle(Particle *const particle)
void setStatusEffect(const int32_t index, const Enable active, const IsStart start)
virtual void updateStatusEffect(const int32_t index, const Enable newStatus, const IsStart start)
void removeActorSpriteListener(ActorSpriteListener *const listener)
std::string getStatusEffectsString() const
void addActorSpriteListener(ActorSpriteListener *const listener)
virtual void handleStatusEffect(const StatusEffect *const effect, const int32_t effectId, const Enable newStatus, const IsStart start)
void setHaveCart(const bool b)
virtual void setMap(Map *const map)
static AnimatedSprite * delayedLoad(const std::string &filename, const int variant)
static AnimatedSprite * load(const std::string &filename, const int variant)
std::vector< Sprite * > mSprites
bool update(const int time)
void addSprite(Sprite *const sprite)
bool getBoolValue(const std::string &key) const
std::string getStringValue(const std::string &key) const
static void distributeEvent(const std::string &msg)
void setTarget(Being *const target)
Being * getTarget() const
void log(const char *const log_text,...)
Particle * addEffect(const std::string &particleEffectFile, const int pixelX, const int pixelY, const int rotation)
void addLocally(Particle *const particle)
void moveTo(const float x, const float y)
void removeLocally(const Particle *const particle)
void setLocally(const int index, Particle *const particle)
void delLocally(const int index)
void setActor(const BeingId actor)
Particle * getParticle() const
Particle * getStartParticle() const
static std::string resolveThemePath(const std::string &path)
static Image * getImageFromTheme(const std::string &path)
static const int mapTileSize
static const int MILLISECONDS_IN_A_TICK
DisplayType ::T DisplayTypeT
const bool ForceDisplay_true
#define FOR_EACH(type, iter, array)
LocalPlayer * localPlayer
Image * getImage(const std::string &idPath)
const OptionsMap & getOpt3Map()
const OptionsMap & getOpt2Map()
StatusEffect * getStatusEffect(const int index, const Enable enabling)
const OptionsMap & getOpt1Map()
const OptionsMap & getOptionMap()
ParticleEngine * particleEngine
#define BLOCK_START(name)
std::vector< SpriteReference * >::const_iterator SpriteRefs
OptionsMap::const_iterator OptionsMapCIter
std::map< uint32_t, uint32_t > OptionsMap
std::string combineDye3(std::string file, const std::string &dye)
std::string strprintf(const char *const format,...)
std::string combineDye2(std::string file, const std::string &dye)
std::string pathJoin(std::string str1, const std::string &str2)
StringVect::const_iterator StringVectCIter
std::vector< SpriteReference * > sprites
TargetCursorSize ::T TargetCursorSizeT
TargetCursorType ::T TargetCursorTypeT