void BattleState::RenderMonsters(SDL_Surface *screen, const Vector<int> &offset) {
for (vector<Monster>::size_type i(0), end(monsters.size()); i < end; ++i) {
if (MonsterPositionOccupied(i)) {
- monsters[i].Sprite()->DrawCenter(screen, monsterPositions[i] + offset);
+ // TODO: better solution for running animations
+ if (monsters[i].AttackAnimation() && monsters[i].AttackAnimation()->Running()) {
+ monsters[i].AttackAnimation()->DrawCenter(screen, monsterPositions[i] + offset);
+ } else if (monsters[i].SpellAnimation() && monsters[i].SpellAnimation()->Running()) {
+ monsters[i].SpellAnimation()->DrawCenter(screen, monsterPositions[i] + offset);
+ } else {
+ monsters[i].Sprite()->DrawCenter(screen, monsterPositions[i] + offset);
+ }
}
}
}
battle->CalculateDamage();
if (battle->CurrentAttack().isMonster) {
- const Monster &monster(battle->MonsterAt(battle->CurrentAttack().index));
+ Monster &monster(battle->MonsterAt(battle->CurrentAttack().index));
titleBarText = monster.Name();
- moveAnimation = 0;
+ moveAnimation = monster.AttackAnimation();
} else {
Hero &hero(battle->HeroAt(battle->CurrentAttack().index));
const AttackChoice &ac(battle->AttackChoiceAt(battle->CurrentAttack().index));