3 #include "AttackChoice.h"
5 #include "../common/Ikari.h"
6 #include "../common/Item.h"
7 #include "../common/Spell.h"
20 Hero::Hero(common::Hero &h)
22 , stats(h.GetStats()) {
31 void Hero::UpdateSpellMenu() {
33 SpellMenu().Reserve(Spells().size());
34 for (vector<const Spell *>::const_iterator i(Spells().begin()), end(Spells().end()); i != end; ++i) {
35 bool enabled((*i)->CanUseInBattle() && (*i)->Cost() <= Mana());
36 SpellMenu().Add((*i)->Name(), *i, enabled, 0, (*i)->Cost());
40 void Hero::UpdateIkariMenu(const Resources *res) {
42 IkariMenu().Reserve(6);
48 Weapon()->HasIkari() && Weapon()->GetIkari()->Cost() <= IP(),
51 Weapon()->HasIkari() ? Weapon()->GetIkari()->Name() : "");
53 IkariMenu().Add(res->noEquipmentText, 0, false, res->weaponMenuIcon);
60 Armor()->HasIkari() && Armor()->GetIkari()->Cost() <= IP(),
63 Armor()->HasIkari() ? Armor()->GetIkari()->Name() : "");
65 IkariMenu().Add(res->noEquipmentText, 0, false, res->armorMenuIcon);
72 Shield()->HasIkari() && Shield()->GetIkari()->Cost() <= IP(),
75 Shield()->HasIkari() ? Shield()->GetIkari()->Name() : "");
77 IkariMenu().Add(res->noEquipmentText, 0, false, res->shieldMenuIcon);
84 Helmet()->HasIkari() && Helmet()->GetIkari()->Cost() <= IP(),
87 Helmet()->HasIkari() ? Helmet()->GetIkari()->Name() : "");
89 IkariMenu().Add(res->noEquipmentText, 0, false, res->helmetMenuIcon);
96 Ring()->HasIkari() && Ring()->GetIkari()->Cost() <= IP(),
99 Ring()->HasIkari() ? Ring()->GetIkari()->Name() : "");
101 IkariMenu().Add(res->noEquipmentText, 0, false, res->ringMenuIcon);
108 Jewel()->HasIkari() && Jewel()->GetIkari()->Cost() <= IP(),
111 Jewel()->HasIkari() ? Jewel()->GetIkari()->Name() : "");
113 IkariMenu().Add(res->noEquipmentText, 0, false, res->jewelMenuIcon);