From 85e7f2a79477712bf3082cb82e6a73c51361abb0 Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Wed, 10 Feb 2010 23:46:49 -0500 Subject: Adds missile-particle attribute to items and monster attacks To use simply add something like: missile-particle="graphics/particles/arrow.particle.xml" to the item's or monster's xml entry This will only work on equipped weapons, and on specified monster attacks. This patch also fixes a memory leak with target particles --- src/resources/iteminfo.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/resources/iteminfo.h') diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 88cdcd85..796382cd 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -180,6 +180,11 @@ class ItemInfo void setWeaponType(int); + // Handlers for seting and getting the string used for particles when attacking + void setMissileParticle(std::string s) { mMissileParticle = s; } + + std::string getMissileParticle() const { return mMissileParticle; } + SpriteAction getAttackType() const { return mAttackType; } @@ -208,6 +213,9 @@ class ItemInfo SpriteAction mAttackType; /**< Attack type, in case of weapon. */ int mAttackRange; /**< Attack range, will be zero if non weapon. */ + // Particle to be shown when weapon attacks + std::string mMissileParticle; + /** Maps gender to sprite filenames. */ std::map mAnimationFiles; -- cgit v1.2.3-70-g09d2