Makes rank chevron palette customizable.
Adds levelup crate-effect and art.
This commit is contained in:
@@ -19,10 +19,12 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
{
|
{
|
||||||
Actor self;
|
Actor self;
|
||||||
Animation anim = new Animation("rank");
|
Animation anim = new Animation("rank");
|
||||||
|
readonly string paletteName;
|
||||||
|
|
||||||
public Rank(Actor self)
|
public Rank(Actor self, string paletteName)
|
||||||
{
|
{
|
||||||
this.self = self;
|
this.self = self;
|
||||||
|
this.paletteName = paletteName;
|
||||||
var xp = self.Trait<GainsExperience>();
|
var xp = self.Trait<GainsExperience>();
|
||||||
|
|
||||||
anim.PlayRepeating("rank");
|
anim.PlayRepeating("rank");
|
||||||
@@ -55,9 +57,10 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
var bounds = self.Bounds.Value;
|
var bounds = self.Bounds.Value;
|
||||||
bounds.Offset(pos.X, pos.Y);
|
bounds.Offset(pos.X, pos.Y);
|
||||||
|
|
||||||
|
var palette = wr.Palette(paletteName);
|
||||||
var offset = (int)(4 / wr.Viewport.Zoom);
|
var offset = (int)(4 / wr.Viewport.Zoom);
|
||||||
var effectPos = wr.Position(new int2(bounds.Right - offset, bounds.Bottom - offset));
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public readonly float[] FirepowerModifier = { 1.1f, 1.15f, 1.2f, 1.5f };
|
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 float[] ArmorModifier = { 1.1f, 1.2f, 1.3f, 1.5f };
|
||||||
public readonly decimal[] SpeedModifier = { 1.1m, 1.15m, 1.2m, 1.5m };
|
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); }
|
public object Create(ActorInitializer init) { return new GainsExperience(init, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ namespace OpenRA.Mods.RA
|
|||||||
self.World.AddFrameEndTask(w =>
|
self.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
if (!self.IsDead())
|
if (!self.IsDead())
|
||||||
w.Add(new Rank(self));
|
w.Add(new Rank(self, info.ChevronPalette));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
mods/ts/bits/levelup.shp
Normal file
BIN
mods/ts/bits/levelup.shp
Normal file
Binary file not shown.
Binary file not shown.
@@ -107,6 +107,11 @@
|
|||||||
CargoType: Infantry
|
CargoType: Infantry
|
||||||
HiddenUnderFog:
|
HiddenUnderFog:
|
||||||
GainsExperience:
|
GainsExperience:
|
||||||
|
ChevronPalette: ra
|
||||||
|
CostThreshold: 5, 10
|
||||||
|
FirepowerModifier: 1.2, 1.5
|
||||||
|
ArmorModifier: 1.2, 1.5
|
||||||
|
SpeedModifier: 1.2, 1.5
|
||||||
GivesExperience:
|
GivesExperience:
|
||||||
DrawLineToTarget:
|
DrawLineToTarget:
|
||||||
ActorLostNotification:
|
ActorLostNotification:
|
||||||
@@ -172,6 +177,11 @@
|
|||||||
AttackMove:
|
AttackMove:
|
||||||
HiddenUnderFog:
|
HiddenUnderFog:
|
||||||
GainsExperience:
|
GainsExperience:
|
||||||
|
ChevronPalette: ra
|
||||||
|
CostThreshold: 5, 10
|
||||||
|
FirepowerModifier: 1.2, 1.5
|
||||||
|
ArmorModifier: 1.2, 1.5
|
||||||
|
SpeedModifier: 1.2, 1.5
|
||||||
GivesExperience:
|
GivesExperience:
|
||||||
DrawLineToTarget:
|
DrawLineToTarget:
|
||||||
ActorLostNotification:
|
ActorLostNotification:
|
||||||
@@ -204,6 +214,11 @@
|
|||||||
HiddenUnderFog:
|
HiddenUnderFog:
|
||||||
AttackMove:
|
AttackMove:
|
||||||
GainsExperience:
|
GainsExperience:
|
||||||
|
ChevronPalette: ra
|
||||||
|
CostThreshold: 5, 10
|
||||||
|
FirepowerModifier: 1.2, 1.5
|
||||||
|
ArmorModifier: 1.2, 1.5
|
||||||
|
SpeedModifier: 1.2, 1.5
|
||||||
GivesExperience:
|
GivesExperience:
|
||||||
DrawLineToTarget:
|
DrawLineToTarget:
|
||||||
ActorLostNotification:
|
ActorLostNotification:
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ World:
|
|||||||
Filename: cameo.pal
|
Filename: cameo.pal
|
||||||
AllowModifiers: false
|
AllowModifiers: false
|
||||||
ShadowIndex: 242
|
ShadowIndex: 242
|
||||||
|
PaletteFromFile@ra:
|
||||||
|
Name: ra
|
||||||
|
Filename: palette.pal
|
||||||
|
ShadowIndex: 4
|
||||||
PaletteFromFile@effect:
|
PaletteFromFile@effect:
|
||||||
Name: effect
|
Name: effect
|
||||||
Filename: anim.pal
|
Filename: anim.pal
|
||||||
|
|||||||
@@ -53,10 +53,16 @@ beacon:
|
|||||||
Length: 12
|
Length: 12
|
||||||
BlendMode: Additive
|
BlendMode: Additive
|
||||||
|
|
||||||
rank: # TODO: backfall to RA asset
|
crate-effects:
|
||||||
rank:
|
levelup: levelup
|
||||||
Start: 0
|
Start: 0
|
||||||
Length: *
|
Length: *
|
||||||
|
Tick: 200
|
||||||
|
|
||||||
|
rank:
|
||||||
|
rank: pips
|
||||||
|
Start: 7
|
||||||
|
Length: 2
|
||||||
|
|
||||||
mpspawn: # TODO: backfall to RA asset
|
mpspawn: # TODO: backfall to RA asset
|
||||||
idle:
|
idle:
|
||||||
|
|||||||
Reference in New Issue
Block a user