+
+ if (HasHelmet()) {
+ IkariMenu().Add(
+ Helmet()->Name(),
+ Helmet(),
+ Helmet()->HasIkari() && Helmet()->GetIkari()->Cost() <= IP(),
+ res->helmetMenuIcon,
+ 0,
+ Helmet()->HasIkari() ? Helmet()->GetIkari()->Name() : "");
+ } else {
+ IkariMenu().Add(res->noEquipmentText, 0, false, res->helmetMenuIcon);
+ }
+
+ if (HasRing()) {
+ IkariMenu().Add(
+ Ring()->Name(),
+ Ring(),
+ Ring()->HasIkari() && Ring()->GetIkari()->Cost() <= IP(),
+ res->ringMenuIcon,
+ 0,
+ Ring()->HasIkari() ? Ring()->GetIkari()->Name() : "");
+ } else {
+ IkariMenu().Add(res->noEquipmentText, 0, false, res->ringMenuIcon);
+ }
+
+ if (HasJewel()) {
+ IkariMenu().Add(
+ Jewel()->Name(),
+ Jewel(),
+ Jewel()->HasIkari() && Jewel()->GetIkari()->Cost() <= IP(),
+ res->jewelMenuIcon,
+ 0,
+ Jewel()->HasIkari() ? Jewel()->GetIkari()->Name() : "");
+ } else {
+ IkariMenu().Add(res->noEquipmentText, 0, false, res->jewelMenuIcon);
+ }
+}
+
+
+void Hero::CreateTypeDescription() {
+ Hero h;
+ TypeDescription &td(TypeDescription::CreateOrGet("Hero"));
+
+ td.SetSize(sizeof(Hero));
+
+ int animationId(TypeDescription::GetTypeId("Animation"));
+ int numberId(TypeDescription::GetTypeId("Number"));
+ int spriteId(TypeDescription::GetTypeId("Sprite"));
+ int statsId(TypeDescription::GetTypeId("Stats"));
+ int stringId(TypeDescription::GetTypeId("String"));
+
+ td.AddField("name", FieldDescription(((char *)&h.name) - ((char *)&h), stringId, true));
+ td.AddField("sprite", FieldDescription(((char *)&h.sprite) - ((char *)&h), spriteId, true));
+ td.AddField("level", FieldDescription(((char *)&h.level) - ((char *)&h), numberId, false));
+
+ td.AddField("maxHealth", FieldDescription(((char *)&h.maxHealth) - ((char *)&h), numberId, false));
+ td.AddField("health", FieldDescription(((char *)&h.health) - ((char *)&h), numberId, false));
+ td.AddField("maxMana", FieldDescription(((char *)&h.maxMana) - ((char *)&h), numberId, false));
+ td.AddField("mana", FieldDescription(((char *)&h.mana) - ((char *)&h), numberId, false));
+ td.AddField("ip", FieldDescription(((char *)&h.ip) - ((char *)&h), numberId, false));
+ td.AddField("stats", FieldDescription(((char *)&h.stats) - ((char *)&h), statsId, false));
+
+ td.AddField("attackAnimation", FieldDescription(((char *)&h.attackAnimation) - ((char *)&h), animationId, true));
+ td.AddField("spellAnimation", FieldDescription(((char *)&h.spellAnimation) - ((char *)&h), animationId, true));
+ td.AddField("meleeAnimation", FieldDescription(((char *)&h.meleeAnimation) - ((char *)&h), animationId, true));