This commit is contained in:
aozhiwei 2023-03-11 14:57:16 +08:00
parent 6b4d8ebc79
commit d1ac2f3f54
3 changed files with 28 additions and 2 deletions

View File

@ -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_);
}
}

View File

@ -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;
};

View File

@ -37,6 +37,14 @@ public:
double result = context_.buff->owner->GetBattleContext()->GetHeroTotalAtk();
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
});
RegisterCProc
(
"myself.get_max_hp",
[this] (const a8::lisp::List& params) -> std::shared_ptr<a8::lisp::Value>
{
double result = context_.buff->owner->GetMaxHP();
return std::make_shared<a8::lisp::Value>(a8::lisp::Atom(result));
});
RegisterCProc
(
"caster.get_hero_atk",