#include "../PScriptLib/AsHelper.as"
// 威震八方
int Rule = 1;
int RoundTime = 12;
int PlayerSpawn = 24;
int PlayerSpawnDir = 80;
int PlayerWeapon = 14;
int PlayerWeapon2 = 9;
int PlayerHP = 5000;

int trg0 = 0;
int trg1 = 0;
int trg2 = 0;
int trg3 = 0;
int trg4 = 0;
int trg5 = 0;
int trg6 = 0;
int trg7 = 0;
int trg8 = 0;
int trg9 = 0;
int trg10 = 0;
int trg11 = 0;
int trg12 = 0;
int trg13 = 0;
int timer0 = 1;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;
int timer5 = 3;
int gameover = 0;
int gameover1 = 0;
int gameover2 = 0;
int gameover3 = 0;
int gameover4 = 0;
int gameover5 = 0;
int now = 0;
int damn =0;
int damn1 =0;
int damn2 =0; 
int bisha =0;
int baoqi =0;
int baoqi2 =0;
int baoqi3 =0;
int baoqi4 =0;
int baoqi5 =0;
int baoqi6 =0;
int baoqi7 =0;
int baoqi8 =0;
int xiaotiao =0;
int aida =0;
int yuchang =0;
int shuangbidana =0;
int aidazhanli =0;
int banyuezhan =0;
int qiangshangtiao=0;
int hengsao=0;
int wuxianlian=0;
int sunjiandajue=0;
int pofang=0;
int fangyu=0;
int jifei=0;
int daoshangtiao=0;
int feibiao=0;
int zhuizhan=0;


void OnStart()
{
AddNPC("npc22_01");
AddNPC("npc22_02");
AddNPC("npc22_03");
AddNPC("npc22_04");
AddNPC("npc22_05");
AddNPC("npc22_06");
AddNPC("npc22_07");
AddNPC("npc22_08");
AddNPC("npc22_09");
AddNPC("npc22_10");
AddNPC("npc22_11");
AddNPC("npc22_12");

}



void OnUpdate()
{
    int player = GetChar("player");
	if (player < 0)
	{
		player = 1;
	}
    int c;
	int c1;
	int c2;
	int flag;
	int c3;
	int c4;
	int c5;
	int c6;
	int c7;
	int c8;
	int c9;
	int c10;
	int c11;
	int c12;
	int c13;
	int now = GetGameTime();
			if(trg1==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 23);//乾1		    
			player = GetAnyChar("player");
			c1=GetAnyChar("冷燕");
			if (Distance(0, 1) < 25)
			{AsMoveToWayPoint(28);trg1=1;timer0=now+2;}
			}

		
			if(trg1==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c1=GetAnyChar("冷燕");
			SetTarget(0, "char", player);
			SetTarget(2, "waypoint", 28);//乾1				
			if (!IsAlive(c1)&&Distance(0, 2) < 25)
			{AsMoveToWayPoint(23);trg1=0;timer0=now+2;}	
			}

			if(trg1==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 7);//乾1		    
			player = GetAnyChar("player");
			c1=GetAnyChar("冷燕");
			if (Distance(0, 1) < 25)
			{AsMoveToWayPoint(13);trg1=1;timer0=now+2;}
			}

		
			if(trg1==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c1=GetAnyChar("冷燕");
			SetTarget(0, "char", player);
			SetTarget(2, "waypoint", 13);//乾1				
			if (!IsAlive(c1)&&Distance(0, 2) < 25)
			{AsMoveToWayPoint(7);trg1=0;timer0=now+2;}	
			}
			
			if(trg2==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(3, "waypoint", 22);//kun1		    
			player = GetAnyChar("player");
			c2=GetAnyChar("君子剑");
			if (Distance(0, 3) < 25)
			{AsMoveToWayPoint(37);trg2=1;timer0=now+2;}
			}

		
			if(trg2==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c2=GetAnyChar("君子剑");
			SetTarget(0, "char", player);
			SetTarget(4, "waypoint", 37);//kun1				
			if (!IsAlive(c2)&&Distance(0, 4) < 25)
			{AsMoveToWayPoint(22);trg2=0;timer0=now+2;}	
			}
			
			if(trg2==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(3, "waypoint", 11);//kun1		    
			player = GetAnyChar("player");
			c2=GetAnyChar("君子剑");
			if (Distance(0, 3) < 25)
			{AsMoveToWayPoint(36);trg2=1;timer0=now+2;}
			}

		
			if(trg2==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c2=GetAnyChar("君子剑");
			SetTarget(0, "char", player);
			SetTarget(4, "waypoint", 36);//kun1				
			if (!IsAlive(c2)&&Distance(0, 4) < 25)
			{AsMoveToWayPoint(11);trg2=0;timer0=now+2;}	
			}

			if(trg3==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(9, "waypoint", 16);//dui1		    
			player = GetAnyChar("player");
			c3=GetAnyChar("夜猫子");
			if (Distance(0, 9) < 25)
			{AsMoveToWayPoint(29);trg3=1;timer0=now+2;}
			}

		
			if(trg3==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c3=GetAnyChar("夜猫子");
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 29);//dui2				
			if (!IsAlive(c3)&&Distance(0, 1) < 25)
			{AsMoveToWayPoint(16);trg3=0;timer0=now+2;}	
			}

			if(trg3==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(9, "waypoint", 6);//dui1		    
			player = GetAnyChar("player");
			c3=GetAnyChar("夜猫子");
			if (Distance(0, 9) < 25)
			{AsMoveToWayPoint(14);trg3=1;timer0=now+2;}
			}

		
			if(trg3==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c3=GetAnyChar("夜猫子");
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 14);//dui2				
			if (!IsAlive(c3)&&Distance(0, 1) < 25)
			{AsMoveToWayPoint(6);trg3=0;timer0=now+2;}	
			}
			
			if(trg4==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(4, "waypoint", 21);//gen1		    
			player = GetAnyChar("player");
			c4=GetAnyChar("孙剑");
			if (Distance(0, 4) < 25)
			{AsMoveToWayPoint(34);trg4=1;timer0=now+2;}
			}

		
			if(trg4==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("孙剑");
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 34);//dui2				
			if (!IsAlive(c4)&&Distance(0, 1) < 25)
			{AsMoveToWayPoint(21);trg4=0;timer0=now+2;}	
			}

			if(trg4==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(4, "waypoint", 35);//gen1		    
			player = GetAnyChar("player");
			c4=GetAnyChar("孙剑");
			if (Distance(0, 4) < 25)
			{AsMoveToWayPoint(10);trg4=1;timer0=now+2;}
			}

		
			if(trg4==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("孙剑");
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 10);//dui2				
			if (!IsAlive(c4)&&Distance(0, 1) < 25)
			{AsMoveToWayPoint(35);trg4=0;timer0=now+2;}	
			}

			if(trg5==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(4, "waypoint", 17);//li1		    
			player = GetAnyChar("player");
			c4=GetAnyChar("高寄萍");
			if (Distance(0, 4) < 25)
			{AsMoveToWayPoint(15);trg5=1;timer0=now+2;}
			}

		
			if(trg5==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("高寄萍");
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 15);//li2				
			if (!IsAlive(c4)&&Distance(0, 1) < 25)
			{AsMoveToWayPoint(17);trg5=0;timer0=now+2;}	
			}
			
			
			
			if(trg5==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(4, "waypoint", 5);//li1		    
			player = GetAnyChar("player");
			c4=GetAnyChar("高寄萍");
			if (Distance(0, 4) < 25)
			{AsMoveToWayPoint(3);trg5=1;timer0=now+2;}
			}

		
			if(trg5==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("高寄萍");
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 5);//li2				
			if (!IsAlive(c4)&&Distance(0, 1) < 25)
			{AsMoveToWayPoint(3);trg5=0;timer0=now+2;}	
			}
			
			if(trg6==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(4, "waypoint", 20);//li1		    
			player = GetAnyChar("player");
			c4=GetAnyChar("不可不戒");
			if (Distance(0, 4) < 25)
			{AsMoveToWayPoint(33);trg6=1;timer0=now+2;}
			}
		
			if(trg6==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("不可不戒");
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 33);//kan2				
			if (!IsAlive(c4)&&Distance(0, 1) < 25)
			{AsMoveToWayPoint(20);trg6=0;timer0=now+2;}	
			}

			if(trg6==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(2, "waypoint", 9);//kan3		    
			player = GetAnyChar("player");
			c4=GetAnyChar("不可不戒");
			if (Distance(0, 2) < 25)
			{AsMoveToWayPoint(32);trg6=1;timer0=now+2;}
			}

		
			if(trg6==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("不可不戒");
			SetTarget(0, "char", player);
			SetTarget(3, "waypoint", 32);//	kan4			
			if (!IsAlive(c4)&&Distance(0, 3) < 25)
			{AsMoveToWayPoint(9);trg6=0;timer0=now+2;}	
			}

			if(trg7==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(4, "waypoint", 18);//zhen1		    
			player = GetAnyChar("player");
			c4=GetAnyChar("孙玉伯");
			if (Distance(0, 4) < 25)
			{AsMoveToWayPoint(2);trg7=1;timer0=now+2;}
			}

		
			if(trg7==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("孙玉伯");
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 2);//zhen2				
			if (!IsAlive(c4)&&Distance(0, 1) < 25)
			{AsMoveToWayPoint(18);trg7=0;timer0=now+2;}	
			}

			if(trg7==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(2, "waypoint", 0);//zhen3		    
			player = GetAnyChar("player");
			c4=GetAnyChar("孙玉伯");
			if (Distance(0, 2) < 25)
			{AsMoveToWayPoint(1);trg7=1;timer0=now+2;}
			}

		
			if(trg7==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("孙玉伯");
			SetTarget(0, "char", player);
			SetTarget(3, "waypoint", 1);//	zhen4			
			if (!IsAlive(c4)&&Distance(0, 3) < 25)
			{AsMoveToWayPoint(0);trg7=0;timer0=now+2;}	
			}

			if(trg8==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(4, "waypoint", 19);//xun	1	    
			player = GetAnyChar("player");
			c4=GetAnyChar("欧阳克");
			if (Distance(0, 4) < 25)
			{AsMoveToWayPoint(30);trg8=1;timer0=now+2;}
			}

		
			if(trg8==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("欧阳克");
			SetTarget(0, "char", player);
			SetTarget(1, "waypoint", 30);//xun	2			
			if (!IsAlive(c4)&&Distance(0, 1) < 25)
			{AsMoveToWayPoint(19);trg8=0;timer0=now+2;}	
			}

			if(trg8==0&&now>timer0)
			{
			SetTarget(0, "char", player);
			SetTarget(2, "waypoint", 8);//xun	3	    
			player = GetAnyChar("player");
			c4=GetAnyChar("欧阳克");
			if (Distance(0, 2) < 25)
			{AsMoveToWayPoint(31);trg8=1;timer0=now+2;}
			}

		
			if(trg8==1&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("欧阳克");
			SetTarget(0, "char", player);
			SetTarget(3, "waypoint", 31);//	xun	4		
			if (!IsAlive(c4)&&Distance(0, 3) < 25)
			{AsMoveToWayPoint(8	);trg8=0;timer0=now+2;}	
			}
			
			if(trg9==0&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("长枪");
			SetTarget(0, "char", player);
			SetTarget(3, "char", c4);//更换长枪模型		
			if (Distance(0, 3) < 100)
			{
			Say(1, "靠近NPC后按下1键切换长枪模型，按下2复原");
			if (AsIsKeyPressed(ImGuiKey_1))
			{
			AsSwitchPlayerSkin("p6");
			AsSwitchWeapon(7);
			
			}
			if (AsIsKeyPressed(ImGuiKey_2))
			{
			AsSwitchPlayerSkin("p0");
			}
			}	
			}
			
						
			if(trg10==0&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("白驼山庄欧阳克");
			SetTarget(0, "char", player);
			SetTarget(3, "char", c4);//更换剑宗模型		
			if (Distance(0, 3) < 100)
			{
			Say(1, "靠近NPC后按下1键切换剑宗模型，按下2复原");
			if (AsIsKeyPressed(ImGuiKey_1))
			{
			AsSwitchPlayerSkin("p26");
			AsSwitchWeapon(6);			
			}
			if (AsIsKeyPressed(ImGuiKey_2))
			{
			AsSwitchPlayerSkin("p0");
			}
			}	
			}
			
						if(trg11==0&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("指虎");
			SetTarget(0, "char", player);
			SetTarget(3, "char", c4);//更换指虎模型		
			if (Distance(0, 3) < 100)
			{
			Say(1, "靠近NPC后按下1键切换指虎模型，按下2复原");
			if (AsIsKeyPressed(ImGuiKey_1))
			{
			AsSwitchPlayerSkin("p18");
			AsSwitchWeapon(51);			
			}
			if (AsIsKeyPressed(ImGuiKey_2))
			{
			AsSwitchPlayerSkin("p0");
			}
			}	
			}
									if(trg12==0&&now>timer0)			
			{		
			player = GetAnyChar("player");
			c4=GetAnyChar("双剑");
			SetTarget(0, "char", player);
			SetTarget(3, "char", c4);//更换双剑模型		
			if (Distance(0, 3) < 100)
			{
			Say(1, "靠近NPC后按下1键切换双剑模型，按下2复原，系统自动更换双剑为圣诞武器，如需平衡可捡取蓝宝石");
			if (AsIsKeyPressed(ImGuiKey_1))
			{
			AsSwitchPlayerSkin("p13");
			AsSwitchWeapon(40);	
			}
			if (AsIsKeyPressed(ImGuiKey_2))
			{
			AsSwitchPlayerSkin("p0");
			}
			}	
			}
			
			

			
			if(bisha==1&&now>timer1&&baoqi==1&&GetAnger(2)>=60)
			{
			bisha=0;timer1=now+2;baoqi=0;
CharBaoQi(2);//必杀检测和冷燕挨打检测同时开启后，如果2号有怒气，就直接爆

			}
						if(now>timer1&&baoqi2==1&&GetAnger(3)>=60)
			{
			bisha=0;timer1=now+2;baoqi2=0;
CharBaoQi(3);//三号挨打开启后，如果3号有怒气，就直接爆

			}
if(bisha==1&&now>timer1&&baoqi3==1&&GetAnger(4)>=60)
			{
			bisha=0;timer1=now+2;baoqi3=0;
CharBaoQi(4);//暴气

			}
			if(bisha==1&&now>timer1&&baoqi4==1&&GetAnger(5)==90)
			{
			bisha=0;timer1=now+2;baoqi4=0;
			CharBaoQi(5);//暴气
			}//孙剑大招厉害，暴气机制削弱
			
			
			
						if(bisha==1&&now>timer1&&baoqi5==1&&GetAnger(6)>=60)
			{
			bisha=0;timer1=now+2;baoqi5=0;
CharBaoQi(6);//暴气

			}
			if(now>timer1&&baoqi6==1&&GetAnger(7)>=60)
			{
			bisha=0;timer1=now+2;baoqi6=0;
CharBaoQi(7);//暴气

			}
						if(now>timer1&&baoqi7==1&&GetAnger(8)>=60)
			{
			bisha=0;timer1=now+2;baoqi7=0;
CharBaoQi(8);//孙玉伯有气直接暴气

			}
		if(now>timer1&&baoqi8==1&&GetAnger(9)>=60)
			{
			bisha=0;timer1=now+2;baoqi8=0;
CharBaoQi(9);//暴气

			}
//2号匕首配套的连招检测
		
		if(xiaotiao==1&&aida==1&&now>timer1)
			{
			 AsCharAttack(2, ",,,f" );
timer1=now+1;
			aida=0;

			}
			if(aida==0)
			{
xiaotiao=0;
			}
//破解鱼肠前a伪连
			if(yuchang==1&&baoqi==1)
			{
AsCharAttack(2, ",j,j," );
			}
						if(yuchang==1&&baoqi2==1)
			{
AsCharAttack(3, ",j,j," );
			}
			
//四号双匕连招优化
	if(aidazhanli==1&&shuangbidana==1)
			{
AsCharAttack(4, "n,f,b,,f,,ff" );
shuangbidana==0;
aidazhanli==0;
			}
//双匕不会起手怎么优化都不行=。=

//五号长枪优化，3a追加升龙连招，下扎追加扫地连招,被河东狮吼直接暴气

if(trg13==0&&now>timer0)
{
c1=GetAnyChar("孙剑");
SetTarget(0, "char", player);
SetTarget(1, "char", c1);
if(Distance(0, 1) > 140&& GetAnger(5)>=60&&IsAlive(c1))
{sunjiandajue=0;timer0=now+3;timer1=now+1;}
if (Distance(0, 1) < 140 && GetAnger(5)>=60&&IsAlive(c1))
{sunjiandajue=1;timer0=now+1;timer1=now+1;}
}

if (sunjiandajue==1)
{AsCharAttack(5, "lrb,lrb" );sunjiandajue=0;}

	
if(banyuezhan==1&&aida==1)
{AsCharAttack(5, ",f" );
banyuezhan=0;
aida=0;
}

if(qiangshangtiao==1&&aida==1)
{AsCharAttack(5, "bf" );
qiangshangtiao=0;
aida==0;
}




if(wuxianlian==1&&now>timer1)//防止墙角无限连
{
player = GetAnyChar("player");
SetTarget(0, "char", player);
SetTarget(1, "waypoint", 53);
SetTarget(2, "waypoint", 54);
SetTarget(3, "waypoint", 55);
SetTarget(4, "waypoint", 56);
SetTarget(5, "waypoint", 57);
SetTarget(6, "waypoint", 58);
SetTarget(7, "waypoint", 59);
SetTarget(8, "waypoint", 60);
			if (Distance(0, 1) < 150&&GetAnger(5)>=90)
			{CharBaoQi(5);wuxianlian=0;//暴气}

}

			if (Distance(0, 2) < 150&&GetAnger(5)>=90)
			{CharBaoQi(5);wuxianlian=0;//暴气}

}
			if (Distance(0, 3) < 150&&GetAnger(5)>=90)
			{CharBaoQi(5);wuxianlian=0;//暴气}

}
			if (Distance(0, 4) < 150&&GetAnger(5)>=90)
			{CharBaoQi(5);wuxianlian=0;//暴气}

}
			if (Distance(0, 5) < 150&&GetAnger(5)>=90)
			{CharBaoQi(5);wuxianlian=0;//暴气}

}
			if (Distance(0, 6) < 150&&GetAnger(5)>=90)
			{CharBaoQi(5);wuxianlian=0;//暴气}

}
			if (Distance(0, 7) < 150&&GetAnger(5)>=90)
			{CharBaoQi(5);wuxianlian=0;//暴气}

}
			if (Distance(0, 8) < 150&&GetAnger(5)>=90)
			{CharBaoQi(5);wuxianlian=0;//暴气}

}

}
//六号高寄萍优化
if(trg13==0&&now>timer0)
{
c1=GetAnyChar("高寄萍");
SetTarget(0, "char", player);
SetTarget(1, "char", c1);
if(Distance(0, 1) > 200&& GetAnger(6)==100&&IsAlive(c1))
{sunjiandajue=0;timer0=now+3;timer1=now+1;}
if (Distance(0, 1) < 200 && GetAnger(6)==100&&IsAlive(c1))
{sunjiandajue=1;timer0=now+1;timer1=now+1;}
}//这里调用的是孙剑大绝开关

if (sunjiandajue==1)
{AsCharAttack(6, "blr,blr" );sunjiandajue=0;}

//神秘飞刀女

if (feibiao==1)
{AsCharAttack(6, "n" );feibiao=0;}

//田伯光七号优化
if(fangyu==1&&now>timer1&&trg6==1)
{
AsCharAttack(7, ".,f" );
fangyu=0;
timer1=now+1;
}

if(jifei==1&&now>timer1&&daoshangtiao==1)
{
AsCharAttack(7, ",ff" );
jifei=0;
daoshangtiao=0;
}


if(jifei==1&&now>timer1&&daoshangtiao==1)
{
AsCharAttack(7, ",ff" );
jifei=0;
daoshangtiao=0;
}
//八号孙玉伯大招满气就放
if(trg13==0&&now>timer0)
{
c1=GetAnyChar("孙玉伯");
SetTarget(0, "char", player);
SetTarget(1, "char", c1);
if(Distance(0, 1) > 200&& GetAnger(8)==100&&IsAlive(c1))
{sunjiandajue=0;timer0=now+3;timer1=now+1;}
if (Distance(0, 1) < 200 && GetAnger(8)==100&&IsAlive(c1))
{sunjiandajue=1;timer0=now+1;timer1=now+1;}
}//这里调用的是孙剑大绝开关
if (sunjiandajue==1)
{AsCharAttack(8, "lrb,lrb" );sunjiandajue=0;}


//九号欧阳克优化

if(trg13==0&&now>timer0)
{
c1=GetAnyChar("欧阳克");
SetTarget(0, "char", player);
SetTarget(1, "char", c1);
if(Distance(0, 1) > 200&& GetAnger(9)==100&&IsAlive(c1))
{sunjiandajue=0;timer0=now+3;timer1=now+1;}
if (Distance(0, 1) < 200 && GetAnger(9)==100&&IsAlive(c1))
{sunjiandajue=2;timer0=now+1;timer1=now+1;}
}//这里调用的是孙剑大绝开关


if (sunjiandajue==2)
{AsCharAttack(9, "lrf,lrf" );sunjiandajue=0;}

if(trg13==0&&now>timer0)
{
c1=GetAnyChar("欧阳克");
SetTarget(0, "char", player);
SetTarget(1, "char", c1);
if(Distance(0, 1) > 200&& GetAnger(9)>=60&&IsAlive(c1)&&GetAnger(9)<=99)
{sunjiandajue=0;timer0=now+3;timer1=now+1;}
if (Distance(0, 1) < 200 && GetAnger(9)>=60&&GetAnger(9)<=99)
{sunjiandajue=1;timer0=now+1;timer1=now+1;}
}//这里调用的是孙剑大绝开关

if (sunjiandajue==1)
{AsCharAttack(9, "rl,rl" );sunjiandajue=0;}

			
    ShowActivePosePanel();
	
//if(gameover==0)
//{
//c1=GetAnyChar("冷燕");
//c2=GetAnyChar("君子剑");
//c3=GetAnyChar("夜猫子");
//c4=GetAnyChar("孙剑");
//c5=GetAnyChar("高寄萍");
//c6=GetAnyChar("不可不戒");
//c7=GetAnyChar("孙玉伯");
//c8=GetAnyChar("欧阳克");
//c9=GetAnyChar("player");
//if(!IsAlive(c1)&&!IsAlive(c2)&&!IsAlive(c3)&&!IsAlive(c4)&&!IsAlive(c5)&&!IsAlive(c6)&&!IsAlive(c7)&&!IsAlive(c8)&&IsAlive(c9)&&now>timer5)
//{
//gameover = 1;

//}
//if(!IsAlive(c9)&&now>timer5)
//{
//gameover = -1;
//}
//}

//	if ((gameover==1 || gameover==-1))
//	{
//		GameOver(gameover);
//		gameover = 2;
//	}

}

void ShowActivePosePanel(){
    // 设置窗口位置
    Vector4 bgColor = Vector4(0,0,0,0.0); // 背景颜色, 0.0~1.0
    Vector2 position = Vector2(1.2, 0.0); // 位置, 0.0~1.0
    auto screenSize = ImGui_GetDisplaySize();
    ImGui_SetNextWindowPos(screenSize * position);

    // 窗口基本属性
    int windowFlags = 
        ImGuiWindowFlags_NoTitleBar | // 无标题栏
        ImGuiWindowFlags_NoMove |  // 禁止拖动
        ImGuiWindowFlags_NoResize |  // 禁止手动调整窗口大小
        ImGuiWindowFlags_AlwaysAutoResize |  // 总是自动调整窗口大小
        ImGuiWindowFlags_NoInputs | // 穿透鼠标
        ImGuiWindowFlags_NoScrollbar | // 无滚动条
        0;

    ImGui_PushStyleColor(ImGuiCol_WindowBg, bgColor);

    // 窗口边框宽度为0
    ImGui_PushStyleVar(ImGuiStyleVar_WindowPadding,  Vector2(0,0));
    ImGui_PushStyleVar(ImGuiStyleVar_IndentSpacing,  0);
    ImGui_PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);

    bool open = true;
    if (ImGui_Begin("角色Pose面板", open, windowFlags)){
        int[] idList = GetCharIdList(); // 获取角色ID列表
        int charCount = idList.GetSize(); // 总角色人数
        // 循环获取角色ID，并在屏幕上写字
        for (int i = 0; i < charCount; i++){ 
            int charId = idList[i]; 
            int pose = GetActivePose(charId);
            ImGui_Text(charId + " : " + pose);
			if(GetActivePose(1)==558 or GetActivePose(1)==244 or GetActivePose(1)==368 or GetActivePose(1)==556 or GetActivePose(1)==560 or GetActivePose(1)==562 or GetActivePose(1)==571)			
			{bisha=1;}//主角释放一些必杀
			if(GetActivePose(1)==259 or GetActivePose(1)==566 or GetActivePose(1)==473)			
			{bisha=1;}//主角释放一些必杀
			if(GetActivePose(1)==110 or GetActivePose(1)==111 or GetActivePose(1)==112 or GetActivePose(1)==113 or GetActivePose(1)==114 or GetActivePose(1)==115 or GetActivePose(1)==100 or GetActivePose(1)==95 or GetActivePose(1)==96 or GetActivePose(1)==97 or GetActivePose(1)==98 or GetActivePose(1)==99)			
			{aida=1; }//主角处于挨打状态
			
			if(GetActivePose(1)==100 or GetActivePose(1)==103 or GetActivePose(1)==104 or GetActivePose(1)==105 or GetActivePose(1)==108	)			
			{jifei=1;}//主角被击飞
			
			
			
			if(GetActivePose(1)==52 or GetActivePose(1)==53 or GetActivePose(1)==54 or GetActivePose(1)==55 or GetActivePose(1)==56 or GetActivePose(1)==57)  
			{fangyu=1;;}//主角处于防御状态
			
			if(GetActivePose(1)==58 or GetActivePose(1)==59 or GetActivePose(1)==60 or GetActivePose(1)==61 or GetActivePose(1)==62 or GetActivePose(1)==63)  
			{fangyu=1; }//主角处于防御状态
			
			if(GetActivePose(1)==64 or GetActivePose(1)==65 or GetActivePose(1)==66 or GetActivePose(1)==67 or GetActivePose(1)==68 or GetActivePose(1)==69 or GetActivePose(1)==70)  
			{fangyu=1; }//主角处于防御状态
			
			if(GetActivePose(1)==71 or GetActivePose(1)==72 or GetActivePose(1)==73 or GetActivePose(1)==74 or GetActivePose(1)==75 or GetActivePose(1)==76 or GetActivePose(1)==77)  
			{fangyu=1; }//主角处于防御状态
			
			if(GetActivePose(1)==78 or GetActivePose(1)==79 or GetActivePose(1)==80 or GetActivePose(1)==81 or GetActivePose(1)==82 or GetActivePose(1)==83 or GetActivePose(1)==84 or GetActivePose(1)==85)  
			{fangyu=1; }//主角处于防御状态
			
			
		 if(GetActivePose(1)==90 or GetActivePose(1)==91 or GetActivePose(1)==93 or GetActivePose(1)==94)			
			{aidazhanli=1; }//主角处于挨打站立状态
			
			if(GetActivePose(1)==0 or GetActivePose(1)==5 or GetActivePose(1)==141 or GetActivePose(1)==141 or GetActivePose(1)==143 or GetActivePose(1)==144 or GetActivePose(1)==15 or GetActivePose(1)==151 or GetActivePose(1)==172 or GetActivePose(1)==169 or GetActivePose(1)==175)			
			{aida=0;aidazhanli=0;}//主角处于自由行动状态时，挨打开关解除
			
			if(GetActivePose(1)==6 or GetActivePose(1)==7 or GetActivePose(1)==8 or GetActivePose(1)==9 or GetActivePose(1)==10)			
			{aida=0;aidazhanli=0;fangyu=0;}//主角处于自由行动状态时，挨打开关解除
			
			if(GetActivePose(1)==164 or GetActivePose(1)==165 or GetActivePose(1)==166 or GetActivePose(1)==167 or GetActivePose(1)==168 or GetActivePose(1)==169 or GetActivePose(1)==170 or GetActivePose(1)==171 or GetActivePose(1)==172 or GetActivePose(1)==173 or GetActivePose(1)==174)			
			{aida=0;aidazhanli=0;fangyu=0;}//主角处于自由行动状态时，挨打开关解除
			
		  if(GetActivePose(1)==176 or GetActivePose(1)==177 or GetActivePose(1)==178 or GetActivePose(1)==179 or GetActivePose(1)==180)			
			{aida=0;aidazhanli=0;fangyu=0;}//主角处于自由行动状态时，挨打开关解除
			
			if(GetActivePose(1)==579 or GetActivePose(1)==250) 
            {yuchang=1;}
			if(GetActivePose(1)!=579 or GetActivePose(1)!=250) 
            {yuchang=0;}//鱼肠伪连检测
			
			//↑↑主角pose检测
			if(GetActivePose(2)==110 or GetActivePose(2)==111 or GetActivePose(2)==112 or GetActivePose(2)==113 or GetActivePose(2)==114 or GetActivePose(2)==115 or GetActivePose(2)==100)			
			{baoqi=1;}//冷燕处于挨打状态，进行暴气检测，这个还得进行回复
			if(GetActivePose(2)==0 or GetActivePose(2)==5 or GetActivePose(2)==142 or GetActivePose(2)==141 or GetActivePose(2)==143 or GetActivePose(2)==144 or GetActivePose(2)==15 or GetActivePose(2)==151 or GetActivePose(2)==172 or GetActivePose(2)==169 or GetActivePose(2)==175)			
			{baoqi=0;}//冷燕处于自由行动状态，复原暴气检测回复，暴气开关关闭时说明角色处于自由行动状态
			//上上二号pose检测


// GetActivePose(3) 版本
if(GetActivePose(3)==110 or GetActivePose(3)==111 or GetActivePose(3)==112 or GetActivePose(3)==113 or GetActivePose(3)==114 or GetActivePose(3)==115 or GetActivePose(3)==100)			
{baoqi2=1;}//三号处于挨打状态，进行暴气检测，这个还得进行回复
if(GetActivePose(3)==0 or GetActivePose(3)==5 or GetActivePose(3)==142 or GetActivePose(3)==141 or GetActivePose(3)==143 or GetActivePose(3)==144 or GetActivePose(3)==15 or GetActivePose(3)==151)			
{baoqi2=0;}//三号处于自由行动状态，复原暴气检测回复

// GetActivePose(4) 版本
if(GetActivePose(4)==110 or GetActivePose(4)==111 or GetActivePose(4)==112 or GetActivePose(4)==113 or GetActivePose(4)==114 or GetActivePose(4)==115 or GetActivePose(4)==100)			
{baoqi3=1;}
if(GetActivePose(4)==0 or GetActivePose(4)==5 or GetActivePose(4)==142 or GetActivePose(4)==141 or GetActivePose(4)==143 or GetActivePose(4)==144 or GetActivePose(4)==15 or GetActivePose(4)==151)			
{baoqi3=0;}

// GetActivePose(5) 版本
if(GetActivePose(5)==110 or GetActivePose(5)==111 or GetActivePose(5)==112 or GetActivePose(5)==113 or GetActivePose(5)==114 or GetActivePose(5)==115 or GetActivePose(5)==100 or GetActivePose(5)==97 or GetActivePose(5)==99)			
{baoqi4=1;}
if(GetActivePose(5)==0 or GetActivePose(5)==5 or GetActivePose(5)==142 or GetActivePose(5)==141 or GetActivePose(5)==143 or GetActivePose(5)==144 or GetActivePose(5)==15 or GetActivePose(5)==151)			
{baoqi4=0;}

// GetActivePose(6) 版本
if(GetActivePose(6)==110 or GetActivePose(6)==111 or GetActivePose(6)==112 or GetActivePose(6)==113 or GetActivePose(6)==114 or GetActivePose(6)==115 or GetActivePose(6)==100)			
{baoqi5=1;}
if(GetActivePose(6)==0 or GetActivePose(6)==5 or GetActivePose(6)==142 or GetActivePose(6)==141 or GetActivePose(6)==143 or GetActivePose(6)==144 or GetActivePose(6)==15 or GetActivePose(6)==151)			
{baoqi5=0;}

// GetActivePose(7) 版本
if(GetActivePose(7)==110 or GetActivePose(7)==111 or GetActivePose(7)==112 or GetActivePose(7)==113 or GetActivePose(7)==114 or GetActivePose(7)==115 or GetActivePose(7)==100)			
{baoqi6=1;}
if(GetActivePose(7)==0 or GetActivePose(7)==5 or GetActivePose(7)==142 or GetActivePose(7)==141 or GetActivePose(7)==143 or GetActivePose(7)==144 or GetActivePose(7)==15 or GetActivePose(7)==151)			
{baoqi6=0;}

// GetActivePose(8) 版本
if(GetActivePose(8)==110 or GetActivePose(8)==111 or GetActivePose(8)==112 or GetActivePose(8)==113 or GetActivePose(8)==114 or GetActivePose(8)==115 or GetActivePose(8)==100)			
{baoqi7=1;}
if(GetActivePose(8)==0 or GetActivePose(8)==5 or GetActivePose(8)==142 or GetActivePose(8)==141 or GetActivePose(8)==143 or GetActivePose(8)==144 or GetActivePose(8)==15 or GetActivePose(8)==151)			
{baoqi7=0;}

// GetActivePose(9) 版本
if(GetActivePose(9)==110 or GetActivePose(9)==111 or GetActivePose(9)==112 or GetActivePose(9)==113 or GetActivePose(9)==114 or GetActivePose(9)==115 or GetActivePose(9)==100)			
{baoqi8=1;}
if(GetActivePose(9)==0 or GetActivePose(9)==5 or GetActivePose(9)==142 or GetActivePose(9)==141 or GetActivePose(9)==143 or GetActivePose(9)==144 or GetActivePose(9)==15 or GetActivePose(9)==151)			
{baoqi8=0;}

//2号匕首的连招系统
if(GetActivePose(2)==248) 
{xiaotiao=1;}

if(GetActivePose(2)!=248) 
{xiaotiao=0;}
//三号剑的暴气

//四号双匕优化
if(GetActivePose(4)==231) 
{shuangbidana=1;}

if(GetActivePose(4)!=231) 
{shuangbidana=0;}

//五号长枪优化  半月斩上挑，下扎上挑，横扫上挑，破防大挑，单a追加
if(GetActivePose(5)==281) 
{banyuezhan=1;}

if(GetActivePose(5)!=281) 
{banyuezhan=0;}

if(GetActivePose(5)==285) 
{qiangshangtiao=1;}

if(GetActivePose(5)!=285) 
{qiangshangtiao=0;}

if(GetActivePose(5)==279) 
{hengsao=1;}

if(GetActivePose(5)!=279) 
{hengsao=0;}

if(GetActivePose(5)==287) 
{hengsao=0;}


if(GetActivePose(1)==286&&GetActivePose(5) ==91)
{wuxianlian=1;}

if(GetActivePose(1)==286&&GetActivePose(5) ==92)
{wuxianlian=1;}

if(GetActivePose(1)!=286)
{wuxianlian=0;}
//神秘飞镖女

if(GetActivePose(6)==151&&trg5==1)
{feibiao=1;}

if(GetActivePose(6)!=151)
{feibiao=0;}

//田伯光击飞连招
if(GetActivePose(7)==299)
{daoshangtiao=1;}

if(GetActivePose(7)!=299)
{daoshangtiao=0;}

if(GetActivePose(7)!=367)
{zhuizhan=0;}

if(GetActivePose(7)==367)
{zhuizhan=1;}



    }
	}

    ImGui_PopStyleVar();
    ImGui_PopStyleVar();
    ImGui_PopStyleVar();
    ImGui_PopStyleColor();

    ImGui_End();
}
