From 90e191ddd92474e5e9cdc4bd2f7f14172134c693 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 9 Jul 2022 13:35:05 -0400 Subject: [PATCH] Rewrite Was a mess --- .../scripts/autoexec/MissionTypeOptions.cs | 57 ++++++++++--------- Classic/scripts/autoexec/VoteMenu.cs | 11 ++-- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/Classic/scripts/autoexec/MissionTypeOptions.cs b/Classic/scripts/autoexec/MissionTypeOptions.cs index fb5a38d..489eb7f 100644 --- a/Classic/scripts/autoexec/MissionTypeOptions.cs +++ b/Classic/scripts/autoexec/MissionTypeOptions.cs @@ -16,51 +16,53 @@ // Message Content // $Host::MapChangeMSGContent = "Pickup Night\nSaturday, March 5th\nJoin discord for details"; +//exec("scripts/autoexec/missiontypeoptions.cs"); package MissionTypeOptions { function loadMissionStage2() { - switch$($Host::PUGpasswordAlwaysOn) + //Disable Tournament Mode for Lak + if($CurrentMissionType $= "Lakrabbit" || $CurrentMissionType $= "DM" || $CurrentMissionType $= "PracticeCTF") { - case 0: - if($CurrentMissionType !$= "LakRabbit") - { - if($Host::TournamentMode && $Host::PUGautoPassword) - $Host::Password = $Host::PUGPassword; - - //Set server mode to SPEED - $Host::HiVisibility = 0; - } - else if($CurrentMissionType $= "LakRabbit") - { - if($Host::TournamentMode) - $Host::TournamentMode = 0; - - //Set server mode to DISTANCE - $Host::HiVisibility = 1; - } - case 1: - $Host::Password = $Host::PUGPassword; - $Host::HiVisibility = 0; //always SPEED + if($Host::TournamentMode) + $Host::TournamentMode = 0; } + //PUGpassword + if($Host::PUGpasswordAlwaysOn) //ON + $Host::Password = $Host::PUGPassword; + + //Set Visibility + if($CurrentMissionType $= "Lakrabbit") + { + //Set server mode to DISTANCE + $Host::HiVisibility = 1; //Lakrabbit or Other + } + else //Set server mode to SPEED for CTF/SCTF/Anything Else + $Host::HiVisibility = 0; + + //Tournament Mode specifics if($Host::TournamentMode) $Host::TimeLimit = 30; //TimeLimit Always 30 minutes in Tourney Mode else { - //Disable everything - if($Host::Password !$= "") - $Host::Password = ""; + //Disable if active if($LockedTeams) $LockedTeams = 0; + if(isActivePackage(LockedTeams) && !$LockedTeams) + deactivatePackage(LockedTeams); + + //Disable if active + if($Host::Password !$= "" && !$Host::PUGpasswordAlwaysOn) //No Password + $Host::Password = ""; + + //Disable if active if($RestrictedVoting) $RestrictedVoting = 0; if($Host::AllowAdmin2Admin) $Host::AllowAdmin2Admin = 0; } - if(isActivePackage(LockedTeams) && !$LockedTeams) - deactivatePackage(LockedTeams); //Siege NoBaseRape Fix if($CurrentMissionType $= "Siege") @@ -73,6 +75,9 @@ function loadMissionStage2() //Map Change Center Print. Used to advertise upcoming events if($Host::MapChangeMSG) centerPrintAll($Host::MapChangeMSGContent, 12, 3); + + //Set random seed + setRandomSeed(getrandom(1,1000)); } }; diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 08fb656..8ccafec 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -198,10 +198,13 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) //PUG Password if(%client.isAdmin && $Host::TournamentMode) { - if($Host::Password !$= "") - messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Disable PUG Password', 'Disable PUG Password'); - else - messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Enable PUG Password', 'Enable PUG Password'); + if(!$Host::PUGpasswordAlwaysOn) //Password is already set + { + if($Host::Password !$= "") + messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Disable PUG Password', 'Disable PUG Password'); + else + messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Enable PUG Password', 'Enable PUG Password'); + } } //Locked Teams if(%client.isAdmin && $Host::TournamentMode)