4 * Created on: Aug 10, 2012
10 #include "../loader/TypeDescription.h"
12 using loader::FieldDescription;
13 using loader::TypeDescription;
18 : name(""), value(0), cost(0), status(false), battle(false) {
23 void Spell::CreateTypeDescription() {
26 int boolId(TypeDescription::GetTypeId("Boolean"));
27 int numberId(TypeDescription::GetTypeId("Number"));
28 int stringId(TypeDescription::GetTypeId("String"));
29 int targetsId(TypeDescription::GetTypeId("TargetingMode"));
31 TypeDescription &td(TypeDescription::CreateOrGet("Spell"));
32 td.SetDescription("All data about a spell (soon).");
33 td.SetConstructor(&Construct);
34 td.SetSize(sizeof(Spell));
36 td.AddField("name", FieldDescription(((char *)&s.name) - ((char *)&s), stringId).SetReferenced().SetDescription("the spell's name"));
37 td.AddField("cost", FieldDescription(((char *)&s.cost) - ((char *)&s), numberId).SetDescription("Amount of magic points needed and deducted for invocation"));
38 td.AddField("targets", FieldDescription(((char *)&s.targetingMode) - ((char *)&s), targetsId).SetDescription("how target selection is to be performed"));
39 td.AddField("status", FieldDescription(((char *)&s.status) - ((char *)&s), boolId).SetDescription("if the spell can be used at the status screen"));
40 td.AddField("battle", FieldDescription(((char *)&s.battle) - ((char *)&s), boolId).SetDescription("if the spell can be used in battle"));
43 void Spell::Construct(void *data) {