#include "lxqj_gg.pst"

/*
作者：『流星奇迹』_兵兵  

QQ：765739946 / 1529869085

Q群：40816428 / 87877010  3-4群 也在进行中.

QQ邮箱：765739946@qq.com / 1529869085@qq.com

流星网：www.23yh.cn / www.yfzz.net / www.lx766.com
2010 / 05 / 26 yzcg 
*/
didian(){
int dd=Rand(2);
if(dd==0){dd=387;}
if(dd==1){dd=468;}
return dd-0;
}
int Rule = 1;
int RoundTime = 999;
int PlayerSpawn = didian();
int PlayerSpawnDir = 90;
int PlayerWeapon = 45;
int PlayerWeapon2 = 21;
int PlayerHP = 30000;

int lxqj_b0;
int lxqj_b1;
int i;
int c1;
int lxsj;
int lx_bb;
int lxqjsj;
int player;
int gameover;
int tmp0;int tmp1;int tmp2;
huangjunlinshishuohua(int c){
int lxqj =Rand(5);
if (lxqj==0){Say(c, "  八噶路.. ");}
if (lxqj==1){Say(c, "  杀杀杀。 冲上去。  ");}
if (lxqj==2){Say(c, "  杀个机. GO。..   ");}
if (lxqj==3){Say(c, "   前途大大地. 冲上去。 ");}
if (lxqj==4){Say(c, "  一定要拿下这片地方。.  ");}
}
int LXx;
playerzhuangbei(){

if (LXx+60<=GetGameTime()) {
LXx = GetGameTime();	

PlayerPerform("use", 40);
PlayerPerform("use", 41);
PlayerPerform("use", 19);
PlayerPerform("use", 34);
PlayerPerform("use", 5);
PlayerPerform("use", 4);
PlayerPerform("use", 3);
    }
}
playerzong0(int player)
{
	if(lx_bb != 0)
	{
		return 0;
	}
	if(lxqj_b0==0)
	{
		PlayerPerform("use", 40);
		PlayerPerform("use", 41);
		PlayerPerform("use", 19);
		PlayerPerform("use", 34);
		PlayerPerform("use", 4);
		PlayerPerform("use", 3);
		PlayerPerform("say", " 众位八路军正在赶来。。 ........。 ");
		PlayerPerform("pause", 2);
		PlayerPerform("say", " 一定要拿下这个宝塔。 ");
		PlayerPerform("pause", 2);
		PlayerPerform("block", 1);
		PlayerPerform("crouch", 1);
		lxqjsj 	= lxsj;	
		lxqj_b0++;           
                //tmp0++;
	}
        if(lxqj_b0==1 && lxqjsj+5<=lxsj)
        { 

	   if(tmp0==0)
           {
             AddNPC("汉奸1");
             AddNPC("汉奸1");
             AddNPC("汉奸1");
             AddNPC("汉奸1");
             AddNPC("汉奸1");
             AddNPC("汉奸1");
	     PlayerPerform("say", " 哼。 小日本已经赶到山顶了。 我前去看看。绝对不能让他们占领此地。 ");
	     PlayerPerform("block", 0);
	     PlayerPerform("say", " 哼。林子大了，难免出点汉奸，今天我一一的收拾了你们这些。 ");
	     PlayerPerform("pause", 2);
	     PlayerPerform("crouch", 0);
             tmp0++;
        }
	lxqjsj 	= lxsj;	
	lxqj_b0++;
        }
        if(lxqj_b0==2 && lxqjsj+60<=lxsj)
        { 

	   if(tmp0==1){AddNPC("皇军1");tmp0++;}
	   c1 = GetChar("皇军");
	   if (c1 > 0)
	   {

	        Perform(c1, "say", "  巴嘎路.. 杀个机..   ");
		Perform(c1, "faceto", player);
		lxqj_b0++;
		lxqjsj 	= lxsj;	
	       }
        }
        if(lxqj_b0==3 && lxqjsj+10<=lxsj)
        { 

		c1 = GetChar("皇军");
		if(GetHP(c1) > 0)
		{
			npclikai2(1, 16);
			tmp1 = 0;
			if(npcrenshu2(1, 16) < 7){tmp1=1;}
			if(tmp1 != 0)
			{
                                AddNPC("小日本1");
		                PlayerPerform("use", 16);
	                        huangjunlinshishuohua(c1);
		                PlayerPerform("use", 8);
		                lxqjsj 	= lxsj;	
	                }
	        }
	        player = GetChar("player");
		if(GetHP(player) > 0)
		{
			npclikai1(1, 16);
			tmp1 = 0;
			if(npcrenshu1(1, 16) < 7){tmp1=1;}
			if(tmp1 != 0)
			{
                                AddNPC("八路军1");
		                lxqjsj 	= lxsj;	
	               }
                 }
		 for(i=2; i<=16; i++)
		 {
		   if(i!=c1 && GetTeam(i)==2){ChangeBehavior(i, "kill", player);}
		   //if(GetTeam(i)==1){ChangeBehavior(i, "follow", player);}
		 }
        }
        if(lxqj_b0==3 && lxqj_b1==0)
        { 
		c1 = GetChar("皇军");
		if(GetHP(c1) < 0)
		{

		   PlayerPerform("say", " 我要亲手把日本人活活打死。！岂能让他死的这么痛快。");
                   PlayerPerform("block", 1);
		   gameover = -1;
		   lxqj_b1=886;
		   lxqj_b0=886;
		   lxqjsj 	= lxsj;	
	       }
        }
        if(lxqj_b0==3 && lxqj_b1==0)
        { 
		c1 = GetChar("皇军");
		if(GetHP(c1) < 3000)
		{

	           Perform(c1, "say", "  巴嘎路. .    你小子，前途大大滴。。.. ");
		   Perform(c1, "faceto", player);
		   lxqj_b1++;
		   lxqjsj 	= lxsj;	
	       }
        }
        if(lxqj_b1==1 && lxqjsj+10<=lxsj)
        { 

		if(GetHP(c1) < 0)
		{
		       PlayerPerform("say", "我们终于把小日本人收拾了。哈哈哈哈。 我们胜利了。！");
		       for(i=2; i<=16; i++)
		       {
				if(GetTeam(i)==2){Perform(i, "use", 35);}
				if(GetTeam(i)==1){ChangeBehavior(i, "idle");}
		       }
		   gameover = 1;
		   lxqj_b1++;
		   lxqj_b0++;
		   lxqjsj 	= lxsj;	
	       }
        }
}
/////////////////////////////////////////////////////////

OnUpdate()
{	

	player = GetAnyChar("player");
	lxsj = GetGameTime();
	if (player < 0)
	{
		return 0;
	}
        NPCCharGetAny();
        playerzong0();
        playerzong1();
        playerzong2();
        playerzong3();
        playerzhuangbei();
	if (gameover!=-1 && GetHP(player)<=0)
	{
		gameover = -1;
		lxqjsj 	= lxsj;	
	}
	if ((gameover == 1 || gameover == -1) && lxqjsj+5<=lxsj)
	{
		GameOver(gameover);
		gameover = 2;
	}
}