annotate spy satellite related palettes and sprites

This commit is contained in:
Matthias Mailänder
2016-01-24 17:14:58 +01:00
parent 38625ec6f8
commit a2398d2e00
3 changed files with 26 additions and 10 deletions

View File

@@ -11,20 +11,23 @@
using System.Collections.Generic;
using OpenRA.Effects;
using OpenRA.Graphics;
using OpenRA.Mods.RA.Traits;
namespace OpenRA.Mods.RA.Effects
{
class GpsSatellite : IEffect
{
readonly GpsPowerInfo info;
readonly Animation anim;
WPos pos;
public GpsSatellite(World world, WPos pos)
public GpsSatellite(World world, WPos pos, GpsPowerInfo info)
{
this.info = info;
this.pos = pos;
anim = new Animation(world, "sputnik");
anim.PlayRepeating("idle");
anim = new Animation(world, info.SatelliteImage);
anim.PlayRepeating(info.SatelliteSequence);
}
public void Tick(World world)
@@ -38,7 +41,7 @@ namespace OpenRA.Mods.RA.Effects
public IEnumerable<IRenderable> Render(WorldRenderer wr)
{
return anim.Render(pos, wr.Palette("effect"));
return anim.Render(pos, wr.Palette(info.SatellitePalette));
}
}
}

View File

@@ -11,20 +11,23 @@
using System.Collections.Generic;
using OpenRA.Effects;
using OpenRA.Graphics;
using OpenRA.Mods.RA.Traits;
namespace OpenRA.Mods.RA.Effects
{
class SatelliteLaunch : IEffect
{
readonly GpsPowerInfo info;
readonly Animation doors;
readonly WPos pos;
int frame = 0;
public SatelliteLaunch(Actor a)
public SatelliteLaunch(Actor a, GpsPowerInfo info)
{
doors = new Animation(a.World, "atek");
this.info = info;
doors.PlayThen("active",
doors = new Animation(a.World, info.DoorImage);
doors.PlayThen(info.DoorSequence,
() => a.World.AddFrameEndTask(w => w.Remove(this)));
pos = a.CenterPosition;
@@ -35,12 +38,12 @@ namespace OpenRA.Mods.RA.Effects
doors.Tick();
if (++frame == 19)
world.AddFrameEndTask(w => w.Add(new GpsSatellite(world, pos)));
world.AddFrameEndTask(w => w.Add(new GpsSatellite(world, pos, info)));
}
public IEnumerable<IRenderable> Render(WorldRenderer wr)
{
return doors.Render(pos, wr.Palette("effect"));
return doors.Render(pos, wr.Palette(info.DoorPalette));
}
}
}