Add an upgrade rule for DeathSounds.DeathTypes

This commit is contained in:
penev92
2015-05-16 02:22:08 +03:00
parent 1c44fcbad4
commit 9ea78285fa
5 changed files with 28 additions and 13 deletions

View File

@@ -11,7 +11,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO;
using System.Linq; using System.Linq;
namespace OpenRA.Mods.Common.UtilityCommands namespace OpenRA.Mods.Common.UtilityCommands
@@ -868,7 +867,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
var rearmSound = minelayerFields.FirstOrDefault(rs => rs.Key == "RearmSound"); var rearmSound = minelayerFields.FirstOrDefault(rs => rs.Key == "RearmSound");
var minelayerRearmSound = rearmSound != null ? FieldLoader.GetValue<string>("RearmSound", rearmSound.Value.Value) : "minelay1.aud"; var minelayerRearmSound = rearmSound != null ? FieldLoader.GetValue<string>("RearmSound", rearmSound.Value.Value) : "minelay1.aud";
limitedAmmoFields.Add(new MiniYamlNode("RearmSound", minelayerRearmSound.ToString())); limitedAmmoFields.Add(new MiniYamlNode("RearmSound", minelayerRearmSound));
minelayerFields.Remove(rearmSound); minelayerFields.Remove(rearmSound);
} }
} }
@@ -1001,6 +1000,22 @@ namespace OpenRA.Mods.Common.UtilityCommands
node.Value.Nodes.RemoveAll(p => p.Key == "Voice"); node.Value.Nodes.RemoveAll(p => p.Key == "Voice");
} }
if (engineVersion < 20150524)
{
// Replace numbers with strings for DeathSounds.DeathType
if (node.Key.StartsWith("DeathSounds"))
{
var deathTypes = node.Value.Nodes.FirstOrDefault(x => x.Key == "DeathTypes");
if (deathTypes != null)
{
var types = FieldLoader.GetValue<string[]>("DeathTypes", deathTypes.Value.Value);
deathTypes.Value.Value = string.Join(", ", types.Select(type => "DeathType" + type));
RenameDamageTypes(deathTypes);
}
}
}
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
} }
} }
@@ -1420,7 +1435,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
} }
} }
if (engineVersion < 20150517) if (engineVersion < 20150524)
{ {
// Remove DeathType from DamageWarhead // Remove DeathType from DamageWarhead
if (node.Key.StartsWith("Warhead") && node.Value.Value == "SpreadDamage") if (node.Key.StartsWith("Warhead") && node.Value.Value == "SpreadDamage")

View File

@@ -233,13 +233,13 @@
Range: 1 Range: 1
ScriptTriggers: ScriptTriggers:
DeathSounds@NORMAL: DeathSounds@NORMAL:
DeathTypes: 1, 2, 3, 4 DeathTypes: DefaultDeath, BulletDeath, SmallExplosionDeath, ExplosionDeath
DeathSounds@BURNED: DeathSounds@BURNED:
DeathSound: Burned DeathSound: Burned
DeathTypes: 5 DeathTypes: FireDeath
DeathSounds@POISONED: DeathSounds@POISONED:
DeathSound: Poisoned DeathSound: Poisoned
DeathTypes: 6 DeathTypes: TiberiumDeath
GainsStatUpgrades: GainsStatUpgrades:
SelfHealing@ELITE: SelfHealing@ELITE:
Step: 2 Step: 2

View File

@@ -230,7 +230,7 @@
Huntable: Huntable:
ScriptTriggers: ScriptTriggers:
DeathSounds: DeathSounds:
DeathTypes: 1, 2, 3, 4 DeathTypes: ExplosionDeath, SoundDeath, SmallExplosionDeath, BulletDeath
Parachutable: Parachutable:
FallRate: 130 FallRate: 130
GainsStatUpgrades: GainsStatUpgrades:

View File

@@ -210,13 +210,13 @@
Upgrades: hospitalheal Upgrades: hospitalheal
Prerequisites: hosp Prerequisites: hosp
DeathSounds@NORMAL: DeathSounds@NORMAL:
DeathTypes: 1, 2, 3, 4 DeathTypes: DefaultDeath, BulletDeath, SmallExplosionDeath, ExplosionDeath
DeathSounds@BURNED: DeathSounds@BURNED:
DeathSound: Burned DeathSound: Burned
DeathTypes: 5 DeathTypes: FireDeath
DeathSounds@ZAPPED: DeathSounds@ZAPPED:
DeathSound: Zapped DeathSound: Zapped
DeathTypes: 6 DeathTypes: ElectricityDeath
Parachutable: Parachutable:
ParachuteOffset: 0,0,427 ParachuteOffset: 0,0,427
KilledOnImpassableTerrain: true KilledOnImpassableTerrain: true

View File

@@ -241,13 +241,13 @@
Huntable: Huntable:
ScriptTriggers: ScriptTriggers:
DeathSounds@NORMAL: DeathSounds@NORMAL:
DeathTypes: 1, 2, 3 DeathTypes: BulletDeath, SmallExplosionDeath, ExplosionDeath
DeathSounds@BURNED: DeathSounds@BURNED:
DeathSound: Burned DeathSound: Burned
DeathTypes: 5 DeathTypes: FireDeath
DeathSounds@ZAPPED: DeathSounds@ZAPPED:
DeathSound: Zapped DeathSound: Zapped
DeathTypes: 6 DeathTypes: EnergyDeath
UpgradeManager: UpgradeManager:
Cloak@CLOAKGENERATOR: Cloak@CLOAKGENERATOR:
UpgradeTypes: cloakgenerator UpgradeTypes: cloakgenerator