Merge pull request #7475 from abcdefg30/perhealth

Convert the float health percentage to an int percentage
This commit is contained in:
Paul Chote
2015-05-03 08:35:58 +12:00
21 changed files with 138 additions and 116 deletions

View File

@@ -43,27 +43,27 @@ namespace OpenRA.Mods.Common.Traits
public object Create(ActorInitializer init) { return new Bridge(init.Self, this); }
public IEnumerable<Pair<ushort, float>> Templates
public IEnumerable<Pair<ushort, int>> Templates
{
get
{
if (Template != 0)
yield return Pair.New(Template, 1f);
yield return Pair.New(Template, 100);
if (DamagedTemplate != 0)
yield return Pair.New(DamagedTemplate, .5f);
yield return Pair.New(DamagedTemplate, 50);
if (DestroyedTemplate != 0)
yield return Pair.New(DestroyedTemplate, 0f);
yield return Pair.New(DestroyedTemplate, 0);
if (DestroyedPlusNorthTemplate != 0)
yield return Pair.New(DestroyedPlusNorthTemplate, 0f);
yield return Pair.New(DestroyedPlusNorthTemplate, 0);
if (DestroyedPlusSouthTemplate != 0)
yield return Pair.New(DestroyedPlusSouthTemplate, 0f);
yield return Pair.New(DestroyedPlusSouthTemplate, 0);
if (DestroyedPlusBothTemplate != 0)
yield return Pair.New(DestroyedPlusBothTemplate, 0f);
yield return Pair.New(DestroyedPlusBothTemplate, 0);
}
}
}

View File

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits
{
readonly BridgeLayerInfo info;
readonly World world;
Dictionary<ushort, Pair<string, float>> bridgeTypes = new Dictionary<ushort, Pair<string, float>>();
Dictionary<ushort, Pair<string, int>> bridgeTypes = new Dictionary<ushort, Pair<string, int>>();
CellLayer<Bridge> bridges;
public BridgeLayer(Actor self, BridgeLayerInfo info)