@@ -153,6 +153,8 @@ function DecisionDay:StartActivity(isNewGame)
153
153
bunkerRegionRecaptureWeights [" Main Bunker Air Traffic Control" ] = 8 ;
154
154
155
155
self .bunkerRegions = {};
156
+ self .captureDisplayScreenTemplate = CreateMOSParticle (" Login Screen" , " Missions.rte" );
157
+ self .fauxdanDisplayScreenTemplate = CreateMOSParticle (" Fauxdan Screen" , " Missions.rte" );
156
158
for _ , bunkerRegionName in ipairs (bunkerRegionNames ) do
157
159
self .bunkerRegions [bunkerRegionName ] = {
158
160
enabled = false ,
@@ -161,6 +163,7 @@ function DecisionDay:StartActivity(isNewGame)
161
163
totalArea = scene :GetArea (bunkerRegionName ),
162
164
captureArea = scene :GetArea (bunkerRegionName .. " Capture" ),
163
165
captureDisplayArea = scene :GetArea (bunkerRegionName .. " Capture Display" ),
166
+ captureDisplayScreens = {},
164
167
internalReinforcementsArea = scene :HasArea (bunkerRegionName .. " Internal Reinforcements" ) and scene :GetOptionalArea (bunkerRegionName .. " Internal Reinforcements" ) or nil ,
165
168
defenderArea = scene :GetArea (bunkerRegionName .. " Defenders" ),
166
169
ownerTeam = self .aiTeam ,
@@ -171,17 +174,14 @@ function DecisionDay:StartActivity(isNewGame)
171
174
aiRegionAttackTimer = Timer (90000 / self .difficultyRatio ),
172
175
aiRecaptureWeight = bunkerRegionRecaptureWeights [bunkerRegionName ] or 0 ,
173
176
fauxdanDisplayArea = scene :HasArea (bunkerRegionName .. " Fauxdan Display" ) and scene :GetOptionalArea (bunkerRegionName .. " Fauxdan Display" ) or nil ,
177
+ fauxdanDisplayScreens = {},
174
178
shieldedArea = scene :HasArea (bunkerRegionName .. " Shield" ) and scene :GetOptionalArea (bunkerRegionName .. " Shield" ) or nil ,
175
179
brainDoor = scene :HasArea (bunkerRegionName .. " Brain Door" ) and scene :GetOptionalArea (bunkerRegionName .. " Brain Door" ) or nil ,
176
180
brain = scene :HasArea (bunkerRegionName .. " Shield" ) and scene :GetOptionalArea (bunkerRegionName .. " Brain" ) or nil ,
177
181
};
178
182
if bunkerRegionName :find (" Vault" ) then
179
183
self .bunkerRegions [bunkerRegionName ].incomeMultiplier = bunkerRegionName :find (" Large" ) and 2 or (bunkerRegionName :find (" Medium" ) and 1.5 or 1 );
180
184
end
181
- if self .bunkerRegions [bunkerRegionName ].fauxdanDisplayArea ~= nil then
182
- self .bunkerRegions [bunkerRegionName ].fauxdanDisplayTimer = Timer (250 );
183
- self .bunkerRegions [bunkerRegionName ].fauxdanDisplayCurrentFrame = 0 ;
184
- end
185
185
end
186
186
187
187
self .controlledBunkerRegionComputerTerrainObjects = {
@@ -879,7 +879,6 @@ function DecisionDay:UpdateCamera()
879
879
end
880
880
end
881
881
882
- -- TODO maybe use the camera scroll sounds that come with the game!
883
882
if scrollTargetAndSpeed then
884
883
for _ , player in pairs (self .humanPlayers ) do
885
884
CameraMan :SetScrollTarget (scrollTargetAndSpeed [1 ], scrollTargetAndSpeed [2 ], false , player );
@@ -1079,46 +1078,60 @@ function DecisionDay:UpdateObjectiveArrowsAndRegionVisuals()
1079
1078
1080
1079
for bunkerRegionName , bunkerRegionData in pairs (self .bunkerRegions ) do
1081
1080
if bunkerRegionData .enabled then
1082
- if bunkerRegionData .fauxdanDisplayTimer ~= nil and bunkerRegionData .ownerTeam == self .aiTeam and bunkerRegionData .fauxdanDisplayTimer :IsPastSimTimeLimit () then
1083
- local numberOfFauxdanDisplayFrames = 20 ;
1084
- bunkerRegionData .fauxdanDisplayCurrentFrame = (bunkerRegionData .fauxdanDisplayCurrentFrame + 1 ) % (numberOfFauxdanDisplayFrames + 1 );
1085
- bunkerRegionData .fauxdanDisplayTimer :Reset ();
1086
- end
1087
-
1088
1081
local currentFauxdanDisplayFrameString ;
1089
1082
local currentLoginScreenFrameString ;
1090
1083
for _ , player in pairs (self .humanPlayers ) do
1091
1084
if math.abs ((bunkerRegionData .totalArea .Center - CameraMan :GetScrollTarget (player )).X ) < FrameMan .PlayerScreenWidth * 0.75 then
1092
1085
if bunkerRegionData .fauxdanDisplayArea ~= nil and bunkerRegionData .ownerTeam == self .aiTeam and self .currentStage == self .stages .attackBrain then
1093
- if currentFauxdanDisplayFrameString == nil then
1094
- currentFauxdanDisplayFrameString = " 00" .. tostring (bunkerRegionData .fauxdanDisplayCurrentFrame );
1095
- if currentFauxdanDisplayFrameString :len () > 3 then
1096
- currentFauxdanDisplayFrameString = string.sub (currentFauxdanDisplayFrameString , currentFauxdanDisplayFrameString :len () - 2 );
1086
+ for box in bunkerRegionData .fauxdanDisplayArea .Boxes do
1087
+ local boxCenterPos = box .Center ;
1088
+ local fauxdanDisplayScreenKey = tostring (boxCenterPos .FlooredX ) .. " ," .. tostring (boxCenterPos .FlooredY );
1089
+
1090
+ local boxBlockedByCaptureDisplay = false ;
1091
+ if bunkerRegionData .captureCount > 0 then
1092
+ for captureDisplayBox in bunkerRegionData .captureDisplayArea .Boxes do
1093
+ if captureDisplayBox .Center .Floored == boxCenterPos .Floored then
1094
+ boxBlockedByCaptureDisplay = true ;
1095
+ break ;
1096
+ end
1097
+ end
1098
+ end
1099
+
1100
+ if not boxBlockedByCaptureDisplay and bunkerRegionData .fauxdanDisplayScreens [fauxdanDisplayScreenKey ] == nil then
1101
+ local fauxdanDisplayScreen = self .fauxdanDisplayScreenTemplate :Clone ();
1102
+ fauxdanDisplayScreen .Pos = boxCenterPos ;
1103
+ MovableMan :AddParticle (fauxdanDisplayScreen );
1104
+ bunkerRegionData .fauxdanDisplayScreens [fauxdanDisplayScreenKey ] = fauxdanDisplayScreen ;
1105
+ elseif boxBlockedByCaptureDisplay and bunkerRegionData .fauxdanDisplayScreens [fauxdanDisplayScreenKey ] ~= nil then
1106
+ bunkerRegionData .fauxdanDisplayScreens [fauxdanDisplayScreenKey ].ToDelete = true ;
1107
+ bunkerRegionData .fauxdanDisplayScreens [fauxdanDisplayScreenKey ] = nil ;
1097
1108
end
1098
- currentFauxdanDisplayFrameString = " Missions.rte/Objects/Fauxdan/Fauxdan" .. currentFauxdanDisplayFrameString .. " .png" ;
1099
1109
end
1100
- for box in bunkerRegionData .fauxdanDisplayArea .Boxes do
1101
- PrimitiveMan :DrawBitmapPrimitive (player , SceneMan :SnapPosition (box .Center , true ) + Vector (0 , 6 ), currentFauxdanDisplayFrameString , 0 ); -- Note: the Vector(0, 6) is to account for empty space at the bottom of the sprite.
1110
+ else
1111
+ for _ , fauxdanDisplayScreen in pairs (bunkerRegionData .fauxdanDisplayScreens ) do
1112
+ fauxdanDisplayScreen .ToDelete = true ;
1102
1113
end
1114
+ bunkerRegionData .fauxdanDisplayScreens = {};
1103
1115
end
1116
+
1104
1117
if bunkerRegionData .captureCount > 0 then
1105
- if currentLoginScreenFrameString == nil then
1106
- local numberOfLoginScreenFrames = 21 ;
1107
- currentLoginScreenFrameString = " 00" .. tostring (math.floor ((bunkerRegionData .captureCount / bunkerRegionData .captureLimit ) * numberOfLoginScreenFrames ));
1108
- if currentLoginScreenFrameString :len () > 3 then
1109
- currentLoginScreenFrameString = string.sub (currentLoginScreenFrameString , currentLoginScreenFrameString :len () - 2 );
1118
+ if # bunkerRegionData .captureDisplayScreens == 0 then
1119
+ for box in bunkerRegionData .captureDisplayArea .Boxes do
1120
+ local captureDisplayScreen = self .captureDisplayScreenTemplate :Clone ();
1121
+ captureDisplayScreen .Pos = box .Center ;
1122
+ MovableMan :AddParticle (captureDisplayScreen );
1123
+ bunkerRegionData .captureDisplayScreens [# bunkerRegionData .captureDisplayScreens + 1 ] = captureDisplayScreen ;
1110
1124
end
1111
- currentLoginScreenFrameString = " Missions.rte/Objects/LoginScreen/LoginScreen" .. currentLoginScreenFrameString .. " .png" ;
1112
1125
end
1113
- for box in bunkerRegionData .captureDisplayArea .Boxes do
1114
- PrimitiveMan :DrawBitmapPrimitive (player , SceneMan :SnapPosition (box .Center , true ) + Vector (0 , 6 ), currentLoginScreenFrameString , 0 ); -- Note: the Vector(0, 6) is to account for empty space at the bottom of the sprite.
1126
+ for _ , captureDisplayScreen in ipairs (bunkerRegionData .captureDisplayScreens ) do
1127
+ captureDisplayScreen .Frame = math.floor ((bunkerRegionData .captureCount / bunkerRegionData .captureLimit ) * (captureDisplayScreen .FrameCount ));
1128
+ captureDisplayScreen .Age = 0 ;
1115
1129
end
1130
+ else
1131
+ bunkerRegionData .captureDisplayScreens = {};
1116
1132
end
1117
1133
end
1118
1134
end
1119
- elseif bunkerRegionData .fauxdanDisplayArea ~= nil then
1120
- bunkerRegionData .fauxdanDisplayTimer :Reset ();
1121
- bunkerRegionData .fauxdanDisplayCurrentFrame = 0 ;
1122
1135
end
1123
1136
end
1124
1137
end
@@ -1178,6 +1191,10 @@ function DecisionDay:UpdateRegionCapturing()
1178
1191
if bunkerRegionData .captureCount >= bunkerRegionData .captureLimit then
1179
1192
bunkerRegionData .ownerTeam = capturingTeam ;
1180
1193
bunkerRegionData .captureCount = 0 ;
1194
+
1195
+ for _ , captureDisplayScreen in ipairs (bunkerRegionData .captureDisplayScreens ) do
1196
+ captureDisplayScreen .Lifetime = 2000 ;
1197
+ end
1181
1198
1182
1199
local useLeftReplacementComputer = captureBox .Center .X >= bunkerRegionData .totalArea .Center .X ;
1183
1200
local replacementComputer = self .controlledBunkerRegionComputerTerrainObjects [capturingTeam ][useLeftReplacementComputer and " left" or " right" ]:Clone ();
@@ -1921,8 +1938,6 @@ function DecisionDay:UpdateActivity()
1921
1938
end
1922
1939
end
1923
1940
1924
- -- TODO maybe keep humanTeam actors out of shielded area. Or just rely on super doors
1925
-
1926
1941
if self .currentStage == self .stages .attackBrain then
1927
1942
self :UpdateBrainDefenderSpawning ();
1928
1943
end
0 commit comments