X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FMonster.cpp;h=dd653383a5151132777e1f6ef6ddb6fb568e680f;hb=46d158b25b842d2ec4b9734af09ca6006c934498;hp=033614231ff0cea9ffec691b5c0dfcf307822901;hpb=fbf5a98f8fd0da951e469003fe87d575a6bb30a4;p=l2e.git diff --git a/src/battle/Monster.cpp b/src/battle/Monster.cpp index 0336142..dd65338 100644 --- a/src/battle/Monster.cpp +++ b/src/battle/Monster.cpp @@ -7,6 +7,11 @@ #include "Monster.h" +#include "../loader/TypeDescription.h" + +using loader::FieldDescription; +using loader::TypeDescription; + namespace battle { Monster::Monster() @@ -16,18 +21,15 @@ Monster::Monster() , attackScript(0) , defenseScript(0) +, meleeAnimation(0) +, attackAnimation(0) +, spellAnimation(0) + , maxHealth(0) , health(0) , maxMana(0) , mana(0) -, attack(0) -, defense(0) -, agility(0) -, intelligence(0) -, gut(0) -, magicResistance(0) - , expReward(0) , goldReward(0) @@ -49,4 +51,32 @@ void Monster::SubtractHealth(int amount) { } } + +void Monster::CreateTypeDescription() { + Monster m; + + 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("Monster")); + td.SetSize(sizeof(Monster)); + + td.AddField("name", FieldDescription(((char *)&m.name) - ((char *)&m), stringId, true)); + td.AddField("sprite", FieldDescription(((char *)&m.sprite) - ((char *)&m), spriteId, true)); + td.AddField("level", FieldDescription(((char *)&m.level) - ((char *)&m), numberId, false)); + + td.AddField("maxHealth", FieldDescription(((char *)&m.maxHealth) - ((char *)&m), numberId, false)); + td.AddField("health", FieldDescription(((char *)&m.health) - ((char *)&m), numberId, false)); + td.AddField("maxMana", FieldDescription(((char *)&m.maxMana) - ((char *)&m), numberId, false)); + td.AddField("mana", FieldDescription(((char *)&m.mana) - ((char *)&m), numberId, false)); + td.AddField("stats", FieldDescription(((char *)&m.stats) - ((char *)&m), statsId, false)); + + td.AddField("attackAnimation", FieldDescription(((char *)&m.attackAnimation) - ((char *)&m), animationId, true)); + td.AddField("spellAnimation", FieldDescription(((char *)&m.spellAnimation) - ((char *)&m), animationId, true)); + td.AddField("meleeAnimation", FieldDescription(((char *)&m.meleeAnimation) - ((char *)&m), animationId, true)); +} + }