diff --git a/server/gameserver/lispenv.cc b/server/gameserver/lispenv.cc index 0cc329f6..b5fb10bc 100644 --- a/server/gameserver/lispenv.cc +++ b/server/gameserver/lispenv.cc @@ -2,6 +2,8 @@ #include "lispenv.h" #include "buff.h" +#include "battledatacontext.h" +#include "creature.h" #include "mt/Skill.h" #include "mt/SkillNumber.h" @@ -26,6 +28,25 @@ public: result = context_.buff->skill_meta->_number_meta->GetAttrByIdx(idx); return std::make_shared(a8::lisp::Atom(result)); }); + RegisterCProc + ( + "!myself.get_hero_atk", + [this] (const a8::lisp::List& params) -> std::shared_ptr + { + double result = context_.buff->owner->GetBattleContext()->GetHeroTotalAtk(); + return std::make_shared(a8::lisp::Atom(result)); + }); + RegisterCProc + ( + "!caster.get_hero_atk", + [this] (const a8::lisp::List& params) -> std::shared_ptr + { + double result = 0.0f; + if (context_.buff->GetCaster().Get()) { + context_.buff->GetCaster().Get()->GetBattleContext()->GetHeroTotalAtk(); + } + return std::make_shared(a8::lisp::Atom(result)); + }); } float Eval(std::shared_ptr expr,