This commit is contained in:
aozhiwei 2022-09-14 10:52:24 +08:00
parent 7901b273c4
commit d765bc61eb
3 changed files with 15 additions and 12 deletions

View File

@ -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_,

View File

@ -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);

View File

@ -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