From b282dffbaf5c0ce5f9b4f40d5076d616e7ac21da Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Fri, 29 May 2015 21:57:43 +0200 Subject: [PATCH] Added atreides-01b --- OpenRA.sln | 3 +- mods/d2k/maps/atreides-01b/atreides01b.lua | 158 ++++++++++++++++++ mods/d2k/maps/atreides-01b/map.bin | Bin 0 -> 4497 bytes mods/d2k/maps/atreides-01b/map.yaml | 178 +++++++++++++++++++++ mods/d2k/missions.yaml | 2 +- 5 files changed, 339 insertions(+), 2 deletions(-) create mode 100644 mods/d2k/maps/atreides-01b/atreides01b.lua create mode 100644 mods/d2k/maps/atreides-01b/map.bin create mode 100644 mods/d2k/maps/atreides-01b/map.yaml diff --git a/OpenRA.sln b/OpenRA.sln index af35229a91..681845a93a 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -67,8 +67,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Red Alert Lua scripts", "Re EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dune 2000 Lua scripts", "Dune 2000 Lua scripts", "{06B1AE07-DDB0-4287-8700-A8CD9A0E652E}" ProjectSection(SolutionItems) = preProject - mods\d2k\maps\atreides-01a\atreides01a.lua = mods\d2k\maps\atreides-01a\atreides01a.lua mods\d2k\maps\shellmap\shellmap.lua = mods\d2k\maps\shellmap\shellmap.lua + mods\d2k\maps\atreides-01a\atreides01a.lua = mods\d2k\maps\atreides-01a\atreides01a.lua + mods\d2k\maps\atreides-01b\atreides01b.lua = mods\d2k\maps\atreides-01b\atreides01b.lua EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "System Lua scripts", "System Lua scripts", "{A4D6AEA4-8009-4256-903B-8D227E50452B}" diff --git a/mods/d2k/maps/atreides-01b/atreides01b.lua b/mods/d2k/maps/atreides-01b/atreides01b.lua new file mode 100644 index 0000000000..08e35e3d34 --- /dev/null +++ b/mods/d2k/maps/atreides-01b/atreides01b.lua @@ -0,0 +1,158 @@ + +HarkonnenReinforcements = { } +HarkonnenReinforcements["Easy"] = +{ + { "rifle", "rifle" } +} + +HarkonnenReinforcements["Normal"] = +{ + { "rifle", "rifle" }, + { "rifle", "rifle", "rifle" }, + { "rifle", "trike" }, +} + +HarkonnenReinforcements["Hard"] = +{ + { "rifle", "rifle" }, + { "trike", "trike" }, + { "rifle", "rifle", "rifle" }, + { "rifle", "trike" }, + { "trike", "trike" } +} + +HarkonnenEntryWaypoints = { HarkonnenWaypoint1.Location, HarkonnenWaypoint2.Location, HarkonnenWaypoint3.Location, HarkonnenWaypoint4.Location } +HarkonnenAttackDelay = DateTime.Seconds(30) +HarkonnenAttackWaves = 1 + +AtreidesReinforcements = { "rifle", "rifle", "rifle", "rifle" } +AtreidesEntryPath = { AtreidesWaypoint.Location, AtreidesRally.Location } + +Messages = +{ + "Build a concrete foundation before placing your buildings.", + "Build a Wind Trap for power.", + "Build a Refinery to collect Spice.", + "Build a Silo to store additional Spice." +} + +ToHarvest = 2500 + +IdleHunt = function(actor) + if not actor.IsDead then + Trigger.OnIdle(actor, actor.Hunt) + end +end + +Tick = function() + if HarkonnenArrived and harkonnen.HasNoRequiredUnits() then + player.MarkCompletedObjective(KillHarkonnen) + end + + if player.Resources > ToHarvest - 1 then + player.MarkCompletedObjective(GatherSpice) + end + + -- player has no Wind Trap + if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then + HasPower = false + Media.DisplayMessage(Messages[2], "Mentat") + else + HasPower = true + end + + -- player has no Refinery and no Silos + if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then + Media.DisplayMessage(Messages[3], "Mentat") + end + + if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then + Media.DisplayMessage(Messages[4], "Mentat") + end + + UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. ToHarvest, player.Color) +end + +WorldLoaded = function() + player = Player.GetPlayer("Atreides") + harkonnen = Player.GetPlayer("Harkonnen") + + if Map.Difficulty == "Normal" then + HarkonnenAttackWaves = 5 + ToHarvest = 3000 + elseif Map.Difficulty == "Hard" then + HarkonnenAttackWaves = 12 + ToHarvest = 3500 + end + + InitObjectives() + + Trigger.OnRemovedFromWorld(AtreidesConyard, function() + local refs = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor) + return actor.Type == "refinery" + end) + + if #refs == 0 then + harkonnen.MarkCompletedObjective(KillAtreides) + else + Trigger.OnAllRemovedFromWorld(refs, function() + harkonnen.MarkCompletedObjective(KillAtreides) + end) + end + end) + + Media.DisplayMessage(Messages[1], "Mentat") + + Trigger.AfterDelay(DateTime.Seconds(25), function() + Media.PlaySpeechNotification(player, "Reinforce") + Reinforcements.Reinforce(player, AtreidesReinforcements, AtreidesEntryPath) + end) + + SendReinforcements() +end + +SendReinforcements = function() + local units = HarkonnenReinforcements[Map.Difficulty] + local delay = Utils.RandomInteger(HarkonnenAttackDelay - DateTime.Seconds(2), HarkonnenAttackDelay) + HarkonnenAttackDelay = HarkonnenAttackDelay - (#units * 3 - 3 - HarkonnenAttackWaves) * DateTime.Seconds(1) + if HarkonnenAttackDelay < 0 then HarkonnenAttackDelay = 0 end + + Trigger.AfterDelay(delay, function() + Reinforcements.Reinforce(harkonnen, Utils.Random(units), { Utils.Random(HarkonnenEntryWaypoints) }, 10, IdleHunt) + + HarkonnenAttackWaves = HarkonnenAttackWaves - 1 + if HarkonnenAttackWaves == 0 then + Trigger.AfterDelay(DateTime.Seconds(1), function() HarkonnenArrived = true end) + else + SendReinforcements() + end + end) +end + +InitObjectives = function() + Trigger.OnObjectiveAdded(player, function(p, id) + Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective") + end) + + KillAtreides = harkonnen.AddPrimaryObjective("Kill all Atreides units.") + GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(ToHarvest) .. " Solaris worth of Spice.") + KillHarkonnen = player.AddSecondaryObjective("Eliminate all Harkonnen units and reinforcements\nin the area.") + + Trigger.OnObjectiveCompleted(player, function(p, id) + Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed") + end) + Trigger.OnObjectiveFailed(player, function(p, id) + Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed") + end) + + Trigger.OnPlayerLost(player, function() + Trigger.AfterDelay(DateTime.Seconds(1), function() + Media.PlaySpeechNotification(player, "Lose") + end) + end) + Trigger.OnPlayerWon(player, function() + Trigger.AfterDelay(DateTime.Seconds(1), function() + Media.PlaySpeechNotification(player, "Win") + end) + end) +end diff --git a/mods/d2k/maps/atreides-01b/map.bin b/mods/d2k/maps/atreides-01b/map.bin new file mode 100644 index 0000000000000000000000000000000000000000..7310830200aaf697fef2ddf74b1fda12c00cb5b1 GIT binary patch literal 4497 zcmeH|!EPHz5JanYNm^dT34G8k2Oj8~q?>L5atI6r4jcpd0DnXRNq_-=L_SV{BGLbm zV_r|~?2af}k#z|Icr_UI^i?Win6$Y@`E-6TQ{+xooXIN|)-db1eT( z$msS%$rnvZNX@OZ&C-aOQ6S$wnZHzrlaGpeE}HR!^o!z0=|kqtwMf5JY)3)Yh-~}N zlm14!nVU8`f2$bc;7B^kEx3nePLZv;?N~+9%V;&hEN>Jy>M`~zM|UQjsauAISR5&i zMw3&QECMk*wy*ZFaC-7<3dSq-XNoiRe@O3hbc@i>5=|%y+0W{YQ_$Sw)2?V;F}57y z*$^G$_Y{ox>W5e!OUKy(=yYK9SL)-lzm;w?f9E@dlwA!m(7hp0V7wUOIfa)D^LNLJ zI&o-7B*{%A#gt@~Q{3UU_7V0@QLhPC-xgWKmwj-FQF`tgeIuxOu(U#}N$ozD z-Gfu?F?C6dEP{+X?`L_3t(kyR#c6gG+3aE4#?n1|^A{hM{aCs6 z>EoC^7Bpckt<`PjHnIgBpXj)I=y>TnUFUS=wuB0n<7df192@ov;*LlR<2LNQ4 z+lLIpfc{Exl|TFZ5Awe@8)KJ&ESk)gbxfX1C)qwEAp$VQ#tzTRzqTSp27qTPGh4Pz z-q(a>1Ga7FR$yxii0K|kypeSNzE3hB8R%e@qm7(iLXrj;X^in8VcAUUlOzD^I7Sv2 zT$Zkmzyp{aPEH5_lW!jjLYXQuojih8w$(|Ntx40incD{<0}K>%p%9SabOtf=bTqNS z;7J?e*}^LQy%#g-WPIG+Pp^|GQrA0-Iw^Q)Tfw)R zPAt1+Ri?T>dfLw%yPw$9zN?Q+v;XgU6;VCZb$;&4wfhybn|mm~4?E|4;=KMZqkjNO C??zAn literal 0 HcmV?d00001 diff --git a/mods/d2k/maps/atreides-01b/map.yaml b/mods/d2k/maps/atreides-01b/map.yaml new file mode 100644 index 0000000000..e60b9d0dd4 --- /dev/null +++ b/mods/d2k/maps/atreides-01b/map.yaml @@ -0,0 +1,178 @@ +MapFormat: 7 + +RequiresMod: d2k + +Title: Atreides 01b + +Description: Harvest Spice from the Imperial Basin. Construct a Spice Refinery and defend it against the Harkonnen troops scattered throughout the basin. You have been assigned only limited offensive forces - use them wisely.\n\nYou will have to learn the subtleties of mining as you go, but remember to build Silos to store the Spice. When you run out of storage space you can not gather more Spice. Also, any building without adequate concrete foundation will need immediate repair and be vulnerable to erosive damage from the harsh environment. Your greatest adversary may be the elements. Good luck.\n + +Author: Westwood Studios + +Tileset: ARRAKIS + +MapSize: 32,28 + +Bounds: 2,2,28,24 + +Visibility: MissionSelector + +Type: Campaign + +Videos: + Briefing: a_br01_e.vqa + +Options: + Crates: False + Creeps: True + Fog: True + Shroud: True + AllyBuildRadius: False + FragileAlliances: False + StartingCash: 2300 + ConfigurableStartingUnits: False + ShortGame: False + TechLevel: Low + Difficulties: Easy, Normal, Hard + +Players: + PlayerReference@Neutral: + Name: Neutral + OwnsWorld: True + NonCombatant: True + Race: Random + PlayerReference@Creeps: + Name: Creeps + NonCombatant: True + Race: Random + PlayerReference@Atreides: + Name: Atreides + Playable: true + Race: atreides + LockRace: true + ColorRamp: 170,255,200 + LockColor: true + Enemies: Harkonnen + PlayerReference@Harkonnen: + Name: Harkonnen + Race: harkonnen + LockRace: true + ColorRamp: 0,255,127 + LockColor: true + Enemies: Atreides + +Actors: + Actor0: rifle + Location: 2,2 + Owner: Harkonnen + Actor1: rifle + Location: 21,2 + Owner: Harkonnen + Actor2: wormspawner + Location: 4,3 + Owner: Creeps + Actor3: rifle + Location: 2,6 + Owner: Harkonnen + Actor4: rifle + Location: 11,7 + Owner: Atreides + Actor5: rifle + Location: 14,8 + Owner: Atreides + Actor6: trike + Location: 29,8 + Owner: Harkonnen + Actor7: trike + Location: 8,9 + Owner: Atreides + Actor9: rifle + Location: 14,10 + Owner: Atreides + Actor10: trike + Location: 14,12 + Owner: Atreides + Actor11: rifle + Location: 7,13 + Owner: Atreides + Actor12: rifle + Location: 12,15 + Owner: Atreides + Actor13: rifle + Location: 28,20 + Owner: Harkonnen + AtreidesConyard: conyard + Location: 10,10 + Owner: Atreides + HarkonnenWaypoint1: waypoint + Location: 20,2 + Owner: Neutral + HarkonnenWaypoint2: waypoint + Location: 29,10 + Owner: Neutral + HarkonnenWaypoint3: waypoint + Location: 24,25 + Owner: Neutral + HarkonnenWaypoint4: waypoint + Location: 2,20 + Owner: Neutral + AtreidesWaypoint: waypoint + Location: 14,2 + Owner: Neutral + AtreidesRally: waypoint + Location: 12,12 + Owner: Neutral + WormWaypoint: waypoint + Location: 22,20 + Owner: Neutral + +Smudges: + +Rules: + Player: + -ConquestVictoryConditions: + MissionObjectives: + EarlyGameOver: true + World: + -CrateSpawner: + -SpawnMPUnits: + -MPStartLocations: + LuaScript: + Scripts: atreides01b.lua + ObjectivesPanel: + PanelName: MISSION_OBJECTIVES + WormManager: + Minimum: 1 + Maximum: 1 + conyard: + Production: + Produces: Building + concreteb: + Buildable: + Prerequisites: ~disabled + barracks: + Buildable: + Prerequisites: ~disabled + light: + Buildable: + Prerequisites: ~disabled + heavy: + Buildable: + Prerequisites: ~disabled + guntower: + Buildable: + Prerequisites: ~disabled + wall: + Buildable: + Prerequisites: ~disabled + +Sequences: + +VoxelSequences: + +Weapons: + +Voices: + +Notifications: + +Translations: diff --git a/mods/d2k/missions.yaml b/mods/d2k/missions.yaml index 40634d409c..5c79dfcfd9 100644 --- a/mods/d2k/missions.yaml +++ b/mods/d2k/missions.yaml @@ -1,3 +1,3 @@ Atreides Campaign: ./mods/d2k/maps/atreides-01a - + ./mods/d2k/maps/atreides-01b