Change crate graphics for christmas. Closes #4296.

This commit is contained in:
Paul Chote
2013-12-15 10:47:58 +13:00
parent f1372acf3f
commit e9e2e353f7
13 changed files with 140 additions and 8 deletions

View File

@@ -114,11 +114,6 @@ namespace OpenRA.Mods.RA
Location = cell;
CenterPosition = cell.CenterPosition;
var seq = self.World.GetTerrainInfo(cell).IsWater ? "water" : "land";
var rs = self.Trait<RenderSprites>();
if (seq != rs.anim.CurrentSequence.Name)
rs.anim.PlayRepeating(seq);
if (self.IsInWorld)
{
self.World.ActorMap.AddInfluence(self, this);

View File

@@ -483,6 +483,7 @@
<Compile Include="AttackBomber.cs" />
<Compile Include="Effects\Rank.cs" />
<Compile Include="ShroudRenderer.cs" />
<Compile Include="Render\WithCrateBody.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">

View File

@@ -0,0 +1,47 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Render
{
class WithCrateBodyInfo : ITraitInfo, Requires<RenderSpritesInfo>
{
public readonly string[] Images = { "crate" };
public readonly string[] XmasImages = { };
public object Create(ActorInitializer init) { return new WithCrateBody(init.self, this); }
}
class WithCrateBody : INotifyParachuteLanded
{
Actor self;
Animation anim;
public WithCrateBody(Actor self, WithCrateBodyInfo info)
{
this.self = self;
var rs = self.Trait<RenderSprites>();
var images = info.XmasImages.Any() && DateTime.Today.Month == 12 ? info.XmasImages : info.Images;
anim = new Animation(images.Random(Game.CosmeticRandom));
anim.Play("idle");
rs.anims.Add("", anim);
}
public void OnLanded()
{
var seq = self.World.GetTerrainInfo(self.Location).IsWater ? "water" : "land";
anim.PlayRepeating(seq);
}
}
}

BIN
mods/cnc/bits/xcrate.shp Normal file

Binary file not shown.

View File

@@ -406,7 +406,9 @@ CRATE:
SelectionShares: 0
NoBaseSelectionShares: 120
Unit: mcv
RenderSimple:
RenderSprites:
WithCrateBody:
XmasImages: xcratea, xcrateb, xcratec, xcrated
BodyOrientation:
mpspawn:

View File

@@ -170,6 +170,38 @@ crate:
Start: 0
ZOffset: -511
xcratea:
idle: xcrate
Start: 0
ZOffset: -511
land: xcrate
Start: 0
ZOffset: -511
xcrateb:
idle: xcrate
Start: 1
ZOffset: -511
land: xcrate
Start: 1
ZOffset: -511
xcratec:
idle: xcrate
Start: 2
ZOffset: -511
land: xcrate
Start: 2
ZOffset: -511
xcrated:
idle: xcrate
Start: 3
ZOffset: -511
land: xcrate
Start: 3
ZOffset: -511
crate-effects:
airstrike: deviator
Start: 0

View File

@@ -561,7 +561,8 @@ CRATE:
SelectionShares: 0
NoBaseSelectionShares: 9001
Unit: mcvo
RenderSimple:
RenderSprites:
WithCrateBody:
ProximityCaptor:
Types:Crate
Passenger:

BIN
mods/ra/bits/xcratea.shp Normal file

Binary file not shown.

BIN
mods/ra/bits/xcrateb.shp Normal file

Binary file not shown.

BIN
mods/ra/bits/xcratec.shp Normal file

Binary file not shown.

BIN
mods/ra/bits/xcrated.shp Normal file

Binary file not shown.

View File

@@ -808,7 +808,9 @@ CRATE:
GiveUnitCrateAction@4tnk:
SelectionShares: 3
Unit: 4tnk
RenderSimple:
RenderSprites:
WithCrateBody:
XmasImages: xcratea, xcrateb, xcratec, xcrated
ProximityCaptor:
Types:Crate
Passenger:

View File

@@ -232,6 +232,58 @@ crate:
Start: 0
ZOffset: -511
xcratea:
idle:
Start: 0
ZOffset: -511
land:
Start: 1
ZOffset: -511
water:
Start: 2
Length: 4
Tick: 500
ZOffset: -511
xcrateb:
idle:
Start: 0
ZOffset: -511
land:
Start: 1
ZOffset: -511
water:
Start: 2
Length: 4
Tick: 500
ZOffset: -511
xcratec:
idle:
Start: 0
ZOffset: -511
land:
Start: 1
ZOffset: -511
water:
Start: 2
Length: 4
Tick: 500
ZOffset: -511
xcrated:
idle:
Start: 0
ZOffset: -511
land:
Start: 1
ZOffset: -511
water:
Start: 2
Length: 4
Tick: 500
ZOffset: -511
crate-effects:
speed: speed
Start: 0