|
@@ -93,36 +93,68 @@ BattleStackAnimation::BattleStackAnimation(BattleInterface & owner, const CStack
|
|
assert(myAnim);
|
|
assert(myAnim);
|
|
}
|
|
}
|
|
|
|
|
|
-ECreatureAnimType::Type AttackAnimation::findValidGroup( const std::vector<ECreatureAnimType::Type> candidates ) const
|
|
|
|
|
|
+StackActionAnimation::StackActionAnimation(BattleInterface & owner, const CStack * stack)
|
|
|
|
+ : BattleStackAnimation(owner, stack)
|
|
|
|
+ , nextGroup(ECreatureAnimType::HOLDING)
|
|
|
|
+ , currGroup(ECreatureAnimType::HOLDING)
|
|
{
|
|
{
|
|
- for ( auto group : candidates)
|
|
|
|
- {
|
|
|
|
- if(myAnim->framesInGroup(group) > 0)
|
|
|
|
- return group;
|
|
|
|
- }
|
|
|
|
|
|
+}
|
|
|
|
|
|
- assert(0);
|
|
|
|
- return ECreatureAnimType::HOLDING;
|
|
|
|
|
|
+ECreatureAnimType::Type StackActionAnimation::getGroup() const
|
|
|
|
+{
|
|
|
|
+ return currGroup;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void StackActionAnimation::setNextGroup( ECreatureAnimType::Type group )
|
|
|
|
+{
|
|
|
|
+ nextGroup = group;
|
|
}
|
|
}
|
|
|
|
|
|
-void AttackAnimation::nextFrame()
|
|
|
|
|
|
+void StackActionAnimation::setGroup( ECreatureAnimType::Type group )
|
|
{
|
|
{
|
|
- if(myAnim->getType() != group)
|
|
|
|
|
|
+ currGroup = group;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void StackActionAnimation::setSound( std::string sound )
|
|
|
|
+{
|
|
|
|
+ this->sound = sound;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool StackActionAnimation::init()
|
|
|
|
+{
|
|
|
|
+ if (!sound.empty())
|
|
|
|
+ CCS->soundh->playSound(sound);
|
|
|
|
+
|
|
|
|
+ if (myAnim->framesInGroup(currGroup) > 0)
|
|
{
|
|
{
|
|
- myAnim->setType(group);
|
|
|
|
|
|
+ myAnim->playOnce(currGroup);
|
|
myAnim->onAnimationReset += [&](){ delete this; };
|
|
myAnim->onAnimationReset += [&](){ delete this; };
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ delete this;
|
|
|
|
|
|
- if(!soundPlayed)
|
|
|
|
- {
|
|
|
|
- playSound();
|
|
|
|
- soundPlayed = true;
|
|
|
|
- }
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
-AttackAnimation::~AttackAnimation()
|
|
|
|
|
|
+StackActionAnimation::~StackActionAnimation()
|
|
{
|
|
{
|
|
- myAnim->setType(ECreatureAnimType::HOLDING);
|
|
|
|
|
|
+ if (stack->isFrozen())
|
|
|
|
+ myAnim->setType(ECreatureAnimType::HOLDING);
|
|
|
|
+ else
|
|
|
|
+ myAnim->setType(nextGroup);
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+ECreatureAnimType::Type AttackAnimation::findValidGroup( const std::vector<ECreatureAnimType::Type> candidates ) const
|
|
|
|
+{
|
|
|
|
+ for ( auto group : candidates)
|
|
|
|
+ {
|
|
|
|
+ if(myAnim->framesInGroup(group) > 0)
|
|
|
|
+ return group;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ assert(0);
|
|
|
|
+ return ECreatureAnimType::HOLDING;
|
|
}
|
|
}
|
|
|
|
|
|
const CCreature * AttackAnimation::getCreature() const
|
|
const CCreature * AttackAnimation::getCreature() const
|
|
@@ -135,9 +167,7 @@ const CCreature * AttackAnimation::getCreature() const
|
|
|
|
|
|
|
|
|
|
AttackAnimation::AttackAnimation(BattleInterface & owner, const CStack *attacker, BattleHex _dest, const CStack *defender)
|
|
AttackAnimation::AttackAnimation(BattleInterface & owner, const CStack *attacker, BattleHex _dest, const CStack *defender)
|
|
- : BattleStackAnimation(owner, attacker),
|
|
|
|
- group(ECreatureAnimType::SHOOT_FRONT),
|
|
|
|
- soundPlayed(false),
|
|
|
|
|
|
+ : StackActionAnimation(owner, attacker),
|
|
dest(_dest),
|
|
dest(_dest),
|
|
defendingStack(defender),
|
|
defendingStack(defender),
|
|
attackingStack(attacker)
|
|
attackingStack(attacker)
|
|
@@ -146,61 +176,34 @@ AttackAnimation::AttackAnimation(BattleInterface & owner, const CStack *attacker
|
|
attackingStackPosBeforeReturn = attackingStack->getPosition();
|
|
attackingStackPosBeforeReturn = attackingStack->getPosition();
|
|
}
|
|
}
|
|
|
|
|
|
-bool HittedAnimation::init()
|
|
|
|
-{
|
|
|
|
- CCS->soundh->playSound(battle_sound(stack->getCreature(), wince));
|
|
|
|
- myAnim->playOnce(ECreatureAnimType::HITTED);
|
|
|
|
- myAnim->onAnimationReset += [&](){ delete this; };
|
|
|
|
- return true;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
HittedAnimation::HittedAnimation(BattleInterface & owner, const CStack * stack)
|
|
HittedAnimation::HittedAnimation(BattleInterface & owner, const CStack * stack)
|
|
- : BattleStackAnimation(owner, stack)
|
|
|
|
|
|
+ : StackActionAnimation(owner, stack)
|
|
{
|
|
{
|
|
|
|
+ setGroup(ECreatureAnimType::HITTED);
|
|
|
|
+ setSound(battle_sound(stack->getCreature(), wince));
|
|
}
|
|
}
|
|
|
|
|
|
DefenceAnimation::DefenceAnimation(BattleInterface & owner, const CStack * stack)
|
|
DefenceAnimation::DefenceAnimation(BattleInterface & owner, const CStack * stack)
|
|
- : BattleStackAnimation(owner, stack)
|
|
|
|
|
|
+ : StackActionAnimation(owner, stack)
|
|
{
|
|
{
|
|
|
|
+ setGroup(ECreatureAnimType::DEFENCE);
|
|
|
|
+ setSound(battle_sound(stack->getCreature(), defend));
|
|
}
|
|
}
|
|
|
|
|
|
-bool DefenceAnimation::init()
|
|
|
|
|
|
+DeathAnimation::DeathAnimation(BattleInterface & owner, const CStack * stack, bool ranged):
|
|
|
|
+ StackActionAnimation(owner, stack)
|
|
{
|
|
{
|
|
- CCS->soundh->playSound(battle_sound(stack->getCreature(), defend));
|
|
|
|
- myAnim->playOnce(ECreatureAnimType::DEFENCE);
|
|
|
|
- myAnim->onAnimationReset += [&](){ delete this; };
|
|
|
|
|
|
+ setSound(battle_sound(stack->getCreature(), killed));
|
|
|
|
|
|
- return true; //initialized successfuly
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-ECreatureAnimType::Type DeathAnimation::getMyAnimType()
|
|
|
|
-{
|
|
|
|
- if(rangedAttack && myAnim->framesInGroup(ECreatureAnimType::DEATH_RANGED) > 0)
|
|
|
|
- return ECreatureAnimType::DEATH_RANGED;
|
|
|
|
|
|
+ if(ranged && myAnim->framesInGroup(ECreatureAnimType::DEATH_RANGED) > 0)
|
|
|
|
+ setGroup(ECreatureAnimType::DEATH_RANGED);
|
|
else
|
|
else
|
|
- return ECreatureAnimType::DEATH;
|
|
|
|
-}
|
|
|
|
|
|
+ setGroup(ECreatureAnimType::DEATH);
|
|
|
|
|
|
-bool DeathAnimation::init()
|
|
|
|
-{
|
|
|
|
- CCS->soundh->playSound(battle_sound(stack->getCreature(), killed));
|
|
|
|
- myAnim->playOnce(getMyAnimType());
|
|
|
|
- myAnim->onAnimationReset += [&](){ delete this; };
|
|
|
|
- return true;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-DeathAnimation::DeathAnimation(BattleInterface & owner, const CStack * stack, bool ranged):
|
|
|
|
- BattleStackAnimation(owner, stack),
|
|
|
|
- rangedAttack(ranged)
|
|
|
|
-{
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-DeathAnimation::~DeathAnimation()
|
|
|
|
-{
|
|
|
|
- if(rangedAttack && myAnim->framesInGroup(ECreatureAnimType::DEAD_RANGED) > 0)
|
|
|
|
- myAnim->setType(ECreatureAnimType::DEAD_RANGED);
|
|
|
|
|
|
+ if(ranged && myAnim->framesInGroup(ECreatureAnimType::DEAD_RANGED) > 0)
|
|
|
|
+ setNextGroup(ECreatureAnimType::DEAD_RANGED);
|
|
else
|
|
else
|
|
- myAnim->setType(ECreatureAnimType::DEAD);
|
|
|
|
|
|
+ setNextGroup(ECreatureAnimType::DEAD);
|
|
}
|
|
}
|
|
|
|
|
|
DummyAnimation::DummyAnimation(BattleInterface & owner, int howManyFrames)
|
|
DummyAnimation::DummyAnimation(BattleInterface & owner, int howManyFrames)
|
|
@@ -223,7 +226,7 @@ void DummyAnimation::nextFrame()
|
|
delete this;
|
|
delete this;
|
|
}
|
|
}
|
|
|
|
|
|
-ECreatureAnimType::Type MeleeAttackAnimation::getUpwardsGroup() const
|
|
|
|
|
|
+ECreatureAnimType::Type MeleeAttackAnimation::getUpwardsGroup(bool multiAttack) const
|
|
{
|
|
{
|
|
if (!multiAttack)
|
|
if (!multiAttack)
|
|
return ECreatureAnimType::ATTACK_UP;
|
|
return ECreatureAnimType::ATTACK_UP;
|
|
@@ -235,7 +238,7 @@ ECreatureAnimType::Type MeleeAttackAnimation::getUpwardsGroup() const
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-ECreatureAnimType::Type MeleeAttackAnimation::getForwardGroup() const
|
|
|
|
|
|
+ECreatureAnimType::Type MeleeAttackAnimation::getForwardGroup(bool multiAttack) const
|
|
{
|
|
{
|
|
if (!multiAttack)
|
|
if (!multiAttack)
|
|
return ECreatureAnimType::ATTACK_FRONT;
|
|
return ECreatureAnimType::ATTACK_FRONT;
|
|
@@ -247,7 +250,7 @@ ECreatureAnimType::Type MeleeAttackAnimation::getForwardGroup() const
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-ECreatureAnimType::Type MeleeAttackAnimation::getDownwardsGroup() const
|
|
|
|
|
|
+ECreatureAnimType::Type MeleeAttackAnimation::getDownwardsGroup(bool multiAttack) const
|
|
{
|
|
{
|
|
if (!multiAttack)
|
|
if (!multiAttack)
|
|
return ECreatureAnimType::ATTACK_DOWN;
|
|
return ECreatureAnimType::ATTACK_DOWN;
|
|
@@ -259,27 +262,16 @@ ECreatureAnimType::Type MeleeAttackAnimation::getDownwardsGroup() const
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-bool MeleeAttackAnimation::init()
|
|
|
|
|
|
+ECreatureAnimType::Type MeleeAttackAnimation::selectGroup(bool multiAttack)
|
|
{
|
|
{
|
|
- assert(attackingStack);
|
|
|
|
- assert(!myAnim->isDeadOrDying());
|
|
|
|
-
|
|
|
|
- if(!attackingStack || myAnim->isDeadOrDying())
|
|
|
|
- {
|
|
|
|
- delete this;
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- logAnim->info("CMeleeAttackAnimation::init: stack %s -> stack %s", stack->getName(), defendingStack->getName());
|
|
|
|
-
|
|
|
|
const ECreatureAnimType::Type mutPosToGroup[] =
|
|
const ECreatureAnimType::Type mutPosToGroup[] =
|
|
{
|
|
{
|
|
- getUpwardsGroup(),
|
|
|
|
- getUpwardsGroup(),
|
|
|
|
- getForwardGroup(),
|
|
|
|
- getDownwardsGroup(),
|
|
|
|
- getDownwardsGroup(),
|
|
|
|
- getForwardGroup()
|
|
|
|
|
|
+ getUpwardsGroup (multiAttack),
|
|
|
|
+ getUpwardsGroup (multiAttack),
|
|
|
|
+ getForwardGroup (multiAttack),
|
|
|
|
+ getDownwardsGroup(multiAttack),
|
|
|
|
+ getDownwardsGroup(multiAttack),
|
|
|
|
+ getForwardGroup (multiAttack)
|
|
};
|
|
};
|
|
|
|
|
|
int revShiftattacker = (attackingStack->side == BattleSide::ATTACKER ? -1 : 1);
|
|
int revShiftattacker = (attackingStack->side == BattleSide::ATTACKER ? -1 : 1);
|
|
@@ -300,14 +292,13 @@ bool MeleeAttackAnimation::init()
|
|
|
|
|
|
assert(mutPos >= 0 && mutPos <=5);
|
|
assert(mutPos >= 0 && mutPos <=5);
|
|
|
|
|
|
- group = mutPosToGroup[mutPos];
|
|
|
|
- return true;
|
|
|
|
|
|
+ return mutPosToGroup[mutPos];
|
|
}
|
|
}
|
|
|
|
|
|
void MeleeAttackAnimation::nextFrame()
|
|
void MeleeAttackAnimation::nextFrame()
|
|
{
|
|
{
|
|
size_t currentFrame = stackAnimation(attackingStack)->getCurrentFrame();
|
|
size_t currentFrame = stackAnimation(attackingStack)->getCurrentFrame();
|
|
- size_t totalFrames = stackAnimation(attackingStack)->framesInGroup(group);
|
|
|
|
|
|
+ size_t totalFrames = stackAnimation(attackingStack)->framesInGroup(getGroup());
|
|
|
|
|
|
if ( currentFrame * 2 >= totalFrames )
|
|
if ( currentFrame * 2 >= totalFrames )
|
|
{
|
|
{
|
|
@@ -317,23 +308,18 @@ void MeleeAttackAnimation::nextFrame()
|
|
AttackAnimation::nextFrame();
|
|
AttackAnimation::nextFrame();
|
|
}
|
|
}
|
|
|
|
|
|
-void MeleeAttackAnimation::playSound()
|
|
|
|
-{
|
|
|
|
- CCS->soundh->playSound(battle_sound(getCreature(), attack));
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
MeleeAttackAnimation::MeleeAttackAnimation(BattleInterface & owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked, bool multiAttack)
|
|
MeleeAttackAnimation::MeleeAttackAnimation(BattleInterface & owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked, bool multiAttack)
|
|
- : AttackAnimation(owner, attacker, _dest, _attacked),
|
|
|
|
- multiAttack(multiAttack)
|
|
|
|
|
|
+ : AttackAnimation(owner, attacker, _dest, _attacked)
|
|
{
|
|
{
|
|
logAnim->debug("Created melee attack anim for %s", attacker->getName());
|
|
logAnim->debug("Created melee attack anim for %s", attacker->getName());
|
|
|
|
+ setSound(battle_sound(getCreature(), attack));
|
|
|
|
+ setGroup(selectGroup(multiAttack));
|
|
}
|
|
}
|
|
|
|
|
|
StackMoveAnimation::StackMoveAnimation(BattleInterface & owner, const CStack * _stack, BattleHex _currentHex):
|
|
StackMoveAnimation::StackMoveAnimation(BattleInterface & owner, const CStack * _stack, BattleHex _currentHex):
|
|
BattleStackAnimation(owner, _stack),
|
|
BattleStackAnimation(owner, _stack),
|
|
currentHex(_currentHex)
|
|
currentHex(_currentHex)
|
|
{
|
|
{
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
bool MovementAnimation::init()
|
|
bool MovementAnimation::init()
|
|
@@ -585,32 +571,10 @@ void ReverseAnimation::setupSecondPart()
|
|
delete this;
|
|
delete this;
|
|
}
|
|
}
|
|
|
|
|
|
-bool ResurrectionAnimation::init()
|
|
|
|
-{
|
|
|
|
- assert(stack);
|
|
|
|
-
|
|
|
|
- if(!stack)
|
|
|
|
- {
|
|
|
|
- delete this;
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- logAnim->info("CResurrectionAnimation::init: stack %s", stack->getName());
|
|
|
|
- myAnim->playOnce(ECreatureAnimType::RESURRECTION);
|
|
|
|
- myAnim->onAnimationReset += [&](){ delete this; };
|
|
|
|
-
|
|
|
|
- return true;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
ResurrectionAnimation::ResurrectionAnimation(BattleInterface & owner, const CStack * _stack):
|
|
ResurrectionAnimation::ResurrectionAnimation(BattleInterface & owner, const CStack * _stack):
|
|
- BattleStackAnimation(owner, _stack)
|
|
|
|
|
|
+ StackActionAnimation(owner, _stack)
|
|
{
|
|
{
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-bool ColorTransformAnimation::init()
|
|
|
|
-{
|
|
|
|
- return true;
|
|
|
|
|
|
+ setGroup(ECreatureAnimType::RESURRECTION);
|
|
}
|
|
}
|
|
|
|
|
|
void ColorTransformAnimation::nextFrame()
|
|
void ColorTransformAnimation::nextFrame()
|
|
@@ -651,7 +615,7 @@ void ColorTransformAnimation::nextFrame()
|
|
}
|
|
}
|
|
|
|
|
|
ColorTransformAnimation::ColorTransformAnimation(BattleInterface & owner, const CStack * _stack, const CSpell * spell):
|
|
ColorTransformAnimation::ColorTransformAnimation(BattleInterface & owner, const CStack * _stack, const CSpell * spell):
|
|
- BattleStackAnimation(owner, _stack),
|
|
|
|
|
|
+ StackActionAnimation(owner, _stack),
|
|
spell(spell),
|
|
spell(spell),
|
|
totalProgress(0.f)
|
|
totalProgress(0.f)
|
|
{
|
|
{
|
|
@@ -716,31 +680,15 @@ RangedAttackAnimation::RangedAttackAnimation(BattleInterface & owner_, const CSt
|
|
: AttackAnimation(owner_, attacker, dest_, defender),
|
|
: AttackAnimation(owner_, attacker, dest_, defender),
|
|
projectileEmitted(false)
|
|
projectileEmitted(false)
|
|
{
|
|
{
|
|
-}
|
|
|
|
-
|
|
|
|
-void RangedAttackAnimation::playSound()
|
|
|
|
-{
|
|
|
|
- CCS->soundh->playSound(battle_sound(getCreature(), shoot));
|
|
|
|
|
|
+ setSound(battle_sound(getCreature(), shoot));
|
|
}
|
|
}
|
|
|
|
|
|
bool RangedAttackAnimation::init()
|
|
bool RangedAttackAnimation::init()
|
|
{
|
|
{
|
|
- assert(attackingStack);
|
|
|
|
- assert(!myAnim->isDeadOrDying());
|
|
|
|
-
|
|
|
|
- if(!attackingStack || myAnim->isDeadOrDying())
|
|
|
|
- {
|
|
|
|
- //FIXME: how is this possible?
|
|
|
|
- logAnim->warn("Shooting animation has not started yet but attacker is dead! Aborting...");
|
|
|
|
- delete this;
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- logAnim->info("CRangedAttackAnimation::init: stack %s", stack->getName());
|
|
|
|
-
|
|
|
|
setAnimationGroup();
|
|
setAnimationGroup();
|
|
initializeProjectile();
|
|
initializeProjectile();
|
|
- return true;
|
|
|
|
|
|
+
|
|
|
|
+ return AttackAnimation::init();
|
|
}
|
|
}
|
|
|
|
|
|
void RangedAttackAnimation::setAnimationGroup()
|
|
void RangedAttackAnimation::setAnimationGroup()
|
|
@@ -755,11 +703,11 @@ void RangedAttackAnimation::setAnimationGroup()
|
|
|
|
|
|
// Calculate projectile start position. Offsets are read out of the CRANIM.TXT.
|
|
// Calculate projectile start position. Offsets are read out of the CRANIM.TXT.
|
|
if (projectileAngle > straightAngle)
|
|
if (projectileAngle > straightAngle)
|
|
- group = getUpwardsGroup();
|
|
|
|
|
|
+ setGroup(getUpwardsGroup());
|
|
else if (projectileAngle < -straightAngle)
|
|
else if (projectileAngle < -straightAngle)
|
|
- group = getDownwardsGroup();
|
|
|
|
|
|
+ setGroup(getDownwardsGroup());
|
|
else
|
|
else
|
|
- group = getForwardGroup();
|
|
|
|
|
|
+ setGroup(getForwardGroup());
|
|
}
|
|
}
|
|
|
|
|
|
void RangedAttackAnimation::initializeProjectile()
|
|
void RangedAttackAnimation::initializeProjectile()
|
|
@@ -769,17 +717,17 @@ void RangedAttackAnimation::initializeProjectile()
|
|
Point shotOrigin = stackAnimation(attackingStack)->pos.topLeft() + Point(222, 265);
|
|
Point shotOrigin = stackAnimation(attackingStack)->pos.topLeft() + Point(222, 265);
|
|
int multiplier = stackFacingRight(attackingStack) ? 1 : -1;
|
|
int multiplier = stackFacingRight(attackingStack) ? 1 : -1;
|
|
|
|
|
|
- if (group == getUpwardsGroup())
|
|
|
|
|
|
+ if (getGroup() == getUpwardsGroup())
|
|
{
|
|
{
|
|
shotOrigin.x += ( -25 + shooterInfo->animation.upperRightMissleOffsetX ) * multiplier;
|
|
shotOrigin.x += ( -25 + shooterInfo->animation.upperRightMissleOffsetX ) * multiplier;
|
|
shotOrigin.y += shooterInfo->animation.upperRightMissleOffsetY;
|
|
shotOrigin.y += shooterInfo->animation.upperRightMissleOffsetY;
|
|
}
|
|
}
|
|
- else if (group == getDownwardsGroup())
|
|
|
|
|
|
+ else if (getGroup() == getDownwardsGroup())
|
|
{
|
|
{
|
|
shotOrigin.x += ( -25 + shooterInfo->animation.lowerRightMissleOffsetX ) * multiplier;
|
|
shotOrigin.x += ( -25 + shooterInfo->animation.lowerRightMissleOffsetX ) * multiplier;
|
|
shotOrigin.y += shooterInfo->animation.lowerRightMissleOffsetY;
|
|
shotOrigin.y += shooterInfo->animation.lowerRightMissleOffsetY;
|
|
}
|
|
}
|
|
- else if (group == getForwardGroup())
|
|
|
|
|
|
+ else if (getGroup() == getForwardGroup())
|
|
{
|
|
{
|
|
shotOrigin.x += ( -25 + shooterInfo->animation.rightMissleOffsetX ) * multiplier;
|
|
shotOrigin.x += ( -25 + shooterInfo->animation.rightMissleOffsetX ) * multiplier;
|
|
shotOrigin.y += shooterInfo->animation.rightMissleOffsetY;
|
|
shotOrigin.y += shooterInfo->animation.rightMissleOffsetY;
|
|
@@ -953,11 +901,9 @@ void CastAnimation::createProjectile(const Point & from, const Point & dest) con
|
|
uint32_t CastAnimation::getAttackClimaxFrame() const
|
|
uint32_t CastAnimation::getAttackClimaxFrame() const
|
|
{
|
|
{
|
|
//TODO: allow defining this parameter in config file, separately from attackClimaxFrame of missile attacks
|
|
//TODO: allow defining this parameter in config file, separately from attackClimaxFrame of missile attacks
|
|
- uint32_t maxFrames = stackAnimation(attackingStack)->framesInGroup(group);
|
|
|
|
|
|
+ uint32_t maxFrames = stackAnimation(attackingStack)->framesInGroup(getGroup());
|
|
|
|
|
|
- if (maxFrames > 2)
|
|
|
|
- return maxFrames - 2;
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return maxFrames / 2;
|
|
}
|
|
}
|
|
|
|
|
|
PointEffectAnimation::PointEffectAnimation(BattleInterface & owner, std::string soundName, std::string animationName, int effects):
|
|
PointEffectAnimation::PointEffectAnimation(BattleInterface & owner, std::string soundName, std::string animationName, int effects):
|