diff --git a/server/gameserver/buff/callfunc.cc b/server/gameserver/buff/callfunc.cc index 5f7bff31..ca867a08 100644 --- a/server/gameserver/buff/callfunc.cc +++ b/server/gameserver/buff/callfunc.cc @@ -76,12 +76,21 @@ void CallFuncBuff::Activate() } break; case BuffCallFunc_e::kAddEnergyShield: - default: { hold_param2_ = meta->GetBuffParam2(this); ProcAddEnergyShield(); } break; + case BuffCallFunc_e::kAddHp: + { + hold_param2_ = meta->GetBuffParam2(this); + ProcAddHp(); + } + break; + default: + { + } + break; } } @@ -252,3 +261,10 @@ void CallFuncBuff::ProcAddEnergyShield() { owner->AddEnergyShield(hold_param2_); } + +void CallFuncBuff::ProcAddHp() +{ + if (!owner->dead) { + owner->AddHp(hold_param2_); + } +} diff --git a/server/gameserver/buff/callfunc.h b/server/gameserver/buff/callfunc.h index 5e876ec2..92348b94 100644 --- a/server/gameserver/buff/callfunc.h +++ b/server/gameserver/buff/callfunc.h @@ -12,7 +12,8 @@ A8_DECLARE_CLASS_ENUM(BuffCallFunc_e, int, kRemoveBuff = 7, kFlashMove = 8, kSetSpeed = 9, - kAddEnergyShield = 10 + kAddEnergyShield = 10, + kAddHp = 11 ); @@ -30,6 +31,7 @@ class CallFuncBuff : public Buff void ProcRemoveBuff(); void ProcFlashMove(); void ProcAddEnergyShield(); + void ProcAddHp(); float hold_param2_ = 0.0; }; diff --git a/server/gameserver/lispenv.cc b/server/gameserver/lispenv.cc index d5bd2632..cf892166 100644 --- a/server/gameserver/lispenv.cc +++ b/server/gameserver/lispenv.cc @@ -37,6 +37,14 @@ public: double result = context_.buff->owner->GetBattleContext()->GetHeroTotalAtk(); return std::make_shared(a8::lisp::Atom(result)); }); + RegisterCProc + ( + "myself.get_max_hp", + [this] (const a8::lisp::List& params) -> std::shared_ptr + { + double result = context_.buff->owner->GetMaxHP(); + return std::make_shared(a8::lisp::Atom(result)); + }); RegisterCProc ( "caster.get_hero_atk",