diff options
author | Ira Rice <irarice@gmail.com> | 2009-03-02 19:10:40 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-02 19:10:40 -0700 |
commit | 1d7b4c4640635c809feca83e76b1aa62109c0707 (patch) | |
tree | 0d715bfc941e72a6df3779d53c6c2e53729366e3 /src/localplayer.cpp | |
parent | 4adee3cfbafee155ab9223e94162c6055ef0a412 (diff) | |
download | mana-1d7b4c4640635c809feca83e76b1aa62109c0707.tar.gz mana-1d7b4c4640635c809feca83e76b1aa62109c0707.tar.bz2 mana-1d7b4c4640635c809feca83e76b1aa62109c0707.tar.xz mana-1d7b4c4640635c809feca83e76b1aa62109c0707.zip |
Added particle attacks back on to the players. However, instead of being
constant, particle attacks are now weapon specific, so that different
weapons can have different attacks.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 9bf5d990..bcf3fb15 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -103,7 +103,8 @@ LocalPlayer::~LocalPlayer() void LocalPlayer::logic() { - switch (mAction) { + switch (mAction) + { case STAND: break; @@ -123,13 +124,36 @@ void LocalPlayer::logic() break; case ATTACK: + int rotation = 0; + std::string particleEffect = ""; int frames = 4; + if (mEquippedWeapon && mEquippedWeapon->getAttackType() == ACTION_ATTACK_BOW) frames = 5; mFrame = (get_elapsed_time(mWalkTime) * frames) / mAttackSpeed; + //attack particle effect + if (mEquippedWeapon) + particleEffect = mEquippedWeapon->getParticleEffect(); + + if (!particleEffect.empty() && mParticleEffects) + { + switch (mDirection) + { + case DOWN: rotation = 0; break; + case LEFT: rotation = 90; break; + case UP: rotation = 180; break; + case RIGHT: rotation = 270; break; + default: break; + } + Particle *p; + p = particleEngine->addEffect("graphics/particles/" + + particleEffect, 0, 0, rotation); + controlParticle(p); + } + if (mFrame >= frames) nextStep(); |