Section 1
//CMLBarrage (cml.CMLBarrage)
package cml {
public class CMLBarrage {
var qrtList:CMLList;
private static var freeList:CMLList = new CMLList();
public function CMLBarrage(){
qrtList = new CMLList();
super();
}
public function appendRandom(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number):void{
qrtList.push(alloc().setRandom(_arg1, _arg2, _arg3, _arg4));
}
public function copy(_arg1:CMLBarrage):void{
var _local2:CMLListElem;
_local2 = _arg1.qrtList.begin;
while (_local2 != _arg1.qrtList.end) {
appendCopyOf(CMLBarrageElem(_local2));
_local2 = _local2.next;
};
}
public function appendCopyOf(_arg1:CMLBarrageElem):void{
qrtList.push(alloc().copy(_arg1));
}
public function appendMultiple(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number):void{
qrtList.push(alloc().setMultiple(_arg1, _arg2, _arg3, _arg4));
}
public function appendSequence(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number):void{
qrtList.push(alloc().setSequence(_arg1, _arg2, _arg3, _arg4));
}
public function clear():void{
freeList.cat(qrtList);
}
private static function alloc():CMLBarrageElem{
var _local1:CMLBarrageElem;
_local1 = CMLBarrageElem(freeList.pop());
if (_local1 == null){
_local1 = new CMLBarrageElem();
};
return (_local1);
}
}
}//package cml
Section 2
//CMLBarrageElem (cml.CMLBarrageElem)
package cml {
import cml.*;
class CMLBarrageElem extends CMLListElem {
private var random:Boolean;// = false
private var speed_step:Number;// = 0
var update:Function;
private var speed_offset:Number;// = 0
var interval:Number;// = 0
var speed:Number;// = 1
private var count:int;// = 1
private var angle_step:Number;// = 0
var angle:Number;// = 0
var init:Function;
private var counter:int;// = 1
private var angle_offset:Number;// = 0
function CMLBarrageElem(){
count = 1;
angle = 0;
speed = 1;
interval = 0;
counter = 1;
angle_offset = 0;
speed_offset = 0;
angle_step = 0;
speed_step = 0;
random = false;
init = _init;
update = _update;
super();
}
function isEnd():Boolean{
return ((counter == 0));
}
function setRandom(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number):CMLBarrageElem{
count = ((_arg1)>0) ? _arg1 : ((_arg4)>0) ? -1 : 1;
angle = 0;
speed = 1;
counter = count;
angle_offset = 0;
speed_offset = 0;
angle_step = _arg2;
speed_step = _arg3;
interval = ((_arg4)>0) ? _arg4 : 0;
random = true;
init = _init_random;
update = _update_random;
return (this);
}
function setMultiple(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number):CMLBarrageElem{
count = ((_arg1)>0) ? _arg1 : 1;
angle = 0;
speed = 1;
counter = count;
angle_offset = (-(_arg2) * 0.5);
speed_offset = (-(_arg3) * 0.5);
angle_step = ((((_arg2 == 360)) || ((_arg2 == -360)))) ? (_arg2 / count) : ((count)<2) ? 0 : (_arg2 / (count - 1));
speed_step = ((count)<2) ? 0 : (_arg3 / (count - 1));
interval = ((_arg4)>0) ? _arg4 : 0;
random = false;
init = _init;
update = _update;
return (this);
}
private function _init_random(_arg1:CMLBarrageElem):void{
counter = count;
angle_offset = (_arg1.angle - (angle_step * 0.5));
speed_offset = (_arg1.speed - (speed_step * 0.5));
angle = (angle_offset + (angle_step * CMLState.rand()));
speed = (speed_offset + (speed_step * CMLState.rand()));
}
function setSequence(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number):CMLBarrageElem{
count = ((_arg1)>0) ? _arg1 : ((_arg4)>0) ? -1 : 1;
angle = 0;
speed = 1;
counter = count;
angle_offset = 0;
speed_offset = 0;
angle_step = _arg2;
speed_step = _arg3;
interval = ((_arg4)>0) ? _arg4 : 0;
random = false;
init = _init;
update = _update;
return (this);
}
private function _update_random():void{
angle = (angle_offset + (angle_step * CMLState.rand()));
speed = (speed_offset + (speed_step * CMLState.rand()));
counter--;
}
function copy(_arg1:CMLBarrageElem):CMLBarrageElem{
count = _arg1.count;
angle = _arg1.angle;
speed = _arg1.speed;
counter = _arg1.counter;
angle_offset = _arg1.angle_offset;
speed_offset = _arg1.speed_offset;
angle_step = _arg1.angle_step;
speed_step = _arg1.speed_step;
interval = _arg1.interval;
random = _arg1.random;
if (!random){
init = _init;
update = _update;
} else {
init = _init_random;
update = _update_random;
};
return (this);
}
private function _update():void{
angle = (angle + angle_step);
speed = (speed + speed_step);
counter--;
}
private function _init(_arg1:CMLBarrageElem):void{
counter = count;
angle = (_arg1.angle + angle_offset);
speed = (_arg1.speed + speed_offset);
}
function setSpeedStep(_arg1:Number):void{
speed_step = _arg1;
}
}
}//package cml
Section 3
//CMLFiber (cml.CMLFiber)
package cml {
public class CMLFiber extends CMLListElem {
var bul:CMLBarrageElem;
var wtm1:int;// = 1
var wtm2:int;// = 1
private var _target_id:uint;// = 0
var seqExec:CMLSequence;// = null
var chgt:int;// = 0
var wcnt:int;// = 0
private var _object_id:uint;// = 0
private var _listChild:CMLList;
private var _barrage:CMLBarrage;
var invt:uint;// = 0
var istc:Array;
private var _target:CMLObject;// = null
var fang:Number;// = 0
var seqFire:CMLSequence;// = null
private var _id:uint;// = 0
var pointer:CMLState;// = null
var seqNew:CMLSequence;// = null
var hopt:uint;// = 2
var fx:Number;// = 0
var fy:Number;// = 0
var argc:Array;
var access_id:uint;// = 0
private var _object:CMLObject;// = null
var seqSub:CMLSequence;// = null
var args:Array;
var jstc:Array;
var hang:Number;// = 0
var lcnt:Array;
static const HO_REL:uint = 4;
static const HO_VEL:uint = 5;
static const HO_SEQ:uint = 6;
static const HO_PAR:uint = 1;
static const HO_ABS:uint = 0;
static const HO_AIM:uint = 2;
static const HO_FIX:uint = 3;
static var loopmax:uint = 0x0400;
private static var activeFiber:CMLList = new CMLList();
static var stacmax:uint = 32;
static var seqRapid:CMLSequence = CMLSequence.newRapidSequence();
private static var freeFiber:CMLList = new CMLList();
private static var seqDefault:CMLSequence = CMLSequence.newDefaultSequence();
public function CMLFiber(){
_id = 0;
_object = null;
_object_id = 0;
_target = null;
_target_id = 0;
pointer = null;
access_id = 0;
_barrage = new CMLBarrage();
_listChild = new CMLList();
fx = 0;
fy = 0;
chgt = 0;
hopt = HO_AIM;
hang = 0;
fang = 0;
bul = new CMLBarrageElem();
invt = 0;
wtm1 = 1;
wtm2 = 1;
seqSub = null;
seqExec = null;
seqNew = null;
seqFire = null;
wcnt = 0;
lcnt = new Array();
jstc = new Array();
istc = new Array();
args = new Array();
argc = new Array();
super();
}
function shiftArguments():void{
args.splice(0, argc.shift());
}
public function getArgument(_arg1:uint):Number{
return (((argc[0])>_arg1) ? args[_arg1] : 0);
}
public function run():CMLListElem{
var _local1:CMLListElem;
var _local2:CMLListElem;
var _local3:CMLListElem;
var _local4:uint;
var _local5:Boolean;
_local1 = next;
if (_object.id != _object_id){
destroy();
return (_local1);
};
if (_target.id != _target_id){
_setTarget(CMLObject.defaultTarget);
};
CMLState._setInvertionFlag(invt);
if (--wcnt <= 0){
_local4 = 0;
_local5 = true;
while (((_local5) && (!((pointer == null))))) {
_local5 = pointer.func(this);
pointer = CMLState(pointer.next);
++_local4;
if (_local4 == loopmax){
throw (new Error("CML Exection error. no wait command ?"));
};
};
};
_local3 = _listChild.end;
_local2 = _listChild.begin;
while (_local2 != _local3) {
_local2 = CMLFiber(_local2).run();
};
_local1 = next;
if (((_listChild.isEmpty()) && ((pointer == null)))){
destroy();
};
return (_local1);
}
private function _finalize():void{
destroyAllChildren();
pointer = null;
_object = null;
_target = null;
_id++;
remove_from_list();
freeFiber.push(this);
}
public function getParentArgument(_arg1:uint):Number{
return (((((argc.length > 1)) && ((argc[1] > _arg1)))) ? args[(_arg1 + argc[0])] : 0);
}
function shiftInvertion():void{
invt = istc.shift();
}
function get id():uint{
return (_id);
}
function getAngle(_arg1:Number):Number{
switch (hopt){
case HO_AIM:
_arg1 = _object.getAimingAngle(_target, fx, fy);
break;
case HO_ABS:
case HO_FIX:
_arg1 = 0;
break;
case HO_REL:
_arg1 = _object.angleOnScreen();
break;
case HO_PAR:
_arg1 = _object.angleParentOnScreen();
break;
case HO_VEL:
_arg1 = _object.getVelocityAngle();
break;
case HO_SEQ:
break;
default:
break;
};
return ((_arg1 + hang));
}
public function set target(_arg1:CMLObject):void{
_setTarget(((_arg1)==null) ? CMLObject.defaultTarget : _arg1);
}
public function get target():CMLObject{
return (_target);
}
function _getAngleForRotationCommand():Number{
return (((hopt)==HO_SEQ) ? (_object.angleOnScreen() + (hang * chgt)) : getAngle(0));
}
function _initialize(_arg1:CMLObject, _arg2:CMLSequence, _arg3:uint):void{
_setObject(_arg1);
access_id = 0;
_clear_param();
invt = _arg3;
pointer = CMLState(_arg2.next);
wcnt = 0;
lcnt.length = 0;
jstc.length = 0;
istc.length = 0;
}
private function _setTarget(_arg1:CMLObject):void{
_target = _arg1;
_target_id = _arg1.id;
}
public function getLoopCounter(_arg1:uint=0):int{
return (((lcnt.length)>_arg1) ? lcnt[_arg1] : 0);
}
public function get object():CMLObject{
return (_object);
}
public function destroy():void{
if (isActive()){
_finalize();
};
}
function isParent():Boolean{
return (!(_listChild.isEmpty()));
}
public function getInterval():int{
return (chgt);
}
public function copyParameters(_arg1:CMLFiber):void{
_setTarget(_arg1.target);
fx = _arg1.fx;
fy = _arg1.fy;
chgt = _arg1.chgt;
hopt = _arg1.hopt;
hang = _arg1.hang;
fang = _arg1.fang;
bul.copy(_arg1.bul);
_barrage.copy(_arg1._barrage);
wtm1 = _arg1.wtm1;
wtm2 = _arg1.wtm2;
seqSub = _arg1.seqSub;
seqExec = _arg1.seqExec;
seqNew = _arg1.seqNew;
seqFire = _arg1.seqFire;
}
function isActive():Boolean{
return (!((_object == null)));
}
function _isShortestRotation():Boolean{
return ((((((hopt == HO_AIM)) || ((hopt == HO_VEL)))) || ((hopt == HO_FIX))));
}
public function get angle():Number{
return ((getAngle(0) + CMLObject.baseAngle));
}
public function findChild(_arg1:uint):CMLFiber{
var _local2:CMLListElem;
var _local3:CMLListElem;
_local3 = _listChild.end;
_local2 = _listChild.begin;
while (_local2 != _local3) {
if (CMLFiber(_local2).access_id == _arg1){
return (CMLFiber(_local2));
};
_local2 = _local2.next;
};
return (null);
}
function unshiftArguments(_arg1:CMLState):void{
var _local2:int;
if ((((_arg1 == null)) || ((_arg1._args.length == 0)))){
argc.unshift(0);
} else {
argc.unshift(_arg1._args.length);
_local2 = (_arg1._args.length - 1);
while (_local2 >= 0) {
args.unshift(_arg1._args[_local2]);
_local2--;
};
};
}
public function get barrage():CMLBarrage{
return (_barrage);
}
function unshiftInvertion(_arg1:uint):void{
istc.unshift(invt);
invt = _arg1;
}
private function _clear_param():void{
_setTarget(CMLObject.defaultTarget);
fx = 0;
fy = 0;
chgt = 0;
hopt = HO_AIM;
hang = 0;
fang = 0;
bul.setSequence(1, 0, 0, 0);
_barrage.clear();
invt = 0;
wtm1 = 1;
wtm2 = 1;
args.length = 0;
argc.length = 0;
seqSub = seqDefault;
seqExec = seqDefault;
seqNew = seqDefault;
seqFire = seqDefault;
}
private function _setObject(_arg1:CMLObject):void{
_object = _arg1;
_object_id = _arg1.id;
}
public function destroyAllChildren():void{
var _local1:CMLListElem;
var _local2:CMLListElem;
var _local3:CMLListElem;
_local3 = _listChild.end;
_local1 = _listChild.begin;
while (_local1 != _local3) {
_local2 = _local1.next;
CMLFiber(_local1).destroy();
_local1 = _local2;
};
}
public function destroyChild(_arg1:uint):Boolean{
var _local2:CMLFiber;
_local2 = findChild(_arg1);
if (_local2 != null){
_local2.destroy();
return (true);
};
return (false);
}
public static function run():void{
var _local1:CMLListElem;
var _local2:CMLListElem;
if (activeFiber.isEmpty()){
return;
};
_local2 = activeFiber.end;
_local1 = activeFiber.begin;
while (_local1 != _local2) {
_local1 = CMLFiber(_local1).run();
};
}
static function newFiber(_arg1:CMLFiber):CMLFiber{
var _local2:CMLFiber;
_local2 = CMLFiber(freeFiber.pop());
if (_local2 == null){
_local2 = new (CMLFiber);
};
if (_arg1 == null){
activeFiber.push(_local2);
} else {
_arg1._listChild.push(_local2);
};
return (_local2);
}
public static function create(_arg1:CMLObject, _arg2:CMLSequence):CMLFiber{
var _local3:CMLFiber;
_local3 = newFiber(null);
_local3._initialize(_arg1, _arg2, 0);
return (_local3);
}
}
}//package cml
Section 4
//CMLFormula (cml.CMLFormula)
package cml {
import cml.*;
class CMLFormula extends CMLState {
private var form:CMLFormulaElem;// = null
private var arg_index:uint;// = 0
private static var stacOperand:Array = new Array();
private static var stacOperator:Array = new Array();
static var operand_rex:String = "([-!(]+)?(0x[0-9a-f]{1,8}|\d+\.?\d*|\$\.?[1-9]+|\$[a-z_][a-z0-9_.]*|\$\.{1,3}l|\$\?\?|\$\?)?([)]+)?";
function CMLFormula(_arg1:CMLState, _arg2:Boolean){
arg_index = 0;
form = null;
super();
type = ST_FORMULA;
jump = _arg1;
func = _calc;
arg_index = (_arg1._args.length - 1);
stacOperator.length = 0;
if (_arg2){
stacOperand.length = 1;
stacOperand[0] = new CMLFormulaLiteral();
CMLFormulaLiteral(stacOperand[0]).num = _arg1._args[arg_index];
} else {
stacOperand.length = 0;
};
}
private function _calc(_arg1:CMLFiber):Boolean{
jump._args[arg_index] = form.calc(_arg1);
return (true);
}
function pushOperand(_arg1:String):void{
stacOperand.unshift(new CMLFormulaLiteral(_arg1));
}
function pushOperator(_arg1:String, _arg2:Boolean):Boolean{
var _local3:CMLFormulaOperator;
var _local4:uint;
_local3 = new CMLFormulaOperator(_arg1, _arg2);
while ((((stacOperator.length > 0)) && ((CMLFormulaOperator(stacOperator[0]).priorL > _local3.priorR)))) {
_local4 = CMLFormulaOperator(stacOperator[0]).oprcnt;
if (stacOperand.length < _local4){
return (false);
};
CMLFormulaOperator(stacOperator[0]).opr1 = ((_local4)>1) ? stacOperand.shift() : null;
CMLFormulaOperator(stacOperator[0]).opr0 = ((_local4)>0) ? stacOperand.shift() : null;
stacOperand.unshift(stacOperator.shift());
};
if ((((((stacOperator.length > 0)) && ((CMLFormulaOperator(stacOperator[0]).priorL == 1)))) && ((_local3.priorR == 1)))){
stacOperator.shift();
} else {
stacOperator.unshift(_local3);
};
return (true);
}
override function _setCommand(_arg1:String):CMLState{
return (this);
}
function construct():Boolean{
var _local1:uint;
while (stacOperator.length > 0) {
_local1 = CMLFormulaOperator(stacOperator[0]).oprcnt;
if (stacOperand.length < _local1){
return (false);
};
CMLFormulaOperator(stacOperator[0]).opr1 = ((_local1)>1) ? stacOperand.shift() : null;
CMLFormulaOperator(stacOperator[0]).opr0 = ((_local1)>0) ? stacOperand.shift() : null;
stacOperand.unshift(stacOperator.shift());
};
if (stacOperand.length == 1){
form = stacOperand.shift();
};
return (!((form == null)));
}
function pushOperatorMulti(_arg1:String, _arg2:Boolean):Boolean{
var _local3:int;
_local3 = 0;
while (_local3 < _arg1.length) {
if (!pushOperator(_arg1.charAt(_local3), _arg2)){
return (false);
};
_local3++;
};
return (true);
}
}
}//package cml
Section 5
//CMLFormulaElem (cml.CMLFormulaElem)
package cml {
import cml.*;
class CMLFormulaElem {
function calc(_arg1:CMLFiber):Number{
return (0);
}
}
}//package cml
Section 6
//CMLFormulaLiteral (cml.CMLFormulaLiteral)
package cml {
import cml.*;
class CMLFormulaLiteral extends CMLFormulaElem {
var func:Function;// = null
var num:Number;// = 0
var name:String;// = ""
function CMLFormulaLiteral(_arg1:String=""){
func = null;
num = 0;
name = "";
super();
if (_arg1.length == 0){
func = ltrl;
} else {
if (_arg1.charAt(0) != "$"){
func = ltrl;
num = Number(_arg1);
} else {
switch (_arg1){
case "$?":
func = rand;
break;
case "$??":
func = rands;
break;
case "$i":
func = refer_i;
break;
case "$r":
func = rank;
break;
case "$l":
func = loop;
num = 0;
break;
case "$.l":
func = loop;
num = 1;
break;
case "$..l":
func = loop;
num = 2;
break;
case "$...l":
func = loop;
num = 3;
break;
case "$1":
func = args;
num = 0;
break;
case "$2":
func = args;
num = 1;
break;
case "$3":
func = args;
num = 2;
break;
case "$4":
func = args;
num = 3;
break;
case "$5":
func = args;
num = 4;
break;
case "$6":
func = args;
num = 5;
break;
case "$7":
func = args;
num = 6;
break;
case "$8":
func = args;
num = 7;
break;
case "$9":
func = args;
num = 8;
break;
case "$.1":
func = argp;
num = 0;
break;
case "$.2":
func = argp;
num = 1;
break;
case "$.3":
func = argp;
num = 2;
break;
case "$.4":
func = argp;
num = 3;
break;
case "$.5":
func = argp;
num = 4;
break;
case "$.6":
func = argp;
num = 5;
break;
case "$.7":
func = argp;
num = 6;
break;
case "$.8":
func = argp;
num = 7;
break;
case "$.9":
func = argp;
num = 8;
break;
case "$x":
func = posx;
break;
case "$y":
func = posy;
break;
case "$sx":
func = sgnx;
break;
case "$sy":
func = sgny;
break;
case "$v":
func = vell;
break;
case "$vx":
func = velx;
break;
case "$vy":
func = vely;
break;
case "$ho":
func = objh;
break;
case "$td":
func = dist;
break;
case "$p.x":
func = prt_posx;
break;
case "$p.y":
func = prt_posy;
break;
case "$p.sx":
func = prt_sgnx;
break;
case "$p.sy":
func = prt_sgny;
break;
case "$p.v":
func = prt_vell;
break;
case "$p.vx":
func = prt_velx;
break;
case "$p.vy":
func = prt_vely;
break;
case "$p.ho":
func = prt_objh;
break;
case "$p.td":
func = prt_dist;
break;
case "$t.x":
func = tgt_posx;
break;
case "$t.y":
func = tgt_posy;
break;
case "$t.sx":
func = tgt_sgnx;
break;
case "$t.sy":
func = tgt_sgny;
break;
case "$t.v":
func = tgt_vell;
break;
case "$t.vx":
func = tgt_velx;
break;
case "$t.vy":
func = tgt_vely;
break;
case "$t.ho":
func = tgt_objh;
break;
default:
func = CMLParser._getUserReference(_arg1.substr(1));
if (func == null){
throw (Error((("$" + _arg1.substr(1)) + " ?")));
};
};
};
};
}
private function ltrl(_arg1:CMLFiber):Number{
return (num);
}
private function tgt_posy(_arg1:CMLFiber):Number{
return (_arg1.target.y);
}
private function tgt_posx(_arg1:CMLFiber):Number{
return (_arg1.target.x);
}
private function tgt_vell(_arg1:CMLFiber):Number{
return (_arg1.target.getVelocity());
}
private function rank(_arg1:CMLFiber):Number{
return (CMLState.rank);
}
private function objh(_arg1:CMLFiber):Number{
return (_arg1.object.angleOnScreen());
}
private function prt_posy(_arg1:CMLFiber):Number{
return (_arg1.object.parent.y);
}
private function prt_sgny(_arg1:CMLFiber):Number{
return (((_arg1.object.parent.y)<0) ? -1 : 1);
}
private function tgt_sgnx(_arg1:CMLFiber):Number{
return (((_arg1.target.x)<0) ? -1 : 1);
}
override function calc(_arg1:CMLFiber):Number{
return (func(_arg1));
}
private function prt_posx(_arg1:CMLFiber):Number{
return (_arg1.object.parent.x);
}
private function tgt_velx(_arg1:CMLFiber):Number{
return (_arg1.target.vx);
}
private function argp(_arg1:CMLFiber):Number{
return (_arg1.getParentArgument(num));
}
private function prt_vell(_arg1:CMLFiber):Number{
return (_arg1.object.parent.getVelocity());
}
private function args(_arg1:CMLFiber):Number{
return (_arg1.getArgument(num));
}
private function sgnx(_arg1:CMLFiber):Number{
return (((_arg1.object.x)<0) ? -1 : 1);
}
private function sgny(_arg1:CMLFiber):Number{
return (((_arg1.object.y)<0) ? -1 : 1);
}
private function tgt_vely(_arg1:CMLFiber):Number{
return (_arg1.target.vy);
}
private function prt_dist(_arg1:CMLFiber):Number{
return (_arg1.object.parent.getDistance(_arg1.target));
}
private function prt_sgnx(_arg1:CMLFiber):Number{
return (((_arg1.object.parent.x)<0) ? -1 : 1);
}
private function posx(_arg1:CMLFiber):Number{
return (_arg1.object.x);
}
private function rand(_arg1:CMLFiber):Number{
return (CMLState.rand());
}
private function dist(_arg1:CMLFiber):Number{
return (_arg1.object.getDistance(_arg1.target));
}
private function prt_velx(_arg1:CMLFiber):Number{
return (_arg1.object.parent.vx);
}
private function prt_vely(_arg1:CMLFiber):Number{
return (_arg1.object.parent.vy);
}
private function refer_i(_arg1:CMLFiber):Number{
return (_arg1.getInterval());
}
private function loop(_arg1:CMLFiber):Number{
return (_arg1.getLoopCounter(num));
}
private function posy(_arg1:CMLFiber):Number{
return (_arg1.object.y);
}
private function rands(_arg1:CMLFiber):Number{
return (((CMLState.rand() * 2) - 1));
}
private function vell(_arg1:CMLFiber):Number{
return (_arg1.object.getVelocity());
}
private function tgt_objh(_arg1:CMLFiber):Number{
return (_arg1.target.angleOnScreen());
}
private function velx(_arg1:CMLFiber):Number{
return (_arg1.object.vx);
}
private function vely(_arg1:CMLFiber):Number{
return (_arg1.object.vy);
}
private function tgt_sgny(_arg1:CMLFiber):Number{
return (((_arg1.target.y)<0) ? -1 : 1);
}
private function prt_objh(_arg1:CMLFiber):Number{
return (_arg1.object.parent.angleOnScreen());
}
}
}//package cml
Section 7
//CMLFormulaOperator (cml.CMLFormulaOperator)
package cml {
import cml.*;
import util.*;
class CMLFormulaOperator extends CMLFormulaElem {
var opr1:CMLFormulaElem;// = null
var priorL:Number;// = 0
var priorR:Number;// = 0
private var func:Function;// = null
var oprcnt:uint;// = 0
var opr0:CMLFormulaElem;// = null
private static var sin:SinTable = new SinTable();
function CMLFormulaOperator(_arg1:String="", _arg2:Boolean=false){
priorL = 0;
priorR = 0;
oprcnt = 0;
opr0 = null;
opr1 = null;
func = null;
super();
if (_arg1.length == 0){
return;
};
if (_arg2){
oprcnt = 1;
if (_arg1 == "("){
func = null;
priorL = 1;
priorR = 99;
} else {
if (_arg1 == ")"){
func = null;
priorL = 99;
priorR = 1;
} else {
if (_arg1 == "-"){
func = neg;
priorL = 10;
priorR = 11;
} else {
if (_arg1 == "!"){
func = not;
priorL = 10;
priorR = 11;
};
};
};
};
} else {
oprcnt = 2;
if (_arg1 == "+"){
func = add;
priorL = 7;
priorR = 6;
} else {
if (_arg1 == "-"){
func = sub;
priorL = 7;
priorR = 6;
} else {
if (_arg1 == "*"){
func = mul;
priorL = 9;
priorR = 8;
} else {
if (_arg1 == "/"){
func = div;
priorL = 9;
priorR = 8;
} else {
if (_arg1 == "%"){
func = sup;
priorL = 9;
priorR = 8;
} else {
if (_arg1 == ">"){
func = grt;
priorL = 5;
priorR = 4;
} else {
if (_arg1 == ">="){
func = geq;
priorL = 5;
priorR = 4;
} else {
if (_arg1 == "<"){
func = les;
priorL = 5;
priorR = 4;
} else {
if (_arg1 == "<="){
func = leq;
priorL = 5;
priorR = 4;
} else {
if (_arg1 == "=="){
func = eqr;
priorL = 5;
priorR = 4;
} else {
if (_arg1 == "!="){
func = neq;
priorL = 5;
priorR = 4;
};
};
};
};
};
};
};
};
};
};
};
};
}
override function calc(_arg1:CMLFiber):Number{
switch (oprcnt){
case 2:
return (func(opr0.calc(_arg1), opr1.calc(_arg1)));
case 1:
return (func(opr0.calc(_arg1), 0));
default:
return (func(0, 0));
};
}
private static function sub(_arg1:Number, _arg2:Number):Number{
return ((_arg1 - _arg2));
}
private static function add(_arg1:Number, _arg2:Number):Number{
return ((_arg1 + _arg2));
}
private static function mul(_arg1:Number, _arg2:Number):Number{
return ((_arg1 * _arg2));
}
private static function eqr(_arg1:Number, _arg2:Number):Number{
return (((_arg1)==_arg2) ? 1 : 0);
}
private static function snd(_arg1:Number, _arg2:Number):Number{
return (sin[sin.index(_arg1)]);
}
private static function grt(_arg1:Number, _arg2:Number):Number{
return (((_arg1)>_arg2) ? 1 : 0);
}
private static function sup(_arg1:Number, _arg2:Number):Number{
return ((_arg1 % _arg2));
}
private static function div(_arg1:Number, _arg2:Number):Number{
return ((_arg1 / _arg2));
}
private static function les(_arg1:Number, _arg2:Number):Number{
return (((_arg1)<_arg2) ? 1 : 0);
}
private static function not(_arg1:Number, _arg2:Number):Number{
return (((_arg1)==0) ? 1 : 0);
}
private static function csd(_arg1:Number, _arg2:Number):Number{
return (sin[(sin.index(_arg1) + 0x0400)]);
}
private static function neg(_arg1:Number, _arg2:Number):Number{
return (-(_arg1));
}
private static function geq(_arg1:Number, _arg2:Number):Number{
return (((_arg1)>=_arg2) ? 1 : 0);
}
private static function neq(_arg1:Number, _arg2:Number):Number{
return (((_arg1)!=_arg2) ? 1 : 0);
}
private static function leq(_arg1:Number, _arg2:Number):Number{
return (((_arg1)<=_arg2) ? 1 : 0);
}
}
}//package cml
Section 8
//CMLList (cml.CMLList)
package cml {
public class CMLList {
private var term:CMLListElem;
public function CMLList(){
term = new CMLListElem();
super();
term.next = term;
term.prev = term;
}
public function get head():CMLListElem{
return (term.next);
}
public function shift():CMLListElem{
var _local1:CMLListElem;
_local1 = term.next;
if (_local1 == term){
return (null);
};
term.next = _local1.next;
term.next.prev = term;
_local1.clear();
return (_local1);
}
public function isEmpty():Boolean{
return ((term.next == term));
}
public function remove(_arg1:CMLListElem):CMLListElem{
if (_arg1 == term){
return (null);
};
_arg1.remove_from_list();
return (_arg1);
}
public function unshift(_arg1:CMLListElem):CMLListElem{
_arg1.next = term.next;
_arg1.prev = term;
term.next.prev = _arg1;
term.next = _arg1;
return (_arg1);
}
public function get end():CMLListElem{
return (term);
}
public function clear():void{
term.next = term;
term.prev = term;
}
public function get begin():CMLListElem{
return (term.next);
}
public function pop():CMLListElem{
var _local1:CMLListElem;
_local1 = term.prev;
if (_local1 == term){
return (null);
};
term.prev = _local1.prev;
term.prev.next = term;
_local1.clear();
return (_local1);
}
public function cat(_arg1:CMLList):void{
if (_arg1.isEmpty()){
return;
};
_arg1.head.prev = term.prev;
_arg1.tail.next = term;
term.prev.next = _arg1.head;
term.prev = _arg1.tail;
_arg1.clear();
}
public function get tail():CMLListElem{
return (term.prev);
}
public function push(_arg1:CMLListElem):CMLListElem{
_arg1.prev = term.prev;
_arg1.next = term;
term.prev.next = _arg1;
term.prev = _arg1;
return (_arg1);
}
public function cut(_arg1:CMLListElem, _arg2:CMLListElem):void{
_arg2.next.prev = _arg1.prev;
_arg1.prev.next = _arg2.next;
_arg1.prev = null;
_arg2.next = null;
}
}
}//package cml
Section 9
//CMLListElem (cml.CMLListElem)
package cml {
import util.*;
class CMLListElem {
public var next:CMLListElem;
public var prev:CMLListElem;
public static var sin:SinTable = new SinTable();
function CMLListElem(){
clear();
}
public function clear():void{
prev = null;
next = null;
}
public function insert_before(_arg1:CMLListElem):void{
next = _arg1;
prev = _arg1.prev;
_arg1.prev.next = this;
_arg1.prev = this;
}
public function remove_from_list():void{
prev.next = next;
next.prev = prev;
prev = null;
next = null;
}
public function insert_after(_arg1:CMLListElem):void{
prev = _arg1;
next = _arg1.next;
_arg1.next.prev = this;
_arg1.next = this;
}
}
}//package cml
Section 10
//CMLObject (cml.CMLObject)
package cml {
import util.*;
public class CMLObject extends CMLListElem {
private var _head_offset:Number;// = 0
private var _relative:CMLObject;// = null
private var _seqDestroy:CMLSequence;// = null
private var _rotd:Number;// = 0
private var _roti:interpolation;
private var _access_id:uint;// = 0
private var _rott:Number;// = 0
private var _motion_type:uint;// = 0
public var x:Number;// = 0
public var y:Number;// = 0
private var funcMotion:Array;
private var _listChild:CMLList;
private var _relative_id:uint;// = 0
private var _id:uint;// = 0
private var _ac:int;// = 0
public var vx:Number;// = 0
public var vy:Number;// = 0
private var _parent:CMLObject;// = null
private var _relative_type:uint;// = 0
protected var move:Function;
private var _ay:Number;// = 0
private var _ax:Number;// = 0
public var head:Number;// = 0
private var _rx:Number;// = 0
private var _seqDestroyNum:Number;// = 0
private var _ry:Number;// = 0
private var _bx:Number;// = 0
private var _by:Number;// = 0
public static const MT_ATTRACT:uint = 4;
public static const MT_INTERPOL:uint = 2;
private static const REL_ATTRACT:uint = 2;
public static const MT_CONST:uint = 0;
private static const REL_ORIGIN:uint = 1;
public static const MT_ACCEL:uint = 1;
public static const MT_BULLETML:uint = 3;
private static const NO_RELATION:uint = 0;
static var _root:CMLObject = null;
private static var _baseAngle:Number = -90;
private static var _vertical:uint = 1;
private static var _defaultTarget:CMLObject = null;
public function CMLObject(){
_id = 0;
_access_id = 0;
_parent = null;
x = 0;
y = 0;
vx = 0;
vy = 0;
_rx = 0;
_ry = 0;
_ax = 0;
_ay = 0;
_bx = 0;
_by = 0;
_ac = 0;
_motion_type = MT_CONST;
head = 0;
_head_offset = 0;
_roti = new interpolation();
_rott = 0;
_rotd = 0;
_relative = null;
_relative_id = 0;
_relative_type = NO_RELATION;
_listChild = new CMLList();
_seqDestroy = null;
_seqDestroyNum = 0;
move = _move;
funcMotion = new Array(_move, _move_accel, _move_interpolate, _move_bml, _move_ro, _move_accel_ro, _move_interpolate_ro, _move_bml_ro);
super();
_id = 0;
}
public function setRotation(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=true):void{
var _local6:Number;
_local6 = (_arg1 - angleOnScreen());
if (_arg5){
_local6 = (_local6 + 180);
_local6 = (_local6 * 0.00277777777777778);
_local6 = (((_local6 - Math.floor(_local6)) * 360) - 180);
};
if (_arg2 == 0){
head = (head + _local6);
_rott = 0;
_rotd = 0;
} else {
_roti.setFergusonCoons(head, (head + _local6), (_local6 * _arg3), (_local6 * _arg4));
_rott = 0;
_rotd = (1 / _arg2);
};
}
public function destroy(_arg1:Number):void{
_finalize(_arg1);
}
public function fireObject(_arg1:CMLSequence):CMLObject{
return (null);
}
public function get id():uint{
return (_id);
}
public function exit(_arg1:Number):void{
}
public function getAimingAngle(_arg1:CMLObject, _arg2:Number, _arg3:Number):Number{
var _local4:uint;
var _local5:Number;
var _local6:Number;
_local4 = sin.index(head);
_local5 = ((x + (sin[(_local4 + 0x0400)] * _arg2)) - (sin[_local4] * _arg3));
_local6 = ((y + (sin[_local4] * _arg2)) + (sin[(_local4 + 0x0400)] * _arg3));
return (((Math.atan2((_arg1.y - _local6), (_arg1.x - _local5)) * 57.2957795130823) - _baseAngle));
}
public function get motion_type():uint{
return (_motion_type);
}
public function angleOnScreen():Number{
return ((head + ((_relative_type)!=REL_ORIGIN) ? _head_offset : (_head_offset + _relative.angleOnScreen())));
}
private function _move_bml_ro():void{
var _local1:uint;
_local1 = sin.index(angle);
_rx = (_rx + vx);
_ry = (_ry + vy);
vx = (sin[(_local1 + 0x0400)] * _ax);
vy = (sin[_local1] * _ax);
_ax = (_ax + _bx);
calcAbsPosition();
if (--_ac == 0){
_bx = 0;
};
if (_rotd != 0){
rotateHead();
} else {
if (_bx == 0){
move = _move_ro;
_motion_type = MT_CONST;
};
};
if (_relative_id != _relative._id){
_relative = null;
_relative_type = NO_RELATION;
move = _move;
_motion_type = MT_CONST;
};
}
private function _move_ro():void{
_rx = (_rx + vx);
_ry = (_ry + vy);
calcAbsPosition();
if (_rotd != 0){
rotateHead();
};
if (_relative_id != _relative._id){
_relative = null;
_relative_type = NO_RELATION;
move = _move;
_motion_type = MT_CONST;
};
}
protected function calcAbsPosition():void{
var _local1:Number;
var _local2:uint;
_local1 = angleParentOnScreen();
if (_local1 != 0){
_local2 = sin.index(_local1);
x = ((_relative.x + (sin[(_local2 + 0x0400)] * _rx)) - (sin[_local2] * _ry));
y = ((_relative.y + (sin[_local2] * _rx)) + (sin[(_local2 + 0x0400)] * _ry));
} else {
x = (_relative.x + _rx);
y = (_relative.y + _ry);
};
}
function getAy():Number{
return (_ay);
}
function _initialize(_arg1:CMLObject, _arg2:Boolean, _arg3:uint, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number):void{
clear();
_arg1.addChild(this);
_access_id = _arg3;
vx = _arg6;
vy = _arg7;
_ax = 0;
_ay = 0;
_ac = 0;
_bx = 0;
_by = 0;
head = _arg8;
_head_offset = _arg9;
_rott = 0;
_rotd = 0;
_seqDestroy = null;
_seqDestroyNum = 0;
if (_arg2){
_relative = _parent;
_relative_id = _relative._id;
_relative_type = REL_ORIGIN;
move = _move_ro;
_motion_type = MT_CONST;
_rx = _arg4;
_ry = _arg5;
calcAbsPosition();
} else {
_relative = null;
_relative_id = 0;
_relative_type = NO_RELATION;
move = _move;
_motion_type = MT_CONST;
x = _arg4;
y = _arg5;
};
enter();
}
function getAx():Number{
return (_ax);
}
protected function runAllChildren():void{
var _local1:CMLListElem;
var _local2:CMLListElem;
var _local3:CMLListElem;
_local3 = _listChild.end;
_local1 = _listChild.begin;
while (_local1 != _local3) {
_local2 = _local1.next;
CMLObject(_local1).run();
_local1 = _local2;
};
}
public function setGravityTarget(_arg1:CMLObject, _arg2:Number, _arg3:Number, _arg4:int=0):void{
if (isPositionRelative()){
return;
};
if ((((_arg2 == 0)) && ((_arg3 == 0)))){
_ax = 0;
_ay = 0;
_bx = 0;
_by = 0;
_ac = 0;
_changeMotion(MT_CONST, NO_RELATION);
} else {
_bx = _arg2;
_by = _arg3;
_ac = _arg4;
_relative = _arg1;
_relative_id = _relative.id;
_relative_type = REL_ATTRACT;
move = _move_gravity;
_motion_type = MT_CONST;
};
}
public function getVelocityAngle():Number{
return (((_motion_type)==MT_BULLETML) ? angleOnScreen() : ((Math.atan2(vy, vx) * 57.2957795130823) - _baseAngle));
}
public function setRotationMax(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=true):void{
var _local5:Number;
if (_arg2 == 0){
_arg2 = 0x100000;
};
_arg3 = (_arg3 * _arg2);
_local5 = (_arg1 - angleOnScreen());
if (_arg4){
_local5 = (_local5 + 180);
_local5 = (_local5 * 0.00277777777777778);
_local5 = (((_local5 - Math.floor(_local5)) * 360) - 180);
};
if (_arg3 != 0){
if (_local5 < -(_arg3)){
_local5 = -(_arg3);
} else {
if (_local5 > _arg3){
_local5 = _arg3;
};
};
};
_roti.setLinear(head, (head + _local5));
_rott = 0;
_rotd = (1 / _arg2);
}
public function findAllChildren(_arg1:uint, _arg2:Function):int{
var _local3:int;
var _local4:CMLListElem;
var _local5:CMLListElem;
var _local6:CMLListElem;
_local3 = 0;
_local6 = _listChild.end;
_local4 = _listChild.begin;
while (_local4 != _local6) {
_local5 = _local4.next;
if (CMLObject(_local4)._access_id == _arg1){
_local3++;
if (!_arg2(CMLObject(_local4))){
break;
};
};
_local4 = _local5;
};
return (_local3);
}
public function createAsRoot(_arg1:CMLObject, _arg2:Number=-90):CMLObject{
_root = this;
_baseAngle = _arg2;
_defaultTarget = _arg1;
_vertical = (uint(((_baseAngle / 90) + 4.5)) & 1);
clear();
_parent = this;
_access_id = 0;
_relative = null;
_relative_id = 0;
_relative_type = NO_RELATION;
x = 0;
y = 0;
vx = 0;
vy = 0;
_rx = 0;
_ry = 0;
_ax = 0;
_ay = 0;
_ac = 0;
_bx = 0;
_by = 0;
head = 0;
_head_offset = 0;
_rott = 0;
_rotd = 0;
move = _move;
_motion_type = MT_CONST;
enter();
return (this);
}
public function getVelocity():Number{
return (((_motion_type)==MT_BULLETML) ? _ax : Math.sqrt(((vx * vx) + (vy * vy))));
}
public function setVelocity(_arg1:Number, _arg2:Number, _arg3:int=0):void{
var _local4:Number;
if (_arg3 == 0){
vx = _arg1;
vy = _arg2;
_changeMotion(MT_CONST, _relative_type);
} else {
_local4 = (1 / _arg3);
if (_motion_type == MT_INTERPOL){
_ax = (_ax - ((_arg1 * _local4) * 2));
_ay = (_ay - ((_arg2 * _local4) * 2));
_bx = (_bx + (((_arg1 * _local4) * _local4) * 6));
_by = (_by + (((_arg2 * _local4) * _local4) * 6));
_ac = _arg3;
_changeMotion(MT_INTERPOL, _relative_type);
} else {
_ax = ((_arg1 - vx) * _local4);
_ay = ((_arg2 - vy) * _local4);
_ac = _arg3;
_changeMotion(MT_ACCEL, _relative_type);
};
};
}
public function setInterpolation(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int=0):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg5 == 0){
vx = _arg3;
vy = _arg4;
if (isPositionRelative()){
_rx = _arg1;
_ry = _arg2;
calcAbsPosition();
} else {
x = _arg1;
y = _arg2;
};
_changeMotion(MT_CONST, _relative_type);
} else {
_local6 = (1 / _arg5);
if (isPositionRelative()){
_local7 = (_arg1 - _rx);
_local8 = (_arg2 - _ry);
_changeMotion(MT_INTERPOL, REL_ORIGIN);
} else {
_local7 = (_arg1 - x);
_local8 = (_arg2 - y);
_changeMotion(MT_INTERPOL, NO_RELATION);
};
_ax = ((((((_local7 * _local6) * 3) - (vx * 2)) - _arg3) * _local6) * 2);
_ay = ((((((_local8 * _local6) * 3) - (vy * 2)) - _arg4) * _local6) * 2);
_bx = (((((((_local7 * _local6) * -2) + vx) + _arg3) * _local6) * _local6) * 6);
_by = (((((((_local8 * _local6) * -2) + vy) + _arg4) * _local6) * _local6) * 6);
_ac = _arg5;
};
}
public function setAsDefaultTarget():void{
_defaultTarget = this;
}
public function setAttraction(_arg1:Number, _arg2:Number, _arg3:int=0):void{
if (isPositionRelative()){
return;
};
if ((((_arg1 == 0)) && ((_arg2 == 0)))){
_ax = 0;
_ay = 0;
_bx = 0;
_by = 0;
_ac = 0;
_changeMotion(MT_CONST, NO_RELATION);
} else {
_bx = _arg1;
_by = _arg2;
_ac = _arg3;
_rx = x;
_ry = y;
_relative = null;
_relative_type = NO_RELATION;
move = _move_attract;
_motion_type = MT_ATTRACT;
};
}
public function getDistance(_arg1:CMLObject):Number{
var _local2:Number;
var _local3:Number;
_local2 = Math.abs((x - _arg1.x));
_local3 = Math.abs((y - _arg1.y));
return (((_local2)>_local3) ? (_local2 + (_local3 * 0.292893218813452)) : (_local3 + (_local2 * 0.292893218813452)));
}
private function _changeMotion(_arg1:uint, _arg2:uint):void{
_motion_type = _arg1;
_relative_type = ((_arg2)==REL_ATTRACT) ? NO_RELATION : _arg2;
move = funcMotion[((_relative_type << 2) | _motion_type)];
if (_relative_type == NO_RELATION){
_relative = null;
};
}
public function destroyAllChildren(_arg1:Number):void{
var _local2:CMLListElem;
var _local3:CMLListElem;
var _local4:CMLListElem;
_local4 = _listChild.end;
_local2 = _listChild.begin;
while (_local2 != _local4) {
_local3 = _local2.next;
CMLObject(_local2).destroy(_arg1);
_local2 = _local3;
};
}
public function isPositionRelative():Boolean{
return ((_relative_type == REL_ORIGIN));
}
private function _move_attract():void{
var _local1:Number;
var _local2:Number;
_local1 = (((_rx - x) * _bx) - (vx * _by));
_local2 = (((_ry - y) * _bx) - (vy * _by));
x = (x + (vx + (_local1 * 0.5)));
y = (y + (vy + (_local2 * 0.5)));
vx = (vx + _local1);
vy = (vy + _local2);
if (_rotd != 0){
rotateHead();
};
if (--_ac == 0){
move = _move;
_motion_type = MT_CONST;
};
}
public function getPositionAngle():Number{
return (((((_relative_type)!=REL_ORIGIN) ? Math.atan2(y, x) : Math.atan2(_ry, _rx) * 57.2957795130823) - _baseAngle));
}
public function execute(_arg1:CMLSequence):CMLFiber{
var _local2:CMLFiber;
_local2 = CMLFiber.create(this, _arg1);
_local2.run();
return ((_local2.isActive()) ? _local2 : null);
}
public function changeSpeedAbs(_arg1:Number, _arg2:int=0):void{
var _local3:uint;
if (_arg2 == 0){
_local3 = sin.index(angle);
vx = (sin[(_local3 + 0x0400)] * _arg1);
vy = (sin[_local3] * _arg1);
} else {
_ax = getVelocity();
_bx = ((_arg1 - _ax) / _arg2);
_ac = _arg2;
_changeMotion(MT_BULLETML, _relative_type);
};
}
function _finalize(_arg1:Number):void{
var _local2:uint;
var _local3:CMLSequence;
if (((!((_seqDestroy == null))) && ((_seqDestroyNum == _arg1)))){
_local2 = _id;
_local3 = _seqDestroy;
_seqDestroy = null;
execute(_local3);
if (_local2 != _id){
return;
};
};
destroyAllChildren(_arg1);
if (this != _root){
_parent.removeChild(this);
_parent = null;
};
exit(_arg1);
_id++;
}
public function isParent():Boolean{
return (!(_listChild.isEmpty()));
}
private function _move_bml():void{
var _local1:uint;
_local1 = sin.index(angle);
x = (x + vx);
y = (y + vy);
vx = (sin[(_local1 + 0x0400)] * _ax);
vy = (sin[_local1] * _ax);
_ax = (_ax + _bx);
if (--_ac == 0){
_bx = 0;
};
if (_rotd != 0){
rotateHead();
} else {
if (_bx == 0){
move = _move;
_motion_type = MT_CONST;
};
};
}
public function run():void{
move();
runAllChildren();
}
public function setHeadAngle(_arg1:Number):void{
head = _arg1;
}
private function _move_accel():void{
x = (x + (vx + (_ax * 0.5)));
y = (y + (vy + (_ay * 0.5)));
vx = (vx + _ax);
vy = (vy + _ay);
if (_rotd != 0){
rotateHead();
};
if (--_ac == 0){
move = _move;
_motion_type = MT_CONST;
};
}
private function _move_accel_ro():void{
_rx = (_rx + (vx + (_ax * 0.5)));
_ry = (_ry + (vy + (_ay * 0.5)));
vx = (vx + _ax);
vy = (vy + _ay);
calcAbsPosition();
if (_rotd != 0){
rotateHead();
};
if (--_ac == 0){
move = _move_ro;
_motion_type = MT_CONST;
};
if (_relative_id != _relative._id){
_relative = null;
_relative_type = NO_RELATION;
move = _move;
_motion_type = MT_CONST;
};
}
public function angleParentOnScreen():Number{
return (((_relative_type)!=REL_ORIGIN) ? _head_offset : (_head_offset + _relative.angleOnScreen()));
}
public function get parent():CMLObject{
return (_parent);
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:int=0):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (_arg3 == 0){
if (_motion_type == MT_ATTRACT){
_rx = _arg1;
_ry = _arg2;
} else {
if (_relative_type == REL_ORIGIN){
_rx = _arg1;
_ry = _arg2;
calcAbsPosition();
} else {
x = _arg1;
y = _arg2;
};
_changeMotion(MT_CONST, _relative_type);
};
} else {
_local4 = (1 / _arg3);
if (isPositionRelative()){
_local5 = (_arg1 - _rx);
_local6 = (_arg2 - _ry);
_changeMotion(MT_INTERPOL, REL_ORIGIN);
} else {
_local5 = (_arg1 - x);
_local6 = (_arg2 - y);
_changeMotion(MT_INTERPOL, NO_RELATION);
};
_ax = (((((_local5 * _local4) * 3) - (vx * 2)) * _local4) * 2);
_ay = (((((_local6 * _local4) * 3) - (vy * 2)) * _local4) * 2);
_bx = ((((((_local5 * _local4) * -2) + vx) * _local4) * _local4) * 6);
_by = ((((((_local6 * _local4) * -2) + vy) * _local4) * _local4) * 6);
_ac = _arg3;
};
}
public function changeDirection(_arg1:Number, _arg2:int, _arg3:Number, _arg4:Boolean=true):void{
var _local5:uint;
var _local6:Number;
if (_arg2 == 0){
setRotation(_arg1, 0, 1, 1, _arg4);
_local5 = sin.index(angle);
_local6 = getVelocity();
vx = (sin[(_local5 + 0x0400)] * _local6);
vy = (sin[_local5] * _local6);
} else {
setRotationMax(_arg1, _arg2, _arg3, _arg4);
if (_motion_type != MT_BULLETML){
_ax = getVelocity();
_bx = 0;
_ac = 0;
_changeMotion(MT_BULLETML, _relative_type);
};
};
}
private function _move():void{
x = (x + vx);
y = (y + vy);
if (_rotd != 0){
rotateHead();
};
}
public function changeSpeedRel(_arg1:Number, _arg2:int=0):void{
var _local3:uint;
if (_arg2 == 0){
_arg1 = (_arg1 + getVelocity());
_local3 = sin.index(angle);
vx = (sin[(_local3 + 0x0400)] * _arg1);
vy = (sin[_local3] * _arg1);
} else {
_ax = getVelocity();
_bx = (_arg1 / _arg2);
_ac = _arg2;
_changeMotion(MT_BULLETML, _relative_type);
};
}
private function _move_interpolate_ro():void{
_rx = (_rx + ((vx + (_ax * 0.5)) + (_bx * 0.166666666666667)));
_ry = (_ry + ((vy + (_ay * 0.5)) + (_by * 0.166666666666667)));
vx = (vx + (_ax + (_bx * 0.5)));
vy = (vy + (_ay + (_by * 0.5)));
_ax = (_ax + _bx);
_ay = (_ay + _by);
calcAbsPosition();
if (_rotd != 0){
rotateHead();
};
if (--_ac == 0){
move = _move_ro;
_motion_type = MT_CONST;
};
if (_relative_id != _relative._id){
_relative = null;
_relative_type = NO_RELATION;
move = _move;
_motion_type = MT_CONST;
};
}
private function _move_gravity():void{
var _local1:Number;
var _local2:Number;
_local1 = (((_relative.x - x) * _bx) - (vx * _by));
_local2 = (((_relative.y - y) * _bx) - (vy * _by));
x = (x + (vx + (_local1 * 0.5)));
y = (y + (vy + (_local2 * 0.5)));
vx = (vx + _local1);
vy = (vy + _local2);
if (_rotd != 0){
rotateHead();
};
if (--_ac == 0){
move = _move;
_motion_type = MT_CONST;
};
if (_relative_id != _relative._id){
_relative = null;
_relative_type = NO_RELATION;
move = _move;
_motion_type = MT_CONST;
};
}
public function getAccelAngle():Number{
return (((_motion_type)==MT_BULLETML) ? angleOnScreen() : ((Math.atan2(_ay, _ax) * 57.2957795130823) - _baseAngle));
}
function getY():Number{
return ((isPositionRelative()) ? _ry : y);
}
public function get angle():Number{
return ((angleOnScreen() + _baseAngle));
}
function getX():Number{
return ((isPositionRelative()) ? _rx : x);
}
protected function rotateHead():void{
_rott = (_rott + _rotd);
if (_rott >= 1){
_rott = 1;
_rotd = 0;
};
head = _roti.calc(_rott);
}
public function setDestructionFiber(_arg1:CMLSequence, _arg2:Number):void{
_seqDestroy = _arg1;
_seqDestroyNum = _arg2;
}
public function enter():void{
}
public function findChild(_arg1:uint):CMLObject{
var _local2:CMLListElem;
var _local3:CMLListElem;
_local3 = _listChild.end;
_local2 = _listChild.begin;
while (_local2 != _local3) {
if (CMLObject(_local2)._access_id == _arg1){
return (CMLObject(_local2));
};
_local2 = _local2.next;
};
return (null);
}
public function isActive():Boolean{
return (!((_parent == null)));
}
protected function removeChild(_arg1:CMLObject):void{
_listChild.remove(_arg1);
}
private function _move_interpolate():void{
x = (x + ((vx + (_ax * 0.5)) + (_bx * 0.166666666666667)));
y = (y + ((vy + (_ay * 0.5)) + (_by * 0.166666666666667)));
vx = (vx + (_ax + (_bx * 0.5)));
vy = (vy + (_ay + (_by * 0.5)));
_ax = (_ax + _bx);
_ay = (_ay + _by);
if (_rotd != 0){
rotateHead();
};
if (--_ac == 0){
move = _move;
_motion_type = MT_CONST;
};
}
protected function addChild(_arg1:CMLObject):void{
_arg1._parent = this;
_listChild.push(_arg1);
}
public function create(_arg1:Number, _arg2:Number, _arg3:CMLObject=null, _arg4:Boolean=false):CMLObject{
_initialize(((_arg3)==null) ? _root : _arg3, _arg4, 0, _arg1, _arg2, 0, 0, 0, 0);
return (this);
}
public function setAccelaration(_arg1:Number, _arg2:Number, _arg3:int=0):void{
_ax = _arg1;
_ay = _arg2;
_ac = _arg3;
_changeMotion(((((_ax == 0)) && ((_ay == 0)))) ? MT_CONST : MT_ACCEL, _relative_type);
}
public function newObject(_arg1:CMLSequence):CMLObject{
return (null);
}
public static function get baseAngle():Number{
return (_baseAngle);
}
public static function get defaultTarget():CMLObject{
return (_defaultTarget);
}
public static function get vertical():uint{
return (_vertical);
}
}
}//package cml
Section 11
//CMLParser (cml.CMLParser)
package cml {
public class CMLParser {
private static const REX_USERDEF:uint = 6;
private static const REX_NONLABELDEF:uint = 26;
private static const REX_COMMENT:uint = 1;
private static const REX_STRING:uint = 30;
private static const REX_FORMULA:uint = 2;
private static const REX_ERROR:uint = 31;
private static const REX_LABELDEF:uint = 22;
private static const REX_PREVREFER:uint = 18;
private static const REX_NORMAL:uint = 10;
private static const REX_CALLSEQ:uint = 14;
private static var mapUsrDefRef:Object = new Object();
private static var regexp:RegExp = null;
private static var listState:CMLList = new CMLList();
private static var cmdTemp:CMLState = null;
private static var mapUsrDefCmd:Object = new Object();
private static var cmdKey:String = "";
private static var childstac:Array = new Array();
private static var loopstac:Array = new Array();
private static var fmlTemp:CMLFormula = null;
private static function _parseComment(_arg1):Boolean{
if (_arg1[REX_COMMENT] == undefined){
return (false);
};
return (true);
}
private static function _parseUserStatement(_arg1):Boolean{
if (_arg1[REX_USERDEF] == undefined){
return (false);
};
cmdTemp = _user_command(_arg1[REX_USERDEF]);
fmlTemp = _argument(cmdTemp, REX_USERDEF, _arg1);
return (true);
}
private static function _parseFormula(_arg1):Boolean{
if (_arg1[REX_FORMULA] == undefined){
return (false);
};
if (cmdTemp == null){
throw (Error("unknown error #2"));
};
if (_arg1[REX_FORMULA] == ","){
_append_formula(fmlTemp);
fmlTemp = _argument(cmdTemp, REX_FORMULA, _arg1, true);
} else {
if (fmlTemp == null){
fmlTemp = new CMLFormula(cmdTemp, true);
};
if (!fmlTemp.pushOperator(_arg1[REX_FORMULA], false)){
throw (Error(("Error in formula " + _arg1[1])));
};
if (_arg1[(REX_FORMULA + 1)] != undefined){
fmlTemp.pushOperatorMulti(_arg1[(REX_FORMULA + 1)], true);
};
if (_arg1[(REX_FORMULA + 2)] != undefined){
fmlTemp.pushOperand(_arg1[(REX_FORMULA + 2)]);
};
if (_arg1[(REX_FORMULA + 3)] != undefined){
fmlTemp.pushOperatorMulti(_arg1[(REX_FORMULA + 3)], true);
};
};
return (true);
}
private static function _parseCallSequence(_arg1):Boolean{
if (_arg1[REX_CALLSEQ] == undefined){
return (false);
};
cmdTemp = _new_reference(null, _arg1[REX_CALLSEQ]);
fmlTemp = _argument(cmdTemp, REX_CALLSEQ, _arg1);
return (true);
}
private static function _parseStatement(_arg1):Boolean{
var _local2:CMLState;
if (_arg1[REX_NORMAL] == undefined){
return (false);
};
cmdKey = _arg1[REX_NORMAL];
cmdTemp = new CMLState();
switch (cmdKey){
case "[":
case "[?":
case "[s?":
loopstac.push(cmdTemp);
break;
case ":":
cmdTemp.jump = loopstac.pop();
cmdTemp.jump.jump = cmdTemp;
loopstac.push(cmdTemp);
break;
case "]":
if (loopstac.length == 0){
throw (Error("[...]] ?"));
};
cmdTemp.jump = loopstac.pop();
cmdTemp.jump.jump = cmdTemp;
break;
case "}":
if (childstac.length <= 1){
throw (Error("{...}} ?"));
};
_append_statement(cmdTemp._setCommand(cmdKey));
_local2 = _cut_sequence(childstac.shift(), cmdTemp);
cmdKey = "";
cmdTemp = ((_local2.type)==CMLState.ST_NO_LABEL) ? _new_reference(_local2, null) : null;
break;
};
if (cmdTemp != null){
fmlTemp = _argument(cmdTemp, REX_NORMAL, _arg1);
};
return (true);
}
private static function _argument(_arg1:CMLState, _arg2:uint, _arg3, _arg4:Boolean=false):CMLFormula{
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:CMLFormula;
_local5 = _arg3[(_arg2 + 1)];
_local6 = _arg3[(_arg2 + 2)];
_local7 = _arg3[(_arg2 + 3)];
if (((_arg4) && ((_arg1._args.length == 0)))){
_arg1._args.push(Number.NaN);
};
_local8 = null;
if (_local6 != undefined){
if (_local6.charAt(0) != "$"){
if (_local7 == undefined){
if (_local5 == undefined){
_arg1._args.push(Number(_local6));
return (null);
};
if (_local5 == "-"){
_arg1._args.push(-(Number(_local6)));
return (null);
};
} else {
if (_local7 == ")"){
if (_local5 == "("){
_arg1._args.push(Number(_local6));
return (null);
};
if (_local5 == "-("){
_arg1._args.push(-(Number(_local6)));
return (null);
};
};
};
};
_arg1._args.push(0);
_local8 = new CMLFormula(_arg1, false);
if (_local5 != undefined){
_local8.pushOperatorMulti(_local5, true);
};
_local8.pushOperand(_local6);
if (_local7 != undefined){
_local8.pushOperatorMulti(_local7, true);
};
} else {
if (_arg4){
_arg1._args.push(Number.NaN);
};
};
return (_local8);
}
private static function _parseNonLabelDefine(_arg1):Boolean{
if (_arg1[REX_NONLABELDEF] == undefined){
return (false);
};
cmdTemp = _new_sequence(childstac[0], null);
fmlTemp = _argument(cmdTemp, REX_NONLABELDEF, _arg1);
childstac.unshift(cmdTemp);
return (true);
}
private static function _initialize(_arg1:CMLSequence):void{
listState.clear();
listState.push(_arg1);
loopstac.length = 0;
childstac.length = 0;
childstac.unshift(_arg1);
cmdKey = "";
cmdTemp = null;
fmlTemp = null;
}
public static function parse(_arg1:CMLSequence, _arg2:String):void{
var res:Object;
var seq = _arg1;
var cml_string = _arg2;
_createCMLRegExp();
try {
_initialize(seq);
res = regexp.exec(cml_string);
while (res != null) {
if (!_parseFormula(res)){
_append();
if (!_parseStatement(res)){
if (!_parseLabelDefine(res)){
if (!_parseNonLabelDefine(res)){
if (!_parsePreviousReference(res)){
if (!_parseCallSequence(res)){
if (!_parseUserStatement(res)){
if (!_parseComment(res)){
if (!_parseString(res)){
if (res[REX_ERROR] != undefined){
throw (Error((res[REX_ERROR] + " ?")));
} else {
throw (Error("unknown error #1"));
};
};
};
};
};
};
};
};
};
};
res = regexp.exec(cml_string);
};
if (loopstac.length != 0){
throw (Error("[[...] ?"));
};
if (childstac.length != 1){
throw (Error("{{...} ?"));
};
_append();
_terminate();
seq.verify();
} catch(err:Error) {
throw (String(("CML" + err.toString())));
};
}
private static function _user_command(_arg1:String):CMLUserDefine{
if ((_arg1 in mapUsrDefCmd)){
return (new CMLUserDefine(mapUsrDefCmd[_arg1]));
};
throw (Error((("&" + _arg1) + " ?")));
}
private static function _append():void{
if (cmdTemp != null){
_append_formula(fmlTemp);
_append_statement(cmdTemp._setCommand(cmdKey));
fmlTemp = null;
};
cmdKey = "";
cmdTemp = null;
}
private static function _parsePreviousReference(_arg1):Boolean{
if (_arg1[REX_PREVREFER] == undefined){
return (false);
};
cmdTemp = _new_reference(null, null);
fmlTemp = _argument(cmdTemp, REX_PREVREFER, _arg1);
return (true);
}
public static function setUserCommand(_arg1:String, _arg2:Function):void{
mapUsrDefCmd[_arg1] = _arg2;
}
private static function _append_formula(_arg1:CMLFormula):void{
if (_arg1 != null){
if (!_arg1.construct()){
throw (Error("in formula"));
};
listState.push(_arg1);
};
}
private static function _terminate():void{
var _local1:CMLState;
_local1 = new CMLState(CMLState.ST_END);
_append_statement(_local1);
listState.cut(listState.head, listState.tail);
}
private static function _parseString(_arg1):Boolean{
if (_arg1[REX_STRING] == undefined){
return (false);
};
cmdTemp = new CMLString(_arg1[REX_STRING]);
return (true);
}
private static function _new_sequence(_arg1:CMLSequence, _arg2:String):CMLSequence{
return (_arg1.newChildSequence(_arg2));
}
private static function _append_statement(_arg1:CMLState):void{
listState.push(_arg1);
}
private static function _new_reference(_arg1:CMLState, _arg2:String):CMLState{
if ((CMLState(listState.tail).type & CMLState.STF_CALLREF) == 0){
_append_statement(new CMLState()._setCommand("@"));
};
return (new CMLRefer(_arg1, _arg2));
}
private static function _createCMLRegExp():void{
var _local1:String;
var _local2:String;
if (regexp == null){
_local1 = ("[ \t]*" + CMLFormula.operand_rex);
_local2 = "(//[^\\n]*$|/\\*.*?\\*/)";
_local2 = (_local2 + ("|(,|\\+|-|\\*|/|%|==|!=|>=|<=|>|<)" + _local1));
_local2 = (_local2 + ("|&([a-z]+)" + _local1));
_local2 = (_local2 + ((("|(" + CMLState.command_rex) + ")") + _local1));
_local2 = (_local2 + ("|([A-Z_.][A-Z0-9_.]*)" + _local1));
_local2 = (_local2 + ("|(\\{\\.\\})" + _local1));
_local2 = (_local2 + ("|#([A-Z_][A-Z0-9_]*)[ \t]*\\{" + _local1));
_local2 = (_local2 + ("|(\\{)" + _local1));
_local2 = (_local2 + "|'(.*?)'");
_local2 = (_local2 + "|([a-z]+)");
regexp = new RegExp(_local2, "gms");
};
}
static function _getUserReference(_arg1:String):Function{
return (mapUsrDefRef[_arg1]);
}
private static function _parseLabelDefine(_arg1):Boolean{
if (_arg1[REX_LABELDEF] == undefined){
return (false);
};
cmdTemp = _new_sequence(childstac[0], _arg1[REX_LABELDEF]);
fmlTemp = _argument(cmdTemp, REX_LABELDEF, _arg1);
childstac.unshift(cmdTemp);
return (true);
}
private static function _cut_sequence(_arg1:CMLState, _arg2:CMLState):CMLState{
listState.cut(_arg1, _arg2);
_arg2.jump = _arg1;
return (_arg1);
}
public static function setUserReference(_arg1:String, _arg2:Function):void{
mapUsrDefRef[_arg1] = _arg2;
}
}
}//package cml
Section 12
//CMLRefer (cml.CMLRefer)
package cml {
import cml.*;
class CMLRefer extends CMLState {
private var _label:String;// = null
function CMLRefer(_arg1:CMLState=null, _arg2:String=null){
_label = null;
super();
jump = _arg1;
_label = _arg2;
func = _nop;
_args = new Array();
type = ST_REFER;
}
override function _setCommand(_arg1:String):CMLState{
return (this);
}
function isLabelUnsolved():Boolean{
return ((((jump == null)) && (!((_label == null)))));
}
public function get label():String{
return (_label);
}
}
}//package cml
Section 13
//CMLSequence (cml.CMLSequence)
package cml {
public class CMLSequence extends CMLState {
private var label:String;// = null
private var member:Object;// = null
private var parent:CMLSequence;// = null
private var non_labeled_count:int;// = 0
private static var arrayPublicSequence:Array = new Array();
public function CMLSequence(_arg1:String=null){
label = null;
member = null;
parent = null;
non_labeled_count = 0;
super();
label = null;
parent = null;
member = new Object();
non_labeled_count = 0;
func = _nop;
_args = new Array();
jump = null;
type = ST_NO_LABEL;
if (_arg1 != null){
CMLParser.parse(this, _arg1);
};
}
public function isEmpty():Boolean{
return ((CMLState(next).type == ST_END));
}
private function _findSequencePublic(_arg1:String):CMLSequence{
var _local2:CMLSequence;
var _local3:CMLSequence;
for each (_local2 in arrayPublicSequence) {
_local3 = _local2.findSequence(_arg1);
if (_local3 != null){
return (_local3);
};
};
return (null);
}
public function addChild(_arg1:CMLSequence):void{
if (_arg1.label == null){
_arg1.label = ("#" + String(non_labeled_count));
non_labeled_count++;
};
if ((_arg1.label in member)){
throw (Error(((("sequence label confliction; " + _arg1.label) + " in ") + label)));
};
_arg1.parent = this;
member[_arg1.label] = _arg1;
}
public function arg(_arg1:uint):Number{
return (((_arg1)<_args.length) ? Number(_args[_arg1]) : 0);
}
public function findSequence(_arg1:String):CMLSequence{
var _local2:int;
var _local3:String;
var _local4:CMLSequence;
var _local5:String;
_local2 = _arg1.indexOf(".");
if (_local2 == -1){
if ((_arg1 in member)){
return (member[_arg1]);
};
} else {
if (_local2 == 0){
_local4 = parent;
while (_local4.parent != null) {
_local4 = _local4.parent;
};
return (_local4.findSequence(_arg1.substr(1)));
};
_local3 = _arg1.substr(0, _local2);
if ((_local3 in member)){
_local5 = _arg1.substr((_local2 + 1));
return (member[_local3].findSequence(_local5));
};
};
return (((parent)!=null) ? parent.findSequence(_arg1) : null);
}
public function setPublic():void{
arrayPublicSequence.push(this);
}
override function _setCommand(_arg1:String):CMLState{
return (this);
}
public function setLabel(_arg1:String):Boolean{
if (parent != null){
return (false);
};
label = _arg1;
type = ((label)==null) ? ST_NO_LABEL : ST_LABEL;
return (true);
}
function verify():void{
var _local1:CMLState;
var _local2:CMLState;
var _local3:CMLState;
var _local4:CMLState;
var _local5:CMLSequence;
_local1 = CMLState(next);
while (_local1 != null) {
_local2 = CMLState(_local1.next);
if (_local1.type == CMLState.ST_REFER){
if (CMLRefer(_local1).isLabelUnsolved()){
_local1.jump = findSequence(CMLRefer(_local1).label);
if (_local1.jump == null){
_local1.jump = _findSequencePublic(CMLRefer(_local1).label);
if (_local1.jump == null){
throw (Error(("Not defined label; " + CMLRefer(_local1).label)));
};
};
};
} else {
if ((_local1.type & CMLState.STF_CALLREF) != 0){
_local3 = _local2;
while (_local3.type == CMLState.ST_FORMULA) {
_local3 = CMLState(_local3.next);
};
if (_local3.type != CMLState.ST_REFER){
if ((_local1.type & CMLState.ST_RESTRICT) != 0){
throw (Error("No reference after &/@/n ?"));
};
_local4 = new CMLRefer();
_local4.insert_after(_local1);
} else {
if (_local3 != _local2){
_local1.remove_from_list();
_local1.insert_before(_local3);
_local2 = CMLState(_local3.next);
};
};
} else {
if (_local1.type == CMLState.ST_BARRAGE){
_local4 = new CMLState(CMLState.ST_BARRAGE);
_local4.insert_before(_local1);
_local3 = _local2;
while ((((_local3.type == CMLState.ST_FORMULA)) || ((_local3.type == CMLState.ST_BARRAGE)))) {
_local3 = CMLState(_local3.next);
};
_local2 = _local3;
};
};
};
_local1 = _local2;
};
for each (_local5 in member) {
_local5.verify();
};
}
function newChildSequence(_arg1:String):CMLSequence{
var _local2:CMLSequence;
_local2 = new CMLSequence();
_local2.setLabel(_arg1);
addChild(_local2);
return (_local2);
}
static function newDefaultSequence():CMLSequence{
var _local1:CMLSequence;
_local1 = new (CMLSequence);
_local1.next = new CMLState(CMLState.ST_END);
_local1.next.prev = _local1;
CMLState(_local1.next).jump = _local1;
return (_local1);
}
static function newRapidSequence():CMLSequence{
var _local1:CMLSequence;
_local1 = new (CMLSequence);
_local1.next = new CMLState(CMLState.ST_RAPID);
_local1.next.prev = _local1;
CMLState(_local1.next).jump = _local1;
return (_local1);
}
}
}//package cml
Section 14
//CMLState (cml.CMLState)
package cml {
public class CMLState extends CMLListElem {
var jump:CMLState;
var type:uint;
var _args:Array;
var func:Function;
static const ST_REFER:uint = 1;
static const ST_NORMAL:uint = 0;
static const ST_LOOP:uint = 5;
static const ST_BLOCKEND:uint = 9;
static const ST_RAPID:uint = 16;
static const ST_NO_LABEL:uint = 3;
static const ST_ELSE:uint = 7;
static const ST_SELECT:uint = 8;
static const STF_CALLREF:uint = 32;
static const ST_END:uint = 12;
static const ST_RESTRICT:uint = 4;
static const ST_BARRAGE:uint = 13;
static const ST_FORMULA:uint = 10;
static const ST_LABEL:uint = 2;
static const ST_IF:uint = 6;
static const ST_STRING:uint = 11;
public static var rank:Number = 0.5;
private static var _invert_flag:uint = 0;
public static var rand:Function = Math.random;
static var command_rex:String = "\[s\?|\[\?|\[|\]|\}|:|\^&|&|w\?|w|~|pd|px|py|p|vd|vx|vy|v|ad|ax|ay|a|gp|gt|rc|r|ko|i|m|cd|csa|csr|css|\^@|@ko|@b|@c|@j|@|\^n|nc|nj|n|\^f|fc|fj|f|qx|qy|q|bm|bs|br|bv|hax|ha|hox|ho|hpx|hp|htx|ht|hvx|hv|hs|td|tp|tc|tb|kf";
public function CMLState(_arg1:uint=0){
_args = new Array();
jump = null;
type = _arg1;
switch (type){
case ST_RAPID:
func = _rapid_fire;
break;
case ST_BARRAGE:
func = _initialize_barrage;
break;
default:
func = _nop;
break;
};
}
private function _cd(_arg1:CMLFiber):Boolean{
_arg1.object.changeDirection(_arg1._getAngleForRotationCommand(), _arg1.chgt, _args[0], _arg1._isShortestRotation());
return (true);
}
private function _ko(_arg1:CMLFiber):Boolean{
_arg1.object.destroy(_args[0]);
return (false);
}
private function _invertY(_arg1:Number):Number{
return (((_invert_flag & (1 + CMLObject.vertical))) ? -(_arg1) : _arg1);
}
private function _invertX(_arg1:Number):Number{
return (((_invert_flag & (2 - CMLObject.vertical))) ? -(_arg1) : _arg1);
}
private function _r(_arg1:CMLFiber):Boolean{
_arg1.object.setRotation(_arg1._getAngleForRotationCommand(), _arg1.chgt, _args[0], _args[1], _arg1._isShortestRotation());
return (true);
}
private function __create_new_fiber(_arg1:CMLFiber, _arg2:CMLObject, _arg3:CMLSequence, _arg4:CMLState, _arg5:uint):void{
var _local6:CMLFiber;
if (!_arg3.isEmpty()){
_local6 = CMLFiber.newFiber(_arg1);
_local6._initialize(_arg2, _arg3, _invert_flag);
_local6.access_id = _arg5;
_local6.unshiftArguments(_arg4);
if (_arg3.type == ST_NO_LABEL){
_local6.copyParameters(_arg1);
};
};
}
private function _tb(_arg1:CMLFiber):Boolean{
_arg1.target = _arg1.object.parent.findChild(uint(_args[0]));
return (true);
}
private function _tc(_arg1:CMLFiber):Boolean{
_arg1.target = _arg1.object.findChild(uint(_args[0]));
return (true);
}
protected function _nop(_arg1:CMLFiber):Boolean{
return (true);
}
private function _fire(_arg1:CMLFiber, _arg2:uint, _arg3:uint):void{
var _local4:CMLState;
_local4 = CMLState(next);
if (_local4.jump != null){
_arg1.seqFire = CMLSequence(_local4.jump);
};
_create_multi_bullet(_arg1, _arg2, _arg3, _local4);
_arg1.pointer = _local4;
}
private function _td(_arg1:CMLFiber):Boolean{
_arg1.target = null;
return (true);
}
private function _tp(_arg1:CMLFiber):Boolean{
_arg1.target = _arg1.object.parent;
return (true);
}
private function _if_start(_arg1:CMLFiber):Boolean{
if (_args[0] == 0){
_arg1.pointer = jump;
};
return (true);
}
function _setCommand(_arg1:String):CMLState{
var _local2:int;
switch (_arg1){
case "w":
if (_args.length == 0){
func = _w0;
} else {
func = _w1;
if (_args[0] == 0){
_args[0] = int.MAX_VALUE;
};
};
break;
case "~":
func = _wi;
break;
case "w?":
func = _waitif;
break;
case "}":
func = _ret;
type = ST_END;
break;
case "[":
func = _loop_start;
type = ST_LOOP;
_resetParameters(1);
break;
case "[?":
func = _if_start;
type = ST_IF;
if (_args.length == 0){
throw (Error("no arguments in [?"));
};
break;
case "[s?":
func = _level_start;
type = ST_SELECT;
if (_args.length == 0){
throw (Error("no arguments in [s?"));
};
break;
case ":":
func = _else_start;
type = ST_ELSE;
_resetParameters(1);
break;
case "]":
func = _block_end;
type = ST_BLOCKEND;
break;
case "i":
func = _i;
_resetParameters(1);
break;
case "p":
func = _p;
_resetParameters(2);
break;
case "px":
func = _px;
_resetParameters(1);
break;
case "py":
func = _py;
_resetParameters(1);
break;
case "pd":
func = _pd;
_resetParameters(2);
break;
case "v":
func = _v;
_resetParameters(2);
break;
case "vx":
func = _vx;
_resetParameters(1);
break;
case "vy":
func = _vy;
_resetParameters(1);
break;
case "vd":
func = _vd;
_resetParameters(2);
break;
case "a":
func = _a;
_resetParameters(2);
break;
case "ax":
func = _ax;
_resetParameters(1);
break;
case "ay":
func = _ay;
_resetParameters(1);
break;
case "ad":
func = _ad;
_resetParameters(2);
break;
case "r":
func = _r;
_resetParameters(2);
break;
case "rc":
func = _rc;
_resetParameters(1);
break;
case "gp":
func = _gp;
_resetParameters(3);
_args[0] = (_args[0] * 0.01);
_args[1] = (_args[1] * 0.01);
break;
case "gt":
func = _gt;
_resetParameters(3);
_args[0] = (_args[0] * 0.01);
_args[1] = (_args[1] * 0.01);
break;
case "cd":
func = _cd;
_resetParameters(2);
break;
case "csa":
func = _csa;
_resetParameters(2);
break;
case "csr":
func = _csr;
_resetParameters(2);
break;
case "css":
func = _css;
_resetParameters(2);
break;
case "ko":
func = _ko;
_resetParameters(1);
break;
case "&":
func = _gosub;
type = (ST_RESTRICT | STF_CALLREF);
break;
case "^&":
func = _fgosub;
type = (ST_RESTRICT | STF_CALLREF);
break;
case "@":
func = _at;
_resetParameters(1);
type = (ST_RESTRICT | STF_CALLREF);
break;
case "@c":
case "@j":
func = _atc;
_resetParameters(2);
type = (ST_RESTRICT | STF_CALLREF);
break;
case "@b":
func = _atb;
_resetParameters(2);
type = (ST_RESTRICT | STF_CALLREF);
break;
case "@ko":
func = _atko;
_resetParameters(1);
type = (ST_RESTRICT | STF_CALLREF);
break;
case "^@":
func = _fat;
type = (ST_RESTRICT | STF_CALLREF);
break;
case "kf":
func = _kf;
break;
case "n":
func = _n;
_resetParameters(1);
type = (ST_RESTRICT | STF_CALLREF);
break;
case "nc":
func = _nc;
_resetParameters(1);
type = (ST_RESTRICT | STF_CALLREF);
break;
case "nj":
func = _nj;
_resetParameters(2);
type = (ST_RESTRICT | STF_CALLREF);
break;
case "^n":
func = _fn;
type = (ST_RESTRICT | STF_CALLREF);
break;
case "f":
_selectFunc(_f0, _f1);
type = STF_CALLREF;
break;
case "fc":
_resetParameters(1);
_selectFunc(_fc0, _fc0, _fc1);
type = STF_CALLREF;
break;
case "fj":
_resetParameters(1);
_selectFunc(_fj0, _fj0, _fj1);
type = STF_CALLREF;
break;
case "^f":
_selectFunc(_ff0, _ff1);
type = STF_CALLREF;
break;
case "q":
func = _q;
_resetParameters(2);
break;
case "qx":
func = _qx;
_resetParameters(1);
break;
case "qy":
func = _qy;
_resetParameters(1);
break;
case "ha":
case "hax":
func = _ha;
_resetParameters(1);
break;
case "hp":
func = _hp;
_resetParameters(1);
break;
case "ht":
func = _ht;
_resetParameters(1);
break;
case "ho":
func = _ho;
_resetParameters(1);
break;
case "hv":
func = _hv;
_resetParameters(1);
break;
case "hpx":
func = _hpx;
_resetParameters(1);
break;
case "htx":
func = _htx;
_resetParameters(1);
break;
case "hox":
func = _hox;
_resetParameters(1);
break;
case "hvx":
func = _hvx;
_resetParameters(1);
break;
case "hs":
func = _hs;
_resetParameters(1);
break;
case "bm":
func = _bm;
_resetParameters(4);
type = ST_BARRAGE;
break;
case "bs":
func = _bs;
_resetParameters(4);
type = ST_BARRAGE;
break;
case "br":
func = _br;
_resetParameters(4);
type = ST_BARRAGE;
break;
case "bv":
func = _bv;
_resetParameters(1);
break;
case "td":
func = _td;
break;
case "tp":
func = _tp;
break;
case "tc":
func = _tc;
_resetParameters(1);
break;
case "tb":
func = _tb;
_resetParameters(1);
break;
case "m":
func = _m;
_resetParameters(1);
break;
default:
throw (Error((("Unknown command; " + _arg1) + " ?")));
};
_local2 = 0;
while (_local2 < _args.length) {
if (isNaN(_args[_local2])){
_args[_local2] = 0;
};
_local2++;
};
return (this);
}
private function _f0(_arg1:CMLFiber):Boolean{
_fire(_arg1, 0, 0);
_arg1.bul.update();
return (true);
}
private function _f1(_arg1:CMLFiber):Boolean{
_arg1.bul.speed = _args[0];
_fire(_arg1, 0, 0);
_arg1.bul.update();
return (true);
}
private function _fj0(_arg1:CMLFiber):Boolean{
_fire(_arg1, _args[0], 2);
_arg1.bul.update();
return (true);
}
private function _level_start(_arg1:CMLFiber):Boolean{
while (_arg1.pointer.jump.type == ST_ELSE) {
if (_args[0] < _arg1.pointer.jump._args[0]){
return (true);
};
_arg1.pointer = _arg1.pointer.jump;
};
return (true);
}
private function _csa(_arg1:CMLFiber):Boolean{
_arg1.object.changeSpeedAbs(_args[0], _arg1.chgt);
return (true);
}
private function _htx(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertAngle(_args[0]);
_arg1.hopt = CMLFiber.HO_AIM;
_fix(_arg1);
return (true);
}
private function _fj1(_arg1:CMLFiber):Boolean{
_arg1.bul.speed = _args[1];
_fire(_arg1, _args[0], 2);
_arg1.bul.update();
return (true);
}
private function _w0(_arg1:CMLFiber):Boolean{
_arg1.wcnt = _arg1.wtm1;
return (false);
}
private function _w1(_arg1:CMLFiber):Boolean{
_arg1.wtm1 = _args[0];
_arg1.wcnt = _arg1.wtm1;
return (false);
}
private function __create_new_object_fiber(_arg1:CMLObject, _arg2:CMLSequence, _arg3:CMLState):void{
var _local4:CMLFiber;
if (!_arg2.isEmpty()){
_local4 = CMLFiber.newFiber(null);
_local4._initialize(_arg1, _arg2, _invert_flag);
_local4.unshiftArguments(_arg3);
};
}
private function _rapid_fire(_arg1:CMLFiber):Boolean{
if (_arg1.bul.isEnd()){
return (false);
};
_create_multi_bullet(_arg1, _arg1.wtm1, _arg1.wtm2, CMLFiber.seqRapid);
_arg1.bul.update();
_arg1.wcnt = _arg1.bul.interval;
_arg1.pointer = CMLFiber.seqRapid;
return (false);
}
private function _csr(_arg1:CMLFiber):Boolean{
_arg1.object.changeSpeedRel(_args[0], _arg1.chgt);
return (true);
}
private function _css(_arg1:CMLFiber):Boolean{
if (_arg1.chgt == 0){
_arg1.object.changeSpeedRel(_args[0], 0);
} else {
_arg1.object.changeSpeedRel((_args[0] * _arg1.chgt), _arg1.chgt);
};
return (true);
}
private function _fiber_child(_arg1:CMLFiber, _arg2:CMLObject, _arg3:uint, _arg4:uint):void{
var refer:CMLState;
var seq:CMLSequence;
var fbr = _arg1;
var obj = _arg2;
var object_id = _arg3;
var fiber_id = _arg4;
refer = CMLState(next);
seq = ((refer.jump)!=null) ? CMLSequence(refer.jump) : fbr.seqExec;
if (fiber_id != 0){
fbr.destroyChild(fiber_id);
};
obj.findAllChildren(object_id, function (_arg1:CMLObject):Boolean{
__create_new_fiber(fbr, _arg1, seq, refer, fiber_id);
return (true);
});
fbr.seqExec = seq;
fbr.pointer = refer;
}
private function _vd(_arg1:CMLFiber):Boolean{
var _local2:uint;
var _local3:Number;
var _local4:Number;
if (_arg1.hopt != CMLFiber.HO_SEQ){
_local2 = sin.index(_arg1.angle);
} else {
_local2 = sin.index((_arg1.object.getVelocityAngle() + CMLObject.baseAngle));
};
_local3 = sin[(_local2 + 0x0400)];
_local4 = sin[_local2];
_arg1.object.setVelocity(((_local3 * _args[0]) - (_local4 * _args[1])), ((_local4 * _args[0]) + (_local3 * _args[1])), _arg1.chgt);
return (true);
}
private function _fc1(_arg1:CMLFiber):Boolean{
_arg1.bul.speed = _args[1];
_fire(_arg1, _args[0], 1);
_arg1.bul.update();
return (true);
}
private function _fix(_arg1:CMLFiber):void{
_arg1.hang = _arg1.getAngle(0);
_arg1.hopt = CMLFiber.HO_FIX;
}
private function _gosub(_arg1:CMLFiber):Boolean{
var _local2:CMLState;
if (_arg1.jstc.length > CMLFiber.stacmax){
throw (new Error("CML Exection error. too many gosubs."));
};
_local2 = CMLState(next);
_arg1.jstc.push(_local2);
_arg1.unshiftInvertion(_invert_flag);
_arg1.unshiftArguments(_local2);
_arg1.pointer = ((_local2.jump)!=null) ? _local2.jump : _arg1.seqSub;
return (true);
}
private function _resetParameters(_arg1:int):void{
var _local2:int;
_local2 = _args.length;
while (_local2 < _arg1) {
_args[_local2] = 0;
_local2++;
};
}
private function _nc(_arg1:CMLFiber):Boolean{
_new(_arg1, _args[0], 1, 0);
return (true);
}
private function _vx(_arg1:CMLFiber):Boolean{
_arg1.object.setVelocity(_invertX(_args[0]), _arg1.object.vy, _arg1.chgt);
return (true);
}
private function _vy(_arg1:CMLFiber):Boolean{
_arg1.object.setVelocity(_arg1.object.vx, _invertY(_args[0]), _arg1.chgt);
return (true);
}
private function _fc0(_arg1:CMLFiber):Boolean{
_fire(_arg1, _args[0], 1);
_arg1.bul.update();
return (true);
}
private function _fn(_arg1:CMLFiber):Boolean{
if (CMLState(next).jump != null){
_arg1.seqNew = CMLSequence(CMLState(next).jump);
};
return (true);
}
private function _fat(_arg1:CMLFiber):Boolean{
if (CMLState(next).jump != null){
_arg1.seqExec = CMLSequence(CMLState(next).jump);
};
return (true);
}
private function _nj(_arg1:CMLFiber):Boolean{
_new(_arg1, _args[0], 2, _args[1]);
return (true);
}
private function _hvx(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertAngle(_args[0]);
_arg1.hopt = CMLFiber.HO_VEL;
_fix(_arg1);
return (true);
}
private function _create_multi_bullet(_arg1:CMLFiber, _arg2:uint, _arg3:uint, _arg4:CMLState):void{
var uang:uint;
var isJoint:Boolean;
var parent:CMLObject;
var x:Number;
var y:Number;
var __reflexive_call:Function;
var __create_bullet:Function;
var x_:Number;
var fbr = _arg1;
var access_id = _arg2;
var rel = _arg3;
var refer = _arg4;
__reflexive_call = function (_arg1:CMLBarrageElem, _arg2:CMLListElem):void{
var _local3:CMLBarrageElem;
var _local4:CMLFiber;
var _local5:CMLListElem;
_local3 = CMLBarrageElem(_arg1.next);
if (_local3.interval == 0){
if (_local3.next == _arg2){
_local3.init(_arg1);
while (!(_local3.isEnd())) {
__create_bullet((fbr.fang + _local3.angle), _local3.speed);
_local3.update();
};
} else {
_local3.init(_arg1);
while (!(_local3.isEnd())) {
__reflexive_call(_local3, _arg2);
_local3.update();
};
};
} else {
_local4 = CMLFiber.newFiber(fbr);
_local4._initialize(fbr.object, CMLFiber.seqRapid, 0);
_local4.bul.copy(_local3);
_local4.bul.init(_arg1);
_local5 = _local3.next;
while (_local5 != _arg2) {
_local4.barrage.appendCopyOf(CMLBarrageElem(_local5));
_local5 = _local5.next;
};
_local4.fx = fbr.fx;
_local4.fy = fbr.fy;
_local4.hopt = fbr.hopt;
_local4.hang = fbr.hang;
_local4.fang = fbr.fang;
_local4.seqFire = fbr.seqFire;
_local4.wtm1 = access_id;
_local4.wtm2 = rel;
};
};
__create_bullet = function (_arg1:Number, _arg2:Number):void{
var _local3:CMLObject;
_local3 = fbr.object.fireObject(fbr.seqFire);
if (_local3 == null){
return;
};
uang = sin.index((_arg1 + CMLObject.baseAngle));
_local3._initialize(parent, isJoint, access_id, x, y, (sin[(uang + 0x0400)] * _arg2), (sin[uang] * _arg2), _arg1, 0);
__create_new_object_fiber(_local3, fbr.seqFire, refer);
};
isJoint = (rel == 2);
parent = ((rel)==0) ? CMLObject._root : fbr.object;
x = fbr.fx;
y = fbr.fy;
if (!isJoint){
uang = sin.index(fbr.object.angleOnScreen());
x_ = x;
x = ((fbr.object.x + (sin[(uang + 0x0400)] * x_)) - (sin[uang] * y));
y = ((fbr.object.y + (sin[uang] * x_)) + (sin[(uang + 0x0400)] * y));
};
fbr.fang = fbr.getAngle(fbr.fang);
if (fbr.barrage.qrtList.isEmpty()){
__create_bullet((fbr.fang + fbr.bul.angle), fbr.bul.speed);
} else {
fbr.bul.next = fbr.barrage.qrtList.head;
__reflexive_call(fbr.bul, fbr.barrage.qrtList.end);
};
}
private function _wi(_arg1:CMLFiber):Boolean{
_arg1.wcnt = _arg1.wtm2;
return ((_arg1.wcnt == 0));
}
private function _waitif(_arg1:CMLFiber):Boolean{
if (_args[0] == 0){
return (true);
};
_arg1.pointer = ((CMLState(prev).type)==ST_FORMULA) ? CMLState(prev.prev) : CMLState(prev);
return (false);
}
private function _else_start(_arg1:CMLFiber):Boolean{
do {
_arg1.pointer = _arg1.pointer.jump;
} while (_arg1.pointer.type == ST_ELSE);
return (true);
}
private function _selectFunc(... _args):void{
var _local2:int;
_local2 = _args.length;
while ((((_local2 > 0)) && (isNaN(_args[(_local2 - 1)])))) {
_local2--;
};
if (_args.length < _local2){
func = _args[(_args.length - 1)];
};
func = _args[_local2];
}
private function _gt(_arg1:CMLFiber):Boolean{
_arg1.chgt = 0;
_arg1.object.setGravityTarget(_arg1.target, _args[0], _args[1], _args[2]);
return (true);
}
private function _gp(_arg1:CMLFiber):Boolean{
_arg1.chgt = 0;
_arg1.object.setAttraction(_args[0], _args[1], _args[2]);
return (true);
}
private function _hox(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertAngle(_args[0]);
_arg1.hopt = CMLFiber.HO_REL;
_fix(_arg1);
return (true);
}
private function _pd(_arg1:CMLFiber):Boolean{
var _local2:uint;
var _local3:Number;
var _local4:Number;
if (_arg1.hopt != CMLFiber.HO_SEQ){
_local2 = sin.index(_arg1.angle);
} else {
_local2 = sin.index((_arg1.object.getPositionAngle() + CMLObject.baseAngle));
};
_local3 = sin[(_local2 + 0x0400)];
_local4 = sin[_local2];
_arg1.object.setPosition(((_local3 * _args[0]) - (_local4 * _args[1])), ((_local4 * _args[0]) + (_local3 * _args[1])), _arg1.chgt);
return (true);
}
private function _ha(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertAngle(_args[0]);
_arg1.hopt = CMLFiber.HO_ABS;
return (true);
}
private function _invertRotation(_arg1:Number):Number{
return (((((_invert_flag == 1)) || ((_invert_flag == 2)))) ? -(_arg1) : _arg1);
}
private function _loop_start(_arg1:CMLFiber):Boolean{
_arg1.lcnt.unshift(int(0));
return (true);
}
private function _px(_arg1:CMLFiber):Boolean{
_arg1.object.setPosition(_invertX(_args[0]), _arg1.object.getY(), _arg1.chgt);
return (true);
}
private function _py(_arg1:CMLFiber):Boolean{
_arg1.object.setPosition(_arg1.object.getX(), _invertY(_args[0]), _arg1.chgt);
return (true);
}
private function _block_end(_arg1:CMLFiber):Boolean{
if (jump.type == ST_LOOP){
var _local2 = _arg1.lcnt;
var _local3:int;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
if (_local4 != int(jump._args[0])){
_arg1.pointer = jump;
return (true);
};
};
_arg1.lcnt.shift();
return (true);
}
private function _ht(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertAngle(_args[0]);
_arg1.hopt = CMLFiber.HO_AIM;
return (true);
}
private function _ho(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertAngle(_args[0]);
_arg1.hopt = CMLFiber.HO_REL;
return (true);
}
private function _hp(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertAngle(_args[0]);
_arg1.hopt = CMLFiber.HO_PAR;
return (true);
}
private function _hpx(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertAngle(_args[0]);
_arg1.hopt = CMLFiber.HO_PAR;
_fix(_arg1);
return (true);
}
private function _ff1(_arg1:CMLFiber):Boolean{
var _local2:CMLState;
_arg1.bul.speed = _args[0];
_local2 = CMLState(next);
if (_local2.jump != null){
_arg1.seqFire = CMLSequence(_local2.jump);
};
_arg1.fang = _arg1.getAngle(_arg1.fang);
_arg1.pointer = _local2;
_arg1.bul.update();
return (true);
}
private function _hv(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertAngle(_args[0]);
_arg1.hopt = CMLFiber.HO_VEL;
return (true);
}
private function _atko(_arg1:CMLFiber):Boolean{
if (CMLState(next).jump != null){
_arg1.seqExec = CMLSequence(CMLState(next).jump);
};
_arg1.object.setDestructionFiber(_arg1.seqExec, _args[0]);
return (true);
}
private function _ff0(_arg1:CMLFiber):Boolean{
var _local2:CMLState;
_local2 = CMLState(next);
if (_local2.jump != null){
_arg1.seqFire = CMLSequence(_local2.jump);
};
_arg1.fang = _arg1.getAngle(_arg1.fang);
_arg1.pointer = _local2;
_arg1.bul.update();
return (true);
}
private function _hs(_arg1:CMLFiber):Boolean{
_arg1.hang = _invertRotation(_args[0]);
_arg1.hopt = CMLFiber.HO_SEQ;
return (true);
}
private function _ad(_arg1:CMLFiber):Boolean{
var _local2:uint;
var _local3:Number;
var _local4:Number;
if (_arg1.hopt != CMLFiber.HO_SEQ){
_local2 = sin.index(_arg1.angle);
} else {
_local2 = sin.index((_arg1.object.getAccelAngle() + CMLObject.baseAngle));
};
_local3 = sin[(_local2 + 0x0400)];
_local4 = sin[_local2];
_arg1.object.setAccelaration(((_local3 * _args[0]) - (_local4 * _args[1])), ((_local4 * _args[0]) + (_local3 * _args[1])), 0);
return (true);
}
private function _qx(_arg1:CMLFiber):Boolean{
_arg1.fx = _invertX(_args[0]);
return (true);
}
private function _qy(_arg1:CMLFiber):Boolean{
_arg1.fy = _invertY(_args[0]);
return (true);
}
private function _rc(_arg1:CMLFiber):Boolean{
_arg1.object.setRotationMax(_arg1._getAngleForRotationCommand(), _arg1.chgt, _args[0], _arg1._isShortestRotation());
return (true);
}
private function _fgosub(_arg1:CMLFiber):Boolean{
if (CMLState(next).jump != null){
_arg1.seqSub = CMLSequence(CMLState(next).jump);
};
return (true);
}
private function _at(_arg1:CMLFiber):Boolean{
_fiber(_arg1, _args[0]);
return (true);
}
private function _ay(_arg1:CMLFiber):Boolean{
_arg1.object.setAccelaration(_arg1.object.getAx(), _invertY(_args[0]), 0);
return (true);
}
private function _atc(_arg1:CMLFiber):Boolean{
_fiber_child(_arg1, _arg1.object, _args[0], _args[1]);
return (true);
}
private function _ax(_arg1:CMLFiber):Boolean{
_arg1.object.setAccelaration(_invertX(_args[0]), _arg1.object.getAy(), 0);
return (true);
}
private function _invertAngle(_arg1:Number):Number{
if ((_invert_flag & (2 - CMLObject.vertical))){
_arg1 = -(_arg1);
};
return (_arg1);
}
private function _initialize_barrage(_arg1:CMLFiber):Boolean{
_arg1.barrage.clear();
return (true);
}
private function _new(_arg1:CMLFiber, _arg2:uint, _arg3:uint, _arg4:Number):void{
var _local5:CMLState;
var _local6:Boolean;
var _local7:CMLObject;
var _local8:Number;
var _local9:Number;
var _local10:CMLObject;
var _local11:uint;
var _local12:Number;
_local5 = CMLState(next);
if (_local5.jump != null){
_arg1.seqNew = CMLSequence(_local5.jump);
};
_local6 = (_arg3 == 2);
_local7 = ((_arg3)==0) ? CMLObject._root : _arg1.object;
_local8 = _arg1.fx;
_local9 = _arg1.fy;
if (!_local6){
_local11 = sin.index(_arg1.object.angleOnScreen());
_local12 = _local8;
_local8 = ((_arg1.object.x + (sin[(_local11 + 0x0400)] * _local12)) - (sin[_local11] * _local9));
_local9 = ((_arg1.object.y + (sin[_local11] * _local12)) + (sin[(_local11 + 0x0400)] * _local9));
};
_local10 = _arg1.object.newObject(_arg1.seqNew);
if (_local10 == null){
return;
};
_local10._initialize(_local7, _local6, _arg2, _local8, _local9, 0, 0, _local7.head, _arg4);
__create_new_object_fiber(_local10, _arg1.seqNew, _local5);
_arg1.pointer = _local5;
}
private function _ret(_arg1:CMLFiber):Boolean{
if (_arg1.jstc.length > 0){
_arg1.shiftArguments();
_arg1.shiftInvertion();
_arg1.pointer = _arg1.jstc.pop();
_arg1.seqSub = CMLSequence(jump);
};
return (true);
}
private function _atb(_arg1:CMLFiber):Boolean{
_fiber_child(_arg1, _arg1.object.parent, _args[0], _args[1]);
return (true);
}
private function _a(_arg1:CMLFiber):Boolean{
_arg1.object.setAccelaration(_invertX(_args[0]), _invertY(_args[1]), 0);
return (true);
}
private function _i(_arg1:CMLFiber):Boolean{
_arg1.chgt = int(_args[0]);
_arg1.wtm2 = _arg1.chgt;
return (true);
}
private function _fiber(_arg1:CMLFiber, _arg2:uint):void{
var _local3:CMLState;
_local3 = CMLState(next);
if (_arg2 != 0){
_arg1.destroyChild(_arg2);
};
if (_local3.jump != null){
__create_new_fiber(_arg1, _arg1.object, CMLSequence(_local3.jump), _local3, _arg2);
_arg1.seqExec = CMLSequence(_local3.jump);
} else {
__create_new_fiber(_arg1, _arg1.object, _arg1.seqExec, _local3, _arg2);
};
_arg1.pointer = _local3;
}
private function _m(_arg1:CMLFiber):Boolean{
var _local2:Boolean;
_invert_flag = (_arg1.invt ^ (uint(_args[0]) + 1));
_arg1.pointer = CMLState(_arg1.pointer.next);
_local2 = CMLState(_arg1.pointer).func(_arg1);
_invert_flag = _arg1.invt;
return (_local2);
}
private function _br(_arg1:CMLFiber):Boolean{
_arg1.barrage.appendRandom(_args[0], _invertRotation(_args[1]), _args[2], _args[3]);
return (true);
}
private function _bs(_arg1:CMLFiber):Boolean{
_arg1.barrage.appendSequence(_args[0], _invertRotation(_args[1]), _args[2], _args[3]);
return (true);
}
private function _p(_arg1:CMLFiber):Boolean{
_arg1.object.setPosition(_invertX(_args[0]), _invertY(_args[1]), _arg1.chgt);
return (true);
}
private function _q(_arg1:CMLFiber):Boolean{
_arg1.fx = _invertX(_args[0]);
_arg1.fy = _invertY(_args[1]);
return (true);
}
private function _bv(_arg1:CMLFiber):Boolean{
_arg1.bul.setSpeedStep(_args[0]);
return (true);
}
private function _n(_arg1:CMLFiber):Boolean{
_new(_arg1, _args[0], 0, 0);
return (true);
}
private function _v(_arg1:CMLFiber):Boolean{
_arg1.object.setVelocity(_invertX(_args[0]), _invertY(_args[1]), _arg1.chgt);
return (true);
}
private function _bm(_arg1:CMLFiber):Boolean{
_arg1.barrage.appendMultiple(_args[0], _invertRotation(_args[1]), _args[2], _args[3]);
return (true);
}
private function _kf(_arg1:CMLFiber):Boolean{
_arg1.destroyAllChildren();
return (true);
}
static function _setInvertionFlag(_arg1:uint):void{
_invert_flag = _arg1;
}
public static function get invert_flag():uint{
return (_invert_flag);
}
}
}//package cml
Section 15
//CMLString (cml.CMLString)
package cml {
public class CMLString extends CMLState {
private var _string:String;
public function CMLString(_arg1:String){
super(ST_STRING);
_string = _arg1;
}
public function get string():String{
return (_string);
}
override function _setCommand(_arg1:String):CMLState{
return (this);
}
}
}//package cml
Section 16
//CMLUserDefine (cml.CMLUserDefine)
package cml {
import cml.*;
class CMLUserDefine extends CMLState {
private var _funcUserDefine:Function;
function CMLUserDefine(_arg1:Function){
super(ST_NORMAL);
_funcUserDefine = _arg1;
func = _call;
}
override function _setCommand(_arg1:String):CMLState{
return (this);
}
private function _call(_arg1:CMLFiber):Boolean{
_funcUserDefine(_arg1, _args);
return (true);
}
}
}//package cml
Section 17
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "2.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 18
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "2.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 19
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 20
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function set height(_arg1:Number):void;
function get scaleY():Number;
function move(_arg1:Number, _arg2:Number):void;
function get scaleX():Number;
function set mask(_arg1:DisplayObject):void;
function set scaleX(_arg1:Number):void;
function set name(_arg1:String):void;
function set scaleY(_arg1:Number):void;
function get visible():Boolean;
function get measuredWidth():Number;
function set visible(_arg1:Boolean):void;
function get alpha():Number;
function get height():Number;
function get width():Number;
function get parent():DisplayObjectContainer;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set y(_arg1:Number):void;
function get x():Number;
function get y():Number;
function set alpha(_arg1:Number):void;
}
}//package mx.core
Section 21
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function get repeaters():Array;
function get instanceIndices():Array;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 22
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 23
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "2.0.0.0";
}
}//package mx.core
Section 24
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import flash.utils.*;
import mx.core.*;
public class NameUtil {
mx_internal static const VERSION:String = "2.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local3:DisplayObject;
var _local4:String;
var _local5:Array;
_local3 = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
var _local2:String;
var _local3:int;
var _local4:int;
if (!_arg1){
return (null);
};
_local2 = getQualifiedClassName(_arg1);
_local3 = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
_local4 = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 25
//base64 (util.base64)
package util {
import flash.utils.*;
public class base64 {
private static var table:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
public static function decode(_arg1:String, _arg2:ByteArray):void{
var c0:int;
var c1:int;
var c2:int;
var c3:int;
var slen:int;
var blen:int;
var imax:int;
var odd:int;
var i:int;
var _c2bin:Function;
var txt = _arg1;
var bin = _arg2;
_c2bin = function ():void{
bin.writeByte(((c0 << 2) | ((c1 & 48) >> 4)));
bin.writeByte((((c1 & 15) << 4) | ((c2 & 60) >> 2)));
bin.writeByte((((c2 & 3) << 6) | c3));
};
slen = txt.length;
blen = (((slen + 3) >> 2) * 3);
imax = (slen & 2147483644);
odd = (slen - imax);
if (bin.length < blen){
bin.length = blen;
};
bin.position = 0;
i = 0;
while (i < imax) {
c0 = table.indexOf(txt.charAt(i));
c1 = table.indexOf(txt.charAt((i + 1)));
c2 = table.indexOf(txt.charAt((i + 2)));
c3 = table.indexOf(txt.charAt((i + 3)));
_c2bin();
i = (i + 4);
};
c0 = ((odd)>0) ? table.indexOf(txt.charAt(imax)) : 0;
c1 = ((odd)>1) ? table.indexOf(txt.charAt((imax + 1))) : 0;
c2 = ((odd)>2) ? table.indexOf(txt.charAt((imax + 2))) : 0;
c3 = ((odd)>3) ? table.indexOf(txt.charAt((imax + 3))) : 0;
_c2bin();
}
public static function encode(_arg1:ByteArray):String{
var txt:String;
var b0:int;
var b1:int;
var b2:int;
var blen:int;
var imax:int;
var odd:int;
var i:int;
var _b2txt:Function;
var bin = _arg1;
_b2txt = function ():void{
txt = (txt + table.charAt(((b0 & 252) >> 2)));
txt = (txt + table.charAt((((b0 & 3) << 4) | (b1 >> 4))));
txt = (txt + table.charAt((((b1 & 15) << 2) | (b2 >> 6))));
txt = (txt + table.charAt((b2 & 63)));
};
txt = "";
blen = bin.length;
imax = int((blen / 3));
odd = (blen - (imax * 3));
bin.position = 0;
i = 0;
while (i < imax) {
b0 = bin.readUnsignedByte();
b1 = bin.readUnsignedByte();
b2 = bin.readUnsignedByte();
_b2txt();
i = (i + 1);
};
b0 = ((odd)>0) ? bin.readUnsignedByte() : 0;
b1 = ((odd)>1) ? bin.readUnsignedByte() : 0;
b2 = ((odd)>2) ? bin.readUnsignedByte() : 0;
_b2txt();
return (txt);
}
}
}//package util
Section 26
//Gradation (util.Gradation)
package util {
import flash.utils.*;
public class Gradation {
private var acolGrad:ByteArray;
public function Gradation(_arg1:uint, _arg2:uint){
acolGrad = new ByteArray();
super();
acolGrad.length = 0x0400;
reset(_arg1, _arg2);
}
private function _set(_arg1:uint, _arg2:uint):void{
_arg1 = (_arg1 << 2);
acolGrad[_arg1] = ((_arg2 & 4278190080) >> 24);
acolGrad[(_arg1 + 1)] = ((_arg2 & 0xFF0000) >> 16);
acolGrad[(_arg1 + 2)] = ((_arg2 & 0xFF00) >> 8);
acolGrad[(_arg1 + 3)] = (_arg2 & 0xFF);
}
public function add(_arg1:Number, _arg2:uint):Gradation{
var _local3:uint;
_local3 = uint(((_arg1 * 0xFF) + 0.5));
if ((_arg2 & 4278190080) == 0){
_arg2 = (_arg2 & 16777216);
};
_set(_local3, _arg2);
return (this);
}
public function update():Gradation{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:Number;
var _local13:Number;
_local1 = 0;
while (_local1 < 0x0100) {
_local2 = (_local1 + 1);
while (_local2 < 0x0100) {
if (acolGrad[(_local2 << 2)] != 0){
break;
};
_local2++;
};
if (_local2 == 0x0100){
return (this);
};
_local3 = (_local1 << 2);
_local4 = acolGrad[_local3];
_local6 = acolGrad[(_local3 + 1)];
_local8 = acolGrad[(_local3 + 2)];
_local10 = acolGrad[(_local3 + 3)];
_local3 = (_local2 << 2);
_local5 = acolGrad[_local3];
_local7 = acolGrad[(_local3 + 1)];
_local9 = acolGrad[(_local3 + 2)];
_local11 = acolGrad[(_local3 + 3)];
_local13 = (1 / Number((_local2 - _local1)));
_local12 = _local13;
_local1++;
while (_local1 < _local2) {
_local3 = (_local1 << 2);
acolGrad[_local3] = ((_local4 * (1 - _local12)) + (_local5 * _local12));
acolGrad[(_local3 + 1)] = ((_local6 * (1 - _local12)) + (_local7 * _local12));
acolGrad[(_local3 + 2)] = ((_local8 * (1 - _local12)) + (_local9 * _local12));
acolGrad[(_local3 + 3)] = ((_local10 * (1 - _local12)) + (_local11 * _local12));
_local12 = (_local12 + _local13);
_local1++;
};
};
return (this);
}
public function del(_arg1:Number):Gradation{
var _local2:uint;
_local2 = uint(((_arg1 * 0xFF) + 0.5));
switch (_local2){
case 0:
case 0xFF:
_set(_local2, 4278190080);
break;
default:
_set(_local2, 0);
break;
};
return (this);
}
public function getColor(_arg1:Number):uint{
var _local2:uint;
_local2 = uint(((_arg1 * 0xFF) + 0.5));
return (_get(_local2));
}
public function reset(_arg1:uint, _arg2:uint):Gradation{
var _local3:uint;
_set(0, _arg1);
_set(0xFF, _arg2);
_local3 = 1;
while (_local3 < 0xFF) {
_set(_local3, 0);
_local3++;
};
return (this);
}
public function copy(_arg1:Gradation):Gradation{
var _local2:int;
_local2 = 0;
while (_local2 < 0x0400) {
acolGrad[_local2] = _arg1.acolGrad[_local2];
_local2++;
};
return (this);
}
public function _get(_arg1:uint):uint{
_arg1 = (_arg1 << 2);
return (((((acolGrad[_arg1] << 24) + (acolGrad[(_arg1 + 1)] << 16)) + (acolGrad[(_arg1 + 2)] << 8)) + acolGrad[(_arg1 + 3)]));
}
public function addBlink(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:uint):Gradation{
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
_local7 = uint(((_arg1 * 0xFF) + 0.5));
_local8 = uint(((_arg2 * 0xFF) + 0.5));
_local9 = uint(((_arg3 * 0xFF) + 0.5));
if (_local9 == 0){
_local9 = 1;
};
if ((_arg4 & 4278190080) == 0){
_arg4 = (_arg4 & 16777216);
};
_local5 = _local7;
while (_local5 < _local8) {
_local6 = 0;
while (_local6 < _local9) {
_set((_local5 + _local6), _arg4);
_local6++;
};
_local5 = (_local5 + (_local9 * 2));
};
return (this);
}
}
}//package util
Section 27
//interpolation (util.interpolation)
package util {
public class interpolation {
private var P:Number;// = 0
private var Q:Number;// = 0
private var R:Number;// = 0
private var S:Number;// = 0
public function interpolation(){
P = 0;
Q = 0;
R = 0;
S = 0;
super();
}
public function setLagrange(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):interpolation{
P = (((_arg4 - _arg3) - _arg1) + _arg2);
Q = ((_arg1 - _arg2) - P);
R = (_arg3 - _arg1);
S = _arg2;
return (this);
}
public function setLinear(_arg1:Number, _arg2:Number):interpolation{
P = 0;
Q = 0;
R = (_arg2 - _arg1);
S = _arg1;
return (this);
}
public function setCatmullRom(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):interpolation{
P = ((((((-(_arg1) + _arg2) - _arg3) + _arg4) * 0.5) + _arg2) - _arg3);
Q = ((_arg1 + ((_arg3 - _arg2) * 2)) - ((_arg2 + _arg4) * 0.5));
R = ((_arg3 - _arg1) * 0.5);
S = _arg2;
return (this);
}
public function calc(_arg1:Number):Number{
return (((((((P * _arg1) + Q) * _arg1) + R) * _arg1) + S));
}
public function setCatmullRomEnd(_arg1:Number, _arg2:Number, _arg3:Number):interpolation{
P = 0;
Q = (((_arg1 + _arg3) * 0.5) - _arg2);
R = ((_arg3 - _arg1) * 0.5);
S = _arg2;
return (this);
}
public function setBezier2(_arg1:Number, _arg2:Number, _arg3:Number):interpolation{
P = 0;
Q = ((_arg1 + _arg2) - (_arg3 * 2));
R = ((_arg3 - _arg1) * 2);
S = _arg1;
return (this);
}
public function setBezier3(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):interpolation{
P = ((-(_arg1) + ((_arg3 - _arg4) * 3)) + _arg2);
Q = (((_arg1 - (_arg3 * 2)) + _arg4) * 3);
R = ((-(_arg1) + _arg3) * 3);
S = _arg1;
return (this);
}
public function setFergusonCoons(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):interpolation{
P = ((((_arg1 - _arg2) * 2) + _arg3) + _arg4);
Q = (((-(_arg1) + _arg2) - _arg3) - P);
R = _arg3;
S = _arg1;
return (this);
}
public function setCatmullRomStart(_arg1:Number, _arg2:Number, _arg3:Number):interpolation{
P = 0;
Q = (((_arg1 + _arg3) * 0.5) - _arg2);
R = (((_arg2 - _arg1) * 2) + ((_arg1 - _arg3) * 0.5));
S = _arg1;
return (this);
}
}
}//package util
Section 28
//matrix4 (util.matrix4)
package util {
public class matrix4 {
public var a10:Number;// = 0
public var a13:Number;// = 0
public var a30:Number;// = 0
public var a11:Number;// = 1
public var a12:Number;// = 0
public var a33:Number;// = 1
public var a20:Number;// = 0
public var a21:Number;// = 0
public var a00:Number;// = 1
public var a01:Number;// = 0
public var a02:Number;// = 0
public var a03:Number;// = 0
public var a22:Number;// = 1
public var a23:Number;// = 0
public var a32:Number;// = 0
public var a31:Number;// = 0
public function matrix4(){
a00 = 1;
a01 = 0;
a02 = 0;
a03 = 0;
a10 = 0;
a11 = 1;
a12 = 0;
a13 = 0;
a20 = 0;
a21 = 0;
a22 = 1;
a23 = 0;
a30 = 0;
a31 = 0;
a32 = 0;
a33 = 1;
super();
}
public function scale(_arg1:Number, _arg2:Number, _arg3:Number):matrix4{
a00 = (a00 * _arg1);
a01 = (a01 * _arg1);
a02 = (a02 * _arg1);
a03 = (a03 * _arg1);
a10 = (a10 * _arg2);
a11 = (a11 * _arg2);
a12 = (a12 * _arg2);
a13 = (a13 * _arg2);
a20 = (a20 * _arg3);
a21 = (a21 * _arg3);
a22 = (a22 * _arg3);
a23 = (a23 * _arg3);
return (this);
}
public function translate(_arg1:Number, _arg2:Number, _arg3:Number):matrix4{
a30 = (a30 + (((_arg1 * a00) + (_arg2 * a10)) + (_arg3 * a20)));
a31 = (a31 + (((_arg1 * a01) + (_arg2 * a11)) + (_arg3 * a21)));
a32 = (a32 + (((_arg1 * a02) + (_arg2 * a12)) + (_arg3 * a22)));
a33 = (a33 + (((_arg1 * a03) + (_arg2 * a13)) + (_arg3 * a23)));
return (this);
}
public function calc_w0(_arg1:vector3):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = _arg1.z;
_arg1.x = (((a00 * _local2) + (a10 * _local3)) + (a20 * _local4));
_arg1.y = (((a01 * _local2) + (a11 * _local3)) + (a21 * _local4));
_arg1.z = (((a02 * _local2) + (a12 * _local3)) + (a22 * _local4));
}
public function loadIdentity():matrix4{
a00 = 1;
a01 = 0;
a02 = 0;
a03 = 0;
a10 = 0;
a11 = 1;
a12 = 0;
a13 = 0;
a20 = 0;
a21 = 0;
a22 = 1;
a23 = 0;
a30 = 0;
a31 = 0;
a32 = 0;
a33 = 1;
return (this);
}
public function rotateX(_arg1:Number):matrix4{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local2 = a10;
_local3 = a11;
_local4 = a12;
_local5 = a13;
_local6 = a20;
_local7 = a21;
_local8 = a22;
_local9 = a23;
_local10 = Math.sin(_arg1);
_local11 = Math.cos(_arg1);
a10 = ((_local11 * _local2) + (_local10 * _local6));
a11 = ((_local11 * _local3) + (_local10 * _local7));
a12 = ((_local11 * _local4) + (_local10 * _local8));
a13 = ((_local11 * _local5) + (_local10 * _local9));
a20 = ((-(_local10) * _local2) + (_local11 * _local6));
a21 = ((-(_local10) * _local3) + (_local11 * _local7));
a22 = ((-(_local10) * _local4) + (_local11 * _local8));
a23 = ((-(_local10) * _local5) + (_local11 * _local9));
return (this);
}
public function rotateY(_arg1:Number):matrix4{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local2 = a20;
_local3 = a21;
_local4 = a22;
_local5 = a23;
_local6 = a00;
_local7 = a01;
_local8 = a02;
_local9 = a03;
_local10 = Math.sin(_arg1);
_local11 = Math.cos(_arg1);
a20 = ((_local11 * _local2) + (_local10 * _local6));
a21 = ((_local11 * _local3) + (_local10 * _local7));
a22 = ((_local11 * _local4) + (_local10 * _local8));
a23 = ((_local11 * _local5) + (_local10 * _local9));
a00 = ((-(_local10) * _local2) + (_local11 * _local6));
a01 = ((-(_local10) * _local3) + (_local11 * _local7));
a02 = ((-(_local10) * _local4) + (_local11 * _local8));
a03 = ((-(_local10) * _local5) + (_local11 * _local9));
return (this);
}
public function rotateZ(_arg1:Number):matrix4{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local2 = a00;
_local3 = a01;
_local4 = a02;
_local5 = a03;
_local6 = a10;
_local7 = a11;
_local8 = a12;
_local9 = a13;
_local10 = Math.sin(_arg1);
_local11 = Math.cos(_arg1);
a00 = ((_local11 * _local2) + (_local10 * _local6));
a01 = ((_local11 * _local3) + (_local10 * _local7));
a02 = ((_local11 * _local4) + (_local10 * _local8));
a03 = ((_local11 * _local5) + (_local10 * _local9));
a10 = ((-(_local10) * _local2) + (_local11 * _local6));
a11 = ((-(_local10) * _local3) + (_local11 * _local7));
a12 = ((-(_local10) * _local4) + (_local11 * _local8));
a13 = ((-(_local10) * _local5) + (_local11 * _local9));
return (this);
}
public function mult(_arg1:matrix4, _arg2:matrix4):matrix4{
a00 = ((((_arg2.a00 * _arg1.a00) + (_arg2.a01 * _arg1.a10)) + (_arg2.a02 * _arg1.a20)) + (_arg2.a03 * _arg1.a30));
a01 = ((((_arg2.a00 * _arg1.a01) + (_arg2.a01 * _arg1.a11)) + (_arg2.a02 * _arg1.a21)) + (_arg2.a03 * _arg1.a31));
a02 = ((((_arg2.a00 * _arg1.a02) + (_arg2.a01 * _arg1.a12)) + (_arg2.a02 * _arg1.a22)) + (_arg2.a03 * _arg1.a32));
a03 = ((((_arg2.a00 * _arg1.a03) + (_arg2.a01 * _arg1.a13)) + (_arg2.a02 * _arg1.a23)) + (_arg2.a03 * _arg1.a33));
a10 = ((((_arg2.a10 * _arg1.a00) + (_arg2.a11 * _arg1.a10)) + (_arg2.a12 * _arg1.a20)) + (_arg2.a13 * _arg1.a30));
a11 = ((((_arg2.a10 * _arg1.a01) + (_arg2.a11 * _arg1.a11)) + (_arg2.a12 * _arg1.a21)) + (_arg2.a13 * _arg1.a31));
a12 = ((((_arg2.a10 * _arg1.a02) + (_arg2.a11 * _arg1.a12)) + (_arg2.a12 * _arg1.a22)) + (_arg2.a13 * _arg1.a32));
a13 = ((((_arg2.a10 * _arg1.a03) + (_arg2.a11 * _arg1.a13)) + (_arg2.a12 * _arg1.a23)) + (_arg2.a13 * _arg1.a33));
a20 = ((((_arg2.a20 * _arg1.a00) + (_arg2.a21 * _arg1.a10)) + (_arg2.a22 * _arg1.a20)) + (_arg2.a23 * _arg1.a30));
a21 = ((((_arg2.a20 * _arg1.a01) + (_arg2.a21 * _arg1.a11)) + (_arg2.a22 * _arg1.a21)) + (_arg2.a23 * _arg1.a31));
a22 = ((((_arg2.a20 * _arg1.a02) + (_arg2.a21 * _arg1.a12)) + (_arg2.a22 * _arg1.a22)) + (_arg2.a23 * _arg1.a32));
a23 = ((((_arg2.a20 * _arg1.a03) + (_arg2.a21 * _arg1.a13)) + (_arg2.a22 * _arg1.a23)) + (_arg2.a23 * _arg1.a33));
a30 = ((((_arg2.a30 * _arg1.a00) + (_arg2.a31 * _arg1.a10)) + (_arg2.a32 * _arg1.a20)) + (_arg2.a33 * _arg1.a30));
a31 = ((((_arg2.a30 * _arg1.a01) + (_arg2.a31 * _arg1.a11)) + (_arg2.a32 * _arg1.a21)) + (_arg2.a33 * _arg1.a31));
a32 = ((((_arg2.a30 * _arg1.a02) + (_arg2.a31 * _arg1.a12)) + (_arg2.a32 * _arg1.a22)) + (_arg2.a33 * _arg1.a32));
a33 = ((((_arg2.a30 * _arg1.a03) + (_arg2.a31 * _arg1.a13)) + (_arg2.a32 * _arg1.a23)) + (_arg2.a33 * _arg1.a33));
return (this);
}
public function calc_w1(_arg1:vector3):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = _arg1.x;
_local3 = _arg1.y;
_local4 = _arg1.z;
_arg1.x = ((((a00 * _local2) + (a10 * _local3)) + (a20 * _local4)) + a30);
_arg1.y = ((((a01 * _local2) + (a11 * _local3)) + (a21 * _local4)) + a31);
_arg1.z = ((((a02 * _local2) + (a12 * _local3)) + (a22 * _local4)) + a32);
}
public function loadPerspective(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):matrix4{
_arg1 = (Math.cos((_arg1 * 0.5)) / Math.sin((_arg1 * 0.5)));
a00 = (_arg1 / _arg2);
a10 = 0;
a20 = 0;
a30 = 0;
a01 = 0;
a11 = _arg1;
a21 = 0;
a31 = 0;
a02 = 0;
a12 = 0;
a22 = (-((_arg4 + _arg3)) / (_arg4 - _arg3));
a32 = (-(((2 * _arg4) * _arg3)) / (_arg4 - _arg3));
a03 = 0;
a13 = 0;
a23 = -1;
a33 = 0;
return (this);
}
}
}//package util
Section 29
//md5 (util.md5)
package util {
import flash.utils.*;
public class md5 {
private static var func:Array = new Array(funcR1, funcR2, funcR3, funcR4);
private static var tableR1:Array = new Array(new Array(0, 7, 1), new Array(1, 12, 2), new Array(2, 17, 3), new Array(3, 22, 4), new Array(4, 7, 5), new Array(5, 12, 6), new Array(6, 17, 7), new Array(7, 22, 8), new Array(8, 7, 9), new Array(9, 12, 10), new Array(10, 17, 11), new Array(11, 22, 12), new Array(12, 7, 13), new Array(13, 12, 14), new Array(14, 17, 15), new Array(15, 22, 16));
private static var table:Array = new Array(tableR1, tableR2, tableR3, tableR4);
private static var tableR3:Array = new Array(new Array(5, 4, 33), new Array(8, 11, 34), new Array(11, 16, 35), new Array(14, 23, 36), new Array(1, 4, 37), new Array(4, 11, 38), new Array(7, 16, 39), new Array(10, 23, 40), new Array(13, 4, 41), new Array(0, 11, 42), new Array(3, 16, 43), new Array(6, 23, 44), new Array(9, 4, 45), new Array(12, 11, 46), new Array(15, 16, 47), new Array(2, 23, 48));
private static var tableR4:Array = new Array(new Array(0, 6, 49), new Array(7, 10, 50), new Array(14, 15, 51), new Array(5, 21, 52), new Array(12, 6, 53), new Array(3, 10, 54), new Array(10, 15, 55), new Array(1, 21, 56), new Array(8, 6, 57), new Array(15, 10, 58), new Array(6, 15, 59), new Array(13, 21, 60), new Array(4, 6, 61), new Array(11, 10, 62), new Array(2, 15, 63), new Array(9, 21, 64));
private static var T:Array = new Array(0, 3614090360, 3905402710, 606105819, 3250441966, 4118548399, 1200080426, 2821735955, 4249261313, 1770035416, 2336552879, 4294925233, 2304563134, 1804603682, 4254626195, 2792965006, 1236535329, 4129170786, 3225465664, 643717713, 3921069994, 3593408605, 38016083, 3634488961, 3889429448, 568446438, 3275163606, 4107603335, 1163531501, 2850285829, 4243563512, 1735328473, 2368359562, 4294588738, 2272392833, 1839030562, 4259657740, 2763975236, 1272893353, 4139469664, 3200236656, 681279174, 3936430074, 3572445317, 76029189, 3654602809, 3873151461, 530742520, 3299628645, 4096336452, 1126891415, 2878612391, 4237533241, 1700485571, 2399980690, 4293915773, 2240044497, 1873313359, 4264355552, 2734768916, 1309151649, 4149444226, 3174756917, 718787259, 3951481745);
private static var tableR2:Array = new Array(new Array(1, 5, 17), new Array(6, 9, 18), new Array(11, 14, 19), new Array(0, 20, 20), new Array(5, 5, 21), new Array(10, 9, 22), new Array(15, 14, 23), new Array(4, 20, 24), new Array(9, 5, 25), new Array(14, 9, 26), new Array(3, 14, 27), new Array(8, 20, 28), new Array(13, 5, 29), new Array(2, 9, 30), new Array(7, 14, 31), new Array(12, 20, 32));
private static function _number(_arg1:Number):uint{
while (_arg1 < 0) {
_arg1 = (_arg1 + 4294967296);
};
while (_arg1 > 4294967295) {
_arg1 = (_arg1 - 4294967296);
};
return (uint(_arg1));
}
private static function funcR2(_arg1:uint, _arg2:uint, _arg3:uint):uint{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function funcR3(_arg1:uint, _arg2:uint, _arg3:uint):uint{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function funcR4(_arg1:uint, _arg2:uint, _arg3:uint):uint{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function funcR1(_arg1:uint, _arg2:uint, _arg3:uint):uint{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
public static function convert(_arg1:String):ByteArray{
var _local2:Function;
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:ByteArray;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:Array;
var _local13:Array;
var _local14:Array;
var _local15:Array;
_local8 = new ByteArray();
_local8.writeUTFBytes(_arg1);
_local9 = _local8.length;
_local10 = (_local9 & 63);
_local11 = ((_local10)<56) ? 64 : 128;
_local8.writeByte(128);
_local5 = (_local9 + 1);
while (_local5 < (_local11 - 8)) {
_local8.writeByte(0);
_local5++;
};
_pack(_local8, (_local9 * 8));
_pack(_local8, 0);
_local12 = new Array(1732584193, 4023233417, 2562383102, 271733878);
_local13 = new Array(0, 1, 2, 3);
_local14 = new Array(16);
_local15 = new Array(4);
_local7 = 0;
while (_local7 < _local11) {
_local5 = 0;
_local6 = _local7;
while (_local5 < 16) {
_local14[_local5] = (((_local8[_local6] | (_local8[(_local6 + 1)] << 8)) | (_local8[(_local6 + 2)] << 16)) | (_local8[(_local6 + 3)] << 24));
_local5++;
_local6 = (_local6 + 4);
};
_local5 = 0;
while (_local5 < 4) {
_local15[_local5] = _local12[_local5];
_local5++;
};
_local5 = 0;
while (_local5 < 4) {
_local2 = func[_local5];
_local3 = table[_local5];
_local6 = 0;
while (_local6 < 16) {
_round(_local14, _local15, _local2, _local13, _local3[_local6]);
_local4 = _local13[0];
_local13[0] = _local13[3];
_local13[3] = _local13[2];
_local13[2] = _local13[1];
_local13[1] = _local4;
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < 4) {
_local12[_local5] = (_local12[_local5] + _local15[_local5]);
_local5++;
};
_local7 = (_local7 + 64);
};
_local8 = new ByteArray();
_pack(_local8, _local12[0]);
_pack(_local8, _local12[1]);
_pack(_local8, _local12[2]);
_pack(_local8, _local12[3]);
return (_local8);
}
private static function _round(_arg1:Array, _arg2:Array, _arg3:Function, _arg4:Array, _arg5:Array):void{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
_local6 = _arg4[0];
_local7 = _arg4[1];
_local8 = _arg4[2];
_local9 = _arg4[3];
_local10 = _arg5[0];
_local11 = _arg5[1];
_local12 = _arg5[2];
_local13 = _number((((_arg2[_local6] + _arg3(_arg2[_local7], _arg2[_local8], _arg2[_local9])) + _arg1[_local10]) + T[_local12]));
_local13 = ((_local13 << _local11) | (_local13 >>> (32 - _local11)));
_local13 = (_local13 + _arg2[_local7]);
_arg2[_local6] = _number(_local13);
}
private static function _pack(_arg1:ByteArray, _arg2:uint):ByteArray{
_arg1.writeByte((_arg2 & 0xFF));
_arg1.writeByte(((_arg2 >>> 8) & 0xFF));
_arg1.writeByte(((_arg2 >>> 16) & 0xFF));
_arg1.writeByte(((_arg2 >>> 24) & 0xFF));
return (_arg1);
}
public static function hash(_arg1:String):String{
var _local2:String;
var _local3:ByteArray;
var _local4:uint;
var _local5:uint;
_local2 = "";
_local3 = convert(_arg1);
_local4 = 0;
while (_local4 < 16) {
_local5 = _local3[_local4];
_local2 = (_local2 + "0123456789abcdef".charAt(((_local5 >> 4) & 15)));
_local2 = (_local2 + "0123456789abcdef".charAt((_local5 & 15)));
_local4++;
};
return (_local2);
}
}
}//package util
Section 30
//randMT (util.randMT)
package util {
public class randMT {
private const MATRIX_A:uint = 2567483615;
private const UPPER_MASK:uint = 2147483648;
private const LOWER_MASK:uint = 2147483647;
private const M:int = 397;
private const N:int = 624;
private var seed_:uint;
private var q:int;
private var r:int;
private var p:int;
private var x:Array;
public function randMT(_arg1:uint=0){
x = new Array();
super();
seed = _arg1;
}
public function get seed():uint{
return (seed_);
}
public function getf():Number{
return ((_next() * 2.3283064365387E-10));
}
private function _next():uint{
var _local1:uint;
_local1 = ((x[p] & UPPER_MASK) | (x[q] & LOWER_MASK));
x[p] = ((x[r] ^ (_local1 >>> 1)) ^ ((_local1 & 1) * MATRIX_A));
_local1 = x[p];
if (++p == N){
p = 0;
};
if (++q == N){
q = 0;
};
if (++r == N){
r = 0;
};
_local1 = (_local1 ^ (_local1 >>> 11));
_local1 = (_local1 ^ ((_local1 << 7) & 2636928640));
_local1 = (_local1 ^ ((_local1 << 15) & 4022730752));
_local1 = (_local1 ^ (_local1 >>> 18));
return (_local1);
}
private function _imul(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = (_arg1 & 0xFFFF);
_local4 = (_arg1 >>> 16);
_local5 = (_arg2 & 0xFFFF);
_local6 = (_arg2 >>> 16);
_local7 = (_local3 * _local5);
_local8 = (((((_local7 >>> 16) + (_local3 * _local6)) & 0xFFFF) + (_local4 * _local5)) & 0xFFFF);
return (((_local8 << 16) | (_local7 & 0xFFFF)));
}
public function set seed(_arg1:uint):void{
var _local2:int;
seed_ = seed;
x[0] = _arg1;
_local2 = 1;
while (_local2 < N) {
x[_local2] = (_imul(1812433253, (x[(_local2 - 1)] ^ (x[(_local2 - 1)] >>> 30))) + _local2);
x[_local2] = (x[_local2] & 4294967295);
_local2++;
};
p = 0;
q = 1;
r = M;
}
public function getui():uint{
return (_next());
}
public function getfs():Number{
return (((_next() * 4.65661287307739E-10) - 1));
}
}
}//package util
Section 31
//SinTable (util.SinTable)
package util {
public dynamic class SinTable extends Array {
private var fil:uint;
private var d2i:Number;
public function SinTable(_arg1:uint=0x1000){
var _local2:uint;
var _local3:Number;
var _local4:int;
super();
_local2 = (_arg1 + (_arg1 >> 2));
_local3 = (Math.PI / Number((_arg1 >> 1)));
length = _local2;
while (_local4 < _local2) {
this[_local4] = Math.sin((Number(_local4) * _local3));
_local4++;
};
d2i = (Number(_arg1) / 360);
fil = (_arg1 - 1);
}
public function index(_arg1:Number):uint{
return ((uint((_arg1 * d2i)) & fil));
}
}
}//package util
Section 32
//vector3 (util.vector3)
package util {
public class vector3 {
public var x:Number;// = 0
public var y:Number;// = 0
public var z:Number;// = 0
public function vector3(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
x = 0;
y = 0;
z = 0;
super();
x = _arg1;
y = _arg2;
z = _arg3;
}
public function sub(_arg1:vector3):vector3{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
return (this);
}
public function cross(_arg1:vector3, _arg2:vector3):vector3{
x = ((_arg1.y * _arg2.z) - (_arg1.z * _arg2.y));
y = ((_arg1.z * _arg2.x) - (_arg1.x * _arg2.z));
z = ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x));
return (this);
}
public function mul(_arg1:vector3):vector3{
x = (x * _arg1.x);
y = (y * _arg1.y);
z = (z * _arg1.z);
return (this);
}
public function length():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function add(_arg1:vector3):vector3{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
return (this);
}
public function dot(_arg1:vector3):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
public function scale(_arg1:Number):vector3{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
return (this);
}
public function length2():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
public function normalize(_arg1:Number):Number{
var _local2:Number;
_local2 = length2();
if (_local2 == 0){
return (0);
};
_local2 = Math.sqrt(_local2);
scale((_arg1 / _local2));
return (_local2);
}
public function div(_arg1:vector3):vector3{
x = (x / _arg1.x);
y = (y / _arg1.y);
z = (z / _arg1.z);
return (this);
}
}
}//package util
Section 33
//WireFrame (util.WireFrame)
package util {
import flash.display.*;
import flash.utils.*;
public class WireFrame {
public var line:Array;
public function WireFrame(){
line = new Array();
super();
}
public function loadText(_arg1:String):void{
}
public function draw(_arg1:Graphics, _arg2:Number=1):void{
var _local3:uint;
var _local4:WireFrameLine;
var _local5:WireFrameVertex;
_local3 = 0;
while (_local3 < line.length) {
_local4 = line[_local3];
_arg1.moveTo((_local4.x * _arg2), (_local4.y * _arg2));
_local5 = _local4.next;
while (_local5 != _local4) {
_arg1.lineTo((_local5.x * _arg2), (_local5.y * _arg2));
_local5 = _local5.next;
};
_local3++;
};
}
public function copyLine(_arg1:Boolean, _arg2:Boolean):WireFrame{
var _local3:WireFrameLine;
var _local4:WireFrameLine;
var _local5:WireFrameVertex;
var _local6:WireFrameVertex;
_local3 = line[(line.length - 1)];
_local4 = new WireFrameLine(_local3.x, _local3.y, _local3.z);
if (_arg1){
_local4.x = -(_local4.x);
};
if (_arg2){
_local4.y = -(_local4.y);
};
_local5 = _local3.next;
while (_local5 != _local3) {
_local6 = new WireFrameVertex(_local5.x, _local5.y, _local5.z);
if (_arg1){
_local6.x = -(_local6.x);
};
if (_arg2){
_local6.y = -(_local6.y);
};
_local4.push(_local6);
_local5 = _local5.next;
};
line.push(_local4);
return (this);
}
public function to(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):WireFrame{
line[(line.length - 1)].push(new WireFrameVertex(_arg1, _arg2, _arg3));
return (this);
}
public function clear():void{
line.length = 0;
}
public function mult(_arg1:matrix4):WireFrame{
var _local2:uint;
var _local3:WireFrameLine;
var _local4:WireFrameVertex;
_local2 = 0;
while (_local2 < line.length) {
_local3 = line[_local2];
_arg1.calc_w1(_local3);
_local4 = _local3.next;
while (_local4 != _local3) {
_arg1.calc_w1(_local4);
_local4 = _local4.next;
};
_local2++;
};
return (this);
}
public function construct(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:uint;
var _local8:WireFrameLine;
var _local9:Number;
var _local10:WireFrameVertex;
_local7 = 0;
while (_local7 < line.length) {
_local8 = line[_local7];
_local9 = (_arg2 / (_arg2 - _local8.z));
_arg1.moveTo((((_local8.x - _arg3) * _local9) + _arg5), (((_local8.y - _arg4) * _local9) + _arg6));
_local10 = _local8.next;
while (_local10 != _local8) {
_local9 = (_arg2 / (_arg2 - _local10.z));
_arg1.lineTo((((_local10.x - _arg3) * _local9) + _arg5), (((_local10.y - _arg4) * _local9) + _arg6));
_local10 = _local10.next;
};
_local7++;
};
}
public function append_clone(_arg1:WireFrame):WireFrame{
var _local2:uint;
var _local3:WireFrameLine;
var _local4:WireFrameVertex;
_local2 = 0;
while (_local2 < _arg1.line.length) {
_local3 = _arg1.line[_local2];
newLine(_local3.x, _local3.y, _local3.z);
_local4 = _local3.next;
while (_local4 != _local3) {
to(_local4.x, _local4.y, _local4.z);
_local4 = _local4.next;
};
_local2++;
};
return (this);
}
public function append(_arg1:WireFrame):WireFrame{
var _local2:uint;
_local2 = 0;
while (_local2 < _arg1.line.length) {
line.push(_arg1.line[_local2]);
_local2++;
};
return (this);
}
public function newLine(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):WireFrame{
line.push(new WireFrameLine(_arg1, _arg2, _arg3));
return (this);
}
public static function load(_arg1:String, _arg2:Function):void{
var _local3:RegExp;
var _local4:Object;
var _local5:WireFrame;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
_local3 = /^#[ \t]*(.*)[ \t]*$|^(new)[ \t]*(x?)(y?)$|^[ \t]*([0-9.]+)[ \t]+([0-9.]+)[ \t]+([0-9.]*)[ \t]*$/gm;
_local4 = _local3.exec(_arg1);
_local5 = null;
_local6 = true;
_local7 = false;
_local8 = false;
while (_local4 != null) {
if (_local4[1] != undefined){
_local5 = _arg2(_local4[1]);
} else {
if (_local5 == null){
throw (new Error("wire frame object not defined"));
};
if (_local4[2] != undefined){
if (!_local6){
if (_local7){
_local5.copyLine(true, false);
};
if (_local8){
_local5.copyLine(false, true);
};
if (((_local7) && (_local8))){
_local5.copyLine(true, false);
};
};
_local6 = true;
_local7 = !((_local4[3] == undefined));
_local8 = !((_local4[4] == undefined));
} else {
if (_local4[5] != undefined){
if (_local6){
_local5.newLine(Number(_local4[5]), Number(_local4[6]), ((_local4[7])==undefined) ? 0 : Number(_local4[7]));
} else {
_local5.to(Number(_local4[5]), Number(_local4[6]), ((_local4[7])==undefined) ? 0 : Number(_local4[7]));
};
_local6 = false;
} else {
throw (new Error(("wire frame data error: " + _local4[0])));
};
};
};
_local4 = _local3.exec(_arg1);
};
}
}
}//package util
class WireFrameVertex extends vector3 {
public var prev:WireFrameVertex;// = null
public var next:WireFrameVertex;// = null
private function WireFrameVertex(_arg1:Number, _arg2:Number, _arg3:Number){
next = null;
prev = null;
super(_arg1, _arg2, _arg3);
}
}
class WireFrameLine extends WireFrameVertex {
private function WireFrameLine(_arg1:Number, _arg2:Number, _arg3:Number){
super(_arg1, _arg2, _arg3);
next = this;
prev = this;
}
public function push(_arg1:WireFrameVertex):void{
_arg1.prev = prev;
_arg1.next = this;
prev.next = _arg1;
prev = _arg1;
}
}
Section 34
//Actor (Actor)
package {
import cml.*;
public class Actor extends CMLObject {
public var size:Number;// = 0
public var drawPrior:uint;
public var life:Number;// = 1
public var prevDraw:Actor;// = null
public var nextTest:Actor;// = null
public var freeList:CMLList;// = null
public var testID:uint;// = 0
public var prevTest:Actor;// = null
public var nextDraw:Actor;// = null
public function Actor(){
size = 0;
life = 1;
freeList = null;
drawPrior = object_manager.NO_HITTEST;
nextDraw = null;
prevDraw = null;
testID = 0;
nextTest = null;
prevTest = null;
super();
nextTest = this;
prevTest = this;
nextDraw = this;
prevDraw = this;
}
override public function run():void{
move();
if (isEscaped()){
destroy(0);
};
}
public function vital(_arg1:Number):void{
}
public function sizing(_arg1:Number):void{
size = _arg1;
}
override public function exit(_arg1:Number):void{
freeList.push(this);
object_manager.popDrawChain(this);
object_manager.popTestChain(this);
}
protected function isEscaped():Boolean{
return ((((((((x < (-(size) - object_manager.SCREEN_HALF_WIDTH))) || ((x > (size + object_manager.SCREEN_HALF_WIDTH))))) || ((y < (-(size) - object_manager.SCREEN_HALF_HEIGHT))))) || ((y > (size + object_manager.SCREEN_HALF_HEIGHT)))));
}
public function fastbreak(_arg1:Number):void{
}
public function draw():void{
}
public function range(_arg1:Boolean):void{
}
override public function enter():void{
life = 1;
object_manager.pushDrawChain(drawPrior, this);
object_manager.pushTestChain(testID, this);
}
}
}//package
Section 35
//key_logger (key_logger)
package {
import util.*;
import flash.utils.*;
public class key_logger {
private var header:log_header;
private var round:uint;// = 0
private var current_time:uint;
private var current_key:uint;
private var data:ByteArray;
private var flagReplay:Boolean;
public var stage:stage_info;
private static const DEFAULT_DATA_LENGTH:uint = 65536;
public function key_logger(){
data = new ByteArray();
round = 0;
header = new log_header();
stage = new stage_info();
super();
}
public function startStage(_arg1:uint):void{
if (flagReplay){
round = _arg1;
current_time = 1;
current_key = 0;
data.position = header.log_position[round];
stage.read(data);
data.readUnsignedShort();
} else {
round = _arg1;
current_time = 0;
current_key = 0xFF;
header.log_count = (round + 1);
header.log_position[round] = data.position;
stage.write(data);
};
}
public function flush():void{
}
public function input():uint{
return (current_key);
}
public function run():void{
var _local1:uint;
if (flagReplay){
current_time--;
if (current_time == 0){
_local1 = data.readUnsignedShort();
current_time = (_local1 & 0xFF);
current_key = (_local1 >> 8);
};
} else {
_local1 = (system.control.getFlag() & 127);
current_time++;
if (((!((current_key == _local1))) || ((current_time == 0xFF)))){
data.writeShort(((current_key << 8) | current_time));
current_key = _local1;
current_time = 0;
};
};
}
public function record():void{
flagReplay = false;
if (data.length < DEFAULT_DATA_LENGTH){
data.length = DEFAULT_DATA_LENGTH;
};
data.position = log_header.SIZE;
header.clear();
}
public function encode():String{
header.write(data);
data.length = data.position;
return (base64.encode(data));
}
public function endStage():void{
if (!flagReplay){
data.writeShort(((current_key << 8) | current_time));
data.writeShort(0xFF);
};
}
public function replay():void{
flagReplay = true;
}
public function decode(_arg1:String):void{
base64.decode(_arg1, data);
header.read(data);
}
public function isReplay():Boolean{
return (flagReplay);
}
}
}//package
import flash.utils.*;
class log_header {
public var log_position:Array;
public var score:uint;// = 0
public var log_count:uint;// = 0
public var version:uint;// = 0
public static const SIZE:uint = 48;
public static const VERSION:uint = 1;
public static const LOG_POSITION_MAX:uint = 6;
private function log_header(){
version = 0;
score = 0;
log_count = 0;
log_position = new Array(LOG_POSITION_MAX);
super();
}
public function clear():void{
var _local1:int;
version = VERSION;
score = 0;
log_count = 0;
_local1 = 0;
while (_local1 < LOG_POSITION_MAX) {
log_position[_local1] = 0;
_local1++;
};
}
public function read(_arg1:ByteArray):void{
var _local2:uint;
var _local3:int;
_local2 = _arg1.position;
_arg1.position = 0;
version = _arg1.readUnsignedInt();
score = _arg1.readUnsignedInt();
log_count = _arg1.readUnsignedInt();
_local3 = 0;
while (_local3 < LOG_POSITION_MAX) {
log_position[_local3] = _arg1.readUnsignedInt();
_local3++;
};
_arg1.position = _local2;
}
public function write(_arg1:ByteArray):void{
var _local2:uint;
var _local3:int;
_local2 = _arg1.position;
_arg1.position = 0;
_arg1.writeUnsignedInt(VERSION);
_arg1.writeUnsignedInt(score);
_arg1.writeUnsignedInt(log_count);
_local3 = 0;
while (_local3 < LOG_POSITION_MAX) {
_arg1.writeUnsignedInt(uint(log_position[_local3]));
_local3++;
};
_arg1.position = _local2;
}
}
Section 36
//main (main)
package {
import flash.events.*;
import flash.display.*;
public class main extends Sprite {
public function main(){
system.boot(this, 240, 320);
system.register(new resource_manager());
system.register(new score_manager());
system.register(new object_manager());
system.register(new screen_manager());
system.scene.reset(score_manager.SCENE_INITIALIZE);
stage.quality = StageQuality.MEDIUM;
stage.frameRate = 40;
stage.addEventListener(MouseEvent.MOUSE_UP, _onMouseUp);
}
public function _onMouseUp(_arg1:MouseEvent):void{
score_manager.insertCoin();
}
}
}//package
Section 37
//manager (manager)
package {
public class manager {
public function draw():void{
}
public function run():void{
}
public function enterScene():void{
}
public function exitScene():void{
}
}
}//package
Section 38
//object_manager (object_manager)
package {
import cml.*;
import flash.display.*;
public class object_manager extends manager {
public static const NO_HITTEST:uint = 0;
public static const DRAR_PRIOR_MAX:uint = 8;
public static const ID_ITEMCNT:uint = 7;
public static const ID_ENEMY:uint = 3;
public static const ID_BLOCK:uint = 8;
public static const SITE_MAX:uint = 8;
public static const SCREEN_HALF_WIDTH:uint = 128;
public static const SCREEN_HALF_HEIGHT:uint = 168;
public static const TEST_ID_MAX:uint = 10;
public static const ID_PLAYER:uint = 1;
public static const ID_LASER:uint = 5;
public static const ID_SHOT:uint = 2;
public static const ID_BULLET:uint = 4;
public static const ID_ITEM:uint = 6;
public static var icPower:CMLSequence;
public static var lockSite:Array = new Array(SITE_MAX);
public static var icShield:CMLSequence;
public static var ic1up:CMLSequence;
public static var useBlock:Boolean = false;
public static var counterLock:int = 0;
public static var testChain:Array = new Array();
public static var siteNo:uint = 0;
public static var icBomb:CMLSequence;
public static var drawChain:Array = new Array();
public function object_manager(){
var _local1:int;
var _local2:int;
var _local3:Actor;
super();
root_stage.createAsRoot(player);
_local1 = 0;
while (_local1 < TEST_ID_MAX) {
testChain.push(new Actor());
_local1++;
};
_local1 = 0;
while (_local1 < DRAR_PRIOR_MAX) {
drawChain.push(new Actor());
_local1++;
};
_local1 = 0;
_local2 = 0;
while (_local1 < SITE_MAX) {
lockSite[_local1] = new LockSite(_local2);
_local1++;
_local2 = ((_local2 + 5) & (SITE_MAX - 1));
};
EnemyShape.defineWireFrame();
EnemyShape.defineShape();
CMLParser.setUserCommand("bnss", bonus_start);
CMLParser.setUserCommand("bnse", bonus_end);
CMLParser.setUserCommand("msc", msc);
CMLParser.setUserCommand("snd", snd);
CMLParser.setUserCommand("quake", quake);
CMLParser.setUserCommand("boss", boss);
CMLParser.setUserCommand("lmtbrk", lmtbrk);
CMLParser.setUserCommand("exp", exp);
CMLParser.setUserCommand("result", result);
CMLParser.setUserCommand("useblock", useblock);
CMLParser.setUserCommand("b", b);
CMLParser.setUserCommand("bh", bh);
CMLParser.setUserCommand("initp", initp);
CMLParser.setUserCommand("gameover", gameover);
CMLParser.setUserCommand("s", size);
CMLParser.setUserCommand("r", range);
CMLParser.setUserCommand("v", vital);
CMLParser.setUserCommand("fast", fastbreak);
CMLParser.setUserReference("lf", lf);
CMLParser.setUserReference("t.lf", tlf);
}
private function endStage():void{
player.destroy(0);
root_stage.stop();
}
override public function draw():void{
drawAll();
}
protected function hitTest(_arg1:uint, _arg2:uint, _arg3:Function):void{
var _local4:Actor;
var _local5:Actor;
var _local6:Actor;
var _local7:Actor;
var _local8:uint;
var _local9:Actor;
var _local10:Actor;
_local9 = testChain[_arg1];
_local10 = testChain[_arg2];
_local4 = testChain[_arg1].nextTest;
while (_local4 != _local9) {
_local5 = _local4.nextTest;
if (_local4.size > 0){
_local8 = _local4.id;
_local6 = testChain[_arg2].nextTest;
while (_local6 != _local10) {
_local7 = _local6.nextTest;
if (_test(_local4, _local6)){
if (!_arg3(_local4, _local6)){
return;
};
if (_local8 != _local4.id){
break;
};
};
_local6 = _local7;
};
};
_local4 = _local5;
};
}
protected function _lockLaser():void{
var _local1:int;
var _local2:LockSite;
var _local3:Enemy;
if (score_manager.locking){
if (++counterLock == 4){
counterLock = 0;
_local2 = newLockSite();
if (_local2 != null){
_local3 = _lockTest();
if (_local3 != null){
_local2.create(0, 0);
_local2.set(_local3);
_local3.lock(Shot.rayPower());
resource_manager.playSound(6);
score_manager.bonus(10);
};
};
lockSite[siteNo].shoot();
siteNo = ((siteNo + 1) & (SITE_MAX - 1));
};
} else {
counterLock = 0;
};
}
override public function run():void{
switch (system.scene.get()){
case score_manager.SCENE_MAIN:
case score_manager.SCENE_REPLAY:
CMLFiber.run();
_lockLaser();
_bomber();
root_stage.run();
if (score_manager.enterCount() == 0){
_destroyAllBullet();
};
if (!score_manager.isTransparent()){
hitTest(ID_PLAYER, ID_BULLET, _playerDamage);
if (useBlock){
rectTest(ID_PLAYER, ID_BLOCK, _playerHitsBlock);
};
};
hitTest(ID_ENEMY, ID_SHOT, _enemyDamage);
if (score_manager.enterCount() <= 0){
distTest(ID_PLAYER, ID_ITEM, _playerGetItem);
};
distTest(ID_PLAYER, ID_ITEMCNT, _playerItemCenter);
if (useBlock){
rectTest(ID_BLOCK, ID_SHOT, _blockHitsShot);
rectTest(ID_BLOCK, ID_BULLET, _blockHitsBullet);
};
_checkEnemyDestruction();
screen_manager.hidePowerGuage((((player.x > 40)) && ((player.y < -130))));
break;
case score_manager.SCENE_RESULT:
case score_manager.SCENE_GAMEOVER:
case score_manager.SCENE_COMPLETE:
case score_manager.SCENE_NAMEENTRY:
CMLFiber.run();
_lockLaser();
_bomber();
root_stage.run();
hitTest(ID_ENEMY, ID_SHOT, _enemyDamage);
if (useBlock){
rectTest(ID_BLOCK, ID_SHOT, _blockHitsShot);
rectTest(ID_BLOCK, ID_BULLET, _blockHitsBullet);
};
_checkEnemyDestruction();
screen_manager.hidePowerGuage(false);
break;
case score_manager.SCENE_TITLE:
case score_manager.SCENE_HOWTO:
CMLFiber.run();
root_stage.run();
break;
default:
break;
};
}
protected function drawAll():void{
var _local1:int;
var _local2:Actor;
_local1 = (DRAR_PRIOR_MAX - 1);
while (_local1 >= 0) {
_local2 = drawChain[_local1].nextDraw;
while (_local2 != drawChain[_local1]) {
_local2.draw();
_local2 = _local2.nextDraw;
};
_local1--;
};
}
override public function exitScene():void{
switch (system.scene.get()){
case score_manager.SCENE_MAIN:
case score_manager.SCENE_REPLAY:
endStage();
break;
case score_manager.SCENE_GAMEOVER:
case score_manager.SCENE_COMPLETE:
break;
case score_manager.SCENE_TITLE:
break;
case score_manager.SCENE_RESULT:
useBlock = false;
break;
default:
break;
};
}
private function reset():void{
root_stage.destroy(0);
root_stage.createAsRoot(player);
backgr.create(0, 0);
}
protected function _test(_arg1:Actor, _arg2:Actor):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
if (_arg2.size == 0){
return (false);
};
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
_local5 = ((-(_local3) * _arg2.vx) - (_local4 * _arg2.vy));
_local6 = (_arg1.size + _arg2.size);
_local7 = ((_local3 * _local3) + (_local4 * _local4));
if (_local5 < 0){
return ((_local7 <= (_local6 * _local6)));
};
_local8 = ((_arg2.vx * _arg2.vx) + (_arg2.vy * _arg2.vy));
_local5 = (_local5 * _local5);
if (_local5 > _local8){
return (false);
};
_local9 = (_local7 - (_local5 / _local8));
return ((((_local9 >= 0)) && ((_local9 <= (_local6 * _local6)))));
}
override public function enterScene():void{
switch (system.scene.get()){
case score_manager.SCENE_MAIN:
case score_manager.SCENE_REPLAY:
startStage();
break;
case score_manager.SCENE_TITLE:
reset();
break;
case score_manager.SCENE_GAMEOVER:
case score_manager.SCENE_COMPLETE:
break;
default:
break;
};
}
protected function distTest(_arg1:uint, _arg2:uint, _arg3:Function):void{
var _local4:Actor;
var _local5:Actor;
var _local6:Actor;
var _local7:Actor;
var _local8:Actor;
var _local9:Actor;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local8 = testChain[_arg1];
_local9 = testChain[_arg2];
_local4 = testChain[_arg1].nextTest;
while (_local4 != _local8) {
_local5 = _local4.nextTest;
if (_local4.size > 0){
_local6 = testChain[_arg2].nextTest;
while (_local6 != _local9) {
_local7 = _local6.nextTest;
_local10 = (_local4.x - _local6.x);
_local11 = (_local4.y - _local6.y);
_local12 = (_local4.size + _local6.size);
if (((_local10 * _local10) + (_local11 * _local11)) <= (_local12 * _local12)){
_arg3(_local4, _local6);
return;
};
_local6 = _local7;
};
};
_local4 = _local5;
};
}
protected function _checkEnemyDestruction():void{
var _local1:Actor;
var _local2:Actor;
var _local3:Actor;
_local3 = testChain[ID_ENEMY];
_local1 = testChain[ID_ENEMY].nextTest;
while (_local1 != _local3) {
_local2 = _local1.nextTest;
Enemy(_local1).checkDestruction();
_local1 = _local2;
};
}
private function startStage():void{
Enemy.start();
player.create(0, -60);
root_stage.start(resource_manager.getStageCML());
useBlock = false;
counterLock = 0;
siteNo = 0;
}
protected function rectTest(_arg1:uint, _arg2:uint, _arg3:Function):void{
var _local4:Actor;
var _local5:Actor;
var _local6:Actor;
var _local7:Actor;
var _local8:Actor;
var _local9:Actor;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local8 = testChain[_arg1];
_local9 = testChain[_arg2];
_local4 = testChain[_arg1].nextTest;
while (_local4 != _local8) {
_local5 = _local4.nextTest;
_local6 = testChain[_arg2].nextTest;
while (_local6 != _local9) {
_local7 = _local6.nextTest;
_local10 = Math.abs((_local4.x - _local6.x));
_local11 = Math.abs((_local4.y - _local6.y));
_local12 = (_local4.size + _local6.size);
if ((((_local10 <= _local12)) && ((_local11 <= _local12)))){
_arg3(_local4, _local6);
};
_local6 = _local7;
};
_local4 = _local5;
};
}
protected function _lockTest():Enemy{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Actor;
var _local6:Actor;
_local3 = (player.x + player.site_x);
_local4 = (player.y + player.site_y);
_local6 = testChain[ID_ENEMY];
_local5 = testChain[ID_ENEMY].nextTest;
while (_local5 != _local6) {
if (Enemy(_local5).isLockable()){
_local1 = (_local5.x - _local3);
_local2 = (_local5.y - _local4);
if (((_local1 * _local1) + (_local2 * _local2)) <= 400){
return (Enemy(_local5));
};
};
_local5 = _local5.nextTest;
};
return (null);
}
public static function size(_arg1:CMLFiber, _arg2:Array):void{
Actor(_arg1.object).sizing(_arg2[0]);
}
protected static function _blockHitsShot(_arg1:Actor, _arg2:Actor):Boolean{
var _local3:uint;
_local3 = 0;
while (_local3 < 4) {
newParticle(_arg2.x, _arg2.y, 0, (20 + (Math.random() * 20)), (Math.random() * 0x1000), (1 + (Math.random() * 2)));
_local3++;
};
_arg2.destroy(1);
return (false);
}
public static function vital(_arg1:CMLFiber, _arg2:Array):void{
Actor(_arg1.object).vital(_arg2[0]);
}
protected static function _playerHitsBlock(_arg1:Actor, _arg2:Actor):Boolean{
score_manager.miss();
explosion(_arg1.x, _arg1.y);
screen_manager.quake(50);
resource_manager.playSound(1);
_createItemCarier();
score_manager.rebirth();
player.missed();
return (false);
}
public static function newItemCenter(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:uint):ItemCenter{
var _local6:ItemCenter;
_local6 = ItemCenter(freeItemCenter.pop());
if (_local6 == null){
_local6 = new ItemCenter();
};
_local6.create(_arg1, _arg2);
_local6.setVelocity(0, 4);
_local6.setInterpolation(_arg3, _arg4, 0, -0.5, 20);
if (((score_manager.extend) && ((_arg5 == 0)))){
_arg5 = 3;
score_manager.extend = false;
} else {
if (((score_manager.shield) && ((_arg5 == 1)))){
_arg5 = 2;
};
};
_local6.createItem(_arg5);
return (_local6);
}
public static function callbackDefaultCMLLoaded():void{
icPower = resource_manager.getCML("ICPOW");
icBomb = resource_manager.getCML("ICBOM");
icShield = resource_manager.getCML("ICSLD");
ic1up = resource_manager.getCML("IC1UP");
player._initShotCML();
}
public static function newLaserShadow():LaserShadow{
var _local1:LaserShadow;
_local1 = LaserShadow(freeLaserShadow.pop());
if (_local1 == null){
_local1 = new LaserShadow();
};
return (_local1);
}
public static function explosion(_arg1:Number, _arg2:Number, _arg3:uint=6):void{
var _local4:uint;
_local4 = 0;
while (_local4 < 0x1000) {
newParticle(_arg1, _arg2, 0, (60 + (Math.random() * 30)), (_local4 + (Math.random() * 128)), (1 + (Math.random() * 2)));
_local4 = (_local4 + 128);
};
_local4 = 0;
while (_local4 < 12) {
newExplosion(_arg1, _arg2, 32, 0, _arg3);
_local4++;
};
}
public static function exp(_arg1:CMLFiber, _arg2:Array):void{
var _local3:ShapeParticle;
if (_arg2[0] == 1){
_local3 = newShapeParticle(resource_manager.flashLight, 3, 2);
_local3.create(_arg1.object.x, _arg1.object.y);
_local3.setMotion(160, 0, 0, 0, 0, 1, 1.05);
_local3.bld = BlendMode.ADD;
} else {
explosion_medium(((_arg1.object.x + (Math.random() * 64)) - 32), ((_arg1.object.y + (Math.random() * 64)) - 32), 3);
_local3 = newShapeParticle(resource_manager.bossExpLight, 1, 3);
_local3.create(0, 0, _arg1.object, true);
_local3.setMotion(0x0100, 0, 0, (Math.random() * 360), ((Math.random() * 4) - 2), 1, 1);
_local3.bld = BlendMode.NORMAL;
};
}
public static function lmtbrk(_arg1:CMLFiber, _arg2:Array):void{
resource_manager.playSound(8);
score_manager.limitBreak();
}
public static function fastbreak(_arg1:CMLFiber, _arg2:Array):void{
Actor(_arg1.object).fastbreak(_arg2[0]);
}
public static function result(_arg1:CMLFiber, _arg2:Array):void{
system.scene.change(score_manager.SCENE_RESULT);
}
public static function range(_arg1:CMLFiber, _arg2:Array):void{
Actor(_arg1.object).range((_arg2[0] == 0));
}
public static function newExplosionRound(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:Number, _arg5:uint):Explosion{
var _local6:Explosion;
_local6 = Explosion(freeExplosion.pop());
if (_local6 == null){
_local6 = new Explosion();
};
_local6.create(_arg1, _arg2);
_local6.set_round(_arg3, _arg4, _arg5);
return (_local6);
}
public static function bonus_start(_arg1:CMLFiber, _arg2:Array):void{
score_manager.startBonus(_arg2[0]);
}
public static function newExplosion(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:uint):Explosion{
var _local6:Explosion;
_local6 = Explosion(freeExplosion.pop());
if (_local6 == null){
_local6 = new Explosion();
};
_local6.create(_arg1, _arg2);
_local6.set(_arg3, _arg4, _arg5);
return (_local6);
}
protected static function _enemyDamage(_arg1:Actor, _arg2:Actor):Boolean{
var _local3:uint;
_local3 = 0;
while (_local3 < 8) {
newParticle(_arg2.x, _arg2.y, 0, (20 + (Math.random() * 20)), (Math.random() * 0x1000), (1 + (Math.random() * 2)));
_local3++;
};
Enemy(_arg1).damage(Shot(_arg2).attackPoint);
_arg2.destroy(1);
score_manager.bonus(1);
return (true);
}
public static function pushTestChain(_arg1:uint, _arg2:Actor):void{
_arg2.prevTest = testChain[_arg1].prevTest;
_arg2.nextTest = testChain[_arg1];
testChain[_arg1].prevTest.nextTest = _arg2;
testChain[_arg1].prevTest = _arg2;
}
public static function explosion_small(_arg1:Number, _arg2:Number, _arg3:uint=6):void{
var _local4:uint;
_local4 = 0;
while (_local4 < 10) {
newExplosion(_arg1, _arg2, 32, 0, _arg3);
_local4++;
};
}
public static function bh(_arg1:CMLFiber, _arg2:Array):void{
var _local3:uint;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Block;
_local3 = uint(_arg2[0]);
_local4 = ((_arg2.length)<2) ? -115 : (Number(_arg2[1]) - 115);
_local5 = ((_arg2.length)<3) ? 176 : (176 + Number(_arg2[2]));
_local6 = 0;
while (_local3 != 0) {
if ((_local3 & 1)){
_local7 = Block(freeBlock.pop());
if (_local7 == null){
_local7 = new Block();
};
_local7.set(2);
_local7.create(_local4, ((_local5 + _local6) - _arg1.object.y), _arg1.object, true);
};
_local3 = (_local3 >> 1);
_local4 = (_local4 + 23);
_local6 = (16 - _local6);
};
}
public static function b(_arg1:CMLFiber, _arg2:Array):void{
var _local3:uint;
var _local4:Number;
var _local5:Number;
var _local6:Block;
_local3 = uint(_arg2[0]);
_local4 = ((_arg2.length)<2) ? -128 : (Number(_arg2[1]) - 128);
_local5 = ((_arg2.length)<3) ? 176 : (176 + Number(_arg2[2]));
while (_local3 != 0) {
if ((_local3 & 1)){
_local6 = Block(freeBlock.pop());
if (_local6 == null){
_local6 = new Block();
};
_local6.set(1);
_local6.create(_local4, (_local5 - _arg1.object.y), _arg1.object, true);
};
_local3 = (_local3 >> 1);
_local4 = (_local4 + 32);
};
}
public static function useblock(_arg1:CMLFiber, _arg2:Array):void{
useBlock = true;
}
public static function initp(_arg1:CMLFiber, _arg2:Array):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (_arg2.length < 3){
return;
};
Actor(_arg1.object).range(true);
_local3 = (_arg1.object.x - _arg2[0]);
_local4 = (_arg1.object.y - _arg2[1]);
_local5 = ((_arg2[2])==0) ? 1 : (1 / _arg2[2]);
_arg1.object.setPosition(_arg2[0], _arg2[1]);
_arg1.object.setVelocity(((_local3 * _local5) * 2), ((_local4 * _local5) * 2));
_arg1.object.setAccelaration((-(_arg1.object.vx) * _local5), (-(_arg1.object.vy) * _local5), _arg2[2]);
}
protected static function _playerGetItem(_arg1:Actor, _arg2:Actor):Boolean{
var _local3:ShapeParticle;
if (score_manager.powerUp(Item(_arg2).type)){
explosion_particle(_arg1.x, _arg1.y, 1, 64);
_local3 = newShapeParticle(resource_manager.flashLight, 1, 3);
_local3.create(_arg1.x, _arg1.y);
_local3.setMotion(16, 0, 0, 0, 0, 64, 0.9);
_local3.bld = BlendMode.ADD;
resource_manager.playSound(7);
player.refleshShot();
};
if (Item(_arg2).parent_destruction){
_arg2.parent.destroy(1);
} else {
_arg2.destroy(1);
};
return (false);
}
public static function getBossEnemy():Actor{
return (Enemy.stageBoss);
}
protected static function _playerItemCenter(_arg1:Actor, _arg2:Actor):Boolean{
if (ItemCenter(_arg2).playerCentred()){
explosion_particle(_arg1.x, _arg1.y, 1, 64);
if (score_manager.powerUp(6)){
resource_manager.playSound(7);
_arg2.destroy(1);
} else {
resource_manager.playSound(4);
_arg2.destroy(2);
};
player.refleshShot();
};
return (false);
}
public static function explosion_particle(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:uint):void{
var _local5:uint;
_local5 = 0;
while (_local5 < 0x1000) {
newParticle(_arg1, _arg2, _arg3, (60 + (Math.random() * 30)), (_local5 + (Math.random() * 128)), (1 + (Math.random() * 2)));
_local5 = (_local5 + _arg4);
};
}
public static function newParticle(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:Number, _arg5:uint, _arg6:Number):Particle{
var _local7:Particle;
_local7 = Particle(freeParticle.pop());
if (_local7 == null){
_local7 = new Particle();
};
_local7.create(_arg1, _arg2);
_local7.set(_arg3, _arg4, _arg5, _arg6);
return (_local7);
}
public static function boss(_arg1:CMLFiber, _arg2:Array):void{
resource_manager.playSound(8);
score_manager.bossWarning();
}
public static function snd(_arg1:CMLFiber, _arg2:Array):void{
resource_manager.playSound(_arg2[0]);
}
public static function lf(_arg1:CMLFiber):Number{
return (Actor(_arg1.object).life);
}
public static function msc(_arg1:CMLFiber, _arg2:Array):void{
resource_manager.stopBGM();
resource_manager.playBGM();
}
protected static function _playerDamage(_arg1:Actor, _arg2:Actor):Boolean{
if (score_manager.playerDamage()){
explosion(_arg1.x, _arg1.y);
screen_manager.quake(50);
resource_manager.playSound(1);
_createItemCarier();
score_manager.rebirth();
player.missed();
} else {
explosion_particle(_arg1.x, _arg1.y, 1, 64);
resource_manager.playSound(4);
_arg2.destroy(0);
};
return (false);
}
protected static function _blockHitsBullet(_arg1:Actor, _arg2:Actor):Boolean{
_arg2.destroy(0);
return (false);
}
public static function explosion_large(_arg1:Number, _arg2:Number, _arg3:uint=6):void{
var _local4:uint;
var _local5:uint;
var _local6:Number;
var _local7:Number;
_local4 = 0;
while (_local4 < 0x1000) {
newParticle(_arg1, _arg2, 0, (60 + (Math.random() * 30)), (_local4 + (Math.random() * 128)), (1 + (Math.random() * 4)));
_local4 = (_local4 + 64);
};
_local4 = 0;
while (_local4 < 0x1000) {
newExplosionRound(_arg1, _arg2, (_local4 + (Math.random() * 128)), (8 + (Math.random() * 2)), _arg3);
_local4 = (_local4 + 128);
};
_local5 = 0;
while (_local5 < 5) {
_local6 = ((_arg1 + (Math.random() * 64)) - 32);
_local7 = ((_arg2 + (Math.random() * 64)) - 32);
_local4 = 0;
while (_local4 < 8) {
newExplosion(_local6, _local7, 32, (_local5 * 3), _arg3);
_local4++;
};
_local5++;
};
}
public static function popDrawChain(_arg1:Actor):void{
_arg1.nextDraw.prevDraw = _arg1.prevDraw;
_arg1.prevDraw.nextDraw = _arg1.nextDraw;
}
public static function newShapeParticle(_arg1:Shape, _arg2:uint, _arg3:uint=6):ShapeParticle{
var _local4:ShapeParticle;
_local4 = ShapeParticle(freeShapeParticle.pop());
if (_local4 == null){
_local4 = new ShapeParticle();
};
_local4.set(_arg1, _arg2, _arg3);
return (_local4);
}
protected static function _destroyAllBullet():void{
var _local1:Actor;
var _local2:Actor;
var _local3:int;
var _local4:int;
var _local5:Particle;
_local1 = testChain[ID_BULLET].nextTest;
while (_local1 != testChain[ID_BULLET]) {
_local2 = _local1.nextTest;
_local4 = ((_local1.size + 1) >> 1);
_local3 = 0;
while (_local3 < _local4) {
_local5 = newParticle(_local1.x, _local1.y, 0, (40 + (Math.random() * 20)), 0, 0);
_local5.setVelocity(((_local1.vx + (Math.random() * 4)) - 2), ((_local1.vy + (Math.random() * 4)) - 2));
_local5.setAccelaration(0, 0.5);
_local3++;
};
_local1.destroy(0);
_local1 = _local2;
};
}
public static function newLockLaser():LockLaser{
var _local1:LockLaser;
_local1 = LockLaser(freeLockLaser.pop());
if (_local1 == null){
_local1 = new LockLaser();
};
return (_local1);
}
public static function bonus_end(_arg1:CMLFiber, _arg2:Array):void{
score_manager.endBonus(_arg2[0]);
}
public static function newShot(_arg1:uint, _arg2:uint):Shot{
var _local3:Shot;
_local3 = Shot(freeShot.pop());
if (_local3 == null){
_local3 = new Shot();
};
_local3.set(_arg1, score_manager.shotLevel[_arg1], _arg2);
return (_local3);
}
public static function newBullet(_arg1:uint):Bullet{
var _local2:Bullet;
_local2 = Bullet(freeBullet.pop());
if (_local2 == null){
_local2 = new Bullet();
};
_local2.set(_arg1);
return (_local2);
}
public static function gameover(_arg1:CMLFiber, _arg2:Array):void{
system.scene.change(score_manager.SCENE_GAMEOVER);
}
public static function newEnemy(_arg1:uint, _arg2:uint, _arg3:uint=0, _arg4:uint=0, _arg5:uint=0):Enemy{
var _local6:Enemy;
_local6 = Enemy(freeEnemy.pop());
if (_local6 == null){
_local6 = new Enemy();
};
_local6.set(_arg1, _arg2, _arg3, (_arg4 + 5), _arg5);
return (_local6);
}
public static function bomber():void{
var _local1:ShapeParticle;
if (score_manager.bomber()){
_local1 = newShapeParticle(resource_manager.flashLight, 4, 1);
_local1.create(player.x, player.y);
_local1.setMotion(40, 0, 0, 0, 0, 64, 1.2);
_local1.bld = BlendMode.ADD;
score_manager.locking = false;
player.refleshShot();
resource_manager.playSound(9);
};
}
public static function newLockSite():LockSite{
var _local1:int;
var _local2:LockSite;
_local1 = 0;
while (_local1 < SITE_MAX) {
_local2 = lockSite[((siteNo + _local1) & (SITE_MAX - 1))];
if (!_local2.isActive()){
return (_local2);
};
_local1++;
};
return (null);
}
public static function newItem(_arg1:uint):Item{
var _local2:Item;
_local2 = Item(freeItem.pop());
if (_local2 == null){
_local2 = new Item();
};
_local2.type = _arg1;
return (_local2);
}
public static function quake(_arg1:CMLFiber, _arg2:Array):void{
screen_manager.quake(_arg2[0]);
}
public static function explosion_medium(_arg1:Number, _arg2:Number, _arg3:uint=6):void{
var _local4:uint;
var _local5:uint;
var _local6:Number;
var _local7:Number;
_local4 = 0;
while (_local4 < 0x1000) {
newParticle(_arg1, _arg2, 0, (60 + (Math.random() * 30)), (_local4 + (Math.random() * 128)), (1 + (Math.random() * 4)));
_local4 = (_local4 + 64);
};
_local4 = 0;
while (_local4 < 0x1000) {
newExplosionRound(_arg1, _arg2, (_local4 + (Math.random() * 128)), (6 + Math.random()), _arg3);
_local4 = (_local4 + 0x0100);
};
_local5 = 0;
while (_local5 < 3) {
_local6 = ((_arg1 + (Math.random() * 64)) - 32);
_local7 = ((_arg2 + (Math.random() * 64)) - 32);
_local4 = 0;
while (_local4 < 8) {
newExplosion(_local6, _local7, 32, (_local5 * 3), _arg3);
_local4++;
};
_local5++;
};
}
public static function pushDrawChain(_arg1:uint, _arg2:Actor):void{
_arg2.prevDraw = drawChain[_arg1].prevDraw;
_arg2.nextDraw = drawChain[_arg1];
drawChain[_arg1].prevDraw.nextDraw = _arg2;
drawChain[_arg1].prevDraw = _arg2;
}
public static function tlf(_arg1:CMLFiber):Number{
return (Actor(_arg1.target).life);
}
public static function getDestructionRatio():Number{
return (Enemy.getDestructionRatio());
}
protected static function _createItemCarier():void{
var _local1:Enemy;
_local1 = newEnemy(ITEM, 1);
_local1.create(0, 160);
CMLFiber.create(_local1, icShield);
switch (((score_manager.getPower() + 1) >> 1)){
case 5:
case 4:
case 3:
object_manager.newItemCenter(player.x, (player.y + 32), 0, 80, 0);
case 2:
object_manager.newItemCenter(player.x, (player.y + 32), 80, 40, 0);
case 1:
object_manager.newItemCenter(player.x, (player.y + 32), -80, 40, 0);
default:
break;
};
}
protected static function _bomber():void{
var _local1:int;
var _local2:Number;
var _local3:int;
_local1 = score_manager.bomberCount();
if ((((_local1 < 0)) || ((_local1 > 32)))){
return;
};
if ((_local1 & 1) == 0){
_local2 = (160 - (_local1 * 10));
_local3 = 0;
while (_local3 < 6) {
explosion_small(((_local3 * 40) - 100), _local2, 6);
_local3++;
};
_bomberDamage(_local2);
};
if ((_local1 & 7) == 0){
_destroyAllBullet();
};
}
private static function _bomberDamage(_arg1:Number):Boolean{
var _local2:Actor;
var _local3:Actor;
_local3 = testChain[ID_ENEMY];
_local2 = testChain[ID_ENEMY].nextTest;
while (_local2 != _local3) {
if ((((_local2.y > (_arg1 - 20))) && ((_local2.y <= (_arg1 + 20))))){
Enemy(_local2).damage(5);
};
_local2 = _local2.nextTest;
};
return (true);
}
public static function popTestChain(_arg1:Actor):void{
_arg1.nextTest.prevTest = _arg1.prevTest;
_arg1.prevTest.nextTest = _arg1.nextTest;
}
}
}//package
import cml.*;
import flash.display.*;
import flash.geom.*;
import util.*;
private var freeExplosion:CMLList = new CMLList();
private var backgr:BackGround = new BackGround();
private const BLARGE:uint = 6;
private const BMEDIUM:uint = 5;
private var freeShapeParticle:CMLList = new CMLList();
class LockLaser extends Actor {
private var target_id:uint;// = 0
private var target:Enemy;// = null
public var ivx:Number;
public var ivy:Number;
private function LockLaser(){
target = null;
target_id = 0;
super();
freeList = freeLockLaser;
drawPrior = 2;
testID = object_manager.ID_LASER;
}
override public function exit(_arg1:Number):void{
if (_arg1 == 1){
object_manager.explosion_particle(x, y, 0, 0x0100);
};
super.exit(_arg1);
}
public function set(_arg1:Enemy, _arg2:Number, _arg3:Number):void{
target = _arg1;
target_id = target.id;
ivx = _arg2;
ivy = _arg3;
}
override public function run():void{
var _local1:LaserShadow;
if (target == null){
vy = (vy + 2);
if (isEscaped()){
destroy(0);
return;
};
} else {
life = (life - 0.0625);
if (life < 0){
target.damage(Shot.rayPower());
target.unlock(Shot.rayPower());
destroy(1);
return;
};
if (target_id != target.id){
target = null;
} else {
setVelocity((((target.x - x) * (1 - life)) + (ivx * life)), (((target.y - y) * (1 - life)) + (ivy * life)));
};
};
move();
_local1 = object_manager.newLaserShadow();
_local1.create(x, y);
_local1.setVelocity(-(vx), -(vy));
}
}
class Block extends Actor {
private var chip:sprite_information;// = null
private var flagAnimation:Boolean;// = false
private var animCounter:uint;// = 0
private static var chipInfo:Array = new Array(null, new sprite_information(0, 224, 32, 32, 0, 0), new sprite_information(32, 224, 32, 32, 0, 0));
private static var sizeInfo:Array = new Array(0, 14, 12);
private function Block(){
animCounter = 0;
flagAnimation = false;
chip = null;
super();
freeList = freeBlock;
testID = object_manager.ID_BLOCK;
drawPrior = 3;
}
override public function newObject(_arg1:CMLSequence):CMLObject{
return (object_manager.newEnemy(_arg1.arg(0), _arg1.arg(1), _arg1.arg(2), _arg1.arg(3), CMLState.invert_flag));
}
override public function fireObject(_arg1:CMLSequence):CMLObject{
return (object_manager.newBullet(_arg1.arg(0)));
}
override public function draw():void{
if (chip != null){
resource_manager.drawChip(x, y, animCounter, chip);
};
}
public function set(_arg1:uint):Block{
chip = chipInfo[_arg1];
size = sizeInfo[_arg1];
return (this);
}
override public function run():void{
move();
if (flagAnimation){
if (++animCounter == chip.animMax){
animCounter = 0;
};
};
if (y < -240){
destroy(0);
};
}
}
private var freeEnemy:CMLList = new CMLList();
private var freeBullet:CMLList = new CMLList();
class Particle extends Actor {
public var grad:Gradation;// = null
public var aging:Number;// = 0.04
private function Particle(){
aging = 0.04;
grad = null;
super();
freeList = freeParticle;
drawPrior = 6;
}
override public function draw():void{
system.screen.fillRect(((120 + x) - 1), ((160 - y) + 1), 2, 2, grad.getColor((1 - life)));
}
public function set(_arg1:uint, _arg2:Number, _arg3:uint, _arg4:Number):void{
grad = resource_manager.grad[_arg1];
aging = (1 / _arg2);
setVelocity((sin[(_arg3 + 0x0400)] * _arg4), (sin[_arg3] * _arg4));
setAccelaration((-(vx) / (_arg2 + 10)), ((-(vy) / (_arg2 + 10)) - 0.1), _arg2);
}
override public function run():void{
move();
life = (life - aging);
if (((isEscaped()) || ((life <= 0)))){
destroy(0);
};
}
}
private var freeItemCenter:CMLList = new CMLList();
private var player:Player = new Player();
private const SMALL:uint = 1;
class Explosion extends Actor {
private var animCounter:int;// = 0
private static var chipInfo:sprite_information = new sprite_information(0x0100, 96, 32, 32, 16, 1);
private function Explosion(){
animCounter = 0;
super();
freeList = freeExplosion;
}
override public function draw():void{
if (animCounter >= 0){
resource_manager.drawChip(x, y, animCounter, chipInfo);
};
}
public function set(_arg1:int, _arg2:int, _arg3:uint):void{
drawPrior = _arg3;
vx = (Math.random() - 0.5);
vy = (Math.random() - 0.5);
x = (x + ((Math.random() - 0.5) * _arg1));
y = (y + ((Math.random() - 0.5) * _arg1));
animCounter = (-(_arg2) - (Math.random() * 16));
}
public function set_round(_arg1:uint, _arg2:Number, _arg3:uint):void{
drawPrior = _arg3;
animCounter = (-(Math.random()) * 4);
vx = (sin[(_arg1 + 0x0400)] * _arg2);
vy = (sin[_arg1] * _arg2);
setAccelaration((-(vx) / (chipInfo.animMax + 4)), ((-(vy) / (chipInfo.animMax + 4)) - 0.1));
}
override public function run():void{
if (++animCounter == chipInfo.animMax){
destroy(0);
};
if (animCounter >= 0){
move();
};
}
}
class Player extends Actor {
private var shot:Array;
private var shotFiber:CMLFiber;
private var muzzleFlash:Boolean;
private var iy:int;
private var ix:int;
private var prevFlag:uint;
private var speed:Number;
private var side:Array;
public var site_x:Number;
public var site_y:Number;
private var animCounter:uint;// = 0
private var sideFiber:CMLFiber;
private var site_angle:Number;
private static var chipSiteAc:sprite_information = new sprite_information(192, 0, 32, 32, 0, 0);
private static var chipSiteIn:sprite_information = new sprite_information(200, 8, 16, 16, 0, 0);
private static var chipInfo:Array = new Array(new sprite_information(0, 0, 32, 32, 0, 0), new sprite_information(0, 32, 32, 32, 0, 0), new sprite_information(96, 0, 32, 32, 0, 0));
private static var chipMuzzle:sprite_information = new sprite_information(384, 0, 9, 12, 0, 0);
private function Player(){
animCounter = 0;
shot = new Array();
side = new Array();
super();
testID = object_manager.ID_PLAYER;
drawPrior = 4;
size = 3;
}
override public function fireObject(_arg1:CMLSequence):CMLObject{
var _local2:uint;
_local2 = _arg1.arg(0);
if (_local2 == 0){
muzzleFlash = true;
};
return (object_manager.newShot(_local2, CMLState.invert_flag));
}
override public function exit(_arg1:Number):void{
object_manager.popDrawChain(this);
object_manager.popTestChain(this);
}
public function refleshShot():void{
prevFlag = 4;
}
override public function draw():void{
var _local1:uint;
var _local2:int;
_local1 = score_manager.shield;
_local2 = score_manager.enterCount();
if (_local2 < 0){
if (muzzleFlash){
resource_manager.drawChip((x - 7), (y + 16), 0, chipMuzzle);
resource_manager.drawChip((x + 6), (y + 16), 0, chipMuzzle);
muzzleFlash = false;
};
if (((score_manager.isTransparent()) && (((animCounter & 2) == 0)))){
_local1 = 2;
};
resource_manager.drawChip(x, y, (ix + 1), chipInfo[_local1]);
if (score_manager.locking){
resource_manager.drawChip((x + site_x), (y + site_y), 0, chipSiteAc);
} else {
resource_manager.drawChip((x + site_x), (y + site_y), 0, chipSiteIn);
};
} else {
resource_manager.drawChip((x - _local2), (y - ((_local2 * _local2) * 0.2)), 0, chipInfo[1]);
};
}
override public function run():void{
var _local1:uint;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:Number;
animCounter++;
_local1 = score_manager.log.input();
ix = (((_local1 & 8) >> 3) - ((_local1 & 4) >> 2));
iy = ((_local1 & 1) - ((_local1 & 2) >> 1));
_local2 = (ix * ((iy)==0) ? 1 : 0.707);
_local3 = (iy * ((ix)==0) ? 1 : 0.707);
_local4 = ((_local1 >> 4) & 3);
_local5 = (speed * ((_local4 & 1)) ? 0.75 : 1);
if (score_manager.enterCount() >= 0){
_local4 = 0;
_local2 = 0;
_local3 = 0;
} else {
if ((((score_manager.bomberCount() < 0)) && ((_local1 & 64)))){
object_manager.bomber();
};
};
if (_local4 != prevFlag){
if (shotFiber != null){
shotFiber.destroy();
shotFiber = null;
};
if (sideFiber != null){
sideFiber.destroy();
sideFiber = null;
};
switch (_local4){
case 1:
score_manager.locking = true;
break;
case 2:
score_manager.locking = false;
shotFiber = CMLFiber.create(this, shot[score_manager.shotLevel[Shot.FRONT]]);
sideFiber = CMLFiber.create(this, side[score_manager.shotLevel[Shot.SIDE]]);
break;
case 3:
score_manager.locking = true;
shotFiber = CMLFiber.create(this, shot[score_manager.shotLevel[Shot.FRONT]]);
break;
default:
score_manager.locking = false;
break;
};
};
prevFlag = _local4;
vx = (_local2 * _local5);
vy = (_local3 * _local5);
move();
if (x < -110){
x = -110;
} else {
if (x > 110){
x = 110;
};
};
if (y < -150){
y = -150;
} else {
if (y > 100){
y = 100;
};
};
runAllChildren();
}
public function missed():void{
site_angle = 0;
site_x = 0;
site_y = 120;
}
override public function enter():void{
super.enter();
speed = 6.5;
setHeadAngle(180);
site_angle = 0;
site_x = 0;
site_y = 120;
muzzleFlash = false;
shotFiber = null;
sideFiber = null;
}
private function _initShotCML():void{
shot.push(resource_manager.getCML("SHOT0"));
shot.push(resource_manager.getCML("SHOT1"));
shot.push(resource_manager.getCML("SHOT2"));
shot.push(resource_manager.getCML("SHOT3"));
side.push(resource_manager.getCML("SIDE0"));
side.push(resource_manager.getCML("SIDE1"));
side.push(resource_manager.getCML("SIDE2"));
side.push(resource_manager.getCML("SIDE3"));
}
}
private const ITEM:uint = 8;
class EnemyShape {
public var shape:Shape;
public var coreType:uint;
public var shapeType:uint;
public static const HEAD:uint = 1;
public static const FRONT:uint = 4;
public static const BACK:uint = 3;
public static const TAIL:uint = 2;
public static const SIDE:uint = 5;
public static const CHILD:uint = 6;
public static const CORE:uint = 0;
public static var partsWireFrame:Array;
public static var data:Array;
public static var chipCore:Array;
private static var mag:Number;
private function EnemyShape(_arg1:uint, _arg2:uint, _arg3:Number){
shape = new Shape();
shape.graphics.lineStyle(1, 15777984);
shape.graphics.beginFill(8413280);
coreType = _arg1;
shapeType = _arg2;
data[coreType][shapeType] = this;
mag = _arg3;
}
public function parts(_arg1:uint, _arg2:uint):EnemyShape{
partsWireFrame[_arg1][_arg2].draw(shape.graphics, mag);
return (this);
}
public function draw(_arg1:Matrix, _arg2:ColorTransform):void{
system.screen.draw(shape, _arg1, _arg2);
if (chipCore[coreType] != null){
resource_manager.drawChip((_arg1.tx - 120), (160 - _arg1.ty), 0, chipCore[coreType]);
};
}
public static function defineShape():void{
var _local1:int;
chipCore = new Array(10);
chipCore[NO_CORE] = null;
chipCore[SMALL] = new sprite_information(0x0100, 0, 10, 10, 0, 0);
chipCore[MEDIUM] = new sprite_information(272, 0, 16, 16, 0, 0);
chipCore[LARGE] = new sprite_information(288, 0, 24, 24, 0, 0);
chipCore[BSMALL] = new sprite_information(320, 0, 10, 10, 0, 0);
chipCore[BMEDIUM] = new sprite_information(336, 0, 16, 16, 0, 0);
chipCore[BLARGE] = new sprite_information(352, 0, 24, 24, 0, 0);
chipCore[BOSS] = new sprite_information(288, 0, 24, 24, 0, 0);
chipCore[ITEM] = new sprite_information(0x0100, 0, 10, 10, 0, 0);
data = new Array(10);
_local1 = 0;
while (_local1 < 10) {
data[_local1] = new Array();
_local1++;
};
new EnemyShape(NO_CORE, 0, 1);
new EnemyShape(NO_CORE, 1, 1.8).parts(CHILD, 0);
new EnemyShape(NO_CORE, 2, 1.4).parts(CHILD, 2);
new EnemyShape(NO_CORE, 3, 1.2).parts(CHILD, 3);
new EnemyShape(NO_CORE, 4, 1.3).parts(CHILD, 4);
new EnemyShape(NO_CORE, 5, 1.8).parts(CHILD, 4);
new EnemyShape(NO_CORE, 6, 1.4).parts(CHILD, 3);
new EnemyShape(NO_CORE, 7, 1.2).parts(CHILD, 1);
new EnemyShape(NO_CORE, 8, 1.6).parts(CHILD, 5);
new EnemyShape(NO_CORE, 9, 1).parts(HEAD, 2);
new EnemyShape(NO_CORE, 10, 2).parts(CHILD, 6);
new EnemyShape(NO_CORE, 11, 2).parts(CHILD, 7);
new EnemyShape(NO_CORE, 12, 1).parts(CHILD, 8);
new EnemyShape(NO_CORE, 13, 2).parts(CHILD, 3);
new EnemyShape(SMALL, 0, 1).parts(CORE, 0).parts(HEAD, 1);
new EnemyShape(SMALL, 1, 1).parts(CORE, 0).parts(BACK, 0);
new EnemyShape(SMALL, 2, 0.8).parts(CORE, 2);
new EnemyShape(MEDIUM, 0, 1.2).parts(CORE, 1);
new EnemyShape(MEDIUM, 1, 1.4).parts(HEAD, 0).parts(TAIL, 0).parts(SIDE, 0);
new EnemyShape(MEDIUM, 2, 1.3).parts(CORE, 0).parts(HEAD, 4).parts(TAIL, 0);
new EnemyShape(MEDIUM, 3, 1.6).parts(CORE, 0).parts(HEAD, 0).parts(TAIL, 0);
new EnemyShape(MEDIUM, 4, 1.3).parts(CORE, 0);
new EnemyShape(MEDIUM, 5, 1.2).parts(CORE, 0).parts(HEAD, 1).parts(TAIL, 0);
new EnemyShape(MEDIUM, 6, 1.2).parts(CORE, 1).parts(HEAD, 1).parts(TAIL, 0);
new EnemyShape(LARGE, 0, 2).parts(CORE, 0).parts(HEAD, 4).parts(TAIL, 0).parts(BACK, 0);
new EnemyShape(BOSS, 0, 1.6).parts(CORE, 2);
new EnemyShape(BOSS, 1, 2).parts(CORE, 0).parts(HEAD, 4).parts(TAIL, 0).parts(BACK, 1);
new EnemyShape(BOSS, 2, 1.8).parts(CORE, 0).parts(HEAD, 4).parts(TAIL, 2);
new EnemyShape(BOSS, 3, 1.4).parts(CORE, 0).parts(HEAD, 1).parts(TAIL, 0);
new EnemyShape(BOSS, 4, 1.6).parts(CORE, 0).parts(HEAD, 4).parts(BACK, 1).parts(TAIL, 2);
new EnemyShape(BOSS, 5, 2).parts(HEAD, 1).parts(TAIL, 1).parts(SIDE, 1);
new EnemyShape(ITEM, 0, 0.7).parts(CORE, 2);
new EnemyShape(ITEM, 1, 0.7).parts(CORE, 2);
new EnemyShape(ITEM, 2, 0.7).parts(CORE, 2);
new EnemyShape(ITEM, 3, 0.7).parts(CORE, 2);
}
public static function defineWireFrame():void{
var _local1:int;
partsWireFrame = new Array(8);
_local1 = 0;
while (_local1 < 8) {
partsWireFrame[_local1] = new Array(16);
_local1++;
};
partsWireFrame[CORE][0] = new WireFrame();
partsWireFrame[CORE][0].newLine(0, 0).to(4, -4).to(4, -10).to(10, -4).to(10, 4).to(8, 6).to(8, 10).to(6, 12).to(6, 6).to(0, 0);
partsWireFrame[CORE][0].copyLine(true, false);
partsWireFrame[CORE][1] = new WireFrame();
partsWireFrame[CORE][1].newLine(0, 0).to(4, -4).to(4, -10).to(20, -4).to(16, 4).to(8, 6).to(8, 10).to(6, 12).to(6, 6).to(0, 0);
partsWireFrame[CORE][1].copyLine(true, false);
partsWireFrame[CORE][2] = new WireFrame();
partsWireFrame[CORE][2].newLine(4, 4).to(4, 14).to(8, 14).to(14, 8).to(14, 4).to(6, 4).to(4, 6);
partsWireFrame[CORE][2].copyLine(true, false);
partsWireFrame[CORE][2].copyLine(false, true);
partsWireFrame[CORE][2].copyLine(true, false);
partsWireFrame[HEAD][0] = new WireFrame();
partsWireFrame[HEAD][0].newLine(0, 2).to(4, 6).to(2, 12).to(-2, 12).to(-4, 6).to(0, 2);
partsWireFrame[HEAD][1] = new WireFrame();
partsWireFrame[HEAD][1].newLine(0, 2).to(4, 6).to(2, 16).to(-2, 16).to(-4, 6).to(0, 2);
partsWireFrame[HEAD][2] = new WireFrame();
partsWireFrame[HEAD][2].newLine(0, 2).to(4, 6).to(2, 20).to(-2, 20).to(-4, 6).to(0, 2);
partsWireFrame[HEAD][3] = new WireFrame();
partsWireFrame[HEAD][3].newLine(0, 2).to(4, 6).to(2, 24).to(-2, 24).to(-4, 6).to(0, 2);
partsWireFrame[HEAD][4] = new WireFrame();
partsWireFrame[HEAD][4].newLine(5, 14).to(3, 16).to(3, 4.5).to(5, 6.5).to(5, 14);
partsWireFrame[HEAD][4].copyLine(true, false);
partsWireFrame[HEAD][5] = new WireFrame();
partsWireFrame[HEAD][5].newLine(5, 16).to(2, 22).to(2, 3.5).to(5, 6.5).to(5, 16);
partsWireFrame[HEAD][5].copyLine(true, false);
partsWireFrame[HEAD][6] = new WireFrame();
partsWireFrame[HEAD][6].newLine(5, 16).to(3, 20).to(3, 27).to(0.5, 32).to(0.5, 1.5).to(5, 6).to(5, 14);
partsWireFrame[HEAD][6].copyLine(true, false);
partsWireFrame[TAIL][0] = new WireFrame();
partsWireFrame[TAIL][0].newLine(0, -2).to(4, -6).to(2, -12).to(-2, -12).to(-4, -6).to(0, -2);
partsWireFrame[TAIL][1] = new WireFrame();
partsWireFrame[TAIL][1].newLine(0, -2).to(4, -6).to(2, -16).to(-2, -16).to(-4, -6).to(0, -2);
partsWireFrame[TAIL][2] = new WireFrame();
partsWireFrame[TAIL][2].newLine(0, -2).to(4, -6).to(2, -20).to(-2, -20).to(-4, -6).to(0, -2);
partsWireFrame[TAIL][3] = new WireFrame();
partsWireFrame[TAIL][3].newLine(0, -2).to(4, -6).to(2, -24).to(-2, -24).to(-4, -6).to(0, -2);
partsWireFrame[TAIL][4] = new WireFrame();
partsWireFrame[TAIL][4].newLine(5, -14).to(3, -16).to(3, -4.5).to(5, -6.5).to(5, -14);
partsWireFrame[TAIL][4].copyLine(true, false);
partsWireFrame[BACK][0] = new WireFrame();
partsWireFrame[BACK][0].newLine(4.5, -10.5).to(10.5, -4.5).to(12, -8).to(8, -12).to(4.5, -10.5);
partsWireFrame[BACK][0].copyLine(true, false);
partsWireFrame[BACK][1] = new WireFrame();
partsWireFrame[BACK][1].newLine(9, -6).to(14, -2).to(16, -4).to(16, -10).to(12, -15).to(12, -17).to(9, -20).to(9, -6);
partsWireFrame[BACK][1].copyLine(true, false);
partsWireFrame[FRONT][1] = new WireFrame();
partsWireFrame[FRONT][1].newLine(9, 6).to(14, 2).to(16, 4).to(16, 10).to(12, 15).to(12, 17).to(9, 20).to(9, 6);
partsWireFrame[FRONT][1].copyLine(true, false);
partsWireFrame[FRONT][2] = new WireFrame();
partsWireFrame[FRONT][2].newLine(9, 6).to(14, 2).to(16, 4).to(16, 10).to(12, 15).to(12, 17).to(9, 20).to(9, 6);
partsWireFrame[FRONT][2].copyLine(true, false);
partsWireFrame[FRONT][3] = new WireFrame();
partsWireFrame[FRONT][3].newLine(9, 6).to(20, -4).to(20, 0).to(16, 10).to(12, 15).to(12, 17).to(9, 20).to(9, 6);
partsWireFrame[FRONT][3].copyLine(true, false);
partsWireFrame[SIDE][0] = new WireFrame();
partsWireFrame[SIDE][0].newLine(-2, 0).to(-6, 4).to(-12, 2).to(-12, -2).to(-6, -4).to(-2, 0);
partsWireFrame[SIDE][0].copyLine(true, false);
partsWireFrame[SIDE][1] = new WireFrame();
partsWireFrame[SIDE][1].newLine(-2, 0).to(-6, 4).to(-16, 2).to(-16, -2).to(-6, -4).to(-2, 0);
partsWireFrame[SIDE][1].copyLine(true, false);
partsWireFrame[SIDE][2] = new WireFrame();
partsWireFrame[SIDE][2].newLine(-2, 0).to(-6, 4).to(-20, 2).to(-20, -2).to(-6, -4).to(-2, 0);
partsWireFrame[SIDE][2].copyLine(true, false);
partsWireFrame[SIDE][3] = new WireFrame();
partsWireFrame[SIDE][3].newLine(-2, 0).to(-6, 4).to(-24, 2).to(-24, -2).to(-6, -4).to(-2, 0);
partsWireFrame[SIDE][3].copyLine(true, false);
partsWireFrame[CHILD][0] = new WireFrame();
partsWireFrame[CHILD][0].newLine(0, -4).to(4, 0).to(2, 24).to(0, 24).to(0, -4);
partsWireFrame[CHILD][1] = new WireFrame();
partsWireFrame[CHILD][1].newLine(0, 0).to(4, -4).to(4, -10).to(20, -4).to(16, 4).to(8, 6).to(8, 10).to(6, 12).to(6, 6).to(0, 0);
partsWireFrame[CHILD][2] = new WireFrame();
partsWireFrame[CHILD][2].newLine(4, 4).to(4, 14).to(8, 14).to(14, 8).to(14, 4).to(6, 4).to(4, 6);
partsWireFrame[CHILD][3] = new WireFrame();
partsWireFrame[CHILD][3].newLine(9, 4).to(14, 0).to(16, 2).to(16, 8).to(12, 13).to(12, 15).to(9, 18).to(9, 4);
partsWireFrame[CHILD][3].newLine(9, -4).to(14, 0).to(16, -2).to(16, -8).to(12, -13).to(12, -15).to(9, -18).to(9, -4);
partsWireFrame[CHILD][4] = new WireFrame();
partsWireFrame[CHILD][4].newLine(9, 6).to(14, 2).to(16, 4).to(16, 10).to(12, 15).to(12, 17).to(9, 20).to(9, 6);
partsWireFrame[CHILD][5] = new WireFrame();
partsWireFrame[CHILD][5].newLine(0, 0).to(4, -4).to(4, -10).to(20, -4).to(16, 4).to(8, 6).to(8, 10).to(6, 12).to(6, 6).to(0, 0);
partsWireFrame[CHILD][5].newLine(21, -4).to(17, 4).to(32, 2).to(36, -2).to(21, -4);
partsWireFrame[CHILD][6] = new WireFrame();
partsWireFrame[CHILD][6].newLine(0.5, -4).to(4.5, 0).to(2.5, 36).to(0.5, 36).to(0.5, -4);
partsWireFrame[CHILD][6].copyLine(true, false);
partsWireFrame[CHILD][7] = new WireFrame();
partsWireFrame[CHILD][7].newLine(0, -4).to(2, -2).to(0, 20).to(-2, -2).to(0, -4);
partsWireFrame[CHILD][8] = new WireFrame();
partsWireFrame[CHILD][8].newLine(-16, 0).to(-6, -16).to(5, -16).to(15, 0).to(5, 16).to(-6, 16).to(-16, 0);
}
}
class Shot extends Actor {
public var type:uint;// = 0
public var level:uint;// = 0
public var invt:uint;// = 0
public static const SIDE:uint = 1;
public static const FRONT:uint = 0;
public static const RAY:uint = 2;
public static var power:Array = new Array(new Array(0.8, 1, 1.2, 1.4), new Array(0.8, 1, 1.1, 1.2), new Array(4, 4.6, 5.2, 6));
private static var chipInfo:Array = new Array(new sprite_information(0x0100, 32, 4, 16, 1, 0), new sprite_information(264, 32, 8, 16, 1, 0), new sprite_information(280, 32, 8, 21, 1, 0), new sprite_information(296, 32, 10, 21, 1, 0));
private function Shot(){
type = 0;
level = 0;
invt = 0;
super();
freeList = freeShot;
testID = object_manager.ID_SHOT;
drawPrior = 5;
size = 5;
}
public function get attackPoint():Number{
return (power[type][level]);
}
override public function draw():void{
if (type == FRONT){
resource_manager.drawChip(x, y, invt, chipInfo[level]);
} else {
resource_manager.drawChip(x, y, invt, chipInfo[0]);
};
}
public function set(_arg1:uint, _arg2:uint, _arg3:uint):void{
type = _arg1;
invt = _arg3;
level = _arg2;
}
override public function run():void{
move();
if (isEscaped()){
destroy(0);
};
}
public static function rayPower():Number{
return (power[RAY][score_manager.shotLevel[RAY]]);
}
}
private const LARGE:uint = 3;
class RootStage extends CMLObject {
private var stage_fiber:CMLFiber;
private function RootStage(){
}
public function stop():void{
stage_fiber.destroy();
stage_fiber = null;
}
override public function run():void{
runAllChildren();
}
override public function newObject(_arg1:CMLSequence):CMLObject{
return (object_manager.newEnemy(_arg1.arg(0), _arg1.arg(1), _arg1.arg(2), _arg1.arg(3), CMLState.invert_flag));
}
override public function fireObject(_arg1:CMLSequence):CMLObject{
return (object_manager.newBullet(_arg1.arg(0)));
}
override public function exit(_arg1:Number):void{
}
override public function enter():void{
}
public function start(_arg1:CMLSequence):void{
stage_fiber = CMLFiber.create(this, _arg1);
}
}
private var freeParticle:CMLList = new CMLList();
class Bullet extends Actor {
private var chip:sprite_information;// = null
private var flagAnimation:Boolean;// = false
private var animCounter:uint;// = 0
private static var chipInfo:Array = new Array(new sprite_information(0, 80, 8, 8, 16, 2), new sprite_information(128, 64, 16, 16, 16, 2), new sprite_information(128, 32, 32, 32, 8, 1), new sprite_information(128, 32, 32, 32, 16, 2), new sprite_information(0, 160, 16, 16, 0, 0), new sprite_information(0, 96, 16, 16, 0, 0), new sprite_information(0, 64, 12, 12, 16, 2), new sprite_information(0, 136, 16, 16, 0, 0));
private static var bulSize:Array = new Array(2, 5, 10, 12, -2, -2, 3, -7);
private function Bullet(){
animCounter = 0;
flagAnimation = false;
chip = null;
super();
freeList = freeBullet;
testID = object_manager.ID_BULLET;
drawPrior = 1;
size = 2;
}
override public function fireObject(_arg1:CMLSequence):CMLObject{
return (object_manager.newBullet(_arg1.arg(0)));
}
override public function draw():void{
resource_manager.drawChip(x, y, animCounter, chip);
}
public function set(_arg1:uint):void{
chip = chipInfo[_arg1];
size = bulSize[_arg1];
}
override public function run():void{
move();
if (flagAnimation){
if (++animCounter == chip.animMax){
animCounter = 0;
};
};
if (isEscaped()){
destroy(0);
};
}
override public function enter():void{
var _local1:ShapeParticle;
if (size > 0){
animCounter = 0;
flagAnimation = true;
} else {
size = -(size);
animCounter = (uint(((head / 5.625) + 65536.5)) & 31);
flagAnimation = false;
};
super.enter();
if (size == 12){
_local1 = object_manager.newShapeParticle(resource_manager.flashLight, 4, 0);
_local1.create(x, y);
_local1.setMotion(16, 0, 0, 0, 0, 64, 0.9);
_local1.bld = BlendMode.ADD;
};
}
}
class ShapeParticle extends Actor {
public var scl:Number;// = 1
public var grad:Gradation;// = null
public var mat:Matrix;
public var bld:String;// = "add"
public var col:ColorTransform;
public var mag:Number;// = 1
public var shape:Shape;// = null
public var rot:Number;// = 0
public var aging:Number;// = 0.04
private function ShapeParticle(){
aging = 0.04;
grad = null;
shape = null;
mat = new Matrix();
col = new ColorTransform();
rot = 0;
scl = 1;
mag = 1;
bld = BlendMode.ADD;
super();
freeList = freeShapeParticle;
drawPrior = 6;
}
override public function draw():void{
system.screen.draw(shape, mat, col, bld);
}
public function set(_arg1:Shape, _arg2:uint, _arg3:uint):ShapeParticle{
shape = _arg1;
grad = resource_manager.grad[_arg2];
drawPrior = _arg3;
return (this);
}
override public function run():void{
move();
life = (life - aging);
head = (head + rot);
scl = (scl * mag);
if (scl > 400){
scl = 400;
};
if (((isEscaped()) || ((life <= 0)))){
destroy(0);
return;
};
mat.identity();
mat.rotate((-(head) * 0.0174532925199433));
mat.scale(scl, scl);
mat.translate((120 + x), (160 - y));
col.color = (grad.getColor((1 - life)) & 0xFFFFFF);
}
public function setMotion(_arg1:Number, _arg2:uint, _arg3:Number, _arg4:Number=0, _arg5:Number=0, _arg6:Number=1, _arg7:Number=1):ShapeParticle{
setVelocity((sin[(_arg2 + 0x0400)] * _arg3), (sin[_arg2] * _arg3));
head = _arg4;
rot = _arg5;
scl = _arg6;
mag = _arg7;
if (_arg1 == 0){
aging = 0;
} else {
aging = (1 / _arg1);
if (_arg3 != 0){
setAccelaration((-(vx) / (_arg1 + 10)), ((-(vy) / (_arg1 + 10)) - 0.1), _arg1);
};
};
return (this);
}
}
class LockSite extends Actor {
private var flagShoot:Boolean;// = false
private var site_pos:uint;// = 0
private var target_id:uint;// = 0
private var target:Enemy;// = null
private static var chipInfo:Array = new Array(new sprite_information(231, 7, 9, 9, 0, 0), new sprite_information(240, 7, 9, 9, 0, 0), new sprite_information(231, 16, 9, 9, 0, 0), new sprite_information(240, 16, 9, 9, 0, 0), new sprite_information(231, 3, 18, 26, 0, 0));
private function LockSite(_arg1:uint){
target = null;
target_id = 0;
site_pos = 0;
flagShoot = false;
super();
freeList = null;
drawPrior = 4;
site_pos = _arg1;
}
override public function exit(_arg1:Number):void{
target = null;
object_manager.popDrawChain(this);
object_manager.popTestChain(this);
}
public function shoot():void{
flagShoot = isActive();
}
override public function draw():void{
if (life == 0){
resource_manager.drawChip(target.x, target.y, 0, chipInfo[4]);
} else {
resource_manager.drawChip((target.x - (life * 48)), (target.y + (life * 48)), 0, chipInfo[0]);
resource_manager.drawChip((target.x + (life * 48)), (target.y + (life * 48)), 0, chipInfo[1]);
resource_manager.drawChip((target.x - (life * 48)), (target.y - (life * 48)), 0, chipInfo[2]);
resource_manager.drawChip((target.x + (life * 48)), (target.y - (life * 48)), 0, chipInfo[3]);
};
}
public function set(_arg1:Enemy):void{
target = _arg1;
target_id = target.id;
}
override public function run():void{
var _local1:LockLaser;
if (((((!((target_id == target.id))) || (!(score_manager.locking)))) || ((target.size == 0)))){
destroy(0);
} else {
life = (life - 0.125);
if (life < 0){
life = 0;
};
if (flagShoot){
flagShoot = false;
_local1 = object_manager.newLockLaser();
_local1.create(player.x, (player.y - 12));
_local1.set(target, ((site_pos * 6) - 21), -20);
resource_manager.playSound(5);
};
};
}
override public function isActive():Boolean{
return (!((target == null)));
}
}
class Item extends Actor {
public var type:uint;// = 0
public var prvy:Number;
public var prvx:Number;
public var parent_destruction:Boolean;
public static const EXTEND:uint = 5;
public static const SHIELD:uint = 3;
public static const RAY:uint = 2;
public static const FRONT:uint = 0;
public static const BOMB:uint = 4;
public static const SIDE:uint = 1;
private static var chipInfo:Array = new Array(new sprite_information(384, 32, 16, 16, 0, 0), new sprite_information(400, 32, 16, 16, 0, 0), new sprite_information(416, 32, 16, 16, 0, 0), new sprite_information(432, 32, 16, 16, 0, 0), new sprite_information(448, 32, 16, 16, 0, 0), new sprite_information(464, 32, 16, 16, 0, 0));
private function Item(){
type = 0;
super();
freeList = freeItem;
testID = object_manager.ID_ITEM;
drawPrior = 5;
size = 10;
}
override public function exit(_arg1:Number):void{
var _local2:Item;
if (_arg1 == 2){
_local2 = object_manager.newItem(type);
_local2.create(x, y);
_local2.setVelocity((x - prvx), (y - prvy), 0);
_local2.parent_destruction = false;
};
super.exit(_arg1);
}
override public function draw():void{
resource_manager.drawChip(x, y, 0, chipInfo[type]);
}
override public function run():void{
prvx = x;
prvy = y;
move();
}
override public function enter():void{
super.enter();
testID = object_manager.ID_ITEM;
parent_destruction = true;
}
}
private var freeLockLaser:CMLList = new CMLList();
private const NO_CORE:uint = 0;
class ItemCenter extends Actor {
public var counter:int;// = 0
private static var chipInfo:sprite_information = new sprite_information(480, 32, 32, 32, 0, 0);
private function ItemCenter(){
counter = 0;
super();
freeList = freeItemCenter;
testID = object_manager.ID_ITEMCNT;
drawPrior = 6;
size = 20;
}
override public function exit(_arg1:Number):void{
super.exit(_arg1);
}
public function createItem(_arg1:uint):void{
var _local2:Item;
var _local3:Item;
var _local4:Item;
var _local5:Item;
_local2 = object_manager.newItem(Item.SIDE);
_local3 = object_manager.newItem(Item.FRONT);
_local4 = object_manager.newItem(Item.RAY);
if (_arg1 == 0){
_local2.create(0, 24, this, true);
_local3.create(20.785, -12, this, true);
_local4.create(-20.785, -12, this, true);
} else {
_local5 = object_manager.newItem((Item.RAY + _arg1));
_local2.create(0, 24, this, true);
_local3.create(24, 0, this, true);
_local4.create(0, -24, this, true);
_local5.create(-24, 0, this, true);
};
}
override public function draw():void{
resource_manager.drawChip(x, y, 0, chipInfo);
}
override public function run():void{
head = (head + (2 + (counter / 3)));
move();
runAllChildren();
if (isEscaped()){
destroy(0);
};
}
public function playerCentred():Boolean{
counter++;
return ((counter > 60));
}
override public function enter():void{
super.enter();
counter = 0;
}
}
private const BOSS:uint = 7;
class BackGround extends Actor {
private var spr0:Sprite;
private var wf:WireFrame;
private var mat0:Matrix;
private function BackGround(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
spr0 = new Sprite();
mat0 = new Matrix();
wf = new WireFrame();
super();
drawPrior = 7;
_local1 = (Math.PI / 8);
_local5 = 0;
while (_local5 <= 8) {
_local2 = (Math.cos((_local5 * _local1)) * 120);
_local4 = (-(Math.sin((_local5 * _local1))) * 120);
wf.newLine(_local2, -240, _local4).to(_local2, 240, _local4);
_local5++;
};
_local6 = 0;
while (_local6 <= 8) {
_local3 = ((_local6 * 60) - 240);
wf.newLine(120, _local3, 0);
_local5 = 0;
while (_local5 <= 8) {
_local2 = (Math.cos((_local5 * _local1)) * 120);
_local4 = (-(Math.sin((_local5 * _local1))) * 120);
wf.to(_local2, _local3, _local4);
_local5++;
};
_local6++;
};
}
override public function exit(_arg1:Number):void{
object_manager.popDrawChain(this);
object_manager.popTestChain(this);
}
override public function draw():void{
system.screen.pixels.draw(spr0);
}
override public function run():void{
move();
if (y > 30){
y = (y - 60);
} else {
if (y < -30){
y = (y + 60);
};
};
spr0.graphics.clear();
spr0.graphics.lineStyle(1, 2105408);
wf.construct(spr0.graphics, 360, 0, y, 120, 160);
}
override public function enter():void{
super.enter();
setVelocity(0, -6);
}
}
class Enemy extends Actor {
private var flagDamage:int;// = 0
private var age:uint;// = 0
private var frameFastBreak:int;// = 0
public var bonus:uint;// = 0
private var damageByRay:Number;// = 0
private var fragIgnoreRange:Boolean;// = false
private var counterIgnoreLock:int;// = 0
private var mat:Matrix;
private var regist:Number;// = 1
private var inva:Number;// = 1
private var invd:Number;// = 1
private var shape:EnemyShape;// = null
private static var countCreate:uint = 0;
private static var damageColor:ColorTransform = new ColorTransform(1, 1, 1, 1, 128, 128, 128, 0);
private static var countDestroy:uint = 0;
private static var stageBoss:Enemy = null;
private function Enemy(){
bonus = 0;
regist = 1;
age = 0;
frameFastBreak = 0;
fragIgnoreRange = false;
shape = null;
mat = new Matrix();
inva = 1;
invd = 1;
flagDamage = 0;
counterIgnoreLock = 0;
damageByRay = 0;
super();
freeList = freeEnemy;
testID = object_manager.ID_ENEMY;
drawPrior = 5;
}
override public function newObject(_arg1:CMLSequence):CMLObject{
return (object_manager.newEnemy(_arg1.arg(0), _arg1.arg(1), _arg1.arg(2), _arg1.arg(3), CMLState.invert_flag));
}
override public function vital(_arg1:Number):void{
setVitality(_arg1);
}
override public function fireObject(_arg1:CMLSequence):CMLObject{
return (object_manager.newBullet(_arg1.arg(0)));
}
override public function exit(_arg1:Number):void{
if (_arg1 == 1){
switch (shape.coreType){
case SMALL:
case BSMALL:
object_manager.explosion(x, y);
resource_manager.playSound(0, 5);
break;
case MEDIUM:
case BMEDIUM:
object_manager.explosion_medium(x, y);
resource_manager.playSound(0, 5);
break;
case LARGE:
case BLARGE:
object_manager.explosion_large(x, y);
resource_manager.playSound(1);
break;
case ITEM:
object_manager.newItemCenter(x, y, x, (y + 16), shape.shapeType);
object_manager.explosion(x, y);
resource_manager.playSound(0, 5);
break;
case BOSS:
object_manager.explosion_large(x, y);
break;
};
if (age < frameFastBreak){
score_manager.fastBreakEnemy(bonus);
} else {
if (frameFastBreak < 0){
score_manager.secretEnemy();
};
score_manager.destroyEnemy(bonus);
};
if (shape.coreType != NO_CORE){
countDestroy++;
};
};
super.exit(_arg1);
}
private function lock(_arg1:Number):void{
counterIgnoreLock = 6;
damageByRay = (damageByRay + _arg1);
}
override public function fastbreak(_arg1:Number):void{
frameFastBreak = _arg1;
}
private function isFlashing():Boolean{
return ((((isPositionRelative()) && (!((Enemy(parent).regist == 0))))) ? Enemy(parent).isFlashing() : (((flagDamage < 0)) || (((age & 1) == 0))));
}
override public function range(_arg1:Boolean):void{
fragIgnoreRange = _arg1;
}
override public function draw():void{
if (shape != null){
shape.draw(mat, (isFlashing()) ? null : damageColor);
};
}
private function isLockable():Boolean{
return ((((((((regist > 0)) && ((size > 0)))) && ((counterIgnoreLock < 0)))) && (((damageByRay * regist) < life))));
}
private function unlock(_arg1:Number):void{
damageByRay = (damageByRay - _arg1);
}
private function damage(_arg1:Number):void{
if (regist > 0){
life = (life - (_arg1 * regist));
flagDamage = 4;
};
}
private function set(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint):Enemy{
shape = ((EnemyShape.data[_arg1][_arg2])!=undefined) ? EnemyShape.data[_arg1][_arg2] : null;
bonus = _arg3;
drawPrior = _arg4;
size = 0;
regist = 0;
inva = ((_arg5 & 1)) ? -1 : 1;
invd = ((_arg5 & 2)) ? -1 : 1;
switch (_arg1){
case NO_CORE:
break;
case BOSS:
stageBoss = this;
default:
countCreate++;
break;
};
return (this);
}
override public function sizing(_arg1:Number):void{
size = _arg1;
}
override public function run():void{
age++;
flagDamage--;
move();
if (((!(fragIgnoreRange)) && (isEscaped()))){
destroy(0);
};
counterIgnoreLock--;
mat.identity();
mat.a = inva;
mat.d = invd;
mat.rotate((-(angleOnScreen()) * 0.0174532925199433));
mat.translate((120 + x), (160 - y));
runAllChildren();
}
private function checkDestruction():Boolean{
if (life <= 0){
destroy(1);
return (true);
};
return (false);
}
private function setVitality(_arg1:Number):void{
regist = ((_arg1)!=0) ? (1 / _arg1) : 0;
}
override public function enter():void{
counterIgnoreLock = 0;
damageByRay = 0;
flagDamage = 0;
fragIgnoreRange = false;
head = 0;
age = 0;
frameFastBreak = 0;
super.enter();
}
private static function start():void{
stageBoss = null;
countCreate = 0;
countDestroy = 0;
}
private static function getDestructionRatio():Number{
return ((countDestroy / countCreate));
}
}
private var root_stage:RootStage = new RootStage();
private const MEDIUM:uint = 2;
private var freeBlock:CMLList = new CMLList();
private var freeShot:CMLList = new CMLList();
private var freeItem:CMLList = new CMLList();
class LaserShadow extends Actor {
public var grad:Gradation;
public var width:Number;
public var line:Shape;
private static var widthTable:Array = new Array(2, 3, 4, 2);
private static var gradTable:Array = new Array(1, 1, 1, 2);
private function LaserShadow(){
line = new Shape();
super();
freeList = freeLaserShadow;
drawPrior = 2;
}
override public function draw():void{
system.screen.draw(line);
}
override public function run():void{
life = (life - 0.0625);
if (life <= 0){
destroy(0);
} else {
line.graphics.clear();
line.graphics.lineStyle(width, grad.getColor((1 - life)));
line.graphics.moveTo((120 + x), (160 - y));
line.graphics.lineTo(((120 + x) + vx), ((160 - y) - vy));
};
}
override public function enter():void{
super.enter();
width = widthTable[score_manager.shotLevel[2]];
grad = resource_manager.grad[gradTable[score_manager.shotLevel[2]]];
}
}
private var freeLaserShadow:CMLList = new CMLList();
private const BSMALL:uint = 4;
Section 39
//password (password)
package {
import util.*;
public class password {
private static var pass:String = "pEngUIn";
public static function hash(_arg1:String, _arg2:String):String{
return (md5.hash(((_arg1 + pass) + _arg2)));
}
}
}//package
Section 40
//resource_manager (resource_manager)
package {
import flash.events.*;
import cml.*;
import flash.media.*;
import flash.display.*;
import flash.geom.*;
import util.*;
import flash.net.*;
import flash.system.*;
public class resource_manager extends manager {
public static const START_ROUND:uint = 0;
private static var binLoader:URLLoader = new URLLoader();
public static var flashLight:Shape;
private static var soundVolume:SoundTransform = new SoundTransform();
private static var expll_mp3:Class = resource_manager_expll_mp3;
private static var sound:Array = null;
private static var bgmChannel:SoundChannel = null;
private static var expm_mp3:Class = resource_manager_expm_mp3;
private static var listFileFunc:Array = new Array();
private static var exps_mp3:Class = resource_manager_exps_mp3;
private static var eneshot12_mp3:Class = resource_manager_eneshot12_mp3;
private static var eneshot14_mp3:Class = resource_manager_eneshot14_mp3;
private static var flagLoading:Boolean = false;
private static var nameLoading:String = "";
private static var defaultCML:CMLSequence = null;
private static var eneshot21_mp3:Class = resource_manager_eneshot21_mp3;
private static var stage_data:Array = new Array("s1.cml", "s2.cml", "s3.cml", "s4.cml", "s5.cml", "s6.cml", "s1.cml", "s2.cml", "s3.cml", "s4.cml", "s5.cml", "s6.cml");
private static var chip:Bitmap;
private static var font:Bitmap;
private static var howto_gif:Class = resource_manager_howto_gif;
private static var chip_gif:Class = resource_manager_chip_gif;
private static var crash_mp3:Class = resource_manager_crash_mp3;
private static var ray_mp3:Class = resource_manager_ray_mp3;
public static var grad:Array;
private static var eneshot32_mp3:Class = resource_manager_eneshot32_mp3;
private static var eneshot34_mp3:Class = resource_manager_eneshot34_mp3;
public static var url:String = "http://www.yomogi.sakura.ne.jp/~si/SolidImage/cml/arcanacra/";
private static var stage_label:Array = new Array("STAGE1", "STAGE2", "STAGE3", "STAGE4", "STAGE5", "STAGE6", "STAGE1A", "STAGE2A", "STAGE3A", "STAGE4A", "STAGE5A", "STAGE6A");
private static var stage_cml:Array = new Array();
public static var bossExpLight:Shape;
private static var progLoading:Number = 0;
private static var musicVolume:SoundTransform = new SoundTransform();
private static var eneshot11_mp3:Class = resource_manager_eneshot11_mp3;
private static var eneshot13_mp3:Class = resource_manager_eneshot13_mp3;
private static var pi_mp3:Class = resource_manager_pi_mp3;
private static var expl_mp3:Class = resource_manager_expl_mp3;
private static var enecharge_mp3:Class = resource_manager_enecharge_mp3;
private static var eneshot22_mp3:Class = resource_manager_eneshot22_mp3;
private static var bgm:Sound = null;
private static var howto:Bitmap;
private static var warning_mp3:Class = resource_manager_warning_mp3;
private static var bomb_mp3:Class = resource_manager_bomb_mp3;
private static var font_gif:Class = resource_manager_font_gif;
private static var funcLoading:Function = null;
private static var pipipi_mp3:Class = resource_manager_pipipi_mp3;
public static var version:String = "VER.0.4.1";
public static var webpage:String = "http://www.yomogi.sakura.ne.jp/~si/SolidImage/index.shtml";
private static var eneshot31_mp3:Class = resource_manager_eneshot31_mp3;
private static var eneshot33_mp3:Class = resource_manager_eneshot33_mp3;
private static var sndLoader:Sound = null;
private static var listFileName:Array = new Array();
private static var flagEscaped:Boolean = false;
private static var sound_time:int = 0;
private static var medLoader:Loader = null;
public function resource_manager(){
var _local1:int;
var _local2:Matrix;
var _local3:Shape;
super();
chip = new chip_gif();
font = new font_gif();
howto = new howto_gif();
sound = new Array(40);
sound[0] = new exps_mp3();
sound[1] = new expm_mp3();
sound[2] = new expl_mp3();
sound[3] = new expll_mp3();
sound[4] = new crash_mp3();
sound[5] = new ray_mp3();
sound[6] = new pi_mp3();
sound[7] = new pipipi_mp3();
sound[8] = new warning_mp3();
sound[9] = new bomb_mp3();
sound[10] = new enecharge_mp3();
sound[11] = new eneshot11_mp3();
sound[12] = new eneshot12_mp3();
sound[13] = new eneshot13_mp3();
sound[14] = new eneshot14_mp3();
sound[21] = new eneshot21_mp3();
sound[22] = new eneshot22_mp3();
sound[31] = new eneshot31_mp3();
sound[32] = new eneshot32_mp3();
sound[33] = new eneshot33_mp3();
sound[34] = new eneshot34_mp3();
grad = new Array(8);
grad[0] = new Gradation(4294967295, 4286611711);
grad[0].add(0.2, 4294951040).add(0.5, 4282400832).update().addBlink(0.5, 1, 0.05, 0);
grad[1] = new Gradation(4294967295, 4278190080);
grad[1].add(0.2, 4286611711).update();
grad[2] = new Gradation(4294967295, 4278190080);
grad[2].add(0.2, 4294954112).update();
grad[3] = new Gradation(4278190080, 4278190080);
grad[3].add(0.8, 4294967295).update();
grad[4] = new Gradation(4294967295, 4278190080);
grad[4].update();
bossExpLight = new Shape();
bossExpLight.graphics.beginFill(0);
bossExpLight.graphics.moveTo(0, 0);
bossExpLight.graphics.lineTo(400, 10);
bossExpLight.graphics.lineTo(400, -10);
bossExpLight.graphics.lineTo(0, 0);
bossExpLight.graphics.endFill();
flashLight = new Shape();
flashLight.graphics.beginFill(0);
flashLight.graphics.drawCircle(0, 0, 1);
soundVolume.volume = 0.7;
musicVolume.volume = 1;
_local2 = new Matrix();
_local3 = new Shape();
_local3.graphics.beginFill(16734080);
_local3.graphics.moveTo(-3.5, -7);
_local3.graphics.lineTo(-3.5, 7);
_local3.graphics.lineTo(3.5, 7);
_local3.graphics.lineTo(3.5, -7);
_local3.graphics.lineTo(-3.5, -7);
_local3.graphics.endFill();
_local3.graphics.lineStyle(1, 0xC00020);
_local3.graphics.moveTo(-3.5, -7);
_local3.graphics.lineTo(-3.5, 7);
_local3.graphics.moveTo(3.5, -7);
_local3.graphics.lineTo(3.5, 7);
_local1 = 0;
while (_local1 < 32) {
_local2.identity();
_local2.rotate((-(_local1) * 0.098174770424681));
_local2.translate(((_local1 * 16) + 8), 144);
chip.bitmapData.draw(_local3, _local2);
_local1++;
};
_local3.graphics.clear();
_local3.graphics.beginFill(16734080);
_local3.graphics.moveTo(-1.5, -7);
_local3.graphics.lineTo(-1.5, 7);
_local3.graphics.lineTo(1.5, 7);
_local3.graphics.lineTo(1.5, -7);
_local3.graphics.lineTo(-1.5, -7);
_local3.graphics.endFill();
_local3.graphics.lineStyle(1, 0xC00020);
_local3.graphics.moveTo(0, -7.5);
_local3.graphics.lineTo(-1.5, -6);
_local3.graphics.lineTo(-1.5, 6);
_local3.graphics.lineTo(0, 7.5);
_local3.graphics.lineTo(1.5, 6);
_local3.graphics.lineTo(1.5, -6);
_local3.graphics.lineTo(0, -7.5);
_local1 = 0;
while (_local1 < 32) {
_local2.identity();
_local2.rotate((-(_local1) * 0.098174770424681));
_local2.translate(((_local1 * 16) + 8), 168);
chip.bitmapData.draw(_local3, _local2);
_local1++;
};
pushLoadingList((url + "default.cml"), _callbackDefaultCMLLoaded);
}
override public function enterScene():void{
switch (system.scene.get()){
case score_manager.SCENE_MAIN:
case score_manager.SCENE_REPLAY:
sound_time = 0;
system.fps.reset(40);
break;
case score_manager.SCENE_GAMEOVER:
case score_manager.SCENE_COMPLETE:
stopBGM();
break;
case score_manager.SCENE_RESULT:
break;
case score_manager.SCENE_TITLE:
IME.enabled = false;
system.fps.reset(40);
stopBGM();
flagEscaped = false;
break;
case score_manager.SCENE_LOADING:
if (bgm == null){
pushLoadingList((url + "bgm0.mp3"), _callbackBGMLoaded);
};
if (stage_cml[score_manager.getRound()] == null){
pushLoadingList((url + stage_data[score_manager.getRound()]), _callbackCMLLoaded);
};
startLoading();
break;
case score_manager.SCENE_INITIALIZE:
startLoading();
break;
default:
break;
};
}
override public function run():void{
system.screen.clear();
switch (system.scene.get()){
case score_manager.SCENE_MAIN:
case score_manager.SCENE_REPLAY:
sound_time--;
_escapekey();
break;
case score_manager.SCENE_TITLE:
if (score_manager.isReadyToStart()){
if (screen_manager.getSelectedMenuID() > 0){
system.scene.change(score_manager.SCENE_LOADING);
};
};
break;
case score_manager.SCENE_HOWTO:
if (_hitkey()){
system.scene.change(score_manager.SCENE_TITLE);
};
break;
case score_manager.SCENE_RESULT:
if (_hitkey()){
system.scene.change(score_manager.SCENE_LOADING);
};
_escapekey();
break;
case score_manager.SCENE_LOADING:
if (!isLoading()){
system.scene.change((score_manager.isReplay()) ? score_manager.SCENE_REPLAY : score_manager.SCENE_MAIN);
};
break;
case score_manager.SCENE_GAMEOVER:
case score_manager.SCENE_COMPLETE:
if (_hitkey()){
system.scene.change(score_manager.SCENE_TITLE);
};
_escapekey();
break;
case score_manager.SCENE_INITIALIZE:
if (!isLoading()){
system.scene.change((score_manager.isFirstTime()) ? score_manager.SCENE_HOWTO : score_manager.SCENE_TITLE);
};
break;
case score_manager.SCENE_NAMEENTRY:
if (!isLoading()){
system.scene.change(score_manager.SCENE_TITLE);
};
break;
default:
break;
};
}
override public function exitScene():void{
switch (system.scene.get()){
case score_manager.SCENE_MAIN:
break;
case score_manager.SCENE_REPLAY:
break;
case score_manager.SCENE_GAMEOVER:
break;
case score_manager.SCENE_COMPLETE:
break;
case score_manager.SCENE_RESULT:
break;
case score_manager.SCENE_TITLE:
if (((!(score_manager.isReplay())) && (!((url == "arcanacra/"))))){
pushLoadingList(((url + "arcplycnt.cgi?time=") + new Date()), _callbackCounterLoaded);
};
break;
case score_manager.SCENE_LOADING:
break;
case score_manager.SCENE_INITIALIZE:
break;
default:
break;
};
}
public static function drawHowTo():void{
system.screen.copyPixels(howto.bitmapData, 24, 32, 192, 0x0100, 0, 0);
}
public static function _hitkey():Boolean{
return (((system.control.isHitted(system.KEY_BUTTON0)) || (system.control.isHitted(system.KEY_BUTTON1))));
}
public static function getCML(_arg1:String):CMLSequence{
return (defaultCML.findSequence(_arg1));
}
private static function _completeMedia(_arg1:Event):void{
medLoader.removeEventListener(ProgressEvent.PROGRESS, _progress);
medLoader.removeEventListener(Event.COMPLETE, _completeMedia);
medLoader.removeEventListener(IOErrorEvent.IO_ERROR, _errorMedia);
if (funcLoading != null){
funcLoading(medLoader);
};
_loadNewFile();
}
public static function playSound(_arg1:uint, _arg2:int=0):void{
if (_arg2 > 0){
if (sound_time <= 0){
sound[_arg1].play(0, 1, soundVolume);
sound_time = _arg2;
};
} else {
sound[_arg1].play(0, 1, soundVolume);
};
}
public static function getLoadingFileName():String{
return (nameLoading);
}
private static function _completeSound(_arg1:Event):void{
sndLoader.removeEventListener(ProgressEvent.PROGRESS, _progress);
sndLoader.removeEventListener(Event.COMPLETE, _completeSound);
sndLoader.removeEventListener(IOErrorEvent.IO_ERROR, _errorSound);
if (funcLoading != null){
funcLoading(sndLoader);
};
_loadNewFile();
}
private static function _errorBinary(_arg1:IOErrorEvent):void{
funcLoading = null;
_completeBinary(_arg1);
}
public static function drawGuage(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:uint, _arg5:uint):void{
var _local6:int;
var _local7:Number;
_local7 = ((_arg3 * 8) + 8);
_local6 = 0;
while (_local6 < _arg4) {
system.screen.copyPixels(font.bitmapData, (120 + _arg1), (160 - _arg2), 8, 8, _local7, 64);
_local6++;
_arg1 = (_arg1 + 8);
};
while (_local6 < _arg5) {
system.screen.copyPixels(font.bitmapData, (120 + _arg1), (160 - _arg2), 8, 8, 0, 64);
_local6++;
_arg1 = (_arg1 + 8);
};
}
private static function _callbackDefaultCMLLoaded(_arg1:String):void{
defaultCML = new CMLSequence(_arg1);
defaultCML.setPublic();
object_manager.callbackDefaultCMLLoaded();
}
public static function stopBGM():void{
if (bgmChannel != null){
bgmChannel.stop();
};
bgmChannel = null;
}
public static function isEscaped():Boolean{
return (flagEscaped);
}
public static function startLoading():Boolean{
return (_loadNewFile());
}
private static function _errorMedia(_arg1:IOErrorEvent):void{
funcLoading = null;
_completeMedia(_arg1);
}
public static function pushLoadingList(_arg1:String, _arg2:Function):void{
listFileName.push(_arg1);
listFileFunc.push(_arg2);
}
private static function _errorSound(_arg1:IOErrorEvent):void{
funcLoading = null;
_completeSound(_arg1);
}
private static function _progress(_arg1:ProgressEvent):void{
progLoading = (Number(_arg1.bytesLoaded) / Number(_arg1.bytesTotal));
flagLoading = true;
}
private static function _callbackCMLLoaded(_arg1:String):void{
var _local2:CMLSequence;
var _local3:uint;
_local2 = new CMLSequence(_arg1);
_local3 = 0;
while (_local3 < stage_label.length) {
stage_cml[_local3] = _local2.findSequence(stage_label[_local3]);
_local3++;
};
}
public static function print(_arg1:Number, _arg2:Number, _arg3:String):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:uint;
_local4 = (120 + int(_arg1));
_local5 = (160 - int(_arg2));
_local9 = 0;
while (_local9 < _arg3.length) {
_local6 = _arg3.charCodeAt(_local9);
if (_local6 == 13){
_local4 = (120 + int(_arg1));
_local5 = (_local5 + 8);
} else {
_local7 = ((_local6 & 15) << 3);
_local8 = ((_local6 & 240) >> 1);
system.screen.copyPixels(font.bitmapData, _local4, _local5, 7, 7, _local7, _local8);
_local4 = (_local4 + 8);
};
_local9++;
};
}
public static function isLoading():Boolean{
return (((flagLoading) || (score_manager.isRankingLoading())));
}
private static function _completeBinary(_arg1:Event):void{
binLoader.removeEventListener(ProgressEvent.PROGRESS, _progress);
binLoader.removeEventListener(Event.COMPLETE, _completeBinary);
binLoader.removeEventListener(IOErrorEvent.IO_ERROR, _errorBinary);
if (funcLoading != null){
funcLoading(binLoader.data);
};
_loadNewFile();
}
private static function _loadNewFile():Boolean{
var _local1:String;
var _local2:RegExp;
progLoading = 1;
flagLoading = false;
if (listFileName.length == 0){
return (false);
};
progLoading = 0;
flagLoading = true;
nameLoading = listFileName.shift();
funcLoading = listFileFunc.shift();
_local1 = nameLoading.slice(-4);
if ((((((((_local1 == ".jpg")) || ((_local1 == ".gif")))) || ((_local1 == ".png")))) || ((_local1 == ".swf")))){
medLoader = new Loader();
medLoader.addEventListener(ProgressEvent.PROGRESS, _progress);
medLoader.addEventListener(Event.COMPLETE, _completeMedia);
medLoader.addEventListener(IOErrorEvent.IO_ERROR, _errorMedia);
medLoader.load(new URLRequest(nameLoading));
} else {
if (_local1 == ".mp3"){
sndLoader = new Sound();
sndLoader.addEventListener(ProgressEvent.PROGRESS, _progress);
sndLoader.addEventListener(Event.COMPLETE, _completeSound);
sndLoader.addEventListener(IOErrorEvent.IO_ERROR, _errorSound);
sndLoader.load(new URLRequest(nameLoading));
} else {
binLoader.addEventListener(ProgressEvent.PROGRESS, _progress);
binLoader.addEventListener(Event.COMPLETE, _completeBinary);
binLoader.addEventListener(IOErrorEvent.IO_ERROR, _errorBinary);
binLoader.load(new URLRequest(nameLoading));
};
};
_local2 = /[^\/]+$/;
if (_local1.charAt(0) == "."){
nameLoading = nameLoading.substr(nameLoading.search(_local2)).toUpperCase();
} else {
nameLoading = "ACCESS TO SERVER";
};
return (true);
}
public static function drawChip(_arg1:Number, _arg2:Number, _arg3:uint, _arg4:sprite_information):void{
system.screen.copyPixels(chip.bitmapData, ((120 + _arg1) - _arg4.cx), ((160 - _arg2) - _arg4.cy), _arg4.w, _arg4.h, (((_arg3 >> _arg4.animInterval) * _arg4.w) + _arg4.tx), _arg4.ty);
}
public static function getLoadingProgression():Number{
return (progLoading);
}
private static function _callbackBGMLoaded(_arg1:Sound):void{
bgm = _arg1;
}
private static function _escapekey():void{
if (system.control.isHitted(system.KEY_ESCAPE)){
flagEscaped = true;
system.scene.change(score_manager.SCENE_TITLE);
};
}
public static function printGray(_arg1:Number, _arg2:Number, _arg3:String):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:uint;
_local4 = (120 + int(_arg1));
_local5 = (160 - int(_arg2));
_local9 = 0;
while (_local9 < _arg3.length) {
_local6 = _arg3.charCodeAt(_local9);
_local7 = ((_local6 & 15) << 3);
_local8 = ((_local6 & 240) >> 1);
system.screen.copyPixels(font.bitmapData, _local4, _local5, 7, 7, _local7, (_local8 + 64));
_local4 = (_local4 + 8);
_local9++;
};
}
public static function getStageCML():CMLSequence{
return (CMLSequence(stage_cml[score_manager.getRound()]));
}
private static function _callbackCounterLoaded(_arg1:String):void{
score_manager.playCount = uint(_arg1);
}
public static function playBGM():void{
bgmChannel = bgm.play(0, 1, musicVolume);
}
}
}//package
Section 41
//resource_manager_bomb_mp3 (resource_manager_bomb_mp3)
package {
import mx.core.*;
public class resource_manager_bomb_mp3 extends SoundAsset {
}
}//package
Section 42
//resource_manager_chip_gif (resource_manager_chip_gif)
package {
import mx.core.*;
public class resource_manager_chip_gif extends BitmapAsset {
}
}//package
Section 43
//resource_manager_crash_mp3 (resource_manager_crash_mp3)
package {
import mx.core.*;
public class resource_manager_crash_mp3 extends SoundAsset {
}
}//package
Section 44
//resource_manager_enecharge_mp3 (resource_manager_enecharge_mp3)
package {
import mx.core.*;
public class resource_manager_enecharge_mp3 extends SoundAsset {
}
}//package
Section 45
//resource_manager_eneshot11_mp3 (resource_manager_eneshot11_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot11_mp3 extends SoundAsset {
}
}//package
Section 46
//resource_manager_eneshot12_mp3 (resource_manager_eneshot12_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot12_mp3 extends SoundAsset {
}
}//package
Section 47
//resource_manager_eneshot13_mp3 (resource_manager_eneshot13_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot13_mp3 extends SoundAsset {
}
}//package
Section 48
//resource_manager_eneshot14_mp3 (resource_manager_eneshot14_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot14_mp3 extends SoundAsset {
}
}//package
Section 49
//resource_manager_eneshot21_mp3 (resource_manager_eneshot21_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot21_mp3 extends SoundAsset {
}
}//package
Section 50
//resource_manager_eneshot22_mp3 (resource_manager_eneshot22_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot22_mp3 extends SoundAsset {
}
}//package
Section 51
//resource_manager_eneshot31_mp3 (resource_manager_eneshot31_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot31_mp3 extends SoundAsset {
}
}//package
Section 52
//resource_manager_eneshot32_mp3 (resource_manager_eneshot32_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot32_mp3 extends SoundAsset {
}
}//package
Section 53
//resource_manager_eneshot33_mp3 (resource_manager_eneshot33_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot33_mp3 extends SoundAsset {
}
}//package
Section 54
//resource_manager_eneshot34_mp3 (resource_manager_eneshot34_mp3)
package {
import mx.core.*;
public class resource_manager_eneshot34_mp3 extends SoundAsset {
}
}//package
Section 55
//resource_manager_expl_mp3 (resource_manager_expl_mp3)
package {
import mx.core.*;
public class resource_manager_expl_mp3 extends SoundAsset {
}
}//package
Section 56
//resource_manager_expll_mp3 (resource_manager_expll_mp3)
package {
import mx.core.*;
public class resource_manager_expll_mp3 extends SoundAsset {
}
}//package
Section 57
//resource_manager_expm_mp3 (resource_manager_expm_mp3)
package {
import mx.core.*;
public class resource_manager_expm_mp3 extends SoundAsset {
}
}//package
Section 58
//resource_manager_exps_mp3 (resource_manager_exps_mp3)
package {
import mx.core.*;
public class resource_manager_exps_mp3 extends SoundAsset {
}
}//package
Section 59
//resource_manager_font_gif (resource_manager_font_gif)
package {
import mx.core.*;
public class resource_manager_font_gif extends BitmapAsset {
}
}//package
Section 60
//resource_manager_howto_gif (resource_manager_howto_gif)
package {
import mx.core.*;
public class resource_manager_howto_gif extends BitmapAsset {
}
}//package
Section 61
//resource_manager_pi_mp3 (resource_manager_pi_mp3)
package {
import mx.core.*;
public class resource_manager_pi_mp3 extends SoundAsset {
}
}//package
Section 62
//resource_manager_pipipi_mp3 (resource_manager_pipipi_mp3)
package {
import mx.core.*;
public class resource_manager_pipipi_mp3 extends SoundAsset {
}
}//package
Section 63
//resource_manager_ray_mp3 (resource_manager_ray_mp3)
package {
import mx.core.*;
public class resource_manager_ray_mp3 extends SoundAsset {
}
}//package
Section 64
//resource_manager_warning_mp3 (resource_manager_warning_mp3)
package {
import mx.core.*;
public class resource_manager_warning_mp3 extends SoundAsset {
}
}//package
Section 65
//score_board (score_board)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class score_board {
private const RANK_MAX:int = 10;
private var replay_data:String;// = null
private var rankingStageScore:Array;
private var round:uint;// = 0
private var stage_score:String;// = null
private var score:uint;// = 0
private var loader:URLLoader;
private var flagLoading:Boolean;
public var error_message:String;
private var ranking_dlg:RankingDialog;
private var rankingReplayFile:Array;
private var input_dlg:InputDialog;
private var url:String;
private var replay_data_file_name:String;// = ""
private var flagSuccess:Boolean;
private var rankingScore:Array;
public function score_board(){
loader = new URLLoader();
input_dlg = new InputDialog(120, 160);
ranking_dlg = new RankingDialog(120, 160);
rankingScore = new Array(RANK_MAX);
rankingStageScore = new Array(RANK_MAX);
rankingReplayFile = new Array(RANK_MAX);
score = 0;
round = 0;
replay_data = null;
replay_data_file_name = "";
stage_score = null;
super();
url = null;
flagLoading = false;
flagSuccess = false;
error_message = "";
}
public function showRanking():void{
ranking_dlg.activate();
}
public function getName():String{
return (input_dlg.getName());
}
private function _completeUpdate(_arg1:Event):void{
flagLoading = false;
if (loader.data.charAt(0) == "#"){
flagSuccess = false;
error_message = loader.data;
} else {
flagSuccess = true;
_parseScoreBoard(loader.data);
};
loader.removeEventListener(Event.COMPLETE, _completeUpdate);
loader.removeEventListener(IOErrorEvent.IO_ERROR, _errorUpdate);
}
public function hideRanking():void{
ranking_dlg.inactivate();
}
public function downloadReplay(_arg1:uint):Boolean{
var _local2:URLRequest;
if (url == null){
return (false);
};
if (!isReplayAvailable(_arg1)){
return (false);
};
if (replay_data_file_name == String(rankingReplayFile[_arg1])){
flagLoading = false;
flagSuccess = true;
return (true);
};
replay_data_file_name = String(rankingReplayFile[_arg1]);
_local2 = new URLRequest(url);
_local2.method = URLRequestMethod.GET;
_local2.data = ("mode=replay&hash=" + replay_data_file_name);
if (user_data.isAnotherMode()){
_local2.data = (_local2.data + "&anot=1");
};
loader.addEventListener(Event.COMPLETE, _completeLoadReplay);
loader.addEventListener(IOErrorEvent.IO_ERROR, _errorLoadReplay);
loader.load(_local2);
flagLoading = true;
flagSuccess = false;
replay_data = null;
return (true);
}
public function isReplayAvailable(_arg1:uint):Boolean{
if (((!(flagSuccess)) || ((_arg1 >= RANK_MAX)))){
return (false);
};
return (!((rankingReplayFile[_arg1] == "#")));
}
public function entryName(_arg1:user_data, _arg2:uint):void{
score = _arg1.score;
round = _arg2;
replay_data = _arg1.replay;
stage_score = _arg1.getStageScoreString();
input_dlg.setName(_arg1.name);
input_dlg.setScore(score);
input_dlg.enableUpdate(isRankin(score));
input_dlg.activate(_onSend, _onCancel);
flagLoading = true;
}
private function _onCancel(_arg1:MouseEvent):void{
flagLoading = false;
input_dlg.inactivate();
}
public function isRankin(_arg1:uint):Boolean{
return ((rankingScore[(RANK_MAX - 1)] < _arg1));
}
private function _completeLoadReplay(_arg1:Event):void{
flagLoading = false;
if (loader.data.charAt(0) == "#"){
flagSuccess = false;
replay_data_file_name = "";
error_message = loader.data;
} else {
flagSuccess = true;
replay_data = loader.data;
};
loader.removeEventListener(Event.COMPLETE, _completeLoadReplay);
loader.removeEventListener(IOErrorEvent.IO_ERROR, _errorLoadReplay);
}
public function getReplayData():String{
return (replay_data);
}
public function isEnableToEntry(_arg1:uint):Boolean{
return ((_arg1 > 100000));
}
public function setURL(_arg1:String):void{
url = _arg1;
}
private function _onSend(_arg1:MouseEvent):void{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:RegExp;
var _local7:URLRequest;
if (url == null){
return;
};
_local2 = String(score);
_local3 = String((round + 1));
_local4 = input_dlg.getName();
_local5 = input_dlg.getComment();
_local6 = /[&=]/g;
_local4 = _local4.replace(_local6, "_");
_local5 = _local5.replace(_local6, "_");
if (_local4 == ""){
_local4 = "#";
};
_local7 = new URLRequest(url);
_local7.method = URLRequestMethod.POST;
_local7.data = ("score=" + _local2);
_local7.data = (_local7.data + ("&round=" + _local3));
_local7.data = (_local7.data + ("&name=" + _local4));
_local7.data = (_local7.data + ("&cmnt=" + _local5));
_local7.data = (_local7.data + ("&sscr=" + stage_score));
_local7.data = (_local7.data + ("&hash=" + password.hash(_local2, _local4)));
if (user_data.isAnotherMode()){
_local7.data = (_local7.data + "&anot=1");
};
if (input_dlg.isUploadChecked()){
_local7.data = (_local7.data + ("&rply=" + replay_data));
};
_startLoading(_local7);
input_dlg.inactivate();
}
public function isLoading():Boolean{
return (flagLoading);
}
private function _errorUpdate(_arg1:Event):void{
flagLoading = false;
flagSuccess = false;
error_message = "#FAILED TO ACCESS RANKING";
loader.removeEventListener(Event.COMPLETE, _completeUpdate);
loader.removeEventListener(IOErrorEvent.IO_ERROR, _errorUpdate);
}
private function _parseScoreBoard(_arg1:String):void{
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:uint;
var _local7:String;
var _local8:String;
var _local9:String;
_local2 = _arg1.split("\n");
_local4 = 0;
while (_local4 < RANK_MAX) {
if (_local4 < _local2.length){
_local3 = _local2[_local4].split("&");
if ((((_local3.length >= 4)) && ((uint(_local3[0]) > 0)))){
_local6 = uint(_local3[0]);
_local7 = String(_local3[1]);
_local8 = String(_local3[2]);
_local9 = String(_local3[3]);
rankingScore[_local4] = _local6;
rankingStageScore[_local4] = _local8;
rankingReplayFile[_local4] = _local9;
ranking_dlg.setName(_local4, _local6, _local7);
} else {
rankingScore[_local4] = 0;
rankingStageScore[_local4] = 0;
rankingReplayFile[_local4] = "#";
ranking_dlg.setName(_local4, 0, "<no data>");
};
} else {
rankingScore[_local4] = 0;
rankingStageScore[_local4] = 0;
rankingReplayFile[_local4] = "#";
ranking_dlg.setName(_local4, 0, "<no data>");
};
_local4++;
};
}
public function update():Boolean{
var _local1:URLRequest;
if (url == null){
return (false);
};
_local1 = new URLRequest(url);
_local1.method = URLRequestMethod.GET;
_local1.data = "mode=refer";
if (user_data.isAnotherMode()){
_local1.data = (_local1.data + "&anot=1");
};
_local1.data = (_local1.data + ("&time=" + new Date().getTime()));
_startLoading(_local1);
return (true);
}
public function getStageScoreString(_arg1:uint):String{
return (rankingStageScore[_arg1]);
}
public function isUploadChecked():Boolean{
return (input_dlg.isUploadChecked());
}
private function _errorLoadReplay(_arg1:Event):void{
flagLoading = false;
flagSuccess = false;
replay_data_file_name = "";
error_message = "#FAILED TO DOWNLOAD REPLAY";
loader.removeEventListener(Event.COMPLETE, _completeLoadReplay);
loader.removeEventListener(IOErrorEvent.IO_ERROR, _errorLoadReplay);
}
public function getScore(_arg1:uint):uint{
if (_arg1 >= RANK_MAX){
return (0);
};
return (rankingScore[_arg1]);
}
private function _startLoading(_arg1:URLRequest):void{
loader.addEventListener(Event.COMPLETE, _completeUpdate);
loader.addEventListener(IOErrorEvent.IO_ERROR, _errorUpdate);
loader.load(_arg1);
flagLoading = true;
flagSuccess = false;
}
public function isSuccess():Boolean{
return (flagSuccess);
}
}
}//package
import flash.events.*;
import flash.display.*;
import flash.text.*;
class InputDialog extends Sprite {
private var message:TextField;
private var nameLabel:TextField;
private var cmntLabel:TextField;
private var cmntField:TextField;
private var nameField:TextField;
private var uploadCheckState:uint;// = 1
private var cnclButton:SimpleButton;
private var uploadCheckShape:Array;
private var funcSend:Function;
private var uploadLabel:TextField;
private var uploadCheck:SimpleButton;
private var funcCancel:Function;
private var score:TextField;
private var sendButton:SimpleButton;
public static const UPLOAD_IMPOSSIBLE:uint = 2;
public static const UPLOAD_CANCEL:uint = 0;
public static const UPLOAD_OK:uint = 1;
private function InputDialog(_arg1:Number, _arg2:Number){
var format:TextFormat;
var message_format:TextFormat;
var score_format:TextFormat;
var dy:int;
var state:uint;
var newSendButton:Function;
var button:Shape;
var x_ = _arg1;
var y_ = _arg2;
nameLabel = new TextField();
cmntLabel = new TextField();
score = new TextField();
message = new TextField();
nameField = new TextField();
cmntField = new TextField();
sendButton = new SimpleButton();
cnclButton = new SimpleButton();
uploadLabel = new TextField();
uploadCheck = new SimpleButton();
uploadCheckShape = new Array(3);
uploadCheckState = 1;
super();
newSendButton = function (_arg1:String, _arg2:Boolean, _arg3:uint, _arg4:uint):TextField{
var _local5:TextFormat;
var _local6:TextField;
_local5 = new TextFormat();
_local5.font = "MS Gothic";
_local5.size = 12;
_local5.bold = _arg2;
_local5.align = TextFormatAlign.CENTER;
_local6 = new TextField();
_local6.width = 54;
_local6.height = 16;
_local6.background = true;
_local6.backgroundColor = _arg3;
_local6.border = true;
_local6.borderColor = 0xFFFFFF;
_local6.textColor = _arg4;
_local6.defaultTextFormat = _local5;
_local6.text = _arg1;
return (_local6);
};
x = x_;
y = y_;
graphics.lineStyle(1, 0xFFFFFF);
graphics.beginFill(0x808080);
graphics.drawRect(-60.5, -88.5, 120, 176);
graphics.endFill();
format = new TextFormat();
format.font = "MS Gothic";
format.size = 12;
message_format = new TextFormat();
message_format.font = "MS Gothic";
message_format.size = 12;
message_format.bold = true;
message_format.align = TextFormatAlign.CENTER;
score_format = new TextFormat();
score_format.font = "MS Gothic";
score_format.size = 16;
score_format.bold = true;
score_format.align = TextFormatAlign.CENTER;
dy = -88;
message.x = -58;
message.y = dy;
message.width = 114;
message.height = 32;
message.multiline = true;
message.textColor = 0xFFFFFF;
message.defaultTextFormat = message_format;
message.text = "Please send\nyour hi-score.";
addChild(message);
dy = (dy + 28);
score.x = -58;
score.y = dy;
score.width = 114;
score.height = 24;
score.textColor = 0xFFFFFF;
score.defaultTextFormat = score_format;
addChild(score);
dy = (dy + 24);
nameLabel.x = -58;
nameLabel.y = dy;
nameLabel.width = 114;
nameLabel.height = 16;
nameLabel.textColor = 0xFFFFFF;
nameLabel.defaultTextFormat = format;
nameLabel.text = "Input your name";
addChild(nameLabel);
dy = (dy + 16);
nameField.x = -58;
nameField.y = dy;
nameField.width = 114;
nameField.height = 16;
nameField.background = true;
nameField.backgroundColor = 0x404040;
nameField.border = true;
nameField.borderColor = 0xFFFFFF;
nameField.restrict = null;
nameField.textColor = 0xFFFFFF;
nameField.type = TextFieldType.INPUT;
nameField.defaultTextFormat = format;
addChild(nameField);
dy = (dy + 22);
cmntLabel.x = -58;
cmntLabel.y = dy;
cmntLabel.width = 114;
cmntLabel.height = 16;
cmntLabel.textColor = 0xFFFFFF;
cmntLabel.defaultTextFormat = format;
cmntLabel.text = "Input comment";
addChild(cmntLabel);
dy = (dy + 16);
cmntField.x = -58;
cmntField.y = dy;
cmntField.width = 114;
cmntField.height = 16;
cmntField.background = true;
cmntField.backgroundColor = 0x404040;
cmntField.border = true;
cmntField.borderColor = 0xFFFFFF;
cmntField.restrict = null;
cmntField.textColor = 0xFFFFFF;
cmntField.type = TextFieldType.INPUT;
cmntField.defaultTextFormat = format;
addChild(cmntField);
dy = (dy + 22);
uploadLabel.x = -36;
uploadLabel.y = dy;
uploadLabel.width = 92;
uploadLabel.height = 16;
uploadLabel.textColor = 0xFFFFFF;
uploadLabel.defaultTextFormat = format;
uploadLabel.text = "Upload replay";
addChild(uploadLabel);
uploadCheck.x = -56;
uploadCheck.y = dy;
state = 0;
while (state < 3) {
button = new Shape();
button.graphics.lineStyle(1, 0xFFFFFF);
button.graphics.beginFill(8421568);
button.graphics.drawRect(0.5, 0.5, 14, 14);
button.graphics.endFill();
button.width = 14;
button.height = 14;
if (state == UPLOAD_OK){
button.graphics.moveTo(3, 4);
button.graphics.lineTo(7, 11);
button.graphics.lineTo(11, 2);
};
uploadCheckShape[state] = button;
state = (state + 1);
};
setUploadCheck(UPLOAD_OK);
addChild(uploadCheck);
dy = (dy + 26);
sendButton.x = -58;
sendButton.y = dy;
sendButton.upState = newSendButton("send", false, 8421568, 0xFFFFFF);
sendButton.overState = newSendButton("send", true, 0xC0C0C0, 4202528);
sendButton.downState = newSendButton("send", false, 0xC0C0C0, 4202528);
sendButton.hitTestState = sendButton.upState;
addChild(sendButton);
cnclButton.x = 2;
cnclButton.y = dy;
cnclButton.upState = newSendButton("cancel", false, 8421568, 0xFFFFFF);
cnclButton.overState = newSendButton("cancel", true, 0xC0C0C0, 4202528);
cnclButton.downState = newSendButton("cancel", false, 0xC0C0C0, 4202528);
cnclButton.hitTestState = cnclButton.upState;
addChild(cnclButton);
}
public function getName():String{
var _local1:String;
_local1 = nameField.text;
return (((_local1.length)<64) ? _local1 : _local1.substr(0, 64));
}
public function activate(_arg1:Function, _arg2:Function):void{
system.main.addChild(this);
funcSend = _arg1;
funcCancel = _arg2;
sendButton.addEventListener(MouseEvent.CLICK, funcSend);
cnclButton.addEventListener(MouseEvent.CLICK, funcCancel);
if (uploadCheckState != UPLOAD_IMPOSSIBLE){
uploadCheck.addEventListener(MouseEvent.CLICK, _onClickUploadCheck);
};
system.main.stage.focus = nameField;
}
public function setName(_arg1:String):void{
nameField.text = _arg1;
}
public function enableUpdate(_arg1:Boolean):void{
uploadCheckState = (_arg1) ? UPLOAD_OK : UPLOAD_IMPOSSIBLE;
setUploadCheck(uploadCheckState);
}
public function getComment():String{
var _local1:String;
_local1 = cmntField.text;
return (((_local1.length)<0x0100) ? _local1 : _local1.substr(0, 0x0100));
}
public function inactivate():void{
system.main.stage.focus = system.main;
system.main.removeChild(this);
sendButton.removeEventListener(MouseEvent.CLICK, funcSend);
cnclButton.removeEventListener(MouseEvent.CLICK, funcCancel);
if (uploadCheckState != UPLOAD_IMPOSSIBLE){
uploadCheck.removeEventListener(MouseEvent.CLICK, _onClickUploadCheck);
};
}
public function setScore(_arg1:uint):void{
score.text = String(_arg1);
}
public function isUploadChecked():Boolean{
return ((uploadCheckState == UPLOAD_OK));
}
private function _onClickUploadCheck(_arg1:MouseEvent):void{
setUploadCheck(((uploadCheckState)==UPLOAD_OK) ? UPLOAD_CANCEL : UPLOAD_OK);
}
public function setText(_arg1:String):void{
message.text = _arg1;
score.text = "";
}
public function setUploadCheck(_arg1:uint):void{
uploadCheckState = _arg1;
if (_arg1 == UPLOAD_IMPOSSIBLE){
uploadCheck.visible = false;
uploadLabel.visible = false;
} else {
uploadCheck.visible = true;
uploadLabel.visible = true;
uploadCheck.upState = uploadCheckShape[_arg1];
uploadCheck.overState = uploadCheck.upState;
uploadCheck.downState = uploadCheck.upState;
uploadCheck.hitTestState = uploadCheck.upState;
};
}
}
class RankingDialog extends Sprite {
private var label:TextField;
private var scoreArea:Array;
private var nameArea:Array;
private var rankArea:Array;
private function RankingDialog(_arg1:Number, _arg2:Number){
var _local3:TextFormat;
var _local4:TextFormat;
var _local5:TextField;
var _local6:int;
label = new TextField();
rankArea = new Array(10);
nameArea = new Array(10);
scoreArea = new Array(10);
super();
x = _arg1;
y = _arg2;
graphics.lineStyle(1, 0xFFFFFF);
graphics.beginFill(0x808080);
graphics.drawRect(-96, -96, 192, 192);
graphics.endFill();
alpha = 0.8;
_local3 = new TextFormat();
_local3.font = "MS Gothic";
_local3.size = 12;
_local3.align = TextFormatAlign.LEFT;
_local4 = new TextFormat();
_local4.font = "MS Gothic";
_local4.size = 12;
_local4.align = TextFormatAlign.RIGHT;
_local5 = new TextField();
label.x = -92;
label.y = -92;
label.width = 184;
label.height = 24;
label.textColor = 0xFFFFFF;
label.defaultTextFormat = _local3;
label.text = "HISTRICAL PLAYERS";
addChild(label);
_local6 = 0;
while (_local6 < 10) {
_local5 = new TextField();
_local5.x = -92;
_local5.y = (-72 + (_local6 * 16));
_local5.width = 16;
_local5.height = 16;
_local5.textColor = 0xFFFFFF;
_local5.defaultTextFormat = _local4;
_local5.text = String((_local6 + 1));
addChild(_local5);
rankArea[_local6] = _local5;
_local5 = new TextField();
_local5.x = -72;
_local5.y = (-72 + (_local6 * 16));
_local5.width = 114;
_local5.height = 16;
_local5.textColor = 0xFFFFFF;
_local5.defaultTextFormat = _local3;
addChild(_local5);
nameArea[_local6] = _local5;
_local5 = new TextField();
_local5.x = 46;
_local5.y = (-72 + (_local6 * 16));
_local5.width = 50;
_local5.height = 16;
_local5.textColor = 0xFFFFFF;
_local5.defaultTextFormat = _local4;
addChild(_local5);
scoreArea[_local6] = _local5;
_local6++;
};
}
public function setName(_arg1:uint, _arg2:uint, _arg3:String):void{
if (_arg1 > 10){
return;
};
scoreArea[_arg1].text = String(_arg2);
nameArea[_arg1].text = _arg3;
}
public function inactivate():void{
system.main.stage.focus = system.main;
system.main.removeChild(this);
}
public function activate():void{
system.main.addChild(this);
}
}
Section 66
//score_manager (score_manager)
package {
import cml.*;
import util.*;
public class score_manager extends manager {
public static const SCENE_HOWTO:uint = 4;
public static const SCENE_REPLAY:uint = 9;
public static const SCENE_GAMEOVER:uint = 5;
public static const SCENE_INITIALIZE:uint = 0;
public static const SCENE_LOADING:uint = 1;
public static const SCENE_RESULT:uint = 7;
public static const BONUS_DESTRUCTION:uint = 0;
public static const SCENE_NAMEENTRY:uint = 6;
public static const SCENE_TITLE:uint = 2;
public static const SCENE_MAIN:uint = 3;
public static const SCENE_COMPLETE:uint = 8;
public static const BONUS_FASTBREAK:uint = 1;
public static const ROUND_MAX:uint = 6;
private static var stage_score:uint = 0;
public static var extend:Boolean = false;
private static var rand:randMT = new randMT();
private static var limitbreak:Boolean = false;
private static var bomberCounter:int = 0;
public static var playCount:uint = 0;
private static var practice:Boolean = false;
public static var log:key_logger = null;
public static var transparent:int = 0;
public static var bonusMode:uint = 0;
public static var shield:uint = 0;
private static var flagShowRanking:Boolean = false;
private static var areaSequence:Array = new Array(1, 8, 2, 9, 4, 13, 1, 8, 2, 9, 4, 13);
private static var start_round:uint = 0;
private static var bossWarningUpper:sprite_information = new sprite_information(448, 64, 16, 16, 0, 0);
private static var scoreBoard:score_board = new score_board();
private static var bossWarningLetter:sprite_information = new sprite_information(0x0100, 64, 192, 32, 0, 0);
private static var replay_index:int = 0;
private static var area:uint = 0;
private static var round:uint = 0;
public static var score:uint = 0;
public static var debugMode:Boolean = false;
private static var destBonus:Array = new Array(50000, 35000, 30000, 25000, 22000, 20000, 18000, 16000, 14000, 12000, 10000);
public static var bomb:uint = 3;
public static var shotLevel:Array = new Array(0, 0, 0);
private static var secret:Boolean = false;
private static var areaName:Array = new Array("THE FOOL", "THE MAGICIAN", "THE HIGH PRIESTESS", "THE EMPRESS", "THE EMPEROR", "THE HIGH EROPHANT", "THE LOVERS", "THE CHARIOT", "STRENGTH", "THE HERMIT", "WHEEL OF FORTUNE", "JUSTICE", "THE HANGED MAN", "DEATH", "TEMPERANCE", "THE DEVIL", "THE TOWER", "THE STAR", "THE MOON", "THE SUN", "JUDGEMENT", "THE WORLD");
private static var enableScore:Boolean = false;
public static var rest:uint = 0;
private static var play_data:user_data = null;
public static var locking:Boolean = false;
private static var isUserDataExist:Boolean = false;
private static var bossWarningLower:sprite_information = new sprite_information(448, 80, 16, 16, 0, 0);
public static var bonusCounter:uint = 0;
private static var bossWarningCount:int = 0;
private static var next_extend:uint = 200000;
private static var hiscore_data:user_data = null;
public static var credit:uint = 0;
public function score_manager(){
log = new key_logger();
hiscore_data = new user_data();
play_data = new user_data();
CMLState.rand = rand.getf;
isUserDataExist = hiscore_data.loadCookie();
play_data.clear();
scoreBoard.setURL((resource_manager.url + "arcscrbrd.cgi"));
}
override public function enterScene():void{
var _local1:uint;
switch (system.scene.get()){
case SCENE_TITLE:
_init();
break;
case SCENE_MAIN:
case SCENE_REPLAY:
_local1 = (round + 1);
if (isAnotherMode()){
screen_manager.printMessage(((((("STAGE 2-" + _local1) + "\n#") + area) + ".") + areaName[area]));
} else {
screen_manager.printMessage(((((("STAGE " + _local1) + "\n#") + area) + ".") + areaName[area]));
};
_startStage();
break;
case SCENE_RESULT:
bonus(getStageBonus());
break;
case SCENE_INITIALIZE:
debugMode = false;
scoreBoard.update();
break;
case SCENE_GAMEOVER:
case SCENE_COMPLETE:
_endAll();
break;
case SCENE_NAMEENTRY:
scoreBoard.entryName(hiscore_data, round);
break;
default:
break;
};
}
override public function draw():void{
switch (system.scene.get()){
case SCENE_MAIN:
case SCENE_REPLAY:
case SCENE_GAMEOVER:
case SCENE_TITLE:
_drawBossWarning();
break;
default:
break;
};
}
override public function run():void{
switch (system.scene.get()){
case SCENE_MAIN:
case SCENE_REPLAY:
log.run();
case SCENE_GAMEOVER:
transparent--;
bossWarningCount--;
bomberCounter--;
break;
case SCENE_TITLE:
if (((system.control.isPressed(system.KEY_RIGHT)) && (isRankingSuccess()))){
if (!flagShowRanking){
scoreBoard.showRanking();
};
flagShowRanking = true;
} else {
if (flagShowRanking){
scoreBoard.hideRanking();
};
flagShowRanking = false;
};
if (isAnotherMode()){
limitbreak = false;
bossWarningCount = ((bossWarningCount - 1) & 15);
} else {
bossWarningCount = -1;
};
break;
default:
break;
};
}
private function _drawBossWarning():void{
var _local1:int;
if (bossWarningCount < 0){
return;
};
resource_manager.drawChip(0, 0, 0, bossWarningLetter);
if (!limitbreak){
_local1 = 0;
while (_local1 < 17) {
resource_manager.drawChip((((_local1 * 16) - 136) + (bossWarningCount & 15)), 24, 0, bossWarningUpper);
resource_manager.drawChip((((_local1 * 16) - 120) - (bossWarningCount & 15)), -24, 0, bossWarningLower);
_local1++;
};
};
}
override public function exitScene():void{
var _local1:int;
var _local2:int;
var _local3:int;
switch (system.scene.get()){
case SCENE_MAIN:
case SCENE_REPLAY:
_endStage();
break;
case SCENE_TITLE:
if (flagShowRanking){
scoreBoard.hideRanking();
};
_local1 = screen_manager.getSelectedMenuID();
_local2 = ((_local1 >> 4) & 15);
_local3 = (((_local1 >> 8) & 15) - 1);
switch ((_local1 & 15)){
case 1:
_setRecordMode(resource_manager.START_ROUND);
_startAll();
break;
case 2:
_setPracticeMode((_local2 - 1));
_startAll();
break;
case 3:
if (!_startLoadingReplay(_local2)){
system.scene.change(SCENE_TITLE);
};
_setReplayMode(_local3);
_startAll();
break;
case 4:
switchAnotherMode();
system.scene.change(SCENE_INITIALIZE);
break;
case 6:
system.scene.change(SCENE_HOWTO);
break;
};
break;
case SCENE_LOADING:
if (isReplay()){
if (!_updateReplay()){
system.scene.change(SCENE_TITLE);
};
};
break;
case SCENE_RESULT:
if (((isReplay()) || (practice))){
system.scene.change(score_manager.SCENE_TITLE);
} else {
_nextRound();
};
break;
case SCENE_GAMEOVER:
case SCENE_COMPLETE:
if (((!(isReplay())) && (isHighScore()))){
if (scoreBoard.isEnableToEntry(hiscore_data.score)){
system.scene.change(SCENE_NAMEENTRY);
};
};
break;
case SCENE_NAMEENTRY:
hiscore_data.name = scoreBoard.getName();
default:
break;
};
}
private static function _endMaximumPower():void{
if ((((((shotLevel[0] == 3)) && ((shotLevel[1] == 3)))) && ((shotLevel[2] == 3)))){
shotLevel[0] = 2;
shotLevel[1] = 2;
shotLevel[2] = 2;
};
}
public static function getDestructionBonus():uint{
var _local1:uint;
_local1 = uint((object_manager.getDestructionRatio() * 100));
return (((_local1)>=90) ? destBonus[(100 - _local1)] : (_local1 * 100));
}
public static function limitBreak():void{
limitbreak = true;
bossWarningCount = 40;
}
public static function isHighScore():Boolean{
return (((((!(isReplay())) && (!(debugMode)))) && ((hiscore_data.score == play_data.score))));
}
public static function miss():void{
if (rest == 0){
system.scene.change(SCENE_GAMEOVER);
} else {
rest--;
};
}
public static function getBossDamageBonus():uint{
var _local1:Actor;
_local1 = object_manager.getBossEnemy();
if (_local1 == null){
return (0);
};
return ((uint(((1 - _local1.life) * 10000)) * 10));
}
public static function endBonus(_arg1:uint):void{
if (bonusCounter >= _arg1){
if (!isReplay()){
switch (bonusMode){
case BONUS_DESTRUCTION:
screen_manager.printMessage("#SECRET DESTROY ALL");
break;
case BONUS_FASTBREAK:
screen_manager.printMessage("#SECRET FAST BREAK ALL");
break;
};
};
resource_manager.playSound(7);
secret = true;
};
bonusCounter = 0;
}
public static function enterCount():int{
return ((transparent - 120));
}
public static function getSecretBonus():uint{
return ((secret) ? 20000 : 0);
}
public static function bonus(_arg1:uint):void{
if (!enableScore){
return;
};
score = (score + _arg1);
stage_score = (stage_score + _arg1);
if (score >= next_extend){
extend = true;
next_extend = (next_extend + ((next_extend)==200000) ? 200000 : 400000);
};
}
public static function clearCookie():void{
hiscore_data.clearCookie();
}
private static function _setReplayMode(_arg1:uint):void{
start_round = _arg1;
log.replay();
}
public static function getPreviousScore():uint{
return (play_data.score);
}
private static function _startAll():void{
if (((!(isReplay())) && (!(practice)))){
credit--;
};
rebirth();
round = start_round;
area = areaSequence[round];
rest = 2;
bomb = 3;
score = 0;
next_extend = 200000;
extend = false;
bossWarningCount = 0;
bomberCounter = 0;
if (!isReplay()){
play_data.clear();
if (practice){
shotLevel[0] = 1;
shotLevel[1] = 1;
shotLevel[2] = 1;
};
};
enableScore = true;
}
public static function getLimitBreakBonus():uint{
return ((limitbreak) ? 20000 : 0);
}
public static function isPreviousReplayAvailable():Boolean{
return (play_data.isReplayAvailable());
}
public static function getPower():uint{
return (((shotLevel[0] + shotLevel[1]) + shotLevel[2]));
}
public static function getStageLimit():uint{
return (user_data.getRoundLimit());
}
public static function isRankingReplayAvailable(_arg1:uint):Boolean{
return (scoreBoard.isReplayAvailable(_arg1));
}
public static function getRankingStageScore(_arg1:uint):String{
return (scoreBoard.getStageScoreString(_arg1));
}
public static function fastBreakEnemy(_arg1:uint):void{
screen_manager.printMessage("FAST BREAK");
if (bonusMode == BONUS_FASTBREAK){
bonusCounter++;
};
bonus((_arg1 * 2));
}
public static function getHighScore():uint{
return (hiscore_data.score);
}
private static function _endStage():void{
_endStageLog();
locking = false;
}
private static function _shotPowerUp(_arg1:uint):void{
var _local2:String;
if (shotLevel[_arg1] < 2){
var _local3 = shotLevel;
var _local4 = _arg1;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
_local2 = String(shotLevel[_arg1]);
switch (_arg1){
case 0:
screen_manager.printMessage(("FRONT SHOT LEVEL " + _local2));
break;
case 1:
screen_manager.printMessage(("SIDE SHOT LEVEL " + _local2));
break;
case 2:
screen_manager.printMessage(("LOCKON RAY LEVEL " + _local2));
break;
};
} else {
if (shotLevel[0] == 3){
shotLevel[0] = 2;
};
if (shotLevel[1] == 3){
shotLevel[1] = 2;
};
if (shotLevel[2] == 3){
shotLevel[2] = 2;
};
shotLevel[_arg1] = 3;
bonus(2000);
switch (_arg1){
case 0:
screen_manager.printMessage("FRONT SHOT LEVEL MAX");
break;
case 1:
screen_manager.printMessage("SIDE SHOT LEVEL MAX");
break;
case 2:
screen_manager.printMessage("LOCKON RAY LEVEL MAX");
break;
};
};
}
private static function _startStage():void{
bonusCounter = 0;
secret = false;
limitbreak = false;
stage_score = 0;
transparent = 160;
_startStageLog();
}
public static function rebirth():void{
if (debugMode){
shotLevel[0] = 2;
shotLevel[1] = 2;
shotLevel[2] = 2;
} else {
shotLevel[0] = 0;
shotLevel[1] = 0;
shotLevel[2] = 0;
};
shield = 0;
bomb = 3;
transparent = 160;
}
public static function bossWarning():void{
limitbreak = false;
bossWarningCount = 120;
}
public static function getRankingScore(_arg1:uint):uint{
return (scoreBoard.getScore(_arg1));
}
public static function isAnotherModeAvailable():Boolean{
return (user_data.isAnotherAvailable());
}
public static function bomberCount():int{
return (bomberCounter);
}
public static function getPreviousStageScore(_arg1:uint):uint{
return (play_data.getStageScore(_arg1));
}
public static function isFinalRound():Boolean{
return ((round == (ROUND_MAX - 1)));
}
public static function isExtended():Boolean{
return (extend);
}
public static function powerUp(_arg1:uint):Boolean{
var _local2:Boolean;
_local2 = true;
switch (_arg1){
case 3:
if (shield == 0){
screen_manager.printMessage("SHIELD RECOVER");
_endMaximumPower();
shield = 1;
} else {
screen_manager.printMessage("SHIELD BONUS +10000");
_endMaximumPower();
bonus(10000);
};
break;
case 4:
if (bomb < 3){
screen_manager.printMessage("BOMB GAIN");
bomb++;
} else {
screen_manager.printMessage("BOMB MAX BONUS +10000");
bonus(10000);
};
break;
case 5:
screen_manager.printMessage("EXTEND PLAYER");
rest++;
break;
case 6:
if ((((((shotLevel[0] == 2)) && ((shotLevel[1] == 2)))) && ((shotLevel[2] == 2)))){
screen_manager.printMessage("MAXIMUM POWER");
shotLevel[0] = 3;
shotLevel[1] = 3;
shotLevel[2] = 3;
} else {
if (((shotLevel[0] + shotLevel[1]) + shotLevel[2]) > 6){
screen_manager.printMessage("MAXIMUM POWER BONUS +20000");
bonus(20000);
} else {
screen_manager.printMessage("ITEM BROKEN ...");
_local2 = false;
};
};
break;
default:
_shotPowerUp(_arg1);
break;
};
if (transparent < 80){
transparent = 80;
};
return (_local2);
}
public static function switchAnotherMode():void{
user_data.switchAnotherMode();
scoreBoard.update();
if (isAnotherMode()){
resource_manager.playSound(8);
};
}
public static function getHiStageScore(_arg1:uint):uint{
return (hiscore_data.getStageScore(_arg1));
}
public static function isFirstTime():Boolean{
return (!(isUserDataExist));
}
private static function _setRecordMode(_arg1:uint):void{
practice = false;
start_round = _arg1;
log.record();
}
private static function _startLoadingReplay(_arg1:int):Boolean{
var _local2:int;
replay_index = _arg1;
switch (replay_index){
case 1:
if (!isPreviousReplayAvailable()){
return (false);
};
break;
case 2:
if (!isHiscoreReplayAvailable()){
return (false);
};
break;
default:
_local2 = (replay_index - 3);
if (!isRankingReplayAvailable(_local2)){
return (false);
};
scoreBoard.downloadReplay(_local2);
break;
};
return (true);
}
private static function _endStageLog():void{
log.endStage();
}
public static function destroyEnemy(_arg1:uint):void{
bonus(_arg1);
}
public static function isAnotherMode():Boolean{
return (!((user_data.isAnotherMode() == 0)));
}
public static function isRankingSuccess():Boolean{
return (scoreBoard.isSuccess());
}
public static function playerDamage():Boolean{
if ((((shield == 1)) || (debugMode))){
shield = 0;
transparent = 80;
return (false);
};
miss();
return (true);
}
private static function _setPracticeMode(_arg1:uint):void{
practice = true;
start_round = _arg1;
log.record();
}
public static function getStageBonus():uint{
return ((((((getRestBonus() + getBombBonus()) + getBossDamageBonus()) + getDestructionBonus()) + getLimitBreakBonus()) + getSecretBonus()));
}
public static function secretEnemy():void{
if (bonusMode == BONUS_DESTRUCTION){
bonusCounter++;
};
}
public static function isTransparent():Boolean{
return ((transparent > 0));
}
public static function isReplay():Boolean{
return (log.isReplay());
}
public static function isReadyToStart():Boolean{
return ((score_manager.credit > 0));
}
public static function bomber():Boolean{
if (bomb == 0){
return (false);
};
bomb--;
transparent = 120;
bomberCounter = 40;
return (true);
}
public static function getRound():uint{
return ((round + (user_data.isAnotherMode() * ROUND_MAX)));
}
private static function _nextRound():void{
play_data.setStageScore(round, stage_score);
user_data.updateRoundLimit((round + 1));
if (isFinalRound()){
round++;
system.scene.change(score_manager.SCENE_COMPLETE);
} else {
round++;
if (bomb < 3){
bomb++;
};
area = areaSequence[round];
};
}
public static function startBonus(_arg1:uint):void{
bonusMode = _arg1;
bonusCounter = 0;
}
private static function _endAll():void{
enableScore = false;
if (!isReplay()){
if (resource_manager.isEscaped()){
play_data.clear();
} else {
play_data.setStageScore(round, stage_score);
play_data.score = score;
play_data.replay = log.encode();
hiscore_data.update(play_data);
};
};
}
public static function getRankingMessage():String{
return (scoreBoard.error_message);
}
private static function _startStageLog():void{
if (isReplay()){
log.startStage(round);
rest = log.stage.rest;
bomb = log.stage.bomb;
shotLevel[0] = log.stage.shot0;
shotLevel[1] = log.stage.shot1;
shotLevel[2] = log.stage.shot2;
shield = log.stage.shield;
score = log.stage.score;
extend = log.stage.extend;
while (score >= next_extend) {
next_extend = (next_extend + ((next_extend)==200000) ? 200000 : 400000);
};
rand.seed = log.stage.seed;
} else {
log.stage.seed = new Date().getTime();
log.stage.rest = rest;
log.stage.bomb = bomb;
log.stage.shot0 = shotLevel[0];
log.stage.shot1 = shotLevel[1];
log.stage.shot2 = shotLevel[2];
log.stage.shield = shield;
log.stage.score = score;
log.stage.extend = extend;
log.startStage(round);
rand.seed = log.stage.seed;
};
}
public static function getBombBonus():uint{
return ((isFinalRound()) ? (bomb * 15000) : (bomb * 5000));
}
private static function _updateReplay():Boolean{
switch (replay_index){
case 1:
log.decode(play_data.replay);
break;
case 2:
log.decode(hiscore_data.replay);
break;
default:
if (!isRankingSuccess()){
return (false);
};
log.decode(scoreBoard.getReplayData());
break;
};
return (true);
}
public static function insertCoin():void{
if (((!((system.scene.get() == SCENE_NAMEENTRY))) && ((credit < 99)))){
credit = (credit + 10);
resource_manager.playSound(7);
};
}
private static function _init():void{
rest = 2;
bomb = 3;
score = 0;
start_round = 0;
bossWarningCount = 0;
replay_index = 0;
enableScore = false;
hiscore_data.saveCookie();
}
public static function isRankingLoading():Boolean{
return (scoreBoard.isLoading());
}
public static function isHiscoreReplayAvailable():Boolean{
return (hiscore_data.isReplayAvailable());
}
public static function getRestBonus():uint{
return ((isFinalRound()) ? (rest * 30000) : (rest * 10000));
}
}
}//package
Section 67
//screen_manager (screen_manager)
package {
import flash.net.*;
public class screen_manager extends manager {
private static var replaySelect:TitleMenu;
private static var guageDrawY:Number;
private static var quakeSize:Number = 0;
private static var msgCount:uint = 0;
private static var msg1:String = null;
private static var msg2:String = null;
private static var optionSelect:TitleMenu;
private static var stageSelect:TitleMenu;
private static var draw_score:uint = 0;
private static var guageY:Number;
private static var selectedMenuID:uint;
private static var mainMenu:TitleMenu;
private static var counter:uint = 0;
public function screen_manager(){
mainMenu = new TitleMenu();
replaySelect = new TitleMenu();
stageSelect = new TitleMenu();
optionSelect = new TitleMenu();
replaySelect.init(_replaySelect);
replaySelect.add(1, "PREVIOUS", stageSelect);
replaySelect.add(2, "HIGHSCORE", stageSelect);
replaySelect.add(3, "NETRANK 1", stageSelect);
replaySelect.add(4, "NETRANK 2", stageSelect);
replaySelect.add(5, "NETRANK 3", stageSelect);
replaySelect.add(6, "NETRANK 4", stageSelect);
replaySelect.add(7, "NETRANK 5", stageSelect);
replaySelect.add(8, "NETRANK 6", stageSelect);
replaySelect.add(9, "NETRANK 7", stageSelect);
replaySelect.add(10, "NETRANK 8", stageSelect);
replaySelect.add(11, "NETRANK 9", stageSelect);
replaySelect.add(12, "NETRANK10", stageSelect);
replaySelect.add(0, "BACK");
stageSelect.init();
stageSelect.add(1, "STAGE1");
stageSelect.add(2, "STAGE2");
stageSelect.add(3, "STAGE3");
stageSelect.add(4, "STAGE4");
stageSelect.add(5, "STAGE5");
stageSelect.add(6, "STAGE6");
stageSelect.add(0, "BACK");
optionSelect.init(_optionSelect);
optionSelect.add(1, "DISPLAY x2");
optionSelect.add(2, "ACCESS WEBPAGE");
optionSelect.add(3, "RESET ALL");
optionSelect.add(0, "BACK");
optionSelect.update(0, 0);
mainMenu.init(_mainMenuSelect);
mainMenu.add(1, "START");
mainMenu.add(2, "PRACTICE", stageSelect);
mainMenu.add(3, "REPLAY", replaySelect);
mainMenu.add(4, "ANOTHER MODE");
mainMenu.add(5, "OPTION", optionSelect);
mainMenu.add(6, "HOW TO PLAY");
}
private function _drawResult():void{
var _local1:String;
resource_manager.print(-60, 96, "- AREA REPORT -");
resource_manager.print(-68, 64, "PLAYER");
system.screen.fillRect((-68 + 120), (159 - 54), 136, 1, 0xFFFFFF);
if (score_manager.isFinalRound()){
__drawResultBonus(50, "|x30000", score_manager.getRestBonus());
__drawResultBonus(40, "{x15000", score_manager.getBombBonus());
} else {
__drawResultBonus(50, "|x10000", score_manager.getRestBonus());
__drawResultBonus(40, "{x5000", score_manager.getBombBonus());
};
resource_manager.print(-68, 16, "DESTRUCTION");
system.screen.fillRect((-68 + 120), (159 - 6), 136, 1, 0xFFFFFF);
_local1 = (("RATIO " + String((uint((object_manager.getDestructionRatio() * 1000)) / 10))) + "%");
__drawResultBonus(2, _local1, score_manager.getDestructionBonus());
__drawResultBonus(-8, "SECRET", score_manager.getSecretBonus());
resource_manager.print(-68, -32, "BOSS");
system.screen.fillRect((-68 + 120), (159 + 42), 136, 1, 0xFFFFFF);
__drawResultBonus(-46, "DAMAGE", score_manager.getBossDamageBonus());
__drawResultBonus(-56, "LIMIT BREAK ", score_manager.getLimitBreakBonus());
__drawResultBonus(-88, "TOTAL", score_manager.getStageBonus());
}
private function start():void{
draw_score = score_manager.score;
guageY = 0;
guageDrawY = 0;
}
private function _drawComplete():void{
resource_manager.print(-68, 16, "CONGRATURATIONS!!");
resource_manager.print(-88, 0, "YOU CLEARED ALL AREAS.");
if (score_manager.isHighScore()){
resource_manager.print(-52, -16, "HIGH SCORE !!");
};
}
override public function draw():void{
var _local1:String;
switch (system.scene.get()){
case score_manager.SCENE_REPLAY:
_drawReplay();
case score_manager.SCENE_MAIN:
case score_manager.SCENE_NAMEENTRY:
_drawScore();
_drawPower();
_drawMessage();
break;
case score_manager.SCENE_TITLE:
_drawScore();
_drawTitle();
if (score_manager.isReadyToStart()){
mainMenu.draw();
};
resource_manager.print(-32, -144, ("CREDIT " + String(score_manager.credit)));
if (score_manager.isRankingLoading()){
resource_manager.print(48, -152, "LOAD RANKING");
} else {
if (!score_manager.isRankingSuccess()){
_local1 = score_manager.getRankingMessage();
resource_manager.print((120 - (_local1.length * 8)), -152, _local1);
} else {
resource_manager.print(-80, -152, "PRESS RIGHT TO SHOW TOP10");
};
};
break;
case score_manager.SCENE_LOADING:
_drawLoading();
if (!score_manager.isReplay()){
resource_manager.drawHowTo();
};
break;
case score_manager.SCENE_RESULT:
_drawScore();
_drawPower();
_drawResult();
break;
case score_manager.SCENE_GAMEOVER:
_drawScore();
_drawPower();
_drawGameover();
break;
case score_manager.SCENE_COMPLETE:
_drawScore();
_drawPower();
_drawComplete();
break;
case score_manager.SCENE_HOWTO:
_drawScore();
resource_manager.drawHowTo();
resource_manager.print(-76, -136, "PRESS SHOT TO TITLE");
break;
default:
break;
};
}
private function _drawPower():void{
guageDrawY = (guageDrawY + ((guageY - guageDrawY) * 0.2));
resource_manager.print(48, (-136 - guageDrawY), "FRONT");
resource_manager.print(56, (-144 - guageDrawY), "SIDE");
resource_manager.print(64, (-152 - guageDrawY), "RAY");
resource_manager.drawGuage(88, (-136 - guageDrawY), 0, (score_manager.shotLevel[0] + 1), 4);
resource_manager.drawGuage(88, (-144 - guageDrawY), 1, (score_manager.shotLevel[1] + 1), 4);
resource_manager.drawGuage(88, (-152 - guageDrawY), 2, (score_manager.shotLevel[2] + 1), 4);
}
private function _drawReplay():void{
resource_manager.print(-119, -152, "REPLAY MODE");
}
override public function run():void{
counter++;
switch (system.scene.get()){
case score_manager.SCENE_TITLE:
case score_manager.SCENE_HOWTO:
draw_score = score_manager.getHighScore();
if (score_manager.isReadyToStart()){
if (!mainMenu.run()){
selectedMenuID = mainMenu.getSelectedID(0);
};
};
break;
default:
draw_score = (draw_score + (((score_manager.score - draw_score) + 1) >> 1));
break;
};
if (quakeSize > 0.5){
system.screen.x = ((Math.random() - 0.5) * quakeSize);
system.screen.y = ((Math.random() - 0.5) * quakeSize);
quakeSize = (quakeSize * 0.85);
} else {
system.screen.x = 0;
system.screen.y = 0;
};
}
override public function exitScene():void{
switch (system.scene.get()){
case score_manager.SCENE_TITLE:
msg1 = null;
msg2 = null;
break;
};
}
private function _drawScore():void{
var _local1:int;
var _local2:String;
var _local3:String;
_local2 = "";
_local3 = String(draw_score);
_local1 = _local3.length;
while (_local1 < 10) {
_local2 = (_local2 + "0");
_local1++;
};
resource_manager.print(-119, 159, (("SCORE:" + _local2) + _local3));
_local1 = 0;
_local2 = "";
while (_local1 < score_manager.rest) {
_local2 = (_local2 + "|");
_local1++;
};
resource_manager.print(-119, 151, ("REST :" + _local2));
_local1 = 0;
_local2 = "";
while (_local1 < score_manager.bomb) {
_local2 = (_local2 + "{");
_local1++;
};
while (_local1 < 3) {
_local2 = (_local2 + "}");
_local1++;
};
resource_manager.print(-119, 143, ("BOMB :" + _local2));
resource_manager.print(80, 159, ("FPS" + String(system.fps.get())));
if (score_manager.debugMode){
resource_manager.print(80, 151, "DEBUG");
};
}
private function _drawGameover():void{
resource_manager.print(-60, 16, "G A M E O V E R");
if (score_manager.isHighScore()){
resource_manager.print(-52, 0, "HIGH SCORE !!");
};
}
override public function enterScene():void{
counter = 0;
switch (system.scene.get()){
case score_manager.SCENE_MAIN:
case score_manager.SCENE_REPLAY:
start();
break;
case score_manager.SCENE_TITLE:
mainMenu.setEnable(4, score_manager.isAnotherModeAvailable());
mainMenu.update(0, 0);
_updateReplaySelectMenu();
stageSelect.update(0, 0);
selectedMenuID = 0;
break;
default:
break;
};
}
private function _drawTitle():void{
resource_manager.print(-84, 88, "- A R C A N A C R A -");
resource_manager.print((-(resource_manager.version.length) * 4), 72, resource_manager.version);
resource_manager.print(-56, -108, "@ keim Si 2007");
if (score_manager.isReadyToStart()){
if ((counter & 8)){
resource_manager.print(-76, -72, "PRESS SHOT TO START");
};
} else {
resource_manager.print(-80, -72, "CLICK TO INSERT COINS");
};
}
private function _drawLoading():void{
var _local1:String;
_local1 = resource_manager.getLoadingFileName();
resource_manager.print((80 - (_local1.length * 8)), -152, _local1);
resource_manager.print(88, -152, (uint((resource_manager.getLoadingProgression() * 100)) + "%"));
}
private function _drawMessage():void{
if (msg1 != null){
resource_manager.print((-(msg1.length) * 4), (40 - (msgCount >> 1)), msg1);
if (msg2 != null){
resource_manager.print((-(msg2.length) * 4), (28 - (msgCount >> 1)), msg2);
};
if (--msgCount == 0){
msg1 = null;
msg2 = null;
};
};
}
private function __drawResultBonus(_arg1:Number, _arg2:String, _arg3:uint):void{
var _local4:String;
resource_manager.print(-68, _arg1, _arg2);
_local4 = String(_arg3);
resource_manager.print((68 - (_local4.length * 8)), _arg1, _local4);
}
private static function _updateReplaySelectMenu():void{
var _local1:int;
replaySelect.setEnable(1, score_manager.isPreviousReplayAvailable());
replaySelect.setSubText(1, String(score_manager.getPreviousScore()));
replaySelect.setEnable(2, score_manager.isHiscoreReplayAvailable());
replaySelect.setSubText(2, String(score_manager.getHighScore()));
_local1 = 0;
while (_local1 < 10) {
replaySelect.setEnable((_local1 + 3), score_manager.isRankingReplayAvailable(_local1));
replaySelect.setSubText((_local1 + 3), String(score_manager.getRankingScore(_local1)));
_local1++;
};
replaySelect.update(0, 0);
}
private static function _optionSelect(_arg1:uint):Boolean{
switch (_arg1){
case 1:
navigateToURL(new URLRequest((resource_manager.url + "v04_x2.html")), "_blank");
navigateToURL(new URLRequest((resource_manager.url + "v04_dummy.html")), "_self");
return (false);
case 2:
navigateToURL(new URLRequest(resource_manager.webpage), "_blank");
return (false);
case 3:
score_manager.clearCookie();
replaySelect.setEnable(2, false);
replaySelect.setSubText(2, "0");
replaySelect.resetCursor();
mainMenu.setEnable(4, false);
return (false);
};
return (true);
}
public static function printMessage(_arg1:String):void{
var _local2:int;
_local2 = _arg1.indexOf("\n");
if (_local2 == -1){
msg1 = _arg1;
msg2 = null;
} else {
msg1 = _arg1.substr(0, _local2);
msg2 = _arg1.substr((_local2 + 1));
};
msgCount = 80;
}
public static function quake(_arg1:Number):void{
quakeSize = _arg1;
}
public static function getSelectedMenuID():uint{
return (selectedMenuID);
}
private static function _mainMenuSelect(_arg1:uint):Boolean{
var _local2:int;
var _local3:int;
var _local4:uint;
switch (_arg1){
case 2:
_local3 = (score_manager.getStageLimit() + 1);
_local2 = 0;
while (_local2 < _local3) {
_local4 = score_manager.getHiStageScore(_local2);
stageSelect.setSubText((_local2 + 1), String(_local4));
stageSelect.setEnable((_local2 + 1), (_local4 > 0));
_local2++;
};
_local2 = _local3;
while (_local2 < score_manager.ROUND_MAX) {
stageSelect.setSubText((_local2 + 1), "LOCKED");
stageSelect.setEnable((_local2 + 1), false);
_local2++;
};
stageSelect.update(0, 0);
break;
};
return (true);
}
private static function _replaySelect(_arg1:uint):Boolean{
var _local2:uint;
var _local3:int;
var _local4:int;
var _local5:Array;
_local4 = (score_manager.getStageLimit() + 1);
switch (_arg1){
case 1:
if (!score_manager.isPreviousReplayAvailable()){
return (false);
};
_local3 = 0;
while (_local3 < _local4) {
_local2 = score_manager.getPreviousStageScore(_local3);
stageSelect.setSubText((_local3 + 1), String(_local2));
stageSelect.setEnable((_local3 + 1), (_local2 > 0));
_local3++;
};
break;
case 2:
if (!score_manager.isHiscoreReplayAvailable()){
return (false);
};
_local3 = 0;
while (_local3 < _local4) {
_local2 = score_manager.getHiStageScore(_local3);
stageSelect.setSubText((_local3 + 1), String(_local2));
stageSelect.setEnable((_local3 + 1), (_local2 > 0));
_local3++;
};
break;
default:
if (!score_manager.isRankingReplayAvailable((_arg1 - 3))){
return (false);
};
_local5 = score_manager.getRankingStageScore((_arg1 - 3)).split(":");
_local3 = 0;
while (_local3 < _local4) {
_local2 = ((_local3)<_local5.length) ? uint(_local5[_local3]) : 0;
stageSelect.setSubText((_local3 + 1), String(_local2));
stageSelect.setEnable((_local3 + 1), (_local2 > 0));
_local3++;
};
break;
};
_local3 = _local4;
while (_local3 < score_manager.ROUND_MAX) {
stageSelect.setSubText((_local3 + 1), "LOCKED");
stageSelect.setEnable((_local3 + 1), false);
_local3++;
};
stageSelect.update(0, 0);
return (true);
}
public static function hidePowerGuage(_arg1:Boolean):void{
guageY = (_arg1) ? 22 : 0;
}
}
}//package
import flash.display.*;
class TitleMenu {
private var sub:Array;
private var tab:Number;// = 0
private var cursor:int;
private var id:Array;
private var selectable:Array;
private var submenu:TitleMenu;// = null
private var funcSelect:Function;
private var text2:Array;
private var back:Shape;
private var text:Array;
private var index_max:int;
private var x:Number;// = 0
private var y:Number;// = 0
private var selectedID:uint;// = 0
private function TitleMenu(){
back = new Shape();
text = new Array();
text2 = new Array();
id = new Array();
selectable = new Array();
sub = new Array();
x = 0;
y = 0;
tab = 0;
selectedID = 0;
submenu = null;
super();
index_max = 0;
cursor = 0;
funcSelect = null;
selectedID = 0;
submenu = null;
}
private function _getIndex(_arg1:uint):int{
var _local2:int;
var _local3:int;
_local2 = id.length;
_local3 = 0;
while (_local3 < _local2) {
if (uint(id[_local3]) == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function getSelectedID(_arg1:uint):uint{
if (submenu != null){
_arg1 = submenu.getSelectedID(_arg1);
};
return (((_arg1 << 4) | selectedID));
}
public function setEnable(_arg1:uint, _arg2:Boolean):void{
var _local3:int;
_local3 = _getIndex(_arg1);
if (_local3 < selectable.length){
selectable[_local3] = _arg2;
};
}
public function update(_arg1:Number, _arg2:Number):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
_local5 = 0;
_local6 = 0;
index_max = id.length;
_local3 = 0;
while (_local3 < index_max) {
_local4 = String(text[_local3]).length;
if (_local5 < _local4){
_local5 = _local4;
};
_local4 = String(text2[_local3]).length;
if (_local6 < _local4){
_local6 = _local4;
};
_local3++;
};
_local7 = ((((_local5 + _local6) + 2) * 8) + 8);
_local8 = ((index_max * 8) + 8);
x = (_arg1 - (_local7 * 0.5));
y = (_arg2 + (_local8 * 0.5));
tab = (((_local5 + _local6) + 1) * 8);
back.graphics.clear();
back.graphics.lineStyle(1, 8421568);
back.graphics.beginFill(4210784);
back.graphics.drawRect((119.5 + x), (159.5 - y), _local7, _local8);
back.graphics.endFill();
while ((((cursor < index_max)) && (!(selectable[cursor])))) {
cursor++;
};
}
public function run():Boolean{
if (index_max == 0){
return (true);
};
if (submenu != null){
if (!submenu.run()){
if (submenu.selectedID > 0){
return (false);
};
submenu = null;
};
} else {
if (system.control.isHitted(system.KEY_DOWN)){
do {
cursor++;
if (cursor == index_max){
cursor = 0;
};
} while (!(selectable[cursor]));
} else {
if (system.control.isHitted(system.KEY_UP)){
do {
cursor--;
if (cursor == -1){
cursor = (index_max - 1);
};
} while (!(selectable[cursor]));
} else {
if (system.control.isHitted(system.KEY_BUTTON1)){
selectedID = uint(id[cursor]);
if (selectedID == 0){
return (false);
};
if (funcSelect != null){
if (!funcSelect(selectedID)){
return (true);
};
};
submenu = sub[cursor];
if (submenu == null){
return (false);
};
} else {
if (system.control.isHitted(system.KEY_BUTTON2)){
selectedID = 0;
return (false);
};
};
};
};
};
return (true);
}
public function resetCursor():void{
cursor = 0;
while ((((cursor < index_max)) && (!(selectable[cursor])))) {
cursor++;
};
}
public function init(_arg1:Function=null):TitleMenu{
funcSelect = _arg1;
id.length = 0;
selectable.length = 0;
text.length = 0;
text2.length = 0;
sub.length = 0;
return (this);
}
public function setSubText(_arg1:uint, _arg2:String):void{
var _local3:int;
_local3 = _getIndex(_arg1);
if (_local3 < text2.length){
text2[_local3] = _arg2;
};
}
public function draw():void{
var _local1:int;
if (index_max == 0){
return;
};
if (submenu != null){
submenu.draw();
} else {
system.screen.draw(back);
_local1 = 0;
while (_local1 < index_max) {
if (selectable[_local1]){
resource_manager.print((x + 12), ((y - 4) - (_local1 * 8)), text[_local1]);
resource_manager.print((((x + tab) + 12) - (text2[_local1].length * 8)), ((y - 4) - (_local1 * 8)), text2[_local1]);
} else {
resource_manager.printGray((x + 12), ((y - 4) - (_local1 * 8)), text[_local1]);
resource_manager.printGray((((x + tab) + 12) - (text2[_local1].length * 8)), ((y - 4) - (_local1 * 8)), text2[_local1]);
};
_local1++;
};
resource_manager.print((x + 4), ((y - 4) - (cursor * 8)), ">");
};
}
public function add(_arg1:uint, _arg2:String, _arg3:TitleMenu=null):TitleMenu{
id.push(_arg1);
selectable.push(true);
text.push(_arg2);
text2.push("");
sub.push(_arg3);
return (this);
}
}
Section 68
//sprite_information (sprite_information)
package {
public class sprite_information {
public var h:uint;
public var tx:uint;
public var ty:uint;
public var animMax:uint;
public var cx:uint;
public var cy:uint;
public var w:uint;
public var animInterval:uint;
public function sprite_information(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint){
tx = _arg1;
ty = _arg2;
w = _arg3;
h = _arg4;
cx = (w / 2);
cy = (h / 2);
animMax = _arg5;
animInterval = _arg6;
}
}
}//package
Section 69
//stage_info (stage_info)
package {
import flash.utils.*;
public class stage_info {
public var bomb:int;// = 0
public var shield:int;// = 0
public var seed:uint;// = 0
public var rest:int;// = 0
public var shot0:int;// = 0
public var shot1:int;// = 0
public var shot2:int;// = 0
public var score:uint;// = 0
public var extend:Boolean;// = false
public function stage_info(){
seed = 0;
rest = 0;
bomb = 0;
shot0 = 0;
shot1 = 0;
shot2 = 0;
shield = 0;
score = 0;
extend = false;
super();
}
public function read(_arg1:ByteArray):void{
seed = _arg1.readUnsignedInt();
score = _arg1.readUnsignedInt();
rest = _arg1.readUnsignedByte();
bomb = _arg1.readUnsignedByte();
shot0 = _arg1.readUnsignedByte();
shot1 = _arg1.readUnsignedByte();
shot2 = _arg1.readUnsignedByte();
shield = _arg1.readUnsignedByte();
extend = _arg1.readBoolean();
}
public function write(_arg1:ByteArray):void{
_arg1.writeUnsignedInt(seed);
_arg1.writeUnsignedInt(score);
_arg1.writeByte(rest);
_arg1.writeByte(bomb);
_arg1.writeByte(shot0);
_arg1.writeByte(shot1);
_arg1.writeByte(shot2);
_arg1.writeByte(shield);
_arg1.writeBoolean(extend);
}
}
}//package
Section 70
//system (system)
package {
import flash.display.*;
public class system {
public static const KEY_BUTTON2:uint = 6;
public static const KEY_BUTTON3:uint = 7;
public static const KEY_RIGHT:uint = 3;
public static const KEY_BUTTON0:uint = 4;
public static const KEY_LEFT:uint = 2;
public static const KEY_BUTTON4:uint = 8;
public static const KEY_BUTTON5:uint = 9;
public static const KEY_ESCAPE:uint = 14;
public static const KEY_BUTTON6:uint = 10;
public static const KEY_BUTTON7:uint = 11;
public static const KEY_START:uint = 12;
public static const KEY_UP:uint = 0;
public static const KEY_SYSTEM:uint = 15;
public static const KEY_RESET:uint = 13;
public static const KEY_DOWN:uint = 1;
public static const KEY_BUTTON1:uint = 5;
public static var scene:SceneModule;
public static var control:ControlModule;
public static var fps:FPSModule;
public static var screen:ScreenModule;
public static var main:Sprite;
public static function register(_arg1:manager):void{
scene._register(_arg1);
}
public static function boot(_arg1:Sprite, _arg2:uint, _arg3:uint, _arg4:uint=0):void{
main = _arg1;
screen = new ScreenModule(main, _arg2, _arg3, _arg4);
control = new ControlModule(main);
fps = new FPSModule(main);
scene = new SceneModule(main);
}
}
}//package
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
class ControlModule {
private var flagPressed:uint;// = 0
private var keyCode:Array;
private var counter:Array;
private function ControlModule(_arg1:Sprite){
flagPressed = 0;
counter = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
keyCode = [38, 40, 37, 39, 16, 90, 88, 67, 86, 65, 83, 68, 32, 13, 81, 48];
super();
_arg1.stage.addEventListener(Event.ENTER_FRAME, _onEnterFrame);
_arg1.stage.addEventListener(KeyboardEvent.KEY_DOWN, _onKeyDown);
_arg1.stage.addEventListener(KeyboardEvent.KEY_UP, _onKeyUp);
reset();
}
public function getX():int{
return ((((flagPressed & 8) >> 3) - ((flagPressed & 4) >> 2)));
}
public function getY():int{
return ((((flagPressed & 2) >> 1) - (flagPressed & 1)));
}
public function getFlag():uint{
return (flagPressed);
}
public function isHitted(_arg1:uint):Boolean{
return ((counter[_arg1] == 1));
}
private function _onKeyUp(_arg1:KeyboardEvent):void{
var event = _arg1;
keyCode.some(function (_arg1:uint, _arg2:int, _arg3:Array):Boolean{
if (event.keyCode != _arg1){
return (false);
};
flagPressed = (flagPressed & (0xFFFFFF ^ (1 << _arg2)));
return (true);
});
}
public function reset():void{
var _local1:uint;
flagPressed = 0;
for each (_local1 in counter) {
_local1 = 0;
};
}
private function _onKeyDown(_arg1:KeyboardEvent):void{
var event = _arg1;
keyCode.some(function (_arg1:uint, _arg2:int, _arg3:Array):Boolean{
if (event.keyCode != _arg1){
return (false);
};
flagPressed = (flagPressed | (1 << _arg2));
return (true);
});
}
private function _onEnterFrame(_arg1:Event):void{
var _local2:uint;
var _local3:uint;
_local2 = flagPressed;
while (_local3 < 16) {
if ((_local2 & 1)){
var _local4 = counter;
var _local5 = _local3;
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
} else {
counter[_local3] = 0;
};
_local2 = (_local2 >> 1);
_local3++;
};
}
public function isPressed(_arg1:uint):Boolean{
return (Boolean((flagPressed & (1 << _arg1))));
}
}
class FPSModule {
private var measuredFPS:int;// = 40
private var timer:Timer;
private var defaultFPS:Number;// = 40
private var delayingTerm:int;// = 0
private var delayedFrame:int;// = 0
private var counter:int;// = 0
private function FPSModule(_arg1:Sprite){
defaultFPS = 40;
measuredFPS = 40;
counter = 0;
delayedFrame = 0;
delayingTerm = 0;
super();
_arg1.stage.addEventListener(Event.ENTER_FRAME, _onEnterFrame);
timer = new Timer(1000, 0);
timer.addEventListener(TimerEvent.TIMER, _onTimer);
reset(_arg1.stage.frameRate);
}
private function _frameSkipped():void{
delayedFrame--;
}
public function getDelay():int{
return (delayedFrame);
}
public function get():uint{
return (measuredFPS);
}
private function _onEnterFrame(_arg1:Event):void{
counter++;
}
public function reset(_arg1:uint):void{
system.main.stage.frameRate = _arg1;
defaultFPS = _arg1;
measuredFPS = _arg1;
counter = 0;
delayedFrame = 0;
delayingTerm = 0;
timer.reset();
timer.start();
}
private function _onTimer(_arg1:TimerEvent):void{
measuredFPS = counter;
counter = 0;
delayedFrame = (defaultFPS - measuredFPS);
}
}
class ScreenModule extends Bitmap {
public var rect:Rectangle;
public var pt:Point;
public var pixels:BitmapData;
public var fullrect:Rectangle;
private function ScreenModule(_arg1:Sprite, _arg2:uint, _arg3:uint, _arg4:uint){
rect = new Rectangle();
pt = new Point();
pixels = new BitmapData(_arg2, _arg3, false, _arg4);
fullrect = new Rectangle(0, 0, _arg2, _arg3);
super(pixels);
_arg1.addChildAt(this, 0);
}
public function copyPixels(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):void{
rect.x = _arg6;
rect.y = _arg7;
rect.width = _arg4;
rect.height = _arg5;
pt.x = _arg2;
pt.y = _arg3;
pixels.copyPixels(_arg1, rect, pt);
}
public function fillRect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:uint):void{
rect.x = _arg1;
rect.y = _arg2;
rect.width = _arg3;
rect.height = _arg4;
pixels.fillRect(rect, _arg5);
}
public function clear(_arg1:uint=0):void{
pixels.fillRect(fullrect, _arg1);
}
public function draw(_arg1:IBitmapDrawable, _arg2:Matrix=null, _arg3:ColorTransform=null, _arg4:String=null):void{
pixels.draw(_arg1, _arg2, _arg3, _arg4, fullrect);
}
}
class SceneModule {
private var scene_change:Boolean;// = false
private var scene_next:uint;// = 0
private var flagPause:Boolean;// = false
private var managerList:Array;
private var scene:uint;// = 0
private function SceneModule(_arg1:Sprite){
scene = 0;
scene_next = 0;
scene_change = false;
flagPause = false;
super();
_arg1.stage.addEventListener(Event.ENTER_FRAME, _onEnterFrame);
managerList = new Array();
scene = 0;
scene_next = 0;
scene_change = false;
flagPause = false;
}
private function _drawAll():void{
var _local1:manager;
for each (_local1 in managerList) {
_local1.draw();
};
}
private function _register(_arg1:manager):void{
managerList.push(_arg1);
}
private function _runAll():void{
var _local1:manager;
if (scene_change){
scene_change = false;
_exitSceneAll();
scene = scene_next;
_enterSceneAll();
};
for each (_local1 in managerList) {
_local1.run();
};
}
public function get():uint{
return (scene);
}
private function _enterSceneAll():void{
var _local1:int;
_local1 = 0;
while (_local1 < managerList.length) {
managerList[_local1].enterScene();
_local1++;
};
}
public function change(_arg1:uint=0):void{
scene_next = _arg1;
scene_change = true;
}
private function _exitSceneAll():void{
var _local1:int;
_local1 = (managerList.length - 1);
while (_local1 >= 0) {
managerList[_local1].exitScene();
_local1--;
};
}
private function _onEnterFrame(_arg1:Event):void{
if (flagPause){
return;
};
_runAll();
if (system.fps.getDelay() > 0){
_runAll();
system.fps._frameSkipped();
};
_drawAll();
}
public function resume():void{
flagPause = false;
}
public function pause():void{
flagPause = true;
}
public function reset(_arg1:uint=0):void{
scene = _arg1;
scene_next = _arg1;
scene_change = false;
_enterSceneAll();
}
}
Section 71
//user_data (user_data)
package {
import flash.net.*;
public class user_data {
private var score_:Array;
private var stage_score:Array;// = null
private var flagUpdate:Boolean;// = false
private var replay_:Array;
private var stage_score_size:uint;// = 0
private var name_:String;// = ""
private static const DEFAULT_ROUND_LIMIT:uint = 0;
private static const VERSION:uint = 2;
private static var round_limit:uint = 0;
private static var FLIENAME:String = "usrdat";
private static var index:uint = 0;
public function user_data(){
name_ = "";
flagUpdate = false;
score_ = new Array(2);
replay_ = new Array(2);
stage_score = null;
stage_score_size = 0;
super();
stage_score_size = (score_manager.ROUND_MAX * 2);
stage_score = new Array(stage_score_size);
index = 0;
round_limit = DEFAULT_ROUND_LIMIT;
}
private function _parseStageScoreString(_arg1:String):Boolean{
var _local2:Array;
var _local3:int;
_local2 = _arg1.split(":");
if (_local2.length != stage_score_size){
return (false);
};
_local3 = 0;
while (_local3 < stage_score_size) {
stage_score[_local3] = uint(_local2[_local3]);
_local3++;
};
return (true);
}
public function saveCookie():void{
var _local1:SharedObject;
if (!flagUpdate){
return;
};
_local1 = SharedObject.getLocal(FLIENAME);
_local1.clear();
_local1.data.version = VERSION;
_local1.data.another = index;
_local1.data.round = round_limit;
_local1.data.name = name_;
_local1.data.score0 = score_[0];
_local1.data.score1 = score_[1];
_local1.data.replay0 = replay_[0];
_local1.data.replay1 = replay_[1];
_local1.data.sss = _createStageScoreString();
_local1.flush();
_local1.close();
flagUpdate = false;
}
public function update(_arg1:user_data):Boolean{
var _local2:int;
var _local3:int;
if (score_[index] < _arg1.score_[index]){
flagUpdate = true;
score_[index] = _arg1.score_[index];
replay_[index] = _arg1.replay_[index];
_local2 = (index * score_manager.ROUND_MAX);
_local3 = 0;
while (_local3 < score_manager.ROUND_MAX) {
stage_score[(_local3 + _local2)] = _arg1.stage_score[(_local3 + _local2)];
_local3++;
};
return (true);
};
return (false);
}
public function get name():String{
return (name_);
}
public function set replay(_arg1:String):void{
flagUpdate = true;
replay_[index] = _arg1;
}
public function get score():uint{
return (uint(score_[index]));
}
public function clear():void{
var _local1:int;
flagUpdate = true;
name_ = "";
score_[0] = 0;
score_[1] = 0;
replay_[0] = null;
replay_[1] = null;
_local1 = 0;
while (_local1 < stage_score_size) {
stage_score[_local1] = 0;
_local1++;
};
}
public function set name(_arg1:String):void{
flagUpdate = true;
name_ = _arg1;
}
public function getStageScoreString():String{
var _local1:String;
var _local2:int;
var _local3:int;
_local1 = "";
_local2 = (index * score_manager.ROUND_MAX);
if (stage_score != null){
_local3 = 0;
while (_local3 < score_manager.ROUND_MAX) {
if (_local3 > 0){
_local1 = (_local1 + ":");
};
_local1 = (_local1 + stage_score[(_local3 + _local2)]);
_local3++;
};
};
return (_local1);
}
public function isReplayAvailable():Boolean{
return (!((replay_[index] == null)));
}
public function clearCookie():void{
var _local1:SharedObject;
_local1 = SharedObject.getLocal(FLIENAME);
_local1.clear();
clear();
index = 0;
round_limit = DEFAULT_ROUND_LIMIT;
}
public function set score(_arg1:uint):void{
flagUpdate = true;
score_[index] = _arg1;
}
public function get replay():String{
return (String(replay_[index]));
}
public function getStageScore(_arg1:uint):uint{
return (uint(stage_score[(_arg1 + (index * score_manager.ROUND_MAX))]));
}
public function setStageScore(_arg1:uint, _arg2:uint):void{
var _local3:uint;
_local3 = (_arg1 + (index * score_manager.ROUND_MAX));
flagUpdate = true;
stage_score[_local3] = _arg2;
}
private function _createStageScoreString():String{
var _local1:String;
var _local2:int;
_local1 = "";
if (stage_score != null){
_local2 = 0;
while (_local2 < stage_score_size) {
if (_local2 > 0){
_local1 = (_local1 + ":");
};
_local1 = (_local1 + stage_score[_local2]);
_local2++;
};
};
return (_local1);
}
public function loadCookie():Boolean{
var _local1:Boolean;
var _local2:SharedObject;
_local1 = false;
clear();
_local2 = SharedObject.getLocal(FLIENAME);
if (("version" in _local2.data)){
if (_local2.data.version == VERSION){
_local1 = true;
if (("another" in _local2.data)){
index = uint(_local2.data.another);
};
if (("round" in _local2.data)){
round_limit = uint(_local2.data.round);
};
if (("name" in _local2.data)){
name_ = String(_local2.data.name);
};
if (("score0" in _local2.data)){
score_[0] = uint(_local2.data.score0);
};
if (("score1" in _local2.data)){
score_[1] = uint(_local2.data.score1);
};
if (("replay0" in _local2.data)){
replay_[0] = String(_local2.data.replay0);
};
if (("replay1" in _local2.data)){
replay_[1] = String(_local2.data.replay1);
};
if (("sss" in _local2.data)){
_parseStageScoreString(String(_local2.data.sss));
};
};
};
_local2.flush();
_local2.close();
flagUpdate = false;
return (_local1);
}
public static function getRoundLimit():uint{
return (round_limit);
}
public static function switchAnotherMode():void{
index = (1 - index);
}
public static function updateRoundLimit(_arg1:uint):void{
if (round_limit < _arg1){
round_limit = _arg1;
};
}
public static function isAnotherAvailable():Boolean{
return ((round_limit == score_manager.ROUND_MAX));
}
public static function isAnotherMode():uint{
return (index);
}
}
}//package