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
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-04-30 15:59:52 +0200
commit8a67e721880959b431d220e2d1fd5b60a4f11ad7 (patch)
treee8383591a0cd3d4849309a6ab0fa1d67823f371c /src/resources/iteminfo.h
parentfe87acd14acd2aa33c9b8a03a77d80d6a7648f1b (diff)
downloadmana-8a67e721880959b431d220e2d1fd5b60a4f11ad7.tar.gz
mana-8a67e721880959b431d220e2d1fd5b60a4f11ad7.tar.bz2
mana-8a67e721880959b431d220e2d1fd5b60a4f11ad7.tar.xz
mana-8a67e721880959b431d220e2d1fd5b60a4f11ad7.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
Diffstat (limited to 'src/resources/iteminfo.h')
-rw-r--r--src/resources/iteminfo.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 16bc4392..4ab66597 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -109,13 +109,25 @@ class ItemInfo
const std::string &getSprite(Gender gender) const;
// 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
@@ -162,8 +174,10 @@ class ItemInfo
/** Attack range, will be equal to ATTACK_RANGE_NOT_SET if no weapon. */
int mAttackRange;
- // Particle to be shown when weapon attacks
- std::string mMissileParticle;
+ /** Effects to be shown when weapon attacks - see also effects.xml */
+ std::string mMissileParticleFile;
+ int mHitEffectId;
+ int mCriticalHitEffectId;
/** Maps gender to sprite filenames. */
std::map<int, std::string> mAnimationFiles;