aftermath rules in yaml too.
This commit is contained in:
@@ -22,7 +22,7 @@ namespace RulesConverter
|
|||||||
|
|
||||||
var rules = new IniFile(ruleStreams);
|
var rules = new IniFile(ruleStreams);
|
||||||
|
|
||||||
var outputFile = args.Single(a => a.EndsWith(".rul"));
|
var outputFile = args.Single(a => !a.EndsWith(".ini"));
|
||||||
|
|
||||||
var categoryMap = new Dictionary<string,Pair<string,string>>
|
var categoryMap = new Dictionary<string,Pair<string,string>>
|
||||||
{
|
{
|
||||||
@@ -156,40 +156,44 @@ namespace RulesConverter
|
|||||||
using (var writer = File.CreateText(outputFile))
|
using (var writer = File.CreateText(outputFile))
|
||||||
{
|
{
|
||||||
foreach (var cat in categoryMap)
|
foreach (var cat in categoryMap)
|
||||||
foreach (var item in rules.GetSection(cat.Key).Select(a => a.Key))
|
try
|
||||||
{
|
{
|
||||||
var iniSection = rules.GetSection(item);
|
foreach (var item in rules.GetSection(cat.Key).Select(a => a.Key))
|
||||||
writer.WriteLine("{0}:", item);
|
|
||||||
writer.WriteLine("\tInherits: {0}", cat.Value.First);
|
|
||||||
|
|
||||||
var traits = iniSection.GetValue("Traits", "")
|
|
||||||
.Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
|
||||||
|
|
||||||
if (iniSection.GetValue("Selectable", "yes") == "yes")
|
|
||||||
traits.Insert(0, "Selectable");
|
|
||||||
|
|
||||||
if (iniSection.GetValue("TechLevel", "-1") != "-1")
|
|
||||||
traits.Insert(0, "Buildable");
|
|
||||||
|
|
||||||
foreach (var t in traits)
|
|
||||||
{
|
{
|
||||||
writer.WriteLine("\t{0}:", t);
|
var iniSection = rules.GetSection(item);
|
||||||
|
writer.WriteLine("{0}:", item);
|
||||||
|
writer.WriteLine("\tInherits: {0}", cat.Value.First);
|
||||||
|
|
||||||
if (traitMap.ContainsKey(t))
|
var traits = iniSection.GetValue("Traits", "")
|
||||||
foreach (var kv in traitMap[t])
|
.Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||||
{
|
|
||||||
var v = kv.Value == "$Tab" ? cat.Value.Second : iniSection.GetValue(kv.Value, "");
|
|
||||||
var fmt = "\t\t{0}: {1}";
|
|
||||||
var k = kv.Key;
|
|
||||||
if (k.StartsWith("@")) { k = k.Substring(1); /*fmt = "\t\t{0}: [{1}]";*/ }
|
|
||||||
if (k.StartsWith("$")) { k = k.Substring(1); fmt = "\t\t{0}: \"{1}\""; }
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(v)) writer.WriteLine(fmt, k, v);
|
if (iniSection.GetValue("Selectable", "yes") == "yes")
|
||||||
}
|
traits.Insert(0, "Selectable");
|
||||||
|
|
||||||
|
if (iniSection.GetValue("TechLevel", "-1") != "-1")
|
||||||
|
traits.Insert(0, "Buildable");
|
||||||
|
|
||||||
|
foreach (var t in traits)
|
||||||
|
{
|
||||||
|
writer.WriteLine("\t{0}:", t);
|
||||||
|
|
||||||
|
if (traitMap.ContainsKey(t))
|
||||||
|
foreach (var kv in traitMap[t])
|
||||||
|
{
|
||||||
|
var v = kv.Value == "$Tab" ? cat.Value.Second : iniSection.GetValue(kv.Value, "");
|
||||||
|
var fmt = "\t\t{0}: {1}";
|
||||||
|
var k = kv.Key;
|
||||||
|
if (k.StartsWith("@")) { k = k.Substring(1); /*fmt = "\t\t{0}: [{1}]";*/ }
|
||||||
|
if (k.StartsWith("$")) { k = k.Substring(1); fmt = "\t\t{0}: \"{1}\""; }
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(v)) writer.WriteLine(fmt, k, v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
writer.WriteLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.WriteLine();
|
|
||||||
}
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
185
aftermath.yaml
Normal file
185
aftermath.yaml
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
STNK:
|
||||||
|
Inherits: DefaultVehicle
|
||||||
|
Selectable:
|
||||||
|
Voice: VehicleVoice
|
||||||
|
Unit:
|
||||||
|
HP: 200
|
||||||
|
Armor: heavy
|
||||||
|
Mobile:
|
||||||
|
Sight: 5
|
||||||
|
ROT: 5
|
||||||
|
Speed: 10
|
||||||
|
Turreted:
|
||||||
|
AttackTurreted:
|
||||||
|
PrimaryWeapon: APTusk
|
||||||
|
Recoil: 2
|
||||||
|
RenderUnitTurreted:
|
||||||
|
Cloak:
|
||||||
|
Chronoshiftable:
|
||||||
|
|
||||||
|
TTNK:
|
||||||
|
Inherits: DefaultVehicle
|
||||||
|
Buildable:
|
||||||
|
TechLevel: 8
|
||||||
|
Tab: Vehicle
|
||||||
|
Prerequisites: tsla
|
||||||
|
Owner: soviet
|
||||||
|
Cost: 1500
|
||||||
|
Description: "Tesla Tank"
|
||||||
|
Selectable:
|
||||||
|
Voice: VehicleVoice
|
||||||
|
Unit:
|
||||||
|
HP: 110
|
||||||
|
Armor: light
|
||||||
|
Crewed: yes
|
||||||
|
Mobile:
|
||||||
|
Sight: 7
|
||||||
|
ROT: 5
|
||||||
|
Speed: 8
|
||||||
|
AttackBase:
|
||||||
|
PrimaryWeapon: TTankZap
|
||||||
|
RenderUnitSpinner:
|
||||||
|
Chronoshiftable:
|
||||||
|
|
||||||
|
CTNK:
|
||||||
|
Inherits: DefaultVehicle
|
||||||
|
Buildable:
|
||||||
|
TechLevel: 12
|
||||||
|
Tab: Vehicle
|
||||||
|
Prerequisites: atek
|
||||||
|
Owner: allies
|
||||||
|
Cost: 2400
|
||||||
|
Description: "Chrono Tank"
|
||||||
|
Selectable:
|
||||||
|
Voice: VehicleVoice
|
||||||
|
Unit:
|
||||||
|
HP: 350
|
||||||
|
Armor: light
|
||||||
|
Mobile:
|
||||||
|
Sight: 5
|
||||||
|
ROT: 5
|
||||||
|
Speed: 5
|
||||||
|
AttackBase:
|
||||||
|
PrimaryWeapon: APTusk
|
||||||
|
RenderUnit:
|
||||||
|
ChronoshiftDeploy:
|
||||||
|
Chronoshiftable:
|
||||||
|
|
||||||
|
DTRK:
|
||||||
|
Inherits: DefaultVehicle
|
||||||
|
Buildable:
|
||||||
|
TechLevel: 13
|
||||||
|
Tab: Vehicle
|
||||||
|
Prerequisites: mslo
|
||||||
|
Owner: allies,soviet
|
||||||
|
Cost: 2400
|
||||||
|
Description: "Demo Truck"
|
||||||
|
Selectable:
|
||||||
|
Voice: VehicleVoice
|
||||||
|
Unit:
|
||||||
|
HP: 110
|
||||||
|
Armor: light
|
||||||
|
Mobile:
|
||||||
|
Sight: 3
|
||||||
|
ROT: 5
|
||||||
|
Speed: 8
|
||||||
|
AttackBase:
|
||||||
|
PrimaryWeapon: Democharge
|
||||||
|
RenderUnit:
|
||||||
|
DemoTruck:
|
||||||
|
|
||||||
|
QTNK:
|
||||||
|
Inherits: DefaultVehicle
|
||||||
|
Buildable:
|
||||||
|
TechLevel: 10
|
||||||
|
Tab: Vehicle
|
||||||
|
Prerequisites: stek
|
||||||
|
Owner: soviet
|
||||||
|
Cost: 2300
|
||||||
|
Description: "M.A.D. Tank"
|
||||||
|
Selectable:
|
||||||
|
Voice: VehicleVoice
|
||||||
|
Unit:
|
||||||
|
HP: 300
|
||||||
|
Armor: heavy
|
||||||
|
Crewed: no
|
||||||
|
Mobile:
|
||||||
|
Sight: 6
|
||||||
|
ROT: 5
|
||||||
|
Speed: 3
|
||||||
|
RenderUnit:
|
||||||
|
Chronoshiftable:
|
||||||
|
|
||||||
|
MSUB:
|
||||||
|
Inherits: DefaultShip
|
||||||
|
Buildable:
|
||||||
|
TechLevel: 9
|
||||||
|
Tab: Ship
|
||||||
|
Prerequisites: stek
|
||||||
|
Owner: soviet
|
||||||
|
Cost: 1650
|
||||||
|
Description: "Missile Submarine"
|
||||||
|
Selectable:
|
||||||
|
Unit:
|
||||||
|
HP: 150
|
||||||
|
Armor: light
|
||||||
|
Mobile:
|
||||||
|
Sight: 6
|
||||||
|
ROT: 7
|
||||||
|
Speed: 5
|
||||||
|
AttackBase:
|
||||||
|
PrimaryWeapon: SubSCUD
|
||||||
|
RenderUnit:
|
||||||
|
Submarine:
|
||||||
|
Chronoshiftable:
|
||||||
|
|
||||||
|
SHOK:
|
||||||
|
Inherits: DefaultInfantry
|
||||||
|
Buildable:
|
||||||
|
TechLevel: 7
|
||||||
|
Tab: Infantry
|
||||||
|
Prerequisites: tsla
|
||||||
|
Owner: soviet
|
||||||
|
Cost: 900
|
||||||
|
Description: "Tesla Trooper"
|
||||||
|
Selectable:
|
||||||
|
Voice: ShokVoice
|
||||||
|
Unit:
|
||||||
|
HP: 80
|
||||||
|
Armor: none
|
||||||
|
Mobile:
|
||||||
|
Sight: 4
|
||||||
|
Speed: 3
|
||||||
|
AttackBase:
|
||||||
|
PrimaryWeapon: PortaTesla
|
||||||
|
RenderInfantry:
|
||||||
|
TakeCover:
|
||||||
|
Passenger:
|
||||||
|
|
||||||
|
MECH:
|
||||||
|
Inherits: DefaultInfantry
|
||||||
|
Buildable:
|
||||||
|
TechLevel: 7
|
||||||
|
Tab: Infantry
|
||||||
|
Prerequisites: fix
|
||||||
|
Owner: allies
|
||||||
|
Cost: 950
|
||||||
|
Description: "Mechanic"
|
||||||
|
LongDesc: "Heals nearby vehicles.\n Strong vs Nothing\n Weak vs Everything"
|
||||||
|
Selectable:
|
||||||
|
Voice: MechVoice
|
||||||
|
Bounds: 12,17,0,-9
|
||||||
|
Unit:
|
||||||
|
HP: 60
|
||||||
|
Armor: none
|
||||||
|
Mobile:
|
||||||
|
Sight: 3
|
||||||
|
Speed: 4
|
||||||
|
RenderInfantry:
|
||||||
|
AutoHeal:
|
||||||
|
AttackBase:
|
||||||
|
PrimaryWeapon: GoodWrench
|
||||||
|
TakeCover:
|
||||||
|
SquishByTank:
|
||||||
|
Passenger:
|
||||||
|
|
||||||
2
regen-yaml.cmd
Normal file
2
regen-yaml.cmd
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
RulesConverter/bin/debug/RulesConverter units.ini rules.ini ra.yaml
|
||||||
|
RulesConverter/bin/debug/RulesConverter aftermathUnits.ini aftrmath.ini aftermath.yaml
|
||||||
Reference in New Issue
Block a user