From 6ff97aad8bf4af8e1a69665b3ad414042efada02 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Fri, 29 Apr 2011 01:21:45 +0200 Subject: 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. --- src/resources/itemdb.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/resources/itemdb.cpp') diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 59d7e951c..ab38e282e 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -226,6 +226,10 @@ void ItemDB::load() int attackRange = XML::getProperty(node, "attack-range", 0); std::string missileParticle = 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")); SpriteDisplay display; display.image = image; @@ -283,7 +287,9 @@ void ItemDB::load() itemInfo->setWeight(weight); itemInfo->setAttackAction(attackAction); itemInfo->setAttackRange(attackRange); - itemInfo->setMissileParticle(missileParticle); + itemInfo->setMissileParticleFile(missileParticle); + itemInfo->setHitEffectId(hitEffectId); + itemInfo->setCriticalHitEffectId(criticalEffectId); itemInfo->setDrawBefore(parseSpriteName(drawBefore)); itemInfo->setDrawAfter(parseSpriteName(drawAfter)); itemInfo->setDrawPriority(drawPriority); -- cgit v1.2.3-60-g2f50