#include "../common/Spell.h"
#include "../graphics/Frame.h"
#include "../graphics/Sprite.h"
+#include "../math/Vector.h"
#include <algorithm>
#include <cassert>
using common::Item;
using common::Spell;
using common::Stats;
-using geometry::Vector;
+using math::Vector;
using graphics::Menu;
using std::rand;
attackOrder.push_back(Order(Order::MONSTER, i));
MonsterAt(i).GetAttackChoice() = AttackChoice(this);
}
- if (capsule.Health() > 0) {
+ if (capsule.Active() && capsule.Health() > 0) {
attackOrder.push_back(Order(Order::CAPSULE));
}
std::sort(attackOrder.begin(), attackOrder.end(), OrderCompare(this));
} else if (attackOrder[attackCursor].IsHero()) {
if (HeroAt(attackOrder[attackCursor].index).Health() > 0) break;
} else {
- if (capsule.Health() > 0) break;
+ if (capsule.Active() && capsule.Health() > 0) break;
}
++attackCursor;
}
}
-void BattleState::UpdateWorld(float deltaT) {
+void BattleState::UpdateWorld(Uint32 deltaT) {
}
}
void BattleState::RenderCapsule(SDL_Surface *screen, const Vector<int> &offset) {
- if (capsule.Health() <= 0) return;
+ if (!capsule.Active() || capsule.Health() <= 0) return;
if (capsule.GetAnimation().Running()) {
capsule.GetAnimation().DrawCenter(screen, capsule.Position() + offset);
} else {