39 const std::string &hoverCursor)
42 "targetCursor",
"medium"));
57 "quickActionEffect", -1));
62 const int moreBlockFlags)
66 node,
"walkType",
"walk");
68 const uint8_t allFlags =
CAST_U8(
78 if (walkStr ==
"walk" || walkStr ==
"ground")
80 else if (walkStr ==
"fly" || walkStr ==
"air")
82 else if (walkStr ==
"all")
84 else if (walkStr ==
"wall")
86 else if (walkStr ==
"monsterwall")
88 else if (walkStr ==
"swim" || walkStr ==
"water")
90 else if (walkStr ==
"walkswim" || walkStr ==
"swimwalk")
100 "startFollowDistance", 3));
102 "followDistance", 0));
104 "warpDistance", 11));
123 "attackOffsetX",
info->getTargetOffsetX()));
125 "attackOffsetY",
info->getTargetOffsetY()));
128 "thinkTime", 500) / 10);
131 "directionType", 1));
133 "sitDirectionType", 1));
135 "deadDirectionType", 1));
137 "attackDirectionType", 4));
143 const std::string &dbName)
145 if (xmlNameEqual(spriteNode,
"sprite"))
147 if (!XmlHaveChildContent(spriteNode))
151 currentSprite->
sprite = XmlChildContent(spriteNode);
154 spriteNode,
"variant", 0);
155 display.
sprites.push_back(currentSprite);
158 else if (xmlNameEqual(spriteNode,
"sound"))
160 if (!XmlHaveChildContent(spriteNode))
164 spriteNode,
"event",
"");
166 spriteNode,
"delay", 0);
167 const char *
const filename = XmlChildContent(spriteNode);
173 else if (event ==
"miss")
177 else if (event ==
"hurt")
181 else if (event ==
"die")
185 else if (event ==
"move")
189 else if (event ==
"sit")
193 else if (event ==
"sittop")
197 else if (event ==
"spawn")
203 logger->
log((dbName +
": Warning, sound effect %s for "
204 "unknown event %s of monster %s").c_str(),
205 filename, event.c_str(),
206 currentInfo->
getName().c_str());
210 else if (xmlNameEqual(spriteNode,
"attack"))
218 "critical-hit-effect-id",
226 "skyaction",
"skyattack");
228 "wateraction",
"waterattack");
230 "rideaction",
"rideattack");
233 "missile-particle",
"");
236 spriteNode,
"missile-z", 32.0F);
238 spriteNode,
"missile-lifetime", 500);
240 spriteNode,
"missile-speed", 7.0F);
242 spriteNode,
"missile-diedistance", 8.0F);
260 else if (xmlNameEqual(spriteNode,
"particlefx"))
262 if (!XmlHaveChildContent(spriteNode))
265 display.
particles.push_back(XmlChildContent(spriteNode));
void addSound(const ItemSoundEvent::Type event, const std::string &filename, const int delay)
void addAttack(const int id, const std::string &action, const std::string &skyAttack, const std::string &waterAttack, const std::string &rideAttack, const int effectId, const int hitEffectId, const int criticalHitEffectId, const int missEffectId, const std::string &missileParticle, const float missileZ, const float missileSpeed, const float missileDieDistance, const int missileLifeTime)
const std::string & getName() const
int getIntValue(const std::string &key) const
void log(const char *const log_text,...)
#define FOR_EACH(type, iter, array)
bool info(InputEvent &event)
bool readObjectNodes(xmlNode *const &spriteNode, SpriteDisplay &display, BeingInfo *const currentInfo, const std::string &dbName)
void readAiAttributes(BeingInfo *const info, xmlNode *const node)
void readBasicAttributes(BeingInfo *const info, xmlNode *const node, const std::string &hoverCursor)
void readWalkingAttributes(BeingInfo *const info, xmlNode *const node, const int moreBlockFlags)
float getFloatProperty(const xmlNodePtr node, const char *const name, float def)
int getProperty(const xmlNodePtr node, const char *const name, int def)
void splitToStringVector(StringVect &tokens, const std::string &text, const char separator)
StringVect::const_iterator StringVectCIter
std::vector< std::string > StringVect
std::vector< SpriteReference * > sprites