fix various breakage in nuke code

This commit is contained in:
Chris Forbes
2010-06-09 20:02:27 +12:00
parent 1bd7a9b590
commit 3870be5122
3 changed files with 8 additions and 12 deletions

View File

@@ -26,27 +26,22 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA.Effects namespace OpenRA.Mods.RA.Effects
{ {
class NukeInfo : IProjectileInfo
{
public readonly string Image = null;
public IEffect Create(ProjectileArgs args) { return null; }
}
class NukeLaunch : IEffect class NukeLaunch : IEffect
{ {
readonly Actor silo; readonly Actor silo;
Animation anim; Animation anim;
float2 pos; float2 pos;
int2 targetLocation; int2 targetLocation;
readonly int targetAltitude = 400;
int altitude; int altitude;
bool goingUp = true; bool goingUp = true;
string weapon;
public NukeLaunch(Actor silo, string weapon, int2 targetLocation) public NukeLaunch(Actor silo, string weapon, int2 targetLocation)
{ {
this.silo = silo; this.silo = silo;
this.targetLocation = targetLocation; this.targetLocation = targetLocation;
anim = new Animation("nuke"); this.weapon = weapon;
anim = new Animation(weapon);
anim.PlayRepeating("up"); anim.PlayRepeating("up");
if (silo == null) if (silo == null)
@@ -61,7 +56,6 @@ namespace OpenRA.Mods.RA.Effects
void StartDescent(World world) void StartDescent(World world)
{ {
pos = OpenRA.Traits.Util.CenterOfCell(targetLocation); pos = OpenRA.Traits.Util.CenterOfCell(targetLocation);
anim = new Animation("nuke");
anim.PlayRepeating("down"); anim.PlayRepeating("down");
goingUp = false; goingUp = false;
} }
@@ -93,7 +87,7 @@ namespace OpenRA.Mods.RA.Effects
void Explode(World world) void Explode(World world)
{ {
world.AddFrameEndTask(w => w.Remove(this)); world.AddFrameEndTask(w => w.Remove(this));
Combat.DoExplosion(silo.Owner.PlayerActor, "Atomic", pos.ToInt2(), 0); Combat.DoExplosion(silo.Owner.PlayerActor, weapon, pos.ToInt2(), 0);
world.WorldActor.traits.Get<ScreenShaker>().AddEffect(20, pos, 5); world.WorldActor.traits.Get<ScreenShaker>().AddEffect(20, pos, 5);
} }

View File

@@ -936,4 +936,8 @@
<unit name="rank"> <unit name="rank">
<sequence name="rank" start="0" length="4" /> <sequence name="rank" start="0" length="4" />
</unit> </unit>
<unit name="atomic">
<sequence name="up" start="0" length="4" src="atomicup" />
<sequence name="down" start="0" length="4" src="atomicdn" />
</unit>
</sequences> </sequences>

View File

@@ -619,8 +619,6 @@ SCUD:
Damage: 600 Damage: 600
Atomic: Atomic:
Nuke:
Image: Nuke
Warhead@impact: Warhead@impact:
Damage: 1000 Damage: 1000
Spread: 6 Spread: 6