summaryrefslogtreecommitdiff
path: root/src/resources/itemdb.cpp
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/itemdb.cpp
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/itemdb.cpp')
-rw-r--r--src/resources/itemdb.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 5e1b2a2f..1457b6dd 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -199,7 +199,13 @@ void ItemDB::loadCommonRef(ItemInfo *itemInfo, xmlNodePtr node)
std::string attackAction = XML::getProperty(node, "attack-action",
SpriteAction::INVALID);
int attackRange = XML::getProperty(node, "attack-range", 0);
- std::string missileParticle = XML::getProperty(node, "missile-particle", "");
+ std::string missileParticleFile = XML::getProperty(node,
+ "missile-particle",
+ "");
+ int hitEffectId = XML::getProperty(node, "hit-effect-id",
+ paths.getIntValue("hitEffectId"));
+ int criticalEffectId = XML::getProperty(node, "critical-hit-effect-id",
+ paths.getIntValue("criticalHitEffectId"));
// Load Ta Item Type
std::string typeStr = XML::getProperty(node, "type", "other");
@@ -218,7 +224,9 @@ void ItemDB::loadCommonRef(ItemInfo *itemInfo, xmlNodePtr node)
itemInfo->mWeight = weight;
itemInfo->mAttackAction = attackAction;
itemInfo->mAttackRange = attackRange;
- itemInfo->setMissileParticle(missileParticle);
+ itemInfo->setMissileParticleFile(missileParticleFile);
+ itemInfo->setHitEffectId(hitEffectId);
+ itemInfo->setCriticalHitEffectId(criticalEffectId);
// Load <sprite>, <sound>, and <floor>
for_each_xml_child_node(itemChild, node)