This commit is contained in:
aozhiwei 2023-02-15 13:42:31 +08:00
parent 751247bf20
commit c0e515b417
3 changed files with 59 additions and 25 deletions

View File

@ -812,9 +812,7 @@ void RoomObstacle::ActiveMedicalStation()
*grid_list_,
[this, &target_list] (Creature* hum, bool& stop)
{
if (master.Get()->team_id == hum->team_id &&
!hum->dead
) {
if (!hum->dead) {
if (Collision::CheckCB
(
hum,
@ -828,6 +826,7 @@ void RoomObstacle::ActiveMedicalStation()
}
);
for (auto& c : target_list) {
if (c->team_id == master.Get()->team_id) {
float add_hp = SkillHelper::GetYlzRecoverHp(master.Get(),
c,
skill_meta);
@ -856,6 +855,25 @@ void RoomObstacle::ActiveMedicalStation()
a8::XPrintf("%s\n", {dbg_msg});
}
#endif
} else {
float damage = SkillHelper::GetYlzDamage(master.Get(),
c,
skill_meta);
c->DecHP(damage,
master.Get()->GetUniId(),
master.Get()->GetName(),
VP_Buff,
master.Get()->GetUniId(),
master.Get()->GetName()
);
for (int buff_id : meta->_buff_list) {
c->TryAddBuff(master.Get(),
buff_id
);
}
}
}
},
&xtimer_attacher);

View File

@ -320,11 +320,26 @@ int SkillHelper::GetYlzRange(const mt::Skill* skill_meta)
int SkillHelper::GetYlzRecoverHp(Creature* sender, Creature* target, const mt::Skill* skill_meta)
{
#if 1
float hp =
skill_meta->_number_meta->resume() +
skill_meta->_number_meta->resume_addition() * sender->GetBattleContext()->GetHeroTotalAtk();
return hp;
#else
float hp =
(skill_meta->_number_meta->_float_ratio +
skill_meta->_number_meta->_float_ratio2 * sender->GetBattleContext()->GetHeroTotalAtk()) *
(1 + target->GetBattleContext()->GetExtRecoverHp());
return hp;
#endif
}
int SkillHelper::GetYlzDamage(Creature* sender, Creature* target, const mt::Skill* skill_meta)
{
float dmg =
skill_meta->_number_meta->damage() +
skill_meta->_number_meta->damage_addition() * sender->GetBattleContext()->GetHeroTotalAtk();
return dmg;
}
int SkillHelper::GetJyfhBuffId(const mt::Skill* skill_meta)

View File

@ -37,6 +37,7 @@ class SkillHelper
//医疗站
static int GetYlzRange(const mt::Skill* skill_meta);
static int GetYlzRecoverHp(Creature* sender, Creature* target, const mt::Skill* skill_meta);
static int GetYlzDamage(Creature* sender, Creature* target, const mt::Skill* skill_meta);
//救援防护
static int GetJyfhBuffId(const mt::Skill* skill_meta);
static float GetJyfhBuffTime(const mt::Skill* skill_meta);