further unhacking to localise extended damage state stuff to JUST WALLS
This commit is contained in:
@@ -152,29 +152,11 @@ namespace OpenRA
|
||||
return DamageState.Normal;
|
||||
}
|
||||
|
||||
public ExtendedDamageState GetExtendedDamageState()
|
||||
{
|
||||
if (Health <= 0)
|
||||
return ExtendedDamageState.Dead;
|
||||
|
||||
if (Health < this.GetMaxHP() * Rules.General.ConditionRed)
|
||||
return ExtendedDamageState.Quarter;
|
||||
|
||||
if (Health < this.GetMaxHP() * Rules.General.ConditionYellow)
|
||||
return ExtendedDamageState.Half;
|
||||
|
||||
if (Health < this.GetMaxHP() * 0.75)
|
||||
return ExtendedDamageState.ThreeQuarter;
|
||||
|
||||
return ExtendedDamageState.Normal;
|
||||
}
|
||||
|
||||
public void InflictDamage(Actor attacker, int damage, WarheadInfo warhead)
|
||||
{
|
||||
if (IsDead) return; /* overkill! don't count extra hits as more kills! */
|
||||
|
||||
var oldState = GetDamageState();
|
||||
var oldExtendedState = GetExtendedDamageState();
|
||||
|
||||
/* apply the damage modifiers, if we have any. */
|
||||
damage = (int)traits.WithInterface<IDamageModifier>().Aggregate(
|
||||
@@ -196,7 +178,6 @@ namespace OpenRA
|
||||
if (Health > maxHP) Health = maxHP;
|
||||
|
||||
var newState = GetDamageState();
|
||||
var newExtendedState = GetExtendedDamageState();
|
||||
|
||||
foreach (var nd in traits.WithInterface<INotifyDamage>())
|
||||
nd.Damaged(this, new AttackInfo
|
||||
@@ -205,8 +186,6 @@ namespace OpenRA
|
||||
Damage = damage,
|
||||
DamageState = newState,
|
||||
DamageStateChanged = newState != oldState,
|
||||
ExtendedDamageState = newExtendedState,
|
||||
ExtendedDamageStateChanged = newExtendedState != oldExtendedState,
|
||||
Warhead = warhead
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user