diff --git a/Classic/scripts/autoexec/AntiCloak.cs b/Classic/scripts/autoexec/AntiCloak.cs index b2979bc..f404ff8 100644 --- a/Classic/scripts/autoexec/AntiCloak.cs +++ b/Classic/scripts/autoexec/AntiCloak.cs @@ -10,7 +10,7 @@ // // Called in GetCounts.cs -function ActivateAntiCloak( %game ) +function CheckAntiCloak( %game ) { //CTF only if( $Host::AntiCloakEnable && $CurrentMissionType $= "CTF" ) diff --git a/Classic/scripts/autoexec/GetRandomMaps.cs b/Classic/scripts/autoexec/GetRandomMaps.cs index ebe2787..386080c 100644 --- a/Classic/scripts/autoexec/GetRandomMaps.cs +++ b/Classic/scripts/autoexec/GetRandomMaps.cs @@ -145,4 +145,22 @@ function SetNextMapGetRandoms( %client ) $SetNextMissionMapSlot7 = "RampartsDM"; $SetNextMissionMapSlot8 = "ShrineDM"; } -} \ No newline at end of file +} + +// Reset SetNextMission every map change +package ResetSetNextMission +{ + +function DefaultGame::gameOver(%game) +{ + Parent::gameOver(%game); + + //Reset SetNextMission Restore + $SetNextMissionRestore = ""; +} + +}; + +// Prevent package from being activated if it is already +if (!isActivePackage(ResetSetNextMission)) + activatePackage(ResetSetNextMission); \ No newline at end of file diff --git a/Classic/scripts/autoexec/GetTeamCounts.cs b/Classic/scripts/autoexec/GetTeamCounts.cs index cbb6a30..7cbdb8d 100644 --- a/Classic/scripts/autoexec/GetTeamCounts.cs +++ b/Classic/scripts/autoexec/GetTeamCounts.cs @@ -65,10 +65,7 @@ function GetTeamCounts( %game, %client, %respawn ) //Start Team Balance Notify schedule(1000, 0, "TeamBalanceNotify", %game, %team1difference, %team2difference); //Start AntiCloak - schedule(1500, 0, "ActivateAntiCloak", %game); - //Start MapRepetitionChecker - schedule(2000, 0, "MapRepetitionChecker", %game); - + schedule(1500, 0, "CheckAntiCloak", %game); //Set so counter wont run when it doesnt need to. $GetCountsClientTeamChange = false; @@ -79,10 +76,91 @@ function GetTeamCounts( %game, %client, %respawn ) } -// Run at DefaultGame::clientJoinTeam, DefaultGame::clientChangeTeam, DefaultGame::assignClientTeam in evo defaultgame.ovl -// Also Run at DefaultGame::onClientEnterObserverMode, DefaultGame::AIChangeTeam, DefaultGame::onClientLeaveGame, DefaultGame::forceObserver in evo defaultgame.ovl -// And finally GameConnection::onConnect in evo server.ovl +// Triggers a Full run function ResetClientChangedTeams() { $GetCountsClientTeamChange = true; } + +// Proper Overrides +// Events that determine a TeamGetCounts update +package TeamCountsTriggers +{ + +function DefaultGame::clientJoinTeam( %game, %client, %team, %respawn ) +{ + Parent::clientJoinTeam( %game, %client, %team, %respawn ); + + //Trigger GetCounts + ResetClientChangedTeams(); +} + +function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs, %respawned) +{ + Parent::clientChangeTeam(%game, %client, %team, %fromObs, %respawned); + + //Trigger GetCounts + ResetClientChangedTeams(); +} + +function DefaultGame::assignClientTeam(%game, %client, %respawn ) +{ + Parent::assignClientTeam(%game, %client, %respawn ); + + //Trigger GetCounts + ResetClientChangedTeams(); +} + +function DefaultGame::onClientEnterObserverMode( %game, %client ) +{ + Parent::onClientEnterObserverMode( %game, %client ); + + //Trigger GetCounts + ResetClientChangedTeams(); +} + +function DefaultGame::AIChangeTeam(%game, %client, %newTeam) +{ + Parent::AIChangeTeam(%game, %client, %newTeam); + + //Trigger GetCounts + ResetClientChangedTeams(); +} + +function DefaultGame::onClientLeaveGame(%game, %client) +{ + Parent::onClientLeaveGame(%game, %client); + + //Trigger GetCounts + ResetClientChangedTeams(); +} + +function DefaultGame::forceObserver(%game, %client, %reason) +{ + Parent::forceObserver(%game, %client, %reason); + + //Trigger GetCounts + ResetClientChangedTeams(); +} + +function GameConnection::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch) +{ + Parent::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch); + + //Reset GetCounts + ResetClientChangedTeams(); +} + +function DefaultGame::gameOver(%game) +{ + Parent::gameOver(%game); + + //Reset GetCounts + ResetClientChangedTeams(); +} + +}; + +// Prevent package from being activated if it is already +if (!isActivePackage(TeamCountsTriggers)) + activatePackage(TeamCountsTriggers); diff --git a/Classic/scripts/autoexec/NoBaseRapeNotify.cs b/Classic/scripts/autoexec/NoBaseRapeNotify.cs index 6a5e1c8..ba9ea6b 100644 --- a/Classic/scripts/autoexec/NoBaseRapeNotify.cs +++ b/Classic/scripts/autoexec/NoBaseRapeNotify.cs @@ -32,13 +32,6 @@ function NBRStatusNotify( %game ) } } -// This function is at DefaultGame::gameOver(%game) CTFGame.cs -// Resets the client NotifyCount when the mission ends -function ResetNBRNotify() -{ - $NoBaseRapeNotifyCount = -1; -} - // This function is at StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) // In the staticshape.ovl in evoClassic.vl2 // Plays a sound when a player hits a protected asset @@ -61,4 +54,22 @@ function ResetNBRAssetSound( %client ) %client.NBRAssetSoundMsgPlayed = false; } +// Reset every map change +package ResetNoBaseRapeNotify +{ + +function DefaultGame::gameOver(%game) +{ + Parent::gameOver(%game); + + //Reset NoBaseRapeNotify + $NoBaseRapeNotifyCount = -1; +} + +}; + +// Prevent package from being activated if it is already +if (!isActivePackage(ResetNoBaseRapeNotify)) + activatePackage(ResetNoBaseRapeNotify); + diff --git a/Classic/scripts/autoexec/TeamBalanceNotify.cs b/Classic/scripts/autoexec/TeamBalanceNotify.cs index 0a793d6..0561097 100644 --- a/Classic/scripts/autoexec/TeamBalanceNotify.cs +++ b/Classic/scripts/autoexec/TeamBalanceNotify.cs @@ -24,7 +24,7 @@ function TeamBalanceNotify( %game, %team1difference, %team2difference ) { //Reset Balanced. $BalancedMsgPlayed = 0; - + if( %team1difference >= 2 || %team2difference >= 2 ) { if( $UnbalancedMsgPlayed !$= 1) @@ -98,10 +98,28 @@ function UnbalancedSound( %game ) } -//Reset Notify at defaultgame::gameOver in evo defaultgame.ovl +// Reset Notify function ResetTeamBalanceNotifyGameOver() { //Reset All TeamBalance Variables $BalancedMsgPlayed = -1; $UnbalancedMsgPlayed = -1; -} \ No newline at end of file +} + +// Reset every map change +package ResetTeamBalanceNotify +{ + +function DefaultGame::gameOver(%game) +{ + Parent::gameOver(%game); + + //Reset All TeamBalance Variables + ResetTeamBalanceNotifyGameOver(); +} + +}; + +// Prevent package from being activated if it is already +if (!isActivePackage(ResetTeamBalanceNotify)) + activatePackage(ResetTeamBalanceNotify); \ No newline at end of file diff --git a/Classic/scripts/autoexec/VoteOverTime.cs b/Classic/scripts/autoexec/VoteOverTime.cs index ee83c71..eb9fb1a 100644 --- a/Classic/scripts/autoexec/VoteOverTime.cs +++ b/Classic/scripts/autoexec/VoteOverTime.cs @@ -56,6 +56,15 @@ function DefaultGame::checkTimeLimit(%game, %forced) } } +// Reset every map change +function DefaultGame::gameOver(%game) +{ + Parent::gameOver(%game); + + //Reset everything to do with Vote Overtime + ResetVOall(%game); +} + }; function RestartcheckTimeLimit(%game, %forced) diff --git a/Classic/scripts/defaultGame.cs b/Classic/scripts/defaultGame.cs index 4734281..2117eea 100644 --- a/Classic/scripts/defaultGame.cs +++ b/Classic/scripts/defaultGame.cs @@ -1428,9 +1428,6 @@ function DefaultGame::clientJoinTeam( %game, %client, %team, %respawn ) updateCanListenState( %client ); logEcho(%client.nameBase@" (cl "@%client@") joined team "@%client.team); - - //Trigger GetCounts - ResetClientChangedTeams(); } function DefaultGame::AIHasJoined(%game, %client) @@ -1483,9 +1480,6 @@ function DefaultGame::AIChangeTeam(%game, %client, %newTeam) } messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1bot %1 has switched to team %2.', %client.name, %game.getTeamName(%client.team), %client, %client.team ); - - //Trigger GetCounts - ResetClientChangedTeams(); } function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs, %respawned) // z0dd - ZOD, 6/06/02. Don't send a message if player used respawn feature. Added %respawned @@ -1561,9 +1555,6 @@ function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs, %respawn // MES - switch objective hud lines when client switches teams messageClient(%client, 'MsgCheckTeamLines', "", %client.team); logEcho(%client.nameBase@" (cl "@%client@") switched to team "@%client.team); - - //Trigger GetCounts - ResetClientChangedTeams(); } // missioncleanup and missiongroup are checked prior to entering game code @@ -1646,9 +1637,6 @@ function DefaultGame::onClientLeaveGame(%game, %client) //remove them from the team rank arrays %game.removeFromTeamRankArray(%client); logEcho(%client.nameBase@" (cl "@%client@") dropped"); - - //Trigger GetCounts - ResetClientChangedTeams(); } function DefaultGame::clientMissionDropReady(%game, %client) @@ -1780,10 +1768,6 @@ function DefaultGame::testDrop( %game, %client ) function DefaultGame::onClientEnterObserverMode( %game, %client ) { // Default game doesn't care... - - //Trigger GetCounts - ResetClientChangedTeams(); - } // from 'item.cs'