#include "zcommon.acs"
#library "global"

#DEFINE MEGABUSTER 0
#DEFINE BUBBLELEAD 1
#DEFINE LEAFSHIELD 2
#DEFINE ATOMICFIRE 3
#DEFINE SHADOWBLADE 4
#DEFINE NAPALMBOMB 5
#DEFINE AIRSHOOTER 6
#DEFINE HYPERBOMB 7
#DEFINE MAGNETMISSILE 8
#DEFINE TOPSPIN 9
#DEFINE NEEDLECANNON 10
#DEFINE GEMINILASER 11
#DEFINE SEARCHSNAKE 12
#DEFINE TIMESTOPPER 13
#DEFINE SUPERARM 14
#DEFINE ICESLASHER 15
#DEFINE THUNDERBEAM 16
#DEFINE METALBLADE 17
#DEFINE HARDKNUCKLE 18
#DEFINE DRILLBOMB 19
#DEFINE BLIZZARDATTACK 20
#DEFINE FIRESTORM 21
#DEFINE QUICKBOOMERANG 22
#DEFINE CRASHBOMB 23
#DEFINE CHARGEKICK 24
#DEFINE ROLLINGCUTTER 25
#DEFINE SPARKSHOCK 26
#DEFINE RINGBOOMERANG 27
#DEFINE GYROATTACK 28
#DEFINE POWERSTONE 29
#DEFINE DUSTCRUSHER 30
#DEFINE PHARAOHSHOT 31
#DEFINE WATERWAVE 32
#DEFINE CRYSTALEYE 33
#DEFINE SKULLBARRIER 34
#DEFINE FLAMEBLAST 35
#DEFINE PROTOBUSTER 36
#DEFINE YAMATOSPEAR 37
#DEFINE DIVEMISSILE 38
#DEFINE PLANTBARRIER 39
#DEFINE SILVERTOMAHAWK 40
#DEFINE WINDSTORM 41
#DEFINE KNIGHTCRUSH 42
#DEFINE STARCRASH 43
#DEFINE RAINFLUSH 44
#DEFINE SAKUGARNE 45
#DEFINE BASSBUSTER 46
#DEFINE BALLADECRACKER 47
#DEFINE SCREWCRUSHER 48
#DEFINE FLASHSTOPPER 49
#DEFINE GRAVITYHOLD 50
#DEFINE CENTAURFLASH 51
#DEFINE MIRRORBUSTER 52

#DEFINE BALLADEREAL 53

#DEFINE ATOMICFIRECRG1 60
#DEFINE ATOMICFIRECRG2 61
#DEFINE ATOMICFIRECRG3 62

#DEFINE PROTOCHARGE1 63
#DEFINE PROTOCHARGE2 64

#DEFINE ENKERCHARGE1 65
#DEFINE ENKERCHARGE2 66

#DEFINE METALMANREAL 67

#DEFINE BOSSPAIN 68

int timestop=0;

Script 999 (int fade)
{
if(fade==0){
FadeTo(0,0,0,0.0,0.0);
}
if(fade==1){
FadeTo(0,255,0,0.3,0.0);
}
}

script 998 (int weap)
{
LocalAmbientSound("menu/cursor",127);
if(GetCvar("teamplay")==1){terminate;}
if(GetCvar("teamlms")==1){terminate;}
if(GetCvar("ctf")==1){terminate;}
if(GetCvar("oneflagctf")==1){terminate;}
Thing_SetTranslation(0, weap);
}

script 997 ENTER
{
if(timestop==1){
SetPlayerProperty(0,1,4);
}
if(GetCvar("instagib")==1){
TakeInventory("MegaBuster",1);
GiveInventory("IGMetalBladeWep",1);
}
if(PlayerIsBot(PlayerNumber())){
GiveInventory("MonsterBlock",1);
}
if(PlayerTeam()==1){
Thing_SetTranslation(0, SCREWCRUSHER);
}
Thing_ChangeTID(0,PlayerNumber()+1000);
HudMessage(s:""; HUDMSG_PLAIN,50,CR_UNTRANSLATED,0.0,0.0,0.1);
}

script 996 RESPAWN
{
HudMessage(s:""; HUDMSG_PLAIN,50,CR_UNTRANSLATED,0.0,0.0,0.1);
if(timestop==1){
SetPlayerProperty(0,1,4);
}
if(GetCvar("instagib")==1){
TakeInventory("MegaBuster",1);
GiveInventory("IGMetalBladeWep",1);
}
if(PlayerIsBot(PlayerNumber())){
GiveInventory("MonsterBlock",1);
}
Thing_ChangeTID(0,PlayerNumber()+1000);
if(PlayerTeam()==1){
Thing_SetTranslation(0, SCREWCRUSHER);
}
}

script 995 OPEN
{
CreateTranslation (BUBBLELEAD, 192:192=4:4, 198:198=96:96);
CreateTranslation (LEAFSHIELD, 192:192=4:4, 198:198=114:114);
CreateTranslation (ATOMICFIRE, 192:192=217:217, 198:198=176:176);
CreateTranslation (ATOMICFIRECRG1, 192:192=217:217, 198:198=176:176, 0:2=196:196, 3:8=196:196, 243:247=196:196);
CreateTranslation (ATOMICFIRECRG2, 192:192=217:217, 198:198=194:194, 0:2=217:217, 3:8=217:217, 243:247=217:217);
CreateTranslation (ATOMICFIRECRG3, 192:192=217:217, 198:198=4:4, 0:2=4:4, 3:8=4:4, 243:247=4:4);
CreateTranslation (SHADOWBLADE, 192:192=250:250, 198:198=252:252);
CreateTranslation (NAPALMBOMB, 192:192=217:217, 198:198=201:201);
CreateTranslation (AIRSHOOTER, 192:192=4:4);
CreateTranslation (HYPERBOMB, 192:192=4:4, 198:198=112:112);
CreateTranslation (MAGNETMISSILE, 192:192=96:96, 198:198=176:176);
CreateTranslation (TOPSPIN, 192:192=210:210, 198:198=96:96);
CreateTranslation (NEEDLECANNON, 192:192=4:4, 198:198=218:218);
CreateTranslation (GEMINILASER, 192:192=4:4);
CreateTranslation (SEARCHSNAKE, 192:192=4:4, 198:198=114:114);
CreateTranslation (TIMESTOPPER, 192:192=250:250, 198:198=252:252);
CreateTranslation (SUPERARM, 192:192=4:4, 198:198=218:218);
CreateTranslation (ICESLASHER, 192:192=4:4);
CreateTranslation (THUNDERBEAM, 192:192=249:249, 198:198=96:96);
CreateTranslation (METALBLADE, 192:192=210:210, 198:198=164:164);
CreateTranslation (HARDKNUCKLE, 192:192=88:88, 198:198=200:200);
CreateTranslation (DRILLBOMB, 192:192=96:96, 198:198=176:176);
CreateTranslation (BLIZZARDATTACK, 192:192=4:4);
CreateTranslation (FIRESTORM, 192:192=217:217, 198:198=176:176);
CreateTranslation (QUICKBOOMERANG, 192:192=170:170, 198:198=173:173);
CreateTranslation (CRASHBOMB, 192:192=4:4, 198:198=172:172);
CreateTranslation (CHARGEKICK, 192:192=4:4, 198:198=172:172);
CreateTranslation (ROLLINGCUTTER, 192:192=4:4, 198:198=96:96);
CreateTranslation (SPARKSHOCK, 192:192=4:4, 198:198=172:172);
CreateTranslation (RINGBOOMERANG, 192:192=210:210, 198:198=164:164);
CreateTranslation (GYROATTACK, 192:192=4:4, 198:198=114:114);
CreateTranslation (POWERSTONE, 192:192=4:4, 198:198=167:167);
CreateTranslation (DUSTCRUSHER, 192:192=4:4, 198:198=96:96);
CreateTranslation (PHARAOHSHOT, 192:192=52:52, 198:198=172:172);
CreateTranslation (WATERWAVE, 192:192=4:4);
CreateTranslation (CRYSTALEYE, 192:192=4:4, 198:198=192:192);
CreateTranslation (SKULLBARRIER, 198:198=193:193);
CreateTranslation (FLAMEBLAST, 192:192=52:52, 198:198=172:172);
CreateTranslation (PROTOBUSTER, 192:192=87:87, 198:198=178:178);
CreateTranslation (PROTOCHARGE1, 192:192=87:87, 198:198=178:178, 0:2=253:253, 3:8=253:253, 243:247=253:253);
CreateTranslation (PROTOCHARGE2, 192:192=160:160, 198:198=148:148, 0:2=166:166, 3:8=204:166, 243:247=166:166);
CreateTranslation (YAMATOSPEAR, 192:192=4:4, 198:198=250:250);
CreateTranslation (DIVEMISSILE, 192:192=4:4);
CreateTranslation (PLANTBARRIER, 192:192=4:4, 198:198=173:173);
CreateTranslation (SILVERTOMAHAWK, 192:192=52:52, 198:198=218:218);
CreateTranslation (WINDSTORM, 192:192=4:4, 198:198=96:96);
CreateTranslation (KNIGHTCRUSH, 192:192=88:88, 198:198=200:200);
CreateTranslation (STARCRASH, 192:192=249:249, 198:198=218:218);
CreateTranslation (RAINFLUSH, 192:192=4:4, 198:198=112:112);
CreateTranslation (SAKUGARNE, 192:192=228:228, 198:198=121:121);
CreateTranslation (BASSBUSTER, 192:192=214:214, 198:198=99:99);
CreateTranslation (BALLADECRACKER, 192:192=193:193, 198:198=254:254);
CreateTranslation (SCREWCRUSHER, 192:192=16:16, 198:198=178:178);
CreateTranslation (FLASHSTOPPER, 192:192=4:4, 198:198=252:252);
CreateTranslation (GRAVITYHOLD, 192:192=4:4, 198:198=252:252);
CreateTranslation (CENTAURFLASH, 192:192=4:4, 198:198=114:114);
CreateTranslation (MIRRORBUSTER, 192:192=161:161, 198:198=199:199);
CreateTranslation (ENKERCHARGE1, 192:192=161:161, 198:198=199:199, 0:2=4:4, 3:8=4:4, 243:247=4:4);
CreateTranslation (ENKERCHARGE2, 192:192=161:161, 198:198=199:199, 0:2=196:204, 3:8=196:204, 243:247=204:204);
CreateTranslation (BALLADEREAL, 192:192=231:231, 198:198=254:254);
CreateTranslation (METALMANREAL, 192:192=231:231, 198:198=176:176);
CreateTranslation (BOSSPAIN, 5:247=4:4,0:3=4:4);
if(PlayerCount()>0){
if(GetCVar("compat_clientssendfullbuttoninfo")==0){
ConsoleCommand("compat_clientssendfullbuttoninfo 1");
//Log(s:"SERVER WARNING: Please enable compat_clientssendfullbuttoninfo to enable jump canceling.");
}}
}

script 994 (void)
{
if(CheckInventory("SkullBarrierWep")>0){
	if(GetCvar("possession")==1){
	TakeInventory("SkullBarrierWep",1);
	}
	if(GetCvar("teampossession")==1){
	TakeInventory("SkullBarrierWep",1);
	}
}
if(PlayerIsBot(PlayerNumber())){
if(CheckInventory("TimeStopperWep")>0){
TakeInventory("TimeStopperWep",1);
GiveInventory("MegaBuster",1);
SetWeapon("MegaBuster");
}

if(CheckInventory("SkullBarrierWep")>0){
TakeInventory("SkullBarrierWep",1);
GiveInventory("MegaBuster",1);
SetWeapon("MegaBuster");
}

if(CheckInventory("PlantBarrierWep")>0){
TakeInventory("PlantBarrierWep",1);
GiveInventory("MegaBuster",1);
SetWeapon("MegaBuster");
}
SetPlayerProperty(0,1,4);
Delay(1);
SetPlayerProperty(0,0,4);
}}

script 993 ENTER // Showing off scripts
{
Terminate;
int i = random(0,6);
if(i == 1){GiveInventory("BubbleLeadWep",1);SetWeapon("BubbleLeadWep");}
if(i == 2){GiveInventory("ShadowBladeWep",1);SetWeapon("ShadowBladeWep");}
if(i == 3){GiveInventory("NapalmBombWep",1);SetWeapon("NapalmBombWep");}
if(i == 4){GiveInventory("AtomicFireWep",1);SetWeapon("AtomicFireWep");}
if(i == 5){GiveInventory("LeafShieldWep",1);SetWeapon("LeafShieldWep");}
if(i == 6){GiveInventory("AirShooterWep",1);SetWeapon("AirShooterWep");}
if(i == 7){GiveInventory("HyperBombWep",1);SetWeapon("HyperBombWep");}
if(i == 8){GiveInventory("MagnetMissileWep",1);SetWeapon("MagnetMissileWep");}
}

script 992 (int amount)
{
if(CheckWeapon("BubbleLeadWep")==1){GiveInventory("BubbleAmmo",amount);}
if(CheckWeapon("ShadowBladeWep")==1){GiveInventory("ShadowAmmo",amount);}
if(CheckWeapon("NapalmBombWep")==1){GiveInventory("NapalmAmmo",amount);}
if(CheckWeapon("AtomicFireWep")==1){GiveInventory("AtomicAmmo",amount+2);}
if(CheckWeapon("LeafShieldWep")==1){GiveInventory("LeafAmmo",amount);}
if(CheckWeapon("AirShooterWep")==1){GiveInventory("AirAmmo",amount);}
if(CheckWeapon("HyperBombWep")==1){GiveInventory("BombAmmo",amount+2);}
if(CheckWeapon("MagnetMissileWep")==1){GiveInventory("MagnetAmmo",amount);}
if(CheckWeapon("TopSpinWep")==1){GiveInventory("TopAmmo",amount);}
if(CheckWeapon("NeedleCannonWep")==1){GiveInventory("NeedleAmmo",amount);}
if(CheckWeapon("GeminiLaserWep")==1){GiveInventory("GeminiAmmo",amount);}
if(CheckWeapon("SearchSnakeWep")==1){GiveInventory("SnakeAmmo",amount);}
if(CheckWeapon("TimeStopperWep")==1){GiveInventory("TimeAmmo",amount);}
if(CheckWeapon("SuperArmWep")==1){GiveInventory("SuperArmAmmo",amount);}
if(CheckWeapon("IceSlasherWep")==1){GiveInventory("IceAmmo",amount);}
if(CheckWeapon("ThunderBeamWep")==1){GiveInventory("ThunderBeamAmmo",amount);}
if(CheckWeapon("MetalBladeWep")==1){GiveInventory("MetalBladeAmmo",amount);}
if(CheckWeapon("HardKnuckleWep")==1){GiveInventory("HardKnuckleAmmo",amount);}
if(CheckWeapon("DrillBombWep")==1){GiveInventory("DrillBombAmmo",amount);}
if(CheckWeapon("BlizzardAttackWep")==1){GiveInventory("BlizzardAttackAmmo",amount);}
if(CheckWeapon("FireStormWep")==1){GiveInventory("FireStormAmmo",amount);}
if(CheckWeapon("QuickBoomerangWep")==1){GiveInventory("QuickBoomerangAmmo",amount+4);}
if(CheckWeapon("CrashBombWep")==1){GiveInventory("CrashBombAmmo",amount+4);}
if(CheckWeapon("ChargeKickWep")==1){GiveInventory("ChargeKickAmmo",amount);}
if(CheckWeapon("RollingCutterWep")==1){GiveInventory("RollingCutterAmmo",amount);}
if(CheckWeapon("SparkShockWep")==1){GiveInventory("SparkShockAmmo",amount);}
if(CheckWeapon("RingBoomerangWep")==1){GiveInventory("RingBoomerangAmmo",amount);}
if(CheckWeapon("GyroAttackWep")==1){GiveInventory("GyroAttackAmmo",amount);}
if(CheckWeapon("PowerStoneWep")==1){GiveInventory("PowerStoneAmmo",amount);}
if(CheckWeapon("DustCrusherWep")==1){GiveInventory("DustCrusherAmmo",amount);}
if(CheckWeapon("PharaohShotWep")==1){GiveInventory("PharaohShotAmmo",amount);}
if(CheckWeapon("WaterWaveWep")==1){GiveInventory("WaterWaveAmmo",amount);}
if(CheckWeapon("CrystalEyeWep")==1){GiveInventory("CrystalEyeAmmo",amount);}
if(CheckWeapon("SkullBarrierWep")==1){GiveInventory("SkullBarrierAmmo",amount);}
if(CheckWeapon("FlameBlastWep")==1){GiveInventory("FlameBlastAmmo",amount);}
if(CheckWeapon("YamatoSpearWep")==1){GiveInventory("YamatoSpearAmmo",amount);}
if(CheckWeapon("DiveMissileWep")==1){GiveInventory("DiveMissileAmmo",amount);}
if(CheckWeapon("PlantBarrierWep")==1){GiveInventory("PlantBarrierAmmo",amount);}
if(CheckWeapon("SilverTomahawkWep")==1){GiveInventory("SilverTomahawkAmmo",amount);}
if(CheckWeapon("WindStormWep")==1){GiveInventory("WindStormAmmo",amount);}
if(CheckWeapon("KnightCrushWep")==1){GiveInventory("KnightCrushAmmo",amount);}
if(CheckWeapon("StarCrashWep")==1){GiveInventory("StarCrashAmmo",amount);}
if(CheckWeapon("RainFlushWep")==1){GiveInventory("RainFlushAmmo",amount);}
if(CheckWeapon("SakugarneWep")==1){GiveInventory("SakugarneAmmo",amount);}
if(CheckWeapon("BalladeCrackerWep")==1){GiveInventory("BalladeCrackerAmmo",amount);}
if(CheckWeapon("ScrewCrusherWep")==1){GiveInventory("ScrewCrusherAmmo",amount);}
if(CheckWeapon("FlashStopperWep")==1){GiveInventory("FlashStopperAmmo",amount);}
if(CheckWeapon("GravityHoldWep")==1){GiveInventory("GravityHoldAmmo",amount);}
if(CheckWeapon("CentaurFlashWep")==1){GiveInventory("CentaurFlashAmmo",amount);}
if(CheckWeapon("MirrorBusterWep")==1){GiveInventory("MirrorBusterAmmo",amount);}
}

script 991 (int weap)
{
if(GetCvar("teamplay")==1){terminate;}
if(GetCvar("teamlms")==1){terminate;}
if(GetCvar("ctf")==1){terminate;}
if(GetCvar("oneflagctf")==1){terminate;}
Thing_SetTranslation(0, weap);
}

script 990 (void)// TOP SPIN
{
SetActorAngle (ActivatorTID(), GetActorAngle (ActivatorTID()) - 0.05);
}

script 989 (void)// POWERSTONE
{
SetActorAngle (ActivatorTID(), GetActorAngle (ActivatorTID()) - 0.06);
}

int powerstonecount=5000;

script 988 (void)//POWERSTONE TIDS
{
powerstonecount++;
Thing_ChangeTID(0,powerstonecount);
if(powerstonecount==5100){
powerstonecount = 5000;
}
}

script 987 DEATH// TIMESTOPPER
{
if(CheckInventory("TimeStopperWep")==1){
if(timestop==1){
ACS_Terminate(986,0);
HudMessageBold(s:""; HUDMSG_PLAIN,50,CR_UNTRANSLATED,0.0,0.0,0.1);
SetWeapon("MegaBuster");
Delay(1);
SetPlayerProperty(1,0,4);
TakeInventory("PowerTimeFreezer",1);
TakeInventory("TimeFreezer",1);
TakeInventory("TimeStopperWep",1);
timestop=0;
}}
}

script 986 (void) //FLASH HUD
{
timestop=1;
SetHudSize(256,224,0);
SetFont("FLASHS1");
HudMessageBold(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,0.0);
Delay(4);
SetFont("FLASHS2");
HudMessageBold(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,0.0);
Delay(4);
SetFont("FLASHS3");
HudMessageBold(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,0.0);
Delay(4);
SetFont("FLASHS4");
HudMessageBold(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,0.0);
Delay(4);
SetFont("FLASHS5");
HudMessageBold(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,0.0);
Delay(4);
SetFont("FLASHS6");
HudMessageBold(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,0.0);
Delay(4);
SetFont("FLASHS7");
HudMessageBold(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,0.0);
Delay(4);
SetFont("FLASHS8");
HudMessageBold(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,0.0);
Delay(4);
SetFont("FLASHS9");
HudMessageBold(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,0.0);
Delay(4);
REstart;
}

script 985 DEATH
{
ACS_Terminate(986,0);
HudMessageBold(s:""; HUDMSG_PLAIN,50,CR_UNTRANSLATED,0.0,0.0,0.1);
}

script 984 (void)
{
if(CheckWeapon("MegaBuster")==0){
SetResultValue( TRUE );
}
if(CheckWeapon("MegaBuster")==1){
SetResultValue( FALSE );
}
}

script 983 ENTER
{
if(PlayerIsBot(PlayerNumber())){
if(timestop==0){
GiveInventory("CreateBotBuddy",1);
GiveInventory("WeaponEnergy",50);
Delay(1);
if(CheckInventory("CutterFlag")==999){terminate;}
Restart;
}
}
}

script 982 RESPAWN
{
//if(GetCvar("teamplay")==1||GetCvar("teamlms")==1){
	//if(PlayerTeam()==1){
	//Thing_SetTranslation(0, SCREWCRUSHER);
	//}
//}
if(PlayerIsBot(PlayerNumber())){
if(timestop==0){
GiveInventory("CreateBotBuddy",1);
GiveInventory("WeaponEnergy",50);
Delay(1);
if(CheckInventory("CutterFlag")==999){terminate;}
Restart;
}
}
}

str RangedWep[10]={
"BlizzardAttackWep",
"SparkShockWep",
"FireStormWep",
"DustCrusherWep",
"ThunderBeamWep",
"GyroAttackWep",
"DiveMissileWep",
"SilverTomahawkWep",
"MagnetMissileWep",
"GeminiLaserWep"
};
str RapidWep[8]={
"QuickBoomerangWep",
"IceSlasherWep",
"WaterWaveWep",
"MetalBladeWep",
"ScrewCrusherWep",
"YamatoSpearWep",
"NeedleCannonWep"
};
str CloseWep[14]={
"BubbleLeadWep",
"WindStormWep",
"CrystalEyeWep",
"PowerStoneWep",
"RingBoomerangWep",
"RollingCutterWep",
"ChargeKickWep",
"SearchSnakeWep",
"FlameBlastWep",
"ShadowBladeWep",
"KnightCrushWep",
"TopSpinWep",
"AirShooterWep"
};
str PowerWep[9]={
"PharaohShotWep",
"SuperArmWep",
"AtomicFireWep",
"HardKnuckleWep",
"CrashBombWep",
"NapalmBombWep",
"HyperBombWep",
"DrillBombWep",
"BalladeCrackerWep"
};
str ShieldWep[5]={
"LeafShieldWep",
"StarCrashWep",
"MirrorBusterWep",
"PlantBarrierWep",
"SkullBarrierWep"
};

global int 0:RangedWepRandom;
global int 1:RapidWepRandom;
global int 2:CloseWepRandom;
global int 3:PowerWepRandom;
global int 4:ShieldWepRandom;

script 981 (void)
{
if(GetCvar("lastmanstanding")==1||GetCvar("teamlms")==1){
if(GetCvar("instagib")==1){terminate;}
Delay(1);
if(PlayerIsBot(PlayerNumber())){
TakeInventory("MegaBuster",1);
}
GiveInventory(ShieldWep[ShieldWepRandom],1);
GiveInventory(RapidWep[RapidWepRandom],1);
GiveInventory(CloseWep[CloseWepRandom],1);
GiveInventory(PowerWep[PowerWepRandom],1);
GiveInventory(RangedWep[RangedWepRandom],1);
Delay(1);
if(PlayerIsBot(PlayerNumber())){
GiveInventory("MegaBuster",1);
}
}
}

script 980 OPEN
{
Delay(10);
RangedWepRandom = Random(0,9);
RapidWepRandom = Random(0,6);
CloseWepRandom = Random(0,13);
PowerWepRandom = Random(0,8);
ShieldWepRandom = Random(0,4);
}

script 979 (void) CLIENTSIDE
{
}

script 978 (void)
{
if(PlayerIsBot(PlayerNumber())){
SetWeapon("MegaBuster");
}
}
  int buttons2[32];
  int fallingplayer[32];
  
script 977 ENTER // Jump cancel experiments
{
if(PlayerIsBot(PlayerNumber())){terminate;}
  while (TRUE)
  {
    buttons2[PlayerNumber()] = GetPlayerInput(-1, INPUT_BUTTONS);
	if(GetActorZ (0) - GetActorFloorZ (0)==0.0)
	{
	GiveInventory("JumpCancler",1);
	//print(s:"You're grounded!");
	}
	
	if(GetActorVelZ(0)<0.0)
	{
	TakeInventory("JumpCancler",1);
	//print(s:"You're falling!");
	}
	fallingplayer[ActivatorTID()] = GetActorZ (0);
	
	if(CheckInventory("JumpCancler")>0){
	//print(s:"You let go but are already falling!");
    if (GetPlayerInput(-1, INPUT_OLDBUTTONS) == GetPlayerInput(-1, INPUT_BUTTONS) + BT_JUMP )
    {
	TakeInventory("JumpCancler",1);
    //  print(s:"You let go!");
	  ThrustThingZ(0,0,0,0);
    }}
    delay(1);
		
  }
}

script 976 (Void) clientside// Flash stopper activate
{
FadeTo(255,255,255,1.0,0.0);
Delay(2);
FadeTo(255,255,255,0.0,0.0);
Delay(2);
}

script 975 (Void) clientside // Flash stopper hit
{
SetHudSize(256,224,0);
SetFont("BFLASH");
HudMessage(s:"A"; HUDMSG_PLAIN,50,CR_UNTRANSLATED,128.0,112.0,4.0);
}

script 974 (void)
{
If(PlayerIsBot(PlayerNumber()))
{
//PrintBold(s:"Sup");
SetPlayerProperty(0,1,4);
Delay(5);
SetPlayerProperty(0,0,4);
}
}

script 973 ENTER clientside
{
ConsoleCommand("cl_showweapnameoncycle false");
}

script 205 (void)
{
if(CheckInventory("BeatCallCheck")>0){
if(CheckInventory("BeatCounter")==0){
TakeInventory("RushCounter",999);
GiveInventory("BeatActivate",1);
GiveInventory("BeatCounter",20);
ThingSound(ActivatorTID(),"item/beat",127);
}
}
}

script 204 (int grav)
{
if(grav==0){SetActorProperty(ActivatorTID(), APROP_Gravity, 0.8);}
if(grav==1){SetActorProperty(ActivatorTID(), APROP_Gravity, 0.25);}
}

script 203 (void)
{
if(GetCvar("lastmanstanding")==1){terminate;}
if(GetCvar("teamlms")==1){terminate;}
if(GetCvar("duel")==1){terminate;}
if(GetCvar("ctf")==1){terminate;}
if(GetCvar("oneflagctf")==1){terminate;}
if(GetCvar("possession")==1){terminate;}
if(GetCvar("teampossession")==1){terminate;}

if(PlayerFrags() == GetCVar("fraglimit") - 5){
if(GetLevelInfo(LEVELINFO_PAR_TIME)==1){SetMusic("MM1BOSS");}
if(GetLevelInfo(LEVELINFO_PAR_TIME)==2){SetMusic("MM2BOSS");}
if(GetLevelInfo(LEVELINFO_PAR_TIME)==3){SetMusic("MM3BOSS");}
if(GetLevelInfo(LEVELINFO_PAR_TIME)==4){SetMusic("MM4BOSS");}
if(GetLevelInfo(LEVELINFO_PAR_TIME)==5){SetMusic("MM5BOSS");}
if(GetLevelInfo(LEVELINFO_PAR_TIME)==6){SetMusic("MM6BOSS");}
}
}

script 201 RESPAWN
{
ACS_ExecuteAlways(977,0);
if(GetCvar("lastmanstanding")==1||GetCvar("teamlms")==1){
Delay(1);
SetPlayerProperty(1,1,4);
}
}

script 202 (void) // FLAME BLAST FLOOR CHECK
{
if(CheckActorFloorTexture(0, "FLAMOIL1")){
ACS_Execute(1,0,0);
}
if(CheckActorFloorTexture(0, "FLAMOIL2")){
ACS_Execute(2,0,0);
}
}

global int 0:SecretUnlock[];
global int 1: rushtime;


Script 200 (int which)
{
SecretUnlock[which]=1;
}

script 199 (int which)
{
//Print(i:SecretUnlock[which]);
SetResultValue( SecretUnlock[which] );
}

Script 198 (void)
{
SecretUnlock[0]=0;
SecretUnlock[1]=0;
SecretUnlock[2]=0;
SecretUnlock[3]=0;
SecretUnlock[4]=0;
SecretUnlock[5]=0;
SecretUnlock[6]=0;
SecretUnlock[7]=0;
SecretUnlock[8]=0;
}

Script 197 ENTER
{
if(PlayerIsBot(PlayerNumber())){terminate;}
Delay(1);
if(SecretUnlock[6]==1){
GiveInventory("ScrewCrusherWep",1);
}
if(SecretUnlock[7]==1){
GiveInventory("MirrorBusterWep",1);
}
if(SecretUnlock[8]==1){
GiveInventory("BalladeCrackerWep",1);
}
}

Script 196 RESPAWN
{
ACS_Execute(197,0);
}

Script 195 (void)
{
if(PlayerIsBot(PlayerNumber())){
ThrustThingZ(0,50,0,1);
Delay(35);
}
}

Script 194 (void)
{
if(PlayerIsBot(PlayerNumber())){
GiveInventory("MegaBuster",1);
SetWeapon("MegaBuster");
}
}