Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit e5a8cb4

Browse files
committed
Merge branch 'pre5-patch' into secrets-and-speedruns
# Conflicts: # Data/Missions.rte/Activities/SignalHunt.lua - Not a real conflict
2 parents f31d326 + da77f5b commit e5a8cb4

File tree

114 files changed

+4170
-3007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+4170
-3007
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Mods/
5959
Userdata/
6060

6161
allegro.log
62-
AbortScreen.bmp
62+
AbortScreen.*
6363
AbortLog.txt
6464
MemCleanupInfo.txt
6565
LogPublish.txt

Data/Base.rte/Activities.ini

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ AddActivity = GAScripted
4747
Description = Build a bunker and defend it against increasingly longer waves of AI-controlled enemies, with time to repair in between! Adjust the Difficulty to change wave difficulty.
4848
SceneName = Ketanot Hills
4949
ScriptPath = Base.rte/Activities/WaveDefense.lua
50-
TeamOfPlayer1 = 0
51-
TeamOfPlayer2 = 0
52-
TeamOfPlayer3 = 0
53-
TeamOfPlayer4 = 0
54-
CPUTeam = 1
50+
TeamOfPlayer1 = 1
51+
TeamOfPlayer2 = 1
52+
TeamOfPlayer3 = 1
53+
TeamOfPlayer4 = 1
54+
CPUTeam = 0
5555
MinTeamsRequired = 2
5656
DefaultGoldCakeDifficulty = 6000
5757
DefaultGoldEasyDifficulty = 5000
@@ -60,9 +60,11 @@ AddActivity = GAScripted
6060
DefaultGoldNutsDifficulty = 2000
6161
DefaultGoldMaxDifficulty = 1000
6262
LuaClassName = WaveDefense
63+
Team1Name = Attackers
64+
Team2Name = Defenders
6365
DefaultRequireClearPathToOrbit = 1
6466
DeployUnitsSwitchEnabled = 1
65-
DefaultDeployUnits = 0
67+
DefaultDeployUnits = 1
6668
6769
6870
AddActivity = GAScripted

Data/Base.rte/Activities/BunkerBreach.lua

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ function BunkerBreach:SetupDefenderBrains()
7777

7878
-- Add defender brains, either using the Brain area or picking randomly from those created by deployments.
7979
if SceneMan.Scene:HasArea("Brain") then
80-
for actor in MovableMan.Actors do
81-
if actor.Team == self.defenderTeam and actor:IsInGroup("Brains") then
80+
for actor in MovableMan.AddedActors do
81+
if actor:IsInGroup("Brains") then
8282
actor.ToDelete = true;
8383
end
8484
end
@@ -141,35 +141,52 @@ function BunkerBreach:SetupDefenderActors()
141141
local techID = PresetMan:GetModuleID(self:GetTeamTech(self.defenderTeam));
142142
local crabToHumanSpawnRatio = self:GetCrabToHumanSpawnRatio(techID);
143143

144-
for _, loadoutName in pairs({"Light", "Heavy", "Sniper", "Engineer", "Mecha", "Turret"}) do
144+
local loadoutNames = {"Light", "Heavy", "Sniper", "Engineer", "Mecha", "Turret"};
145+
146+
local hasSpawnAreas = false;
147+
for _, loadoutName in pairs(loadoutNames) do
145148
if SceneMan.Scene:HasArea(loadoutName .. " Defenders") then
146-
local defenderArea = SceneMan.Scene:GetOptionalArea(loadoutName .. " Defenders");
147-
if defenderArea ~= nil then
148-
for defenderBox in defenderArea.Boxes do
149-
local guard;
150-
if loadoutName == "Mecha" or loadoutName == "Turret" then
151-
guard = crabToHumanSpawnRatio > 0 and self:CreateCrab(techID, loadoutName == "Turret") or self:CreateInfantry(techID, "Heavy");
152-
else
153-
guard = self:CreateInfantry(techID, loadoutName);
154-
end
155-
if guard then
156-
guard.Pos = defenderBox.Center;
157-
guard.Team = self.defenderTeam;
158-
guard.AIMode = Actor.AIMODE_SENTRY;
159-
if loadoutName == "Engineer" then
160-
guard.AIMode = Actor.AIMODE_GOLDDIG;
149+
hasSpawnAreas = true;
150+
end
151+
end
152+
153+
for actor in MovableMan.AddedActors do
154+
if not actor:IsInGroup("Brains") and not actor:IsInGroup("Bunker Systems - Automovers") then
155+
if hasSpawnAreas then
156+
actor.ToDelete = true;
157+
elseif actor.Team ~= self.defenderTeam then
158+
MovableMan:ChangeActorTeam(actor, self.defenderTeam);
159+
end
160+
end
161+
end
162+
163+
if hasSpawnAreas then
164+
for _, loadoutName in pairs({"Light", "Heavy", "Sniper", "Engineer", "Mecha", "Turret"}) do
165+
if SceneMan.Scene:HasArea(loadoutName .. " Defenders") then
166+
hasSpawnAreas = true;
167+
local defenderArea = SceneMan.Scene:GetOptionalArea(loadoutName .. " Defenders");
168+
if defenderArea ~= nil then
169+
for defenderBox in defenderArea.Boxes do
170+
local guard;
171+
if loadoutName == "Mecha" or loadoutName == "Turret" then
172+
guard = crabToHumanSpawnRatio > 0 and self:CreateCrab(techID, loadoutName == "Turret") or self:CreateInfantry(techID, "Heavy");
173+
else
174+
guard = self:CreateInfantry(techID, loadoutName);
175+
end
176+
if guard then
177+
guard.Pos = defenderBox.Center;
178+
guard.Team = self.defenderTeam;
179+
guard.AIMode = Actor.AIMODE_SENTRY;
180+
if loadoutName == "Engineer" then
181+
guard.AIMode = Actor.AIMODE_GOLDDIG;
182+
end
183+
MovableMan:AddActor(guard);
161184
end
162-
MovableMan:AddActor(guard);
163185
end
164186
end
165187
end
166188
end
167189
end
168-
for actor in MovableMan.AddedActors do
169-
if actor.Team ~= self.defenderTeam and not actor:IsInGroup("Brains") and not actor:IsInGroup("Bunker Systems - Automovers") then
170-
MovableMan:ChangeActorTeam(actor, self.defenderTeam);
171-
end
172-
end
173190
end
174191

175192
function BunkerBreach:SetupFogOfWar()
@@ -241,12 +258,12 @@ function BunkerBreach:StartActivity(isNewGame)
241258

242259
self:SetupAIVariables();
243260

244-
self:SetupHumanAttackerBrains();
245-
246261
self:SetupDefenderBrains();
247262

248263
self:SetupDefenderActors();
249264

265+
self:SetupHumanAttackerBrains();
266+
250267
self:SetupFogOfWar();
251268
else
252269
self:ResumeLoadedGame();

Data/Base.rte/Activities/SkirmishDefense.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ function SkirmishDefense:StartNewGame(aiTeams)
110110
soleHumanTeam = soleHumanTeam == -1 and team or false;
111111
end
112112
end
113-
-- If there's only one Human team, set all existing doors to that team
113+
-- If there's only one Human team, set all existing doors and actors to that team
114114
if soleHumanTeam ~= false and soleHumanTeam >= 0 then
115115
for actor in MovableMan.AddedActors do
116-
if actor.Team ~= soleHumanTeam and actor.ClassName == "ADoor" then
116+
if actor.Team ~= soleHumanTeam then
117117
MovableMan:ChangeActorTeam(actor, soleHumanTeam);
118118
end
119119
end

Data/Base.rte/Activities/WaveDefense.lua

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ end
2525

2626
function WaveDefense:StartActivity(isNewGame)
2727
-- Get player team
28-
self.playerTeam = Activity.TEAM_1;
28+
self.playerTeam = Activity.TEAM_2;
2929
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
3030
if self:PlayerActive(player) and self:PlayerHuman(player) then
3131
self.playerTeam = self:GetTeamOfPlayer(player);
@@ -94,7 +94,6 @@ end
9494

9595
function WaveDefense:StartNewGame()
9696
self:SetTeamFunds(self:GetStartingGold(), self.playerTeam);
97-
self:CheckBrains();
9897

9998
self.triggerWaveInit = true;
10099
self.wave = 1;
@@ -105,7 +104,17 @@ function WaveDefense:StartNewGame()
105104
if actor.ClassName == "AHuman" or actor.ClassName == "ACrab" then
106105
actor.AIMode = Actor.AIMODE_SENTRY;
107106
end
108-
actor.Team = self.playerTeam;
107+
MovableMan:ChangeActorTeam(actor, self.playerTeam);
108+
end
109+
110+
self:CheckBrains();
111+
112+
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
113+
if self:PlayerActive(player) and self:PlayerHuman(player) then
114+
if self:GetPlayerBrain(player) then
115+
self:SwitchToActor(self:GetPlayerBrain(player), player, self:GetTeamOfPlayer(player));
116+
end
117+
end
109118
end
110119
end
111120

@@ -258,6 +267,14 @@ function WaveDefense:UpdateActivity()
258267
end
259268
end
260269

270+
-- Reveal the main bunker area for the defender.
271+
local mainBunkerArea = SceneMan.Scene:GetOptionalArea("Main Bunker");
272+
if mainBunkerArea ~= nil then
273+
for mainBunkerBox in mainBunkerArea.Boxes do
274+
SceneMan:RevealUnseenBox(mainBunkerBox.Corner.X, mainBunkerBox.Corner.Y, mainBunkerBox.Width, mainBunkerBox.Height, self.playerTeam);
275+
end
276+
end
277+
261278
for Act in MovableMan.AddedActors do
262279
if Act.ClassName ~= "ADoor" then
263280
for ang = 0, math.pi*2, 0.15 do

Data/Base.rte/Actors/Shared/Scripts/SelfHeal.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ function Update(self)
1111
if self.healing.wound then
1212
if self.healing.timer:IsPastSimMS(self.healing.delay) then
1313
self.healing.timer:Reset();
14-
self.Health = math.min(self.Health + self.healing.wound.BurstDamage * math.sqrt(self.healing.part.DamageMultiplier), self.MaxHealth);
14+
if self.healing.part.DamageMultiplier > 1 then
15+
self.Health = math.min(self.Health + self.healing.wound.BurstDamage * math.sqrt(self.healing.part.DamageMultiplier), self.MaxHealth);
16+
else
17+
self.Health = math.min(self.Health + self.healing.wound.BurstDamage * self.healing.part.DamageMultiplier, self.MaxHealth);
18+
end
1519
self.healing.wound.ToDelete = true;
1620
self.healing.wound = nil;
1721
for wound in self.healing.part.Wounds do

Data/Base.rte/Constants.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ rte.PxTravelledPerFrame = GetPPM() * TimerMan.DeltaTimeSecs;
1414
--Materials
1515
rte.airID = 0;
1616
rte.goldID = 2;
17-
rte.doorID = 4; --Xenocronium
18-
rte.grassID = 128;
17+
rte.grassID = 128;
18+
rte.doorID = 181;

Data/Base.rte/Devices/Explosives/NapalmBomb/NapalmBomb.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ AddDevice = TDExplosive
241241
MaxVelocity = 25
242242
InheritsVel = 0
243243
LifeVariation = 0.20
244+
SpreadMode = 1
244245
AddGib = Gib
245246
GibParticle = PEmitter
246247
CopyOf = Flame Hurt Short
@@ -249,7 +250,6 @@ AddDevice = TDExplosive
249250
MaxVelocity = 40
250251
InheritsVel = 0
251252
LifeVariation = 0.20
252-
SpreadMode = 1
253253
AddGib = Gib
254254
GibParticle = PEmitter
255255
CopyOf = Ground Flame

Data/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosive.ini

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ AddDevice = HDFirearm
6565
X = -2
6666
Y = -5
6767
EntryWound = AEmitter
68-
CopyOf = Dent Metal
68+
CopyOf = Dent Metal No Spark
6969
ExitWound = AEmitter
70-
CopyOf = Dent Metal
71-
GoldValue = 10
70+
CopyOf = Dent Metal No Spark
71+
GoldValue = 5
7272
AtomGroup = AtomGroup
7373
AutoGenerate = 1
7474
Material = Material
@@ -105,14 +105,30 @@ AddDevice = HDFirearm
105105
Y = 1
106106
RateOfFire = 60
107107
ReloadTime = 400
108+
AddGib = Gib
109+
GibParticle = MOPixel
110+
CopyOf = Spark Yellow 1
111+
MinVelocity = 10
112+
MaxVelocity = 15
113+
AddGib = Gib
114+
GibParticle = MOPixel
115+
CopyOf = Spark Yellow 2
116+
MinVelocity = 10
117+
MaxVelocity = 15
108118
AddGib = Gib
109119
GibParticle = MOSParticle
110120
CopyOf = Gib Metal Dark Micro A
121+
MinVelocity = 0
122+
MaxVelocity = 5
111123
AddGib = Gib
112124
GibParticle = MOSParticle
113125
CopyOf = Gib Metal Dark Tiny A
114-
GibWoundLimit = 3
115-
GibImpulseLimit = 30
126+
MinVelocity = 0
127+
MaxVelocity = 5
128+
GibWoundLimit = 1
129+
GibImpulseLimit = 10
130+
GibSound = SoundContainer
131+
CopyOf = Device Impact
116132

117133

118134
///////////////////////////////////////////////////////////////////////

Data/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDetonator.lua

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,24 @@ function Update(self)
1818
end
1919
if self.Magazine then
2020
if self:IsActivated() then
21-
if self.fireOn == false then
22-
if self.delayTimer:IsPastSimMS(self.detonateDelay) then
23-
self.delayTimer:Reset();
24-
self.actionPhase = self.actionPhase + 1;
25-
self.blink = false;
26-
else
27-
self.Magazine.RoundCount = math.ceil(100 * (1 - 1 * self.delayTimer.ElapsedSimTimeMS/self.detonateDelay));
28-
end
29-
if self.actionPhase >= 1 then
21+
if self.delayTimer:IsPastSimMS(self.detonateDelay) then
22+
self.delayTimer:Reset();
23+
self.actionPhase = self.actionPhase + 1;
24+
self.blink = false;
25+
else
26+
self.Magazine.RoundCount = math.ceil(100 * (1 - 1 * self.delayTimer.ElapsedSimTimeMS/self.detonateDelay));
27+
end
28+
if self.actionPhase >= 1 then
3029

31-
if RemoteExplosiveTableA and RemoteExplosiveTableB then
32-
for i = 1, #RemoteExplosiveTableA do
33-
if MovableMan:IsParticle(RemoteExplosiveTableA[i]) and RemoteExplosiveTableB[i] == self.alliedTeam then
34-
RemoteExplosiveTableA[i].Sharpness = 2;
35-
end
30+
if RemoteExplosiveTableA and RemoteExplosiveTableB then
31+
for i = 1, #RemoteExplosiveTableA do
32+
if MovableMan:IsParticle(RemoteExplosiveTableA[i]) and RemoteExplosiveTableB[i] == self.alliedTeam then
33+
RemoteExplosiveTableA[i].Sharpness = 2;
3634
end
3735
end
38-
self.detonateSound:Play(self.Pos);
39-
self.fireOn = true;
40-
self:Reload();
4136
end
37+
self.detonateSound:Play(self.Pos);
38+
self:Reload();
4239
end
4340
else
4441
self.delayTimer:Reset();

0 commit comments

Comments
 (0)