Update AntiPack.cs

Packs can now be choosin' individually
This commit is contained in:
ChocoTaco1 2020-05-29 15:20:30 -04:00
parent bdf5639238
commit e382ec04f2

View file

@ -9,6 +9,11 @@
// $Host::AntiPackPlayerCount = 6; // $Host::AntiPackPlayerCount = 6;
// //
// Choose which packs to limit
$AntiPackIncludeCloak = 1;
$AntiPackIncludeShield = 0;
// Called in GetCounts.cs // Called in GetCounts.cs
function CheckAntiPack( %game ) function CheckAntiPack( %game )
{ {
@ -40,16 +45,26 @@ function CheckAntiPack( %game )
switch$($AntiPackStatus) switch$($AntiPackStatus)
{ {
case ON: case ON:
$InvBanList[CTF, "CloakingPack"] = 1; if($AntiPackIncludeCloak)
$InvBanList[CTF, "ShieldPack"] = 1; {
if(!isActivePackage(AntiPack)) $InvBanList[CTF, "CloakingPack"] = 1;
activatePackage(AntiPack); if(!isActivePackage(AntiPackCloak))
activatePackage(AntiPackCloak);
}
if($AntiPackIncludeShield)
{
$InvBanList[CTF, "ShieldPack"] = 1;
if(!isActivePackage(AntiPackShield))
activatePackage(AntiPackShield);
}
$AntiPackStatus = "ACTIVEON"; $AntiPackStatus = "ACTIVEON";
case OFF: case OFF:
$InvBanList[CTF, "CloakingPack"] = 0; $InvBanList[CTF, "CloakingPack"] = 0;
$InvBanList[CTF, "ShieldPack"] = 0; $InvBanList[CTF, "ShieldPack"] = 0;
if(isActivePackage(AntiPack)) if(isActivePackage(AntiPackCloak))
deactivatePackage(AntiPack); deactivatePackage(AntiPackCloak);
if(isActivePackage(AntiPackShield))
deactivatePackage(AntiPackShield);
$AntiPackStatus = "ACTIVEOFF"; $AntiPackStatus = "ACTIVEOFF";
case ACTIVEON: case ACTIVEON:
//Do Nothing //Do Nothing
@ -59,7 +74,7 @@ function CheckAntiPack( %game )
} }
// So if the player is able to get said pack, he cant use it // So if the player is able to get said pack, he cant use it
package AntiPack package AntiPackCloak
{ {
function CloakingPackImage::onActivate(%data, %obj, %slot) function CloakingPackImage::onActivate(%data, %obj, %slot)
@ -75,6 +90,11 @@ function CloakingPackImage::onActivate(%data, %obj, %slot)
} }
} }
};
package AntiPackShield
{
function ShieldPackImage::onActivate(%data, %obj, %slot) function ShieldPackImage::onActivate(%data, %obj, %slot)
{ {
messageClient(%obj.client, 'MsgShieldPackInvalid', '\c2Shieldpack is disabled until %1 players.', $Host::AntiPackPlayerCount ); messageClient(%obj.client, 'MsgShieldPackInvalid', '\c2Shieldpack is disabled until %1 players.', $Host::AntiPackPlayerCount );