Add upgrade rules.

This commit is contained in:
Paul Chote
2014-03-17 21:41:34 +13:00
parent 3f9e89a746
commit 9993eacf65
14 changed files with 109 additions and 20 deletions

View File

@@ -174,6 +174,54 @@ namespace OpenRA.Utility
i.Value.Nodes.Add(new MiniYamlNode("OccupiesSpace", "false")); i.Value.Nodes.Add(new MiniYamlNode("OccupiesSpace", "false"));
} }
// Armaments and muzzleflashes were reworked to support garrisoning
if (engineVersion < 20140321)
{
if (depth == 0)
{
var muzzles = node.Value.Nodes.Where(n => n.Key.StartsWith("WithMuzzleFlash"));
var armaments = node.Value.Nodes.Where(n => n.Key.StartsWith("Armament"));
// Shift muzzle flash definitions to Armament
foreach (var m in muzzles)
{
var muzzleArmNode = m.Value.Nodes.SingleOrDefault(n => n.Key == "Armament");
var muzzleSequenceNode = m.Value.Nodes.SingleOrDefault(n => n.Key == "Sequence");
var muzzleSplitFacingsNode = m.Value.Nodes.SingleOrDefault(n => n.Key == "SplitFacings");
var muzzleFacingsCountNode = m.Value.Nodes.SingleOrDefault(n => n.Key == "FacingCount");
var muzzleArmName = muzzleArmNode != null ? muzzleArmNode.Value.Value.Trim() : "primary";
var muzzleSequence = muzzleSequenceNode != null ? muzzleSequenceNode.Value.Value.Trim() : "muzzle";
var muzzleSplitFacings = muzzleSplitFacingsNode != null ? FieldLoader.GetValue<bool>("SplitFacings", muzzleSplitFacingsNode.Value.Value) : false;
var muzzleFacingsCount = muzzleFacingsCountNode != null ? FieldLoader.GetValue<int>("FacingsCount", muzzleFacingsCountNode.Value.Value) : 8;
foreach (var a in armaments)
{
var armNameNode = m.Value.Nodes.SingleOrDefault(n => n.Key == "Name");
var armName = armNameNode != null ? armNameNode.Value.Value.Trim() : "primary";
if (muzzleArmName == armName)
{
a.Value.Nodes.Add(new MiniYamlNode("MuzzleSequence", muzzleSequence));
if (muzzleSplitFacings)
a.Value.Nodes.Add(new MiniYamlNode("MuzzleSplitFacings", muzzleFacingsCount.ToString()));
}
}
}
foreach (var m in muzzles.ToList().Skip(1))
node.Value.Nodes.Remove(m);
}
// Remove all but the first muzzle flash definition
if (depth == 1 && node.Key.StartsWith("WithMuzzleFlash"))
{
node.Key = "WithMuzzleFlash";
node.Value.Nodes.RemoveAll(n => n.Key == "Armament");
node.Value.Nodes.RemoveAll(n => n.Key == "Sequence");
}
}
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
} }
} }

View File

@@ -68,10 +68,12 @@ HELI:
Armament@PRIMARY: Armament@PRIMARY:
Weapon: HeliAGGun Weapon: HeliAGGun
LocalOffset: 128,-213,-85, 128,213,-85 LocalOffset: 128,-213,-85, 128,213,-85
MuzzleSequence: muzzle
Armament@SECONDARY: Armament@SECONDARY:
Name: secondary Name: secondary
Weapon: HeliAAGun Weapon: HeliAAGun
LocalOffset: 128,-213,-85, 128,213,-85 LocalOffset: 128,-213,-85, 128,213,-85
MuzzleSequence: muzzle
AttackHeli: AttackHeli:
FacingTolerance: 20 FacingTolerance: 20
LimitedAmmo: LimitedAmmo:
@@ -83,9 +85,7 @@ HELI:
RenderUnit: RenderUnit:
WithRotor: WithRotor:
Offset: 0,0,85 Offset: 0,0,85
WithMuzzleFlash@PRIMARY: WithMuzzleFlash:
WithMuzzleFlash@SECONDARY:
Armament: secondary
WithShadow: WithShadow:
LeavesHusk: LeavesHusk:
HuskActor: HELI.Husk HuskActor: HELI.Husk
@@ -204,8 +204,7 @@ A10:
Name: gun Name: gun
Weapon: Vulcan Weapon: Vulcan
LocalOffset: 1024,0,-85 LocalOffset: 1024,0,-85
WithMuzzleFlash@SECONDARY: WithMuzzleFlash:
Armament: gun
Armament@BOMBS: Armament@BOMBS:
Name: bombs Name: bombs
Weapon: Napalm Weapon: Napalm

View File

@@ -441,6 +441,8 @@ VICE:
Armament: Armament:
Weapon: Chemspray Weapon: Chemspray
LocalOffset: 384,0,0 LocalOffset: 384,0,0
MuzzleSequence: muzzle
MuzzleSplitFacings: 8
AttackFrontal: AttackFrontal:
AttackWander: AttackWander:
RenderUnit: RenderUnit:

View File

@@ -103,6 +103,8 @@ E4:
Weapon: Flamethrower Weapon: Flamethrower
LocalOffset: 341,0,256 LocalOffset: 341,0,256
FireDelay: 3 FireDelay: 3
MuzzleSequence: muzzle
MuzzleSplitFacings: 8
AttackFrontal: AttackFrontal:
WithMuzzleFlash: WithMuzzleFlash:
SplitFacings: true SplitFacings: true
@@ -138,6 +140,8 @@ E5:
Weapon: Chemspray Weapon: Chemspray
LocalOffset: 341,0,256 LocalOffset: 341,0,256
FireDelay: 3 FireDelay: 3
MuzzleSequence: muzzle
MuzzleSplitFacings: 8
AttackFrontal: AttackFrontal:
WithMuzzleFlash: WithMuzzleFlash:
SplitFacings: true SplitFacings: true

View File

@@ -524,6 +524,7 @@ GUN:
Armament: Armament:
Weapon: TurretGun Weapon: TurretGun
LocalOffset: 512,0,112 LocalOffset: 512,0,112
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
AutoTarget: AutoTarget:
@@ -566,6 +567,7 @@ SAM:
RenderBuildingTurreted: RenderBuildingTurreted:
Armament: Armament:
Weapon: SAMMissile Weapon: SAMMissile
MuzzleSequence: muzzle
AttackPopupTurreted: AttackPopupTurreted:
WithMuzzleFlash: WithMuzzleFlash:
AutoTarget: AutoTarget:
@@ -639,6 +641,7 @@ GTWR:
Armament: Armament:
Weapon: HighV Weapon: HighV
LocalOffset: 256,0,256 LocalOffset: 256,0,256
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
BodyOrientation: BodyOrientation:
QuantizedFacings: 8 QuantizedFacings: 8

View File

@@ -98,16 +98,16 @@ APC:
Recoil: 96 Recoil: 96
RecoilRecovery: 18 RecoilRecovery: 18
LocalOffset: 85,85,299, 85,-85,299 LocalOffset: 85,85,299, 85,-85,299
MuzzleSequence: muzzle
Armament@SECONDARY: Armament@SECONDARY:
Name: secondary Name: secondary
Weapon: APCGun.AA Weapon: APCGun.AA
Recoil: 96 Recoil: 96
RecoilRecovery: 18 RecoilRecovery: 18
LocalOffset: 85,85,299, 85,-85,299 LocalOffset: 85,85,299, 85,-85,299
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash@PRIMARY: WithMuzzleFlash:
WithMuzzleFlash@SECONDARY:
Armament: secondary
RenderUnit: RenderUnit:
WithTurret: WithTurret:
AutoTarget: AutoTarget:
@@ -141,6 +141,7 @@ ARTY:
Armament: Armament:
Weapon: ArtilleryShell Weapon: ArtilleryShell
LocalOffset: 624,0,208 LocalOffset: 624,0,208
MuzzleSequence: muzzle
AttackFrontal: AttackFrontal:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -175,6 +176,8 @@ FTNK:
Armament: Armament:
Weapon: BigFlamer Weapon: BigFlamer
LocalOffset: 512,128,42, 512,-128,42 LocalOffset: 512,128,42, 512,-128,42
MuzzleSequence: muzzle
MuzzleSplitFacings: 8
AttackFrontal: AttackFrontal:
RenderUnit: RenderUnit:
AutoTarget: AutoTarget:
@@ -212,6 +215,7 @@ BGGY:
Armament: Armament:
Weapon: MachineGun Weapon: MachineGun
LocalOffset: 171,0,43 LocalOffset: 171,0,43
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -283,6 +287,7 @@ JEEP:
Armament: Armament:
Weapon: MachineGun Weapon: MachineGun
LocalOffset: 171,0,85 LocalOffset: 171,0,85
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -318,6 +323,7 @@ LTNK:
Recoil: 85 Recoil: 85
RecoilRecovery: 17 RecoilRecovery: 17
LocalOffset: 720,0,90 LocalOffset: 720,0,90
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -355,6 +361,7 @@ MTNK:
Recoil: 128 Recoil: 128
RecoilRecovery: 26 RecoilRecovery: 26
LocalOffset: 768,0,90 LocalOffset: 768,0,90
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -396,14 +403,16 @@ HTNK:
LocalOffset: 900,180,340, 900,-180,340 LocalOffset: 900,180,340, 900,-180,340
Recoil: 170 Recoil: 170
RecoilRecovery: 42 RecoilRecovery: 42
MuzzleSequence: muzzle
Armament@SECONDARY: Armament@SECONDARY:
Name: secondary Name: secondary
Weapon: MammothMissiles Weapon: MammothMissiles
LocalOffset: -85,384,340, -85,-384,340 LocalOffset: -85,384,340, -85,-384,340
LocalYaw: -100, 100 LocalYaw: -100, 100
Recoil: 42 Recoil: 42
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash@PRIMARY: WithMuzzleFlash:
RenderUnit: RenderUnit:
WithTurret: WithTurret:
AutoTarget: AutoTarget:

View File

@@ -190,6 +190,7 @@ DEVAST:
Armament: Armament:
Weapon: DevBullet Weapon: DevBullet
LocalOffset: 256,0,32 LocalOffset: 256,0,32
MuzzleSequence: muzzle
AttackFrontal: AttackFrontal:
WithMuzzleFlash: WithMuzzleFlash:
AutoTarget: AutoTarget:

View File

@@ -172,6 +172,7 @@ RAIDER:
Armament: Armament:
Weapon: HMGo Weapon: HMGo
LocalOffset: 256,0,128 LocalOffset: 256,0,128
MuzzleSequence: muzzle
AttackFrontal: AttackFrontal:
AutoTarget: AutoTarget:
Explodes: Explodes:
@@ -206,6 +207,7 @@ STEALTHRAIDER:
Armament: Armament:
Weapon: HMGo Weapon: HMGo
LocalOffset: 256,0,128 LocalOffset: 256,0,128
MuzzleSequence: muzzle
AttackFrontal: AttackFrontal:
Explodes: Explodes:
Weapon: UnitExplodeTiny Weapon: UnitExplodeTiny

View File

@@ -471,6 +471,7 @@ WALL:
Armament: Armament:
Weapon: TurretGun Weapon: TurretGun
LocalOffset: 448,0,128 LocalOffset: 448,0,128
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
AutoTarget: AutoTarget:
RenderDetectionCircle: RenderDetectionCircle:

View File

@@ -130,6 +130,7 @@ TRIKE:
Armament: Armament:
Weapon: HMG Weapon: HMG
LocalOffset: -416,0,0 LocalOffset: -416,0,0
MuzzleSequence: muzzle
AttackFrontal: AttackFrontal:
AutoTarget: AutoTarget:
Explodes: Explodes:
@@ -218,6 +219,7 @@ QUAD.starport:
Recoil: 128 Recoil: 128
RecoilRecovery: 32 RecoilRecovery: 32
LocalOffset: 256,0,0 LocalOffset: 256,0,0
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -267,6 +269,7 @@ SIEGETANK:
Recoil: 150 Recoil: 150
RecoilRecovery: 19 RecoilRecovery: 19
LocalOffset: 512,0,320 LocalOffset: 512,0,320
MuzzleSequence: muzzle
AttackFrontal: AttackFrontal:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:

View File

@@ -147,10 +147,12 @@ YAK:
Armament@PRIMARY: Armament@PRIMARY:
Weapon: ChainGun.Yak Weapon: ChainGun.Yak
LocalOffset: 256,-213,0 LocalOffset: 256,-213,0
MuzzleSequence: muzzle
Armament@SECONDARY: Armament@SECONDARY:
Name: secondary Name: secondary
Weapon: ChainGun.Yak Weapon: ChainGun.Yak
LocalOffset: 256,213,0 LocalOffset: 256,213,0
MuzzleSequence: muzzle
AttackPlane: AttackPlane:
FacingTolerance: 20 FacingTolerance: 20
Plane: Plane:
@@ -171,9 +173,7 @@ YAK:
ReloadTicks: 11 ReloadTicks: 11
IronCurtainable: IronCurtainable:
ReturnOnIdle: ReturnOnIdle:
WithMuzzleFlash@PRIMARY: WithMuzzleFlash:
WithMuzzleFlash@SECONDARY:
Armament: secondary
Contrail: Contrail:
Offset: -853,0,0 Offset: -853,0,0
LeavesHusk: LeavesHusk:
@@ -295,10 +295,12 @@ HIND:
Armament@PRIMARY: Armament@PRIMARY:
Weapon: ChainGun Weapon: ChainGun
LocalOffset: 85,-213,-85 LocalOffset: 85,-213,-85
MuzzleSequence: muzzle
Armament@SECONDARY: Armament@SECONDARY:
Name: secondary Name: secondary
Weapon: ChainGun Weapon: ChainGun
LocalOffset: 85,213,-85 LocalOffset: 85,213,-85
MuzzleSequence: muzzle
AttackHeli: AttackHeli:
FacingTolerance: 20 FacingTolerance: 20
Helicopter: Helicopter:
@@ -321,9 +323,7 @@ HIND:
IronCurtainable: IronCurtainable:
Selectable: Selectable:
Bounds: 38,32,0,0 Bounds: 38,32,0,0
WithMuzzleFlash@PRIMARY: WithMuzzleFlash:
WithMuzzleFlash@SECONDARY:
Armament: secondary
LeavesHusk: LeavesHusk:
HuskActor: HIND.Husk HuskActor: HIND.Husk
SmokeTrailWhenDamaged: SmokeTrailWhenDamaged:

View File

@@ -181,6 +181,7 @@ CA:
LocalOffset: 480,-100,40, 480,100,40 LocalOffset: 480,-100,40, 480,100,40
Recoil: 171 Recoil: 171
RecoilRecovery: 34 RecoilRecovery: 34
MuzzleSequence: muzzle
Armament@SECONDARY: Armament@SECONDARY:
Name: secondary Name: secondary
Turret: secondary Turret: secondary
@@ -188,10 +189,9 @@ CA:
LocalOffset: 480,-100,40, 480,100,40 LocalOffset: 480,-100,40, 480,100,40
Recoil: 171 Recoil: 171
RecoilRecovery: 34 RecoilRecovery: 34
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash@PRIMARY: WithMuzzleFlash:
WithMuzzleFlash@SECONDARY:
Armament: secondary
Selectable: Selectable:
Bounds: 44,44 Bounds: 44,44
RenderUnit: RenderUnit:
@@ -262,11 +262,13 @@ PT:
Armament@PRIMARY: Armament@PRIMARY:
Weapon: 2Inch Weapon: 2Inch
LocalOffset: 208,0,48 LocalOffset: 208,0,48
MuzzleSequence: muzzle
Armament@SECONDARY: Armament@SECONDARY:
Name: secondary Name: secondary
Weapon: DepthCharge Weapon: DepthCharge
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash@PRIMARY: WithMuzzleFlash:
Selectable: Selectable:
Bounds: 32,32 Bounds: 32,32
RenderUnit: RenderUnit:

View File

@@ -351,6 +351,7 @@ AGUN:
Armament: Armament:
Weapon: ZSU-23 Weapon: ZSU-23
LocalOffset: 432,150,-30, 432,-150,-30 LocalOffset: 432,150,-30, 432,-150,-30
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
AutoTarget: AutoTarget:
@@ -624,6 +625,7 @@ HBOX.E1:
Armament: Armament:
Weapon: Vulcan Weapon: Vulcan
LocalOffset: 400,0,48 LocalOffset: 400,0,48
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
Cargo: Cargo:
@@ -723,6 +725,7 @@ GUN:
Armament: Armament:
Weapon: TurretGun Weapon: TurretGun
LocalOffset: 512,0,112 LocalOffset: 512,0,112
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
AutoTarget: AutoTarget:
@@ -802,6 +805,7 @@ SAM:
RenderBuildingTurreted: RenderBuildingTurreted:
Armament: Armament:
Weapon: Nike Weapon: Nike
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
AutoTarget: AutoTarget:

View File

@@ -55,6 +55,7 @@ V2RL:
Recoil: 85 Recoil: 85
RecoilRecovery: 25 RecoilRecovery: 25
LocalOffset: 768,0,90 LocalOffset: 768,0,90
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -95,6 +96,7 @@ V2RL:
Recoil: 128 Recoil: 128
RecoilRecovery: 38 RecoilRecovery: 38
LocalOffset: 720,0,80 LocalOffset: 720,0,80
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -137,6 +139,7 @@ V2RL:
Recoil: 128 Recoil: 128
RecoilRecovery: 38 RecoilRecovery: 38
LocalOffset: 768,85,90, 768,-85,90 LocalOffset: 768,85,90, 768,-85,90
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -181,14 +184,16 @@ V2RL:
LocalOffset: 900,180,340, 900,-180,340 LocalOffset: 900,180,340, 900,-180,340
Recoil: 171 Recoil: 171
RecoilRecovery: 30 RecoilRecovery: 30
MuzzleSequence: muzzle
Armament@SECONDARY: Armament@SECONDARY:
Name: secondary Name: secondary
Weapon: MammothTusk Weapon: MammothTusk
LocalOffset: -85,384,340, -85,-384,340 LocalOffset: -85,384,340, -85,-384,340
LocalYaw: -100,100 LocalYaw: -100,100
Recoil: 43 Recoil: 43
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash@PRIMARY: WithMuzzleFlash:
RenderUnit: RenderUnit:
WithTurret: WithTurret:
AutoTarget: AutoTarget:
@@ -230,6 +235,7 @@ ARTY:
Armament: Armament:
Weapon: 155mm Weapon: 155mm
LocalOffset: 624,0,208 LocalOffset: 624,0,208
MuzzleSequence: muzzle
AttackFrontal: AttackFrontal:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -344,6 +350,7 @@ JEEP:
Offset: 0,0,85 Offset: 0,0,85
Armament: Armament:
Weapon: M60mg Weapon: M60mg
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -377,6 +384,7 @@ APC:
Armament: Armament:
Weapon: M60mg Weapon: M60mg
LocalOffset: 0,0,171 LocalOffset: 0,0,171
MuzzleSequence: muzzle
AttackFrontal: AttackFrontal:
RenderUnit: RenderUnit:
WithMuzzleFlash: WithMuzzleFlash:
@@ -608,6 +616,7 @@ FTRK:
Weapon: FLAK-23 Weapon: FLAK-23
Recoil: 85 Recoil: 85
LocalOffset: 512,0,192 LocalOffset: 512,0,192
MuzzleSequence: muzzle
AttackTurreted: AttackTurreted:
WithMuzzleFlash: WithMuzzleFlash:
RenderUnit: RenderUnit:
@@ -717,6 +726,7 @@ QTNK:
-EjectOnDeath: -EjectOnDeath:
TargetableUnit: TargetableUnit:
TargetTypes: Ground, MADTank TargetTypes: Ground, MADTank
STNK: STNK:
Inherits: ^Vehicle Inherits: ^Vehicle
Buildable: Buildable:
@@ -761,3 +771,4 @@ STNK:
UncloakOnUnload: True UncloakOnUnload: True
DetectCloaked: DetectCloaked:
Range: 6 Range: 6