3 #include "AttackChoice.h"
5 #include "../common/Ikari.h"
6 #include "../common/Item.h"
7 #include "../common/Spell.h"
8 #include "../math/Vector.h"
21 Hero::Hero(common::Hero &h)
23 , stats(h.GetStats()) {
32 void Hero::UpdateSpellMenu() {
34 SpellMenu().Reserve(Spells().size());
35 for (vector<const Spell *>::const_iterator i(Spells().begin()), end(Spells().end()); i != end; ++i) {
36 bool enabled((*i)->CanUseInBattle() && (*i)->Cost() <= Mana());
37 SpellMenu().Add((*i)->Name(), *i, enabled, 0, (*i)->Cost());
41 void Hero::UpdateIkariMenu(const Resources *res) {
43 IkariMenu().Reserve(6);
49 Weapon()->HasIkari() && Weapon()->GetIkari()->Cost() <= IP(),
52 Weapon()->HasIkari() ? Weapon()->GetIkari()->Name() : "");
54 IkariMenu().Add(res->noEquipmentText, 0, false, res->weaponMenuIcon);
61 Armor()->HasIkari() && Armor()->GetIkari()->Cost() <= IP(),
64 Armor()->HasIkari() ? Armor()->GetIkari()->Name() : "");
66 IkariMenu().Add(res->noEquipmentText, 0, false, res->armorMenuIcon);
73 Shield()->HasIkari() && Shield()->GetIkari()->Cost() <= IP(),
76 Shield()->HasIkari() ? Shield()->GetIkari()->Name() : "");
78 IkariMenu().Add(res->noEquipmentText, 0, false, res->shieldMenuIcon);
85 Helmet()->HasIkari() && Helmet()->GetIkari()->Cost() <= IP(),
88 Helmet()->HasIkari() ? Helmet()->GetIkari()->Name() : "");
90 IkariMenu().Add(res->noEquipmentText, 0, false, res->helmetMenuIcon);
97 Ring()->HasIkari() && Ring()->GetIkari()->Cost() <= IP(),
100 Ring()->HasIkari() ? Ring()->GetIkari()->Name() : "");
102 IkariMenu().Add(res->noEquipmentText, 0, false, res->ringMenuIcon);
109 Jewel()->HasIkari() && Jewel()->GetIkari()->Cost() <= IP(),
112 Jewel()->HasIkari() ? Jewel()->GetIkari()->Name() : "");
114 IkariMenu().Add(res->noEquipmentText, 0, false, res->jewelMenuIcon);