//  金华城
int Rule = 5;
int RoundTime = 99;
int PlayerSpawn = 289;
int PlayerSpawnDir = 305;
int PlayerWeapon = 15;
int PlayerWeapon2 = 17;
int PlayerHP = 32000;

int trg0; 
int trg1; 
int trg2; 
int now;  
int player;
int timer0;  
int gameover;

int z1;   
int za1; 
int z2;   
int za2; 
int z3;   
int za3; 
int z4;   
int za4; 
int z5;   
int za5;
int z6;   
int za6;  
int zhongdu;  //循环中毒

int yiren;  // 一个小函数

int c1;   
int ca1;      
int c2;      
int ca2;  
int c3;   
int ca3; 
int c4;
int ca4;
int c5;   
int ca5; 
int c6;  
int ca6;  
int c7;   
int ca7; 
int c8;   
int ca8;
int daoju;

GetDistance(int k1,int k2)
{
   SetTarget(0, "char", k1);
   SetTarget(1, "char", k2);
   return Distance(0,1);
}

bingbingsiwang(int ca,int c) { // 兵兵死亡失败
 if (ca>=0 && c<0) {
  GameOver(-1);}}

GetNPCChar() {
   z1=GetChar("伊人梦");
   za1=GetAnyChar("伊人梦");
   z2=GetChar("凤凤");
   za2=GetAnyChar("凤凤");
   z3=GetChar("小何");
   za3=GetAnyChar("小何"); // 自己人
   z4=GetChar("叶翔");
   za4=GetAnyChar("叶翔");
   z5=GetChar("石头大哥");
   za5=GetAnyChar("石头大哥");
   z6=GetChar("高老大");
   za6=GetAnyChar("高老大");

   c1=GetChar("『流星奇迹』_兵兵");
   ca1=GetAnyChar("『流星奇迹』_兵兵");
   c2=GetChar("晶晶");
   ca2=GetAnyChar("晶晶");
   c3=GetChar("只痛笑ZJ  ☆");
   ca3=GetAnyChar("只痛笑ZJ  ☆");
   c4=GetChar("2o10年、兵兵");
   ca4=GetAnyChar("2o10年、兵兵");
   c5=GetChar("bai 痴 ル");
   ca5=GetAnyChar("bai 痴 ル");
   c6=GetChar("无名蒙面");
   ca6=GetAnyChar("无名蒙面");
   c7=GetChar("豆豆");
   ca7=GetAnyChar("豆豆");
   c8=GetChar("、始终不够");
   ca8=GetAnyChar("、始终不够");

}

xunhuan(){
if (zhongdu+30<=GetGameTime()) {
zhongdu = GetGameTime();	
Perform(z1,"use",11);Perform(z2,"use",11);Perform(z3,"use",11);
Perform(z1,"use",12);Perform(z2,"use",12);Perform(z3,"use",12);
Perform(z1,"use",13);Perform(z2,"use",13);Perform(z3,"use",13);
Perform(z1,"use",14);Perform(z2,"use",14);Perform(z3,"use",14);	
Perform(z4,"use",11);Perform(z5,"use",11);Perform(z6,"use",11);
Perform(z4,"use",12);Perform(z5,"use",12);Perform(z6,"use",12);
Perform(z4,"use",13);Perform(z5,"use",13);Perform(z6,"use",13);
Perform(z4,"use",14);Perform(z5,"use",14);Perform(z6,"use",14);	
PlayerPerform("use", 11);
PlayerPerform("use", 12);
PlayerPerform("use", 13);
PlayerPerform("use", 14);
}

if (daoju+30<=GetGameTime()) {
daoju = GetGameTime();
Perform(c1,"use",40);
Perform(c1,"use",41);
Perform(c1,"use",5);
Perform(c1,"use",3);	
Perform(c1,"use",4);
Perform(c1,"use",34); // 兵兵跟老婆加血 Perform(c1,"use",15);Perform(c1,"use",15);
Perform(c2,"use",40);                   Perform(c2,"use",15);Perform(c2,"use",15);
Perform(c2,"use",41);
Perform(c2,"use",5);
Perform(c2,"use",3);	
Perform(c2,"use",4);
Perform(c2,"use",34);
Perform(c3,"use",40);
Perform(c3,"use",41);
Perform(c3,"use",5);
Perform(c3,"use",3);	
Perform(c3,"use",4);
Perform(c3,"use",34);
Perform(c4,"use",40);
Perform(c4,"use",41);
Perform(c4,"use",5);
Perform(c4,"use",3);	
Perform(c4,"use",4);
Perform(c4,"use",34);
Perform(c5,"use",40);
Perform(c5,"use",41);
Perform(c5,"use",5);
Perform(c5,"use",3);	
Perform(c5,"use",4);
Perform(c5,"use",34);
Perform(c6,"use",40);
Perform(c6,"use",41);
Perform(c6,"use",5);
Perform(c6,"use",3);	
Perform(c6,"use",4);
Perform(c6,"use",34);
Perform(c7,"use",40);
Perform(c7,"use",41);
Perform(c7,"use",5);
Perform(c7,"use",3);	
Perform(c7,"use",4);
Perform(c7,"use",34);
Perform(c8,"use",40);
Perform(c8,"use",41);
Perform(c8,"use",5);
Perform(c8,"use",3);	
Perform(c8,"use",4);
Perform(c8,"use",34);}}

scene1(){
if (trg0 == 0 &&  c1>=0 && GetDistance(player,c1)<=1000 ){

ChangeBehavior(c2, "follow", z1);
ChangeBehavior(c3, "follow", z2);
ChangeBehavior(c4, "follow", z6);
ChangeBehavior(c5, "follow", z3);
ChangeBehavior(c6, "follow", z4);
ChangeBehavior(c7, "follow", z5);
ChangeBehavior(c8, "follow", z1);  //锁杀伊人阵
ChangeBehavior(z1, "follow", c2);  // 锁杀敌人
ChangeBehavior(z2, "follow", c3);
ChangeBehavior(z6, "follow", c4);
ChangeBehavior(z3, "follow", c5);
ChangeBehavior(z4, "follow", c6);
ChangeBehavior(z5, "follow", c7);
Perform(c2,"use",30);	
Perform(c3,"use",30);	
Perform(c4,"use",30);	
Perform(c5,"use",30);	
Perform(c6,"use",30);	
Perform(c7,"use",30);	
Perform(c8,"use",30);	
Perform(c2,"use",19);	
Perform(c3,"use",19);	
Perform(c4,"use",19);	
Perform(c5,"use",19);	
Perform(c6,"use",19);	
Perform(c7,"use",19);	
Perform(c8,"use",19);	
Perform(c1,"pause",30);
Perform(c2,"pause",30);
Perform(c3,"pause",30);
Perform(c4,"pause",30);
Perform(c5,"pause",30);
Perform(c6,"pause",30);
Perform(c7,"pause",30);
Perform(c8,"pause",30);
Perform(z1,"pause",30);
Perform(z2,"pause",30);
Perform(z3,"pause",30);
Perform(z4,"pause",30);
Perform(z5,"pause",30);
Perform(z6,"pause",30);
PlayerPerform("block",0);
PlayerPerform("say"," 那我感觉也值得！.... ");  // 时刻:15
PlayerPerform("pause",2);
PlayerPerform("block",1);
PlayerPerform("say"," 今天就是抱着这口气，我也要跟你们拼了！即使死在你的手里！.. ");  // 时刻:13
PlayerPerform("pause",2);
PlayerPerform("block",1);
PlayerPerform("say"," 快活林的人你也不放过！还屡次的抓住他们，折磨他们！.. ");  // 时刻:11
PlayerPerform("pause",2);
PlayerPerform("block",1);
PlayerPerform("say","  感觉我们今天会死在你的手里，但是我们也不会退后的，说不定还有一点的希望！... ");  // 时刻:9
PlayerPerform("pause",3);
PlayerPerform("block",1);
PlayerPerform("say","  一起应战了！我们会改变这一切的！杀杀杀杀杀杀杀杀杀杀杀！.... ");  // 时刻:6
PlayerPerform("pause",6);
PlayerPerform("block",1);
Perform(c1,"say","  这一切将不会在重演！你也许会改变这一切！来吧！放心的来吧！..");  // 时刻:2
Perform(c1,"pause",2);
PlayerPerform("block",1);
Perform(c1,"say","  不要多说了！做个了断吧！..");  // 时刻:2
Perform(c1,"pause",2);
Perform(c1,"use",30);	
PlayerPerform("say"," 是不是应该把我们的毒给解掉！." );  // 时刻:0
Perform(c1,"faceto",player);
PlayerPerform("block",1);
Perform(c1,"use",19);
Perform(z1,"use",11);Perform(z2,"use",11);Perform(z3,"use",11);
Perform(z1,"use",12);Perform(z2,"use",12);Perform(z3,"use",12);
Perform(z1,"use",13);Perform(z2,"use",13);Perform(z3,"use",13);
Perform(z1,"use",14);Perform(z2,"use",14);Perform(z3,"use",14);	
Perform(z4,"use",11);Perform(z5,"use",11);Perform(z6,"use",11);
Perform(z4,"use",12);Perform(z5,"use",12);Perform(z6,"use",12);
Perform(z4,"use",13);Perform(z5,"use",13);Perform(z6,"use",13);
Perform(z4,"use",14);Perform(z5,"use",14);Perform(z6,"use",14);	
PlayerPerform("use", 30);
PlayerPerform("use", 19);
trg0++;yiren=1;}

if (yiren == 1 && c3<0 && c4<0 && c5<0 && c6<0 && c7<0 && c8<0){

Perform(z1,"pause",30);
Perform(z2,"pause",30);
Perform(z3,"pause",30);
Perform(z4,"pause",30);
Perform(z5,"pause",30);
Perform(z6,"pause",30);
Perform(c1,"pause",30);
Perform(c2,"pause",30);
PlayerPerform("say","  希望能再次感受你的刺激任务！拜拜...！呵呵！..这样多好。 ");  // 时刻:24
PlayerPerform("pause",20);
Perform(c1,"say","  我工作走喽！再见再见！哈哈。行！！你这家伙！呵呵..... ");  // 时刻:19
Perform(c1,"pause",1);
Perform(c1,"say","  再见了，伊人君，兵兵支持你哦，继续努力！拜拜... ");  // 时刻:18
Perform(c1,"pause",1);
Perform(c1,"say","  是是，咱马上走，哎哟！ ");  // 时刻:17
Perform(c1,"pause",5);
Perform(c2,"say","  别给我耍醉嘴。快点给我走，要不然姐夫又要说我们了！  ");  // 时刻:15
Perform(c2,"pause",6);
Perform(c1,"say","  阿，又要工作了。...55555555，累死我了快， ");  // 时刻:12
Perform(c1,"pause",5);
Perform(c2,"say","  那就放了他们吧！走！去工作！...  ");  // 时刻:9
Perform(c2,"faceto",c1);
Perform(c2,"pause",9);
Perform(c1,"say","  很好..   伊人君，你行阿，呵呵...这么好的苗子，我还真不想这么做了。 ");  // 时刻:7
Perform(c1,"pause",5);
PlayerPerform("say","  兵兵.  想清楚，真的不想跟你自相残杀！ ");  // 时刻:4
PlayerPerform("pause",4);
Perform(c1,"say","  快活林的人果然是有种！哈哈，真是F了你们！.. ");  // 时刻:2
Perform(c1,"pause",2);
PlayerPerform("say","  希望你不要这样做，我还想继续走你的人生！.." );  // 时刻:0
Perform(c1,"faceto",player);
PlayerPerform("block",1);

yiren=2;timer0 = now + 28;}

if (yiren==2 && now>timer0){GameOver(1);}



if (trg0 == 1 && z1<0 && z2<0 && z3<0 && z4<0 && z5<0 && z6<0) {

Perform(c1,"pause",30);
Perform(c2,"pause",30);
Perform(c3,"pause",30);
Perform(c4,"pause",30);
Perform(c5,"pause",30);
Perform(c6,"pause",30);
Perform(c7,"pause",30);
Perform(c8,"pause",30);
Perform(c1,"say","  这一切将永远不会在出现了！..   但流星永远不会坠落！再见.....  ");  // 时刻:9
Perform(c1,"pause",2);
Perform(c1,"say","  真是不可取..  你失败了！游戏结束了！..  ");  // 时刻:7
Perform(c1,"pause",5);
PlayerPerform("use", 35);
PlayerPerform("pause",2);
PlayerPerform("say","  我不是你的对手！从此江湖上不会在有快活林以及我（伊人君）的名字！... ");  // 时刻:4
PlayerPerform("pause",4);
Perform(c1,"say","  真是废物！一点刺激的感觉也没有，.. 连自己的同门师弟都救不了，活着干什么.. ");  // 时刻:2
Perform(c1,"pause",2);
PlayerPerform("say"," 我对不起你们！我...." );  // 时刻:0
Perform(c1,"faceto",player);
PlayerPerform("block",1);

trg0++;timer0 = now + 12;}

if (trg0==2 && now>timer0){GameOver(-1);}}

ziji(){
bingbingsiwang(ca1,c1);
bingbingsiwang(ca2,c2);
if (GetHP(player)<=0) 
{GameOver(-1);}}
OnStart(){

// 结局的重点
AddNPC("10主");
AddNPC("10主1");
AddNPC("10主2");
AddNPC("10主3");
AddNPC("10主4");
AddNPC("10主5");
AddNPC("10主6");
AddNPC("10主7");

//  下面是自己人
AddNPC("10关自己1");
AddNPC("10关自己2");
AddNPC("10关自己3");
AddNPC("10关自己4");
AddNPC("10关自己5");
AddNPC("10关自己6");
}
OnUpdate()
{	
	player = GetAnyChar("player");
	if (player < 0){return 0;}
        now = GetGameTime();
        GetNPCChar() ; 
        xunhuan(); 
	ziji();
	scene1();
}

