Makes rank chevron palette customizable.

Adds levelup crate-effect and art.
This commit is contained in:
reaperrr
2014-04-23 21:21:21 +02:00
parent 082667eeea
commit 6ae4b74535
7 changed files with 34 additions and 5 deletions

View File

@@ -19,10 +19,12 @@ namespace OpenRA.Mods.RA.Effects
{
Actor self;
Animation anim = new Animation("rank");
readonly string paletteName;
public Rank(Actor self)
public Rank(Actor self, string paletteName)
{
this.self = self;
this.paletteName = paletteName;
var xp = self.Trait<GainsExperience>();
anim.PlayRepeating("rank");
@@ -55,9 +57,10 @@ namespace OpenRA.Mods.RA.Effects
var bounds = self.Bounds.Value;
bounds.Offset(pos.X, pos.Y);
var palette = wr.Palette(paletteName);
var offset = (int)(4 / wr.Viewport.Zoom);
var effectPos = wr.Position(new int2(bounds.Right - offset, bounds.Bottom - offset));
yield return new SpriteRenderable(anim.Image, effectPos, WVec.Zero, 0, wr.Palette("effect"), 1f / wr.Viewport.Zoom, true);
yield return new SpriteRenderable(anim.Image, effectPos, WVec.Zero, 0, palette, 1f / wr.Viewport.Zoom, true);
}
}
}

View File

@@ -23,6 +23,7 @@ namespace OpenRA.Mods.RA
public readonly float[] FirepowerModifier = { 1.1f, 1.15f, 1.2f, 1.5f };
public readonly float[] ArmorModifier = { 1.1f, 1.2f, 1.3f, 1.5f };
public readonly decimal[] SpeedModifier = { 1.1m, 1.15m, 1.2m, 1.5m };
public readonly string ChevronPalette = "effect";
public object Create(ActorInitializer init) { return new GainsExperience(init, this); }
}
@@ -75,7 +76,7 @@ namespace OpenRA.Mods.RA
self.World.AddFrameEndTask(w =>
{
if (!self.IsDead())
w.Add(new Rank(self));
w.Add(new Rank(self, info.ChevronPalette));
});
}
}

BIN
mods/ts/bits/levelup.shp Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -107,6 +107,11 @@
CargoType: Infantry
HiddenUnderFog:
GainsExperience:
ChevronPalette: ra
CostThreshold: 5, 10
FirepowerModifier: 1.2, 1.5
ArmorModifier: 1.2, 1.5
SpeedModifier: 1.2, 1.5
GivesExperience:
DrawLineToTarget:
ActorLostNotification:
@@ -172,6 +177,11 @@
AttackMove:
HiddenUnderFog:
GainsExperience:
ChevronPalette: ra
CostThreshold: 5, 10
FirepowerModifier: 1.2, 1.5
ArmorModifier: 1.2, 1.5
SpeedModifier: 1.2, 1.5
GivesExperience:
DrawLineToTarget:
ActorLostNotification:
@@ -204,6 +214,11 @@
HiddenUnderFog:
AttackMove:
GainsExperience:
ChevronPalette: ra
CostThreshold: 5, 10
FirepowerModifier: 1.2, 1.5
ArmorModifier: 1.2, 1.5
SpeedModifier: 1.2, 1.5
GivesExperience:
DrawLineToTarget:
ActorLostNotification:

View File

@@ -17,6 +17,10 @@ World:
Filename: cameo.pal
AllowModifiers: false
ShadowIndex: 242
PaletteFromFile@ra:
Name: ra
Filename: palette.pal
ShadowIndex: 4
PaletteFromFile@effect:
Name: effect
Filename: anim.pal

View File

@@ -53,10 +53,16 @@ beacon:
Length: 12
BlendMode: Additive
rank: # TODO: backfall to RA asset
rank:
crate-effects:
levelup: levelup
Start: 0
Length: *
Tick: 200
rank:
rank: pips
Start: 7
Length: 2
mpspawn: # TODO: backfall to RA asset
idle: