-/*
- * BattleState.cpp
- *
- * Created on: Aug 5, 2012
- * Author: holy
- */
-
#include "BattleState.h"
#include "PartyLayout.h"
++numHeroes;
}
+void BattleState::SetCapsule(const Capsule &c) {
+ capsule = c;
+}
+
void BattleState::NextHero() {
++activeHero;
while (activeHero < numHeroes && heroes[activeHero].Health() == 0) {
smallHeroTags[i] = SmallHeroTag(this, i);
}
+ capsule.Position() = heroesLayout->CalculatePosition(4, background->w, background->h);
+
for (int i(0); i < int(monsters.size()); ++i) {
monsters[i].Position() = monstersLayout->CalculatePosition(i, background->w, background->h);
}
}
}
+void BattleState::RenderCapsule(SDL_Surface *screen, const Vector<int> &offset) {
+ if (capsule.Health() <= 0) return;
+ if (capsule.GetAnimation().Running()) {
+ capsule.GetAnimation().DrawCenter(screen, capsule.Position() + offset);
+ } else {
+ capsule.Sprite()->DrawCenter(screen, capsule.Position() + offset);
+ }
+}
+
void BattleState::RenderHeroTags(SDL_Surface *screen, const Vector<int> &offset) {
assert(screen);
int tagHeight(attackTypeMenu.Height());