Added two new difficulties to allies-05a

This commit is contained in:
abcdefg30
2015-05-30 18:38:48 +02:00
parent 39a297d575
commit ae955a2340
3 changed files with 190 additions and 47 deletions

View File

@@ -5,6 +5,7 @@ AttackGroupSize = 6
Barracks = { Barracks2, Barracks3 } Barracks = { Barracks2, Barracks3 }
Rallypoints = { VehicleRallypoint1, VehicleRallypoint2, VehicleRallypoint3, VehicleRallypoint4, VehicleRallypoint5 } Rallypoints = { VehicleRallypoint1, VehicleRallypoint2, VehicleRallypoint3, VehicleRallypoint4, VehicleRallypoint5 }
WaterLZs = { WaterLZ1, WaterLZ2 }
Airfields = { Airfield1, Airfield2 } Airfields = { Airfield1, Airfield2 }
Yaks = { } Yaks = { }
@@ -23,6 +24,10 @@ SetupAttackGroup = function()
local units = { } local units = { }
for i = 0, AttackGroupSize, 1 do for i = 0, AttackGroupSize, 1 do
if #IdlingUnits == 0 then
return units
end
local number = Utils.RandomInteger(1, #IdlingUnits) local number = Utils.RandomInteger(1, #IdlingUnits)
if IdlingUnits[number] and not IdlingUnits[number].IsDead then if IdlingUnits[number] and not IdlingUnits[number].IsDead then
@@ -35,19 +40,45 @@ SetupAttackGroup = function()
end end
SendAttack = function() SendAttack = function()
if not Attacking then if Attacking then
return return
end end
Attacking = false Attacking = true
HoldProduction = false HoldProduction = true
local units = SetupAttackGroup() local units = { }
Utils.Do(units, function(unit) if SendWaterTransports and Utils.RandomInteger(0,2) == 1 then
IdleHunt(unit) units = WaterAttack()
end)
Trigger.AfterDelay(DateTime.Minutes(1), function() Attacking = true end) Utils.Do(units, function(unit)
Trigger.AfterDelay(DateTime.Minutes(2), function() HoldProduction = true end) Trigger.OnAddedToWorld(unit, function()
Trigger.OnIdle(unit, unit.Hunt)
end)
end)
Trigger.AfterDelay(DateTime.Seconds(20), function()
Attacking = false
HoldProduction = false
end)
else
units = SetupAttackGroup()
Utils.Do(units, function(unit)
IdleHunt(unit)
end)
Trigger.AfterDelay(DateTime.Minutes(1), function() Attacking = false end)
Trigger.AfterDelay(DateTime.Minutes(2), function() HoldProduction = false end)
end
end
WaterAttack = function()
local types = { }
for i = 1, 5, 1 do
types[i] = Utils.Random(SovietInfantryTypes)
end
return Reinforcements.ReinforceWithTransport(ussr, InsertionTransport, types, { WaterTransportSpawn.Location, Utils.Random(WaterLZs).Location }, { WaterTransportSpawn.Location })[2]
end end
ProtectHarvester = function(unit) ProtectHarvester = function(unit)
@@ -113,17 +144,21 @@ InitProductionBuildings = function()
TrainInfantry = false TrainInfantry = false
end end
end) end)
end elseif not Barracks3.IsDead then
Barracks3.IsPrimaryBuilding = true
if not Barracks3.IsDead then else
Trigger.OnKilled(Barracks3, function() if Barracks2.IsDead then TrainInfantry = false end end)
end
if Barracks2.IsDead and Barracks3.IsDead then
TrainInfantry = false TrainInfantry = false
end end
if Map.Difficulty == "Normal" then if not Barracks3.IsDead then
Trigger.OnKilled(Barracks3, function()
if Barracks2.IsDead then
TrainInfantry = false
end
end)
end
if Map.Difficulty ~= "Easy" then
if not Airfield1.IsDead then if not Airfield1.IsDead then
Trigger.OnKilled(Airfield1, function() Trigger.OnKilled(Airfield1, function()

View File

@@ -2,19 +2,30 @@ if Map.Difficulty == "Easy" then
TanyaType = "e7" TanyaType = "e7"
ReinforceCash = 5000 ReinforceCash = 5000
HoldAITime = DateTime.Minutes(3) HoldAITime = DateTime.Minutes(3)
SpecialCameras = true
elseif Map.Difficulty == "Normal" then
TanyaType = "e7.noautotarget"
ChangeStance = true
ReinforceCash = 2250
HoldAITime = DateTime.Minutes(2)
SpecialCameras = true
else else
TanyaType = "e7.noautotarget" TanyaType = "e7.noautotarget"
ChangeStance = true ChangeStance = true
ReinforceCash = 2500 ReinforceCash = 1500
HoldAITime = DateTime.Minutes(2) HoldAITime = DateTime.Minutes(1) + DateTime.Seconds(30)
SendWaterTransports = true
end end
SpyType = { "spy" } SpyType = { "spy" }
SpyEntryPath = { SpyEntry.Location, SpyLoadout.Location } SpyEntryPath = { SpyEntry.Location, SpyLoadout.Location }
InsertionTransport = "lst" InsertionTransport = "lst.in"
ExtractionTransport = "lst"
TrukPath = { TrukWaypoint1, TrukWaypoint2, TrukWaypoint3, TrukWaypoint4, TrukWaypoint5, TrukWaypoint6 } TrukPath = { TrukWaypoint1, TrukWaypoint2, TrukWaypoint3, TrukWaypoint4, TrukWaypoint5, TrukWaypoint6 }
ExtractionHeliType = "tran" ExtractionHeliType = "tran"
InsertionHeliType = "tran.in"
ExtractionPath = { ExtractionEntry.Location, ExtractionLZ.Location } ExtractionPath = { ExtractionEntry.Location, ExtractionLZ.Location }
HeliReinforcements = { "medi", "mech", "mech" }
GreeceReinforcements = GreeceReinforcements =
{ {
@@ -32,6 +43,7 @@ PatrolAPath = { PatrolRally.Location, PatrolARally1.Location, PatrolARally2.Loca
PatrolBPath = { PatrolBRally1.Location, PatrolBRally2.Location, PatrolBRally3.Location, PatrolRally.Location } PatrolBPath = { PatrolBRally1.Location, PatrolBRally2.Location, PatrolBRally3.Location, PatrolRally.Location }
TanyaVoices = { "tuffguy", "bombit", "laugh", "gotit", "lefty", "keepem" } TanyaVoices = { "tuffguy", "bombit", "laugh", "gotit", "lefty", "keepem" }
SpyVoice = "sking"
SamSites = { Sam1, Sam2, Sam3, Sam4 } SamSites = { Sam1, Sam2, Sam3, Sam4 }
GroupPatrol = function(units, waypoints, delay) GroupPatrol = function(units, waypoints, delay)
@@ -71,12 +83,20 @@ Tick = function()
end end
if ussr.HasNoRequiredUnits() then if ussr.HasNoRequiredUnits() then
if not greece.IsObjectiveCompleted(KillAll) and Map.Difficulty == "Real tough guy" then
SendWaterExtraction()
end
greece.MarkCompletedObjective(KillAll) greece.MarkCompletedObjective(KillAll)
end end
if GreeceReinforcementsArrived and greece.HasNoRequiredUnits() then if GreeceReinforcementsArrived and greece.HasNoRequiredUnits() then
ussr.MarkCompletedObjective(ussrObj) ussr.MarkCompletedObjective(ussrObj)
end end
if ussr.Resources >= ussr.ResourceCapacity * 0.75 then
ussr.Cash = ussr.Cash + ussr.Resources - ussr.ResourceCapacity * 0.25
ussr.Resources = ussr.ResourceCapacity * 0.25
end
end end
SendReinforcements = function() SendReinforcements = function()
@@ -93,18 +113,32 @@ SendReinforcements = function()
ActivateAI() ActivateAI()
end end
ExtractTanya = function() ExtractUnits = function(extractionUnit, pos, after)
if ExtractionHeli.IsDead or not ExtractionHeli.HasPassengers then if extractionUnit.IsDead or not extractionUnit.HasPassengers then
return return
end end
ExtractionHeli.Move(CPos.New(ExtractionPath[1].X, ExtractionHeli.Location.Y)) extractionUnit.Move(pos)
ExtractionHeli.Destroy() extractionUnit.Destroy()
Trigger.OnRemovedFromWorld(ExtractionHeli, function() Trigger.OnRemovedFromWorld(extractionUnit, after)
greece.MarkCompletedObjective(mainObj) end
SendReinforcements()
PrisonCamera.Destroy() SendWaterExtraction = function()
local flare = Actor.Create("flare", true, { Owner = greece, Location = SpyEntryPath[2] + CVec.New(2, 0) })
Trigger.AfterDelay(DateTime.Seconds(5), flare.Destroy)
Media.PlaySpeechNotification(greece, "SignalFlareNorth")
Camera.Position = flare.CenterPosition
WaterExtractionTran = Reinforcements.ReinforceWithTransport(greece, ExtractionTransport, nil, SpyEntryPath)[1]
ExtractObj = greece.AddPrimaryObjective("Get all your forces into the transport.")
Trigger.OnKilled(WaterExtractionTran, function() ussr.MarkCompletedObjective(ussrObj) end)
Trigger.OnAllRemovedFromWorld(greece.GetGroundAttackers(), function()
ExtractUnits(WaterExtractionTran, SpyEntryPath[1], function()
greece.MarkCompletedObjective(ExtractObj)
greece.MarkCompletedObjective(surviveObj)
end)
end) end)
end end
@@ -117,10 +151,12 @@ WarfactoryInfiltrated = function()
Truk.Move(waypoint.Location) Truk.Move(waypoint.Location)
end) end)
Trigger.AfterDelay(DateTime.Seconds(2), function() if SpecialCameras then
SpyCameraA.Destroy() Trigger.AfterDelay(DateTime.Seconds(2), function()
SpyCameraB.Destroy() SpyCameraA.Destroy()
end) SpyCameraB.Destroy()
end)
end
end end
MissInfiltrated = function() MissInfiltrated = function()
@@ -152,7 +188,21 @@ FreeTanya = function()
Trigger.OnKilled(Tanya, function() ussr.MarkCompletedObjective(ussrObj) end) Trigger.OnKilled(Tanya, function() ussr.MarkCompletedObjective(ussrObj) end)
KillSams = greece.AddPrimaryObjective("Destroy all four SAM sites that block\nthe extraction helicopter.") if Map.Difficulty == "Real tough guy" then
KillSams = greece.AddPrimaryObjective("Destroy all four SAM Sites that block\nour reinforcements' helicopter.")
greece.MarkCompletedObjective(mainObj)
surviveObj = greece.AddPrimaryObjective("Tanya must not die!")
Media.PlaySpeechNotification(greece, "TanyaRescued")
else
KillSams = greece.AddPrimaryObjective("Destroy all four SAM sites that block\nthe extraction helicopter.")
Media.PlaySpeechNotification(greece, "TargetFreed")
end
if not SpecialCameras then
PrisonCamera.Destroy()
end
end end
SendSpy = function() SendSpy = function()
@@ -161,8 +211,10 @@ SendSpy = function()
Trigger.OnKilled(Spy, function() ussr.MarkCompletedObjective(ussrObj) end) Trigger.OnKilled(Spy, function() ussr.MarkCompletedObjective(ussrObj) end)
SpyCameraA = Actor.Create("camera", true, { Owner = greece, Location = SpyCamera1.Location }) if SpecialCameras then
SpyCameraB = Actor.Create("camera", true, { Owner = greece, Location = SpyCamera2.Location }) SpyCameraA = Actor.Create("camera", true, { Owner = greece, Location = SpyCamera1.Location })
SpyCameraB = Actor.Create("camera", true, { Owner = greece, Location = SpyCamera2.Location })
end
end end
ActivatePatrols = function() ActivatePatrols = function()
@@ -200,10 +252,16 @@ InitTriggers = function()
Spy = Actor.Create("spy", true, { Owner = greece, Location = TrukWaypoint5.Location }) Spy = Actor.Create("spy", true, { Owner = greece, Location = TrukWaypoint5.Location })
Spy.Move(SpyWaypoint.Location) Spy.Move(SpyWaypoint.Location)
Spy.Infiltrate(Prison) Spy.Infiltrate(Prison)
Media.PlaySoundNotification(greece, SpyVoice)
FollowTruk = false FollowTruk = false
TrukCamera.Destroy() TrukCamera.Destroy()
PrisonCamera = Actor.Create("camera", true, { Owner = greece, Location = TrukWaypoint5.Location })
if SpecialCameras then
PrisonCamera = Actor.Create("camera", true, { Owner = greece, Location = TrukWaypoint5.Location })
else
PrisonCamera = Actor.Create("camera.truk", true, { Owner = greece, Location = Prison.Location + CVec.New(1, 1) })
end
Trigger.OnKilled(Spy, function() ussr.MarkCompletedObjective(ussrObj) end) Trigger.OnKilled(Spy, function() ussr.MarkCompletedObjective(ussrObj) end)
end end
@@ -218,10 +276,12 @@ InitTriggers = function()
end end
end) end)
Trigger.OnKilled(Mammoth, function() if Map.Difficulty ~= "Real tough guy" then
Trigger.AfterDelay(HoldAITime - DateTime.Seconds(45), function() HoldProduction = false end) Trigger.OnKilled(Mammoth, function()
Trigger.AfterDelay(HoldAITime, function() Attacking = true end) Trigger.AfterDelay(HoldAITime - DateTime.Seconds(45), function() HoldProduction = false end)
end) Trigger.AfterDelay(HoldAITime, function() Attacking = true end)
end)
end
Trigger.OnKilled(FlameBarrel, function() Trigger.OnKilled(FlameBarrel, function()
if not FlameTower.IsDead then if not FlameTower.IsDead then
@@ -237,10 +297,31 @@ InitTriggers = function()
local flare = Actor.Create("flare", true, { Owner = greece, Location = ExtractionPath[2] + CVec.New(0, -1) }) local flare = Actor.Create("flare", true, { Owner = greece, Location = ExtractionPath[2] + CVec.New(0, -1) })
Trigger.AfterDelay(DateTime.Seconds(7), flare.Destroy) Trigger.AfterDelay(DateTime.Seconds(7), flare.Destroy)
Media.PlaySpeechNotification(greece, "SignalFlare") Media.PlaySpeechNotification(greece, "SignalFlare")
ExtractionHeli = Reinforcements.ReinforceWithTransport(greece, ExtractionHeliType, nil, ExtractionPath)[1]
Trigger.OnKilled(ExtractionHeli, function() ussr.MarkCompletedObjective(ussrObj) end) if Map.Difficulty == "Real tough guy" then
Trigger.OnRemovedFromWorld(Tanya, ExtractTanya) Reinforcements.ReinforceWithTransport(greece, InsertionHeliType, HeliReinforcements, ExtractionPath, { ExtractionPath[1] })
if not Harvester.IsDead then
Harvester.FindResources()
end
else
ExtractionHeli = Reinforcements.ReinforceWithTransport(greece, ExtractionHeliType, nil, ExtractionPath)[1]
local exitPos = CPos.New(ExtractionPath[1].X, ExtractionPath[2].Y)
Trigger.OnKilled(ExtractionHeli, function() ussr.MarkCompletedObjective(ussrObj) end)
Trigger.OnRemovedFromWorld(Tanya, function()
ExtractUnits(ExtractionHeli, exitPos, function()
Media.PlaySpeechNotification(greece, "TanyaRescued")
greece.MarkCompletedObjective(mainObj)
SendReinforcements()
if SpecialCameras then
PrisonCamera.Destroy()
end
end)
end)
end
end) end)
end end

View File

@@ -33,7 +33,7 @@ Options:
StartingCash: 0 StartingCash: 0
TechLevel: Medium TechLevel: Medium
ConfigurableStartingUnits: False ConfigurableStartingUnits: False
Difficulties: Easy, Normal Difficulties: Easy, Normal, Hard, Real tough guy
ShortGame: False ShortGame: False
Players: Players:
@@ -1569,6 +1569,15 @@ Actors:
VehicleRallypoint5: waypoint VehicleRallypoint5: waypoint
Location: 47,84 Location: 47,84
Owner: Neutral Owner: Neutral
WaterTransportSpawn: waypoint
Owner: Neutral
Location: 71,48
WaterLZ1: waypoint
Owner: Neutral
Location: 52,53
WaterLZ2: waypoint
Owner: Neutral
Location: 63,63
Smudges: Smudges:
@@ -1608,8 +1617,6 @@ Rules:
Tooltip: Tooltip:
GenericVisibility: Enemy GenericVisibility: Enemy
ShowOwnerRow: false ShowOwnerRow: false
MustBeDestroyed:
RequiredForShortGame: false
^Wall: ^Wall:
Tooltip: Tooltip:
ShowOwnerRow: false ShowOwnerRow: false
@@ -1644,12 +1651,31 @@ Rules:
Prerequisites: ~disabled Prerequisites: ~disabled
LST: LST:
-Selectable: -Selectable:
TargetableUnit:
TargetTypes: Ground, Water
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
LST.IN:
Inherits: LST
RenderLandingCraft:
Image: LST
Cargo:
Types: disabled
TRAN: TRAN:
-Selectable: -Selectable:
RevealsShroud: RevealsShroud:
Range: 0c0 Range: 4c0
Tooltip: Tooltip:
ShowOwnerRow: false ShowOwnerRow: false
TargetableAircraft:
GroundedTargetTypes: Ground
TRAN.IN:
Inherits: TRAN
RenderSprites:
Image: TRAN
Cargo:
Types: disabled
FLARE: FLARE:
Tooltip: Tooltip:
ShowOwnerRow: false ShowOwnerRow: false
@@ -1834,5 +1860,6 @@ Notifications:
lefty: lefty1 lefty: lefty1
keepem: keepem1 keepem: keepem1
tuffguy: tuffguy1 tuffguy: tuffguy1
sking: sking1
Translations: Translations: