1
1
package.loaded .Constants = nil ;
2
2
require (" Constants" );
3
+ require (" Scripts/Shared/Activity_SpeedrunHelper" )
3
4
4
5
function DecisionDayDeployBrainPieSliceActivation (pieMenuOwner , pieMenu , pieSlice )
5
6
ActivityMan :GetActivity ():SaveNumber (" DeployBrain" , pieMenuOwner :GetController ().Player + 1 );
@@ -398,6 +399,8 @@ function DecisionDay:OnSave()
398
399
end
399
400
400
401
function DecisionDay :StartNewGame ()
402
+ self .speedrunData = ActivitySpeedrunHelper .Setup (self , self .DoSpeedrunMode );
403
+
401
404
self :SetTeamFunds (0 , self .humanTeam );
402
405
self .BuyMenuEnabled = false ;
403
406
@@ -787,6 +790,11 @@ function DecisionDay:DoGameOverCheck()
787
790
self .messageTimer :Reset ();
788
791
end
789
792
end
793
+
794
+ if self .speedrunData and self .WinnerTeam == self .humanTeam then
795
+ self .messageTimer :SetSimTimeLimitMS (10000 );
796
+ ActivitySpeedrunHelper .CompleteSpeedrun (self .speedrunData );
797
+ end
790
798
791
799
if self .WinnerTeam ~= Activity .NOTEAM and self .messageTimer :IsPastSimTimeLimit () then
792
800
if self .WinnerTeam == self .humanTeam then
@@ -800,6 +808,48 @@ function DecisionDay:DoGameOverCheck()
800
808
end
801
809
end
802
810
811
+ function DecisionDay :DoSpeedrunMode ()
812
+ self .Difficulty = Activity .MAXDIFFICULTY ;
813
+ self .difficultyRatio = 2 ;
814
+ for _ , bunkerRegionData in pairs (self .bunkerRegions ) do
815
+ bunkerRegionData .captureLimit = 600 * self .difficultyRatio ;
816
+ bunkerRegionData .aiRegionDefenseTimer :SetSimTimeLimitMS (60000 / self .difficultyRatio );
817
+ bunkerRegionData .aiRegionDefenseTimer .ElapsedSimTimeMS = 60000 / self .difficultyRatio ;
818
+ bunkerRegionData .aiRegionAttackTimer :SetSimTimeLimitMS (90000 / self .difficultyRatio );
819
+ end
820
+
821
+ self .aiData .externalSpawnTimer :SetSimTimeLimitMS (120000 / self .difficultyRatio );
822
+ self .aiData .internalReinforcementsTimer :SetSimTimeLimitMS (100000 / self .difficultyRatio );
823
+ self .aiData .internalReinforcementLimit = 12 * self .difficultyRatio ;
824
+ self .aiData .bunkerRegionDefenseRange = math.max (500 , math.min (750 * self .difficultyRatio , 1000 ));
825
+ self .aiData .attackerLimit = 10 * self .difficultyRatio ;
826
+ self .aiData .attackersPerSpawn = 4 * self .difficultyRatio ;
827
+
828
+ self .aiData .brainDefenderSpawnTimer :SetSimTimeLimitMS (10000 / self .difficultyRatio );
829
+ self .aiData .brainDefenderReplenishTimer :SetSimTimeLimitMS (30000 / self .difficultyRatio );
830
+ self .aiData .brainDefendersTotal = 20 * self .difficultyRatio ;
831
+ self .aiData .brainDefendersRemaining = self .aiData .brainDefendersTotal ;
832
+
833
+ self :SetTeamFunds (0 , self .humanTeam );
834
+
835
+ self :SetTeamTech (self .humanTeam , " -All-" );
836
+ self .humanTeamTech = PresetMan :GetModuleID (self :GetTeamTech (self .humanTeam ));
837
+ self :SetTeamTech (self .aiTeam , " -All-" );
838
+ self .aiTeamTech = PresetMan :GetModuleID (self :GetTeamTech (self .aiTeam ));
839
+
840
+ AudioMan :PlayMusic (" Base.rte/Music/dBSoundworks/bossfight.ogg" , - 1 , - 1 );
841
+
842
+ self .messageTimer :SetSimTimeLimitMS (1 );
843
+
844
+ self .currentStage = self .stages .attackFrontBunker ;
845
+
846
+ self .aiData .internalReinforcementsEnabled = true ;
847
+ self .internalReinforcementsData [self .bunkerIds .frontBunker ].enabled = true ;
848
+
849
+ self .bunkerRegions [" Front Bunker Operations" ].enabled = true ;
850
+ self .bunkerRegions [" Front Bunker Small Vault" ].enabled = true ;
851
+ end
852
+
803
853
function DecisionDay :UpdateCurrentStage ()
804
854
local previousStage = self .currentStage ;
805
855
@@ -939,6 +989,10 @@ function DecisionDay:UpdateCamera()
939
989
CameraMan :SetScrollTarget (Vector (adjustedCameraMinimumX , CameraMan :GetScrollTarget (player ).Y ), 0.25 , false , 0 );
940
990
end
941
991
end
992
+
993
+ if self .speedrunData and ActivitySpeedrunHelper .SpeedrunActive (self .speedrunData ) then
994
+ return ;
995
+ end
942
996
943
997
local slowScroll = 0.0125 ;
944
998
local mediumScroll = 0.05 ;
@@ -1050,6 +1104,12 @@ function DecisionDay:UpdateCamera()
1050
1104
end
1051
1105
1052
1106
function DecisionDay :UpdateMessages ()
1107
+ if self .speedrunData and ActivitySpeedrunHelper .SpeedrunActive (self .speedrunData ) then
1108
+ FrameMan :ClearScreenText (Activity .PLAYER_1 );
1109
+ FrameMan :SetScreenText (ActivitySpeedrunHelper .GetSpeedrunDuration (self .speedrunData ), Activity .PLAYER_1 , 0 , 1 , ActivitySpeedrunHelper .SpeedrunCompleted (self .speedrunData ));
1110
+ return ;
1111
+ end
1112
+
1053
1113
if self .messageTimer :IsPastSimTimeLimit () then
1054
1114
if self .currentMessageNumber < self .numberOfMessagesForStage then
1055
1115
self .currentMessageNumber = self .currentMessageNumber + 1 ;
@@ -2064,6 +2124,14 @@ function DecisionDay:UpdateActivity()
2064
2124
if self .WinnerTeam ~= Activity .NOTEAM then
2065
2125
return ;
2066
2126
end
2127
+
2128
+ if self .speedrunData and not ActivitySpeedrunHelper .SpeedrunActive (self .speedrunData ) then
2129
+ if self .currentStage == self .stages .followInitialDropShip then
2130
+ ActivitySpeedrunHelper .CheckForSpeedrun (self .speedrunData );
2131
+ else
2132
+ self .speedrunData = nil ;
2133
+ end
2134
+ end
2067
2135
2068
2136
if self .currentStage < self .stages .frontBunkerCaptured then
2069
2137
self :SpawnAndUpdateInitialDropShips ();
0 commit comments