1
- Patrol = { " e1" , " e2" , " e1" }
2
- Infantry = { " e4" , " e1" , " e1" , " e2" , " e1" , " e2" }
3
- Vehicles = { " arty" , " ftrk" , " ftrk" , " apc" , " apc" }
4
- Tank = { " 3tnk" }
5
- LongRange = { " v2rl" }
6
- Boss = { " 4tnk" }
7
1
8
2
SovietEntryPoints = { Entry1 , Entry2 , Entry3 , Entry4 , Entry5 , Entry6 , Entry7 , Entry8 }
9
3
PatrolWaypoints = { Entry2 , Entry4 , Entry6 , Entry8 }
10
4
ParadropWaypoints = { Paradrop1 , Paradrop2 , Paradrop3 , Paradrop4 }
11
- OilDerricks = { OilDerrick1 , OilDerrick2 , OilDerrick3 , OilDerrick4 }
12
5
SpawnPoints = { Spawn1 , Spawn2 , Spawn3 , Spawn4 }
13
6
Snipers = { Sniper1 , Sniper2 , Sniper3 , Sniper4 , Sniper5 , Sniper6 , Sniper7 , Sniper8 , Sniper9 , Sniper10 , Sniper11 , Sniper12 }
14
7
8
+ if Map .Difficulty == " Very Easy (1P)" then
9
+ ParaChance = 20
10
+ Patrol = { " e1" , " e2" , " e1" }
11
+ Infantry = { " e4" , " e1" , " e1" , " e2" , " e2" }
12
+ Vehicles = { " apc" }
13
+ Tank = { " 3tnk" }
14
+ LongRange = { " arty" }
15
+ Boss = { " v2rl" }
16
+ Swarm = { " shok" , " shok" , " shok" }
17
+ elseif Map .Difficulty == " Easy (2P)" then
18
+ ParaChance = 25
19
+ Patrol = { " e1" , " e2" , " e1" }
20
+ Infantry = { " e4" , " e1" , " e1" , " e2" , " e1" , " e2" , " e1" }
21
+ Vehicles = { " ftrk" , " apc" , " arty" }
22
+ Tank = { " 3tnk" }
23
+ LongRange = { " v2rl" }
24
+ Boss = { " 4tnk" }
25
+ Swarm = { " shok" , " shok" , " shok" , " shok" , " ttnk" }
26
+ elseif Map .Difficulty == " Normal (3P)" then
27
+ ParaChance = 30
28
+ Patrol = { " e1" , " e2" , " e1" , " e1" }
29
+ Infantry = { " e4" , " e1" , " e1" , " e2" , " e1" , " e2" , " e1" }
30
+ Vehicles = { " ftrk" , " ftrk" , " apc" , " arty" }
31
+ Tank = { " 3tnk" }
32
+ LongRange = { " v2rl" }
33
+ Boss = { " 4tnk" }
34
+ Swarm = { " shok" , " shok" , " shok" , " shok" , " ttnk" , " ttnk" , " ttnk" }
35
+ elseif Map .Difficulty == " Hard (4P)" then
36
+ ParaChance = 35
37
+ Patrol = { " e1" , " e2" , " e1" , " e1" , " e4" }
38
+ Infantry = { " e4" , " e1" , " e1" , " e2" , " e1" , " e2" , " e1" }
39
+ Vehicles = { " arty" , " ftrk" , " ftrk" , " apc" , " apc" }
40
+ Tank = { " 3tnk" }
41
+ LongRange = { " v2rl" }
42
+ Boss = { " 4tnk" }
43
+ Swarm = { " shok" , " shok" , " shok" , " shok" , " shok" , " ttnk" , " ttnk" , " ttnk" , " ttnk" }
44
+ else
45
+ ParaChance = 40
46
+ Patrol = { " e1" , " e2" , " e1" , " e1" , " e4" , " e4" }
47
+ Infantry = { " e4" , " e1" , " e1" , " e2" , " e1" , " e2" , " e1" , " e1" }
48
+ Vehicles = { " arty" , " arty" , " ftrk" , " apc" , " apc" }
49
+ Tank = { " ftrk" , " 3tnk" }
50
+ LongRange = { " v2rl" }
51
+ Boss = { " 4tnk" }
52
+ Swarm = { " shok" , " shok" , " shok" , " shok" , " shok" , " shok" , " ttnk" , " ttnk" , " ttnk" , " ttnk" , " ttnk" }
53
+ end
54
+
15
55
Wave = 0
16
56
Waves =
17
57
{
18
- { delay = 500 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
19
-
20
- { delay = 750 , entries = PatrolWaypoints , units = Patrol , targets = ParadropWaypoints },
21
-
22
- { delay = 750 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
23
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
24
- { delay = 1 , entries = SovietEntryPoints , units = Vehicles , targets = SpawnPoints },
25
-
26
- { delay = 1500 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
27
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
28
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
29
-
30
- { delay = 1500 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
31
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
32
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
33
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
34
- { delay = 1 , entries = SovietEntryPoints , units = Vehicles , targets = SpawnPoints },
35
-
36
- { delay = 1500 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
37
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
38
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
39
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
40
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
41
- { delay = 1 , entries = SovietEntryPoints , units = Tank , targets = SpawnPoints },
42
- { delay = 1 , entries = SovietEntryPoints , units = Vehicles , targets = SpawnPoints },
43
-
44
- { delay = 1500 , entries = SovietEntryPoints , Infantry , targets = SpawnPoints },
45
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
46
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
47
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
48
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
49
- { delay = 1 , entries = SovietEntryPoints , units = Tank , targets = SpawnPoints },
50
- { delay = 1 , entries = SovietEntryPoints , units = Tank , targets = SpawnPoints },
51
-
52
- { delay = 1500 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
53
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
54
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
55
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
56
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
57
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
58
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
59
- { delay = 1 , entries = SovietEntryPoints , units = LongRange , targets = SpawnPoints },
60
-
61
- { delay = 1500 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
62
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
63
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
64
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
65
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
66
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
67
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
68
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
69
- { delay = 1 , entries = SovietEntryPoints , units = LongRange , targets = SpawnPoints },
70
- { delay = 1 , entries = SovietEntryPoints , units = Tank , targets = SpawnPoints },
71
- { delay = 1 , entries = SovietEntryPoints , units = LongRange , targets = SpawnPoints },
72
-
73
- { delay = 1500 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
74
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
75
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
76
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
77
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
78
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
79
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
80
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
81
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
82
- { delay = 1 , entries = SovietEntryPoints , units = LongRange , targets = SpawnPoints },
83
- { delay = 1 , entries = SovietEntryPoints , units = LongRange , targets = SpawnPoints },
84
- { delay = 1 , entries = SovietEntryPoints , units = Tank , targets = SpawnPoints },
85
- { delay = 1 , entries = SovietEntryPoints , units = Tank , targets = SpawnPoints },
86
- { delay = 1 , entries = SovietEntryPoints , units = Vehicles , targets = SpawnPoints },
87
-
88
- { delay = 1500 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
89
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
90
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
91
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
92
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
93
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
94
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
95
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
96
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
97
- { delay = 1 , entries = SovietEntryPoints , units = Infantry , targets = SpawnPoints },
98
- { delay = 1 , entries = SovietEntryPoints , units = Boss , targets = SpawnPoints }
58
+ { delay = 500 , units = { Infantry } },
59
+ { delay = 500 , units = { Patrol , Patrol } },
60
+ { delay = 700 , units = { Infantry , Infantry , Vehicles }, },
61
+ { delay = 1500 , units = { Infantry , Infantry , Infantry , Infantry } },
62
+ { delay = 1500 , units = { Infantry , Infantry , Patrol , Vehicles } },
63
+ { delay = 1500 , units = { Infantry , Infantry , Patrol , Infantry , Tank , Vehicles } },
64
+ { delay = 1500 , units = { Infantry , Infantry , Patrol , Infantry , Tank , Tank , Swarm } },
65
+ { delay = 1500 , units = { Infantry , Infantry , Patrol , Infantry , Infantry , Infantry , LongRange } },
66
+ { delay = 1500 , units = { Infantry , Infantry , Patrol , Infantry , Infantry , Infantry , Infantry , LongRange , Tank , LongRange } },
67
+ { delay = 1500 , units = { Infantry , Infantry , Patrol , Infantry , Infantry , Infantry , Infantry , Infantry , LongRange , LongRange , Tank , Tank , Vehicles } },
68
+ { delay = 1500 , units = { Infantry , Infantry , Patrol , Infantry , Infantry , Infantry , Infantry , Infantry , Infantry , Boss , Swarm } }
99
69
}
100
70
101
- SendUnits = function (entryCell , unitTypes , interval , targetCell )
102
- Reinforcements .Reinforce (soviets , unitTypes , { entryCell }, interval , function (a )
71
+ -- Now do some adjustments to the waves
72
+ if Map .Difficulty == " Real tough guy" or Map .Difficulty == " Endless mode" then
73
+ Waves [8 ] = { delay = 1500 , units = { Infantry , Infantry , Patrol , Infantry , Infantry , Infantry }, ironUnits = { LongRange } }
74
+ Waves [9 ] = { delay = 1500 , units = { Infantry , Infantry , Patrol , Infantry , Infantry , Infantry , Infantry , Infantry , LongRange , LongRange , Vehicles , Tank }, ironUnits = { Tank } }
75
+ Waves [11 ] = { delay = 1500 , units = { Vehicles , Infantry , Patrol , Patrol , Patrol , Infantry , LongRange , Tank , Boss , Infantry , Infantry , Patrol } }
76
+ end
77
+
78
+ SendUnits = function (entryCell , unitTypes , targetCell , extraData )
79
+ Reinforcements .Reinforce (soviets , unitTypes , { entryCell }, 40 , function (a )
80
+ if not a .HasProperty (" AttackMove" ) then
81
+ Trigger .OnIdle (a , function (a )
82
+ a .Move (targetCell )
83
+ end )
84
+ return
85
+ end
86
+
103
87
Trigger .OnIdle (a , function (a )
104
88
if a .Location ~= targetCell then
105
89
a .AttackMove (targetCell )
106
90
else
107
91
a .Hunt ()
108
92
end
109
93
end )
110
- end )
111
94
112
- if (Wave < # Waves ) then
113
- SendWave ()
114
- else
115
- Trigger .AfterDelay (DateTime .Minutes (2 ), SovietsRetreating )
116
- Media .DisplayMessage (" You survived the onslaught! No more waves incoming." )
117
- end
95
+ if extraData == " IronCurtain" then
96
+ a .GrantUpgrade (" invulnerability" )
97
+ Trigger .AfterDelay (DateTime .Seconds (25 ), function ()
98
+ a .RevokeUpgrade (" invulnerability" )
99
+ end )
100
+ end
101
+ end )
118
102
end
119
103
120
104
SendWave = function ()
121
105
Wave = Wave + 1
122
106
local wave = Waves [Wave ]
123
107
124
- local entry = Utils .Random (wave .entries ).Location
125
- local target = Utils .Random (wave .targets ).Location
126
-
127
108
Trigger .AfterDelay (wave .delay , function ()
128
- SendUnits (entry , wave .units , 40 , target )
109
+ Utils .Do (wave .units , function (units )
110
+ local entry = Utils .Random (SovietEntryPoints ).Location
111
+ local target = Utils .Random (SpawnPoints ).Location
112
+
113
+ SendUnits (entry , units , target )
114
+ end )
115
+
116
+ if wave .ironUnits then
117
+ Utils .Do (wave .ironUnits , function (units )
118
+ local entry = Utils .Random (SovietEntryPoints ).Location
119
+ local target = Utils .Random (SpawnPoints ).Location
129
120
130
- if not played then
131
- played = true
132
- Utils .Do (players , function (player )
133
- Media .PlaySpeechNotification (player , " EnemyUnitsApproaching" )
121
+ SendUnits (entry , units , target , " IronCurtain" )
134
122
end )
135
- Trigger .AfterDelay (DateTime .Seconds (1 ), function () played = false end )
123
+ end
124
+
125
+ Utils .Do (players , function (player )
126
+ Media .PlaySpeechNotification (player , " EnemyUnitsApproaching" )
127
+ end )
128
+
129
+ if (Wave < # Waves ) then
130
+ if Utils .RandomInteger (1 , 100 ) < ParaChance then
131
+ local units = ParaProxy .SendParatroopers (Utils .Random (ParadropWaypoints ).CenterPosition )
132
+ Utils .Do (units , function (unit )
133
+ Trigger .OnIdle (unit , function (a )
134
+ if a .IsInWorld then
135
+ a .Hunt ()
136
+ end
137
+ end )
138
+ end )
139
+
140
+ local delay = Utils .RandomInteger (DateTime .Seconds (20 ), DateTime .Seconds (45 ))
141
+ Trigger .AfterDelay (delay , SendWave )
142
+ else
143
+ SendWave ()
144
+ end
145
+ else
146
+ if Map .Difficulty == " Endless mode" then
147
+ Wave = 0
148
+ IncreaseDifficulty ()
149
+ SendWave ()
150
+ return
151
+ end
152
+
153
+ Trigger .AfterDelay (DateTime .Minutes (1 ), SovietsRetreating )
154
+ Media .DisplayMessage (" You almost survived the onslaught! No more waves incoming." )
136
155
end
137
156
end )
138
157
end
@@ -145,6 +164,13 @@ SovietsRetreating = function()
145
164
end )
146
165
end
147
166
167
+ IncreaseDifficulty = function ()
168
+ local additions = { Infantry , Patrol , Vehicles , Tank , LongRange , Boss , Swarm }
169
+ Utils .Do (Waves , function (wave )
170
+ wave .units [# wave .units + 1 ] = Utils .Random (additions )
171
+ end )
172
+ end
173
+
148
174
Tick = function ()
149
175
if (Utils .RandomInteger (1 , 200 ) == 10 ) then
150
176
local delay = Utils .RandomInteger (1 , 10 )
@@ -166,13 +192,8 @@ WorldLoaded = function()
166
192
players [i ] = player
167
193
end
168
194
169
- Utils .Do (Snipers , function (a )
170
- if a .Owner == soviets then
171
- a .GrantUpgrade (" unkillable" )
172
- end
173
- end )
174
-
175
195
Media .DisplayMessage (" Defend Fort Lonestar at all costs!" )
176
196
197
+ ParaProxy = Actor .Create (" powerproxy.paratroopers" , false , { Owner = soviets })
177
198
SendWave ()
178
199
end
0 commit comments