This commit is contained in:
aozhiwei 2023-05-25 18:56:19 +08:00
parent b23dcf72f5
commit 352121bda8
3 changed files with 24 additions and 1 deletions

View File

@ -81,6 +81,12 @@ void CallFuncBuff::Activate()
ProcAddHp(); ProcAddHp();
} }
break; break;
case BuffCallFunc_e::kAddMaxHp:
{
hold_param2_ = meta->GetBuffParam2(this);
ProcAddMaxHp();
}
break;
case BuffCallFunc_e::kFlashMoveToPos: case BuffCallFunc_e::kFlashMoveToPos:
{ {
hold_param2_ = meta->GetBuffParam2(this); hold_param2_ = meta->GetBuffParam2(this);
@ -847,3 +853,10 @@ void CallFuncBuff::DecSkillCd()
skill->Accelerate(-dec_time); skill->Accelerate(-dec_time);
} }
} }
void CallFuncBuff::ProcAddMaxHp()
{
if (!owner->dead && !owner->downed) {
owner->SetMaxHP(owner->GetMaxHP() + hold_param2_);
}
}

View File

@ -25,7 +25,8 @@ A8_DECLARE_CLASS_ENUM(BuffCallFunc_e, int,
kSummonObstacleSpecDistance = 25, kSummonObstacleSpecDistance = 25,
kClearSummonObstacle = 26, kClearSummonObstacle = 26,
kDecSkillCd = 27, kDecSkillCd = 27,
kRefreshHp = 28 kRefreshHp = 28,
kAddMaxHp = 29,
); );
@ -44,6 +45,7 @@ class CallFuncBuff : public Buff
void ProcFlashMove(); void ProcFlashMove();
void ProcAddEnergyShield(); void ProcAddEnergyShield();
void ProcAddHp(); void ProcAddHp();
void ProcAddMaxHp();
void ProcFlashMoveToPos(); void ProcFlashMoveToPos();
void ProcLightCircle(); void ProcLightCircle();
void ProcSyncProp(); void ProcSyncProp();

View File

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