From e9e2e353f7998c44ea3eb406b3d7495dd474cb55 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 15 Dec 2013 10:47:58 +1300 Subject: [PATCH] Change crate graphics for christmas. Closes #4296. --- OpenRA.Mods.RA/Crate.cs | 5 --- OpenRA.Mods.RA/OpenRA.Mods.RA.csproj | 1 + OpenRA.Mods.RA/Render/WithCrateBody.cs | 47 ++++++++++++++++++++++ mods/cnc/bits/xcrate.shp | Bin 0 -> 2410 bytes mods/cnc/rules/system.yaml | 4 +- mods/cnc/sequences/misc.yaml | 32 +++++++++++++++ mods/d2k/rules/system.yaml | 3 +- mods/ra/bits/xcratea.shp | Bin 0 -> 3600 bytes mods/ra/bits/xcrateb.shp | Bin 0 -> 3600 bytes mods/ra/bits/xcratec.shp | Bin 0 -> 3600 bytes mods/ra/bits/xcrated.shp | Bin 0 -> 3600 bytes mods/ra/rules/system.yaml | 4 +- mods/ra/sequences/misc.yaml | 52 +++++++++++++++++++++++++ 13 files changed, 140 insertions(+), 8 deletions(-) create mode 100755 OpenRA.Mods.RA/Render/WithCrateBody.cs create mode 100644 mods/cnc/bits/xcrate.shp create mode 100644 mods/ra/bits/xcratea.shp create mode 100644 mods/ra/bits/xcrateb.shp create mode 100644 mods/ra/bits/xcratec.shp create mode 100644 mods/ra/bits/xcrated.shp diff --git a/OpenRA.Mods.RA/Crate.cs b/OpenRA.Mods.RA/Crate.cs index e628356864..cfaba5d447 100644 --- a/OpenRA.Mods.RA/Crate.cs +++ b/OpenRA.Mods.RA/Crate.cs @@ -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(); - if (seq != rs.anim.CurrentSequence.Name) - rs.anim.PlayRepeating(seq); - if (self.IsInWorld) { self.World.ActorMap.AddInfluence(self, this); diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 980c6a412b..0e28d6d8a2 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -483,6 +483,7 @@ + diff --git a/OpenRA.Mods.RA/Render/WithCrateBody.cs b/OpenRA.Mods.RA/Render/WithCrateBody.cs new file mode 100755 index 0000000000..662fdc46c1 --- /dev/null +++ b/OpenRA.Mods.RA/Render/WithCrateBody.cs @@ -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 + { + 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(); + 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); + } + } +} diff --git a/mods/cnc/bits/xcrate.shp b/mods/cnc/bits/xcrate.shp new file mode 100644 index 0000000000000000000000000000000000000000..5e1e1422fd77415953fac339f14b0162e281eb97 GIT binary patch literal 2410 zcmdT^!EM7Z3^a-WWj}fsvVZ~_q?>qw4k6?lz}6}n!SD|K>8V9}lpTk(^Jwcw5CyiB zyW>%^2%Z`q@A&cfY??FAmzR0|KF#yT>pXwGF?$>1ZTYX&1LBDqWALg&<|jiYf!Z7d zNJ@#w7)_L75{-aM(Zn=S;S623!>3ZZB=MRb0n^kmaZ(WiKS`$RR{bb(1XIUGO1)UZ ze4}MTo_`VkX*wEzS+kvwT0J1%+Qxgl>X7-Zx88wTPd6`sIOnYOUK2TcXGg#}Yr^|B z<7xM}g*H2h*Zj!9E+F(}3tW{!&Z~Y~N;b2RQZJi>xpuF(Jik80@BST)f9_I3LyGZk zSBex9sLe+NQoB-&niz)2T`9(4&;$Yo&d~Qe9NIofyj}&wG4@R8%NDpQgT7z&+ft&Q zjg)%X1kAO2#gCT4(fH>sB{ZZE?slbMg9D`tfW@^dg`f$dz+EYXYgu0D5L&|1?r{q( pIf>V+Kn8XJp)XtDstkx${kD`Wv5`_Q+k&}vulUhYI2tcX=?A;{rWybM literal 0 HcmV?d00001 diff --git a/mods/cnc/rules/system.yaml b/mods/cnc/rules/system.yaml index 0f9110f9ac..bed2ed3d04 100644 --- a/mods/cnc/rules/system.yaml +++ b/mods/cnc/rules/system.yaml @@ -406,7 +406,9 @@ CRATE: SelectionShares: 0 NoBaseSelectionShares: 120 Unit: mcv - RenderSimple: + RenderSprites: + WithCrateBody: + XmasImages: xcratea, xcrateb, xcratec, xcrated BodyOrientation: mpspawn: diff --git a/mods/cnc/sequences/misc.yaml b/mods/cnc/sequences/misc.yaml index 809742e8d5..3821bfacd9 100644 --- a/mods/cnc/sequences/misc.yaml +++ b/mods/cnc/sequences/misc.yaml @@ -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 diff --git a/mods/d2k/rules/system.yaml b/mods/d2k/rules/system.yaml index a9fc3dd967..47ed6ec808 100644 --- a/mods/d2k/rules/system.yaml +++ b/mods/d2k/rules/system.yaml @@ -561,7 +561,8 @@ CRATE: SelectionShares: 0 NoBaseSelectionShares: 9001 Unit: mcvo - RenderSimple: + RenderSprites: + WithCrateBody: ProximityCaptor: Types:Crate Passenger: diff --git a/mods/ra/bits/xcratea.shp b/mods/ra/bits/xcratea.shp new file mode 100644 index 0000000000000000000000000000000000000000..10868065110e432ed6cfafd78961f96cc0432357 GIT binary patch literal 3600 zcmdT`OODhq5VcSXghoOvxdk`j8hr;=EhUP=5m!FdGv5HdgZ8-N2J0KlgG z6RtPTq0Ql-6x;XNu~vJIFF}8vUyHvHmG+o18HcwI^q)VpftY>N>mZSgiHzY%yb23c z^IrR$Ul~y%VULnT$`YRe3ukd^l{2D} Hd~2s)E@cuR literal 0 HcmV?d00001 diff --git a/mods/ra/bits/xcrateb.shp b/mods/ra/bits/xcrateb.shp new file mode 100644 index 0000000000000000000000000000000000000000..3edd4fce7f1aa3048a9052067c93d07c1d573276 GIT binary patch literal 3600 zcmdT`OODhq5VcSXgpd$RZoy4B5Ubg8gjsgtUotzGeHKox;K>0v2(MgmTy_UBLkl%j zt7E&WUX?#D<-ArTAMqpktkfN~_piA9apLyV8*ab6<#u_;?T7c|U1TcVKkD58AEOEZ zk0dgG3^A-QH4A}eUDp^xs15TR);K{u&$S_hry2jJWoh*hzRN20DL*oVu+#>E{z|_r zyT6=2LE=JzsMm_jT5K)8Sf1Cr7XNimb9Zg18{q$CDxLP7rB0#J=_D|F`*Y^S@BZXl<&A(?G{)aYj*V8kMcoCRZhsEMz4yaNep?9qhO&^;WrD zl^&GsIY@e1KTuT~hoLBuAArGo=SS}c40h@5cW)d(&ig8k{${PQ&Rc7BnLpurWejWv zomO<;SIgS$HNFM?eta$dMpQat#-t2(-_pN6Xk~Nt5vKzp;lGf9a@HL`YFe~Oh|;6&i0yX0TZ$-I9B z`?B6&rqU5*6cHsYu4W9Dk|`tCK-H*FW-l{zhJrCTU9lB{GBOkZ?Wa$gLWe+Mp3=8Z zM*!4FsuU`aFVuM5QxRh9;TvKkCjnZ#wPCpCV;(y6dzcQr0WwSS#jV zY@)}^6AE+_`8M)MJgX|MCE%r|#ACb$wOL1%vRIk8$#xk;L)6QtWFR7X=~4>0lwxUm z7jRb4v&9S7BZ^VrLa`bzIYxe2jw#kN#keZT3#G#am#dOW9OFPn;R<6a4TUT;|L!qY zB`^G8Fg;hLUaX3PS=0Bawzccu-Z%Do#}Fg7GD9IV0oxTFrpH_Yj-~Z D8hA{! literal 0 HcmV?d00001 diff --git a/mods/ra/bits/xcratec.shp b/mods/ra/bits/xcratec.shp new file mode 100644 index 0000000000000000000000000000000000000000..c83d6e624972e95969eaa65973f767db7e0eea32 GIT binary patch literal 3600 zcmdT`OOD$x3>Au?MNy!bWpB}&^gvx@J4fh324YLJ?Af)m_p0|$j2>hjMeFMnX`4l+ z3}Q(nAF0nX<+qCE6MigTlsapHEyuMOw3@ALxo`CJ>k@6Pyl>)PryeAh}J@*{)yYi(fY@AT`M z{LA?>M6Vo(d#$vy5qpboQP;+|;vZ9jlib8rX`ZI6M1BA!=SDX>H(`)updZeT0FBO7am;rjOQRzqljqO4L0Jo% zMW+=r4ArtWdyQ{F*T=Ww??k0b%vhAg?i2s(gH{x)PjNaR5?mEx)!Dyc}Na&26tGL=w%wyog9EvQuSvY=8K3jT>oQ6HwzBhdCu)UyFKA{_F` zK_5Pe<`e6QPnGkV(+plR$4w;X|GC${7C>|pj;aRqk{z{c_=c;$-YvO9z(+<$+={kyj`yU1MBKho}i z_g;m7CW*}NgAWT_%|>8Zmc{!JYDbJ=@iWX_S35$uMEqZ3Z0$b87#C?z`H>;OQ#lCw zD|?LFe7Syt_(*|BYei-)z7}6RPt$J2f8Np@Zw++^{J%`4!*;Ty6e=AK(o?8(n57*M zrcyO~4H@H}^$zF1u7|t-g-S+iQ!ShZ+Ix#T@>|H>wzc|ed<**h_*VR#sIj;b$G8H5Qa%W@vJ#JddJQaEtysVN%{3; z9Vp}6mNxm+2qsyu%#1vy77K-dMQ}lx)wWj3om|{)Y~pVw8PQZDYuEj!Sa}L25jfed z`B!r?pI^Z~Py5SM+M|pjqNL5$jKNkiW#k^H8WqZHWrprhFb20PjzUmIh5`VTsebyT zCG-dsx|t{wdjg;qq{}?H{L|-rBD-C0PoK`9A5rPVl%YkY{ExafqcgpBG@l}68Fk-l zL8NR~YGkWefAI;8nI{ZT6Zuy1NIaV=t|j2LrNm>r2DRBnm9lu5xXE`NL_^f`sAM1_ zdQmBb+)D8@+7+A))V6prb&p~cxKOOdOODaJEc+B2m||R&