HitShape Upgrade Rules

Radius is now a sub-property of Shape.Circle.
This commit is contained in:
reaperrr
2015-12-27 23:32:40 +01:00
committed by Huw Pascoe
parent b427190ab4
commit 7076dfaa4d
7 changed files with 37 additions and 9 deletions

View File

@@ -2788,6 +2788,25 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
}
// Refactored Health.Radius to HitShapes
if (engineVersion < 20151227)
{
if (node.Key.StartsWith("Health"))
{
var radius = node.Value.Nodes.FirstOrDefault(x => x.Key == "Radius");
if (radius != null)
{
var radiusValue = FieldLoader.GetValue<string>("Radius", radius.Value.Value);
node.Value.Nodes.Add(new MiniYamlNode("Shape", "Circle"));
var shape = node.Value.Nodes.First(x => x.Key == "Shape");
shape.Value.Nodes.Add(new MiniYamlNode("Radius", radiusValue));
node.Value.Nodes.Remove(radius);
}
}
}
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}

View File

@@ -163,7 +163,8 @@
Inherits@2: ^GainsExperience
Inherits@3: ^SpriteActor
Health:
Radius: 128
Shape: Circle
Radius: 128
Armor:
Type: None
RevealsShroud:
@@ -286,8 +287,9 @@
Inherits@1: ^ExistsInWorld
Inherits@2: ^SpriteActor
Health:
Radius: 128
HP: 1000
Shape: Circle
Radius: 128
Armor:
Type: Wood
Buildable:
@@ -339,8 +341,9 @@
Inherits@1: ^ExistsInWorld
Inherits@2: ^SpriteActor
Health:
Radius: 427
HP: 300
Shape: Circle
Radius: 427
Armor:
Type: Wood
RevealsShroud:

View File

@@ -160,7 +160,8 @@
Inherits@2: ^GainsExperience
Inherits@3: ^SpriteActor
Health:
Radius: 96
Shape: Circle
Radius: 96
Armor:
Type: none
RevealsShroud:

View File

@@ -165,8 +165,9 @@
Inherits@3: ^SpriteActor
DrawLineToTarget:
Health:
Radius: 128
HP: 25
Shape: Circle
Radius: 128
Armor:
Type: None
RevealsShroud:

View File

@@ -591,7 +591,8 @@ Ant:
VisualBounds: 30,30,0,-2
Health:
HP: 750
Radius: 469
Shape: Circle
Radius: 469
Mobile:
Speed: 99
ROT: 12

View File

@@ -211,8 +211,9 @@ DOGGIE:
Tooltip:
Name: Tiberian Fiend
Health:
Radius: 213
HP: 250
Shape: Circle
Radius: 213
PoisonedByTiberium:
Weapon: TiberiumHeal
Valued:

View File

@@ -231,8 +231,9 @@
Inherits@3: ^SpriteActor
DrawLineToTarget:
Health:
Radius: 128
HP: 50
Shape: Circle
Radius: 128
Armor:
Type: None
Valued:
@@ -518,7 +519,8 @@
Inherits@2: ^SpriteActor
DrawLineToTarget:
Health:
Radius: 256
Shape: Circle
Radius: 256
Armor:
Type: Light
Mobile: