summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-06 03:54:00 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-06 03:54:00 +0300
commit4fb8f9f0905038f3180f108ec56b2a326ceb3483 (patch)
tree94b221f6bc81e07d565d2828dac078f471854b81 /src/resources
parentdf9a705c331da29cb0582539a817f68c79d4f267 (diff)
downloadmanaplus-4fb8f9f0905038f3180f108ec56b2a326ceb3483.tar.gz
manaplus-4fb8f9f0905038f3180f108ec56b2a326ceb3483.tar.bz2
manaplus-4fb8f9f0905038f3180f108ec56b2a326ceb3483.tar.xz
manaplus-4fb8f9f0905038f3180f108ec56b2a326ceb3483.zip
Add particle effect miss-effect-id to items and monsters.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/beinginfo.cpp6
-rw-r--r--src/resources/beinginfo.h8
-rw-r--r--src/resources/itemdb.cpp3
-rw-r--r--src/resources/iteminfo.cpp5
-rw-r--r--src/resources/iteminfo.h7
-rw-r--r--src/resources/monsterdb.cpp9
6 files changed, 28 insertions, 10 deletions
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp
index eef4ba7b7..f55d1f2e3 100644
--- a/src/resources/beinginfo.cpp
+++ b/src/resources/beinginfo.cpp
@@ -32,7 +32,7 @@
BeingInfo *BeingInfo::unknown = nullptr;
Attack *BeingInfo::empty = new Attack(SpriteAction::ATTACK,
- -1, -1, -1, std::string());
+ -1, -1, -1, -1, std::string());
BeingInfo::BeingInfo() :
mName(_("unnamed")),
@@ -117,13 +117,14 @@ const Attack *BeingInfo::getAttack(const int id) const
void BeingInfo::addAttack(const int id, std::string action, const int effectId,
const int hitEffectId, const int criticalHitEffectId,
+ const int missEffectId,
const std::string &missileParticle)
{
if (mAttacks[id])
delete mAttacks[id];
mAttacks[id] = new Attack(action, effectId, hitEffectId,
- criticalHitEffectId, missileParticle);
+ criticalHitEffectId, missEffectId, missileParticle);
}
void BeingInfo::clear()
@@ -141,5 +142,6 @@ void BeingInfo::init()
empty->mEffectId = paths.getIntValue("effectId");
empty->mHitEffectId = paths.getIntValue("hitEffectId");
empty->mCriticalHitEffectId = paths.getIntValue("criticalHitEffectId");
+ empty->mMissEffectId = paths.getIntValue("missEffectId");
}
}
diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h
index d08e85608..208fcd541 100644
--- a/src/resources/beinginfo.h
+++ b/src/resources/beinginfo.h
@@ -34,15 +34,17 @@ struct Attack final
int mEffectId;
int mHitEffectId;
int mCriticalHitEffectId;
+ int mMissEffectId;
std::string mMissileParticle;
Attack(const std::string &action, const int effectId,
const int hitEffectId, const int criticalHitEffectId,
- const std::string &missileParticle) :
+ const int missEffectId, const std::string &missileParticle) :
mAction(action),
mEffectId(effectId),
mHitEffectId(hitEffectId),
mCriticalHitEffectId(criticalHitEffectId),
+ mMissEffectId(missEffectId),
mMissileParticle(missileParticle)
{
}
@@ -105,9 +107,9 @@ class BeingInfo final
const std::string &getSound(const SoundEvent event) const;
- void addAttack(const int id, std::string action,
+ void addAttack(const int id, std::string action, const int effectId,
const int hitEffectId, const int criticalHitEffectId,
- const int effectId,
+ const int missEffectId,
const std::string &missileParticle);
const Attack *getAttack(const int id) const;
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 8fd4a9fdc..559015be9 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -245,6 +245,8 @@ void ItemDB::load()
const int criticalEffectId = XML::getProperty(
node, "critical-hit-effect-id",
paths.getIntValue("criticalHitEffectId"));
+ const int missEffectId = XML::getProperty(node, "miss-effect-id",
+ paths.getIntValue("missEffectId"));
SpriteDisplay display;
display.image = image;
@@ -305,6 +307,7 @@ void ItemDB::load()
itemInfo->setMissileParticleFile(missileParticle);
itemInfo->setHitEffectId(hitEffectId);
itemInfo->setCriticalHitEffectId(criticalEffectId);
+ itemInfo->setMissEffectId(missEffectId);
itemInfo->setDrawBefore(-1, parseSpriteName(drawBefore));
itemInfo->setDrawAfter(-1, parseSpriteName(drawAfter));
itemInfo->setDrawPriority(-1, drawPriority);
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 7e106af80..c7d8ecc0e 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -81,8 +81,9 @@ ItemInfo::ItemInfo() :
mMissileParticle(""),
mColors(nullptr),
mColorList(""),
- mHitEffectId(0),
- mCriticalHitEffectId(0),
+ mHitEffectId(-1),
+ mCriticalHitEffectId(-1),
+ mMissEffectId(-1),
maxFloorOffset(32)
{
for (int f = 0; f < 10; f ++)
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 644b80154..ba429341d 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -194,6 +194,12 @@ class ItemInfo final
int getCriticalHitEffectId() const
{ return mCriticalHitEffectId; }
+ void setMissEffectId(const int s)
+ { mMissEffectId = s; }
+
+ int getMissEffectId() const
+ { return mMissEffectId; }
+
const std::string &getAttackAction() const
{ return mAttackAction; }
@@ -306,6 +312,7 @@ class ItemInfo final
std::string mColorList;
int mHitEffectId;
int mCriticalHitEffectId;
+ int mMissEffectId;
int maxFloorOffset;
};
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index 3629357d1..22441c34e 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -192,11 +192,13 @@ void MonsterDB::load()
const int id = XML::getProperty(spriteNode, "id", 0);
const int effectId = XML::getProperty(
spriteNode, "effect-id", paths.getIntValue("effectId"));
- int hitEffectId = XML::getProperty(spriteNode,
+ const int hitEffectId = XML::getProperty(spriteNode,
"hit-effect-id", paths.getIntValue("hitEffectId"));
- int criticalHitEffectId = XML::getProperty(spriteNode,
+ const int criticalHitEffectId = XML::getProperty(spriteNode,
"critical-hit-effect-id",
paths.getIntValue("criticalHitEffectId"));
+ const int missEffectId = XML::getProperty(spriteNode,
+ "miss-effect-id", paths.getIntValue("missEffectId"));
const std::string spriteAction = XML::getProperty(
spriteNode, "action", "attack");
@@ -205,7 +207,8 @@ void MonsterDB::load()
spriteNode, "missile-particle", "");
currentInfo->addAttack(id, spriteAction, effectId,
- hitEffectId, criticalHitEffectId, missileParticle);
+ hitEffectId, criticalHitEffectId, missEffectId,
+ missileParticle);
}
else if (xmlNameEqual(spriteNode, "particlefx"))
{