fix mslo nuke offset
This commit is contained in:
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
bool goingUp = true;
|
bool goingUp = true;
|
||||||
string weapon;
|
string weapon;
|
||||||
|
|
||||||
public NukeLaunch(Actor silo, string weapon, int2 targetLocation)
|
public NukeLaunch(Actor silo, string weapon, int2 spawnOffset, int2 targetLocation)
|
||||||
{
|
{
|
||||||
this.silo = silo;
|
this.silo = silo;
|
||||||
this.targetLocation = targetLocation;
|
this.targetLocation = targetLocation;
|
||||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
StartDescent(Game.world);
|
StartDescent(Game.world);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pos = silo.CenterLocation;
|
pos = silo.CenterLocation + spawnOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartDescent(World world)
|
void StartDescent(World world)
|
||||||
|
|||||||
@@ -60,15 +60,20 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
[WeaponReference]
|
[WeaponReference]
|
||||||
public readonly string MissileWeapon = "";
|
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
|
class NukeSilo
|
||||||
{
|
{
|
||||||
Actor self;
|
Actor self;
|
||||||
public NukeSilo(Actor self)
|
NukeSiloInfo info;
|
||||||
|
|
||||||
|
public NukeSilo(Actor self, NukeSiloInfo info)
|
||||||
{
|
{
|
||||||
this.self = self;
|
this.self = self;
|
||||||
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Attack(int2 targetLocation)
|
public void Attack(int2 targetLocation)
|
||||||
@@ -78,7 +83,7 @@ namespace OpenRA.Mods.RA
|
|||||||
self.World.AddFrameEndTask(w =>
|
self.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
//FIRE ZE MISSILES
|
//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
|
Category: Defense
|
||||||
NukeSilo:
|
NukeSilo:
|
||||||
MissileWeapon: atomic
|
MissileWeapon: atomic
|
||||||
|
SpawnOffset: 10,0
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
Buildable:
|
Buildable:
|
||||||
BuildPaletteOrder: 130
|
BuildPaletteOrder: 130
|
||||||
|
|||||||
Reference in New Issue
Block a user