X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FSpell.cpp;h=4fce22f1e42ea3e15992b969a952c8296cd9ee60;hb=95bbd3d0b18007bf8614b1bf16042949b12fc641;hp=f347774317cfae7e70050df334b2c3a369a9f87d;hpb=d872d756e64b8f1f57cba64ae19f479f8eab3927;p=l2e.git diff --git a/src/common/Spell.cpp b/src/common/Spell.cpp index f347774..4fce22f 100644 --- a/src/common/Spell.cpp +++ b/src/common/Spell.cpp @@ -7,11 +7,39 @@ #include "Spell.h" +#include "TargetingMode.h" +#include "../loader/Interpreter.h" +#include "../loader/TypeDescription.h" + +using loader::FieldDescription; +using loader::Interpreter; +using loader::TypeDescription; + namespace common { Spell::Spell() -: name(""), value(0), cost(0), usability(0) { +: name(""), value(0), cost(0), status(false), battle(false) { + +} + + +void Spell::CreateTypeDescription() { + Spell s; + + TypeDescription &td(TypeDescription::Create(TYPE_ID, "Spell")); + td.SetDescription("All data about a spell (soon)."); + td.SetConstructor(&Construct); + td.SetSize(sizeof(Spell)); + + td.AddField("name", FieldDescription(((char *)&s.name) - ((char *)&s), Interpreter::STRING_ID).SetReferenced().SetDescription("the spell's name")); + td.AddField("cost", FieldDescription(((char *)&s.cost) - ((char *)&s), Interpreter::NUMBER_ID).SetDescription("Amount of magic points needed and deducted for invocation")); + td.AddField("targets", FieldDescription(((char *)&s.targetingMode) - ((char *)&s), TargetingMode::TYPE_ID).SetDescription("how target selection is to be performed")); + td.AddField("status", FieldDescription(((char *)&s.status) - ((char *)&s), Interpreter::BOOLEAN_ID).SetDescription("if the spell can be used at the status screen")); + td.AddField("battle", FieldDescription(((char *)&s.battle) - ((char *)&s), Interpreter::BOOLEAN_ID).SetDescription("if the spell can be used in battle")); +} +void Spell::Construct(void *data) { + new (data) Spell; } }