1
This commit is contained in:
parent
751247bf20
commit
c0e515b417
@ -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,34 +826,54 @@ void RoomObstacle::ActiveMedicalStation()
|
||||
}
|
||||
);
|
||||
for (auto& c : target_list) {
|
||||
float add_hp = SkillHelper::GetYlzRecoverHp(master.Get(),
|
||||
c,
|
||||
skill_meta);
|
||||
float old_hp = c->GetHP();
|
||||
c->AddHp(add_hp);
|
||||
if (std::abs(c->GetHP() - old_hp) > 0.0001f && master.Get()) {
|
||||
if (c->team_id == master.Get()->team_id) {
|
||||
float add_hp = SkillHelper::GetYlzRecoverHp(master.Get(),
|
||||
c,
|
||||
skill_meta);
|
||||
float old_hp = c->GetHP();
|
||||
c->AddHp(add_hp);
|
||||
if (std::abs(c->GetHP() - old_hp) > 0.0001f && master.Get()) {
|
||||
for (int buff_id : meta->_buff_list) {
|
||||
c->TryAddBuff(master.Get(),
|
||||
buff_id
|
||||
);
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
{
|
||||
std::string dbg_msg = a8::Format
|
||||
(
|
||||
"skill_id:%d 医疗站 human.atk:%f target.extRecoverHp:%f add_hp:%f range2:%f",
|
||||
{
|
||||
skill_meta->skill_id(),
|
||||
master.Get()->GetBattleContext()->GetHeroTotalAtk(),
|
||||
master.Get()->GetBattleContext()->GetExtRecoverHp(),
|
||||
add_hp,
|
||||
skill_meta->_number_meta->_float_range2
|
||||
});
|
||||
master.Get()->SendDebugMsg(dbg_msg);
|
||||
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
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
#ifdef DEBUG
|
||||
{
|
||||
std::string dbg_msg = a8::Format
|
||||
(
|
||||
"skill_id:%d 医疗站 human.atk:%f target.extRecoverHp:%f add_hp:%f range2:%f",
|
||||
{
|
||||
skill_meta->skill_id(),
|
||||
master.Get()->GetBattleContext()->GetHeroTotalAtk(),
|
||||
master.Get()->GetBattleContext()->GetExtRecoverHp(),
|
||||
add_hp,
|
||||
skill_meta->_number_meta->_float_range2
|
||||
});
|
||||
master.Get()->SendDebugMsg(dbg_msg);
|
||||
a8::XPrintf("%s\n", {dbg_msg});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
},
|
||||
&xtimer_attacher);
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user