4 * Created on: Aug 6, 2012
10 #include "AttackChoice.h"
11 #include "Resources.h"
12 #include "../common/Ikari.h"
13 #include "../common/Item.h"
14 #include "../common/Spell.h"
27 Hero::Hero(common::Hero &h)
29 , stats(h.GetStats()) {
38 void Hero::UpdateSpellMenu() {
40 SpellMenu().Reserve(Spells().size());
41 for (vector<const Spell *>::const_iterator i(Spells().begin()), end(Spells().end()); i != end; ++i) {
42 bool enabled((*i)->CanUseInBattle() && (*i)->Cost() <= Mana());
43 SpellMenu().Add((*i)->Name(), *i, enabled, 0, (*i)->Cost());
47 void Hero::UpdateIkariMenu(const Resources *res) {
49 IkariMenu().Reserve(6);
55 Weapon()->HasIkari() && Weapon()->GetIkari()->Cost() <= IP(),
58 Weapon()->HasIkari() ? Weapon()->GetIkari()->Name() : "");
60 IkariMenu().Add(res->noEquipmentText, 0, false, res->weaponMenuIcon);
67 Armor()->HasIkari() && Armor()->GetIkari()->Cost() <= IP(),
70 Armor()->HasIkari() ? Armor()->GetIkari()->Name() : "");
72 IkariMenu().Add(res->noEquipmentText, 0, false, res->armorMenuIcon);
79 Shield()->HasIkari() && Shield()->GetIkari()->Cost() <= IP(),
82 Shield()->HasIkari() ? Shield()->GetIkari()->Name() : "");
84 IkariMenu().Add(res->noEquipmentText, 0, false, res->shieldMenuIcon);
91 Helmet()->HasIkari() && Helmet()->GetIkari()->Cost() <= IP(),
94 Helmet()->HasIkari() ? Helmet()->GetIkari()->Name() : "");
96 IkariMenu().Add(res->noEquipmentText, 0, false, res->helmetMenuIcon);
103 Ring()->HasIkari() && Ring()->GetIkari()->Cost() <= IP(),
106 Ring()->HasIkari() ? Ring()->GetIkari()->Name() : "");
108 IkariMenu().Add(res->noEquipmentText, 0, false, res->ringMenuIcon);
115 Jewel()->HasIkari() && Jewel()->GetIkari()->Cost() <= IP(),
118 Jewel()->HasIkari() ? Jewel()->GetIkari()->Name() : "");
120 IkariMenu().Add(res->noEquipmentText, 0, false, res->jewelMenuIcon);