SNM Fallbacks and VoteSound updates

This commit is contained in:
ChocoTaco 2019-02-20 17:59:45 -05:00
parent 31e21592e9
commit 86b966c9e8
4 changed files with 39 additions and 14 deletions

Binary file not shown.

View file

@ -1,5 +1,9 @@
// Random Set Next Mission maps
//
//Random Set Next Mission maps
//Runs for SetNextMisssion (Random) and Map Repetition Checker
//
//If this file isnt present. Presets are found in defaultGame.ovl in evo.vl2
//Presets are only meant as a fallback.
//Setting $EvoCachedNextMission = ""; can crash the server.
//
//This file is present

View file

@ -2,7 +2,12 @@
//$EvoCachedNextMission = "RoundTheMountain";
//
//$GetRandomMapsLoaded makes sure GetRandomMaps.cs is present
//MapRepetitionChecker can't funtion without it
//$SNMPresetsLoaded makes sure if GetRandomMaps.cs isnt present presets are loaded.
//Presets are in defaultgame.ovl evo
//
//Set up to not run if GetRandomMaps.cs not loaded or Presets not loaded.
//Server can crash if $EvoCachedNextMission = "";
//
//Run in GetTeamCounts.cs
function MapRepetitionChecker( %game )
@ -10,7 +15,7 @@ function MapRepetitionChecker( %game )
//Debug
//%MapRepetitionCheckerDebug = true;
if( $CurrentMissionType $= "CTF" && !$Host::TournamentMode && $MapRepetitionCheckerRunOnce !$= 1 && $GetRandomMapsLoaded )
if( $CurrentMissionType $= "CTF" && !$Host::TournamentMode && $MapRepetitionCheckerRunOnce !$= 1 && ($GetRandomMapsLoaded || $SNMPresetsLoaded))
{
if( $PreviousMission1back $= $EvoCachedNextMission || $PreviousMission2back $= $EvoCachedNextMission || $PreviousMission3back $= $EvoCachedNextMission || $PreviousMission4back $= $EvoCachedNextMission )
MapRepetitionCheckerFindRandom();
@ -38,7 +43,9 @@ function MapRepetitionChecker( %game )
function MapRepetitionCheckerFindRandom()
{
SetNextMapGetRandoms( %client );
if($GetRandomMapsLoaded) //Make sure GetRandomMaps.cs is present
SetNextMapGetRandoms( %client ); //Get Random Set Next Mission maps
%MapCheckerRandom = getRandom(1,6);
$EvoCachedNextMission = $SetNextMissionMapSlot[%MapCheckerRandom];
@ -46,7 +53,10 @@ function MapRepetitionCheckerFindRandom()
if($EvoCachedNextMission $= $PreviousMission1back || $EvoCachedNextMission $= $PreviousMission2back || $EvoCachedNextMission $= $PreviousMission3back || $EvoCachedNextMission $= $PreviousMission4back)
MapRepetitionCheckerFindRandom();
else
{
error(formatTimeString("HH:nn:ss") SPC "Map Repetition Corrected.");
messageAll('MsgNoBaseRapeNotify', '\crMap Repetition Corrected: Next mission set to %1.', $EvoCachedNextMission);
}
}
//Once per match

View file

@ -1,17 +1,28 @@
//Make a sound every so seconds to make sure everyone votes
//
// Enable or Disable VoteSound
// $Host::EnableVoteSound = 1;
//Enable or Disable VoteSound
//$Host::EnableVoteSound = 1;
//
//%VotesoundRandom must match $VoteSoundRandom to prevent duplicate messages
//$VoteSoundRandom is generated everytime a vote starts and if it doesnt match an ongoing schedule does not play.
function VoteSound( %game )
{
if( $VoteSoundInProgress && $Host::EnableVoteSound )
function VoteSound( %game, %typename, %arg1, %arg2, %VoteSoundRandom )
{
if( $VoteSoundInProgress && $Host::EnableVoteSound && $VoteSoundRandom $= %VoteSoundRandom )
{
messageAll('', '\c1Vote in Progress: \c0Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', %display);
schedule(12000, 0, "VoteSound", %game);
if(%typename $= "VoteChangeMission")
messageAll('', '\c1Vote in Progress: \c0To change the mission to %1 (%2). Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', %arg1, %arg2 );
else if(%typename $= "VoteSkipMission")
messageAll('', '\c1Vote in Progress: \c0To skip the mission to %1. Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', $EvoCachedNextMission );
else if(%typename $= "VoteChangeTimeLimit")
messageAll('', '\c1Vote in Progress: \c0To change the time limit to %1. Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', %arg1 );
else if(%typename $= "VoteKickPlayer")
messageAll('', '\c1Vote in Progress: \c0To kick player %1. Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', %arg1.name );
else
messageAll('', '\c1Vote in Progress: \c0Press Insert for Yes or Delete for No.~wgui/objective_notification.wav');
schedule(12000, 0, "VoteSound", %game, %typename, %arg1, %arg2, %VoteSoundRandom);
}
else
return;
}