diff --git a/OpenRA.Mods.RA/Effects/CrateEffect.cs b/OpenRA.Mods.RA/Effects/CrateEffect.cs index 49f69d5269..9139c59cc0 100644 --- a/OpenRA.Mods.RA/Effects/CrateEffect.cs +++ b/OpenRA.Mods.RA/Effects/CrateEffect.cs @@ -29,7 +29,13 @@ namespace OpenRA.Mods.RA.Effects { Actor a; Animation anim = new Animation("crate-effects"); - float2 doorOffset = new float2(-4,0); + float2 offset = new float2(-4,0); + + public CrateEffect(Actor a, string seq, int2 offset) + : this(a, seq) + { + this.offset = offset; + } public CrateEffect(Actor a, string seq) { @@ -46,7 +52,7 @@ namespace OpenRA.Mods.RA.Effects public IEnumerable Render() { yield return new Renderable(anim.Image, - a.CenterLocation - .5f * anim.Image.size + doorOffset, "effect"); + a.CenterLocation - .5f * anim.Image.size + offset, "effect"); } } } diff --git a/OpenRA.Mods.RA/GainsExperience.cs b/OpenRA.Mods.RA/GainsExperience.cs index 2f3249292e..7774b6c73a 100644 --- a/OpenRA.Mods.RA/GainsExperience.cs +++ b/OpenRA.Mods.RA/GainsExperience.cs @@ -58,17 +58,14 @@ namespace OpenRA.Mods.RA { Experience += amount; - while (Level < Levels.Count() - 1 && Experience > Levels[Level]) + while (Level < Levels.Count() - 1 && Experience >= Levels[Level]) { Level++; - // TODO: Show an effect or play a sound or something - Log.Write("{0} became Level {1}".F(self.Info.Name, Level)); +// Game.Debug("{0} became Level {1}".F(self.Info.Name, Level)); - self.World.AddFrameEndTask(w => - { - w.Add(new CrateEffect(self, "speed")); - }); + Sound.PlayToPlayer(self.Owner, "hydrod1.aud", self.CenterLocation); + self.World.AddFrameEndTask(w => w.Add(new CrateEffect(self, "levelup", new int2(0,-24)))); } } diff --git a/mods/ra/levelup.shp b/mods/ra/levelup.shp new file mode 100644 index 0000000000..eec8a7f72c Binary files /dev/null and b/mods/ra/levelup.shp differ diff --git a/mods/ra/sequences.xml b/mods/ra/sequences.xml index 64d1591aa0..94f8c8ca7b 100644 --- a/mods/ra/sequences.xml +++ b/mods/ra/sequences.xml @@ -844,6 +844,7 @@ +