summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-04-29 01:21:45 +0200
committerAndrei Karas <akaras@inbox.ru>2011-05-01 23:45:51 +0300
commit6ff97aad8bf4af8e1a69665b3ad414042efada02 (patch)
treeed0f186c524146d0b68c082373b1053d84f51c16 /src/resources/iteminfo.h
parentbba99b414167d9adb40622d8fc8c1e9dc814e956 (diff)
downloadmv-6ff97aad8bf4af8e1a69665b3ad414042efada02.tar.gz
mv-6ff97aad8bf4af8e1a69665b3ad414042efada02.tar.bz2
mv-6ff97aad8bf4af8e1a69665b3ad414042efada02.tar.xz
mv-6ff97aad8bf4af8e1a69665b3ad414042efada02.zip
Added customizable on-hit effects for characters.
This patch adds support for the following two parameters in weapon items: hit-effect-id: Effect triggered on the victim on normal hit. critical-hit-effect-id: Triggered on the victim on critical hit. (Specified in effects.xml) The patch also permits the use of custom defaults set in paths.xml by setting the following keys: (Paths are relative to the 'particles' key value, here.) hitEffectId: defaulted to effect id 26. criticalHitEffectId: defaulted to effect id 28. Resolves: Mana-mantis #337. Reviewed-by: bcs86 Conflicts: src/being.cpp src/resources/itemdb.cpp src/resources/iteminfo.h ManaPlus: adding missing checks.
Diffstat (limited to 'src/resources/iteminfo.h')
-rw-r--r--src/resources/iteminfo.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 8b276601c..01a4b5b9e 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -183,11 +183,25 @@ class ItemInfo
void setAttackAction(std::string attackAction);
// Handlers for seting and getting the string used for particles when attacking
- void setMissileParticle(std::string s) { mMissileParticle = s; }
+ void setMissileParticleFile(const std::string &s)
+ { mMissileParticleFile = s; }
- std::string getMissileParticle() const { return mMissileParticle; }
+ const std::string &getMissileParticleFile() const
+ { return mMissileParticleFile; }
- std::string getAttackAction() const
+ void setHitEffectId(int s)
+ { mHitEffectId = s; }
+
+ int getHitEffectId() const
+ { return mHitEffectId; }
+
+ void setCriticalHitEffectId(int s)
+ { mCriticalHitEffectId = s; }
+
+ int getCriticalHitEffectId() const
+ { return mCriticalHitEffectId; }
+
+ const std::string &getAttackAction() const
{ return mAttackAction; }
int getAttackRange() const
@@ -232,6 +246,9 @@ class ItemInfo
bool isRemoveItemId(int id) const;
+ /** Effects to be shown when weapon attacks - see also effects.xml */
+ std::string mMissileParticleFile;
+
int getReplaceToSpriteId(int id) const;
std::map<int, int> &addReplaceSprite(int sprite);
@@ -251,6 +268,9 @@ class ItemInfo
const std::string replaceColors(std::string str,
unsigned char color) const;
+ int mHitEffectId;
+ int mCriticalHitEffectId;
+
protected:
SpriteDisplay mDisplay; /**< Display info (like icon) */
std::string mName;