Change DamageState names
This commit is contained in:
@@ -26,7 +26,7 @@ namespace OpenRA.Traits
|
||||
public virtual object Create(ActorInitializer init) { return new Health(init, this); }
|
||||
}
|
||||
|
||||
public enum DamageState { Dead, Quarter, Half, ThreeQuarter, Normal, Undamaged };
|
||||
public enum DamageState { Dead, Critical, Heavy, Medium, Light, Undamaged };
|
||||
|
||||
public class Health
|
||||
{
|
||||
@@ -61,18 +61,18 @@ namespace OpenRA.Traits
|
||||
return DamageState.Dead;
|
||||
|
||||
if (hp < MaxHP * 0.25f)
|
||||
return DamageState.Quarter;
|
||||
return DamageState.Critical;
|
||||
|
||||
if (hp < MaxHP * 0.5f)
|
||||
return DamageState.Half;
|
||||
return DamageState.Heavy;
|
||||
|
||||
if (hp < MaxHP * 0.75f)
|
||||
return DamageState.ThreeQuarter;
|
||||
return DamageState.Medium;
|
||||
|
||||
if (hp == MaxHP)
|
||||
return DamageState.Undamaged;
|
||||
|
||||
return DamageState.Normal;
|
||||
return DamageState.Light;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Traits
|
||||
|
||||
protected virtual string GetPrefix(Actor self)
|
||||
{
|
||||
return self.GetDamageState() <= DamageState.Half ? "damaged-" : "";
|
||||
return self.GetDamageState() <= DamageState.Heavy ? "damaged-" : "";
|
||||
}
|
||||
|
||||
public void PlayCustomAnim(Actor self, string name)
|
||||
|
||||
@@ -69,8 +69,8 @@ namespace OpenRA.Traits
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -2), xy + new float2(0, -4), c, c);
|
||||
Game.Renderer.LineRenderer.DrawLine(Xy + new float2(0, -2), Xy + new float2(0, -4), c, c);
|
||||
|
||||
var healthColor = (health.DamageState == DamageState.Quarter) ? Color.Red :
|
||||
(health.DamageState == DamageState.Half) ? Color.Yellow : Color.LimeGreen;
|
||||
var healthColor = (health.DamageState == DamageState.Critical) ? Color.Red :
|
||||
(health.DamageState == DamageState.Heavy) ? Color.Yellow : Color.LimeGreen;
|
||||
|
||||
var healthColor2 = Color.FromArgb(
|
||||
255,
|
||||
|
||||
Reference in New Issue
Block a user