fix mslo nuke offset
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ MSLO:
|
||||
Category: Defense
|
||||
NukeSilo:
|
||||
MissileWeapon: atomic
|
||||
SpawnOffset: 10,0
|
||||
Inherits: ^Building
|
||||
Buildable:
|
||||
BuildPaletteOrder: 130
|
||||
|
||||
Reference in New Issue
Block a user