From 94e30503a73b5fa56f451f4c44fb50e51a8ef01e Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 20 Mar 2014 22:12:13 +1300 Subject: [PATCH 1/2] Allow support powers to define a poster image for beacons. --- OpenRA.Mods.RA/Effects/Beacon.cs | 23 +++++++++++++++++--- OpenRA.Mods.RA/Player/PlaceBeacon.cs | 2 +- OpenRA.Mods.RA/SupportPowers/SupportPower.cs | 6 ++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.RA/Effects/Beacon.cs b/OpenRA.Mods.RA/Effects/Beacon.cs index 8ae5a4a4e9..90abc83f7d 100644 --- a/OpenRA.Mods.RA/Effects/Beacon.cs +++ b/OpenRA.Mods.RA/Effects/Beacon.cs @@ -20,21 +20,30 @@ namespace OpenRA.Mods.RA.Effects readonly Player owner; readonly WPos position; readonly string palettePrefix; + readonly string posterPalette; readonly Animation arrow = new Animation("beacon"); readonly Animation circles = new Animation("beacon"); + readonly Animation poster; static readonly int maxArrowHeight = 512; int arrowHeight = maxArrowHeight; int arrowSpeed = 50; - public Beacon(Player owner, WPos position, int duration, string palettePrefix) + public Beacon(Player owner, WPos position, int duration, string palettePrefix, string posterType, string posterPalette) { this.owner = owner; this.position = position; this.palettePrefix = palettePrefix; + this.posterPalette = posterPalette; arrow.Play("arrow"); circles.Play("circles"); + if (posterType != null) + { + poster = new Animation("beacon"); + poster.Play(posterType); + } + owner.World.Add(new DelayedAction(duration, () => owner.World.Remove(this))); } @@ -55,10 +64,18 @@ namespace OpenRA.Mods.RA.Effects public IEnumerable Render(WorldRenderer r) { if (!owner.IsAlliedWith(owner.World.RenderPlayer)) - return SpriteRenderable.None; + yield break; var palette = r.Palette(palettePrefix + owner.InternalName); - return circles.Render(position, palette).Concat(arrow.Render(position + new WVec(0, 0, arrowHeight), palette)); + foreach (var a in circles.Render(position, palette)) + yield return a; + + foreach (var a in arrow.Render(position + new WVec(0, 0, arrowHeight), palette)) + yield return a; + + if (poster != null) + foreach (var a in poster.Render(position, r.Palette(posterPalette))) + yield return a; } } } diff --git a/OpenRA.Mods.RA/Player/PlaceBeacon.cs b/OpenRA.Mods.RA/Player/PlaceBeacon.cs index 8e7464744f..7cc382b769 100644 --- a/OpenRA.Mods.RA/Player/PlaceBeacon.cs +++ b/OpenRA.Mods.RA/Player/PlaceBeacon.cs @@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA if (playerBeacon != null) self.World.Remove(playerBeacon); - playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.PalettePrefix); + playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.PalettePrefix, null, null); self.World.Add(playerBeacon); if (self.Owner.IsAlliedWith(self.World.RenderPlayer)) diff --git a/OpenRA.Mods.RA/SupportPowers/SupportPower.cs b/OpenRA.Mods.RA/SupportPowers/SupportPower.cs index 6817ab41de..19d17eef9f 100755 --- a/OpenRA.Mods.RA/SupportPowers/SupportPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/SupportPower.cs @@ -34,6 +34,8 @@ namespace OpenRA.Mods.RA public readonly bool DisplayBeacon = false; public readonly int BeaconDuration = 10 * 25; public readonly string BeaconPalettePrefix = "player"; + public readonly string BeaconPoster = null; + public readonly string BeaconPosterPalette = "chrome"; public readonly bool DisplayRadarPing = false; public readonly string OrderName; @@ -72,7 +74,9 @@ namespace OpenRA.Mods.RA order.Player, order.TargetLocation.CenterPosition, Info.BeaconDuration, - Info.BeaconPalettePrefix); + Info.BeaconPalettePrefix, + Info.BeaconPoster, + Info.BeaconPosterPalette); self.World.Add(beacon); } From 725f690aaa28a1c8eebbe09c8b92b625d8c5abbb Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 20 Mar 2014 22:12:34 +1300 Subject: [PATCH 2/2] Add posters for TD airstrike and nuke. --- mods/cnc/bits/atomicon.shp | Bin 0 -> 515 bytes mods/cnc/bits/bombicon.shp | Bin 0 -> 547 bytes mods/cnc/rules/structures.yaml | 2 ++ mods/cnc/sequences/misc.yaml | 8 ++++++++ 4 files changed, 10 insertions(+) create mode 100644 mods/cnc/bits/atomicon.shp create mode 100644 mods/cnc/bits/bombicon.shp diff --git a/mods/cnc/bits/atomicon.shp b/mods/cnc/bits/atomicon.shp new file mode 100644 index 0000000000000000000000000000000000000000..bdbc59a4ec40779c93681f0e0c615b38ab590b5b GIT binary patch literal 515 zcmYjNziSjh82#pwQBuf$C*1tlOK!hKNxfxKWe!Q0EL zc~O*QoiJOLc#GIz%`Awhovh_bxoWtH1l-Js9T$aC0$A?Cs!H~V(hVymbSK^mA+@G> zkYdl41#V};bBL|f*f-UX=B|^XI~u|3Ob8CE@L(dH*G^aX0ai?zq(;Fh9!|KI zf;WMunRX8Dm^vMfN6HH|#h-8iU7W!)Q`5N_A%jm48HI0fXIzD0Sbc0CWQ+MLq`V$! z%^n*Gj|S(aj`wLuEE7uMZrsbHd*7c934Wi{9UcS$?<|*imc#>M`*6c_Fv5deJ1M_~ zE#ugpshi=*E@zN_-ENt>9UYhT?Z5+BuHXec2iCm*rLp~K|BdfkE%C$#0j98?Et~3x hhPNZUn`}U@`RkIp$db;0!5G7AakcpIt7SeP{R7Kz<>J&Kf>fQvzrxMmZGO{xA0OZQzQ^Dc1ec+-0Z;)jPWQ5$|A+Nu z`GbLdbiDip%x<^a9bj;V&UW>dj*6p4dOMXS7tEX(Uc_@w%XL#7gnOWO(j`aibb_EJ zu-MmKHy%f05J=rHMA|X~jp2j-Ac`WXhD%Pm47mb#>;+#SFnTuBhh8*DvTXb<2-2m( zL70eFe9n~x<{jPhqBzMuCvMyVvUrHsp=c_2*TH?yo0G7cCy9%+7pm%LG*VTn*#5pZ z*M$AL)zZNO(u!2F{1k=hg0K(#JjW09DhepbQ!`12+NyR)+a$WltRW>B2JevpA;WUl zU$3PklZ{@~s5*j_TR2QZSFP(LkHHSM7 z=_5QMV&mR)9cQcIt>?6b6*JeUr}B57;z+jnE`u(p08h^Y-gJyO9r~M3*q_>sYl@W~ Y$?qXn)jBI(?O~9o$LY`C8|I1e55N<_AOHXW literal 0 HcmV?d00001 diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index 8961845dc1..42f9ecc89e 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -384,6 +384,7 @@ HQ: IncomingSound: enemya.aud UnitType: a10 DisplayBeacon: True + BeaconPoster: airstrike DisplayRadarPing: True CameraActor: camera SupportPowerChargeBar: @@ -491,6 +492,7 @@ TMPL: IncomingSound: nuke1.aud MissileWeapon: atomic DisplayBeacon: True + BeaconPoster: atomic DisplayRadarPing: True SupportPowerChargeBar: diff --git a/mods/cnc/sequences/misc.yaml b/mods/cnc/sequences/misc.yaml index 32d33bd732..33aa39ef28 100644 --- a/mods/cnc/sequences/misc.yaml +++ b/mods/cnc/sequences/misc.yaml @@ -161,6 +161,14 @@ beacon: circles: fpls Start: 0 Length: * + airstrike: bombicon + Start: 0 + Length: 1 + Offset: 0,-42 + atomic: atomicon + Start: 0 + Length: 1 + Offset: 0,-42 select: repair: