@@ -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}"
|
||||
|
||||
@@ -23,7 +23,16 @@ HarkonnenReinforcements["Hard"] =
|
||||
|
||||
HarkonnenEntryWaypoints = { HarkonnenWaypoint1.Location, HarkonnenWaypoint2.Location, HarkonnenWaypoint3.Location, HarkonnenWaypoint4.Location }
|
||||
HarkonnenAttackDelay = DateTime.Seconds(30)
|
||||
HarkonnenAttackWaves = 1
|
||||
|
||||
HarkonnenAttackWaves = { }
|
||||
HarkonnenAttackWaves["Easy"] = 1
|
||||
HarkonnenAttackWaves["Normal"] = 5
|
||||
HarkonnenAttackWaves["Hard"] = 12
|
||||
|
||||
ToHarvest = { }
|
||||
ToHarvest["Easy"] = 2500
|
||||
ToHarvest["Normal"] = 3000
|
||||
ToHarvest["Hard"] = 3500
|
||||
|
||||
AtreidesReinforcements = { "rifle", "rifle", "rifle" }
|
||||
AtreidesEntryPath = { AtreidesWaypoint.Location, AtreidesRally.Location }
|
||||
@@ -36,7 +45,6 @@ Messages =
|
||||
"Build a Silo to store additional Spice."
|
||||
}
|
||||
|
||||
ToHarvest = 2500
|
||||
|
||||
IdleHunt = function(actor)
|
||||
if not actor.IsDead then
|
||||
@@ -49,7 +57,7 @@ Tick = function()
|
||||
player.MarkCompletedObjective(KillHarkonnen)
|
||||
end
|
||||
|
||||
if player.Resources > ToHarvest - 1 then
|
||||
if player.Resources > ToHarvest[Map.Difficulty] - 1 then
|
||||
player.MarkCompletedObjective(GatherSpice)
|
||||
end
|
||||
|
||||
@@ -70,21 +78,13 @@ Tick = function()
|
||||
Media.DisplayMessage(Messages[4], "Mentat")
|
||||
end
|
||||
|
||||
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. ToHarvest, player.Color)
|
||||
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. ToHarvest[Map.Difficulty], 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()
|
||||
@@ -108,20 +108,21 @@ WorldLoaded = function()
|
||||
Reinforcements.Reinforce(player, AtreidesReinforcements, AtreidesEntryPath)
|
||||
end)
|
||||
|
||||
WavesLeft = HarkonnenAttackWaves[Map.Difficulty]
|
||||
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)
|
||||
HarkonnenAttackDelay = HarkonnenAttackDelay - (#units * 3 - 3 - WavesLeft) * 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
|
||||
WavesLeft = WavesLeft - 1
|
||||
if WavesLeft == 0 then
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() HarkonnenArrived = true end)
|
||||
else
|
||||
SendReinforcements()
|
||||
@@ -135,7 +136,7 @@ InitObjectives = function()
|
||||
end)
|
||||
|
||||
KillAtreides = harkonnen.AddPrimaryObjective("Kill all Atreides units.")
|
||||
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(ToHarvest) .. " Solaris worth of Spice.")
|
||||
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(ToHarvest[Map.Difficulty]) .. " Solaris worth of Spice.")
|
||||
KillHarkonnen = player.AddSecondaryObjective("Eliminate all Harkonnen units and reinforcements\nin the area.")
|
||||
|
||||
Trigger.OnObjectiveCompleted(player, function(p, id)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 174 KiB |
159
mods/d2k/maps/atreides-01b/atreides01b.lua
Normal file
159
mods/d2k/maps/atreides-01b/atreides01b.lua
Normal file
@@ -0,0 +1,159 @@
|
||||
|
||||
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 = { }
|
||||
HarkonnenAttackWaves["Easy"] = 1
|
||||
HarkonnenAttackWaves["Normal"] = 5
|
||||
HarkonnenAttackWaves["Hard"] = 12
|
||||
|
||||
ToHarvest = { }
|
||||
ToHarvest["Easy"] = 2500
|
||||
ToHarvest["Normal"] = 3000
|
||||
ToHarvest["Hard"] = 3500
|
||||
|
||||
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."
|
||||
}
|
||||
|
||||
|
||||
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[Map.Difficulty] - 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[Map.Difficulty], player.Color)
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("Atreides")
|
||||
harkonnen = Player.GetPlayer("Harkonnen")
|
||||
|
||||
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)
|
||||
|
||||
WavesLeft = HarkonnenAttackWaves[Map.Difficulty]
|
||||
SendReinforcements()
|
||||
end
|
||||
|
||||
SendReinforcements = function()
|
||||
local units = HarkonnenReinforcements[Map.Difficulty]
|
||||
local delay = Utils.RandomInteger(HarkonnenAttackDelay - DateTime.Seconds(2), HarkonnenAttackDelay)
|
||||
HarkonnenAttackDelay = HarkonnenAttackDelay - (#units * 3 - 3 - WavesLeft) * 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)
|
||||
|
||||
WavesLeft = WavesLeft - 1
|
||||
if WavesLeft == 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[Map.Difficulty]) .. " 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
|
||||
BIN
mods/d2k/maps/atreides-01b/map.bin
Normal file
BIN
mods/d2k/maps/atreides-01b/map.bin
Normal file
Binary file not shown.
BIN
mods/d2k/maps/atreides-01b/map.png
Normal file
BIN
mods/d2k/maps/atreides-01b/map.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 174 KiB |
178
mods/d2k/maps/atreides-01b/map.yaml
Normal file
178
mods/d2k/maps/atreides-01b/map.yaml
Normal file
@@ -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:
|
||||
@@ -1,3 +1,3 @@
|
||||
Atreides Campaign:
|
||||
./mods/d2k/maps/atreides-01a
|
||||
|
||||
./mods/d2k/maps/atreides-01b
|
||||
|
||||
Reference in New Issue
Block a user