Converted ElseIFs to Case

This commit is contained in:
ChocoTaco 2019-03-15 12:39:00 -04:00
parent 944a5901b3
commit 91de1c4a17
2 changed files with 85 additions and 90 deletions

View file

@ -68,84 +68,76 @@ $LCTFRandomMapPick36 = "TWL_OsIris"; $LCTFRandomMapPick37 = "TWL_Damnation";
function SetNextMapGetRandoms( %client ) function SetNextMapGetRandoms( %client )
{ {
switch$($CurrentMissionType)
if( $CurrentMissionType $= "CTF" )
{ {
//Get random numbers case "CTF":
%RandomPick1 = getRandom(1,5); //Get random numbers
%RandomPick2 = getRandom(6,10); %RandomPick1 = getRandom(1,5);
%RandomPick3 = getRandom(11,15); %RandomPick2 = getRandom(6,10);
%RandomPick4 = getRandom(16,20); %RandomPick3 = getRandom(11,15);
%RandomPick5 = getRandom(21,25); %RandomPick4 = getRandom(16,20);
%RandomPick6 = getRandom(26,30); %RandomPick5 = getRandom(21,25);
%RandomPick7 = getRandom(31,35); %RandomPick6 = getRandom(26,30);
%RandomPick8 = getRandom(36,40); %RandomPick7 = getRandom(31,35);
%RandomPick8 = getRandom(36,40);
//Deduction code //Deduction code
$SetNextMissionMapSlot1 = $RandomMapPick[%RandomPick1]; $SetNextMissionMapSlot1 = $RandomMapPick[%RandomPick1];
$SetNextMissionMapSlot2 = $RandomMapPick[%RandomPick2]; $SetNextMissionMapSlot2 = $RandomMapPick[%RandomPick2];
$SetNextMissionMapSlot3 = $RandomMapPick[%RandomPick3]; $SetNextMissionMapSlot3 = $RandomMapPick[%RandomPick3];
$SetNextMissionMapSlot4 = $RandomMapPick[%RandomPick4]; $SetNextMissionMapSlot4 = $RandomMapPick[%RandomPick4];
$SetNextMissionMapSlot5 = $RandomMapPick[%RandomPick5]; $SetNextMissionMapSlot5 = $RandomMapPick[%RandomPick5];
$SetNextMissionMapSlot6 = $RandomMapPick[%RandomPick6]; $SetNextMissionMapSlot6 = $RandomMapPick[%RandomPick6];
$SetNextMissionMapSlot7 = $RandomMapPick[%RandomPick7]; $SetNextMissionMapSlot7 = $RandomMapPick[%RandomPick7];
$SetNextMissionMapSlot8 = $RandomMapPick[%RandomPick8]; $SetNextMissionMapSlot8 = $RandomMapPick[%RandomPick8];
} case "LakRabbit":
else if( $CurrentMissionType $= "LakRabbit" ) //Get random numbers
{ %LakRandomPick1 = getRandom(1,3);
//Get random numbers %LakRandomPick2 = getRandom(4,6);
%LakRandomPick1 = getRandom(1,3); %LakRandomPick3 = getRandom(7,9);
%LakRandomPick2 = getRandom(4,6); %LakRandomPick4 = getRandom(10,12);
%LakRandomPick3 = getRandom(7,9); %LakRandomPick5 = getRandom(13,15);
%LakRandomPick4 = getRandom(10,12); %LakRandomPick6 = getRandom(16,18);
%LakRandomPick5 = getRandom(13,15); %LakRandomPick7 = getRandom(19,21);
%LakRandomPick6 = getRandom(16,18); %LakRandomPick8 = getRandom(22,24);
%LakRandomPick7 = getRandom(19,21);
%LakRandomPick8 = getRandom(22,24);
//Deduction code //Deduction code
$SetNextMissionMapSlot1 = $LakRandomMapPick[%LakRandomPick1]; $SetNextMissionMapSlot1 = $LakRandomMapPick[%LakRandomPick1];
$SetNextMissionMapSlot2 = $LakRandomMapPick[%LakRandomPick2]; $SetNextMissionMapSlot2 = $LakRandomMapPick[%LakRandomPick2];
$SetNextMissionMapSlot3 = $LakRandomMapPick[%LakRandomPick3]; $SetNextMissionMapSlot3 = $LakRandomMapPick[%LakRandomPick3];
$SetNextMissionMapSlot4 = $LakRandomMapPick[%LakRandomPick4]; $SetNextMissionMapSlot4 = $LakRandomMapPick[%LakRandomPick4];
$SetNextMissionMapSlot5 = $LakRandomMapPick[%LakRandomPick5]; $SetNextMissionMapSlot5 = $LakRandomMapPick[%LakRandomPick5];
$SetNextMissionMapSlot6 = $LakRandomMapPick[%LakRandomPick6]; $SetNextMissionMapSlot6 = $LakRandomMapPick[%LakRandomPick6];
$SetNextMissionMapSlot7 = $LakRandomMapPick[%LakRandomPick7]; $SetNextMissionMapSlot7 = $LakRandomMapPick[%LakRandomPick7];
$SetNextMissionMapSlot8 = $LakRandomMapPick[%LakRandomPick8]; $SetNextMissionMapSlot8 = $LakRandomMapPick[%LakRandomPick8];
} case "SCtF":
else if( $CurrentMissionType $= "SCtF" ) //Get random numbers
{ %LCTFRandomPick1 = getRandom(1,5);
//Get random numbers %LCTFRandomPick2 = getRandom(6,10);
%LCTFRandomPick1 = getRandom(1,5); %LCTFRandomPick3 = getRandom(11,15);
%LCTFRandomPick2 = getRandom(6,10); %LCTFRandomPick4 = getRandom(16,20);
%LCTFRandomPick3 = getRandom(11,15); %LCTFRandomPick5 = getRandom(21,25);
%LCTFRandomPick4 = getRandom(16,20); %LCTFRandomPick6 = getRandom(26,30);
%LCTFRandomPick5 = getRandom(21,25); %LCTFRandomPick7 = getRandom(31,35);
%LCTFRandomPick6 = getRandom(26,30); %LCTFRandomPick8 = getRandom(36,40);
%LCTFRandomPick7 = getRandom(31,35);
%LCTFRandomPick8 = getRandom(36,40);
//Deduction code //Deduction code
$SetNextMissionMapSlot1 = $LCTFRandomMapPick[%LCTFRandomPick1]; $SetNextMissionMapSlot1 = $LCTFRandomMapPick[%LCTFRandomPick1];
$SetNextMissionMapSlot2 = $LCTFRandomMapPick[%LCTFRandomPick2]; $SetNextMissionMapSlot2 = $LCTFRandomMapPick[%LCTFRandomPick2];
$SetNextMissionMapSlot3 = $LCTFRandomMapPick[%LCTFRandomPick3]; $SetNextMissionMapSlot3 = $LCTFRandomMapPick[%LCTFRandomPick3];
$SetNextMissionMapSlot4 = $LCTFRandomMapPick[%LCTFRandomPick4]; $SetNextMissionMapSlot4 = $LCTFRandomMapPick[%LCTFRandomPick4];
$SetNextMissionMapSlot5 = $LCTFRandomMapPick[%LCTFRandomPick5]; $SetNextMissionMapSlot5 = $LCTFRandomMapPick[%LCTFRandomPick5];
$SetNextMissionMapSlot6 = $LCTFRandomMapPick[%LCTFRandomPick6]; $SetNextMissionMapSlot6 = $LCTFRandomMapPick[%LCTFRandomPick6];
$SetNextMissionMapSlot7 = $LCTFRandomMapPick[%LCTFRandomPick7]; $SetNextMissionMapSlot7 = $LCTFRandomMapPick[%LCTFRandomPick7];
$SetNextMissionMapSlot8 = $LCTFRandomMapPick[%LCTFRandomPick8]; $SetNextMissionMapSlot8 = $LCTFRandomMapPick[%LCTFRandomPick8];
case "DM":
$SetNextMissionMapSlot1 = "RaspDM";
$SetNextMissionMapSlot2 = "EntombedDM";
$SetNextMissionMapSlot3 = "IceDomeDM";
$SetNextMissionMapSlot4 = "HoofToeDM";
$SetNextMissionMapSlot5 = "ArenaDomeDM";
$SetNextMissionMapSlot6 = "VulcansWrathDM";
$SetNextMissionMapSlot7 = "RampartsDM";
$SetNextMissionMapSlot8 = "ShrineDM";
} }
else if( $CurrentMissionType $= "DM" )
{
$SetNextMissionMapSlot1 = "RaspDM";
$SetNextMissionMapSlot2 = "EntombedDM";
$SetNextMissionMapSlot3 = "IceDomeDM";
$SetNextMissionMapSlot4 = "HoofToeDM";
$SetNextMissionMapSlot5 = "ArenaDomeDM";
$SetNextMissionMapSlot6 = "VulcansWrathDM";
$SetNextMissionMapSlot7 = "RampartsDM";
$SetNextMissionMapSlot8 = "ShrineDM";
}
else
return;
} }

View file

@ -10,22 +10,25 @@ function VoteSound( %game, %typename, %arg1, %arg2, %VoteSoundRandom )
{ {
if( $VoteSoundInProgress && $Host::EnableVoteSound && $VoteSoundRandom $= %VoteSoundRandom ) if( $VoteSoundInProgress && $Host::EnableVoteSound && $VoteSoundRandom $= %VoteSoundRandom )
{ {
if(%typename $= "VoteChangeMission") switch$(%typename)
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")
{ {
if(%arg1 $= "999") %arg1 = "unlimited"; case "VoteChangeMission":
messageAll('', '\c1Vote in Progress: \c0To change the time limit to %1. Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', %arg1 ); 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 );
case "VoteSkipMission":
messageAll('', '\c1Vote in Progress: \c0To skip the mission to %1. Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', $EvoCachedNextMission );
case "VoteChangeTimeLimit":
if(%arg1 $= "999") %arg1 = "unlimited";
messageAll('', '\c1Vote in Progress: \c0To change the time limit to %1. Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', %arg1 );
case "VoteKickPlayer":
messageAll('', '\c1Vote in Progress: \c0To kick player %1. Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', %arg1.name );
case "VoteTournamentMode":
messageAll('', '\c1Vote in Progress: \c0To change the mission to Tournament Mode (%1). Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', %arg1, %arg2 );
} }
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); schedule(12000, 0, "VoteSound", %game, %typename, %arg1, %arg2, %VoteSoundRandom);
} }
else
return;
} }