1
This commit is contained in:
parent
bcef94bd99
commit
68ddbb136c
@ -887,3 +887,8 @@ int BattleDataContext::GetLevel()
|
|||||||
{
|
{
|
||||||
return std::max(level_, 1);
|
return std::max(level_, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float BattleDataContext::GetBrainLifePct()
|
||||||
|
{
|
||||||
|
return hero_ability_->GetBrainLifePct();
|
||||||
|
}
|
||||||
|
@ -61,6 +61,7 @@ struct BattleDataContext
|
|||||||
int GetReloadTime(Creature* c, Weapon* weapon);
|
int GetReloadTime(Creature* c, Weapon* weapon);
|
||||||
float GetHeroTotalAtk();
|
float GetHeroTotalAtk();
|
||||||
float GetExtRecoverHp();
|
float GetExtRecoverHp();
|
||||||
|
float GetBrainLifePct();
|
||||||
|
|
||||||
void SetReviveCoin(int num);
|
void SetReviveCoin(int num);
|
||||||
int GetReviveCoin();
|
int GetReviveCoin();
|
||||||
|
@ -297,6 +297,15 @@ void Car::OnBulletHit(IBullet* bullet)
|
|||||||
bullet->GetSender().Get()->GetUniId(),
|
bullet->GetSender().Get()->GetUniId(),
|
||||||
bullet->GetSender().Get()->GetName(),
|
bullet->GetSender().Get()->GetName(),
|
||||||
dmg_out);
|
dmg_out);
|
||||||
|
if (bullet->GetSender().Get() &&
|
||||||
|
!bullet->GetSender().Get()->dead &&
|
||||||
|
dmg_out > 0.0f &&
|
||||||
|
!bullet->GetSkillMeta() &&
|
||||||
|
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
|
||||||
|
float recover_hp = dmg_out *
|
||||||
|
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
|
||||||
|
bullet->GetSender().Get()->AddHp(recover_hp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (bullet->GetBulletMeta()->_buff_meta) {
|
if (bullet->GetBulletMeta()->_buff_meta) {
|
||||||
MustBeAddBuff(this, bullet->GetBulletMeta()->buffid());
|
MustBeAddBuff(this, bullet->GetBulletMeta()->buffid());
|
||||||
|
@ -179,6 +179,15 @@ void Hero::OnBulletHit(IBullet* bullet)
|
|||||||
bullet->GetSender().Get()->GetUniId(),
|
bullet->GetSender().Get()->GetUniId(),
|
||||||
bullet->GetSender().Get()->GetName(),
|
bullet->GetSender().Get()->GetName(),
|
||||||
dmg_out);
|
dmg_out);
|
||||||
|
if (bullet->GetSender().Get() &&
|
||||||
|
!bullet->GetSender().Get()->dead &&
|
||||||
|
dmg_out > 0.0f &&
|
||||||
|
!bullet->GetSkillMeta() &&
|
||||||
|
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
|
||||||
|
float recover_hp = dmg_out *
|
||||||
|
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
|
||||||
|
bullet->GetSender().Get()->AddHp(recover_hp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2140,6 +2140,15 @@ void Human::OnBulletHit(IBullet* bullet)
|
|||||||
bullet->GetPassenger().Get()->GetName(),
|
bullet->GetPassenger().Get()->GetName(),
|
||||||
dmg_out);
|
dmg_out);
|
||||||
bullet->GetSender().Get()->GetTrigger()->DmgOut(this, dmg_out);
|
bullet->GetSender().Get()->GetTrigger()->DmgOut(this, dmg_out);
|
||||||
|
if (bullet->GetSender().Get() &&
|
||||||
|
!bullet->GetSender().Get()->dead &&
|
||||||
|
dmg_out > 0.0f &&
|
||||||
|
!bullet->GetSkillMeta() &&
|
||||||
|
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
|
||||||
|
float recover_hp = dmg_out *
|
||||||
|
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
|
||||||
|
bullet->GetSender().Get()->AddHp(recover_hp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!bullet->IsPreBattleBullet()) {
|
if (!bullet->IsPreBattleBullet()) {
|
||||||
@ -2156,6 +2165,15 @@ void Human::OnBulletHit(IBullet* bullet)
|
|||||||
bullet->GetSender().Get()->GetName(),
|
bullet->GetSender().Get()->GetName(),
|
||||||
dmg_out);
|
dmg_out);
|
||||||
bullet->GetSender().Get()->GetTrigger()->DmgOut(this, dmg_out);
|
bullet->GetSender().Get()->GetTrigger()->DmgOut(this, dmg_out);
|
||||||
|
if (bullet->GetSender().Get() &&
|
||||||
|
!bullet->GetSender().Get()->dead &&
|
||||||
|
dmg_out > 0.0f &&
|
||||||
|
!bullet->GetSkillMeta() &&
|
||||||
|
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) {
|
||||||
|
float recover_hp = dmg_out *
|
||||||
|
bullet->GetSender().Get()->GetBattleContext()->GetBrainLifePct();
|
||||||
|
bullet->GetSender().Get()->AddHp(recover_hp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user