fix Bridge init
This commit is contained in:
@@ -43,8 +43,12 @@ namespace OpenRA.Traits
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int HP { get { return hp; } }
|
public int HP { get { return hp; } }
|
||||||
public readonly int MaxHP;
|
public readonly int MaxHP;
|
||||||
public float HPFraction { get { return hp*1f/MaxHP; } }
|
public float HPFraction
|
||||||
|
{
|
||||||
|
get { return hp * 1f / MaxHP; }
|
||||||
|
set { hp = (int)(value * MaxHP); }
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsDead { get { return hp <= 0; } }
|
public bool IsDead { get { return hp <= 0; } }
|
||||||
public bool RemoveOnDeath = true;
|
public bool RemoveOnDeath = true;
|
||||||
|
|||||||
@@ -90,9 +90,9 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
currentTemplate = template;
|
currentTemplate = template;
|
||||||
if (template == Info.DamagedTemplate)
|
if (template == Info.DamagedTemplate)
|
||||||
Health.InflictDamage(self, self, Health.MaxHP/2, null);
|
Health.HPFraction = .5f;
|
||||||
else if (template != Info.Template)
|
else if (template != Info.Template)
|
||||||
Health.InflictDamage(self, self, Health.MaxHP, null);
|
Health.HPFraction = 0f;
|
||||||
|
|
||||||
// Create a new cache to store the tile data
|
// Create a new cache to store the tile data
|
||||||
if (cachedTileset != self.World.Map.Tileset)
|
if (cachedTileset != self.World.Map.Tileset)
|
||||||
|
|||||||
Reference in New Issue
Block a user