1
This commit is contained in:
parent
7901b273c4
commit
d765bc61eb
@ -962,8 +962,8 @@ void Buff::ProcReserveMove()
|
||||
|
||||
void Buff::ProcHoldShield()
|
||||
{
|
||||
owner->shield_hp_ = meta->int_param2;
|
||||
owner->shield_max_hp_ = meta->int_param2;
|
||||
owner->shield_hp_ = meta->int_param3;
|
||||
owner->shield_max_hp_ = meta->int_param3;
|
||||
owner->room->frame_event.AddPropChg(owner->GetWeakPtrRef(),
|
||||
kPropShieldHp,
|
||||
owner->shield_max_hp_,
|
||||
|
@ -515,7 +515,7 @@ void Bullet::Check(float distance)
|
||||
float shot_angle = shot_angle = dir.CalcAngleEx(c->GetAttackDir());
|
||||
CircleCollider collider;
|
||||
collider.owner = c;
|
||||
collider.rad = hold_shield_buff->meta->param1;
|
||||
collider.rad = hold_shield_buff->meta->param2;
|
||||
if (shot_angle * 180 < 90.0f) {
|
||||
if (TestCollision(room, &collider)) {
|
||||
c->OnBulletHit(this);
|
||||
|
@ -3506,16 +3506,19 @@ void Human::OnBulletHit(Bullet* bullet)
|
||||
{
|
||||
Buff* buff = GetBuffByEffectId(kBET_HoldShield);
|
||||
if (buff) {
|
||||
float finaly_dmg = bullet->sender.Get()->GetBattleContext()->CalcDmg(this, bullet);
|
||||
shield_hp_ = std::max(0.0f, shield_hp_ - finaly_dmg);
|
||||
room->frame_event.AddPropChg(GetWeakPtrRef(),
|
||||
kPropShieldHp,
|
||||
shield_max_hp_,
|
||||
shield_hp_);
|
||||
if (shield_hp_ <= 0) {
|
||||
RemoveBuffByUniId(buff->buff_uniid);
|
||||
float shot_angle = shot_angle = bullet->dir.CalcAngleEx(GetAttackDir());
|
||||
if (shot_angle * 180 < 90.0f) {
|
||||
float finaly_dmg = bullet->sender.Get()->GetBattleContext()->CalcDmg(this, bullet);
|
||||
shield_hp_ = std::max(0.0f, shield_hp_ - finaly_dmg);
|
||||
room->frame_event.AddPropChg(GetWeakPtrRef(),
|
||||
kPropShieldHp,
|
||||
shield_max_hp_,
|
||||
shield_hp_);
|
||||
if (shield_hp_ <= 0) {
|
||||
RemoveBuffByUniId(buff->buff_uniid);
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user