From 2c2f0143421585ae5f0e2db0b7ef6deca22160c8 Mon Sep 17 00:00:00 2001 From: Matthew Bowra-Dean Date: Sat, 6 Mar 2010 21:13:48 +1300 Subject: [PATCH] Removed reflection hack and added nuke WeaponInfo to rules.ini --- OpenRA.Game/Effects/NukeLaunch.cs | 6 +----- mods/ra/rules.ini | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenRA.Game/Effects/NukeLaunch.cs b/OpenRA.Game/Effects/NukeLaunch.cs index 36abd1d384..76ce40a7ff 100644 --- a/OpenRA.Game/Effects/NukeLaunch.cs +++ b/OpenRA.Game/Effects/NukeLaunch.cs @@ -79,11 +79,7 @@ namespace OpenRA.Effects void Explode(World world) { world.AddFrameEndTask(w => w.Remove(this)); - var weapon = new WeaponInfo(); - //Epic reflection hack that'll probably break on mono - typeof(WeaponInfo).GetField("Damage").SetValue(weapon, 1000); - typeof(WeaponInfo).GetField("Projectile").SetValue(weapon, "NukeDown"); - typeof(WeaponInfo).GetField("Warhead").SetValue(weapon, "Nuke"); + var weapon = Rules.WeaponInfo["Atomic"]; Combat.DoImpact(pos.ToInt2(), pos.ToInt2(), weapon, projectileDown, nukeWarhead, silo); } diff --git a/mods/ra/rules.ini b/mods/ra/rules.ini index b699902464..5258c70d6b 100644 --- a/mods/ra/rules.ini +++ b/mods/ra/rules.ini @@ -445,6 +445,12 @@ Speed=25 Warhead=HE Report=MISSILE1 +;Nuke (special case for Nuclear missile) +[Atomic] +Damage=1000 +Projectile=NukeDown +Warhead=Nuke + ; ******* Projectile Statistics ******* ; Projectiles describe how and what image to use as the weapon flies @@ -817,6 +823,7 @@ DogJaw Heal SCUD UnitExplode +Atomic [TeslaZap] RenderAsTesla=true