fix mslo nuke offset

This commit is contained in:
Chris Forbes
2010-08-01 13:03:53 +12:00
parent 5b5378ae6c
commit 718b0e7613
3 changed files with 11 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Effects
bool goingUp = true;
string weapon;
public NukeLaunch(Actor silo, string weapon, int2 targetLocation)
public NukeLaunch(Actor silo, string weapon, int2 spawnOffset, int2 targetLocation)
{
this.silo = silo;
this.targetLocation = targetLocation;
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.RA.Effects
StartDescent(Game.world);
}
else
pos = silo.CenterLocation;
pos = silo.CenterLocation + spawnOffset;
}
void StartDescent(World world)

View File

@@ -60,15 +60,20 @@ namespace OpenRA.Mods.RA
{
[WeaponReference]
public readonly string MissileWeapon = "";
public object Create(ActorInitializer init) { return new NukeSilo(init.self); }
public readonly int2 SpawnOffset = int2.Zero;
public object Create(ActorInitializer init) { return new NukeSilo(init.self, this); }
}
class NukeSilo
{
Actor self;
public NukeSilo(Actor self)
NukeSiloInfo info;
public NukeSilo(Actor self, NukeSiloInfo info)
{
this.self = self;
this.info = info;
}
public void Attack(int2 targetLocation)
@@ -78,7 +83,7 @@ namespace OpenRA.Mods.RA
self.World.AddFrameEndTask(w =>
{
//FIRE ZE MISSILES
w.Add(new NukeLaunch(self, self.Info.Traits.Get<NukeSiloInfo>().MissileWeapon, targetLocation));
w.Add(new NukeLaunch(self, info.MissileWeapon, info.SpawnOffset, targetLocation));
});
}
}

View File

@@ -2,6 +2,7 @@ MSLO:
Category: Defense
NukeSilo:
MissileWeapon: atomic
SpawnOffset: 10,0
Inherits: ^Building
Buildable:
BuildPaletteOrder: 130