home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / the_lost_vikings.swf / scripts / DefineSprite_627_ExitClass / frame_1 / DoAction.as
Encoding:
Text File  |  2007-03-20  |  2.1 KB  |  89 lines

  1. function Exit_Collide0(target)
  2. {
  3.    if(target.CX2 < this.CX1 || target.CX1 > this.CX2 || target.CY2 < this.CY1 || target.CY1 > this.CY2)
  4.    {
  5.       return 0;
  6.    }
  7.    return 1;
  8. }
  9. function Exit_Loop()
  10. {
  11.    var exit = 0;
  12.    var alive = 3;
  13.    this.Obj_Climb = this.Obj_Climb + 1;
  14.    if(this.Obj_Climb & 7)
  15.    {
  16.       this.cacheCX();
  17.       if(!(this.Obj_Flags & 0x20))
  18.       {
  19.          if(_root.Runner.Obj_Flags & 4)
  20.          {
  21.             alive--;
  22.          }
  23.          if(_root.Fighter.Obj_Flags & 4)
  24.          {
  25.             alive--;
  26.          }
  27.          if(_root.Shield.Obj_Flags & 4)
  28.          {
  29.             alive--;
  30.          }
  31.          if(Exit_Collide0(_root.Runner))
  32.          {
  33.             exit++;
  34.          }
  35.          if(Exit_Collide0(_root.Fighter))
  36.          {
  37.             exit++;
  38.          }
  39.          if(Exit_Collide0(_root.Shield))
  40.          {
  41.             exit++;
  42.          }
  43.          if(alive)
  44.          {
  45.             if(exit == alive)
  46.             {
  47.                if(alive == 3)
  48.                {
  49.                   _root.KeyLocked = 1;
  50.                   _root.Objs.create("HelpClass",80,1,7864320,5242880,8).gotoAndPlay("Exit1");
  51.                   this.Obj_Flags |= 32;
  52.                }
  53.                else
  54.                {
  55.                   _root.KeyLocked = 1;
  56.                   _root.Objs.create("HelpClass",80,1,7864320,5242880,8).gotoAndPlay("OneKilled");
  57.                   this.Obj_Flags |= 32;
  58.                }
  59.             }
  60.          }
  61.       }
  62.    }
  63. }
  64. this.setHndlr(1,this.Exit_Loop);
  65. this.gotoAndPlay("Exit_Loop");
  66. _root.KEY_LT = 37;
  67. _root.KEY_RT = 39;
  68. _root.KEY_UP = 38;
  69. _root.KEY_DN = 40;
  70. _root.KEY_A = 65;
  71. _root.KEY_B = 83;
  72. _root.KEY_LB = 81;
  73. _root.KEY_RB = 87;
  74. _root.KEY_CHEAT = 17;
  75. _root.Obj_Flags_ALWAYSRUN = 384;
  76. _root.Obj_Flags_BACKGROUND = 256;
  77. _root.Obj_Flags_MICKEY = 128;
  78. _root.Obj_Flags_DEAD = 64;
  79. _root.Obj_Flags_SPECIAL = 32;
  80. _root.Obj_Flags_KILL = 16;
  81. _root.Obj_Flags_KEYBD = 8;
  82. _root.Obj_Flags_GONE = 4;
  83. _root.Obj_Flags_ATTACK = 2;
  84. _root.Obj_Flags_CLIMBING = 1;
  85. this.Obj_X1 = -32;
  86. this.Obj_X2 = 32;
  87. this.Obj_Y1 = -32;
  88. this.Obj_Y2 = 0;
  89.