#library "Global"
#include "zcommon.acs"

int introchecker=0;

script 999 (void) // Speed changing properties for Hunter/Jitterskull
{
if(PlayerClass(PlayerNumber())==1)
{
SetActorProperty(0, APROP_Speed, 0.5);
}
if(PlayerClass(PlayerNumber())==4)
{
SetActorProperty(0, APROP_Speed, 0.0001);
}
}

script 998 (void) // Speed changing properties for Hunter/Jitterskull
{
if(PlayerClass(PlayerNumber())==1)
{
SetActorProperty(0, APROP_Speed, 1.06);
}
if(PlayerClass(PlayerNumber())==4)
{
SetActorProperty(0, APROP_Speed, 0.20);
}
}

script 997 (void) { // The Creeper's pop up attack (Shortened for GVH)
SetHudSize(1280, 1024, 1);
SetFont("CREEC0");
HudMessage(s:"A"; HUDMSG_FADEOUT, 666, CR_UNTRANSLATED, 1180.0, 1720.0, 0.2, 0.5);
}

script 996 (void) // Cyborg recharge (executed when standing still)
{
LocalAmbientSound("weapons/cyborgcharge",127);
fadeto(0, 0, 255, 0.03, 0.0);
Delay(5);
fadeto(0, 0, 255, 0.0, 0.0);
}

int botweapon=0;

script 995 ENTER // Bot weapon fixes
{
if(PlayerIsBot(PlayerNumber()))
{
if(PlayerClass(PlayerNumber())==0)
{
botweapon=random(0,2);
Delay(1);
	if(botweapon==1)
	{
	SetWeapon("Riotgun");
	}
	if(botweapon==2)
	{
	SetWeapon("Machinegun");
	}
}
if(PlayerClass(PlayerNumber())==1)
{
TakeInventory("Bow",1);
GiveInventory("BotBow",1);
GiveInventory("HunterMagic", random(0,2));
SetWeapon("BotBow");
}
}
if(PlayerClass(PlayerNumber())==1)
{
SetPlayerProperty(0,1,2);
}
}

script 994 RESPAWN // Bot weapon fixes
{
if(PlayerIsBot(PlayerNumber()))
{
if(PlayerClass(PlayerNumber())==0)
{
botweapon=random(0,2);
Delay(1);
	if(botweapon==1)
	{
	SetWeapon("Riotgun");
	}
	if(botweapon==2)
	{
	SetWeapon("Machinegun");
	}
}
if(PlayerClass(PlayerNumber())==1)
{
TakeInventory("Bow",1);
GiveInventory("BotBow",1);
SetWeapon("BotBow");
}
}
if(PlayerClass(PlayerNumber())==1)
{
SetPlayerProperty(0,1,2);
}
}

script 993 (int arrowtype) // Hunter arrow graphic display
{
if(arrowtype==0){
SetFont("NORARROW");
}
if(arrowtype==1){
SetFont("FIRARROW");
}
if(arrowtype==2){
SetFont("ICEARROW");
}
if(arrowtype==3){
SetFont("LITARROW");
}
hudmessage(s:"a"; HUDMSG_PLAIN, 9, 0, 1.0, 0.95, 0); 
}

script 992 ENTER // Winning themes
{
if(GetCvar("teamlms")!=1){
if(RedScore() == GetCVar("fraglimit") - 5){
SetMusic("D_GWINNING",0);
terminate;
}
if(BlueScore() == GetCVar("fraglimit") - 5){
SetMusic("D_HWINNING",0);
terminate;
}
}
delay(1);
restart;
}

script 990 ENTER // Warns people about Jitterskull's wallrun issue
{
if(GetCvar("compat_wallrun")!=0){
Log(s:"\cgWarning: \ccserver's compat_wallrun must be false for Jitterskull to work correctly!");
}
if(PlayerClass(PlayerNumber())!=1)
{
SetFont("NORARROW");
hudmessage(s:""; HUDMSG_PLAIN, 9, 0, 1.0, 0.97, 0); 
}
}


script 989 DEATH // Remove the arrow box when you die
{
SetFont("NORARROW");
hudmessage(s:""; HUDMSG_PLAIN, 9, 0, 1.0, 0.97, 0); 
}

script 988 RESPAWN // Other stuff
{
if (GameType () > 0){
if(PlayerClass(PlayerNumber())!=1)
{
SetFont("NORARROW");
hudmessage(s:""; HUDMSG_PLAIN, 9, 0, 1.0, 0.97, 0); 
}
}
}

script 987 (void) // Creeper recharge (executed when standing still)
{
LocalAmbientSound("weapons/creepercharge",127);
GiveInventory("GhoulAmmo",1);
fadeto(255, 255, 255, 0.03, 0.0);
Delay(5);
fadeto(255, 255, 255, 0.0, 0.0);
}

script 986 (void) // Creeper stun blast effect
{
SetPlayerProperty (0, 1, 0);
fadeto(255, 255, 255, 0.03, 0.0);
Delay(48);
fadeto(255, 255, 255, 0.0, 0.0);
SetPlayerProperty (0, 0, 0);
}


script 985 OPEN // LMS Tense music start
{
if(GetCVar("winlimit") == 1){
Terminate;
}
if(Bluescore()==GetCVar("winlimit") - 1){
if(Redscore()==GetCVar("winlimit") - 1){
SetMusic("D_LTHING");
terminate;
}
}
Delay(8);
restart;
}

script 984 RESPAWN net //Down with cheating. Play properly or gtfo
{
if(PlayerIsBot(PlayerNumber())){
Terminate;
}
If(GetCVar("r_drawtrans")==0){
ConsoleCommand("r_drawtrans 1");
}
If(GetCVar("gl_depthfog")==0){
ConsoleCommand("gl_depthfog 1");
}
If(GetCVar("gl_distfog=70")<70){
ConsoleCommand("gl_distfog 70");
}
}
