1
This commit is contained in:
parent
deb8ec286d
commit
8e50ea6aea
@ -349,12 +349,16 @@ void CallFuncBuff::ProcAddEnergyShield()
|
|||||||
kUpdateEnergyShieldEvent,
|
kUpdateEnergyShieldEvent,
|
||||||
[this] (const a8::Args& args) mutable
|
[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
|
event_handlers_.push_back(owner->GetTrigger()->AddListener
|
||||||
(
|
(
|
||||||
kDestoryEnergyShieldEvent,
|
kDestoryEnergyShieldEvent,
|
||||||
[this] (const a8::Args& args) mutable
|
[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,
|
max_energy_shield,
|
||||||
true);
|
true);
|
||||||
GetTrigger()->ReceiveDmg();
|
GetTrigger()->ReceiveDmg();
|
||||||
|
if (energy_shield <= 0) {
|
||||||
|
GetTrigger()->DestoryEnergyShield();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
float old_health = GetHP();
|
float old_health = GetHP();
|
||||||
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user