Skip to content

Commit fe5616b

Browse files
committed
Undid spawn timer removal
1 parent 5e5b2fa commit fe5616b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Data/Base.rte/Activities/WaveDefense.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function WaveDefense:StartActivity(isNewGame)
4949
self.AI.HuntTimer = Timer();
5050

5151
self.AI.bombChance = math.min(math.max(self.Difficulty/100+math.random(-0.1, 0.1), 0), 1);
52+
self.AI.timeToSpawn = 8000 - 50 * self.Difficulty; -- Time before the first AI spawn: from 8s to 3s
5253
self.AI.timeToBomb = (42000 - 300 * self.Difficulty) * math.random(0.7, 1.1); -- From 42s to 12s
5354
self.AI.baseSpawnTime = 9000 - 40 * self.Difficulty; -- From 9s to 5s
5455
self.AI.randomSpawnTime = 6000 - 30 * self.Difficulty; -- From 6s to 3s
@@ -98,11 +99,6 @@ function WaveDefense:StartNewGame()
9899
self.wave = 1;
99100
self.wavesDefeated = 0;
100101

101-
-- Just spawn all the time
102-
-- We used to vary this by difficulty, but eh, why bother. It just stretches the length of each round out.
103-
-- Instead we spawn constantly >:)
104-
self.AI.timeToSpawn = 0;
105-
106102
-- Set all actors defined in the ini-file to sentry mode, and set their team to the player's.
107103
for actor in MovableMan.AddedActors do
108104
if actor.ClassName == "AHuman" or actor.ClassName == "ACrab" then
@@ -444,9 +440,12 @@ function WaveDefense:UpdateActivity()
444440

445441
if obstacleHeight > 200 and math.random() < 0.4 then
446442
-- This target is very difficult to reach: cancel this attack and search for another target again soon
443+
self.AI.timeToSpawn = 500;
447444
self.AI.AttackTarget = nil;
448445
self.AI.AttackPos = nil;
449446
else
447+
self.AI.timeToSpawn = (self.AI.baseSpawnTime + math.random(self.AI.randomSpawnTime)) * rte.SpawnIntervalScale;
448+
450449
if obstacleHeight < 30 then
451450
self:CreateHeavyDrop(xPosLZ, self.AI.AttackPos);
452451
elseif obstacleHeight < 100 then
@@ -492,6 +491,7 @@ function WaveDefense:UpdateActivity()
492491
else
493492
-- No target found
494493
self.AI.SpawnTimer:Reset();
494+
self.AI.timeToSpawn = 5000;
495495
end
496496
end
497497
end

0 commit comments

Comments
 (0)