#library "resurct"
#include "zcommon.acs"




//This script blocks your view if you die, because of sourceport limitations.
//if you resurrect, the weapon modifier gets deleted and weapons behave differently, which messes up the whole thing.
script "Custom_skill_bug_issue" Death 
	{ 
if ((GameSkill()> 7 && GameSkill()<= 10 && GameType () == GAME_SINGLE_PLAYER))// || GameType() == GAME_NET_COOPERATIVE || GameType() == GAME_NET_DEATHMATCH
		{
//	HudMessage(s:"Due to sourceport limitations and a game-breaking bug, you can't resurrect on this skill."; HUDMSG_TYPEON | HUDMSG_LOG, 2, CR_GRAY, 0.5, 0.175, 3.0, 0.01, 2.0);
ACS_NamedExecute("prevent_resurrect_bug",0);
DELAY(10);   
//FadeTo(0.0, 0.0, 0.0, 1.0, 2.0);
//DELAY(35*3);   
//FadeTo(0.0, 0.0, 0.0, 0.0, 3.0); 
terminate; 
}

	} 



int Scriptexecuted = 0;
//Gives player a powerup upon resurrection.	
script "Prevent_resurrect_bug" (void)
	{ 

if (GetActorProperty(0, APROP_HEALTH) <= 0  && Scriptexecuted <25)
	{ delay(5);	
//	HudMessage(s:"A"; HUDMSG_TYPEON | HUDMSG_LOG, 2, CR_GRAY, 0.5, 0.175, 3.0, 0.01, 2.0);
	Restart;	} 

else if (GetActorProperty(0, APROP_HEALTH) > 0 && Scriptexecuted <25)
	{ delay(2); giveinventory("RipAndTear_Powerup",1); ScriptExecuted++; 
//	HudMessage(s:"B"; HUDMSG_TYPEON | HUDMSG_LOG, 2, CR_GRAY, 0.5, 0.175, 3.0, 0.01, 2.0);
	Restart; } 

else if (GetActorProperty(0, APROP_HEALTH) > 0 && Scriptexecuted >=25)
	{ delay(2); giveinventory("RipAndTear_Powerup",1); ScriptExecuted = 0; 
//	HudMessage(s:"Check."; HUDMSG_TYPEON | HUDMSG_LOG, 2, CR_GRAY, 0.5, 0.175, 3.0, 0.01, 2.0);
	terminate; } 


}
