1
This commit is contained in:
parent
deb8ec286d
commit
8e50ea6aea
@ -349,12 +349,16 @@ void CallFuncBuff::ProcAddEnergyShield()
|
||||
kUpdateEnergyShieldEvent,
|
||||
[this] (const a8::Args& args) mutable
|
||||
{
|
||||
int value = args.Get<int>(0);
|
||||
int new_time = args.Get<int>(1);
|
||||
owner->AddEnergyShield(value);
|
||||
}));
|
||||
event_handlers_.push_back(owner->GetTrigger()->AddListener
|
||||
(
|
||||
kDestoryEnergyShieldEvent,
|
||||
[this] (const a8::Args& args) mutable
|
||||
{
|
||||
owner->RemoveBuffByUniId(buff_uniid);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
@ -262,6 +262,9 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in
|
||||
max_energy_shield,
|
||||
true);
|
||||
GetTrigger()->ReceiveDmg();
|
||||
if (energy_shield <= 0) {
|
||||
GetTrigger()->DestoryEnergyShield();
|
||||
}
|
||||
} else {
|
||||
float old_health = GetHP();
|
||||
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user