Skip to content

Commit fcccdd6

Browse files
committed
Call ModuleMan instead of PresetMan where necessary (followup to cortex-command-community/Cortex-Command-Community-Project-Source@5f75ded)
1 parent 8c59a63 commit fcccdd6

16 files changed

+55
-55
lines changed

Data/Base.rte/Activities/BrainVsBrain.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function BrainvsBrain:StartActivity(isNewGame)
4444
self.TechName[Activity.TEAM_2] = self:GetTeamTech(Activity.TEAM_2);
4545

4646
if self.CPUTeam ~= Activity.NOTEAM then
47-
self.CPUTechID = PresetMan:GetModuleID(self.TechName[self.CPUTeam]);
47+
self.CPUTechID = ModuleMan:GetModuleID(self.TechName[self.CPUTeam]);
4848
end
4949

5050
if isNewGame then
@@ -564,7 +564,7 @@ function BrainvsBrain:CreateHeavyDrop(xPosLZ)
564564
Craft.Pos = Vector(xPosLZ, -30); -- Set the spawn point of the craft
565565

566566
for i = 1, Craft.MaxPassengers do
567-
if math.random() < self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.TechName[self.CPUTeam])) then
567+
if math.random() < self:GetCrabToHumanSpawnRatio(ModuleMan:GetModuleID(self.TechName[self.CPUTeam])) then
568568
Passenger = self:CreateCrab(self.CPUTeam);
569569
elseif RangeRand(0, 105) < self.Difficulty then
570570
Passenger = self:CreateHeavyInfantry(self.CPUTeam);
@@ -849,7 +849,7 @@ end
849849

850850
function BrainvsBrain:CreateLightInfantry(team, mode)
851851
local Passenger = RandomAHuman("Actors - Light", self.TechName[team]);
852-
if Passenger.ModuleID ~= PresetMan:GetModuleID(self.TechName[team]) then
852+
if Passenger.ModuleID ~= ModuleMan:GetModuleID(self.TechName[team]) then
853853
Passenger = RandomAHuman("Actors", self.TechName[team]);
854854
end
855855

@@ -874,7 +874,7 @@ end
874874

875875
function BrainvsBrain:CreateDefender(team)
876876
local Passenger = RandomAHuman("Actors - Light", self.TechName[team]);
877-
if Passenger.ModuleID ~= PresetMan:GetModuleID(self.TechName[team]) then
877+
if Passenger.ModuleID ~= ModuleMan:GetModuleID(self.TechName[team]) then
878878
Passenger = RandomAHuman("Actors", self.TechName[team]);
879879
end
880880

@@ -894,7 +894,7 @@ end
894894

895895
function BrainvsBrain:CreateHeavyInfantry(team, mode)
896896
local Passenger = RandomAHuman("Actors - Heavy", self.TechName[team]);
897-
if Passenger.ModuleID ~= PresetMan:GetModuleID(self.TechName[team]) then
897+
if Passenger.ModuleID ~= ModuleMan:GetModuleID(self.TechName[team]) then
898898
Passenger = RandomAHuman("Actors", self.TechName[team]);
899899
end
900900

@@ -926,7 +926,7 @@ end
926926

927927
function BrainvsBrain:CreateMediumInfantry(team, mode)
928928
local Passenger = RandomAHuman("Actors - Heavy", self.TechName[team]);
929-
if Passenger.ModuleID ~= PresetMan:GetModuleID(self.TechName[team]) then
929+
if Passenger.ModuleID ~= ModuleMan:GetModuleID(self.TechName[team]) then
930930
Passenger = RandomAHuman("Actors", self.TechName[team]);
931931
end
932932

@@ -951,7 +951,7 @@ end
951951

952952
function BrainvsBrain:CreateScoutInfantry(team, mode)
953953
local Passenger = RandomAHuman("Actors - Light", self.TechName[team]);
954-
if Passenger.ModuleID ~= PresetMan:GetModuleID(self.TechName[team]) then
954+
if Passenger.ModuleID ~= ModuleMan:GetModuleID(self.TechName[team]) then
955955
Passenger = RandomAHuman("Actors", self.TechName[team]);
956956
end
957957

@@ -976,7 +976,7 @@ end
976976

977977
function BrainvsBrain:CreateEngineer(team, mode)
978978
local Passenger = RandomAHuman("Actors - Light", self.TechName[team]);
979-
if Passenger.ModuleID ~= PresetMan:GetModuleID(self.TechName[team]) then
979+
if Passenger.ModuleID ~= ModuleMan:GetModuleID(self.TechName[team]) then
980980
Passenger = RandomAHuman("Actors", self.TechName[team]);
981981
end
982982

Data/Base.rte/Activities/BunkerBreach.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function BunkerBreach:SetupDefenderBrains()
138138
end
139139

140140
function BunkerBreach:SetupDefenderActors()
141-
local techID = PresetMan:GetModuleID(self:GetTeamTech(self.defenderTeam));
141+
local techID = ModuleMan:GetModuleID(self:GetTeamTech(self.defenderTeam));
142142
local crabToHumanSpawnRatio = self:GetCrabToHumanSpawnRatio(techID);
143143

144144
for _, loadoutName in pairs({"Light", "Heavy", "Sniper", "Engineer", "Mecha", "Turret"}) do
@@ -628,7 +628,7 @@ function BunkerBreach:CreateInternalReinforcements(loadout, numberOfReinforcemen
628628
loadout = nil;
629629
end
630630
local team = self.CPUTeam;
631-
local techID = PresetMan:GetModuleID(self:GetTeamTech(team));
631+
local techID = ModuleMan:GetModuleID(self:GetTeamTech(team));
632632
local crabToHumanSpawnRatio = self:GetCrabToHumanSpawnRatio(techID);
633633

634634
local internalReinforcementPositionsToEnemyTargets = self:CalculateInternalReinforcementPositionsToEnemyTargets(numberOfReinforcementsToCreate);
@@ -649,7 +649,7 @@ function BunkerBreach:CreateInternalReinforcements(loadout, numberOfReinforcemen
649649
numberOfInternalReinforcementsToCreateAtPosition = 3;
650650
end
651651
end
652-
652+
653653
for i = 1, numberOfInternalReinforcementsToCreateAtPosition do
654654
local internalReinforcement;
655655
if loadout then
@@ -690,7 +690,7 @@ function BunkerBreach:CreateDrop(loadout, aiMode, passengerCount, avoidPreviousC
690690
loadout = nil;
691691
end
692692
local team = self.CPUTeam;
693-
local techID = PresetMan:GetModuleID(self:GetTeamTech(team));
693+
local techID = ModuleMan:GetModuleID(self:GetTeamTech(team));
694694
local crabToHumanSpawnRatio = self:GetCrabToHumanSpawnRatio(techID);
695695

696696
local craft = RandomACDropShip("Craft", techID);
@@ -855,7 +855,7 @@ function BunkerBreach:CreateCrab(techID, createTurret)
855855
end
856856

857857
function BunkerBreach:CreateBrainBot(team, techID)
858-
local techID = PresetMan:GetModuleID(self:GetTeamTech(team));
858+
local techID = ModuleMan:GetModuleID(self:GetTeamTech(team));
859859
local actor;
860860
if techID ~= -1 and team == self.attackerTeam then
861861
actor = PresetMan:GetLoadout("Infantry Brain", techID, false);

Data/Base.rte/Activities/Harvester.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function Harvester:UpdateActivity()
253253
for i = 1, actorsInCargo do
254254
-- Get any Actor from the CPU's native tech
255255
local passenger = nil;
256-
if math.random() >= self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.CPUTechName)) then
256+
if math.random() >= self:GetCrabToHumanSpawnRatio(ModuleMan:GetModuleID(self.CPUTechName)) then
257257
passenger = RandomAHuman("Any", self.CPUTechName);
258258
else
259259
passenger = RandomACrab("Actors - Mecha", self.CPUTechName);

Data/Base.rte/Activities/KeepieUppie.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function KeepieUppie:ResumeLoadedGame()
104104
end
105105
end
106106
end
107-
107+
108108
if not self.playerRocketSpawned then
109109
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
110110
if self:PlayerActive(player) and self:PlayerHuman(player) then
@@ -206,7 +206,7 @@ function KeepieUppie:UpdateActivity()
206206
for i = 1, actorsInCargo do
207207
-- Get any Actor from the CPU's native tech
208208
local passenger = nil;
209-
if math.random() >= self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.CPUTechName)) then
209+
if math.random() >= self:GetCrabToHumanSpawnRatio(ModuleMan:GetModuleID(self.CPUTechName)) then
210210
passenger = RandomAHuman("Any", self.CPUTechName);
211211
else
212212
passenger = RandomACrab("Any", self.CPUTechName);

Data/Base.rte/Activities/Massacre.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ function Massacre:UpdateActivity()
249249
for i = 1, actorsInCargo do
250250
-- Get any Actor from the CPU's native tech
251251
local passenger = nil;
252-
if math.random() >= self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.CPUTechName)) then
252+
if math.random() >= self:GetCrabToHumanSpawnRatio(ModuleMan:GetModuleID(self.CPUTechName)) then
253253
passenger = RandomAHuman("Any", self.CPUTechName);
254254
else
255255
passenger = RandomACrab("Actors - Mecha", self.CPUTechName);

Data/Base.rte/Activities/OneManArmy.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ function OneManArmy:SetupHumanPlayerBrains(actorGroup, primaryGroup, secondaryGr
105105

106106
--If we can't find an unassigned brain in the scene to give the player, create one
107107
if not foundBrain then
108-
local tech = PresetMan:GetModuleID(self:GetTeamTech(team));
108+
local tech = ModuleMan:GetModuleID(self:GetTeamTech(team));
109109
foundBrain = CreateAHuman(defaultActor);
110110
--If a faction was chosen, pick the first item from faction listing
111111
if tech ~= -1 then
112-
local module = PresetMan:GetDataModule(tech);
112+
local module = ModuleMan:GetDataModule(tech);
113113
local primaryWeapon, secondaryWeapon, throwable, actor;
114114
for entity in module.Presets do
115115
local picked; --Prevent duplicates
@@ -333,9 +333,9 @@ function OneManArmy:UpdateActivity()
333333
for i = 1, actorsInCargo do
334334
--Get any Actor from the CPU's native tech
335335
local passenger = nil;
336-
if math.random() >= self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.CPUTechName)) then
336+
if math.random() >= self:GetCrabToHumanSpawnRatio(ModuleMan:GetModuleID(self.CPUTechName)) then
337337
passenger = RandomAHuman("Actors - Light", self.CPUTechName);
338-
if passenger.ModuleID ~= PresetMan:GetModuleID(self.CPUTechName) then
338+
if passenger.ModuleID ~= ModuleMan:GetModuleID(self.CPUTechName) then
339339
passenger = RandomAHuman("Actors", self.CPUTechName);
340340
end
341341
else

Data/Base.rte/Activities/OneManArmyDiggers.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ function OneManArmy:SetupHumanPlayerBrains(actorGroup, primaryGroup, secondaryGr
106106
local foundBrain = MovableMan:GetUnassignedBrain(team);
107107
-- If we can't find an unassigned brain in the scene to give the player, create one
108108
if not foundBrain then
109-
local tech = PresetMan:GetModuleID(self:GetTeamTech(team));
109+
local tech = ModuleMan:GetModuleID(self:GetTeamTech(team));
110110
foundBrain = CreateAHuman(defaultActor);
111111
-- If a faction was chosen, pick the first item from faction listing
112112
if tech ~= -1 then
113-
local module = PresetMan:GetDataModule(tech);
113+
local module = ModuleMan:GetDataModule(tech);
114114
local primaryWeapon, secondaryWeapon, throwable, actor;
115115
for entity in module.Presets do
116116
local picked; -- Prevent duplicates
@@ -288,7 +288,7 @@ function OneManArmy:UpdateActivity()
288288
-- Set the ship up with a cargo of a few armed and equipped actors
289289
for i = 1, actorsInCargo do
290290
local passenger = RandomAHuman("Actors - " .. ((self.Difficulty > 75 and math.random() > 0.5) and "Heavy" or "Light"), self.CPUTechName);
291-
if passenger.ModuleID ~= PresetMan:GetModuleID(self.CPUTechName) then
291+
if passenger.ModuleID ~= ModuleMan:GetModuleID(self.CPUTechName) then
292292
passenger = RandomAHuman("Actors", self.CPUTechName);
293293
end
294294

Data/Base.rte/Activities/OneManArmyZeroG.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function OneManArmyZeroG:StartActivity(isNewGame)
88
self.winTimer = Timer();
99

1010
self.CPUTechName = self:GetTeamTech(self.CPUTeam);
11-
11+
1212
self.isDiggersOnly = self.PresetName:find("Diggers") ~= nil;
1313

1414
if isNewGame then
@@ -85,7 +85,7 @@ function OneManArmyZeroG:StartNewGame()
8585
self.timeLimit = (timeLimitMinutes * 60000) + 5000;
8686
self.timeDisplay = timeLimitText .. " minutes";
8787
self.enemySpawnTimeLimit = 500;
88-
88+
8989
local automoverController = CreateActor("Invisible Automover Controller", "Base.rte");
9090
automoverController.Team = -1;
9191
automoverController:SetNumberValue("MovementSpeed", 16);
@@ -121,11 +121,11 @@ function OneManArmyZeroG:SetupHumanPlayerBrains(actorGroup, primaryGroup, second
121121

122122
--If we can't find an unassigned brain in the scene to give the player, create one
123123
if not foundBrain then
124-
local tech = PresetMan:GetModuleID(self:GetTeamTech(team));
124+
local tech = ModuleMan:GetModuleID(self:GetTeamTech(team));
125125
foundBrain = CreateAHuman(defaultActor);
126126
--If a faction was chosen, pick the first item from faction listing
127127
if tech ~= -1 then
128-
local dataModule = PresetMan:GetDataModule(tech);
128+
local dataModule = ModuleMan:GetDataModule(tech);
129129
local primaryWeapon, secondaryWeapon, tertiaryWeapon, actor;
130130
for entity in dataModule.Presets do
131131
local picked; --Prevent duplicates
@@ -248,14 +248,14 @@ function OneManArmyZeroG:ResumeLoadedGame()
248248
end
249249
end
250250
end
251-
251+
252252
for particle in MovableMan.AddedParticles do
253253
if particle.PresetName == "Automover Node 1x1" then
254254
particle.Scale = 0;
255255
break;
256256
end
257257
end
258-
258+
259259
for actor in MovableMan.AddedActors do
260260
if actor.Team ~= Activity.TEAM_1 then
261261
actor.AIMode = Actor.AIMODE_BRAINHUNT;
@@ -339,12 +339,12 @@ function OneManArmyZeroG:UpdateActivity()
339339
end
340340
end
341341
end
342-
342+
343343
local enemyMOIDCount = MovableMan:GetTeamMOIDCount(self.CPUTeam);
344344
if self.CPUTeam ~= Activity.NOTEAM and self.enemySpawnTimer:LeftTillSimMS(self.enemySpawnTimeLimit) <= 0 and enemyMOIDCount < rte.AIMOIDMax then
345345
for i = 1, math.random(1, 3) do
346346
local actor = RandomAHuman("Actors - Light", self.CPUTechName);
347-
if actor.ModuleID ~= PresetMan:GetModuleID(self.CPUTechName) then
347+
if actor.ModuleID ~= ModuleMan:GetModuleID(self.CPUTechName) then
348348
actor = RandomAHuman("Actors", self.CPUTechName);
349349
end
350350

Data/Base.rte/Activities/Siege.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Siege:StartActivity()
3131
self.CPUTechName = self:GetTeamTech(self.CPUTeam); -- Select a tech for the CPU player
3232
self.PlayerTechName = self:GetTeamTech(self.PlayerTeam);
3333
gPrevAITech = self.CPUTechName -- Store the AI tech in a global so we don't pick the same tech again next round
34-
self.CPUTechID = PresetMan:GetModuleID(self.CPUTechName);
34+
self.CPUTechID = ModuleMan:GetModuleID(self.CPUTechName);
3535

3636
self:SetTeamFunds(math.ceil((3000 + self.Difficulty * 175) * rte.StartingFundsScale), self.CPUTeam);
3737
if self.Difficulty == 100 then
@@ -483,7 +483,7 @@ function Siege:CreateHeavyDrop(xPosLZ, techName)
483483
Craft.Pos = Vector(xPosLZ, -30); -- Set the spawn point of the craft
484484

485485
for i = 1, Craft.MaxPassengers do
486-
if math.random() < self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(techName)) then
486+
if math.random() < self:GetCrabToHumanSpawnRatio(ModuleMan:GetModuleID(techName)) then
487487
Passenger = self:CreateCrab(Actor.AIMODE_GOTO, techName);
488488
elseif RangeRand(0, 105) < self.Difficulty then
489489
Passenger = self:CreateHeavyInfantry(Actor.AIMODE_GOTO,techName);
@@ -503,7 +503,7 @@ function Siege:CreateHeavyDrop(xPosLZ, techName)
503503
end
504504

505505
-- Subtract the total value of the craft+cargo from the CPU team's funds
506-
self:ChangeTeamFunds(-Craft:GetTotalValue(PresetMan:GetModuleID(techName), 2), self.CPUTeam);
506+
self:ChangeTeamFunds(-Craft:GetTotalValue(ModuleMan:GetModuleID(techName), 2), self.CPUTeam);
507507

508508
-- Spawn the Craft onto the scene
509509
MovableMan:AddActor(Craft);
@@ -540,7 +540,7 @@ function Siege:CreateSWATDrop(xPosLZ, techName)
540540
end
541541

542542
-- Subtract the total value of the craft+cargo from the CPU team's funds
543-
self:ChangeTeamFunds(-Craft:GetTotalValue(PresetMan:GetModuleID(techName), 2), self.CPUTeam);
543+
self:ChangeTeamFunds(-Craft:GetTotalValue(ModuleMan:GetModuleID(techName), 2), self.CPUTeam);
544544

545545
-- Spawn the Craft onto the scene
546546
MovableMan:AddActor(Craft);
@@ -577,7 +577,7 @@ function Siege:CreateArtilleryDrop(xPosLZ, techName)
577577
end
578578

579579
-- Subtract the total value of the craft+cargo from the CPU team's funds
580-
self:ChangeTeamFunds(-Craft:GetTotalValue(PresetMan:GetModuleID(techName), 2), self.CPUTeam);
580+
self:ChangeTeamFunds(-Craft:GetTotalValue(ModuleMan:GetModuleID(techName), 2), self.CPUTeam);
581581

582582
-- Spawn the Craft onto the scene
583583
MovableMan:AddActor(Craft);
@@ -631,7 +631,7 @@ function Siege:CreateMediumDrop(xPosLZ, techName)
631631
end
632632

633633
-- Subtract the total value of the craft+cargo from the CPU team's funds
634-
self:ChangeTeamFunds(-Craft:GetTotalValue(PresetMan:GetModuleID(techName), 2), self.CPUTeam);
634+
self:ChangeTeamFunds(-Craft:GetTotalValue(ModuleMan:GetModuleID(techName), 2), self.CPUTeam);
635635

636636
-- Spawn the Craft onto the scene
637637
MovableMan:AddActor(Craft);
@@ -683,7 +683,7 @@ function Siege:CreateLightDrop(xPosLZ, techName)
683683
end
684684

685685
-- Subtract the total value of the craft+cargo from the CPU team's funds
686-
self:ChangeTeamFunds(-Craft:GetTotalValue(PresetMan:GetModuleID(techName), 2), self.CPUTeam);
686+
self:ChangeTeamFunds(-Craft:GetTotalValue(ModuleMan:GetModuleID(techName), 2), self.CPUTeam);
687687

688688
-- Spawn the Craft onto the scene
689689
MovableMan:AddActor(Craft);
@@ -731,7 +731,7 @@ function Siege:CreateEngineerDrop(xPosLZ, techName)
731731
end
732732

733733
-- Subtract the total value of the craft+cargo from the CPU team's funds
734-
self:ChangeTeamFunds(-Craft:GetTotalValue(PresetMan:GetModuleID(techName), 2), self.CPUTeam);
734+
self:ChangeTeamFunds(-Craft:GetTotalValue(ModuleMan:GetModuleID(techName), 2), self.CPUTeam);
735735

736736
-- Spawn the Craft onto the scene
737737
MovableMan:AddActor(Craft);

Data/Base.rte/Activities/SkirmishDefense.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function SkirmishDefense:StartActivity(isNewGame)
5757
end
5858
end
5959

60-
self.AI[team].TechID = PresetMan:GetModuleID(self:GetTeamTech(team));
60+
self.AI[team].TechID = ModuleMan:GetModuleID(self:GetTeamTech(team));
6161
end
6262

6363
if isNewGame then

0 commit comments

Comments
 (0)