Adjust difficulty, add speeches to allies-06a
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
information, see COPYING.
|
||||
]]
|
||||
|
||||
SovietsActivated = false
|
||||
|
||||
WTransWays =
|
||||
{
|
||||
{ WaterUnloadEntry1.Location, WaterUnload1.Location },
|
||||
@@ -20,23 +22,23 @@ WTransUnits =
|
||||
}
|
||||
WTransDelays =
|
||||
{
|
||||
easy = 4,
|
||||
normal = 3,
|
||||
hard = 1
|
||||
easy = DateTime.Seconds(240),
|
||||
normal = DateTime.Seconds(180),
|
||||
hard = DateTime.Seconds(140)
|
||||
}
|
||||
|
||||
BuildDelays =
|
||||
{
|
||||
easy = 90,
|
||||
normal = 60,
|
||||
hard = 30
|
||||
easy = DateTime.Seconds(90),
|
||||
normal = DateTime.Seconds(60),
|
||||
hard = DateTime.Seconds(30)
|
||||
}
|
||||
|
||||
WaterAttacks =
|
||||
FirstAirDelays =
|
||||
{
|
||||
easy = 1,
|
||||
normal = 2,
|
||||
hard = 3
|
||||
easy = DateTime.Seconds(180),
|
||||
normal = DateTime.Seconds(120),
|
||||
hard = DateTime.Seconds(90)
|
||||
}
|
||||
|
||||
WaterAttackTypes =
|
||||
@@ -52,6 +54,7 @@ InfTypes =
|
||||
{
|
||||
{ "e1", "e1", "e1"},
|
||||
{ "e2", "e1", "e1"},
|
||||
{ "e2", "e2", "e1"},
|
||||
{ "e4", "e4", "e1"}
|
||||
}
|
||||
|
||||
@@ -62,14 +65,12 @@ AttackRallyPoints =
|
||||
{ SovietOreAttack2.Location }
|
||||
}
|
||||
|
||||
ImportantBuildings = { WeaponsFactory, Airfield, dome2, SovietConyard }
|
||||
ImportantBuildings = { WeaponsFactory, Airfield, EastRadarDome, SovietConyard }
|
||||
SovietAircraftType = { "yak" }
|
||||
Yaks = { }
|
||||
IdlingUnits = { }
|
||||
IdlingTanks = { tank1, tank2, tank3, tank4, tank5, tank6, tank7, tank8 }
|
||||
IdlingNavalUnits = { }
|
||||
|
||||
InitialiseAttack = function()
|
||||
PrepareTankDefenders = function()
|
||||
Utils.Do(ImportantBuildings, function(a)
|
||||
Trigger.OnDamaged(a, function()
|
||||
Utils.Do(IdlingTanks, function(unit)
|
||||
@@ -81,23 +82,23 @@ InitialiseAttack = function()
|
||||
end)
|
||||
end
|
||||
|
||||
Attack = 0
|
||||
InfantryWave = 0
|
||||
ProduceInfantry = function()
|
||||
if SovietBarracks.IsDead or SovietBarracks.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
Attack = Attack + 1
|
||||
InfantryWave = InfantryWave + 1
|
||||
local toBuild = Utils.Random(InfTypes)
|
||||
USSR.Build(toBuild, function(units)
|
||||
if Attack == 2 and not AttackTnk1.IsDead then
|
||||
if InfantryWave == 2 and not AttackTnk1.IsDead then
|
||||
units[#units + 1] = AttackTnk1
|
||||
elseif Attack == 4 and not AttackTnk2.IsDead then
|
||||
elseif InfantryWave == 4 and not AttackTnk2.IsDead then
|
||||
units[#units + 1] = AttackTnk2
|
||||
end
|
||||
|
||||
SendAttack(units, Utils.Random(AttackRallyPoints))
|
||||
Trigger.AfterDelay(DateTime.Seconds(BuildDelays), ProduceInfantry)
|
||||
Trigger.AfterDelay(BuildDelays[Difficulty], ProduceInfantry)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -115,24 +116,22 @@ ProduceVehicles = function()
|
||||
end
|
||||
|
||||
ProduceNaval = function()
|
||||
if not ShouldProduce and #Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Greece and self.Type == "syrd" end) < 1 then
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), ProduceNaval)
|
||||
if not Greece.HasPrerequisites({ "syrd" }) then
|
||||
Trigger.AfterDelay(DateTime.Seconds(60), ProduceNaval)
|
||||
return
|
||||
end
|
||||
|
||||
ShouldProduce = true
|
||||
|
||||
if SubPen.IsDead or SubPen.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
USSR.Build(WaterAttackTypes, function(units)
|
||||
USSR.Build(WaterAttackTypes[Difficulty], function(units)
|
||||
Utils.Do(units, function(unit)
|
||||
IdlingNavalUnits[#IdlingNavalUnits + 1] = unit
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(1) + DateTime.Seconds(40), ProduceNaval)
|
||||
if #IdlingNavalUnits >= WaterAttacks then
|
||||
if #IdlingNavalUnits >= #WaterAttackTypes[Difficulty] then
|
||||
Trigger.AfterDelay(DateTime.Seconds(20), function()
|
||||
SendAttack(SetupNavalAttackGroup(), { Harbor.Location })
|
||||
end)
|
||||
@@ -146,15 +145,12 @@ ProduceAircraft = function()
|
||||
end
|
||||
|
||||
USSR.Build(SovietAircraftType, function(units)
|
||||
local yak = units[1]
|
||||
Yaks[#Yaks + 1] = yak
|
||||
|
||||
Trigger.OnKilled(yak, ProduceAircraft)
|
||||
if #Yaks == 1 then
|
||||
Trigger.AfterDelay(DateTime.Seconds(BuildDelays), ProduceAircraft)
|
||||
end
|
||||
|
||||
InitializeAttackAircraft(yak, Greece)
|
||||
Utils.Do(units, function(yak)
|
||||
InitializeAttackAircraft(yak, Greece)
|
||||
Trigger.OnKilled(yak, function()
|
||||
Trigger.AfterDelay(BuildDelays[Difficulty], ProduceAircraft)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -167,7 +163,7 @@ end
|
||||
|
||||
SetupNavalAttackGroup = function()
|
||||
local units = { }
|
||||
for i = 0, 3 do
|
||||
for i = 1, 3 do
|
||||
if #IdlingNavalUnits == 0 then
|
||||
return units
|
||||
end
|
||||
@@ -184,7 +180,7 @@ end
|
||||
|
||||
WTransWaves = function()
|
||||
local way = Utils.Random(WTransWays)
|
||||
local units = Utils.Random(WTransUnits)
|
||||
local units = Utils.Random(WTransUnits[Difficulty])
|
||||
local attackUnits = Reinforcements.ReinforceWithTransport(USSR, "lst", units , way, { way[2], way[1] })[2]
|
||||
Utils.Do(attackUnits, function(a)
|
||||
Trigger.OnAddedToWorld(a, function()
|
||||
@@ -193,25 +189,31 @@ WTransWaves = function()
|
||||
end)
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(WTransDelays), WTransWaves)
|
||||
Trigger.AfterDelay(WTransDelays[Difficulty], WTransWaves)
|
||||
end
|
||||
|
||||
ActivateAI = function()
|
||||
WaterAttackTypes = WaterAttackTypes[Difficulty]
|
||||
WaterAttacks = WaterAttacks[Difficulty]
|
||||
WTransUnits = WTransUnits[Difficulty]
|
||||
WTransDelays = WTransDelays[Difficulty]
|
||||
BuildDelays = BuildDelays[Difficulty]
|
||||
|
||||
InitialiseAttack()
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), ProduceInfantry)
|
||||
Trigger.AfterDelay(DateTime.Minutes(1) + DateTime.Seconds(10), function()
|
||||
ProduceAircraft()
|
||||
ProduceVehicles()
|
||||
end)
|
||||
if SovietsActivated then
|
||||
return
|
||||
end
|
||||
SovietsActivated = true
|
||||
|
||||
WeaponsFactory.RallyPoint = WeaponMeetPoint.Location
|
||||
SubPen.RallyPoint = SubMeetPoint.Location
|
||||
Trigger.AfterDelay(DateTime.Minutes(5) + DateTime.Seconds(10), ProduceNaval)
|
||||
Trigger.AfterDelay(DateTime.Minutes(WTransDelays), WTransWaves)
|
||||
PrepareTankDefenders()
|
||||
ProduceInfantry()
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), ProduceVehicles)
|
||||
|
||||
Trigger.AfterDelay(FirstAirDelays[Difficulty], ProduceAircraft)
|
||||
Trigger.OnProduction(Airfield, function()
|
||||
if not YakCamera.IsInWorld then
|
||||
return
|
||||
end
|
||||
|
||||
-- This begins neutral to lessen its effect on ground attacks.
|
||||
YakCamera.Owner = USSR
|
||||
end)
|
||||
|
||||
Trigger.OnAnyKilled(USSR.GetActorsByType("ss"), ProduceNaval)
|
||||
Trigger.AfterDelay(WTransDelays[Difficulty], WTransWaves)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user