// 伊人梦
int Rule = 1;
int RoundTime = 350;
int PlayerSpawn = 0;
int PlayerSpawnDir = 100;
int PlayerWeapon = 15;
int PlayerWeapon2 = 0;
int PlayerHP = 8000;

OnStart()
{
	AddNPC("2关");
}
int player;
int trg0;
int trg1;
int trg2;
int timer0;
int timer1;
int timer2;
int timer3;
int s1;
int s2;
int s3;
int s4;
int k1;
int k2;
int k3;
int con;
int gameover; 



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)
	{
		int p1 = GetChar("伊人梦");
		SetTarget(0, "char", p1);
		SetTarget(1, "char", player);
		if (GetHP(p1) >0 && Distance(0, 1) < 50)
		{

			ChangeBehavior(p1, "follow", 4);
			Perform(p1, "say", "咱玩捉迷藏，老公你来抓我阿，");
			Perform(p1, "pause", 10);
			Perform(p1, "say", "你成天就知道完这个任务！那个任务的，我都！！没人管了。");
			Perform(p1, "pause", 8);
			Perform(p1, "say", "但是我只想好好的过日子，老这么打打杀杀，过的也心里也不安。");
			Perform(p1, "pause", 4);
			Perform(p1, "say", "昨天听说你在威阵八方又杀人了！！我们不要在做杀手了。");
			Perform(p1, "faceto", player);

       
			PlayerPerform("block", 0);
			PlayerPerform("say", "就知道玩！");
			PlayerPerform("pause", 11);
			PlayerPerform("say", "呵呵？这不在这陪你的吗，嘿嘿！！");
			PlayerPerform("pause", 9);
			PlayerPerform("say", "（宝贝）有你老公保护你呢，你怕什么呀！！");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "那怎么可以，咱不能让老大失望阿。老大现在这么看重我们。");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			
			trg0 = 1;
			timer0 = now + 25;
			s1 = 0;
		}
	}


	if (trg0 == 1  && now > timer0)
	{
               AddNPC("2关蒙面1");
               AddNPC("2关蒙面2");
               AddNPC("2关蒙面3");
               AddNPC("2关蒙面4");
		trg0 = 2;
	}
   

if (trg0==2)
        {
		c1 = GetChar("蒙面人1");
		c2 = GetChar("蒙面人2");
		c3 = GetChar("蒙面人3");
		c4 = GetChar("蒙面人4");
		p1 = GetChar("伊人梦");
		if (GetHP(c1) >0)
		{
			ChangeBehavior(c1, "follow", p1);
			ChangeBehavior(c2, "follow", p1);
			ChangeBehavior(c3, "follow", p1);
			ChangeBehavior(c4, "follow", p1);
			Perform(c1, "say", "哼..那我就先宰了你的梦，在搞定你！！");
			Perform(c1, "pause", 2);
			Perform(c1, "say", "哈哈，死到临头，还在这搞浪漫！！");
			Perform(c1, "faceto", player);
			PlayerPerform("say", "什么人！！");
			PlayerPerform("pause", 1);
			trg0 = 3;
		}
	}
	        if (GetHP(p1) <= 0)
		{
			if(s1 == 0)
			{
				Say(p1,"老公！！.");
			        Say(c1,"你老婆这么好搞阿！轮到你了！！");
				ChangeBehavior(c1,"follow",player);
				ChangeBehavior(c2,"follow",player);
				ChangeBehavior(c3,"follow",player);
				ChangeBehavior(c4,"follow",player);
				s1 = 1;
                                }
                          }

        if (trg0 == 3)
	{		
                c = GetAnyChar("蒙面人1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "小子果然有两下子");
			Perform(c, "faceto", player);
			trg0 = 4;
		}
	}

if (trg0 == 4)
	{
		c1 = GetAnyChar("蒙面人1"); 
		c2 = GetAnyChar("蒙面人2"); 
		c3 = GetAnyChar("蒙面人3");
		c4 = GetAnyChar("蒙面人4");
		if (GetHP(c1)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && player>=0 && GetHP(player)>0)
		{

			AddNPC("2关巨人1");
                 	AddNPC("2关巨人2");
                	AddNPC("2关巨人3");
                 	AddNPC("2关巨人4");
                	AddNPC("2关巨人5");
		        RemoveNPC(c1);
		        RemoveNPC(c2);
		        RemoveNPC(c3);
		        RemoveNPC(c4);

			trg0 = 5;
		}
	}

 if (trg1 == 0)
	{
		c = GetAnyChar("巨人1");
		if (c>=0 && GetHP(c)<1000)
		{			
			Perform(c, "pause", 3);
			Perform(c, "say", "自己去找吧！！。");
			Perform(c, "pause", 3);
		        PlayerPerform("block", 0);
		        PlayerPerform("say", "说。谁是你的老大？");
		        PlayerPerform("block", 1);
			trg1 = 1;
		        timer0 = now + 5; 
		}

       } 
	if (trg1==1 && now>timer0)
	{
		gameover = 1;

			trg1 = 2;
		}


	if (gameover!=-1 && GetHP(player)<=0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}

}