mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-01-20 00:24:49 +00:00
Core update
This commit is contained in:
parent
baa4889aff
commit
d2f38aac33
|
|
@ -18,7 +18,7 @@ $AntiPackIncludeShield = 0;
|
|||
function CheckAntiPack( %game )
|
||||
{
|
||||
//CTF only
|
||||
if( $Host::AntiPackEnable && $CurrentMissionType $= "CTF" && !$Host::TournamentMode )
|
||||
if( $Host::AntiPackEnable )
|
||||
{
|
||||
//echo("TotalTeamPlayerCount " @ $TotalTeamPlayerCount);
|
||||
//echo("AntiPackPlayerCount " @ $AntiPackPlayerCount);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// How far behind littleTeam must be to use All Mode.
|
||||
// Meaning picking from a pool of all players on the bigTeam instead of just the lowest scoring player.
|
||||
// 400 equals 400 points. 4 caps behind.
|
||||
$AllModeThreshold = 400;
|
||||
$AllModeThreshold = 300;
|
||||
|
||||
|
||||
// Run from TeamBalanceNotify.cs via UnbalancedSound( %game )
|
||||
|
|
@ -28,18 +28,13 @@ function Autobalance( %game, %AutobalanceSafetynetTrys )
|
|||
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
|
||||
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
|
||||
|
||||
//If even, stop.
|
||||
if( %team1difference == 1 || %team2difference == 1 || $TeamRank[1, count] == $TeamRank[2, count] )
|
||||
{
|
||||
//Reset TBN
|
||||
ResetTBNStatus();
|
||||
return;
|
||||
}
|
||||
//Determine bigTeam
|
||||
else if( %team1difference >= 2 )
|
||||
if( %team1difference >= 2 )
|
||||
%bigTeam = 1;
|
||||
else if( %team2difference >= 2 )
|
||||
%bigTeam = 2;
|
||||
else
|
||||
return;
|
||||
|
||||
%littleTeam = ( %bigTeam == 1 ) ? 2 : 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -70,12 +70,15 @@ function GetTeamCounts( %game, %client, %respawn )
|
|||
%team1difference = $PlayerCount[1] - $PlayerCount[2];
|
||||
%team2difference = $PlayerCount[2] - $PlayerCount[1];
|
||||
|
||||
//Start Base Rape Notify
|
||||
schedule(500, 0, "NBRStatusNotify", %game);
|
||||
//Start Team Balance Notify
|
||||
schedule(1000, 0, "TeamBalanceNotify", %game, %team1difference, %team2difference);
|
||||
//Start AntiCloak
|
||||
schedule(1500, 0, "CheckAntiPack", %game);
|
||||
if( !$Host::TournamentMode )
|
||||
{
|
||||
if( $CurrentMissionType $= "CTF" )
|
||||
{
|
||||
NBRStatusNotify(%game);
|
||||
CheckAntiPack(%game);
|
||||
}
|
||||
TeamBalanceNotify(%game, %team1difference, %team2difference);
|
||||
}
|
||||
|
||||
//Set so counter wont run when it doesnt need to.
|
||||
$GetCountsStatus = "IDLE";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package NoBaseRape
|
||||
{
|
||||
|
||||
//From Evolution MOD
|
||||
//Modified for our needs
|
||||
// From Evolution MOD
|
||||
// Modified for our needs
|
||||
function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType)
|
||||
{
|
||||
//echo( %targetObject.getDataBlock().getClassName() );
|
||||
|
|
@ -20,8 +20,7 @@ function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %pos
|
|||
{
|
||||
//Notify only if asset is on other team
|
||||
if( %targetObject.team !$= %sourceObject.team )
|
||||
NBRAssetSound( %game, %sourceObject );
|
||||
|
||||
NBRAssetMessage(%sourceObject);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -34,3 +33,18 @@ function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %pos
|
|||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(NoBaseRape))
|
||||
activatePackage(NoBaseRape);
|
||||
|
||||
|
||||
// Message when a player hits a protected enemy asset
|
||||
function NBRAssetMessage(%sourceObject)
|
||||
{
|
||||
if($CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify )
|
||||
{
|
||||
%timeDif = getSimTime() - %sourceObject.NBRTime;
|
||||
if(%timeDif > 10000 || !%sourceObject.NBRTime)
|
||||
{
|
||||
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '\c2No Base Rape is enabled until %1 players.', $Host::NoBaseRapePlayerCount );
|
||||
%sourceObject.NBRTime = getSimTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// Called in GetTeamCounts.cs
|
||||
function NBRStatusNotify( %game )
|
||||
{
|
||||
if( $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::NoBaseRapeEnabled )
|
||||
if( $Host::EnableNoBaseRapeNotify && $Host::NoBaseRapeEnabled )
|
||||
{
|
||||
//On
|
||||
if( $Host::NoBaseRapePlayerCount > $TotalTeamPlayerCount )
|
||||
|
|
@ -59,22 +59,3 @@ if (!isActivePackage(ResetNBRNotify))
|
|||
activatePackage(ResetNBRNotify);
|
||||
|
||||
|
||||
// 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 enemy asset
|
||||
function NBRAssetSound( %game, %sourceObject )
|
||||
{
|
||||
//Wont play again until the schedule is done
|
||||
if(!isEventPending(%sourceObject.NBRAssetSoundSchedule) && $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::NoBaseRapeEnabled )
|
||||
{
|
||||
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '\c2No Base Rape is enabled until %1 players.', $Host::NoBaseRapePlayerCount );
|
||||
%sourceObject.NBRAssetSoundSchedule = schedule(10000, 0, "ResetNBRAssetSound", %sourceObject );
|
||||
}
|
||||
}
|
||||
// Reset
|
||||
function ResetNBRAssetSound( %sourceObject )
|
||||
{
|
||||
if(isEventPending(%sourceObject.NBRAssetSoundSchedule))
|
||||
cancel(%sourceObject.NBRAssetSoundSchedule);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// Called in GetTeamCounts.cs
|
||||
function TeamBalanceNotify( %game, %team1difference, %team2difference )
|
||||
{
|
||||
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 && !$Host::TournamentMode )
|
||||
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 )
|
||||
{
|
||||
//echo ("%Team1Difference " @ %Team1Difference);
|
||||
//echo ("%Team2Difference " @ %Team2Difference);
|
||||
|
|
@ -28,7 +28,7 @@ function TeamBalanceNotify( %game, %team1difference, %team2difference )
|
|||
$TBNStatus = "UNBALANCED";
|
||||
}
|
||||
else
|
||||
//Means teams arnt even, but arnt so uneven to do anything about. Meaning a team is a man down. 6vs7, 4vs3 etc
|
||||
//Man down. 6vs7, 4vs3 etc
|
||||
$TBNStatus = "UNEVEN";
|
||||
}
|
||||
//Teams are even
|
||||
|
|
@ -64,32 +64,14 @@ function NotifyUnbalanced( %game )
|
|||
if(isEventPending($NotifySchedule))
|
||||
cancel($NotifySchedule);
|
||||
|
||||
if( $TBNStatus $= "NOTIFY" ) //If Status has changed to EVEN or anything else.
|
||||
{
|
||||
//Team Count code by Keen
|
||||
$PlayerCount[0] = 0;
|
||||
$PlayerCount[1] = 0;
|
||||
$PlayerCount[2] = 0;
|
||||
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%i);
|
||||
|
||||
//if(!%client.isAIControlled())
|
||||
$PlayerCount[%client.team]++;
|
||||
}
|
||||
if( $TBNStatus !$= "NOTIFY" ) //If Status has changed to EVEN or anything else (GameOver reset).
|
||||
return;
|
||||
|
||||
//Difference Variables
|
||||
%team1difference = $PlayerCount[1] - $PlayerCount[2];
|
||||
%team2difference = $PlayerCount[2] - $PlayerCount[1];
|
||||
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
|
||||
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
|
||||
|
||||
if( %team1difference == 1 || %team2difference == 1 || $PlayerCount[1] == $PlayerCount[2] )
|
||||
{
|
||||
ResetTBNStatus();
|
||||
return;
|
||||
}
|
||||
//Continue
|
||||
else if( %team1difference >= 2 || %team2difference >= 2 )
|
||||
if( %team1difference >= 2 || %team2difference >= 2 )
|
||||
{
|
||||
//Autobalance Warning
|
||||
if( $Host::EnableAutobalance )
|
||||
|
|
@ -105,7 +87,8 @@ function NotifyUnbalanced( %game )
|
|||
schedule(15000, 0, "ResetGetCountsStatus");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
ResetTBNStatus();
|
||||
}
|
||||
|
||||
// Reset TBNStatus
|
||||
|
|
|
|||
Loading…
Reference in a new issue