Add difficulty settings to soviet06 missions

This commit is contained in:
Biofreak1987
2015-10-24 16:25:17 +02:00
parent 9ae4114d26
commit 37cc524f43
7 changed files with 179 additions and 8 deletions

View File

@@ -74,8 +74,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Red Alert Lua scripts", "Re
mods\ra\maps\soviet-05\soviet05-reinforcements_teams.lua = mods\ra\maps\soviet-05\soviet05-reinforcements_teams.lua
mods\ra\maps\soviet-05\soviet05.lua = mods\ra\maps\soviet-05\soviet05.lua
mods\ra\maps\soviet-06a\soviet06a-AI.lua = mods\ra\maps\soviet-06a\soviet06a-AI.lua
mods\ra\maps\soviet-06a\soviet06a-reinforcements_teams.lua = mods\ra\maps\soviet-06a\soviet06a-reinforcements_teams.lua
mods\ra\maps\soviet-06a\soviet06a.lua = mods\ra\maps\soviet-06a\soviet06a.lua
mods\ra\maps\soviet-06b\soviet06b-AI.lua = mods\ra\maps\soviet-06b\soviet06b-AI.lua
mods\ra\maps\soviet-06b\soviet06b-reinforcements_teams.lua = mods\ra\maps\soviet-06b\soviet06b-reinforcements_teams.lua
mods\ra\maps\soviet-06b\soviet06b.lua = mods\ra\maps\soviet-06b\soviet06b.lua
mods\ra\maps\soviet-07\soviet07.lua = mods\ra\maps\soviet-07\soviet07.lua
mods\ra\maps\survival01\survival01.lua = mods\ra\maps\survival01\survival01.lua

View File

@@ -32,6 +32,7 @@ Options:
FragileAlliances: False
StartingCash: 11500
ConfigurableStartingUnits: False
Difficulties: Easy, Normal, Hard
ShortGame: False
Players:
@@ -544,9 +545,6 @@ Actors:
Location: 28,23
Owner: Greece
Facing: 128
Actor161: dome
Location: 23,5
Owner: Greece
Actor163: gap
Location: 24,21
Owner: Greece
@@ -736,6 +734,10 @@ Actors:
waypoint82: waypoint
Location: 87,29
Owner: Neutral
AGun: agun
Owner: Greece
Location: 25,4
TurretFacing: 92
APCWaypoint1: waypoint
Location: 52,50
Owner: Neutral
@@ -789,6 +791,21 @@ Actors:
CYardLocation: waypoint
Owner: Neutral
Location: 31,4
Dome: dome
Location: 23,5
Owner: Greece
EnemyEntry1: waypoint
Owner: Neutral
Location: 10,1
EnemyEntry2: waypoint
Owner: Neutral
Location: 97,37
EnemyRally1: waypoint
Owner: Neutral
Location: 9,23
EnemyRally2: waypoint
Owner: Neutral
Location: 88,37
Harvester: harv
Location: 12,10
Owner: Greece
@@ -843,7 +860,7 @@ Rules:
-SpawnMPUnits:
-MPStartLocations:
LuaScript:
Scripts: soviet06a.lua, soviet06a-AI.lua
Scripts: soviet06a.lua, soviet06a-AI.lua, soviet06a-reinforcements_teams.lua
ObjectivesPanel:
PanelName: MISSION_OBJECTIVES
^Building:

View File

@@ -0,0 +1,59 @@
EnemyReinforcements =
{
Easy =
{
{ "e1", "e1", "e3" },
{ "e1", "e3", "jeep" },
{ "e1", "jeep", "1tnk" }
},
Normal =
{
{ "e1", "e1", "e3", "e3" },
{ "e1", "e3", "jeep", "jeep" },
{ "e1", "jeep", "1tnk", "2tnk" }
},
Hard =
{
{ "e1", "e1", "e3", "e3", "e1" },
{ "e1", "e3", "jeep", "jeep", "1tnk" },
{ "e1", "jeep", "1tnk", "2tnk", "arty" }
}
}
EnemyAttackDelay =
{
Easy = DateTime.Minutes(5),
Normal = DateTime.Minutes(2) + DateTime.Seconds(40),
Hard = DateTime.Minutes(1) + DateTime.Seconds(30)
}
EnemyPaths =
{
{ EnemyEntry1.Location, EnemyRally1.Location },
{ EnemyEntry2.Location, EnemyRally2.Location }
}
wave = 0
SendEnemies = function()
Trigger.AfterDelay(EnemyAttackDelay[Map.Difficulty], function()
wave = wave + 1
if wave > 3 then
wave = 1
end
if wave == 1 then
local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Map.Difficulty][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2]
Utils.Do(units, IdleHunt)
else
local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Map.Difficulty][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2]
Utils.Do(units, IdleHunt)
end
if not Dome.IsDead then
SendEnemies()
end
end)
end

View File

@@ -76,11 +76,17 @@ Trigger.OnKilled(Apwr2, function(building)
BaseApwr2.exists = false
end)
Trigger.OnKilled(Dome, function()
player.MarkCompletedObjective(sovietObjective2)
Media.PlaySpeechNotification(player, "ObjectiveMet")
end)
-- Activate the AI once the player deployed the Mcv
Trigger.OnRemovedFromWorld(Mcv, function()
if not mcvDeployed then
mcvDeployed = true
BuildBase()
SendEnemies()
Trigger.AfterDelay(DateTime.Minutes(1), ProduceInfantry)
Trigger.AfterDelay(DateTime.Minutes(2), ProduceArmor)
Trigger.AfterDelay(DateTime.Minutes(2), function()
@@ -128,6 +134,7 @@ WorldLoaded = function()
end)
alliedObjective = enemy.AddPrimaryObjective("Destroy all Soviet troops.")
sovietObjective = player.AddPrimaryObjective("Escort the Convoy.")
sovietObjective2 = player.AddSecondaryObjective("Destroy the Allied radar dome to stop enemy\nreinforcements.")
end
Tick = function()

View File

@@ -32,6 +32,7 @@ Options:
FragileAlliances: False
StartingCash: 11500
ConfigurableStartingUnits: False
Difficulties: Easy, Normal, Hard
ShortGame: False
Players:
@@ -325,9 +326,6 @@ Actors:
Location: 61,48
Owner: Greece
Facing: 160
Actor95: dome
Location: 67,49
Owner: Greece
Actor103: 2tnk
Location: 76,30
Owner: Greece
@@ -429,6 +427,9 @@ Actors:
Actor147: silo
Owner: Greece
Location: 73,49
Actor148: sbag
Owner: Greece
Location: 65,51
waypoint69: waypoint
Location: 21,28
Owner: Neutral
@@ -450,6 +451,10 @@ Actors:
waypoint94: waypoint
Location: 49,16
Owner: Neutral
AGun: agun
Owner: Greece
Location: 69,48
TurretFacing: 92
APCWaypoint1: waypoint
Location: 39,62
Owner: Neutral
@@ -480,6 +485,21 @@ Actors:
CYardLocation: waypoint
Owner: Neutral
Location: 71,49
Dome: dome
Location: 67,49
Owner: Greece
EnemyEntry1: waypoint
Owner: Neutral
Location: 53,10
EnemyEntry2: waypoint
Owner: Neutral
Location: 18,62
EnemyRally1: waypoint
Owner: Neutral
Location: 53,31
EnemyRally2: waypoint
Owner: Neutral
Location: 25,62
Harvester: harv
Location: 77,39
Owner: Greece
@@ -532,7 +552,7 @@ Rules:
-SpawnMPUnits:
-MPStartLocations:
LuaScript:
Scripts: soviet06b.lua, soviet06b-AI.lua
Scripts: soviet06b.lua, soviet06b-AI.lua, soviet06b-reinforcements_teams.lua
ObjectivesPanel:
PanelName: MISSION_OBJECTIVES
^Building:

View File

@@ -0,0 +1,59 @@
EnemyReinforcements =
{
Easy =
{
{ "e1", "e1", "e3" },
{ "e1", "e3", "jeep" },
{ "e1", "jeep", "1tnk" }
},
Normal =
{
{ "e1", "e1", "e3", "e3" },
{ "e1", "e3", "jeep", "jeep" },
{ "e1", "jeep", "1tnk", "2tnk" }
},
Hard =
{
{ "e1", "e1", "e3", "e3", "e1" },
{ "e1", "e3", "jeep", "jeep", "1tnk" },
{ "e1", "jeep", "1tnk", "2tnk", "arty" }
}
}
EnemyAttackDelay =
{
Easy = DateTime.Minutes(5),
Normal = DateTime.Minutes(2) + DateTime.Seconds(40),
Hard = DateTime.Minutes(1) + DateTime.Seconds(30)
}
EnemyPaths =
{
{ EnemyEntry1.Location, EnemyRally1.Location },
{ EnemyEntry2.Location, EnemyRally2.Location }
}
wave = 0
SendEnemies = function()
Trigger.AfterDelay(EnemyAttackDelay[Map.Difficulty], function()
wave = wave + 1
if wave > 3 then
wave = 1
end
if wave == 1 then
local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Map.Difficulty][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2]
Utils.Do(units, IdleHunt)
else
local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Map.Difficulty][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2]
Utils.Do(units, IdleHunt)
end
if not Dome.IsDead then
SendEnemies()
end
end)
end

View File

@@ -47,10 +47,16 @@ Trigger.OnKilled(Apwr2, function(building)
BaseApwr2.exists = false
end)
Trigger.OnKilled(Dome, function()
player.MarkCompletedObjective(sovietObjective2)
Media.PlaySpeechNotification(player, "ObjectiveMet")
end)
Trigger.OnRemovedFromWorld(Mcv, function()
if not mcvDeployed then
mcvDeployed = true
BuildBase()
SendEnemies()
Trigger.AfterDelay(DateTime.Minutes(1), ProduceInfantry)
Trigger.AfterDelay(DateTime.Minutes(2), ProduceArmor)
end
@@ -93,6 +99,7 @@ WorldLoaded = function()
end)
alliedObjective = enemy.AddPrimaryObjective("Destroy all Soviet troops.")
sovietObjective = player.AddPrimaryObjective("Escort the Convoy.")
sovietObjective2 = player.AddSecondaryObjective("Destroy the Allied radar dome to stop enemy\nreinforcements.")
end
Tick = function()