summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-14 18:02:03 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-14 18:02:03 +0300
commit4edbdf124303f0e7c229f43a5054755e112ff6b4 (patch)
tree54d355cb568b07108c08db0f712c072d60c1a7ce /src/resources
parent15424641cca695650f4b56c37711c12c81cf2c32 (diff)
downloadmv-4edbdf124303f0e7c229f43a5054755e112ff6b4.tar.gz
mv-4edbdf124303f0e7c229f43a5054755e112ff6b4.tar.bz2
mv-4edbdf124303f0e7c229f43a5054755e112ff6b4.tar.xz
mv-4edbdf124303f0e7c229f43a5054755e112ff6b4.zip
Fix attack sprite actions. Add ride attack action.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/attack.h15
-rw-r--r--src/resources/beingcommon.cpp15
-rw-r--r--src/resources/beinginfo.cpp19
-rw-r--r--src/resources/beinginfo.h1
4 files changed, 39 insertions, 11 deletions
diff --git a/src/resources/attack.h b/src/resources/attack.h
index d904b40b5..578818db6 100644
--- a/src/resources/attack.h
+++ b/src/resources/attack.h
@@ -32,19 +32,26 @@ struct Attack final
std::string mAction;
std::string mSkyAction;
std::string mWaterAction;
+ std::string mRideAction;
int mEffectId;
int mHitEffectId;
int mCriticalHitEffectId;
int mMissEffectId;
std::string mMissileParticle;
- Attack(const std::string &action, const std::string &skyAction,
- const std::string &waterAction, const int effectId,
- const int hitEffectId, const int criticalHitEffectId,
- const int missEffectId, const std::string &missileParticle) :
+ Attack(const std::string &action,
+ const std::string &skyAction,
+ const std::string &waterAction,
+ const std::string &rideAction,
+ const int effectId,
+ const int hitEffectId,
+ const int criticalHitEffectId,
+ const int missEffectId,
+ const std::string &missileParticle) :
mAction(action),
mSkyAction(skyAction),
mWaterAction(waterAction),
+ mRideAction(rideAction),
mEffectId(effectId),
mHitEffectId(hitEffectId),
mCriticalHitEffectId(criticalHitEffectId),
diff --git a/src/resources/beingcommon.cpp b/src/resources/beingcommon.cpp
index 6c64a162d..3025e658c 100644
--- a/src/resources/beingcommon.cpp
+++ b/src/resources/beingcommon.cpp
@@ -188,13 +188,22 @@ bool BeingCommon::readObjectNodes(XmlNodePtrConst &spriteNode,
"skyaction", "skyattack");
const std::string waterSpriteAction = XML::getProperty(spriteNode,
"wateraction", "waterattack");
+ const std::string rideSpriteAction = XML::getProperty(spriteNode,
+ "rideaction", "rideattack");
const std::string missileParticle = XML::getProperty(spriteNode,
"missile-particle", "");
- currentInfo->addAttack(attackId, spriteAction, skySpriteAction,
- waterSpriteAction, effectId, hitEffectId,
- criticalHitEffectId, missEffectId, missileParticle);
+ currentInfo->addAttack(attackId,
+ spriteAction,
+ skySpriteAction,
+ waterSpriteAction,
+ rideSpriteAction,
+ effectId,
+ hitEffectId,
+ criticalHitEffectId,
+ missEffectId,
+ missileParticle);
return true;
}
else if (xmlNameEqual(spriteNode, "particlefx"))
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp
index 79969e71e..b857335ba 100644
--- a/src/resources/beinginfo.cpp
+++ b/src/resources/beinginfo.cpp
@@ -41,8 +41,11 @@
BeingInfo *BeingInfo::unknown = nullptr;
Attack *BeingInfo::empty = new Attack(SpriteAction::ATTACK,
- SpriteAction::ATTACKSKY, SpriteAction::ATTACKWATER,
- -1, -1, -1, -1, std::string());
+ SpriteAction::ATTACKSKY,
+ SpriteAction::ATTACKWATER,
+ SpriteAction::ATTACKRIDE,
+ -1, -1, -1, -1,
+ std::string());
BeingInfo::BeingInfo() :
mDisplay(),
@@ -169,6 +172,7 @@ void BeingInfo::addAttack(const int id,
const std::string &action,
const std::string &skyAction,
const std::string &waterAction,
+ const std::string &rideAction,
const int effectId,
const int hitEffectId,
const int criticalHitEffectId,
@@ -176,8 +180,15 @@ void BeingInfo::addAttack(const int id,
const std::string &missileParticle)
{
delete mAttacks[id];
- mAttacks[id] = new Attack(action, skyAction, waterAction, effectId,
- hitEffectId, criticalHitEffectId, missEffectId, missileParticle);
+ mAttacks[id] = new Attack(action,
+ skyAction,
+ waterAction,
+ rideAction,
+ effectId,
+ hitEffectId,
+ criticalHitEffectId,
+ missEffectId,
+ missileParticle);
}
void BeingInfo::clear()
diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h
index a4ee2a750..6a84723a3 100644
--- a/src/resources/beinginfo.h
+++ b/src/resources/beinginfo.h
@@ -102,6 +102,7 @@ class BeingInfo final
const std::string &action,
const std::string &skyAttack,
const std::string &waterAttack,
+ const std::string &rideAttack,
const int effectId,
const int hitEffectId,
const int criticalHitEffectId,