Section 1
//Actor (com.nitrome.engine.Actor)
package com.nitrome.engine {
import flash.display.*;
public class Actor extends Clip {
public var active:Boolean;
public var all_collision:Boolean;
public var electrocuted:Boolean;
public var collision_rect:Rect;
public var free:Boolean;
public var x:Number;
public var y:Number;
public function Actor(_arg1:Sprite, _arg2:Game, _arg3:Boolean){
super(_arg1, _arg2);
this.free = _arg3;
= true;
x = _arg1.x;
y = _arg1.y;
active = true;
all_collision = false;
electrocuted = false;
_arg2.(this);
}
override public function remove():void{
var _local1:int;
var _local2:int;
if (forced){
return;
};
if (active){
active = false;
if (!free){
g.scroller.map_array_layers[layer][init_y][init_x] = tile_id;
} else {
_local1 = ((x * Game.SCALE) >> 0);
_local2 = ((y * Game.SCALE) >> 0);
if ((((g.scroller.map_array_layers[layer][_local2][_local1] == 0)) || ((g.scroller.map_array_layers[layer][_local2][_local1] == null)))){
g.scroller.map_array_layers[layer][_local2][_local1] = tile_id;
} else {
g.scroller.map_array_layers[layer][init_y][init_x] = tile_id;
};
};
};
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
return (false);
}
public function intersects(_arg1:Rect):Boolean{
return (false);
}
public function resolveBulletCollision(_arg1):void{
}
public function resolveEncounterCollision(_arg1):void{
}
public function debug():void{
}
public function alert():void{
}
public function unpause():void{
}
public function standdown():void{
}
}
}//package com.nitrome.engine
Section 2
//Clip (com.nitrome.engine.Clip)
package com.nitrome.engine {
import flash.display.*;
public class Clip {
public var init_x:int;
public var init_y:int;
public var block:Boolean;// = false
public var layer:int;
public var tile_id:String;
public var map_x:int;
public var mc:Sprite;
public var forced:Boolean;// = false
public var map_y:int;
public var g:Game;
public var force_field:Boolean;// = false
public var
:Boolean;// = false
public var
:Boolean;// = false
public var id_tag:int;// = -1
public function Clip(_arg1:Sprite, _arg2:Game){
block = false;
force_field = false;
= false;
= false;
forced = false;
id_tag = -1;
super();
this.mc = _arg1;
this.g = _arg2;
}
public function remove():void{
if (forced){
return;
};
if (mc.parent != null){
mc.parent.removeChild(mc);
};
g.scroller.map_array_layers[layer][map_y][map_x] = tile_id;
}
}
}//package com.nitrome.engine
Section 3
//Dot (com.nitrome.engine.Dot)
package com.nitrome.engine {
public class Dot {
public var ix:Number;
public var iy:Number;
public var x:Number;
public var y:Number;
public function Dot(_arg1:Number=0, _arg2:Number=0){
this.x = (ix = _arg1);
this.y = (iy = _arg2);
}
public function (_arg1:Number){
x = (x * _arg1);
y = (y * _arg1);
}
public function toString():String{
return ((((("(" + x) + ",") + y) + ")"));
}
public function pin():void{
x = ix;
y = iy;
}
}
}//package com.nitrome.engine
Section 4
//Encounter (com.nitrome.engine.Encounter)
package com.nitrome.engine {
import flash.display.*;
import com.nitrome.engine_specific.*;
public class Encounter extends Clip {
public var active:Boolean;
public var aggressive:Boolean;// = false
public var :Boolean;
public var actor_target:Boolean;// = true
public var on_scroller:Boolean;// = false
public var reward:HiddenInt;
public var has_main:Boolean;
public var has_collision:Boolean;
public var spawned:Boolean;// = false
public var free:Boolean;
public var x:Number;
public var y:Number;
public var skip:Boolean;
public function Encounter(_arg1:Sprite, _arg2:Game, _arg3:Boolean){
spawned = false;
aggressive = false;
actor_target = true;
on_scroller = false;
super(_arg1, _arg2);
this.free = _arg3;
= true;
x = _arg1.x;
y = _arg1.y;
active = true;
has_main = false;
has_collision = true;
= false;
skip = false;
_arg2.
(this);
}
override public function remove():void{
var _local1:int;
var _local2:int;
if (forced){
return;
};
if (active){
active = false;
if (!free){
g.scroller.map_array_layers[layer][init_y][init_x] = tile_id;
} else {
_local1 = ((x * Game.SCALE) >> 0);
_local2 = ((y * Game.SCALE) >> 0);
if ((((g.scroller.map_array_layers[layer][_local2][_local1] == 0)) || ((g.scroller.map_array_layers[layer][_local2][_local1] == null)))){
g.scroller.map_array_layers[layer][_local2][_local1] = tile_id;
} else {
g.scroller.map_array_layers[layer][init_y][init_x] = tile_id;
};
};
};
}
public function standdown():void{
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
return (false);
}
public function intersects(_arg1:Rect):Boolean{
return (false);
}
public function resolvePlayerCollision(_arg1:Player):void{
}
public function alert():void{
}
public function debug():void{
}
public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
}
public function unpause():void{
}
}
}//package com.nitrome.engine
Section 5
//HiddenInt (com.nitrome.engine.HiddenInt)
package com.nitrome.engine {
public class HiddenInt {
private var _value:int;
private var r:int;
public function HiddenInt(_arg1:int=0){
r = (int((Math.random() * 2000000)) - 1000000);
_value = (r + _arg1);
}
public function get value():int{
return ((_value - r));
}
public function set value(_arg1:int):void{
r = (int((Math.random() * 2000000)) - 1000000);
_value = (r + _arg1);
}
}
}//package com.nitrome.engine
Section 6
//Line (com.nitrome.engine.Line)
package com.nitrome.engine {
import flash.display.*;
public class Line {
public var vy:Number;
public var vx:Number;
public var ly:Number;
public var ry:Number;
public var lx:Number;
public var dx:Number;
public var rx:Number;
public var len:Number;
public var :Number;
public var a:Dot;
public var b:Dot;
public var dy:Number;
public function Line(_arg1:Dot, _arg2:Dot){
this.a = _arg1;
this.b = _arg2;
updateLine();
}
public function atan2():Number{
= Math.atan2(vy, vx);
return ();
}
public function (_arg1:Number):void{
_arg1 = (_arg1 + atan2());
= _arg1;
a.x = (b.x + (Math.cos(_arg1) * len));
a.y = (b.y + (Math.sin(_arg1) * len));
updateLine();
}
public function proximity(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:Dot;
var _local5:Line;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:*;
_local4 = new Dot(_arg1, _arg2);
_local5 = this;
_local6 = (_local4.x - a.x);
_local7 = (_local4.y - a.y);
_local8 = dot(_local5, _local5);
_local9 = ((_local6 * _local5.vx) + (_local7 * _local5.vy));
if (_local9 < 0){
if (Util.proximity(a.x, a.y, _local4.x, _local4.y, _arg3)){
return (true);
};
} else {
if (_local9 > _local8){
if (Util.proximity(b.x, b.y, _local4.x, _local4.y, _arg3)){
return (true);
};
} else {
if ((((_local9 >= 0)) && ((_local9 <= _local8)))){
_local10 = ((_local6 * -(_local5.lx)) + (_local7 * -(_local5.ly)));
_local11 = (_local10 * _local5.lx);
_local12 = (_local10 * _local5.ly);
_local13 = ((_local11 * _local11) + (_local12 * _local12));
if (((_arg3 * _arg3) - _local13) >= 0){
return (true);
};
};
};
};
return (false);
}
public function draw(_arg1:Graphics):void{
_arg1.moveTo(a.x, a.y);
_arg1.lineTo(b.x, b.y);
}
public function updateLine():void{
vx = (b.x - a.x);
vy = (b.y - a.y);
len = Math.sqrt(((vx * vx) + (vy * vy)));
if (len > 0){
dx = (vx / len);
dy = (vy / len);
} else {
dx = 0;
dy = 0;
};
rx = -(dy);
ry = dx;
lx = dy;
ly = -(dx);
}
public function copy():Line{
return (new Line(new Dot(a.x, a.y), new Dot(b.x, b.y)));
}
public function
(_arg1:Number):Object{
return ({x:(b.x + ((a.x - b.x) * _arg1)), y:(b.y + ((a.y - b.y) * _arg1))});
}
public function toString():String{
return ((((((((("a:(" + a.x) + ",") + a.y) + ") b:(") + b.x) + ",") + b.y) + ")"));
}
public function (_arg1:Number):void{
_arg1 = (_arg1 + atan2());
= _arg1;
b.x = (a.x + (Math.cos(_arg1) * len));
b.y = (a.y + (Math.sin(_arg1) * len));
updateLine();
}
public static function perP(_arg1:Object, _arg2:Object):Number{
var _local3:*;
_local3 = ((_arg1.vx * _arg2.vy) - (_arg1.vy * _arg2.vx));
return (_local3);
}
public static function intersects(_arg1:Object, _arg2:Object):Boolean{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local3 = {vx:(_arg2.a.x - _arg1.a.x), vy:(_arg2.a.y - _arg1.a.y)};
_local4 = perP(_local3, _arg2);
_local5 = perP(_arg1, _arg2);
_local6 = (_local4 / _local5);
_local7 = (_local5 / _local4);
return ((((((((_local6 >= 0)) && ((_local6 <= 1)))) && ((_local7 >= 0)))) && ((_local7 <= 1))));
}
public static function intersectionPoint(_arg1:Object, _arg2:Object):Object{
var _local3:*;
var _local4:*;
var _local5:*;
_local3 = {vx:(_arg2.a.x - _arg1.a.x), vy:(_arg2.a.y - _arg1.a.y)};
_local4 = (perP(_local3, _arg2) / perP(_arg1, _arg2));
_local5 = {};
_local5.x = (_arg1.a.x + (_arg1.vx * _local4));
_local5.y = (_arg1.a.y + (_arg1.vy * _local4));
return (_local5);
}
public static function dot(_arg1:Object, _arg2:Object):Number{
return (((_arg1.vx * _arg2.vx) + (_arg1.vy * _arg2.vy)));
}
public static function miniPerP(_arg1:Object, _arg2:Object):Number{
var _local3:*;
_local3 = ((_arg1.dx * _arg2.dy) - (_arg1.dy * _arg2.dx));
return (_local3);
}
public static function normal(_arg1:Object, _arg2:Object):Object{
var _local3:*;
var _local4:*;
_local3 = {x:(_arg1.x - _arg2.x), y:(_arg1.y - _arg2.y)};
_local4 = _local3.length;
_local3.x = (_local3.x / _local4);
_local3.y = (_local3.y / _local4);
return (_local3);
}
public static function projection(_arg1:Line, _arg2:Line):Line{
var _local3:*;
_local3 = Line.dot(_arg1, _arg2);
return (new Line(new Dot(0, 0), new Dot((_arg1.dx * _local3), (_arg1.dy * _local3))));
}
}
}//package com.nitrome.engine
Section 7
//LZW (com.nitrome.engine.LZW)
package com.nitrome.engine {
public class LZW {
private static var xmlsafe:Boolean = true;
public function (_arg1:String):String{
var _local2:Array;
var _local3:String;
var _local4:int;
_local2 = _arg1.split(",");
_local3 = "";
_local4 = 0;
while (_local4 < _local2.length) {
_local3 = (_local3 + String.fromCharCode(parseInt(_local2[_local4], 16)));
_local4++;
};
return (_local3);
}
public function compress(_arg1:String):String{
var _local2:Array;
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:String;
var _local7:Array;
var _local8:Number;
var _local9:Number;
var _local10:String;
var _local11:String;
_local2 = [];
_local3 = (xmlsafe) ? 5 : 0;
_local4 = 0;
while (_local4 < 0x0100) {
_local2[String.fromCharCode(_local4)] = _local4;
_local4++;
};
if (xmlsafe){
_local2["<"] = 0x0100;
_local2[">"] = 0x0101;
_local2["&"] = 258;
_local2["\""] = 259;
_local2["'"] = 260;
};
_local5 = "";
_local6 = _arg1;
_local7 = _local6.split("");
_local8 = _local7.length;
_local9 = (0x0100 + _local3);
_local10 = "";
_local4 = 0;
while (_local4 <= _local8) {
_local11 = _local7[_local4];
if (_local2[(_local10 + _local11)] !== undefined){
_local10 = (_local10 + _local11);
} else {
_local5 = (_local5 + String.fromCharCode(_local2[_local10]));
_local2[(_local10 + _local11)] = _local9;
_local9++;
_local10 = _local11;
};
_local4++;
};
return (_local5);
}
public function decompress(_arg1:String):String{
var _local2:Array;
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local7:Number;
var _local8:Number;
var _local9:String;
var _local10:String;
var _local11:String;
var _local12:String;
var _local13:Number;
var _local14:String;
_local2 = [];
_local3 = (xmlsafe) ? 5 : 0;
_local4 = 0;
while (_local4 < 0x0100) {
_local12 = String.fromCharCode(_local4);
_local2[_local4] = _local12;
_local4++;
};
if (xmlsafe){
_local2[0x0100] = "<";
_local2[0x0101] = ">";
_local2[258] = "&";
_local2[259] = "\"";
_local2[260] = "'";
};
_local5 = _arg1;
_local6 = _local5.split("");
_local7 = _local6.length;
_local8 = (0x0100 + _local3);
_local9 = "";
_local10 = "";
_local11 = "";
_local4 = 0;
while (_local4 < _local7) {
_local13 = _local5.charCodeAt(_local4);
_local14 = _local2[_local13];
if (_local9 == ""){
_local9 = _local14;
_local11 = (_local11 + _local14);
} else {
if (_local13 <= (0xFF + _local3)){
_local11 = (_local11 + _local14);
_local10 = (_local9 + _local14);
_local2[_local8] = _local10;
_local8++;
_local9 = _local14;
} else {
_local10 = _local2[_local13];
if (_local10 == null){
_local10 = (_local9 + _local9.slice(0, 1));
};
_local11 = (_local11 + _local10);
_local2[_local8] = (_local9 + _local10.slice(0, 1));
_local8++;
_local9 = _local10;
};
};
_local4++;
};
return (_local11);
}
public function (_arg1:String):String{
var _local2:Array;
var _local3:int;
_local2 = _arg1.split("");
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = _local2[_local3].charCodeAt(0);
_local2[_local3] = _local2[_local3].toString(16);
_local3++;
};
return (_local2.toString());
}
}
}//package com.nitrome.engine
Section 8
//Particle (com.nitrome.engine.Particle)
package com.nitrome.engine {
public class Particle extends Dot {
public var px:Number;
public var py:Number;
public var temp_x:Number;
public var temp_y:Number;
public function Particle(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
px = (temp_x = _arg1);
py = (temp_y = _arg2);
}
override public function pin():void{
x = (px = (temp_x = ix));
y = (py = (temp_y = iy));
}
public function speed():Number{
return (Math.sqrt((((x - px) * (x - px)) + ((y - py) * (y - py)))));
}
public function verlet(_arg1:Number, _arg2:Number, _arg3:Number):void{
temp_x = x;
temp_y = y;
x = (x + ((_arg3 * (x - px)) + _arg1));
y = (y + ((_arg3 * (y - py)) + _arg2));
px = temp_x;
py = temp_y;
}
public function (_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = (px - x);
_local3 = (py - y);
addVelocity((_local2 * _arg1), (_local3 * _arg1));
}
public function addVelocity(_arg1:Number, _arg2:Number):void{
px = (px - _arg1);
py = (py - _arg2);
}
public function ():Number{
return ((x - px));
}
public function ():Line{
return (new Line(new Dot(px, py), this));
}
public function (_arg1:Number, _arg2:Number):void{
this.x = (px = (temp_x = (ix = _arg1)));
this.y = (py = (temp_y = (iy = _arg2)));
}
override public function toString():String{
return (((((((("(" + x) + ",") + y) + ") ") + x) + ",") + y));
}
public function ():Number{
return ((y - py));
}
public function copy():Particle{
var _local1:*;
_local1 = new Particle(x, y);
_local1.px = px;
_local1.py = py;
return (_local1);
}
public function pinTo(_arg1:Number, _arg2:Number):void{
this.x = (ix = (px = (temp_x = _arg1)));
this.y = (iy = (py = (temp_y = _arg2)));
}
}
}//package com.nitrome.engine
Section 9
//Rect (com.nitrome.engine.Rect)
package com.nitrome.engine {
import flash.display.*;
public class Rect {
public var width:Number;
public var height:Number;
public var cx:Number;
public var cy:Number;
public var x:Number;
public var y:Number;
public static const DOWN:int = 4;
public static const LEFT:int = 8;
public static const TEMP:int = 16;
public static const UP:int = 1;
public static const RIGHT:int = 2;
public function Rect(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.x = _arg1;
this.y = _arg2;
this.width = _arg3;
this.height = _arg4;
}
public function draw(_arg1:Graphics):void{
_arg1.drawRect(x, y, width, height);
}
public function (_arg1:Array):Array{
_arg1[0].x = x;
_arg1[0].y = y;
_arg1[1].x = ((x + width) - 1);
_arg1[1].y = y;
_arg1[2].x = ((x + width) - 1);
_arg1[2].y = ((y + height) - 1);
_arg1[3].x = x;
_arg1[3].y = ((y + height) - 1);
return (_arg1);
}
public function intersection(_arg1:Rect):Rect{
return (new Rect(Math.max(x, _arg1.x), Math.max(y, _arg1.y), Math.abs((Math.max(x, _arg1.x) - Math.min((x + width), (_arg1.x + _arg1.width)))), Math.abs((Math.max(y, _arg1.y) - Math.min((y + height), (_arg1.y + _arg1.height))))));
}
public function sideOf(_arg1:Number, _arg2:Number):int{
var _local3:Number;
var _local4:Number;
cx = (this.x + (width * 0.5));
cy = (this.y + (height * 0.5));
if ((((_arg1 == cx)) && ((_arg2 == cy)))){
return (2);
};
_local3 = (_arg1 - cx);
_local4 = (_arg2 - cy);
if ((((((_arg1 > cx)) && ((_arg2 > cy)))) && ((Math.abs(_local4) < Math.abs(_local3))))){
return (2);
};
if ((((((_arg1 > cx)) && ((_arg2 > cy)))) && ((Math.abs(_local4) > Math.abs(_local3))))){
return (4);
};
if ((((((_arg1 < cx)) && ((_arg2 > cy)))) && ((Math.abs(_local4) > Math.abs(_local3))))){
return (4);
};
if ((((((_arg1 < cx)) && ((_arg2 > cy)))) && ((Math.abs(_local4) < Math.abs(_local3))))){
return (8);
};
if ((((((_arg1 < cx)) && ((_arg2 < cy)))) && ((Math.abs(_local4) < Math.abs(_local3))))){
return (8);
};
if ((((((_arg1 < cx)) && ((_arg2 < cy)))) && ((Math.abs(_local4) > Math.abs(_local3))))){
return (1);
};
if ((((((_arg1 > cx)) && ((_arg2 < cy)))) && ((Math.abs(_local4) > Math.abs(_local3))))){
return (1);
};
if ((((((_arg1 > cx)) && ((_arg2 < cy)))) && ((Math.abs(_local4) < Math.abs(_local3))))){
return (2);
};
if ((((_arg2 == cy)) && ((_arg1 > cx)))){
return (2);
};
if ((((_arg1 == cx)) && ((_arg2 > cy)))){
return (4);
};
if ((((_arg2 == cy)) && ((_arg1 < cx)))){
return (8);
};
if ((((_arg1 == cx)) && ((_arg2 < cy)))){
return (1);
};
if ((((_local3 == Math.abs(_local3))) && ((_local4 == -(Math.abs(_local4)))))){
return (2);
};
if ((((_local4 == Math.abs(_local4))) && ((_local3 == Math.abs(_local3))))){
return (4);
};
if ((((_local4 == Math.abs(_local4))) && ((_local3 == -(Math.abs(_local3)))))){
return (8);
};
if ((((_local4 == -(Math.abs(_local4)))) && ((_local3 == -(Math.abs(_local3)))))){
return (1);
};
return (0);
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
return ((((((((_arg1 >= this.x)) && ((_arg2 >= this.y)))) && ((_arg1 < (this.x + width))))) && ((_arg2 < (this.y + height)))));
}
public function intersectsCircle(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
var _local4:Number;
var _local5:Number;
_local4 = _arg1;
_local5 = _arg2;
if (_local4 < x){
_local4 = x;
};
if (_local4 > ((x + width) - 1)){
_local4 = ((x + width) - 1);
};
if (_local5 < y){
_local5 = y;
};
if (_local5 > ((y + height) - 1)){
_local5 = ((y + height) - 1);
};
return (((((_arg1 - _local4) * (_arg1 - _local4)) + ((_arg2 - _local5) * (_arg2 - _local5))) < (_arg3 * _arg3)));
}
public function toString():String{
return ((((((((("(x:" + x) + " y:") + y) + " width:") + width) + " height:") + height) + ")"));
}
public function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.width = _arg3;
this.height = _arg4;
}
public function intersects(_arg1:Rect):Boolean{
return (!((((((((this.x > (_arg1.x + (_arg1.width - 1)))) || (((this.x + (this.width - 1)) < _arg1.x)))) || ((this.y > (_arg1.y + (_arg1.height - 1)))))) || (((this.y + (this.height - 1)) < _arg1.y)))));
}
public function inside(_arg1:Rect){
return (((((((((x + (width - 1)) < (_arg1.x + _arg1.width))) && (((y + (height - 1)) < (_arg1.y + _arg1.height))))) && ((x >= _arg1.x)))) && ((y >= _arg1.y))));
}
public static function boundingBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Rect{
return (new Rect(Math.min(_arg1, _arg3), Math.min(_arg2, _arg4), Math.abs((_arg1 - _arg3)), Math.abs((_arg2 - _arg4))));
}
public static function oppositeSide(_arg1:Number):Number{
if (_arg1 == UP){
return (DOWN);
};
if (_arg1 == RIGHT){
return (LEFT);
};
if (_arg1 == DOWN){
return (UP);
};
if (_arg1 == LEFT){
return (RIGHT);
};
return (0);
}
}
}//package com.nitrome.engine
Section 10
//Scroller (com.nitrome.engine.Scroller)
package com.nitrome.engine {
import flash.display.*;
import com.nitrome.engine_specific.*;
public class Scroller {
public var :Array;
public var :Array;
public var current_layer:int;
public var :int;
public var signage:Array;
public var :Array;
public var
:Array;
public var height:int;
public var SCALE:Number;
public var :int;
public var layers:int;
public var :int;
public var :Array;
public var scale:Number;
public var :Array;
public var tile_holder:Sprite;
public var tile_maker:TileMaker;
public var gfx:Boolean;
public var tiles:Sprite;
public var scroll_x:Boolean;
public var scroll_y:Boolean;
public var :int;
public var :int;
public var :int;
public var :int;
public var :Array;
public var map_array:Array;
public var width:int;
public var :Array;
public var :int;
public var :int;
public var :Array;
public var :Array;
public var :int;
public var :int;
public var map_rect:Rect;
public var map_array_layers:Array;
public var tile_layers:Array;
public var :Array;
public var stage:Sprite;
public static const VERT:int = 2;
public static const ENCOUNTER_LAYER:int = 2;
public static const HORIZ:int = 1;
public static const BLOCK_LAYER:int = 1;
public function Scroller(_arg1:Game, _arg2:Sprite, _arg3:Sprite, _arg4:Number, _arg5:int, _arg6:int, _arg7:int, _arg8:int){
this.stage = _arg2;
this.tile_holder = _arg3;
this.scale = _arg4;
SCALE = (1 / _arg4);
this.width = _arg5;
this.height = _arg6;
this. = _arg7;
this. = _arg8;
tile_maker = new TileMaker(_arg1, this);
scroll_x = true;
scroll_y = true;
= [];
gfx = false;
= new Array(1, 3, 3, 1);
= new Array(1, 3, 3, 1);
= Math.ceil((_arg7 / _arg4));
= Math.ceil((_arg8 / _arg4));
tile_layers = [];
= [];
map_array_layers = [];
= [];
= [];
= [];
= [];
current_layer = 0;
layers = 0;
= BLOCK_LAYER;
= 0;
= 0;
= 0;
= 0;
map_rect = new Rect(0, 0, (_arg5 * _arg4), (_arg6 * _arg4));
}
protected function (_arg1:Number):void{
var _local2:int;
.push(_arg1);
_local2 = 0;
while (_local2 < .length) {
[_local2].push(tile_maker.mapElement(_arg1, (_local2 + [0])));
_local2++;
};
}
public function renderScrollLayer(_arg1:int, _arg2:int):void{
var _local3:int;
var _local4:int;
changeLayer(_arg1);
tiles = new Sprite();
_local3 = 0;
while (_local3 < height) {
_local4 = 0;
while (_local4 < width) {
tile_maker.mapElement(_local4, _local3);
_local4++;
};
_local3++;
};
if (_arg2 == HORIZ){
tiles.x = (Game.scale * width);
} else {
if (_arg2 == VERT){
tiles.y = (Game.scale * height);
};
};
tile_layers[_arg1].addChild(tiles);
tiles = new Sprite();
_local3 = 0;
while (_local3 < height) {
_local4 = 0;
while (_local4 < width) {
tile_maker.mapElement(_local4, _local3);
_local4++;
};
_local3++;
};
tile_layers[_arg1].addChild(tiles);
(_arg1, false);
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
return ((((((((_arg1 < ( - 1))) && ((_arg1 >= )))) && ((_arg2 < ( - 1))))) && ((_arg2 >= ))));
}
public function addLayer(_arg1:Array, _arg2:Boolean=false):void{
var _local3:Sprite;
if (tile_layers.length == layers){
_local3 = new Sprite();
tile_holder.addChild(_local3);
tile_layers.push(_local3);
};
.push(_arg2);
map_array_layers.push(_arg1);
.push([]);
.push([]);
.push([]);
.push(true);
layers++;
}
public function intersects(_arg1:Rect):Boolean{
return (!(((((((( > (_arg1.x + (_arg1.width - 1)))) || ((( - 1) < _arg1.x)))) || (( > (_arg1.y + (_arg1.height - 1)))))) || ((( - 1) < _arg1.y)))));
}
public function clipManager():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = ((stage.x * SCALE) >> 0);
_local2 = ((stage.y * SCALE) >> 0);
_local4 = 0;
while (_local4 < layers) {
changeLayer(_local4);
if ([_local4]){
if (scroll_x){
if (-(_local1) > ){
if (((([0] > 0)) && (([0] > (-(_local1) - [_local4]))))){
_local3 = ([0] - (-(_local1) - [_local4]));
while (_local3 > 0) {
(([0] - 1));
if (_local4 == ){
= ( - scale);
};
_local3--;
if ([0] == 0){
break;
};
};
};
if ([(.length - 1)] > ((-(_local1) + ) + [_local4])){
_local3 = ([(.length - 1)] - ((-(_local1) + ) + [_local4]));
while (_local3 > 0) {
();
if (_local4 == ){
= ( - scale);
};
_local3--;
};
};
};
if (_local1 < ){
if (((([(.length - 1)] < (width - 1))) && (([(.length - 1)] < ((-(_local1) + ) + [_local4]))))){
_local3 = (((-(_local1) + ) + [_local4]) - [(.length - 1)]);
while (_local3 > 0) {
(([(.length - 1)] + 1));
if (_local4 == ){
= ( + scale);
};
_local3--;
if ([(.length - 1)] == (width - 1)){
break;
};
};
};
if ([0] < (-(_local1) - [_local4])){
_local3 = ((-(_local1) - [_local4]) - [0]);
while (_local3 > 0) {
();
if (_local4 == ){
= ( + scale);
};
_local3--;
};
};
};
};
if (scroll_y){
if (_local2 > ){
if (((( [0] > 0)) && (( [0] > (-(_local2) -
[_local4]))))){
_local3 = ( [0] - (-(_local2) -
[_local4]));
while (_local3 > 0) {
(( [0] - 1));
if (_local4 == ){
= ( - scale);
};
_local3--;
if ( [0] == 0){
break;
};
};
};
if ( [( .length - 1)] > ((-(_local2) + ) +
[_local4])){
_local3 = ( [( .length - 1)] - ((-(_local2) + ) +
[_local4]));
while (_local3 > 0) {
();
if (_local4 == ){
= ( - scale);
};
_local3--;
};
};
};
if (_local2 < ){
if (((( [( .length - 1)] < (height - 1))) && (( [( .length - 1)] < ((-(_local2) + ) +
[_local4]))))){
_local3 = (((-(_local2) + ) +
[_local4]) - [( .length - 1)]);
while (_local3 > 0) {
(( [( .length - 1)] + 1));
if (_local4 == ){
= ( + scale);
};
_local3--;
if ( [( .length - 1)] == (height - 1)){
break;
};
};
};
if ( [0] < (-(_local2) -
[_local4])){
_local3 = ((-(_local2) -
[_local4]) - [0]);
while (_local3 > 0) {
();
if (_local4 == ){
= ( + scale);
};
_local3--;
};
};
};
};
};
_local4++;
};
= _local1;
= _local2;
}
protected function (_arg1:Number):void{
var _local2:int;
.unshift(_arg1);
_local2 = 0;
while (_local2 < .length) {
[_local2].unshift(tile_maker.mapElement(_arg1, (_local2 + [0])));
_local2++;
};
}
public function reset():void{
= ((stage.x * SCALE) >> 0);
= ((stage.y * SCALE) >> 0);
}
public function (_arg1:int, _arg2:int, _arg3:int):void{
map_array_layers[_arg1][_arg3][_arg2] = 0;
}
public function debug(_arg1:Graphics):void{
_arg1.moveTo(, );
_arg1.lineTo(, );
_arg1.lineTo(, );
_arg1.lineTo(, );
_arg1.lineTo(, );
_arg1.moveTo(-(stage.x), -(stage.y));
_arg1.lineTo((-(stage.x) + ), -(stage.y));
_arg1.lineTo((-(stage.x) + ), (-(stage.y) + ));
_arg1.lineTo(-(stage.x), (-(stage.y) + ));
_arg1.lineTo(-(stage.x), -(stage.y));
}
public function rezForced():void{
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = 0;
while (_local1 < layers) {
changeLayer(_local1);
_local2 = 0;
while (_local2 < height) {
_local3 = 0;
while (_local3 < width) {
if (!(((map_array[_local2][_local3] >= 0)) || ((map_array[_local2][_local3] <= 0)))){
if ((((map_array[_local2][_local3] is String)) && ((map_array[_local2][_local3].search(/F/) > -1)))){
map_array[_local2][_local3] = map_array[_local2][_local3].replace(/F/, "");
tile_maker.mapElement(_local3, _local2, true);
map_array[_local2][_local3] = 0;
};
};
_local3++;
};
_local2++;
};
_local1++;
};
}
public function setSignage(_arg1:Array):void{
this.signage = _arg1;
}
protected function ():void{
var _local1:int;
_local1 = 0;
while (_local1 < .length) {
if ([_local1][(.length - 1)] != null){
if (!gfx){
[_local1][(.length - 1)].remove();
} else {
[_local1][(.length - 1)].parent.removeChild([_local1][(.length - 1)]);
};
};
[_local1].pop();
_local1++;
};
.pop();
}
protected function (_arg1:int):void{
var _local2:int;
.push([]);
.push(_arg1);
_local2 = 0;
while (_local2 < .length) {
[(.length - 1)].push(tile_maker.mapElement((_local2 + [0]), _arg1));
_local2++;
};
}
protected function (_arg1:int):void{
var _local2:int;
.unshift([]);
.unshift(_arg1);
_local2 = 0;
while (_local2 < .length) {
[0].push(tile_maker.mapElement((_local2 + [0]), _arg1));
_local2++;
};
}
public function addTileLayer(_arg1:Sprite){
tile_layers.push(_arg1);
}
public function changeLayer(_arg1:int):void{
tiles = tile_layers[_arg1];
map_array = map_array_layers[_arg1];
= [_arg1];
= [_arg1];
= [_arg1];
gfx = [_arg1];
current_layer = _arg1;
}
protected function ():void{
var _local1:int;
_local1 = 0;
while (_local1 < .length) {
if ([_local1][0] != null){
if (!gfx){
[_local1][0].remove();
} else {
[_local1][0].parent.removeChild([_local1][0]);
};
};
[_local1].shift();
_local1++;
};
.shift();
}
public function (_arg1:int, _arg2:Boolean):void{
[_arg1] = _arg2;
}
protected function
():void{
var _local1:int;
_local1 = 0;
while (_local1 < .length) {
if ([(.length - 1)][_local1] != null){
if (!gfx){
[(.length - 1)][_local1].remove();
} else {
[(.length - 1)][_local1].parent.removeChild([(.length - 1)][_local1]);
};
};
_local1++;
};
.pop();
.pop();
}
public function (_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
map_array_layers[_arg1][_arg3][_arg2] = _arg4;
}
public function rezBeginning(_arg1:int, _arg2:int):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:int;
var _local10:int;
var _local11:int;
= [];
= [];
= [];
_local3 = Math.round(( * 0.5));
_local4 = Math.round(( * 0.5));
stage.x = -(((_arg1 - _local3) * scale));
stage.y = -(((_arg2 - _local4) * scale));
= ((stage.x / scale) >> 0);
= ((stage.y / scale) >> 0);
_local5 = ((_arg1 - _local3) - ( [] * 2));
_local6 = ((_arg2 - _local4) - (
[] * 2));
_local7 = ((_local5 + ) + ( [] * 4));
_local8 = ((_local6 + ) + (
[] * 4));
if (_local5 < 0){
_local5 = 0;
};
if (_local6 < 0){
_local6 = 0;
};
if (_local7 > width){
_local7 = width;
};
if (_local8 > height){
_local8 = height;
};
= (_local5 * scale);
= (_local6 * scale);
= (_local7 * scale);
= (_local8 * scale);
_local11 = 0;
while (_local11 < layers) {
changeLayer(_local11);
if ([_local11]){
_local9 = _local5;
while (_local9 < _local7) {
.push(_local9);
_local9++;
};
_local10 = _local6;
while (_local10 < _local8) {
(_local10);
_local10++;
};
};
_local11++;
};
}
protected function ():void{
var _local1:int;
_local1 = 0;
while (_local1 < .length) {
if ([0][_local1] != null){
if (!gfx){
[0][_local1].remove();
} else {
[0][_local1].parent.removeChild([0][_local1]);
};
};
_local1++;
};
.shift();
.shift();
}
}
}//package com.nitrome.engine
Section 11
//Spring (com.nitrome.engine.Spring)
package com.nitrome.engine {
public class Spring extends Line {
public var stiffness:Number;
public var rest_len:Number;
public function Spring(_arg1:Dot, _arg2:Dot){
super(_arg1, _arg2);
stiffness = 0.5;
rest_len = len;
}
public function (_arg1:Number, _arg2:Number):void{
updateLine();
if (len < _arg1){
b.x = (a.x + (_arg1 * dx));
b.y = (a.y + (_arg1 * dy));
updateLine();
} else {
if (len > _arg2){
b.x = (a.x + (_arg2 * dx));
b.y = (a.y + (_arg2 * dy));
updateLine();
};
};
}
public function
(_arg1:Number, _arg2:Number):void{
updateLine();
if (len < _arg1){
a.x = (b.x + (_arg1 * -(dx)));
a.y = (b.y + (_arg1 * -(dy)));
updateLine();
} else {
if (len > _arg2){
a.x = (b.x + (_arg2 * -(dx)));
a.y = (b.y + (_arg2 * -(dy)));
updateLine();
};
};
}
public function updateSpring():void{
var _local1:Number;
var _local2:Number;
var _local3:Dot;
vx = (b.x - a.x);
vy = (b.y - a.y);
len = Math.sqrt(((vx * vx) + (vy * vy)));
_local1 = 0;
if (len > 0){
_local1 = ((len - rest_len) / len);
};
_local2 = (_local1 * stiffness);
_local3 = new Dot((-(vx) * _local2), (-(vy) * _local2));
a.x = (a.x - _local3.x);
a.y = (a.y - _local3.y);
b.x = (b.x + _local3.x);
b.y = (b.y + _local3.y);
updateLine();
}
}
}//package com.nitrome.engine
Section 12
//Trig (com.nitrome.engine.Trig)
package com.nitrome.engine {
public class Trig {
public static const sin:Array = [0, 0.0174524064372835, 0.034899496702501, 0.0523359562429438, 0.0697564737441253, 0.0871557427476582, 0.104528463267653, 0.121869343405147, 0.139173100960065, 0.156434465040231, 0.17364817766693, 0.190808995376545, 0.207911690817759, 0.224951054343865, 0.241921895599668, 0.258819045102521, 0.275637355816999, 0.292371704722737, 0.309016994374947, 0.325568154457157, 0.342020143325669, 0.3583679495453, 0.374606593415912, 0.390731128489274, 0.4067366430758, 0.4226182617407, 0.438371146789078, 0.453990499739547, 0.469471562785891, 0.484809620246337, 0.5, 0.515038074910054, 0.529919264233205, 0.544639035015027, 0.559192903470747, 0.573576436351046, 0.587785252292473, 0.601815023152049, 0.615661475325659, 0.629320391049838, 0.64278760968654, 0.656059028990508, 0.669130606358859, 0.681998360062499, 0.694658370458998, 0.707106781186548, 0.719339800338652, 0.731353701619171, 0.743144825477395, 0.754709580222772, 0.766044443118979, 0.777145961456971, 0.788010753606722, 0.798635510047293, 0.809016994374948, 0.819152044288992, 0.829037572555042, 0.838670567945424, 0.848048096156427, 0.857167300702113, 0.866025403784439, 0.874619707139396, 0.882947592858927, 0.891006524188368, 0.898794046299167, 0.90630778703665, 0.913545457642601, 0.920504853452441, 0.927183854566788, 0.933580426497202, 0.939692620785909, 0.945518575599317, 0.951056516295154, 0.956304755963036, 0.961261695938319, 0.965925826289069, 0.970295726275997, 0.974370064785236, 0.978147600733806, 0.981627183447664, 0.984807753012208, 0.987688340595138, 0.99026806874157, 0.992546151641322, 0.994521895368274, 0.996194698091746, 0.997564050259824, 0.998629534754574, 0.999390827019096, 0.999847695156391, 1, 0.999847695156391, 0.999390827019096, 0.998629534754574, 0.997564050259824, 0.996194698091745, 0.994521895368273, 0.992546151641322, 0.99026806874157, 0.987688340595137, 0.984807753012208, 0.981627183447664, 0.978147600733805, 0.974370064785235, 0.970295726275996, 0.965925826289068, 0.961261695938318, 0.956304755963035, 0.951056516295153, 0.945518575599316, 0.939692620785908, 0.933580426497201, 0.927183854566787, 0.920504853452439, 0.9135454576426, 0.906307787036649, 0.898794046299166, 0.891006524188367, 0.882947592858926, 0.874619707139395, 0.866025403784438, 0.857167300702112, 0.848048096156426, 0.838670567945424, 0.829037572555042, 0.819152044288992, 0.809016994374947, 0.798635510047293, 0.788010753606722, 0.777145961456971, 0.766044443118979, 0.754709580222773, 0.743144825477395, 0.731353701619171, 0.719339800338652, 0.707106781186549, 0.694658370458999, 0.6819983600625, 0.66913060635886, 0.656059028990509, 0.642787609686541, 0.62932039104984, 0.615661475325661, 0.601815023152051, 0.587785252292476, 0.573576436351049, 0.55919290347075, 0.544639035015031, 0.529919264233209, 0.515038074910058, 0.500000000000004, 0.484809620246341, 0.469471562785895, 0.453990499739552, 0.438371146789082, 0.422618261740705, 0.406736643075806, 0.390731128489279, 0.374606593415918, 0.358367949545306, 0.342020143325675, 0.325568154457163, 0.309016994374954, 0.292371704722744, 0.275637355817006, 0.258819045102528, 0.241921895599676, 0.224951054343873, 0.207911690817768, 0.190808995376553, 0.173648177666939, 0.15643446504024, 0.139173100960075, 0.121869343405157, 0.104528463267663, 0.0871557427476679, 0.0697564737441353, 0.052335956242954, 0.0348994967025113, 0.0174524064372941, 1.07806057163162E-14, -0.0174524064372725, -0.0348994967024898, -0.0523359562429325, -0.0697564737441138, -0.0871557427476465, -0.104528463267642, -0.121869343405135, -0.139173100960053, -0.156434465040218, -0.173648177666918, -0.190808995376532, -0.207911690817746, -0.224951054343852, -0.241921895599655, -0.258819045102507, -0.275637355816986, -0.292371704722723, -0.309016994374934, -0.325568154457143, -0.342020143325655, -0.358367949545286, -0.374606593415898, -0.39073112848926, -0.406736643075786, -0.422618261740685, -0.438371146789063, -0.453990499739532, -0.469471562785876, -0.484809620246323, -0.499999999999986, -0.51503807491004, -0.52991926423319, -0.544639035015013, -0.559192903470732, -0.573576436351032, -0.587785252292459, -0.601815023152034, -0.615661475325644, -0.629320391049823, -0.642787609686525, -0.656059028990493, -0.669130606358844, -0.681998360062484, -0.694658370458983, -0.707106781186534, -0.719339800338637, -0.731353701619157, -0.743144825477381, -0.754709580222759, -0.766044443118965, -0.777145961456958, -0.788010753606709, -0.79863551004728, -0.809016994374935, -0.819152044288979, -0.829037572555029, -0.838670567945412, -0.848048096156414, -0.857167300702101, -0.866025403784427, -0.874619707139385, -0.882947592858916, -0.891006524188357, -0.898794046299157, -0.90630778703664, -0.913545457642591, -0.920504853452431, -0.927183854566778, -0.933580426497193, -0.9396926207859, -0.945518575599309, -0.951056516295146, -0.956304755963028, -0.961261695938312, -0.965925826289062, -0.97029572627599, -0.974370064785229, -0.9781476007338, -0.981627183447659, -0.984807753012203, -0.987688340595134, -0.990268068741567, -0.992546151641319, -0.994521895368271, -0.996194698091743, -0.997564050259822, -0.998629534754572, -0.999390827019095, -0.999847695156391, -1, -0.999847695156392, -0.999390827019097, -0.998629534754575, -0.997564050259826, -0.996194698091748, -0.994521895368276, -0.992546151641326, -0.990268068741574, -0.987688340595142, -0.984807753012213, -0.98162718344767, -0.978147600733812, -0.974370064785242, -0.970295726276004, -0.965925826289076, -0.961261695938328, -0.956304755963045, -0.951056516295164, -0.945518575599327, -0.93969262078592, -0.933580426497214, -0.9271838545668, -0.920504853452453, -0.913545457642615, -0.906307787036664, -0.898794046299182, -0.891006524188383, -0.882947592858943, -0.874619707139413, -0.866025403784456, -0.85716730070213, -0.848048096156444, -0.838670567945443, -0.829037572555061, -0.819152044289012, -0.809016994374968, -0.798635510047314, -0.788010753606744, -0.777145961456994, -0.766044443119002, -0.754709580222796, -0.743144825477419, -0.731353701619196, -0.719339800338677, -0.707106781186574, -0.694658370459024, -0.681998360062526, -0.669130606358887, -0.656059028990536, -0.642787609686569, -0.629320391049868, -0.615661475325689, -0.601815023152079, -0.587785252292505, -0.573576436351078, -0.55919290347078, -0.544639035015061, -0.529919264233239, -0.515038074910089, -0.500000000000035, -0.484809620246373, -0.469471562785927, -0.453990499739583, -0.438371146789115, -0.422618261740737, -0.406736643075838, -0.390731128489312, -0.374606593415951, -0.35836794954534, -0.342020143325709, -0.325568154457197, -0.309016994374988, -0.292371704722778, -0.275637355817041, -0.258819045102563, -0.24192189559971, -0.224951054343908, -0.207911690817802, -0.190808995376588, -0.173648177666974, -0.156434465040275, -0.13917310096011, -0.121869343405192, -0.104528463267698, -0.0871557427477034, -0.0697564737441708, -0.0523359562429896, -0.034899496702547, -0.0174524064373297];
public static const cos:Array = [1, 0.999847695156391, 0.999390827019096, 0.998629534754574, 0.997564050259824, 0.996194698091746, 0.994521895368273, 0.992546151641322, 0.99026806874157, 0.987688340595138, 0.984807753012208, 0.981627183447664, 0.978147600733806, 0.974370064785235, 0.970295726275996, 0.965925826289068, 0.961261695938319, 0.956304755963035, 0.951056516295154, 0.945518575599317, 0.939692620785908, 0.933580426497202, 0.927183854566787, 0.92050485345244, 0.913545457642601, 0.90630778703665, 0.898794046299167, 0.891006524188368, 0.882947592858927, 0.874619707139396, 0.866025403784438, 0.857167300702112, 0.848048096156426, 0.838670567945424, 0.829037572555042, 0.819152044288992, 0.809016994374947, 0.798635510047293, 0.788010753606722, 0.777145961456971, 0.766044443118978, 0.754709580222772, 0.743144825477394, 0.73135370161917, 0.719339800338651, 0.707106781186547, 0.694658370458997, 0.681998360062498, 0.669130606358858, 0.656059028990507, 0.642787609686539, 0.629320391049837, 0.615661475325658, 0.601815023152048, 0.587785252292472, 0.573576436351045, 0.559192903470746, 0.544639035015026, 0.529919264233204, 0.515038074910053, 0.499999999999999, 0.484809620246336, 0.46947156278589, 0.453990499739546, 0.438371146789076, 0.422618261740698, 0.406736643075799, 0.390731128489273, 0.374606593415911, 0.358367949545299, 0.342020143325668, 0.325568154457155, 0.309016994374946, 0.292371704722735, 0.275637355816998, 0.258819045102519, 0.241921895599666, 0.224951054343864, 0.207911690817758, 0.190808995376543, 0.173648177666929, 0.156434465040229, 0.139173100960064, 0.121869343405146, 0.104528463267652, 0.0871557427476566, 0.0697564737441237, 0.0523359562429422, 0.0348994967024993, 0.0174524064372818, -1.71512449944288E-15, -0.0174524064372853, -0.0348994967025027, -0.0523359562429456, -0.0697564737441271, -0.08715574274766, -0.104528463267655, -0.121869343405149, -0.139173100960067, -0.156434465040233, -0.173648177666932, -0.190808995376547, -0.207911690817761, -0.224951054343867, -0.24192189559967, -0.258819045102523, -0.275637355817001, -0.292371704722739, -0.309016994374949, -0.325568154457159, -0.342020143325671, -0.358367949545302, -0.374606593415914, -0.390731128489276, -0.406736643075802, -0.422618261740701, -0.438371146789079, -0.453990499739548, -0.469471562785892, -0.484809620246338, -0.500000000000001, -0.515038074910055, -0.529919264233206, -0.544639035015028, -0.559192903470747, -0.573576436351046, -0.587785252292473, -0.601815023152048, -0.615661475325658, -0.629320391049837, -0.642787609686539, -0.656059028990506, -0.669130606358857, -0.681998360062497, -0.694658370458996, -0.707106781186546, -0.71933980033865, -0.731353701619169, -0.743144825477393, -0.75470958022277, -0.766044443118976, -0.777145961456969, -0.78801075360672, -0.798635510047291, -0.809016994374945, -0.81915204428899, -0.829037572555039, -0.838670567945422, -0.848048096156424, -0.85716730070211, -0.866025403784436, -0.874619707139393, -0.882947592858924, -0.891006524188365, -0.898794046299164, -0.906307787036647, -0.913545457642598, -0.920504853452438, -0.927183854566785, -0.933580426497199, -0.939692620785906, -0.945518575599315, -0.951056516295151, -0.956304755963033, -0.961261695938317, -0.965925826289066, -0.970295726275995, -0.974370064785233, -0.978147600733804, -0.981627183447662, -0.984807753012207, -0.987688340595136, -0.990268068741569, -0.992546151641321, -0.994521895368272, -0.996194698091745, -0.997564050259824, -0.998629534754573, -0.999390827019095, -0.999847695156391, -1, -0.999847695156391, -0.999390827019096, -0.998629534754574, -0.997564050259825, -0.996194698091747, -0.994521895368275, -0.992546151641324, -0.990268068741572, -0.98768834059514, -0.98480775301221, -0.981627183447666, -0.978147600733808, -0.974370064785238, -0.970295726276, -0.965925826289072, -0.961261695938323, -0.95630475596304, -0.951056516295158, -0.945518575599322, -0.939692620785913, -0.933580426497207, -0.927183854566793, -0.920504853452446, -0.913545457642607, -0.906307787036657, -0.898794046299174, -0.891006524188375, -0.882947592858935, -0.874619707139404, -0.866025403784447, -0.857167300702121, -0.848048096156435, -0.838670567945433, -0.829037572555052, -0.819152044289002, -0.809016994374958, -0.798635510047304, -0.788010753606733, -0.777145961456983, -0.76604444311899, -0.754709580222784, -0.743144825477407, -0.731353701619184, -0.719339800338665, -0.707106781186561, -0.694658370459012, -0.681998360062513, -0.669130606358873, -0.656059028990523, -0.642787609686555, -0.629320391049854, -0.615661475325675, -0.601815023152065, -0.58778525229249, -0.573576436351064, -0.559192903470765, -0.544639035015046, -0.529919264233224, -0.515038074910073, -0.50000000000002, -0.484809620246357, -0.469471562785911, -0.453990499739568, -0.438371146789098, -0.422618261740721, -0.406736643075822, -0.390731128489296, -0.374606593415934, -0.358367949545323, -0.342020143325692, -0.32556815445718, -0.309016994374971, -0.292371704722761, -0.275637355817024, -0.258819045102545, -0.241921895599693, -0.22495105434389, -0.207911690817785, -0.190808995376571, -0.173648177666957, -0.156434465040257, -0.139173100960092, -0.121869343405174, -0.104528463267681, -0.0871557427476857, -0.069756473744153, -0.0523359562429718, -0.0348994967025292, -0.0174524064373119, -2.86054064502761E-14, 0.0174524064372547, 0.034899496702472, 0.0523359562429147, 0.069756473744096, 0.0871557427476287, 0.104528463267624, 0.121869343405118, 0.139173100960036, 0.156434465040201, 0.1736481776669, 0.190808995376515, 0.207911690817729, 0.224951054343835, 0.241921895599637, 0.25881904510249, 0.275637355816969, 0.292371704722706, 0.309016994374917, 0.325568154457126, 0.342020143325638, 0.35836794954527, 0.374606593415881, 0.390731128489243, 0.40673664307577, 0.422618261740669, 0.438371146789047, 0.453990499739517, 0.469471562785861, 0.484809620246307, 0.49999999999997, 0.515038074910024, 0.529919264233175, 0.544639035014998, 0.559192903470717, 0.573576436351017, 0.587785252292444, 0.60181502315202, 0.61566147532563, 0.629320391049809, 0.642787609686511, 0.65605902899048, 0.669130606358831, 0.681998360062471, 0.69465837045897, 0.707106781186521, 0.719339800338625, 0.731353701619145, 0.743144825477369, 0.754709580222747, 0.766044443118953, 0.777145961456946, 0.788010753606698, 0.798635510047269, 0.809016994374924, 0.819152044288969, 0.82903757255502, 0.838670567945402, 0.848048096156405, 0.857167300702092, 0.866025403784418, 0.874619707139376, 0.882947592858908, 0.891006524188349, 0.898794046299149, 0.906307787036632, 0.913545457642584, 0.920504853452424, 0.927183854566772, 0.933580426497187, 0.939692620785894, 0.945518575599303, 0.95105651629514, 0.956304755963023, 0.961261695938307, 0.965925826289057, 0.970295726275986, 0.974370064785225, 0.978147600733796, 0.981627183447656, 0.9848077530122, 0.987688340595131, 0.990268068741564, 0.992546151641317, 0.994521895368269, 0.996194698091742, 0.997564050259821, 0.998629534754572, 0.999390827019094, 0.99984769515639];
}
}//package com.nitrome.engine
Section 13
//Util (com.nitrome.engine.Util)
package com.nitrome.engine {
import flash.display.*;
import flash.geom.*;
public class Util {
public static const RIGHT:Number = 2;
public static const UP_RIGHT_ROTATION:Number = 45;
public static const LEFT:Number = 8;
public static const UP_LEFT_ROTATION:Number = 315;
public static const DOWN_LEFT_ROTATION:Number = 225;
public static const UP:Number = 1;
public static const DOWN_RIGHT_ROTATION:Number = 135;
public static const RIGHT_ROTATION:Number = 90;
public static const UP_ROTATION:Number = 0;
public static const DOWN:Number = 4;
public static const LEFT_ROTATION:Number = 270;
public static const DOWN_ROTATION:Number = 180;
public static function stopClips(_arg1:DisplayObjectContainer):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.numChildren) {
if ((_arg1.getChildAt(_local2) is MovieClip)){
(_arg1.getChildAt(_local2) as MovieClip).stop();
};
if ((_arg1.getChildAt(_local2) is DisplayObjectContainer)){
stopClips((_arg1.getChildAt(_local2) as DisplayObjectContainer));
};
_local2++;
};
}
public static function localToLocal(_arg1:Point, _arg2:DisplayObject, _arg3:DisplayObject):Point{
_arg1.x = (_arg1.y = 0);
_arg1 = _arg2.localToGlobal(_arg1);
_arg1 = _arg3.globalToLocal(_arg1);
return (_arg1);
}
public static function mcToString2(_arg1:Sprite, _arg2:Sprite):String{
var _local3:Point;
_local3 = new Point();
_local3 = Util.localToLocal(_local3, _arg1, _arg2);
return ((((("pos.x = " + _local3.x) + ";\npos.y = ") + _local3.y) + ";"));
}
public static function circleOverlap(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Boolean{
return (((((_arg4 - _arg1) * (_arg4 - _arg1)) + ((_arg5 - _arg2) * (_arg5 - _arg2))) <= ((_arg3 + _arg6) * (_arg3 + _arg6))));
}
public static function rectContains(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Boolean{
return ((((((((_arg5 >= _arg1)) && ((_arg6 >= _arg2)))) && ((_arg5 < (_arg1 + _arg3))))) && ((_arg6 < (_arg2 + _arg4)))));
}
public static function
(_arg1:Array):String{
var _local2:String;
var _local3:Number;
var _local4:int;
_local2 = "";
_local3 = 0;
_local4 = 0;
while (_local4 < _arg1.length) {
_local3++;
if (_arg1[_local4] != _arg1[(_local4 + 1)]){
_local2 = (_local2 + _arg1[_local4]);
if (_local3 > 1){
_local2 = (_local2 + (":" + _local3));
};
if (_local4 < (_arg1.length - 1)){
_local2 = (_local2 + ",");
};
_local3 = 0;
};
_local4++;
};
return (_local2);
}
public static function degreeLerp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
_arg1 = (_arg1 + ((Math.abs((_arg2 - _arg1)))>180) ? ((_arg1)<_arg2) ? 360 : -(360) : 0);
return ((_arg1 + ((_arg2 - _arg1) * _arg3)));
}
public static function unserialize(_arg1:String):Array{
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:int;
var _local7:int;
_local2 = [];
_local3 = _arg1.split(",");
_local4 = 0;
while (_local4 < _local3.length) {
if (_local3[_local4].indexOf(":") > -1){
_local5 = _local3[_local4].split(":");
_local6 = parseInt(_local5[1]);
_local7 = 0;
while (_local7 < _local6) {
_local2.push(_local5[0]);
_local7++;
};
} else {
_local2.push(_local3[_local4]);
};
_local4++;
};
return (_local2);
}
public static function wrapLerp(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
var _local6:Number;
_local6 = Math.abs((_arg4 - _arg5));
_arg1 = (_arg1 + ((Math.abs((_arg2 - _arg1)))>(_local6 * 0.5)) ? ((_arg1)<_arg2) ? _local6 : -(_local6) : 0);
return (
(_arg1, _arg2, _arg3));
}
public static function sideToString(_arg1:int):String{
if (_arg1 == UP){
return ("UP");
};
if (_arg1 == RIGHT){
return ("RIGHT");
};
if (_arg1 == DOWN){
return ("DOWN");
};
if (_arg1 == LEFT){
return ("LEFT");
};
return ("null");
}
public static function onScreen(_arg1:Number, _arg2:Number, _arg3:Game, _arg4:Number):Boolean{
return (((((((((_arg1 + _arg4) >= -(_arg3.canvas.x))) && (((_arg2 + _arg4) >= -(_arg3.canvas.y))))) && (((_arg1 - _arg4) < (-(_arg3.canvas.x) + Game.WIDTH))))) && (((_arg2 - _arg4) < (-(_arg3.canvas.y) + Game.HEIGHT)))));
}
public static function startClips(_arg1:DisplayObjectContainer):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.numChildren) {
if ((_arg1.getChildAt(_local2) is MovieClip)){
(_arg1.getChildAt(_local2) as MovieClip).gotoAndPlay((_arg1.getChildAt(_local2) as MovieClip).currentFrame);
};
if ((_arg1.getChildAt(_local2) is DisplayObjectContainer)){
startClips((_arg1.getChildAt(_local2) as DisplayObjectContainer));
};
_local2++;
};
}
public static function circleInside(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Boolean{
return (((((_arg4 - _arg1) * (_arg4 - _arg1)) + ((_arg5 - _arg2) * (_arg5 - _arg2))) <= ((_arg6 - _arg3) * (_arg6 - _arg3))));
}
public static function getRotation(_arg1:int):Number{
var _local2:int;
_local2 = 0;
switch (_arg1){
case UP:
_local2 = UP_ROTATION;
break;
case RIGHT:
_local2 = RIGHT_ROTATION;
break;
case DOWN:
_local2 = DOWN_ROTATION;
break;
case LEFT:
_local2 = LEFT_ROTATION;
break;
};
return (_local2);
}
public static function thetaLerp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
_arg1 = (_arg1 + ((Math.abs((_arg2 - _arg1)))>Math.PI) ? ((_arg1)<_arg2) ? (Math.PI * 2) : -((Math.PI * 2)) : 0);
return ((_arg1 + ((_arg2 - _arg1) * _arg3)));
}
public static function
(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return ((_arg1 + ((_arg2 - _arg1) * _arg3)));
}
public static function mcToString(_arg1:Sprite):String{
return ((((("(" + _arg1.x) + " ") + _arg1.y) + ")"));
}
public static function proximity(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
return (((((_arg3 - _arg1) * (_arg3 - _arg1)) + ((_arg4 - _arg2) * (_arg4 - _arg2))) <= (_arg5 * _arg5)));
}
}
}//package com.nitrome.engine
Section 14
//ArmPos (com.nitrome.engine_specific.ArmPos)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class ArmPos {
static function getPos(_arg1:Dot, _arg2:String, _arg3:int=1):Dot{
if (_arg2 == "run_left"){
_arg1.x = 6;
if (_arg3 == 1){
_arg1.y = -23;
} else {
if (_arg3 == 2){
_arg1.y = -21;
} else {
if (_arg3 == 3){
_arg1.y = -22;
} else {
if (_arg3 == 4){
_arg1.y = -22;
} else {
if (_arg3 == 5){
_arg1.y = -23;
} else {
if (_arg3 == 6){
_arg1.y = -24;
} else {
if (_arg3 == 7){
_arg1.y = -23;
} else {
if (_arg3 == 8){
_arg1.y = -21;
} else {
if (_arg3 == 9){
_arg1.y = -22;
} else {
if (_arg3 == 10){
_arg1.y = -22;
} else {
if (_arg3 == 11){
_arg1.y = -23;
} else {
if (_arg3 == 12){
_arg1.y = -24;
};
};
};
};
};
};
};
};
};
};
};
};
return (_arg1);
} else {
if (_arg2 == "run_right"){
_arg1.x = -6;
if (_arg3 == 1){
_arg1.y = -23;
} else {
if (_arg3 == 2){
_arg1.y = -21;
} else {
if (_arg3 == 3){
_arg1.y = -22;
} else {
if (_arg3 == 4){
_arg1.y = -22;
} else {
if (_arg3 == 5){
_arg1.y = -23;
} else {
if (_arg3 == 6){
_arg1.y = -24;
} else {
if (_arg3 == 7){
_arg1.y = -23;
} else {
if (_arg3 == 8){
_arg1.y = -21;
} else {
if (_arg3 == 9){
_arg1.y = -22;
} else {
if (_arg3 == 10){
_arg1.y = -22;
} else {
if (_arg3 == 11){
_arg1.y = -23;
} else {
if (_arg3 == 12){
_arg1.y = -24;
};
};
};
};
};
};
};
};
};
};
};
};
return (_arg1);
} else {
if ((((_arg2 == "wait_left")) || ((_arg2 == "wait_in_left")))){
_arg1.x = 10;
_arg1.y = -15;
return (_arg1);
};
if ((((_arg2 == "wait_right")) || ((_arg2 == "wait_in_right")))){
_arg1.x = -10;
_arg1.y = -15;
return (_arg1);
};
if (_arg2 == "jump_left"){
_arg1.x = 13;
_arg1.y = -27;
return (_arg1);
};
if (_arg2 == "jump_right"){
_arg1.x = -13;
_arg1.y = -27;
return (_arg1);
};
if (_arg2 == "fall_left"){
_arg1.x = 11;
_arg1.y = -21;
return (_arg1);
};
if (_arg2 == "fall_right"){
_arg1.x = -11;
_arg1.y = -21;
return (_arg1);
};
if (_arg2 == "swing_left"){
_arg1.x = 11;
_arg1.y = -21;
return (_arg1);
};
if (_arg2 == "swing_right"){
_arg1.x = -11;
_arg1.y = -21;
return (_arg1);
};
if (_arg2 == "wall_left"){
_arg1.x = 9;
_arg1.y = -17;
return (_arg1);
};
if (_arg2 == "wall_right"){
_arg1.x = -9;
_arg1.y = -17;
return (_arg1);
};
if (_arg2 == "stealth"){
_arg1.x = 0;
_arg1.y = 0;
return (_arg1);
};
};
};
return (_arg1);
}
}
}//package com.nitrome.engine_specific
Section 15
//BitmapSprite (com.nitrome.engine_specific.BitmapSprite)
package com.nitrome.engine_specific {
import flash.display.*;
import flash.geom.*;
public class BitmapSprite {
public var width:int;
public var total_frames:int;
public var test:BitmapData;
public var dx:int;
public var dy:int;
public var rect:Rectangle;
public var :Array;
public var height:int;
public var p:Point;
public var x:int;
public var y:int;
public static var p:Point;
public function BitmapSprite(_arg1:MovieClip){
var _local2:Rectangle;
var _local3:int;
super();
x = (y = 0);
= [];
_local2 = _arg1.getBounds(_arg1);
_local3 = 0;
while (_local3 < _arg1.totalFrames) {
_arg1.gotoAndStop((_local3 + 1));
[_local3] = new BitmapData(Math.ceil(_local2.width), Math.ceil(_local2.height), true, 0);
[_local3].draw(_arg1, new Matrix(1, 0, 0, 1, -(_local2.left), -(_local2.top)));
_local3++;
};
total_frames = _arg1.totalFrames;
width = _local2.width;
height = _local2.height;
dx = _local2.left;
dy = _local2.top;
rect = new Rectangle(0, 0, Math.ceil(_local2.width), Math.ceil(_local2.height));
p = new Point();
}
public function (_arg1:Rectangle):void{
.push(_arg1);
}
public function render(_arg1:BitmapData, _arg2:int):void{
p.x = (x + dx);
p.y = (y + dy);
_arg1.copyPixels([_arg2], rect, p, null, null, true);
}
public function (_arg1:Array):void{
= .concat(_arg1);
}
}
}//package com.nitrome.engine_specific
Section 16
//BladeMan (com.nitrome.engine_specific.BladeMan)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class BladeMan extends Encounter {
public var py:Number;
public var count:int;
public var cast:RayCastReport;
public var previous_state:int;
public var dot:Dot;
public var health:int;// = 3
public var platform:Boolean;
public var attack_rect:Rect;
public var scan:Line;
public var health_fraction:Number;// = 0.333
public var state:int;
public var dir:int;
public var grid_x:int;
public var grid_y:int;
public var collision_rect:Rect;
public var temp_y:Number;
public static const LEFT:int = 8;
private static const GRAVITY_Y:Number = 1.3;
public static const DEFLECT:int = 32;
private static const JUMP_ATTACK_Y:Array = [-21, -21, -21, -21, -21, -21, -21, -21, -21, -51, -81, -121, -154, -169, -170, -170, -170, -170, -170, -170, -118, -58, -21, -21, -21, -21, -21, -21, -21, -21, -21];
private static const INTO_DEFEND_DELAY:int = 8;
public static const UP:int = 1;
private static const JUMP_ATTACK_DELAY:int = 30;
public static const RUNNING:int = 1;
private static const height:int = 42;
private static const FLOOR_DEPTH:int = 6;
public static const DOWN:int = 4;
private static const ATTACK_DELAY:int = 13;
public static const WAITING:int = 4;
public static const SPEED:Number = 6;
private static const DEFLECT_DELAY:int = 3;
public static const TEST_DEPTH:int = 5;
private static const RECOVER_DELAY:int = 10;
private static const JUMP_ATTACK_DIST:int = 150;
private static const DAMPING_Y:Number = 0.99;
private static const ATTACK_DIST:int = 50;
public static const RECOVER:int = 64;
private static const width:int = 26;
public static const ATTACK:int = 8;
public static const DEFEND:int = 128;
public static const FALLING:int = 2;
public static const INTO_DEFEND:int = 254;
public static const JUMP_ATTACK:int = 16;
public static const RIGHT:int = 2;
public function BladeMan(_arg1:int, _arg2:Sprite, _arg3:Game){
health = 3;
health_fraction = 0.333;
super(_arg2, _arg3, true);
has_main = true;
has_collision = true;
this.dir = _arg1;
collision_rect = new Rect((x - (width >> 1)), (y - (height >> 1)), 26, 42);
attack_rect = new Rect();
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
py = y;
if (_arg3.stack_map[(map_y + 1)][map_x] > -1){
platform = true;
state = WAITING;
} else {
platform = false;
state = FALLING;
};
if (_arg3.player != null){
scan = new Line(new Dot(_arg2.x, _arg2.y), _arg3.player);
};
reward = new HiddenInt(70);
on_scroller = false;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
}
override public function intersects(_arg1:Rect):Boolean{
return (attack_rect.intersects(_arg1));
}
public function updateAnimState():void{
if (state == RUNNING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "run_right"){
(mc as MovieClip).gotoAndStop("run_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "run_left"){
(mc as MovieClip).gotoAndStop("run_left");
};
};
};
} else {
if ((((state == WAITING)) || ((state == RECOVER)))){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "wait_right"){
(mc as MovieClip).gotoAndStop("wait_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "wait_left"){
(mc as MovieClip).gotoAndStop("wait_left");
};
};
};
} else {
if (state == ATTACK){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "attack_right"){
(mc as MovieClip).gotoAndStop("attack_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "attack_left"){
(mc as MovieClip).gotoAndStop("attack_left");
};
};
};
} else {
if (state == JUMP_ATTACK){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "jump_attack_right"){
(mc as MovieClip).gotoAndStop("jump_attack_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "jump_attack_left"){
(mc as MovieClip).gotoAndStop("jump_attack_left");
};
};
};
} else {
if (state == FALLING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "fall_right"){
(mc as MovieClip).gotoAndStop("fall_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "fall_left"){
(mc as MovieClip).gotoAndStop("fall_left");
};
};
};
} else {
if (state == INTO_DEFEND){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "into_defend_right"){
(mc as MovieClip).gotoAndStop("into_defend_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "into_defend_left"){
(mc as MovieClip).gotoAndStop("into_defend_left");
};
};
};
} else {
if (state == DEFEND){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "defend_right"){
(mc as MovieClip).gotoAndStop("defend_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "defend_left"){
(mc as MovieClip).gotoAndStop("defend_left");
};
};
};
} else {
if (state == DEFLECT){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "deflect_right"){
(mc as MovieClip).gotoAndStop("deflect_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "deflect_left"){
(mc as MovieClip).gotoAndStop("deflect_left");
};
};
};
};
};
};
};
};
};
};
};
}
public function kill(_arg1:Number):void{
if (!active){
return;
};
if (!spawned){
NitromeGame.bonus.enemy_count.value++;
};
active = false;
g.addFX(mc.x, mc.y, g.bang_bitmap1);
if (Math.random() > 0.5){
g.addSmoke(mc.x, mc.y);
};
g.addDebris((collision_rect.x + (collision_rect.width * 0.5)), (collision_rect.y + (collision_rect.height * 0.5)), ((_arg1 > 0)) ? 10 : -10, g.debris_clips[11], g.debris_clips[10], g.debris_clips[9]);
}
public function toString():String{
var _local1:String;
_local1 = "";
if (state == ATTACK){
_local1 = "ATTACK";
} else {
if (state == JUMP_ATTACK){
_local1 = "JUMP_ATTACK";
} else {
if (state == RUNNING){
_local1 = "RUNNING";
} else {
if (state == WAITING){
_local1 = "WAITING";
} else {
if (state == RECOVER){
_local1 = "RECOVER";
} else {
if (state == FALLING){
_local1 = "FALLING";
} else {
if (state == INTO_DEFEND){
_local1 = "INTO_DEFEND";
} else {
if (state == DEFEND){
_local1 = "DEFEND";
} else {
if (state == DEFLECT){
_local1 = "DEFLECT";
};
};
};
};
};
};
};
};
};
_local1 = (_local1 + ((((("(" + x) + ",") + y) + ")") + count));
return (_local1);
}
public function main():void{
on_scroller = g.scroller.contains(x, y);
if (((!(forced)) && (!(on_scroller)))){
if (dir == LEFT){
tile_id = "22";
} else {
if (dir == RIGHT){
tile_id = "23";
};
};
remove();
return;
};
if (!g.player.active){
state = WAITING;
};
if (state == WAITING){
if (scan != null){
scan.a.x = mc.x;
scan.a.y = mc.y;
scan.updateLine();
cast = RayCast.cast(scan, g.block_map, true);
if (((((((g.player.active) && (!(g.player.chameleon)))) && ((((((g.player.x < x)) && ((dir == LEFT)))) || ((((g.player.x > x)) && ((dir == RIGHT)))))))) && (RayCast.reportIntersectsRect(scan, cast, g.player.collision_rect)))){
state = RUNNING;
};
} else {
if (g.player != null){
scan = new Line(new Dot(mc.x, mc.y), g.player);
};
};
};
if (state == RUNNING){
move();
scan.updateLine();
if (on_scroller){
cast = RayCast.cast(scan, g.block_map, true);
if (((((((g.player.active) && (!(g.player.chameleon)))) && (!((g.player.state == Player.STEALTH))))) && ((g.player.x < (x - (width >> 1)))))){
dir = LEFT;
} else {
if (((((((g.player.active) && (!(g.player.chameleon)))) && (!((g.player.state == Player.STEALTH))))) && ((g.player.x > (x + (width >> 1)))))){
dir = RIGHT;
};
};
if (((((((((g.player.active) && (!(g.player.chameleon)))) && (!((g.player.state == Player.STEALTH))))) && ((g.player.map_y == map_y)))) && (Util.proximity(x, y, g.player.x, g.player.y, ATTACK_DIST)))){
state = ATTACK;
count = 0;
} else {
if (((((((((((g.player.active) && (!(g.player.chameleon)))) && (!((g.player.state == Player.STEALTH))))) && (RayCast.reportIntersectsRect(scan, cast, g.player.collision_rect)))) && ((g.player.map_y < map_y)))) && (Util.proximity(x, y, g.player.x, g.player.y, JUMP_ATTACK_DIST)))){
state = JUMP_ATTACK;
count = 0;
};
};
};
if (dir == RIGHT){
grid_x = ((((x + (width >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if (g.stack_map[grid_y][grid_x] > Game.EMPTY){
state = INTO_DEFEND;
count = 0;
};
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
state = INTO_DEFEND;
count = 0;
};
} else {
if (dir == LEFT){
grid_x = ((((x - (width >> 1)) - TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if (g.stack_map[grid_y][grid_x] > Game.EMPTY){
state = INTO_DEFEND;
count = 0;
};
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
state = INTO_DEFEND;
count = 0;
};
};
};
if (state == RUNNING){
if (grid_x == (g.scroller.width - 1)){
dir = LEFT;
};
if (grid_x == 0){
dir = RIGHT;
};
};
} else {
if (state == FALLING){
findFloor();
if (platform == false){
verletY(GRAVITY_Y, DAMPING_Y);
};
} else {
if (state == INTO_DEFEND){
count++;
if (count >= INTO_DEFEND_DELAY){
state = DEFEND;
};
} else {
if (state == DEFEND){
if (((((!((g.player.state == Player.STEALTH))) && (!(g.player.chameleon)))) && ((((((dir == RIGHT)) && ((g.player.x < x)))) || ((((dir == LEFT)) && ((g.player.x > x)))))))){
state = RUNNING;
};
} else {
if (state == DEFLECT){
count++;
if (count >= DEFLECT_DELAY){
state = previous_state;
};
} else {
if (state == ATTACK){
count++;
if (count >= ATTACK_DELAY){
state = RECOVER;
count = 0;
};
} else {
if (state == JUMP_ATTACK){
count++;
if (count >= JUMP_ATTACK_DELAY){
state = RECOVER;
count = 0;
};
} else {
if (state == RECOVER){
count++;
if (count >= RECOVER_DELAY){
state = RUNNING;
count = 0;
};
};
};
};
};
};
};
};
};
updateAnimState();
updateMC();
updateCollisionRect();
}
public function verletY(_arg1:Number, _arg2:Number):void{
temp_y = y;
y = (y + ((_arg2 * (y - py)) + _arg1));
py = temp_y;
map_y = ((y * Game.SCALE) >> 0);
}
override public function resolvePlayerCollision(_arg1:Player):void{
if ((((state == ATTACK)) || ((state == JUMP_ATTACK)))){
if (state == JUMP_ATTACK){
if ((((count == 18)) || ((count == 19)))){
if (!_arg1.collision_rect.intersectsCircle(x, (collision_rect.y + (height >> 1)), 40)){
return;
};
};
};
if (state == ATTACK){
if ((((count == 3)) || ((count == 4)))){
if (!_arg1.collision_rect.intersectsCircle(x, (y - 5), 40)){
return;
};
};
};
_arg1.hit();
};
}
public function findFloor():void{
if (g.stack_map[(map_y + 1)][map_x] > -1){
platform = true;
y = ((-1 + ((map_y + 1) * Game.scale)) - (height >> 1));
updateCollisionRect();
state = WAITING;
};
}
public function move():void{
if (dir == RIGHT){
x = (x + SPEED);
scan.a.x = (scan.a.x + SPEED);
} else {
if (dir == LEFT){
x = (x - SPEED);
scan.a.x = (scan.a.x - SPEED);
};
};
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
}
public function updateCollisionRect():void{
collision_rect.x = (x - (width >> 1));
collision_rect.y = (y - (height >> 1));
attack_rect.x = (attack_rect.y = (attack_rect.width = (attack_rect.height = 0)));
if (state == JUMP_ATTACK){
collision_rect.y = (y + JUMP_ATTACK_Y[count]);
if (count == 9){
attack_rect.x = ((dir == LEFT)) ? (x - 46) : (x - 20);
attack_rect.y = (y - 49);
attack_rect.width = 72;
attack_rect.height = 30;
} else {
if (count == 11){
attack_rect.x = ((dir == LEFT)) ? (x - 43) : (x - 23);
attack_rect.y = (y - 111);
attack_rect.width = 72;
attack_rect.height = 30;
} else {
if ((((count == 18)) || ((count == 19)))){
attack_rect.x = ((dir == LEFT)) ? (x - 48) : (x - 46);
attack_rect.y = (y - 203);
attack_rect.width = 92;
attack_rect.height = 92;
} else {
if (count == 20){
attack_rect.x = ((dir == LEFT)) ? (x - 39) : (x + 9);
attack_rect.y = (y - 88);
attack_rect.width = 30;
attack_rect.height = 5;
} else {
if ((((count >= 22)) && ((count <= 24)))){
attack_rect.x = ((dir == LEFT)) ? (x - 39) : (x + 9);
attack_rect.y = (y + 11);
attack_rect.width = 30;
attack_rect.height = 5;
};
};
};
};
};
};
if (state == ATTACK){
if ((((count == 3)) || ((count == 4)))){
attack_rect.x = ((dir == LEFT)) ? (x - 47) : (x - 41);
attack_rect.y = (y - 65);
attack_rect.width = 92;
attack_rect.height = 92;
} else {
if ((((count >= 5)) && ((count <= 7)))){
attack_rect.x = ((dir == LEFT)) ? (x - 39) : (x + 9);
attack_rect.y = (y + 11);
attack_rect.width = 30;
attack_rect.height = 5;
};
};
};
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:int;
if (!active){
return;
};
if (((!(_arg2)) && (!((((state == WAITING)) || ((state == RECOVER))))))){
if (!(((state == ATTACK)) || ((state == JUMP_ATTACK)))){
previous_state = state;
state = DEFLECT;
count = 0;
};
_arg1.ping((_arg1.px - _arg1.x));
return;
};
health--;
_local3 = new HitSparkMC();
_local3.x = (_arg1.x >> 0);
_local3.y = (_arg1.y >> 0);
_local4 = collision_rect.sideOf(_arg1.x, _arg1.y);
if (_local4 == UP){
} else {
if (_local4 == RIGHT){
_local3.rotation = 90;
} else {
if (_local4 == DOWN){
_local3.rotation = 180;
} else {
if (_local4 == LEFT){
_local3.rotation = 270;
};
};
};
};
g.effect_holder.addChild(_local3);
if (health <= 0){
if (!spawned){
g.addScore(reward.value);
} else {
g.addScore((reward.value / 10));
};
kill((_arg1.x - _arg1.px));
NitromeGame.sound_manager.playSound("smithdie");
} else {
NitromeGame.sound_manager.playSound("smithhit");
if (state == WAITING){
if ((((dir == RIGHT)) && ((g.player.x < x)))){
dir = LEFT;
} else {
if ((((dir == LEFT)) && ((g.player.x > x)))){
dir = RIGHT;
};
};
};
};
}
}
}//package com.nitrome.engine_specific
Section 17
//BladeManGuard (com.nitrome.engine_specific.BladeManGuard)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class BladeManGuard extends Actor {
public var detect_rect:Rect;
public var py:Number;
public var state:int;
public var dir:int;
public var count:int;
public var target:Encounter;
public var position:int;
public var grid_x:int;
public var grid_y:int;
public var previous_state:int;
public var dot:Dot;
public var :Number;
public var temp_y:Number;
public var :Number;
private var i:int;
public var platform:Boolean;
public var attack_rect:Rect;
public static const LEFT:int = 8;
private static const GRAVITY_Y:Number = 1.3;
public static const DEFLECT:int = 32;
private static const JUMP_ATTACK_Y:Array = [-21, -21, -21, -21, -21, -21, -21, -21, -21, -51, -81, -121, -154, -169, -170, -170, -170, -170, -170, -170, -118, -58, -21, -21, -21, -21, -21, -21, -21, -21, -21];
private static const INTO_DEFEND_DELAY:int = 8;
public static const UP:int = 1;
public static const ELECTRIC:int = 0x0200;
public static const RUNNING:int = 1;
private static const JUMP_ATTACK_DELAY:int = 30;
private static const GUARD_DIST:int = 50;
private static const FLOOR_DEPTH:int = 6;
public static const DOWN:int = 4;
private static const ATTACK_DELAY:int = 13;
public static const WAITING:int = 4;
public static const SPEED:Number = 6;
private static const DEFLECT_DELAY:int = 3;
public static const TEST_DEPTH:int = 5;
private static const RECOVER_DELAY:int = 10;
private static const JUMP_ATTACK_DIST:int = 150;
private static const DAMPING_Y:Number = 0.99;
public static const DEFEND:int = 128;
private static const height:int = 42;
public static const RECOVER:int = 64;
private static const width:int = 26;
public static const ATTACK:int = 8;
private static const ATTACK_DIST:int = 10;
public static const FALLING:int = 2;
public static const INTO_DEFEND:int = 0x0100;
public static const JUMP_ATTACK:int = 16;
public static const RIGHT:int = 2;
public static var point_man:BladeManGuard;
public static var rear_guard:Array = [];
public function BladeManGuard(_arg1:int, _arg2:Sprite, _arg3:Game){
super(_arg2, _arg3, true);
this.dir = _arg1;
collision_rect = new Rect((x - (width >> 1)), (y - (height >> 1)), 26, 42);
attack_rect = new Rect();
detect_rect = new Rect((x - 20), (y - JUMP_ATTACK_DIST), 40, JUMP_ATTACK_DIST);
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
py = y;
if (_arg3.stack_map[(map_y + 1)][map_x] > -1){
platform = true;
state = WAITING;
} else {
platform = false;
state = FALLING;
};
if (point_man == null){
point_man = this;
} else {
position = rear_guard.length;
rear_guard.push(this);
};
}
public function toString():String{
var _local1:String;
_local1 = "";
if (state == ATTACK){
_local1 = "ATTACK";
} else {
if (state == JUMP_ATTACK){
_local1 = "JUMP_ATTACK";
} else {
if (state == RUNNING){
_local1 = "RUNNING";
} else {
if (state == WAITING){
_local1 = "WAITING";
} else {
if (state == RECOVER){
_local1 = "RECOVER";
} else {
if (state == FALLING){
_local1 = "FALLING";
} else {
if (state == INTO_DEFEND){
_local1 = "INTO_DEFEND";
} else {
if (state == DEFEND){
_local1 = "DEFEND";
} else {
if (state == DEFLECT){
_local1 = "DEFLECT";
};
};
};
};
};
};
};
};
};
_local1 = (_local1 + ((((("(" + x) + ",") + y) + ")") + count));
return (_local1);
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
}
override public function intersects(_arg1:Rect):Boolean{
if ((((state == ATTACK)) || ((state == JUMP_ATTACK)))){
return (attack_rect.intersects(_arg1));
};
return (detect_rect.intersects(_arg1));
}
public function updateAnimState():void{
if (state == RUNNING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "run_right"){
(mc as MovieClip).gotoAndStop("run_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "run_left"){
(mc as MovieClip).gotoAndStop("run_left");
};
};
};
} else {
if ((((state == WAITING)) || ((state == RECOVER)))){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "wait_right"){
(mc as MovieClip).gotoAndStop("wait_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "wait_left"){
(mc as MovieClip).gotoAndStop("wait_left");
};
};
};
} else {
if (state == ATTACK){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "attack_right"){
(mc as MovieClip).gotoAndStop("attack_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "attack_left"){
(mc as MovieClip).gotoAndStop("attack_left");
};
};
};
} else {
if (state == JUMP_ATTACK){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "jump_attack_right"){
(mc as MovieClip).gotoAndStop("jump_attack_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "jump_attack_left"){
(mc as MovieClip).gotoAndStop("jump_attack_left");
};
};
};
} else {
if (state == FALLING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "fall_right"){
(mc as MovieClip).gotoAndStop("fall_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "fall_left"){
(mc as MovieClip).gotoAndStop("fall_left");
};
};
};
} else {
if (state == INTO_DEFEND){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "into_defend_right"){
(mc as MovieClip).gotoAndStop("into_defend_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "into_defend_left"){
(mc as MovieClip).gotoAndStop("into_defend_left");
};
};
};
} else {
if (state == DEFEND){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "defend_right"){
(mc as MovieClip).gotoAndStop("defend_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "defend_left"){
(mc as MovieClip).gotoAndStop("defend_left");
};
};
};
} else {
if (state == DEFLECT){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "deflect_right"){
(mc as MovieClip).gotoAndStop("deflect_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "deflect_left"){
(mc as MovieClip).gotoAndStop("deflect_left");
};
};
};
} else {
if (state == ELECTRIC){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "electric_right"){
(mc as MovieClip).gotoAndStop("electric_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "electric_left"){
(mc as MovieClip).gotoAndStop("electric_left");
};
};
};
};
};
};
};
};
};
};
};
};
}
override public function resolveBulletCollision(_arg1):void{
var _local2:Boolean;
if (!(((((state == ATTACK)) || ((state == JUMP_ATTACK)))) || ((state == DEFLECT)))){
previous_state = state;
state = DEFLECT;
count = 0;
};
_local2 = !((_arg1 is Bullet));
_arg1 = (_local2) ? _arg1.list[_arg1.hit] : _arg1;
if (_local2){
g.addDebris(_arg1.x, _arg1.y, (_arg1.px - _arg1.x), _arg1.bitmap, _arg1.bitmap, _arg1.bitmap, _arg1.bitmap);
} else {
g.addDebris(_arg1.x, _arg1.y, (_arg1.px - _arg1.x), _arg1.bitmap);
};
_arg1.active = false;
}
public function main():void{
if (((!(forced)) && (!(g.scroller.contains(x, y))))){
if (((active) && ((point_man == this)))){
point_man = null;
} else {
i = 0;
while (i < rear_guard.length) {
if (rear_guard[i] == this){
rear_guard.splice(i, 1);
break;
};
i++;
};
i = 0;
while (i < rear_guard.length) {
rear_guard[i].position = i;
i++;
};
};
remove();
return;
};
if (point_man == null){
i = 0;
while (i < rear_guard.length) {
if (rear_guard[i] == this){
rear_guard.splice(i, 1);
break;
};
i++;
};
i = 0;
while (i < rear_guard.length) {
rear_guard[i].position = i;
i++;
};
point_man = this;
};
if (state == WAITING){
if (g.player.dir == RIGHT){
if (x < ){
state = RUNNING;
dir = RIGHT;
} else {
if (x > ){
state = RUNNING;
dir = LEFT;
};
};
} else {
if (g.player.dir == LEFT){
if (x > ){
state = RUNNING;
dir = LEFT;
} else {
if (x < ){
state = RUNNING;
dir = RIGHT;
};
};
};
};
if (electrocuted){
state = INTO_DEFEND;
count = 0;
};
} else {
if (state == RUNNING){
move();
if ((((x > )) && ((x < )))){
state = WAITING;
if (g.player.dir == RIGHT){
dir = RIGHT;
} else {
if (g.player.dir == LEFT){
dir = LEFT;
};
};
} else {
if (x < ){
dir = RIGHT;
} else {
if (x > ){
dir = LEFT;
};
};
};
if (dir == RIGHT){
grid_x = ((((x + (width >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if (g.stack_map[grid_y][grid_x] > Game.EMPTY){
state = INTO_DEFEND;
count = 0;
};
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
state = INTO_DEFEND;
count = 0;
};
} else {
if (dir == LEFT){
grid_x = ((((x - (width >> 1)) - TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if (g.stack_map[grid_y][grid_x] > Game.EMPTY){
state = INTO_DEFEND;
count = 0;
};
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
state = INTO_DEFEND;
count = 0;
};
};
};
if (electrocuted){
state = INTO_DEFEND;
count = 0;
};
} else {
if (state == FALLING){
findFloor();
if (platform == false){
verletY(GRAVITY_Y, DAMPING_Y);
};
} else {
if (state == INTO_DEFEND){
count++;
if (count >= INTO_DEFEND_DELAY){
state = DEFEND;
if (electrocuted){
state = ELECTRIC;
};
};
} else {
if (state == DEFEND){
if (dir == RIGHT){
if (x > ){
dir = LEFT;
state = RUNNING;
};
} else {
if (dir == LEFT){
if (x < ){
dir = RIGHT;
state = RUNNING;
};
};
};
} else {
if (state == DEFLECT){
count++;
if (count >= DEFLECT_DELAY){
state = previous_state;
};
} else {
if (state == ATTACK){
count++;
if (count >= ATTACK_DELAY){
state = RECOVER;
count = 0;
target = null;
};
} else {
if (state == JUMP_ATTACK){
count++;
if (count >= JUMP_ATTACK_DELAY){
state = RECOVER;
count = 0;
target = null;
};
} else {
if (state == RECOVER){
count++;
if (count >= RECOVER_DELAY){
state = RUNNING;
count = 0;
};
};
};
};
};
};
};
};
};
};
updateAnimState();
updateMC();
updateCollisionRect();
}
override public function resolveEncounterCollision(_arg1):void{
if ((((state == ATTACK)) || ((state == JUMP_ATTACK)))){
if (target != null){
return;
};
if (state == JUMP_ATTACK){
if ((((count == 18)) || ((count == 19)))){
if (!_arg1.collision_rect.intersectsCircle(x, (collision_rect.y + (height >> 1)), 40)){
return;
};
};
};
if (state == ATTACK){
if ((((count == 3)) || ((count == 4)))){
if (!_arg1.collision_rect.intersectsCircle(x, (y - 5), 40)){
return;
};
};
};
_arg1.resolveWeaponCollision(new Star(x, y, 0, 0, null, g), true);
target = _arg1;
} else {
if (_arg1.y < (y - 40)){
state = JUMP_ATTACK;
} else {
state = ATTACK;
};
count = 0;
};
}
public function move():void{
if (dir == RIGHT){
x = (x + SPEED);
} else {
if (dir == LEFT){
x = (x - SPEED);
};
};
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
}
public function findFloor():void{
if (g.stack_map[(map_y + 1)][map_x] > -1){
if (((((map_x * Game.scale) > ((-1 + x) + (width >> 1)))) || (((((map_x * Game.scale) + Game.scale) - 1) < (x - (width >> 1)))))){
return;
};
if (((((y + (height >> 1)) < ((map_y + 1) * Game.scale))) || (((y + (height >> 1)) > ((((map_y + 1) * Game.scale) + FLOOR_DEPTH) + (y - py)))))){
return;
};
platform = true;
y = (((map_y + 1) * Game.scale) - (height >> 1));
updateCollisionRect();
state = WAITING;
};
}
public function verletY(_arg1:Number, _arg2:Number):void{
temp_y = y;
y = (y + ((_arg2 * (y - py)) + _arg1));
py = temp_y;
map_y = ((y * Game.SCALE) >> 0);
}
public function updateCollisionRect():void{
if (point_man == this){
if (g.player.dir == RIGHT){
= ((g.player.x + GUARD_DIST) + GUARD_DIST);
= (((g.player.x + GUARD_DIST) + GUARD_DIST) + (GUARD_DIST * 0.5));
} else {
if (g.player.dir == LEFT){
= (((g.player.x - GUARD_DIST) - GUARD_DIST) - (GUARD_DIST * 0.5));
= ((g.player.x - GUARD_DIST) - GUARD_DIST);
};
};
} else {
if (g.player.dir == RIGHT){
= ((g.player.x - (GUARD_DIST * (position + 1))) - (GUARD_DIST * 0.5));
= (g.player.x - (GUARD_DIST * (position + 1)));
} else {
if (g.player.dir == LEFT){
= (g.player.x + (GUARD_DIST * (position + 1)));
= ((g.player.x + (GUARD_DIST * (position + 1))) + (GUARD_DIST * 0.5));
};
};
};
if ( < 0){
= 0;
= GUARD_DIST;
};
if ( > (g.scroller.width * Game.scale)){
= (g.scroller.width * Game.scale);
= ( - GUARD_DIST);
};
collision_rect.x = (x - (width >> 1));
collision_rect.y = (y - (height >> 1));
detect_rect.x = (x - (detect_rect.width * 0.5));
detect_rect.y = (y - JUMP_ATTACK_DIST);
attack_rect.x = (attack_rect.y = (attack_rect.width = (attack_rect.height = 0)));
if (state == JUMP_ATTACK){
collision_rect.y = (y + JUMP_ATTACK_Y[count]);
if (count == 9){
attack_rect.x = ((dir == LEFT)) ? (x - 46) : (x - 20);
attack_rect.y = (y - 49);
attack_rect.width = 72;
attack_rect.height = 30;
} else {
if (count == 11){
attack_rect.x = ((dir == LEFT)) ? (x - 43) : (x - 23);
attack_rect.y = (y - 111);
attack_rect.width = 72;
attack_rect.height = 30;
} else {
if ((((count == 18)) || ((count == 19)))){
attack_rect.x = ((dir == LEFT)) ? (x - 48) : (x - 46);
attack_rect.y = (y - 203);
attack_rect.width = 92;
attack_rect.height = 92;
} else {
if (count == 20){
attack_rect.x = ((dir == LEFT)) ? (x - 39) : (x + 9);
attack_rect.y = (y - 88);
attack_rect.width = 30;
attack_rect.height = 5;
} else {
if ((((count >= 22)) && ((count <= 24)))){
attack_rect.x = ((dir == LEFT)) ? (x - 39) : (x + 9);
attack_rect.y = (y + 11);
attack_rect.width = 30;
attack_rect.height = 5;
};
};
};
};
};
};
if (state == ATTACK){
if ((((count == 3)) || ((count == 4)))){
attack_rect.x = ((dir == LEFT)) ? (x - 47) : (x - 41);
attack_rect.y = (y - 65);
attack_rect.width = 92;
attack_rect.height = 92;
} else {
if ((((count >= 5)) && ((count <= 7)))){
attack_rect.x = ((dir == LEFT)) ? (x - 39) : (x + 9);
attack_rect.y = (y + 11);
attack_rect.width = 30;
attack_rect.height = 5;
};
};
};
}
public static function clear():void{
point_man = null;
rear_guard = [];
}
}
}//package com.nitrome.engine_specific
Section 18
//Block (com.nitrome.engine_specific.Block)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class Block extends Rect {
public var active:Boolean;
public var block:Boolean;// = true
public var px:Number;
public var py:Number;
public var moving_block:Boolean;// = false
public var attachable:Boolean;
public var force_field:Boolean;// = false
public var stacked:int;
public var cutting:Boolean;// = false
public function Block(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
block = true;
force_field = false;
moving_block = false;
cutting = false;
super(_arg1, _arg2, _arg3, _arg4);
px = _arg1;
py = _arg2;
stacked = 0;
attachable = true;
active = true;
}
public function stack(_arg1:int):void{
stacked = (stacked | _arg1);
}
}
}//package com.nitrome.engine_specific
Section 19
//BlockClip (com.nitrome.engine_specific.BlockClip)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class BlockClip extends Clip {
public var spawn:Boolean;// = false
public var b:Block;
public function BlockClip(_arg1:Sprite, _arg2:Game){
spawn = false;
super(_arg1, _arg2);
block = true;
}
public function debug():void{
b.draw(g.debug);
if (b.stacked > 0){
if ((b.stacked & Rect.UP)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo((b.x + (b.width * 0.5)), b.y);
};
if ((b.stacked & Rect.RIGHT)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo((b.x + b.width), (b.y + (b.height * 0.5)));
};
if ((b.stacked & Rect.DOWN)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo((b.x + (b.width * 0.5)), (b.y + b.height));
};
if ((b.stacked & Rect.LEFT)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo(b.x, (b.y + (b.height * 0.5)));
};
};
}
}
}//package com.nitrome.engine_specific
Section 20
//Boss (com.nitrome.engine_specific.Boss)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Boss extends FlyingBot {
public var :int;
public var
:int;
public var :Number;
public var :Number;
public var shield:Sprite;
public var health:int;
public var health_fraction:Number;
public var :int;
public var :int;// = 40
public var :int;
public var :Boolean;
public var :Array;
public var collision_rect:Rect;
public static const TOTAL_EMITTERS:int = 3;
public static const SPIDER_HITS:int = 5;
public static const ESCAPE_DELAY:int = 150;
public static const SPEED:Number = 2;
public static const DYING:int = 4;
public static const BOOM_DELAY:int = 10;
public static const WARM_UP_STEP:Number = 0.08;
public static const FINAL_BOOM_DELAY:int = 200;
public function Boss(_arg1:Sprite, _arg2:Game, _arg3:Boolean){
var _local4:int;
var _local5:Emitter;
= 40;
super(Path.STOPPED, _arg1, _arg2);
this. = _arg3;
selectPatrolPath();
state = MOVING;
collision_rect = new Rect((x - 16), (y - 16), 32, 32);
= 25;
if (this.){
shield = new SmallShieldMC();
shield.blendMode = BlendMode.LIGHTEN;
_arg1.addChild(shield);
= 75;
};
health = ;
health_fraction = (1 / );
reward = new HiddenInt(5000);
= 0;
= [];
_local4 = 0;
while (_local4 < TOTAL_EMITTERS) {
_local5 = ();
_local5.angle = ((_local4 * 120) % 360);
_local4++;
};
_arg2.boss_level = true;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
if (shield != null){
if (shield.alpha < 0.2){
shield.alpha = (shield.alpha + WARM_UP_STEP);
} else {
if (shield.alpha > 0.2){
shield.alpha = (shield.alpha - WARM_UP_STEP);
};
};
};
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
public function kill():void{
var _local1:int;
if (!active){
return;
};
g.addFX(mc.x, mc.y, g.bang_bitmap3);
g.addSmoke(mc.x, mc.y);
g.addSmoke(mc.x, mc.y);
g.addSmoke(mc.x, mc.y);
g.addSmoke(mc.x, mc.y);
g.addSmoke(mc.x, mc.y);
_local1 = 0;
while (_local1 < .length) {
[_local1].kill();
_local1++;
};
_local1 = 0;
while (_local1 < g.bullets.length) {
g.bullets[_local1].kill(0);
_local1++;
};
_local1 = 0;
while (_local1 < g.encounters.length) {
if (((!((g.encounters[_local1] == this))) && (g.encounters[_local1].has_collision))){
g.encounters[_local1].kill();
};
_local1++;
};
g.shake(5);
state = DYING;
= (BOOM_DELAY + (Math.random() * BOOM_DELAY));
= () ? FINAL_BOOM_DELAY : ESCAPE_DELAY;
if (!spawned){
NitromeGame.bonus.enemy_count.value++;
};
}
override public function remove():void{
}
public function main():void{
if (state == MOVING){
move();
if ((((dir == UP)) || ((dir == DOWN)))){
if (((y - 32) * Game.SCALE) == map_y){
selectPatrolPath();
};
} else {
if ((((dir == LEFT)) || ((dir == RIGHT)))){
if (((x - 32) * Game.SCALE) == map_x){
selectPatrolPath();
};
} else {
if (dir == STOPPED){
selectPatrolPath();
};
};
};
} else {
if (state == TURNING){
state = MOVING;
} else {
if (state == DYING){
if ((((-- <= 0)) && (!(g.completed)))){
= ((-(Emitter.RADIUS) + mc.x) + ((Math.random() * Emitter.RADIUS) * 2));
= ((-(Emitter.RADIUS) + mc.y) + ((Math.random() * Emitter.RADIUS) * 2));
g.addFX(, , g.bang_bitmap1);
g.addSmoke(, );
g.addSmoke(, );
g.shake(3);
= (BOOM_DELAY + (Math.random() * BOOM_DELAY));
};
--;
if ((() && ((
<= 0)))){
g.shake(20);
= ((-(Emitter.RADIUS) + mc.x) + ((Math.random() * Emitter.RADIUS) * 2));
= ((-(Emitter.RADIUS) + mc.y) + ((Math.random() * Emitter.RADIUS) * 2));
g.addFX(, , g.bang_bitmap2);
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
= ((-(Emitter.RADIUS) + mc.x) + ((Math.random() * Emitter.RADIUS) * 2));
= ((-(Emitter.RADIUS) + mc.y) + ((Math.random() * Emitter.RADIUS) * 2));
g.addFX(, , g.bang_bitmap2);
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
= ((-(Emitter.RADIUS) + mc.x) + ((Math.random() * Emitter.RADIUS) * 2));
= ((-(Emitter.RADIUS) + mc.y) + ((Math.random() * Emitter.RADIUS) * 2));
g.addFX(, , g.bang_bitmap2);
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
= ((-(Emitter.RADIUS) + mc.x) + ((Math.random() * Emitter.RADIUS) * 2));
= ((-(Emitter.RADIUS) + mc.y) + ((Math.random() * Emitter.RADIUS) * 2));
g.addFX(, , g.bang_bitmap2);
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
= ((-(Emitter.RADIUS) + mc.x) + ((Math.random() * Emitter.RADIUS) * 2));
= ((-(Emitter.RADIUS) + mc.y) + ((Math.random() * Emitter.RADIUS) * 2));
g.addFX(, , g.bang_bitmap2);
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
g.addSmoke(, );
NitromeGame.sound_manager.playSound("bang4");
active = false;
g.player.levelComplete();
} else {
y--;
x++;
if (
== 0){
g.player.levelComplete();
};
};
};
};
};
updateMC();
updateCollisionRect();
}
override public function resolvePlayerCollision(_arg1:Player):void{
_arg1.hit();
}
public function ():Emitter{
var _local1:MovieClip;
var _local2:Emitter;
_local1 = new EmitterMC();
_local1.x = (x + (Trig.cos[270] * Emitter.RADIUS));
_local1.y = (y + (Trig.cos[270] * Emitter.RADIUS));
g.monster_holder.addChild(_local1);
_local2 = new Emitter(_local1, this, g);
.push(_local2);
return (_local2);
}
public function move():void{
if (dir == UP){
y = (y - SPEED);
} else {
if (dir == RIGHT){
x = (x + SPEED);
} else {
if (dir == LEFT){
x = (x - SPEED);
} else {
if (dir == DOWN){
y = (y + SPEED);
};
};
};
};
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
}
public function updateCollisionRect():void{
collision_rect.x = (x - 16);
collision_rect.y = (y - 16);
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:int;
if (((!(active)) || ((state == DYING)))){
return;
};
if (((_arg2) || (!()))){
if (!_arg2){
health = (health - 1);
} else {
health = (health - ( / SPIDER_HITS));
};
_local3 = new HitSparkMC();
_local3.x = (_arg1.x >> 0);
_local3.y = (_arg1.y >> 0);
_local4 = collision_rect.sideOf(_arg1.x, _arg1.y);
if (_local4 == UP){
} else {
if (_local4 == RIGHT){
_local3.rotation = 90;
} else {
if (_local4 == DOWN){
_local3.rotation = 180;
} else {
if (_local4 == LEFT){
_local3.rotation = 270;
};
};
};
};
NitromeGame.sound_manager.playSound("bossouch");
g.effect_holder.addChild(_local3);
if (health <= 0){
g.addScore(reward.value);
kill();
};
} else {
shield.alpha = 1;
_arg1.ping((_arg1.px - _arg1.x));
};
}
}
}//package com.nitrome.engine_specific
Section 21
//Bullet (com.nitrome.engine_specific.Bullet)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class Bullet extends Dot {
public var active:Boolean;
public var px:Number;
public var py:Number;
public var temp_x:Number;
public var map_y:int;
public var init:Boolean;
public var map_x:int;
public var temp_y:Number;
public var g:Game;
public var frame:int;
public var bitmap:BitmapSprite;
public function Bullet(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:BitmapSprite, _arg7:Game){
super(_arg1, _arg2);
this.g = _arg7;
this.bitmap = _arg6;
active = true;
init = false;
frame = 0;
px = (_arg1 - (_arg3 * _arg5));
py = (_arg2 - (_arg4 * _arg5));
}
public function main():void{
var _local1:Block;
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Rect;
var _local6:*;
var _local7:Number;
var _local8:Number;
if (!init){
init = true;
return;
};
temp_x = x;
temp_y = y;
x = (x + (x - px));
y = (y + (y - py));
px = temp_x;
py = temp_y;
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
if (!g.scroller.contains(x, y)){
active = false;
return;
};
if (g.stack_map[map_y][map_x] > Game.EMPTY){
_local1 = g.block_map[map_y][map_x].b;
if (!_local1.contains(x, y)){
return;
};
_local2 = _local1.sideOf(x, y);
_local3 = (x - px);
_local4 = (y - py);
_local5 = new Rect(0, 0, 0, 0);
_local5.x = Math.min(x, px);
_local5.y = Math.min(y, py);
_local5.width = Math.abs((x - px));
_local5.height = Math.abs((y - py));
_local6 = _local5.intersection(_local1);
_local7 = 0;
_local8 = 0;
if (_local3 != 0){
_local7 = (Math.min(Math.abs(_local3), _local6.width) * ((_local3 > 0)) ? 1 : -1);
};
if (_local4 != 0){
_local8 = (Math.min(Math.abs(_local4), _local6.height) * ((_local4 > 0)) ? 1 : -1);
};
x = (x - _local7);
y = (y - _local8);
_local2 = _local1.sideOf(x, y);
if ((_local1.stacked & _local2)){
if ((((_local2 == Rect.UP)) || ((_local2 == Rect.DOWN)))){
if (x < (_local1.x + (_local1.width * 0.5))){
x = (_local1.x - 1);
_local2 = Rect.LEFT;
} else {
x = (_local1.x + _local1.width);
_local2 = Rect.RIGHT;
};
} else {
if ((((_local2 == Rect.RIGHT)) || ((_local2 == Rect.LEFT)))){
if (y < (_local1.y + (_local1.height * 0.5))){
y = (_local1.y - 1);
_local2 = Rect.UP;
} else {
y = (_local1.y + _local1.height);
_local2 = Rect.DOWN;
};
};
};
} else {
if (_local2 == Rect.LEFT){
x = (_local1.x - 1);
} else {
if (_local2 == Rect.UP){
y = (_local1.y - 1);
};
};
};
kill(_local2);
};
}
public function resolvePlayerCollision(_arg1:Player):void{
_arg1.hit();
kill(_arg1.collision_rect.sideOf(x, y));
}
public function kill(_arg1:int):void{
if (!active){
return;
};
active = false;
if (bitmap == g.bullet_bitmap){
if (_arg1 == Rect.UP){
g.addFX(x, y, g.bullet_hit_bitmap_up);
} else {
if (_arg1 == Rect.RIGHT){
g.addFX(x, y, g.bullet_hit_bitmap_right);
} else {
if (_arg1 == Rect.DOWN){
g.addFX(x, y, g.bullet_hit_bitmap_down);
} else {
if (_arg1 == Rect.LEFT){
g.addFX(x, y, g.bullet_hit_bitmap_left);
};
};
};
};
} else {
if (bitmap == g.grenade_bitmap){
g.addFX(x, y, g.bang_bitmap1);
} else {
if (bitmap == g.boss_bullet_bitmap){
g.addFX(x, y, g.boss_bullet_hit_bitmap);
};
};
};
}
public function updateMC():void{
bitmap.x = (-(g.bullet_layer_holder.x) + x);
bitmap.y = (-(g.bullet_layer_holder.y) + y);
bitmap.render(g.bullet_layer, frame);
frame = ((frame + 1) % bitmap.total_frames);
}
public function erase():void{
active = false;
}
public function intersects(_arg1:Rect):Boolean{
return (_arg1.intersectsCircle(x, y, 3));
}
}
}//package com.nitrome.engine_specific
Section 22
//BulletGroup (com.nitrome.engine_specific.BulletGroup)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class BulletGroup {
public var active:Boolean;
private var i:int;
public var hit:int;
public var list:Array;
public function BulletGroup(_arg1:Array){
active = true;
this.list = _arg1;
}
public function resolvePlayerCollision(_arg1:Player):void{
_arg1.hit();
list[hit].kill(_arg1.collision_rect.sideOf(list[hit].x, list[hit].y));
}
public function intersects(_arg1:Rect):Boolean{
i = 0;
while (i < list.length) {
if (list[i].intersects(_arg1)){
hit = i;
return (true);
};
i++;
};
return (false);
}
public function main():void{
i = 0;
while (i < list.length) {
list[i].main();
if (!list[i].active){
active = false;
return;
};
i++;
};
}
public function updateMC():void{
i = 0;
while (i < list.length) {
list[i].updateMC();
i++;
};
}
}
}//package com.nitrome.engine_specific
Section 23
//Cammo (com.nitrome.engine_specific.Cammo)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Cammo extends Encounter {
public var health_fraction:Number;// = 0
public var collision_rect:Rect;
public var health:int;// = 0
public function Cammo(_arg1:Sprite, _arg2:Game){
health = 0;
health_fraction = 0;
super(_arg1, _arg2, false);
collision_rect = new Rect((_arg1.x + 16), (_arg1.y + 32), 32, 32);
actor_target = false;
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
override public function resolvePlayerCollision(_arg1:Player):void{
if (!((_arg1.chameleon_pickup) || (_arg1.chameleon))){
_arg1.chameleon_pickup = true;
(mc as MovieClip).gotoAndStop("collect");
NitromeGame.sound_manager.playSound("coins");
};
}
override public function unpause():void{
if ((mc as MovieClip).currentLabel == "idle"){
(mc as MovieClip).gotoAndStop("idle");
};
}
}
}//package com.nitrome.engine_specific
Section 24
//Coin (com.nitrome.engine_specific.Coin)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Coin extends Encounter {
public var collision_rect:Rect;
public function Coin(_arg1:Sprite, _arg2:Game){
super(_arg1, _arg2, false);
collision_rect = new Rect((_arg1.x + 15), (_arg1.y + 36), 35, 28);
actor_target = false;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
override public function resolvePlayerCollision(_arg1:Player):void{
g.addScore(50);
kill();
}
public function kill():void{
var _local1:MovieClip;
if (!active){
return;
};
_local1 = new CoinFadeMC();
NitromeGame.sound_manager.playSound("coins");
NitromeGame.bonus.cash_count.value++;
_local1.x = mc.x;
_local1.y = mc.y;
g.star_holder.addChild(_local1);
g.scroller.map_array_layers[layer][map_y][map_x] = 0;
active = false;
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
if (!active){
return;
};
g.addScore(50);
kill();
}
}
}//package com.nitrome.engine_specific
Section 25
//Coward (com.nitrome.engine_specific.Coward)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Coward extends Encounter {
public var py:Number;
public var paused:Boolean;
public var cast:RayCastReport;
public var firing_count:int;
public var a:Dot;
public var health:int;// = 0
public var platform:Boolean;
public var health_fraction:Number;// = 0
public var controlled:Boolean;
public var state:int;
public var dir:int;
public var pause_count:int;// = 0
public var grid_x:int;
public var grid_y:int;
public var stop_dir:int;
public var collision_rect:Rect;
public var temp_y:Number;
public static const RIGHT:int = 2;
private static const width:int = 26;
public static const LEFT:int = 8;
private static const GRAVITY_Y:Number = 1.3;
private static const height:int = 42;
private static const FLOOR_DEPTH:int = 6;
public static const UP:int = 1;
public static const RUNNING:int = 1;
public static const SPEED:Number = 8;
public static const DOWN:int = 4;
public static const STOPPED:int = 0;
public static const FALLING:int = 2;
public static const WAIT:int = 4;
public static const TEST_DEPTH:int = 5;
private static const DAMPING_Y:Number = 0.99;
public function Coward(_arg1:int, _arg2:Sprite, _arg3:Game){
health = 0;
health_fraction = 0;
pause_count = 0;
super(_arg2, _arg3, true);
has_main = true;
has_collision = true;
this.dir = _arg1;
collision_rect = new Rect((x - (width >> 1)), (y - (height >> 1)), 26, 42);
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
py = y;
if (_arg3.stack_map[(map_y + 1)][map_x] > Game.EMPTY){
platform = true;
state = WAIT;
} else {
platform = false;
state = FALLING;
};
controlled = ((!((_arg3.actor_map[map_y][map_x] == 0))) || (!((((_arg3.actor_map[map_y][map_x] >= 0)) || ((_arg3.actor_map[map_y][map_x] <= 0))))));
if (controlled){
paused = false;
pause_count = 0;
selectPatrolPath();
};
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function updateAnimState():void{
if (state == RUNNING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "run_right"){
(mc as MovieClip).gotoAndStop("run_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "run_left"){
(mc as MovieClip).gotoAndStop("run_left");
};
} else {
if (dir == STOPPED){
if (stop_dir == RIGHT){
if ((mc as MovieClip).currentLabel != "stop_right"){
(mc as MovieClip).gotoAndStop("stop_right");
};
} else {
if (stop_dir == LEFT){
if ((mc as MovieClip).currentLabel != "stop_left"){
(mc as MovieClip).gotoAndStop("stop_left");
};
};
};
};
};
};
} else {
if (state == FALLING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "fall_right"){
(mc as MovieClip).gotoAndStop("fall_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "fall_left"){
(mc as MovieClip).gotoAndStop("fall_left");
};
};
};
} else {
if (state == WAIT){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "stop_right"){
(mc as MovieClip).gotoAndStop("stop_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "stop_left"){
(mc as MovieClip).gotoAndStop("stop_left");
};
};
};
};
};
};
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
}
public function selectPatrolPath():void{
if (pause_count == -1){
return;
};
if ((((dir == Path.STOPPED)) && ((pause_count > 0)))){
pause_count = 0;
state = WAIT;
return;
};
stop_dir = dir;
Path.getDir(dir, g.actor_map, null, map_x, map_y);
dir = Path.dir;
pause_count = (paused) ? 0 : Path.pause_delay;
if (pause_count > 0){
dir = Path.STOPPED;
paused = true;
return;
};
paused = false;
}
public function main():void{
if (state == RUNNING){
if (((((g.scroller.contains(x, y)) || ((map_x == 0)))) || ((map_x == (g.scroller.width - 1))))){
move();
};
if (controlled){
if ((((dir == RIGHT)) || ((dir == LEFT)))){
if (((x - 32) * Game.SCALE) == map_x){
selectPatrolPath();
};
} else {
if (dir == Path.STOPPED){
selectPatrolPath();
};
};
};
if ((((dir == RIGHT)) && ((map_x < (g.scroller.width - 1))))){
grid_x = ((((x + (width >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if ((((g.stack_map[grid_y][grid_x] > Game.EMPTY)) && (!((g.stack_map[grid_y][grid_x] & Rect.TEMP))))){
dir = LEFT;
};
grid_x = (((x - (width >> 1)) * Game.SCALE) >> 0);
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
state = FALLING;
platform = false;
py = y;
};
} else {
if ((((dir == LEFT)) && ((map_x > 0)))){
grid_x = ((((x - (width >> 1)) - TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if ((((g.stack_map[grid_y][grid_x] > Game.EMPTY)) && (!((g.stack_map[grid_y][grid_x] & Rect.TEMP))))){
dir = RIGHT;
};
grid_x = (((x + (width >> 1)) * Game.SCALE) >> 0);
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
state = FALLING;
platform = false;
py = y;
};
};
};
} else {
if (state == FALLING){
if (g.scroller.contains(x, y)){
move();
findFloor();
if (platform == false){
verletY(GRAVITY_Y, DAMPING_Y);
};
};
} else {
if (state == WAIT){
if (((Util.proximity(g.player.x, g.player.y, x, y, 200)) && ((Math.abs((g.player.y - y)) < 100)))){
state = RUNNING;
};
};
};
};
updateAnimState();
updateMC();
updateCollisionRect();
}
public function verletY(_arg1:Number, _arg2:Number):void{
temp_y = y;
y = (y + ((_arg2 * (y - py)) + _arg1));
py = temp_y;
map_y = ((y * Game.SCALE) >> 0);
}
public function findFloor():void{
grid_x = (x * Game.SCALE);
if (g.stack_map[(map_y + 1)][grid_x] > Game.EMPTY){
platform = true;
y = ((((map_y + 1) * Game.scale) - (height >> 1)) - 2);
updateCollisionRect();
state = RUNNING;
};
}
public function move():void{
if (dir == RIGHT){
x = (x + SPEED);
} else {
if (dir == LEFT){
x = (x - SPEED);
};
};
map_x = (((x - 32) * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
}
public function updateCollisionRect():void{
collision_rect.x = (x - (width >> 1));
collision_rect.y = (y - (height >> 1));
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
_arg1.ping((_arg1.px - _arg1.x));
}
}
}//package com.nitrome.engine_specific
Section 26
//CowardSwitch (com.nitrome.engine_specific.CowardSwitch)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class CowardSwitch extends Encounter {
public const ACTIVE:int = 2;
public const DEATH_DELAY:int = 85;
public const INACTIVE:int = 1;
public var health_fraction:Number;// = 0.33333
public var state:int;
public var :int;
public var collision_rect:Rect;
public var health:int;// = 3
public static const DOWN:int = 4;
public static const LEFT:int = 8;
public static const UP:int = 1;
public static const RIGHT:int = 2;
public function CowardSwitch(_arg1:int, _arg2:Sprite, _arg3:Game){
health = 3;
health_fraction = 0.33333;
super(_arg2, _arg3, false);
this.id_tag = _arg1;
if (_arg3.tags[_arg1] == null){
_arg3.tags[_arg1] = true;
};
if (_arg3.tags[_arg1]){
has_collision = true;
state = ACTIVE;
collision_rect = new Rect((x + 21), (y + 18), 22, 46);
(_arg2 as MovieClip).gotoAndStop("active");
= 0;
} else {
state = INACTIVE;
_arg2.visible = false;
has_collision = false;
collision_rect = new Rect();
};
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function main():void{
var _local1:int;
++;
if ( >= DEATH_DELAY){
g.addFX((x + 66), (y + 55), g.bang_bitmap1);
g.addSmoke((x + 66), (y + 55));
g.addSmoke((x + 66), (y + 55));
g.addSmoke((x + 66), (y + 55));
g.shake(5);
has_main = false;
mc.visible = false;
collision_rect = new Rect();
state = INACTIVE;
g.tags[id_tag] = false;
_local1 = 0;
while (_local1 < g.encounters.length) {
if (((!((g.encounters[_local1] == this))) && ((g.encounters[_local1].id_tag == id_tag)))){
g.encounters[_local1].deactivate();
};
_local1++;
};
NitromeGame.bonus.enemy_count.value++;
};
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:int;
if ((((state == INACTIVE)) || (!(has_collision)))){
return;
};
health--;
_local3 = new HitSparkMC();
_local3.x = (_arg1.x >> 0);
_local3.y = (_arg1.y >> 0);
_local4 = collision_rect.sideOf(_arg1.x, _arg1.y);
if (_local4 == UP){
} else {
if (_local4 == RIGHT){
_local3.rotation = 90;
} else {
if (_local4 == DOWN){
_local3.rotation = 180;
} else {
if (_local4 == LEFT){
_local3.rotation = 270;
};
};
};
};
g.effect_holder.addChild(_local3);
NitromeGame.sound_manager.playSound("scientisthit");
if (health <= 0){
has_collision = false;
has_main = true;
g.addScore(1000);
(mc as MovieClip).gotoAndStop("inactive");
};
}
override public function unpause():void{
if (state == ACTIVE){
(mc as MovieClip).gotoAndStop("active");
};
}
}
}//package com.nitrome.engine_specific
Section 27
//DeadStar (com.nitrome.engine_specific.DeadStar)
package com.nitrome.engine_specific {
import flash.display.*;
import flash.events.*;
public class DeadStar extends Sprite {
public var dead:Boolean;// = false
private static const FADE_RATE:Number = 0.2;
public function DeadStar(){
dead = false;
super();
}
public function init(_arg1:int):void{
if (_arg1 == 1){
} else {
if (_arg1 == 2){
rotation = 22.5;
} else {
if (_arg1 == 3){
rotation = 45;
} else {
if (_arg1 == 4){
rotation = 67.5;
};
};
};
};
}
public function kill():void{
dead = true;
addEventListener(Event.ENTER_FRAME, fade, false, 0, true);
}
private function fade(_arg1:Event):void{
if (alpha > 0){
alpha = (alpha - FADE_RATE);
} else {
removeEventListener(Event.ENTER_FRAME, main);
if (parent != null){
parent.removeChild(this);
};
};
}
public function main():void{
}
}
}//package com.nitrome.engine_specific
Section 28
//DebrisFX (com.nitrome.engine_specific.DebrisFX)
package com.nitrome.engine_specific {
public class DebrisFX extends FX {
public var px:Number;
public var py:Number;
public var dir:Number;
public var temp_x:Number;
public var temp_y:Number;
public function DebrisFX(_arg1:Number, _arg2:Number, _arg3:BitmapSprite, _arg4:Game){
super(_arg1, _arg2, _arg3, _arg4);
dir = ((Math.random() > 0.5)) ? 15 : -15;
px = _arg1;
py = _arg2;
}
override public function main():void{
var _local1:*;
var _local2:*;
_local1 = x;
_local2 = y;
x = (x + ((x - px) * 0.95));
y = (y + ((y - py) + 1));
px = _local1;
py = _local2;
bitmap.x = (-(g.fx_layer_holder.x) + x);
bitmap.y = (-(g.fx_layer_holder.y) + y);
bitmap.render(g.fx_layer, 0);
}
public function addVelocity(_arg1:Number, _arg2:Number):void{
px = (px - _arg1);
py = (py - _arg2);
}
}
}//package com.nitrome.engine_specific
Section 29
//ElectricBlock (com.nitrome.engine_specific.ElectricBlock)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class ElectricBlock extends EncounterBlock {
public var health_fraction:Number;// = 0
public var collision_rect:Rect;
public var health:int;// = 0
public function ElectricBlock(_arg1:Sprite, _arg2:Game){
health = 0;
health_fraction = 0;
super(_arg1, _arg2);
collision_rect = new Rect((x - 5), (y - 5), (Game.scale + 10), (Game.scale + 10));
has_collision = true;
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
override public function resolvePlayerCollision(_arg1:Player):void{
_arg1.hit();
}
}
}//package com.nitrome.engine_specific
Section 30
//ElectricFinish (com.nitrome.engine_specific.ElectricFinish)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class ElectricFinish extends Encounter {
public var health_fraction:Number;// = 0
public var collision_rect:Rect;
public var health:int;// = 0
public function ElectricFinish(_arg1:Sprite, _arg2:Game){
var _local3:int;
health = 0;
health_fraction = 0;
super(_arg1, _arg2, false);
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
_local3 = 0;
while (_local3 < _arg2.scroller.height) {
if ((map_y - _local3) <= 0){
break;
};
if (_arg2.stack_map[(map_y - _local3)][map_x] > Game.EMPTY){
_local3--;
break;
};
_local3++;
};
collision_rect = new Rect((_arg1.x + 30), ((map_y - _local3) * Game.scale), 4, (Game.scale + (_local3 * Game.scale)));
actor_target = false;
has_main = false;
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
override public function resolvePlayerCollision(_arg1:Player):void{
if (!active){
return;
};
g.player.levelComplete(this);
NitromeGame.sound_manager.playSound("electric");
g.scroller.map_array_layers[layer][map_y][map_x] = 0;
g.mouse_pressed = false;
}
}
}//package com.nitrome.engine_specific
Section 31
//Emitter (com.nitrome.engine_specific.Emitter)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Emitter extends Encounter {
public var :int;
public var dir:int;
public var health_fraction:Number;// = 0
public var firing_count:int;
public var collision_rect:Rect;
public var health:int;// = 0
public var angle:int;
public var :Boss;
public static const BURST_DELAY:int = 30;
public static const WIDTH:Number = 16;
public static const HEIGHT:Number = 16;
public static const BULLET_SPEED:int = 4;
public static const CYCLE_DELAY:int = 60;
public static const RADIUS:Number = 72;
public static const FIRING_DELAY:int = 2;
public function Emitter(_arg1:MovieClip, _arg2:Boss, _arg3:Game){
health = 0;
health_fraction = 0;
super(_arg1, _arg3, true);
this. = _arg2;
has_main = true;
has_collision = true;
angle = 270;
dir = 2;
firing_count = 0;
= 0;
angle = 0;
collision_rect = new Rect((x - (WIDTH * 0.5)), (y - (HEIGHT * 0.5)), WIDTH, HEIGHT);
_arg1.alpha = 0;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
if (mc.alpha < 1){
return (false);
};
return (collision_rect.contains(_arg1, _arg2));
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
if (mc.alpha < 1){
mc.alpha = (mc.alpha + 0.01);
};
}
override public function intersects(_arg1:Rect):Boolean{
if (mc.alpha < 1){
return (false);
};
return (collision_rect.intersects(_arg1));
}
public function main():void{
angle = (angle + dir);
if (angle > 359){
angle = (angle - 360);
} else {
if (angle < 0){
angle = (angle + 360);
};
};
x = (.x + (RADIUS * Trig.cos[angle]));
y = (.y + (RADIUS * Trig.sin[angle]));
updateCollisionRect();
++;
if ((((((mc.alpha >= 1)) && (.active))) && (( < BURST_DELAY)))){
fire();
};
if ( >= CYCLE_DELAY){
= 0;
} else {
if (!.active){
kill();
};
};
updateMC();
}
public function fire():void{
if (firing_count++ >= FIRING_DELAY){
g.addBullet(x, y, Trig.cos[angle], Trig.sin[angle], BULLET_SPEED, g.boss_bullet_bitmap);
firing_count = 0;
};
}
override public function resolvePlayerCollision(_arg1:Player):void{
_arg1.hit();
}
public function kill():void{
if (!active){
return;
};
active = false;
g.addFX(mc.x, mc.y, g.bang_bitmap1);
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:int;
if (mc.alpha < 1){
return;
};
_local3 = new HitSparkMC();
_local3.x = (_arg1.x >> 0);
_local3.y = (_arg1.y >> 0);
_local4 = collision_rect.sideOf(_arg1.x, _arg1.y);
if (_local4 == Rect.UP){
} else {
if (_local4 == Rect.RIGHT){
_local3.rotation = 90;
} else {
if (_local4 == Rect.DOWN){
_local3.rotation = 180;
} else {
if (_local4 == Rect.LEFT){
_local3.rotation = 270;
};
};
};
};
g.effect_holder.addChild(_local3);
g.addFX(mc.x, mc.y, g.bang_bitmap1);
mc.alpha = 0;
}
public function updateCollisionRect():void{
collision_rect.x = (x - (WIDTH * 0.5));
collision_rect.y = (y - (HEIGHT * 0.5));
}
}
}//package com.nitrome.engine_specific
Section 32
//EncounterBlock (com.nitrome.engine_specific.EncounterBlock)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class EncounterBlock extends Encounter {
public var b:Block;
public var spawn:Boolean;// = false
public function EncounterBlock(_arg1:Sprite, _arg2:Game){
spawn = false;
super(_arg1, _arg2, false);
block = true;
free = false;
has_collision = false;
actor_target = false;
}
override public function debug():void{
b.draw(g.debug);
if (b.stacked > 0){
if ((b.stacked & Rect.UP)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo((b.x + (b.width * 0.5)), b.y);
};
if ((b.stacked & Rect.RIGHT)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo((b.x + b.width), (b.y + (b.height * 0.5)));
};
if ((b.stacked & Rect.DOWN)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo((b.x + (b.width * 0.5)), (b.y + b.height));
};
if ((b.stacked & Rect.LEFT)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo(b.x, (b.y + (b.height * 0.5)));
};
};
}
}
}//package com.nitrome.engine_specific
Section 33
//FlyingBot (com.nitrome.engine_specific.FlyingBot)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class FlyingBot extends Encounter {
public var state:int;
public var controlled:Boolean;
public var :MovieClip;
public var dir:int;
public var pause_count:int;// = 0
public var r:Number;
public var paused:Boolean;
public var :Array;
public var :int;
public var :int;
public var
:int;
public var :int;
public var :Node;
public var angle:int;// = 0
public static const TURNING:int = 2;
public static const LEFT:int = 8;
public static const DOWN:int = 4;
public static const STOPPED:int = 0;
public static const MOVING:int = 1;
public static const PAUSE_UNIT:int = 25;
public static const UP:int = 1;
public static const RIGHT:int = 2;
public function FlyingBot(_arg1:int, _arg2:Sprite, _arg3:Game){
angle = 0;
pause_count = 0;
super(_arg2, _arg3, true);
has_main = true;
has_collision = true;
this.dir = _arg1;
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
= [];
[0] = new Node();
[1] = new Node();
[2] = new Node();
[3] = new Node();
controlled = ((!(( == 0))) || (!((((_arg3.path_map[map_y][map_x] >= 0)) || ((_arg3.path_map[map_y][map_x] <= 0))))));
paused = false;
}
public function selectPatrolPath():void{
if (pause_count == -1){
return;
};
if ((((dir == STOPPED)) && ((pause_count > 0)))){
pause_count--;
return;
};
Path.getDir(dir, g.path_map, g.stack_map, map_x, map_y);
if (dir != STOPPED){
= dir;
};
dir = Path.dir;
pause_count = (paused) ? 0 : Path.pause_delay;
if (pause_count > 0){
dir = Path.STOPPED;
paused = true;
return;
};
paused = false;
if (dir != ){
state = TURNING;
if ( == UP){
if (dir == RIGHT){
angle = 0;
if ( != null){
.rotation = (.rotation + 1);
};
} else {
if (dir == LEFT){
angle = 180;
} else {
angle = 90;
if ( != null){
.rotation = (.rotation + 1);
};
};
};
} else {
if ( == RIGHT){
if (dir == DOWN){
angle = 90;
} else {
if (dir == UP){
angle = -90;
} else {
angle = 180;
};
};
} else {
if ( == DOWN){
if (dir == RIGHT){
angle = 0;
if ( != null){
.rotation = (.rotation + 1);
};
} else {
if (dir == LEFT){
angle = 180;
} else {
angle = -90;
};
};
} else {
if ( == LEFT){
if (dir == DOWN){
angle = 90;
if ( != null){
.rotation = (.rotation + 1);
};
} else {
if (dir == UP){
angle = -90;
} else {
angle = 0;
if ( != null){
.rotation = (.rotation + 1);
};
};
};
};
};
};
};
};
}
public function selectSeekPath():void{
var _local1:int;
= int.MAX_VALUE;
= 0;
[3].x = map_x;
[3].y = (map_y - 1);
[3].walkable = (((map_y > 0)) && ((g.stack_map[[3].y][[3].x] == Game.EMPTY)));
[3].setH(g.player.map_x, g.player.map_y);
[3].s = ([3].walkable) ? g.scent_map[[3].y][[3].x] : -1;
[0].x = (map_x + 1);
[0].y = map_y;
[0].walkable = (((map_x < (g.scroller.width - 1))) && ((g.stack_map[[0].y][[0].x] == Game.EMPTY)));
[0].setH(g.player.map_x, g.player.map_y);
[0].s = ([0].walkable) ? g.scent_map[[0].y][[0].x] : -1;
[1].x = map_x;
[1].y = (map_y + 1);
[1].walkable = (((map_y < (g.scroller.height - 1))) && ((g.stack_map[[1].y][[1].x] == Game.EMPTY)));
[1].setH(g.player.map_x, g.player.map_y);
[1].s = ([1].walkable) ? g.scent_map[[1].y][[1].x] : -1;
[2].x = (map_x - 1);
[2].y = map_y;
[2].walkable = (((map_x > 0)) && ((g.stack_map[[2].y][[2].x] == Game.EMPTY)));
[2].setH(g.player.map_x, g.player.map_y);
[2].s = ([2].walkable) ? g.scent_map[[2].y][[2].x] : -1;
_local1 = 0;
while (_local1 < .length) {
if ([_local1].walkable){
if ([_local1].s > ){
= [_local1].s;
= [_local1];
} else {
if (((( == 0)) && (([_local1].h <
)))){
= [_local1].h;
= [_local1];
};
};
};
_local1++;
};
if (.y < map_y){
if (dir != UP){
dir = UP;
angle = -90;
state = TURNING;
};
} else {
if (.x > map_x){
if (dir != RIGHT){
dir = RIGHT;
angle = 0;
state = TURNING;
};
} else {
if (.y > map_y){
if (dir != DOWN){
dir = DOWN;
angle = 90;
state = TURNING;
};
} else {
if (.x < map_x){
if (dir != LEFT){
dir = LEFT;
angle = 180;
state = TURNING;
};
};
};
};
};
}
}
}//package com.nitrome.engine_specific
Section 34
//FlyingGun (com.nitrome.engine_specific.FlyingGun)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.geom.*;
public class FlyingGun extends FlyingBot {
public var wobble_alpha:Number;
public var sparks:MovieClip;
public var cast:RayCastReport;
public var gun:MovieClip;
public var strength:Number;
public var firing_count:int;
public var beam_width:int;
public var previous_state:int;
public var alpha:Array;
public var shield:Sprite;
private var i:int;
public var health:int;// = 5
public var scan:Line;
public var health_fraction:Number;// = 0.2
public var fast:Boolean;
public var killer:Boolean;
public var wobble:int;
public var bullet_list:Array;
public var wobble_step:int;
public var
:Boolean;
public var collision_rect:Rect;
public var cols:Array;
public static const FIRING:int = 4;
public static const KILL_WOBBLE_ALPHA:Number = 0.25;
public static const SCAN_WOBBLE_ALPHA:Number = 0.05;
public static const GRENADE_SPEED:int = 8;
public static const FIRING_DELAY:int = 11;
public static const KILL_WOBBLE_STEP:int = 12;
private static const KILL_ALPHA:Array = [0.45, 0.25, 0.15];
public static const FIRING_CHARGE_DELAY:int = 6;
public static const TURN_SPEED:Number = 3;
public static const SPEED:Number = 4;
public static const BULLET_SPEED:int = 16;
public static const KILLER_WIDTH:int = 5;
public static const SCAN_WIDTH:int = 2;
private static const KILL_COLS:Array = [16304135, 0xF89200, 14116875];
private static const SCAN_COLS:Array = [311058, 1152348, 947785];
public static const WARM_UP_STEP:Number = 0.08;
private static const SCAN_ALPHA:Array = [0.35, 0.25, 0.15];
public static const SCAN_WOBBLE_STEP:int = 6;
public static var point:Point = new Point();
public function FlyingGun(_arg1:int, _arg2:MovieClip, _arg3:Game, _arg4:Boolean=false, _arg5:Boolean=false, _arg6:Boolean=false){
var _local7:Dot;
health = 5;
health_fraction = 0.2;
super(_arg1, _arg2, _arg3);
firing_count = 0;
strength = 0;
init_x = map_x;
init_y = map_y;
this.killer = _arg6;
gun = (_arg6) ? new LaserGunMC() : new GunMC();
cols = (_arg6) ? KILL_COLS : SCAN_COLS;
alpha = (_arg6) ? KILL_ALPHA : SCAN_ALPHA;
beam_width = (_arg6) ? KILLER_WIDTH : SCAN_WIDTH;
wobble_step = (_arg6) ? KILL_WOBBLE_STEP : SCAN_WOBBLE_STEP;
wobble_alpha = (_arg6) ? KILL_WOBBLE_ALPHA : SCAN_WOBBLE_ALPHA;
this.fast = _arg5;
= gun;
if (_arg6){
sparks = new LaserGunSparksMC();
_arg3.effect_holder.addChild(sparks);
sparks.visible = false;
};
if (_arg3.alert_state != Game.ACTIVE){
this.aggressive = _arg4;
} else {
this.aggressive = true;
};
if (((!(this.aggressive)) || ((_arg3.player == null)))){
selectPatrolPath();
} else {
selectSeekPath();
};
if (this.aggressive){
(_arg2 as MovieClip).gotoAndStop("aggressive");
};
state = MOVING;
collision_rect = new Rect((x - 16), (y - 16), 32, 50);
if ((((this.dir == DOWN)) || ((((this.dir == STOPPED)) && (( == DOWN)))))){
gun.rotation = (angle = 90);
} else {
if ((((this.dir == RIGHT)) || ((((this.dir == STOPPED)) && (( == RIGHT)))))){
gun.rotation = (angle = 0);
} else {
if ((((this.dir == UP)) || ((((this.dir == STOPPED)) && (( == UP)))))){
gun.rotation = (angle = -90);
} else {
if ((((this.dir == LEFT)) || ((((this.dir == STOPPED)) && (( == LEFT)))))){
gun.rotation = (angle = 180);
};
};
};
};
_local7 = new Dot((_arg2.x + 0.5), (_arg2.y + 0.5));
if (_arg1 == DOWN){
scan = new Line(_local7, new Dot(_local7.x, (_local7.y + (Game.WIDTH + Game.HEIGHT))));
} else {
if (_arg1 == RIGHT){
scan = new Line(_local7, new Dot((_local7.x + (Game.WIDTH + Game.HEIGHT)), _local7.y));
} else {
if (_arg1 == UP){
scan = new Line(_local7, new Dot(_local7.x, (_local7.y - (Game.WIDTH + Game.HEIGHT))));
} else {
if (_arg1 == LEFT){
scan = new Line(_local7, new Dot((_local7.x - (Game.WIDTH + Game.HEIGHT)), _local7.y));
};
};
};
};
rotate();
_arg2.addChildAt(gun, 0);
shield = new SmallShieldMC();
shield.blendMode = BlendMode.LIGHTEN;
_arg2.addChild(shield);
reward = new HiddenInt(70);
on_scroller = false;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
wobble = ((wobble + wobble_step) % 360);
i = 1;
while (i < 4) {
g.scan_holder.graphics.lineStyle((i * beam_width), cols[(i - 1)], (strength * (alpha[(i - 1)] + Math.abs((Trig.sin[wobble] * wobble_alpha)))));
g.scan_holder.graphics.moveTo(mc.x, mc.y);
if (cast != null){
g.scan_holder.graphics.lineTo(cast.ax, cast.ay);
} else {
g.scan_holder.graphics.lineTo(scan.b.x, scan.b.y);
};
i++;
};
if (state != FIRING){
if (shield.alpha < 0.2){
shield.alpha = (shield.alpha + WARM_UP_STEP);
} else {
if (shield.alpha > 0.2){
shield.alpha = (shield.alpha - WARM_UP_STEP);
};
};
} else {
if (shield.alpha > 0){
shield.alpha = (shield.alpha - (WARM_UP_STEP * 2));
};
};
if (killer){
if (cast != null){
sparks.x = cast.ax;
sparks.y = cast.ay;
if (cast.access_side == UP){
sparks.rotation = 0;
} else {
if (cast.access_side == RIGHT){
sparks.rotation = 90;
} else {
if (cast.access_side == DOWN){
sparks.rotation = 180;
} else {
if (cast.access_side == LEFT){
sparks.rotation = -90;
};
};
};
};
if (!Util.proximity(x, y, cast.ax, cast.ay, 70)){
sparks.visible = true;
sparks.alpha = strength;
} else {
sparks.visible = false;
};
} else {
sparks.visible = false;
};
};
}
override public function intersects(_arg1:Rect):Boolean{
if (((!(
)) || (((!(killer)) && ((((g.player.state == Player.STEALTH)) || (g.player.chameleon))))))){
return (false);
};
return (RayCast.reportIntersectsRect(scan, cast, g.player.collision_rect));
}
public function fire():void{
if (firing_count == 0){
if (fast){
bullet_list = [new Bullet((x + (scan.dx * 50)), (y + (scan.dy * 50)), scan.dx, scan.dy, BULLET_SPEED, g.bullet_bitmap, g), new Bullet((x + (58 * scan.dx)), (y + (58 * scan.dy)), scan.dx, scan.dy, BULLET_SPEED, g.bullet_bitmap, g), new Bullet((x + (66 * scan.dx)), (y + (66 * scan.dy)), scan.dx, scan.dy, BULLET_SPEED, g.bullet_bitmap, g), new Bullet((x + (74 * scan.dx)), (y + (74 * scan.dy)), scan.dx, scan.dy, BULLET_SPEED, g.bullet_bitmap, g)];
g.addBulletGroup(bullet_list);
NitromeGame.sound_manager.playSound("machinegun");
gun.gotoAndStop("fire_bullet");
point = Util.localToLocal(point, gun.cartridges, g.canvas);
g.addDebrisDir(point.x, point.y, scan.dy, -(scan.dx), g.cartridge_bitmap, g.cartridge_bitmap, g.cartridge_bitmap, g.cartridge_bitmap);
} else {
g.addBullet((x + (scan.dx * 50)), (y + (scan.dy * 50)), scan.dx, scan.dy, GRENADE_SPEED, g.grenade_bitmap);
gun.gotoAndStop("fire_grenade");
NitromeGame.sound_manager.playSound("grenade");
point = Util.localToLocal(point, gun.cartridges, g.canvas);
g.addDebrisDir(point.x, point.y, scan.dy, -(scan.dx), g.grenade_cartridge_bitmap);
};
};
if (++firing_count >= FIRING_DELAY){
firing_count = 0;
gun.gotoAndStop("idle");
if ((((cast == null)) || (((!((cast == null))) && (!(RayCast.reportIntersectsRect(scan, cast, g.player.collision_rect))))))){
state = previous_state;
};
};
}
public function rotate():void{
scan.dx = Trig.cos[((gun.rotation + 360) % 360)];
scan.dy = Trig.sin[((gun.rotation + 360) % 360)];
scan.vx = (scan.dx * scan.len);
scan.vy = (scan.dy * scan.len);
scan.b.x = (scan.a.x + scan.vx);
scan.b.y = (scan.a.y + scan.vy);
scan.rx = -(scan.dy);
scan.ry = scan.dx;
scan.lx = scan.dy;
scan.ly = -(scan.dx);
}
override public function alert():void{
aggressive = true;
(mc as MovieClip).gotoAndStop("aggressive");
}
public function kill(_arg1:Number):void{
if (!active){
return;
};
active = false;
if (!spawned){
NitromeGame.bonus.enemy_count.value++;
};
g.addFX(mc.x, mc.y, g.bang_bitmap2);
g.addSmoke(mc.x, mc.y);
g.addSmoke(mc.x, mc.y);
g.shake(3);
if (((killer) && (!((sparks.parent == null))))){
sparks.parent.removeChild(sparks);
};
g.addDebris((collision_rect.x + (collision_rect.width * 0.5)), (collision_rect.y + (collision_rect.height * 0.5)), ((_arg1 > 0)) ? 10 : -10, g.debris_clips[2], g.debris_clips[3], (killer) ? g.debris_clips[5] : g.debris_clips[4]);
}
override public function remove():void{
if (((killer) && (!((sparks.parent == null))))){
sparks.parent.removeChild(sparks);
};
super.remove();
}
public function main():void{
on_scroller = g.scroller.contains(x, y);
if (((!(forced)) && (!(on_scroller)))){
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
if (!aggressive){
if (dir == UP){
if (killer){
tile_id = "33";
} else {
if (fast){
tile_id = "32";
} else {
tile_id = "32";
};
};
} else {
if (dir == RIGHT){
if (killer){
tile_id = "36";
} else {
if (fast){
tile_id = "35";
} else {
tile_id = "34";
};
};
} else {
if (dir == DOWN){
if (killer){
tile_id = "39";
} else {
if (fast){
tile_id = "38";
} else {
tile_id = "37";
};
};
} else {
if (dir == LEFT){
if (killer){
tile_id = "42";
} else {
if (fast){
tile_id = "41";
} else {
tile_id = "40";
};
};
};
};
};
};
} else {
if (killer){
tile_id = "45";
} else {
if (fast){
tile_id = "44";
} else {
tile_id = "43";
};
};
};
remove();
return;
};
if (state == MOVING){
move();
if ((((dir == UP)) || ((dir == DOWN)))){
if (((y - 32) * Game.SCALE) == map_y){
if (aggressive){
selectSeekPath();
} else {
selectPatrolPath();
};
};
} else {
if ((((dir == LEFT)) || ((dir == RIGHT)))){
if (((x - 32) * Game.SCALE) == map_x){
if (aggressive){
selectSeekPath();
} else {
selectPatrolPath();
};
};
} else {
if (dir == STOPPED){
if (aggressive){
selectSeekPath();
} else {
selectPatrolPath();
};
};
};
};
} else {
if (state == TURNING){
if (Math.abs((angle - gun.rotation)) <= TURN_SPEED){
gun.rotation = angle;
state = MOVING;
} else {
r = gun.rotation;
r = (r + ((Math.abs((angle - r)))>180) ? ((r)<angle) ? 360 : -(360) : 0);
r = (r + (((angle - r) > 0)) ? TURN_SPEED : -(TURN_SPEED));
gun.rotation = r;
};
rotate();
} else {
if (state == FIRING){
fire();
};
};
};
= Util.onScreen(x, y, g, 100);
cast = RayCast.cast(scan, g.block_map, true);
if ((((strength < 1)) && (
))){
strength = (strength + WARM_UP_STEP);
} else {
if (strength > 0){
strength = (strength - (WARM_UP_STEP * 2));
};
};
updateMC();
updateCollisionRect();
}
override public function resolvePlayerCollision(_arg1:Player):void{
if (((((!((state == FIRING))) && ((strength >= 1)))) && (!(Util.proximity(_arg1.x, _arg1.y, x, y, 50))))){
if (!killer){
previous_state = state;
state = FIRING;
} else {
g.player.hit();
};
};
}
public function move():void{
if (dir == UP){
y = (y - SPEED);
scan.a.y = (scan.a.y - SPEED);
scan.b.y = (scan.b.y - SPEED);
} else {
if (dir == RIGHT){
x = (x + SPEED);
scan.a.x = (scan.a.x + SPEED);
scan.b.x = (scan.b.x + SPEED);
} else {
if (dir == LEFT){
x = (x - SPEED);
scan.a.x = (scan.a.x - SPEED);
scan.b.x = (scan.b.x - SPEED);
} else {
if (dir == DOWN){
y = (y + SPEED);
scan.a.y = (scan.a.y + SPEED);
scan.b.y = (scan.b.y + SPEED);
};
};
};
};
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
}
public function updateCollisionRect():void{
collision_rect.x = (x - 16);
collision_rect.y = (y - 16);
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:int;
if (!active){
return;
};
if (((_arg2) || ((state == FIRING)))){
health--;
_local3 = new HitSparkMC();
_local3.x = (_arg1.x >> 0);
_local3.y = (_arg1.y >> 0);
_local4 = collision_rect.sideOf(_arg1.x, _arg1.y);
if (_local4 == UP){
} else {
if (_local4 == RIGHT){
_local3.rotation = 90;
} else {
if (_local4 == DOWN){
_local3.rotation = 180;
} else {
if (_local4 == LEFT){
_local3.rotation = 270;
};
};
};
};
g.effect_holder.addChild(_local3);
if ((((health <= 0)) || (_arg2))){
if (!spawned){
g.addScore(reward.value);
} else {
g.addScore((reward.value / 10));
};
kill((_arg1.x - _arg1.px));
};
} else {
shield.alpha = 1;
_arg1.ping((_arg1.px - _arg1.x));
};
}
override public function unpause():void{
gun.gotoAndStop("idle");
if (aggressive){
(mc as MovieClip).gotoAndStop("aggressive");
} else {
(mc as MovieClip).gotoAndStop("idle");
};
}
}
}//package com.nitrome.engine_specific
Section 35
//ForceField (com.nitrome.engine_specific.ForceField)
package com.nitrome.engine_specific {
import flash.display.*;
public class ForceField extends EncounterBlock {
public var state:int;
public static const INACTIVE:int = 1;
public static const ACTIVE:int = 2;
public function ForceField(_arg1:Sprite, _arg2:Game){
super(_arg1, _arg2);
force_field = true;
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
if (_arg2.alert_state != Game.ACTIVE){
state = INACTIVE;
block = false;
_arg2.stack_map[map_y][map_x] = Game.EMPTY;
(_arg1 as MovieClip).gotoAndStop("inactive");
} else {
if (_arg2.alert_state == Game.ACTIVE){
state = ACTIVE;
block = true;
(_arg1 as MovieClip).gotoAndStop("active");
};
};
}
override public function unpause():void{
if (state == INACTIVE){
(mc as MovieClip).gotoAndStop("inactive");
} else {
if (state == ACTIVE){
(mc as MovieClip).gotoAndStop("active");
};
};
}
override public function alert():void{
state = ACTIVE;
g.stack_map[map_y][map_x] = b.stacked;
(mc as MovieClip).gotoAndPlay("activate");
block = true;
}
override public function standdown():void{
state = INACTIVE;
g.stack_map[map_y][map_x] = Game.EMPTY;
(mc as MovieClip).gotoAndPlay("deactivate");
block = false;
}
}
}//package com.nitrome.engine_specific
Section 36
//ForceFieldDoor (com.nitrome.engine_specific.ForceFieldDoor)
package com.nitrome.engine_specific {
import flash.display.*;
public class ForceFieldDoor extends EncounterBlock {
public var state:int;
public static const INACTIVE:int = 1;
public static const ACTIVE:int = 2;
public function ForceFieldDoor(_arg1:int, _arg2:Sprite, _arg3:Game){
super(_arg2, _arg3);
this.id_tag = _arg1;
force_field = true;
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
if (_arg3.tags[_arg1] == null){
_arg3.tags[_arg1] = true;
};
if (!_arg3.tags[_arg1]){
state = INACTIVE;
block = false;
_arg3.stack_map[map_y][map_x] = Game.EMPTY;
(_arg2 as MovieClip).gotoAndStop("inactive");
} else {
state = ACTIVE;
block = true;
(_arg2 as MovieClip).gotoAndStop("active");
};
}
override public function unpause():void{
if (state == INACTIVE){
(mc as MovieClip).gotoAndStop("inactive");
} else {
if (state == ACTIVE){
(mc as MovieClip).gotoAndStop("active");
};
};
}
override public function alert():void{
}
public function deactivate():void{
state = INACTIVE;
g.stack_map[map_y][map_x] = Game.EMPTY;
(mc as MovieClip).gotoAndPlay("deactivate");
block = false;
}
override public function standdown():void{
}
}
}//package com.nitrome.engine_specific
Section 37
//FX (com.nitrome.engine_specific.FX)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class FX extends Dot {
public var active:Boolean;
public var frame:int;
public var g:Game;
public var bitmap:BitmapSprite;
public function FX(_arg1:Number, _arg2:Number, _arg3:BitmapSprite, _arg4:Game, _arg5:int=0){
super(_arg1, _arg2);
this.bitmap = _arg3;
this.g = _arg4;
frame = (0 - _arg5);
active = true;
}
public function main():void{
if (frame > -1){
bitmap.x = (-(g.fx_layer_holder.x) + x);
bitmap.y = (-(g.fx_layer_holder.y) + y);
bitmap.render(g.fx_layer, frame++);
if (frame == bitmap.total_frames){
active = false;
};
} else {
frame++;
};
}
}
}//package com.nitrome.engine_specific
Section 38
//GameFinish (com.nitrome.engine_specific.GameFinish)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class GameFinish extends Encounter {
public var health_fraction:Number;// = 0
public var collision_rect:Rect;
public var health:int;// = 0
public function GameFinish(_arg1:Sprite, _arg2:Game){
var _local3:int;
health = 0;
health_fraction = 0;
super(_arg1, _arg2, false);
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
_local3 = 0;
while (_local3 < _arg2.scroller.height) {
if ((map_y - _local3) <= 0){
break;
};
if (_arg2.stack_map[(map_y - _local3)][map_x] > Game.EMPTY){
_local3--;
break;
};
_local3++;
};
collision_rect = new Rect((_arg1.x + 30), ((map_y - _local3) * Game.scale), 4, (Game.scale + (_local3 * Game.scale)));
actor_target = false;
has_main = false;
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
override public function resolvePlayerCollision(_arg1:Player):void{
if (!active){
return;
};
g.player.levelComplete();
g.scroller.map_array_layers[layer][map_y][map_x] = 0;
g.mouse_pressed = false;
}
}
}//package com.nitrome.engine_specific
Section 39
//GeneratorSwitch (com.nitrome.engine_specific.GeneratorSwitch)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class GeneratorSwitch extends EncounterBlock {
public const ACTIVE:int = 2;
public const INACTIVE:int = 1;
public var health_fraction:Number;// = 0
public var state:int;
public var collision_rect:Rect;
public var health:int;// = 0
public function GeneratorSwitch(_arg1:int, _arg2:Sprite, _arg3:Game){
health = 0;
health_fraction = 0;
super(_arg2, _arg3);
this.id_tag = _arg1;
if (_arg3.tags[_arg1] == null){
_arg3.tags[_arg1] = true;
};
if (_arg3.tags[_arg1]){
has_collision = true;
collision_rect = new Rect(x, y, Game.scale, Game.scale);
(_arg2 as MovieClip).gotoAndStop("active");
} else {
has_collision = false;
collision_rect = new Rect();
(_arg2 as MovieClip).gotoAndStop("inactive");
};
}
override public function unpause():void{
if (state == INACTIVE){
(mc as MovieClip).gotoAndStop("inactive");
} else {
if (state == ACTIVE){
(mc as MovieClip).gotoAndStop("active");
};
};
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:int;
if (state == INACTIVE){
return;
};
state = INACTIVE;
collision_rect = new Rect();
g.tags[id_tag] = false;
_local3 = 0;
while (_local3 < g.encounters.length) {
if (((!((g.encounters[_local3] == this))) && ((g.encounters[_local3].id_tag == id_tag)))){
g.encounters[_local3].deactivate();
};
_local3++;
};
g.addFX((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)), g.bang_bitmap1);
g.addSmoke((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.addSmoke((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
(mc as MovieClip).gotoAndStop("inactive");
NitromeGame.sound_manager.playSound("powerdown");
}
}
}//package com.nitrome.engine_specific
Section 40
//GunBlock (com.nitrome.engine_specific.GunBlock)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.geom.*;
public class GunBlock extends EncounterBlock {
public var :Array;
public var bullet_list:Array;
public var firing_count:int;
public var :Object;
public var fast:Boolean;
public var angle:int;
public static const GRENADE_SPEED:int = 8;
public static const BULLET_SPEED:int = 16;
public static const FIRING_DELAY:int = 50;
public static var point:Point = new Point();
public function GunBlock(_arg1:MovieClip, _arg2:Game){
super(_arg1, _arg2);
has_main = true;
firing_count = (_arg2.frame_count % FIRING_DELAY);
fast = false;
}
override public function unpause():void{
(mc as MovieClip).gun.gotoAndStop("idle");
}
public function main():void{
if (firing_count == 0){
if (fast){
bullet_list = [new Bullet(x, y, Trig.cos[angle], Trig.sin[angle], BULLET_SPEED, g.bullet_bitmap, g), new Bullet([1].x, [1].y, Trig.cos[angle], Trig.sin[angle], BULLET_SPEED, g.bullet_bitmap, g), new Bullet([2].x, [2].y, Trig.cos[angle], Trig.sin[angle], BULLET_SPEED, g.bullet_bitmap, g), new Bullet([3].x, [3].y, Trig.cos[angle], Trig.sin[angle], BULLET_SPEED, g.bullet_bitmap, g)];
g.addBulletGroup(bullet_list);
(mc as MovieClip).gun.gotoAndStop("fire_bullet");
NitromeGame.sound_manager.playSound("machinegun");
point = Util.localToLocal(point, (mc as MovieClip).gun.cartridges, g.canvas);
g.addDebrisDir(point.x, point.y, Trig.sin[angle], -(Trig.cos[angle]), g.cartridge_bitmap, g.cartridge_bitmap, g.cartridge_bitmap, g.cartridge_bitmap);
} else {
g.addBullet(x, y, Trig.cos[angle], Trig.sin[angle], GRENADE_SPEED, g.grenade_bitmap);
(mc as MovieClip).gun.gotoAndStop("fire_grenade");
NitromeGame.sound_manager.playSound("grenade");
point = Util.localToLocal(point, (mc as MovieClip).gun.cartridges, g.canvas);
g.addDebrisDir(point.x, point.y, Trig.sin[angle], -(Trig.cos[angle]), g.grenade_cartridge_bitmap);
};
};
if (++firing_count >= FIRING_DELAY){
firing_count = 0;
(mc as MovieClip).gun.gotoAndStop("idle");
};
}
public function setDirection(_arg1:int):void{
if (_arg1 == Rect.UP){
x = (b.x + (Game.scale >> 1));
y = (b.y - 15);
angle = 270;
} else {
if (_arg1 == Rect.RIGHT){
x = ((b.x + Game.scale) + 14);
y = (b.y + (Game.scale >> 1));
angle = 0;
} else {
if (_arg1 == Rect.DOWN){
x = (b.x + (Game.scale >> 1));
y = ((b.y + Game.scale) + 14);
angle = 90;
} else {
if (_arg1 == Rect.LEFT){
x = (b.x - 15);
y = (b.y + (Game.scale >> 1));
angle = 180;
};
};
};
};
= [new Dot(x, y), new Dot((x + (8 * Trig.cos[angle])), (y + (8 * Trig.sin[angle]))), new Dot((x + (16 * Trig.cos[angle])), (y + (16 * Trig.sin[angle]))), new Dot((x + (24 * Trig.cos[angle])), (y + (24 * Trig.sin[angle])))];
this.fast = fast;
}
}
}//package com.nitrome.engine_specific
Section 41
//GunMan (com.nitrome.engine_specific.GunMan)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.geom.*;
public class GunMan extends Encounter {
public var py:Number;
public var paused:Boolean;
public var cast:RayCastReport;
public var firing_count:int;
public var a:Dot;
public var health:int;// = 2
public var fast:Boolean;
public var platform:Boolean;
public var scan:Line;
public var health_fraction:Number;// = 0.5
public var controlled:Boolean;
public var state:int;
public var dir:int;
public var pause_count:int;// = 0
public var :Boolean;
public var grid_x:int;
public var grid_y:int;
public var stop_dir:int;
public var collision_rect:Rect;
public var temp_y:Number;
public static const RIGHT_ID:String = "378";
private static const width:int = 26;
public static const LEFT:int = 8;
private static const height:int = 42;
private static const DAMPING_Y:Number = 0.99;
private static const GRAVITY_Y:Number = 1.3;
public static const LEFT_ID:String = "377";
public static const GRENADE_SPEED:int = 8;
public static const FIRING_DELAY:int = 30;
public static const UP:int = 1;
public static const RUNNING:int = 1;
public static const SPEED:Number = 2;
private static const FLOOR_DEPTH:int = 6;
public static const DOWN:int = 4;
public static const BULLET_SPEED:int = 16;
public static const STOPPED:int = 0;
public static const FALLING:int = 2;
public static const FIRING:int = 4;
public static const RIGHT:int = 2;
public static const TEST_DEPTH:int = 5;
public static var point:Point = new Point();
public function GunMan(_arg1:int, _arg2:Sprite, _arg3:Game, _arg4:Boolean=false, _arg5:Boolean=false){
health = 2;
health_fraction = 0.5;
pause_count = 0;
super(_arg2, _arg3, true);
has_main = true;
has_collision = true;
this.dir = _arg1;
this. = _arg5;
collision_rect = new Rect((x - (width >> 1)), (y - (height >> 1)), 26, 42);
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
py = y;
if (_arg3.stack_map[(map_y + 1)][map_x] > Game.EMPTY){
platform = true;
state = RUNNING;
} else {
platform = false;
state = FALLING;
};
a = new Dot((_arg2.x + 0.5), (_arg2.y + 0.5));
reward = new HiddenInt(40);
(_arg2 as MovieClip).gun.gotoAndStop("idle");
controlled = ((!((_arg3.path_map[map_y][map_x] == 0))) || (!((((_arg3.path_map[map_y][map_x] >= 0)) || ((_arg3.path_map[map_y][map_x] <= 0))))));
if (controlled){
paused = false;
pause_count = 0;
selectPatrolPath();
};
firing_count = 0;
this.fast = _arg4;
on_scroller = false;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
override public function intersects(_arg1:Rect):Boolean{
if (((((((((!(on_scroller)) || ())) || ((state == FALLING)))) || ((g.player.state == Player.STEALTH)))) || (g.player.chameleon))){
return (false);
};
if (((((!((scan == null))) && ((cast == null)))) && ((((((((dir == LEFT)) && ((g.player.x < x)))) || ((((dir == RIGHT)) && ((g.player.x > x)))))) || ((((dir == STOPPED)) && ((((((stop_dir == LEFT)) && ((g.player.x < x)))) || ((((stop_dir == RIGHT)) && ((g.player.x > x)))))))))))){
return (RayCast.reportIntersectsRect(scan, cast, g.player.collision_rect));
};
return (false);
}
public function updateAnimState():void{
var _local1:*;
if (state == RUNNING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "run_right"){
(mc as MovieClip).gotoAndStop("run_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "run_left"){
(mc as MovieClip).gotoAndStop("run_left");
};
} else {
if (dir == STOPPED){
if (stop_dir == RIGHT){
if ((mc as MovieClip).currentLabel != "stop_right"){
(mc as MovieClip).gotoAndStop("stop_right");
};
} else {
if (stop_dir == LEFT){
if ((mc as MovieClip).currentLabel != "stop_left"){
(mc as MovieClip).gotoAndStop("stop_left");
};
};
};
};
};
};
if ((mc as MovieClip).gun.currentLabel != "idle"){
(mc as MovieClip).gun.gotoAndStop("idle");
};
} else {
if (state == FALLING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "fall_right"){
(mc as MovieClip).gotoAndStop("fall_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "fall_left"){
(mc as MovieClip).gotoAndStop("fall_left");
};
};
};
if ((mc as MovieClip).gun.currentLabel != "idle"){
(mc as MovieClip).gun.gotoAndStop("idle");
};
} else {
if (state == FIRING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "fire_right"){
(mc as MovieClip).gotoAndStop("fire_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "fire_left"){
(mc as MovieClip).gotoAndStop("fire_left");
};
} else {
if (dir == STOPPED){
if (stop_dir == RIGHT){
if ((mc as MovieClip).currentLabel != "fire_right"){
(mc as MovieClip).gotoAndStop("fire_right");
};
} else {
if (stop_dir == LEFT){
if ((mc as MovieClip).currentLabel != "fire_left"){
(mc as MovieClip).gotoAndStop("fire_left");
};
};
};
};
};
};
if (fast){
if ((mc as MovieClip).gun.currentLabel != "fire_bullet"){
(mc as MovieClip).gun.gotoAndStop("fire_bullet");
};
} else {
if ((mc as MovieClip).gun.currentLabel != "fire_grenade"){
(mc as MovieClip).gun.gotoAndStop("fire_grenade");
};
};
_local1 = (scan.atan2() * Game.ONE80DIVIDEDBYPI);
};
};
};
if ((((state == RUNNING)) && ((dir == STOPPED)))){
(mc as MovieClip).gun.alpha = 0;
(mc as MovieClip).arm.alpha = 0;
} else {
(mc as MovieClip).gun.alpha = 1;
(mc as MovieClip).arm.alpha = 1;
};
if (state == FIRING){
if ((((dir == RIGHT)) || ((((dir == STOPPED)) && ((stop_dir == RIGHT)))))){
(mc as MovieClip).gun.rotation = _local1;
(mc as MovieClip).arm.rotation = _local1;
(mc as MovieClip).gun.scaleX = -1;
(mc as MovieClip).arm.scaleX = -1;
} else {
if ((((dir == LEFT)) || ((((dir == STOPPED)) && ((stop_dir == LEFT)))))){
(mc as MovieClip).gun.rotation = (_local1 + 180);
(mc as MovieClip).arm.rotation = (_local1 + 180);
(mc as MovieClip).gun.scaleX = 1;
(mc as MovieClip).arm.scaleX = 1;
};
};
} else {
if ((((dir == RIGHT)) || ((((dir == STOPPED)) && ((stop_dir == RIGHT)))))){
(mc as MovieClip).gun.rotation = 0;
(mc as MovieClip).arm.rotation = 0;
(mc as MovieClip).gun.scaleX = -1;
(mc as MovieClip).arm.scaleX = -1;
} else {
if ((((dir == LEFT)) || ((((dir == STOPPED)) && ((stop_dir == LEFT)))))){
(mc as MovieClip).gun.rotation = 0;
(mc as MovieClip).arm.rotation = 0;
(mc as MovieClip).gun.scaleX = 1;
(mc as MovieClip).arm.scaleX = 1;
};
};
};
}
public function fire():void{
var _local1:Array;
if (firing_count == 0){
if (!fast){
g.addBullet((x + (27 * scan.dx)), (y + (27 * scan.dy)), scan.dx, scan.dy, GRENADE_SPEED, g.grenade_bitmap);
point = Util.localToLocal(point, (mc as MovieClip).gun.cartridges, g.canvas);
g.addDebrisDir(point.x, point.y, scan.dy, -(scan.dx), g.grenade_cartridge_bitmap);
NitromeGame.sound_manager.playSound("grenade");
} else {
_local1 = [new Bullet((x + (27 * scan.dx)), (y + (27 * scan.dy)), scan.dx, scan.dy, BULLET_SPEED, g.bullet_bitmap, g), new Bullet((x + (35 * scan.dx)), (y + (35 * scan.dy)), scan.dx, scan.dy, BULLET_SPEED, g.bullet_bitmap, g), new Bullet((x + (43 * scan.dx)), (y + (43 * scan.dy)), scan.dx, scan.dy, BULLET_SPEED, g.bullet_bitmap, g), new Bullet((x + (51 * scan.dx)), (y + (51 * scan.dy)), scan.dx, scan.dy, BULLET_SPEED, g.bullet_bitmap, g)];
g.addBulletGroup(_local1);
point = Util.localToLocal(point, (mc as MovieClip).gun.cartridges, g.canvas);
g.addDebrisDir(point.x, point.y, scan.dy, -(scan.dx), g.cartridge_bitmap, g.cartridge_bitmap, g.cartridge_bitmap, g.cartridge_bitmap);
NitromeGame.sound_manager.playSound("machinegun");
};
};
firing_count++;
if (firing_count >= FIRING_DELAY){
firing_count = 0;
if ((((cast == null)) || (((!((cast == null))) && (!(RayCast.reportIntersectsRect(scan, cast, g.player.collision_rect))))))){
state = RUNNING;
};
};
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
}
public function kill(_arg1:Number=0):void{
if (!active){
return;
};
active = false;
if (!spawned){
NitromeGame.bonus.enemy_count.value++;
};
g.addFX(mc.x, mc.y, g.bang_bitmap1);
if (Math.random() > 0.5){
g.addSmoke(mc.x, mc.y);
};
g.addDebris((collision_rect.x + (collision_rect.width * 0.5)), (collision_rect.y + (collision_rect.height * 0.5)), ((_arg1 > 0)) ? 10 : -10, g.debris_clips[12], g.debris_clips[13], g.debris_clips[14]);
}
public function selectPatrolPath():void{
if (pause_count == -1){
return;
};
if ((((dir == Path.STOPPED)) && ((pause_count > 0)))){
pause_count--;
return;
};
stop_dir = dir;
Path.getDir(dir, g.path_map, null, map_x, map_y);
dir = Path.dir;
pause_count = (paused) ? 0 : Path.pause_delay;
if (pause_count > 0){
dir = Path.STOPPED;
paused = true;
return;
};
paused = false;
}
public function main():void{
on_scroller = g.scroller.contains(x, y);
if (((!(forced)) && (!(on_scroller)))){
if (dir == LEFT){
if (){
tile_id = "155";
} else {
if (fast){
tile_id = "58";
} else {
tile_id = "57";
};
};
} else {
if (dir == RIGHT){
if (){
tile_id = "156";
} else {
if (fast){
tile_id = "60";
} else {
tile_id = "59";
};
};
};
};
remove();
return;
};
if (state == RUNNING){
if (scan == null){
if (g.player != null){
scan = new Line(a, g.player);
if (on_scroller){
cast = RayCast.cast(scan, g.block_map, true);
};
};
} else {
scan.updateLine();
if (on_scroller){
cast = RayCast.cast(scan, g.block_map, true);
};
};
move();
if (controlled){
if ((((dir == RIGHT)) || ((dir == LEFT)))){
if (((x - 32) * Game.SCALE) == map_x){
selectPatrolPath();
};
} else {
if (dir == Path.STOPPED){
selectPatrolPath();
};
};
};
if (dir == RIGHT){
grid_x = ((((x + (width >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if (g.stack_map[grid_y][grid_x] > Game.EMPTY){
dir = LEFT;
};
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
dir = LEFT;
};
if (grid_x == (g.scroller.width - 1)){
dir = LEFT;
};
} else {
if (dir == LEFT){
grid_x = ((((x - (width >> 1)) - TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if (g.stack_map[grid_y][grid_x] > Game.EMPTY){
dir = RIGHT;
};
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
dir = RIGHT;
};
if (grid_x == 0){
dir = RIGHT;
};
};
};
} else {
if (state == FALLING){
findFloor();
if (platform == false){
verletY(GRAVITY_Y, DAMPING_Y);
};
} else {
if (state == FIRING){
if ((((dir == RIGHT)) && ((g.player.x < x)))){
dir = LEFT;
} else {
if ((((dir == LEFT)) && ((g.player.x > x)))){
dir = RIGHT;
};
};
scan.updateLine();
if (on_scroller){
cast = RayCast.cast(scan, g.block_map, true);
};
fire();
};
};
};
updateAnimState();
updateMC();
updateCollisionRect();
}
public function verletY(_arg1:Number, _arg2:Number):void{
temp_y = y;
y = (y + ((_arg2 * (y - py)) + _arg1));
py = temp_y;
a.y = y;
map_y = ((y * Game.SCALE) >> 0);
}
override public function resolvePlayerCollision(_arg1:Player):void{
if (((!(Util.proximity(_arg1.x, _arg1.y, x, y, 30))) && (!((state == FIRING))))){
state = FIRING;
};
}
public function findFloor():void{
if (g.stack_map[(map_y + 1)][map_x] > Game.EMPTY){
platform = true;
y = ((-3 + ((map_y + 1) * Game.scale)) - (height >> 1));
a.y = y;
updateCollisionRect();
state = RUNNING;
};
}
public function move():void{
if (dir == RIGHT){
x = (x + SPEED);
a.x = x;
} else {
if (dir == LEFT){
x = (x - SPEED);
a.x = x;
};
};
map_x = (((x - 32) * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
}
public function updateCollisionRect():void{
collision_rect.x = (x - (width >> 1));
collision_rect.y = (y - (height >> 1));
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:int;
if (!active){
return;
};
health--;
_local3 = new HitSparkMC();
_local3.x = (_arg1.x >> 0);
_local3.y = (_arg1.y >> 0);
_local4 = collision_rect.sideOf(_arg1.x, _arg1.y);
if (_local4 == UP){
} else {
if (_local4 == RIGHT){
_local3.rotation = 90;
} else {
if (_local4 == DOWN){
_local3.rotation = 180;
} else {
if (_local4 == LEFT){
_local3.rotation = 270;
};
};
};
};
g.effect_holder.addChild(_local3);
if ((((health <= 0)) || (_arg2))){
if (!spawned){
g.addScore(reward.value);
} else {
g.addScore((reward.value / 10));
};
kill((_arg1.x - _arg1.px));
NitromeGame.sound_manager.playSound("smithdie");
} else {
NitromeGame.sound_manager.playSound("smithhit");
if (state == RUNNING){
if ((((dir == RIGHT)) && ((g.player.x < x)))){
dir = LEFT;
state = FIRING;
} else {
if ((((dir == LEFT)) && ((g.player.x > x)))){
dir = RIGHT;
state = FIRING;
} else {
if (dir == STOPPED){
if ((((stop_dir == RIGHT)) && ((g.player.x < x)))){
stop_dir = LEFT;
state = FIRING;
} else {
if ((((stop_dir == LEFT)) && ((g.player.x > x)))){
stop_dir = RIGHT;
state = FIRING;
};
};
};
};
};
};
};
}
}
}//package com.nitrome.engine_specific
Section 42
//HackedSpider (com.nitrome.engine_specific.HackedSpider)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import com.nitrome.game.*;
import flash.ui.*;
public class HackedSpider extends Actor {
public var px:Number;
public var scroll_y:Number;
public var scroll_x:Number;
public var light:MovieClip;
public var py:Number;
public var dir:int;
public var body:MovieClip;
public var speed:Number;
public var temp_x:Number;
public var keys_pressed:int;
public var temp_y:Number;
public var map_rect:Rect;
public static const ACC:Number = 2.5;
public static const WIDTH:Number = 28;
public static const SPEED:Number = 10;
public static const DAMPING:Number = 0.59;
public static const HEIGHT:Number = 28;
public function HackedSpider(_arg1:MovieClip, _arg2:Game){
super(_arg1, _arg2, true);
_arg2.spider = this;
collision_rect = new Rect((x - 14), (y - 14), 28, 28);
px = x;
py = y;
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
all_collision = true;
body = (_arg1 as MovieClip).body;
light = (_arg1 as MovieClip).light;
scroll_x = (_arg2.player.scroll_rect.width * 0.5);
scroll_y = (_arg2.player.scroll_rect.height * 0.5);
map_rect = _arg2.scroller.map_rect;
if (((!((_arg2.current_event == null))) && ((_arg2.current_event.name == "message")))){
_arg2.current_event.active = false;
_arg2. = false;
};
speed = 0;
dir = 0;
}
public function checkKeys():void{
keys_pressed = 0;
if (((((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A)))) && (!(((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D))))))){
px = (px + speed);
keys_pressed = (keys_pressed | Rect.LEFT);
};
if (((((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D)))) && (!(((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A))))))){
px = (px - speed);
keys_pressed = (keys_pressed | Rect.RIGHT);
};
if (((((Key.isDown(Keyboard.UP)) || (Key.isDown(Key.W)))) && (!(((Key.isDown(Keyboard.DOWN)) || (Key.isDown(Key.S))))))){
py = (py + speed);
keys_pressed = (keys_pressed | Rect.UP);
};
if (((((Key.isDown(Keyboard.DOWN)) || (Key.isDown(Key.S)))) && (!(((Key.isDown(Keyboard.UP)) || (Key.isDown(Key.W))))))){
py = (py - speed);
keys_pressed = (keys_pressed | Rect.DOWN);
};
if (Key.isDown(Keyboard.SPACE)){
kill();
};
if ((((keys_pressed == 0)) && ((speed > 0)))){
speed = (speed - ACC);
} else {
if (speed < SPEED){
speed = (speed + ACC);
};
};
if (keys_pressed != 0){
dir = keys_pressed;
};
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
if (keys_pressed){
body.play();
light.play();
if ((((keys_pressed & Rect.UP)) && ((keys_pressed & Rect.RIGHT)))){
mc.rotation = 315;
} else {
if ((((keys_pressed & Rect.DOWN)) && ((keys_pressed & Rect.RIGHT)))){
mc.rotation = 45;
} else {
if ((((keys_pressed & Rect.DOWN)) && ((keys_pressed & Rect.LEFT)))){
mc.rotation = 135;
} else {
if ((((keys_pressed & Rect.UP)) && ((keys_pressed & Rect.LEFT)))){
mc.rotation = 215;
} else {
if ((keys_pressed & Rect.UP)){
mc.rotation = 270;
} else {
if ((keys_pressed & Rect.RIGHT)){
mc.rotation = 0;
} else {
if ((keys_pressed & Rect.DOWN)){
mc.rotation = 90;
} else {
if ((keys_pressed & Rect.LEFT)){
mc.rotation = 180;
};
};
};
};
};
};
};
};
} else {
body.stop();
light.stop();
};
if ((((dir & Rect.UP)) && ((scroll_y < g.player.scroll_rect.height)))){
scroll_y = (scroll_y + 2);
};
if ((((dir & Rect.RIGHT)) && ((scroll_x > 0)))){
scroll_x = (scroll_x - 2);
};
if ((((dir & Rect.DOWN)) && ((scroll_y > 0)))){
scroll_y = (scroll_y - 2);
};
if ((((dir & Rect.LEFT)) && ((scroll_x < g.player.scroll_rect.width)))){
scroll_x = (scroll_x + 2);
};
if ((((keys_pressed & Rect.UP)) && ((scroll_y < g.player.scroll_rect.height)))){
scroll_y = (scroll_y + 6);
};
if ((((keys_pressed & Rect.RIGHT)) && ((scroll_x > 0)))){
scroll_x = (scroll_x - 6);
};
if ((((keys_pressed & Rect.DOWN)) && ((scroll_y > 0)))){
scroll_y = (scroll_y - 6);
};
if ((((keys_pressed & Rect.LEFT)) && ((scroll_x < g.player.scroll_rect.width)))){
scroll_x = (scroll_x + 6);
};
g.player.scroll_target_x = ((-(mc.x) + g.player.scroll_rect.x) + scroll_x);
g.player.scroll_target_y = ((-(mc.y) + g.player.scroll_rect.y) + scroll_y);
g.player.scrolling();
g.scroller.clipManager();
}
public function main():void{
temp_x = x;
temp_y = y;
x = (x + (DAMPING * (x - px)));
y = (y + (DAMPING * (y - py)));
px = temp_x;
py = temp_y;
if ((map_rect.x + (map_rect.width - 1)) < (x + (WIDTH >> 1))){
x = (px = ((-((WIDTH >> 1)) + map_rect.x) + (map_rect.width - 1)));
};
if ((map_rect.y + (map_rect.height - 1)) < y){
kill();
return;
};
if (map_rect.x >= (x - (WIDTH >> 1))){
x = (px = (map_rect.x + (WIDTH >> 1)));
};
if (map_rect.y >= (y - (HEIGHT >> 1))){
y = (py = (map_rect.y + (HEIGHT >> 1)));
};
if (collision_rect.intersects(g.player.collision_rect)){
g.player.hit();
kill();
return;
};
map_x = (collision_rect.x * Game.SCALE);
map_y = (collision_rect.y * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if ((g.stack_map[map_y][map_x] & Rect.TEMP)){
if (((!((g.block_map[map_y][map_x] is GeneratorSwitch))) && (g.block_map[map_y][map_x].b.contains(collision_rect.x, collision_rect.y)))){
kill();
return;
};
} else {
kill();
return;
};
};
map_x = ((collision_rect.x + WIDTH) * Game.SCALE);
map_y = (collision_rect.y * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if ((g.stack_map[map_y][map_x] & Rect.TEMP)){
if (((!((g.block_map[map_y][map_x] is GeneratorSwitch))) && (g.block_map[map_y][map_x].b.contains((collision_rect.x + WIDTH), collision_rect.y)))){
kill();
return;
};
} else {
kill();
return;
};
};
map_x = ((collision_rect.x + WIDTH) * Game.SCALE);
map_y = ((collision_rect.y + HEIGHT) * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if ((g.stack_map[map_y][map_x] & Rect.TEMP)){
if (((!((g.block_map[map_y][map_x] is GeneratorSwitch))) && (g.block_map[map_y][map_x].b.contains((collision_rect.x + WIDTH), (collision_rect.y + HEIGHT))))){
kill();
return;
};
} else {
kill();
return;
};
};
map_x = (collision_rect.x * Game.SCALE);
map_y = ((collision_rect.y + HEIGHT) * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if ((g.stack_map[map_y][map_x] & Rect.TEMP)){
if (((!((g.block_map[map_y][map_x] is GeneratorSwitch))) && (g.block_map[map_y][map_x].b.contains(collision_rect.x, (collision_rect.y + HEIGHT))))){
kill();
return;
};
} else {
kill();
return;
};
};
checkKeys();
updateMC();
updateCollisionRect();
}
override public function resolveBulletCollision(_arg1):void{
kill();
}
override public function resolveEncounterCollision(_arg1):void{
if (!active){
return;
};
if ((((_arg1 is Laser)) && ((_arg1.state == Laser.INACTIVE)))){
return;
};
if ((((_arg1 is TripWire)) && (!(_arg1.killer)))){
return;
};
if ((_arg1 is Cammo)){
return;
};
if ((_arg1 is Lift)){
return;
};
_arg1.resolveWeaponCollision(new Star(x, y, (x - px), (y - py), null, g), true);
if ((((_arg1 is Health)) || ((_arg1 is Coin)))){
return;
};
kill();
}
public function kill():void{
if (!active){
return;
};
active = false;
g.addFX(mc.x, mc.y, g.bang_bitmap1);
g.player.key_lock = true;
if (!g.player.on_scroller){
g.spider_death_count = Game.SPIDER_DEATH_DELAY;
} else {
g.spider = null;
};
}
public function updateCollisionRect():void{
collision_rect.x = (x - 16);
collision_rect.y = (y - 16);
}
}
}//package com.nitrome.engine_specific
Section 43
//Health (com.nitrome.engine_specific.Health)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Health extends Encounter {
public var collision_rect:Rect;
public function Health(_arg1:Sprite, _arg2:Game){
super(_arg1, _arg2, false);
collision_rect = new Rect((_arg1.x + 11), (_arg1.y + 34), 38, 30);
actor_target = false;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
override public function resolvePlayerCollision(_arg1:Player):void{
if (_arg1.health.value < 3){
_arg1.health.value++;
NitromeGame.timeline.health_panel.gotoAndStop(("_" + g.player.health.value));
};
kill();
}
public function kill():void{
var _local1:MovieClip;
if (!active){
return;
};
_local1 = new HealthFadeMC();
NitromeGame.sound_manager.playSound("oishii");
_local1.x = mc.x;
_local1.y = mc.y;
g.star_holder.addChild(_local1);
g.scroller.map_array_layers[layer][map_y][map_x] = 0;
active = false;
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
if (!active){
return;
};
if (g.player.health.value < 3){
g.player.health.value++;
NitromeGame.timeline.health_panel.gotoAndStop(("_" + g.player.health.value));
};
kill();
}
}
}//package com.nitrome.engine_specific
Section 44
//Laser (com.nitrome.engine_specific.Laser)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Laser extends Encounter {
public var health_fraction:Number;// = 0
public var state:int;
public var count:int;
public var :Boolean;
public var collision_rect:Rect;
public var health:int;// = 0
public static const DELAY:int = 50;
public static const ACTIVE:int = 2;
public static const INACTIVE:int = 1;
public static const WARM_UP_STEP:Number = 0.2;
public function Laser(_arg1:Boolean, _arg2:Rect, _arg3:MovieClip, _arg4:Game){
health = 0;
health_fraction = 0;
super(_arg3, _arg4, false);
collision_rect = _arg2;
this. = _arg1;
state = ACTIVE;
actor_target = false;
if (_arg1){
has_main = true;
count = (_arg4.frame_count % 100);
if (count >= 50){
count = (count % 50);
state = INACTIVE;
_arg3.alpha = 0;
};
};
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return ((((state == ACTIVE)) && (collision_rect.contains(_arg1, _arg2))));
}
override public function intersects(_arg1:Rect):Boolean{
if (state == ACTIVE){
return (collision_rect.intersects(_arg1));
};
return (false);
}
public function main():void{
count++;
if (state == ACTIVE){
if (count >= DELAY){
state = INACTIVE;
count = 0;
};
if (mc.alpha < 1){
mc.alpha = (mc.alpha + WARM_UP_STEP);
};
} else {
if (state == INACTIVE){
if (count >= DELAY){
state = ACTIVE;
count = 0;
};
if (mc.alpha > 0){
mc.alpha = (mc.alpha - WARM_UP_STEP);
};
};
};
}
override public function resolvePlayerCollision(_arg1:Player):void{
_arg1.hit();
}
override public function debug():void{
collision_rect.draw(g.debug);
}
}
}//package com.nitrome.engine_specific
Section 45
//Lift (com.nitrome.engine_specific.Lift)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Lift extends Encounter {
public var health_fraction:Number;// = 0
public var collision_rect:Rect;
public var health:int;// = 0
public function Lift(_arg1:Sprite, _arg2:Game){
health = 0;
health_fraction = 0;
super(_arg1, _arg2, false);
collision_rect = new Rect((_arg1.x + 30), (_arg1.y + 32), 2, 32);
actor_target = false;
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
override public function resolvePlayerCollision(_arg1:Player):void{
if (((!(active)) || (!((g.player.state == Player.RUNNING))))){
return;
};
g.player.levelComplete(this);
g.scroller.map_array_layers[layer][map_y][map_x] = 0;
g.mouse_pressed = false;
}
public function exitAnim():void{
(mc as MovieClip).gotoAndStop("exit");
}
override public function unpause():void{
(mc as MovieClip).gotoAndStop(1);
}
}
}//package com.nitrome.engine_specific
Section 46
//LiveStar (com.nitrome.engine_specific.LiveStar)
package com.nitrome.engine_specific {
import flash.display.*;
public class LiveStar extends DeadStar {
public var star:MovieClip;
}
}//package com.nitrome.engine_specific
Section 47
//Morph (com.nitrome.engine_specific.Morph)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.events.*;
public class Morph extends Sprite {
private const SPEED:int = 2;
private const NUM:int = 18;
private var
:Number;
private var i:int;
private var gfx:Graphics;
private var
:Number;
private var step:Number;
private var
:Array;
public function Morph(){
var _local1:Shape;
super();
_local1 = new Shape();
gfx = _local1.graphics;
addChild(_local1);
addEventListener(Event.ENTER_FRAME, main, false, 0, true);
= (height / 2);
= width;
step = (width / NUM);
= [];
i = 0;
while (i < NUM) {
.push(
(i));
i = (i + 2);
};
}
private function get randomy():Number{
return (((
* 0.1) + (Math.random() *
)));
}
public function main(_arg1:Event):void{
gfx.clear();
gfx.beginFill(0);
gfx.moveTo(0, (
-
[0].a.y));
i = 0;
while (i <
.length) {
gfx.lineTo(
[i].a.x, (
-
[i].a.y));
gfx.lineTo(
[i].b.x, (
-
[i].b.y));
i++;
};
gfx.lineTo(width, (
-
[(
.length - 1)].b.y));
gfx.lineTo(width, (
+
[(
.length - 1)].b.y));
i = (
.length - 1);
while (i > -1) {
gfx.lineTo(
[i].b.x, (
+
[i].b.y));
gfx.lineTo(
[i].a.x, (
+
[i].a.y));
i--;
};
gfx.lineTo(0, (
+
[0].a.y));
gfx.lineTo(0, (
-
[0].a.y));
i = 0;
while (i <
.length) {
[i].a.x = (
[i].a.x + SPEED);
[i].b.x = (
[i].b.x + SPEED);
i++;
};
if (
[0].a.x > 0){
.unshift(
(-2));
};
if (
[(
.length - 1)].a.x >
){
.pop();
};
}
private function
(_arg1:int):Object{
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local5:Object;
_local2 = randomy;
_local3 = (Math.random() * 8);
if (_local3){
_local4 = (step / (_local3 + 1));
};
_local5 = {a:new Dot((_arg1 * step), _local2), b:new Dot(((_arg1 + 1) * step), _local2), ribs:_local3, rib_len:_local4};
return (_local5);
}
}
}//package com.nitrome.engine_specific
Section 48
//MovingBlock (com.nitrome.engine_specific.MovingBlock)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class MovingBlock extends FlyingBot {
public var init:Boolean;// = false
public var SPEED:Number;// = 2
public var remove_call:Boolean;// = false
public var rez_buddies:Array;
public var b:Block;
public var :int;
public var evil:Boolean;// = false
public var buddy:Boolean;// = false
public var base_tile_id:int;
public static const CRUSH:int = 4;
public static const CRUSH_DELAY:int = 16;
public function MovingBlock(_arg1:int, _arg2:Sprite, _arg3:Game){
SPEED = 2;
buddy = false;
remove_call = false;
init = false;
evil = false;
super(_arg1, _arg2, _arg3);
block = true;
state = MOVING;
rez_buddies = [];
= 0;
}
public function updateMC():void{
mc.x = (b.x >> 0);
mc.y = (b.y >> 0);
}
public function ():void{
b.x = x;
b.y = y;
}
override public function alert():void{
if (evil){
aggressive = true;
(mc as MovieClip).gotoAndStop("aggressive");
};
}
override public function debug():void{
b.draw(g.debug);
if (b.stacked > 0){
if ((b.stacked & Rect.UP)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo((b.x + (b.width * 0.5)), b.y);
};
if ((b.stacked & Rect.RIGHT)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo((b.x + b.width), (b.y + (b.height * 0.5)));
};
if ((b.stacked & Rect.DOWN)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo((b.x + (b.width * 0.5)), (b.y + b.height));
};
if ((b.stacked & Rect.LEFT)){
g.debug.moveTo((b.x + (b.width * 0.5)), (b.y + (b.height * 0.5)));
g.debug.lineTo(b.x, (b.y + (b.height * 0.5)));
};
};
}
override public function remove():void{
var _local1:int;
var _local2:*;
has_main = false;
if (rez_buddies.length > 0){
_local1 = 0;
while (_local1 < rez_buddies.length) {
rez_buddies[_local1].remove_call = true;
_local1++;
};
};
if (active){
active = false;
if (!buddy){
if (aggressive){
tile_id = "129";
} else {
_local2 = 0;
while ((dir = (dir >> 1))) {
_local2++;
};
tile_id = ("" + (base_tile_id + _local2));
};
g.scroller.map_array_layers[layer][map_y][map_x] = tile_id;
} else {
g.scroller.map_array_layers[layer][map_y][map_x] = 0;
};
g.stack_map[map_y][map_x] = Game.EMPTY;
};
}
public function main():void{
b.px = x;
b.py = y;
if (!init){
g.block_map[map_y][map_x] = this;
g.stack_map[map_y][map_x] = Rect.TEMP;
init = true;
};
if (state == MOVING){
move();
if ((((dir == UP)) || ((dir == DOWN)))){
if ((y * Game.SCALE) == map_y){
if ((((dir == UP)) && ((g.block_map[(map_y + 1)][map_x] == this)))){
g.block_map[(map_y + 1)][map_x] = null;
g.stack_map[(map_y + 1)][map_x] = Game.EMPTY;
} else {
if ((((dir == DOWN)) && ((g.block_map[(map_y - 1)][map_x] == this)))){
g.block_map[(map_y - 1)][map_x] = null;
g.stack_map[(map_y - 1)][map_x] = Game.EMPTY;
};
};
if (((((((!(buddy)) && (!(forced)))) && (!(g.scroller.contains(x, y))))) || (((buddy) && (remove_call))))){
remove();
return;
};
if (aggressive){
selectSeekPath();
} else {
selectPatrolPath();
};
};
} else {
if ((((dir == LEFT)) || ((dir == RIGHT)))){
if ((x * Game.SCALE) == map_x){
if ((((dir == LEFT)) && ((g.block_map[map_y][(map_x + 1)] == this)))){
g.block_map[map_y][(map_x + 1)] = null;
g.stack_map[map_y][(map_x + 1)] = Game.EMPTY;
} else {
if ((((dir == RIGHT)) && ((g.block_map[map_y][(map_x - 1)] == this)))){
g.block_map[map_y][(map_x - 1)] = null;
g.stack_map[map_y][(map_x - 1)] = Game.EMPTY;
};
};
if (((((((!(buddy)) && (!(forced)))) && (!(g.scroller.contains(x, y))))) || (((buddy) && (remove_call))))){
remove();
return;
};
if (aggressive){
selectSeekPath();
} else {
selectPatrolPath();
};
};
} else {
if (dir == STOPPED){
if (((((((!(buddy)) && (!(forced)))) && (!(g.scroller.contains(x, y))))) || (((buddy) && (remove_call))))){
remove();
return;
};
if (aggressive){
selectSeekPath();
} else {
selectPatrolPath();
};
};
};
};
} else {
if (state == TURNING){
state = MOVING;
} else {
if (state == CRUSH){
--;
if ( <= 0){
state = MOVING;
};
};
};
};
updateMC();
();
}
override public function selectPatrolPath():void{
super.selectPatrolPath();
if (dir == UP){
g.block_map[(map_y - 1)][map_x] = this;
g.stack_map[(map_y - 1)][map_x] = Rect.TEMP;
} else {
if (dir == DOWN){
g.block_map[(map_y + 1)][map_x] = this;
g.stack_map[(map_y + 1)][map_x] = Rect.TEMP;
} else {
if (dir == LEFT){
g.block_map[map_y][(map_x - 1)] = this;
g.stack_map[map_y][(map_x - 1)] = Rect.TEMP;
} else {
if (dir == RIGHT){
g.block_map[map_y][(map_x + 1)] = this;
g.stack_map[map_y][(map_x + 1)] = Rect.TEMP;
};
};
};
};
}
public function move():void{
if (dir == UP){
y = (y - SPEED);
} else {
if (dir == RIGHT){
x = (x + SPEED);
} else {
if (dir == LEFT){
x = (x - SPEED);
} else {
if (dir == DOWN){
y = (y + SPEED);
};
};
};
};
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
}
override public function selectSeekPath():void{
super.selectSeekPath();
if ((((((((((((g.player.grid_x == map_x)) && ((g.player.grid_y == (map_y + 1))))) && ((g.stack_map[(map_y + 1)][map_x] == Rect.TEMP)))) || ((((((g.player.grid_x == (map_x + 1))) && ((g.player.grid_y == map_y)))) && ((g.stack_map[map_y][(map_x + 1)] == Rect.TEMP)))))) || ((((((g.player.grid_x == map_x)) && ((g.player.grid_y == (map_y - 1))))) && ((g.stack_map[(map_y - 1)][map_x] == Rect.TEMP)))))) || ((((((g.player.grid_x == (map_x - 1))) && ((g.player.grid_y == map_y)))) && ((g.stack_map[map_y][(map_x - 1)] == Rect.TEMP)))))){
state = CRUSH;
= CRUSH_DELAY;
return;
};
if (SPEED != 4){
SPEED = 4;
};
if (dir == UP){
g.block_map[(map_y - 1)][map_x] = this;
g.stack_map[(map_y - 1)][map_x] = Rect.TEMP;
} else {
if (dir == DOWN){
g.block_map[(map_y + 1)][map_x] = this;
g.stack_map[(map_y + 1)][map_x] = Rect.TEMP;
} else {
if (dir == LEFT){
g.block_map[map_y][(map_x - 1)] = this;
g.stack_map[map_y][(map_x - 1)] = Rect.TEMP;
} else {
if (dir == RIGHT){
g.block_map[map_y][(map_x + 1)] = this;
g.stack_map[map_y][(map_x + 1)] = Rect.TEMP;
};
};
};
};
}
override public function unpause():void{
if (evil){
if (aggressive){
(mc as MovieClip).gotoAndStop("aggressive");
} else {
(mc as MovieClip).gotoAndStop("idle");
};
};
}
}
}//package com.nitrome.engine_specific
Section 49
//Ninja (com.nitrome.engine_specific.Ninja)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.geom.*;
public class Ninja extends Encounter {
public var stealth:Boolean;
public var stealth_clip:StealthClip;
public var orient:int;
public var :int;
public var :int;
public var old_orient:int;
public var health:int;// = 5
public var flip:int;
public var health_fraction:Number;// = 0.2
public var tracking_count:int;
public var controlled:Boolean;
public var state:int;
public var dir:int;
public var stealth_mask:MovieClip;
public var collision_rect:Rect;
public var :int;
public static const RIGHT:int = 2;
public static const LEFT:int = 8;
public static const FLYING:int = 4;
public static const UP:int = 1;
public static const RUNNING:int = 2;
public static const WIDTH:int = 22;
public static const HEIGHT:int = 34;
public static const DOWN:int = 4;
public static const HIDE_DELAY:int = 25;
public static const SPEED:int = 7;
public static const TRACKING_DELAY:int = 75;
public static const CHASE_DIST:Number = 500;
public static const WAIT:int = 1;
public static var point:Point = new Point();
public function Ninja(_arg1:int, _arg2:MovieClip, _arg3:Game){
health = 5;
health_fraction = 0.2;
super(_arg2, _arg3, true);
this.orient = _arg1;
if (_arg1 == UP){
x = (x + (Game.scale >> 1));
y = (y + (Game.scale - 1));
} else {
if (_arg1 == RIGHT){
y = (y + (Game.scale >> 1));
} else {
if (_arg1 == DOWN){
x = (x + (Game.scale >> 1));
} else {
if (_arg1 == LEFT){
x = (x + (Game.scale - 1));
y = (y + (Game.scale >> 1));
};
};
};
};
if ((((_arg1 == UP)) || ((_arg1 == DOWN)))){
if (((!((_arg3.player == null))) && (_arg3.player.active))){
dir = ((_arg3.player.x < x)) ? LEFT : RIGHT;
} else {
dir = ((Math.random() >= 0.5)) ? LEFT : RIGHT;
};
} else {
if ((((_arg1 == RIGHT)) || ((_arg1 == LEFT)))){
if (((!((_arg3.player == null))) && (_arg3.player.active))){
dir = ((_arg3.player.y < y)) ? UP : DOWN;
} else {
dir = ((Math.random() >= 0.5)) ? UP : DOWN;
};
};
};
has_main = true;
has_collision = true;
collision_rect = new Rect();
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
state = WAIT;
stealth = true;
stealth_mask = new NinjaMC();
stealth_clip = new StealthClip(stealth_mask, 80, 80);
_arg3.monster_holder.addChild(stealth_clip);
_arg3. .push(this);
updateCollisionRect();
updateMC();
tracking_count = TRACKING_DELAY;
reward = new HiddenInt(70);
controlled = !((_arg3.path_map[map_y][map_x] == 0));
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
stealth_clip.x = mc.x;
stealth_clip.y = mc.y;
if (orient == UP){
mc.rotation = 0;
stealth_clip.bitmap.x = (-(stealth_clip.bitmap.width) * 0.5);
stealth_clip.bitmap.y = (-(stealth_clip.bitmap.height) + 2);
= (-(stealth_clip.bitmap.width) * 0.5);
= (-(stealth_clip.bitmap.height) + 2);
} else {
if (orient == RIGHT){
mc.rotation = 90;
stealth_clip.bitmap.x = (-(stealth_clip.bitmap.width) * 0.5);
stealth_clip.bitmap.y = 2;
= -2;
= (-(stealth_clip.bitmap.height) * 0.5);
} else {
if (orient == DOWN){
mc.rotation = 180;
stealth_clip.bitmap.x = (stealth_clip.bitmap.width * 0.5);
stealth_clip.bitmap.y = 2;
= (-(stealth_clip.bitmap.width) * 0.5);
= -2;
} else {
if (orient == LEFT){
mc.rotation = 270;
stealth_clip.bitmap.x = (stealth_clip.bitmap.width * 0.5);
stealth_clip.bitmap.y = (-(stealth_clip.bitmap.height) + 2);
= (-(stealth_clip.bitmap.width) + 2);
= ((-(stealth_clip.bitmap.height) * 0.5) + 2);
};
};
};
};
stealth_clip.rotation = mc.rotation;
stealth_clip.bitmap.rotation = -(mc.rotation);
if (stealth){
if (stealth_clip.alpha < 1){
stealth_clip.alpha = (stealth_clip.alpha + 0.1);
};
} else {
if (stealth_clip.alpha > 0){
stealth_clip.alpha = (stealth_clip.alpha - 0.1);
};
};
}
override public function intersects(_arg1:Rect):Boolean{
if ((((state == FLYING)) && (collision_rect.intersects(_arg1)))){
return (true);
};
return (false);
}
public function updateAnimState(_arg1:MovieClip):void{
if (state == RUNNING){
if (orient == UP){
if (dir == RIGHT){
if ((_arg1 as MovieClip).currentLabel != "run_right"){
(_arg1 as MovieClip).gotoAndStop("run_right");
};
} else {
if (dir == LEFT){
if ((_arg1 as MovieClip).currentLabel != "run_left"){
(_arg1 as MovieClip).gotoAndStop("run_left");
};
};
};
} else {
if (orient == RIGHT){
if (dir == DOWN){
if ((_arg1 as MovieClip).currentLabel != "run_right"){
(_arg1 as MovieClip).gotoAndStop("run_right");
};
} else {
if (dir == UP){
if ((_arg1 as MovieClip).currentLabel != "run_left"){
(_arg1 as MovieClip).gotoAndStop("run_left");
};
};
};
} else {
if (orient == DOWN){
if (dir == RIGHT){
if ((_arg1 as MovieClip).currentLabel != "run_left"){
(_arg1 as MovieClip).gotoAndStop("run_left");
};
} else {
if (dir == LEFT){
if ((_arg1 as MovieClip).currentLabel != "run_right"){
(_arg1 as MovieClip).gotoAndStop("run_right");
};
};
};
} else {
if (orient == LEFT){
if (dir == DOWN){
if ((_arg1 as MovieClip).currentLabel != "run_left"){
(_arg1 as MovieClip).gotoAndStop("run_left");
};
} else {
if (dir == UP){
if ((_arg1 as MovieClip).currentLabel != "run_right"){
(_arg1 as MovieClip).gotoAndStop("run_right");
};
};
};
};
};
};
};
} else {
if (state == WAIT){
if (orient == UP){
if (dir == RIGHT){
if ((_arg1 as MovieClip).currentLabel != "wait_right"){
(_arg1 as MovieClip).gotoAndStop("wait_right");
};
} else {
if (dir == LEFT){
if ((_arg1 as MovieClip).currentLabel != "wait_left"){
(_arg1 as MovieClip).gotoAndStop("wait_left");
};
};
};
} else {
if (orient == RIGHT){
if (dir == DOWN){
if ((_arg1 as MovieClip).currentLabel != "wait_right"){
(_arg1 as MovieClip).gotoAndStop("wait_right");
};
} else {
if (dir == UP){
if ((_arg1 as MovieClip).currentLabel != "wait_left"){
(_arg1 as MovieClip).gotoAndStop("wait_left");
};
};
};
} else {
if (orient == DOWN){
if (dir == RIGHT){
if ((_arg1 as MovieClip).currentLabel != "wait_left"){
(_arg1 as MovieClip).gotoAndStop("wait_left");
};
} else {
if (dir == LEFT){
if ((_arg1 as MovieClip).currentLabel != "wait_right"){
(_arg1 as MovieClip).gotoAndStop("wait_right");
};
};
};
} else {
if (orient == LEFT){
if (dir == DOWN){
if ((_arg1 as MovieClip).currentLabel != "wait_left"){
(_arg1 as MovieClip).gotoAndStop("wait_left");
};
} else {
if (dir == UP){
if ((_arg1 as MovieClip).currentLabel != "wait_right"){
(_arg1 as MovieClip).gotoAndStop("wait_right");
};
};
};
};
};
};
};
} else {
if (state == FLYING){
if ((_arg1 as MovieClip).currentLabel != "fly"){
(_arg1 as MovieClip).gotoAndStop("fly");
};
};
};
};
}
public function stealthScreenGrab():void{
mc.visible = false;
point = Util.localToLocal(point, mc, NitromeGame.timeline);
stealth_clip.grab((-(point.x) - ), (-(point.y) - ));
mc.visible = true;
}
public function kill(_arg1:Number):void{
if (!active){
return;
};
active = false;
if (!spawned){
NitromeGame.bonus.enemy_count.value++;
};
g.addFX(mc.x, mc.y, g.bang_bitmap1);
if (stealth_clip.parent != null){
stealth_clip.parent.removeChild(stealth_clip);
};
if (Math.random() > 0.5){
g.addSmoke(mc.x, mc.y);
};
g.shake(3);
g.addDebris((collision_rect.x + (collision_rect.width * 0.5)), (collision_rect.y + (collision_rect.height * 0.5)), ((_arg1 > 0)) ? 10 : -10, g.debris_clips[6], g.debris_clips[7], g.debris_clips[8]);
}
public function fly(_arg1=null):void{
var _local2:MovieClip;
if (state == FLYING){
return;
};
state = FLYING;
stealth = false;
= HIDE_DELAY;
NitromeGame.sound_manager.playSound("missile");
_local2 = new JumpMC();
if (((!((_arg1 == null))) && (_arg1.b.moving_block))){
_local2.x = (x - _arg1.b.x);
_local2.y = (y - _arg1.b.y);
updateMC();
_local2.rotation = mc.rotation;
_arg1.mc.addChild(_local2);
} else {
_local2.x = mc.x;
_local2.y = mc.y;
_local2.rotation = mc.rotation;
g.effect_holder.addChild(_local2);
};
}
override public function remove():void{
if (((active) && (!((stealth_clip.parent == null))))){
stealth_clip.parent.removeChild(stealth_clip);
};
super.remove();
}
public function main():void{
if ((((((((((((((((state == RUNNING)) || ((state == WAIT)))) && (!(forced)))) && (!(g.scroller.contains((collision_rect.x + (collision_rect.width * 0.5)), (collision_rect.y + (collision_rect.height * 0.5))))))) && (!((map_x == 0))))) && (!((map_x == (g.scroller.width - 1)))))) && (!((map_y == 0))))) && (!((map_y == (g.scroller.height - 1)))))){
map_x = (collision_rect.x + (collision_rect.width * 0.5));
map_y = (collision_rect.y + (collision_rect.height * 0.5));
if (orient == UP){
tile_id = "63";
} else {
if (orient == RIGHT){
tile_id = "64";
} else {
if (orient == DOWN){
tile_id = "65";
} else {
if (orient == LEFT){
tile_id = "66";
};
};
};
};
remove();
return;
};
old_orient = orient;
if ((((state == RUNNING)) || ((state == WAIT)))){
if ((((g.player.state == Player.STEALTH)) || (g.player.chameleon))){
stealth = false;
= HIDE_DELAY;
} else {
if (((!(stealth)) && ((-- < 0)))){
stealth = true;
};
};
if (--tracking_count <= 0){
if (Util.proximity(x, y, g.player.x, g.player.y, CHASE_DIST)){
state = RUNNING;
if ((((orient == UP)) || ((orient == DOWN)))){
if (((((((g.player.active) && (!((g.player.state == Player.STEALTH))))) && (!(g.player.chameleon)))) && ((g.player.x < (x - SPEED))))){
dir = LEFT;
} else {
if (((((((g.player.active) && (!((g.player.state == Player.STEALTH))))) && (!(g.player.chameleon)))) && ((g.player.x > (x + SPEED))))){
dir = RIGHT;
};
};
} else {
if ((((orient == RIGHT)) || ((orient == LEFT)))){
if (((((((g.player.active) && (!((g.player.state == Player.STEALTH))))) && (!(g.player.chameleon)))) && ((g.player.y < (y - SPEED))))){
dir = UP;
} else {
if (((((((g.player.active) && (!((g.player.state == Player.STEALTH))))) && (!(g.player.chameleon)))) && ((g.player.y > (y + SPEED))))){
dir = DOWN;
};
};
};
};
} else {
if (Math.random() > 0.5){
state = WAIT;
};
};
tracking_count = TRACKING_DELAY;
};
if (((((g.player.active) && (!((g.player.state == Player.STEALTH))))) && (!(g.player.chameleon)))){
if ((((orient == UP)) || ((orient == DOWN)))){
if ((((((g.player.x > (x - SPEED))) && ((g.player.x < (x + SPEED))))) && (jumpClear()))){
fly();
};
} else {
if ((((orient == RIGHT)) || ((orient == LEFT)))){
if ((((((g.player.y > (y - SPEED))) && ((g.player.y < (y + SPEED))))) && (jumpClear()))){
fly();
};
};
};
};
if (controlled){
if (state == RUNNING){
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
if (g.path_map[map_y][map_x] == 0){
fly();
} else {
if (dir == UP){
if ((((g.path_map[(map_y - 1)][map_x] == 0)) && ((g.stack_map[(map_y - 1)][map_x] == Game.EMPTY)))){
dir = DOWN;
};
} else {
if (dir == RIGHT){
if ((((g.path_map[map_y][(map_x + 1)] == 0)) && ((g.stack_map[map_y][(map_x + 1)] == Game.EMPTY)))){
dir = LEFT;
};
} else {
if (dir == DOWN){
if ((((g.path_map[(map_y + 1)][map_x] == 0)) && ((g.stack_map[(map_y + 1)][map_x] == Game.EMPTY)))){
dir = UP;
};
} else {
if (dir == LEFT){
if ((((g.path_map[map_y][(map_x - 1)] == 0)) && ((g.stack_map[map_y][(map_x - 1)] == Game.EMPTY)))){
dir = RIGHT;
};
};
};
};
};
};
};
};
if (state == RUNNING){
if (dir == UP){
y = (y - SPEED);
map_x = (x * Game.SCALE);
map_y = ((y - (WIDTH >> 1)) * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains(x, (y - HEIGHT))))){
y = (g.block_map[map_y][map_x].b.y + g.block_map[map_y][map_x].b.height);
if (orient == RIGHT){
x = (x + (WIDTH >> 1));
} else {
if (orient == LEFT){
x = (x - (WIDTH >> 1));
};
};
fly(g.block_map[map_y][map_x]);
};
} else {
state = RUNNING;
y = ((map_y + 1) * Game.scale);
if (orient == RIGHT){
x = (x + (WIDTH >> 1));
} else {
if (orient == LEFT){
x = (x - (WIDTH >> 1));
};
};
};
dir = orient;
orient = DOWN;
} else {
if (map_y == 0){
dir = DOWN;
};
};
if (state != FLYING){
map_y = (y * Game.SCALE);
if (orient == LEFT){
if (g.stack_map[map_y][(map_x + 1)] == Game.EMPTY){
orient = dir;
x = ((map_x + 1) * Game.scale);
y = (((map_y + 1) * Game.scale) - 1);
dir = RIGHT;
};
} else {
if (orient == RIGHT){
if (g.stack_map[map_y][(map_x - 1)] == Game.EMPTY){
orient = dir;
x = ((map_x * Game.scale) - 1);
y = (((map_y + 1) * Game.scale) - 1);
dir = LEFT;
};
};
};
};
} else {
if (dir == RIGHT){
x = (x + SPEED);
map_x = ((x + (WIDTH >> 1)) * Game.SCALE);
map_y = (y * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains((x + HEIGHT), y)))){
x = (g.block_map[map_y][map_x].b.x - 1);
if (orient == DOWN){
y = (y + (WIDTH >> 1));
} else {
if (orient == UP){
y = (y - (WIDTH >> 1));
};
};
fly(g.block_map[map_y][map_x]);
};
} else {
state = RUNNING;
x = ((map_x * Game.scale) - 1);
if (orient == DOWN){
y = (y + (WIDTH >> 1));
} else {
if (orient == UP){
y = (y - (WIDTH >> 1));
};
};
};
dir = orient;
orient = LEFT;
} else {
if (map_x == (g.scroller.width - 1)){
dir = LEFT;
};
};
if (state != FLYING){
map_x = (x * Game.SCALE);
if (orient == UP){
if (g.stack_map[(map_y + 1)][map_x] == Game.EMPTY){
orient = dir;
x = (map_x * Game.scale);
y = ((map_y + 1) * Game.scale);
dir = DOWN;
};
} else {
if (orient == DOWN){
if (g.stack_map[(map_y - 1)][map_x] == Game.EMPTY){
orient = dir;
x = (map_x * Game.scale);
y = ((map_y * Game.scale) - 1);
dir = UP;
};
};
};
};
} else {
if (dir == DOWN){
y = (y + SPEED);
map_x = (x * Game.SCALE);
map_y = ((y + (WIDTH >> 1)) * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains(x, (y + HEIGHT))))){
y = (g.block_map[map_y][map_x].b.y - 1);
if (orient == RIGHT){
x = (x + (WIDTH >> 1));
} else {
if (orient == LEFT){
x = (x - (WIDTH >> 1));
};
};
fly(g.block_map[map_y][map_x]);
};
} else {
state = RUNNING;
y = ((map_y * Game.scale) - 1);
if (orient == RIGHT){
x = (x + (WIDTH >> 1));
} else {
if (orient == LEFT){
x = (x - (WIDTH >> 1));
};
};
};
dir = orient;
orient = UP;
} else {
if (map_y == (g.scroller.height - 1)){
dir = UP;
};
};
if (state != FLYING){
map_y = (y * Game.SCALE);
if (orient == LEFT){
if (g.stack_map[map_y][(map_x + 1)] == Game.EMPTY){
orient = dir;
x = ((map_x + 1) * Game.scale);
y = (map_y * Game.scale);
dir = RIGHT;
};
} else {
if (orient == RIGHT){
if (g.stack_map[map_y][(map_x - 1)] == Game.EMPTY){
orient = dir;
x = ((map_x * Game.scale) - 1);
y = (map_y * Game.scale);
dir = LEFT;
};
};
};
};
} else {
if (dir == LEFT){
x = (x - SPEED);
map_x = ((x - (WIDTH >> 1)) * Game.SCALE);
map_y = (y * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains((x - HEIGHT), y)))){
x = (g.block_map[map_y][map_x].b.x + g.block_map[map_y][map_x].b.width);
if (orient == DOWN){
y = (y + (WIDTH >> 1));
} else {
if (orient == UP){
y = (y - (WIDTH >> 1));
};
};
fly(g.block_map[map_y][map_x]);
};
} else {
state = RUNNING;
x = ((map_x + 1) * Game.scale);
if (orient == DOWN){
y = (y + (WIDTH >> 1));
} else {
if (orient == UP){
y = (y - (WIDTH >> 1));
};
};
};
dir = orient;
orient = RIGHT;
} else {
if (map_x == 0){
dir = RIGHT;
};
};
if (state != FLYING){
map_x = (x * Game.SCALE);
if (orient == UP){
if (g.stack_map[(map_y + 1)][map_x] == Game.EMPTY){
orient = dir;
x = (((map_x + 1) * Game.scale) - 1);
y = ((map_y + 1) * Game.scale);
dir = DOWN;
};
} else {
if (orient == DOWN){
if (g.stack_map[(map_y - 1)][map_x] == Game.EMPTY){
orient = dir;
x = (((map_x + 1) * Game.scale) - 1);
y = ((map_y * Game.scale) - 1);
dir = UP;
};
};
};
};
};
};
};
};
};
} else {
if (state == FLYING){
if (orient == UP){
y = (y - (SPEED * 2));
map_x = (x * Game.SCALE);
map_y = ((y - HEIGHT) * Game.SCALE);
if (map_y == 0){
orient = DOWN;
return;
};
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains(x, (y - HEIGHT))))){
state = FLYING;
y = (g.block_map[map_y][map_x].b.y + g.block_map[map_y][map_x].b.height);
};
} else {
state = RUNNING;
y = ((map_y + 1) * Game.scale);
};
orient = DOWN;
};
} else {
if (orient == RIGHT){
x = (x + (SPEED * 2));
map_x = ((x + HEIGHT) * Game.SCALE);
map_y = (y * Game.SCALE);
if (map_x == (g.scroller.width - 1)){
orient = LEFT;
return;
};
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains((x + HEIGHT), y)))){
state = FLYING;
x = (g.block_map[map_y][map_x].b.x - 1);
};
} else {
state = RUNNING;
x = ((map_x * Game.scale) - 1);
};
orient = LEFT;
};
} else {
if (orient == DOWN){
y = (y + (SPEED * 2));
map_x = (x * Game.SCALE);
map_y = ((y + HEIGHT) * Game.SCALE);
if (map_y == (g.scroller.height - 1)){
orient = UP;
return;
};
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains(x, (y + HEIGHT))))){
state = FLYING;
y = (g.block_map[map_y][map_x].b.y - 1);
};
} else {
state = RUNNING;
y = ((map_y * Game.scale) - 1);
};
orient = UP;
};
} else {
if (orient == LEFT){
x = (x - (SPEED * 2));
map_x = ((x - HEIGHT) * Game.SCALE);
map_y = (y * Game.SCALE);
if (map_y == 0){
orient = RIGHT;
return;
};
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains((x - HEIGHT), y)))){
state = FLYING;
x = (g.block_map[map_y][map_x].b.x + g.block_map[map_y][map_x].b.width);
};
} else {
state = RUNNING;
x = ((map_x + 1) * Game.scale);
};
orient = RIGHT;
};
};
};
};
};
};
};
updateCollisionRect();
updateAnimState((mc as MovieClip));
updateAnimState(stealth_mask);
updateMC();
if (old_orient != orient){
stealthScreenGrab();
};
}
public function jumpClear():Boolean{
var _local1:int;
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
_local1 = 0;
while (_local1 < 100) {
if (orient == UP){
if ((map_y - _local1) == g.player.map_y){
return (true);
};
if ((map_y - _local1) < 0){
return (false);
};
if (g.stack_map[(map_y - _local1)][map_x] > Game.EMPTY){
return (false);
};
} else {
if (orient == RIGHT){
if ((map_x + _local1) == g.player.map_x){
return (true);
};
if ((map_x + _local1) > (g.scroller.width - 1)){
return (false);
};
if (g.stack_map[map_y][(map_x + _local1)] > Game.EMPTY){
return (false);
};
} else {
if (orient == DOWN){
if ((map_y + _local1) == g.player.map_y){
return (true);
};
if ((map_y + _local1) > (g.scroller.height - 1)){
return (false);
};
if (g.stack_map[(map_y + _local1)][map_x] > Game.EMPTY){
return (false);
};
} else {
if (orient == LEFT){
if ((map_x - _local1) == g.player.map_x){
return (true);
};
if ((map_x - _local1) < 0){
return (false);
};
if (g.stack_map[map_y][(map_x - _local1)] > Game.EMPTY){
return (false);
};
};
};
};
};
_local1++;
};
return (false);
}
override public function resolvePlayerCollision(_arg1:Player):void{
_arg1.hit();
}
public function updateCollisionRect():void{
if (orient == UP){
collision_rect.x = (x - (WIDTH * 0.5));
collision_rect.y = (y - HEIGHT);
collision_rect.width = WIDTH;
collision_rect.height = HEIGHT;
} else {
if (orient == RIGHT){
collision_rect.x = x;
collision_rect.y = (y - (WIDTH * 0.5));
collision_rect.width = HEIGHT;
collision_rect.height = WIDTH;
} else {
if (orient == DOWN){
collision_rect.x = (x - (WIDTH * 0.5));
collision_rect.y = y;
collision_rect.width = WIDTH;
collision_rect.height = HEIGHT;
} else {
if (orient == LEFT){
collision_rect.x = (x - HEIGHT);
collision_rect.y = (y - (WIDTH * 0.5));
collision_rect.width = HEIGHT;
collision_rect.height = WIDTH;
};
};
};
};
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:int;
if (!active){
return;
};
if (((!(_arg2)) && (stealth))){
_arg1.ping((_arg1.px - _arg1.x));
return;
};
if (state == WAIT){
state = RUNNING;
};
health--;
_local3 = new HitSparkMC();
_local3.x = (_arg1.x >> 0);
_local3.y = (_arg1.y >> 0);
_local4 = collision_rect.sideOf(_arg1.x, _arg1.y);
if (_local4 == UP){
} else {
if (_local4 == RIGHT){
_local3.rotation = 90;
} else {
if (_local4 == DOWN){
_local3.rotation = 180;
} else {
if (_local4 == LEFT){
_local3.rotation = 270;
};
};
};
};
g.effect_holder.addChild(_local3);
if ((((health <= 0)) || (_arg2))){
if (!spawned){
g.addScore(reward.value);
} else {
g.addScore((reward.value / 10));
};
kill((_arg1.x - _arg1.px));
NitromeGame.sound_manager.playSound("smithdie");
} else {
NitromeGame.sound_manager.playSound("smithhit");
};
}
}
}//package com.nitrome.engine_specific
Section 50
//NinjaGuard (com.nitrome.engine_specific.NinjaGuard)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.geom.*;
public class NinjaGuard extends Actor {
public var detect_rect:Rect;
public var tracking_count:int;
public var
:int;// = 0
public var dir:int;
public var controlled:Boolean;
public var pause_count:int;// = 0
public var state:int;
public var reveal_count:int;
public var paused:Boolean;
public var target:Encounter;
public var orient:int;
public var stop_dir:int;
public var old_orient:int;
public var flip:int;
public static const DOWN:int = 4;
public static const LEFT:int = 8;
public static const REVEAL:int = 16;
public static const FLYING:int = 4;
public static const TRACKING_DELAY:int = 50;
public static const ELECTRIC:int = 8;
public static const RUNNING:int = 2;
public static const WIDTH:int = 24;
public static const HEIGHT:int = 42;
public static const NURSE_DIST:Number = 75;
public static const STOP_DELAY:int = 8;
public static const SPEED:int = 7;
public static const LEAD_DIST:Number = 600;
public static const REVEAL_DELAY:int = 150;
public static const UP:int = 1;
public static const WAIT:int = 1;
public static const CHASE_DIST:Number = 500;
public static const RIGHT:int = 2;
public static var point:Point = new Point();
public function NinjaGuard(_arg1:int, _arg2:MovieClip, _arg3:Game){
pause_count = 0;
= 0;
super(_arg2, _arg3, true);
this.orient = _arg1;
if (_arg1 == UP){
x = (x + (Game.scale >> 1));
y = (y + (Game.scale - 1));
};
if ((((_arg1 == UP)) || ((_arg1 == DOWN)))){
if (((!((_arg3.player == null))) && (_arg3.player.active))){
dir = ((_arg3.player.x < x)) ? LEFT : RIGHT;
} else {
dir = ((Math.random() >= 0.5)) ? LEFT : RIGHT;
};
} else {
if ((((_arg1 == RIGHT)) || ((_arg1 == LEFT)))){
if (((!((_arg3.player == null))) && (_arg3.player.active))){
dir = ((_arg3.player.y < y)) ? UP : DOWN;
} else {
dir = ((Math.random() >= 0.5)) ? UP : DOWN;
};
};
};
collision_rect = new Rect();
detect_rect = new Rect();
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
state = WAIT;
updateCollisionRect();
updateMC();
tracking_count = TRACKING_DELAY;
controlled = !((_arg3.actor_map[map_y][map_x] == 0));
reveal_count = 0;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
override public function intersects(_arg1:Rect):Boolean{
var _local2:int;
var _local3:int;
if (state == FLYING){
return (collision_rect.intersects(_arg1));
};
if (detect_rect.intersects(_arg1)){
_local2 = ((_arg1.x + (_arg1.width * 0.5)) * Game.SCALE);
_local3 = ((_arg1.y + (_arg1.height * 0.5)) * Game.SCALE);
return (jumpClear(_local2, _local3));
};
return (false);
}
public function updateAnimState(_arg1:MovieClip):void{
if (state == RUNNING){
if (orient == UP){
if (dir == RIGHT){
if ((_arg1 as MovieClip).currentLabel != "run_right"){
(_arg1 as MovieClip).gotoAndStop("run_right");
};
} else {
if (dir == LEFT){
if ((_arg1 as MovieClip).currentLabel != "run_left"){
(_arg1 as MovieClip).gotoAndStop("run_left");
};
};
};
} else {
if (orient == RIGHT){
if (dir == DOWN){
if ((_arg1 as MovieClip).currentLabel != "run_right"){
(_arg1 as MovieClip).gotoAndStop("run_right");
};
} else {
if (dir == UP){
if ((_arg1 as MovieClip).currentLabel != "run_left"){
(_arg1 as MovieClip).gotoAndStop("run_left");
};
};
};
} else {
if (orient == DOWN){
if (dir == RIGHT){
if ((_arg1 as MovieClip).currentLabel != "run_left"){
(_arg1 as MovieClip).gotoAndStop("run_left");
};
} else {
if (dir == LEFT){
if ((_arg1 as MovieClip).currentLabel != "run_right"){
(_arg1 as MovieClip).gotoAndStop("run_right");
};
};
};
} else {
if (orient == LEFT){
if (dir == DOWN){
if ((_arg1 as MovieClip).currentLabel != "run_left"){
(_arg1 as MovieClip).gotoAndStop("run_left");
};
} else {
if (dir == UP){
if ((_arg1 as MovieClip).currentLabel != "run_right"){
(_arg1 as MovieClip).gotoAndStop("run_right");
};
};
};
};
};
};
};
} else {
if (state == WAIT){
if (orient == UP){
if (dir == RIGHT){
if ((_arg1 as MovieClip).currentLabel != "wait_right"){
(_arg1 as MovieClip).gotoAndStop("wait_right");
};
} else {
if (dir == LEFT){
if ((_arg1 as MovieClip).currentLabel != "wait_left"){
(_arg1 as MovieClip).gotoAndStop("wait_left");
};
};
};
} else {
if (orient == RIGHT){
if (dir == DOWN){
if ((_arg1 as MovieClip).currentLabel != "wait_right"){
(_arg1 as MovieClip).gotoAndStop("wait_right");
};
} else {
if (dir == UP){
if ((_arg1 as MovieClip).currentLabel != "wait_left"){
(_arg1 as MovieClip).gotoAndStop("wait_left");
};
};
};
} else {
if (orient == DOWN){
if (dir == RIGHT){
if ((_arg1 as MovieClip).currentLabel != "wait_left"){
(_arg1 as MovieClip).gotoAndStop("wait_left");
};
} else {
if (dir == LEFT){
if ((_arg1 as MovieClip).currentLabel != "wait_right"){
(_arg1 as MovieClip).gotoAndStop("wait_right");
};
};
};
} else {
if (orient == LEFT){
if (dir == DOWN){
if ((_arg1 as MovieClip).currentLabel != "wait_left"){
(_arg1 as MovieClip).gotoAndStop("wait_left");
};
} else {
if (dir == UP){
if ((_arg1 as MovieClip).currentLabel != "wait_right"){
(_arg1 as MovieClip).gotoAndStop("wait_right");
};
};
};
};
};
};
};
} else {
if (state == FLYING){
if ((_arg1 as MovieClip).currentLabel != "fly"){
(_arg1 as MovieClip).gotoAndStop("fly");
};
} else {
if (state == ELECTRIC){
if ((_arg1 as MovieClip).currentLabel != "electric"){
(_arg1 as MovieClip).gotoAndStop("electric");
};
} else {
if (state == REVEAL){
if ((_arg1 as MovieClip).currentLabel != "reveal"){
(_arg1 as MovieClip).gotoAndStop("reveal");
};
};
};
};
};
};
}
public function main():void{
old_orient = orient;
if ((((state == RUNNING)) || ((state == WAIT)))){
selectPatrolPath();
if (dir == orient){
dir = stop_dir;
fly();
} else {
if ((((((((((dir == DOWN)) && ((orient == UP)))) || ((((dir == LEFT)) && ((orient == RIGHT)))))) || ((((dir == UP)) && ((orient == DOWN)))))) || ((((dir == RIGHT)) && ((orient == LEFT)))))){
dir = stop_dir;
};
};
if (((((((Path.free) && ((--
<= 0)))) && (Util.proximity(x, y, g.player.x, g.player.y, NURSE_DIST)))) || (((!(Path.free)) && (!(Util.proximity(x, y, g.player.x, g.player.y, LEAD_DIST))))))){
state = WAIT;
if (electrocuted){
state = ELECTRIC;
} else {
if (reveal_count){
state = REVEAL;
};
};
} else {
if (state == WAIT){
tracking_count = 0;
= STOP_DELAY;
state = RUNNING;
if (electrocuted){
state = ELECTRIC;
} else {
if (reveal_count){
state = REVEAL;
};
};
};
};
if (((((Path.free) && ((state == RUNNING)))) && ((--tracking_count <= 0)))){
if ((((orient == UP)) || ((orient == DOWN)))){
if (((((g.player.active) && (!((g.player.state == Player.STEALTH))))) && ((g.player.x < (x - SPEED))))){
dir = LEFT;
} else {
if (((((g.player.active) && (!((g.player.state == Player.STEALTH))))) && ((g.player.x > (x + SPEED))))){
dir = RIGHT;
};
};
map_y = (y * Game.SCALE);
if ((((((orient == UP)) && ((g.player.map_y < map_y)))) || ((((orient == DOWN)) && ((g.player.map_y > map_y)))))){
fly();
};
} else {
if ((((orient == RIGHT)) || ((orient == LEFT)))){
if (((((g.player.active) && (!((g.player.state == Player.STEALTH))))) && ((g.player.y < (y - SPEED))))){
dir = UP;
} else {
if (((((g.player.active) && (!((g.player.state == Player.STEALTH))))) && ((g.player.y > (y + SPEED))))){
dir = DOWN;
};
};
map_x = (x * Game.SCALE);
if ((((((orient == LEFT)) && ((g.player.map_x < map_x)))) || ((((orient == RIGHT)) && ((g.player.map_x > map_x)))))){
fly();
};
};
};
tracking_count = TRACKING_DELAY;
};
if (state == RUNNING){
if (dir == UP){
y = (y - SPEED);
map_x = (x * Game.SCALE);
map_y = ((y - (WIDTH >> 1)) * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains(x, (y - HEIGHT))))){
y = (g.block_map[map_y][map_x].b.y + g.block_map[map_y][map_x].b.height);
if (orient == RIGHT){
x = (x + (WIDTH >> 1));
} else {
if (orient == LEFT){
x = (x - (WIDTH >> 1));
};
};
fly(g.block_map[map_y][map_x]);
};
} else {
state = RUNNING;
y = ((map_y + 1) * Game.scale);
if (orient == RIGHT){
x = (x + (WIDTH >> 1));
} else {
if (orient == LEFT){
x = (x - (WIDTH >> 1));
};
};
};
dir = orient;
orient = DOWN;
} else {
if (map_y == 0){
dir = DOWN;
};
};
if (state != FLYING){
map_y = (y * Game.SCALE);
if (orient == LEFT){
if (g.stack_map[map_y][(map_x + 1)] == Game.EMPTY){
orient = dir;
x = ((map_x + 1) * Game.scale);
y = (((map_y + 1) * Game.scale) - 1);
dir = RIGHT;
};
} else {
if (orient == RIGHT){
if (g.stack_map[map_y][(map_x - 1)] == Game.EMPTY){
orient = dir;
x = ((map_x * Game.scale) - 1);
y = (((map_y + 1) * Game.scale) - 1);
dir = LEFT;
};
};
};
};
} else {
if (dir == RIGHT){
x = (x + SPEED);
map_x = ((x + (WIDTH >> 1)) * Game.SCALE);
map_y = (y * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains((x + HEIGHT), y)))){
x = (g.block_map[map_y][map_x].b.x - 1);
if (orient == DOWN){
y = (y + (WIDTH >> 1));
} else {
if (orient == UP){
y = (y - (WIDTH >> 1));
};
};
fly(g.block_map[map_y][map_x]);
};
} else {
state = RUNNING;
x = ((map_x * Game.scale) - 1);
if (orient == DOWN){
y = (y + (WIDTH >> 1));
} else {
if (orient == UP){
y = (y - (WIDTH >> 1));
};
};
};
dir = orient;
orient = LEFT;
} else {
if (map_x == (g.scroller.width - 1)){
dir = LEFT;
};
};
if (state != FLYING){
map_x = (x * Game.SCALE);
if (orient == UP){
if (g.stack_map[(map_y + 1)][map_x] == Game.EMPTY){
orient = dir;
x = (map_x * Game.scale);
y = ((map_y + 1) * Game.scale);
dir = DOWN;
};
} else {
if (orient == DOWN){
if (g.stack_map[(map_y - 1)][map_x] == Game.EMPTY){
orient = dir;
x = (map_x * Game.scale);
y = ((map_y * Game.scale) - 1);
dir = UP;
};
};
};
};
} else {
if (dir == DOWN){
y = (y + SPEED);
map_x = (x * Game.SCALE);
map_y = ((y + (WIDTH >> 1)) * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains(x, (y + HEIGHT))))){
y = (g.block_map[map_y][map_x].b.y - 1);
if (orient == RIGHT){
x = (x + (WIDTH >> 1));
} else {
if (orient == LEFT){
x = (x - (WIDTH >> 1));
};
};
fly(g.block_map[map_y][map_x]);
};
} else {
state = RUNNING;
y = ((map_y * Game.scale) - 1);
if (orient == RIGHT){
x = (x + (WIDTH >> 1));
} else {
if (orient == LEFT){
x = (x - (WIDTH >> 1));
};
};
};
dir = orient;
orient = UP;
} else {
if (map_y == (g.scroller.height - 1)){
dir = UP;
};
};
if (state != FLYING){
map_y = (y * Game.SCALE);
if (orient == LEFT){
if (g.stack_map[map_y][(map_x + 1)] == Game.EMPTY){
orient = dir;
x = ((map_x + 1) * Game.scale);
y = (map_y * Game.scale);
dir = RIGHT;
};
} else {
if (orient == RIGHT){
if (g.stack_map[map_y][(map_x - 1)] == Game.EMPTY){
orient = dir;
x = ((map_x * Game.scale) - 1);
y = (map_y * Game.scale);
dir = LEFT;
};
};
};
};
} else {
if (dir == LEFT){
x = (x - SPEED);
map_x = ((x - (WIDTH >> 1)) * Game.SCALE);
map_y = (y * Game.SCALE);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains((x - HEIGHT), y)))){
x = (g.block_map[map_y][map_x].b.x + g.block_map[map_y][map_x].b.width);
if (orient == DOWN){
y = (y + (WIDTH >> 1));
} else {
if (orient == UP){
y = (y - (WIDTH >> 1));
};
};
fly(g.block_map[map_y][map_x]);
};
} else {
state = RUNNING;
x = ((map_x + 1) * Game.scale);
if (orient == DOWN){
y = (y + (WIDTH >> 1));
} else {
if (orient == UP){
y = (y - (WIDTH >> 1));
};
};
};
dir = orient;
orient = RIGHT;
} else {
if (map_x == (g.scroller.width - 1)){
dir = LEFT;
};
};
if (state != FLYING){
map_x = (x * Game.SCALE);
if (orient == UP){
if (g.stack_map[(map_y + 1)][map_x] == Game.EMPTY){
orient = dir;
x = (((map_x + 1) * Game.scale) - 1);
y = ((map_y + 1) * Game.scale);
dir = DOWN;
};
} else {
if (orient == DOWN){
if (g.stack_map[(map_y - 1)][map_x] == Game.EMPTY){
orient = dir;
x = (((map_x + 1) * Game.scale) - 1);
y = ((map_y * Game.scale) - 1);
dir = UP;
};
};
};
};
};
};
};
};
};
} else {
if (state == FLYING){
if (orient == UP){
y = (y - (SPEED * 2));
map_x = (x * Game.SCALE);
map_y = ((y - HEIGHT) * Game.SCALE);
if (map_y == 0){
orient = DOWN;
return;
};
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains(x, (y - HEIGHT))))){
state = FLYING;
y = (g.block_map[map_y][map_x].b.y + g.block_map[map_y][map_x].b.height);
};
} else {
state = RUNNING;
y = ((map_y + 1) * Game.scale);
};
orient = DOWN;
};
} else {
if (orient == RIGHT){
x = (x + (SPEED * 2));
map_x = ((x + HEIGHT) * Game.SCALE);
map_y = (y * Game.SCALE);
if (map_x == (g.scroller.width - 1)){
orient = LEFT;
return;
};
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains((x + HEIGHT), y)))){
state = FLYING;
x = (g.block_map[map_y][map_x].b.x - 1);
};
} else {
state = RUNNING;
x = ((map_x * Game.scale) - 1);
};
orient = LEFT;
};
} else {
if (orient == DOWN){
y = (y + (SPEED * 2));
map_x = (x * Game.SCALE);
map_y = ((y + HEIGHT) * Game.SCALE);
if (map_y == (g.scroller.height - 1)){
orient = UP;
return;
};
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains(x, (y + HEIGHT))))){
state = FLYING;
y = (g.block_map[map_y][map_x].b.y - 1);
};
} else {
state = RUNNING;
y = ((map_y * Game.scale) - 1);
};
orient = UP;
};
} else {
if (orient == LEFT){
x = (x - (SPEED * 2));
map_x = ((x - HEIGHT) * Game.SCALE);
map_y = (y * Game.SCALE);
if (map_y == 0){
orient = RIGHT;
return;
};
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (((!((g.block_map[map_y][map_x] == null))) && (g.block_map[map_y][map_x].b.contains((x - HEIGHT), y)))){
state = FLYING;
x = (g.block_map[map_y][map_x].b.x + g.block_map[map_y][map_x].b.width);
};
} else {
state = RUNNING;
x = ((map_x + 1) * Game.scale);
};
orient = RIGHT;
};
};
};
};
};
} else {
if (state == REVEAL){
reveal_count--;
if (reveal_count == 0){
state = WAIT;
};
};
};
};
updateCollisionRect();
updateAnimState((mc as MovieClip));
updateMC();
}
public function selectPatrolPath():void{
if (pause_count == -1){
return;
};
if ((((dir == Path.STOPPED)) && ((pause_count > 0)))){
pause_count--;
return;
};
if (dir != Path.STOPPED){
stop_dir = dir;
};
Path.getDir(dir, g.actor_map, null, map_x, map_y);
dir = Path.dir;
pause_count = (paused) ? 0 : Path.pause_delay;
if (pause_count > 0){
dir = Path.STOPPED;
paused = true;
return;
};
paused = false;
}
public function jumpClear(_arg1:int, _arg2:int):Boolean{
var _local3:int;
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
_local3 = 0;
while (_local3 < 100) {
if (orient == UP){
if ((map_y - _local3) == _arg2){
return (true);
};
if ((map_y - _local3) < 0){
return (false);
};
if (g.stack_map[(map_y - _local3)][map_x] > Game.EMPTY){
return (false);
};
} else {
if (orient == RIGHT){
if ((map_x + _local3) == _arg1){
return (true);
};
if ((map_x + _local3) > (g.scroller.width - 1)){
return (false);
};
if (g.stack_map[map_y][(map_x + _local3)] > Game.EMPTY){
return (false);
};
} else {
if (orient == DOWN){
if ((map_y + _local3) == _arg2){
return (true);
};
if ((map_y + _local3) > (g.scroller.height - 1)){
return (false);
};
if (g.stack_map[(map_y + _local3)][map_x] > Game.EMPTY){
return (false);
};
} else {
if (orient == LEFT){
if ((map_x - _local3) == _arg1){
return (true);
};
if ((map_x - _local3) < 0){
return (false);
};
if (g.stack_map[map_y][(map_x - _local3)] > Game.EMPTY){
return (false);
};
};
};
};
};
_local3++;
};
return (false);
}
override public function resolveBulletCollision(_arg1):void{
var _local2:Boolean;
_local2 = !((_arg1 is Bullet));
_arg1 = (_local2) ? _arg1.list[_arg1.hit] : _arg1;
if (_local2){
g.addDebris(_arg1.x, _arg1.y, (_arg1.px - _arg1.x), _arg1.bitmap, _arg1.bitmap, _arg1.bitmap, _arg1.bitmap);
} else {
g.addDebris(_arg1.x, _arg1.y, (_arg1.px - _arg1.x), _arg1.bitmap);
};
_arg1.active = false;
}
override public function resolveEncounterCollision(_arg1):void{
if (state == FLYING){
if (target == _arg1){
return;
};
_arg1.resolveWeaponCollision(new Star(x, y, 0, 0, null, g), true);
target = _arg1;
} else {
target = null;
fly();
};
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
if (orient == UP){
mc.rotation = 0;
} else {
if (orient == RIGHT){
mc.rotation = 90;
} else {
if (orient == DOWN){
mc.rotation = 180;
} else {
if (orient == LEFT){
mc.rotation = 270;
};
};
};
};
}
public function updateCollisionRect():void{
if (orient == UP){
collision_rect.x = (x - (WIDTH * 0.5));
collision_rect.y = (y - HEIGHT);
collision_rect.width = WIDTH;
collision_rect.height = HEIGHT;
detect_rect.x = collision_rect.x;
detect_rect.y = 0;
detect_rect.width = collision_rect.width;
detect_rect.height = (collision_rect.y + collision_rect.height);
} else {
if (orient == RIGHT){
collision_rect.x = x;
collision_rect.y = (y - (WIDTH * 0.5));
collision_rect.width = HEIGHT;
collision_rect.height = WIDTH;
detect_rect.x = collision_rect.x;
detect_rect.y = collision_rect.y;
detect_rect.width = ((g.scroller.width * Game.scale) - collision_rect.x);
detect_rect.height = collision_rect.height;
} else {
if (orient == DOWN){
collision_rect.x = (x - (WIDTH * 0.5));
collision_rect.y = y;
collision_rect.width = WIDTH;
collision_rect.height = HEIGHT;
detect_rect.x = collision_rect.x;
detect_rect.y = collision_rect.y;
detect_rect.width = collision_rect.width;
detect_rect.height = ((g.scroller.height * Game.scale) - collision_rect.y);
} else {
if (orient == LEFT){
collision_rect.x = (x - HEIGHT);
collision_rect.y = (y - (WIDTH * 0.5));
collision_rect.width = HEIGHT;
collision_rect.height = WIDTH;
detect_rect.x = 0;
detect_rect.y = collision_rect.y;
detect_rect.width = (collision_rect.x + collision_rect.width);
detect_rect.height = collision_rect.height;
};
};
};
};
}
public function fly(_arg1=null):void{
var _local2:MovieClip;
if (state == FLYING){
return;
};
state = FLYING;
_local2 = new JumpMC();
NitromeGame.sound_manager.playSound("missile");
if (((!((_arg1 == null))) && (_arg1.b.moving_block))){
_local2.x = (x - _arg1.b.x);
_local2.y = (y - _arg1.b.y);
updateMC();
_local2.rotation = mc.rotation;
_arg1.mc.addChild(_local2);
} else {
_local2.x = mc.x;
_local2.y = mc.y;
_local2.rotation = mc.rotation;
g.effect_holder.addChild(_local2);
};
}
}
}//package com.nitrome.engine_specific
Section 51
//Node (com.nitrome.engine_specific.Node)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class Node extends Dot {
var walkable:Boolean;// = true
var h:int;// = 0
var s:int;// = 0
public function Node(_arg1:int=0, _arg2:int=0){
h = 0;
s = 0;
walkable = true;
super();
}
function setH(_arg1:int, _arg2:int):void{
var _local3:*;
var _local4:*;
_local3 = (this.x - _arg1);
_local4 = (this.y - _arg2);
h = (((_local3 < 0)) ? -(_local3) : _local3 + ((_local4 < 0)) ? -(_local4) : _local4);
}
}
}//package com.nitrome.engine_specific
Section 52
//Path (com.nitrome.engine_specific.Path)
package com.nitrome.engine_specific {
public class Path {
public static const STOP:int = 8;
public static const RIGHT:int = 2;
public static const LEFT:int = 8;
public static const DOWN:int = 4;
public static const GO_UP:int = 9;
public static const PAUSE_UNIT:int = 25;
public static const GO_DOWN:int = 11;
public static const UP:int = 1;
public static const HORIZ:int = 7;
public static const GO_RIGHT:int = 10;
public static const STOPPED:int = 0;
public static const VERT:int = 6;
public static const FREE:int = 5;
public static const GO_LEFT:int = 12;
public static var width:int = -1;
public static var :int;
public static var dir:int;
public static var height:int = -1;
public static var free:Boolean;
public static var pause_delay:int;
public static function getDir(_arg1:int, _arg2:Array, _arg3:Array, _arg4:int, _arg5:int):void{
if (width < 0){
height = _arg2.length;
width = _arg2[0].length;
};
= _arg2[_arg5][_arg4];
pause_delay = 0;
if ( == STOP){
pause_delay = -1;
dir = STOPPED;
return;
};
if (!(((_arg2[_arg5][_arg4] >= 0)) || ((_arg2[_arg5][_arg4] <= 0)))){
pause_delay = (_arg2[_arg5][_arg4].match(/(?<=I\()\d+/)[0] * PAUSE_UNIT);
= _arg2[_arg5][_arg4].match(/\d+/)[0];
};
free = ( == 0);
if ( == 0){
dir = _arg1;
if ((((dir == UP)) && ((_arg5 == 0)))){
dir = DOWN;
} else {
if ((((dir == RIGHT)) && ((_arg4 == (width - 1))))){
dir = LEFT;
} else {
if ((((dir == DOWN)) && ((_arg5 == (height - 1))))){
dir = UP;
} else {
if ((((dir == LEFT)) && ((_arg4 == 0)))){
dir = RIGHT;
};
};
};
};
} else {
if ( == FREE){
dir = _arg1;
if (dir == UP){
if ((((_arg5 == 0)) || ((_arg2[(_arg5 - 1)][_arg4] == 0)))){
dir = DOWN;
};
} else {
if (dir == RIGHT){
if ((((_arg4 == (width - 1))) || ((_arg2[_arg5][(_arg4 + 1)] == 0)))){
dir = LEFT;
};
} else {
if (dir == DOWN){
if ((((_arg5 == (height - 1))) || ((_arg2[(_arg5 + 1)][_arg4] == 0)))){
dir = UP;
};
} else {
if (dir == LEFT){
if ((((_arg4 == 0)) || ((_arg2[_arg5][(_arg4 - 1)] == 0)))){
dir = RIGHT;
};
};
};
};
};
} else {
if ( == GO_UP){
dir = UP;
} else {
if ( == GO_RIGHT){
dir = RIGHT;
} else {
if ( == GO_DOWN){
dir = DOWN;
} else {
if ( == GO_LEFT){
dir = LEFT;
} else {
if ( == HORIZ){
if ((((_arg1 == RIGHT)) || ((_arg1 == LEFT)))){
dir = _arg1;
if (dir == RIGHT){
if ((((_arg4 == (width - 1))) || ((_arg2[_arg5][(_arg4 + 1)] == 0)))){
dir = LEFT;
};
} else {
if (dir == LEFT){
if ((((_arg4 == 0)) || ((_arg2[_arg5][(_arg4 - 1)] == 0)))){
dir = RIGHT;
};
};
};
} else {
if (dir == UP){
if ((((_arg4 == 0)) || ((_arg2[_arg5][(_arg4 - 1)] == 0)))){
dir = RIGHT;
} else {
if ((((_arg4 == (width - 1))) || ((_arg2[_arg5][(_arg4 + 1)] == 0)))){
dir = LEFT;
} else {
dir = ((Math.random() >= 0.5)) ? RIGHT : LEFT;
};
};
} else {
if (dir == DOWN){
if ((((_arg4 == 0)) || ((_arg2[_arg5][(_arg4 - 1)] == 0)))){
dir = RIGHT;
} else {
if ((((_arg4 == (width - 1))) || ((_arg2[_arg5][(_arg4 + 1)] == 0)))){
dir = LEFT;
} else {
dir = ((Math.random() >= 0.5)) ? RIGHT : LEFT;
};
};
};
};
};
} else {
if ( == VERT){
if ((((_arg1 == UP)) || ((_arg1 == DOWN)))){
dir = _arg1;
if (dir == DOWN){
if ((((_arg5 == (height - 1))) || ((_arg2[(_arg5 + 1)][_arg4] == 0)))){
dir = DOWN;
};
} else {
if (dir == UP){
if ((((_arg5 == 0)) || ((_arg2[(_arg5 - 1)][_arg4] == 0)))){
dir = DOWN;
};
};
};
} else {
if (dir == RIGHT){
if ((((_arg5 == 0)) || ((_arg2[(_arg5 - 1)][_arg4] == 0)))){
dir = DOWN;
} else {
if ((((_arg5 == (height - 1))) || ((_arg2[(_arg5 + 1)][_arg4] == 0)))){
dir = UP;
} else {
dir = ((Math.random() >= 0.5)) ? DOWN : UP;
};
};
} else {
if (dir == LEFT){
if ((((_arg5 == 0)) || ((_arg2[(_arg5 - 1)][_arg4] == 0)))){
dir = DOWN;
} else {
if ((((_arg5 == (height - 1))) || ((_arg2[(_arg5 + 1)][_arg4] == 0)))){
dir = UP;
} else {
dir = ((Math.random() >= 0.5)) ? DOWN : UP;
};
};
};
};
};
};
};
};
};
};
};
};
};
if (_arg3 == null){
return;
};
if ((((dir == UP)) && ((_arg3[(_arg5 - 1)][_arg4] > Game.EMPTY)))){
dir = DOWN;
} else {
if ((((dir == RIGHT)) && ((_arg3[_arg5][(_arg4 + 1)] > Game.EMPTY)))){
dir = LEFT;
} else {
if ((((dir == DOWN)) && ((_arg3[(_arg5 + 1)][_arg4] > Game.EMPTY)))){
dir = UP;
} else {
if ((((dir == LEFT)) && ((_arg3[_arg5][(_arg4 - 1)] > Game.EMPTY)))){
dir = RIGHT;
};
};
};
};
}
}
}//package com.nitrome.engine_specific
Section 53
//Player (com.nitrome.engine_specific.Player)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.geom.*;
import com.nitrome.game.*;
import flash.ui.*;
public class Player extends Particle {
public var :Sprite;
public var :Sprite;
public var :Number;
public var rope_end:Rope;
public var :Boolean;
public var stealth_clip:StealthClip;
public var
:Number;
public var :Boolean;
public var scroll_rect:Rect;
public var :int;
public var :Rect;
public var :MovieClip;
public var :int;
public var :Number;
public var :RayCastReport;
public var chameleon:Boolean;
public var map_x:int;
public var map_y:int;
public var health:HiddenInt;
public var
:Number;
public var stars:Array;
public var g:Game;
private var i:int;
public var platform:Block;
public var :Block;
public var cy:Number;
public var :Number;
public var scroll_target_x:Number;
public var scroll_target_y:Number;
public var :MovieClip;
public var :MovieClip;
public var :int;
public var :Boolean;
public var :Boolean;// = false
private var block:Block;
public var state:int;
public var dx:Number;
public var dy:Number;
public var cx:Number;
public var :Rope;
public var :int;
public var
:Boolean;
public var :int;
public var dir:int;
public var :Boolean;
public var on_scroller:Boolean;
public var
:Boolean;
public var :Boolean;
public var anchor:RopeAnchor;
public var :Number;
public var vy:Number;
public var :int;
public var vx:Number;
public var :Boolean;
public var collision_rect:Rect;
public var :int;
public var :int;
public var :Number;
public var :Sprite;
public var keys_pressed:int;
public var :int;
public var
:int;
public var map_rect:Rect;
public var :int;
public var rope:Array;
public var
:Number;
public var :Boolean;
public var :int;
public var :int;
public var active:Boolean;
public var :Number;
public var key_lock:Boolean;
public var :Array;
public var :Boolean;
public var :MovieClip;
public var :Shape;
public var :int;
public var
:Shape;
public var finish_item:Encounter;
public var
:Shape;
public var :Shape;
public var :Number;
public var level_completed:Boolean;
public var
:int;
public var
:MovieClip;
public var
:int;
public var
:Boolean;
public var
:Trail;
public var
:int;
public var
:MovieClip;
public var scroll_x:Number;
public var scroll_y:Number;
public var point:Point;
public var mc:MovieClip;
public var
:Trail;
public var
:Number;
public var stealth_mask:MovieClip;
public var :MovieClip;
public var grid_x:int;
public var grid_y:int;
public var :Number;
public var chameleon_pickup:Boolean;
public var :Number;
public var
:Sprite;
public var running:Boolean;
public var :Boolean;
public var
:MovieClip;
private var :Dot;
private static const WALLSLIDE_DAMPING_Y:Number = 0.85;
public static const LEFT:int = 8;
public static const DAMPING_STEP:Number = 0.001;
private static const JUMP_DELAY:Number = 5.8;
private static const SWING_DAMPING_X:Number = 0.99;
public static const DOWN_RIGHT:int = 32;
public static const SWINGING:int = 8;
public static const HEIGHT:int = 42;
public static const NUM_STARS:int = 20;
public static const SCALE:Number = 0.015625;
public static const SPEED:Number = 7.5;
public static const EXTEND_ROPE_OFF_DELAY:int = 10;
public static const HURT_DELAY:int = 50;
public static const FALL_RIGHT:int = 64;
public static const WALLSLIDE_DELAY:int = 25;
private static const DAMPING_X:Number = 0.55;
private static const DAMPING_Y:Number = 0.99;
private static const MIN_KICK = 1.5;
public static const OUCH_DEATH_DELAY:int = 20;
private static const LOST:int = 4;
public static const WALL_RIGHT:int = 0x0100;
private static const JUMP_DECAY:Number = 0.7;
public static const scale:int = 64;
public static const UP_LEFT:int = 128;
public static const ROPE_ALPHA_FADE:Number = 0.1;
public static const FALL_LEFT:int = 128;
public static const MAX_ROPE_LENGTH:int = 800;
public static const RUNNING_RIGHT:int = 2;
public static const UP_RIGHT:int = 16;
public static const JUMP_FRAME_DELAY = 3;
private static const MAX_KICK = 4;
public static const WALL_LEFT:int = 0x0200;
public static const DEAD:int = 16;
public static const SWING_FLOOR_DELAY = 5;
public static const MAX_ROPE_SPEED:Number = 10;
public static const JUMP_LEFT:int = 32;
private static const READY:int = 1;
public static const DOWN_LEFT:int = 64;
private static const GRAVITY_X:Number = 0;
private static const GRAVITY_Y:Number = 1.3;
private static const FLOOR_DEPTH:int = 6;
public static const WAIT_LEFT:int = 8;
private static const FORCED_WALLSLIDE_DAMPING_Y:Number = 0.6;
public static const RUNNING:int = 1;
public static const DOWN:int = 4;
public static const WIDTH:int = 24;
public static const READY_DELAY:int = 2;
public static const THROW_DELAY:int = 2;
public static const JUMP_RIGHT:int = 16;
public static const RUNNING_LEFT:int = 1;
public static const WAIT_RIGHT:int = 4;
public static const UP:int = 1;
private static const THROW:int = 2;
public static const MIN_ROPE_SPEED:Number = 3;
public static const JUMPING:int = 2;
public static const STEALTH:int = 4;
public static const STEALTH_ANIM:int = 0x0400;
public static const OUCH_DELAY:int = 10;
public static const RIGHT:int = 2;
public function Player(_arg1:MovieClip, _arg2:MovieClip, _arg3:int, _arg4:int, _arg5:Game){
= false;
super(_arg3, _arg4);
state = STEALTH;
dir = RIGHT;
= false;
= false;
= false;
= 0;
= false;
= 0;
= false;
= false;
= 0;
= 0;
= 0;
= MIN_ROPE_SPEED;
= 0;
= 0;
= 0;
= 0;
= 0;
running = false;
active = true;
= false;
chameleon = false;
chameleon_pickup = false;
key_lock = false;
this.g = _arg5;
this.mc = _arg1;
this.stealth_mask = _arg2;
_arg1.x = ( = (_arg3 >> 0));
_arg1.y = ( = ((_arg4 >> 0) + (HEIGHT >> 1)));
map_x = ((_arg3 * SCALE) >> 0);
map_y = ((_arg4 * SCALE) >> 0);
grid_x = (_arg3 * SCALE);
grid_y = (_arg4 * SCALE);
= MIN_KICK;
platform = ((_arg5.block_map[(map_y + 1)][map_x] is Clip)) ? _arg5.block_map[(map_y + 1)][map_x].b : null;
if (platform == null){
state = JUMPING;
};
health = new HiddenInt(3);
NitromeGame.timeline.health_panel.gotoAndStop("_3");
collision_rect = new Rect(0, 0, 0, 0);
updateCollisionRect();
= new Array(4);
map_rect = _arg5.scroller.map_rect;
scroll_rect = new Rect(NitromeGame.timeline.scroll_border.x, NitromeGame.timeline.scroll_border.y, NitromeGame.timeline.scroll_border.width, NitromeGame.timeline.scroll_border.height);
NitromeGame.timeline.scroll_border.visible = false;
scroll_x = 0;
scroll_y = scroll_rect.height;
scroll_target_x = ((-(_arg1.x) + scroll_rect.x) + scroll_x);
scroll_target_y = ((-(_arg1.y) + scroll_rect.y) + scroll_y);
scroll_target_x = Math.min(0, scroll_target_x);
scroll_target_y = Math.min(0, scroll_target_y);
scroll_target_x = Math.max(((-(_arg5.scroller.width) * scale) + Game.WIDTH), scroll_target_x);
scroll_target_y = Math.max(((-(_arg5.scroller.height) * scale) + Game.HEIGHT), scroll_target_y);
_arg5.canvas.x = ((0.1 + scroll_target_x) >> 0);
_arg5.canvas.y = ((0.1 + scroll_target_y) >> 0);
= _arg5.canvas.x;
= _arg5.canvas.y;
scrolling();
_arg5.scroller.reset();
= DAMPING_X;
rope = [];
stars = [];
= new Dot();
= new LeftArmMC();
= new RightArmMC();
= new LeftArmMC();
= new RightArmMC();
_arg5.player_holder.addChild();
_arg5.player_holder.addChild();
_arg2.addChild(
);
_arg2.addChild();
stealth_clip = new StealthClip(_arg2, 80, 80);
_arg5.player_holder.addChild(stealth_clip);
stealth_clip.bitmap.x = (-(stealth_clip.bitmap.width) * 0.5);
stealth_clip.bitmap.y = -(stealth_clip.bitmap.height);
= false;
= new StealthOutlineMC();
.blendMode = BlendMode.OVERLAY;
_arg5.player_holder.addChild();
.alpha = 0;
= new EyeGlowMC();
.alpha = 0;
_arg5.player_holder.addChild();
= new ChameleonMC();
_arg5.player_holder.addChild(
);
= new Shape();
= new ChameleonMC();
.cacheAsBitmap = true;
.cacheAsBitmap = true;
.mask = ;
= new Shape();
_arg5.player_holder.addChild( );
.mask = ;
= new Rect(-30, -60, 60, 0);
_arg5.player_holder.addChild(
);
_arg5.player_holder.addChild();
= new WallSlideLeftMC();
= new WallSlideRightMC();
.alpha = 0;
.alpha = 0;
_arg5.player_holder.addChild(
);
_arg5.player_holder.addChild( );
= new Sprite();
= new Shape();
= new Shape();
_arg5.player_holder.addChild();
.addChild(
);
.addChild( );
point = new Point();
point = Util.localToLocal(point, _arg1.body.left_eye, _arg5.canvas);
= new Trail(point.x, point.y, 7, 0.6);
point = Util.localToLocal(point, _arg1.body.right_eye, _arg5.canvas);
= new Trail(point.x, point.y, 7, 0.6);
= false;
Key.forceClearKeys();
}
public function ():void{
if ((((() || ((state == STEALTH)))) || (((!((g.spider == null))) && ((state == RUNNING)))))){
.visible = false;
.visible = false;
.visible = false;
.visible = false;
return;
};
if (dir == RIGHT){
.visible = false;
.visible = mc.visible;
.visible = false;
.visible = true;
} else {
if (dir == LEFT){
.visible = false;
.visible = mc.visible;
.visible = false;
.visible = true;
};
};
if (){
if ( == READY){
.rotation = 0;
.gotoAndStop("ready");
.rotation = 0;
.gotoAndStop("ready");
.rotation = 0;
.gotoAndStop("ready");
.rotation = 0;
.gotoAndStop("ready");
} else {
if (((( == THROW)) && (( > 0)))){
if (anchor != null){
if (!anchor.locked){
if (dir == LEFT){
= (Game.ONE80DIVIDEDBYPI * anchor.rope.atan2());
} else {
if (dir == RIGHT){
= (Game.ONE80DIVIDEDBYPI * anchor.rope.atan2());
= ( + 180);
};
};
} else {
if (rope_end != null){
if (dir == LEFT){
= (Game.ONE80DIVIDEDBYPI * rope_end.atan2());
} else {
if (dir == RIGHT){
= (Game.ONE80DIVIDEDBYPI * rope_end.atan2());
= ( + 180);
};
};
};
};
= sideOf( );
.rotation = ;
.rotation = ;
.rotation = ;
.rotation = ;
};
if ( == RIGHT){
.gotoAndStop("right");
.gotoAndStop("right");
.gotoAndStop("right");
.gotoAndStop("right");
} else {
if ( == LEFT){
.gotoAndStop("left");
.gotoAndStop("left");
.gotoAndStop("left");
.gotoAndStop("left");
};
};
} else {
.rotation = 0;
.rotation = 0;
.rotation = 0;
.rotation = 0;
if ((((state == RUNNING)) && (running))){
.gotoAndStop("run_rest");
.gotoAndStop("run_rest");
.gotoAndStop("run_rest");
.gotoAndStop("run_rest");
} else {
if ((((((state == RUNNING)) && (!(running)))) || ((((state == SWINGING)) && ((
& DOWN)))))){
.gotoAndStop("wait_rest");
.gotoAndStop("wait_rest");
.gotoAndStop("wait_rest");
.gotoAndStop("wait_rest");
} else {
if ((((state == JUMPING)) && (!()))){
.gotoAndStop("jump_rest");
.gotoAndStop("jump_rest");
.gotoAndStop("jump_rest");
.gotoAndStop("jump_rest");
} else {
if ((((((((((state == JUMPING)) && ())) && (( == 0)))) && (!((
& DOWN))))) || ((state == SWINGING)))){
.gotoAndStop("fall_rest");
.gotoAndStop("fall_rest");
.gotoAndStop("fall_rest");
.gotoAndStop("fall_rest");
} else {
if ((((((state == JUMPING)) && ())) && ())){
.gotoAndStop("wall_rest");
.gotoAndStop("wall_rest");
.gotoAndStop("wall_rest");
.gotoAndStop("wall_rest");
};
};
};
};
};
};
};
} else {
.rotation = 0;
.rotation = 0;
.rotation = 0;
.rotation = 0;
if ((((state == RUNNING)) && (running))){
.gotoAndStop("run_rest");
.gotoAndStop("run_rest");
.gotoAndStop("run_rest");
.gotoAndStop("run_rest");
} else {
if ((((((state == RUNNING)) && (!(running)))) || ((((state == SWINGING)) && ((
& DOWN)))))){
.gotoAndStop("wait_rest");
.gotoAndStop("wait_rest");
.gotoAndStop("wait_rest");
.gotoAndStop("wait_rest");
} else {
if ((((state == JUMPING)) && (!()))){
.gotoAndStop("jump_rest");
.gotoAndStop("jump_rest");
.gotoAndStop("jump_rest");
.gotoAndStop("jump_rest");
} else {
if ((((((((((state == JUMPING)) && ())) && (( == 0)))) && (!((
& DOWN))))) || ((state == SWINGING)))){
.gotoAndStop("fall_rest");
.gotoAndStop("fall_rest");
.gotoAndStop("fall_rest");
.gotoAndStop("fall_rest");
} else {
if ((((((state == JUMPING)) && ())) && ())){
.gotoAndStop("wall_rest");
.gotoAndStop("wall_rest");
.gotoAndStop("wall_rest");
.gotoAndStop("wall_rest");
};
};
};
};
};
};
if (mc.body != null){
= ArmPos.getPos(, mc.currentLabel, mc.body.currentFrame);
} else {
= ArmPos.getPos(, mc.currentLabel);
};
.x = .x;
.y = .y;
.x = .x;
.y = .y;
.x = (.x + mc.x);
.y = (.y + mc.y);
.x = (.x + mc.x);
.y = (.y + mc.y);
if (state == STEALTH){
.visible = false;
.visible = false;
.visible = false;
.visible = false;
};
}
public function enterChameleonMode():void{
if (((chameleon) || (!(chameleon_pickup)))){
return;
};
chameleon = true;
.height = 0;
.graphics.clear();
.graphics.clear();
.alpha = 1;
g.chameleon();
chameleon_pickup = false;
NitromeGame.sound_manager.playSound("cammo");
}
public function createRope():void{
rope = [];
rope_end = new Rope(anchor, this);
rope.push(rope_end);
if (rope_end.b.y > rope_end.a.y){
if (rope_end.rest_len > HEIGHT){
rope_end.rest_len = (rope_end.rest_len - (HEIGHT * 0.6));
} else {
rope_end.rest_len = (rope_end.rest_len * 0.8);
};
rope_end.stiffness = (rope_end.stiffness * 0.3);
};
= ( = rope_end.rest_len);
state = SWINGING;
= SWING_DAMPING_X;
= true;
platform = null;
}
public function ():void{
var _local1:int;
collision_rect = new Rect();
mc.visible = false;
.visible = false;
.visible = false;
stealth_clip.visible = false;
.visible = false;
.visible = false;
.visible = false;
.graphics.clear();
.graphics.clear();
g.rope_holder.graphics.clear();
g.mouse_pressed = false;
running = false;
g.rope_holder.graphics.clear();
if (anchor != null){
anchor.convertToStar();
};
_local1 = 0;
while (_local1 < stars.length) {
stars[_local1].kill();
_local1++;
};
map_x = (map_y = 0);
}
public function (_arg1:Encounter):Boolean{
return (_arg1.intersects(collision_rect));
}
public function updateAnimState(_arg1:MovieClip):void{
var _local2:Boolean;
_local2 = false;
if (!){
if (((!((g.spider == null))) && ((state == RUNNING)))){
if (_arg1.currentLabel != "spider"){
_arg1.gotoAndStop("spider");
};
} else {
if ((((state == RUNNING)) && (running))){
if (dir == LEFT){
if (_arg1.currentLabel != "run_left"){
_arg1.gotoAndStop("run_left");
};
} else {
if (dir == RIGHT){
if (_arg1.currentLabel != "run_right"){
_arg1.gotoAndStop("run_right");
};
};
};
} else {
if ((((((state == RUNNING)) && (!(running)))) || ((((state == SWINGING)) && ((
> 0)))))){
if (dir == LEFT){
if (((((!((platform == null))) && ((collision_rect.x <= (platform.x + 5))))) && (((!((platform.stacked & LEFT))) || ((((map_x > 0)) && ((g.stack_map[map_y][(map_x - 1)] > -1)))))))){
if (_arg1.currentLabel != "wait_in_left"){
_arg1.gotoAndStop("wait_in_left");
};
} else {
if (_arg1.currentLabel != "wait_left"){
_arg1.gotoAndStop("wait_left");
};
};
} else {
if (dir == RIGHT){
if (((((!((platform == null))) && (((collision_rect.x + collision_rect.width) >= ((platform.x + platform.width) - 5))))) && (((!((platform.stacked & RIGHT))) || ((((map_x < (g.scroller.width - 1))) && ((g.stack_map[map_y][(map_x + 1)] > -1)))))))){
if (_arg1.currentLabel != "wait_in_right"){
_arg1.gotoAndStop("wait_in_right");
};
} else {
if (_arg1.currentLabel != "wait_right"){
_arg1.gotoAndStop("wait_right");
};
};
};
};
} else {
if ((((state == JUMPING)) && (!()))){
if (dir == LEFT){
if (_arg1.currentLabel != "jump_left"){
_arg1.gotoAndStop("jump_left");
};
} else {
if (dir == RIGHT){
if (_arg1.currentLabel != "jump_right"){
_arg1.gotoAndStop("jump_right");
};
};
};
} else {
if ((((((state == JUMPING)) && ())) && (( == 0)))){
if (dir == LEFT){
if (_arg1.currentLabel != "fall_left"){
_arg1.gotoAndStop("fall_left");
};
} else {
if (dir == RIGHT){
if (_arg1.currentLabel != "fall_right"){
_arg1.gotoAndStop("fall_right");
};
};
};
} else {
if (state == SWINGING){
if (dir == LEFT){
if (_arg1.currentLabel != "swing_left"){
_arg1.gotoAndStop("swing_left");
};
} else {
if (dir == RIGHT){
if (_arg1.currentLabel != "swing_right"){
_arg1.gotoAndStop("swing_right");
};
};
};
} else {
if ((((((state == JUMPING)) && ())) && ())){
if (dir == LEFT){
if (
.alpha < 1){
.alpha = (
.alpha + 0.1);
};
if (_arg1.currentLabel != "wall_left"){
_arg1.gotoAndStop("wall_left");
.alpha = 0;
};
} else {
if (dir == RIGHT){
if ( .alpha < 1){
.alpha = ( .alpha + 0.1);
};
if (_arg1.currentLabel != "wall_right"){
_arg1.gotoAndStop("wall_right");
.alpha = 0;
};
};
};
} else {
if (state == STEALTH){
if (_arg1.currentLabel != "stealth"){
_arg1.gotoAndStop("stealth");
};
};
};
};
};
};
};
};
};
} else {
if (dir == LEFT){
if (_arg1.currentLabel != "ouch_left"){
_arg1.gotoAndStop("ouch_left");
};
} else {
if (dir == RIGHT){
if (_arg1.currentLabel != "ouch_right"){
_arg1.gotoAndStop("ouch_right");
};
};
};
};
}
public function ():void{
if (g.event_map[grid_y][grid_x] > -1){
if (g.current_event == null){
g.current_event = g.events[g.event_map[grid_y][grid_x]];
g.current_event.active = true;
} else {
if (g.current_event.id != g.event_map[grid_y][grid_x]){
g.current_event.active = false;
};
};
} else {
if (g.current_event != null){
g.current_event.active = false;
};
};
}
public function debug():void{
g.debug.lineStyle(2, 0xFF00);
collision_rect.draw(g.debug);
i = 0;
while (i < .length) {
if (((((!(((( [i] >= 0)) || (( [i] <= 0))))) && (!(( [i] == null))))) && ( [i].block))){
[i].debug();
};
i++;
};
}
public function updateMC():void{
= mc.x;
= mc.y;
mc.x = ((x + 0.1) >> 0);
mc.y = (((y + 0.1) >> 0) + (HEIGHT >> 1));
stealth_clip.x = mc.x;
stealth_clip.y = mc.y;
.x = mc.x;
.y = mc.y;
.x = mc.x;
.y = mc.y;
.x = mc.x;
.y = mc.y;
.x = mc.x;
.y = mc.y;
if (chameleon){
.graphics.clear();
.graphics.beginFill(0xFFFFFF);
.graphics.drawRect(.x, .y, .width, .height);
.graphics.endFill();
if (.height < (.width + 9)){
.height = (.height + 2);
.graphics.clear();
.graphics.lineStyle(2, 0xFF00);
.graphics.moveTo(.x, (.y + .height));
.graphics.lineTo((.x + .width), (.y + .height));
.graphics.lineStyle(2, 0xFF00, 0.7);
.graphics.moveTo(.x, ((.y + .height) - 2));
.graphics.lineTo((.x + .width), ((.y + .height) - 2));
.graphics.lineStyle(2, 0xFF00, 0.3);
.graphics.moveTo(.x, ((.y + .height) - 4));
.graphics.lineTo((.x + .width), ((.y + .height) - 4));
};
} else {
if (.height > 0){
if (
.alpha > 0){
.alpha = (
.alpha - 0.25);
} else {
.height = 0;
.graphics.clear();
.graphics.clear();
};
};
};
if ((((state == STEALTH)) && (!(chameleon)))){
.x = (.x = mc.x);
.y = (.y = mc.y);
if (stealth_clip.alpha < 1){
stealth_clip.alpha = (stealth_clip.alpha + 0.1);
};
if (.alpha < 1){
.alpha = (.alpha + 0.2);
};
if (.alpha < 1){
.alpha = (.alpha + 0.2);
};
} else {
if (stealth_clip.alpha > 0){
stealth_clip.alpha = (stealth_clip.alpha - 0.02);
};
if (.alpha > 0){
.alpha = (.alpha - 0.2);
};
if (.alpha > 0){
.alpha = 0;
};
if (chameleon){
if (mc.alpha > 0){
mc.alpha = (mc.alpha - 0.05);
.alpha = (.alpha = mc.alpha);
};
} else {
if (mc.alpha != 1){
mc.alpha = 1;
.alpha = (.alpha = mc.alpha);
};
};
};
if (((((((!()) && ((state == JUMPING)))) && ())) && ())){
.x = (mc.x - (WIDTH >> 1));
.x = (mc.x + (WIDTH >> 1));
.y = ( .y = mc.y);
} else {
if (
.alpha > 0){
.alpha = (
.alpha - 0.1);
if (((!(( == null))) && (.moving_block))){
.x = ((.x + .width) - 1);
};
};
if ( .alpha > 0){
.alpha = ( .alpha - 0.1);
if (((!(( == null))) && (.moving_block))){
.x = .x;
};
};
};
();
if ((((state == RUNNING)) && (running))){
if (dir == RIGHT){
if (
.alpha > 0){
.alpha = (
.alpha - 0.1);
} else {
if ( .alpha < 1){
.alpha = ( .alpha + 0.2);
};
};
} else {
if (dir == LEFT){
if ( .alpha > 0){
.alpha = ( .alpha - 0.1);
} else {
if (
.alpha < 1){
.alpha = (
.alpha + 0.2);
};
};
};
};
} else {
if ( .alpha < 1){
.alpha = ( .alpha + 0.2);
};
if (
.alpha < 1){
.alpha = (
.alpha + 0.2);
};
};
if (
.alpha > 0){
.graphics.clear();
.graphics.moveTo(
.dots[(
.dots.length - 1)].x,
.dots[(
.dots.length - 1)].y);
i = 1;
while (i <
.dots.length) {
.graphics.lineStyle(2, 0xFF00, (0.035 * i));
.graphics.lineTo(
.dots[i].x,
.dots[i].y);
i++;
};
};
if ( .alpha > 0){
.graphics.clear();
.graphics.moveTo(
.dots[(
.dots.length - 1)].x,
.dots[(
.dots.length - 1)].y);
i = 1;
while (i <
.dots.length) {
.graphics.lineStyle(2, 0xFF00, (0.035 * i));
.graphics.lineTo(
.dots[i].x,
.dots[i].y);
i++;
};
};
if (g.spider == null){
if (!(state & DEAD)){
if (NitromeGame.timeline.mouseX < 200){
if (scroll_x < scroll_rect.width){
scroll_x = (scroll_x + 4);
};
} else {
if (NitromeGame.timeline.mouseX > 350){
if (scroll_x > 0){
scroll_x = (scroll_x - 4);
};
};
};
if (NitromeGame.timeline.mouseX < 100){
if (scroll_x < scroll_rect.width){
scroll_x = (scroll_x + 4);
};
} else {
if (NitromeGame.timeline.mouseX > 450){
if (scroll_x > 0){
scroll_x = (scroll_x - 4);
};
};
};
if ((((((NitromeGame.timeline.mouseY > 300)) || ((((Math.abs(( - mc.y)) > 2)) && (( < mc.y)))))) && ((scroll_y > 0)))){
scroll_y = (scroll_y - 2);
} else {
if ((((NitromeGame.timeline.mouseY < 100)) && ((scroll_y < (scroll_rect.height + 60))))){
scroll_y = (scroll_y + 2);
} else {
if (scroll_y < scroll_rect.height){
scroll_y = (scroll_y + 2);
} else {
if (scroll_y > scroll_rect.height){
scroll_y = (scroll_y - 2);
};
};
};
};
scroll_target_x = ((-(mc.x) + scroll_rect.x) + scroll_x);
scroll_target_y = ((-(mc.y) + scroll_rect.y) + scroll_y);
};
scrolling();
g.scroller.clipManager();
};
}
override public function toString():String{
var _local1:String;
_local1 = "";
if (state == RUNNING){
_local1 = "RUNNING";
} else {
if (state == JUMPING){
_local1 = "JUMPING";
} else {
if (state == DEAD){
_local1 = "DEAD";
} else {
if (state == SWINGING){
_local1 = "SWINGING";
} else {
if (state == STEALTH){
_local1 = "STEALTH";
};
};
};
};
};
return ((((((("(" + (x >> 0)) + ",") + (y >> 0)) + ",") + _local1) + ")"));
}
public function
():void{
if (((g.god_mode) || (!(active)))){
return;
};
active = false;
NitromeGame.sound_manager.playSound("aiiee");
g.addFX(mc.x, mc.y, g.bang_bitmap2);
g.addSmoke(mc.x, mc.y);
g.addSmoke(mc.x, mc.y);
g.addSmoke(mc.x, mc.y);
g.shake(5);
();
g.gameOver();
}
public function addStar(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Star{
var _local5:Sprite;
var _local6:Star;
_local5 = new LiveStar();
g.star_holder.addChild(_local5);
_local5.x = (_arg1 >> 0);
_local5.y = (_arg2 >> 0);
_local6 = new Star(_arg1, _arg2, _arg3, _arg4, _local5, g);
stars.push(_local6);
return (_local6);
}
public function (_arg1):void{
var _local2:int;
var _local3:Rect;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
block = _arg1.b;
_local2 = block.sideOf((collision_rect.x + (WIDTH >> 1)), (collision_rect.y + (HEIGHT >> 1)));
_local3 = collision_rect.intersection(block);
if (_local3.width < _local3.height){
if ((_local2 & block.stacked)){
if ((((_local2 == UP)) || ((_local2 == DOWN)))){
if (x < (block.x + (scale >> 1))){
x = (block.x - (WIDTH >> 1));
px = x;
= (
| RIGHT);
if ((((((keys_pressed == RIGHT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
} else {
x = ((block.x + scale) + (WIDTH >> 1));
px = x;
= (
| LEFT);
if ((((((keys_pressed == LEFT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
};
} else {
if ((((_local2 == LEFT)) || ((_local2 == RIGHT)))){
if (y < (block.y + (scale >> 1))){
y = (block.y - (HEIGHT >> 1));
= (
| DOWN);
} else {
y = ((block.y + block.height) + (HEIGHT >> 1));
= (
| UP);
};
};
};
} else {
if (((!((block.stacked & LEFT))) && ((x < (block.x + (scale >> 1)))))){
x = (block.x - (WIDTH >> 1));
px = x;
= (
| RIGHT);
if ((((((keys_pressed == RIGHT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
} else {
if (!(block.stacked & RIGHT)){
x = ((block.x + scale) + (WIDTH >> 1));
px = x;
= (
| LEFT);
if ((((((keys_pressed == LEFT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
} else {
if (y < (block.y + (scale >> 1))){
y = (block.y - (HEIGHT >> 1));
= (
| DOWN);
} else {
y = ((block.y + block.height) + (HEIGHT >> 1));
= (
| UP);
};
};
};
};
} else {
if (_local3.height < _local3.width){
if ((_local2 & block.stacked)){
if ((((_local2 == UP)) || ((_local2 == DOWN)))){
if (x < (block.x + (scale >> 1))){
x = (block.x - (WIDTH >> 1));
px = x;
= (
| RIGHT);
if ((((((keys_pressed == RIGHT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
} else {
x = ((block.x + scale) + (WIDTH >> 1));
px = x;
= (
| LEFT);
if ((((((keys_pressed == LEFT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
};
} else {
if ((((_local2 == LEFT)) || ((_local2 == RIGHT)))){
if (y < (block.y + (scale >> 1))){
y = (block.y - (HEIGHT >> 1));
= (
| DOWN);
} else {
y = ((block.y + block.height) + (HEIGHT >> 1));
= (
| UP);
};
};
};
} else {
if (y < (block.y + (scale >> 1))){
y = (block.y - (HEIGHT >> 1));
= (
| DOWN);
if (!(((((state & JUMPING)) && (!()))) || ((state == SWINGING)))){
platform = block;
state = RUNNING;
= false;
if (block.moving_block){
= _arg1.mc;
};
};
} else {
y = ((block.y + scale) + (HEIGHT >> 1));
= (
| UP);
if ((((x >= block.x)) && ((x < (block.x + scale))))){
if (((!((platform == null))) && ((platform.x == block.x)))){
= true;
};
} else {
if (((block.moving_block) || (((!((platform == null))) && (platform.moving_block))))){
if (x < (block.x + (scale >> 1))){
x = (block.x - (WIDTH >> 1));
} else {
x = ((block.x + scale) + (WIDTH >> 1));
};
};
};
};
};
} else {
if (_local3.width == _local3.height){
_local4 = (block.x + block.width);
_local5 = (block.y + block.height);
_local6 = x;
_local7 = (y - HEIGHT);
if ((((_local6 > _local4)) && ((_local7 > _local5)))){
if ((block.stacked & Rect.RIGHT)){
y = ((block.y + scale) + (HEIGHT >> 1));
= (
| UP);
} else {
if ((block.stacked & DOWN)){
x = ((block.x + scale) + (WIDTH >> 1));
px = x;
= (
| RIGHT);
if ((((((keys_pressed == RIGHT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
} else {
x = ((block.x + scale) + (WIDTH >> 1));
px = x;
= (
| RIGHT);
if ((((((keys_pressed == RIGHT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
};
};
} else {
if ((((_local6 < _local4)) && ((_local7 > _local5)))){
if ((block.stacked & LEFT)){
y = ((block.y + block.height) + (HEIGHT >> 1));
= (
| UP);
} else {
if ((block.stacked & UP)){
x = (block.x - (WIDTH >> 1));
px = x;
= (
| LEFT);
if ((((((keys_pressed == LEFT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
} else {
x = (block.x - (WIDTH >> 1));
px = x;
= (
| LEFT);
if ((((((keys_pressed == LEFT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
};
};
} else {
if ((((_local6 < _local4)) && ((_local7 < _local5)))){
if ((block.stacked & LEFT)){
y = (block.y - (HEIGHT >> 1));
= (
| DOWN);
} else {
if ((block.stacked & DOWN)){
x = (block.x - (WIDTH >> 1));
px = x;
= (
| LEFT);
if ((((((keys_pressed == LEFT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
} else {
x = (block.x - (WIDTH >> 1));
px = x;
y = (block.y - (HEIGHT >> 1));
= (
| LEFT);
if ((((((keys_pressed == LEFT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
= (
| DOWN);
if (!(((((state & JUMPING)) && (!()))) || ((state == SWINGING)))){
platform = block;
state = RUNNING;
= false;
if (block.moving_block){
= _arg1.mc;
};
};
};
};
} else {
if ((((_local6 > _local4)) && ((_local7 < _local5)))){
if ((block.stacked & RIGHT)){
y = (block.y - (HEIGHT >> 1));
= (
| DOWN);
} else {
if ((block.stacked & DOWN)){
x = ((block.x + scale) + (WIDTH >> 1));
px = x;
= (
| RIGHT);
if ((((((keys_pressed == RIGHT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
} else {
x = ((block.x + scale) + (WIDTH >> 1));
px = x;
y = (block.y + (HEIGHT >> 1));
= (
| RIGHT);
if ((((((keys_pressed == RIGHT)) && ((((block.stacked & UP)) || (((y - (HEIGHT >> 1)) > block.y)))))) && ((((block.stacked & DOWN)) || ((y < (block.y + block.height))))))){
if ((((state == JUMPING)) && (!()))){
= WALLSLIDE_DELAY;
};
= block;
= false;
};
= (
| DOWN);
if (!(((((state & JUMPING)) && (!()))) || ((state == SWINGING)))){
platform = block;
state = RUNNING;
= false;
if (block.moving_block){
= _arg1.mc;
};
};
};
};
};
};
};
};
};
};
};
if (((((
) && ((state == SWINGING)))) && (block.moving_block))){
if ((
& LEFT)){
if (block.px < block.x){
x = (x + (block.x - block.px));
};
} else {
if ((
& RIGHT)){
if (block.px > block.x){
x = (x + (block.x - block.px));
};
} else {
if ((
& UP)){
if (block.py < block.y){
y = (y + (block.y - block.py));
};
};
};
};
};
updateCollisionRect();
}
public function levelComplete(_arg1:Encounter=null):void{
if (((!(active)) || (level_completed))){
return;
};
level_completed = true;
finish_item = _arg1;
}
public function ():void{
if (stars.length >= NUM_STARS){
stars[0].kill();
stars.shift();
};
i = 0;
while (i < stars.length) {
stars[i].main();
if (stars[i].dead){
stars.splice(i, 1);
i--;
};
i++;
};
}
public function checkKeys():void{
var _local1:MovieClip;
var _local2:Sprite;
keys_pressed = 0;
if (state == RUNNING){
running = false;
if (((((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A)))) && (!(((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D))))))){
= DAMPING_X;
px = (px + SPEED);
dir = LEFT;
running = true;
keys_pressed = LEFT;
};
if (((((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D)))) && (!(((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A))))))){
= DAMPING_X;
px = (px - SPEED);
dir = RIGHT;
running = true;
keys_pressed = RIGHT;
};
if (((((Key.isDown(Keyboard.UP)) || (Key.isDown(Key.W)))) && (!( )))){
= true;
state = JUMPING;
= JUMP_DELAY;
= JUMP_FRAME_DELAY;
py = (y + );
= ( - JUMP_DECAY);
_local1 = new JumpMC();
if (platform.moving_block){
_local1.x = (x - platform.x);
.addChild(_local1);
} else {
_local1.x = mc.x;
_local1.y = mc.y;
g.effect_holder.addChild(_local1);
};
platform = null;
NitromeGame.sound_manager.playSound("jump");
} else {
if (((((((((((!((g.alert_state == Game.ACTIVE))) && (!()))) && (!()))) && (!(g.mouse_pressed)))) && (!(((((((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D)))) || (Key.isDown(Keyboard.LEFT)))) || (Key.isDown(Key.A))))))) && (((Key.isDown(Keyboard.DOWN)) || (Key.isDown(Key.S)))))){
state = STEALTH;
= true;
(dir == LEFT);
if (!chameleon){
NitromeGame.sound_manager.playSound("wom");
};
};
};
} else {
if (state == JUMPING){
if ((() || ())){
if (){
px = (px + SPEED);
dir = LEFT;
};
if (){
px = (px - SPEED);
dir = RIGHT;
};
} else {
if (( & RIGHT)){
dir = RIGHT;
} else {
if (( & LEFT)){
dir = LEFT;
};
};
if (){
= false;
};
if (((((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A)))) && (!(((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D))))))){
= DAMPING_X;
px = (px + SPEED);
dir = LEFT;
keys_pressed = LEFT;
};
if (((((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D)))) && (!(((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A))))))){
= DAMPING_X;
px = (px - SPEED);
dir = RIGHT;
keys_pressed = RIGHT;
};
if (((((((Key.isDown(Keyboard.DOWN)) || (Key.isDown(Key.S)))) && (!(((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A))))))) && (!(((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D))))))){
= 0;
= 0;
};
};
if (((( > 0)) || (((((((((Key.isDown(Keyboard.UP)) || (Key.isDown(Key.W)))) && (!()))) && (( > 0)))) && ( ))))){
--;
py = (py + );
= ( - JUMP_DECAY);
};
if (((((( > 0)) && (!( )))) && (((((!(((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D))))) && (((((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A)))) && (( & RIGHT)))))) || (((((!(((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A))))) && (((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D)))))) && (( & LEFT)))))))){
= true;
= false;
state = JUMPING;
= JUMP_DELAY;
= JUMP_FRAME_DELAY;
py = (y + );
= ( - JUMP_DECAY);
platform = null;
= 0;
if (( & LEFT)){
= true;
};
if (( & RIGHT)){
= true;
};
NitromeGame.sound_manager.playSound("jump");
};
if (!){
= ( = false);
};
} else {
if (state == SWINGING){
if ((((
== 0)) && ((rope_end.b.y > rope_end.a.y)))){
if (x < rope_end.a.x){
if (((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D)))){
px = (px + (rope_end.rx * ));
py = (py + (rope_end.ry * ));
};
} else {
if (x > rope_end.a.x){
if (((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A)))){
px = (px + (rope_end.lx * ));
py = (py + (rope_end.ly * ));
};
} else {
if (x == rope_end.a.x){
if (((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(Key.D)))){
px = (px + (rope_end.rx * ));
py = (py + (rope_end.ry * ));
} else {
if (((Key.isDown(Keyboard.LEFT)) || (Key.isDown(Key.A)))){
px = (px + (rope_end.lx * ));
py = (py + (rope_end.ly * ));
};
};
};
};
};
};
if ((((((() && (((Key.isDown(Keyboard.UP)) || (Key.isDown(Key.W)))))) && (!((
& UP))))) && ((rope_end.len > HEIGHT)))){
i = 0;
while (i < rope.length) {
rope[i].rest_len = (rope[i].rest_len - );
i++;
};
= (
- );
if (((( < MAX_ROPE_SPEED)) && ((
> 100)))){
= ( + ((MAX_ROPE_SPEED - ) * 0.1));
} else {
if ( > MIN_ROPE_SPEED){
= ( + ((MIN_ROPE_SPEED - ) * 0.1));
};
};
} else {
if ((((((((((((rope_end.b.y > rope_end.a.y)) && ((
< MAX_ROPE_LENGTH)))) && (((Key.isDown(Keyboard.DOWN)) || (Key.isDown(Key.S)))))) && (!((
& DOWN))))) && (( == 0)))) && (!((((((rope_end.b.x > rope_end.a.x)) && ((
& RIGHT)))) || ((((rope_end.b.x < rope_end.a.x)) && ((
& LEFT))))))))){
i = 0;
while (i < rope.length) {
rope[i].rest_len = (rope[i].rest_len + );
i++;
};
= (
+ );
if (((( < MAX_ROPE_SPEED)) && ((
< (MAX_ROPE_LENGTH - 100))))){
= ( + ((MAX_ROPE_SPEED - ) * 0.1));
} else {
if ( > MIN_ROPE_SPEED){
= ( + ((MIN_ROPE_SPEED - ) * 0.1));
};
};
} else {
if (((((((((Key.isDown(Keyboard.UP)) || (Key.isDown(Key.W)))) && (!((
& UP))))) && ((((
& LEFT)) || ((
& RIGHT)))))) && ((rope_end.len <= HEIGHT)))){
rope_end = null;
rope = [];
anchor = null;
= false;
= true;
state = JUMPING;
= JUMP_DELAY;
= JUMP_FRAME_DELAY;
py = (y + );
= ( - JUMP_DECAY);
NitromeGame.sound_manager.playSound("jump");
platform = null;
} else {
= MIN_ROPE_SPEED;
};
};
};
} else {
if (state == STEALTH){
};
};
};
};
if (!((((((Key.isDown(Keyboard.UP)) || (Key.isDown(Key.W)))) || ())) || ())){
= false;
};
if (!((Key.isDown(Keyboard.DOWN)) || (Key.isDown(Key.S)))){
= false;
if (state == STEALTH){
state = ((platform == null)) ? JUMPING : RUNNING;
};
};
if (((((((( == 0)) && (!((state == STEALTH))))) && (g.mouse_pressed))) && (!()))){
if (chameleon){
exitChameleonMode();
};
= READY;
vx = (g.canvas.mouseX - x);
vy = (g.canvas.mouseY - y);
= Math.sqrt(((vx * vx) + (vy * vy)));
dx = (vx /
);
dy = (vy /
);
= READY_DELAY;
} else {
if ( == READY){
if (--
<= 0){
_local2 = new LiveStar();
g.star_holder.addChild(_local2);
anchor = new RopeAnchor(x, y, dx, dy, _local2, g);
= 0;
= false;
= THROW;
= THROW_DELAY;
};
} else {
if (((( == THROW)) && (!(g.mouse_pressed)))){
if (-- <= 0){
= 0;
};
} else {
if (anchor == null){
--;
};
};
};
};
if (){
g.mouse_pressed = false;
};
if (!g.mouse_pressed){
if (((!((anchor == null))) && (anchor.active))){
anchor.convertToStar();
};
};
}
public function ():void{
= false;
if ((map_rect.x + (map_rect.width - 1)) < (x + (WIDTH >> 1))){
x = (px = ((-((WIDTH >> 1)) + map_rect.x) + (map_rect.width - 1)));
};
if ((map_rect.y + (map_rect.height - 1)) < y){
();
return;
};
if (map_rect.x >= (x - (WIDTH >> 1))){
x = (px = (map_rect.x + (WIDTH >> 1)));
};
if (map_rect.y >= (y - (HEIGHT >> 1))){
y = (py = (map_rect.y + (HEIGHT >> 1)));
};
map_x = ((x - (WIDTH >> 1)) * SCALE);
map_y = ((y - (HEIGHT >> 1)) * SCALE);
if (map_y >= (g.scroller.height - 1)){
map_y = (g.scroller.height - 2);
};
[0] = g.block_map[map_y][map_x];
[1] = g.block_map[map_y][(map_x + 1)];
[2] = g.block_map[(map_y + 1)][map_x];
[3] = g.block_map[(map_y + 1)][(map_x + 1)];
= grid_x;
= grid_y;
grid_x = (x * SCALE);
grid_y = (y * SCALE);
if (g.scent_map[grid_y][grid_x] > -1){
g.scent_map[grid_y][grid_x] = g.frame_count;
};
if (((!((grid_x == ))) && (!((grid_y == ))))){
if (g.scent_map[][grid_x] > -1){
g.scent_map[][grid_x] = g.frame_count;
};
if (g.scent_map[grid_y][] > -1){
g.scent_map[grid_y][] = g.frame_count;
};
};
i = 0;
while (i < .length) {
if (((((!(((( [i] <= 0)) || (( [i] >= 0))))) && (!(( [i] == null))))) && ( [i].block))){
block = [i].b;
if (block.intersects(collision_rect)){
( [i]);
};
};
i++;
};
if ((((((((
& UP)) && ((
& DOWN)))) && (
))) || ((((
& RIGHT)) && ((
& LEFT)))))){
();
};
if (((!((platform == null))) || (!()))){
= 0;
= 0;
} else {
if (
> 0){
=
;
if ((
& DOWN)){
= EXTEND_ROPE_OFF_DELAY;
};
};
};
if ((((state == SWINGING)) && ((
& DOWN)))){
= SWING_FLOOR_DELAY;
} else {
if (state == SWINGING){
--;
};
};
}
public function stealthScreenGrab():void{
mc.visible = false;
.visible = false;
.visible = false;
.visible = false;
.visible = false;
point = Util.localToLocal(point, mc, NitromeGame.timeline);
stealth_clip.grab((-(point.x) - stealth_clip.bitmap.x), (-(point.y) - stealth_clip.bitmap.y));
mc.visible = true;
.visible = true;
.visible = true;
}
public function
():void{
if (!chameleon){
if (mc.body != null){
if (dir == LEFT){
point = Util.localToLocal(point, mc.body.left_eye, g.canvas);
.move(point.x, point.y);
.main();
point = Util.localToLocal(point, mc.body.right_eye, g.canvas);
.move(point.x, point.y);
.main();
} else {
if (dir == RIGHT){
point = Util.localToLocal(point, mc.body.right_eye, g.canvas);
.move(point.x, point.y);
.main();
point = Util.localToLocal(point, mc.body.left_eye, g.canvas);
.move(point.x, point.y);
.main();
};
};
};
} else {
if (
.body != null){
if (dir == LEFT){
point = Util.localToLocal(point,
.body.left_eye, g.canvas);
.move(point.x, point.y);
.main();
point = Util.localToLocal(point,
.body.right_eye, g.canvas);
.move(point.x, point.y);
.main();
} else {
if (dir == RIGHT){
point = Util.localToLocal(point,
.body.right_eye, g.canvas);
.move(point.x, point.y);
.main();
point = Util.localToLocal(point,
.body.left_eye, g.canvas);
.move(point.x, point.y);
.main();
};
};
};
};
}
public function
():void{
var _local1:int;
var _local2:RopeJoint;
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Rope;
var _local7:Number;
var _local8:Number;
if (anchor != null){
anchor.main();
if (((((!((anchor == null))) && (anchor.locked))) && (anchor.active))){
i = 1;
while (i < rope.length) {
if (rope[i].a.block.moving_block){
rope[i].a.main();
};
i++;
};
if (){
rope_end.updateSpring();
} else {
rope_end.updateLine();
};
rope_end.a.pin();
map_x = ((x * SCALE) >> 0);
map_y = ((y * SCALE) >> 0);
if (map_y >= g.scroller.height){
return;
};
if ((((g.stack_map[map_y][map_x] > Game.EMPTY)) && (!((g.stack_map[map_y][map_x] & Rect.TEMP))))){
(g.block_map[map_y][map_x]);
rope_end.updateLine();
};
if (!){
if (rope_end.b.y <= rope_end.a.y){
= true;
};
if ((((
& DOWN)) && ((rope_end.b.y <= rope_end.a.y)))){
rope_end.rest_len = rope_end.len;
};
if ((((
& DOWN)) || ((rope_end.b.y > rope_end.a.y)))){
= true;
if (){
rope_end.rest_len = rope_end.len;
};
= false;
};
};
if (((((!((rope_end.stiffness == 0.5))) && ((((rope_end.len < )) || ((rope_end.len < HEIGHT)))))) && ((y > rope_end.a.y)))){
rope_end.stiffness = 0.5;
};
i = 0;
while (i < (rope.length - 1)) {
= RayCast.cast(rope[i], g.block_map, true);
if (((!(( == null))) && (.block.cutting))){
g.mouse_pressed = false;
};
i++;
};
= RayCast.cast(rope_end, g.block_map);
if ( != null){
if (.block.cutting){
g.mouse_pressed = false;
};
_local1 = 0;
while (_local1 < 100) {
if ( == null){
break;
};
_local3 = 0;
_local4 = 0;
if (rope_end.from){
if (rope_end.block == .block){
if (rope_end.from == Rope.UP_LEFT){
if (.exit_side == RIGHT){
.access_side = UP;
} else {
if (.exit_side == DOWN){
.access_side = LEFT;
};
};
} else {
if (rope_end.from == Rope.UP_RIGHT){
if (.exit_side == LEFT){
.access_side = UP;
} else {
if (.exit_side == DOWN){
.access_side = RIGHT;
};
};
} else {
if (rope_end.from == Rope.DOWN_RIGHT){
if (.exit_side == LEFT){
.access_side = DOWN;
} else {
if (.exit_side == UP){
.access_side = RIGHT;
};
};
} else {
if (rope_end.from == Rope.DOWN_LEFT){
if (.exit_side == RIGHT){
.access_side = DOWN;
} else {
if (.exit_side == UP){
.access_side = LEFT;
};
};
};
};
};
};
};
};
if (.access_side == UP){
if (.exit_side == RIGHT){
i = 0;
while (i < 1000) {
if ((.block.stacked & RIGHT)){
.map_x++;
.block = g.block_map[.map_y][.map_x].b;
} else {
break;
};
i++;
};
_local2 = new RopeJoint((.block.x + scale), (.block.y - 1), .block, g);
_local3 = RIGHT;
_local4 = Rope.UP_RIGHT;
} else {
if (.exit_side == LEFT){
i = 0;
while (i < 1000) {
if ((.block.stacked & LEFT)){
.map_x--;
.block = g.block_map[.map_y][.map_x].b;
} else {
break;
};
i++;
};
_local2 = new RopeJoint((.block.x - 1), .block.y, .block, g);
_local3 = LEFT;
_local4 = Rope.UP_LEFT;
} else {
if (.exit_side == DOWN){
if (px > x){
_local2 = new RopeJoint((.block.x + scale), (.block.y - 1), .block, g);
_local3 = RIGHT;
_local4 = Rope.UP_RIGHT;
} else {
if (px < x){
_local2 = new RopeJoint((.block.x - 1), (.block.y - 1), .block, g);
_local3 = LEFT;
_local4 = Rope.UP_LEFT;
} else {
if (.ax > (.block.x + (scale >> 1))){
_local2 = new RopeJoint((.block.x + scale), (.block.y - 1), .block, g);
_local3 = RIGHT;
_local4 = Rope.UP_RIGHT;
} else {
_local2 = new RopeJoint((.block.x - 1), (.block.y - 1), .block, g);
_local3 = LEFT;
_local4 = Rope.UP_LEFT;
};
};
};
};
};
};
} else {
if (.access_side == RIGHT){
if (.exit_side == DOWN){
i = 0;
while (i < 1000) {
if ((.block.stacked & DOWN)){
.map_y++;
.block = g.block_map[.map_y][.map_x].b;
} else {
break;
};
i++;
};
_local2 = new RopeJoint((.block.x + scale), (.block.y + scale), .block, g);
_local3 = RIGHT;
_local4 = Rope.DOWN_RIGHT;
} else {
if (.exit_side == UP){
i = 0;
while (i < 1000) {
if ((.block.stacked & UP)){
.map_y--;
.block = g.block_map[.map_y][.map_x].b;
} else {
break;
};
i++;
};
_local2 = new RopeJoint((.block.x + scale), .block.y, .block, g);
_local3 = LEFT;
_local4 = Rope.UP_RIGHT;
} else {
if (.exit_side == LEFT){
if (py > y){
_local2 = new RopeJoint((.block.x + scale), (.block.y + scale), .block, g);
_local3 = RIGHT;
_local4 = Rope.DOWN_RIGHT;
} else {
if (py < y){
_local2 = new RopeJoint((.block.x + scale), (.block.y - 1), .block, g);
_local3 = LEFT;
_local4 = Rope.UP_RIGHT;
} else {
if (.ay > (.block.y + (scale >> 1))){
_local2 = new RopeJoint((.block.x + scale), (.block.y + scale), .block, g);
_local3 = RIGHT;
_local4 = Rope.DOWN_RIGHT;
} else {
_local2 = new RopeJoint((.block.x + scale), (.block.y - 1), .block, g);
_local3 = LEFT;
_local4 = Rope.UP_RIGHT;
};
};
};
};
};
};
} else {
if (.access_side == DOWN){
if (.exit_side == RIGHT){
i = 0;
while (i < 1000) {
if ((.block.stacked & RIGHT)){
.map_x++;
.block = g.block_map[.map_y][.map_x].b;
} else {
break;
};
i++;
};
_local2 = new RopeJoint((.block.x + scale), (.block.y + scale), .block, g);
_local3 = LEFT;
_local4 = Rope.DOWN_RIGHT;
} else {
if (.exit_side == LEFT){
i = 0;
while (i < 1000) {
if ((.block.stacked & LEFT)){
.map_x--;
.block = g.block_map[.map_y][.map_x].b;
} else {
break;
};
i++;
};
_local2 = new RopeJoint((.block.x - 1), (.block.y + scale), .block, g);
_local3 = RIGHT;
_local4 = Rope.DOWN_LEFT;
} else {
if (.exit_side == UP){
if (px > x){
_local2 = new RopeJoint((.block.x + scale), (.block.y + scale), .block, g);
_local3 = LEFT;
_local4 = Rope.DOWN_RIGHT;
} else {
if (px < x){
_local2 = new RopeJoint((.block.x - 1), (.block.y + scale), .block, g);
_local3 = RIGHT;
_local4 = Rope.DOWN_LEFT;
} else {
if (.ax > (.block.x + (scale >> 1))){
_local2 = new RopeJoint((.block.x - 1), (.block.y + scale), .block, g);
_local3 = LEFT;
_local4 = Rope.DOWN_LEFT;
} else {
_local2 = new RopeJoint((.block.x + scale), (.block.y + scale), .block, g);
_local3 = RIGHT;
_local4 = Rope.DOWN_RIGHT;
};
};
};
};
};
};
} else {
if (.access_side == LEFT){
if (.exit_side == DOWN){
i = 0;
while (i < 1000) {
if ((.block.stacked & DOWN)){
.map_y++;
.block = g.block_map[.map_y][.map_x].b;
} else {
break;
};
i++;
};
_local2 = new RopeJoint((.block.x - 1), (.block.y + scale), .block, g);
_local3 = LEFT;
_local4 = Rope.DOWN_LEFT;
} else {
if (.exit_side == UP){
i = 0;
while (i < 1000) {
if ((.block.stacked & UP)){
.map_y--;
.block = g.block_map[.map_y][.map_x].b;
} else {
break;
};
i++;
};
_local2 = new RopeJoint((.block.x - 1), (.block.y - 1), .block, g);
_local3 = RIGHT;
_local4 = Rope.UP_LEFT;
} else {
if (.exit_side == RIGHT){
if (py > y){
_local2 = new RopeJoint((.block.x - 1), (.block.y + scale), .block, g);
_local3 = LEFT;
_local4 = Rope.DOWN_LEFT;
} else {
if (py < y){
_local2 = new RopeJoint((.block.x - 1), (.block.y - 1), .block, g);
_local3 = RIGHT;
_local4 = Rope.UP_LEFT;
} else {
if (.ay > (.block.y + (scale >> 1))){
_local2 = new RopeJoint((.block.x - 1), (.block.y + scale), .block, g);
_local3 = LEFT;
_local4 = Rope.DOWN_LEFT;
} else {
_local2 = new RopeJoint((.block.x - 1), (.block.y - 1), .block, g);
_local3 = RIGHT;
_local4 = Rope.UP_LEFT;
};
};
};
};
};
};
};
};
};
};
if (_local2 != null){
_local5 = rope_end.rest_len;
rope_end.b = _local2;
rope_end.updateLine();
if (_local3 == RIGHT){
rope_end.unwrap_x = rope_end.lx;
rope_end.unwrap_y = rope_end.ly;
} else {
rope_end.unwrap_x = rope_end.rx;
rope_end.unwrap_y = rope_end.ry;
};
_local6 = new Rope(_local2, this);
rope_end = _local6;
rope_end.from = _local4;
rope_end.block = .block;
rope.push(rope_end);
};
= RayCast.cast(rope_end, g.block_map);
_local1++;
};
};
if (rope.length > 1){
_local7 = ((rope_end.dx * rope[(rope.length - 2)].unwrap_x) + (rope_end.dy * rope[(rope.length - 2)].unwrap_y));
if (_local7 > 0){
_local8 = (rope[(rope.length - 2)].len + rope_end.len);
rope.pop();
rope_end = rope[(rope.length - 1)];
rope_end.b = this;
};
};
};
};
if ( > 0){
--;
};
if (((( == 0)) && ((state == SWINGING)))){
rope_end = null;
rope = [];
anchor = null;
state = JUMPING;
= true;
};
g.rope_holder.graphics.clear();
g.rope_holder.graphics.lineStyle(2, 1976903, );
if ( < 1){
= ( + ROPE_ALPHA_FADE);
};
if (rope.length > 0){
i = 0;
while (i < (rope.length - 1)) {
g.rope_holder.graphics.moveTo(rope[i].a.x, rope[i].a.y);
g.rope_holder.graphics.lineTo(rope[i].b.x, rope[i].b.y);
i++;
};
g.rope_holder.graphics.moveTo(rope[(rope.length - 1)].a.x, rope[(rope.length - 1)].a.y);
g.rope_holder.graphics.lineTo((.x + mc.x), (.y + mc.y));
} else {
if (((((!((anchor == null))) && (anchor.active))) && (!((anchor.rope == null))))){
g.rope_holder.graphics.moveTo((.x + mc.x), (.y + mc.y));
g.rope_holder.graphics.lineTo(anchor.mc.x, anchor.mc.y);
};
};
}
public function
():void{
if (!active){
return;
};
if (){
++;
if ((((health.value > 0)) && (( >= OUCH_DELAY)))){
= false;
= true;
} else {
if ( >= OUCH_DEATH_DELAY){
= false;
= true;
};
};
};
if (){
if (health.value <= 0){
();
} else {
++;
mc.visible = !(mc.visible);
if ( >= HURT_DELAY){
= false;
mc.visible = true;
};
};
};
}
public function sideOf(_arg1:Number):int{
_arg1 = (_arg1 + 180);
if ((((_arg1 < 22.5)) || ((_arg1 >= 337.5)))){
return (RIGHT);
};
if ((((_arg1 >= 22.5)) && ((_arg1 < 67.5)))){
return (RIGHT);
};
if ((((_arg1 >= 67.5)) && ((_arg1 < 112.5)))){
return (RIGHT);
};
if ((((_arg1 >= 112.5)) && ((_arg1 < 157.5)))){
return (LEFT);
};
if ((((_arg1 >= 157.5)) && ((_arg1 < 202.5)))){
return (LEFT);
};
if ((((_arg1 >= 202.5)) && ((_arg1 < 247.5)))){
return (LEFT);
};
if ((((_arg1 >= 247.5)) && ((_arg1 < 292.5)))){
return (RIGHT);
};
if ((((_arg1 >= 292.5)) && ((_arg1 < 337.5)))){
return (RIGHT);
};
return (0);
}
public function exitChameleonMode():void{
if (!chameleon){
return;
};
stealthScreenGrab();
stealth_clip.alpha = 1;
chameleon = false;
g.alert_count = 0;
}
public function hit():void{
if ((((((() || ())) || (!(active)))) || (g.god_mode))){
return;
};
if (g.spider != null){
g.spider.kill();
};
if (chameleon){
exitChameleonMode();
};
NitromeGame.sound_manager.playSound("electric");
NitromeGame.bonus.dodge.value = 0;
= true;
g.mouse_pressed = false;
= 0;
= 0;
if (state == STEALTH){
state = RUNNING;
};
health.value--;
NitromeGame.timeline.health_panel.gotoAndStop(("_" + health.value));
}
public function verletY(_arg1:Number, _arg2:Number):void{
temp_y = y;
y = (y + ((_arg2 * (y - py)) + _arg1));
py = temp_y;
}
public function (_arg1:Number, _arg2:Number):void{
temp_x = x;
x = (x + ((_arg2 * (x - px)) + _arg1));
px = temp_x;
}
public function main():void{
var _local1:int;
var _local2:int;
var _local3:MovieClip;
= 0;
if (platform != null){
= (
| Rect.DOWN);
};
if (((key_lock) && ((Key.keys_pressed == 0)))){
key_lock = false;
};
if ((((((((state == RUNNING)) || ((state == JUMPING)))) || ((state == SWINGING)))) || ((state == STEALTH)))){
on_scroller = ((g.scroller.contains(x, y)) || ((y >= (map_rect.height - 1))));
if (on_scroller){
if (state == JUMPING){
if (py <= y){
= true;
};
if (){
findFloor();
};
};
if ((((state == RUNNING)) || ((state == STEALTH)))){
if (platform.moving_block){
x = (x + (platform.x - platform.px));
px = (px + (platform.x - platform.px));
y = (y + (platform.y - platform.py));
py = (py + (platform.y - platform.py));
};
};
if (state == RUNNING){
();
};
();
};
();
();
if (!active){
return;
};
updateAnimState(mc);
updateAnimState(stealth_mask);
updateAnimState(
);
updateAnimState();
updateMC();
();
();
if (((((((!()) && (!(g.completed)))) && ((g.spider == null)))) && (!(key_lock)))){
checkKeys();
};
if (on_scroller){
if (state != SWINGING){
if ( > DAMPING_X){
= ( - DAMPING_STEP);
};
(GRAVITY_X, );
} else {
(GRAVITY_X, );
};
if (platform == null){
if (){
--;
if ((y + 20) > (.y + .height)){
if ((((.stacked & DOWN)) && (((.y + .height) < map_rect.height)))){
_local1 = ((.x * SCALE) >> 0);
_local2 = ((.y * SCALE) >> 0);
= g.block_map[(_local2 + 1)][_local1].b;
} else {
= 0;
};
};
if ( > (WALLSLIDE_DELAY - 2)){
verletY(GRAVITY_Y, FORCED_WALLSLIDE_DAMPING_Y);
} else {
verletY(GRAVITY_Y, WALLSLIDE_DAMPING_Y);
};
} else {
verletY(GRAVITY_Y, DAMPING_Y);
};
};
};
();
updateCollisionRect();
if ((((state == RUNNING)) && (level_completed))){
active = false;
if ((finish_item is Lift)){
(finish_item as Lift).exitAnim();
} else {
if ((finish_item is ElectricFinish)){
_local3 = new OuchFinishMC();
_local3.x = mc.x;
_local3.y = mc.y;
g.player_holder.addChild(_local3);
g.electrocuteActors();
} else {
if (finish_item == null){
_local3 = new LevelCompleteMC();
_local3.x = mc.x;
_local3.y = mc.y;
g.player_holder.addChild(_local3);
};
};
};
g.finish_count = 0;
();
};
};
}
public function findFloor():void{
map_x = (((x - (WIDTH >> 1)) * SCALE) >> 0);
map_y = (((y - (HEIGHT >> 1)) * SCALE) >> 0);
if (map_y >= (g.scroller.height - 1)){
map_y = (g.scroller.height - 2);
};
[0] = g.block_map[map_y][map_x];
[1] = g.block_map[map_y][(map_x + 1)];
[2] = g.block_map[(map_y + 1)][map_x];
[3] = g.block_map[(map_y + 1)][(map_x + 1)];
i = 0;
while (i < .length) {
if (((((!(((( [i] >= 0)) || (( [i] <= 0))))) && (!(( [i] == null))))) && ( [i].block))){
block = [i].b;
if ((block.stacked & Rect.UP)){
} else {
if ((((block.x > ((-1 + x) + (WIDTH >> 1)))) || ((((block.x + scale) - 1) < (x - (WIDTH >> 1)))))){
} else {
if (((((y + (HEIGHT >> 1)) < block.y)) || (((y + (HEIGHT >> 1)) > ((block.y + FLOOR_DEPTH) + (y - py)))))){
} else {
platform = block;
y = (block.y - (HEIGHT >> 1));
if (platform.moving_block){
x = (x - (platform.x - platform.px));
px = (px - (platform.x - platform.px));
y = (y - (platform.y - platform.py));
py = (py - (platform.y - platform.py));
= [i].mc;
};
updateCollisionRect();
state = RUNNING;
= DAMPING_X;
= false;
= false;
= false;
return;
};
};
};
};
i++;
};
}
public function ():void{
if (platform != null){
if ((((((((platform.x + platform.width) - 1) < (x - (WIDTH >> 1)))) || ((platform.x > ((-1 + x) + (WIDTH >> 1)))))) || (((platform.force_field) && (!(platform.active)))))){
platform = null;
findFloor();
if (platform == null){
state = JUMPING;
= true;
py = y;
};
};
};
}
public function updateCollisionRect():void{
collision_rect.x = (x - (WIDTH >> 1));
collision_rect.y = (y - (HEIGHT >> 1));
collision_rect.width = WIDTH;
collision_rect.height = HEIGHT;
}
public function scrolling():void{
var _local1:Number;
scroll_target_x = Math.min(0, scroll_target_x);
scroll_target_y = Math.min(0, scroll_target_y);
scroll_target_x = Math.max(((-(g.scroller.width) * scale) + Game.WIDTH), scroll_target_x);
scroll_target_y = Math.max(((-(g.scroller.height) * scale) + Game.HEIGHT), scroll_target_y);
_local1 = 0.2;
= g.canvas.x;
= g.canvas.y;
g.canvas.x = (g.canvas.x + Math.round(((scroll_target_x - g.canvas.x) * _local1)));
g.canvas.y = (g.canvas.y + Math.round(((scroll_target_y - g.canvas.y) * _local1)));
if (((((Key.isDown(Keyboard.LEFT)) || (Key.isDown(65)))) || (((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(68)))))){
= (
+ (g.canvas.x - ));
};
if (g.back.back != null){
g.back.back.x = ((
* 0.05) >> 0);
g.back.front.x = ((
* 0.1) >> 0);
if (g.back.back.x > 0){
g.back.back.x = (g.back.back.x - (g.back.back.width * 0.5));
};
if (g.back.back.x < (-(g.back.back.width) * 0.5)){
g.back.back.x = (g.back.back.x + (g.back.back.width * 0.5));
};
if (g.back.front.x > 0){
g.back.front.x = (g.back.front.x - (g.back.front.width * 0.5));
};
if (g.back.front.x < (-(g.back.front.width) * 0.5)){
g.back.front.x = (g.back.front.x + (g.back.front.width * 0.5));
};
if ((((((g.background_type == Game.DAWN)) || ((g.background_type == Game.DAWN_SUN)))) || ((g.background_type == Game.NIGHT)))){
g.back.back.visible = false;
} else {
g.back.back.visible = true;
};
if ((((g.background_type == Game.DAWN_CLOUDS)) || ((g.background_type == Game.DAWN)))){
NitromeGame.timeline.back.front.sun1.visible = false;
NitromeGame.timeline.back.front.sun2.visible = false;
} else {
if ((((g.background_type == Game.DAWN_CLOUDS_SUN)) || ((g.background_type == Game.DAWN_SUN)))){
NitromeGame.timeline.back.front.sun1.visible = true;
NitromeGame.timeline.back.front.sun2.visible = true;
g.back.front.sun1.sparkle1.rotation = (g.back.front.sun1.sparkle1.rotation + ((g.canvas.x - ) * 0.05));
g.back.front.sun1.sparkle2.rotation = (g.back.front.sun1.sparkle2.rotation - ((g.canvas.x - ) * 0.05));
g.back.front.sun2.sparkle1.rotation = (g.back.front.sun2.sparkle1.rotation + ((g.canvas.x - ) * 0.05));
g.back.front.sun2.sparkle2.rotation = (g.back.front.sun2.sparkle2.rotation - ((g.canvas.x - ) * 0.05));
};
};
};
}
}
}//package com.nitrome.engine_specific
Section 54
//RayCast (com.nitrome.engine_specific.RayCast)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class RayCast {
public static const LEFT:int = 8;
public static const UP:int = 1;
public static const DOWN:int = 4;
public static const RIGHT:int = 2;
public static var
:Boolean;
public static var tx:Number;
public static var ty:Number;
public static var px:Number;
public static var py:Number;
public static var block:Block;
public static var DX:Number;
public static var DY:Number;
public static var dist_to_block_edge:Number;
public static var
:Number;
public static var next_y:Number;
public static var corn:Array;
public static var new_next:Number;
public static var next_x:Number;
public static var
:Number;
public static var iterations:int = 100;
public static var ax:Number;
public static var ay:Number;
public static var
:Number;
public static var vx:Number;
public static var vy:Number;
public static var dir_x:int;
public static var dir_y:int;
public static var dot:Number;
public static var line_rect:Rect;
public static var moving_found:Boolean;
public static var map_x:int;
public static var map_y:int;
public static var stack_map_value:int;
public static var report:RayCastReport;
public static var temp_block:Block;
public static var g:Game;
public static var i:int;
public static var j:int;
public static var next:Number;
public static var num_corners_inside:int;
public static function init(_arg1:Game):void{
g = _arg1;
corn = new Array(4);
i = 0;
while (i < 4) {
corn[i] = new Dot();
i++;
};
line_rect = new Rect();
temp_block = new Block(0, 0, Game.scale, Game.scale);
}
public static function reportIntersectsRect(_arg1:Line, _arg2:RayCastReport, _arg3:Rect):Boolean{
if (_arg2 == null){
ax = _arg1.b.x;
ay = _arg1.b.y;
} else {
ax = _arg2.ax;
ay = _arg2.ay;
};
line_rect.x = Math.min(_arg1.a.x, ax);
line_rect.y = Math.min(_arg1.a.y, ay);
line_rect.width = Math.abs((_arg1.a.x - ax));
line_rect.height = Math.abs((_arg1.a.y - ay));
if (line_rect.intersects(_arg3)){
if ((((((((_arg1.a.x >= _arg3.x)) && ((_arg1.a.x < (_arg3.x + _arg3.width))))) && ((ax >= _arg3.x)))) && ((ax < (_arg3.x + _arg3.width))))){
return (true);
};
if ((((((((_arg1.a.y >= _arg3.y)) && ((_arg1.a.y < (_arg3.y + _arg3.height))))) && ((ay >= _arg3.y)))) && ((ay < (_arg3.y + _arg3.height))))){
return (true);
};
corn = _arg3.(corn);
num_corners_inside = 0;
j = 0;
while (j < corn.length) {
vx = (corn[j].x - _arg1.a.x);
vy = (corn[j].y - _arg1.a.y);
dot = ((vx * _arg1.rx) + (vy * _arg1.ry));
if (dot < 0){
num_corners_inside++;
};
j++;
};
if ((((num_corners_inside == 0)) || ((num_corners_inside == 4)))){
} else {
return (true);
};
};
return (false);
}
public static function cast(_arg1:Line, _arg2:Array, _arg3:Boolean=false):RayCastReport{
report = null;
= (moving_found = false);
map_x = ((_arg1.a.x * Game.SCALE) >> 0);
map_y = ((_arg1.a.y * Game.SCALE) >> 0);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
= true;
block = ((_arg2[map_y][map_x] is Clip)) ? _arg2[map_y][map_x].b : new Block((map_x * Game.scale), (map_y * Game.scale), Game.scale, Game.scale);
report = new RayCastReport(block, map_x, map_y, _arg1.a.x, _arg1.a.y);
};
if (_arg1.dx != 0){
DX = (1 / _arg1.dx);
} else {
DX = 0;
};
if (_arg1.dy != 0){
DY = (1 / _arg1.dy);
} else {
DY = 0;
};
dir_x = ((_arg1.dx < 0)) ? -1 : 1;
dir_y = ((_arg1.dy < 0)) ? -1 : 1;
px = (_arg1.a.x - (map_x * Game.scale));
py = (_arg1.a.y - (map_y * Game.scale));
tx = ((_arg1.dx)<0) ? 0 : Game.scale;
ty = ((_arg1.dy)<0) ? 0 : Game.scale;
= 0;
i = 0;
while (i < iterations) {
if (((!((_arg1.dx == 0))) && (!((_arg1.dy == 0))))){
next_x = Math.abs(((px - tx) * DX));
next_y = Math.abs(((py - ty) * DY));
if (next_x < next_y){
next = next_x;
map_x = (map_x + dir_x);
= (
+ next_x);
if ((((((((((((
> _arg1.len)) && ((report == null)))) || ((map_x < 0)))) || ((map_y < 0)))) || ((map_x >= _arg2[0].length)))) || ((map_y >= _arg2.length)))){
return (null);
};
px = (px + (_arg1.dx * next_x));
py = (py + (_arg1.dy * next_x));
px = (px - (dir_x * Game.scale));
} else {
next = next_y;
map_y = (map_y + dir_y);
= (
+ next_y);
if ((((((((((((
> _arg1.len)) && ((report == null)))) || ((map_x < 0)))) || ((map_y < 0)))) || ((map_x >= _arg2[0].length)))) || ((map_y >= _arg2.length)))){
return (null);
};
px = (px + (_arg1.dx * next_y));
py = (py + (_arg1.dy * next_y));
py = (py - (dir_y * Game.scale));
};
stack_map_value = g.stack_map[map_y][map_x];
if (((!(
)) && ((stack_map_value > Game.EMPTY)))){
block = ((_arg2[map_y][map_x] is Clip)) ? _arg2[map_y][map_x].b : new Block((map_x * Game.scale), (map_y * Game.scale), Game.scale, Game.scale);
report = new RayCastReport(block, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py));
if (((!((stack_map_value & Rect.TEMP))) && (_arg3))){
report.access_side = block.sideOf(report.ax, report.ay);
return (report);
};
= true;
} else {
if (
){
report.
= ((map_x * Game.scale) + px);
report.
= ((map_y * Game.scale) + py);
if ((g.stack_map[report.map_y][report.map_x] & Rect.TEMP)){
block = report.block;
if (!moving_found){
if (block.y == (report.map_y * Game.scale)){
if ((((report.ax >= block.x)) && ((report.ax < (block.x + block.width))))){
ax = report.ax;
ay = report.ay;
moving_found = true;
if ((
- next) > _arg1.len){
return (null);
};
} else {
if ((((report.
>= block.x)) && ((report.
< (block.x + block.width))))){
if (_arg1.dx < 0){
dist_to_block_edge = (report.ax - (block.x + block.width));
new_next = Math.abs((dist_to_block_edge * DX));
if (((-(next) +
) + new_next) > _arg1.len){
return (null);
};
ax = ((block.x + block.width) - 1);
ay = (report.ay + (new_next * _arg1.dy));
} else {
dist_to_block_edge = (block.x - report.ax);
new_next = Math.abs((dist_to_block_edge * DX));
if (((-(next) +
) + new_next) > _arg1.len){
return (null);
};
ax = block.x;
ay = (report.ay + (new_next * _arg1.dy));
};
moving_found = true;
};
};
} else {
if ((((report.ay >= block.y)) && ((report.ay < (block.y + block.height))))){
ax = report.ax;
ay = report.ay;
moving_found = true;
if ((
- next) > _arg1.len){
return (null);
};
} else {
if ((((report.
>= block.y)) && ((report.
< (block.y + block.height))))){
if (_arg1.dy < 0){
dist_to_block_edge = (report.ay - (block.y + block.height));
new_next = Math.abs((dist_to_block_edge * DY));
if (((-(next) +
) + new_next) > _arg1.len){
return (null);
};
ax = (report.ax + (new_next * _arg1.dx));
ay = ((block.y + block.height) - 1);
} else {
dist_to_block_edge = (block.y - report.ay);
new_next = Math.abs((dist_to_block_edge * DY));
if (((-(next) +
) + new_next) > _arg1.len){
return (null);
};
ax = (report.ax + (new_next * _arg1.dx));
ay = block.y;
};
moving_found = true;
};
};
};
if (moving_found){
if (_arg3){
report.ax = ax;
report.ay = ay;
report.access_side = report.block.sideOf(report.ax, report.ay);
return (report);
};
} else {
if (stack_map_value > Game.EMPTY){
block = ((_arg2[map_y][map_x] is Clip)) ? _arg2[map_y][map_x].b : new Block((map_x * Game.scale), (map_y * Game.scale), Game.scale, Game.scale);
report = new RayCastReport(block, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py));
if (((!((stack_map_value == Rect.TEMP))) && (_arg3))){
report.access_side = block.sideOf(report.ax, report.ay);
return (report);
};
} else {
report = null;
= false;
};
};
};
if (((moving_found) && ((((((stack_map_value == Game.EMPTY)) || (!((stack_map_value & Rect.TEMP))))) || (!((g.block_map[map_y][map_x].b == report.block))))))){
if (block.y == (report.map_y * Game.scale)){
if ((((report.
>= block.x)) && ((report.
< (block.x + block.width))))){
= report.
;
= report.
;
if (
> _arg1.len){
return (null);
};
} else {
if (_arg1.dx < 0){
dist_to_block_edge = (report.ax - block.x);
new_next = Math.abs((dist_to_block_edge * DX));
= block.x;
= (report.ay + (new_next * _arg1.dy));
if (
< _arg1.b.x){
return (null);
};
} else {
dist_to_block_edge = ((block.x + block.width) - report.ax);
new_next = Math.abs((dist_to_block_edge * DX));
= (block.x + block.width);
= (report.ay + (new_next * _arg1.dy));
if (
> _arg1.b.x){
return (null);
};
};
};
} else {
if ((((report.
>= block.y)) && ((report.
< (block.y + block.height))))){
= report.
;
= report.
;
if (
> _arg1.len){
return (null);
};
} else {
if (_arg1.dy < 0){
dist_to_block_edge = (report.ay - block.y);
new_next = Math.abs((dist_to_block_edge * DY));
= (report.ax + (new_next * _arg1.dx));
= block.y;
if (
< _arg1.b.y){
return (null);
};
} else {
dist_to_block_edge = ((block.y + block.height) - report.ay);
new_next = Math.abs((dist_to_block_edge * DY));
= (report.ax + (new_next * _arg1.dx));
= (block.y + block.height);
if (
> _arg1.b.x){
return (null);
};
};
};
};
report.ax = ax;
report.ay = ay;
report.
=
;
report.
=
;
report.access_side = report.block.sideOf(report.ax, report.ay);
report.exit_side = report.block.sideOf(report.
, report.
);
return (report);
};
} else {
if (
> _arg1.len){
return (null);
};
report.access_side = report.block.sideOf(report.ax, report.ay);
report.exit_side = report.block.sideOf(report.
, report.
);
return (report);
};
};
};
} else {
if (_arg1.dy == 0){
next_x = Math.abs(((px - tx) * DX));
map_x = (map_x + dir_x);
= (
+ next_x);
if ((((((((((((
> _arg1.len)) && ((report == null)))) || ((map_x < 0)))) || ((map_y < 0)))) || ((map_x >= _arg2[0].length)))) || ((map_y >= _arg2.length)))){
return (null);
};
px = (px + (_arg1.dx * next_x));
px = (px - (dir_x * Game.scale));
stack_map_value = g.stack_map[map_y][map_x];
if (((!(
)) && ((stack_map_value > Game.EMPTY)))){
block = ((_arg2[map_y][map_x] is Clip)) ? _arg2[map_y][map_x].b : new Block((map_x * Game.scale), (map_y * Game.scale), Game.scale, Game.scale);
report = new RayCastReport(block, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py));
if (((!((stack_map_value & Rect.TEMP))) && (_arg3))){
report.access_side = block.sideOf(report.ax, report.ay);
return (report);
};
= true;
} else {
if (
){
report.
= ((map_x * Game.scale) + px);
report.
= ((map_y * Game.scale) + py);
if ((g.stack_map[report.map_y][report.map_x] & Rect.TEMP)){
block = report.block;
if (!moving_found){
if (block.y == (report.map_y * Game.scale)){
if ((((report.ax >= block.x)) && ((report.ax < (block.x + block.width))))){
ax = report.ax;
ay = report.ay;
moving_found = true;
if ((
- next) > _arg1.len){
return (null);
};
} else {
if ((((report.
>= block.x)) && ((report.
< (block.x + block.width))))){
if (_arg1.dx < 0){
ax = ((block.x + block.width) - 1);
ay = report.ay;
} else {
ax = block.x;
ay = report.ay;
};
moving_found = true;
};
};
} else {
if ((((report.ay >= block.y)) && ((report.ay < (block.y + block.height))))){
ax = report.ax;
ay = report.ay;
moving_found = true;
if ((
- next) > _arg1.len){
return (null);
};
};
};
if (moving_found){
if (_arg3){
report.ax = ax;
report.ay = ay;
report.access_side = report.block.sideOf(report.ax, report.ay);
return (report);
};
} else {
if (stack_map_value > Game.EMPTY){
block = ((_arg2[map_y][map_x] is Clip)) ? _arg2[map_y][map_x].b : new Block((map_x * Game.scale), (map_y * Game.scale), Game.scale, Game.scale);
report = new RayCastReport(block, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py));
if (((!((stack_map_value == Rect.TEMP))) && (_arg3))){
report.access_side = block.sideOf(report.ax, report.ay);
return (report);
};
} else {
report = null;
= false;
};
};
};
if (((moving_found) && ((((stack_map_value == Game.EMPTY)) || (!((g.block_map[map_y][map_x].b == report.block))))))){
if (block.y == (report.map_y * Game.scale)){
if ((((report.
>= block.x)) && ((report.
< (block.x + block.width))))){
= report.
;
= report.
;
if (
> _arg1.len){
return (null);
};
} else {
if (_arg1.dx < 0){
= block.x;
= report.ay;
if (
< _arg1.b.x){
return (null);
};
} else {
= (block.x + block.width);
= report.ay;
if (
> _arg1.b.x){
return (null);
};
};
};
} else {
if ((((report.
>= block.y)) && ((report.
< (block.y + block.height))))){
= report.
;
= report.
;
};
};
report.ax = ax;
report.ay = ay;
report.
=
;
report.
=
;
report.access_side = report.block.sideOf(report.ax, report.ay);
report.exit_side = report.block.sideOf(report.
, report.
);
return (report);
};
} else {
if (
> _arg1.len){
return (null);
};
report.access_side = report.block.sideOf(report.ax, report.ay);
report.exit_side = report.block.sideOf(report.
, report.
);
return (report);
};
};
};
} else {
if (_arg1.dx == 0){
next_y = Math.abs(((py - ty) * DY));
map_y = (map_y + dir_y);
= (
+ next_y);
if ((((((((((((
> _arg1.len)) && ((report == null)))) || ((map_x < 0)))) || ((map_y < 0)))) || ((map_x >= _arg2[0].length)))) || ((map_y >= _arg2.length)))){
return (null);
};
py = (py + (_arg1.dy * next_y));
py = (py - (dir_y * Game.scale));
stack_map_value = g.stack_map[map_y][map_x];
if (((!(
)) && ((stack_map_value > Game.EMPTY)))){
block = ((_arg2[map_y][map_x] is Clip)) ? _arg2[map_y][map_x].b : new Block((map_x * Game.scale), (map_y * Game.scale), Game.scale, Game.scale);
report = new RayCastReport(block, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py));
if (((!((stack_map_value & Rect.TEMP))) && (_arg3))){
report.access_side = block.sideOf(report.ax, report.ay);
return (report);
};
= true;
} else {
if (
){
report.
= ((map_x * Game.scale) + px);
report.
= ((map_y * Game.scale) + py);
if (g.stack_map[report.map_y][report.map_x] == Rect.TEMP){
block = report.block;
if (!moving_found){
if (block.y == (report.map_y * Game.scale)){
if ((((report.ax >= block.x)) && ((report.ax < (block.x + block.width))))){
ax = report.ax;
ay = report.ay;
moving_found = true;
if ((
- next) > _arg1.len){
return (null);
};
};
} else {
if ((((report.ay >= block.y)) && ((report.ay < (block.y + block.height))))){
ax = report.ax;
ay = report.ay;
moving_found = true;
if ((
- next) > _arg1.len){
return (null);
};
} else {
if ((((report.
>= block.y)) && ((report.
< (block.y + block.height))))){
if (_arg1.dy < 0){
ax = report.ax;
ay = ((block.y + block.height) - 1);
if (
< _arg1.b.y){
return (null);
};
} else {
ax = report.ax;
ay = block.y;
if (
> _arg1.b.y){
return (null);
};
};
moving_found = true;
};
};
};
if (moving_found){
if (_arg3){
report.ax = ax;
report.ay = ay;
report.access_side = report.block.sideOf(report.ax, report.ay);
return (report);
};
} else {
if (stack_map_value > Game.EMPTY){
block = ((_arg2[map_y][map_x] is Clip)) ? _arg2[map_y][map_x].b : new Block((map_x * Game.scale), (map_y * Game.scale), Game.scale, Game.scale);
report = new RayCastReport(block, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py));
if (((!((stack_map_value == Rect.TEMP))) && (_arg3))){
report.access_side = block.sideOf(report.ax, report.ay);
return (report);
};
} else {
report = null;
= false;
};
};
};
if (((moving_found) && ((((stack_map_value == Game.EMPTY)) || (!((g.block_map[map_y][map_x].b == report.block))))))){
if (block.y == (report.map_y * Game.scale)){
if ((((report.
>= block.x)) && ((report.
< (block.x + block.width))))){
= report.
;
= report.
;
if (
> _arg1.len){
return (null);
};
};
} else {
if ((((report.
>= block.y)) && ((report.
< (block.y + block.height))))){
= report.
;
= report.
;
if (
> _arg1.len){
return (null);
};
} else {
if (_arg1.dy < 0){
= report.ax;
= block.y;
if (
< _arg1.b.y){
return (null);
};
} else {
= report.ax;
= (block.y + block.height);
if (
> _arg1.b.y){
return (null);
};
};
};
};
report.ax = ax;
report.ay = ay;
report.
=
;
report.
=
;
report.access_side = report.block.sideOf(report.ax, report.ay);
report.exit_side = report.block.sideOf(report.
, report.
);
return (report);
};
} else {
if (
> _arg1.len){
return (null);
};
report.access_side = report.block.sideOf(report.ax, report.ay);
report.exit_side = report.block.sideOf(report.
, report.
);
return (report);
};
};
};
};
};
};
i++;
};
return (null);
}
public static function initCast(_arg1:Line, _arg2:Array):RayCastReport{
map_x = ((_arg1.a.x * Game.SCALE) >> 0);
map_y = ((_arg1.a.y * Game.SCALE) >> 0);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
return (new RayCastReport(null, map_x, map_y, _arg1.a.x, _arg1.a.y));
};
if (_arg1.dx != 0){
DX = (1 / _arg1.dx);
} else {
DX = 0;
};
if (_arg1.dy != 0){
DY = (1 / _arg1.dy);
} else {
DY = 0;
};
dir_x = ((_arg1.dx < 0)) ? -1 : 1;
dir_y = ((_arg1.dy < 0)) ? -1 : 1;
px = (_arg1.a.x - (map_x * Game.scale));
py = (_arg1.a.y - (map_y * Game.scale));
tx = ((_arg1.dx)<0) ? 0 : Game.scale;
ty = ((_arg1.dy)<0) ? 0 : Game.scale;
= 0;
i = 0;
while (i < 1000) {
next_x = Math.abs(((px - tx) * DX));
next_y = Math.abs(((py - ty) * DY));
if ((((next_x < next_y)) || ((next_y == 0)))){
map_x = (map_x + dir_x);
= (
+ next_x);
stack_map_value = g.stack_map[map_y][map_x];
if ((((((((((
> _arg1.len)) || ((map_x < 0)))) || ((map_y < 0)))) || ((map_x >= _arg2[0].length)))) || ((map_y >= _arg2.length)))){
return (new RayCastReport(null, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py)));
};
px = (px + (_arg1.dx * next_x));
py = (py + (_arg1.dy * next_x));
px = (px - (dir_x * Game.scale));
if ((((stack_map_value > Game.EMPTY)) && (!((stack_map_value == Rect.TEMP))))){
return (new RayCastReport(null, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py)));
};
} else {
map_y = (map_y + dir_y);
= (
+ next_y);
stack_map_value = g.stack_map[map_y][map_x];
if ((((((((((
> _arg1.len)) || ((map_x < 0)))) || ((map_y < 0)))) || ((map_x >= _arg2[0].length)))) || ((map_y >= _arg2.length)))){
return (new RayCastReport(null, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py)));
};
px = (px + (_arg1.dx * next_y));
py = (py + (_arg1.dy * next_y));
py = (py - (dir_y * Game.scale));
if ((((stack_map_value > Game.EMPTY)) && (!((stack_map_value == Rect.TEMP))))){
return (new RayCastReport(null, map_x, map_y, ((map_x * Game.scale) + px), ((map_y * Game.scale) + py)));
};
};
i++;
};
return (null);
}
}
}//package com.nitrome.engine_specific
Section 55
//RayCastReport (com.nitrome.engine_specific.RayCastReport)
package com.nitrome.engine_specific {
import flash.display.*;
public class RayCastReport {
public var
:Boolean;
public var block:Block;
public var access_side:int;// = 0
public var
:Number;
public var
:Number;
public var map_x:int;// = -1
public var map_y:int;// = -1
public var ax:Number;
public var ay:Number;
public var exit_side:int;// = 0
public function RayCastReport(_arg1:Block=null, _arg2:int=0, _arg3:int=0, _arg4:Number=0, _arg5:Number=0){
map_x = -1;
map_y = -1;
access_side = 0;
exit_side = 0;
super();
this.block = _arg1;
this.map_x = _arg2;
this.map_y = _arg3;
this.ax = _arg4;
this.ay = _arg5;
}
public function draw(_arg1:Graphics):void{
_arg1.lineStyle(2, 0xFF0000);
_arg1.moveTo(ax, ay);
_arg1.lineTo(
,
);
}
}
}//package com.nitrome.engine_specific
Section 56
//Rope (com.nitrome.engine_specific.Rope)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class Rope extends Spring {
public var unwrap_y:Number;
public var unwrap_x:Number;
public var block:Block;
public var from:int;// = 0
public var
:int;
public static const DOWN_LEFT:int = 4;
public static const UP_RIGHT:int = 2;
public static const UP_LEFT:int = 1;
public static const DOWN_RIGHT:int = 8;
public function Rope(_arg1:Dot, _arg2:Dot){
from = 0;
super(_arg1, _arg2);
}
}
}//package com.nitrome.engine_specific
Section 57
//RopeAnchor (com.nitrome.engine_specific.RopeAnchor)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class RopeAnchor extends Star {
public const SPEED:Number = 32;
public var locked:Boolean;
public var block:Block;
public var :Boolean;
public var rope:Rope;
public var surface_x:Number;
public var surface_y:Number;
public function RopeAnchor(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Sprite, _arg6:Game){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
locked = false;
= true;
= true;
rope = new Rope(this, _arg6.player);
}
override public function pin():void{
x = (px = ix);
y = (px = iy);
}
override public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
}
public function convertToStar():void{
var _local1:Star;
if (!locked){
_local1 = g.player.addStar(x, y, dx, dy);
mc.parent.removeChild(mc);
} else {
g.player.stars.push(mc);
};
active = false;
g.player.anchor = null;
}
override protected function anchor(_arg1:Block, _arg2:Sprite=null):void{
var _local3:Number;
var _local4:Number;
var _local5:Rect;
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:int;
this.block = _arg1;
_local3 = (x - px);
_local4 = (y - py);
dx = (dy = 0);
_local5 = new Rect(0, 0, 0, 0);
_local5.x = Math.min(x, px);
_local5.y = Math.min(y, py);
_local5.width = Math.abs((x - px));
_local5.height = Math.abs((y - py));
_local6 = _local5.intersection(_arg1);
_local7 = 0;
_local8 = 0;
if (_local3 != 0){
_local7 = (Math.min(Math.abs(_local3), _local6.width) * ((_local3 > 0)) ? 1 : -1);
};
if (_local4 != 0){
_local8 = (Math.min(Math.abs(_local4), _local6.height) * ((_local4 > 0)) ? 1 : -1);
};
x = (x - _local7);
y = (y - _local8);
_local9 = _arg1.sideOf(x, y);
if ((_arg1.stacked & _local9)){
if ((((_local9 == Rect.UP)) || ((_local9 == Rect.DOWN)))){
if (x < (_arg1.x + (_arg1.width * 0.5))){
x = (_arg1.x - 1);
_local9 = Rect.LEFT;
if ((_arg1.stacked & Rect.LEFT)){
if (y < (_arg1.y + (_arg1.height * 0.5))){
y = (_arg1.y - 1);
_local9 = Rect.UP;
} else {
y = (_arg1.y + _arg1.height);
_local9 = Rect.DOWN;
};
};
} else {
x = (_arg1.x + _arg1.width);
_local9 = Rect.RIGHT;
if ((_arg1.stacked & Rect.RIGHT)){
if (y < (_arg1.y + (_arg1.height * 0.5))){
y = (_arg1.y - 1);
_local9 = Rect.UP;
} else {
y = (_arg1.y + _arg1.height);
_local9 = Rect.DOWN;
};
};
};
} else {
if ((((_local9 == Rect.RIGHT)) || ((_local9 == Rect.LEFT)))){
if (y < (_arg1.y + (_arg1.height * 0.5))){
y = (_arg1.y - 1);
_local9 = Rect.UP;
if ((_arg1.stacked & Rect.UP)){
if (x < (_arg1.x + (_arg1.width * 0.5))){
x = (_arg1.x - 1);
_local9 = Rect.LEFT;
} else {
x = (_arg1.x + _arg1.width);
_local9 = Rect.RIGHT;
};
};
} else {
y = (_arg1.y + _arg1.height);
_local9 = Rect.DOWN;
if ((_arg1.stacked & Rect.DOWN)){
if (x < (_arg1.x + (_arg1.width * 0.5))){
x = (_arg1.x - 1);
_local9 = Rect.LEFT;
} else {
x = (_arg1.x + _arg1.width);
_local9 = Rect.RIGHT;
};
};
};
};
};
} else {
if (_local9 == Rect.LEFT){
x = (_arg1.x - 1);
} else {
if (_local9 == Rect.UP){
y = (_arg1.y - 1);
};
};
};
surface_x = (x - _arg1.x);
surface_y = (y - _arg1.y);
pinTo(x, y);
rope.updateLine();
if (!_arg1.attachable){
kill();
g.player.hit();
return;
};
if (((_arg1.force_field) || (_arg1.cutting))){
ping(-(_local3));
return;
};
if (((g.mouse_pressed) && ((RayCast.cast(rope, g.block_map) == null)))){
locked = true;
g.player.createRope();
} else {
kill();
return;
};
_local10 = (mc as LiveStar).star.currentFrame;
mc.parent.removeChild(mc);
mc = new DeadStar();
(mc as DeadStar).init(_local10);
if (_arg2 == null){
g.dead_star_holder.addChild(mc);
updateMC();
} else {
mc.x = (x - _arg1.x);
mc.y = (y - _arg1.y);
_arg2.addChildAt(mc, 0);
};
}
override public function main():void{
if (((active) && (!(locked)))){
move();
if (!g.scroller.contains(x, y)){
kill();
return;
};
encounterCollision();
if (!active){
return;
};
blockCollision();
if (!locked){
updateMC();
};
rope.updateLine();
if (((((!(locked)) && ((rope.len > 0)))) && (!((RayCast.cast(rope, g.block_map) == null))))){
convertToStar();
return;
};
};
if (((((locked) && (!((block == null))))) && (block.moving_block))){
x = (ix = (block.x + surface_x));
y = (iy = (block.y + surface_y));
};
}
override public function kill():void{
(mc as DeadStar).kill();
active = false;
g.player.anchor = null;
}
public function pinTo(_arg1:Number, _arg2:Number):void{
this.x = (ix = (px = (temp_x = _arg1)));
this.y = (iy = (py = (temp_y = _arg2)));
locked = true;
}
}
}//package com.nitrome.engine_specific
Section 58
//RopeJoint (com.nitrome.engine_specific.RopeJoint)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class RopeJoint extends Dot {
public var px:Number;
public var py:Number;
public var block:Block;
public var surface_x:Number;
public var g:Game;
public var surface_y:Number;
public function RopeJoint(_arg1:Number, _arg2:Number, _arg3:Block, _arg4:Game){
super(_arg1, _arg2);
px = _arg1;
py = _arg2;
this.g = _arg4;
this.block = _arg3;
surface_x = ((_arg1 - _arg3.x) >> 0);
surface_y = ((_arg2 - _arg3.y) >> 0);
}
public function main():void{
if (((!((block == null))) && (block.moving_block))){
px = x;
py = y;
x = (ix = (block.x + surface_x));
y = (iy = (block.y + surface_y));
};
}
}
}//package com.nitrome.engine_specific
Section 59
//RotoGun (com.nitrome.engine_specific.RotoGun)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.geom.*;
public class RotoGun extends Encounter {
public var angle:int;
public var health_fraction:Number;// = 0.333
public var dir:int;
public var state:int;
public var r:int;
public var :Boolean;// = false
public var bullet_list:Array;
public var firing_count:int;
public var collision_rect:Rect;
public var health:int;// = 3
public var fast:Boolean;
public static const FIRING_CHARGE_DELAY:int = 6;
public static const TURNING:int = 2;
public static const TURN_SPEED:Number = 5;
public static const FIRING:int = 4;
public static const GRENADE_SPEED:int = 8;
public static const FIRING_DELAY:int = 11;
public static const BULLET_SPEED:int = 16;
public static var point:Point = new Point();
public function RotoGun(_arg1:int, _arg2:int, _arg3:Sprite, _arg4:Game, _arg5:Boolean=false, _arg6:Boolean=false){
health = 3;
health_fraction = 0.333;
= false;
super(_arg3, _arg4, false);
this.dir = _arg2;
this.id_tag = _arg1;
this. = _arg6;
this.fast = _arg5;
has_main = true;
if (_arg1 == 0){
angle = -90;
} else {
if (_arg1 == 1){
angle = ((_arg2 == Rect.RIGHT)) ? -45 : -135;
} else {
if (_arg1 == 2){
angle = ((_arg2 == Rect.RIGHT)) ? 0 : 180;
} else {
if (_arg1 == 3){
angle = ((_arg2 == Rect.RIGHT)) ? 45 : 135;
} else {
if (_arg1 == 4){
angle = ((_arg2 == Rect.RIGHT)) ? 90 : 90;
} else {
if (_arg1 == 5){
angle = ((_arg2 == Rect.RIGHT)) ? 135 : 45;
} else {
if (_arg1 == 6){
angle = ((_arg2 == Rect.RIGHT)) ? 180 : 0;
} else {
if (_arg1 == 7){
angle = ((_arg2 == Rect.RIGHT)) ? -135 : -45;
};
};
};
};
};
};
};
};
_arg3.rotation = angle;
state = FIRING;
firing_count = 0;
collision_rect = new Rect((x - 16), (y - 16), 32, 32);
reward = new HiddenInt(20);
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function main():void{
if (state == TURNING){
if ((((Math.abs((angle - mc.rotation)) <= TURN_SPEED)) || ((Math.abs((angle - mc.rotation)) == (360 - TURN_SPEED))))){
mc.rotation = angle;
state = FIRING;
} else {
r = mc.rotation;
r = (r + ((Math.abs((angle - r)))>180) ? ((r)<angle) ? 360 : -(360) : 0);
r = (r + (((angle - r) > 0)) ? TURN_SPEED : -(TURN_SPEED));
mc.rotation = r;
};
} else {
if (state == FIRING){
fire();
};
};
}
public function fire():void{
if (firing_count == 0){
r = ((mc.rotation + 360) % 360);
if (fast){
bullet_list = [new Bullet((x + (Trig.cos[r] * 50)), (y + (Trig.sin[r] * 50)), Trig.cos[r], Trig.sin[r], BULLET_SPEED, g.bullet_bitmap, g), new Bullet((x + (58 * Trig.cos[r])), (y + (58 * Trig.sin[r])), Trig.cos[r], Trig.sin[r], BULLET_SPEED, g.bullet_bitmap, g), new Bullet((x + (66 * Trig.cos[r])), (y + (66 * Trig.sin[r])), Trig.cos[r], Trig.sin[r], BULLET_SPEED, g.bullet_bitmap, g), new Bullet((x + (74 * Trig.cos[r])), (y + (74 * Trig.sin[r])), Trig.cos[r], Trig.sin[r], BULLET_SPEED, g.bullet_bitmap, g)];
g.addBulletGroup(bullet_list);
(mc as MovieClip).gun.gotoAndStop("fire_bullet");
NitromeGame.sound_manager.playSound("machinegun");
point = Util.localToLocal(point, (mc as MovieClip).gun.cartridges, g.canvas);
g.addDebrisDir(point.x, point.y, Trig.sin[r], -(Trig.cos[r]), g.cartridge_bitmap, g.cartridge_bitmap, g.cartridge_bitmap, g.cartridge_bitmap);
} else {
g.addBullet((x + (Trig.cos[r] * 50)), (y + (Trig.sin[r] * 50)), Trig.cos[r], Trig.sin[r], GRENADE_SPEED, g.grenade_bitmap);
(mc as MovieClip).gun.gotoAndStop("fire_grenade");
NitromeGame.sound_manager.playSound("grenade");
point = Util.localToLocal(point, (mc as MovieClip).gun.cartridges, g.canvas);
g.addDebrisDir(point.x, point.y, Trig.sin[r], -(Trig.cos[r]), g.grenade_cartridge_bitmap);
};
};
if (++firing_count >= FIRING_DELAY){
state = TURNING;
firing_count = 0;
id_tag++;
if (id_tag > 7){
id_tag = (id_tag - 8);
};
if (id_tag == 0){
angle = -90;
} else {
if (id_tag == 1){
angle = ((dir == Rect.RIGHT)) ? -45 : -135;
} else {
if (id_tag == 2){
angle = ((dir == Rect.RIGHT)) ? 0 : 180;
} else {
if (id_tag == 3){
angle = ((dir == Rect.RIGHT)) ? 45 : 135;
} else {
if (id_tag == 4){
angle = ((dir == Rect.RIGHT)) ? 90 : 90;
} else {
if (id_tag == 5){
angle = ((dir == Rect.RIGHT)) ? 135 : 45;
} else {
if (id_tag == 6){
angle = ((dir == Rect.RIGHT)) ? 180 : 0;
} else {
if (id_tag == 7){
angle = ((dir == Rect.RIGHT)) ? -135 : -45;
};
};
};
};
};
};
};
};
(mc as MovieClip).gun.gotoAndStop("idle");
};
}
public function kill(_arg1:Number):void{
if (!active){
return;
};
active = false;
if (!spawned){
NitromeGame.bonus.enemy_count.value++;
};
g.addFX(mc.x, mc.y, g.bang_bitmap2);
g.addSmoke(mc.x, mc.y);
g.addSmoke(mc.x, mc.y);
g.shake(3);
g.addDebris((collision_rect.x + (collision_rect.width * 0.5)), (collision_rect.y + (collision_rect.height * 0.5)), ((_arg1 > 0)) ? 10 : -10, g.debris_clips[5]);
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:int;
if (!active){
return;
};
if (((_arg2) || (!()))){
health--;
_local3 = new HitSparkMC();
_local3.x = (_arg1.x >> 0);
_local3.y = (_arg1.y >> 0);
_local4 = collision_rect.sideOf(_arg1.x, _arg1.y);
if (_local4 == Rect.UP){
} else {
if (_local4 == Rect.RIGHT){
_local3.rotation = 90;
} else {
if (_local4 == Rect.DOWN){
_local3.rotation = 180;
} else {
if (_local4 == Rect.LEFT){
_local3.rotation = 270;
};
};
};
};
g.effect_holder.addChild(_local3);
if ((((health <= 0)) || (_arg2))){
g.addScore(reward.value);
kill((_arg1.x - _arg1.px));
};
} else {
_arg1.ping((_arg1.px - _arg1.x));
};
}
override public function unpause():void{
(mc as MovieClip).gun.gotoAndStop("idle");
}
}
}//package com.nitrome.engine_specific
Section 60
//Scientist (com.nitrome.engine_specific.Scientist)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Scientist extends Encounter {
public var py:Number;
public var paused:Boolean;
public var cast:RayCastReport;
public var :int;
public var a:Dot;
public var health:int;// = 0
public var platform:Boolean;
public var
:int;
public var alert_count:int;
public var scan:Line;
public var health_fraction:Number;// = 0
public var pause_count:int;// = 0
public var controlled:Boolean;
public var state:int;
public var dir:int;
public var grid_x:int;
public var grid_y:int;
public var stop_dir:int;
public var collision_rect:Rect;
public var temp_y:Number;
private static const DAMPING_Y:Number = 0.99;
public static const RIGHT:int = 2;
public static const RECOVER:int = 16;
public static const RIGHT_ID:String = "418";
private static const width:int = 20;
public static const LEFT:int = 8;
private static const height:int = 44;
private static const GRAVITY_Y:Number = 1.3;
public static const LEFT_ID:String = "417";
private static const FLOOR_DEPTH:int = 6;
public static const UP:int = 1;
public static const STUN_DELAY:int = 100;
public static const RUNNING:int = 1;
public static const ALERT_DELAY:int = 50;
public static const SPEED:Number = 2;
public static const RECOVER_DELAY:int = 22;
public static const DOWN:int = 4;
public static const STOPPED:int = 0;
public static const FALLING:int = 2;
public static const STUNNED:int = 8;
public static const ALERT:int = 4;
public static const TEST_DEPTH:int = 5;
public function Scientist(_arg1:int, _arg2:Sprite, _arg3:Game){
health = 0;
health_fraction = 0;
pause_count = 0;
super(_arg2, _arg3, true);
has_main = true;
has_collision = true;
this.dir = _arg1;
collision_rect = new Rect((x - (width >> 1)), (y - (height >> 1)), 26, 42);
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
py = y;
if (_arg3.stack_map[(map_y + 1)][map_x] > Game.EMPTY){
platform = true;
state = RUNNING;
} else {
platform = false;
state = FALLING;
};
a = new Dot((_arg2.x + 0.5), (_arg2.y + 0.5));
reward = new HiddenInt(40);
controlled = ((!((_arg3.path_map[map_y][map_x] == 0))) || (!((((_arg3.path_map[map_y][map_x] >= 0)) || ((_arg3.path_map[map_y][map_x] <= 0))))));
if (controlled){
paused = false;
pause_count = 0;
selectPatrolPath();
};
actor_target = false;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
if (!(((state == RUNNING)) || ((state == ALERT)))){
return (false);
};
return (collision_rect.contains(_arg1, _arg2));
}
override public function intersects(_arg1:Rect):Boolean{
if (((((!(g.player.chameleon)) && (g.player.chameleon_pickup))) && ((g.player.state == Player.STEALTH)))){
if (collision_rect.intersects(_arg1)){
g.player.enterChameleonMode();
return (false);
};
};
if (((((((!(on_scroller)) || ((g.player.state == Player.STEALTH)))) || (g.player.chameleon))) || (!((state == RUNNING))))){
return (false);
};
if (((((!((scan == null))) && ((cast == null)))) && ((((((((dir == LEFT)) && ((g.player.x < x)))) || ((((dir == RIGHT)) && ((g.player.x > x)))))) || ((((dir == STOPPED)) && ((((((stop_dir == LEFT)) && ((g.player.x < x)))) || ((((stop_dir == RIGHT)) && ((g.player.x > x)))))))))))){
return (RayCast.reportIntersectsRect(scan, cast, g.player.collision_rect));
};
return (false);
}
public function updateAnimState():void{
if (state == RUNNING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "run_right"){
(mc as MovieClip).gotoAndStop("run_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "run_left"){
(mc as MovieClip).gotoAndStop("run_left");
};
} else {
if (dir == STOPPED){
if (stop_dir == RIGHT){
if ((mc as MovieClip).currentLabel != "stop_right"){
(mc as MovieClip).gotoAndStop("stop_right");
};
} else {
if (stop_dir == LEFT){
if ((mc as MovieClip).currentLabel != "stop_left"){
(mc as MovieClip).gotoAndStop("stop_left");
};
};
};
};
};
};
} else {
if (state == FALLING){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "fall_right"){
(mc as MovieClip).gotoAndStop("fall_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "fall_left"){
(mc as MovieClip).gotoAndStop("fall_left");
};
};
};
} else {
if (state == STUNNED){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "stunned_right"){
(mc as MovieClip).gotoAndStop("stunned_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "stunned_left"){
(mc as MovieClip).gotoAndStop("stunned_left");
};
} else {
if (dir == STOPPED){
if (stop_dir == RIGHT){
if ((mc as MovieClip).currentLabel != "stunned_right"){
(mc as MovieClip).gotoAndStop("stunned_right");
};
} else {
if (stop_dir == LEFT){
if ((mc as MovieClip).currentLabel != "stunned_left"){
(mc as MovieClip).gotoAndStop("stunned_left");
};
};
};
};
};
};
} else {
if (state == RECOVER){
if (dir == RIGHT){
if ((mc as MovieClip).currentLabel != "recover_right"){
(mc as MovieClip).gotoAndStop("recover_right");
};
} else {
if (dir == LEFT){
if ((mc as MovieClip).currentLabel != "recover_left"){
(mc as MovieClip).gotoAndStop("recover_left");
};
} else {
if (dir == STOPPED){
if (stop_dir == RIGHT){
if ((mc as MovieClip).currentLabel != "recover_right"){
(mc as MovieClip).gotoAndStop("recover_right");
};
} else {
if (stop_dir == LEFT){
if ((mc as MovieClip).currentLabel != "recover_left"){
(mc as MovieClip).gotoAndStop("recover_left");
};
};
};
};
};
};
} else {
if (state == ALERT){
if ((mc as MovieClip).currentLabel != "alert"){
(mc as MovieClip).gotoAndStop("alert");
};
};
};
};
};
};
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
}
override public function alert():void{
if (!(((state == RUNNING)) || ((state == STOPPED)))){
return;
};
state = ALERT;
alert_count = ALERT_DELAY;
}
public function kill(_arg1:Number):void{
if (!active){
return;
};
active = false;
NitromeGame.bonus.buddha.value = 0;
g.addFX(mc.x, mc.y, g.bang_bitmap1);
if (Math.random() > 0.5){
g.addSmoke(mc.x, mc.y);
};
}
public function selectPatrolPath():void{
if (pause_count == -1){
return;
};
if ((((dir == Path.STOPPED)) && ((pause_count > 0)))){
pause_count--;
return;
};
stop_dir = dir;
Path.getDir(dir, g.path_map, null, map_x, map_y);
dir = Path.dir;
pause_count = (paused) ? 0 : Path.pause_delay;
if (pause_count > 0){
dir = Path.STOPPED;
paused = true;
return;
};
paused = false;
}
public function main():void{
on_scroller = g.scroller.contains(x, y);
if (((!(forced)) && (!(on_scroller)))){
if (dir == LEFT){
tile_id = "103";
} else {
if (dir == RIGHT){
tile_id = "104";
};
};
remove();
return;
};
if (state == RUNNING){
if (scan == null){
if (g.player != null){
scan = new Line(a, g.player);
if (on_scroller){
cast = RayCast.cast(scan, g.block_map, true);
};
};
} else {
scan.updateLine();
if (on_scroller){
cast = RayCast.cast(scan, g.block_map, true);
};
};
move();
if (controlled){
if ((((dir == RIGHT)) || ((dir == LEFT)))){
if (((x - 32) * Game.SCALE) == map_x){
selectPatrolPath();
};
} else {
if (dir == Path.STOPPED){
selectPatrolPath();
};
};
};
if (dir == RIGHT){
grid_x = ((((x + (width >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if (g.stack_map[grid_y][grid_x] > Game.EMPTY){
dir = LEFT;
};
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
dir = LEFT;
};
if (grid_x == (g.scroller.width - 1)){
dir = LEFT;
};
} else {
if (dir == LEFT){
grid_x = ((((x - (width >> 1)) - TEST_DEPTH) * Game.SCALE) >> 0);
grid_y = map_y;
if (g.stack_map[grid_y][grid_x] > Game.EMPTY){
dir = RIGHT;
};
grid_y = ((((y + (height >> 1)) + TEST_DEPTH) * Game.SCALE) >> 0);
if (g.stack_map[grid_y][grid_x] == Game.EMPTY){
dir = RIGHT;
};
if (grid_x == 0){
dir = RIGHT;
};
};
};
} else {
if (state == FALLING){
findFloor();
if (platform == false){
verletY(GRAVITY_Y, DAMPING_Y);
};
} else {
if (state == ALERT){
alert_count--;
if (alert_count <= 0){
state = RUNNING;
};
} else {
if (state == STUNNED){
--;
if ( <= 0){
NitromeGame.sound_manager.playSound("electric");
state = RECOVER;
= RECOVER_DELAY;
};
} else {
if (state == RECOVER){
--;
if (
<= 0){
scan.updateLine();
cast = RayCast.cast(scan, g.block_map, true);
state = RUNNING;
};
};
};
};
};
};
updateAnimState();
updateMC();
updateCollisionRect();
}
public function verletY(_arg1:Number, _arg2:Number):void{
temp_y = y;
y = (y + ((_arg2 * (y - py)) + _arg1));
py = temp_y;
if (scan != null){
scan.a.y = y;
};
map_y = ((y * Game.SCALE) >> 0);
}
override public function resolvePlayerCollision(_arg1:Player):void{
g.alert();
}
public function findFloor():void{
if (g.stack_map[(map_y + 1)][map_x] > Game.EMPTY){
platform = true;
y = (((map_y + 1) * Game.scale) - (height >> 1));
updateCollisionRect();
state = RUNNING;
};
}
public function move():void{
if (dir == RIGHT){
x = (x + SPEED);
scan.a.x = (scan.a.x + SPEED);
} else {
if (dir == LEFT){
x = (x - SPEED);
scan.a.x = (scan.a.x - SPEED);
};
};
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
}
public function updateCollisionRect():void{
if (!(((state == RECOVER)) || ((state == STUNNED)))){
collision_rect.x = (x - (width >> 1));
collision_rect.y = (y - (height >> 1));
collision_rect.width = width;
collision_rect.height = height;
} else {
if ((((dir == RIGHT)) || ((stop_dir == RIGHT)))){
collision_rect.x = ((x - height) - (width >> 1));
collision_rect.y = y;
collision_rect.width = height;
collision_rect.height = width;
} else {
if ((((dir == LEFT)) || ((stop_dir == LEFT)))){
collision_rect.x = (x + (width >> 1));
collision_rect.y = y;
collision_rect.width = height;
collision_rect.height = width;
};
};
};
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:int;
if (!(((state == RUNNING)) || ((state == ALERT)))){
return;
};
_local3 = new HitSparkMC();
_local3.x = (_arg1.x >> 0);
_local3.y = (_arg1.y >> 0);
_local4 = collision_rect.sideOf(_arg1.x, _arg1.y);
if (_local4 == UP){
} else {
if (_local4 == RIGHT){
_local3.rotation = 90;
} else {
if (_local4 == DOWN){
_local3.rotation = 180;
} else {
if (_local4 == LEFT){
_local3.rotation = 270;
};
};
};
};
g.effect_holder.addChild(_local3);
NitromeGame.sound_manager.playSound("scientisthit");
state = STUNNED;
= STUN_DELAY;
}
override public function unpause():void{
var _local1:MovieClip;
if (state == STUNNED){
_local1 = (mc as MovieClip).stun;
if (_local1.currentFrame == _local1.totalFrames){
_local1.gotoAndStop(_local1.totalFrames);
};
};
}
}
}//package com.nitrome.engine_specific
Section 61
//SkipStoryButton (com.nitrome.engine_specific.SkipStoryButton)
package com.nitrome.engine_specific {
import flash.display.*;
import flash.events.*;
public class SkipStoryButton extends Sprite {
var active:Boolean;// = true
public function SkipStoryButton(){
active = true;
super();
if (StoryClip.next_frame == "congrats"){
visible = false;
};
addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
public function onClick(_arg1:MouseEvent):void{
if (active){
if (NitromeGame.timeline.currentLabel == "story"){
NitromeGame.timeline.story.quit();
};
};
}
}
}//package com.nitrome.engine_specific
Section 62
//Smoke (com.nitrome.engine_specific.Smoke)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class Smoke extends Particle {
public const DELAY:int = 75;
public var active:Boolean;
public var count:int;
public var g:Game;
public function Smoke(_arg1:Number, _arg2:Number, _arg3:Game){
super(_arg1, _arg2);
count = DELAY;
this.g = _arg3;
active = true;
}
public function main():void{
var _local1:BitmapSprite;
var _local2:int;
verlet(0, 0.2, 0.99);
_local2 = (Math.random() * 4);
if (_local2 == 0){
_local1 = g.burn_bitmap1;
} else {
if (_local2 == 1){
_local1 = g.burn_bitmap2;
} else {
if (_local2 == 2){
_local1 = g.burn_bitmap3;
} else {
if (_local2 == 3){
_local1 = g.burn_bitmap4;
};
};
};
};
g.addFX(x, y, _local1);
count--;
if (count <= 0){
active = false;
};
}
}
}//package com.nitrome.engine_specific
Section 63
//Sniper (com.nitrome.engine_specific.Sniper)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.geom.*;
public class Sniper extends Encounter {
public var stealth:Boolean;
public var wobble:int;
public var :SniperSight;
public var stealth_clip:StealthClip;
public var stealth_mask:MovieClip;
public var collision_rect:Rect;
public static const WOBBLE_STEP:int = 1;
public static var point:Point = new Point();
public function Sniper(_arg1:Sprite, _arg2:Game, _arg3:Boolean=false){
var _local4:Boolean;
var _local5:int;
super(_arg1, _arg2, false);
this.stealth = false;
has_main = false;
collision_rect = new Rect((_arg1.x + 12), (_arg1.y + 10), 46, 46);
map_x = (init_x = ((_arg1.x * Game.SCALE) >> 0));
map_y = (init_y = ((_arg1.y * Game.SCALE) >> 0));
_local4 = false;
_local5 = 0;
while (_local5 < _arg2.encounters.length) {
if ((((((_arg2.encounters[_local5].init_x == init_x)) && ((_arg2.encounters[_local5].init_y == init_y)))) && (!((_arg2.encounters[_local5] == this))))){
if ((_arg2.encounters[_local5] is SniperSight)){
= _arg2.encounters[_local5];
_local4 = true;
break;
};
};
_local5++;
};
if (!_local4){
();
};
reward = new HiddenInt(70);
}
override public function remove():void{
if (forced){
return;
};
if (active){
active = false;
g.scroller.map_array_layers[layer][init_y][init_x] = tile_id;
};
}
public function ():void{
var _local1:MovieClip;
_local1 = new SightMC();
_local1.blendMode = BlendMode.OVERLAY;
_local1.gotoAndStop(1);
_local1.x = (collision_rect.x + (collision_rect.width * 0.5));
_local1.y = (collision_rect.y + (collision_rect.height * 0.5));
g.light_holder.addChild(_local1);
= new SniperSight(_local1, g, stealth);
.map_x = init_x;
.map_y = init_y;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function main():void{
wobble = ((wobble + WOBBLE_STEP) % 360);
stealth_clip.alpha = (0.85 + (Math.abs(Trig.sin[wobble]) * 0.15));
}
public function stealthScreenGrab():void{
mc.visible = false;
point = Util.localToLocal(point, mc, NitromeGame.timeline);
stealth_clip.grab(-(point.x), -(point.y));
mc.visible = true;
}
public function kill(_arg1:Number):void{
if (!active){
return;
};
active = false;
if (!spawned){
NitromeGame.bonus.enemy_count.value++;
};
g.addFX((collision_rect.x + (collision_rect.width * 0.5)), (collision_rect.y + (collision_rect.height * 0.5)), g.bang_bitmap1);
g.shake(3);
.kill();
g.scroller.map_array_layers[layer][map_y][map_x] = 0;
if (((stealth) && (!((stealth_clip.parent == null))))){
stealth_clip.parent.removeChild(stealth_clip);
};
g.addDebris((collision_rect.x + (collision_rect.width * 0.5)), (collision_rect.y + (collision_rect.height * 0.5)), ((_arg1 > 0)) ? 10 : -10, g.debris_clips[0], g.debris_clips[1]);
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
if (!active){
return;
};
if (!spawned){
g.addScore(reward.value);
} else {
g.addScore((reward.value / 10));
};
kill((_arg1.x - _arg1.px));
}
}
}//package com.nitrome.engine_specific
Section 64
//SniperSight (com.nitrome.engine_specific.SniperSight)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class SniperSight extends Encounter {
private var fade:Boolean;
public var state:int;
public var stealth:Boolean;
public var hit:Dot;
public var firing_count:int;
public var :Array;
public var :Boolean;
public var player:Player;
public var :Line;
public var :int;
public static const SPEED:int = 7;
public static const TARGETING:int = 2;
public static const FIRING:int = 4;
public static const TRACKING:int = 1;
public static const FIRING_STEP:int = 2;
public static const SEARCHING:int = 0;
public static const SIGHT_STEP:int = 2;
public function SniperSight(_arg1:Sprite, _arg2:Game, _arg3:Boolean){
super(_arg1, _arg2, true);
this.stealth = true;
has_main = true;
state = TRACKING;
= false;
if (_arg2.player != null){
= new Line(new Dot(_arg1.x, _arg1.y), _arg2.player);
};
= _arg2.scroller.map_array_layers[3];
hit = new Dot(x, y);
actor_target = false;
map_x = (init_x = ((_arg1.x * Game.SCALE) >> 0));
map_y = (init_y = ((_arg1.y * Game.SCALE) >> 0));
}
public function kill():void{
if (((fade) || (!(active)))){
return;
};
fade = true;
}
override public function intersects(_arg1:Rect):Boolean{
return (_arg1.intersectsCircle(mc.x, mc.y, 20));
}
public function fire():void{
var _local1:int;
var _local2:Number;
hit.x = mc.x;
hit.y = mc.y;
_local1 = (Math.random() * 360);
_local2 = (-30 + (Math.random() * 60));
hit.x = (hit.x + (Trig.cos[_local1] * _local2));
hit.y = (hit.y + (Trig.sin[_local1] * _local2));
map_x = (hit.x * Game.SCALE);
map_y = (hit.y * Game.SCALE);
if ((() && (g.player.collision_rect.contains(hit.x, hit.y)))){
g.player.hit();
};
if ((((((((map_x > -1)) && ((map_x < g.scroller.width)))) && ((map_y > -1)))) && ((map_y < g.scroller.height)))){
if ((((g.stack_map[map_y][map_x] > Game.EMPTY)) || (!(((([map_y][map_x] == null)) || (([map_y][map_x] == 0))))))){
g.addFX(hit.x, hit.y, g.smoke_hit_bitmap);
};
};
g.addFX(hit.x, hit.y, g.sniper_shot_bitmap);
}
public function main():void{
if (fade){
if (mc.alpha > 0){
mc.alpha = (mc.alpha - 0.2);
} else {
active = false;
return;
};
return;
};
= ((([g.player.grid_y][g.player.grid_x] == null)) || (([g.player.grid_y][g.player.grid_x] == 0)));
if (state == SEARCHING){
if (((((stealth) || (((!((g.player.state == Player.STEALTH))) && (!(g.player.chameleon)))))) && ())){
state = TRACKING;
};
} else {
if (state == TRACKING){
if (((((!(stealth)) && ((((g.player.state == Player.STEALTH)) || (g.player.chameleon))))) || (!()))){
state = SEARCHING;
};
} else {
if (state == TARGETING){
if ( < (SIGHT_STEP * 4)){
++;
if ( < SIGHT_STEP){
(mc as MovieClip).gotoAndStop(2);
} else {
if ( == SIGHT_STEP){
(mc as MovieClip).gotoAndStop(3);
} else {
if ( == (SIGHT_STEP * 2)){
(mc as MovieClip).gotoAndStop(4);
} else {
if ( == (SIGHT_STEP * 3)){
(mc as MovieClip).gotoAndStop(5);
};
};
};
};
} else {
state = FIRING;
firing_count = 0;
};
} else {
if (state == FIRING){
if (firing_count < (FIRING_STEP * 4)){
if (firing_count == 0){
NitromeGame.sound_manager.playSound("machinegun");
fire();
} else {
if (firing_count == FIRING_STEP){
fire();
} else {
if (firing_count == (FIRING_STEP * 2)){
fire();
} else {
if (firing_count == (FIRING_STEP * 3)){
fire();
};
};
};
};
firing_count++;
} else {
state = TRACKING;
(mc as MovieClip).gotoAndStop(1);
};
};
};
};
};
if (((!(( == null))) && ((((((state == TRACKING)) || ((state == SEARCHING)))) || (FIRING))))){
move();
} else {
if (g.player != null){
= new Line(new Dot(mc.x, mc.y), g.player);
};
};
}
override public function resolvePlayerCollision(_arg1:Player):void{
if ((((((state == TRACKING)) && ())) && (((stealth) || (((!((g.player.state == Player.STEALTH))) && (!(g.player.chameleon)))))))){
state = TARGETING;
= 0;
};
}
public function move():void{
.a.x = mc.x;
.a.y = mc.y;
if ((((((((state == TRACKING)) || ((state == FIRING)))) || ((state == TARGETING)))) || (!(Util.onScreen(mc.x, mc.y, g, 10))))){
.updateLine();
};
if (.len > 10){
mc.x = (mc.x + (.dx * SPEED));
mc.y = (mc.y + (.dy * SPEED));
};
}
}
}//package com.nitrome.engine_specific
Section 65
//SpawnBlock (com.nitrome.engine_specific.SpawnBlock)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class SpawnBlock extends EncounterBlock {
public var state:int;
public var :Clip;
public var hack:Boolean;
public var backing:Sprite;
public var :int;
public var spawn_id:int;
public static const SPAWN_TOTAL:int = 6;
public static const ACTIVE:int = 2;
public static const INACTIVE:int = 1;
public function SpawnBlock(_arg1:Sprite, _arg2:Game){
super(_arg1, _arg2);
spawn = true;
state = _arg2.alert_state;
= SPAWN_TOTAL;
hack = false;
if ((((state == ACTIVE)) || (aggressive))){
(_arg1 as MovieClip).gotoAndStop("active");
has_main = true;
} else {
if (state == INACTIVE){
(_arg1 as MovieClip).gotoAndStop("inactive");
};
};
}
override public function remove():void{
if (forced){
return;
};
if (active){
active = false;
g.scroller.map_array_layers[layer][map_y][map_x] = tile_id;
if (backing.parent != null){
backing.parent.removeChild(backing);
};
};
}
public function main():void{
if (((((!(((hack) && (!((g.spider == null)))))) && (( > 0)))) && (((( == null)) || (((!(( == null))) && (!(( as Encounter).active)))))))){
g.scroller.changeLayer(Scroller.ENCOUNTER_LAYER);
g.scroller.map_array[map_y][map_x] = spawn_id;
g.scroller.tile_maker.mapElement(map_x, map_y);
= g.encounters[(g.encounters.length - 1)];
( as Encounter).spawned = true;
if (!aggressive){
--;
};
};
}
override public function alert():void{
if (aggressive){
return;
};
(mc as MovieClip).gotoAndPlay("activating");
has_main = true;
= SPAWN_TOTAL;
}
override public function standdown():void{
if (aggressive){
return;
};
(mc as MovieClip).gotoAndPlay("deactivating");
has_main = false;
= null;
}
}
}//package com.nitrome.engine_specific
Section 66
//Spider (com.nitrome.engine_specific.Spider)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Spider extends FlyingBot {
public var light:MovieClip;
public var health:int;// = 0
public var health_fraction:Number;// = 0
public var body:MovieClip;
public var collision_rect:Rect;
public var :Boolean;
public static const TURN_SPEED:Number = 6;
public static const SPEED:Number = 8;
public function Spider(_arg1:int, _arg2:MovieClip, _arg3:Game, _arg4:Boolean=false, _arg5:Boolean=false){
health = 0;
health_fraction = 0;
super(_arg1, _arg2, _arg3);
= _arg2;
body = (_arg2 as MovieClip).body;
light = (_arg2 as MovieClip).light;
if (((_arg5) || (!((_arg3.alert_state == Game.ACTIVE))))){
this.aggressive = _arg4;
} else {
this.aggressive = true;
};
light.visible = this.aggressive;
if (((!(this.aggressive)) || ((_arg3.player == null)))){
selectPatrolPath();
} else {
selectSeekPath();
};
if (_arg1 == STOPPED){
body.stop();
light.stop();
};
state = MOVING;
if ((((this.dir == DOWN)) || ((((this.dir == STOPPED)) && (( == DOWN)))))){
_arg2.rotation = (angle = 90);
} else {
if ((((this.dir == RIGHT)) || ((((this.dir == STOPPED)) && (( == RIGHT)))))){
_arg2.rotation = (angle = 0);
} else {
if ((((this.dir == UP)) || ((((this.dir == STOPPED)) && (( == UP)))))){
_arg2.rotation = (angle = -90);
} else {
if ((((this.dir == LEFT)) || ((((this.dir == STOPPED)) && (( == LEFT)))))){
_arg2.rotation = (angle = 180);
};
};
};
};
collision_rect = new Rect((x - 16), (y - 16), 32, 32);
reward = new HiddenInt(10);
this. = _arg5;
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (collision_rect.contains(_arg1, _arg2));
}
public function updateMC():void{
if ((((state == TURNING)) || ((dir == STOPPED)))){
body.stop();
light.stop();
} else {
body.play();
light.play();
};
mc.x = (x >> 0);
mc.y = (y >> 0);
}
override public function intersects(_arg1:Rect):Boolean{
return (collision_rect.intersects(_arg1));
}
override public function alert():void{
if (){
return;
};
aggressive = true;
light.visible = true;
}
public function kill():void{
if (!active){
return;
};
active = false;
if (((!(spawned)) && (!()))){
NitromeGame.bonus.enemy_count.value++;
};
g.addFX(mc.x, mc.y, g.bang_bitmap1);
}
public function main():void{
if (((!(forced)) && (!(g.scroller.contains(x, y))))){
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
if (){
tile_id = "0";
} else {
if (aggressive){
tile_id = "111";
} else {
if (dir == UP){
tile_id = "107";
} else {
if (dir == RIGHT){
tile_id = "108";
} else {
if (dir == DOWN){
tile_id = "109";
} else {
if (dir == LEFT){
tile_id = "110";
};
};
};
};
};
};
remove();
return;
};
if (state == MOVING){
move();
if ((((dir == UP)) || ((dir == DOWN)))){
if (((y - 32) * Game.SCALE) == map_y){
if (aggressive){
selectSeekPath();
} else {
selectPatrolPath();
};
};
} else {
if ((((dir == LEFT)) || ((dir == RIGHT)))){
if (((x - 32) * Game.SCALE) == map_x){
if (aggressive){
selectSeekPath();
} else {
selectPatrolPath();
};
};
} else {
if (dir == STOPPED){
if (aggressive){
selectSeekPath();
} else {
selectPatrolPath();
};
};
};
};
} else {
if (state == TURNING){
if (Math.abs((angle - mc.rotation)) <= TURN_SPEED){
mc.rotation = angle;
state = MOVING;
} else {
r = mc.rotation;
r = (r + ((Math.abs((angle - r)))>180) ? ((r)<angle) ? 360 : -(360) : 0);
r = (r + (((angle - r) > 0)) ? TURN_SPEED : -(TURN_SPEED));
mc.rotation = r;
};
};
};
updateMC();
updateCollisionRect();
}
override public function resolvePlayerCollision(_arg1:Player):void{
_arg1.hit();
kill();
}
public function move():void{
if (dir == UP){
y = (y - SPEED);
} else {
if (dir == RIGHT){
x = (x + SPEED);
} else {
if (dir == LEFT){
x = (x - SPEED);
} else {
if (dir == DOWN){
y = (y + SPEED);
};
};
};
};
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
}
public function updateCollisionRect():void{
collision_rect.x = (x - 16);
collision_rect.y = (y - 16);
}
override public function resolveWeaponCollision(_arg1:Star, _arg2:Boolean=false):void{
var _local3:MovieClip;
var _local4:HackedSpider;
if (!active){
return;
};
if ((() && ((_arg1 is RopeAnchor)))){
active = false;
_local3 = new HackSpiderMC();
_local3.x = (x >> 0);
_local3.y = (y >> 0);
g.monster_holder.addChild(_local3);
_local4 = new HackedSpider(_local3, g);
NitromeGame.sound_manager.playSound("hack");
} else {
if (!spawned){
g.addScore(reward.value);
} else {
if (!){
g.addScore((reward.value / 10));
};
};
kill();
};
}
}
}//package com.nitrome.engine_specific
Section 67
//Star (com.nitrome.engine_specific.Star)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class Star extends Dot {
public var active:Boolean;
public var px:Number;
public var :Array;
public var py:Number;
public var dx:Number;
public var mc:Sprite;
public var dy:Number;
public var speed:Number;// = 32
public var temp_x:Number;
public var temp_y:Number;
public var map_y:int;
public var map_x:int;
public var dead:Boolean;
public var g:Game;
public var i:int;
public var j:int;
public var :Boolean;// = false
public static const SPEED:Number = 32;
public function Star(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Sprite, _arg6:Game){
speed = 32;
= false;
super(_arg1, _arg2);
this.mc = _arg5;
this.g = _arg6;
this.dx = _arg3;
this.dy = _arg4;
px = (ix = _arg1);
py = (iy = _arg2);
= [];
.push(new Dot(_arg1, _arg2));
.push(new Dot(_arg1, _arg2));
.push(new Dot(_arg1, _arg2));
active = true;
dead = false;
}
public function ping(_arg1:Number):void{
g.addDebris(x, y, _arg1, g.star_debris_bitmap);
mc.visible = false;
active = false;
dead = true;
}
public function
():void{
var _local1:int;
active = false;
_local1 = (mc as LiveStar).star.currentFrame;
mc.parent.removeChild(mc);
mc = new DeadStar();
(mc as DeadStar).init(_local1);
g.dead_star_holder.addChild(mc);
updateMC();
}
protected function blockCollision():void{
var _local1:int;
_local1 = 0;
while (_local1 < .length) {
map_x = (([_local1].x * Game.SCALE) >> 0);
map_y = (([_local1].y * Game.SCALE) >> 0);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (g.block_map[map_y][map_x].b.contains([_local1].x, [_local1].y)){
x = [_local1].x;
y = [_local1].y;
anchor(g.block_map[map_y][map_x].b, g.block_map[map_y][map_x].mc);
if ((((() && (!(g.block_map[map_y][map_x].b.force_field)))) && (!(g.block_map[map_y][map_x].b.cutting)))){
NitromeGame.sound_manager.playSound("star_hit");
};
return;
};
} else {
x = [_local1].x;
y = [_local1].y;
anchor(g.block_map[map_y][map_x].b);
if ((((() && (!(g.block_map[map_y][map_x].b.force_field)))) && (!(g.block_map[map_y][map_x].b.cutting)))){
NitromeGame.sound_manager.playSound("star_hit");
};
return;
};
};
_local1++;
};
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
if (g.stack_map[map_y][map_x] > Game.EMPTY){
if (g.stack_map[map_y][map_x] == Rect.TEMP){
if (g.block_map[map_y][map_x].b.contains(x, y)){
anchor(g.block_map[map_y][map_x].b, g.block_map[map_y][map_x].mc);
if ((((() && (!(g.block_map[map_y][map_x].b.force_field)))) && (!(g.block_map[map_y][map_x].b.cutting)))){
NitromeGame.sound_manager.playSound("star_hit");
};
};
} else {
anchor(g.block_map[map_y][map_x].b);
if ((((() && (!(g.block_map[map_y][map_x].b.force_field)))) && (!(g.block_map[map_y][map_x].b.cutting)))){
NitromeGame.sound_manager.playSound("star_hit");
};
};
};
}
public function erase():void{
mc.parent.removeChild(mc);
active = false;
dead = true;
}
public function updateMC():void{
mc.x = (x >> 0);
mc.y = (y >> 0);
}
protected function anchor(_arg1:Block, _arg2:Sprite=null):void{
var _local3:Number;
var _local4:Number;
var _local5:Rect;
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:int;
_local3 = (x - px);
_local4 = (y - py);
_local5 = new Rect(0, 0, 0, 0);
_local5.x = Math.min(x, px);
_local5.y = Math.min(y, py);
_local5.width = Math.abs((x - px));
_local5.height = Math.abs((y - py));
_local6 = _local5.intersection(_arg1);
_local7 = 0;
_local8 = 0;
if (_local3 != 0){
_local7 = (Math.min(Math.abs(_local3), _local6.width) * ((_local3 > 0)) ? 1 : -1);
};
if (_local4 != 0){
_local8 = (Math.min(Math.abs(_local4), _local6.height) * ((_local4 > 0)) ? 1 : -1);
};
x = (x - _local7);
y = (y - _local8);
_local9 = _arg1.sideOf(x, y);
if ((_arg1.stacked & _local9)){
if ((((_local9 == Rect.UP)) || ((_local9 == Rect.DOWN)))){
if (x < (_arg1.x + (_arg1.width * 0.5))){
x = (_arg1.x - 1);
_local9 = Rect.LEFT;
} else {
x = (_arg1.x + _arg1.width);
_local9 = Rect.RIGHT;
};
} else {
if ((((_local9 == Rect.RIGHT)) || ((_local9 == Rect.LEFT)))){
if (y < (_arg1.y + (_arg1.height * 0.5))){
y = (_arg1.y - 1);
_local9 = Rect.UP;
} else {
y = (_arg1.y + _arg1.height);
_local9 = Rect.DOWN;
};
};
};
} else {
if (_local9 == Rect.LEFT){
x = (_arg1.x - 1);
} else {
if (_local9 == Rect.UP){
y = (_arg1.y - 1);
};
};
};
active = false;
_local10 = (mc as LiveStar).star.currentFrame;
mc.parent.removeChild(mc);
mc = new DeadStar();
(mc as DeadStar).init(_local10);
if (_arg2 == null){
g.dead_star_holder.addChild(mc);
updateMC();
} else {
mc.x = (x - _arg1.x);
mc.y = (y - _arg1.y);
_arg2.addChildAt(mc, 0);
};
if (((_arg1.force_field) || (_arg1.cutting))){
ping(-(_local3));
};
}
public function main():void{
if (active){
move();
if (!g.scroller.contains(x, y)){
erase();
};
if (active){
encounterCollision();
blockCollision();
if (active){
updateMC();
};
};
};
}
protected function encounterCollision():void{
j = 0;
while (j < .length) {
i = 0;
while (i < g.encounters.length) {
if (!g.encounters[i].has_collision){
} else {
if (g.encounters[i].contains([j].x, [j].y)){
x = [j].x;
y = [j].y;
g.encounters[i].resolveWeaponCollision(this);
if (((!(g.boss_level)) && (g.encounters[i].active))){
g.enemy_health_panel.bar.scaleX = (g.encounters[i].health_fraction * g.encounters[i].health);
} else {
if (!g.boss_level){
g.enemy_health_panel.bar.scaleX = 0;
} else {
if ((g.encounters[i] is Boss)){
g.enemy_health_panel.bar.scaleX = (g.encounters[i].health_fraction * g.encounters[i].health);
};
};
};
kill();
return;
};
};
i++;
};
j++;
};
i = 0;
while (i < g.encounters.length) {
if (!g.encounters[i].has_collision){
} else {
if (g.encounters[i].contains(x, y)){
g.encounters[i].resolveWeaponCollision(this);
if (((!(g.boss_level)) && (g.encounters[i].active))){
g.enemy_health_panel.bar.scaleX = (g.encounters[i].health_fraction * g.encounters[i].health);
} else {
if (!g.boss_level){
g.enemy_health_panel.bar.scaleX = 0;
} else {
if ((g.encounters[i] is Boss)){
g.enemy_health_panel.bar.scaleX = (g.encounters[i].health_fraction * g.encounters[i].health);
};
};
};
kill();
return;
};
};
i++;
};
}
protected function move():void{
var _local1:int;
px = x;
py = y;
_local1 = 0;
while (_local1 < .length) {
[_local1].x = (x + (((dx * SPEED) * 0.25) * (_local1 + 1)));
[_local1].y = (y + (((dy * SPEED) * 0.25) * (_local1 + 1)));
_local1++;
};
x = (x + (dx * SPEED));
y = (y + (dy * SPEED));
}
public function kill():void{
(mc as DeadStar).kill();
active = false;
dead = true;
}
}
}//package com.nitrome.engine_specific
Section 68
//StealthClip (com.nitrome.engine_specific.StealthClip)
package com.nitrome.engine_specific {
import flash.display.*;
import flash.geom.*;
public class StealthClip extends Sprite {
public var :Sprite;
public var bitmap:Bitmap;
public var data:BitmapData;
public var matrix:Matrix;
public var rect:Rectangle;
public function StealthClip(_arg1:Sprite, _arg2:int, _arg3:int){
this. = _arg1;
data = new BitmapData(_arg2, _arg3, true, 0xFFFFFF);
bitmap = new Bitmap(data);
addChild(bitmap);
addChild(_arg1);
_arg1.cacheAsBitmap = true;
bitmap.cacheAsBitmap = true;
bitmap.mask = _arg1;
matrix = new Matrix();
rect = new Rectangle(0, 0, _arg2, _arg3);
}
public function grab(_arg1:Number, _arg2:Number):void{
visible = false;
NitromeGame.timeline.loading_clip.visible = false;
matrix.tx = _arg1;
matrix.ty = _arg2;
data.draw(NitromeGame.timeline, matrix, null, null, rect);
visible = true;
NitromeGame.timeline.loading_clip.visible = true;
}
}
}//package com.nitrome.engine_specific
Section 69
//StoryClip (com.nitrome.engine_specific.StoryClip)
package com.nitrome.engine_specific {
import flash.display.*;
import flash.events.*;
import com.nitrome.game.*;
import flash.text.*;
public class StoryClip extends Sprite {
public var active:Boolean;
public var pos:int;
public var
:int;
public var :TextField;
public var :TextFormat;
public static const SECOND_BOSS:int = 3;
public static const INTRO:int = 0;
public static const FAKE_END:int = 4;
public static const REAL_END:int = 5;
public static const STORY:Array = [["2028*\n\nHuge corporations battle for markets across the planet. They control everything and everyone. On the front line are warriors like Takeshi, a young ninja fresh from combat academy. Today is his first corporate espionage mission, little does Takeshi realise that today begins the story of a legendary ninja... the final ninja.\n\n*40 years before the events of Final Ninja 1."], ["Takeshi awakes alone in a cold cell somewhere deep in the base..."], ["\"Someone's sent a tiny ninja for me to play with...a small plaything before dinnertime....looks like a sweet snack!! Tasty!!\""], ["\"Dinner is served!!! I'm ready this time little ninja! Ha ha ha Extra Tasty!!!\""], ["With Maxwell Murlock and Victor Boshi gone, the company was ruined and the little ninja who had toppled a giant corporation had one thing left to do..."], ["\"...you even bought some of my guards back. Excellent work Takeshi! You'll go far in this organisation. And Snowfox, I'm not letting you on another of these undercover missions, your mother and I have had enough worrying. And I know it's a long journey home so both of you: Behave!\"", "\"I'm still your boss.\""]];
public static const FIRST_BOSS:int = 2;
public static const CAPTURED:int = 1;
public static var next_frame:String;
public static var list:Array;
public function StoryClip(){
= new TextFormat(new StoryFont().fontName, 16, 0x838383, null, null, null, null, null, TextFormatAlign.CENTER);
}
public function init():void{
= new TextField();
.embedFonts = true;
.wordWrap = true;
.width = 550;
.x = 0;
.selectable = false;
addChild();
pos = 0;
(list[pos]);
.alpha = 0;
active = true;
addEventListener(Event.ENTER_FRAME, main, false, 0, true);
addEventListener(MouseEvent.CLICK, click, false, 0, true);
}
public function quit():void{
if (!active){
return;
};
active = false;
NitromeGame.transition.doTween(next_frame);
if (next_frame == "game"){
NitromeGame.sound_manager.playMusicFadeIn(SoundManager.GAME);
} else {
if (next_frame == "congrats"){
NitromeGame.sound_manager.playMusicFadeIn(SoundManager.MENU);
};
};
removeEventListener(Event.ENTER_FRAME, main);
removeEventListener(MouseEvent.CLICK, click);
}
public function click(_arg1:MouseEvent):void{
if (.alpha >= 1){
= 0;
};
}
public function main(_arg1:Event):void{
if ((((
> 0)) && ((.alpha < 1)))){
.alpha = (.alpha + 0.05);
} else {
if (
> 0){
--;
} else {
if ((((
<= 0)) && ((.alpha > 0)))){
.alpha = (.alpha - 0.05);
} else {
if (pos < (list.length - 1)){
(list[++pos]);
} else {
quit();
};
};
};
};
}
public function
(_arg1:String):void{
.text = _arg1;
.setTextFormat();
.height = 400;
.y = (200 - (.textHeight * 0.5));
= (_arg1.replace(/ /g, "").length * 4);
}
}
}//package com.nitrome.engine_specific
Section 70
//TileMaker (com.nitrome.engine_specific.TileMaker)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
import flash.utils.*;
public class TileMaker {
public var :Array;
private var item;
private var mc:Sprite;
public var forced:Boolean;
private var :int;
public var g:Game;
private var i:int;
private var n:int;
public var s:Scroller;
public var :Boolean;
public var id_tag:int;
private static const DOWN:int = 4;
private static const RIGHT:int = 2;
private static const LEFT:int = 8;
private static const EMPTY:int = 1;
private static const IN_PLAY:int = 2;
private static const UP:int = 1;
public function TileMaker(_arg1:Game, _arg2:Scroller){
BladeManGuard.clear();
this.g = _arg1;
this.s = _arg2;
= new Array("", "", "BuildBlockMC", "BuildElectricBlockMC", "BuildWhiteBlockMC", "", "", "", "", "", "", "", "", "", "", "", "", "", "BeamMC1", "BeamMC1", "BeamMC2", "BeamMC2", "BladeManMC", "BladeManMC", "BossMC", "BossMC", "BossShadowMC", "CammoMC", "CoinMC", "CowardGeneratorMC", "flash.display.Sprite", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "FlyingGunMC", "ForceFieldMC1", "ForceFieldMC2", "GeneratorMC", "GunBlockMC1", "GunBlockMC1", "GunBlockMC2", "GunBlockMC2", "GunBlockMC3", "GunBlockMC3", "GunBlockMC4", "GunBlockMC4", "GunManMC", "GunManMC", "GunManMC", "GunManMC", "HealthMC", "LiftMC", "NinjaMC", "NinjaMC", "NinjaMC", "NinjaMC", "RotoGunMC", "RotoGunMC", "RotoGunMC", "RotoGunMC", "ScannerMC1", "ScannerMC1", "LaserMC1", "LaserMC1", "ScannerMC2", "ScannerMC2", "LaserMC2", "LaserMC2", "ScannerMC3", "ScannerMC3", "LaserMC3", "LaserMC3", "ScannerMC4", "ScannerMC4", "LaserMC4", "LaserMC4", "ScannerMC5", "ScannerMC5", "LaserMC5", "LaserMC5", "ScannerMC6", "ScannerMC6", "LaserMC6", "LaserMC6", "ScannerMC7", "ScannerMC7", "LaserMC7", "LaserMC7", "ScannerMC8", "ScannerMC8", "LaserMC8", "LaserMC8", "ScientistMC", "ScientistMC", "SniperMC", "SniperMC", "SpiderMC", "SpiderMC", "SpiderMC", "SpiderMC", "SpiderMC", "", "", "", "", "EvilMovingBlockMC", "SpawnMC1", "SpawnMC1", "SpawnMC1", "SpawnMC2", "SpawnMC2", "SpawnMC2", "HackSpiderMC", "HackSpiderMC", "BladeManMC", "CowardMC", "NinjaGuardMC", "BuildCoverMC", "EvilMovingBlockMC", "EvilMovingBlockMC", "EvilMovingBlockMC", "EvilMovingBlockMC", "EvilMovingBlockMC", "MovingMC6", "MovingMC6", "MovingMC6", "MovingMC6", "MovingMC8", "MovingMC8", "MovingMC8", "MovingMC8", "MovingMC3", "MovingMC3", "MovingMC3", "MovingMC3", "MovingMC11", "MovingMC11", "MovingMC11", "MovingMC11", "MovingMC10", "MovingMC10", "MovingMC10", "MovingMC10", "EntranceLiftMC", "GunManMC", "GunManMC", "WaterLineMC", "BlockMC1", "BlockMC2", "BlockMC3", "BlockMC4", "BlockMC5", "BlockMC6", "BlockMC7", "BlockMC8", "BlockMC9", "BlockMC10", "BlockMC11", "BlockMC12", "BlockMC13", "BlockMC14", "BlockMC15", "BlockMC16", "BlockMC17", "BlockMC18", "BlockMC19", "BlockMC20", "BlockMC21", "BlockMC22", "BlockMC23", "BlockMC24", "BlockMC25", "BlockMC26", "BlockMC27", "BlockMC28", "BlockMC29", "BlockMC30", "BlockMC31", "BlockMC32", "BlockMC33", "BlockMC34", "BlockMC35", "BlockMC36", "BlockMC37", "BlockMC38", "BlockMC39", "BlockMC40", "BlockMC41", "BlockMC42", "BlockMC43", "BlockMC44", "BlockMC45", "BlockMC46", "BlockMC47", "BlockMC48", "BlockMC49", "BlockMC50", "BlockMC51", "BlockMC52", "BlockMC53", "BlockMC54", "BlockMC55", "BlockMC56", "BlockMC57", "BlockMC58", "BlockMC59", "BlockMC60", "BlockMC61", "BlockMC62", "BlockMC63", "BlockMC64", "BlockMC65", "BlockMC66", "BlockMC67", "BlockMC68", "BlockMC69", "BlockMC70", "BlockMC71", "BlockMC72", "BlockMC73", "BlockMC74", "BlockMC75", "BlockMC76", "BlockMC77", "BlockMC78", "BlockMC79", "BlockMC80", "BlockMC81", "BlockMC82", "BlockMC83", "BlockMC84", "BlockMC85", "BlockMC86", "BlockMC87", "BlockMC88", "BlockMC89", "BlockMC90", "BlockMC91", "BlockMC92", "BlockMC93", "BlockMC94", "BlockMC95", "BlockMC96", "BlockMC97", "BlockMC98", "BlockMC99", "BlockMC100", "BlockMC101", "BlockMC102", "BlockMC103", "BlockMC104", "BlockMC105", "BlockMC106", "BlockMC107", "BlockMC108", "BlockMC109", "BlockMC110", "BlockMC111", "BlockMC112", "BlockMC113", "BlockMC114", "BlockMC115", "BlockMC116", "BlockMC117", "BlockMC118", "BlockMC119", "BlockMC120", "BlockMC121", "BlockMC122", "BlockMC123", "BlockMC124", "BlockMC125", "BlockMC126", "BlockMC127", "BlockMC128", "BlockMC129", "BlockMC130", "BlockMC131", "BlockMC132", "BlockMC133", "BlockMC134", "BlockMC135", "BlockMC136", "BlockMC137", "BlockMC138", "BlockMC139", "BlockMC140", "BlockMC141", "BlockMC142", "BlockMC143", "BlockMC144", "BlockMC145", "BlockMC146", "BlockMC147", "BlockMC148", "BlockMC149", "BlockMC150", "BlockMC151", "BlockMC152", "BlockMC153", "BlockMC154", "BlockMC155", "BlockMC156", "BlockMC157", "BlockMC158", "BlockMC159", "BlockMC160", "BlockMC161", "BlockMC162", "BlockMC163", "BlockMC164", "BlockMC165", "BlockMC166", "BlockMC167", "BlockMC168", "BlockMC169", "BlockMC170", "BlockMC171", "BlockMC172", "BlockMC173", "BlockMC174", "BlockMC175", "BlockMC176", "BlockMC177", "BlockMC178", "BlockMC179", "BlockMC180", "BlockMC181", "BlockMC182", "BlockMC183", "BlockMC184", "BlockMC185", "BlockMC186", "BlockMC187", "BlockMC188", "BlockMC189", "BlockMC190", "BlockMC191", "BlockMC192", "BlockMC193", "BlockMC194", "BlockMC195", "BlockMC196", "BlockMC197", "BlockMC198", "BlockMC199", "BlockMC200", "BlockMC201", "BlockMC202", "BlockMC203", "BlockMC204", "BlockMC205", "BlockMC206", "BlockMC207", "BlockMC208", "BlockMC209", "BlockMC210", "BlockMC211", "BlockMC212", "BlockMC213", "BlockMC214", "BlockMC215", "BlockMC216", "BlockMC217", "BlockMC218", "ElectricMC1", "ElectricMC2", "ElectricMC3", "ElectricMC4", "ElectricMC5", "ElectricMC6", "ElectricMC7", "ElectricMC8", "ElectricMC9", "WhiteMC1", "WhiteMC2", "WhiteMC3", "WhiteMC4", "WhiteMC5", "WhiteMC6", "WhiteMC7", "WhiteMC8", "WhiteMC9", "WhiteMC10", "WhiteMC11", "WhiteMC12", "WhiteMC13", "WhiteMC14", "WhiteMC15", "WhiteMC16", "WhiteMC17", "WhiteMC18", "WhiteMC19", "WhiteMC20", "WhiteMC21", "WhiteMC22", "WhiteMC23", "WhiteMC24", "WhiteMC25", "WhiteMC26", "WhiteMC27", "WhiteMC28", "WhiteMC29", "WhiteMC30", "MidMC1", "MidMC2", "MidMC3", "MidMC4", "MidMC5", "MidMC6", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "BlockMC219", "BlockMC220", "BlockMC221", "BlockMC222", "WireMC1", "WireMC2", "WireMC3", "WireMC4", "WireMC5", "WireMC6", "WireMC7", "WireMC8", "WireMC9", "WireMC10", "WireMC11", "WireMC12", "BlockMC223", "BlockMC224", "BlockMC225", "BlockMC226", "BlockMC227", "BlockMC228", "BlockMC229", "BlockMC230", "BlockMC231", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "BossPlatformMC1", "BossPlatformMC2", "BossPlatformMC3", "BossPlatformMC4", "BossPlatformMC5", "BossPlatformMC6", "BossPlatformMC7", "BackArrayMC", "BackArrayMC", "BackArrayMC", "BackArrayMC", "WhiteMC31", "WhiteMC32", "BlockMC232", "BlockMC233", "WhiteMC33", "BlockMC234", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "FrontArrayMC", "BossGraphicMC", "flash.display.Sprite");
i = 0;
while (i < .length) {
if ([i] != ""){
[i] = (getDefinitionByName([i]) as Class);
};
i++;
};
}
public function mapElement(_arg1:int, _arg2:int, _arg3:Boolean=false){
var _local4:int;
var _local5:Sprite;
var _local6:Sprite;
var _local7:MovingBlock;
var _local8:MovingBlock;
var _local9:Sprite;
var _local10:Sprite;
= parseInt(s.map_array[_arg2][_arg1]);
id_tag = -1;
if ( == 0){
return (null);
};
if (!(((s.map_array[_arg2][_arg1] >= 0)) || ((s.map_array[_arg2][_arg1] <= 0)))){
id_tag = s.map_array[_arg2][_arg1].match(/(?<=I\()\d+/)[0];
= parseInt(s.map_array[_arg2][_arg1].match(/\d+/)[0]);
};
n = (_arg1 + (_arg2 * s.width));
= true;
if ( >= 1){
mc = new ([]);
};
if (mc != null){
mc.x = (_arg1 * s.scale);
mc.y = (_arg2 * s.scale);
s.tiles.addChild(mc);
};
if (s.gfx){
if (((( >= 678)) && (( <= 736)))){
(mc as MovieClip).gotoAndStop(( - 677));
};
if (((( >= 762)) && (( <= 767)))){
(mc as MovieClip).gotoAndStop(( - 702));
};
if (((( >= 421)) && (( <= 677)))){
(mc as MovieClip).gotoAndStop(( - 420));
};
if (((( >= 775)) && (( <= 778)))){
(mc as MovieClip).gotoAndStop(( - 517));
};
if (((( >= 785)) && (( <= 790)))){
(mc as MovieClip).gotoAndStop(( - 719));
};
if (((((( >= 426)) && (( <= 471)))) || (((((( >= 263)) && (( <= 286)))) && (!(( == 279))))))){
g.background_holder.addChild(mc);
};
return (mc);
};
if ( == 1){
} else {
if (((((((((((((( == 2)) || (( == 784)))) || (((( >= 781)) && (( <= 782)))))) || (((( >= 0x0300)) && (( <= 772)))))) || (((( >= 158)) && (( <= 375)))))) || (((( >= 737)) && (( <= 740)))))) || (((( >= 753)) && (( <= 761)))))){
item = ("static", mc, _arg1, _arg2);
if (((( >= 737)) && (( <= 740)))){
g.sign_holder.addChild(mc);
};
} else {
if (((( == 3)) || (((( >= 376)) && (( <= 384)))))){
item = ("electric", mc, _arg1, _arg2);
} else {
if (((((((( == 4)) || (( == 783)))) || (((( >= 779)) && (( <= 780)))))) || (((( >= 385)) && (( <= 414)))))){
item = ("white", mc, _arg1, _arg2);
} else {
if (((( >= 129)) && (( <= 153)))){
_local4 = (( - 126) % 4);
item = new MovingBlock((1 << _local4), mc, g);
item.b = new Block((_arg1 * Game.scale), (_arg2 * Game.scale), Game.scale, Game.scale);
item.b.moving_block = true;
item.b.cutting = true;
if ( == 129){
item.evil = true;
item.aggressive = true;
(mc as MovieClip).gotoAndStop("aggressive");
item.dir = FlyingBot.STOPPED;
};
if (((( >= 130)) && (( <= 133)))){
item.evil = true;
item.base_tile_id = 130;
if (g.alert_state == Game.ACTIVE){
item.aggressive = true;
(mc as MovieClip).gotoAndStop("aggressive");
item.dir = FlyingBot.STOPPED;
} else {
item.selectPatrolPath();
};
} else {
if (((( >= 134)) && (( <= 137)))){
item.base_tile_id = 134;
item.selectPatrolPath();
};
};
if (((( >= 138)) && (( <= 141)))){
item.b.stack(Rect.RIGHT);
_local5 = new MovingMC9();
_local5.x = (mc.x + Game.scale);
_local5.y = mc.y;
_local7 = new MovingBlock(item.dir, _local5, g);
_local7.b = new Block(((_arg1 + 1) * Game.scale), (_arg1 * Game.scale), Game.scale, Game.scale);
_local7.b.stack(Rect.LEFT);
_local7.b.cutting = true;
_local7.b.moving_block = true;
_local7.buddy = true;
g.block_map[_arg2][(_arg1 + 1)] = _local7;
item.rez_buddies.push(_local7);
s.tiles.addChild(_local5);
item.base_tile_id = 138;
item.selectPatrolPath();
_local7.selectPatrolPath();
_local7.layer = s.current_layer;
} else {
if (((( >= 142)) && (( <= 145)))){
item.b.stack((Rect.RIGHT | Rect.LEFT));
_local5 = new MovingMC1();
_local5.x = (mc.x + Game.scale);
_local5.y = mc.y;
_local7 = new MovingBlock(item.dir, _local5, g);
_local7.b = new Block(((_arg1 + 1) * Game.scale), (_arg2 * Game.scale), Game.scale, Game.scale);
_local7.b.stack(Rect.LEFT);
_local7.b.cutting = true;
_local7.b.moving_block = true;
_local7.buddy = true;
_local6 = new MovingMC2();
_local6.x = (mc.x - Game.scale);
_local6.y = mc.y;
_local8 = new MovingBlock(item.dir, _local6, g);
_local8.b = new Block(((_arg1 - 1) * Game.scale), (_arg2 * Game.scale), Game.scale, Game.scale);
_local8.b.stack(Rect.LEFT);
_local8.b.cutting = true;
_local8.b.moving_block = true;
_local8.buddy = true;
g.block_map[_arg2][(_arg1 + 1)] = _local7;
g.block_map[_arg2][(_arg1 - 1)] = _local8;
item.rez_buddies.push(_local7, _local8);
s.tiles.addChild(_local5);
s.tiles.addChild(_local6);
item.selectPatrolPath();
_local7.selectPatrolPath();
_local8.selectPatrolPath();
_local7.layer = s.current_layer;
_local8.layer = s.current_layer;
item.base_tile_id = 142;
};
};
if (((( >= 146)) && (( <= 149)))){
item.b.stack(Rect.DOWN);
_local5 = new MovingMC5();
_local5.x = mc.x;
_local5.y = (mc.y + Game.scale);
_local7 = new MovingBlock(item.dir, _local5, g);
_local7.b = new Block((_arg1 * Game.scale), ((_arg2 + 1) * Game.scale), Game.scale, Game.scale);
_local7.b.stack(Rect.UP);
_local7.b.cutting = true;
_local7.b.moving_block = true;
_local7.buddy = true;
g.block_map[(_arg2 + 1)][_arg1] = _local7;
item.rez_buddies.push(_local7);
s.tiles.addChild(_local5);
item.base_tile_id = 146;
item.selectPatrolPath();
_local7.selectPatrolPath();
_local7.layer = s.current_layer;
} else {
if (((( >= 150)) && (( <= 153)))){
item.b.stack((Rect.UP | Rect.DOWN));
_local5 = new MovingMC1();
_local5.x = mc.x;
_local5.y = (mc.y + Game.scale);
_local7 = new MovingBlock(item.dir, _local5, g);
_local7.b = new Block((_arg1 * Game.scale), ((_arg2 + 1) * Game.scale), Game.scale, Game.scale);
_local7.b.stack(Rect.DOWN);
_local7.b.cutting = true;
_local7.b.moving_block = true;
_local7.buddy = true;
_local6 = new MovingMC2();
_local6.x = mc.x;
_local6.y = (mc.y - Game.scale);
_local8 = new MovingBlock(item.dir, _local6, g);
_local8.b = new Block((_arg1 * Game.scale), ((_arg2 - 1) * Game.scale), Game.scale, Game.scale);
_local8.b.stack(Rect.UP);
_local8.b.cutting = true;
_local8.b.moving_block = true;
_local8.buddy = true;
g.block_map[(_arg2 + 1)][_arg1] = _local7;
g.block_map[(_arg2 - 1)][_arg1] = _local8;
item.rez_buddies.push(_local7, _local8);
s.tiles.addChild(_local5);
s.tiles.addChild(_local6);
item.base_tile_id = 150;
item.selectPatrolPath();
_local7.selectPatrolPath();
_local8.selectPatrolPath();
_local7.layer = s.current_layer;
_local8.layer = s.current_layer;
};
};
} else {
if (((( >= 18)) && (( <= 21)))){
((mc as MovieClip).beam);
if ( == 18){
item = new Laser(false, new Rect(mc.x, (mc.y + 22), Game.scale, 22), (mc as MovieClip), g);
} else {
if ( == 19){
item = new Laser(true, new Rect(mc.x, (mc.y + 22), Game.scale, 22), (mc as MovieClip), g);
} else {
if ( == 20){
item = new Laser(false, new Rect((mc.x + 22), mc.y, 22, Game.scale), (mc as MovieClip), g);
} else {
if ( == 21){
item = new Laser(true, new Rect((mc.x + 22), mc.y, 22, Game.scale), (mc as MovieClip), g);
};
};
};
};
} else {
if (((( == 22)) || (( == 23)))){
mc.x = (mc.x + 32);
mc.y = (mc.y + 43);
if ( == 22){
item = new BladeMan(LEFT, mc, g);
} else {
if ( == 23){
item = new BladeMan(RIGHT, mc, g);
};
};
} else {
if (((( == 24)) || (( == 25)))){
item = new Boss(mc, g, ( == 25));
} else {
if ( == 26){
item = new Clip(mc, g);
} else {
if ( == 27){
item = new Cammo(mc, g);
} else {
if ( == 28){
item = new Coin(mc, g);
} else {
if ( == 29){
item = new CowardSwitch(id_tag, mc, g);
} else {
if ( == 30){
item = new ElectricFinish(mc, g);
} else {
if (((( >= 31)) && (( <= 45)))){
mc.x = (mc.x + 32);
mc.y = (mc.y + 32);
if ( == 31){
item = new FlyingGun(FlyingBot.UP, (mc as MovieClip), g);
} else {
if ( == 32){
item = new FlyingGun(FlyingBot.UP, (mc as MovieClip), g, false, true);
} else {
if ( == 33){
item = new FlyingGun(FlyingBot.UP, (mc as MovieClip), g, false, false, true);
} else {
if ( == 34){
item = new FlyingGun(FlyingBot.RIGHT, (mc as MovieClip), g);
} else {
if ( == 35){
item = new FlyingGun(FlyingBot.RIGHT, (mc as MovieClip), g, false, true);
} else {
if ( == 36){
item = new FlyingGun(FlyingBot.RIGHT, (mc as MovieClip), g, false, false, true);
} else {
if ( == 37){
item = new FlyingGun(FlyingBot.DOWN, (mc as MovieClip), g);
} else {
if ( == 38){
item = new FlyingGun(FlyingBot.DOWN, (mc as MovieClip), g, false, true);
} else {
if ( == 39){
item = new FlyingGun(FlyingBot.DOWN, (mc as MovieClip), g, false, false, true);
} else {
if ( == 40){
item = new FlyingGun(FlyingBot.LEFT, (mc as MovieClip), g);
} else {
if ( == 41){
item = new FlyingGun(FlyingBot.LEFT, (mc as MovieClip), g, false, true);
} else {
if ( == 42){
item = new FlyingGun(FlyingBot.LEFT, (mc as MovieClip), g, false, false, true);
} else {
if ( == 43){
item = new FlyingGun(FlyingBot.DOWN, (mc as MovieClip), g, true);
} else {
if ( == 44){
item = new FlyingGun(FlyingBot.DOWN, (mc as MovieClip), g, true, true);
} else {
if ( == 45){
item = new FlyingGun(FlyingBot.DOWN, (mc as MovieClip), g, true, false, true);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
} else {
if (((( == 46)) || (( == 47)))){
if (id_tag == -1){
item = new ForceField((mc as MovieClip), g);
} else {
item = new ForceFieldDoor(id_tag, mc, g);
};
item.b = new Block((_arg1 * Game.scale), (_arg2 * Game.scale), Game.scale, Game.scale);
if ((((((_arg2 > 0)) && ((((g.stack_map[(_arg2 - 1)][_arg1] > Game.EMPTY)) || (isForceField(s.map_array[(_arg2 - 1)][_arg1])))))) || ((_arg2 == 0)))){
item.b.stack(UP);
};
if ((((((_arg1 < (s.width - 1))) && ((((g.stack_map[_arg2][(_arg1 + 1)] > Game.EMPTY)) || (isForceField(s.map_array[_arg2][(_arg1 + 1)])))))) || ((_arg1 == (s.width - 1))))){
item.b.stack(RIGHT);
};
if ((((((_arg2 < (s.height - 1))) && ((((g.stack_map[(_arg2 + 1)][_arg1] > Game.EMPTY)) || (isForceField(s.map_array[(_arg2 + 1)][_arg1])))))) || ((_arg2 == (s.height - 1))))){
item.b.stack(DOWN);
};
if ((((((_arg1 > 0)) && ((((g.stack_map[_arg2][(_arg1 - 1)] > Game.EMPTY)) || (isForceField(s.map_array[_arg2][(_arg1 - 1)])))))) || ((_arg1 == 0)))){
item.b.stack(LEFT);
};
item.b.force_field = true;
if (id_tag > -1){
if (item.state == ForceFieldDoor.ACTIVE){
g.stack_map[_arg2][_arg1] = item.b.stacked;
};
} else {
if (g.alert_state == Game.ACTIVE){
item.b.active = true;
g.stack_map[_arg2][_arg1] = item.b.stacked;
} else {
if (g.alert_state == Game.INACTIVE){
item.b.active = false;
};
};
};
g.sign_holder.addChild(mc);
((mc as MovieClip).field);
} else {
if ( == 48){
item = ("generator", mc, _arg1, _arg2, id_tag);
} else {
if (((( >= 49)) && (( <= 56)))){
item = ("gun", mc, _arg1, _arg2);
if (((( == 49)) || (( == 50)))){
item.setDirection(UP);
if ( == 50){
item.fast = true;
};
} else {
if (((( == 51)) || (( == 52)))){
item.setDirection(RIGHT);
if ( == 52){
item.fast = true;
};
} else {
if (((( == 53)) || (( == 54)))){
item.setDirection(DOWN);
if ( == 54){
item.fast = true;
};
} else {
if (((( == 55)) || (( == 56)))){
item.setDirection(LEFT);
if ( == 56){
item.fast = true;
};
};
};
};
};
} else {
if (((((((( >= 57)) && (( <= 60)))) || (( == 155)))) || (( == 156)))){
mc.x = (mc.x + 32);
mc.y = (mc.y + 40);
if ( == 57){
item = new GunMan(LEFT, mc, g);
} else {
if ( == 58){
item = new GunMan(LEFT, mc, g, true);
} else {
if ( == 59){
item = new GunMan(RIGHT, mc, g);
} else {
if ( == 60){
item = new GunMan(RIGHT, mc, g, true);
} else {
if ( == 155){
item = new GunMan(LEFT, mc, g, false, true);
} else {
if ( == 156){
item = new GunMan(RIGHT, mc, g, false, true);
};
};
};
};
};
};
} else {
if ( == 61){
item = new Health(mc, g);
} else {
if ( == 62){
g.effect_holder.addChild(mc);
item = new Lift(mc, g);
} else {
if (((( >= 63)) && (( <= 66)))){
if ( == 63){
item = new Ninja(Ninja.UP, (mc as MovieClip), g);
} else {
if ( == 64){
item = new Ninja(Ninja.RIGHT, (mc as MovieClip), g);
} else {
if ( == 65){
item = new Ninja(Ninja.DOWN, (mc as MovieClip), g);
} else {
if ( == 66){
item = new Ninja(Ninja.LEFT, (mc as MovieClip), g);
};
};
};
};
} else {
if (((( >= 67)) && (( <= 70)))){
mc.x = (mc.x + (Game.scale >> 1));
mc.y = (mc.y + (Game.scale >> 1));
if ( == 67){
item = new RotoGun(id_tag, Rect.RIGHT, mc, g);
} else {
if ( == 68){
item = new RotoGun(id_tag, Rect.RIGHT, mc, g, true);
} else {
if ( == 69){
item = new RotoGun(id_tag, Rect.LEFT, mc, g);
} else {
if ( == 70){
item = new RotoGun(id_tag, Rect.LEFT, mc, g, true);
};
};
};
};
} else {
if (((( >= 71)) && (( <= 102)))){
if ( == 71){
item = new TripWire(TripWire.FIXED, UP, mc, g);
} else {
if ( == 72){
item = new TripWire(TripWire.FIXED_VARIABLE, UP, mc, g);
} else {
if ( == 73){
item = new TripWire(TripWire.FIXED, UP, mc, g, true);
} else {
if ( == 74){
item = new TripWire(TripWire.FIXED_VARIABLE, UP, mc, g, true);
} else {
if ( == 75){
item = new TripWire(TripWire.FIXED, RIGHT, mc, g);
} else {
if ( == 76){
item = new TripWire(TripWire.FIXED_VARIABLE, RIGHT, mc, g);
} else {
if ( == 77){
item = new TripWire(TripWire.FIXED, RIGHT, mc, g, true);
} else {
if ( == 78){
item = new TripWire(TripWire.FIXED_VARIABLE, RIGHT, mc, g, true);
} else {
if ( == 79){
item = new TripWire(TripWire.FIXED, DOWN, mc, g);
} else {
if ( == 80){
item = new TripWire(TripWire.FIXED_VARIABLE, DOWN, mc, g);
} else {
if ( == 81){
item = new TripWire(TripWire.FIXED, DOWN, mc, g, true);
} else {
if ( == 82){
item = new TripWire(TripWire.FIXED_VARIABLE, DOWN, mc, g, true);
} else {
if ( == 83){
item = new TripWire(TripWire.FIXED, LEFT, mc, g);
} else {
if ( == 84){
item = new TripWire(TripWire.FIXED_VARIABLE, LEFT, mc, g);
} else {
if ( == 85){
item = new TripWire(TripWire.FIXED, LEFT, mc, g, true);
} else {
if ( == 86){
item = new TripWire(TripWire.FIXED_VARIABLE, LEFT, mc, g, true);
} else {
if ( == 87){
item = new TripWire(TripWire.TURNING, UP, mc, g);
} else {
if ( == 88){
item = new TripWire(TripWire.TURNING, UP, mc, g);
item.other_way = true;
item.getCurrentAngle();
} else {
if ( == 89){
item = new TripWire(TripWire.TURNING, UP, mc, g, true);
} else {
if ( == 90){
item = new TripWire(TripWire.TURNING, UP, mc, g, true);
item.other_way = true;
item.getCurrentAngle();
} else {
if ( == 91){
item = new TripWire(TripWire.TURNING, RIGHT, mc, g);
} else {
if ( == 92){
item = new TripWire(TripWire.TURNING, RIGHT, mc, g);
item.other_way = true;
item.getCurrentAngle();
} else {
if ( == 93){
item = new TripWire(TripWire.TURNING, RIGHT, mc, g, true);
} else {
if ( == 94){
item = new TripWire(TripWire.TURNING, RIGHT, mc, g, true);
item.other_way = true;
item.getCurrentAngle();
} else {
if ( == 95){
item = new TripWire(TripWire.TURNING, DOWN, mc, g);
} else {
if ( == 96){
item = new TripWire(TripWire.TURNING, DOWN, mc, g);
item.other_way = true;
item.getCurrentAngle();
} else {
if ( == 97){
item = new TripWire(TripWire.TURNING, DOWN, mc, g, true);
} else {
if ( == 98){
item = new TripWire(TripWire.TURNING, DOWN, mc, g, true);
item.other_way = true;
item.getCurrentAngle();
} else {
if ( == 99){
item = new TripWire(TripWire.TURNING, LEFT, mc, g);
} else {
if ( == 100){
item = new TripWire(TripWire.TURNING, LEFT, mc, g);
item.other_way = true;
item.getCurrentAngle();
} else {
if ( == 101){
item = new TripWire(TripWire.TURNING, LEFT, mc, g, true);
} else {
if ( == 102){
item = new TripWire(TripWire.TURNING, LEFT, mc, g, true);
item.other_way = true;
item.getCurrentAngle();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
g.sign_holder.addChild(mc);
} else {
if (((( == 103)) || (( == 104)))){
mc.x = (mc.x + 32);
mc.y = (mc.y + 41);
if ( == 103){
item = new Scientist(LEFT, mc, g);
} else {
if ( == 104){
item = new Scientist(RIGHT, mc, g);
};
};
} else {
if (((( == 105)) || (( == 106)))){
if ( == 105){
item = new Sniper(mc, g);
} else {
item = new Sniper(mc, g, true);
};
} else {
if (((((( >= 107)) && (( <= 111)))) || (((( == 123)) || (( == 124)))))){
mc.x = (mc.x + 32);
mc.y = (mc.y + 32);
if ( == 107){
item = new Spider(FlyingBot.UP, (mc as MovieClip), g);
} else {
if ( == 108){
item = new Spider(FlyingBot.RIGHT, (mc as MovieClip), g);
} else {
if ( == 109){
item = new Spider(FlyingBot.DOWN, (mc as MovieClip), g);
} else {
if ( == 110){
item = new Spider(FlyingBot.LEFT, (mc as MovieClip), g);
} else {
if ( == 111){
item = new Spider(FlyingBot.DOWN, (mc as MovieClip), g, true);
} else {
if ( == 123){
item = new Spider(FlyingBot.UP, (mc as MovieClip), g, false, true);
} else {
if ( == 124){
item = new Spider(FlyingBot.DOWN, (mc as MovieClip), g, false, true);
};
};
};
};
};
};
};
} else {
if (((( >= 112)) && (( <= 114)))){
} else {
if (((( >= 117)) && (( <= 122)))){
mc.x = (_arg1 * s.scale);
mc.y = (_arg2 * s.scale);
g.spawn_holder.addChild(mc);
item = ("spawn", mc, _arg1, _arg2);
if (((( >= 117)) && (( <= 119)))){
item.backing = new SpawnBackMC1();
} else {
item.backing = new SpawnBackMC2();
};
if (((( == 117)) || (( == 120)))){
} else {
item.aggressive = (item.has_main = true);
(mc as MovieClip).gotoAndStop("active");
};
if (((( == 118)) || (( == 121)))){
item.hack = true;
};
item.backing.x = mc.x;
item.backing.y = mc.y;
g.background_holder.addChild(item.backing);
if ( == 118){
item.spawn_id = 123;
} else {
if ( == 121){
item.spawn_id = 124;
} else {
i = 0;
while (i < g.spawnage.length) {
if ((((g.spawnage[i].x == _arg1)) && ((g.spawnage[i].y == _arg2)))){
item.spawn_id = g.spawnage[i].id;
break;
};
i++;
};
};
};
} else {
if ( == 125){
mc.x = (mc.x + 32);
mc.y = (mc.y + 43);
item = new BladeManGuard(RIGHT, mc, g);
} else {
if ( == 126){
mc.x = (mc.x + 32);
mc.y = (mc.y + 41);
item = new Coward(RIGHT, mc, g);
} else {
if ( == 127){
item = new NinjaGuard(Ninja.UP, (mc as MovieClip), g);
} else {
if ( == 154){
item = new Clip(mc, g);
s.map_array[_arg2][_arg1] = 0;
} else {
if ( == 157){
_local9 = new SubMC();
_local9.x = 0;
_local9.y = (s.height * Game.scale);
g.light_holder.addChild(_local9);
item = new WaterLine(mc, g);
g.light_holder.addChild(mc);
} else {
if (((( == 773)) || (( == 774)))){
item = new Clip(mc, g);
if ( == 773){
i = 0;
while (i < (s.height * 2)) {
_local10 = new BlockMC18();
_local10.x = ((_arg1 + 2) * Game.scale);
_local10.y = (i * Game.scale);
g.background_holder.addChild(_local10);
i++;
};
} else {
i = 0;
while (i < (s.height * 2)) {
_local10 = new BlockMC18();
_local10.x = ((_arg1 - 2) * Game.scale);
_local10.y = (i * Game.scale);
g.background_holder.addChild(_local10);
i++;
};
};
if (g.scrolling == Scroller.HORIZ){
(mc as MovieClip).wheels.rotation = 180;
};
} else {
if ( == 792){
item = new GameFinish(mc, g);
mc.x = (mc.x + 32);
mc.y = (mc.y + 32);
} else {
item = new Clip(mc, g);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
if (((((((((((( >= 13)) && (( <= 157)))) && (!(( == 128))))) && (!(( == 154))))) && (!(( == 26))))) || (( == 792)))){
= !(item.free);
};
if (item != null){
item.map_x = (item.init_x = _arg1);
item.map_y = (item.init_y = _arg2);
item.tile_id = s.map_array[_arg2][_arg1];
item.layer = s.current_layer;
item.forced = _arg3;
if (){
s.map_array[_arg2][_arg1] = item;
return (item);
};
s.map_array[_arg2][_arg1] = 0;
};
return (null);
}
public function (_arg1:String, _arg2:Sprite, _arg3:Number, _arg4:Number, _arg5:int=-1){
var _local6:*;
var _local7:MovieClip;
if (g.stack_map[_arg4][_arg3] == -1){
_local6 = new Clip(_arg2, g);
_local6.block = true;
return (_local6);
};
if (_arg1 == "static"){
_local6 = new BlockClip(_arg2, g);
} else {
if (_arg1 == "white"){
_local6 = new BlockClip(_arg2, g);
} else {
if (_arg1 == "gun"){
_local6 = new GunBlock((_arg2 as MovieClip), g);
} else {
if (_arg1 == "electric"){
_local6 = new ElectricBlock(_arg2, g);
} else {
if (_arg1 == "spawn"){
_local6 = new SpawnBlock(_arg2, g);
} else {
if (_arg1 == "generator"){
_local6 = new GeneratorSwitch(_arg5, _arg2, g);
};
};
};
};
};
};
_local6.b = new Block((_arg3 * Game.scale), (_arg4 * Game.scale), Game.scale, Game.scale);
_local6.b.stacked = g.stack_map[_arg4][_arg3];
if (_arg1 == "electric"){
_local6.b.attachable = false;
_local7 = new ElectricMC();
new ElectricMC().x = (_local7.y = 32);
_local7.scaleX = ((Math.random() > 0.5)) ? 1 : -1;
_local7.scaleY = ((Math.random() > 0.5)) ? 1 : -1;
_local7.gotoAndPlay((1 + ((_local7.totalFrames * Math.random()) >> 0)));
_arg2.addChild(_local7);
};
if (_arg1 == "white"){
_local6.b.cutting = true;
};
return (_local6);
}
public function
(_arg1:int):Sprite{
return (new Sprite());
}
public function (_arg1:MovieClip){
_arg1.gotoAndPlay(((g.frame_count % _arg1.totalFrames) + 1));
}
public static function isBlock(_arg1):Boolean{
if (((!((((_arg1 >= 0)) || ((_arg1 <= 0))))) && ((_arg1 is String)))){
_arg1 = _arg1.match(/\d+/)[0];
};
return (((((((!((((_arg1 >= 0)) || ((_arg1 <= 0))))) && (_arg1.block))) && (!(_arg1.force_field)))) || ((((((_arg1 >= 0)) || ((_arg1 <= 0)))) && ((((((((((((((((((((((_arg1 >= 2)) && ((_arg1 <= 4)))) || ((((_arg1 >= 779)) && ((_arg1 <= 784)))))) || ((((_arg1 >= 0x0300)) && ((_arg1 <= 772)))))) || ((((_arg1 >= 48)) && ((_arg1 <= 56)))))) || ((((_arg1 >= 117)) && ((_arg1 <= 122)))))) || ((((_arg1 >= 158)) && ((_arg1 <= 375)))))) || ((((_arg1 >= 737)) && ((_arg1 <= 740)))))) || ((((_arg1 >= 753)) && ((_arg1 <= 761)))))) || ((((_arg1 >= 376)) && ((_arg1 <= 384)))))) || ((((_arg1 >= 385)) && ((_arg1 <= 414))))))))));
}
public static function isSpawn(_arg1):Boolean{
return (((((!((((_arg1 >= 0)) || ((_arg1 <= 0))))) && (_arg1.spawn))) || ((((((_arg1 >= 0)) || ((_arg1 <= 0)))) && ((((_arg1 >= 117)) && ((_arg1 <= 122))))))));
}
public static function isForceField(_arg1):Boolean{
if (((!((((_arg1 >= 0)) || ((_arg1 <= 0))))) && ((_arg1 is String)))){
_arg1 = _arg1.match(/\d+/)[0];
};
return (((((!((((_arg1 >= 0)) || ((_arg1 <= 0))))) && (_arg1.force_field))) || ((((((_arg1 >= 0)) || ((_arg1 <= 0)))) && ((((_arg1 == 46)) || ((_arg1 == 47))))))));
}
public static function isEnemy(_arg1):Boolean{
if (((!((((_arg1 >= 0)) || ((_arg1 <= 0))))) && ((_arg1 is String)))){
_arg1 = _arg1.match(/\d+/)[0];
};
return ((((((_arg1 >= 0)) || ((_arg1 <= 0)))) && ((((((((((((((((_arg1 >= 22)) && ((_arg1 <= 25)))) || ((_arg1 == 29)))) || ((((_arg1 >= 31)) && ((_arg1 <= 45)))))) || ((((_arg1 >= 57)) && ((_arg1 <= 60)))))) || ((((_arg1 >= 63)) && ((_arg1 <= 70)))))) || ((((_arg1 >= 105)) && ((_arg1 <= 111)))))) || ((((_arg1 >= 155)) && ((_arg1 <= 156))))))));
}
}
}//package com.nitrome.engine_specific
Section 71
//Trail (com.nitrome.engine_specific.Trail)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
public class Trail {
public var
:Number;
public var length:int;
public var dots:Array;
public function Trail(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number){
var _local5:int;
super();
dots = [];
this.length = _arg3;
this.
= _arg4;
_local5 = 0;
while (_local5 < _arg3) {
dots.push(new Dot(_arg1, _arg2));
_local5++;
};
}
public function move(_arg1:Number, _arg2:Number):void{
dots[(dots.length - 1)].x = _arg1;
dots[(dots.length - 1)].y = _arg2;
}
public function (_arg1:Number, _arg2:Number):void{
var _local3:int;
_local3 = 0;
while (_local3 < dots.length) {
dots[_local3].x = _arg1;
dots[_local3].y = _arg2;
_local3++;
};
}
public function main():void{
var _local1:int;
_local1 = (length - 2);
while (_local1 > -1) {
dots[_local1].x = (dots[_local1].x - ((dots[_local1].x - dots[(_local1 + 1)].x) *
));
dots[_local1].y = (dots[_local1].y - ((dots[_local1].y - dots[(_local1 + 1)].y) *
));
_local1--;
};
}
}
}//package com.nitrome.engine_specific
Section 72
//TripWire (com.nitrome.engine_specific.TripWire)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class TripWire extends Encounter {
public var paused:Boolean;
public var wobble_alpha:Number;
public var
:int;
public var type:int;
public var beam_width:int;
public var cast:RayCastReport;
public var other_way:Boolean;// = false
public var strength:Number;
public var orient:int;
public var :int;
public var :int;
public var sparks:MovieClip;
public var :Number;
public var :Number;
public var alpha:Array;
private var i:int;
public var scan:Line;
public var pause_count:int;// = 0
public var killer:Boolean;
public var controlled:Boolean;
public var wobble:int;
public var dir:int;
public var :int;
public var wobble_step:int;
public var collision_rect:Rect;
public var angle:int;// = 0
public var cols:Array;
private static const SCAN_ALPHA:Array = [0.15, 0.15, 0.15];
public static const FIXED_VARIABLE:int = 4;
public static const SCAN_WOBBLE_STEP:int = 6;
public static const KILL_WOBBLE_ALPHA:Number = 0.25;
public static const SCAN_WOBBLE_ALPHA:Number = 0.05;
public static const FIXED:int = 1;
public static const LEFT:int = 8;
public static const KILL_WOBBLE_STEP:int = 12;
public static const UP:int = 1;
private static const KILL_ALPHA:Array = [0.45, 0.25, 0.15];
public static const TURNING:int = 2;
public static const SPEED:Number = 2;
public static const DOWN:int = 4;
public static const SCAN_WIDTH:int = 2;
public static const KILLER_WIDTH:int = 5;
private static const KILL_COLS:Array = [16304135, 0xF89200, 14116875];
private static const SCAN_COLS:Array = [6173899, 0xFF0600, 0xFF0600];
public static const RIGHT:int = 2;
public static const WARM_UP_STEP:Number = 0.02;
public static var TURN_SPEED:int = 1;
public function TripWire(_arg1:int, _arg2:int, _arg3:Sprite, _arg4:Game, _arg5:Boolean=false){
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Dot;
var _local11:Number;
var _local12:int;
var _local13:int;
angle = 0;
other_way = false;
pause_count = 0;
super(_arg3, _arg4, false);
this.type = _arg1;
this.dir = _arg2;
this.killer = _arg5;
cols = (_arg5) ? KILL_COLS : SCAN_COLS;
alpha = (_arg5) ? KILL_ALPHA : SCAN_ALPHA;
beam_width = (_arg5) ? KILLER_WIDTH : SCAN_WIDTH;
wobble_step = (_arg5) ? KILL_WOBBLE_STEP : SCAN_WOBBLE_STEP;
wobble_alpha = (_arg5) ? KILL_WOBBLE_ALPHA : SCAN_WOBBLE_ALPHA;
if (_arg5){
sparks = new LaserGunSparksMC();
_arg4.effect_holder.addChild(sparks);
sparks.visible = false;
if (_arg1 == FIXED){
if (_arg2 == UP){
sparks.rotation = 180;
} else {
if (_arg2 == RIGHT){
sparks.rotation = 90;
} else {
if (_arg2 == LEFT){
sparks.rotation = -90;
};
};
};
};
};
strength = 0;
if (((forced) || (!((_arg4.alert_state == Game.ACTIVE))))){
strength = 1;
};
map_x = ((x * Game.SCALE) >> 0);
map_y = ((y * Game.SCALE) >> 0);
has_main = true;
free = true;
if (_arg1 == TURNING){
collision_rect = new Rect();
_local6 = (_arg4.scroller.width * Game.scale);
_local7 = (_arg4.scroller.height * Game.scale);
_local8 = 0;
_local9 = 0;
if (_arg2 == UP){
_local10 = new Dot((32 + (Game.scale * map_x)), (-1 + (map_y * Game.scale)));
scan = new Line(_local10, new Dot(_local10.x, (_local10.y - ((_arg4.scroller.width * _arg4.scroller.height) * Game.scale))));
= 180;
= 360;
} else {
if (_arg2 == RIGHT){
_local10 = new Dot((Game.scale * (map_x + 1)), (32 + (map_y * Game.scale)));
scan = new Line(_local10, new Dot((_local10.x + ((_arg4.scroller.width * _arg4.scroller.height) * Game.scale)), _local10.y));
= 270;
= 450;
} else {
if (_arg2 == DOWN){
_local10 = new Dot((32 + (Game.scale * map_x)), ((map_y + 1) * Game.scale));
scan = new Line(_local10, new Dot(_local10.x, (_local10.y + ((_arg4.scroller.width * _arg4.scroller.height) * Game.scale))));
= 0;
= 180;
} else {
if (_arg2 == LEFT){
_local10 = new Dot((-1 + (Game.scale * map_x)), (32 + (map_y * Game.scale)));
scan = new Line(_local10, new Dot((_local10.x - ((_arg4.scroller.width * _arg4.scroller.height) * Game.scale)), _local10.y));
= 90;
= 270;
};
};
};
};
_local11 = -(scan.len);
i = 0;
while (i < 178) {
angle = (( + i) % 360);
rotate();
cast = RayCast.initCast(scan, _arg4.block_map);
if (cast != null){
if (cast.ax < _local6){
_local6 = cast.ax;
};
if (cast.ay < _local7){
_local7 = cast.ay;
};
if (cast.ax > _local8){
_local8 = cast.ax;
};
if (cast.ay > _local9){
_local9 = cast.ay;
};
if (RayCast.
> _local11){
_local11 = RayCast.
;
};
};
i++;
};
collision_rect.x = _local6;
collision_rect.y = _local7;
collision_rect.width = (_local8 - _local6);
collision_rect.height = (_local9 - _local7);
scan.len = _local11;
getCurrentAngle();
actor_target = false;
on_scroller = false;
} else {
if (_arg1 == FIXED){
if (_arg2 == UP){
_local12 = map_x;
_local13 = (map_y - 1);
while (_local13 > 0) {
if (_arg4.stack_map[_local13][_local12] > Game.EMPTY){
break;
};
_local13--;
};
collision_rect = new Rect((30 + (Game.scale * _local12)), ((_local13 + 1) * Game.scale), 4, (((map_y - 1) - _local13) * Game.scale));
scan = new Line(new Dot((32 + (Game.scale * map_x)), (map_y * Game.scale)), new Dot((32 + (Game.scale * map_x)), ((_local13 + 1) * Game.scale)));
} else {
if (_arg2 == RIGHT){
_local13 = map_y;
_local12 = (map_x + 1);
while (_local12 < _arg4.scroller.width) {
if (_arg4.stack_map[_local13][_local12] > Game.EMPTY){
break;
};
_local12++;
};
collision_rect = new Rect((Game.scale * (map_x + 1)), (30 + (_local13 * Game.scale)), (((_local12 - 1) - map_x) * Game.scale), 4);
scan = new Line(new Dot((Game.scale * (map_x + 1)), (32 + (map_y * Game.scale))), new Dot((Game.scale * _local12), (32 + (map_y * Game.scale))));
} else {
if (_arg2 == DOWN){
_local12 = map_x;
_local13 = (map_y + 1);
while (_local13 < _arg4.scroller.height) {
if (_arg4.stack_map[_local13][_local12] > Game.EMPTY){
break;
};
_local13++;
};
collision_rect = new Rect((30 + (Game.scale * _local12)), ((map_y + 1) * Game.scale), 4, (((_local13 - 1) - map_y) * Game.scale));
scan = new Line(new Dot((32 + (Game.scale * map_x)), ((map_y + 1) * Game.scale)), new Dot((32 + (Game.scale * _local12)), (_local13 * Game.scale)));
} else {
if (_arg2 == LEFT){
_local13 = map_y;
_local12 = (map_x - 1);
while (_local12 > 0) {
if (_arg4.stack_map[_local13][_local12] > Game.EMPTY){
break;
};
_local12--;
};
collision_rect = new Rect((Game.scale * (_local12 + 1)), (30 + (_local13 * Game.scale)), (((map_x - 1) - _local12) * Game.scale), 4);
scan = new Line(new Dot((Game.scale * map_x), (32 + (map_y * Game.scale))), new Dot((Game.scale * (_local12 + 1)), (32 + (map_y * Game.scale))));
};
};
};
};
} else {
if (_arg1 == FIXED_VARIABLE){
if (_arg2 == UP){
collision_rect = new Rect((30 + (Game.scale * map_x)), 0, 4, (map_y * Game.scale));
scan = new Line(new Dot((32 + (Game.scale * map_x)), (-1 + (map_y * Game.scale))), new Dot((32 + (Game.scale * map_x)), 0));
} else {
if (_arg2 == RIGHT){
collision_rect = new Rect((Game.scale * (map_x + 1)), (30 + (map_y * Game.scale)), (((_arg4.scroller.width - map_x) - 1) * Game.scale), 4);
scan = new Line(new Dot((Game.scale * (map_x + 1)), (32 + (map_y * Game.scale))), new Dot((Game.scale * _arg4.scroller.width), (32 + (map_y * Game.scale))));
} else {
if (_arg2 == DOWN){
collision_rect = new Rect((30 + (Game.scale * _local12)), ((map_y + 1) * Game.scale), 4, (((_arg4.scroller.height - map_y) - 1) * Game.scale));
scan = new Line(new Dot((32 + (Game.scale * map_x)), ((map_y + 1) * Game.scale)), new Dot((32 + (Game.scale * map_x)), (_arg4.scroller.height * Game.scale)));
} else {
if (_arg2 == LEFT){
collision_rect = new Rect(0, (30 + (_local13 * Game.scale)), (-1 + (map_x * Game.scale)), 4);
scan = new Line(new Dot((-1 + (Game.scale * map_x)), (32 + (map_y * Game.scale))), new Dot(0, (32 + (map_y * Game.scale))));
};
};
};
};
};
};
};
controlled = ((!((_arg4.path_map[map_y][map_x] == 0))) || (!((((_arg4.path_map[map_y][map_x] >= 0)) || ((_arg4.path_map[map_y][map_x] <= 0))))));
if (controlled){
_local12 = _arg3.x;
_local13 = _arg3.y;
orient = _arg2;
= (scan.a.x - _local12);
= (scan.a.y - _local13);
paused = false;
pause_count = 0;
selectPatrolPath();
free = true;
};
if ((((_arg1 == TURNING)) || ((_arg1 == FIXED_VARIABLE)))){
cast = RayCast.cast(scan, _arg4.block_map, true);
};
}
override public function intersects(_arg1:Rect):Boolean{
if ((((type == TURNING)) || ((type == FIXED_VARIABLE)))){
if (((!(killer)) && (((g.player.chameleon) || ((g.player.state == Player.STEALTH)))))){
return (false);
};
return (RayCast.reportIntersectsRect(scan, cast, g.player.collision_rect));
} else {
if (type == FIXED){
if (((!(killer)) && (((g.player.chameleon) || ((g.player.state == Player.STEALTH)))))){
return (false);
};
return (collision_rect.intersects(_arg1));
};
};
return (false);
}
public function updateMC():void{
wobble = ((wobble + wobble_step) % 360);
if (type == FIXED){
i = 1;
while (i < 4) {
g.scan_holder.graphics.lineStyle((i * beam_width), cols[(i - 1)], (strength * (alpha[(i - 1)] + Math.abs((Trig.sin[wobble] * wobble_alpha)))));
g.scan_holder.graphics.moveTo(scan.a.x, scan.a.y);
g.scan_holder.graphics.lineTo(scan.b.x, scan.b.y);
i++;
};
} else {
if ((((type == TURNING)) || ((type == FIXED_VARIABLE)))){
if (type == TURNING){
(mc as MovieClip).scanner.rotation = (angle + 180);
if (killer){
(mc as MovieClip).scanner.rotation = ((mc as MovieClip).scanner.rotation + 180);
};
};
i = 1;
while (i < 4) {
g.scan_holder.graphics.lineStyle((i * beam_width), cols[(i - 1)], (strength * (alpha[(i - 1)] + Math.abs((Trig.sin[wobble] * wobble_alpha)))));
g.scan_holder.graphics.moveTo(scan.a.x, scan.a.y);
if (cast != null){
g.scan_holder.graphics.lineTo(cast.ax, cast.ay);
} else {
g.scan_holder.graphics.lineTo(scan.b.x, scan.b.y);
};
i++;
};
};
};
if (killer){
if (type == FIXED){
sparks.visible = true;
sparks.x = scan.b.x;
sparks.y = scan.b.y;
} else {
if (cast != null){
sparks.x = cast.ax;
sparks.y = cast.ay;
if (cast.access_side == UP){
sparks.rotation = 0;
} else {
if (cast.access_side == RIGHT){
sparks.rotation = 90;
} else {
if (cast.access_side == DOWN){
sparks.rotation = 180;
} else {
if (cast.access_side == LEFT){
sparks.rotation = -90;
};
};
};
};
if (((!(Util.proximity(scan.a.x, scan.a.y, cast.ax, cast.ay, 70))) || ((type == FIXED_VARIABLE)))){
sparks.visible = true;
sparks.alpha = strength;
} else {
sparks.visible = false;
};
} else {
sparks.visible = false;
};
};
};
}
public function getCurrentAngle():void{
angle = (g.frame_count % 360);
if (other_way){
angle = ((angle + 180) % 360);
};
if (angle > 180){
= -(TURN_SPEED);
angle = (angle % 180);
angle = (
- angle);
} else {
= TURN_SPEED;
angle = (angle + );
};
}
public function rotate():void{
scan.dx = Trig.cos[(angle % 360)];
scan.dy = Trig.sin[(angle % 360)];
scan.vx = (scan.dx * scan.len);
scan.vy = (scan.dy * scan.len);
scan.b.x = (scan.a.x + scan.vx);
scan.b.y = (scan.a.y + scan.vy);
scan.rx = -(scan.dy);
scan.ry = scan.dx;
scan.lx = scan.dy;
scan.ly = -(scan.dx);
}
override public function remove():void{
if (((killer) && (!((sparks.parent == null))))){
sparks.parent.removeChild(sparks);
};
super.remove();
}
public function main():void{
on_scroller = g.scroller.contains(x, y);
if (((!(forced)) && (!(on_scroller)))){
strength = (strength - WARM_UP_STEP);
if (strength <= 0){
map_x = (x * Game.SCALE);
map_y = (y * Game.SCALE);
remove();
return;
};
} else {
if ((((strength < 1)) && (((!((g.alert_state == Game.ACTIVE))) || (killer))))){
strength = (strength + WARM_UP_STEP);
} else {
if ((((strength > 0)) && ((((g.alert_state == Game.ACTIVE)) && (!(killer)))))){
strength = (strength - WARM_UP_STEP);
};
};
};
if (controlled){
if (dir == UP){
y = (y - SPEED);
} else {
if (dir == RIGHT){
x = (x + SPEED);
} else {
if (dir == DOWN){
y = (y + SPEED);
} else {
if (dir == LEFT){
x = (x - SPEED);
};
};
};
};
if ((((dir == RIGHT)) || ((dir == LEFT)))){
map_x = (x * Game.SCALE);
if ((x * Game.SCALE) == map_x){
selectPatrolPath();
};
} else {
if ((((dir == UP)) || ((dir == DOWN)))){
map_y = (y * Game.SCALE);
if ((y * Game.SCALE) == map_y){
selectPatrolPath();
};
} else {
if (dir == Path.STOPPED){
selectPatrolPath();
};
};
};
if (type == TURNING){
scan.a.x = (x + );
scan.a.y = (y + );
} else {
if ((((type == FIXED)) || ((type == FIXED_VARIABLE)))){
if ((((orient == UP)) || ((orient == DOWN)))){
scan.a.x = (x + );
scan.b.x = (x + );
collision_rect.x = ((-2 + x) + );
} else {
if ((((orient == RIGHT)) || ((orient == LEFT)))){
scan.a.y = (y + );
scan.b.y = (y + );
collision_rect.y = ((-2 + y) + );
};
};
};
};
mc.x = x;
mc.y = y;
};
if (type == TURNING){
if ( > 0){
if (angle >=
){
angle =
;
= -(TURN_SPEED);
};
} else {
if (angle <= ){
angle = ;
= TURN_SPEED;
};
};
angle = (angle + );
rotate();
};
if ((((type == TURNING)) || ((type == FIXED_VARIABLE)))){
cast = RayCast.cast(scan, g.block_map, true);
};
updateMC();
}
override public function resolvePlayerCollision(_arg1:Player):void{
if (strength >= 1){
if (!killer){
g.alert();
} else {
_arg1.hit();
};
};
}
public function selectPatrolPath():void{
if (pause_count == -1){
return;
};
if ((((dir == Path.STOPPED)) && ((pause_count > 0)))){
pause_count--;
return;
};
Path.getDir(dir, g.path_map, null, map_x, map_y);
dir = Path.dir;
pause_count = (paused) ? 0 : Path.pause_delay;
if (pause_count > 0){
dir = Path.STOPPED;
paused = true;
return;
};
paused = false;
}
}
}//package com.nitrome.engine_specific
Section 73
//WaterLine (com.nitrome.engine_specific.WaterLine)
package com.nitrome.engine_specific {
import com.nitrome.engine.*;
import flash.display.*;
public class WaterLine extends Encounter {
public function WaterLine(_arg1:Sprite, _arg2:Game){
super(_arg1, _arg2, true);
has_main = true;
has_collision = false;
}
public function main():void{
mc.x = -(g.canvas.x);
}
}
}//package com.nitrome.engine_specific
Section 74
//BackButton (com.nitrome.game.BackButton)
package com.nitrome.game {
import flash.events.*;
public class BackButton extends SimpleButton {
public function BackButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.transition.doTween("title_screen");
}
}
}//package com.nitrome.game
Section 75
//ContinueEndButton (com.nitrome.game.ContinueEndButton)
package com.nitrome.game {
import flash.events.*;
import com.nitrome.engine_specific.*;
public class ContinueEndButton extends SimpleButton {
public function ContinueEndButton(){
addFrameScript(0, frame1);
}
function doStuff():void{
NitromeGame.timeline.game.clearListeners();
NitromeGame.timeline.popup_holder.key_pressed = true;
NitromeGame.timeline.popup_holder.hidePopUp();
StoryClip.next_frame = "congrats";
StoryClip.list = StoryClip.STORY[StoryClip.REAL_END];
NitromeGame.timeline.tt.doTween("story");
NitromeGame.sound_manager.stopMusicFadeOut();
NitromeGame.setGameComplete();
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
if (!NitromeGame.timeline.popup_holder.key_pressed){
doStuff();
};
}
}
}//package com.nitrome.game
Section 76
//ContinueGameButton (com.nitrome.game.ContinueGameButton)
package com.nitrome.game {
import flash.events.*;
public class ContinueGameButton extends SimpleButton {
public function ContinueGameButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.timeline.game.pauseGame();
}
}
}//package com.nitrome.game
Section 77
//ContinueGameHelpButton (com.nitrome.game.ContinueGameHelpButton)
package com.nitrome.game {
import flash.events.*;
public class ContinueGameHelpButton extends SimpleButton {
public function ContinueGameHelpButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.timeline.game.pauseGame();
}
}
}//package com.nitrome.game
Section 78
//CreditsButton (com.nitrome.game.CreditsButton)
package com.nitrome.game {
import flash.events.*;
public class CreditsButton extends SimpleButton {
public function CreditsButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.transition.doTween("credits");
}
}
}//package com.nitrome.game
Section 79
//FxToggle (com.nitrome.game.FxToggle)
package com.nitrome.game {
import flash.events.*;
public class FxToggle extends SimpleButton {
public function FxToggle(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 29, frame30);
if (!NitromeGame.sfx){
gotoAndStop("_off_up");
} else {
gotoAndStop("_on_up");
};
addEventListener(MouseEvent.CLICK, onClick);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame20(){
stop();
}
function frame30(){
stop();
}
override protected function updateGraphic():void{
if (over){
if (NitromeGame.sound_manager.sfx){
gotoAndStop("_on_over");
} else {
if (!NitromeGame.sound_manager.sfx){
gotoAndStop("_off_over");
};
};
} else {
if (NitromeGame.sound_manager.sfx){
gotoAndStop("_on_up");
} else {
if (!NitromeGame.sound_manager.sfx){
gotoAndStop("_off_up");
};
};
};
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.sound_manager.toggleSfx();
updateGraphic();
}
}
}//package com.nitrome.game
Section 80
//GameHelpButton (com.nitrome.game.GameHelpButton)
package com.nitrome.game {
import flash.events.*;
public class GameHelpButton extends SimpleButton {
public function GameHelpButton(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.timeline.game.pauseGame(true);
}
}
}//package com.nitrome.game
Section 81
//HelpArrowButtonLeft (com.nitrome.game.HelpArrowButtonLeft)
package com.nitrome.game {
import flash.display.*;
import flash.events.*;
public class HelpArrowButtonLeft extends SimpleButton {
public function HelpArrowButtonLeft(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
(parent as MovieClip).gotoAndStop((((parent as MovieClip).currentFrame == 1)) ? (parent as MovieClip).totalFrames : ((parent as MovieClip).currentFrame - 1));
}
}
}//package com.nitrome.game
Section 82
//HelpArrowButtonRight (com.nitrome.game.HelpArrowButtonRight)
package com.nitrome.game {
import flash.display.*;
import flash.events.*;
public class HelpArrowButtonRight extends SimpleButton {
public function HelpArrowButtonRight(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
(parent as MovieClip).gotoAndStop((((parent as MovieClip).currentFrame == (parent as MovieClip).totalFrames)) ? 1 : ((parent as MovieClip).currentFrame + 1));
}
}
}//package com.nitrome.game
Section 83
//HelpButton (com.nitrome.game.HelpButton)
package com.nitrome.game {
import flash.events.*;
public class HelpButton extends SimpleButton {
public function HelpButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.transition.doTween("help");
}
}
}//package com.nitrome.game
Section 84
//Key (com.nitrome.game.Key)
package com.nitrome.game {
import flash.display.*;
import flash.events.*;
public class Key {
public static const NUMBER_0:uint = 48;
public static const NUMBER_1:uint = 49;
public static const NUMBER_2:uint = 50;
public static const NUMBER_3:uint = 51;
public static const NUMBER_4:uint = 52;
public static const NUMBER_5:uint = 53;
public static const NUMBER_6:uint = 54;
public static const NUMBER_7:uint = 55;
public static const NUMBER_8:uint = 56;
public static const NUMBER_9:uint = 57;
public static const D:uint = 68;
public static const E:uint = 69;
public static const F:uint = 70;
public static const G:uint = 71;
public static const A:uint = 65;
public static const I:uint = 73;
public static const C:uint = 67;
public static const K:uint = 75;
public static const L:uint = 76;
public static const M:uint = 77;
public static const N:uint = 78;
public static const H:uint = 72;
public static const P:uint = 80;
public static const B:uint = 66;
public static const R:uint = 82;
public static const S:uint = 83;
public static const U:uint = 85;
public static const O:uint = 79;
public static const Q:uint = 81;
public static const J:uint = 74;
public static const Z:uint = 90;
public static const T:uint = 84;
public static const V:uint = 86;
public static const W:uint = 87;
public static const X:uint = 88;
public static const Y:uint = 89;
public static var stage:Stage;
private static var keysDown:Array = [];
private static var initialized:Boolean = false;
public static var keys_pressed:int = 0;
public static function init(_arg1:Stage){
if (!initialized){
stage = _arg1;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
stage.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = [];
keys_pressed = 0;
}
public static function forceClearKeys():void{
keysDown = [];
keys_pressed = 0;
}
private static function keyPressed(_arg1:KeyboardEvent):void{
if (!Boolean(keysDown[_arg1.keyCode])){
keys_pressed++;
};
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = false;
keys_pressed--;
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean(keysDown[_arg1]));
}
}
}//package com.nitrome.game
Section 85
//LevelChooserButton (com.nitrome.game.LevelChooserButton)
package com.nitrome.game {
import flash.display.*;
import flash.events.*;
import com.nitrome.engine_specific.*;
public class LevelChooserButton extends SimpleButton {
private var active:Boolean;
private var id:int;
public var bottom:MovieClip;
public var :int;
public var top:MovieClip;
public var :int;// = 10
public var
:String;
public var :Boolean;// = false
public var _mask:MovieClip;
public static const up_col:int = 0x838383;
public static const over_col:int = 0xFFAA00;
public function LevelChooserButton(){
= false;
= 10;
super();
id = int(name.slice(6));
if (NitromeGame.getLevelUnlocked(id)){
active = true;
useHandCursor = true;
} else {
active = false;
useHandCursor = false;
};
updateGraphic();
= ((!(NitromeGame.completed)) && ((NitromeGame.last_level == id)));
if ( ){
addEventListener(Event.ENTER_FRAME, , false, 0, true);
= ;
};
}
public function (_arg1:Event):void{
updateGraphic();
}
override protected function updateGraphic():void{
if (active){
_mask.gotoAndStop((id + 1));
top.gotoAndStop((id + 1));
bottom.gotoAndStop((id + 1));
if (over){
top.visible = true;
} else {
if ( ){
if (-- <= 0){
= ;
top.visible = !(top.visible);
};
} else {
top.visible = false;
};
};
} else {
visible = false;
};
}
override public function onClick(_arg1:MouseEvent):void{
if (active){
NitromeGame.selected_level = id;
Score.value = 0;
if (id == 0){
StoryClip.next_frame = "game";
StoryClip.list = StoryClip.STORY[StoryClip.INTRO];
NitromeGame.timeline.tt.doTween("story");
NitromeGame.sound_manager.stopMusicFadeOut();
} else {
NitromeGame.timeline.tt.doTween("game");
NitromeGame.sound_manager.crossFade(SoundManager.GAME);
};
};
updateGraphic();
}
}
}//package com.nitrome.game
Section 86
//LevelSelectButton (com.nitrome.game.LevelSelectButton)
package com.nitrome.game {
import flash.events.*;
public class LevelSelectButton extends SimpleButton {
public function LevelSelectButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.timeline.game.clearListeners();
NitromeGame.transition.doTween("choose_level");
NitromeGame.sound_manager.crossFade(SoundManager.MENU);
}
}
}//package com.nitrome.game
Section 87
//MiniclipLogo (com.nitrome.game.MiniclipLogo)
package com.nitrome.game {
import flash.events.*;
import flash.net.*;
public class MiniclipLogo extends SimpleButton {
public function MiniclipLogo(){
addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
override public function onClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.miniclip.com"), "_blank");
}
}
}//package com.nitrome.game
Section 88
//MsgPanel (com.nitrome.game.MsgPanel)
package com.nitrome.game {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class MsgPanel extends MovieClip {
public var count:int;
public var msg:TextField;
public var state:int;
public var step:Number;
public static const FADE_DELAY:int = 25;
public static const FADE_IN:int = 2;
public static const HIDDEN:int = 8;
public static const FADE_OUT:int = 4;
public static const VISIBLE:int = 1;
public static const VISIBLE_DELAY:int = 50;
public function MsgPanel(){
visible = false;
alpha = 0;
state = HIDDEN;
count = 0;
step = (1 / FADE_DELAY);
}
public function onEnterFrame(_arg1:Event):void{
if (state == FADE_IN){
alpha = (alpha + step);
if (alpha >= 1){
state = VISIBLE;
};
} else {
if (state == VISIBLE){
count++;
if (count >= VISIBLE_DELAY){
state = FADE_OUT;
};
} else {
if (state == FADE_OUT){
alpha = (alpha - step);
if (alpha <= 0){
state = HIDDEN;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
visible = false;
};
};
};
};
}
public function setMsg(_arg1:String):void{
msg.text = _arg1.toUpperCase();
state = FADE_IN;
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
count = 0;
visible = true;
}
}
}//package com.nitrome.game
Section 89
//MusicToggle (com.nitrome.game.MusicToggle)
package com.nitrome.game {
import flash.events.*;
public class MusicToggle extends SimpleButton {
public function MusicToggle(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 29, frame30);
if (!NitromeGame.music){
gotoAndStop("_off_up");
} else {
gotoAndStop("_on_up");
};
addEventListener(MouseEvent.CLICK, onClick);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame20(){
stop();
}
function frame30(){
stop();
}
override protected function updateGraphic():void{
if (over){
if (NitromeGame.sound_manager.music){
gotoAndStop("_on_over");
} else {
if (!NitromeGame.sound_manager.music){
gotoAndStop("_off_over");
};
};
} else {
if (NitromeGame.sound_manager.music){
gotoAndStop("_on_up");
} else {
if (!NitromeGame.sound_manager.music){
gotoAndStop("_off_up");
};
};
};
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.sound_manager.toggleMusic();
updateGraphic();
}
}
}//package com.nitrome.game
Section 90
//NextLevelButton (com.nitrome.game.NextLevelButton)
package com.nitrome.game {
import flash.events.*;
import com.nitrome.engine_specific.*;
public class NextLevelButton extends SimpleButton {
public function NextLevelButton(){
addFrameScript(0, frame1);
}
function doStuff():void{
NitromeGame.timeline.game.clearListeners();
NitromeGame.selected_level++;
NitromeGame.timeline.popup_holder.hidePopUp();
if (NitromeGame.selected_level == 1){
StoryClip.next_frame = "game";
StoryClip.list = StoryClip.STORY[StoryClip.CAPTURED];
NitromeGame.timeline.tt.doTween("story");
NitromeGame.sound_manager.stopMusicFadeOut();
} else {
if (NitromeGame.selected_level == 10){
StoryClip.next_frame = "game";
StoryClip.list = StoryClip.STORY[StoryClip.FIRST_BOSS];
NitromeGame.timeline.tt.doTween("story");
NitromeGame.sound_manager.stopMusicFadeOut();
} else {
if (NitromeGame.selected_level == 21){
StoryClip.next_frame = "game";
StoryClip.list = StoryClip.STORY[StoryClip.SECOND_BOSS];
NitromeGame.timeline.tt.doTween("story");
NitromeGame.sound_manager.stopMusicFadeOut();
} else {
if (NitromeGame.selected_level == 22){
StoryClip.next_frame = "game";
StoryClip.list = StoryClip.STORY[StoryClip.FAKE_END];
NitromeGame.timeline.tt.doTween("story");
NitromeGame.sound_manager.stopMusicFadeOut();
} else {
NitromeGame.transition.doTween("game_reset");
};
};
};
};
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
if (!NitromeGame.timeline.popup_holder.key_pressed){
doStuff();
};
}
}
}//package com.nitrome.game
Section 91
//NitromeButton (com.nitrome.game.NitromeButton)
package com.nitrome.game {
import flash.events.*;
import flash.net.*;
public class NitromeButton extends SimpleButton {
public function NitromeButton(){
addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
override public function onClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.nitrome.com"), "_blank");
}
}
}//package com.nitrome.game
Section 92
//PauseButton (com.nitrome.game.PauseButton)
package com.nitrome.game {
import flash.events.*;
public class PauseButton extends SimpleButton {
public function PauseButton(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.timeline.game.pauseGame();
}
}
}//package com.nitrome.game
Section 93
//PlayButton (com.nitrome.game.PlayButton)
package com.nitrome.game {
import flash.events.*;
public class PlayButton extends SimpleButton {
public function PlayButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.transition.doTween("choose_level");
}
}
}//package com.nitrome.game
Section 94
//PlayGameButton (com.nitrome.game.PlayGameButton)
package com.nitrome.game {
import flash.events.*;
import com.nitrome.engine_specific.*;
public class PlayGameButton extends SimpleButton {
public function PlayGameButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
Score.value = 0;
if (NitromeGame.last_level < NitromeGame.total_levels){
NitromeGame.selected_level = NitromeGame.last_level;
} else {
NitromeGame.selected_level = 0;
};
if (NitromeGame.selected_level == 0){
StoryClip.next_frame = "game";
StoryClip.list = StoryClip.STORY[StoryClip.INTRO];
NitromeGame.timeline.tt.doTween("story");
NitromeGame.sound_manager.stopMusicFadeOut();
} else {
NitromeGame.timeline.tt.doTween("game");
NitromeGame.sound_manager.crossFade(SoundManager.GAME);
};
}
}
}//package com.nitrome.game
Section 95
//PopUpHolder (com.nitrome.game.PopUpHolder)
package com.nitrome.game {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class PopUpHolder extends MovieClip {
public var popup_clip:MovieClip;
private var :Boolean;
public var key_pressed:Boolean;
private var :String;
public function PopUpHolder(){
addFrameScript(0, frame1, 1, frame2, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
popup_clip.gotoAndStop("wait");
stop();
}
function frame2(){
popup_clip.gotoAndStop();
}
public function hidePopUp():void{
= true;
key_pressed = true;
= "wait";
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
gotoAndPlay("out");
}
public function onEnterFrame(_arg1:Event):void{
if ((((((((currentFrame == NitromeGame.POPUP_HOLDER_FRAME)) && (Key.isDown(Keyboard.SPACE)))) && (!(key_pressed)))) && (!()))){
key_pressed = true;
if ( == "level_complete"){
popup_clip.next_level_button.doStuff();
} else {
if ( == "game_over"){
popup_clip.try_again_button.doStuff();
} else {
if ( == "final_level_complete"){
popup_clip.continue_end_button.doStuff();
};
};
};
= true;
};
if ((((currentFrame == NitromeGame.POPUP_HOLDER_FRAME)) && (!(Key.isDown(Keyboard.SPACE))))){
key_pressed = false;
};
}
public function launchPopUp(_arg1:String):void{
= _arg1;
key_pressed = false;
= false;
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
gotoAndPlay(2);
}
}
}//package com.nitrome.game
Section 96
//QuitGameButton (com.nitrome.game.QuitGameButton)
package com.nitrome.game {
import flash.events.*;
public class QuitGameButton extends SimpleButton {
public function QuitGameButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.timeline.game.clearListeners();
NitromeGame.transition.doTween("choose_level");
NitromeGame.sound_manager.crossFade(SoundManager.MENU);
}
}
}//package com.nitrome.game
Section 97
//Score (com.nitrome.game.Score)
package com.nitrome.game {
public class Score {
private static var r:int;
private static var _value:int;
private static var hash:String;
public static function init():void{
r = (int((Math.random() * 2000000)) - 1000000);
_value = r;
hash = _value.toString(16);
}
public static function verify():Boolean{
return ((_value.toString(16) == hash));
}
public static function get value():int{
return ((_value - r));
}
public static function set value(_arg1:int):void{
var _local2:Boolean;
_local2 = verify();
r = (int((Math.random() * 2000000)) - 1000000);
_value = (r + _arg1);
if (_local2){
hash = _value.toString(16);
};
}
}
}//package com.nitrome.game
Section 98
//ScoreTicker (com.nitrome.game.ScoreTicker)
package com.nitrome.game {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class ScoreTicker extends MovieClip {
private var :int;
private var :String;
private var :int;
private var
:int;
private var :int;
public var score_text:TextField;
private var inc:int;
private var :int;
private function
():void{
score_text.text = String();
}
private function (_arg1:Event):void{
= ( + inc);
if ( >=
){
=
;
();
removeEventListener(Event.ENTER_FRAME, );
();
} else {
();
};
}
private function ():void{
if ( != null){
parent[].startCount( , );
};
}
public function startCount(_arg1:int, _arg2:int):void{
= _arg1;
this.inc = _arg2;
if (this.inc == 0){
this.inc = 5;
};
= 0;
addEventListener(Event.ENTER_FRAME, , false, 0, true);
}
public function setOnFinish(_arg1:String, _arg2:int, _arg3:int):void{
= _arg1;
= _arg2;
= _arg3;
if ( == 0){
= 5;
};
}
}
}//package com.nitrome.game
Section 99
//SimpleButton (com.nitrome.game.SimpleButton)
package com.nitrome.game {
import flash.display.*;
import flash.events.*;
public class SimpleButton extends MovieClip {
public var i:int;
protected var over:Boolean;// = false
public function SimpleButton(){
over = false;
super();
mouseChildren = false;
buttonMode = true;
addEventListener(MouseEvent.MOUSE_OVER, , false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, , false, 0, true);
addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
protected function (_arg1:MouseEvent):void{
over = true;
updateGraphic();
}
protected function (_arg1:MouseEvent):void{
over = false;
updateGraphic();
}
protected function updateGraphic():void{
if (over){
gotoAndStop("_over");
} else {
gotoAndStop("_up");
};
}
public function onClick(_arg1:MouseEvent):void{
}
}
}//package com.nitrome.game
Section 100
//SoundManager (com.nitrome.game.SoundManager)
package com.nitrome.game {
import flash.display.*;
import flash.media.*;
public class SoundManager extends SoundManagerSuper {
protected const GAME_VOLUME:Number = 1;
protected const BEAM_VOLUME:Number = 0.6;
protected const MENU_VOLUME:Number = 1;
public var coins:MovieClip;
public var star_hit:MovieClip;
public var jump:MovieClip;
public var cough:MovieClip;
public var wom:MovieClip;
public var smithhit:MovieClip;
public var finalninja:MovieClip;
public var tang:MovieClip;
public var bang1:MovieClip;
public var bang2:MovieClip;
public var chop:MovieClip;
public var lift:MovieClip;
public var bang3:MovieClip;
public var oishii:MovieClip;
public var bang4:MovieClip;
public var electric:MovieClip;
public var missile:MovieClip;
public var powerdown:MovieClip;
public var hack:MovieClip;
public var bosslaugh:MovieClip;
public var grenade:MovieClip;
public var alert:MovieClip;
public var scientisthit:MovieClip;
public var msg:MovieClip;
public var machinegun:MovieClip;
public var smithdie:MovieClip;
public var aiiee:MovieClip;
public var cammo:MovieClip;
public var bossouch:MovieClip;
public var sword1:MovieClip;
public var yatta:MovieClip;
public var sword2:MovieClip;
public static const GAME:int = 1;
public static const MENU:int = 0;
public static const BEAM:int = 0;
public function SoundManager(){
NitromeGame.sound_manager = this;
music_loops.push(new MenuMusic());
music_loops.push(new GameMusic());
music_transforms.push(new SoundTransform(MENU_VOLUME, 0));
music_transforms.push(new SoundTransform(GAME_VOLUME, 0));
music_channels.push(new SoundChannel());
music_channels.push(new SoundChannel());
music_volumes.push(MENU_VOLUME);
music_volumes.push(GAME_VOLUME);
= uint.MAX_VALUE;
}
}
}//package com.nitrome.game
Section 101
//SoundManagerSuper (com.nitrome.game.SoundManagerSuper)
package com.nitrome.game {
import flash.display.*;
import flash.events.*;
public class SoundManagerSuper extends MovieClip {
protected const CROSS_FADE_SPEED:Number = 0.05;
protected const LOOP_FADE_SPEED:Number = 0.1;
protected var :Array;
protected var :Array;
public var
:int;
protected var :Boolean;// = true
protected var :Array;
protected var
;
protected var :Array;
protected var music_volumes:Array;
public var :Boolean;// = false
public var :Boolean;// = false
protected var :int;
protected var music_channels:Array;
protected var music_loops:Array;
protected var
:Array;
protected var :Array;
protected var :Boolean;// = true
protected var music_transforms:Array;
public static const NO_MUSIC:int = -1;
public function SoundManagerSuper(){
var _local1:int;
var _local2:MovieClip;
= new Array();
= new Array();
= new Array();
= new Array();
= new Array();
= new Array();
= new Array();
music_loops = new Array();
music_channels = new Array();
music_transforms = new Array();
music_volumes = new Array();
= true;
= true;
= false;
= false;
super();
= NitromeGame.music;
= NitromeGame.sfx;
_local1 = 0;
while (_local1 < numChildren) {
_local2 = (getChildAt(_local1) as MovieClip);
if (_local2 != null){
[_local2.name] = _local2;
};
_local1++;
};
}
private function (_arg1:Event):void{
if (music_transforms[
].volume > 0){
music_transforms[
].volume = (music_transforms[
].volume - CROSS_FADE_SPEED);
music_channels[
].soundTransform = music_transforms[
];
};
if (music_transforms[
].volume <= 0){
= false;
music_channels[
].stop();
= NO_MUSIC;
_arg1.target.removeEventListener(Event.ENTER_FRAME, );
};
}
public function crossFade(_arg1:int):void{
if (((((!()) || ())) || ((
== _arg1)))){
return;
};
=
;
= _arg1;
music_transforms[_arg1].volume = 0;
music_channels[_arg1] = music_loops[_arg1].play(0, int.MAX_VALUE, music_transforms[_arg1]);
= true;
addEventListener(Event.ENTER_FRAME, );
}
public function ():void{
var _local1:int;
_local1 = 0;
while (_local1 < .length) {
if (((!(([_local1] == null))) && ([_local1]))){
[_local1] = [_local1].play(0, int.MAX_VALUE,
[_local1]);
};
_local1++;
};
}
public function get music():Boolean{
return ();
}
public function set sfx(_arg1:Boolean):void{
= _arg1;
}
public function toggleMusic():void{
if (){
();
} else {
();
};
}
private function (_arg1:Event):void{
if (music_transforms[].volume > 0){
music_transforms[].volume = (music_transforms[].volume - CROSS_FADE_SPEED);
music_channels[].soundTransform = music_transforms[];
};
if (music_transforms[
].volume < music_volumes[
]){
music_transforms[
].volume = (music_transforms[
].volume + CROSS_FADE_SPEED);
music_channels[
].soundTransform = music_transforms[
];
};
if ((((music_transforms[
].volume >= music_volumes[
])) && ((music_transforms[].volume <= 0)))){
music_channels[].stop();
= false;
_arg1.target.removeEventListener(Event.ENTER_FRAME, );
};
}
public function playSound(_arg1:String):void{
if (){
if ([_arg1] != null){
[_arg1].gotoAndPlay(2);
};
};
}
public function ():void{
var _local1:uint;
_local1 = 0;
while (_local1 < music_channels.length) {
if (music_channels[_local1] != null){
music_channels[_local1].stop();
};
_local1++;
};
}
public function ():void{
NitromeGame.music = ( = true);
if (
!= NO_MUSIC){
playMusic(
, true);
};
}
private function (_arg1:Event):void{
if (music_transforms[
].volume < music_volumes[
]){
music_transforms[
].volume = (music_transforms[
].volume + CROSS_FADE_SPEED);
music_channels[
].soundTransform = music_transforms[
];
};
if (music_transforms[
].volume >= music_volumes[
]){
= false;
_arg1.target.removeEventListener(Event.ENTER_FRAME, );
};
}
private function (_arg1:Event):void{
var _local2:Boolean;
var _local3:int;
_local2 = true;
_local3 = 0;
while (_local3 < .length) {
if (
[_local3] != 0){
_local2 = false;
if (
[_local3] > 0){
if (
[_local3].volume < [_local3]){
[_local3].volume = (
[_local3].volume + LOOP_FADE_SPEED);
[_local3].soundTransform =
[_local3];
} else {
if (
[_local3].volume >= [_local3]){
[_local3].volume = [_local3];
[_local3].soundTransform =
[_local3];
[_local3] = 0;
};
};
} else {
if (
[_local3] < 0){
if (
[_local3].volume > 0){
[_local3].volume = (
[_local3].volume - LOOP_FADE_SPEED);
[_local3].soundTransform =
[_local3];
} else {
if (
[_local3].volume <= 0){
[_local3] = 0;
[_local3].stop();
[_local3] = false;
};
};
};
};
};
_local3++;
};
if (_local2){
_arg1.target.removeEventListener(Event.ENTER_FRAME, );
= false;
};
}
public function
():void{
var _local1:int;
_local1 = 0;
while (_local1 < .length) {
if ([_local1] != null){
[_local1].stop();
};
_local1++;
};
}
public function stopMusicFadeOut():void{
if (((!()) || ())){
return;
};
music_transforms[
].volume = music_volumes[
];
= true;
addEventListener(Event.ENTER_FRAME, );
}
public function set music(_arg1:Boolean):void{
= _arg1;
}
public function playMusic(_arg1:uint, _arg2:Boolean=false):void{
var _local3:uint;
if (((_arg2) && ((
== NO_MUSIC)))){
return;
};
if (((!((
== _arg1))) || (_arg2))){
if (){
_local3 = 0;
while (_local3 < music_loops.length) {
if (_local3 == _arg1){
} else {
if (music_channels[_local3] != null){
music_channels[_local3].stop();
};
};
_local3++;
};
music_transforms[_arg1].volume = music_volumes[_arg1];
music_channels[_arg1] = music_loops[_arg1].play(0, int.MAX_VALUE, music_transforms[_arg1]);
};
= _arg1;
};
}
public function ():void{
var _local1:int;
_local1 = 0;
while (_local1 < .length) {
(_local1);
_local1++;
};
}
public function toggleSfx():void{
if (){
();
} else {
();
};
}
public function get sfx():Boolean{
return ();
}
public function ():void{
NitromeGame.sfx = ( = true);
();
}
public function ():void{
NitromeGame.sfx = ( = false);
();
}
public function (_arg1:int):void{
if (((((!()) || (!([_arg1])))) || ((
[_arg1] == -1)))){
return;
};
[_arg1] = -1;
if (!){
addEventListener(Event.ENTER_FRAME, );
= true;
};
}
public function
():void{
var _local1:uint;
_local1 = 0;
while (_local1 < music_channels.length) {
if (music_channels[_local1] != null){
music_channels[_local1].stop();
};
_local1++;
};
NitromeGame.music = ( = false);
}
public function (_arg1:uint):void{
if ([_arg1] != null){
[_arg1].stop();
[_arg1] = false;
};
}
public function (_arg1:int):void{
if ((((
[_arg1] == 1)) || (!()))){
return;
};
if (![_arg1]){
[_arg1].volume = 0;
[_arg1] = true;
[_arg1] = [_arg1].play(0, int.MAX_VALUE,
[_arg1]);
};
[_arg1] = 1;
if (!){
addEventListener(Event.ENTER_FRAME, );
= true;
};
}
public function playMusicFadeIn(_arg1:int):void{
if (((((!()) || ())) || ((
== _arg1)))){
return;
};
= _arg1;
music_transforms[_arg1].volume = 0;
= true;
music_channels[_arg1] = music_loops[_arg1].play(0, int.MAX_VALUE, music_transforms[_arg1]);
addEventListener(Event.ENTER_FRAME, );
}
public function (_arg1:uint):void{
if (){
if (((!(([_arg1] == null))) && (!([_arg1])))){
[_arg1].volume = [_arg1];
[_arg1] = [_arg1].play(0, int.MAX_VALUE,
[_arg1]);
};
};
}
}
}//package com.nitrome.game
Section 102
//SubmitScoreButton (com.nitrome.game.SubmitScoreButton)
package com.nitrome.game {
import flash.events.*;
public class SubmitScoreButton extends SimpleButton {
public function SubmitScoreButton(){
addFrameScript(0, frame1);
if (Score.value > NitromeGame.getLastSavedScore()){
visible = true;
} else {
visible = false;
};
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.timeline.game.clearListeners();
NitromeGame.setLastSavedScore(Score.value);
NitromeGame.timeline.popup_holder.hidePopUp();
NitromeGame.transition.doTween("submit_score");
NitromeGame.sound_manager.playMusic(SoundManager.MENU, false);
}
}
}//package com.nitrome.game
Section 103
//Transition (com.nitrome.game.Transition)
package com.nitrome.game {
import com.nitrome.engine.*;
import flash.display.*;
import flash.events.*;
public class Transition extends MovieClip {
public var :Shape;
public var :Bitmap;
public var :Bitmap;
public var count:int;
public var
:Line;
public var next_frame:String;
public var bitmapdata:BitmapData;
public var
:Shape;
public var state:int;
public var tweening:Boolean;
public var :Shape;
public var step:Number;
public static const SLIDE:int = 4;
public static const FADE:int = 2;
public static const SLASH:int = 1;
public static const TWEEN_DELAY:int = 15;
public function Transition(){
bitmapdata = new BitmapData(550, 400, true, 0xFFFFFF);
= new Bitmap(bitmapdata);
= new Bitmap(bitmapdata);
= new Shape();
= new Shape();
= new Shape();
.visible = false;
.visible = false;
.mask = ;
.mask = ;
= new Line(new Dot(275, 0), new Dot(275, 400));
addChild( );
addChild( );
addChild( );
addChild( );
addChild(
);
count = 0;
tweening = false;
next_frame = "";
}
public function doTween(_arg1:String, _arg2:int=0):void{
if (!tweening){
(_arg1);
} else {
next_frame = _arg1;
};
}
private function onEnterFrame(_arg1:Event):void{
if (state == SLASH){
state = FADE;
} else {
if (state == FADE){
state = SLIDE;
} else {
if (state == SLIDE){
.graphics.clear();
count++;
.x = ( .x - step);
.x = ( .x - step);
.x = ( .x + step);
.x = ( .x + step);
if (count >= TWEEN_DELAY){
.visible = false;
.visible = false;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
tweening = false;
if (next_frame != ""){
(next_frame);
next_frame = "";
};
};
};
};
};
}
public function
(_arg1:String):void{
var _local2:Number;
tweening = true;
_local2 = (-250 + (Math.random() * 500));
.a.x = (275 + _local2);
.b.x = (275 - _local2);
.graphics.clear();
.graphics.lineStyle(5, 0, 0.05);
.graphics.moveTo((
.a.x - 275), -200);
.graphics.lineTo((
.b.x - 275), 200);
.graphics.lineStyle(2, 0, 0.05);
.graphics.moveTo((
.a.x - 275), -200);
.graphics.lineTo((
.b.x - 275), 200);
NitromeGame.timeline.curves_clip.visible = false;
bitmapdata.draw(NitromeGame.timeline);
NitromeGame.timeline.curves_clip.visible = true;
.graphics.clear();
.updateLine();
step = (Math.max(
.a.x,
.b.x) / TWEEN_DELAY);
.graphics.clear();
.graphics.clear();
.graphics.beginFill(0xFFFFFF);
.graphics.beginFill(0xFFFFFF);
.graphics.moveTo(0, 0);
.graphics.lineTo(
.a.x, 0);
.graphics.lineTo(
.b.x, 400);
.graphics.lineTo(0, 400);
.graphics.lineTo(0, 0);
.graphics.moveTo(
.a.x, 0);
.graphics.lineTo(550, 0);
.graphics.lineTo(550, 400);
.graphics.lineTo(
.b.x, 400);
.graphics.lineTo(
.a.x, 0);
.graphics.endFill();
.graphics.endFill();
.x = ( .x = ( .x = ( .x = -275)));
.y = ( .y = ( .y = ( .y = -200)));
.visible = true;
.visible = true;
(parent as MovieClip).gotoAndStop(_arg1);
count = 0;
state = SLASH;
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
}
}
}//package com.nitrome.game
Section 104
//TryAgainButton (com.nitrome.game.TryAgainButton)
package com.nitrome.game {
import flash.events.*;
public class TryAgainButton extends SimpleButton {
public function TryAgainButton(){
addFrameScript(0, frame1);
}
function doStuff():void{
NitromeGame.timeline.game.clearListeners();
Score.value = 0;
NitromeGame.level_score = 0;
NitromeGame.timeline.popup_holder.hidePopUp();
NitromeGame.transition.doTween("game_reset");
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
if (!NitromeGame.timeline.popup_holder.key_pressed){
doStuff();
};
}
}
}//package com.nitrome.game
Section 105
//ViewScoresButton (com.nitrome.game.ViewScoresButton)
package com.nitrome.game {
import flash.events.*;
public class ViewScoresButton extends SimpleButton {
public function ViewScoresButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
override public function onClick(_arg1:MouseEvent):void{
NitromeGame.transition.doTween("view_scores");
}
}
}//package com.nitrome.game
Section 106
//ArrowButton (com.nitrome.highscore.ArrowButton)
package com.nitrome.highscore {
import flash.events.*;
import com.nitrome.game.*;
public class ArrowButton extends SimpleButton {
var :HighScoreBoard;
public function ArrowButton(){
= (parent as HighScoreBoard);
visible = false;
}
public function hide():void{
visible = false;
}
override public function onClick(_arg1:MouseEvent):void{
if (name == "_prev_arrow"){
.shiftScoresPrev();
} else {
if (name == "_next_arrow"){
.shiftScoresNext();
};
};
}
public function show():void{
visible = true;
}
}
}//package com.nitrome.highscore
Section 107
//ClearButton (com.nitrome.highscore.ClearButton)
package com.nitrome.highscore {
import flash.events.*;
import com.nitrome.game.*;
public class ClearButton extends SimpleButton {
private var :ScoreSubmitPanel;
public function ClearButton(){
= (parent as ScoreSubmitPanel);
}
override public function onClick(_arg1:MouseEvent):void{
.clearName();
}
}
}//package com.nitrome.highscore
Section 108
//HighScoreBoard (com.nitrome.highscore.HighScoreBoard)
package com.nitrome.highscore {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class HighScoreBoard extends MovieClip {
public const MAX_DIGITS:int = 8;
private const MAX_RANK:int = 100;
public const NUM_LINES:int = 10;
public var _score_line_7:ScoreLine;
private var :Array;
private var :Boolean;
private var :Boolean;// = false
public var loading_text:MovieClip;
public var _next_arrow:NextArrow;
private var :URLRequest;
private var :URLVariables;
public var _score_line_10:ScoreLine;
private var :ArrowButton;
public var _prev_arrow:PrevArrow;
private var :int;
public var _score_line_1:ScoreLine;
public var _score_line_2:ScoreLine;
public var _score_line_3:ScoreLine;
public var _score_line_4:ScoreLine;
public var _score_line_5:ScoreLine;
public var _score_line_6:ScoreLine;
public var _score_line_8:ScoreLine;
public var _score_line_9:ScoreLine;
private var :URLLoader;
private var :ArrowButton;
public function HighScoreBoard(){
var _local1:int;
= false;
super();
= new Array(NUM_LINES);
if (NitromeGame.isAtURL(NitromeGame.NITROME)){
trace(0);
_local1 = 0;
while (_local1 < .length) {
[_local1] = (getChildByName(("_score_line_" + (_local1 + 1))) as HighScoreLine);
_local1++;
};
= (getChildByName("_prev_arrow") as ArrowButton);
= (getChildByName("_next_arrow") as ArrowButton);
= false;
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
addEventListener(Event.ENTER_FRAME,
, false, 0, true);
} else {
gotoAndStop("hide");
};
}
public function
(_arg1:int):void{
= _arg1;
= new URLLoader();
= new URLVariables();
= new URLRequest(NitromeGame.RETRIEVE_URL);
.method = URLRequestMethod.POST;
.data = ;
.dataFormat = URLLoaderDataFormat.VARIABLES;
.addEventListener(Event.COMPLETE, );
.addEventListener(IOErrorEvent.IO_ERROR,
);
.min_rank = String(_arg1);
.game_name = NitromeGame.game_id;
.time_based = (NitromeGame.time_based) ? "1" : "0";
.load();
}
private function (_arg1:Event):void{
var _local2:String;
_local2 = _arg1.target.data.result;
trace((("Scores retrieved: (" + _local2) + ")"));
(_local2);
= true;
}
private function init(_arg1:Event):void{
(1);
_arg1.target.removeEventListener(Event.ADDED_TO_STAGE, init);
}
public function shiftScoresPrev():void{
var _local1:int;
_local1 = ( - 10);
if (_local1 < 1){
_local1 = 1;
};
(_local1);
}
public function set zero_fill(_arg1:Boolean):void{
= _arg1;
}
private function
(_arg1:Event):void{
if ((() && ((loading_text.alpha > 0)))){
loading_text.alpha = (loading_text.alpha - 0.1);
} else {
if ((() && ((loading_text.alpha <= 0)))){
_arg1.target.removeEventListener(Event.ENTER_FRAME,
);
};
};
}
private function
(_arg1:IOErrorEvent):void{
trace(("Retrieve scores failed: " + _arg1.text));
}
public function get zero_fill():Boolean{
return ();
}
public function (_arg1:Array):void{
var _local2:int;
var _local3:String;
var _local4:String;
if (_arg1.length > 0){
_local2 = 0;
while (_local2 <= 9) {
_local3 = String(_arg1[_local2].user_name);
_local4 = String(_arg1[_local2].score);
if ((((_local3 == "")) || ((_local3 == null)))){
[_local2].hide();
.hide();
} else {
[_local2].displayData(( + _local2), _local3, _local4);
};
_local2++;
};
} else {
trace("no leaderboard data");
};
}
public function (_arg1:String):void{
var _local2:int;
var _local3:Object;
if (_arg1 != "0"){
_local2 = 0;
while (_local2 < .length) {
_local3 = NitromeGame.getHighScoreLine(_arg1, (_local2 + 1));
if (_local3 == null){
[_local2].hide();
} else {
[_local2].displayData(( + _local2), _local3.username, _local3.score);
};
_local2++;
};
if (NitromeGame.displayNextButton(_arg1)){
.show();
} else {
.hide();
};
if (NitromeGame.displayPreviousButton(_arg1)){
.show();
} else {
.hide();
};
};
}
public function shiftScoresNext():void{
var _local1:int;
_local1 = ( + 10);
(_local1);
}
}
}//package com.nitrome.highscore
Section 109
//HighScoreLine (com.nitrome.highscore.HighScoreLine)
package com.nitrome.highscore {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class HighScoreLine extends Sprite {
private const FADE_SPEED:Number = 0.3;
private var :int;
private var :TextField;
private var :TextField;
public var _score_text:TextField;
private var :Boolean;
private var score_text:TextField;
private var
:int;
public var _rank_text:TextField;
public var _name_text:TextField;
private var :HighScoreBoard;
public function HighScoreLine(){
visible = false;
= false;
score_text = (getChildByName("_score_text") as TextField);
= (getChildByName("_name_text") as TextField);
= (getChildByName("_rank_text") as TextField);
= (parent as HighScoreBoard);
}
public function hide():void{
trace((name + " hide"));
visible = false;
= true;
}
private function (_arg1:Event):void{
if (
>= ){
alpha = (alpha + FADE_SPEED);
if (alpha >= 1){
_arg1.target.removeEventListener(Event.ENTER_FRAME, );
};
};
++;
}
public function displayData(_arg1:int, _arg2:String, _arg3:String):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
trace((name + " displayData:"));
.text = String((_arg1 + "."));
.text = _arg2.toUpperCase();
trace(((((_arg1 + ",") + _arg2) + ",") + _arg3));
if (.zero_fill){
_local4 = .MAX_DIGITS;
_local5 = _arg3.length;
_local6 = (_local4 - _local5);
_local7 = 1;
while (_local7 <= _local6) {
_arg3 = ("0" + _arg3);
_local7++;
};
score_text.text = _arg3;
} else {
score_text.text = _arg3;
};
alpha = 0;
visible = true;
= (((_arg1 - 1) % .NUM_LINES) * int((1 / FADE_SPEED)));
= 0;
addEventListener(Event.ENTER_FRAME, );
}
}
}//package com.nitrome.highscore
Section 110
//LetterButton (com.nitrome.highscore.LetterButton)
package com.nitrome.highscore {
import flash.events.*;
import com.nitrome.game.*;
import flash.text.*;
public class LetterButton extends SimpleButton {
private var :TextField;
public var _letter:TextField;
private var :String;
private var :ScoreSubmitPanel;
public static const up_col:int = 0x838383;
public static const over_col:int = 0xFFAA00;
public function LetterButton(){
= (parent as ScoreSubmitPanel);
= name;
= (getChildByName("_letter") as TextField);
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(_arg1:Event):void{
.text = ;
_arg1.target.removeEventListener(Event.ADDED_TO_STAGE, init);
}
override protected function updateGraphic():void{
if (over){
.textColor = over_col;
} else {
.textColor = up_col;
};
}
override public function onClick(_arg1:MouseEvent):void{
.addLetter();
}
}
}//package com.nitrome.highscore
Section 111
//ScoreSubmitPanel (com.nitrome.highscore.ScoreSubmitPanel)
package com.nitrome.highscore {
import flash.display.*;
import flash.events.*;
import com.nitrome.game.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public class ScoreSubmitPanel extends MovieClip {
private const MAX_LENGTH:Number = 10;
private var :URLLoader;
public var C:LetterButton;
public var D:LetterButton;
public var E:LetterButton;
public var F:LetterButton;
public var H:LetterButton;
public var I:LetterButton;
public var J:LetterButton;
public var L:LetterButton;
public var P:LetterButton;
public var K:LetterButton;
public var W:LetterButton;
public var X:LetterButton;
public var R:LetterButton;
public var T:LetterButton;
public var U:LetterButton;
public var V:LetterButton;
public var G:LetterButton;
public var Y:LetterButton;
private var :TextField;
public var S:LetterButton;
public var A:LetterButton;
public var N:LetterButton;
public var O:LetterButton;
public var _score_text:TextField;
public var Z:LetterButton;
public var M:LetterButton;
public var Q:LetterButton;
public var B:LetterButton;
private var score_text:TextField;
private var loading_clip:MovieClip;
public var _name_text:TextField;
private var :Boolean;
private var :SubmitButton;
public var _submit_button:SubmitButton;
public var loading_black:MovieClip;
public var _clear_button:ClearButton;
private var :URLRequest;
private var :URLVariables;
public function ScoreSubmitPanel(){
if (NitromeGame.isAtURL(NitromeGame.NITROME)){
= (getChildByName("_submit_button") as SubmitButton);
= (getChildByName("_name_text") as TextField);
score_text = (getChildByName("_score_text") as TextField);
= false;
addEventListener(Event.ADDED_TO_STAGE, init);
} else {
gotoAndStop("hide");
};
}
public function addLetter(_arg1:String):void{
var _local2:String;
var _local3:String;
_local2 = .text;
if (_local2.length < MAX_LENGTH){
_arg1 = _arg1.toUpperCase();
_local3 = (_local2 + _arg1);
.text = _local3;
.enable();
};
}
private function (_arg1:IOErrorEvent):void{
trace(("Submit score failed: " + _arg1.text));
trace();
loading_black.gotoAndPlay(2);
}
public function clearName():void{
.disable();
.text = "";
}
private function keyPressed(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.charCode;
if ((((((_local2 >= 65)) && ((_local2 <= 90)))) || ((((_local2 >= 97)) && ((_local2 <= 122)))))){
addLetter(String.fromCharCode(_local2));
};
if ((((_arg1.keyCode == Keyboard.BACKSPACE)) || ((_arg1.keyCode == Keyboard.DELETE)))){
clearName();
};
}
private function (_arg1:Event):void{
trace("Score submitted");
loading_black.gotoAndPlay(2);
}
private function init(_arg1:Event):void{
score_text.text = ("YOUR SCORE IS " + Score.value);
trace(score_text.text);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.target.removeEventListener(Event.ADDED_TO_STAGE, init);
}
public function submitScore():void{
var _local1:String;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_local1 = .text;
if (_local1 != ""){
= new URLLoader();
= new URLVariables();
= new URLRequest(NitromeGame.SUBMIT_URL);
.method = URLRequestMethod.POST;
.data = ;
.addEventListener(Event.COMPLETE, );
.addEventListener(IOErrorEvent.IO_ERROR, );
.data_string = NitromeGame.getScoreData(Score.value, _local1);
.time_based = "0";
.data = ;
.load();
} else {
loading_black.gotoAndPlay(2);
};
}
}
}//package com.nitrome.highscore
Section 112
//SubmitButton (com.nitrome.highscore.SubmitButton)
package com.nitrome.highscore {
import flash.events.*;
import com.nitrome.game.*;
public class SubmitButton extends SimpleButton {
private var :Boolean;// = false
private var
:Boolean;// = true
private var :ScoreSubmitPanel;
public function SubmitButton(){
= false;
= true;
super();
gotoAndStop("_up");
= (parent as ScoreSubmitPanel);
}
public function enable():void{
= false;
useHandCursor = true;
buttonMode = true;
updateGraphic();
}
override protected function updateGraphic():void{
if (((!(over)) || (
))){
gotoAndStop("_up");
} else {
gotoAndStop("_over");
};
}
public function disable():void{
= true;
useHandCursor = false;
buttonMode = false;
updateGraphic();
}
override public function onClick(_arg1:MouseEvent):void{
if (
){
gotoAndStop("_up");
} else {
if (!){
.submitScore();
= true;
};
};
}
}
}//package com.nitrome.highscore
Section 113
//Lock (com.nitrome.util.Lock)
package com.nitrome.util {
import flash.display.*;
import flash.net.*;
public class Lock extends MovieClip {
public function Lock(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
public static function urlLock(_arg1:Stage):void{
var _local2:String;
if (NitromeGame.isAtURL(NitromeGame.NITROME, NitromeGame.MINICLIP) == true){
} else {
_arg1.addChild(new (Lock));
_local2 = ("http://www.nitrome.com/games/" + NitromeGame.game_id);
navigateToURL(new URLRequest(_local2), "_blank");
};
}
}
}//package com.nitrome.util
Section 114
//MD5 (com.nitrome.util.MD5)
package com.nitrome.util {
public class MD5 {
private var :int;// = 8
private var :String;// = ""
public function MD5(_arg1:String=null, _arg2:int=0){
= "";
= 8;
super();
if (_arg1 != null){
this. = _arg1;
};
if (((((!((_arg2 == 0))) && ((_arg2 == 8)))) || ((_arg2 == 16)))){
this. = _arg2;
};
}
private function (_arg1:Array):String{
var _local2:String;
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:int;
_local2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
_local3 = new String("");
_local4 = 0;
while (_local4 < (_arg1.length * 4)) {
_local5 = (((((_arg1[(_local4 >> 2)] >> (8 * (_local4 % 4))) & 0xFF) << 16) | (((_arg1[((_local4 + 1) >> 2)] >> (8 * ((_local4 + 1) % 4))) & 0xFF) << 8)) | ((_arg1[((_local4 + 2) >> 2)] >> (8 * ((_local4 + 2) % 4))) & 0xFF));
_local6 = 0;
while (_local6 < 4) {
if (((_local4 * 8) + (_local6 * 6)) > (_arg1.length * 32)){
_local3 = (_local3 + );
} else {
_local3 = (_local3 + _local2.charAt(((_local5 >> (6 * (3 - _local6))) & 63)));
};
_local6++;
};
_local4 = (_local4 + 3);
};
return (_local3);
}
private function
(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):int{
return (
((
(
(_arg2, _arg1),
(_arg4, _arg6)), _arg5), _arg3));
}
private function (_arg1:Array):String{
var _local2:String;
var _local3:int;
var _local4:int;
_local2 = new String("");
_local3 = ((1 << ) - 1);
_local4 = 0;
while (_local4 < (_arg1.length * 32)) {
_local2 = (_local2 + String.fromCharCode(((_arg1[(_local4 >> 5)] >>> (_local4 % 32)) & _local3)));
_local4 = (_local4 + );
};
return (_local2);
}
private function (_arg1:String, _arg2:String):Array{
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:int;
var _local7:Array;
_local3 = new Array((_arg1));
if (_local3.length > 16){
_local3 = (_local3, (_arg1.length * ));
};
_local4 = new Array(16);
_local5 = new Array(16);
_local6 = 0;
while (_local6 < 16) {
_local4[_local6] = (_local3[_local6] ^ 909522486);
_local5[_local6] = (_local3[_local6] ^ 1549556828);
_local6++;
};
_local7 = new Array((_local4.concat((_arg2)), (0x0200 + (_arg2.length * ))));
return ((_local5.concat(_local7), (0x0200 + 128)));
}
private function
(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (
(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private function (_arg1:String, _arg2:String):String{
return ( ((_arg1, _arg2)));
}
public function hash(_arg1:String):String{
return ((_arg1));
}
private function (_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (
((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private function (_arg1:String):String{
return ( (((_arg1), (_arg1.length * ))));
}
private function (_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
private function (_arg1:Array, _arg2:int):Array{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
_local3 = 1732584193;
_local4 = -271733879;
_local5 = -1732584194;
_local6 = 271733878;
_local7 = 0;
while (_local7 < _arg1.length) {
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 =
(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, -680876936);
_local6 =
(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, -389564586);
_local5 =
(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819);
_local4 =
(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, -1044525330);
_local3 =
(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, -176418897);
_local6 =
(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426);
_local5 =
(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, -1473231341);
_local4 =
(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, -45705983);
_local3 =
(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416);
_local6 =
(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, -1958414417);
_local5 =
(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, -42063);
_local4 =
(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, -1990404162);
_local3 =
(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682);
_local6 =
(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, -40341101);
_local5 =
(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, -1502002290);
_local4 =
(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329);
_local3 =
(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, -165796510);
_local6 =
(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, -1069501632);
_local5 =
(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713);
_local4 =
(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, -373897302);
_local3 =
(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, -701558691);
_local6 =
(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083);
_local5 =
(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, -660478335);
_local4 =
(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, -405537848);
_local3 =
(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438);
_local6 =
(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, -1019803690);
_local5 =
(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, -187363961);
_local4 =
(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501);
_local3 =
(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, -1444681467);
_local6 =
(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, -51403784);
_local5 =
(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473);
_local4 =
(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, -1926607734);
_local3 = (_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, -378558);
_local6 = (_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, -2022574463);
_local5 = (_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562);
_local4 = (_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, -35309556);
_local3 = (_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, -1530992060);
_local6 = (_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353);
_local5 = (_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, -155497632);
_local4 = (_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, -1094730640);
_local3 = (_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174);
_local6 = (_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, -358537222);
_local5 = (_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, -722521979);
_local4 = (_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189);
_local3 = (_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, -640364487);
_local6 = (_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, -421815835);
_local5 = (_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520);
_local4 = (_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, -995338651);
_local3 = (_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, -198630844);
_local6 = (_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415);
_local5 = (_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, -1416354905);
_local4 = (_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, -57434055);
_local3 = (_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571);
_local6 = (_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, -1894986606);
_local5 = (_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, -1051523);
_local4 = (_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, -2054922799);
_local3 = (_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359);
_local6 = (_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, -30611744);
_local5 = (_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, -1560198380);
_local4 = (_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649);
_local3 = (_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, -145523070);
_local6 = (_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, -1120210379);
_local5 = (_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259);
_local4 = (_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, -343485551);
_local3 =
(_local3, _local8);
_local4 =
(_local4, _local9);
_local5 =
(_local5, _local10);
_local6 =
(_local6, _local11);
_local7 = (_local7 + 16);
};
return (new Array(_local3, _local4, _local5, _local6));
}
private function (_arg1:String):String{
return ( (((_arg1), (_arg1.length * ))));
}
private function (_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (
(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private function (_arg1:String, _arg2:String):String{
return ( ((_arg1, _arg2)));
}
private function (_arg1:String):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
_local2 = [];
_local3 = ((1 << ) - 1);
_local4 = 0;
while (_local4 < (_arg1.length * )) {
_local2[(_local4 >> 5)] = (_local2[(_local4 >> 5)] | ((_arg1.charCodeAt((_local4 / )) & _local3) << (_local4 % 32)));
_local4 = (_local4 + );
};
return (_local2);
}
private function (_arg1:Array):String{
var _local2:String;
var _local3:String;
var _local4:int;
_local2 = "0123456789abcdef";
_local3 = new String("");
_local4 = 0;
while (_local4 < (_arg1.length * 4)) {
_local3 = (_local3 + (_local2.charAt(((_arg1[(_local4 >> 2)] >> (((_local4 % 4) * 8) + 4)) & 15)) + _local2.charAt(((_arg1[(_local4 >> 2)] >> ((_local4 % 4) * 8)) & 15))));
_local4++;
};
return (_local3);
}
private function
(_arg1:Number, _arg2:Number):Number{
var _local3:int;
var _local4:int;
_local3 = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
_local4 = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
private function (_arg1:String):String{
return ((((_arg1), (_arg1.length * ))));
}
private function (_arg1:String, _arg2:String):String{
return (((_arg1, _arg2)));
}
private function
(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (
(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
}
}//package com.nitrome.util
Section 115
//QuickURLCheck (com.nitrome.util.QuickURLCheck)
package com.nitrome.util {
import flash.display.*;
public class QuickURLCheck {
public static const NITROME_URL:Array = ["http://www.nitrome.com/", "http://cdn.nitrome.com/"];
public static function isAtNitrome(_arg1:MovieClip):Boolean{
var _local2:String;
var _local3:int;
var _local4:String;
_local2 = _arg1.loaderInfo.url;
_local3 = 0;
while (_local3 < NITROME_URL.length) {
_local4 = NITROME_URL[_local3];
if (_local2.substr(0, _local4.length) == _local4){
return (true);
};
_local3++;
};
return (false);
}
}
}//package com.nitrome.util
Section 116
//aiiee_622 (finalninjazero_fla.aiiee_622)
package finalninjazero_fla {
import flash.display.*;
public dynamic class aiiee_622 extends MovieClip {
public function aiiee_622(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 117
//alert_607 (finalninjazero_fla.alert_607)
package finalninjazero_fla {
import flash.display.*;
public dynamic class alert_607 extends MovieClip {
public function alert_607(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 118
//alert_panel_683 (finalninjazero_fla.alert_panel_683)
package finalninjazero_fla {
import flash.display.*;
import flash.text.*;
public dynamic class alert_panel_683 extends MovieClip {
public var alert_time:TextField;
}
}//package finalninjazero_fla
Section 119
//back_663 (finalninjazero_fla.back_663)
package finalninjazero_fla {
import flash.display.*;
public dynamic class back_663 extends MovieClip {
public var front:MovieClip;
public var back:MovieClip;
public function back_663(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 120
//backcammo_660 (finalninjazero_fla.backcammo_660)
package finalninjazero_fla {
import flash.display.*;
public dynamic class backcammo_660 extends MovieClip {
public var morph:Morph;
}
}//package finalninjazero_fla
Section 121
//bang1_608 (finalninjazero_fla.bang1_608)
package finalninjazero_fla {
import flash.display.*;
public dynamic class bang1_608 extends MovieClip {
public function bang1_608(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 122
//bang2_609 (finalninjazero_fla.bang2_609)
package finalninjazero_fla {
import flash.display.*;
public dynamic class bang2_609 extends MovieClip {
public function bang2_609(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 123
//bang3_610 (finalninjazero_fla.bang3_610)
package finalninjazero_fla {
import flash.display.*;
public dynamic class bang3_610 extends MovieClip {
public function bang3_610(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 124
//bang4_611 (finalninjazero_fla.bang4_611)
package finalninjazero_fla {
import flash.display.*;
public dynamic class bang4_611 extends MovieClip {
public function bang4_611(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 125
//bosslaugh_638 (finalninjazero_fla.bosslaugh_638)
package finalninjazero_fla {
import flash.display.*;
public dynamic class bosslaugh_638 extends MovieClip {
public function bosslaugh_638(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 126
//bossouch_637 (finalninjazero_fla.bossouch_637)
package finalninjazero_fla {
import flash.display.*;
public dynamic class bossouch_637 extends MovieClip {
public function bossouch_637(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 127
//cammo_629 (finalninjazero_fla.cammo_629)
package finalninjazero_fla {
import flash.display.*;
public dynamic class cammo_629 extends MovieClip {
public function cammo_629(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 128
//cammocollect_273 (finalninjazero_fla.cammocollect_273)
package finalninjazero_fla {
import flash.display.*;
public dynamic class cammocollect_273 extends MovieClip {
public function cammocollect_273(){
addFrameScript(39, );
}
function (){
(parent as MovieClip).gotoAndStop("idle");
stop();
}
}
}//package finalninjazero_fla
Section 129
//chamforward_106 (finalninjazero_fla.chamforward_106)
package finalninjazero_fla {
import flash.display.*;
public dynamic class chamforward_106 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 130
//chamjump_109 (finalninjazero_fla.chamjump_109)
package finalninjazero_fla {
import flash.display.*;
public dynamic class chamjump_109 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 131
//chamlook_108 (finalninjazero_fla.chamlook_108)
package finalninjazero_fla {
import flash.display.*;
public dynamic class chamlook_108 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 132
//chamrun_107 (finalninjazero_fla.chamrun_107)
package finalninjazero_fla {
import flash.display.*;
public dynamic class chamrun_107 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 133
//chamslide_110 (finalninjazero_fla.chamslide_110)
package finalninjazero_fla {
import flash.display.*;
public dynamic class chamslide_110 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 134
//chop_612 (finalninjazero_fla.chop_612)
package finalninjazero_fla {
import flash.display.*;
public dynamic class chop_612 extends MovieClip {
public function chop_612(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 135
//coins_624 (finalninjazero_fla.coins_624)
package finalninjazero_fla {
import flash.display.*;
public dynamic class coins_624 extends MovieClip {
public function coins_624(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 136
//cough_618 (finalninjazero_fla.cough_618)
package finalninjazero_fla {
import flash.display.*;
public dynamic class cough_618 extends MovieClip {
public function cough_618(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 137
//cowarddead_276 (finalninjazero_fla.cowarddead_276)
package finalninjazero_fla {
import flash.display.*;
public dynamic class cowarddead_276 extends MovieClip {
public function cowarddead_276(){
addFrameScript(41, , 84,
);
}
function
(){
stop();
}
function (){
NitromeGame.sound_manager.playSound("electric");
}
}
}//package finalninjazero_fla
Section 138
//dawntowers_676 (finalninjazero_fla.dawntowers_676)
package finalninjazero_fla {
import flash.display.*;
public dynamic class dawntowers_676 extends MovieClip {
public var sun2:MovieClip;
public var sun1:MovieClip;
}
}//package finalninjazero_fla
Section 139
//electric_625 (finalninjazero_fla.electric_625)
package finalninjazero_fla {
import flash.display.*;
public dynamic class electric_625 extends MovieClip {
public function electric_625(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 140
//enemy_health_panel_690 (finalninjazero_fla.enemy_health_panel_690)
package finalninjazero_fla {
import flash.display.*;
public dynamic class enemy_health_panel_690 extends MovieClip {
public var bar:MovieClip;
}
}//package finalninjazero_fla
Section 141
//exitanim_241 (finalninjazero_fla.exitanim_241)
package finalninjazero_fla {
import flash.display.*;
public dynamic class exitanim_241 extends MovieClip {
public function exitanim_241(){
addFrameScript(0, frame1, 19, frame20, 74,
);
}
function
(){
stop();
}
function frame1(){
NitromeGame.sound_manager.playSound("yatta");
}
function frame20(){
NitromeGame.sound_manager.playSound("lift");
}
}
}//package finalninjazero_fla
Section 142
//fade_to_black_693 (finalninjazero_fla.fade_to_black_693)
package finalninjazero_fla {
import flash.display.*;
public dynamic class fade_to_black_693 extends MovieClip {
public function fade_to_black_693(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
stop();
}
}
}//package finalninjazero_fla
Section 143
//fallnin_98 (finalninjazero_fla.fallnin_98)
package finalninjazero_fla {
import flash.display.*;
public dynamic class fallnin_98 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 144
//finalninja_640 (finalninjazero_fla.finalninja_640)
package finalninjazero_fla {
import flash.display.*;
public dynamic class finalninja_640 extends MovieClip {
public function finalninja_640(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 145
//fincrouch_83 (finalninjazero_fla.fincrouch_83)
package finalninjazero_fla {
import flash.display.*;
public dynamic class fincrouch_83 extends MovieClip {
public var body:MovieClip;
}
}//package finalninjazero_fla
Section 146
//finjump_85 (finalninjazero_fla.finjump_85)
package finalninjazero_fla {
import flash.display.*;
public dynamic class finjump_85 extends MovieClip {
public var body:MovieClip;
}
}//package finalninjazero_fla
Section 147
//game_music_holder_627 (finalninjazero_fla.game_music_holder_627)
package finalninjazero_fla {
import flash.display.*;
public dynamic class game_music_holder_627 extends MovieClip {
public function game_music_holder_627(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package finalninjazero_fla
Section 148
//grenade_630 (finalninjazero_fla.grenade_630)
package finalninjazero_fla {
import flash.display.*;
public dynamic class grenade_630 extends MovieClip {
public function grenade_630(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 149
//gunclip_48 (finalninjazero_fla.gunclip_48)
package finalninjazero_fla {
import flash.display.*;
public dynamic class gunclip_48 extends MovieClip {
public var cartridges:MovieClip;
public function gunclip_48(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 150
//gunmanhelp_200 (finalninjazero_fla.gunmanhelp_200)
package finalninjazero_fla {
import flash.display.*;
public dynamic class gunmanhelp_200 extends MovieClip {
public var arm:MovieClip;
public var gun:MovieClip;
}
}//package finalninjazero_fla
Section 151
//hack_631 (finalninjazero_fla.hack_631)
package finalninjazero_fla {
import flash.display.*;
public dynamic class hack_631 extends MovieClip {
public function hack_631(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 152
//health_panel_681 (finalninjazero_fla.health_panel_681)
package finalninjazero_fla {
import flash.display.*;
public dynamic class health_panel_681 extends MovieClip {
public function health_panel_681(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 153
//help_movie_183 (finalninjazero_fla.help_movie_183)
package finalninjazero_fla {
import flash.display.*;
public dynamic class help_movie_183 extends MovieClip {
public function help_movie_183(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 154
//jump_619 (finalninjazero_fla.jump_619)
package finalninjazero_fla {
import flash.display.*;
public dynamic class jump_619 extends MovieClip {
public function jump_619(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 155
//jumpnin_86 (finalninjazero_fla.jumpnin_86)
package finalninjazero_fla {
import flash.display.*;
public dynamic class jumpnin_86 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 156
//jumpnin_help_186 (finalninjazero_fla.jumpnin_help_186)
package finalninjazero_fla {
import flash.display.*;
public dynamic class jumpnin_help_186 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 157
//lift_632 (finalninjazero_fla.lift_632)
package finalninjazero_fla {
import flash.display.*;
public dynamic class lift_632 extends MovieClip {
public function lift_632(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 158
//lift_stealth_243 (finalninjazero_fla.lift_stealth_243)
package finalninjazero_fla {
import flash.display.*;
public dynamic class lift_stealth_243 extends MovieClip {
public function lift_stealth_243(){
addFrameScript(19, frame20, 28,
);
}
function frame20(){
NitromeGame.sound_manager.playSound("wom");
}
function
(){
stop();
}
}
}//package finalninjazero_fla
Section 159
//linkage_container_4 (finalninjazero_fla.linkage_container_4)
package finalninjazero_fla {
import flash.display.*;
public dynamic class linkage_container_4 extends MovieClip {
public function linkage_container_4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 160
//loading_black_213 (finalninjazero_fla.loading_black_213)
package finalninjazero_fla {
import flash.display.*;
public dynamic class loading_black_213 extends MovieClip {
public var loading_text:MovieClip;
public function loading_black_213(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
NitromeGame.timeline.gotoAndStop("view_scores");
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 161
//loading_screen_695 (finalninjazero_fla.loading_screen_695)
package finalninjazero_fla {
import flash.display.*;
import com.nitrome.game.*;
public dynamic class loading_screen_695 extends MovieClip {
public var tt:Transition;
public function loading_screen_695(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
this.tt.doTween("clear");
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 162
//machinegun_633 (finalninjazero_fla.machinegun_633)
package finalninjazero_fla {
import flash.display.*;
public dynamic class machinegun_633 extends MovieClip {
public function machinegun_633(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 163
//MainTimeline (finalninjazero_fla.MainTimeline)
package finalninjazero_fla {
import flash.display.*;
import flash.events.*;
import com.nitrome.engine_specific.*;
import flash.geom.*;
import mochi.as3.*;
import flash.utils.*;
import com.nitrome.game.*;
import com.nitrome.util.*;
import flash.text.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var score_panel:MovieClip;
public var msg_rating:TextField;
public var cash_rating:TextField;
public var shaker:MovieClip;
public var msg_totals:TextField;
public var enemy_rating:TextField;
public var level_1:LevelChooserButton;
public var level_2:LevelChooserButton;
public var level_3:LevelChooserButton;
public var level_6:LevelChooserButton;
public var level_7:LevelChooserButton;
public var level_9:LevelChooserButton;
public var level_8:LevelChooserButton;
public var submit_score_button:SubmitScoreButton;
public var level_4:LevelChooserButton;
public var level_5:LevelChooserButton;
public var cash_totals:TextField;
public var hint_panel:MovieClip;
public var level_0:LevelChooserButton;
public var ;
public var b:Object;
public var health_panel:MovieClip;
public var :ContextMenu;
public var loading_clip:MovieClip;
public var tt:Transition;
public var sound_manager:SoundManager;
public var text_panel:MovieClip;
public var enemy_totals:TextField;
public var popup_holder:PopUpHolder;
public var music_toggle:MusicToggle;
public var
:Number;
public var info:TextField;
public var level_10:LevelChooserButton;
public var level_11:LevelChooserButton;
public var level_13:LevelChooserButton;
public var level_14:LevelChooserButton;
public var level_15:LevelChooserButton;
public var level_17:LevelChooserButton;
public var level_12:LevelChooserButton;
public var level_16:LevelChooserButton;
public var level_18:LevelChooserButton;
public var level_19:LevelChooserButton;
public var level_20:LevelChooserButton;
public var level_21:LevelChooserButton;
public var level_22:LevelChooserButton;
public var back:MovieClip;
public var story:StoryClip;
public var dodge_rating:TextField;
public var dodge_totals:TextField;
public var title_logo:MovieClip;
public var loadedTF:TextField;
public var curves_clip:MovieClip;
public var pause_game_button:PauseButton;
public var alert_panel:MovieClip;
public var fx_toggle:FxToggle;
public var buttons:MovieClip;
public var fade_to_black:MovieClip;
public var msg_panel:MsgPanel;
public var enemy_health_panel:MovieClip;
public var :Number;
public var :Number;
public var total_score:TextField;
public var scroll_border:MovieClip;
public var :Number;
public var game:Game;
public function MainTimeline(){
addFrameScript(0, frame1, 2, , 10,
, 20, frame21, 30,
, 40, , 50,
, 60, frame61, 70, , 80, , 90, , 100, , 110, , 120, , 131, );
}
public function
(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = loaderInfo.bytesLoaded;
_local3 = loaderInfo.bytesTotal;
_local4 = ((_local2 / _local3) * 100);
(root as MovieClip).loadedTF.text = (("LOADING " + _local4.toString()) + "%");
if (loaderInfo.bytesLoaded >= loaderInfo.bytesTotal){
removeEventListener(Event.ENTER_FRAME,
);
gotoAndStop("miniclip");
};
}
function
(){
stop();
NitromeGame.transition = tt;
Key.init(stage);
Score.init();
NitromeGame.init(this, "finalninjazero", "star_", 23);
NitromeGame.selected_level = 0;
= new ContextMenu();
.hideBuiltInItems();
this.contextMenu = ;
sound_manager = new SoundManager();
sound_manager.x = -50;
sound_manager.y = -50;
addChild(sound_manager);
= new MiniclipIntro();
.x = 275;
.y = 200;
addChild();
}
function (){
addEventListener(Event.ENTER_FRAME,
, false, 0, true);
stop();
}
function frame1(){
if (!QuickURLCheck.isAtNitrome(this)){
MochiAd.showPreGameAd({clip:root, id:"375002be23f31c26", res:"550x400", background:0, color:0x838383, outline:2699309, no_bg:true});
};
}
function frame21(){
stop();
}
function
(){
stage.quality = StageQuality.LOW;
Lock.urlLock(stage);
NitromeGame.sound_manager.playSound("finalninja");
gotoAndStop("title_screen");
title_logo.addEventListener(Event.ENTER_FRAME, );
title_logo.alpha = 0;
buttons.alpha = 0;
stop();
}
function (){
stop();
}
function
(){
stop();
}
function frame61(){
stop();
}
function (){
stop();
}
function (){
stop();
}
public function (_arg1:Event){
if (((!((title_logo == null))) && ((title_logo.alpha < 1)))){
title_logo.alpha = (title_logo.alpha + 0.015);
buttons.alpha = (buttons.alpha + 0.015);
} else {
if (title_logo != null){
title_logo.alpha = 1;
buttons.alpha = 1;
};
NitromeGame.sound_manager.playMusicFadeIn(SoundManager.MENU);
removeEventListener(Event.ENTER_FRAME, );
};
}
function (){
stop();
}
function (){
if (Score.value == 0){
submit_score_button.visible = false;
} else {
submit_score_button.visible = true;
};
total_score.text = ("YOUR TOTAL SCORE IS " + Score.value);
b = NitromeGame.getTotalBonus();
= ((1 / NitromeGame.total_levels) * b.dodge);
= ((1 / b.cash_total) * b.cash_count);
= ((1 / b.msg_total) * b.msg_count);
= ((1 / b.enemy_total) * b.enemy_count);
dodge_totals.text = (((("DODGE RATING (" + b.dodge) + "/") + NitromeGame.total_levels) + ")");
cash_totals.text = (((("CASH RATING (" + b.cash_count) + "/") + b.cash_total) + ")");
msg_totals.text = (((("MSG RATING (" + b.msg_count) + "/") + b.msg_total) + ")");
enemy_totals.text = (((("HUNT RATING (" + b.enemy_count) + "/") + b.enemy_total) + ")");
if (
< 0.25){
dodge_rating.text = "SWISS CHEESE";
} else {
if (
< 0.5){
dodge_rating.text = "ACCIDENT PRONE";
} else {
if (
< 0.75){
dodge_rating.text = "JUST A FLESH WOUND";
} else {
if (
< 0.99999999){
dodge_rating.text = "NOT JUST LUCK";
} else {
if (
== 1){
dodge_rating.text = "PERFECT";
};
};
};
};
};
if ( < 0.25){
cash_rating.text = "CHARITY CASE";
} else {
if ( < 0.5){
cash_rating.text = "MINIMUM WAGE";
} else {
if ( < 0.75){
cash_rating.text = "CAT BURGLAR";
} else {
if ( < 0.99999999){
cash_rating.text = "SCROOGE";
} else {
if ( == 1){
cash_rating.text = "PERFECT";
};
};
};
};
};
if ( < 0.25){
msg_rating.text = "BLIND";
} else {
if ( < 0.5){
msg_rating.text = "NEEDS GLASSES";
} else {
if ( < 0.75){
msg_rating.text = "PERCEPTIVE";
} else {
if ( < 0.99999999){
msg_rating.text = "PEDANTIC";
} else {
if ( == 1){
msg_rating.text = "PERFECT";
};
};
};
};
};
if ( < 0.25){
enemy_rating.text = "BENEVOLENT";
} else {
if ( < 0.5){
enemy_rating.text = "EYE FOR AN EYE";
} else {
if ( < 0.75){
enemy_rating.text = "SADISTIC";
} else {
if ( < 0.99999999){
enemy_rating.text = "OLD TESTAMENT";
} else {
if ( == 1){
enemy_rating.text = "PERFECT";
};
};
};
};
};
stop();
}
function (){
stage.quality = StageQuality.LOW;
game = new Game(shaker.canvas, shaker, back);
stop();
}
function (){
game.clearAll();
game = null;
loading_clip.gotoAndStop("loading");
gotoAndStop("game");
}
function (){
story.init();
stop();
}
}
}//package finalninjazero_fla
Section 164
//mcAnimation_649 (finalninjazero_fla.mcAnimation_649)
package finalninjazero_fla {
import flash.display.*;
public dynamic class mcAnimation_649 extends MovieClip {
public function mcAnimation_649(){
addFrameScript(135, );
}
function (){
NitromeGame.timeline.gotoAndStop("nitrome");
parent.parent.removeChild(parent);
stop();
}
}
}//package finalninjazero_fla
Section 165
//menu_music_holder_628 (finalninjazero_fla.menu_music_holder_628)
package finalninjazero_fla {
import flash.display.*;
public dynamic class menu_music_holder_628 extends MovieClip {
public function menu_music_holder_628(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package finalninjazero_fla
Section 166
//missile_636 (finalninjazero_fla.missile_636)
package finalninjazero_fla {
import flash.display.*;
public dynamic class missile_636 extends MovieClip {
public function missile_636(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 167
//msg_639 (finalninjazero_fla.msg_639)
package finalninjazero_fla {
import flash.display.*;
public dynamic class msg_639 extends MovieClip {
public function msg_639(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 168
//ninjareveal_41 (finalninjazero_fla.ninjareveal_41)
package finalninjazero_fla {
import flash.display.*;
public dynamic class ninjareveal_41 extends MovieClip {
public function ninjareveal_41(){
addFrameScript(148, );
}
function (){
stop();
}
}
}//package finalninjazero_fla
Section 169
//ninrun_97 (finalninjazero_fla.ninrun_97)
package finalninjazero_fla {
import flash.display.*;
public dynamic class ninrun_97 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 170
//ninrun_help_185 (finalninjazero_fla.ninrun_help_185)
package finalninjazero_fla {
import flash.display.*;
public dynamic class ninrun_help_185 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 171
//ninswing_100 (finalninjazero_fla.ninswing_100)
package finalninjazero_fla {
import flash.display.*;
public dynamic class ninswing_100 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 172
//ninswing_help_195 (finalninjazero_fla.ninswing_help_195)
package finalninjazero_fla {
import flash.display.*;
public dynamic class ninswing_help_195 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 173
//nitrome_intro_659 (finalninjazero_fla.nitrome_intro_659)
package finalninjazero_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class nitrome_intro_659 extends MovieClip {
public var
:Array;
public var _t:IntroMC5;
public var rect:Rectangle;
public var _r:IntroMC4;
public var :MovieClip;
public var :Array;
public var :Array;
public var :Array;
public var :Array;
public var bitmap:Bitmap;
public var pos:Array;
public var i:int;
public var bitmapdata:BitmapData;
public var :Array;
public var :Rectangle;
public var matrix:Matrix;
public var :BitmapData;
public var _e:IntroMC1;
public var _m:IntroMC2;
public var _n:IntroMC7;
public var _i:IntroMC6;
public var _o:IntroMC3;
public function nitrome_intro_659(){
addFrameScript(0, frame1, 169, );
}
function (){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
NitromeGame.transition.doTween("pre_title_screen");
stop();
}
function frame1(){
if (NitromeGame.timeline.currentLabel != "nitrome"){
stop();
};
= [IntroMC7, IntroMC6, IntroMC5, IntroMC4, IntroMC3, IntroMC2, IntroMC1];
= [];
pos = [{x:0, y:0}, {x:0, y:0}, {x:0, y:0}, {x:0, y:0}, {x:0, y:0}, {x:0, y:0}, {x:0, y:0}];
= [false, false, false, false, false, false, false];
= [2, 2, 2, 2, 2, 2, 2];
[0] = _n;
[1] = _i;
[2] = _t;
[3] = _r;
[4] = _o;
[5] = _m;
[6] = _e;
= [];
= [];
matrix = new Matrix();
rect = new Rectangle();
i = 0;
while (i < .length) {
= [i].getBounds(this);
bitmapdata = new BitmapData(.width, .height, true, 0xFFFFFF);
= new BitmapData(.width, .height, true, 0xFFFFFF);
bitmap = new Bitmap(bitmapdata);
.push(bitmap);
.push();
= new ([i]);
[i].addChild(bitmap);
[i].addChild();
bitmap.cacheAsBitmap = true;
.cacheAsBitmap = true;
bitmap.mask = ;
pos[i].x = [i].x;
pos[i].y = [i].y;
i++;
};
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
}
public function onEnterFrame(_arg1:Event):void{
i = 0;
while (i < .length) {
[i].bitmapData.copyPixels([i], new Rectangle(0, 0, [i].width, [i].height), new Point());
[i].visible = false;
i++;
};
i = 0;
while (i < .length) {
rect = new Rectangle(0, 0, [i].width, [i].height);
matrix.tx = -([i].x);
matrix.ty = -([i].y);
[i].draw(this, matrix, null, null, rect);
if ((((((((([i].x + ([i].width - 1)) > -270)) && ((([i].y + ([i].height - 1)) < 200)))) && (([i].x >= -270)))) && (([i].y >= -200)))){
var _local2 =
;
var _local3 = i;
var _local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
};
i++;
};
i = 0;
while (i < .length) {
if (
[i] <= 0){
[i].visible = true;
if ((([i]) && ((((Math.abs((pos[i].x - [i].x)) >> 0) + (Math.abs((pos[i].y - [i].y)) >> 0)) == 0)))){
if ([i].alpha > 0){
[i].alpha = ([i].alpha - 0.1);
};
} else {
if (((Math.abs((pos[i].x - [i].x)) >> 0) + (Math.abs((pos[i].y - [i].y)) >> 0)) != 0){
[i] = true;
};
};
};
pos[i].x = [i].x;
pos[i].y = [i].y;
i++;
};
}
}
}//package finalninjazero_fla
Section 174
//oishii_620 (finalninjazero_fla.oishii_620)
package finalninjazero_fla {
import flash.display.*;
public dynamic class oishii_620 extends MovieClip {
public function oishii_620(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 175
//pauseswat_224 (finalninjazero_fla.pauseswat_224)
package finalninjazero_fla {
import flash.display.*;
public dynamic class pauseswat_224 extends MovieClip {
public var arm:MovieClip;
}
}//package finalninjazero_fla
Section 176
//popup_clip_180 (finalninjazero_fla.popup_clip_180)
package finalninjazero_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import com.nitrome.game.*;
import flash.text.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class popup_clip_180 extends MovieClip {
public var try_again_button:TryAgainButton;
public var cash_count:TextField;
public var cash_bonus:TextField;
public var ticker_score:ScoreTicker;
public var next_level_button:NextLevelButton;
public var submit_score_button:SubmitScoreButton;
public var hunt_bonus:TextField;
public var enemy_count:TextField;
public var continue_end_button:ContinueEndButton;
public var msg_count:TextField;
public var msg_bonus:TextField;
public function popup_clip_180(){
addFrameScript(0, frame1, 1, frame2, 15, , 29, frame30, 45, , 60, frame61);
}
function (){
if (Score.value == 0){
submit_score_button.visible = false;
} else {
submit_score_button.visible = true;
};
ticker_score.startCount(Score.value, (Score.value / 75));
stop();
}
function frame1(){
stop();
}
function frame2(){
cash_bonus.text = (((("CASH BONUS (" + NitromeGame.bonus.cash_count.value) + "/") + NitromeGame.bonus.cash_total.value) + ")");
msg_bonus.text = (((("MSG BONUS (" + NitromeGame.bonus.msg_count.value) + "/") + NitromeGame.bonus.msg_total.value) + ")");
hunt_bonus.text = (((("HUNT BONUS (" + NitromeGame.bonus.enemy_count.value) + "/") + NitromeGame.bonus.enemy_total.value) + ")");
stop();
}
function frame30(){
cash_bonus.text = (((("CASH BONUS (" + NitromeGame.bonus.cash_count.value) + "/") + NitromeGame.bonus.cash_total.value) + ")");
msg_bonus.text = (((("MSG BONUS (" + NitromeGame.bonus.msg_count.value) + "/") + NitromeGame.bonus.msg_total.value) + ")");
hunt_bonus.text = (((("HUNT BONUS (" + NitromeGame.bonus.enemy_count.value) + "/") + NitromeGame.bonus.enemy_total.value) + ")");
stop();
}
function (){
cash_count.text = ((("CASH: " + NitromeGame.bonus.cash_count.value) + "/") + NitromeGame.bonus.cash_total.value);
msg_count.text = ((("MSG: " + NitromeGame.bonus.msg_count.value) + "/") + NitromeGame.bonus.msg_total.value);
enemy_count.text = ((("ENEMIES: " + NitromeGame.bonus.enemy_count.value) + "/") + NitromeGame.bonus.enemy_total.value);
stop();
}
function frame61(){
stop();
}
}
}//package finalninjazero_fla
Section 177
//powerdown_634 (finalninjazero_fla.powerdown_634)
package finalninjazero_fla {
import flash.display.*;
public dynamic class powerdown_634 extends MovieClip {
public function powerdown_634(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 178
//scientistdead_231 (finalninjazero_fla.scientistdead_231)
package finalninjazero_fla {
import flash.display.*;
public dynamic class scientistdead_231 extends MovieClip {
public function scientistdead_231(){
addFrameScript(23,
);
}
function
(){
stop();
}
}
}//package finalninjazero_fla
Section 179
//scientisthit_635 (finalninjazero_fla.scientisthit_635)
package finalninjazero_fla {
import flash.display.*;
public dynamic class scientisthit_635 extends MovieClip {
public function scientisthit_635(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 180
//score_counter_clip_182 (finalninjazero_fla.score_counter_clip_182)
package finalninjazero_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import com.nitrome.game.*;
import flash.text.*;
import flash.net.*;
import flash.media.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class score_counter_clip_182 extends MovieClip {
public var ticker_level:ScoreTicker;
public var ticker_score:ScoreTicker;
public var ticker_cash:ScoreTicker;
public var ticker_dodge:ScoreTicker;
public var ticker_hunt:ScoreTicker;
public var ticker_msg:ScoreTicker;
public function score_counter_clip_182(){
addFrameScript(19, frame20);
}
function frame20(){
ticker_cash.setOnFinish("ticker_msg", ((NitromeGame.bonus.msg_count.value == NitromeGame.bonus.msg_total.value)) ? 5000 : 0, (5000 / 25));
ticker_msg.setOnFinish("ticker_hunt", ((NitromeGame.bonus.enemy_count.value == NitromeGame.bonus.enemy_total.value)) ? 10000 : 0, (10000 / 25));
ticker_hunt.setOnFinish("ticker_dodge", (NitromeGame.bonus.dodge.value) ? 5000 : 0, (5000 / 25));
ticker_dodge.setOnFinish("ticker_level", NitromeGame.level_score, (NitromeGame.level_score / 50));
ticker_level.setOnFinish("ticker_score", Score.value, (Score.value / 50));
ticker_cash.startCount(((NitromeGame.bonus.cash_count.value == NitromeGame.bonus.cash_total.value)) ? 5000 : 0, (5000 / 25));
stop();
}
}
}//package finalninjazero_fla
Section 181
//score_panel_682 (finalninjazero_fla.score_panel_682)
package finalninjazero_fla {
import flash.display.*;
import flash.text.*;
public dynamic class score_panel_682 extends MovieClip {
public var score:TextField;
}
}//package finalninjazero_fla
Section 182
//shaker_679 (finalninjazero_fla.shaker_679)
package finalninjazero_fla {
import flash.display.*;
public dynamic class shaker_679 extends MovieClip {
public var canvas:holder;
}
}//package finalninjazero_fla
Section 183
//smithdie_626 (finalninjazero_fla.smithdie_626)
package finalninjazero_fla {
import flash.display.*;
public dynamic class smithdie_626 extends MovieClip {
public function smithdie_626(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 184
//smithhit_621 (finalninjazero_fla.smithhit_621)
package finalninjazero_fla {
import flash.display.*;
public dynamic class smithhit_621 extends MovieClip {
public function smithhit_621(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 185
//star_hit_613 (finalninjazero_fla.star_hit_613)
package finalninjazero_fla {
import flash.display.*;
public dynamic class star_hit_613 extends MovieClip {
public function star_hit_613(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 186
//stealthnin_96 (finalninjazero_fla.stealthnin_96)
package finalninjazero_fla {
import flash.display.*;
public dynamic class stealthnin_96 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 187
//sunflare_677 (finalninjazero_fla.sunflare_677)
package finalninjazero_fla {
import flash.display.*;
public dynamic class sunflare_677 extends MovieClip {
public var sparkle2:MovieClip;
public var sparkle1:MovieClip;
}
}//package finalninjazero_fla
Section 188
//swat_flare_50 (finalninjazero_fla.swat_flare_50)
package finalninjazero_fla {
import flash.display.*;
public dynamic class swat_flare_50 extends MovieClip {
public function swat_flare_50(){
addFrameScript(8, );
}
function (){
stop();
}
}
}//package finalninjazero_fla
Section 189
//swatgun_201 (finalninjazero_fla.swatgun_201)
package finalninjazero_fla {
import flash.display.*;
public dynamic class swatgun_201 extends MovieClip {
public var cartridges:MovieClip;
public function swatgun_201(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 190
//swdefend_253 (finalninjazero_fla.swdefend_253)
package finalninjazero_fla {
import flash.display.*;
public dynamic class swdefend_253 extends MovieClip {
public function swdefend_253(){
addFrameScript(0, frame1);
}
function frame1(){
NitromeGame.sound_manager.playSound("tang");
}
}
}//package finalninjazero_fla
Section 191
//swjumpfin_255 (finalninjazero_fla.swjumpfin_255)
package finalninjazero_fla {
import flash.display.*;
public dynamic class swjumpfin_255 extends MovieClip {
public function swjumpfin_255(){
addFrameScript(6, , 21, );
}
function (){
NitromeGame.sound_manager.playSound("sword1");
}
function (){
NitromeGame.sound_manager.playSound("chop");
}
}
}//package finalninjazero_fla
Section 192
//sword1_614 (finalninjazero_fla.sword1_614)
package finalninjazero_fla {
import flash.display.*;
public dynamic class sword1_614 extends MovieClip {
public function sword1_614(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 193
//sword2_615 (finalninjazero_fla.sword2_615)
package finalninjazero_fla {
import flash.display.*;
public dynamic class sword2_615 extends MovieClip {
public function sword2_615(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 194
//swstandinattack_254 (finalninjazero_fla.swstandinattack_254)
package finalninjazero_fla {
import flash.display.*;
public dynamic class swstandinattack_254 extends MovieClip {
public function swstandinattack_254(){
addFrameScript(0, frame1, 4,
);
}
function frame1(){
NitromeGame.sound_manager.playSound("sword2");
}
function
(){
NitromeGame.sound_manager.playSound("chop");
}
}
}//package finalninjazero_fla
Section 195
//swwaitdef_257 (finalninjazero_fla.swwaitdef_257)
package finalninjazero_fla {
import flash.display.*;
public dynamic class swwaitdef_257 extends MovieClip {
public function swwaitdef_257(){
addFrameScript(7,
);
}
function
(){
stop();
}
}
}//package finalninjazero_fla
Section 196
//tang_616 (finalninjazero_fla.tang_616)
package finalninjazero_fla {
import flash.display.*;
public dynamic class tang_616 extends MovieClip {
public function tang_616(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 197
//text_panel_684 (finalninjazero_fla.text_panel_684)
package finalninjazero_fla {
import flash.display.*;
public dynamic class text_panel_684 extends MovieClip {
public var panel:MovieClip;
public function text_panel_684(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package finalninjazero_fla
Section 198
//text_panel_faces_686 (finalninjazero_fla.text_panel_faces_686)
package finalninjazero_fla {
import flash.display.*;
public dynamic class text_panel_faces_686 extends MovieClip {
public function text_panel_faces_686(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 199
//text_panel_panel_685 (finalninjazero_fla.text_panel_panel_685)
package finalninjazero_fla {
import flash.display.*;
import flash.text.*;
public dynamic class text_panel_panel_685 extends MovieClip {
public var message_text:TextField;
public var face_panel:MovieClip;
}
}//package finalninjazero_fla
Section 200
//top_clip_lvls_56 (finalninjazero_fla.top_clip_lvls_56)
package finalninjazero_fla {
import flash.display.*;
public dynamic class top_clip_lvls_56 extends MovieClip {
public var top:MovieClip;
}
}//package finalninjazero_fla
Section 201
//waitinnin_101 (finalninjazero_fla.waitinnin_101)
package finalninjazero_fla {
import flash.display.*;
public dynamic class waitinnin_101 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 202
//waitnin_84 (finalninjazero_fla.waitnin_84)
package finalninjazero_fla {
import flash.display.*;
public dynamic class waitnin_84 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 203
//waitnin_help_189 (finalninjazero_fla.waitnin_help_189)
package finalninjazero_fla {
import flash.display.*;
public dynamic class waitnin_help_189 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 204
//waitnin_redy_help_191 (finalninjazero_fla.waitnin_redy_help_191)
package finalninjazero_fla {
import flash.display.*;
public dynamic class waitnin_redy_help_191 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 205
//waitnin_redy_throw_192 (finalninjazero_fla.waitnin_redy_throw_192)
package finalninjazero_fla {
import flash.display.*;
public dynamic class waitnin_redy_throw_192 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 206
//wallnin_99 (finalninjazero_fla.wallnin_99)
package finalninjazero_fla {
import flash.display.*;
public dynamic class wallnin_99 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 207
//wallnin_help_198 (finalninjazero_fla.wallnin_help_198)
package finalninjazero_fla {
import flash.display.*;
public dynamic class wallnin_help_198 extends MovieClip {
public var right_eye:MovieClip;
public var left_eye:MovieClip;
}
}//package finalninjazero_fla
Section 208
//wallpuff_51 (finalninjazero_fla.wallpuff_51)
package finalninjazero_fla {
import flash.display.*;
public dynamic class wallpuff_51 extends MovieClip {
public function wallpuff_51(){
addFrameScript(13, );
}
function (){
stop();
}
}
}//package finalninjazero_fla
Section 209
//wom_617 (finalninjazero_fla.wom_617)
package finalninjazero_fla {
import flash.display.*;
public dynamic class wom_617 extends MovieClip {
public function wom_617(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 210
//yatta_623 (finalninjazero_fla.yatta_623)
package finalninjazero_fla {
import flash.display.*;
public dynamic class yatta_623 extends MovieClip {
public function yatta_623(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package finalninjazero_fla
Section 211
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!(clip is DisplayObject)){
trace("Warning: Object passed as container clip not a descendant of the DisplayObject type");
return (null);
};
if (MovieClip(clip).stage == null){
trace("Warning: Container clip for ad is not attached to the stage");
return (null);
};
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
if (!options.skip){
loader.load(req);
};
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_w:Number;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var progress:Number;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}, progress_override:function (_arg1:Object):Number{
return (NaN);
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
if (options.skip){
ad_timeout = 0;
};
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
bar_w = ((w - bar.x) - 10);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(bar_w, 0);
backing.lineTo(bar_w, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(bar_w, 0);
inside.lineTo(bar_w, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(bar_w, 0);
outline.lineTo(bar_w, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
progress = Math.min(1, options.progress_override(clip));
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Object;
var _local11:Number;
var _local12:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = Math.min(1, options.progress_override(_local1));
if (_local7 == 1){
complete = true;
};
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local8 = ((100 * _local6) / _local5);
if (!isNaN(_local7)){
_local8 = (100 * _local7);
};
_local9 = ((100 * _local3) / chk.ad_msec);
_local10 = this._mochiad_bar._inside;
_local11 = Math.min(100, Math.min(((_local8) || (0)), _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10.scaleX = (_local11 * 0.01);
options.ad_progress(_local11);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local12 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local12 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local8 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (unloaded){
MochiAd.unload(_local1);
} else {
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 212
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
MochiSocial.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 213
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var :MochiDigits;
private var :Number;
private var :Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
= 0;
setValue(_arg1, _arg2);
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function ():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
= ( ^ (_local1 ^ ));
= _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode(( ^ ));
if ( != null){
_local1 = (_local1 + .toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
= (_local3.charCodeAt(_temp1) ^ );
if (_arg2 < _local3.length){
= new MochiDigits(_arg1, _arg2);
} else {
= null;
};
();
}
public function (_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 214
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var
:Object;
public function MochiEventDispatcher():void{
= {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (
[_arg1] == undefined){
return;
};
for (_local3 in
[_arg1]) {
var _local6 =
[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (
[_arg1] == undefined){
[_arg1] = [];
return;
};
for (_local3 in
[_arg1]) {
if (
[_arg1][_local3] != _arg2){
} else {
[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 215
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local3:Object;
var _local4:Object;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
}
}//package mochi.as3
Section 216
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var :Array;
private var :Object;
private var :Number;
private var
:Object;
private var :Number;
private var :Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, );
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, );
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, );
= new Object();
= false;
= 0;
= 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
();
};
}
private function (_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (_arg1.privateProperties.consumable){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if ( == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if ([_arg1]){
return (MochiDigits([_arg1]).value);
};
return (undefined);
}
public function ():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, );
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, );
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if ( == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if ([_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=.length) ? 0 : (_arg1 + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if ( == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if ([_arg1]){
_local3 = MochiDigits([_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
.push(_arg1);
[_arg1] = new MochiDigits(_arg2);
};
++;
}
private function sync(_arg1:Event=null):void{
var _local2:Object;
var _local3:String;
if ((() || (( == )))){
return;
};
= ;
_local2 = {};
for (_local3 in ) {
_local2[_local3] = MochiDigits([_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, );
= true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return ([(_arg1 - 1)]);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, );
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (![_arg1]){
return (false);
};
.splice(.indexOf(_arg1), 1);
delete [_arg1];
return (true);
}
private function (_arg1:Object):void{
[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function (_arg1:MochiUserData):void{
= false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
= -1;
};
triggerEvent(WRITTEN, {});
}
private function (_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
= {};
= new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
.push(_local2);
[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in
) {
_local3 =
[_local2].count;
if ([(_local2 + KEY_SALT)]){
_local3 = (_local3 - [_local2]);
};
if (_local3 == 0){
} else {
({id:_local2, count:_local3, properties:
[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function (_arg1:Object=null):void{
= null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 217
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = _callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _callbacks[cb];
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.8 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
var _local3:Number;
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String;
var _local3:String;
_local2 = _arg1.target;
_local3 = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = _arg1;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String;
var _local4:URLRequest;
var _local5:URLVariables;
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
_local3 = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local4 = new URLRequest(_local3);
_local5 = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function updateCopy(_arg1:Object):void{
MochiServices.send("coins_updateCopy", _arg1, null, null);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 218
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 219
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var
:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
= {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize",
);
break;
case SYNC_PROPERTY:
[_arg2.name] = _arg2.value;
break;
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (
[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:String;
if (
[_arg1] == _arg2){
return;
};
_local3 = _arg1.toString();
[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
}
}//package mochi.as3
Section 220
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var :Function;// = null
public var error:Event;// = null
public var key:String;// = null
public var :String;// = null
public var data;// = null
public var _loader:URLLoader;
public function MochiUserData(_arg1:String="", _arg2:Function=null){
key = null;
data = null;
error = null;
= null;
= null;
super();
this.key = _arg1;
this. = _arg2;
}
public function (_arg1:SecurityErrorEvent):void{
(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function (_arg1):void{
("put",
(_arg1));
}
public function
(_arg1:String, _arg2:ByteArray):void{
var api_url:String;
var api_token:String;
var args:URLVariables;
var req:URLRequest;
var _operation = _arg1;
var _data = _arg2;
= _operation;
api_url = MochiSocial.getAPIURL();
api_token = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
args = new URLVariables();
args.op = _operation;
args.key = key;
req = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, );
_loader.addEventListener(IOErrorEvent.IO_ERROR, );
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, );
try {
_loader.load(req);
} catch(e:SecurityError) {
(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function ():void{
try {
(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function
(_arg1):ByteArray{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function (_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if ( != null){
();
} else {
dispatchEvent(_arg1);
};
close();
}
public function (_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = (_loader.data);
} else {
data = null;
};
} catch(e:Error) {
(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if ( != null){
();
} else {
dispatchEvent(event);
};
close();
}
public function ():void{
("get",
(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + ) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, );
_loader.removeEventListener(IOErrorEvent.IO_ERROR, );
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, );
_loader.close();
_loader = null;
};
error = null;
= null;
}
public function (_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData;
_local3 = new MochiUserData(_arg1, _arg2);
_local3.();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData;
_local4 = new MochiUserData(_arg1, _arg3);
_local4. (_arg2);
}
}
}//package mochi.as3
Section 221
//BackArrayMC (BackArrayMC)
package {
import flash.display.*;
public dynamic class BackArrayMC extends MovieClip {
}
}//package
Section 222
//BangMC1 (BangMC1)
package {
import flash.display.*;
public dynamic class BangMC1 extends MovieClip {
}
}//package
Section 223
//BangMC2 (BangMC2)
package {
import flash.display.*;
public dynamic class BangMC2 extends MovieClip {
}
}//package
Section 224
//BangMC3 (BangMC3)
package {
import flash.display.*;
public dynamic class BangMC3 extends MovieClip {
}
}//package
Section 225
//BeamMC1 (BeamMC1)
package {
import flash.display.*;
public dynamic class BeamMC1 extends MovieClip {
public var beam:MovieClip;
}
}//package
Section 226
//BeamMC2 (BeamMC2)
package {
import flash.display.*;
public dynamic class BeamMC2 extends MovieClip {
public var beam:MovieClip;
}
}//package
Section 227
//BigShieldMC (BigShieldMC)
package {
import flash.display.*;
public dynamic class BigShieldMC extends Sprite {
}
}//package
Section 228
//BladeManMC (BladeManMC)
package {
import flash.display.*;
public dynamic class BladeManMC extends MovieClip {
public function BladeManMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 229
//BlockMC1 (BlockMC1)
package {
import flash.display.*;
public dynamic class BlockMC1 extends Sprite {
}
}//package
Section 230
//BlockMC10 (BlockMC10)
package {
import flash.display.*;
public dynamic class BlockMC10 extends Sprite {
}
}//package
Section 231
//BlockMC100 (BlockMC100)
package {
import flash.display.*;
public dynamic class BlockMC100 extends Sprite {
}
}//package
Section 232
//BlockMC101 (BlockMC101)
package {
import flash.display.*;
public dynamic class BlockMC101 extends Sprite {
}
}//package
Section 233
//BlockMC102 (BlockMC102)
package {
import flash.display.*;
public dynamic class BlockMC102 extends Sprite {
}
}//package
Section 234
//BlockMC103 (BlockMC103)
package {
import flash.display.*;
public dynamic class BlockMC103 extends Sprite {
}
}//package
Section 235
//BlockMC104 (BlockMC104)
package {
import flash.display.*;
public dynamic class BlockMC104 extends Sprite {
}
}//package
Section 236
//BlockMC105 (BlockMC105)
package {
import flash.display.*;
public dynamic class BlockMC105 extends Sprite {
}
}//package
Section 237
//BlockMC106 (BlockMC106)
package {
import flash.display.*;
public dynamic class BlockMC106 extends Sprite {
}
}//package
Section 238
//BlockMC107 (BlockMC107)
package {
import flash.display.*;
public dynamic class BlockMC107 extends Sprite {
}
}//package
Section 239
//BlockMC108 (BlockMC108)
package {
import flash.display.*;
public dynamic class BlockMC108 extends Sprite {
}
}//package
Section 240
//BlockMC109 (BlockMC109)
package {
import flash.display.*;
public dynamic class BlockMC109 extends Sprite {
}
}//package
Section 241
//BlockMC11 (BlockMC11)
package {
import flash.display.*;
public dynamic class BlockMC11 extends Sprite {
}
}//package
Section 242
//BlockMC110 (BlockMC110)
package {
import flash.display.*;
public dynamic class BlockMC110 extends Sprite {
}
}//package
Section 243
//BlockMC111 (BlockMC111)
package {
import flash.display.*;
public dynamic class BlockMC111 extends Sprite {
}
}//package
Section 244
//BlockMC112 (BlockMC112)
package {
import flash.display.*;
public dynamic class BlockMC112 extends Sprite {
}
}//package
Section 245
//BlockMC113 (BlockMC113)
package {
import flash.display.*;
public dynamic class BlockMC113 extends Sprite {
}
}//package
Section 246
//BlockMC114 (BlockMC114)
package {
import flash.display.*;
public dynamic class BlockMC114 extends Sprite {
}
}//package
Section 247
//BlockMC115 (BlockMC115)
package {
import flash.display.*;
public dynamic class BlockMC115 extends Sprite {
}
}//package
Section 248
//BlockMC116 (BlockMC116)
package {
import flash.display.*;
public dynamic class BlockMC116 extends Sprite {
}
}//package
Section 249
//BlockMC117 (BlockMC117)
package {
import flash.display.*;
public dynamic class BlockMC117 extends Sprite {
}
}//package
Section 250
//BlockMC118 (BlockMC118)
package {
import flash.display.*;
public dynamic class BlockMC118 extends Sprite {
}
}//package
Section 251
//BlockMC119 (BlockMC119)
package {
import flash.display.*;
public dynamic class BlockMC119 extends Sprite {
}
}//package
Section 252
//BlockMC12 (BlockMC12)
package {
import flash.display.*;
public dynamic class BlockMC12 extends Sprite {
}
}//package
Section 253
//BlockMC120 (BlockMC120)
package {
import flash.display.*;
public dynamic class BlockMC120 extends Sprite {
}
}//package
Section 254
//BlockMC121 (BlockMC121)
package {
import flash.display.*;
public dynamic class BlockMC121 extends Sprite {
}
}//package
Section 255
//BlockMC122 (BlockMC122)
package {
import flash.display.*;
public dynamic class BlockMC122 extends Sprite {
}
}//package
Section 256
//BlockMC123 (BlockMC123)
package {
import flash.display.*;
public dynamic class BlockMC123 extends Sprite {
}
}//package
Section 257
//BlockMC124 (BlockMC124)
package {
import flash.display.*;
public dynamic class BlockMC124 extends Sprite {
}
}//package
Section 258
//BlockMC125 (BlockMC125)
package {
import flash.display.*;
public dynamic class BlockMC125 extends Sprite {
}
}//package
Section 259
//BlockMC126 (BlockMC126)
package {
import flash.display.*;
public dynamic class BlockMC126 extends Sprite {
}
}//package
Section 260
//BlockMC127 (BlockMC127)
package {
import flash.display.*;
public dynamic class BlockMC127 extends Sprite {
}
}//package
Section 261
//BlockMC128 (BlockMC128)
package {
import flash.display.*;
public dynamic class BlockMC128 extends Sprite {
}
}//package
Section 262
//BlockMC129 (BlockMC129)
package {
import flash.display.*;
public dynamic class BlockMC129 extends Sprite {
}
}//package
Section 263
//BlockMC13 (BlockMC13)
package {
import flash.display.*;
public dynamic class BlockMC13 extends Sprite {
}
}//package
Section 264
//BlockMC130 (BlockMC130)
package {
import flash.display.*;
public dynamic class BlockMC130 extends Sprite {
}
}//package
Section 265
//BlockMC131 (BlockMC131)
package {
import flash.display.*;
public dynamic class BlockMC131 extends Sprite {
}
}//package
Section 266
//BlockMC132 (BlockMC132)
package {
import flash.display.*;
public dynamic class BlockMC132 extends Sprite {
}
}//package
Section 267
//BlockMC133 (BlockMC133)
package {
import flash.display.*;
public dynamic class BlockMC133 extends Sprite {
}
}//package
Section 268
//BlockMC134 (BlockMC134)
package {
import flash.display.*;
public dynamic class BlockMC134 extends Sprite {
}
}//package
Section 269
//BlockMC135 (BlockMC135)
package {
import flash.display.*;
public dynamic class BlockMC135 extends Sprite {
}
}//package
Section 270
//BlockMC136 (BlockMC136)
package {
import flash.display.*;
public dynamic class BlockMC136 extends Sprite {
}
}//package
Section 271
//BlockMC137 (BlockMC137)
package {
import flash.display.*;
public dynamic class BlockMC137 extends Sprite {
}
}//package
Section 272
//BlockMC138 (BlockMC138)
package {
import flash.display.*;
public dynamic class BlockMC138 extends Sprite {
}
}//package
Section 273
//BlockMC139 (BlockMC139)
package {
import flash.display.*;
public dynamic class BlockMC139 extends Sprite {
}
}//package
Section 274
//BlockMC14 (BlockMC14)
package {
import flash.display.*;
public dynamic class BlockMC14 extends Sprite {
}
}//package
Section 275
//BlockMC140 (BlockMC140)
package {
import flash.display.*;
public dynamic class BlockMC140 extends Sprite {
}
}//package
Section 276
//BlockMC141 (BlockMC141)
package {
import flash.display.*;
public dynamic class BlockMC141 extends Sprite {
}
}//package
Section 277
//BlockMC142 (BlockMC142)
package {
import flash.display.*;
public dynamic class BlockMC142 extends Sprite {
}
}//package
Section 278
//BlockMC143 (BlockMC143)
package {
import flash.display.*;
public dynamic class BlockMC143 extends Sprite {
}
}//package
Section 279
//BlockMC144 (BlockMC144)
package {
import flash.display.*;
public dynamic class BlockMC144 extends Sprite {
}
}//package
Section 280
//BlockMC145 (BlockMC145)
package {
import flash.display.*;
public dynamic class BlockMC145 extends Sprite {
}
}//package
Section 281
//BlockMC146 (BlockMC146)
package {
import flash.display.*;
public dynamic class BlockMC146 extends Sprite {
}
}//package
Section 282
//BlockMC147 (BlockMC147)
package {
import flash.display.*;
public dynamic class BlockMC147 extends Sprite {
}
}//package
Section 283
//BlockMC148 (BlockMC148)
package {
import flash.display.*;
public dynamic class BlockMC148 extends Sprite {
}
}//package
Section 284
//BlockMC149 (BlockMC149)
package {
import flash.display.*;
public dynamic class BlockMC149 extends Sprite {
}
}//package
Section 285
//BlockMC15 (BlockMC15)
package {
import flash.display.*;
public dynamic class BlockMC15 extends Sprite {
}
}//package
Section 286
//BlockMC150 (BlockMC150)
package {
import flash.display.*;
public dynamic class BlockMC150 extends Sprite {
}
}//package
Section 287
//BlockMC151 (BlockMC151)
package {
import flash.display.*;
public dynamic class BlockMC151 extends Sprite {
}
}//package
Section 288
//BlockMC152 (BlockMC152)
package {
import flash.display.*;
public dynamic class BlockMC152 extends Sprite {
}
}//package
Section 289
//BlockMC153 (BlockMC153)
package {
import flash.display.*;
public dynamic class BlockMC153 extends Sprite {
}
}//package
Section 290
//BlockMC154 (BlockMC154)
package {
import flash.display.*;
public dynamic class BlockMC154 extends Sprite {
}
}//package
Section 291
//BlockMC155 (BlockMC155)
package {
import flash.display.*;
public dynamic class BlockMC155 extends Sprite {
}
}//package
Section 292
//BlockMC156 (BlockMC156)
package {
import flash.display.*;
public dynamic class BlockMC156 extends Sprite {
}
}//package
Section 293
//BlockMC157 (BlockMC157)
package {
import flash.display.*;
public dynamic class BlockMC157 extends Sprite {
}
}//package
Section 294
//BlockMC158 (BlockMC158)
package {
import flash.display.*;
public dynamic class BlockMC158 extends Sprite {
}
}//package
Section 295
//BlockMC159 (BlockMC159)
package {
import flash.display.*;
public dynamic class BlockMC159 extends Sprite {
}
}//package
Section 296
//BlockMC16 (BlockMC16)
package {
import flash.display.*;
public dynamic class BlockMC16 extends Sprite {
}
}//package
Section 297
//BlockMC160 (BlockMC160)
package {
import flash.display.*;
public dynamic class BlockMC160 extends Sprite {
}
}//package
Section 298
//BlockMC161 (BlockMC161)
package {
import flash.display.*;
public dynamic class BlockMC161 extends Sprite {
}
}//package
Section 299
//BlockMC162 (BlockMC162)
package {
import flash.display.*;
public dynamic class BlockMC162 extends Sprite {
}
}//package
Section 300
//BlockMC163 (BlockMC163)
package {
import flash.display.*;
public dynamic class BlockMC163 extends Sprite {
}
}//package
Section 301
//BlockMC164 (BlockMC164)
package {
import flash.display.*;
public dynamic class BlockMC164 extends Sprite {
}
}//package
Section 302
//BlockMC165 (BlockMC165)
package {
import flash.display.*;
public dynamic class BlockMC165 extends Sprite {
}
}//package
Section 303
//BlockMC166 (BlockMC166)
package {
import flash.display.*;
public dynamic class BlockMC166 extends Sprite {
}
}//package
Section 304
//BlockMC167 (BlockMC167)
package {
import flash.display.*;
public dynamic class BlockMC167 extends Sprite {
}
}//package
Section 305
//BlockMC168 (BlockMC168)
package {
import flash.display.*;
public dynamic class BlockMC168 extends Sprite {
}
}//package
Section 306
//BlockMC169 (BlockMC169)
package {
import flash.display.*;
public dynamic class BlockMC169 extends Sprite {
}
}//package
Section 307
//BlockMC17 (BlockMC17)
package {
import flash.display.*;
public dynamic class BlockMC17 extends Sprite {
}
}//package
Section 308
//BlockMC170 (BlockMC170)
package {
import flash.display.*;
public dynamic class BlockMC170 extends Sprite {
}
}//package
Section 309
//BlockMC171 (BlockMC171)
package {
import flash.display.*;
public dynamic class BlockMC171 extends Sprite {
}
}//package
Section 310
//BlockMC172 (BlockMC172)
package {
import flash.display.*;
public dynamic class BlockMC172 extends Sprite {
}
}//package
Section 311
//BlockMC173 (BlockMC173)
package {
import flash.display.*;
public dynamic class BlockMC173 extends Sprite {
}
}//package
Section 312
//BlockMC174 (BlockMC174)
package {
import flash.display.*;
public dynamic class BlockMC174 extends Sprite {
}
}//package
Section 313
//BlockMC175 (BlockMC175)
package {
import flash.display.*;
public dynamic class BlockMC175 extends Sprite {
}
}//package
Section 314
//BlockMC176 (BlockMC176)
package {
import flash.display.*;
public dynamic class BlockMC176 extends Sprite {
}
}//package
Section 315
//BlockMC177 (BlockMC177)
package {
import flash.display.*;
public dynamic class BlockMC177 extends Sprite {
}
}//package
Section 316
//BlockMC178 (BlockMC178)
package {
import flash.display.*;
public dynamic class BlockMC178 extends Sprite {
}
}//package
Section 317
//BlockMC179 (BlockMC179)
package {
import flash.display.*;
public dynamic class BlockMC179 extends Sprite {
}
}//package
Section 318
//BlockMC18 (BlockMC18)
package {
import flash.display.*;
public dynamic class BlockMC18 extends Sprite {
}
}//package
Section 319
//BlockMC180 (BlockMC180)
package {
import flash.display.*;
public dynamic class BlockMC180 extends Sprite {
}
}//package
Section 320
//BlockMC181 (BlockMC181)
package {
import flash.display.*;
public dynamic class BlockMC181 extends Sprite {
}
}//package
Section 321
//BlockMC182 (BlockMC182)
package {
import flash.display.*;
public dynamic class BlockMC182 extends Sprite {
}
}//package
Section 322
//BlockMC183 (BlockMC183)
package {
import flash.display.*;
public dynamic class BlockMC183 extends Sprite {
}
}//package
Section 323
//BlockMC184 (BlockMC184)
package {
import flash.display.*;
public dynamic class BlockMC184 extends Sprite {
}
}//package
Section 324
//BlockMC185 (BlockMC185)
package {
import flash.display.*;
public dynamic class BlockMC185 extends Sprite {
}
}//package
Section 325
//BlockMC186 (BlockMC186)
package {
import flash.display.*;
public dynamic class BlockMC186 extends Sprite {
}
}//package
Section 326
//BlockMC187 (BlockMC187)
package {
import flash.display.*;
public dynamic class BlockMC187 extends Sprite {
}
}//package
Section 327
//BlockMC188 (BlockMC188)
package {
import flash.display.*;
public dynamic class BlockMC188 extends Sprite {
}
}//package
Section 328
//BlockMC189 (BlockMC189)
package {
import flash.display.*;
public dynamic class BlockMC189 extends Sprite {
}
}//package
Section 329
//BlockMC19 (BlockMC19)
package {
import flash.display.*;
public dynamic class BlockMC19 extends Sprite {
}
}//package
Section 330
//BlockMC190 (BlockMC190)
package {
import flash.display.*;
public dynamic class BlockMC190 extends Sprite {
}
}//package
Section 331
//BlockMC191 (BlockMC191)
package {
import flash.display.*;
public dynamic class BlockMC191 extends Sprite {
}
}//package
Section 332
//BlockMC192 (BlockMC192)
package {
import flash.display.*;
public dynamic class BlockMC192 extends Sprite {
}
}//package
Section 333
//BlockMC193 (BlockMC193)
package {
import flash.display.*;
public dynamic class BlockMC193 extends Sprite {
}
}//package
Section 334
//BlockMC194 (BlockMC194)
package {
import flash.display.*;
public dynamic class BlockMC194 extends Sprite {
}
}//package
Section 335
//BlockMC195 (BlockMC195)
package {
import flash.display.*;
public dynamic class BlockMC195 extends Sprite {
}
}//package
Section 336
//BlockMC196 (BlockMC196)
package {
import flash.display.*;
public dynamic class BlockMC196 extends Sprite {
}
}//package
Section 337
//BlockMC197 (BlockMC197)
package {
import flash.display.*;
public dynamic class BlockMC197 extends Sprite {
}
}//package
Section 338
//BlockMC198 (BlockMC198)
package {
import flash.display.*;
public dynamic class BlockMC198 extends Sprite {
}
}//package
Section 339
//BlockMC199 (BlockMC199)
package {
import flash.display.*;
public dynamic class BlockMC199 extends Sprite {
}
}//package
Section 340
//BlockMC2 (BlockMC2)
package {
import flash.display.*;
public dynamic class BlockMC2 extends Sprite {
}
}//package
Section 341
//BlockMC20 (BlockMC20)
package {
import flash.display.*;
public dynamic class BlockMC20 extends Sprite {
}
}//package
Section 342
//BlockMC200 (BlockMC200)
package {
import flash.display.*;
public dynamic class BlockMC200 extends Sprite {
}
}//package
Section 343
//BlockMC201 (BlockMC201)
package {
import flash.display.*;
public dynamic class BlockMC201 extends Sprite {
}
}//package
Section 344
//BlockMC202 (BlockMC202)
package {
import flash.display.*;
public dynamic class BlockMC202 extends Sprite {
}
}//package
Section 345
//BlockMC203 (BlockMC203)
package {
import flash.display.*;
public dynamic class BlockMC203 extends Sprite {
}
}//package
Section 346
//BlockMC204 (BlockMC204)
package {
import flash.display.*;
public dynamic class BlockMC204 extends Sprite {
}
}//package
Section 347
//BlockMC205 (BlockMC205)
package {
import flash.display.*;
public dynamic class BlockMC205 extends Sprite {
}
}//package
Section 348
//BlockMC206 (BlockMC206)
package {
import flash.display.*;
public dynamic class BlockMC206 extends Sprite {
}
}//package
Section 349
//BlockMC207 (BlockMC207)
package {
import flash.display.*;
public dynamic class BlockMC207 extends Sprite {
}
}//package
Section 350
//BlockMC208 (BlockMC208)
package {
import flash.display.*;
public dynamic class BlockMC208 extends Sprite {
}
}//package
Section 351
//BlockMC209 (BlockMC209)
package {
import flash.display.*;
public dynamic class BlockMC209 extends Sprite {
}
}//package
Section 352
//BlockMC21 (BlockMC21)
package {
import flash.display.*;
public dynamic class BlockMC21 extends Sprite {
}
}//package
Section 353
//BlockMC210 (BlockMC210)
package {
import flash.display.*;
public dynamic class BlockMC210 extends Sprite {
}
}//package
Section 354
//BlockMC211 (BlockMC211)
package {
import flash.display.*;
public dynamic class BlockMC211 extends Sprite {
}
}//package
Section 355
//BlockMC212 (BlockMC212)
package {
import flash.display.*;
public dynamic class BlockMC212 extends Sprite {
}
}//package
Section 356
//BlockMC213 (BlockMC213)
package {
import flash.display.*;
public dynamic class BlockMC213 extends Sprite {
}
}//package
Section 357
//BlockMC214 (BlockMC214)
package {
import flash.display.*;
public dynamic class BlockMC214 extends Sprite {
}
}//package
Section 358
//BlockMC215 (BlockMC215)
package {
import flash.display.*;
public dynamic class BlockMC215 extends Sprite {
}
}//package
Section 359
//BlockMC216 (BlockMC216)
package {
import flash.display.*;
public dynamic class BlockMC216 extends Sprite {
}
}//package
Section 360
//BlockMC217 (BlockMC217)
package {
import flash.display.*;
public dynamic class BlockMC217 extends Sprite {
}
}//package
Section 361
//BlockMC218 (BlockMC218)
package {
import flash.display.*;
public dynamic class BlockMC218 extends Sprite {
}
}//package
Section 362
//BlockMC219 (BlockMC219)
package {
import flash.display.*;
public dynamic class BlockMC219 extends Sprite {
}
}//package
Section 363
//BlockMC22 (BlockMC22)
package {
import flash.display.*;
public dynamic class BlockMC22 extends Sprite {
}
}//package
Section 364
//BlockMC220 (BlockMC220)
package {
import flash.display.*;
public dynamic class BlockMC220 extends Sprite {
}
}//package
Section 365
//BlockMC221 (BlockMC221)
package {
import flash.display.*;
public dynamic class BlockMC221 extends Sprite {
}
}//package
Section 366
//BlockMC222 (BlockMC222)
package {
import flash.display.*;
public dynamic class BlockMC222 extends Sprite {
}
}//package
Section 367
//BlockMC223 (BlockMC223)
package {
import flash.display.*;
public dynamic class BlockMC223 extends Sprite {
}
}//package
Section 368
//BlockMC224 (BlockMC224)
package {
import flash.display.*;
public dynamic class BlockMC224 extends Sprite {
}
}//package
Section 369
//BlockMC225 (BlockMC225)
package {
import flash.display.*;
public dynamic class BlockMC225 extends Sprite {
}
}//package
Section 370
//BlockMC226 (BlockMC226)
package {
import flash.display.*;
public dynamic class BlockMC226 extends Sprite {
}
}//package
Section 371
//BlockMC227 (BlockMC227)
package {
import flash.display.*;
public dynamic class BlockMC227 extends Sprite {
}
}//package
Section 372
//BlockMC228 (BlockMC228)
package {
import flash.display.*;
public dynamic class BlockMC228 extends Sprite {
}
}//package
Section 373
//BlockMC229 (BlockMC229)
package {
import flash.display.*;
public dynamic class BlockMC229 extends Sprite {
}
}//package
Section 374
//BlockMC23 (BlockMC23)
package {
import flash.display.*;
public dynamic class BlockMC23 extends Sprite {
}
}//package
Section 375
//BlockMC230 (BlockMC230)
package {
import flash.display.*;
public dynamic class BlockMC230 extends Sprite {
}
}//package
Section 376
//BlockMC231 (BlockMC231)
package {
import flash.display.*;
public dynamic class BlockMC231 extends Sprite {
}
}//package
Section 377
//BlockMC232 (BlockMC232)
package {
import flash.display.*;
public dynamic class BlockMC232 extends Sprite {
}
}//package
Section 378
//BlockMC233 (BlockMC233)
package {
import flash.display.*;
public dynamic class BlockMC233 extends Sprite {
}
}//package
Section 379
//BlockMC234 (BlockMC234)
package {
import flash.display.*;
public dynamic class BlockMC234 extends Sprite {
}
}//package
Section 380
//BlockMC24 (BlockMC24)
package {
import flash.display.*;
public dynamic class BlockMC24 extends Sprite {
}
}//package
Section 381
//BlockMC25 (BlockMC25)
package {
import flash.display.*;
public dynamic class BlockMC25 extends Sprite {
}
}//package
Section 382
//BlockMC26 (BlockMC26)
package {
import flash.display.*;
public dynamic class BlockMC26 extends Sprite {
}
}//package
Section 383
//BlockMC27 (BlockMC27)
package {
import flash.display.*;
public dynamic class BlockMC27 extends Sprite {
}
}//package
Section 384
//BlockMC28 (BlockMC28)
package {
import flash.display.*;
public dynamic class BlockMC28 extends Sprite {
}
}//package
Section 385
//BlockMC29 (BlockMC29)
package {
import flash.display.*;
public dynamic class BlockMC29 extends Sprite {
}
}//package
Section 386
//BlockMC3 (BlockMC3)
package {
import flash.display.*;
public dynamic class BlockMC3 extends Sprite {
}
}//package
Section 387
//BlockMC30 (BlockMC30)
package {
import flash.display.*;
public dynamic class BlockMC30 extends Sprite {
}
}//package
Section 388
//BlockMC31 (BlockMC31)
package {
import flash.display.*;
public dynamic class BlockMC31 extends Sprite {
}
}//package
Section 389
//BlockMC32 (BlockMC32)
package {
import flash.display.*;
public dynamic class BlockMC32 extends Sprite {
}
}//package
Section 390
//BlockMC33 (BlockMC33)
package {
import flash.display.*;
public dynamic class BlockMC33 extends Sprite {
}
}//package
Section 391
//BlockMC34 (BlockMC34)
package {
import flash.display.*;
public dynamic class BlockMC34 extends Sprite {
}
}//package
Section 392
//BlockMC35 (BlockMC35)
package {
import flash.display.*;
public dynamic class BlockMC35 extends Sprite {
}
}//package
Section 393
//BlockMC36 (BlockMC36)
package {
import flash.display.*;
public dynamic class BlockMC36 extends Sprite {
}
}//package
Section 394
//BlockMC37 (BlockMC37)
package {
import flash.display.*;
public dynamic class BlockMC37 extends Sprite {
}
}//package
Section 395
//BlockMC38 (BlockMC38)
package {
import flash.display.*;
public dynamic class BlockMC38 extends Sprite {
}
}//package
Section 396
//BlockMC39 (BlockMC39)
package {
import flash.display.*;
public dynamic class BlockMC39 extends Sprite {
}
}//package
Section 397
//BlockMC4 (BlockMC4)
package {
import flash.display.*;
public dynamic class BlockMC4 extends Sprite {
}
}//package
Section 398
//BlockMC40 (BlockMC40)
package {
import flash.display.*;
public dynamic class BlockMC40 extends Sprite {
}
}//package
Section 399
//BlockMC41 (BlockMC41)
package {
import flash.display.*;
public dynamic class BlockMC41 extends Sprite {
}
}//package
Section 400
//BlockMC42 (BlockMC42)
package {
import flash.display.*;
public dynamic class BlockMC42 extends Sprite {
}
}//package
Section 401
//BlockMC43 (BlockMC43)
package {
import flash.display.*;
public dynamic class BlockMC43 extends Sprite {
}
}//package
Section 402
//BlockMC44 (BlockMC44)
package {
import flash.display.*;
public dynamic class BlockMC44 extends Sprite {
}
}//package
Section 403
//BlockMC45 (BlockMC45)
package {
import flash.display.*;
public dynamic class BlockMC45 extends Sprite {
}
}//package
Section 404
//BlockMC46 (BlockMC46)
package {
import flash.display.*;
public dynamic class BlockMC46 extends Sprite {
}
}//package
Section 405
//BlockMC47 (BlockMC47)
package {
import flash.display.*;
public dynamic class BlockMC47 extends Sprite {
}
}//package
Section 406
//BlockMC48 (BlockMC48)
package {
import flash.display.*;
public dynamic class BlockMC48 extends Sprite {
}
}//package
Section 407
//BlockMC49 (BlockMC49)
package {
import flash.display.*;
public dynamic class BlockMC49 extends Sprite {
}
}//package
Section 408
//BlockMC5 (BlockMC5)
package {
import flash.display.*;
public dynamic class BlockMC5 extends Sprite {
}
}//package
Section 409
//BlockMC50 (BlockMC50)
package {
import flash.display.*;
public dynamic class BlockMC50 extends Sprite {
}
}//package
Section 410
//BlockMC51 (BlockMC51)
package {
import flash.display.*;
public dynamic class BlockMC51 extends Sprite {
}
}//package
Section 411
//BlockMC52 (BlockMC52)
package {
import flash.display.*;
public dynamic class BlockMC52 extends Sprite {
}
}//package
Section 412
//BlockMC53 (BlockMC53)
package {
import flash.display.*;
public dynamic class BlockMC53 extends Sprite {
}
}//package
Section 413
//BlockMC54 (BlockMC54)
package {
import flash.display.*;
public dynamic class BlockMC54 extends Sprite {
}
}//package
Section 414
//BlockMC55 (BlockMC55)
package {
import flash.display.*;
public dynamic class BlockMC55 extends Sprite {
}
}//package
Section 415
//BlockMC56 (BlockMC56)
package {
import flash.display.*;
public dynamic class BlockMC56 extends Sprite {
}
}//package
Section 416
//BlockMC57 (BlockMC57)
package {
import flash.display.*;
public dynamic class BlockMC57 extends Sprite {
}
}//package
Section 417
//BlockMC58 (BlockMC58)
package {
import flash.display.*;
public dynamic class BlockMC58 extends Sprite {
}
}//package
Section 418
//BlockMC59 (BlockMC59)
package {
import flash.display.*;
public dynamic class BlockMC59 extends Sprite {
}
}//package
Section 419
//BlockMC6 (BlockMC6)
package {
import flash.display.*;
public dynamic class BlockMC6 extends Sprite {
}
}//package
Section 420
//BlockMC60 (BlockMC60)
package {
import flash.display.*;
public dynamic class BlockMC60 extends Sprite {
}
}//package
Section 421
//BlockMC61 (BlockMC61)
package {
import flash.display.*;
public dynamic class BlockMC61 extends Sprite {
}
}//package
Section 422
//BlockMC62 (BlockMC62)
package {
import flash.display.*;
public dynamic class BlockMC62 extends Sprite {
}
}//package
Section 423
//BlockMC63 (BlockMC63)
package {
import flash.display.*;
public dynamic class BlockMC63 extends Sprite {
}
}//package
Section 424
//BlockMC64 (BlockMC64)
package {
import flash.display.*;
public dynamic class BlockMC64 extends Sprite {
}
}//package
Section 425
//BlockMC65 (BlockMC65)
package {
import flash.display.*;
public dynamic class BlockMC65 extends Sprite {
}
}//package
Section 426
//BlockMC66 (BlockMC66)
package {
import flash.display.*;
public dynamic class BlockMC66 extends Sprite {
}
}//package
Section 427
//BlockMC67 (BlockMC67)
package {
import flash.display.*;
public dynamic class BlockMC67 extends Sprite {
}
}//package
Section 428
//BlockMC68 (BlockMC68)
package {
import flash.display.*;
public dynamic class BlockMC68 extends Sprite {
}
}//package
Section 429
//BlockMC69 (BlockMC69)
package {
import flash.display.*;
public dynamic class BlockMC69 extends Sprite {
}
}//package
Section 430
//BlockMC7 (BlockMC7)
package {
import flash.display.*;
public dynamic class BlockMC7 extends Sprite {
}
}//package
Section 431
//BlockMC70 (BlockMC70)
package {
import flash.display.*;
public dynamic class BlockMC70 extends Sprite {
}
}//package
Section 432
//BlockMC71 (BlockMC71)
package {
import flash.display.*;
public dynamic class BlockMC71 extends Sprite {
}
}//package
Section 433
//BlockMC72 (BlockMC72)
package {
import flash.display.*;
public dynamic class BlockMC72 extends Sprite {
}
}//package
Section 434
//BlockMC73 (BlockMC73)
package {
import flash.display.*;
public dynamic class BlockMC73 extends Sprite {
}
}//package
Section 435
//BlockMC74 (BlockMC74)
package {
import flash.display.*;
public dynamic class BlockMC74 extends Sprite {
}
}//package
Section 436
//BlockMC75 (BlockMC75)
package {
import flash.display.*;
public dynamic class BlockMC75 extends Sprite {
}
}//package
Section 437
//BlockMC76 (BlockMC76)
package {
import flash.display.*;
public dynamic class BlockMC76 extends Sprite {
}
}//package
Section 438
//BlockMC77 (BlockMC77)
package {
import flash.display.*;
public dynamic class BlockMC77 extends Sprite {
}
}//package
Section 439
//BlockMC78 (BlockMC78)
package {
import flash.display.*;
public dynamic class BlockMC78 extends Sprite {
}
}//package
Section 440
//BlockMC79 (BlockMC79)
package {
import flash.display.*;
public dynamic class BlockMC79 extends Sprite {
}
}//package
Section 441
//BlockMC8 (BlockMC8)
package {
import flash.display.*;
public dynamic class BlockMC8 extends Sprite {
}
}//package
Section 442
//BlockMC80 (BlockMC80)
package {
import flash.display.*;
public dynamic class BlockMC80 extends Sprite {
}
}//package
Section 443
//BlockMC81 (BlockMC81)
package {
import flash.display.*;
public dynamic class BlockMC81 extends Sprite {
}
}//package
Section 444
//BlockMC82 (BlockMC82)
package {
import flash.display.*;
public dynamic class BlockMC82 extends Sprite {
}
}//package
Section 445
//BlockMC83 (BlockMC83)
package {
import flash.display.*;
public dynamic class BlockMC83 extends Sprite {
}
}//package
Section 446
//BlockMC84 (BlockMC84)
package {
import flash.display.*;
public dynamic class BlockMC84 extends Sprite {
}
}//package
Section 447
//BlockMC85 (BlockMC85)
package {
import flash.display.*;
public dynamic class BlockMC85 extends Sprite {
}
}//package
Section 448
//BlockMC86 (BlockMC86)
package {
import flash.display.*;
public dynamic class BlockMC86 extends Sprite {
}
}//package
Section 449
//BlockMC87 (BlockMC87)
package {
import flash.display.*;
public dynamic class BlockMC87 extends Sprite {
}
}//package
Section 450
//BlockMC88 (BlockMC88)
package {
import flash.display.*;
public dynamic class BlockMC88 extends Sprite {
}
}//package
Section 451
//BlockMC89 (BlockMC89)
package {
import flash.display.*;
public dynamic class BlockMC89 extends Sprite {
}
}//package
Section 452
//BlockMC9 (BlockMC9)
package {
import flash.display.*;
public dynamic class BlockMC9 extends Sprite {
}
}//package
Section 453
//BlockMC90 (BlockMC90)
package {
import flash.display.*;
public dynamic class BlockMC90 extends Sprite {
}
}//package
Section 454
//BlockMC91 (BlockMC91)
package {
import flash.display.*;
public dynamic class BlockMC91 extends Sprite {
}
}//package
Section 455
//BlockMC92 (BlockMC92)
package {
import flash.display.*;
public dynamic class BlockMC92 extends Sprite {
}
}//package
Section 456
//BlockMC93 (BlockMC93)
package {
import flash.display.*;
public dynamic class BlockMC93 extends Sprite {
}
}//package
Section 457
//BlockMC94 (BlockMC94)
package {
import flash.display.*;
public dynamic class BlockMC94 extends Sprite {
}
}//package
Section 458
//BlockMC95 (BlockMC95)
package {
import flash.display.*;
public dynamic class BlockMC95 extends Sprite {
}
}//package
Section 459
//BlockMC96 (BlockMC96)
package {
import flash.display.*;
public dynamic class BlockMC96 extends Sprite {
}
}//package
Section 460
//BlockMC97 (BlockMC97)
package {
import flash.display.*;
public dynamic class BlockMC97 extends Sprite {
}
}//package
Section 461
//BlockMC98 (BlockMC98)
package {
import flash.display.*;
public dynamic class BlockMC98 extends Sprite {
}
}//package
Section 462
//BlockMC99 (BlockMC99)
package {
import flash.display.*;
public dynamic class BlockMC99 extends Sprite {
}
}//package
Section 463
//BossBulletHitMC (BossBulletHitMC)
package {
import flash.display.*;
public dynamic class BossBulletHitMC extends MovieClip {
}
}//package
Section 464
//BossBulletMC (BossBulletMC)
package {
import flash.display.*;
public dynamic class BossBulletMC extends MovieClip {
}
}//package
Section 465
//BossGraphicMC (BossGraphicMC)
package {
import flash.display.*;
public dynamic class BossGraphicMC extends Sprite {
}
}//package
Section 466
//BossMC (BossMC)
package {
import flash.display.*;
public dynamic class BossMC extends Sprite {
}
}//package
Section 467
//BossPlatformMC1 (BossPlatformMC1)
package {
import flash.display.*;
public dynamic class BossPlatformMC1 extends Sprite {
}
}//package
Section 468
//BossPlatformMC2 (BossPlatformMC2)
package {
import flash.display.*;
public dynamic class BossPlatformMC2 extends Sprite {
}
}//package
Section 469
//BossPlatformMC3 (BossPlatformMC3)
package {
import flash.display.*;
public dynamic class BossPlatformMC3 extends Sprite {
}
}//package
Section 470
//BossPlatformMC4 (BossPlatformMC4)
package {
import flash.display.*;
public dynamic class BossPlatformMC4 extends Sprite {
}
}//package
Section 471
//BossPlatformMC5 (BossPlatformMC5)
package {
import flash.display.*;
public dynamic class BossPlatformMC5 extends Sprite {
}
}//package
Section 472
//BossPlatformMC6 (BossPlatformMC6)
package {
import flash.display.*;
public dynamic class BossPlatformMC6 extends MovieClip {
public var wheels:MovieClip;
}
}//package
Section 473
//BossPlatformMC7 (BossPlatformMC7)
package {
import flash.display.*;
public dynamic class BossPlatformMC7 extends MovieClip {
public var wheels:MovieClip;
}
}//package
Section 474
//BossShadowMC (BossShadowMC)
package {
import flash.display.*;
public dynamic class BossShadowMC extends MovieClip {
}
}//package
Section 475
//BuildBlockMC (BuildBlockMC)
package {
import flash.display.*;
public dynamic class BuildBlockMC extends Sprite {
}
}//package
Section 476
//BuildCoverMC (BuildCoverMC)
package {
import flash.display.*;
public dynamic class BuildCoverMC extends Sprite {
}
}//package
Section 477
//BuildElectricBlockMC (BuildElectricBlockMC)
package {
import flash.display.*;
public dynamic class BuildElectricBlockMC extends Sprite {
}
}//package
Section 478
//BuildWhiteBlockMC (BuildWhiteBlockMC)
package {
import flash.display.*;
public dynamic class BuildWhiteBlockMC extends Sprite {
}
}//package
Section 479
//BulletHitMC1 (BulletHitMC1)
package {
import flash.display.*;
public dynamic class BulletHitMC1 extends MovieClip {
}
}//package
Section 480
//BulletHitMC2 (BulletHitMC2)
package {
import flash.display.*;
public dynamic class BulletHitMC2 extends MovieClip {
}
}//package
Section 481
//BulletHitMC3 (BulletHitMC3)
package {
import flash.display.*;
public dynamic class BulletHitMC3 extends MovieClip {
}
}//package
Section 482
//BulletHitMC4 (BulletHitMC4)
package {
import flash.display.*;
public dynamic class BulletHitMC4 extends MovieClip {
}
}//package
Section 483
//BulletMC (BulletMC)
package {
import flash.display.*;
public dynamic class BulletMC extends MovieClip {
}
}//package
Section 484
//BurnMC1 (BurnMC1)
package {
import flash.display.*;
public dynamic class BurnMC1 extends MovieClip {
}
}//package
Section 485
//BurnMC2 (BurnMC2)
package {
import flash.display.*;
public dynamic class BurnMC2 extends MovieClip {
}
}//package
Section 486
//BurnMC3 (BurnMC3)
package {
import flash.display.*;
public dynamic class BurnMC3 extends MovieClip {
}
}//package
Section 487
//BurnMC4 (BurnMC4)
package {
import flash.display.*;
public dynamic class BurnMC4 extends MovieClip {
}
}//package
Section 488
//CammoMC (CammoMC)
package {
import flash.display.*;
public dynamic class CammoMC extends MovieClip {
public function CammoMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 489
//CartridgeMC (CartridgeMC)
package {
import flash.display.*;
public dynamic class CartridgeMC extends MovieClip {
}
}//package
Section 490
//ChameleonMC (ChameleonMC)
package {
import flash.display.*;
public dynamic class ChameleonMC extends MovieClip {
public var body:MovieClip;
public function ChameleonMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 491
//ChaseFinishMC (ChaseFinishMC)
package {
import flash.display.*;
public dynamic class ChaseFinishMC extends MovieClip {
public function ChaseFinishMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 492
//ClearButton (ClearButton)
package {
import com.nitrome.highscore.*;
public dynamic class ClearButton extends ClearButton {
public function ClearButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 493
//CoinFadeMC (CoinFadeMC)
package {
import flash.display.*;
public dynamic class CoinFadeMC extends MovieClip {
public function CoinFadeMC(){
addFrameScript(20, frame21);
}
function frame21(){
parent.removeChild(this);
stop();
}
}
}//package
Section 494
//CoinMC (CoinMC)
package {
import flash.display.*;
public dynamic class CoinMC extends Sprite {
}
}//package
Section 495
//CowardGeneratorMC (CowardGeneratorMC)
package {
import flash.display.*;
public dynamic class CowardGeneratorMC extends MovieClip {
public function CowardGeneratorMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 496
//CowardMC (CowardMC)
package {
import flash.display.*;
public dynamic class CowardMC extends MovieClip {
public function CowardMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 497
//DeadStarMC (DeadStarMC)
package {
import flash.display.*;
public dynamic class DeadStarMC extends MovieClip {
}
}//package
Section 498
//DebrisMC0 (DebrisMC0)
package {
import flash.display.*;
public dynamic class DebrisMC0 extends MovieClip {
}
}//package
Section 499
//DebrisMC1 (DebrisMC1)
package {
import flash.display.*;
public dynamic class DebrisMC1 extends MovieClip {
}
}//package
Section 500
//DebrisMC10 (DebrisMC10)
package {
import flash.display.*;
public dynamic class DebrisMC10 extends MovieClip {
}
}//package
Section 501
//DebrisMC11 (DebrisMC11)
package {
import flash.display.*;
public dynamic class DebrisMC11 extends MovieClip {
}
}//package
Section 502
//DebrisMC12 (DebrisMC12)
package {
import flash.display.*;
public dynamic class DebrisMC12 extends MovieClip {
}
}//package
Section 503
//DebrisMC13 (DebrisMC13)
package {
import flash.display.*;
public dynamic class DebrisMC13 extends MovieClip {
}
}//package
Section 504
//DebrisMC14 (DebrisMC14)
package {
import flash.display.*;
public dynamic class DebrisMC14 extends MovieClip {
}
}//package
Section 505
//DebrisMC2 (DebrisMC2)
package {
import flash.display.*;
public dynamic class DebrisMC2 extends MovieClip {
}
}//package
Section 506
//DebrisMC3 (DebrisMC3)
package {
import flash.display.*;
public dynamic class DebrisMC3 extends MovieClip {
}
}//package
Section 507
//DebrisMC4 (DebrisMC4)
package {
import flash.display.*;
public dynamic class DebrisMC4 extends MovieClip {
}
}//package
Section 508
//DebrisMC5 (DebrisMC5)
package {
import flash.display.*;
public dynamic class DebrisMC5 extends MovieClip {
}
}//package
Section 509
//DebrisMC6 (DebrisMC6)
package {
import flash.display.*;
public dynamic class DebrisMC6 extends MovieClip {
}
}//package
Section 510
//DebrisMC7 (DebrisMC7)
package {
import flash.display.*;
public dynamic class DebrisMC7 extends MovieClip {
}
}//package
Section 511
//DebrisMC8 (DebrisMC8)
package {
import flash.display.*;
public dynamic class DebrisMC8 extends MovieClip {
}
}//package
Section 512
//DebrisMC9 (DebrisMC9)
package {
import flash.display.*;
public dynamic class DebrisMC9 extends MovieClip {
}
}//package
Section 513
//ElectricFinishMC (ElectricFinishMC)
package {
import flash.display.*;
public dynamic class ElectricFinishMC extends Sprite {
}
}//package
Section 514
//ElectricMC (ElectricMC)
package {
import flash.display.*;
public dynamic class ElectricMC extends MovieClip {
}
}//package
Section 515
//ElectricMC1 (ElectricMC1)
package {
import flash.display.*;
public dynamic class ElectricMC1 extends Sprite {
}
}//package
Section 516
//ElectricMC2 (ElectricMC2)
package {
import flash.display.*;
public dynamic class ElectricMC2 extends Sprite {
}
}//package
Section 517
//ElectricMC3 (ElectricMC3)
package {
import flash.display.*;
public dynamic class ElectricMC3 extends Sprite {
}
}//package
Section 518
//ElectricMC4 (ElectricMC4)
package {
import flash.display.*;
public dynamic class ElectricMC4 extends Sprite {
}
}//package
Section 519
//ElectricMC5 (ElectricMC5)
package {
import flash.display.*;
public dynamic class ElectricMC5 extends Sprite {
}
}//package
Section 520
//ElectricMC6 (ElectricMC6)
package {
import flash.display.*;
public dynamic class ElectricMC6 extends Sprite {
}
}//package
Section 521
//ElectricMC7 (ElectricMC7)
package {
import flash.display.*;
public dynamic class ElectricMC7 extends Sprite {
}
}//package
Section 522
//ElectricMC8 (ElectricMC8)
package {
import flash.display.*;
public dynamic class ElectricMC8 extends Sprite {
}
}//package
Section 523
//ElectricMC9 (ElectricMC9)
package {
import flash.display.*;
public dynamic class ElectricMC9 extends Sprite {
}
}//package
Section 524
//EmitterMC (EmitterMC)
package {
import flash.display.*;
public dynamic class EmitterMC extends MovieClip {
}
}//package
Section 525
//EntranceLiftMC (EntranceLiftMC)
package {
import flash.display.*;
public dynamic class EntranceLiftMC extends MovieClip {
public function EntranceLiftMC(){
addFrameScript(49, frame50, 114, );
}
function (){
stop();
if (parent != null){
parent.removeChild(this);
};
}
function frame50(){
NitromeGame.sound_manager.playSound("lift");
}
}
}//package
Section 526
//EvilMovingBlockMC (EvilMovingBlockMC)
package {
import flash.display.*;
public dynamic class EvilMovingBlockMC extends MovieClip {
public function EvilMovingBlockMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 527
//EyeGlowMC (EyeGlowMC)
package {
import flash.display.*;
public dynamic class EyeGlowMC extends Sprite {
}
}//package
Section 528
//FlyingGunMC (FlyingGunMC)
package {
import flash.display.*;
public dynamic class FlyingGunMC extends MovieClip {
public function FlyingGunMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 529
//ForceFieldMC1 (ForceFieldMC1)
package {
import flash.display.*;
public dynamic class ForceFieldMC1 extends MovieClip {
public var field:MovieClip;
public function ForceFieldMC1(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package
Section 530
//ForceFieldMC2 (ForceFieldMC2)
package {
import flash.display.*;
public dynamic class ForceFieldMC2 extends MovieClip {
public var field:MovieClip;
public function ForceFieldMC2(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package
Section 531
//FrontArrayMC (FrontArrayMC)
package {
import flash.display.*;
public dynamic class FrontArrayMC extends MovieClip {
}
}//package
Section 532
//Game (Game)
package {
import com.nitrome.engine.*;
import flash.display.*;
import flash.events.*;
import com.nitrome.engine_specific.*;
import flash.geom.*;
import flash.utils.*;
import com.nitrome.game.*;
import flash.net.*;
import flash.ui.*;
public class Game {
public var
:int;// = 0
public var actor_map:Array;
public var tags:Array;
public var effect_holder:Sprite;
public var game_paused:Boolean;
public var :ColorTransform;
public var :String;
public var smoke_hit_bitmap:BitmapSprite;
public var shaker:Sprite;
public var :Array;
public var event_map:Array;
public var star_holder:Sprite;
public var scroller:Scroller;
public var path_map:Array;
public var completed:Boolean;
public var debug:Graphics;
public var current_event:Object;
public var tile_holder:Sprite;
public var cartridge_bitmap:BitmapSprite;
public var boss_bullet_hit_bitmap:BitmapSprite;
private var i:int;
private var j:int;
public var boss_level:Boolean;
public var alert_count:int;
public var sign_holder:Sprite;
public var burn_bitmap2:BitmapSprite;
public var burn_bitmap4:BitmapSprite;
public var bullet_layer_holder:Bitmap;
public var burn_bitmap1:BitmapSprite;
public var burn_bitmap3:BitmapSprite;
public var finish_count:int;
public var mouse_pressed:Boolean;
public var state:int;
public var :Boolean;
public var :int;
public var fx_layer_holder:Bitmap;
public var block_map:Array;
public var sniper_shot_bitmap:BitmapSprite;
public var :Graphics;
public var player_holder:Sprite;
public var :Array;
public var :Array;
public var dead_star_holder:Sprite;
public var player:Player;
public var spider:HackedSpider;
public var back:MovieClip;
public var
:Array;
public var spawn_holder:Sprite;
public var light_holder:Sprite;
public var bullet_bitmap:BitmapSprite;
public var events:Array;
public var :Array;
public var stack_map:Array;
public var spider_death_count:int;
public var bullet_hit_bitmap_left:BitmapSprite;
public var grenade_cartridge_bitmap:BitmapSprite;
public var grenade_bitmap:BitmapSprite;
public var star_debris_bitmap:BitmapSprite;
public var canvas:Sprite;
public var debris_clips:Array;
public var :Array;
public var bullet_hit_bitmap_up:BitmapSprite;
public var god_mode:Boolean;
public var rope_holder:Shape;
public var encounters:Array;
public var fx_layer:BitmapData;
public var spawnage:Array;
public var monster_holder:Sprite;
public var background_type:int;
public var scan_holder:Sprite;
public var enemy_health_panel:MovieClip;
public var frame_count:int;
public var bullets:Array;
public var boss_bullet_bitmap:BitmapSprite;
public var
:Number;
public var bullet_hit_bitmap_down:BitmapSprite;
public var scent_map:Array;
public var bullet_hit_bitmap_right:BitmapSprite;
public var :Rectangle;
public var bullet_layer:BitmapData;
public var bang_bitmap2:BitmapSprite;
public var background_holder:Sprite;
public var bang_bitmap1:BitmapSprite;
public var start_y:int;
public var bang_bitmap3:BitmapSprite;
public var start_x:int;
public var alert_state:int;
public var scrolling:int;
public static const DAWN_SUN:int = 4;
public static const NIGHT_CLOUDS:int = 0;
public static const ACTIVE:int = 2;
public static const IN_PLAY:int = 1;
public static const CHAMELEON_DELAY:int = 500;
public static const DAWN:int = 5;
public static const ALERT_DELAY:int = 250;
public static const WIDTH:int = 550;
public static const HEIGHT:int = 400;
public static const SCALE:Number = 0.015625;
public static const CHAMELEON:int = 4;
public static const EMPTY:int = -1;
public static const SAFE_COL:int = 0x838383;
public static const EVENT_AREA:int = 115;
public static const LIFT_DELAY:int = 75;
public static const ALERT_COL_LIMIT:Number = 100;
public static const ELECTRIC_DELAY:int = 125;
public static const DANGER_COL:int = 0xFF0600;
public static const ALERT_COL_SPEED:Number = 3;
public static const scale:int = 64;
public static const DAWN_CLOUDS_SUN:int = 2;
public static const SPIDER_DEATH_DELAY:int = 15;
public static const DAWN_CLOUDS:int = 3;
public static const INACTIVE:int = 1;
public static const NIGHT:int = 1;
public static const GAME:int = 1;
public static const ONE80DIVIDEDBYPI:Number = 57.2957795130823;
public static var cache_xml:Boolean = true;
public function Game(_arg1:Sprite, _arg2:Sprite, _arg3:MovieClip){
= 0;
super();
this.canvas = _arg1;
this.shaker = _arg2;
this.back = _arg3;
RayCast.init(this);
_arg1.addEventListener(Event.ENTER_FRAME,
, false, 0, true);
}
private function ():void{
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:String;
_local1 = new PlayerMC();
_local2 = new PlayerMC();
player_holder.addChild(_local1);
player = new Player(_local1, _local2, ((scale >> 1) + (start_x * scale)), ((-(Player.HEIGHT) >> 1) + ((start_y + 1) * scale)), this);
_local3 = ((NitromeGame.selected_level < 10)) ? "0" : "";
_local3 = (_local3 + NitromeGame.selected_level);
NitromeGame.timeline.msg_panel.setMsg(((_local3 + ": ") + ));
}
public function clearAll():void{
canvas.transform.colorTransform = new ColorTransform();
clearListeners();
while (canvas.numChildren > 0) {
canvas.removeChildAt(0);
};
}
private function ():void{
var _local1:int;
var _local2:int;
scroller.changeLayer(Scroller.ENCOUNTER_LAYER);
_local1 = 0;
while (_local1 < scroller.height) {
_local2 = 0;
while (_local2 < scroller.width) {
if (TileMaker.isEnemy(scroller.map_array[_local1][_local2])){
NitromeGame.bonus.enemy_total.value++;
};
_local2++;
};
_local1++;
};
}
private function (_arg1:MouseEvent):void{
mouse_pressed = false;
}
public function (_arg1:String, _arg2:String):void{
NitromeGame.timeline.text_panel.panel.message_text.text = _arg1;
NitromeGame.timeline.text_panel.gotoAndPlay("popup_stay");
NitromeGame.timeline.text_panel.panel.face_panel.gotoAndStop(_arg2);
}
public function ():void{
var _local1:int;
var _local2:String;
if (alert_state == ACTIVE){
.blueOffset = (.blueOffset -
);
.greenOffset = (.greenOffset -
);
if (
> 0){
if (.blueOffset <= -(ALERT_COL_LIMIT)){
= -(ALERT_COL_SPEED);
};
} else {
if (.blueOffset >= 0){
= ALERT_COL_SPEED;
};
};
canvas.transform.colorTransform = ;
if (NitromeGame.timeline.alert_panel.alpha < 1){
NitromeGame.timeline.alert_panel.alpha = (NitromeGame.timeline.alert_panel.alpha + 0.04);
} else {
alert_count--;
_local1 = ((alert_count * 0.04) >> 0);
_local2 = ("" + ((_local1 < 10)) ? ("0" + _local1) : _local1);
NitromeGame.timeline.alert_panel.alert_time.text = _local2;
if (alert_count <= 0){
standdown();
};
};
} else {
if (alert_state == INACTIVE){
if (.blueOffset < 0){
.blueOffset = (.blueOffset + ALERT_COL_SPEED);
.greenOffset = (.greenOffset + ALERT_COL_SPEED);
canvas.transform.colorTransform = ;
};
if (NitromeGame.timeline.alert_panel.alpha > 0){
NitromeGame.timeline.alert_panel.alpha = (NitromeGame.timeline.alert_panel.alpha - 0.04);
};
} else {
if (alert_state == CHAMELEON){
if (NitromeGame.timeline.alert_panel.alpha < 1){
NitromeGame.timeline.alert_panel.alpha = (NitromeGame.timeline.alert_panel.alpha + 0.04);
} else {
alert_count--;
_local1 = ((alert_count * 0.04) >> 0);
_local2 = ("" + ((_local1 < 10)) ? ("0" + _local1) : _local1);
NitromeGame.timeline.alert_panel.alert_time.text = _local2;
if (alert_count <= 0){
NitromeGame.timeline.alert_panel.alert_time.text = "00";
NitromeGame.timeline.alert_panel.alert_time.textColor = DANGER_COL;
alert_state = INACTIVE;
if (player.chameleon){
player.exitChameleonMode();
};
};
};
};
};
};
}
private function ():void{
var _local1:String;
var _local2:URLLoader;
_local1 = ();
if (((!(cache_xml)) || (!((NitromeGame.last_loaded_path == _local1))))){
_local2 = new URLLoader();
_local2.addEventListener(Event.COMPLETE, , false, 0, true);
_local2.load(new URLRequest(()));
} else {
(NitromeGame.last_loaded_xml);
};
}
public function chameleon():void{
if ((((alert_state == ACTIVE)) || ((alert_state == CHAMELEON)))){
return;
};
NitromeGame.timeline.alert_panel.alert_time.text = "HIDDEN";
NitromeGame.timeline.alert_panel.alert_time.textColor = SAFE_COL;
alert_state = CHAMELEON;
if (player.rope.length > 0){
mouse_pressed = false;
};
alert_count = CHAMELEON_DELAY;
}
private function (_arg1:Array, _arg2:Array, _arg3:int, _arg4:int, _arg5:int, _arg6:int):Array{
var _local7:Array;
_local7 = [];
if (_arg1[_arg4][_arg3] == EMPTY){
return (_local7);
};
_arg1[_arg4][_arg3] = EMPTY;
if ((((((_arg4 > 0)) && (!(TileMaker.isBlock(_arg2[(_arg4 - 1)][_arg3]))))) && (!((_arg1[(_arg4 - 1)][_arg3] == EMPTY))))){
_local7.push(new Dot(_arg3, (_arg4 - 1)));
} else {
if ((((_arg4 > 0)) && (TileMaker.isBlock(_arg2[(_arg4 - 1)][_arg3])))){
_arg1[(_arg4 - 1)][_arg3] = IN_PLAY;
};
};
if ((((((_arg3 < (_arg5 - 1))) && (!(TileMaker.isBlock(_arg2[_arg4][(_arg3 + 1)]))))) && (!((_arg1[_arg4][(_arg3 + 1)] == EMPTY))))){
_local7.push(new Dot((_arg3 + 1), _arg4));
} else {
if ((((_arg3 < (_arg5 - 1))) && (TileMaker.isBlock(_arg2[_arg4][(_arg3 + 1)])))){
_arg1[_arg4][(_arg3 + 1)] = IN_PLAY;
};
};
if ((((((_arg4 < (_arg6 - 1))) && (!(TileMaker.isBlock(_arg2[(_arg4 + 1)][_arg3]))))) && (!((_arg1[(_arg4 + 1)][_arg3] == EMPTY))))){
_local7.push(new Dot(_arg3, (_arg4 + 1)));
} else {
if ((((_arg4 < (_arg6 - 1))) && (TileMaker.isBlock(_arg2[(_arg4 + 1)][_arg3])))){
_arg1[(_arg4 + 1)][_arg3] = IN_PLAY;
};
};
if ((((((_arg3 > 0)) && (!(TileMaker.isBlock(_arg2[_arg4][(_arg3 - 1)]))))) && (!((_arg1[_arg4][(_arg3 - 1)] == EMPTY))))){
_local7.push(new Dot((_arg3 - 1), _arg4));
} else {
if ((((_arg3 > 0)) && (TileMaker.isBlock(_arg2[_arg4][(_arg3 - 1)])))){
_arg1[_arg4][(_arg3 - 1)] = IN_PLAY;
};
};
if ((((((_arg3 < (_arg5 - 1))) && ((_arg4 > 0)))) && (TileMaker.isBlock(_arg2[(_arg4 - 1)][(_arg3 + 1)])))){
_arg1[(_arg4 - 1)][(_arg3 + 1)] = IN_PLAY;
};
if ((((((_arg3 < (_arg5 - 1))) && ((_arg4 < (_arg6 - 1))))) && (TileMaker.isBlock(_arg2[(_arg4 + 1)][(_arg3 + 1)])))){
_arg1[(_arg4 + 1)][(_arg3 + 1)] = IN_PLAY;
};
if ((((((_arg3 > 0)) && ((_arg4 < (_arg6 - 1))))) && (TileMaker.isBlock(_arg2[(_arg4 + 1)][(_arg3 - 1)])))){
_arg1[(_arg4 + 1)][(_arg3 - 1)] = IN_PLAY;
};
if ((((((_arg3 > 0)) && ((_arg4 > 0)))) && (TileMaker.isBlock(_arg2[(_arg4 - 1)][(_arg3 - 1)])))){
_arg1[(_arg4 - 1)][(_arg3 - 1)] = IN_PLAY;
};
return (_local7);
}
private function (_arg1:Event):void{
if (current_event.active){
if (((((current_event.text_up) && ())) && (!(Key.isDown(Keyboard.SPACE))))){
current_event.active = false;
= false;
};
};
}
private function ():void{
if (shaker.y != 0){
shaker.y = -(shaker.y);
if (shaker.y > 0){
shaker.y--;
};
};
}
public function addScore(_arg1:int):void{
NitromeGame.level_score = (NitromeGame.level_score + _arg1);
Score.value = (Score.value + _arg1);
NitromeGame.timeline.score_panel.score.text =
();
}
public function electrocuteActors():void{
var _local1:int;
_local1 = 0;
while (_local1 < .length) {
[_local1].electrocuted = true;
_local1++;
};
}
public function
(_arg1:Event):void{
if (!NitromeGame.timeline.tt.tweening){
canvas.removeEventListener(Event.ENTER_FRAME,
);
init();
};
}
public function clearListeners():void{
canvas.removeEventListener(Event.ENTER_FRAME, main);
NitromeGame.timeline.text_panel.panel.removeEventListener(MouseEvent.CLICK, );
Key.stage.removeEventListener(MouseEvent.MOUSE_DOWN,
);
Key.stage.removeEventListener(MouseEvent.MOUSE_UP, );
Key.stage.removeEventListener(KeyboardEvent.KEY_DOWN,
);
Key.forceClearKeys();
}
private function (_arg1:int, _arg2:Array, _arg3:Array, _arg4:int, _arg5:int):Array{
var _local6:Array;
_local6 = [];
_arg2[_arg5][_arg4] = _arg1;
if ((((((_arg5 > 0)) && ((_arg3[(_arg5 - 1)][_arg4] == EVENT_AREA)))) && ((_arg2[(_arg5 - 1)][_arg4] == -1)))){
_local6.push(new Dot(_arg4, (_arg5 - 1)));
};
if ((((((_arg4 < (scroller.width - 1))) && ((_arg3[_arg5][(_arg4 + 1)] == EVENT_AREA)))) && ((_arg2[_arg5][(_arg4 + 1)] == -1)))){
_local6.push(new Dot((_arg4 + 1), _arg5));
};
if ((((((_arg5 < (scroller.height - 1))) && ((_arg3[(_arg5 + 1)][_arg4] == EVENT_AREA)))) && ((_arg2[(_arg5 + 1)][_arg4] == -1)))){
_local6.push(new Dot(_arg4, (_arg5 + 1)));
};
if ((((((_arg4 > 0)) && ((_arg3[_arg5][(_arg4 - 1)] == EVENT_AREA)))) && ((_arg2[_arg5][(_arg4 - 1)] == -1)))){
_local6.push(new Dot((_arg4 - 1), _arg5));
};
return (_local6);
}
public function ():void{
canvas.addEventListener(Event.ENTER_FRAME, main, false, 0, true);
NitromeGame.timeline.text_panel.panel.addEventListener(MouseEvent.CLICK, );
Key.stage.addEventListener(MouseEvent.MOUSE_DOWN,
);
Key.stage.addEventListener(MouseEvent.MOUSE_UP, );
Key.stage.addEventListener(KeyboardEvent.KEY_DOWN,
);
}
private function ():void{
var _local1:int;
i = 0;
while (i < bullets.length) {
if (bullets[i].active){
bullets[i].main();
};
if (bullets[i].active){
_local1 = 0;
while (_local1 < .length) {
if (bullets[i].intersects([_local1].collision_rect)){
[_local1].resolveBulletCollision(bullets[i]);
break;
};
_local1++;
};
};
if (((bullets[i].active) && (bullets[i].intersects(player.collision_rect)))){
bullets[i].resolvePlayerCollision(player);
};
if (!bullets[i].active){
bullets.splice(i, 1);
i--;
} else {
bullets[i].updateMC();
};
i++;
};
}
private function
(_arg1:Array):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
_local2 = [];
_local3 = 0;
while (_local3 < scroller.height) {
_local2[_local3] = [];
_local4 = 0;
while (_local4 < scroller.width) {
_local2[_local3].push(0);
_local4++;
};
_local3++;
};
_local3 = 0;
while (_local3 < scroller.height) {
_local4 = 0;
while (_local4 < scroller.width) {
if (_arg1[_local3][_local4] == IN_PLAY){
if ((((((_local3 > 0)) && ((_arg1[(_local3 - 1)][_local4] == IN_PLAY)))) || ((_local3 == 0)))){
_local2[_local3][_local4] = (_local2[_local3][_local4] | Rect.UP);
};
if ((((((_local4 < (scroller.width - 1))) && ((_arg1[_local3][(_local4 + 1)] == IN_PLAY)))) || ((_local4 == (scroller.width - 1))))){
_local2[_local3][_local4] = (_local2[_local3][_local4] | Rect.RIGHT);
};
if ((((((_local3 < (scroller.height - 1))) && ((_arg1[(_local3 + 1)][_local4] == IN_PLAY)))) || ((_local3 == (scroller.height - 1))))){
_local2[_local3][_local4] = (_local2[_local3][_local4] | Rect.DOWN);
};
if ((((((_local4 > 0)) && ((_arg1[_local3][(_local4 - 1)] == IN_PLAY)))) || ((_local4 == 0)))){
_local2[_local3][_local4] = (_local2[_local3][_local4] | Rect.LEFT);
};
} else {
_local2[_local3][_local4] = -1;
};
_local4++;
};
_local3++;
};
return (_local2);
}
private function ():void{
var _local1:int;
var _local2:int;
scroller.changeLayer(Scroller.ENCOUNTER_LAYER);
_local1 = 0;
while (_local1 < scroller.height) {
_local2 = 0;
while (_local2 < scroller.width) {
if ((((((block_map[_local1][_local2] >= 0)) || ((block_map[_local1][_local2] <= 0)))) && (TileMaker.isSpawn(block_map[_local1][_local2])))){
spawnage.push({x:_local2, y:_local1, id:scroller.map_array[_local1][_local2]});
scroller.map_array[_local1][_local2] = 0;
if ((((_local1 > 0)) && (TileMaker.isBlock(block_map[(_local1 - 1)][_local2])))){
if (stack_map[(_local1 - 1)][_local2] == EMPTY){
stack_map[(_local1 - 1)][_local2] = 0;
};
};
if ((((_local1 < (scroller.height - 1))) && (TileMaker.isBlock(block_map[(_local1 + 1)][_local2])))){
if (stack_map[(_local1 + 1)][_local2] == EMPTY){
stack_map[(_local1 + 1)][_local2] = 0;
};
};
};
_local2++;
};
_local1++;
};
}
public function levelComplete():void{
var _local1:Object;
if (completed){
return;
};
completed = true;
player.running = false;
if (NitromeGame.bonus.dodge.value){
addScore(5000);
};
if (NitromeGame.bonus.cash_count.value == NitromeGame.bonus.cash_total.value){
addScore(5000);
};
if (NitromeGame.bonus.msg_count.value == NitromeGame.bonus.msg_total.value){
addScore(5000);
};
if (NitromeGame.bonus.enemy_count.value == NitromeGame.bonus.enemy_total.value){
addScore(10000);
};
_local1 = {dodge:(NitromeGame.bonus.dodge.value == 1), cash_count:NitromeGame.bonus.cash_count.value, cash_total:NitromeGame.bonus.cash_total.value, msg_count:NitromeGame.bonus.msg_count.value, msg_total:NitromeGame.bonus.msg_total.value, enemy_count:NitromeGame.bonus.enemy_count.value, enemy_total:NitromeGame.bonus.enemy_total.value};
NitromeGame.setLevelBonus(_local1, NitromeGame.selected_level);
if (NitromeGame.selected_level >= (NitromeGame.total_levels - 1)){
NitromeGame.timeline.popup_holder.launchPopUp("final_level_complete");
} else {
NitromeGame.timeline.popup_holder.launchPopUp("level_complete");
NitromeGame.setLevelUnlocked((NitromeGame.selected_level + 1));
if (NitromeGame.last_level < (NitromeGame.selected_level + 1)){
NitromeGame.last_level = (NitromeGame.selected_level + 1);
};
};
}
private function ():void{
var _local1:int;
var _local2:int;
scroller.changeLayer(Scroller.ENCOUNTER_LAYER);
_local1 = 0;
while (_local1 < scroller.height) {
_local2 = 0;
while (_local2 < scroller.width) {
if (scroller.map_array[_local1][_local2] == 28){
NitromeGame.bonus.cash_total.value++;
};
_local2++;
};
_local1++;
};
}
private function
(_arg1:MouseEvent):void{
mouse_pressed = true;
}
public function addBullet(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:BitmapSprite):void{
bullets.push(new Bullet(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, this));
}
public function shake(_arg1:int):void{
shaker.y = _arg1;
}
public function pauseGame(_arg1:Boolean=false):void{
var _local2:int;
if (!player.active){
return;
};
if (!game_paused){
Util.stopClips(player_holder);
Util.stopClips(monster_holder);
game_paused = true;
if (_arg1){
NitromeGame.timeline.popup_holder.launchPopUp("game_help");
} else {
NitromeGame.timeline.popup_holder.launchPopUp("game_paused");
};
} else {
Util.startClips(player_holder);
Util.startClips(monster_holder);
_local2 = 0;
while (_local2 < encounters.length) {
encounters[_local2].unpause();
_local2++;
};
NitromeGame.timeline.popup_holder.hidePopUp();
game_paused = false;
};
}
private function
():void{
i = 0;
while (i <
.length) {
[i].main();
if (((!(
[i].active)) || (!(Util.onScreen(
[i].x,
[i].y, this, 20))))){
.splice(i, 1);
i--;
};
i++;
};
}
public function
(_arg1:Encounter):void{
var _local2:int;
_local2 = 0;
while (_local2 < encounters.length) {
if (encounters[_local2] == _arg1){
encounters.splice(_local2, 1);
break;
};
_local2++;
};
}
public function init():void{
var _local1:Shape;
var _local2:Shape;
background_holder = new Sprite();
tile_holder = new Sprite();
monster_holder = new Sprite();
star_holder = new Sprite();
dead_star_holder = new Sprite();
rope_holder = new Shape();
player_holder = new Sprite();
effect_holder = new Sprite();
sign_holder = new Sprite();
spawn_holder = new Sprite();
light_holder = new Sprite();
scan_holder = new Sprite();
fx_layer = new BitmapData(WIDTH, HEIGHT, true, 4294967295);
fx_layer_holder = new Bitmap(fx_layer);
bullet_layer = new BitmapData(WIDTH, HEIGHT, true, 4294967295);
bullet_layer_holder = new Bitmap(bullet_layer);
= new Rectangle(0, 0, WIDTH, HEIGHT);
_local1 = new Shape();
_local2 = new Shape();
debug = _local1.graphics;
= _local2.graphics;
debug.lineStyle(2, 0xFF00);
.lineStyle(1, 0xFF0000);
canvas.addChild(background_holder);
canvas.addChild(dead_star_holder);
canvas.addChild(scan_holder);
canvas.addChild(tile_holder);
canvas.addChild(monster_holder);
canvas.addChild(bullet_layer_holder);
canvas.addChild(spawn_holder);
canvas.addChild(rope_holder);
canvas.addChild(star_holder);
canvas.addChild(player_holder);
canvas.addChild(effect_holder);
canvas.addChild(sign_holder);
canvas.addChild(fx_layer_holder);
canvas.addChild(light_holder);
canvas.addChild(_local1);
canvas.addChild(_local2);
burn_bitmap1 = new BitmapSprite(new BurnMC1());
burn_bitmap2 = new BitmapSprite(new BurnMC2());
burn_bitmap3 = new BitmapSprite(new BurnMC3());
burn_bitmap4 = new BitmapSprite(new BurnMC4());
bang_bitmap1 = new BitmapSprite(new BangMC1());
bang_bitmap2 = new BitmapSprite(new BangMC2());
bang_bitmap3 = new BitmapSprite(new BangMC3());
star_debris_bitmap = new BitmapSprite(new DeadStarMC());
bullet_bitmap = new BitmapSprite(new BulletMC());
boss_bullet_bitmap = new BitmapSprite(new BossBulletMC());
grenade_bitmap = new BitmapSprite(new GrenadeMC());
bullet_hit_bitmap_up = new BitmapSprite(new BulletHitMC1());
bullet_hit_bitmap_right = new BitmapSprite(new BulletHitMC2());
bullet_hit_bitmap_down = new BitmapSprite(new BulletHitMC3());
bullet_hit_bitmap_left = new BitmapSprite(new BulletHitMC4());
sniper_shot_bitmap = new BitmapSprite(new SniperShotMC());
cartridge_bitmap = new BitmapSprite(new CartridgeMC());
grenade_cartridge_bitmap = new BitmapSprite(new GrenadeCartridgeMC());
smoke_hit_bitmap = new BitmapSprite(new SmokeHitMC());
boss_bullet_hit_bitmap = new BitmapSprite(new BossBulletHitMC());
debris_clips = [];
i = 0;
while (i < 15) {
debris_clips[i] = new BitmapSprite(new ((getDefinitionByName(("DebrisMC" + i)) as Class)));
i++;
};
encounters = [];
= [];
= [];
spawnage = [];
tags = [];
= [];
= [];
bullets = [];
= [];
= [];
frame_count = 0;
NitromeGame.level_score = 0;
state = GAME;
game_paused = false;
god_mode = false;
alert_state = INACTIVE;
= new ColorTransform();
= ALERT_COL_SPEED;
completed = false;
= false;
boss_level = false;
NitromeGame.bonus.dodge = new HiddenInt(1);
NitromeGame.bonus.cash_count = new HiddenInt();
NitromeGame.bonus.cash_total = new HiddenInt();
NitromeGame.bonus.msg_count = new HiddenInt();
NitromeGame.bonus.msg_total = new HiddenInt();
NitromeGame.bonus.enemy_count = new HiddenInt();
NitromeGame.bonus.enemy_total = new HiddenInt();
NitromeGame.timeline.health_panel.gotoAndStop("_3");
NitromeGame.timeline.alert_panel.alpha = 0;
NitromeGame.timeline.score_panel.score.text =
();
NitromeGame.timeline.fade_to_black.gotoAndStop("clear");
NitromeGame.timeline.text_panel.gotoAndStop(1);
enemy_health_panel = NitromeGame.timeline.enemy_health_panel;
enemy_health_panel.alpha = 0;
enemy_health_panel.bar.scaleX = 0;
NitromeGame.timeline.hint_panel.visible = false;
();
}
private function
(_arg1:KeyboardEvent):void{
if (Key.isDown(Key.P)){
pauseGame();
};
if (Key.isDown(Key.H)){
pauseGame(true);
};
}
public function addFX(_arg1:Number, _arg2:Number, _arg3:BitmapSprite):void{
if (_arg3 == bang_bitmap1){
NitromeGame.sound_manager.playSound("bang1");
} else {
if (_arg3 == bang_bitmap2){
NitromeGame.sound_manager.playSound("bang2");
} else {
if (_arg3 == bang_bitmap3){
NitromeGame.sound_manager.playSound("bang3");
};
};
};
.push(new FX(_arg1, _arg2, _arg3, this));
}
public function addBulletGroup(_arg1:Array):void{
bullets.push(new BulletGroup(_arg1));
}
private function ():void{
var _local1:int;
if (current_event.name == "message"){
if (!current_event.active){
NitromeGame.timeline.hint_panel.visible = false;
if (current_event.text_up){
();
current_event.text_up = false;
};
current_event = null;
} else {
if (current_event.forced){
if (!current_event.text_up){
current_event.text_up = true;
current_event.forced = false;
NitromeGame.sound_manager.playSound("msg");
if (!current_event.seen){
NitromeGame.bonus.msg_count.value++;
current_event.seen = true;
};
if (current_event.face == "ninja_reveal"){
_local1 = 0;
while (_local1 < .length) {
if (([_local1] is NinjaGuard)){
[_local1].reveal_count = NinjaGuard.REVEAL_DELAY;
};
_local1++;
};
};
(current_event.text, current_event.face);
};
} else {
if (!current_event.text_up){
if (spider == null){
if (((!(current_event.seen)) && (!(NitromeGame.timeline.hint_panel.visible)))){
NitromeGame.sound_manager.playSound("msg");
};
NitromeGame.timeline.hint_panel.visible = true;
} else {
NitromeGame.timeline.hint_panel.visible = false;
};
if (((((!(player.key_lock)) && ())) && (Key.isDown(Keyboard.SPACE)))){
NitromeGame.timeline.hint_panel.visible = false;
current_event.text_up = true;
(current_event.text, current_event.face);
= false;
if (!current_event.seen){
NitromeGame.bonus.msg_count.value++;
current_event.seen = true;
};
};
};
};
if (((((current_event.text_up) && ())) && (Key.isDown(Keyboard.SPACE)))){
current_event.active = false;
= false;
};
};
};
if (!Key.isDown(Keyboard.SPACE)){
= true;
};
}
public function
():String{
var _local1:String;
_local1 = Score.value.toString();
while (_local1.length < 7) {
_local1 = ("0" + _local1);
};
return (_local1);
}
public function ():void{
if (enemy_health_panel.bar.scaleX > 0){
if (enemy_health_panel.alpha < 1){
enemy_health_panel.alpha = (enemy_health_panel.alpha + 0.2);
};
} else {
if (enemy_health_panel.alpha > 0){
enemy_health_panel.alpha = (enemy_health_panel.alpha - 0.2);
};
};
}
private function
():void{
i = 0;
while (i < encounters.length) {
if (encounters[i].skip){
} else {
if (((encounters[i].has_collision) && (encounters[i].intersects(player.collision_rect)))){
encounters[i].resolvePlayerCollision(player);
};
if (encounters[i].has_main){
encounters[i].main();
};
if (!encounters[i].active){
Util.stopClips(encounters[i].mc);
encounters[i].mc.parent.removeChild(encounters[i].mc);
encounters.splice(i, 1);
i--;
};
};
i++;
};
}
private function (_arg1:Event):void{
var _local2:XML;
_local2 = new XML(_arg1.target.data);
NitromeGame.last_loaded_path = ();
NitromeGame.last_loaded_xml = _local2;
(_local2);
}
public function addSmoke(_arg1:Number, _arg2:Number):void{
var _local3:Smoke;
_local3 = new Smoke(_arg1, _arg2, this);
= (
+ (70 + (Math.random() * 50)));
= (
% 360);
_local3.addVelocity((Trig.cos[
] * 10), (Trig.sin[
] * 10));
.push(_local3);
}
public function reset():void{
game_paused = true;
clearAll();
init();
}
private function ():void{
i = 0;
while (i < .length) {
[i].main();
if (((!( [i].active)) || (!(Util.onScreen( [i].x, [i].y, this, [i].bitmap.width))))){
.splice(i, 1);
i--;
};
i++;
};
}
public function (_arg1:XML):void{
var _local2:Array;
var _local3:XML;
var _local4:int;
var _local5:int;
var _local6:*;
var _local7:XML;
var _local8:Boolean;
var _local9:LZW;
var _local10:String;
var _local11:Array;
var _local12:Boolean;
var _local13:String;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:String;
var _local19:Boolean;
_local2 = [];
_local3 = _arg1.level[0];
scroller = new Scroller(this, canvas, tile_holder, scale, parseInt(_local3.@width), parseInt(_local3.@height), WIDTH, HEIGHT);
start_x = parseInt(_local3.@start_x);
start_y = parseInt(_local3.@start_y);
background_type = parseInt(_local3.@background);
scrolling = parseInt(_local3.@scroll);
NitromeGame.timeline.back.gotoAndStop(((background_type < 2)) ? "night" : "dawn");
_local6 = [];
_local8 = (_local3.@compression == "true");
_local9 = new LZW();
i = 0;
for each (_local7 in _arg1.tiles) {
_local10 = "";
if (_local8){
_local10 = _local9.decompress(_local7.@values);
} else {
_local10 = _local7.@values;
};
_local6 = Util.unserialize(_local10);
_local11 = [];
_local4 = 0;
while (_local4 < scroller.height) {
_local11.push([]);
_local5 = 0;
while (_local5 < scroller.width) {
_local11[_local4].push(_local6[(_local5 + (_local4 * scroller.width))]);
_local5++;
};
_local4++;
};
_local12 = false;
if (i == 3){
scroller.addTileLayer(sign_holder);
_local12 = true;
} else {
if (i == 0){
scroller.addTileLayer(background_holder);
_local12 = true;
} else {
if (i == 2){
scroller.addTileLayer(monster_holder);
} else {
if (i == 4){
path_map = _local11;
} else {
if (i == 5){
actor_map = _local11;
} else {
if (i == 6){
event_map = _local11;
};
};
};
};
};
};
if (scroller.layers < 4){
scroller.addLayer(_local11, _local12);
};
i++;
};
for each (_local7 in _arg1.sign) {
_local13 = (_local8) ? _local9.decompress(_local7.@text) : _local7.@text;
_local14 = parseInt(_local7.@n);
_local15 = parseInt(_local7.@layer);
_local16 = parseInt(_local7.@width);
_local17 = parseInt(_local7.@height);
_local18 = _local7.@face;
_local19 = (_local7.@forced == "true");
_local2.push({text:_local13, n:_local14, layer:_local15, width:_local16, height:_local17, face:_local18, forced:_local19});
};
scroller.setSignage(_local2);
= _arg1.msg[0].@text;
block_map = scroller.map_array_layers[Scroller.BLOCK_LAYER];
stack_map =
(());
();
();
();
();
();
NitromeGame.bonus.msg_total.value = events.length;
if (scrolling){
scroller.renderScrollLayer(0, Scroller.VERT);
};
scroller.rezForced();
scroller.rezBeginning(start_x, start_y);
frame_count = 1;
();
();
NitromeGame.timeline.loading_clip.gotoAndPlay("fade_out");
NitromeGame.sound_manager.playMusic(SoundManager.GAME);
}
public function alert():void{
if ((((alert_state == ACTIVE)) || ((alert_state == CHAMELEON)))){
return;
};
NitromeGame.sound_manager.playSound("alert");
NitromeGame.timeline.alert_panel.alert_time.text = "DANGER";
NitromeGame.timeline.alert_panel.alert_time.textColor = DANGER_COL;
alert_state = ACTIVE;
j = 0;
while (j < encounters.length) {
encounters[j].alert();
j++;
};
if (player.rope.length > 0){
if (RayCast.cast(player.rope_end, block_map, true) != null){
mouse_pressed = false;
};
};
= new ColorTransform(1, 1, 1, 1, 0, 0, 0);
alert_count = ALERT_DELAY;
}
public function addDebrisDir(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, ... _args):void{
var _local6:int;
var _local7:DebrisFX;
_local6 = 0;
while (_local6 < _args.length) {
_local7 = new DebrisFX(_arg1, _arg2, _args[_local6], this);
_local7.addVelocity((_arg3 * (Math.random() * 10)), (_arg4 * (Math.random() * 10)));
.push(_local7);
_local6++;
};
}
public function ():void{
NitromeGame.timeline.text_panel.gotoAndPlay("hide");
}
public function addDebris(_arg1:Number, _arg2:Number, _arg3:Number, ... _args):void{
var _local5:int;
var _local6:DebrisFX;
_local5 = 0;
while (_local5 < _args.length) {
_local6 = new DebrisFX(_arg1, _arg2, _args[_local5], this);
_local6.addVelocity(((-5 + (Math.random() * 10)) + _arg3), ((-5 + (Math.random() * 5)) - 10));
.push(_local6);
_local5++;
};
}
private function
():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Dot;
var _local5:int;
var _local6:int;
var _local7:Boolean;
var _local8:Array;
var _local9:Object;
var _local10:Array;
var _local11:int;
var _local12:Array;
_local6 = -1;
_local7 = false;
_local8 = [];
_local9 = {};
_local10 = [];
events = [];
_local1 = 0;
while (_local1 < scroller.height) {
_local8[_local1] = [];
_local2 = 0;
while (_local2 < scroller.width) {
_local8[_local1][_local2] = -1;
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < scroller.height) {
_local2 = 0;
while (_local2 < scroller.width) {
if (!(((event_map[_local1][_local2] >= 0)) || ((event_map[_local1][_local2] <= 0)))){
if (event_map[_local1][_local2].search(/I/) > -1){
_local6 = event_map[_local1][_local2].match(/(?<=I\()\d+/)[0];
};
_local5 = parseInt(event_map[_local1][_local2].match(/\d+/)[0]);
_local7 = (event_map[_local1][_local2].search(/F/) > -1);
};
if ((event_map[_local1][_local2])){
if (event_map[_local1][_local2] == 1){
_local3 = 0;
while (_local3 < scroller.signage.length) {
if (scroller.signage[_local3].n == (_local2 + (_local1 * scroller.width))){
_local9 = {active:false, name:"message", face:scroller.signage[_local3].face, id:events.length, text:scroller.signage[_local3].text, forced:scroller.signage[_local3].forced, text_up:false, seen:false};
events.push(_local9);
_local10 = (_local9.id, _local8, event_map, _local2, _local1);
_local11 = 0;
while (_local11 < (scroller.width * scroller.height)) {
_local4 = _local10.shift();
_local12 = (_local9.id, _local8, event_map, _local4.x, _local4.y);
if (_local12.length > 0){
_local10 = _local10.concat(_local12);
};
if (_local10.length == 0){
break;
};
_local11++;
};
break;
};
_local3++;
};
};
};
_local2++;
};
_local1++;
};
event_map = _local8;
}
public function standdown():void{
if (alert_state == INACTIVE){
return;
};
alert_state = INACTIVE;
j = 0;
while (j < encounters.length) {
encounters[j].standdown();
j++;
};
NitromeGame.timeline.alert_panel.alert_time.text = "SAFE";
NitromeGame.timeline.alert_panel.alert_time.textColor = SAFE_COL;
}
private function ():void{
var _local1:int;
i = 0;
while (i < .length) {
_local1 = 0;
while (_local1 < encounters.length) {
if (((((((((encounters[_local1].active) && ((([i].all_collision) || (encounters[_local1].actor_target))))) && (!((encounters[_local1] is MovingBlock))))) && (encounters[_local1].has_collision))) && ([i].intersects(encounters[_local1].collision_rect)))){
if (!(encounters[_local1] is TripWire)){
[i].resolveEncounterCollision(encounters[_local1]);
};
if (((((!(boss_level)) && (encounters[_local1].active))) && (!((encounters[_local1] is TripWire))))){
enemy_health_panel.bar.scaleX = (encounters[_local1].health_fraction * encounters[_local1].health);
} else {
if (!boss_level){
enemy_health_panel.bar.scaleX = 0;
} else {
if ((encounters[_local1] is Boss)){
enemy_health_panel.bar.scaleX = (encounters[_local1].health_fraction * encounters[_local1].health);
};
};
};
};
if ([i] == spider){
if ((((encounters[_local1] is TripWire)) && (encounters[_local1].killer))){
if ((((encounters[_local1].type == TripWire.TURNING)) || ((encounters[_local1].type == TripWire.FIXED_VARIABLE)))){
if (RayCast.reportIntersectsRect(encounters[_local1].scan, encounters[_local1].cast, [i].collision_rect)){
[i].kill();
};
} else {
if (encounters[_local1].type == TripWire.FIXED){
if (encounters[_local1].collision_rect.intersects([i].collision_rect)){
[i].kill();
};
};
};
};
if ((((((((encounters[_local1] is FlyingGun)) && (encounters[_local1].killer))) && ((encounters[_local1].strength >= 1)))) && (!(Util.proximity(encounters[_local1].x, encounters[_local1].y, [i].x, [i].y, 50))))){
if (RayCast.reportIntersectsRect(encounters[_local1].scan, encounters[_local1].cast, [i].collision_rect)){
[i].kill();
};
};
};
_local1++;
};
[i].main();
if (![i].active){
Util.stopClips([i].mc);
[i].mc.parent.removeChild([i].mc);
.splice(i, 1);
i--;
};
i++;
};
if (((!((spider == null))) && (!(spider.active)))){
if (spider_death_count > 0){
spider_death_count--;
} else {
spider = null;
};
};
}
private function (_arg1:int):Boolean{
if (_arg1 == 1){
return (true);
};
return (false);
}
private function ():Array{
var _local1:Array;
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:int;
var _local7:Array;
var _local8:Array;
_local1 = [];
_local2 = block_map;
_local3 = 0;
while (_local3 < scroller.height) {
_local1[_local3] = [];
_local4 = 0;
while (_local4 < scroller.width) {
_local1[_local3].push(0);
_local4++;
};
_local3++;
};
_local5 = (_local1, _local2, start_x, start_y, scroller.width, scroller.height);
_local6 = 0;
while (_local6 < (scroller.width * scroller.height)) {
_local7 = [];
i = 0;
while (i < _local5.length) {
_local8 = (_local1, _local2, _local5[i].x, _local5[i].y, scroller.width, scroller.height);
if (_local8.length > 0){
_local7 = _local7.concat(_local8);
};
i++;
};
_local5 = _local7;
if (_local5.length == 0){
break;
};
_local6++;
};
return (_local1);
}
public function
(_arg1:Encounter):void{
encounters.push(_arg1);
}
public function main(_arg1:Event):void{
debug.clear();
debug.lineStyle(2, 0xFF00);
if (!game_paused){
if (player.state == Player.STEALTH){
player.stealthScreenGrab();
};
i = 0;
while (i < .length) {
if ( [i].active){
if (Util.onScreen( [i].x, [i].y, this, 100)){
[i].stealthScreenGrab();
};
} else {
.splice(i, 1);
i--;
};
i++;
};
if (player.active){
player.main();
} else {
if (player.level_completed){
finish_count++;
if ((player.finish_item is Lift)){
if (finish_count == LIFT_DELAY){
levelComplete();
};
} else {
if ((player.finish_item is ElectricFinish)){
if (finish_count == LIFT_DELAY){
NitromeGame.timeline.fade_to_black.gotoAndPlay("fade");
NitromeGame.sound_manager.playSound("bosslaugh");
} else {
if (finish_count == ELECTRIC_DELAY){
levelComplete();
};
};
} else {
if (player.finish_item == null){
if (finish_count == 25){
NitromeGame.timeline.fade_to_black.gotoAndPlay("fade");
} else {
if (finish_count == LIFT_DELAY){
levelComplete();
};
};
};
};
};
};
};
if (scrolling){
if (scrolling == Scroller.HORIZ){
scroller.tile_layers[0].y = (scroller.tile_layers[0].y + 5);
if (scroller.tile_layers[0].y > 0){
scroller.tile_layers[0].y = (scroller.tile_layers[0].y - (scroller.height * scale));
};
} else {
scroller.tile_layers[0].y = (scroller.tile_layers[0].y - 5);
if (scroller.tile_layers[0].y < (-(scroller.height) * scale)){
scroller.tile_layers[0].y = (scroller.tile_layers[0].y + (scroller.height * scale));
};
};
};
fx_layer.fillRect(, 0xFFFFFF);
fx_layer_holder.x = -(canvas.x);
fx_layer_holder.y = -(canvas.y);
bullet_layer.fillRect(, 0xFFFFFF);
bullet_layer_holder.x = -(canvas.x);
bullet_layer_holder.y = -(canvas.y);
scan_holder.graphics.clear();
();
();
();
();
();
();
();
();
();
if (current_event != null){
();
};
frame_count++;
};
}
public function (_arg1:Actor):void{
var _local2:int;
_local2 = 0;
while (_local2 < .length) {
if ([_local2] == _arg1){
.splice(_local2, 1);
break;
};
_local2++;
};
}
public function (_arg1:Actor):void{
.push(_arg1);
}
private function ():String{
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:String;
_local1 = ("" + NitromeGame.selected_level);
if (NitromeGame.selected_level < 10){
_local1 = ("0" + NitromeGame.selected_level);
};
_local2 = "levels/";
_local3 = ".xml";
_local4 = ((NitromeGame.getSwfPath() + _local2) + NitromeGame.getLevelName((NitromeGame.selected_level + 1), _local3));
return (_local4);
}
public function gameOver():void{
NitromeGame.timeline.popup_holder.launchPopUp("game_over");
}
private function ():void{
var _local1:int;
var _local2:int;
scent_map = [];
_local1 = 0;
while (_local1 < scroller.height) {
scent_map[_local1] = [];
_local2 = 0;
while (_local2 < scroller.width) {
if (stack_map[_local1][_local2] > Game.EMPTY){
scent_map[_local1].push(-1);
} else {
scent_map[_local1].push(0);
};
_local2++;
};
_local1++;
};
}
private function ():void{
i = 0;
while (i < .length) {
[i].main();
if (((!([i].active)) || (!(Util.onScreen([i].x, [i].y, this, 50))))){
.splice(i, 1);
i--;
};
i++;
};
}
}
}//package
Section 533
//GameMusic (GameMusic)
package {
import flash.media.*;
public dynamic class GameMusic extends Sound {
}
}//package
Section 534
//GeneratorMC (GeneratorMC)
package {
import flash.display.*;
public dynamic class GeneratorMC extends MovieClip {
public function GeneratorMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 535
//GrenadeCartridgeMC (GrenadeCartridgeMC)
package {
import flash.display.*;
public dynamic class GrenadeCartridgeMC extends MovieClip {
}
}//package
Section 536
//GrenadeMC (GrenadeMC)
package {
import flash.display.*;
public dynamic class GrenadeMC extends MovieClip {
}
}//package
Section 537
//GunBlockMC1 (GunBlockMC1)
package {
import flash.display.*;
public dynamic class GunBlockMC1 extends MovieClip {
public var gun:MovieClip;
}
}//package
Section 538
//GunBlockMC2 (GunBlockMC2)
package {
import flash.display.*;
public dynamic class GunBlockMC2 extends MovieClip {
public var gun:MovieClip;
}
}//package
Section 539
//GunBlockMC3 (GunBlockMC3)
package {
import flash.display.*;
public dynamic class GunBlockMC3 extends MovieClip {
public var gun:MovieClip;
}
}//package
Section 540
//GunBlockMC4 (GunBlockMC4)
package {
import flash.display.*;
public dynamic class GunBlockMC4 extends MovieClip {
public var gun:MovieClip;
}
}//package
Section 541
//GunManMC (GunManMC)
package {
import flash.display.*;
public dynamic class GunManMC extends MovieClip {
public var arm:MovieClip;
public var gun:MovieClip;
public function GunManMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 542
//GunMC (GunMC)
package {
import flash.display.*;
public dynamic class GunMC extends MovieClip {
public var cartridges:MovieClip;
public function GunMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 543
//HackSpiderMC (HackSpiderMC)
package {
import flash.display.*;
public dynamic class HackSpiderMC extends MovieClip {
public var light:MovieClip;
public var body:MovieClip;
}
}//package
Section 544
//HealthFadeMC (HealthFadeMC)
package {
import flash.display.*;
public dynamic class HealthFadeMC extends MovieClip {
public function HealthFadeMC(){
addFrameScript(20, frame21);
}
function frame21(){
parent.removeChild(this);
stop();
}
}
}//package
Section 545
//HealthMC (HealthMC)
package {
import flash.display.*;
public dynamic class HealthMC extends Sprite {
}
}//package
Section 546
//HighScoreBoard (HighScoreBoard)
package {
import com.nitrome.highscore.*;
public dynamic class HighScoreBoard extends HighScoreBoard {
public function HighScoreBoard(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 547
//HitSparkMC (HitSparkMC)
package {
import flash.display.*;
public dynamic class HitSparkMC extends MovieClip {
public function HitSparkMC(){
addFrameScript(0, frame1, 8, );
}
function frame1(){
NitromeGame.sound_manager.playSound("star_hit");
}
function (){
parent.removeChild(this);
stop();
}
}
}//package
Section 548
//holder (holder)
package {
import flash.display.*;
public dynamic class holder extends Sprite {
}
}//package
Section 549
//IntroMC1 (IntroMC1)
package {
import flash.display.*;
public dynamic class IntroMC1 extends MovieClip {
}
}//package
Section 550
//IntroMC2 (IntroMC2)
package {
import flash.display.*;
public dynamic class IntroMC2 extends MovieClip {
}
}//package
Section 551
//IntroMC3 (IntroMC3)
package {
import flash.display.*;
public dynamic class IntroMC3 extends MovieClip {
}
}//package
Section 552
//IntroMC4 (IntroMC4)
package {
import flash.display.*;
public dynamic class IntroMC4 extends MovieClip {
}
}//package
Section 553
//IntroMC5 (IntroMC5)
package {
import flash.display.*;
public dynamic class IntroMC5 extends MovieClip {
}
}//package
Section 554
//IntroMC6 (IntroMC6)
package {
import flash.display.*;
public dynamic class IntroMC6 extends MovieClip {
}
}//package
Section 555
//IntroMC7 (IntroMC7)
package {
import flash.display.*;
public dynamic class IntroMC7 extends MovieClip {
}
}//package
Section 556
//JumpMC (JumpMC)
package {
import flash.display.*;
public dynamic class JumpMC extends MovieClip {
public function JumpMC(){
addFrameScript(11, );
}
function (){
if (parent != null){
parent.removeChild(this);
};
stop();
}
}
}//package
Section 557
//LaserGunMC (LaserGunMC)
package {
import flash.display.*;
public dynamic class LaserGunMC extends MovieClip {
}
}//package
Section 558
//LaserGunSparksMC (LaserGunSparksMC)
package {
import flash.display.*;
public dynamic class LaserGunSparksMC extends MovieClip {
}
}//package
Section 559
//LaserMC1 (LaserMC1)
package {
import flash.display.*;
public dynamic class LaserMC1 extends MovieClip {
}
}//package
Section 560
//LaserMC2 (LaserMC2)
package {
import flash.display.*;
public dynamic class LaserMC2 extends MovieClip {
}
}//package
Section 561
//LaserMC3 (LaserMC3)
package {
import flash.display.*;
public dynamic class LaserMC3 extends MovieClip {
}
}//package
Section 562
//LaserMC4 (LaserMC4)
package {
import flash.display.*;
public dynamic class LaserMC4 extends MovieClip {
}
}//package
Section 563
//LaserMC5 (LaserMC5)
package {
import flash.display.*;
public dynamic class LaserMC5 extends MovieClip {
public var scanner:MovieClip;
}
}//package
Section 564
//LaserMC6 (LaserMC6)
package {
import flash.display.*;
public dynamic class LaserMC6 extends MovieClip {
public var scanner:MovieClip;
}
}//package
Section 565
//LaserMC7 (LaserMC7)
package {
import flash.display.*;
public dynamic class LaserMC7 extends MovieClip {
public var scanner:MovieClip;
}
}//package
Section 566
//LaserMC8 (LaserMC8)
package {
import flash.display.*;
public dynamic class LaserMC8 extends MovieClip {
public var scanner:MovieClip;
}
}//package
Section 567
//LeftArmMC (LeftArmMC)
package {
import flash.display.*;
public dynamic class LeftArmMC extends MovieClip {
public function LeftArmMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 568
//LetterButton (LetterButton)
package {
import com.nitrome.highscore.*;
public dynamic class LetterButton extends LetterButton {
public function LetterButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 569
//LevelCompleteMC (LevelCompleteMC)
package {
import flash.display.*;
public dynamic class LevelCompleteMC extends MovieClip {
public function LevelCompleteMC(){
addFrameScript(34, , 49, frame50);
}
function (){
NitromeGame.sound_manager.playSound("yatta");
}
function frame50(){
stop();
}
}
}//package
Section 570
//LiftMC (LiftMC)
package {
import flash.display.*;
public dynamic class LiftMC extends MovieClip {
public function LiftMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 571
//MenuMusic (MenuMusic)
package {
import flash.media.*;
public dynamic class MenuMusic extends Sound {
}
}//package
Section 572
//MidMC1 (MidMC1)
package {
import flash.display.*;
public dynamic class MidMC1 extends Sprite {
}
}//package
Section 573
//MidMC2 (MidMC2)
package {
import flash.display.*;
public dynamic class MidMC2 extends Sprite {
}
}//package
Section 574
//MidMC3 (MidMC3)
package {
import flash.display.*;
public dynamic class MidMC3 extends Sprite {
}
}//package
Section 575
//MidMC4 (MidMC4)
package {
import flash.display.*;
public dynamic class MidMC4 extends Sprite {
}
}//package
Section 576
//MidMC5 (MidMC5)
package {
import flash.display.*;
public dynamic class MidMC5 extends Sprite {
}
}//package
Section 577
//MidMC6 (MidMC6)
package {
import flash.display.*;
public dynamic class MidMC6 extends Sprite {
}
}//package
Section 578
//MiniclipIntro (MiniclipIntro)
package {
import flash.display.*;
public dynamic class MiniclipIntro extends MovieClip {
public var mcAnimation:MovieClip;
}
}//package
Section 579
//Morph (Morph)
package {
import com.nitrome.engine_specific.*;
public dynamic class Morph extends Morph {
}
}//package
Section 580
//MovingMC1 (MovingMC1)
package {
import flash.display.*;
public dynamic class MovingMC1 extends Sprite {
}
}//package
Section 581
//MovingMC10 (MovingMC10)
package {
import flash.display.*;
public dynamic class MovingMC10 extends Sprite {
}
}//package
Section 582
//MovingMC11 (MovingMC11)
package {
import flash.display.*;
public dynamic class MovingMC11 extends Sprite {
}
}//package
Section 583
//MovingMC2 (MovingMC2)
package {
import flash.display.*;
public dynamic class MovingMC2 extends Sprite {
}
}//package
Section 584
//MovingMC3 (MovingMC3)
package {
import flash.display.*;
public dynamic class MovingMC3 extends Sprite {
}
}//package
Section 585
//MovingMC4 (MovingMC4)
package {
import flash.display.*;
public dynamic class MovingMC4 extends Sprite {
}
}//package
Section 586
//MovingMC5 (MovingMC5)
package {
import flash.display.*;
public dynamic class MovingMC5 extends Sprite {
}
}//package
Section 587
//MovingMC6 (MovingMC6)
package {
import flash.display.*;
public dynamic class MovingMC6 extends Sprite {
}
}//package
Section 588
//MovingMC7 (MovingMC7)
package {
import flash.display.*;
public dynamic class MovingMC7 extends Sprite {
}
}//package
Section 589
//MovingMC8 (MovingMC8)
package {
import flash.display.*;
public dynamic class MovingMC8 extends Sprite {
}
}//package
Section 590
//MovingMC9 (MovingMC9)
package {
import flash.display.*;
public dynamic class MovingMC9 extends Sprite {
}
}//package
Section 591
//NextArrow (NextArrow)
package {
import com.nitrome.highscore.*;
public dynamic class NextArrow extends ArrowButton {
public function NextArrow(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 592
//NinjaGuardMC (NinjaGuardMC)
package {
import flash.display.*;
public dynamic class NinjaGuardMC extends MovieClip {
public function NinjaGuardMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 593
//NinjaMC (NinjaMC)
package {
import flash.display.*;
public dynamic class NinjaMC extends MovieClip {
public function NinjaMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 594
//NitromeButton (NitromeButton)
package {
import com.nitrome.game.*;
public dynamic class NitromeButton extends NitromeButton {
}
}//package
Section 595
//NitromeGame (NitromeGame)
package {
import com.nitrome.engine.*;
import flash.display.*;
import com.nitrome.game.*;
import com.nitrome.util.*;
import flash.net.*;
public class NitromeGame {
public static const NITROME:uint = 0;
private static const DOMAINS:Array = new Array(".nitrome.com/", ".miniclip.com/", ".candystand.com/");
public static const MINICLIP:uint = 1;
private static const MINICLIP_URL:Array = new Array("http://www.miniclip.com/", "http://miniclip.com/");
public static const CANDYSTAND:uint = 2;
private static const NITROME_URL:Array = new Array("http://www.nitrome.com/", "http://cdn.nitrome.com/", "http://www.nitrome.co.uk/", "http://www.nitrome.net/", "http://www.nitromegames.com/", "http://www.nitromegames.co.uk/", "http://www.nitrome-games.com/", "http://www.nitrome-games.co.uk/", "http://www.nitromeimages.com/");
private static const CANDYSTAND_URL:Array = new Array("http://www.candystand.com/", "http://candystand.com/");
public static const SUBMIT_URL:String = "http://www.nitrome.com/php/submit_score.php";
public static const RETRIEVE_URL:String = "http://www.nitrome.com/php/retrieve_scores.php";
public static const POPUP_HOLDER_FRAME:int = 10;
private static var _level_id:String;
public static var bonus:Object = {};
private static var _leading_zero:Boolean = true;
public static var last_loaded_xml:XML;
private static var _last_level:HiddenInt;
public static var timeline:MovieClip;
private static var _game_id:String;
public static var completed:Boolean;
private static var ar_key:String = "ctdngevfaqki8_lb:psoj90ux127hm/4w5y3rz.6-";
private static var _level_score:HiddenInt;
public static var transition:Transition;
private static var _time_based:Boolean = false;
public static var sound_manager:SoundManager;
private static var ar_1:Array = new Array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "/", ":", ".", "_", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-");
private static var ar_2:Array = new Array("_", "7", "c", "2", "l", "r", "a", "h", "i", ".", "g", "m", "v", "1", "b", "q", "3", "z", "w", "o", "u", "t", "s", "0", "d", "f", "8", "n", "5", "k", ":", "j", "p", "/", "4", "6", "e", "9", "y", "x", "-");
private static var adj:Number = 1.75;
private static var _total_levels:int;
public static var global:Object = {};
private static var _url:String;
private static var ff:Array = [];
public static var last_loaded_path:String;
private static var _selected_level:HiddenInt;
private static function decryptString(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Number;
var _local5:int;
var _local6:*;
var _local7:int;
var _local8:int;
var _local9:Number;
var _local10:int;
var _local11:String;
adj = 1.75;
ff = convertKey(_arg1);
_local3 = "";
_local4 = 0;
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2.substr(_local5, 1);
_local8 = 0;
while (_local8 < ar_2.length) {
if (ar_2[_local8] == _local6){
_local7 = _local8;
break;
};
_local8++;
};
adj = applyFudgeFactor();
_local9 = (_local4 + adj);
_local10 = (_local7 - Math.round(_local9));
_local10 = checkRange(_local10);
_local4 = (_local9 + _local7);
_local11 = ar_1[_local10];
_local3 = (_local3 + _local11);
_local5++;
};
return (_local3);
}
public static function set sfx(_arg1:Boolean):void{
var _local2:String;
var _local3:SharedObject;
_local2 = ("so_" + game_id);
_local3 = SharedObject.getLocal(_local2);
_local3.data.sfxon = _arg1;
_local3.flush();
_local3.close();
}
public static function init(_arg1:MovieClip, _arg2:String, _arg3:String, _arg4:Number):void{
timeline = _arg1;
_url = _arg1.loaderInfo.url;
_level_id = _arg3;
_total_levels = _arg4;
_game_id = _arg2.toLowerCase();
_selected_level = new HiddenInt(1);
_level_score = new HiddenInt();
_last_level = new HiddenInt(getLastUnlocked());
completed = getGameComplete();
}
public static function getLastUnlocked(_arg1:int=1):int{
var _local2:String;
var _local3:SharedObject;
var _local4:Boolean;
var _local5:*;
var _local6:Array;
var _local7:int;
_local2 = (("so_" + game_id) + _arg1);
_local3 = SharedObject.getLocal(_local2);
_local4 = false;
for each (_local5 in _local3.data) {
_local4 = true;
break;
};
_local6 = new Array(total_levels);
if (!_local4){
_local7 = 0;
while (_local7 < _local6.length) {
_local6[_local7] = 0;
_local7++;
};
_local6[0] = 1;
_local3.data.levels_unlocked = _local6;
_local3.flush();
_local3.close();
return (0);
//unresolved jump
};
if (_local3.data.levels_unlocked == undefined){
_local7 = 0;
while (_local7 < _local6.length) {
_local6[_local7] = 0;
_local7++;
};
_local6[0] = 1;
_local3.data.levels_unlocked = _local6;
_local3.flush();
_local3.close();
return (0);
//unresolved jump
};
_local7 = 1;
while (_local7 < _local3.data.levels_unlocked.length) {
if (_local3.data.levels_unlocked[_local7] == 0){
return ((_local7 - 1));
};
_local7++;
};
return ((total_levels - 1));
}
public static function get level_score():int{
return (_level_score.value);
}
private static function checkRange(_arg1:int):int{
var _local2:int;
_arg1 = Math.round(_arg1);
_local2 = ar_1.length;
while (_arg1 >= _local2) {
_arg1 = (_arg1 - _local2);
};
while (_arg1 < 0) {
_arg1 = (_arg1 + _local2);
};
return (_arg1);
}
public static function get music():Boolean{
var _local1:String;
var _local2:SharedObject;
var _local3:Boolean;
var _local4:*;
_local1 = ("so_" + game_id);
_local2 = SharedObject.getLocal(_local1);
_local3 = false;
for each (_local4 in _local2.data) {
_local3 = true;
break;
};
if (_local3){
if (_local2.data.musicon != undefined){
return (_local2.data.musicon);
};
return (true);
//unresolved jump
};
return (true);
}
public static function set level_score(_arg1:int):void{
_level_score.value = _arg1;
}
public static function getTotalBonus(_arg1:int=1):Object{
var _local2:String;
var _local3:SharedObject;
var _local4:Boolean;
var _local5:*;
var _local6:Object;
var _local7:Array;
var _local8:int;
_local2 = (("so_" + game_id) + String(_arg1));
_local3 = SharedObject.getLocal(_local2);
_local4 = false;
for each (_local5 in _local3.data) {
_local4 = true;
break;
};
if (!_local4){
return ({dodge:0, cash_count:0, cash_total:0, msg_count:0, msg_total:0, enemy_count:0, enemy_total:0});
};
if (_local3.data.level_bonuses == undefined){
return ({dodge:0, cash_count:0, cash_total:0, msg_count:0, msg_total:0, enemy_count:0, enemy_total:0});
};
_local6 = {dodge:0, cash_count:0, cash_total:0, msg_count:0, msg_total:0, enemy_count:0, enemy_total:0};
_local7 = _local3.data.level_bonuses;
_local8 = 0;
while (_local8 < _local7.length) {
if (_local7[_local8] != undefined){
_local6.dodge = (_local6.dodge + (_local7[_local8].dodge) ? 1 : 0);
_local6.cash_count = (_local6.cash_count + _local7[_local8].cash_count);
_local6.cash_total = (_local6.cash_total + _local7[_local8].cash_total);
_local6.msg_count = (_local6.msg_count + _local7[_local8].msg_count);
_local6.msg_total = (_local6.msg_total + _local7[_local8].msg_total);
_local6.enemy_count = (_local6.enemy_count + _local7[_local8].enemy_count);
_local6.enemy_total = (_local6.enemy_total + _local7[_local8].enemy_total);
};
_local8++;
};
return (_local6);
}
public static function isAtURL(... _args):Boolean{
var _local2:Boolean;
var _local3:int;
var _local4:Array;
var _local5:int;
var _local6:String;
_local2 = false;
if (_args.length == 0){
_args.push(NITROME);
};
_local3 = 0;
while (_local3 < _args.length) {
if (_args[_local3] == NITROME){
_local4 = NITROME_URL;
} else {
if (_args[_local3] == MINICLIP){
_local4 = MINICLIP_URL;
} else {
if (_args[_local3] == CANDYSTAND){
_local4 = CANDYSTAND_URL;
};
};
};
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5];
if (url.substr(0, _local6.length) == _local6){
_local2 = true;
break;
};
_local5++;
};
_local3++;
};
return (_local2);
}
public static function set last_level(_arg1:int):void{
_last_level.value = _arg1;
}
public static function setLevelUnlocked(_arg1:int, _arg2:int=1):void{
var _local3:String;
var _local4:SharedObject;
var _local5:Boolean;
var _local6:*;
var _local7:Array;
var _local8:int;
_local3 = (("so_" + game_id) + _arg2);
_local4 = SharedObject.getLocal(_local3);
_local5 = false;
for each (_local6 in _local4.data) {
_local5 = true;
break;
};
_local7 = new Array(total_levels);
if (!_local5){
_local8 = 0;
while (_local8 < _local7.length) {
_local7[_local8] = 0;
_local8++;
};
_local7[0] = 1;
} else {
if (_local4.data.levels_unlocked == undefined){
_local8 = 0;
while (_local8 < _local7.length) {
_local7[_local8] = 0;
_local8++;
};
_local7[0] = 1;
} else {
_local7 = _local4.data.levels_unlocked;
};
};
_local7[_arg1] = 1;
_local4.data.levels_unlocked = _local7;
_local4.flush();
_local4.close();
}
public static function set music(_arg1:Boolean):void{
var _local2:String;
var _local3:SharedObject;
_local2 = ("so_" + game_id);
_local3 = SharedObject.getLocal(_local2);
_local3.data.musicon = _arg1;
_local3.flush();
_local3.close();
}
public static function get leading_zero():Boolean{
return (_leading_zero);
}
public static function getLevelScore(_arg1:int, _arg2:int=1):int{
var _local3:String;
var _local4:SharedObject;
var _local5:Boolean;
var _local6:*;
_local3 = (("so_" + game_id) + String(_arg2));
_local4 = SharedObject.getLocal(_local3);
_local5 = false;
for each (_local6 in _local4.data) {
_local5 = true;
break;
};
if (!_local5){
return (0);
};
if (_local4.data.level_scores == undefined){
return (0);
};
if (_local4.data.level_scores[_arg1] == undefined){
return (0);
};
return (_local4.data.level_scores[_arg1]);
}
public static function displayNextButton(_arg1:String):Boolean{
var _local2:Array;
var _local3:String;
_local2 = _arg1.split("|");
_local3 = _local2[10];
if (_local3 == "1"){
return (true);
};
if (_local3 == "0"){
return (false);
};
return (false);
}
public static function displayPreviousButton(_arg1:String):Boolean{
var _local2:Array;
var _local3:String;
_local2 = _arg1.split("|");
_local3 = _local2[11];
if (_local3 == "1"){
return (true);
};
if (_local3 == "0"){
return (false);
};
return (false);
}
public static function get url():String{
return (_url);
}
public static function setLevelScore(_arg1:int, _arg2:int, _arg3:int=1):void{
var _local4:String;
var _local5:SharedObject;
var _local6:Boolean;
var _local7:*;
_local4 = (("so_" + game_id) + _arg3);
_local5 = SharedObject.getLocal(_local4);
_local6 = false;
for each (_local7 in _local5.data) {
_local6 = true;
break;
};
if (!_local6){
_local5.data.level_scores = [];
_local5.data.level_scores[_arg2] = _arg1;
} else {
if (_local5.data.level_scores == undefined){
_local5.data.level_scores = new Array();
_local5.data.level_scores[_arg2] = _arg1;
} else {
_local5.data.level_scores[_arg2] = _arg1;
};
};
_local5.flush();
_local5.close();
}
public static function getHighScoreLine(_arg1:String, _arg2:int):Object{
var _local3:Array;
var _local4:String;
var _local5:Array;
var _local6:Object;
_local3 = _arg1.split("|");
_local4 = _local3[(_arg2 - 1)];
if ((((((((_local4 == "0")) || ((_local4 == "1")))) || ((_local4 == null)))) || ((_local4 == "")))){
return (null);
};
_local5 = _local4.split("_");
if ((((_local5[1] == "n")) || ((_local5[2] == "n")))){
return (null);
};
_local6 = {};
_local6.username = _local5[2];
_local6.score = _local5[1];
_local6.rank = _local5[0];
return (_local6);
}
public static function getLastSavedScore(_arg1:int=1):int{
var _local2:String;
var _local3:SharedObject;
var _local4:Boolean;
var _local5:*;
_local2 = (("so_" + game_id) + String(_arg1));
_local3 = SharedObject.getLocal(_local2);
_local4 = false;
for each (_local5 in _local3.data) {
_local4 = true;
break;
};
if (!_local4){
return (0);
};
if (_local3.data.last_saved_score == undefined){
return (0);
};
return (_local3.data.last_saved_score);
}
public static function getLevelName(_arg1:Number, _arg2:String=".xml"):String{
var _local3:MD5;
var _local4:String;
var _local5:String;
_local3 = new MD5();
_local4 = "";
if (leading_zero){
if (_arg1 < 10){
_local4 = "0";
};
};
_local5 = _local3.hash(String(((level_id + _local4) + _arg1)));
return ((_local5 + _arg2));
}
public static function setLastSavedScore(_arg1:int, _arg2:int=1):void{
var _local3:String;
var _local4:SharedObject;
_local3 = (("so_" + game_id) + String(_arg2));
_local4 = SharedObject.getLocal(_local3);
_local4.data.last_saved_score = _arg1;
_local4.flush();
_local4.close();
}
public static function lockAllLevels(_arg1:int=1):void{
var _local2:String;
var _local3:SharedObject;
var _local4:Array;
var _local5:int;
_local2 = (("so_" + game_id) + _arg1);
_local3 = SharedObject.getLocal(_local2);
_local4 = new Array(total_levels);
_local5 = 0;
while (_local5 < _local4.length) {
_local4[_local5] = 0;
_local5++;
};
_local4[0] = 1;
_local3.data.levels_unlocked = _local4;
_local3.flush();
_local3.close();
}
public static function get game_id():String{
return (_game_id);
}
public static function set leading_zero(_arg1:Boolean):void{
_leading_zero = _arg1;
}
public static function unlockAllLevels(_arg1:int=1):void{
var _local2:String;
var _local3:SharedObject;
var _local4:Array;
var _local5:int;
_local2 = (("so_" + game_id) + _arg1);
_local3 = SharedObject.getLocal(_local2);
_local4 = new Array(total_levels);
_local5 = 0;
while (_local5 < _local4.length) {
_local4[_local5] = 1;
_local5++;
};
_local3.data.levels_unlocked = _local4;
_local3.flush();
_local3.close();
}
public static function get sfx():Boolean{
var _local1:String;
var _local2:SharedObject;
var _local3:Boolean;
var _local4:*;
_local1 = ("so_" + game_id);
_local2 = SharedObject.getLocal(_local1);
_local3 = false;
for each (_local4 in _local2.data) {
_local3 = true;
break;
};
if (_local3){
if (_local2.data.sfxon != undefined){
return (_local2.data.sfxon);
};
return (true);
//unresolved jump
};
return (true);
}
public static function get last_level():int{
return (_last_level.value);
}
public static function getSwfPath():String{
var _local1:String;
var _local2:int;
_local1 = url;
_local2 = _local1.length;
while (_local2 >= 0) {
if (_local1.charAt(_local2) == "/"){
_local1 = _local1.slice(0, (_local2 + 1));
break;
};
_local2--;
};
return (_local1);
}
public static function getScoreData(_arg1:int, _arg2:String):String{
var _local3:String;
var _local4:String;
_local3 = ((((String(_arg1) + "_") + game_id) + "_") + _arg2.toLowerCase());
trace(("encrypting: " + _local3));
_local4 = encryptString(ar_key, _local3);
trace(("encrypted: " + _local4));
trace(("decrypted: " + decryptString(ar_key, _local4)));
return (_local4);
}
private static function convertKey(_arg1:String):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:String;
var _local6:int;
var _local7:int;
_local2 = [];
_local2.push(_arg1.length);
_local3 = 0;
_local4 = 0;
while (_local4 < _arg1.length) {
_local5 = _arg1.substr(_local4, 1);
_local7 = 0;
while (_local7 < ar_1.length) {
if (ar_1[_local7] == _local5){
_local6 = _local7;
break;
};
_local7++;
};
_local2.push(_local6);
_local3 = (_local3 + _local6);
_local4++;
};
_local2.push(_local3);
return (_local2);
}
public static function set time_based(_arg1:Boolean):void{
_time_based = _arg1;
}
public static function get level_id():String{
return (_level_id);
}
public static function getBonusScore(_arg1:int=1):int{
var _local2:String;
var _local3:SharedObject;
var _local4:Boolean;
var _local5:*;
var _local6:int;
var _local7:int;
_local2 = (("so_" + game_id) + String(_arg1));
_local3 = SharedObject.getLocal(_local2);
_local4 = false;
for each (_local5 in _local3.data) {
_local4 = true;
break;
};
if (!_local4){
return (0);
};
if (_local3.data.level_scores == undefined){
return (0);
};
_local6 = 0;
_local7 = 0;
while (_local7 < _local3.data.level_scores.length) {
if (((!((_local3.data.level_scores[_local7] == undefined))) && (!(isNaN(_local3.data.level_scores[_local7]))))){
_local6 = (_local6 + _local3.data.level_scores[_local7]);
};
_local7++;
};
return (_local6);
}
public static function get time_based():Boolean{
return (_time_based);
}
public static function getGameComplete(_arg1:int=1):Boolean{
var _local2:String;
var _local3:SharedObject;
var _local4:Boolean;
var _local5:*;
_local2 = (("so_" + game_id) + String(_arg1));
_local3 = SharedObject.getLocal(_local2);
_local4 = false;
for each (_local5 in _local3.data) {
_local4 = true;
break;
};
if (!_local4){
return (false);
};
return (Boolean(_local3.data.completed));
}
public static function get total_levels():int{
return (_total_levels);
}
public static function set selected_level(_arg1:int):void{
_selected_level.value = _arg1;
if (_arg1 > _last_level.value){
_last_level.value = _arg1;
};
}
public static function getLevelUnlocked(_arg1:int, _arg2:int=1):Boolean{
var _local3:String;
var _local4:SharedObject;
var _local5:Boolean;
var _local6:*;
var _local7:Array;
var _local8:int;
_local3 = (("so_" + game_id) + _arg2);
_local4 = SharedObject.getLocal(_local3);
_local5 = false;
for each (_local6 in _local4.data) {
_local5 = true;
break;
};
_local7 = new Array(total_levels);
if (!_local5){
_local8 = 0;
while (_local8 < _local7.length) {
_local7[_local8] = 0;
_local8++;
};
_local7[0] = 1;
_local4.data.levels_unlocked = _local7;
_local4.flush();
_local4.close();
if (_arg1 == 0){
return (true);
};
return (false);
} else {
if (_local4.data.levels_unlocked == undefined){
_local8 = 0;
while (_local8 < _local7.length) {
_local7[_local8] = 0;
_local8++;
};
_local7[0] = 1;
_local4.data.levels_unlocked = _local7;
_local4.flush();
_local4.close();
if (_arg1 == 0){
return (true);
};
return (false);
} else {
if (_local4.data.levels_unlocked[_arg1] == 1){
return (true);
};
if (_local4.data.levels_unlocked[_arg1] == 0){
return (false);
};
};
};
return (false);
}
public static function setGameComplete(_arg1:int=1):void{
var _local2:String;
var _local3:SharedObject;
var _local4:Boolean;
var _local5:*;
_local2 = (("so_" + game_id) + _arg1);
_local3 = SharedObject.getLocal(_local2);
_local4 = false;
for each (_local5 in _local3.data) {
_local4 = true;
break;
};
if (!_local4){
_local3.data.completed = true;
} else {
_local3.data.completed = true;
};
_local3.flush();
_local3.close();
}
private static function encryptString(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Number;
var _local5:int;
var _local6:String;
var _local7:int;
var _local8:int;
var _local9:Number;
var _local10:int;
var _local11:String;
adj = 1.75;
ff = convertKey(_arg1);
_local3 = "";
_local4 = 0;
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2.substr(_local5, 1);
_local8 = 0;
while (_local8 < ar_1.length) {
if (ar_1[_local8] == _local6){
_local7 = _local8;
break;
};
_local8++;
};
adj = applyFudgeFactor();
_local9 = (_local4 + adj);
_local10 = (Math.round(_local9) + _local7);
_local10 = checkRange(_local10);
_local4 = (_local9 + _local10);
_local11 = ar_2[_local10];
_local3 = (_local3 + _local11);
_local5++;
};
return (_local3);
}
public static function get selected_level():int{
return (_selected_level.value);
}
public static function getLevelBonus(_arg1:int, _arg2:int=1):Object{
var _local3:String;
var _local4:SharedObject;
var _local5:Boolean;
var _local6:*;
_local3 = (("so_" + game_id) + String(_arg2));
_local4 = SharedObject.getLocal(_local3);
_local5 = false;
for each (_local6 in _local4.data) {
_local5 = true;
break;
};
if (!_local5){
return ({dodge:false, cash_count:0, cash_total:0, msg_count:0, msg_total:0, enemy_count:0, enemy_total:0});
};
if (_local4.data.level_bonuses == undefined){
return ({});
};
if (_local4.data.level_bonuses[_arg1] == undefined){
return ({});
};
return (_local4.data.level_bonuses[_arg1]);
}
private static function applyFudgeFactor():Number{
var _local1:Number;
_local1 = Number(ff.shift());
_local1 = (_local1 + adj);
ff.push(_local1);
return (_local1);
}
public static function setLevelBonus(_arg1:Object, _arg2:int, _arg3:int=1):void{
var _local4:String;
var _local5:SharedObject;
var _local6:Boolean;
var _local7:*;
_local4 = (("so_" + game_id) + _arg3);
_local5 = SharedObject.getLocal(_local4);
_local6 = false;
for each (_local7 in _local5.data) {
_local6 = true;
break;
};
if (!_local6){
_local5.data.level_bonuses = [];
_local5.data.level_bonuses[_arg2] = _arg1;
} else {
if (_local5.data.level_bonuses == undefined){
_local5.data.level_bonuses = [];
_local5.data.level_bonuses[_arg2] = _arg1;
} else {
_local5.data.level_bonuses[_arg2] = _arg1;
};
};
_local5.flush();
_local5.close();
}
}
}//package
Section 596
//OuchFinishMC (OuchFinishMC)
package {
import flash.display.*;
public dynamic class OuchFinishMC extends MovieClip {
}
}//package
Section 597
//PlayerMC (PlayerMC)
package {
import flash.display.*;
public dynamic class PlayerMC extends MovieClip {
public var body:MovieClip;
public function PlayerMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 598
//PrevArrow (PrevArrow)
package {
import com.nitrome.highscore.*;
public dynamic class PrevArrow extends ArrowButton {
public function PrevArrow(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 599
//RightArmMC (RightArmMC)
package {
import flash.display.*;
public dynamic class RightArmMC extends MovieClip {
public function RightArmMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 600
//RotoGunMC (RotoGunMC)
package {
import flash.display.*;
public dynamic class RotoGunMC extends MovieClip {
public var gun:MovieClip;
}
}//package
Section 601
//ScannerMC1 (ScannerMC1)
package {
import flash.display.*;
public dynamic class ScannerMC1 extends MovieClip {
}
}//package
Section 602
//ScannerMC2 (ScannerMC2)
package {
import flash.display.*;
public dynamic class ScannerMC2 extends MovieClip {
}
}//package
Section 603
//ScannerMC3 (ScannerMC3)
package {
import flash.display.*;
public dynamic class ScannerMC3 extends MovieClip {
}
}//package
Section 604
//ScannerMC4 (ScannerMC4)
package {
import flash.display.*;
public dynamic class ScannerMC4 extends MovieClip {
}
}//package
Section 605
//ScannerMC5 (ScannerMC5)
package {
import flash.display.*;
public dynamic class ScannerMC5 extends MovieClip {
public var scanner:MovieClip;
}
}//package
Section 606
//ScannerMC6 (ScannerMC6)
package {
import flash.display.*;
public dynamic class ScannerMC6 extends MovieClip {
public var scanner:MovieClip;
}
}//package
Section 607
//ScannerMC7 (ScannerMC7)
package {
import flash.display.*;
public dynamic class ScannerMC7 extends MovieClip {
public var scanner:MovieClip;
}
}//package
Section 608
//ScannerMC8 (ScannerMC8)
package {
import flash.display.*;
public dynamic class ScannerMC8 extends MovieClip {
public var scanner:MovieClip;
}
}//package
Section 609
//ScientistMC (ScientistMC)
package {
import flash.display.*;
public dynamic class ScientistMC extends MovieClip {
public var stun:MovieClip;
public function ScientistMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 610
//ScoreLine (ScoreLine)
package {
import com.nitrome.highscore.*;
public dynamic class ScoreLine extends HighScoreLine {
}
}//package
Section 611
//ScoreSubmitPanel (ScoreSubmitPanel)
package {
import com.nitrome.highscore.*;
public dynamic class ScoreSubmitPanel extends ScoreSubmitPanel {
public function ScoreSubmitPanel(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 612
//SightMC (SightMC)
package {
import flash.display.*;
public dynamic class SightMC extends MovieClip {
public function SightMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 613
//SmallShieldMC (SmallShieldMC)
package {
import flash.display.*;
public dynamic class SmallShieldMC extends Sprite {
}
}//package
Section 614
//SmokeHitMC (SmokeHitMC)
package {
import flash.display.*;
public dynamic class SmokeHitMC extends MovieClip {
}
}//package
Section 615
//SniperMC (SniperMC)
package {
import flash.display.*;
public dynamic class SniperMC extends MovieClip {
}
}//package
Section 616
//SniperShotMC (SniperShotMC)
package {
import flash.display.*;
public dynamic class SniperShotMC extends MovieClip {
}
}//package
Section 617
//SpawnBackMC1 (SpawnBackMC1)
package {
import flash.display.*;
public dynamic class SpawnBackMC1 extends Sprite {
}
}//package
Section 618
//SpawnBackMC2 (SpawnBackMC2)
package {
import flash.display.*;
public dynamic class SpawnBackMC2 extends Sprite {
}
}//package
Section 619
//SpawnMC1 (SpawnMC1)
package {
import flash.display.*;
public dynamic class SpawnMC1 extends MovieClip {
public function SpawnMC1(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package
Section 620
//SpawnMC2 (SpawnMC2)
package {
import flash.display.*;
public dynamic class SpawnMC2 extends MovieClip {
public function SpawnMC2(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package
Section 621
//SpiderMC (SpiderMC)
package {
import flash.display.*;
public dynamic class SpiderMC extends MovieClip {
public var light:MovieClip;
public var body:MovieClip;
}
}//package
Section 622
//StealthOutlineMC (StealthOutlineMC)
package {
import flash.display.*;
public dynamic class StealthOutlineMC extends Sprite {
}
}//package
Section 623
//StoryFont (StoryFont)
package {
import flash.text.*;
public dynamic class StoryFont extends Font {
}
}//package
Section 624
//SubMC (SubMC)
package {
import flash.display.*;
public dynamic class SubMC extends Sprite {
}
}//package
Section 625
//SubmitButton (SubmitButton)
package {
import com.nitrome.highscore.*;
public dynamic class SubmitButton extends SubmitButton {
public function SubmitButton(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 626
//WallSlideLeftMC (WallSlideLeftMC)
package {
import flash.display.*;
public dynamic class WallSlideLeftMC extends MovieClip {
}
}//package
Section 627
//WallSlideRightMC (WallSlideRightMC)
package {
import flash.display.*;
public dynamic class WallSlideRightMC extends MovieClip {
}
}//package
Section 628
//WaterLineMC (WaterLineMC)
package {
import flash.display.*;
public dynamic class WaterLineMC extends MovieClip {
public var bubbleHolder:MovieClip;
}
}//package
Section 629
//WhiteMC1 (WhiteMC1)
package {
import flash.display.*;
public dynamic class WhiteMC1 extends Sprite {
}
}//package
Section 630
//WhiteMC10 (WhiteMC10)
package {
import flash.display.*;
public dynamic class WhiteMC10 extends Sprite {
}
}//package
Section 631
//WhiteMC11 (WhiteMC11)
package {
import flash.display.*;
public dynamic class WhiteMC11 extends Sprite {
}
}//package
Section 632
//WhiteMC12 (WhiteMC12)
package {
import flash.display.*;
public dynamic class WhiteMC12 extends Sprite {
}
}//package
Section 633
//WhiteMC13 (WhiteMC13)
package {
import flash.display.*;
public dynamic class WhiteMC13 extends Sprite {
}
}//package
Section 634
//WhiteMC14 (WhiteMC14)
package {
import flash.display.*;
public dynamic class WhiteMC14 extends Sprite {
}
}//package
Section 635
//WhiteMC15 (WhiteMC15)
package {
import flash.display.*;
public dynamic class WhiteMC15 extends Sprite {
}
}//package
Section 636
//WhiteMC16 (WhiteMC16)
package {
import flash.display.*;
public dynamic class WhiteMC16 extends Sprite {
}
}//package
Section 637
//WhiteMC17 (WhiteMC17)
package {
import flash.display.*;
public dynamic class WhiteMC17 extends Sprite {
}
}//package
Section 638
//WhiteMC18 (WhiteMC18)
package {
import flash.display.*;
public dynamic class WhiteMC18 extends Sprite {
}
}//package
Section 639
//WhiteMC19 (WhiteMC19)
package {
import flash.display.*;
public dynamic class WhiteMC19 extends Sprite {
}
}//package
Section 640
//WhiteMC2 (WhiteMC2)
package {
import flash.display.*;
public dynamic class WhiteMC2 extends Sprite {
}
}//package
Section 641
//WhiteMC20 (WhiteMC20)
package {
import flash.display.*;
public dynamic class WhiteMC20 extends Sprite {
}
}//package
Section 642
//WhiteMC21 (WhiteMC21)
package {
import flash.display.*;
public dynamic class WhiteMC21 extends Sprite {
}
}//package
Section 643
//WhiteMC22 (WhiteMC22)
package {
import flash.display.*;
public dynamic class WhiteMC22 extends Sprite {
}
}//package
Section 644
//WhiteMC23 (WhiteMC23)
package {
import flash.display.*;
public dynamic class WhiteMC23 extends Sprite {
}
}//package
Section 645
//WhiteMC24 (WhiteMC24)
package {
import flash.display.*;
public dynamic class WhiteMC24 extends Sprite {
}
}//package
Section 646
//WhiteMC25 (WhiteMC25)
package {
import flash.display.*;
public dynamic class WhiteMC25 extends Sprite {
}
}//package
Section 647
//WhiteMC26 (WhiteMC26)
package {
import flash.display.*;
public dynamic class WhiteMC26 extends Sprite {
}
}//package
Section 648
//WhiteMC27 (WhiteMC27)
package {
import flash.display.*;
public dynamic class WhiteMC27 extends Sprite {
}
}//package
Section 649
//WhiteMC28 (WhiteMC28)
package {
import flash.display.*;
public dynamic class WhiteMC28 extends Sprite {
}
}//package
Section 650
//WhiteMC29 (WhiteMC29)
package {
import flash.display.*;
public dynamic class WhiteMC29 extends Sprite {
}
}//package
Section 651
//WhiteMC3 (WhiteMC3)
package {
import flash.display.*;
public dynamic class WhiteMC3 extends Sprite {
}
}//package
Section 652
//WhiteMC30 (WhiteMC30)
package {
import flash.display.*;
public dynamic class WhiteMC30 extends Sprite {
}
}//package
Section 653
//WhiteMC31 (WhiteMC31)
package {
import flash.display.*;
public dynamic class WhiteMC31 extends Sprite {
}
}//package
Section 654
//WhiteMC32 (WhiteMC32)
package {
import flash.display.*;
public dynamic class WhiteMC32 extends Sprite {
}
}//package
Section 655
//WhiteMC33 (WhiteMC33)
package {
import flash.display.*;
public dynamic class WhiteMC33 extends Sprite {
}
}//package
Section 656
//WhiteMC4 (WhiteMC4)
package {
import flash.display.*;
public dynamic class WhiteMC4 extends Sprite {
}
}//package
Section 657
//WhiteMC5 (WhiteMC5)
package {
import flash.display.*;
public dynamic class WhiteMC5 extends Sprite {
}
}//package
Section 658
//WhiteMC6 (WhiteMC6)
package {
import flash.display.*;
public dynamic class WhiteMC6 extends Sprite {
}
}//package
Section 659
//WhiteMC7 (WhiteMC7)
package {
import flash.display.*;
public dynamic class WhiteMC7 extends Sprite {
}
}//package
Section 660
//WhiteMC8 (WhiteMC8)
package {
import flash.display.*;
public dynamic class WhiteMC8 extends Sprite {
}
}//package
Section 661
//WhiteMC9 (WhiteMC9)
package {
import flash.display.*;
public dynamic class WhiteMC9 extends Sprite {
}
}//package
Section 662
//WireMC1 (WireMC1)
package {
import flash.display.*;
public dynamic class WireMC1 extends Sprite {
}
}//package
Section 663
//WireMC10 (WireMC10)
package {
import flash.display.*;
public dynamic class WireMC10 extends Sprite {
}
}//package
Section 664
//WireMC11 (WireMC11)
package {
import flash.display.*;
public dynamic class WireMC11 extends Sprite {
}
}//package
Section 665
//WireMC12 (WireMC12)
package {
import flash.display.*;
public dynamic class WireMC12 extends Sprite {
}
}//package
Section 666
//WireMC2 (WireMC2)
package {
import flash.display.*;
public dynamic class WireMC2 extends Sprite {
}
}//package
Section 667
//WireMC3 (WireMC3)
package {
import flash.display.*;
public dynamic class WireMC3 extends Sprite {
}
}//package
Section 668
//WireMC4 (WireMC4)
package {
import flash.display.*;
public dynamic class WireMC4 extends Sprite {
}
}//package
Section 669
//WireMC5 (WireMC5)
package {
import flash.display.*;
public dynamic class WireMC5 extends Sprite {
}
}//package
Section 670
//WireMC6 (WireMC6)
package {
import flash.display.*;
public dynamic class WireMC6 extends Sprite {
}
}//package
Section 671
//WireMC7 (WireMC7)
package {
import flash.display.*;
public dynamic class WireMC7 extends Sprite {
}
}//package
Section 672
//WireMC8 (WireMC8)
package {
import flash.display.*;
public dynamic class WireMC8 extends Sprite {
}
}//package
Section 673
//WireMC9 (WireMC9)
package {
import flash.display.*;
public dynamic class WireMC9 extends Sprite {
}
}//package