Skip to content

Commit c7066d4

Browse files
committed
Wipeout announcements and overlay showing
1 parent e3491db commit c7066d4

File tree

2 files changed

+59
-5
lines changed

2 files changed

+59
-5
lines changed

scripts/vscripts/tf2ware_ultimate/main.nut

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ function Ware_StartMinigameInternal(is_boss)
13991399
Ware_CriticalZone = true
14001400

14011401
local valid_players = Ware_GetValidPlayers(is_boss)
1402-
1402+
14031403
Ware_MinigameScope.clear()
14041404

14051405
local player_count = valid_players.len()
@@ -1847,7 +1847,7 @@ function Ware_FinishMinigameInternal()
18471847
}
18481848
else
18491849
{
1850-
passed = false
1850+
passed = true
18511851
}
18521852

18531853
if (all_passed)
@@ -1873,7 +1873,8 @@ function Ware_FinishMinigameInternal()
18731873

18741874
Ware_ShowMinigameText(player, "")
18751875
Ware_PlayGameSound(player, sound)
1876-
Ware_ShowScreenOverlay(player, overlay)
1876+
if (participated && !all_passed && !all_failed)
1877+
Ware_ShowScreenOverlay(player, overlay)
18771878
if (Ware_MinigameOverlay2Set)
18781879
Ware_ShowScreenOverlay2(player, null)
18791880

scripts/vscripts/tf2ware_ultimate/specialrounds/wipeout.nut

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,59 @@ function OnMinigameEnd()
262262
local lives = Ware_GetPlayerSpecialRoundData(player).lives
263263
if(lives > 0)
264264
player.RemoveCond(TF_COND_HALLOWEEN_GHOST_MODE)
265-
265+
266266
player.SetMoveType(MOVETYPE_WALK, 0)
267267
player.SetCollisionGroup(COLLISION_GROUP_PUSHAWAY)
268268
player.RemoveCond(TF_COND_HALLOWEEN_KART)
269269
}
270270
Ware_MinigameHomeLocation.Teleport(Wipeout_Spectators)
271+
272+
AnnounceKnockouts()
271273
}
272274

275+
276+
function AnnounceKnockouts()
277+
{
278+
local knocked_out = 0
279+
280+
foreach (data in Ware_PlayersData)
281+
{
282+
local player = data.player
283+
local idx = Wipeout_ValidPlayers.find(player)
284+
if (idx == null)
285+
continue
286+
287+
local lives = Ware_GetPlayerSpecialRoundData(player).lives
288+
if (lives <= 0)
289+
{
290+
knocked_out++
291+
Ware_ChatPrint(null, "{player}{color} has been {color}wiped out!", player, "9AB973", COLOR_GREEN);
292+
293+
Wipeout_ValidPlayers.remove(idx)
294+
if (player.IsAlive())
295+
Ware_SuicidePlayer(player)
296+
}
297+
}
298+
299+
local players_len = Wipeout_GetAlivePlayers().len()
300+
301+
if (knocked_out > 0)
302+
{
303+
Ware_ChatPrint(null, "{int} {str} been knocked out! There are {int} {str} still standing.",
304+
knocked_out,
305+
knocked_out > 1 ? "players have" : "player has",
306+
players_len,
307+
players_len == 1 ? "player" : "players")
308+
}
309+
//else
310+
//{
311+
// Ware_ChatPrint(null, "No one has been knocked out! There are {int} {str} still standing.",
312+
// players_len,
313+
// players_len == 1 ? "player" : "players")
314+
//}
315+
}
316+
317+
273318
function OnDeclareWinners(top_players, top_score, winner_count)
274319
{
275320
if (winner_count > 1)
@@ -287,4 +332,12 @@ function OnDeclareWinners(top_players, top_score, winner_count)
287332
{
288333
Ware_ChatPrint(null, "{color}Nobody won!?", TF_COLOR_DEFAULT)
289334
}
290-
}
335+
}
336+
337+
function OnEnd()
338+
{
339+
foreach(player in Ware_Players)
340+
{
341+
player.RemoveCond(TF_COND_HALLOWEEN_GHOST_MODE)
342+
}
343+
}

0 commit comments

Comments
 (0)