Switched to true/false

This commit is contained in:
ChocoTaco 2018-11-10 23:11:00 -05:00
parent 7755d719e2
commit 008f7789cc
2 changed files with 24 additions and 24 deletions

View file

@ -10,20 +10,27 @@ function NBRStatusNotify( %game, %client, %respawn )
//echo ("$TeamBalanceClient " @ $TeamBalanceClient); //echo ("$TeamBalanceClient " @ $TeamBalanceClient);
//On //On
if( !$Host::TournamentMode && $Host::EvoNoBaseRapeEnabled && $Host::EvoNoBaseRapeClassicPlayerCount > $TotalTeamPlayerCount && $NoBaseRapeNotifyCount !$= 0 ) if( !$Host::TournamentMode && $Host::EvoNoBaseRapeEnabled && $Host::EvoNoBaseRapeClassicPlayerCount > $TotalTeamPlayerCount && $NoBaseRapeNotifyCount )
{ {
messageAll('MsgNoBaseRapeNotify', 'No Base Rape is \c1Enabled.~wfx/misc/nexus_cap.wav'); messageAll('MsgNoBaseRapeNotify', 'No Base Rape is \c1Enabled.~wfx/misc/nexus_cap.wav');
$NoBaseRapeNotifyCount = 0; $NoBaseRapeNotifyCount = false;
} }
//Off //Off
else if( $NoBaseRapeNotifyCount !$= 1 ) else if( !$NoBaseRapeNotifyCount )
{ {
messageAll('MsgNoBaseRapeNotify', 'No Base Rape is \c1Disabled.~wfx/misc/diagnostic_on.wav'); messageAll('MsgNoBaseRapeNotify', 'No Base Rape is \c1Disabled.~wfx/misc/diagnostic_on.wav');
$NoBaseRapeNotifyCount = 1; $NoBaseRapeNotifyCount = true;
} }
} }
} }
//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) //This function is at StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType)
//In the staticshape.ovl in evoClassic.vl2 //In the staticshape.ovl in evoClassic.vl2
//Plays a sound when a player hits a protected asset //Plays a sound when a player hits a protected asset
@ -32,11 +39,4 @@ function NBRAssetSound( %game, %sourceObject )
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '~wfx/misc/diagnostic_beep.wav'); messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '~wfx/misc/diagnostic_beep.wav');
} }
//This function is at DefaultGame::gameOver(%game) CTFGame.cs
//Resets the client NotifyCount when the mission ends
function ResetNBRNotify()
{
$NoBaseRapeNotifyCount = -1;
}

View file

@ -19,36 +19,36 @@ function TeamBalanceNotify::AtSpawn( %game, %client, %respawn )
if( $PlayerCount[1] !$= $PlayerCount[2] ) if( $PlayerCount[1] !$= $PlayerCount[2] )
{ {
//Uneven. Reset Balanced. //Uneven. Reset Balanced.
$BalancedMsgPlayed = 0; $BalancedMsgPlayed = false;
if( %Team1Difference >= 2 || %Team2Difference >= 2 ) if( %Team1Difference >= 2 || %Team2Difference >= 2 )
{ {
if( $UnbalancedMsgPlayed !$= 1 && %Team2Difference == 2 || %Team1Difference == 2 ) if( !$UnbalancedMsgPlayed && %Team2Difference == 2 || %Team1Difference == 2 )
{ {
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced.'); messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced.');
//Once per cycle //Once per cycle.
$UnbalancedMsgPlayed = 1; $UnbalancedMsgPlayed = true;
//Reset Stats. //Reset Stats.
$StatsMsgPlayed = 0; $StatsMsgPlayed = false;
} }
//Stats Aspect. 3 or more difference gets a stats notify. //Stats Aspect. 3 or more difference gets a stats notify.
else if( $StatsMsgPlayed !$= 1 ) else if( !$StatsMsgPlayed )
{ {
messageAll('MsgTeamBalanceNotify', '\c1It is currently %1 vs %2 with %3 observers.', $PlayerCount[1], $PlayerCount[2], $PlayerCount[0] ); messageAll('MsgTeamBalanceNotify', '\c1It is currently %1 vs %2 with %3 observers.', $PlayerCount[1], $PlayerCount[2], $PlayerCount[0] );
$StatsMsgPlayed = 1; $StatsMsgPlayed = true;
} }
} }
} }
//If teams are balanced and teams dont equal 0. //If teams are balanced and teams dont equal 0.
else if( $PlayerCount[1] == $PlayerCount[2] && $TotalTeamPlayerCount !$= 0 && $BalancedMsgPlayed !$= 1 ) else if( $PlayerCount[1] == $PlayerCount[2] && $TotalTeamPlayerCount !$= 0 && !$BalancedMsgPlayed )
{ {
messageAll('MsgTeamBalanceNotify', '\c1Teams are balanced.'); messageAll('MsgTeamBalanceNotify', '\c1Teams are balanced.');
//Once per cycle. //Once per cycle.
$BalancedMsgPlayed = 1; $BalancedMsgPlayed = true;
//Reset unbalanced. //Reset unbalanced.
$UnbalancedMsgPlayed = 0; $UnbalancedMsgPlayed = false;
//Reset Stats. //Reset Stats.
$StatsMsgPlayed = 0; $StatsMsgPlayed = false;
} }
} }
} }
@ -57,8 +57,8 @@ function TeamBalanceNotify::AtSpawn( %game, %client, %respawn )
//Allows for another unbalanced notification everytime the flag is capped. //Allows for another unbalanced notification everytime the flag is capped.
function ResetUnbalancedNotifyPerCap() function ResetUnbalancedNotifyPerCap()
{ {
$UnbalancedMsgPlayed = 0; $UnbalancedMsgPlayed = false;
$StatsMsgPlayed = 0; $StatsMsgPlayed = false;
} }
//Reset Notify at defaultgame::gameOver in evo defaultgame.ovl //Reset Notify at defaultgame::gameOver in evo defaultgame.ovl