This commit is contained in:
aozhiwei 2023-02-14 16:34:19 +08:00
parent ea38d75e59
commit b810720ac9
2 changed files with 20 additions and 61 deletions

View File

@ -262,7 +262,7 @@ void Skill::InitPassiveSkill()
break;
case MAGIC_30301_XL:
{
ProcJSHX();
Proc30301XL();
}
break;
case MAGIC_30401_MAO:
@ -309,29 +309,6 @@ void Skill::InitPassiveSkill()
void Skill::Proc30101HL()
{
a8::XTimerWp recover_timer = owner->room->xtimer.SetIntervalWpEx
(
GetCd() / FRAME_RATE_MS,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
if (!owner->dead) {
}
}
},
&xtimer_attacher);
owner->GetTrigger()->AddListener
(
kReceiveDmgEvent,
[this, recover_timer] (const a8::Args& args) mutable
{
if (!recover_timer.expired()) {
owner->room->xtimer.ResetTimer(recover_timer);
}
}
);
}
void Skill::ProcSSJS()
@ -392,46 +369,28 @@ void Skill::ProcSSJS()
);
}
void Skill::ProcJSHX()
void Skill::Proc30301XL()
{
a8::XTimerWp recover_timer = owner->room->xtimer.SetIntervalWpEx
(
GetCd() / FRAME_RATE_MS,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
if (!owner->dead) {
}
}
},
&xtimer_attacher);
owner->GetTrigger()->AddListener
(
kKillEvent,
[this] (const a8::Args& args)
kReceiveDmgEvent,
[this, recover_timer] (const a8::Args& args) mutable
{
int weapon_id = args.Get<int>(2);
if (owner->GetCurrWeapon()->meta->id() != weapon_id) {
return;
}
#if 0
if (!owner->GetCurrWeapon()->skill_meta ||
owner->GetCurrWeapon()->skill_meta->GetMagicId() != MAGIC_20801) {
return;
}
#endif
if (!owner->dead) {
float add_hp = SkillHelper::GetJshxHp(owner, meta);
float real_add_hp = std::max(0.0f, std::min(owner->GetMaxHP() - owner->GetHP(), add_hp));
owner->AddHp(add_hp);
owner->TryAddBuff(owner, 208014);
#ifdef DEBUG
{
std::string dbg_msg = a8::Format
(
"skill_id:%d 击杀回血 add_hp:%f real_add_hp:%f ratio:%f ratio2:%f human.atk:%f human.extRecoverHp:%f",
{
meta->skill_id(),
add_hp,
real_add_hp,
meta->_number_meta->_float_ratio,
meta->_number_meta->_float_ratio2,
owner->GetBattleContext()->GetHeroTotalAtk(),
owner->GetBattleContext()->GetExtRecoverHp()
});
owner->SendDebugMsg(dbg_msg);
a8::XPrintf("%s\n", {dbg_msg});
}
#endif
if (!recover_timer.expired()) {
owner->room->xtimer.ResetTimer(recover_timer);
}
}
);

View File

@ -52,7 +52,7 @@ private:
void Proc30101HL();
void ProcSSJS();
void ProcJSHX();
void Proc30301XL();
void ProcSWZB();
void ProcCMXD();
void ProcMYXY();