// 死之阵8
int Rule = 1;
int RoundTime = 600;
int PlayerSpawn = 14;
int PlayerSpawnDir = 50;
int PlayerWeapon = 17;
int PlayerWeapon2 =14;
int PlayerHP = 30000;

int trg0; 
int shi0; 
int trg1;
int trg2;

int now; 
int sj; // 这个是循环中毒 
int player;
int timer0;  
int gameover;

int c1;     
int ca1;  
int c1shi; 
int c2;      
int ca2;  
int c3;   
int ca3; 
int c4;
int ca4;
int c5;   
int ca5; 
int meng;  //蒙面循环隐身

GetDistance(int k1,int k2)
{
   SetTarget(0, "char", k1);
   SetTarget(1, "char", k2);
   return Distance(0,1);
}
GetNPCChar() {
   c1=GetChar("『流星奇迹』_兵兵");
   ca1=GetAnyChar("『流星奇迹』_兵兵");
   c2=GetChar("蒙面人=1");
   ca2=GetAnyChar("蒙面人=1");
   c3=GetChar("蒙面人=2");
   ca3=GetAnyChar("蒙面人=2");
   c4=GetChar("蒙面人=3");
   ca4=GetAnyChar("蒙面人=3");
   c5=GetChar("蒙面人=4");
   ca5=GetAnyChar("蒙面人=4");
}
diannao(){
if (c1shi+50<=GetGameTime()) {
c1shi = 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);}}

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

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

ChangeBehavior(c1,"kill",player);
Perform(c1,"say"," 得罪了！伊人君！.  ");  // 时刻:28
Perform(c1,"pause",1);
Perform(c1,"say"," 我也是不愿意这么做，但是没有什么办法了！如果我有时间，定会回来的！  ");  // 时刻:27
Perform(c1,"pause",5);
PlayerPerform("say"," 那我也是心甘情愿，因为你给了我快乐！动手吧！ ");  // 时刻:25
PlayerPerform("pause",5);
Perform(c1,"say"," 口气不小，那样你很快会死在我的手里   ");  // 时刻:22
Perform(c1,"pause",5);
PlayerPerform("say","  我尊敬你！永远的尊敬，即使现在我们要自相残杀，但是你给了我快乐！所以我让你10招！  ");  // 时刻:20
PlayerPerform("pause",7);
Perform(c1,"say","  你就让我收回这一切吧！！   ");  // 时刻:17
Perform(c1,"pause",1);
Perform(c1,"say","  我是想继续给你们快乐！但是（天为人愿）呢！对不起了！");  // 时刻:16
Perform(c1,"pause",6);
PlayerPerform("say","  你值得，你感觉值得吗这样？.... 好好的，你不是说还会继续研究么？  ");  // 时刻:13
PlayerPerform("pause",5);
Perform(c1,"say","  你必须的死. 才能收回去！但也同时我会消失在你的世界里");  // 时刻:10
Perform(c1,"pause",4);
PlayerPerform("say","  一定要这么做吗？！！.... ");  // 时刻:8
PlayerPerform("pause",4);
Perform(c1,"say","  我要把这一切的一切收回去！不会在重演！.");  // 时刻:6
Perform(c1,"pause",4);
PlayerPerform("say","  完美结局不是已经出来了吗？但是你为什么又要杀我，为什么？.... ");  // 时刻:4
PlayerPerform("pause",4);
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);
trg0++;}

if (trg0==1 && c1>=0 && GetHP(c1)<GetMaxHP(c1)) {
GameOver(-1);}

if (GetHP(player)<2000 && trg0==1) {

ChangeBehavior(c1,"kill",player);
Perform(c1,"pause",4);
PlayerPerform("use", 34);
PlayerPerform("use", 4);
PlayerPerform("use", 15);
PlayerPerform("use", 15);
PlayerPerform("use", 15);
PlayerPerform("use", 20);
PlayerPerform("use", 20);
PlayerPerform("say","  得罪了兵兵！！  ");  // 时刻:10
PlayerPerform("pause",2);
PlayerPerform("say","  恩！虽然你要收回这一切，但是我们会记得你给我们的快乐！  ");  // 时刻:8
PlayerPerform("pause",4);
Perform(c1,"say","  来吧.. 结束这一切吧！兵兵永远会记得你们！ ");  // 时刻:6
Perform(c1,"pause",6);
PlayerPerform("say","  对不起了兵兵！.... 我真的不想这么做，但是不这么做是不行的了。  ");  // 时刻:4
PlayerPerform("pause",4);
Perform(c1,"say","  在不还手你真的要死了！..");  // 时刻:2
Perform(c1,"faceto",player);
PlayerPerform("block",1);
trg0++;shi0=GetGameTime();}

if (trg0==2 && c1>=0 && GetHP(c1)<GetMaxHP(c1) && shi0+10>GetGameTime()) {
GameOver(-1);}

if (GetHP(c1)<15000 && trg0==2) {

PlayerPerform("say","  阿！我中毒了.....  ");  // 时刻:8
PlayerPerform("pause",4);
Perform(c1,"say","  应该给你点难度！你以为会这么容易让你跟我交手吗？..");  // 时刻:2
Perform(c1,"pause",3);
Perform(c1,"faceto",player);
PlayerPerform("use", 11);
PlayerPerform("use", 12);
PlayerPerform("use", 13);
PlayerPerform("use", 14);
trg0++;}

if (trg0==3 && sj+20<=GetGameTime()) {sj = GetGameTime();

PlayerPerform("use", 11);
PlayerPerform("use", 12);
PlayerPerform("use", 13);
PlayerPerform("use", 14);}

if (GetHP(c1)<10000 && trg0==3) {

Perform(c1,"say","  那就叫两个人一起来玩！！.."); 
Perform(c1,"say","  这么厉害？中毒也能这样！我还真是佩服你了！..");  // 时刻:2
Perform(c1,"faceto",player);
AddNPC("7关1");AddNPC("7关3");
AddNPC("7关2");AddNPC("7关4");
trg0++;}

if (trg0==4 && c2>=0  && c3>=0  && c4>=0  && c5>=0 ) {

ChangeBehavior(c2,"kill",player);
ChangeBehavior(c3,"kill",player);
ChangeBehavior(c4,"kill",player);
ChangeBehavior(c5,"kill",player);
Perform(c2,"use",7);
Perform(c3,"use",7);
Perform(c4,"use",7);
Perform(c5,"use",7);
Perform(c2,"use",20);
Perform(c3,"use",20);
Perform(c4,"use",20);
Perform(c5,"use",20);
trg0++;}

if (trg0==5 && meng+30<=GetGameTime()) {meng = GetGameTime();

Perform(c2,"use",7);
Perform(c3,"use",7);
Perform(c4,"use",7);
Perform(c5,"use",7);
Perform(c2,"use",15);
Perform(c3,"use",15);
Perform(c4,"use",15);
Perform(c5,"use",15);}

if (GetHP(c1)<1000 && trg0==5) {

Perform(c1,"say","  今天我是来试下你的身手，的确不错！去金华城找我！结束这一切....");  // 时刻:2
Perform(c1,"faceto",player);
trg0++;timer0 = now + 5;}

if (trg0==6 && now>timer0){GameOver(1);}}
ziji(){
bingbingsiwang(ca1,c1);
if (GetHP(player)<=0) 
{ GameOver(-1);}}
OnStart(){AddNPC("8关");}
OnUpdate()
{	
	player = GetAnyChar("player");
	if (player < 0){return 0;}
        now = GetGameTime();
        GetNPCChar() ; 
        diannao() ; 
	ziji();
	scene1();
}

