2019-09-13 19:34:03 +00:00
|
|
|
// No Base Rape Notify Script
|
|
|
|
|
//
|
|
|
|
|
// Notifys clients if NoBase rape is on or off.
|
|
|
|
|
//
|
|
|
|
|
// Enable or Disable
|
|
|
|
|
// $Host::EnableNoBaseRapeNotify = 1;
|
2018-11-04 21:59:10 +00:00
|
|
|
//
|
2019-02-03 02:33:58 +00:00
|
|
|
|
2019-09-13 19:34:03 +00:00
|
|
|
// Called in GetTeamCounts.cs
|
2019-02-03 07:35:09 +00:00
|
|
|
function NBRStatusNotify( %game )
|
2018-06-28 18:34:52 +00:00
|
|
|
{
|
2020-08-18 17:58:49 +00:00
|
|
|
if( $Host::EnableNoBaseRapeNotify && $Host::NoBaseRapeEnabled )
|
2019-12-11 21:30:37 +00:00
|
|
|
{
|
2018-11-11 00:56:13 +00:00
|
|
|
//On
|
2020-03-23 20:23:42 +00:00
|
|
|
if( $Host::NoBaseRapePlayerCount > $TotalTeamPlayerCount )
|
2018-11-11 00:56:13 +00:00
|
|
|
{
|
2019-12-11 21:30:37 +00:00
|
|
|
if( $NBRStatus !$= "PLAYEDON" )
|
|
|
|
|
$NBRStatus = "ON";
|
2018-06-28 18:34:52 +00:00
|
|
|
}
|
2018-11-11 00:56:13 +00:00
|
|
|
//Off
|
2019-12-11 21:30:37 +00:00
|
|
|
else
|
2018-11-11 06:49:33 +00:00
|
|
|
{
|
2019-12-11 21:30:37 +00:00
|
|
|
if( $NBRStatus !$= "PLAYEDOFF" )
|
|
|
|
|
$NBRStatus = "OFF";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch$($NBRStatus)
|
|
|
|
|
{
|
|
|
|
|
case ON:
|
|
|
|
|
messageAll('MsgNoBaseRapeNotify', '\c1No Base Rape: \c0Enabled.');
|
|
|
|
|
$NBRStatus = "PLAYEDON";
|
|
|
|
|
case OFF:
|
|
|
|
|
messageAll('MsgNoBaseRapeNotify', '\c1No Base Rape: \c0Disabled.~wfx/misc/diagnostic_on.wav');
|
|
|
|
|
$NBRStatus = "PLAYEDOFF";
|
|
|
|
|
case PLAYEDON:
|
|
|
|
|
//Do Nothing
|
|
|
|
|
case PLAYEDOFF:
|
|
|
|
|
//Do Nothing
|
2018-11-11 06:49:33 +00:00
|
|
|
}
|
2018-11-11 00:56:13 +00:00
|
|
|
}
|
2018-06-28 18:34:52 +00:00
|
|
|
}
|
|
|
|
|
|
2019-12-11 21:30:37 +00:00
|
|
|
// Reset gameover
|
|
|
|
|
package ResetNBRNotify
|
2019-10-06 20:30:41 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
function DefaultGame::gameOver(%game)
|
|
|
|
|
{
|
|
|
|
|
Parent::gameOver(%game);
|
|
|
|
|
|
|
|
|
|
//Reset NoBaseRapeNotify
|
2019-12-11 21:30:37 +00:00
|
|
|
$NBRStatus = "IDLE";
|
2019-10-06 20:30:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Prevent package from being activated if it is already
|
2019-12-11 21:30:37 +00:00
|
|
|
if (!isActivePackage(ResetNBRNotify))
|
|
|
|
|
activatePackage(ResetNBRNotify);
|
|
|
|
|
|
|
|
|
|
|