hack CrateEffect to have a custom offset; add levelup.shp; change > to >= in GainsExperience

This commit is contained in:
Chris Forbes
2010-05-27 19:02:07 +12:00
parent 1bd9dc7536
commit 230625897a
4 changed files with 13 additions and 9 deletions

View File

@@ -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))));
}
}