X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FBattleState.h;h=3561609e91c105a34413a8b29d042d7d1a0c50ce;hb=5121f4215d725f492bea084fb94900d7e5972743;hp=a10ff7e8fae2b6947dd651c4a403c9b33c57e76d;hpb=d2f44bfe5d159647431cee8ab29898bd3618d980;p=l2e.git diff --git a/src/battle/BattleState.h b/src/battle/BattleState.h index a10ff7e..3561609 100644 --- a/src/battle/BattleState.h +++ b/src/battle/BattleState.h @@ -8,7 +8,6 @@ #ifndef BATTLE_BATTLESTATE_H_ #define BATTLE_BATTLESTATE_H_ -#include "AttackChoice.h" #include "AttackTypeMenu.h" #include "Hero.h" #include "HeroTag.h" @@ -41,6 +40,7 @@ namespace graphics { namespace battle { +class AttackChoice; class PartyLayout; class Stats; @@ -58,6 +58,8 @@ public: , numHeroes(0) , activeHero(-1) , attackCursor(-1) + , expReward(0) + , goldReward(0) , ranAway(false) { assert(background && res); } public: @@ -82,10 +84,10 @@ public: AttackTypeMenu &GetAttackTypeMenu() { return attackTypeMenu; } MoveMenu &GetMoveMenu() { return moveMenu; } - graphics::Menu &GetSpellMenu() { return spellMenus[activeHero]; } - const graphics::Menu &GetSpellMenu() const { return spellMenus[activeHero]; } - graphics::Menu &GetIkariMenu() { return ikariMenus[activeHero]; } - const graphics::Menu &GetIkariMenu() const { return ikariMenus[activeHero]; } + graphics::Menu &GetSpellMenu() { return heroes[activeHero].SpellMenu(); } + const graphics::Menu &GetSpellMenu() const { return heroes[activeHero].SpellMenu(); } + graphics::Menu &GetIkariMenu() { return heroes[activeHero].IkariMenu(); } + const graphics::Menu &GetIkariMenu() const { return heroes[activeHero].IkariMenu(); } graphics::Menu &GetItemMenu() { return itemMenu; } const graphics::Menu &GetItemMenu() const { return itemMenu; } @@ -107,8 +109,8 @@ public: bool HasChosenAttackType() const { return ActiveHeroAttackChoice().GetType() != AttackChoice::UNDECIDED; } AttackChoice &ActiveHeroAttackChoice() { return AttackChoiceAt(activeHero); } const AttackChoice &ActiveHeroAttackChoice() const { return AttackChoiceAt(activeHero); } - AttackChoice &AttackChoiceAt(int index) { assert(index >= 0 && index < NumHeroes()); return attackChoices[index]; } - const AttackChoice &AttackChoiceAt(int index) const { assert(index >= 0 && index < NumHeroes()); return attackChoices[index]; } + AttackChoice &AttackChoiceAt(int index) { assert(index >= 0 && index < NumHeroes()); return heroes[index].GetAttackChoice(); } + const AttackChoice &AttackChoiceAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroes[index].GetAttackChoice(); } AttackChoice &MonsterAttackChoiceAt(int index) { assert(index >= 0 && index < MaxMonsters()); return monsterAttacks[index]; } const AttackChoice &MonsterAttackChoiceAt(int index) const { assert(index >= 0 && index < MaxMonsters()); return monsterAttacks[index]; } bool AttackSelectionDone() const { return activeHero >= numHeroes; } @@ -159,8 +161,6 @@ public: void RenderSmallHeroTags(SDL_Surface *screen, const geometry::Vector &offset); private: - void LoadSpellMenu(std::vector::size_type heroIndex); - void LoadIkariMenu(std::vector::size_type heroIndex); void LoadInventory(); Uint16 CalculateDamage(const Stats &attacker, const Stats &defender) const; @@ -179,17 +179,16 @@ private: std::vector monsterAttacks; std::vector attackOrder; Hero heroes[4]; - graphics::Menu spellMenus[4]; graphics::Menu itemMenu; - graphics::Menu ikariMenus[4]; HeroTag heroTags[4]; SmallHeroTag smallHeroTags[4]; geometry::Point heroTagPositions[4]; geometry::Point smallHeroTagPositions[4]; - AttackChoice attackChoices[4]; int numHeroes; int activeHero; int attackCursor; + int expReward; + int goldReward; bool ranAway; };