Removed reflection hack and added nuke WeaponInfo to rules.ini

This commit is contained in:
Matthew Bowra-Dean
2010-03-06 21:13:48 +13:00
parent 314a8a619b
commit 2c2f014342
2 changed files with 8 additions and 5 deletions

View File

@@ -79,11 +79,7 @@ namespace OpenRA.Effects
void Explode(World world) void Explode(World world)
{ {
world.AddFrameEndTask(w => w.Remove(this)); world.AddFrameEndTask(w => w.Remove(this));
var weapon = new WeaponInfo(); var weapon = Rules.WeaponInfo["Atomic"];
//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");
Combat.DoImpact(pos.ToInt2(), pos.ToInt2(), weapon, projectileDown, nukeWarhead, silo); Combat.DoImpact(pos.ToInt2(), pos.ToInt2(), weapon, projectileDown, nukeWarhead, silo);
} }

View File

@@ -445,6 +445,12 @@ Speed=25
Warhead=HE Warhead=HE
Report=MISSILE1 Report=MISSILE1
;Nuke (special case for Nuclear missile)
[Atomic]
Damage=1000
Projectile=NukeDown
Warhead=Nuke
; ******* Projectile Statistics ******* ; ******* Projectile Statistics *******
; Projectiles describe how and what image to use as the weapon flies ; Projectiles describe how and what image to use as the weapon flies
@@ -817,6 +823,7 @@ DogJaw
Heal Heal
SCUD SCUD
UnitExplode UnitExplode
Atomic
[TeslaZap] [TeslaZap]
RenderAsTesla=true RenderAsTesla=true