// 伊人君
int Rule = 1;
int RoundTime = 450;
int PlayerSpawn = 0;
int PlayerSpawnDir = 0;
int PlayerWeapon = 10+Rand(10);
int PlayerWeapon2 = 58;
int PlayerHP = 5000+Rand(5000);
OnStart()
{
	AddNPC("1关随机1");
	AddNPC("1关随机2");
	AddNPC("1关随机3");
	AddNPC("1关随机4");
	AddNPC("1关随机5");
	AddNPC("1关随机6");
	AddNPC("1关随机7");
	AddNPC("1关随机8");
}


int trg0 = 0;
int timer0 = 0;
int timer1 = 0;
int gameover = 0;


OnUpdate()
{
	int player = GetAnyChar("player");
	if (player < 0)
	{
		return 0;
	}
	if (gameover == 2)
	{
		return 0;
	}
	
	int c;
	int c1;
	int c2;
	int c3;
	int c4;
	int c5;
	int c6;
	int c7;
	int now = GetGameTime();

	if (trg0 == 0)
	{
		PlayerPerform("say", "（又一次踏入血战！！）");
		PlayerPerform("pause", 2);
		PlayerPerform("say", "（伊人君的杀手之路！！又一次踏入血战！！）");
		PlayerPerform("crouch", 1);
		PlayerPerform("block", 1);
		trg0 = 1;
	}
	
	if (trg0 == 1)
	{
		c = GetAnyChar("随机杀手");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "能跟你交手，也算是我的服气！！.");

			PlayerPerform("use", 16);
			PlayerPerform("use", 16);
			PlayerPerform("use", 41);
			PlayerPerform("use", 5);
			PlayerPerform("say", "伊人君做事绝对利索.～");
			PlayerPerform("pause", 2);
			trg0 = 2;
		}
	}

	if (trg0 == 2)
	{
		c = GetAnyChar("随机杀手");
		c1 = GetAnyChar("随机杀手1");
		c2 = GetAnyChar("随机杀手2");
		c3 = GetAnyChar("随机杀手3");
		c4 = GetAnyChar("随机杀手4");
		c5 = GetAnyChar("随机杀手5");
		c6 = GetAnyChar("随机杀手6");
		c7 = GetAnyChar("随机杀手7");
		
		if (GetHP(c)<=0 && GetHP(c1)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c7)<=0 && player>=0 && GetHP(player)>0)
		{


			PlayerPerform("use", 15);

			trg0 = 3;
			timer0 = now + 5;
		}
	}
 if (trg0 == 3 && now>timer0)
	{
                RemoveNPC(GetAnyChar("随机杀手"));
		RemoveNPC(GetAnyChar("随机杀手1"));
                RemoveNPC(GetAnyChar("随机杀手2"));
		RemoveNPC(GetAnyChar("随机杀手3"));
                RemoveNPC(GetAnyChar("随机杀手4"));
                RemoveNPC(GetAnyChar("随机杀手5"));
		RemoveNPC(GetAnyChar("随机杀手6"));
                RemoveNPC(GetAnyChar("随机杀手7"));

	                trg0 = 4;    
			timer1 = now + 1;           
      
		}

        if (trg0 == 4 && now>timer1)
	{
                    AddNPC("1关八神");
      	                trg0 = 5;        
      
		}
if (trg0 == 5)
	{
		c = GetChar("威阵八神");
		if (c>=0 && GetEnemy(c)==player)
		{

                        Perform(c,"use",34);
                        Perform(c,"use",19);
			Perform(c, "say", "伊人！！我们玩一玩！！");

			PlayerPerform("use", 16);
			PlayerPerform("use", 16);
			PlayerPerform("use", 41);
			PlayerPerform("use", 5);
				PlayerPerform("block", 0);
		PlayerPerform("say", "领教了！！我作为杀手，必须的服从命令！！");
		PlayerPerform("pause", 2);
		PlayerPerform("block", 1);

		trg0 = 6;
		timer0 = now + 5;
	}
	
}

if (trg0==6 && now>timer0)
	{


                    AddNPC("1关八神");
                    AddNPC("1关八神");
                    AddNPC("1关八神");
                    AddNPC("1关八神");
                    AddNPC("1关八神");
			PlayerPerform("use", 34);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 20);
		        PlayerPerform("say", "来几个杀几个！！");
			trg0 = 7;
		}


	if (trg0==7)
	{
		if (GetHP(c) <=0 && gameover != 1)
		{
			Say(c,"好戏连绵不断！！你总有一天会得到报应！");
			gameover = 1;
			timer1 = now + 1;
			trg0 = 8;
		}
	}
	if (gameover!=-1 && GetHP(player)<=0 && player > 0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}
}
