2019-09-13 15:34:03 -04:00
|
|
|
// No Base Rape Notify Script
|
|
|
|
|
//
|
|
|
|
|
// Notifys clients if NoBase rape is on or off.
|
|
|
|
|
//
|
|
|
|
|
// Enable or Disable
|
|
|
|
|
// $Host::EnableNoBaseRapeNotify = 1;
|
2018-11-04 16:59:10 -05:00
|
|
|
//
|
2019-02-02 21:33:58 -05:00
|
|
|
|
2019-09-13 15:34:03 -04:00
|
|
|
// Called in GetTeamCounts.cs
|
2019-02-03 02:35:09 -05:00
|
|
|
function NBRStatusNotify( %game )
|
2018-06-28 14:34:52 -04:00
|
|
|
{
|
2018-11-11 01:38:18 -05:00
|
|
|
if( $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::EvoNoBaseRapeEnabled )
|
2018-11-04 16:59:10 -05:00
|
|
|
{
|
|
|
|
|
//echo ("%client " @ %client);
|
|
|
|
|
//echo ("$TeamBalanceClient " @ $TeamBalanceClient);
|
2018-11-10 19:56:13 -05:00
|
|
|
|
|
|
|
|
//On
|
2018-11-11 01:38:18 -05:00
|
|
|
if( $Host::EvoNoBaseRapeClassicPlayerCount > $TotalTeamPlayerCount )
|
2018-11-10 19:56:13 -05:00
|
|
|
{
|
2018-11-11 01:38:18 -05:00
|
|
|
if( $NoBaseRapeNotifyCount !$= 0 )
|
|
|
|
|
{
|
2019-02-03 02:35:09 -05:00
|
|
|
messageAll('MsgNoBaseRapeNotify', '\c1No Base Rape: \c0Enabled.');
|
2019-02-02 21:33:58 -05:00
|
|
|
$NoBaseRapeNotifyCount = 0;
|
2018-11-11 01:38:18 -05:00
|
|
|
}
|
2018-06-28 14:34:52 -04:00
|
|
|
}
|
2018-11-10 19:56:13 -05:00
|
|
|
//Off
|
2018-11-11 01:38:18 -05:00
|
|
|
else if( $NoBaseRapeNotifyCount !$= 1 )
|
2018-11-11 01:49:33 -05:00
|
|
|
{
|
2019-01-03 15:48:55 -05:00
|
|
|
messageAll('MsgNoBaseRapeNotify', '\c1No Base Rape: \c0Disabled.~wfx/misc/diagnostic_on.wav');
|
2018-11-11 01:49:33 -05:00
|
|
|
$NoBaseRapeNotifyCount = 1;
|
|
|
|
|
}
|
2018-11-10 19:56:13 -05:00
|
|
|
}
|
2018-06-28 14:34:52 -04:00
|
|
|
}
|
|
|
|
|
|
2019-09-13 15:34:03 -04:00
|
|
|
// 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
|
2018-11-10 19:56:13 -05:00
|
|
|
function NBRAssetSound( %game, %sourceObject )
|
2018-06-28 14:34:52 -04:00
|
|
|
{
|
2019-02-01 14:41:09 -05:00
|
|
|
%client = %sourceObject;
|
|
|
|
|
|
2019-02-03 18:00:37 -05:00
|
|
|
if( !%client.NBRAssetSoundMsgPlayed && $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::EvoNoBaseRapeEnabled )
|
2019-02-01 14:41:09 -05:00
|
|
|
{
|
|
|
|
|
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '\c2No Base Rape is enabled until %1 players.', $Host::EvoNoBaseRapeClassicPlayerCount );
|
|
|
|
|
|
|
|
|
|
%client.NBRAssetSoundMsgPlayed = true;
|
2019-02-01 20:59:37 -05:00
|
|
|
schedule(10000, 0, "ResetNBRAssetSound", %client );
|
2019-02-01 14:41:09 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-13 15:34:03 -04:00
|
|
|
// Cool down between messages
|
2019-02-01 14:41:09 -05:00
|
|
|
function ResetNBRAssetSound( %client )
|
|
|
|
|
{
|
|
|
|
|
%client.NBRAssetSoundMsgPlayed = false;
|
2018-06-28 14:34:52 -04:00
|
|
|
}
|
|
|
|
|
|
2019-10-06 16:30:41 -04:00
|
|
|
// 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);
|
|
|
|
|
|
2018-06-28 14:34:52 -04:00
|
|
|
|