From a93a723db62ba2ad445b0fff26be5c51aefcda78 Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Sun, 3 May 2009 17:11:25 -0400 Subject: Added rotational particles, and added code to show arrows when a player shoots them. --- src/being.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index d719635b..fc61fbd9 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -470,8 +470,23 @@ void Being::handleAttack() void Being::handleAttack(Being *victim, int damage, AttackType type) #endif { - setAction(Being::ATTACK); + if (this != player_node) + setAction(Being::ATTACK); #ifdef EATHENA_SUPPORT + if (getType() == PLAYER) + { + if (mEquippedWeapon->getAttackType() == ACTION_ATTACK_BOW) + { + Particle *p = new Particle(NULL); + p->setLifetime(1000); + victim->controlParticle(p); + + Particle *p2 = particleEngine->addEffect("graphics/particles/arrow.particle.xml", mPx, mPy); + p2->setLifetime(900); + p2->setDestination(p, 7, 0); + p2->setDieDistance(8); + } + } mFrame = 0; mWalkTime = tick_time; #endif -- cgit v1.2.3-70-g09d2