TacoServer/Classic/scripts/autoexec/NoBaseRapeNotify.cs

76 lines
2.3 KiB
C#
Raw Normal View History

//Enable or Disable
//$Host::EnableNoBaseRapeNotify = 1;
//
2019-02-02 21:33:58 -05:00
2019-02-02 22:36:31 -05:00
//Notifys the user if NoBase rape is on or off.
2018-11-10 19:56:13 -05:00
function NBRStatusNotify( %game, %client, %respawn )
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 )
{
//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-02 21:33:58 -05:00
//Added so you dont get a sound first time every map.
if( $NoBaseRapeNotifyFirst !$= 1)
{
messageAll('MsgNoBaseRapeNotify', '\c1No Base Rape: \c0Enabled.');
$NoBaseRapeNotifyFirst = 1;
}
//Each corresponding time per map will get a sound.
else
messageAll('MsgNoBaseRapeNotify', '\c1No Base Rape: \c0Enabled.~wfx/misc/nexus_cap.wav');
$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');
2019-02-02 22:36:31 -05:00
2018-11-11 01:49:33 -05:00
$NoBaseRapeNotifyCount = 1;
2019-02-02 21:33:58 -05:00
$NoBaseRapeNotifyFirst = 1;
2018-11-11 01:49:33 -05:00
}
2018-11-10 19:56:13 -05:00
}
2018-06-28 14:34:52 -04:00
}
2018-11-10 23:11:00 -05:00
//This function is at DefaultGame::gameOver(%game) CTFGame.cs
//Resets the client NotifyCount when the mission ends
function ResetNBRNotify()
{
$NoBaseRapeNotifyCount = -1;
2019-02-02 22:36:31 -05:00
$NoBaseRapeNotifyFirst = -1;
2018-11-10 23:11:00 -05:00
}
2018-06-28 14:34:52 -04:00
//This function is at StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType)
2018-11-10 19:56:13 -05:00
//In the staticshape.ovl in evoClassic.vl2
2018-06-28 14:34:52 -04:00
//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;
//messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '~wfx/misc/diagnostic_beep.wav');
if( !%client.NBRAssetSoundMsgPlayed )
{
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '\c2No Base Rape is enabled until %1 players.', $Host::EvoNoBaseRapeClassicPlayerCount );
%client.NBRAssetSoundMsgPlayed = true;
//$NBRAssetSoundMsgPlayed = %sourceObject.client.NBRAssetSoundMsgPlayed;
2019-02-01 20:59:37 -05:00
schedule(10000, 0, "ResetNBRAssetSound", %client );
2019-02-01 14:41:09 -05:00
}
}
//Cool down between messeges
function ResetNBRAssetSound( %client )
{
//%sourceObject.client.NBRAssetSoundMsgPlayed = $NBRAssetSoundMsgPlayed;
%client.NBRAssetSoundMsgPlayed = false;
2018-06-28 14:34:52 -04:00
}