X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FSpell.cpp;h=1b4142b006822f7fb8dd8023d773084eb64b6a25;hb=1338442a6db3a706d09622188aad1cdfe183a70b;hp=4fce22f1e42ea3e15992b969a952c8296cd9ee60;hpb=1907ca03c5e865c4d398170042aa384c67ffff29;p=l2e.git diff --git a/src/common/Spell.cpp b/src/common/Spell.cpp index 4fce22f..1b4142b 100644 --- a/src/common/Spell.cpp +++ b/src/common/Spell.cpp @@ -18,11 +18,22 @@ using loader::TypeDescription; namespace common { Spell::Spell() -: name(""), value(0), cost(0), status(false), battle(false) { +: name("") +, value(0) +, cost(0) +, heroMask(0) +, status(false) +, battle(false) { } +bool Spell::Less(const Spell *lhs, const Spell *rhs) { + // TODO: find out real spell sorting order + return lhs->Cost() < rhs->Cost(); +} + + void Spell::CreateTypeDescription() { Spell s; @@ -32,8 +43,9 @@ void Spell::CreateTypeDescription() { 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("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("heroMask", FieldDescription(((char *)&s.heroMask) - ((char *)&s), Interpreter::NUMBER_ID).SetDescription("which heroes can invoke this spell")); 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")); }