From 9ff69b794664df64a58b7605ab5e102154a731d3 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Thu, 21 Jun 2012 22:53:20 +1200 Subject: [PATCH 01/12] Add EVA voices Use new WaitFor when waiting for Einstein Have a small delay before the Soviets counterattack Have the Soviets Attack-Move towards Einstein during the counterattack, this makes them much more damaging Spawn the signal flare only after Einstein has been spawned, also add EVA voice for this --- OpenRA.Mods.RA/Missions/Allies01Script.cs | 443 +++++++++++----------- mods/ra/maps/allies-01.oramap | Bin 2713 -> 2705 bytes 2 files changed, 222 insertions(+), 221 deletions(-) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index 9712484eb0..6918919566 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -19,253 +19,254 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Missions { - public class Allies01ScriptInfo : TraitInfo, Requires { } + public class Allies01ScriptInfo : TraitInfo, Requires { } - public class Allies01Script : IWorldLoaded, ITick - { - private string[] objectives = + public class Allies01Script : IWorldLoaded, ITick + { + private static readonly string[] objectives = { "Find Einstein.", "Wait for the helicopter and extract Einstein." }; - private int currentObjective; + private int currentObjective; - private Player allies; - private Player soviets; + private Player allies; + private Player soviets; - private ISound music; + private ISound music; - private Actor insertionLZ; - private Actor extractionLZ; - private Actor lab; - private Actor insertionLZEntryPoint; - private Actor extractionLZEntryPoint; - private Actor chinookExitPoint; - private Actor shipSpawnPoint; - private Actor shipMovePoint; - private Actor einstein; - private Actor einsteinChinook; - private Actor tanya; - private Actor attackEntryPoint1; - private Actor attackEntryPoint2; + private Actor insertionLZ; + private Actor extractionLZ; + private Actor lab; + private Actor insertionLZEntryPoint; + private Actor extractionLZEntryPoint; + private Actor chinookExitPoint; + private Actor shipSpawnPoint; + private Actor shipMovePoint; + private Actor einstein; + private Actor einsteinChinook; + private Actor tanya; + private Actor attackEntryPoint1; + private Actor attackEntryPoint2; - private static readonly string[] taunts = { "laugh1.aud", "lefty1.aud", "cmon1.aud", "gotit1.aud" }; + private static readonly string[] taunts = { "laugh1.aud", "lefty1.aud", "cmon1.aud", "gotit1.aud" }; - private static readonly string[] ships = { "ca", "ca", "ca", "ca" }; + private static readonly string[] ships = { "ca", "ca", "ca", "ca" }; - private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog" }; - private int currentAttackWaveFrameNumber = -600; - private int currentAttackWave; - private const int einsteinChinookArrivesAtAttackWave = 5; + private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog" }; + private int currentAttackWaveFrameNumber; + private int currentAttackWave; + private const int einsteinChinookArrivesAtAttackWave = 5; - private const int labRange = 5; - private const string einsteinName = "c1"; - private const string tanyaName = "e7"; - private const string chinookName = "tran"; + private const int labRange = 5; + private const string einsteinName = "c1"; + private const string tanyaName = "e7"; + private const string chinookName = "tran"; + private const string signalFlareName = "flare"; - private void NextObjective() - { - currentObjective++; - } + private void NextObjective() + { + currentObjective++; + } - private void DisplayObjective() - { - Game.AddChatLine(Color.LimeGreen, "Objective", objectives[currentObjective]); - } + private void DisplayObjective() + { + Game.AddChatLine(Color.LimeGreen, "Objective", objectives[currentObjective]); + } - private void MissionFailed(Actor self, string text) - { - if (allies.WinState != WinState.Undefined) - { - return; - } - allies.WinState = WinState.Lost; - Game.AddChatLine(Color.Red, "Mission failed", text); - foreach (var actor in self.World.Actors.Where(a => a.Owner == allies)) - { - actor.Kill(actor); - } - self.World.LocalShroud.Disabled = true; - } + private void MissionFailed(Actor self, string text) + { + if (allies.WinState != WinState.Undefined) + { + return; + } + allies.WinState = WinState.Lost; + Game.AddChatLine(Color.Red, "Mission failed", text); + foreach (var actor in self.World.Actors.Where(a => a.Owner == allies)) + { + actor.Kill(actor); + } + self.World.LocalShroud.Disabled = true; + Sound.Play("misnlst1.aud", 5); + } - private void MissionAccomplished(Actor self, string text) - { - if (allies.WinState != WinState.Undefined) - { - return; - } - allies.WinState = WinState.Won; - Game.AddChatLine(Color.Blue, "Mission accomplished", text); - self.World.LocalShroud.Disabled = true; - } + private void MissionAccomplished(Actor self, string text) + { + if (allies.WinState != WinState.Undefined) + { + return; + } + allies.WinState = WinState.Won; + Game.AddChatLine(Color.Blue, "Mission accomplished", text); + self.World.LocalShroud.Disabled = true; + Sound.Play("misnwon1.aud", 5); + } - public void Tick(Actor self) - { - if (allies.WinState != WinState.Undefined) - { - return; - } - // display current objective every so often - if (self.World.FrameNumber % 1500 == 1) - { - DisplayObjective(); - } - // taunt every so often - if (self.World.FrameNumber % 1000 == 0) - { - Sound.Play(taunts[self.World.SharedRandom.Next(taunts.Length)]); - } - // take Tanya to the LZ - if (self.World.FrameNumber == 1) - { - FlyTanyaToInsertionLZ(self); - } - // objectives - if (currentObjective == 0) - { - if (AlliesControlLab(self)) - { - SpawnEinsteinAtLab(self); // spawn Einstein once the area is clear - Sound.Play("einok1.aud"); // "Incredible!" - Einstein - SendShips(self); - NextObjective(); - DisplayObjective(); - } - if (lab.Destroyed) - { - MissionFailed(self, "Einstein was killed."); - } - } - else if (currentObjective == 1) - { - if (self.World.FrameNumber >= currentAttackWaveFrameNumber + 600) - { - SendAttackWave(self, attackWave); - currentAttackWave++; - currentAttackWaveFrameNumber = self.World.FrameNumber; - if (currentAttackWave == einsteinChinookArrivesAtAttackWave) - { - FlyToExtractionLZ(self); - } - } - if (einsteinChinook != null) - { - if (einsteinChinook.Trait().Passengers.Contains(einstein)) - { - FlyEinsteinFromExtractionLZ(); - } - if (!self.World.Map.IsInMap(einsteinChinook.Location) && !einstein.IsInWorld) - { - MissionAccomplished(self, "Einstein was rescued."); - } - } - if (einstein.Destroyed) - { - MissionFailed(self, "Einstein was killed."); - } - } - if (tanya.Destroyed) - { - MissionFailed(self, "Tanya was killed."); - } - } + public void Tick(Actor self) + { + if (allies.WinState != WinState.Undefined) + { + return; + } + // display current objective every so often + if (self.World.FrameNumber % 1500 == 1) + { + DisplayObjective(); + } + // taunt every so often + if (self.World.FrameNumber % 1000 == 0) + { + Sound.Play(taunts[self.World.SharedRandom.Next(taunts.Length)]); + } + // take Tanya to the LZ + if (self.World.FrameNumber == 1) + { + FlyTanyaToInsertionLZ(self); + } + // objectives + if (currentObjective == 0) + { + if (AlliesControlLab(self)) + { + SpawnSignalFlare(self); + Sound.Play("flaren1.aud", 5); + SpawnEinsteinAtLab(self); // spawn Einstein once the area is clear + Sound.Play("einok1.aud"); // "Incredible!" - Einstein + SendShips(self); + NextObjective(); + DisplayObjective(); + currentAttackWaveFrameNumber = self.World.FrameNumber; + } + if (lab.Destroyed) + { + MissionFailed(self, "Einstein was killed."); + } + } + else if (currentObjective == 1) + { + if (self.World.FrameNumber >= currentAttackWaveFrameNumber + 600) + { + Sound.Play("enmyapp1.aud", 5); + SendAttackWave(self, attackWave); + currentAttackWave++; + currentAttackWaveFrameNumber = self.World.FrameNumber; + if (currentAttackWave == einsteinChinookArrivesAtAttackWave) + { + FlyEinsteinFromExtractionLZ(self); + } + } + if (einsteinChinook != null && !self.World.Map.IsInMap(einsteinChinook.Location) && !einstein.IsInWorld) + { + MissionAccomplished(self, "Einstein was rescued."); + } + if (einstein.Destroyed) + { + MissionFailed(self, "Einstein was killed."); + } + } + if (tanya.Destroyed) + { + MissionFailed(self, "Tanya was killed."); + } + } - private void SendAttackWave(Actor self, IEnumerable wave) - { - foreach (var unit in wave) - { - var spawnActor = self.World.SharedRandom.Next(2) == 0 ? attackEntryPoint1 : attackEntryPoint2; - var targetActor = self.World.SharedRandom.Next(2) == 0 ? einstein : tanya; - var actor = self.World.CreateActor(unit, new TypeDictionary { new OwnerInit(soviets), new LocationInit(spawnActor.Location) }); - actor.QueueActivity(new Attack(Target.FromActor(targetActor), 2)); - } - } + private void SpawnSignalFlare(Actor self) + { + self.World.CreateActor(signalFlareName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZ.Location) }); + } - private IEnumerable UnitsNearActor(Actor self, Actor actor, int range) - { - return self.World.FindUnitsInCircle(actor.CenterLocation, Game.CellSize * range) - .Where(a => a.IsInWorld && a != self.World.WorldActor && !a.Destroyed && a.HasTrait() && !a.Owner.NonCombatant); - } + private void SendAttackWave(Actor self, IEnumerable wave) + { + foreach (var unit in wave) + { + var spawnActor = self.World.SharedRandom.Next(2) == 0 ? attackEntryPoint1 : attackEntryPoint2; + var actor = self.World.CreateActor(unit, new TypeDictionary { new OwnerInit(soviets), new LocationInit(spawnActor.Location) }); + actor.QueueActivity(new AttackMove.AttackMoveActivity(actor, new Attack(Target.FromActor(einstein), 3))); // better way of doing this? + } + } - private bool AlliesControlLab(Actor self) - { - var units = UnitsNearActor(self, lab, labRange); - return units.Count() >= 1 && units.All(a => a.Owner == allies); - } + private IEnumerable UnitsNearActor(Actor self, Actor actor, int range) + { + return self.World.FindUnitsInCircle(actor.CenterLocation, Game.CellSize * range) + .Where(a => a.IsInWorld && a != self.World.WorldActor && !a.Destroyed && a.HasTrait() && !a.Owner.NonCombatant); + } - private void SpawnEinsteinAtLab(Actor self) - { - einstein = self.World.CreateActor(einsteinName, new TypeDictionary { new OwnerInit(allies), new LocationInit(lab.Location) }); - } + private bool AlliesControlLab(Actor self) + { + var units = UnitsNearActor(self, lab, labRange); + return units.Any() && units.All(a => a.Owner == allies); + } - private void SendShips(Actor self) - { - for (int i = 0; i < ships.Length; i++) - { - var actor = self.World.CreateActor(ships[i], - new TypeDictionary { new OwnerInit(allies), new LocationInit(shipSpawnPoint.Location + new int2(i * 2, 0)) }); - actor.QueueActivity(new Move.Move(shipMovePoint.Location + new int2(i * 4, 0))); - } - } + private void SpawnEinsteinAtLab(Actor self) + { + einstein = self.World.CreateActor(einsteinName, new TypeDictionary { new OwnerInit(allies), new LocationInit(lab.Location) }); + } - private void FlyEinsteinFromExtractionLZ() - { - einsteinChinook.QueueActivity(new Wait(150)); - einsteinChinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); - einsteinChinook.QueueActivity(new RemoveSelf()); - } + private void SendShips(Actor self) + { + for (int i = 0; i < ships.Length; i++) + { + var actor = self.World.CreateActor(ships[i], + new TypeDictionary { new OwnerInit(allies), new LocationInit(shipSpawnPoint.Location + new int2(i * 2, 0)) }); + actor.QueueActivity(new Move.Move(shipMovePoint.Location + new int2(i * 4, 0))); + } + } - private void FlyToExtractionLZ(Actor self) - { - einsteinChinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZEntryPoint.Location) }); - einsteinChinook.QueueActivity(new HeliFly(extractionLZ.CenterLocation)); - einsteinChinook.QueueActivity(new Turn(0)); - einsteinChinook.QueueActivity(new HeliLand(true)); - } + private void FlyEinsteinFromExtractionLZ(Actor self) + { + einsteinChinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZEntryPoint.Location) }); + einsteinChinook.QueueActivity(new HeliFly(extractionLZ.CenterLocation)); + einsteinChinook.QueueActivity(new Turn(0)); + einsteinChinook.QueueActivity(new HeliLand(true)); + einsteinChinook.QueueActivity(new WaitFor(() => einsteinChinook.Trait().Passengers.Contains(einstein))); + einsteinChinook.QueueActivity(new Wait(150)); + einsteinChinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); + einsteinChinook.QueueActivity(new RemoveSelf()); + } - private void FlyTanyaToInsertionLZ(Actor self) - { - tanya = self.World.CreateActor(false, tanyaName, new TypeDictionary { new OwnerInit(allies) }); - var chinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(insertionLZEntryPoint.Location) }); - chinook.Trait().Load(chinook, tanya); - // use CenterLocation for HeliFly, Location for Move - chinook.QueueActivity(new HeliFly(insertionLZ.CenterLocation)); - chinook.QueueActivity(new Turn(0)); - chinook.QueueActivity(new HeliLand(true)); - chinook.QueueActivity(new UnloadCargo()); - chinook.QueueActivity(new CallFunc(() => Sound.Play("laugh1.aud"))); - chinook.QueueActivity(new Wait(150)); - chinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); - chinook.QueueActivity(new RemoveSelf()); - } + private void FlyTanyaToInsertionLZ(Actor self) + { + tanya = self.World.CreateActor(false, tanyaName, new TypeDictionary { new OwnerInit(allies) }); + var chinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(insertionLZEntryPoint.Location) }); + chinook.Trait().Load(chinook, tanya); + // use CenterLocation for HeliFly, Location for Move + chinook.QueueActivity(new HeliFly(insertionLZ.CenterLocation)); + chinook.QueueActivity(new Turn(0)); + chinook.QueueActivity(new HeliLand(true)); + chinook.QueueActivity(new UnloadCargo()); + chinook.QueueActivity(new CallFunc(() => Sound.Play("laugh1.aud"))); + chinook.QueueActivity(new Wait(150)); + chinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); + chinook.QueueActivity(new RemoveSelf()); + } - public void WorldLoaded(World w) - { - allies = w.Players.Single(p => p.InternalName == "Allies"); - soviets = w.Players.Single(p => p.InternalName == "Soviets"); - var actors = w.WorldActor.Trait().Actors; - insertionLZ = actors["InsertionLZ"]; - extractionLZ = actors["ExtractionLZ"]; - lab = actors["Lab"]; - insertionLZEntryPoint = actors["InsertionLZEntryPoint"]; - chinookExitPoint = actors["ChinookExitPoint"]; - extractionLZEntryPoint = actors["ExtractionLZEntryPoint"]; - shipSpawnPoint = actors["ShipSpawnPoint"]; - shipMovePoint = actors["ShipMovePoint"]; - attackEntryPoint1 = actors["SovietAttackEntryPoint1"]; - attackEntryPoint2 = actors["SovietAttackEntryPoint2"]; - music = Sound.Play("hell226m.aud"); // Hell March - Game.ConnectionStateChanged += StopMusic; - } + public void WorldLoaded(World w) + { + allies = w.Players.Single(p => p.InternalName == "Allies"); + soviets = w.Players.Single(p => p.InternalName == "Soviets"); + var actors = w.WorldActor.Trait().Actors; + insertionLZ = actors["InsertionLZ"]; + extractionLZ = actors["ExtractionLZ"]; + lab = actors["Lab"]; + insertionLZEntryPoint = actors["InsertionLZEntryPoint"]; + chinookExitPoint = actors["ChinookExitPoint"]; + extractionLZEntryPoint = actors["ExtractionLZEntryPoint"]; + shipSpawnPoint = actors["ShipSpawnPoint"]; + shipMovePoint = actors["ShipMovePoint"]; + attackEntryPoint1 = actors["SovietAttackEntryPoint1"]; + attackEntryPoint2 = actors["SovietAttackEntryPoint2"]; + music = Sound.Play("hell226m.aud"); // Hell March + Game.ConnectionStateChanged += StopMusic; + } - private void StopMusic(OrderManager orderManager) - { - if (!orderManager.GameStarted) - { - Sound.StopSound(music); - Game.ConnectionStateChanged -= StopMusic; - } - } - } + private void StopMusic(OrderManager orderManager) + { + if (!orderManager.GameStarted) + { + Sound.StopSound(music); + Game.ConnectionStateChanged -= StopMusic; + } + } + } } diff --git a/mods/ra/maps/allies-01.oramap b/mods/ra/maps/allies-01.oramap index 8e23ab172baf468f62b48bc6f7235ce0eb3fe0de..53ce7e9bacc0dfe65c8cc086c62c92bf9592473a 100644 GIT binary patch delta 1658 zcmV-=28H>V6_FJUP)h>@6aWAK2mq$0)v*n{0}a5Y)j)f{cvj;D001D9)&oC(ldaW$ z`_Qgd(#}}L3Q6xPHX6*umIc9tHt)IEP&pbTK`<|+ni^MC$=X4Lg5Vu%3sE+*tGoE4t1eoDZZ@6r`1yQ7HUOX!CR$cq~x4h!w$e>44x`9=HMJWk!l7tB7 zA&U0gvxYv^9rvCxXLNHU?5#a{d{wiJrp)+{l1Yn$`-zi>dxG2iRx|v~{OF&JKib-P z5$>G`#)afMkMs{34P+6aP5|vv9g%R@B@YwFY&!5qqX93g`*T1Rq9fwy@*Y7z10n`L zacM{te|pA`6SqOJV$TeJ@sW!^9}VtB)w5?9V&t+v0{|730f<}xY}Mddq12)QM;<_? zqSgxKp8>a|HU+k5ip{Pm8i%jRvrj5AdN4jxUAd$Ob2W7sDaW3>l^moykp3 z{HN`PiIYD8eqzYSml>CuV0!~4 z@!Kv;#G4_x4Uu{>J=NEr#HgE@Ycr+Ts={Mbx=*Q|4&Rv+SsnMeu@83-;n9)8QWeNJ z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Mfg|@9SCO=OCmdhL{0>A#jK2Wy6Ocj;N3m5!(=n50Tgq zsSlCb5Sb5=IS|eklG*Y>5>J2YOoo;g;)yAZEXSNr-*#al-U`WWh}2W*slNUsM&Ha_ zn<>Rs7oMQfeM$9v_|BxrO58_dpY9&Q<0FNoDv)u8r3d}}57$wB2_PKU6GP@TNz0uO&Ze*{@-0uU5N z>;%}mtdF;=le_zX>$Gr|QVzU{tRIaFY2r*Dl*be2%YL~!&%9x*s@3@Yi=7S@~fI>w#pCy$gjsuB)GbDh`ewDk|7HAIrV?c$3#$00KJ;2|Ryh79Es+b--~Fk>lc@pv+VTvpT*#Kl&y(~6Z)FxzaGEA_G$ zOt%#~JyXKRvzKpq{e8(PscZ%+tVvCWGT}! zc;n@BDpv5Q3q%=EsS8bY0e=l$B>Bg>&?cw1@6|qx)F-W1OdYrI{bmcV#xSA8tlSg`01B%`3)z7BltuC2LE!}HZb`Yr91!P(nDs5BIcHMD$ zc*m#;6{}%aT-}4Xt`ec7?`TIeIgoB(N6p}Q9b$Z>_ndDKJ~}&_?Hmn*;4?3ECVvA^ zO928u02BZK00;nKrqV!(n1!I40{{R8JOBU(03-ka0000003eg^2^uksM!0-0P0ax= z6p)@aP0azs&PyY|OU(gLO928u02BZK00;mZ?1^@s600IC40J8u90MH2l0001^GW$>f From 3ab197f400e369e6ae2a9b6994b36863b59a73c9 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Thu, 21 Jun 2012 23:34:34 +1200 Subject: [PATCH 02/12] Buff the Allies a bit - give them some riflemen. --- mods/ra/maps/allies-01.oramap | Bin 2705 -> 2682 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/mods/ra/maps/allies-01.oramap b/mods/ra/maps/allies-01.oramap index 53ce7e9bacc0dfe65c8cc086c62c92bf9592473a..6b878633a3a1cc4cbd0334831b3963cefafb28fe 100644 GIT binary patch literal 2682 zcmZ{mc{CJ^8pa2SvSi;X@+nL9DBEN$WU{Z*Op3V3E_;^GzGP%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ej%Wvbm1GV$hxrsb@*_les=Jn%$nCp6V)_J64Fjf42cvki|Nk%4q@KsV`@H$~OBo z5ew(SDYXp(sYk8e_5!r3WC7hjyviJZ#D)uJArta0K{wXe+$lkmJI^Dw(NiDNa=QQ~U@n?g7^$8*7}NYNIA!?S=!@%l#AIzuK$@r4=1#O=3_Ah$DS zL$-Y8{KsKti>Zn+CN;eM&0__ESBJR9t#{394gN@8m9piWl5Z+|>?IR))Ud|KGvk#t>Hgws1Qv^f;Ciz!TDh;?+YiJ3F8 z{L2?ICZ84RkGo(Ae_kp`V7Mb!jtbRw%0pG(S|%Y2FR4l2>y|%grGU-B8l6)CO#$<1 z>98)v%!xbi&wsl(B)7D=q0A-WL=1k*Y*oNSTA@X-W{UjkY8ViDUrQN5#0*Onn;C%X z*QgJeGViAt*?)UTL*0Z8Est1*%^I$G$6;`?p8r1o>2;?8g1-kefaAb0Xwi#?_0rs6er9!o zG7J8{@!!P%n=yYApYSvv7sr#rc#=5(W`^l$IGiy4jmiCgDH!R~gHGgWk9XxU;!d5s F{sZwc8E*gp From 1146790dc148694271c4419af0384ced51181b18 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Fri, 22 Jun 2012 13:07:24 +1200 Subject: [PATCH 03/12] Reworked the left side of the map to make it useful, and moved one of the spawnpoints there. --- mods/ra/maps/allies-01.oramap | Bin 2682 -> 2771 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/mods/ra/maps/allies-01.oramap b/mods/ra/maps/allies-01.oramap index 6b878633a3a1cc4cbd0334831b3963cefafb28fe..3b7a39d154555cb13d70dea1f6f1935a5e13e736 100644 GIT binary patch literal 2771 zcmZ{mc{CJUAIHZ!mU){J*=o#03E5Iqc1kA75+eJ^8j(RfS+Ycor7?zNEk%Ru`!>~J z?1RRVu|_c(1|jRr%k#X?bKY~_^WJ;T{oecg<8%M|p6}P#fQ_9W003|S3|xk_U}RIL zW;OtTLk$1`9!$L)edG}C50_p}+!WR3e~MSC%oxS1beP*go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w(GBl&s^c$rIF+Q@o@MiJlF#{-BML2M{ML=WJ=hT-W;1yqt z7B=POu6$(ql|9njtnxAWdvNDDAVrjrx6s%@gIIF2?44`GwcZV6#C<+Qa(rHuu%DoY0j#kK zRDI*DoEsQ*XIl|L2QtCAxXa@9OPGCGUbg6Pc6fl2IV87<9IAh{@I<90rUUpCO2#&S z5r~y2C|vLF+noyK@%%8%l*yx8GhDmhmLsjef$!`!x0_UPYH)_A4TyzR1MvT=-%*JC og?|^pzl;7JJO5QQ9JR>bqTeB817bglCIEo-Xnc=0{lxF Date: Fri, 22 Jun 2012 13:39:36 +1200 Subject: [PATCH 04/12] Bleep when objective shown --- OpenRA.Mods.RA/Missions/Allies01Script.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index 6918919566..de2f7825ce 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -73,6 +73,7 @@ namespace OpenRA.Mods.RA.Missions private void DisplayObjective() { Game.AddChatLine(Color.LimeGreen, "Objective", objectives[currentObjective]); + Sound.Play("bleep6.aud", 5); } private void MissionFailed(Actor self, string text) From 6ba0c448c8120b998fe0a2086414e882e30e92f7 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Fri, 22 Jun 2012 15:27:07 +1200 Subject: [PATCH 05/12] Remove killing of player when they fail the mission, this is more fun and it's also really loud when all the units die at once --- OpenRA.Mods.RA/Missions/Allies01Script.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index de2f7825ce..e0c86643f1 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -84,10 +84,6 @@ namespace OpenRA.Mods.RA.Missions } allies.WinState = WinState.Lost; Game.AddChatLine(Color.Red, "Mission failed", text); - foreach (var actor in self.World.Actors.Where(a => a.Owner == allies)) - { - actor.Kill(actor); - } self.World.LocalShroud.Disabled = true; Sound.Play("misnlst1.aud", 5); } From 7fb659bd3a75a40b9dad70f84cf1bd7533fcbcd6 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Sat, 23 Jun 2012 20:41:43 +1200 Subject: [PATCH 06/12] Make the mission a bit harder - add a heavy tank to each wave --- OpenRA.Mods.RA/Missions/Allies01Script.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index e0c86643f1..2128256dbc 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA.Missions private static readonly string[] ships = { "ca", "ca", "ca", "ca" }; - private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog" }; + private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog", "3tnk" }; private int currentAttackWaveFrameNumber; private int currentAttackWave; private const int einsteinChinookArrivesAtAttackWave = 5; From bda92f3898ea29fc422df1e558e774f8f9188b8c Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Sun, 24 Jun 2012 21:28:46 +1200 Subject: [PATCH 07/12] Only send the heavy tank on the last wave, this is the first mission after all --- OpenRA.Mods.RA/Missions/Allies01Script.cs | 440 +++++++++++----------- 1 file changed, 221 insertions(+), 219 deletions(-) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index 2128256dbc..01343ae748 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -19,251 +19,253 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Missions { - public class Allies01ScriptInfo : TraitInfo, Requires { } + public class Allies01ScriptInfo : TraitInfo, Requires { } - public class Allies01Script : IWorldLoaded, ITick - { - private static readonly string[] objectives = + public class Allies01Script : IWorldLoaded, ITick + { + private static readonly string[] objectives = { "Find Einstein.", "Wait for the helicopter and extract Einstein." }; - private int currentObjective; + private int currentObjective; - private Player allies; - private Player soviets; + private Player allies; + private Player soviets; - private ISound music; + private ISound music; - private Actor insertionLZ; - private Actor extractionLZ; - private Actor lab; - private Actor insertionLZEntryPoint; - private Actor extractionLZEntryPoint; - private Actor chinookExitPoint; - private Actor shipSpawnPoint; - private Actor shipMovePoint; - private Actor einstein; - private Actor einsteinChinook; - private Actor tanya; - private Actor attackEntryPoint1; - private Actor attackEntryPoint2; + private Actor insertionLZ; + private Actor extractionLZ; + private Actor lab; + private Actor insertionLZEntryPoint; + private Actor extractionLZEntryPoint; + private Actor chinookExitPoint; + private Actor shipSpawnPoint; + private Actor shipMovePoint; + private Actor einstein; + private Actor einsteinChinook; + private Actor tanya; + private Actor attackEntryPoint1; + private Actor attackEntryPoint2; - private static readonly string[] taunts = { "laugh1.aud", "lefty1.aud", "cmon1.aud", "gotit1.aud" }; + private static readonly string[] taunts = { "laugh1.aud", "lefty1.aud", "cmon1.aud", "gotit1.aud" }; - private static readonly string[] ships = { "ca", "ca", "ca", "ca" }; + private static readonly string[] ships = { "ca", "ca", "ca", "ca" }; - private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog", "3tnk" }; - private int currentAttackWaveFrameNumber; - private int currentAttackWave; - private const int einsteinChinookArrivesAtAttackWave = 5; + private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog" }; + private static readonly string[] lastAttackWaveAddition = { "3tnk" }; + private int currentAttackWaveFrameNumber; + private int currentAttackWave; + private const int einsteinChinookArrivesAtAttackWave = 5; - private const int labRange = 5; - private const string einsteinName = "c1"; - private const string tanyaName = "e7"; - private const string chinookName = "tran"; - private const string signalFlareName = "flare"; + private const int labRange = 5; + private const string einsteinName = "c1"; + private const string tanyaName = "e7"; + private const string chinookName = "tran"; + private const string signalFlareName = "flare"; - private void NextObjective() - { - currentObjective++; - } + private void NextObjective() + { + currentObjective++; + } - private void DisplayObjective() - { - Game.AddChatLine(Color.LimeGreen, "Objective", objectives[currentObjective]); - Sound.Play("bleep6.aud", 5); - } + private void DisplayObjective() + { + Game.AddChatLine(Color.LimeGreen, "Objective", objectives[currentObjective]); + Sound.Play("bleep6.aud", 5); + } - private void MissionFailed(Actor self, string text) - { - if (allies.WinState != WinState.Undefined) - { - return; - } - allies.WinState = WinState.Lost; - Game.AddChatLine(Color.Red, "Mission failed", text); - self.World.LocalShroud.Disabled = true; - Sound.Play("misnlst1.aud", 5); - } + private void MissionFailed(Actor self, string text) + { + if (allies.WinState != WinState.Undefined) + { + return; + } + allies.WinState = WinState.Lost; + Game.AddChatLine(Color.Red, "Mission failed", text); + self.World.LocalShroud.Disabled = true; + Sound.Play("misnlst1.aud", 5); + } - private void MissionAccomplished(Actor self, string text) - { - if (allies.WinState != WinState.Undefined) - { - return; - } - allies.WinState = WinState.Won; - Game.AddChatLine(Color.Blue, "Mission accomplished", text); - self.World.LocalShroud.Disabled = true; - Sound.Play("misnwon1.aud", 5); - } + private void MissionAccomplished(Actor self, string text) + { + if (allies.WinState != WinState.Undefined) + { + return; + } + allies.WinState = WinState.Won; + Game.AddChatLine(Color.Blue, "Mission accomplished", text); + self.World.LocalShroud.Disabled = true; + Sound.Play("misnwon1.aud", 5); + } - public void Tick(Actor self) - { - if (allies.WinState != WinState.Undefined) - { - return; - } - // display current objective every so often - if (self.World.FrameNumber % 1500 == 1) - { - DisplayObjective(); - } - // taunt every so often - if (self.World.FrameNumber % 1000 == 0) - { - Sound.Play(taunts[self.World.SharedRandom.Next(taunts.Length)]); - } - // take Tanya to the LZ - if (self.World.FrameNumber == 1) - { - FlyTanyaToInsertionLZ(self); - } - // objectives - if (currentObjective == 0) - { - if (AlliesControlLab(self)) - { - SpawnSignalFlare(self); - Sound.Play("flaren1.aud", 5); - SpawnEinsteinAtLab(self); // spawn Einstein once the area is clear - Sound.Play("einok1.aud"); // "Incredible!" - Einstein - SendShips(self); - NextObjective(); - DisplayObjective(); - currentAttackWaveFrameNumber = self.World.FrameNumber; - } - if (lab.Destroyed) - { - MissionFailed(self, "Einstein was killed."); - } - } - else if (currentObjective == 1) - { - if (self.World.FrameNumber >= currentAttackWaveFrameNumber + 600) - { - Sound.Play("enmyapp1.aud", 5); - SendAttackWave(self, attackWave); - currentAttackWave++; - currentAttackWaveFrameNumber = self.World.FrameNumber; - if (currentAttackWave == einsteinChinookArrivesAtAttackWave) - { - FlyEinsteinFromExtractionLZ(self); - } - } - if (einsteinChinook != null && !self.World.Map.IsInMap(einsteinChinook.Location) && !einstein.IsInWorld) - { - MissionAccomplished(self, "Einstein was rescued."); - } - if (einstein.Destroyed) - { - MissionFailed(self, "Einstein was killed."); - } - } - if (tanya.Destroyed) - { - MissionFailed(self, "Tanya was killed."); - } - } + public void Tick(Actor self) + { + if (allies.WinState != WinState.Undefined) + { + return; + } + // display current objective every so often + if (self.World.FrameNumber % 1500 == 1) + { + DisplayObjective(); + } + // taunt every so often + if (self.World.FrameNumber % 1000 == 0) + { + Sound.Play(taunts[self.World.SharedRandom.Next(taunts.Length)]); + } + // take Tanya to the LZ + if (self.World.FrameNumber == 1) + { + FlyTanyaToInsertionLZ(self); + } + // objectives + if (currentObjective == 0) + { + if (AlliesControlLab(self)) + { + SpawnSignalFlare(self); + Sound.Play("flaren1.aud", 5); + SpawnEinsteinAtLab(self); // spawn Einstein once the area is clear + Sound.Play("einok1.aud"); // "Incredible!" - Einstein + SendShips(self); + NextObjective(); + DisplayObjective(); + currentAttackWaveFrameNumber = self.World.FrameNumber; + } + if (lab.Destroyed) + { + MissionFailed(self, "Einstein was killed."); + } + } + else if (currentObjective == 1) + { + if (self.World.FrameNumber >= currentAttackWaveFrameNumber + 600) + { + Sound.Play("enmyapp1.aud", 5); + SendAttackWave(self, attackWave); + currentAttackWave++; + currentAttackWaveFrameNumber = self.World.FrameNumber; + if (currentAttackWave == einsteinChinookArrivesAtAttackWave) + { + SendAttackWave(self, lastAttackWaveAddition); + FlyEinsteinFromExtractionLZ(self); + } + } + if (einsteinChinook != null && !self.World.Map.IsInMap(einsteinChinook.Location) && !einstein.IsInWorld) + { + MissionAccomplished(self, "Einstein was rescued."); + } + if (einstein.Destroyed) + { + MissionFailed(self, "Einstein was killed."); + } + } + if (tanya.Destroyed) + { + MissionFailed(self, "Tanya was killed."); + } + } - private void SpawnSignalFlare(Actor self) - { - self.World.CreateActor(signalFlareName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZ.Location) }); - } + private void SpawnSignalFlare(Actor self) + { + self.World.CreateActor(signalFlareName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZ.Location) }); + } - private void SendAttackWave(Actor self, IEnumerable wave) - { - foreach (var unit in wave) - { - var spawnActor = self.World.SharedRandom.Next(2) == 0 ? attackEntryPoint1 : attackEntryPoint2; - var actor = self.World.CreateActor(unit, new TypeDictionary { new OwnerInit(soviets), new LocationInit(spawnActor.Location) }); - actor.QueueActivity(new AttackMove.AttackMoveActivity(actor, new Attack(Target.FromActor(einstein), 3))); // better way of doing this? - } - } + private void SendAttackWave(Actor self, IEnumerable wave) + { + foreach (var unit in wave) + { + var spawnActor = self.World.SharedRandom.Next(2) == 0 ? attackEntryPoint1 : attackEntryPoint2; + var actor = self.World.CreateActor(unit, new TypeDictionary { new OwnerInit(soviets), new LocationInit(spawnActor.Location) }); + actor.QueueActivity(new AttackMove.AttackMoveActivity(actor, new Attack(Target.FromActor(einstein), 3))); // better way of doing this? + } + } - private IEnumerable UnitsNearActor(Actor self, Actor actor, int range) - { - return self.World.FindUnitsInCircle(actor.CenterLocation, Game.CellSize * range) - .Where(a => a.IsInWorld && a != self.World.WorldActor && !a.Destroyed && a.HasTrait() && !a.Owner.NonCombatant); - } + private IEnumerable UnitsNearActor(Actor self, Actor actor, int range) + { + return self.World.FindUnitsInCircle(actor.CenterLocation, Game.CellSize * range) + .Where(a => a.IsInWorld && a != self.World.WorldActor && !a.Destroyed && a.HasTrait() && !a.Owner.NonCombatant); + } - private bool AlliesControlLab(Actor self) - { - var units = UnitsNearActor(self, lab, labRange); - return units.Any() && units.All(a => a.Owner == allies); - } + private bool AlliesControlLab(Actor self) + { + var units = UnitsNearActor(self, lab, labRange); + return units.Any() && units.All(a => a.Owner == allies); + } - private void SpawnEinsteinAtLab(Actor self) - { - einstein = self.World.CreateActor(einsteinName, new TypeDictionary { new OwnerInit(allies), new LocationInit(lab.Location) }); - } + private void SpawnEinsteinAtLab(Actor self) + { + einstein = self.World.CreateActor(einsteinName, new TypeDictionary { new OwnerInit(allies), new LocationInit(lab.Location) }); + } - private void SendShips(Actor self) - { - for (int i = 0; i < ships.Length; i++) - { - var actor = self.World.CreateActor(ships[i], - new TypeDictionary { new OwnerInit(allies), new LocationInit(shipSpawnPoint.Location + new int2(i * 2, 0)) }); - actor.QueueActivity(new Move.Move(shipMovePoint.Location + new int2(i * 4, 0))); - } - } + private void SendShips(Actor self) + { + for (int i = 0; i < ships.Length; i++) + { + var actor = self.World.CreateActor(ships[i], + new TypeDictionary { new OwnerInit(allies), new LocationInit(shipSpawnPoint.Location + new int2(i * 2, 0)) }); + actor.QueueActivity(new Move.Move(shipMovePoint.Location + new int2(i * 4, 0))); + } + } - private void FlyEinsteinFromExtractionLZ(Actor self) - { - einsteinChinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZEntryPoint.Location) }); - einsteinChinook.QueueActivity(new HeliFly(extractionLZ.CenterLocation)); - einsteinChinook.QueueActivity(new Turn(0)); - einsteinChinook.QueueActivity(new HeliLand(true)); - einsteinChinook.QueueActivity(new WaitFor(() => einsteinChinook.Trait().Passengers.Contains(einstein))); - einsteinChinook.QueueActivity(new Wait(150)); - einsteinChinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); - einsteinChinook.QueueActivity(new RemoveSelf()); - } + private void FlyEinsteinFromExtractionLZ(Actor self) + { + einsteinChinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZEntryPoint.Location) }); + einsteinChinook.QueueActivity(new HeliFly(extractionLZ.CenterLocation)); + einsteinChinook.QueueActivity(new Turn(0)); + einsteinChinook.QueueActivity(new HeliLand(true)); + einsteinChinook.QueueActivity(new WaitFor(() => einsteinChinook.Trait().Passengers.Contains(einstein))); + einsteinChinook.QueueActivity(new Wait(150)); + einsteinChinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); + einsteinChinook.QueueActivity(new RemoveSelf()); + } - private void FlyTanyaToInsertionLZ(Actor self) - { - tanya = self.World.CreateActor(false, tanyaName, new TypeDictionary { new OwnerInit(allies) }); - var chinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(insertionLZEntryPoint.Location) }); - chinook.Trait().Load(chinook, tanya); - // use CenterLocation for HeliFly, Location for Move - chinook.QueueActivity(new HeliFly(insertionLZ.CenterLocation)); - chinook.QueueActivity(new Turn(0)); - chinook.QueueActivity(new HeliLand(true)); - chinook.QueueActivity(new UnloadCargo()); - chinook.QueueActivity(new CallFunc(() => Sound.Play("laugh1.aud"))); - chinook.QueueActivity(new Wait(150)); - chinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); - chinook.QueueActivity(new RemoveSelf()); - } + private void FlyTanyaToInsertionLZ(Actor self) + { + tanya = self.World.CreateActor(false, tanyaName, new TypeDictionary { new OwnerInit(allies) }); + var chinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(insertionLZEntryPoint.Location) }); + chinook.Trait().Load(chinook, tanya); + // use CenterLocation for HeliFly, Location for Move + chinook.QueueActivity(new HeliFly(insertionLZ.CenterLocation)); + chinook.QueueActivity(new Turn(0)); + chinook.QueueActivity(new HeliLand(true)); + chinook.QueueActivity(new UnloadCargo()); + chinook.QueueActivity(new CallFunc(() => Sound.Play("laugh1.aud"))); + chinook.QueueActivity(new Wait(150)); + chinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); + chinook.QueueActivity(new RemoveSelf()); + } - public void WorldLoaded(World w) - { - allies = w.Players.Single(p => p.InternalName == "Allies"); - soviets = w.Players.Single(p => p.InternalName == "Soviets"); - var actors = w.WorldActor.Trait().Actors; - insertionLZ = actors["InsertionLZ"]; - extractionLZ = actors["ExtractionLZ"]; - lab = actors["Lab"]; - insertionLZEntryPoint = actors["InsertionLZEntryPoint"]; - chinookExitPoint = actors["ChinookExitPoint"]; - extractionLZEntryPoint = actors["ExtractionLZEntryPoint"]; - shipSpawnPoint = actors["ShipSpawnPoint"]; - shipMovePoint = actors["ShipMovePoint"]; - attackEntryPoint1 = actors["SovietAttackEntryPoint1"]; - attackEntryPoint2 = actors["SovietAttackEntryPoint2"]; - music = Sound.Play("hell226m.aud"); // Hell March - Game.ConnectionStateChanged += StopMusic; - } + public void WorldLoaded(World w) + { + allies = w.Players.Single(p => p.InternalName == "Allies"); + soviets = w.Players.Single(p => p.InternalName == "Soviets"); + var actors = w.WorldActor.Trait().Actors; + insertionLZ = actors["InsertionLZ"]; + extractionLZ = actors["ExtractionLZ"]; + lab = actors["Lab"]; + insertionLZEntryPoint = actors["InsertionLZEntryPoint"]; + chinookExitPoint = actors["ChinookExitPoint"]; + extractionLZEntryPoint = actors["ExtractionLZEntryPoint"]; + shipSpawnPoint = actors["ShipSpawnPoint"]; + shipMovePoint = actors["ShipMovePoint"]; + attackEntryPoint1 = actors["SovietAttackEntryPoint1"]; + attackEntryPoint2 = actors["SovietAttackEntryPoint2"]; + music = Sound.Play("hell226m.aud"); // Hell March + Game.ConnectionStateChanged += StopMusic; + } - private void StopMusic(OrderManager orderManager) - { - if (!orderManager.GameStarted) - { - Sound.StopSound(music); - Game.ConnectionStateChanged -= StopMusic; - } - } - } + private void StopMusic(OrderManager orderManager) + { + if (!orderManager.GameStarted) + { + Sound.StopSound(music); + Game.ConnectionStateChanged -= StopMusic; + } + } + } } From 380875ad3e7ffb64b970e331595a44bc3b064568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 24 Jun 2012 19:24:26 +0300 Subject: [PATCH 08/12] added Einstein --- mods/ra/rules/infantry.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mods/ra/rules/infantry.yaml b/mods/ra/rules/infantry.yaml index f45313c1c1..7b3aa40600 100644 --- a/mods/ra/rules/infantry.yaml +++ b/mods/ra/rules/infantry.yaml @@ -305,6 +305,27 @@ C2: ProximityCaptor: Types:CivilianInfantry +EINSTEIN: + Inherits: ^Infantry + Selectable: + Voice: EinsteinVoice + Bounds: 12,17,0,-9 + Valued: + Cost: 10 + Tooltip: + Name: Prof. Einstein + Health: + HP: 25 + Mobile: + Speed: 5 + RevealsShroud: + Range: 2 + -AutoTarget: + AttackMove: + JustMove: true + ProximityCaptor: + Types:CivilianInfantry + SHOK: Inherits: ^Infantry Buildable: From 5b470650b792de9d5c340e78513049f7f0a773d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 24 Jun 2012 19:26:03 +0300 Subject: [PATCH 09/12] added Einstein --- mods/ra/sequences.yaml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/mods/ra/sequences.yaml b/mods/ra/sequences.yaml index f31f7e6ba5..e748e8a4f5 100644 --- a/mods/ra/sequences.yaml +++ b/mods/ra/sequences.yaml @@ -1877,6 +1877,45 @@ c2: Length: 6 Facings: 8 +einstein: + stand: + Start: 0 + Facings: 8 + panic-run: + Start: 8 + Length: 6 + Facings: 8 + panic-stand: + Start: 8 + Length: 6 + Facings: 8 + run: + Start: 56 + Length: 6 + Facings: 8 + die1: + Start: 115 + Length: 8 + die2: + Start: 123 + Length: 8 + die3: + Start: 135 + Length: 12 + die4: + Start: 147 + Length: 17 + die5: + Start: 123 + Length: 8 + die6: electro + Start: 0 + Length: * + die-crushed: corpse1 + Start: 0 + Length: 6 + Tick: 1600 + parabomb: open: Start: 0 From 079a52ee65be3835faf52843546fb1b9ca72d602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 24 Jun 2012 19:27:05 +0300 Subject: [PATCH 10/12] added Einstein --- OpenRA.Mods.RA/Missions/Allies01Script.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index 01343ae748..2e9beb915f 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -61,7 +61,7 @@ namespace OpenRA.Mods.RA.Missions private const int einsteinChinookArrivesAtAttackWave = 5; private const int labRange = 5; - private const string einsteinName = "c1"; + private const string einsteinName = "einstein"; private const string tanyaName = "e7"; private const string chinookName = "tran"; private const string signalFlareName = "flare"; From 2cc749118f1dcd715135e94a94b6f90358e627cf Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Mon, 25 Jun 2012 05:19:25 +1200 Subject: [PATCH 11/12] Make it more overwhelming at the fifth wave and each wave after that --- OpenRA.Mods.RA/Missions/Allies01Script.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index 2e9beb915f..8d240277a8 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA.Missions private static readonly string[] ships = { "ca", "ca", "ca", "ca" }; private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog" }; - private static readonly string[] lastAttackWaveAddition = { "3tnk" }; + private static readonly string[] lastAttackWaveAddition = { "3tnk", "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2" }; private int currentAttackWaveFrameNumber; private int currentAttackWave; private const int einsteinChinookArrivesAtAttackWave = 5; @@ -149,11 +149,14 @@ namespace OpenRA.Mods.RA.Missions SendAttackWave(self, attackWave); currentAttackWave++; currentAttackWaveFrameNumber = self.World.FrameNumber; - if (currentAttackWave == einsteinChinookArrivesAtAttackWave) - { - SendAttackWave(self, lastAttackWaveAddition); - FlyEinsteinFromExtractionLZ(self); - } + if (currentAttackWave >= einsteinChinookArrivesAtAttackWave) + { + SendAttackWave(self, lastAttackWaveAddition); + } + if (currentAttackWave == einsteinChinookArrivesAtAttackWave) + { + FlyEinsteinFromExtractionLZ(self); + } } if (einsteinChinook != null && !self.World.Map.IsInMap(einsteinChinook.Location) && !einstein.IsInWorld) { From 9c6bc45f8f132921f72093997856b1148742de68 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Mon, 25 Jun 2012 05:34:06 +1200 Subject: [PATCH 12/12] Fix whitespace --- OpenRA.Mods.RA/Missions/Allies01Script.cs | 440 +++++++++++----------- 1 file changed, 220 insertions(+), 220 deletions(-) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index 8d240277a8..2d1018ebef 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -19,136 +19,136 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Missions { - public class Allies01ScriptInfo : TraitInfo, Requires { } + public class Allies01ScriptInfo : TraitInfo, Requires { } - public class Allies01Script : IWorldLoaded, ITick - { - private static readonly string[] objectives = - { - "Find Einstein.", - "Wait for the helicopter and extract Einstein." - }; + public class Allies01Script : IWorldLoaded, ITick + { + private static readonly string[] objectives = + { + "Find Einstein.", + "Wait for the helicopter and extract Einstein." + }; - private int currentObjective; + private int currentObjective; - private Player allies; - private Player soviets; + private Player allies; + private Player soviets; - private ISound music; + private ISound music; - private Actor insertionLZ; - private Actor extractionLZ; - private Actor lab; - private Actor insertionLZEntryPoint; - private Actor extractionLZEntryPoint; - private Actor chinookExitPoint; - private Actor shipSpawnPoint; - private Actor shipMovePoint; - private Actor einstein; - private Actor einsteinChinook; - private Actor tanya; - private Actor attackEntryPoint1; - private Actor attackEntryPoint2; + private Actor insertionLZ; + private Actor extractionLZ; + private Actor lab; + private Actor insertionLZEntryPoint; + private Actor extractionLZEntryPoint; + private Actor chinookExitPoint; + private Actor shipSpawnPoint; + private Actor shipMovePoint; + private Actor einstein; + private Actor einsteinChinook; + private Actor tanya; + private Actor attackEntryPoint1; + private Actor attackEntryPoint2; - private static readonly string[] taunts = { "laugh1.aud", "lefty1.aud", "cmon1.aud", "gotit1.aud" }; + private static readonly string[] taunts = { "laugh1.aud", "lefty1.aud", "cmon1.aud", "gotit1.aud" }; - private static readonly string[] ships = { "ca", "ca", "ca", "ca" }; + private static readonly string[] ships = { "ca", "ca", "ca", "ca" }; - private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog" }; - private static readonly string[] lastAttackWaveAddition = { "3tnk", "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2" }; - private int currentAttackWaveFrameNumber; - private int currentAttackWave; - private const int einsteinChinookArrivesAtAttackWave = 5; + private static readonly string[] attackWave = { "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "dog" }; + private static readonly string[] lastAttackWaveAddition = { "3tnk", "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2" }; + private int currentAttackWaveFrameNumber; + private int currentAttackWave; + private const int einsteinChinookArrivesAtAttackWave = 5; - private const int labRange = 5; - private const string einsteinName = "einstein"; - private const string tanyaName = "e7"; - private const string chinookName = "tran"; - private const string signalFlareName = "flare"; + private const int labRange = 5; + private const string einsteinName = "einstein"; + private const string tanyaName = "e7"; + private const string chinookName = "tran"; + private const string signalFlareName = "flare"; - private void NextObjective() - { - currentObjective++; - } + private void NextObjective() + { + currentObjective++; + } - private void DisplayObjective() - { - Game.AddChatLine(Color.LimeGreen, "Objective", objectives[currentObjective]); - Sound.Play("bleep6.aud", 5); - } + private void DisplayObjective() + { + Game.AddChatLine(Color.LimeGreen, "Objective", objectives[currentObjective]); + Sound.Play("bleep6.aud", 5); + } - private void MissionFailed(Actor self, string text) - { - if (allies.WinState != WinState.Undefined) - { - return; - } - allies.WinState = WinState.Lost; - Game.AddChatLine(Color.Red, "Mission failed", text); - self.World.LocalShroud.Disabled = true; - Sound.Play("misnlst1.aud", 5); - } + private void MissionFailed(Actor self, string text) + { + if (allies.WinState != WinState.Undefined) + { + return; + } + allies.WinState = WinState.Lost; + Game.AddChatLine(Color.Red, "Mission failed", text); + self.World.LocalShroud.Disabled = true; + Sound.Play("misnlst1.aud", 5); + } - private void MissionAccomplished(Actor self, string text) - { - if (allies.WinState != WinState.Undefined) - { - return; - } - allies.WinState = WinState.Won; - Game.AddChatLine(Color.Blue, "Mission accomplished", text); - self.World.LocalShroud.Disabled = true; - Sound.Play("misnwon1.aud", 5); - } + private void MissionAccomplished(Actor self, string text) + { + if (allies.WinState != WinState.Undefined) + { + return; + } + allies.WinState = WinState.Won; + Game.AddChatLine(Color.Blue, "Mission accomplished", text); + self.World.LocalShroud.Disabled = true; + Sound.Play("misnwon1.aud", 5); + } - public void Tick(Actor self) - { - if (allies.WinState != WinState.Undefined) - { - return; - } - // display current objective every so often - if (self.World.FrameNumber % 1500 == 1) - { - DisplayObjective(); - } - // taunt every so often - if (self.World.FrameNumber % 1000 == 0) - { - Sound.Play(taunts[self.World.SharedRandom.Next(taunts.Length)]); - } - // take Tanya to the LZ - if (self.World.FrameNumber == 1) - { - FlyTanyaToInsertionLZ(self); - } - // objectives - if (currentObjective == 0) - { - if (AlliesControlLab(self)) - { - SpawnSignalFlare(self); - Sound.Play("flaren1.aud", 5); - SpawnEinsteinAtLab(self); // spawn Einstein once the area is clear - Sound.Play("einok1.aud"); // "Incredible!" - Einstein - SendShips(self); - NextObjective(); - DisplayObjective(); - currentAttackWaveFrameNumber = self.World.FrameNumber; - } - if (lab.Destroyed) - { - MissionFailed(self, "Einstein was killed."); - } - } - else if (currentObjective == 1) - { - if (self.World.FrameNumber >= currentAttackWaveFrameNumber + 600) - { - Sound.Play("enmyapp1.aud", 5); - SendAttackWave(self, attackWave); - currentAttackWave++; - currentAttackWaveFrameNumber = self.World.FrameNumber; + public void Tick(Actor self) + { + if (allies.WinState != WinState.Undefined) + { + return; + } + // display current objective every so often + if (self.World.FrameNumber % 1500 == 1) + { + DisplayObjective(); + } + // taunt every so often + if (self.World.FrameNumber % 1000 == 0) + { + Sound.Play(taunts[self.World.SharedRandom.Next(taunts.Length)]); + } + // take Tanya to the LZ + if (self.World.FrameNumber == 1) + { + FlyTanyaToInsertionLZ(self); + } + // objectives + if (currentObjective == 0) + { + if (AlliesControlLab(self)) + { + SpawnSignalFlare(self); + Sound.Play("flaren1.aud", 5); + SpawnEinsteinAtLab(self); // spawn Einstein once the area is clear + Sound.Play("einok1.aud"); // "Incredible!" - Einstein + SendShips(self); + NextObjective(); + DisplayObjective(); + currentAttackWaveFrameNumber = self.World.FrameNumber; + } + if (lab.Destroyed) + { + MissionFailed(self, "Einstein was killed."); + } + } + else if (currentObjective == 1) + { + if (self.World.FrameNumber >= currentAttackWaveFrameNumber + 600) + { + Sound.Play("enmyapp1.aud", 5); + SendAttackWave(self, attackWave); + currentAttackWave++; + currentAttackWaveFrameNumber = self.World.FrameNumber; if (currentAttackWave >= einsteinChinookArrivesAtAttackWave) { SendAttackWave(self, lastAttackWaveAddition); @@ -157,118 +157,118 @@ namespace OpenRA.Mods.RA.Missions { FlyEinsteinFromExtractionLZ(self); } - } - if (einsteinChinook != null && !self.World.Map.IsInMap(einsteinChinook.Location) && !einstein.IsInWorld) - { - MissionAccomplished(self, "Einstein was rescued."); - } - if (einstein.Destroyed) - { - MissionFailed(self, "Einstein was killed."); - } - } - if (tanya.Destroyed) - { - MissionFailed(self, "Tanya was killed."); - } - } + } + if (einsteinChinook != null && !self.World.Map.IsInMap(einsteinChinook.Location) && !einstein.IsInWorld) + { + MissionAccomplished(self, "Einstein was rescued."); + } + if (einstein.Destroyed) + { + MissionFailed(self, "Einstein was killed."); + } + } + if (tanya.Destroyed) + { + MissionFailed(self, "Tanya was killed."); + } + } - private void SpawnSignalFlare(Actor self) - { - self.World.CreateActor(signalFlareName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZ.Location) }); - } + private void SpawnSignalFlare(Actor self) + { + self.World.CreateActor(signalFlareName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZ.Location) }); + } - private void SendAttackWave(Actor self, IEnumerable wave) - { - foreach (var unit in wave) - { - var spawnActor = self.World.SharedRandom.Next(2) == 0 ? attackEntryPoint1 : attackEntryPoint2; - var actor = self.World.CreateActor(unit, new TypeDictionary { new OwnerInit(soviets), new LocationInit(spawnActor.Location) }); - actor.QueueActivity(new AttackMove.AttackMoveActivity(actor, new Attack(Target.FromActor(einstein), 3))); // better way of doing this? - } - } + private void SendAttackWave(Actor self, IEnumerable wave) + { + foreach (var unit in wave) + { + var spawnActor = self.World.SharedRandom.Next(2) == 0 ? attackEntryPoint1 : attackEntryPoint2; + var actor = self.World.CreateActor(unit, new TypeDictionary { new OwnerInit(soviets), new LocationInit(spawnActor.Location) }); + actor.QueueActivity(new AttackMove.AttackMoveActivity(actor, new Attack(Target.FromActor(einstein), 3))); // better way of doing this? + } + } - private IEnumerable UnitsNearActor(Actor self, Actor actor, int range) - { - return self.World.FindUnitsInCircle(actor.CenterLocation, Game.CellSize * range) - .Where(a => a.IsInWorld && a != self.World.WorldActor && !a.Destroyed && a.HasTrait() && !a.Owner.NonCombatant); - } + private IEnumerable UnitsNearActor(Actor self, Actor actor, int range) + { + return self.World.FindUnitsInCircle(actor.CenterLocation, Game.CellSize * range) + .Where(a => a.IsInWorld && a != self.World.WorldActor && !a.Destroyed && a.HasTrait() && !a.Owner.NonCombatant); + } - private bool AlliesControlLab(Actor self) - { - var units = UnitsNearActor(self, lab, labRange); - return units.Any() && units.All(a => a.Owner == allies); - } + private bool AlliesControlLab(Actor self) + { + var units = UnitsNearActor(self, lab, labRange); + return units.Any() && units.All(a => a.Owner == allies); + } - private void SpawnEinsteinAtLab(Actor self) - { - einstein = self.World.CreateActor(einsteinName, new TypeDictionary { new OwnerInit(allies), new LocationInit(lab.Location) }); - } + private void SpawnEinsteinAtLab(Actor self) + { + einstein = self.World.CreateActor(einsteinName, new TypeDictionary { new OwnerInit(allies), new LocationInit(lab.Location) }); + } - private void SendShips(Actor self) - { - for (int i = 0; i < ships.Length; i++) - { - var actor = self.World.CreateActor(ships[i], - new TypeDictionary { new OwnerInit(allies), new LocationInit(shipSpawnPoint.Location + new int2(i * 2, 0)) }); - actor.QueueActivity(new Move.Move(shipMovePoint.Location + new int2(i * 4, 0))); - } - } + private void SendShips(Actor self) + { + for (int i = 0; i < ships.Length; i++) + { + var actor = self.World.CreateActor(ships[i], + new TypeDictionary { new OwnerInit(allies), new LocationInit(shipSpawnPoint.Location + new int2(i * 2, 0)) }); + actor.QueueActivity(new Move.Move(shipMovePoint.Location + new int2(i * 4, 0))); + } + } - private void FlyEinsteinFromExtractionLZ(Actor self) - { - einsteinChinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZEntryPoint.Location) }); - einsteinChinook.QueueActivity(new HeliFly(extractionLZ.CenterLocation)); - einsteinChinook.QueueActivity(new Turn(0)); - einsteinChinook.QueueActivity(new HeliLand(true)); - einsteinChinook.QueueActivity(new WaitFor(() => einsteinChinook.Trait().Passengers.Contains(einstein))); - einsteinChinook.QueueActivity(new Wait(150)); - einsteinChinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); - einsteinChinook.QueueActivity(new RemoveSelf()); - } + private void FlyEinsteinFromExtractionLZ(Actor self) + { + einsteinChinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZEntryPoint.Location) }); + einsteinChinook.QueueActivity(new HeliFly(extractionLZ.CenterLocation)); + einsteinChinook.QueueActivity(new Turn(0)); + einsteinChinook.QueueActivity(new HeliLand(true)); + einsteinChinook.QueueActivity(new WaitFor(() => einsteinChinook.Trait().Passengers.Contains(einstein))); + einsteinChinook.QueueActivity(new Wait(150)); + einsteinChinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); + einsteinChinook.QueueActivity(new RemoveSelf()); + } - private void FlyTanyaToInsertionLZ(Actor self) - { - tanya = self.World.CreateActor(false, tanyaName, new TypeDictionary { new OwnerInit(allies) }); - var chinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(insertionLZEntryPoint.Location) }); - chinook.Trait().Load(chinook, tanya); - // use CenterLocation for HeliFly, Location for Move - chinook.QueueActivity(new HeliFly(insertionLZ.CenterLocation)); - chinook.QueueActivity(new Turn(0)); - chinook.QueueActivity(new HeliLand(true)); - chinook.QueueActivity(new UnloadCargo()); - chinook.QueueActivity(new CallFunc(() => Sound.Play("laugh1.aud"))); - chinook.QueueActivity(new Wait(150)); - chinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); - chinook.QueueActivity(new RemoveSelf()); - } + private void FlyTanyaToInsertionLZ(Actor self) + { + tanya = self.World.CreateActor(false, tanyaName, new TypeDictionary { new OwnerInit(allies) }); + var chinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(insertionLZEntryPoint.Location) }); + chinook.Trait().Load(chinook, tanya); + // use CenterLocation for HeliFly, Location for Move + chinook.QueueActivity(new HeliFly(insertionLZ.CenterLocation)); + chinook.QueueActivity(new Turn(0)); + chinook.QueueActivity(new HeliLand(true)); + chinook.QueueActivity(new UnloadCargo()); + chinook.QueueActivity(new CallFunc(() => Sound.Play("laugh1.aud"))); + chinook.QueueActivity(new Wait(150)); + chinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); + chinook.QueueActivity(new RemoveSelf()); + } - public void WorldLoaded(World w) - { - allies = w.Players.Single(p => p.InternalName == "Allies"); - soviets = w.Players.Single(p => p.InternalName == "Soviets"); - var actors = w.WorldActor.Trait().Actors; - insertionLZ = actors["InsertionLZ"]; - extractionLZ = actors["ExtractionLZ"]; - lab = actors["Lab"]; - insertionLZEntryPoint = actors["InsertionLZEntryPoint"]; - chinookExitPoint = actors["ChinookExitPoint"]; - extractionLZEntryPoint = actors["ExtractionLZEntryPoint"]; - shipSpawnPoint = actors["ShipSpawnPoint"]; - shipMovePoint = actors["ShipMovePoint"]; - attackEntryPoint1 = actors["SovietAttackEntryPoint1"]; - attackEntryPoint2 = actors["SovietAttackEntryPoint2"]; - music = Sound.Play("hell226m.aud"); // Hell March - Game.ConnectionStateChanged += StopMusic; - } + public void WorldLoaded(World w) + { + allies = w.Players.Single(p => p.InternalName == "Allies"); + soviets = w.Players.Single(p => p.InternalName == "Soviets"); + var actors = w.WorldActor.Trait().Actors; + insertionLZ = actors["InsertionLZ"]; + extractionLZ = actors["ExtractionLZ"]; + lab = actors["Lab"]; + insertionLZEntryPoint = actors["InsertionLZEntryPoint"]; + chinookExitPoint = actors["ChinookExitPoint"]; + extractionLZEntryPoint = actors["ExtractionLZEntryPoint"]; + shipSpawnPoint = actors["ShipSpawnPoint"]; + shipMovePoint = actors["ShipMovePoint"]; + attackEntryPoint1 = actors["SovietAttackEntryPoint1"]; + attackEntryPoint2 = actors["SovietAttackEntryPoint2"]; + music = Sound.Play("hell226m.aud"); // Hell March + Game.ConnectionStateChanged += StopMusic; + } - private void StopMusic(OrderManager orderManager) - { - if (!orderManager.GameStarted) - { - Sound.StopSound(music); - Game.ConnectionStateChanged -= StopMusic; - } - } - } + private void StopMusic(OrderManager orderManager) + { + if (!orderManager.GameStarted) + { + Sound.StopSound(music); + Game.ConnectionStateChanged -= StopMusic; + } + } + } }