Skip to content

Commit

Permalink
Rocket smoke.
Browse files Browse the repository at this point in the history
  • Loading branch information
IceReaper committed Mar 8, 2023
1 parent e643a35 commit 637e506
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
10 changes: 10 additions & 0 deletions OpenRA.Mods.OpenE2140/Assets/VirtualAssets/VirtualAssetsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ private record FrameInfo(int Frame, bool FlipX);
private static readonly Color[] LightOffPalette;
private static readonly Color[] PlayerPalette;
private static readonly Color[] ShadowsPalette;
private static readonly Color[] SmokePalette;

static VirtualAssetsBuilder()
{
Expand Down Expand Up @@ -100,6 +101,12 @@ static VirtualAssetsBuilder()
VirtualAssetsBuilder.ShadowsPalette = new Color[256];
VirtualAssetsBuilder.ShadowsPalette[253] = Color.FromArgb(0x20000000);
VirtualAssetsBuilder.ShadowsPalette[254] = Color.FromArgb(0x40000000);

VirtualAssetsBuilder.SmokePalette = new Color[256];

// TODO find right colors
for (var i = 0; i < 10; i++)
VirtualAssetsBuilder.SmokePalette[i + 1] = Color.FromArgb(i * 8, i * 8, i * 8);
}

public static Dictionary<string, Stream> BuildAssets(IReadOnlyFileSystem? fileSystem, string name, IReadOnlyPackage package)
Expand Down Expand Up @@ -210,6 +217,9 @@ private static byte[] BuildSpriteSheet(Mix mix, MiniYamlNode sheetNode)
if (sheetFlags.Contains("Shadow"))
VirtualAssetsBuilder.ApplyPalette(VirtualAssetsBuilder.ShadowsPalette, 253, 2, palette, 253, 2, 0, false);

if (sheetFlags.Contains("Smoke"))
VirtualAssetsBuilder.ApplyPalette(VirtualAssetsBuilder.SmokePalette, 0, 256, palette, 0, 256, 0, false);

if (sheetFlags.Contains("Muzzle"))
{
if (animationNode.Key == "muzzle")
Expand Down
3 changes: 3 additions & 0 deletions mods/e2140/content/shared/sequences/projectiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ projectile_heavy_rocket: projectile_heavy_rocket.vspr
BlendMode: Additive

missile_trail: missile_trail.vspr
idle:
Tick: 70
BlendMode: Additive
3 changes: 1 addition & 2 deletions mods/e2140/content/ucs/vehicles/tiger_assault/weapons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ ucs_vehicles_tiger_assault:
Speed: 260
Arm: 2
Blockable: false
ContrailLength: 10
Inaccuracy: 128
Image: projectile_rocket
Palette:
#TrailImage: missile_trail
TrailImage: missile_trail
TrailInterval: 0
TrailPalette:
Shadow: True
Expand Down
8 changes: 3 additions & 5 deletions mods/e2140/virtualassets/SPRM0.MIX.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ projectile_rocket:
idle: 62-70 16
explode: 47-55

missile_trail:
idle: 157,157,158,158,159,159,160,160
# sequence: 1,1,2,2,3,3,4,4
# sprites: 157-159

missile_trail: Smoke
idle: 157-159

projectile_heavy_rocket:
idle: 88-96 16
explode: 8-15
Expand Down

0 comments on commit 637e506

Please sign in to comment.