X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHero.cpp;h=fdf8125872c1df23a57c3f8187837d96da125d2f;hb=46d158b25b842d2ec4b9734af09ca6006c934498;hp=17ec08a2bbc8316abd84fadb827d02f087d80745;hpb=5121f4215d725f492bea084fb94900d7e5972743;p=l2e.git diff --git a/src/battle/Hero.cpp b/src/battle/Hero.cpp index 17ec08a..fdf8125 100644 --- a/src/battle/Hero.cpp +++ b/src/battle/Hero.cpp @@ -12,9 +12,12 @@ #include "../common/Ikari.h" #include "../common/Item.h" #include "../common/Spell.h" +#include "../loader/TypeDescription.h" using common::Ikari; using common::Spell; +using loader::FieldDescription; +using loader::TypeDescription; using std::vector; namespace battle { @@ -150,4 +153,33 @@ void Hero::UpdateIkariMenu(const Resources *res) { } } + +void Hero::CreateTypeDescription() { + Hero h; + + 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")); + + TypeDescription &td(TypeDescription::CreateOrGet("Hero")); + td.SetSize(sizeof(Hero)); + + 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)); +} + }