Section 1
//_Preloader_1 (VindexChronicle7_fla._Preloader_1)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class _Preloader_1 extends MovieClip {
public var link_btn:SimpleButton;
public var logo_mc:MovieClip;
public function _Preloader_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package VindexChronicle7_fla
Section 2
//bomb_preloader_2 (VindexChronicle7_fla.bomb_preloader_2)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class bomb_preloader_2 extends MovieClip {
public var loaderbar:MovieClip;
public function bomb_preloader_2(){
addFrameScript(0, frame1, 214, frame215);
}
function frame215(){
stop();
}
function frame1(){
stop();
}
}
}//package VindexChronicle7_fla
Section 3
//bomb_smoker3_16 (VindexChronicle7_fla.bomb_smoker3_16)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class bomb_smoker3_16 extends MovieClip {
public var sm:MovieClip;
}
}//package VindexChronicle7_fla
Section 4
//bomb_smoker4_15 (VindexChronicle7_fla.bomb_smoker4_15)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class bomb_smoker4_15 extends MovieClip {
public var sm:MovieClip;
public function bomb_smoker4_15(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package VindexChronicle7_fla
Section 5
//enemy_hp_stat_mc_23 (VindexChronicle7_fla.enemy_hp_stat_mc_23)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class enemy_hp_stat_mc_23 extends MovieClip {
public var val:MovieClip;
public function enemy_hp_stat_mc_23(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package VindexChronicle7_fla
Section 6
//inbetween_bg_mc_47 (VindexChronicle7_fla.inbetween_bg_mc_47)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class inbetween_bg_mc_47 extends MovieClip {
public function inbetween_bg_mc_47(){
addFrameScript(0, frame1, 19, frame20, 39, frame40, 59, frame60, 80, frame81);
}
function frame81(){
stop();
}
function frame1(){
stop();
}
function frame20(){
stop();
}
function frame40(){
stop();
}
function frame60(){
stop();
}
}
}//package VindexChronicle7_fla
Section 7
//live_mc_54 (VindexChronicle7_fla.live_mc_54)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class live_mc_54 extends MovieClip {
public function live_mc_54(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package VindexChronicle7_fla
Section 8
//MainTimeline (VindexChronicle7_fla.MainTimeline)
package VindexChronicle7_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var VindexGame;
public var preloader:MovieClip;
public var gameLoaded:Boolean;
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
stop();
VindexGame = new VindexChronicle(stage);
VindexGame.Start();
}
function frame1(){
stop();
gameLoaded = false;
preloader.stop();
preloader.logo_mc.stop();
preloader.logo_mc.loaderbar.stop();
preloader.addEventListener(Event.ENTER_FRAME, updatePreloader, false, 0, true);
preloader.link_btn.addEventListener(MouseEvent.MOUSE_DOWN, gotoArc, false);
}
public function updatePreloader(_arg1:Event):void{
var _local2:Number;
_local2 = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
if (_local2 != 100){
preloader.logo_mc.loaderbar.gotoAndStop(int(_local2));
} else {
if (!gameLoaded){
gameLoaded = true;
preloader.logo_mc.play();
};
if (preloader.logo_mc.currentFrame == preloader.logo_mc.totalFrames){
preloader.logo_mc.gotoAndStop(preloader.logo_mc.totalFrames);
preloader.removeEventListener(Event.ENTER_FRAME, updatePreloader, false);
this.gotoAndPlay(2);
};
};
}
public function gotoArc(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.arcadebomb.com"), "_blank");
}
}
}//package VindexChronicle7_fla
Section 9
//map_mc_97 (VindexChronicle7_fla.map_mc_97)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class map_mc_97 extends MovieClip {
public function map_mc_97(){
addFrameScript(6, frame7, 12, frame13, 18, frame19, 24, frame25, 30, frame31, 31, frame32);
}
function frame7(){
gotoAndPlay("viking");
}
function frame19(){
gotoAndPlay("persian");
}
function frame25(){
gotoAndPlay("egypt");
}
function frame13(){
gotoAndPlay("britons");
}
function frame31(){
gotoAndPlay("sparta");
}
function frame32(){
stop();
}
}
}//package VindexChronicle7_fla
Section 10
//upgrade_special_mc_88 (VindexChronicle7_fla.upgrade_special_mc_88)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class upgrade_special_mc_88 extends MovieClip {
public function upgrade_special_mc_88(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package VindexChronicle7_fla
Section 11
//upgradeAdd_mc_87 (VindexChronicle7_fla.upgradeAdd_mc_87)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class upgradeAdd_mc_87 extends MovieClip {
public function upgradeAdd_mc_87(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
function frame11(){
stop();
}
}
}//package VindexChronicle7_fla
Section 12
//upgradehintanimation_52 (VindexChronicle7_fla.upgradehintanimation_52)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class upgradehintanimation_52 extends MovieClip {
public function upgradehintanimation_52(){
addFrameScript(100, frame101);
}
function frame101(){
stop();
}
}
}//package VindexChronicle7_fla
Section 13
//zEXPORT_19 (VindexChronicle7_fla.zEXPORT_19)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class zEXPORT_19 extends MovieClip {
public var mn_pause:pause_upgrade_mc;
public var mn_lose:ending_lose_mc;
public var mn_interface:interface_all_mc;
public var mn_changelv:change_lv;
public var mn_main:main_mc;
public var mn_ending:ending_movie_mc;
public var mn_opening:opening_movie_mc;
public function zEXPORT_19(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package VindexChronicle7_fla
Section 14
//zSndExport_125 (VindexChronicle7_fla.zSndExport_125)
package VindexChronicle7_fla {
import flash.display.*;
public dynamic class zSndExport_125 extends MovieClip {
public function zSndExport_125(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package VindexChronicle7_fla
Section 15
//_arrow_guard (_arrow_guard)
package {
public dynamic class _arrow_guard extends BaseSoundEffect {
}
}//package
Section 16
//_arrow_hit (_arrow_hit)
package {
public dynamic class _arrow_hit extends BaseSoundEffect {
}
}//package
Section 17
//_blunt_hit (_blunt_hit)
package {
public dynamic class _blunt_hit extends BaseSoundEffect {
}
}//package
Section 18
//_guard_hit (_guard_hit)
package {
public dynamic class _guard_hit extends BaseSoundEffect {
}
}//package
Section 19
//_kick_hit (_kick_hit)
package {
public dynamic class _kick_hit extends BaseSoundEffect {
}
}//package
Section 20
//_slash_hit (_slash_hit)
package {
public dynamic class _slash_hit extends BaseSoundEffect {
}
}//package
Section 21
//arrow_mc (arrow_mc)
package {
import flash.display.*;
public dynamic class arrow_mc extends MovieClip {
public var bodyBox:MovieClip;
public function arrow_mc(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package
Section 22
//ArrowClass (ArrowClass)
package {
import flash.events.*;
import flash.display.*;
public class ArrowClass extends MovieClip {
private var worldMgr;// = null
private var range:Number;// = 0
private var pow:int;// = 10
private var speed:Number;// = 0
private var objArrow;// = null
private var objTarget;// = null
private var objCont;// = null
public function ArrowClass(_arg1, _arg2){
objCont = null;
objArrow = null;
objTarget = null;
worldMgr = null;
pow = 10;
range = 0;
speed = 0;
super();
worldMgr = _arg1;
objCont = _arg2;
objArrow = new arrow_mc();
objCont.addChild(objArrow);
objArrow.cacheAsBitmap = true;
objArrow.visible = false;
objArrow.scaleX = -1;
speed = 30;
}
private function stopShoot(){
objArrow.visible = false;
objArrow.removeEventListener(Event.ENTER_FRAME, throwHandle);
}
public function ShootArrow(_arg1, _arg2){
if (objArrow.visible == true){
return;
};
range = 0;
objTarget = _arg1;
objArrow.x = objCont.stageX;
objArrow.y = objCont.stageY;
objArrow.y = (objArrow.y - 60);
pow = _arg2;
objArrow.gotoAndStop("stand");
objArrow.visible = true;
objArrow.addEventListener(Event.ENTER_FRAME, throwHandle, false, 0, true);
}
public function remove(){
objArrow.removeEventListener(Event.ENTER_FRAME, throwHandle);
objCont.removeChild(objArrow);
objCont = null;
objArrow = null;
objTarget = null;
worldMgr = null;
}
public function isReady():Boolean{
if (objArrow.visible == true){
return (false);
};
return (true);
}
private function throwHandle(_arg1:Event):void{
var _local2:StdAtkRes;
if (((objCont.getAI().getIsPaused()) || ((objTarget == null)))){
return;
};
if (objArrow.currentLabel == "end"){
stopShoot();
};
if (objArrow.currentLabel != "stand"){
return;
};
if (((objTarget.getAI().isEnableHit()) && ((objTarget.isKoed() == false)))){
if ((((Math.abs((objCont.y - objTarget.y)) < 30)) && (objTarget.bodyBox.hitTestObject(objArrow.bodyBox)))){
_local2 = new StdAtkRes();
_local2.setHit(pow, 3, 1, false);
_local2.directionPush(objCont, objTarget);
objTarget.getAI().setDamageHit(_local2);
if (objTarget.getAI().isGuard()){
objArrow.gotoAndPlay("deflect");
} else {
stopShoot();
};
};
};
if (range > 1000){
stopShoot();
} else {
objArrow.x = (objArrow.x + speed);
range = (range + speed);
};
}
}
}//package
Section 23
//ba_mc (ba_mc)
package {
public dynamic class ba_mc extends EntityClass {
public function ba_mc(){
addFrameScript(24, frame25, 41, frame42, 70, frame71, 96, frame97, 112, frame113, 123, frame124, 159, frame160, 216, frame217);
}
function frame160(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame42(){
gotoAndPlay("walk");
}
function frame71(){
gotoAndPlay("stand");
}
function frame97(){
gotoAndPlay("stand");
}
function frame217(){
stop();
}
function frame113(){
gotoAndPlay("stand");
}
function frame124(){
gotoAndPlay("stand");
}
}
}//package
Section 24
//BaseMovieClip (BaseMovieClip)
package {
import flash.display.*;
public class BaseMovieClip extends MovieClip {
public var _passable:Boolean;// = false
private var _z:Number;
public var _static:Boolean;// = false
public function BaseMovieClip(){
_static = false;
_passable = false;
super();
}
public function changeStatic(_arg1:Boolean){
_static = _arg1;
}
public function isCollisionHit(_arg1, _arg2):Boolean{
if (((_arg1.hitBox) && (_arg2.bodyBox))){
if (_arg1.hitBox.hitTestObject(_arg2.bodyBox)){
return (true);
};
};
return (false);
}
public function getZDepthVal():Number{
return (_z);
}
public function setupProperty(_arg1:Boolean, _arg2:Boolean){
_static = _arg1;
_passable = _arg2;
}
public function changePassable(_arg1:Boolean){
_passable = _arg1;
}
public function isCollisionFoot(_arg1, _arg2):Boolean{
if (_arg1._static){
return (false);
};
if (_arg2._passable){
return (false);
};
if (((_arg1.areaBox) && (_arg2.areaBox))){
if (_arg1.areaBox.hitTestObject(_arg2.areaBox)){
return (true);
};
};
return (false);
}
public function updateProperty(){
_z = Math.round(this.y);
}
public function isCollisionArea(_arg1, _arg2):Boolean{
if (((_arg1.hitAreaBox) && (_arg2.areaBox))){
if (_arg1.hitAreaBox.hitTestObject(_arg2.areaBox)){
return (true);
};
};
return (false);
}
public function pushObject(_arg1, _arg2){
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
_local5 = Math.atan2(_local4, _local3);
if (_arg2._static){
_arg1.x = (_arg1.x - (Math.max(_arg1._trace_spd_x, 2) * Math.cos(_local5)));
_arg1.y = (_arg1.y - (Math.max(_arg1._trace_spd_y, 2) * Math.sin(_local5)));
} else {
_arg1.x = (_arg1.x - (Math.min(Math.abs((_local3 * 0.5)), 0.5) * Math.cos(_local5)));
_arg1.y = (_arg1.y - (Math.min(Math.abs((_local4 * 0.5)), 0.5) * Math.sin(_local5)));
_arg2.x = (_arg2.x + (Math.min(Math.abs((_local3 * 0.5)), 0.5) * Math.cos(_local5)));
_arg2.y = (_arg2.y + (Math.min(Math.abs((_local4 * 0.5)), 0.5) * Math.sin(_local5)));
};
}
}
}//package
Section 25
//BaseSound (BaseSound)
package {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public class BaseSound extends Sound {
private var sndTransform:SoundTransform;
private var sndFadeOut:Boolean;
private var sndFadeIn:Boolean;
private var sndPosTime:Number;
private var loop:Boolean;
private var sndObj:Sound;
private var sndChannel:SoundChannel;
private var sndTimer:Timer;
private var sndVolume:Number;
private var sndPan:Number;
public function BaseSound(){
sndObj = this;
sndChannel = null;
sndTransform = null;
sndVolume = 1;
sndPan = 0;
sndPosTime = 0;
sndFadeIn = false;
sndFadeOut = false;
loop = false;
sndTimer = new Timer(50);
sndTimer.addEventListener(TimerEvent.TIMER, sndTimerHandler);
sndTimer.start();
}
public function setVolume(_arg1:Number):void{
var _local2:SoundTransform;
sndVolume = _arg1;
if (sndChannel){
_local2 = sndChannel.soundTransform;
_local2.volume = sndVolume;
sndChannel.soundTransform = _local2;
};
}
public function stopSound():void{
if (sndChannel){
sndChannel.stop();
sndChannel.removeEventListener(Event.SOUND_COMPLETE, sound_loop);
loop = false;
trace("stopSound() ");
};
}
public function fadeOut(_arg1:Boolean):void{
sndFadeOut = true;
sndFadeIn = false;
if (_arg1){
setVolume(1);
};
trace("Fade Out Effect ");
}
public function pauseSound():void{
if (sndChannel){
sndPosTime = sndChannel.position;
sndChannel.stop();
sndChannel.removeEventListener(Event.SOUND_COMPLETE, sound_loop);
trace(("pauseSound(), Position :" + String(sndPosTime)));
};
}
public function playSound():void{
stopSound();
sndChannel = sndObj.play();
setVolume(sndVolume);
setPan(sndPan);
trace("playSound() ");
}
public function fadeIn(_arg1:Boolean):void{
sndFadeIn = true;
sndFadeOut = false;
if (_arg1){
setVolume(0);
};
trace("Fade In Effect ");
}
private function sndTimerHandler(_arg1:TimerEvent):void{
if (((sndFadeIn) && (sndFadeOut))){
sndFadeIn = false;
sndFadeOut = false;
setVolume(1);
};
if (sndFadeIn){
sndVolume = (sndVolume + 0.01);
if (sndVolume > 1){
setVolume(1);
sndFadeIn = false;
} else {
setVolume(sndVolume);
};
};
if (sndFadeOut){
sndVolume = (sndVolume - 0.01);
if (sndVolume < 0){
setVolume(0);
sndFadeOut = false;
} else {
setVolume(sndVolume);
};
};
}
public function setPan(_arg1:Number):void{
var _local2:SoundTransform;
sndPan = _arg1;
if (sndChannel){
_local2 = sndChannel.soundTransform;
_local2.pan = sndPan;
sndChannel.soundTransform = _local2;
};
}
public function resumeSound():void{
stopSound();
sndChannel = sndObj.play(sndPosTime);
if (loop){
sndChannel.addEventListener(Event.SOUND_COMPLETE, sound_loop);
};
setVolume(sndVolume);
setPan(sndPan);
trace("resumeSound() ");
}
private function sound_loop(_arg1:Event){
sndChannel = sndObj.play();
setVolume(sndVolume);
setPan(sndPan);
sndChannel.addEventListener(Event.SOUND_COMPLETE, sound_loop);
trace("Loop Back ");
}
public function playSoundLoop():void{
stopSound();
sndChannel = sndObj.play();
sndChannel.addEventListener(Event.SOUND_COMPLETE, sound_loop);
setVolume(sndVolume);
setPan(sndPan);
loop = true;
trace("playSoundLoop() ");
}
}
}//package
Section 26
//BaseSoundEffect (BaseSoundEffect)
package {
import flash.media.*;
public class BaseSoundEffect extends Sound {
private var sndChannel:SoundChannel;
private var sndObj:Sound;
private var sndVolume:Number;
public function BaseSoundEffect(){
sndObj = this;
sndChannel = null;
sndVolume = 1;
}
public function playSound():void{
stopSound();
sndChannel = sndObj.play();
setVolume(sndVolume);
}
public function setVolume(_arg1:Number):void{
var _local2:SoundTransform;
sndVolume = _arg1;
if (sndChannel){
_local2 = sndChannel.soundTransform;
_local2.volume = sndVolume;
sndChannel.soundTransform = _local2;
};
}
public function stopSound():void{
if (sndChannel){
sndChannel.stop();
};
}
}
}//package
Section 27
//bb_mc (bb_mc)
package {
public dynamic class bb_mc extends EntityClass {
public function bb_mc(){
addFrameScript(24, frame25, 54, frame55, 55, frame56, 86, frame87, 116, frame117, 129, frame130, 163, frame164, 173, frame174, 180, frame181, 191, frame192, 238, frame239, 305, frame306);
}
function frame164(){
gotoAndPlay("stand");
}
function frame174(){
stop();
}
function frame181(){
gotoAndPlay("stand");
}
function frame25(){
gotoAndPlay("stand");
}
function frame192(){
gotoAndPlay("stand");
}
function frame55(){
gotoAndPlay("walk");
}
function frame56(){
gotoAndPlay("stand");
}
function frame306(){
stop();
}
function frame87(){
gotoAndPlay("stand");
}
function frame117(){
gotoAndPlay("stand");
}
function frame239(){
stop();
}
function frame130(){
gotoAndPlay("stand");
}
}
}//package
Section 28
//BgClass (BgClass)
package {
import flash.display.*;
public class BgClass extends Sprite {
private var viewMin_x:Number;// = 0
private var viewMin_y:Number;// = 0
private var real_left_border:Number;// = 0
private var top_border:Number;// = 0
public var objBGF;// = null
private var left_border:Number;// = 0
private var middle_y:Number;// = 0
private var max_x:Number;// = 0
public var objBG;// = null
private var move_x:Number;// = 0
private var real_top_border:Number;// = 0
private var move_y:Number;// = 0
private var max_y:Number;// = 0
private var right_border:Number;// = 640
private var real_right_border:Number;// = 640
private var viewMax_y:Number;// = 0
private var bottom_border:Number;// = 480
private var min_y:Number;// = 0
private var viewMax_x:Number;// = 0
private var min_x:Number;// = 0
private var real_bottom_border:Number;// = 480
public function BgClass(){
left_border = 0;
right_border = 640;
top_border = 0;
bottom_border = 480;
real_left_border = 0;
real_right_border = 640;
real_top_border = 0;
real_bottom_border = 480;
objBG = null;
objBGF = null;
viewMin_x = 0;
viewMax_x = 0;
viewMin_y = 0;
viewMax_y = 0;
min_x = 0;
max_x = 0;
min_y = 0;
max_y = 0;
middle_y = 0;
move_x = 0;
move_y = 0;
super();
}
public function getMoveBgX(){
return ((move_x - objBG.x));
}
public function setupBorder(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
left_border = _arg1;
right_border = _arg2;
top_border = _arg3;
bottom_border = _arg4;
}
public function updateView(_arg1){
var _local2:*;
var _local3:*;
if ((((objBG == null)) || ((_arg1 == null)))){
return;
};
_local2 = Math.abs(_arg1._trace_spd_x);
_local3 = Math.abs(_arg1._trace_spd_y);
if (_arg1.x < viewMin_x){
if (moveForward(_local2)){
_arg1.x = viewMin_x;
};
};
if (_arg1.x > viewMax_x){
if (moveBackward(_local2)){
_arg1.x = viewMax_x;
};
};
if (_arg1.y < viewMin_y){
if (moveDown(_local3)){
_arg1.y = viewMin_y;
};
};
if (_arg1.y > viewMax_y){
if (moveUp(_local3)){
_arg1.y = viewMax_y;
};
};
}
public function getLeftBorder():Number{
return (left_border);
}
private function moveDown(_arg1):Boolean{
move_y = (move_y + _arg1);
if (move_y > min_y){
move_y = min_y;
return (false);
};
return (true);
}
public function refreshView(){
var _local1:*;
var _local2:*;
if (objBG == null){
return;
};
_local1 = (move_x - objBG.x);
_local2 = (move_y - objBG.y);
objBG.x = move_x;
objBG.y = move_y;
top_border = Math.max((objBG.y + middle_y), 0);
real_top_border = (objBG.y + middle_y);
real_bottom_border = (real_bottom_border + _local2);
real_left_border = (real_left_border + _local1);
real_right_border = (real_right_border + _local1);
if (((((objBG.bg1) && (objBG.bg2))) && (objBG.bg3))){
objBG.bg1.x = (-0.5 * objBG.x);
objBG.bg2.x = (-0.3 * objBG.x);
};
}
public function getBG():Object{
return (objBG);
}
public function getTopBorder():Number{
return (top_border);
}
public function getRealTopBorder():Number{
return (real_top_border);
}
public function getRightBorder():Number{
return (right_border);
}
public function setupViewPlayer(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
viewMin_x = _arg1;
viewMax_x = _arg2;
viewMin_y = _arg3;
viewMax_y = _arg4;
}
private function moveUp(_arg1):Boolean{
move_y = (move_y - _arg1);
if (move_y < max_y){
move_y = max_y;
return (false);
};
return (true);
}
public function getRealLeftBorder():Number{
return (real_left_border);
}
public function getRealBottomBorder():Number{
return (real_bottom_border);
}
public function getRealRightBorder():Number{
return (real_right_border);
}
public function getBottomBorder():Number{
return (bottom_border);
}
public function BackgroundClass(){
trace(" create bg ");
}
public function setupWalkBG(_arg1, _arg2, _arg3, _arg4, _arg5){
min_x = _arg1;
max_x = _arg2;
min_y = _arg3;
max_y = _arg4;
middle_y = _arg5;
objBG.x = (move_x = 0);
objBG.y = (move_y = 0);
top_border = Math.max((objBG.y + middle_y), 0);
real_left_border = 0;
real_right_border = objBG.width;
real_top_border = (objBG.y + middle_y);
real_bottom_border = objBG.height;
}
public function getBGF():Object{
return (objBGF);
}
private function moveBackward(_arg1):Boolean{
move_x = (move_x - _arg1);
if (move_x < max_x){
move_x = max_x;
return (false);
};
return (true);
}
private function moveForward(_arg1):Boolean{
move_x = (move_x + _arg1);
if (move_x > min_x){
move_x = min_x;
return (false);
};
return (true);
}
public function getMoveBgY(){
return ((move_y - objBG.y));
}
public function destroy(){
objBG = null;
objBGF = null;
}
}
}//package
Section 29
//BGM (BGM)
package {
public dynamic class BGM extends BaseSound {
}
}//package
Section 30
//BgManager (BgManager)
package {
public class BgManager extends BgClass {
var document_width:int;// = 640
var document_height:int;// = 480
public function BgManager(){
document_width = 640;
document_height = 480;
super();
}
public function init(_arg1, _arg2){
setupBorder(0, _arg1, 240, _arg2);
setupViewPlayer(250, 390, 250, 400);
document_width = _arg1;
document_height = _arg2;
}
public function createPersianLand(){
objBG = new persianLand();
setupWalkBG(0, Math.round((document_width - objBG.width)), 0, Math.round((document_height - objBG.height)), 410);
trace(("scroll x = " + Math.round((document_width - objBG.width))));
trace(("scroll y = " + Math.round((document_height - objBG.height))));
}
public function createEgyptLand(){
objBG = new egyptLand();
setupWalkBG(0, Math.round((document_width - objBG.width)), 0, Math.round((document_height - objBG.height)), 420);
trace(("scroll x = " + Math.round((document_width - objBG.width))));
trace(("scroll y = " + Math.round((document_height - objBG.height))));
}
public function createBritonLand(){
objBG = new britonLand();
setupWalkBG(0, Math.round((document_width - objBG.width)), 0, Math.round((document_height - objBG.height)), 410);
trace(("scroll x = " + Math.round((document_width - objBG.width))));
trace(("scroll y = " + Math.round((document_height - objBG.height))));
}
public function createLv1Scn(){
objBG = new bgTest();
setupWalkBG(0, Math.round((document_width - objBG.width)), 0, Math.round((document_height - objBG.height)), 300);
trace(("scroll x = " + Math.round((document_width - objBG.width))));
trace(("scroll y = " + Math.round((document_height - objBG.height))));
}
public function createSpartaLand(){
objBG = new spartaLand();
setupWalkBG(0, Math.round((document_width - objBG.width)), 0, Math.round((document_height - objBG.height)), 380);
trace(("scroll x = " + Math.round((document_width - objBG.width))));
trace(("scroll y = " + Math.round((document_height - objBG.height))));
}
public function createVikingLand(){
objBG = new vikingLand();
setupWalkBG(0, Math.round((document_width - objBG.width)), 0, Math.round((document_height - objBG.height)), 430);
trace(("scroll x = " + Math.round((document_width - objBG.width))));
trace(("scroll y = " + Math.round((document_height - objBG.height))));
}
}
}//package
Section 31
//bgTest (bgTest)
package {
import flash.display.*;
public dynamic class bgTest extends Sprite {
}
}//package
Section 32
//boxA (boxA)
package {
public dynamic class boxA extends EntityClass {
}
}//package
Section 33
//britonLand (britonLand)
package {
import flash.display.*;
public dynamic class britonLand extends Sprite {
public var bg3:MovieClip;
public var bg1:MovieClip;
public var bg2:MovieClip;
}
}//package
Section 34
//bs_mc (bs_mc)
package {
public dynamic class bs_mc extends EntityClass {
public function bs_mc(){
addFrameScript(24, frame25, 40, frame41, 58, frame59, 66, frame67, 67, frame68, 86, frame87, 97, frame98, 135, frame136, 196, frame197);
}
function frame25(){
gotoAndPlay("stand");
}
function frame197(){
stop();
}
function frame41(){
gotoAndPlay("walk");
}
function frame59(){
gotoAndPlay("stand");
}
function frame67(){
stop();
}
function frame68(){
gotoAndPlay("stand");
}
function frame87(){
gotoAndPlay("stand");
}
function frame98(){
gotoAndPlay("stand");
}
function frame136(){
stop();
}
}
}//package
Section 35
//change_lv (change_lv)
package {
import flash.display.*;
public dynamic class change_lv extends MovieClip {
public var bNextLevel:SimpleButton;
public var bg:MovieClip;
public function change_lv(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package
Section 36
//CharBritonsArcherClass (CharBritonsArcherClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharBritonsArcherClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 8
private var objMC;// = null
private var objArrow;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharBritonsArcherClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 8;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
objArrow = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (0.7 + Math.random());
objArrow = new ArrowClass(worldMgr, objMC);
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 103){
_local1.setHit(10, 2, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.4){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.4)) && ((_local1 < 0.8)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.95){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
playBreak();
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.95){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.6)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.7){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.7)) && ((_local1 < 0.8)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (objMC.currentFrame == 65){
objArrow.ShootArrow(objTargetMC, 30);
};
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objArrow.remove();
objArrow = null;
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 37
//CharBritonsBossClass (CharBritonsBossClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharBritonsBossClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 3
private var objMC;// = null
private var objArrow;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharBritonsBossClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 3;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
objArrow = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = 1.2;
objArrow = new ArrowClass(worldMgr, objMC);
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 139){
_local1.setHit(20, 2, 1, true);
};
if (objMC.currentFrame == 150){
_local1.setHit(30, 2, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.6){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.6)) && ((_local1 < 0.9)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.9){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
playBreak();
} else {
if (objArrow.isReady()){
playAttack();
} else {
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.85){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.8){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.8)) && ((_local1 < 0.9)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (objMC.currentFrame == 66){
objArrow.ShootArrow(objTargetMC, 60);
};
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objArrow.remove();
objArrow = null;
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 38
//CharBritonsFighterClass (CharBritonsFighterClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharBritonsFighterClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 4
private var objMC;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharBritonsFighterClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 4;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (0.8 + Math.random());
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 53){
_local1.setHit(16, 1, 1, false);
};
if (objMC.currentFrame == 80){
_local1.setHit(12, 2, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.5){
if (Math.random() < 0.8){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.5)) && ((_local1 < 0.8)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.8){
if (Math.random() < 0.2){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.7){
if (Math.random() < 0.7){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.7){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.7)) && ((_local1 < 0.9)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 39
//CharEgyptArcherClass (CharEgyptArcherClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharEgyptArcherClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 3
private var objMC;// = null
private var objArrow;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharEgyptArcherClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 3;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
objArrow = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (1.1 + Math.random());
objArrow = new ArrowClass(worldMgr, objMC);
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 87){
_local1.setHit(20, 2, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.4){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.4)) && ((_local1 < 0.9)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.85){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
playBreak();
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.85){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.8){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.8)) && ((_local1 < 0.9)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (objMC.currentFrame == 66){
objArrow.ShootArrow(objTargetMC, 30);
};
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objArrow.remove();
objArrow = null;
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 40
//CharEgyptBossClass (CharEgyptBossClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharEgyptBossClass {
const _special = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 3
private var objMC;// = null
private var actTimer:Timer;// = null
private var pushThis:Number;// = 1
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharEgyptBossClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 3;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = 1.5;
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 67){
_local1.setHit(75, 1, 1, false);
};
if (objMC.currentFrame == 85){
_local1.setHit(120, 2, 1, false);
};
if (objMC.currentFrame == 99){
_local1.setHit(65, 2, 1, true);
};
if (objMC.currentFrame == 106){
_local1.setHit(100, 1, 1, false);
};
if (objMC.currentFrame == 118){
_local1.setHit(170, 2, 1, true);
};
};
return (_local1);
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _special)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (!((charState == _dead))))){
if (charState == _hit){
if (Math.random() < 0.8){
return;
};
};
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.6){
if (Math.random() < 0.8){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.6)) && ((_local1 < 0.95)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.9){
if (Math.random() < 0.4){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.9){
if (Math.random() < 0.7){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.8){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.8)) && ((_local1 < 0.95)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "special"){
charState = _special;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _special)))){
return (true);
};
return (false);
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function playSpecial(){
if (objMC.currentLabel != "special"){
objMC.gotoAndPlay("special");
};
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 41
//CharEgyptFighterClass (CharEgyptFighterClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharEgyptFighterClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 5
private var objMC;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharEgyptFighterClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 5;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (1.3 + Math.random());
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 44){
_local1.setHit(10, 1, 1, false);
};
if (objMC.currentFrame == 53){
_local1.setHit(15, 1, 1, false);
};
if (objMC.currentFrame == 71){
_local1.setHit(20, 2, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.4){
if (Math.random() < 0.8){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.4)) && ((_local1 < 0.8)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.8){
if (Math.random() < 0.2){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.8){
if (Math.random() < 0.7){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.8){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.8)) && ((_local1 < 0.9)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 42
//CharPersianArcherClass (CharPersianArcherClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharPersianArcherClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 4
private var objMC;// = null
private var objArrow;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharPersianArcherClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 4;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
objArrow = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (0.9 + Math.random());
objArrow = new ArrowClass(worldMgr, objMC);
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 74){
_local1.setHit(8, 3, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.4){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.4)) && ((_local1 < 0.8)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.8){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
playBreak();
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.8){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.8){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.8)) && ((_local1 < 0.9)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (objMC.currentFrame == 59){
objArrow.ShootArrow(objTargetMC, 28);
};
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objArrow.remove();
objArrow = null;
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 43
//CharPersianBossClass (CharPersianBossClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharPersianBossClass {
const _special = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 8
private var objMC;// = null
private var actTimer:Timer;// = null
private var pushThis:Number;// = 1
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharPersianBossClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 8;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = 2;
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 69){
_local1.setHit(45, 1, 1, false);
};
if (objMC.currentFrame == 89){
_local1.setHit(50, 1, 1, false);
};
if (objMC.currentFrame == 111){
_local1.setHit(60, 2, 1, true);
};
if (objMC.currentFrame == 122){
_local1.setHit(75, 1, 1, false);
};
};
return (_local1);
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _special)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (!((charState == _dead))))){
if (charState == _hit){
if (Math.random() < 0.8){
return;
};
};
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.4){
if (Math.random() < 0.8){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.4)) && ((_local1 < 0.9)))){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.9){
if (Math.random() < 0.4){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.9){
if (Math.random() < 0.7){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.8){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.8)) && ((_local1 < 0.9)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "special"){
charState = _special;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _special)))){
return (true);
};
return (false);
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function playSpecial(){
if (objMC.currentLabel != "special"){
objMC.gotoAndPlay("special");
};
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 44
//CharPersianFighterClass (CharPersianFighterClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharPersianFighterClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 4
private var objMC;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharPersianFighterClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 4;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (1 + Math.random());
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 50){
_local1.setHit(30, 1, 1, false);
};
if (objMC.currentFrame == 70){
_local1.setHit(22, 3, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.4){
if (Math.random() < 0.8){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.4)) && ((_local1 < 0.9)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.9){
if (Math.random() < 0.2){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.8){
if (Math.random() < 0.7){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.8){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.8)) && ((_local1 < 0.9)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 45
//CharSpartaArcherClass (CharSpartaArcherClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharSpartaArcherClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 3
private var objMC;// = null
private var objArrow;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharSpartaArcherClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 3;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
objArrow = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (1.2 + Math.random());
objArrow = new ArrowClass(worldMgr, objMC);
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 70){
_local1.setHit(20, 1, 1, false);
};
if (objMC.currentFrame == 80){
_local1.setHit(25, 3, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.5){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.5)) && ((_local1 < 0.9)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.9){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
playBreak();
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.9){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.7){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.7)) && ((_local1 < 0.9)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (objMC.currentFrame == 54){
objArrow.ShootArrow(objTargetMC, 60);
};
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objArrow.remove();
objArrow = null;
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 46
//CharSpartaBossClass (CharSpartaBossClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharSpartaBossClass {
const _special = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 3
private var objMC;// = null
private var actTimer:Timer;// = null
private var pushThis:Number;// = 1
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharSpartaBossClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 3;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = 2.5;
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 53){
_local1.setHit(135, 1, 1, false);
};
if (objMC.currentFrame == 65){
_local1.setHit(210, 1, 1, false);
};
if (objMC.currentFrame == 76){
_local1.setHit(90, 2, 1, false);
};
if (objMC.currentFrame == 84){
_local1.setHit(85, 1, 1, false);
};
if (objMC.currentFrame == 94){
_local1.setHit(300, 2, 1, true);
};
if (objMC.currentFrame == 104){
_local1.setHit(175, 1, 1, false);
};
};
return (_local1);
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _special)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (!((charState == _dead))))){
if (charState == _hit){
if (Math.random() < 0.7){
return;
};
};
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.6){
if (Math.random() < 0.8){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.6)) && ((_local1 < 0.95)))){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.95){
if (Math.random() < 0.4){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.95){
if (Math.random() < 0.7){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.8){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.8)) && ((_local1 < 0.95)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "special"){
charState = _special;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _special)))){
return (true);
};
return (false);
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function playSpecial(){
if (objMC.currentLabel != "special"){
objMC.gotoAndPlay("special");
};
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 47
//CharSpartaFighterClass (CharSpartaFighterClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharSpartaFighterClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 3
private var objMC;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharSpartaFighterClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 3;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (1.5 + Math.random());
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 46){
_local1.setHit(22, 1, 1, false);
};
if (objMC.currentFrame == 54){
_local1.setHit(30, 1, 1, false);
};
if (objMC.currentFrame == 66){
_local1.setHit(22, 1, 1, true);
};
if (objMC.currentFrame == 75){
_local1.setHit(26, 2, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.5){
if (Math.random() < 0.8){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.5)) && ((_local1 < 0.95)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.9){
if (Math.random() < 0.2){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.9){
if (Math.random() < 0.7){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.85){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.85)) && ((_local1 < 0.95)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 48
//CharVikingArcherClass (CharVikingArcherClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharVikingArcherClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 5
private var objMC;// = null
private var objArrow;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharVikingArcherClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 5;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
objArrow = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (0.5 + Math.random());
objArrow = new ArrowClass(worldMgr, objMC);
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 76){
_local1.setHit(4, 2, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.4){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.4)) && ((_local1 < 0.8)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.8){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
playBreak();
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.7){
if (Math.abs((objTargetMC.x - objMC.x)) < 90){
if ((((Math.random() < 0.5)) && (objArrow.isReady()))){
playAttack();
} else {
playBreak();
};
} else {
if (objArrow.isReady()){
playAttack();
} else {
playStand();
timeAction((500 + (Math.random() * 500)));
AI_state = AI_IDLE;
AI_lock = true;
return;
};
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.6){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.6)) && ((_local1 < 0.8)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (objMC.currentFrame == 63){
objArrow.ShootArrow(objTargetMC, 10);
};
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objArrow.remove();
objArrow = null;
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 49
//CharVikingBossClass (CharVikingBossClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharVikingBossClass {
const _special = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 4
private var objMC;// = null
private var actTimer:Timer;// = null
private var pushThis:Number;// = 1
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharVikingBossClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 4;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = 1.4;
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 81){
_local1.setHit(32, 1, 1, false);
};
if (objMC.currentFrame == 87){
_local1.setHit(40, 1, 1, false);
};
if (objMC.currentFrame == 99){
_local1.setHit(35, 2, 1, true);
};
if (objMC.currentFrame == 117){
_local1.setHit(60, 1, 1, false);
};
};
return (_local1);
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _special)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.5){
if (Math.random() < 0.8){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.5)) && ((_local1 < 0.9)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.9){
if (Math.random() < 0.4){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.9){
if (Math.random() < 0.7){
playAttack();
} else {
playSpecial();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((500 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.7){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.7)) && ((_local1 < 0.9)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "special"){
charState = _special;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _special)))){
return (true);
};
return (false);
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function playSpecial(){
if (objMC.currentLabel != "special"){
objMC.gotoAndPlay("special");
};
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 50
//CharVikingFighterClass (CharVikingFighterClass)
package {
import flash.events.*;
import flash.utils.*;
public class CharVikingFighterClass {
const _break = 3;
const AI_IDLE = 0;
const AI_GUARD = 4;
const _guard = 4;
const _move = 1;
const AI_ATTACK = 3;
const _dead = 6;
const AI_MOVECLOSE = 1;
const _hit = 5;
const _stand = 0;
const _attack = 2;
const AI_MOVEAWAY = 2;
private var worldMgr;// = null
private var AI_state:int;// = 0
private var speed:Number;// = 2
private var objMC;// = null
private var pushThis:Number;// = 1
private var actTimer:Timer;// = null
private var charState:int;// = 0
private var AI_lock:Boolean;// = false
private var AI_paused_state:int;// = 0
private var isPaused:Boolean;// = false
private var objTargetMC;// = null
public function CharVikingFighterClass(_arg1, _arg2){
isPaused = false;
AI_paused_state = 0;
worldMgr = null;
objMC = null;
objTargetMC = null;
speed = 2;
pushThis = 1;
charState = 0;
AI_state = 0;
AI_lock = false;
actTimer = null;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
speed = (0.5 + Math.random());
}
private function playStand(){
if (objMC.currentLabel != "stand"){
objMC.gotoAndPlay("stand");
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 55){
_local1.setHit(7, 1, 1, false);
};
if (objMC.currentFrame == 64){
_local1.setHit(4, 2, 1, true);
};
};
return (_local1);
}
private function playMoveClose(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, speed);
if (objMC.x > objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _move)))) || ((charState == _guard)))) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
private function AI_DECISION(){
var _local1:Number;
if ((((AI_lock == false)) && (((!((charState == _hit))) && (!((charState == _dead))))))){
_local1 = Math.random();
if (detectHitArea()){
if (objTargetMC.getAI().isOffensive()){
if (_local1 < 0.4){
if (Math.random() < 0.8){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
if ((((_local1 >= 0.4)) && ((_local1 < 0.8)))){
if (Math.random() < 0.8){
playGuard();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_GUARD;
} else {
playMoveAway();
timeAction((1000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
};
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
} else {
if (objTargetMC.getAI().isDefensive()){
if (_local1 < 0.8){
if (Math.random() < 0.2){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
} else {
if (_local1 < 0.7){
if (Math.random() < 0.7){
playAttack();
} else {
playBreak();
};
AI_state = AI_ATTACK;
} else {
playStand();
timeAction((1000 + (Math.random() * 1000)));
AI_state = AI_IDLE;
};
};
};
} else {
if (_local1 < 0.6){
playMoveClose();
AI_state = AI_MOVECLOSE;
} else {
if ((((_local1 >= 0.6)) && ((_local1 < 0.8)))){
playMoveAway();
timeAction((3000 + (Math.random() * 3000)));
AI_state = AI_MOVEAWAY;
} else {
playStand();
timeAction((1000 + (Math.random() * 2000)));
AI_state = AI_IDLE;
};
};
};
AI_lock = true;
};
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "fatality"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
charState = _attack;
};
};
};
};
};
};
};
searchTarget();
AI_DECISION();
AI_RUN();
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if (objMC.currentLabel != "attack"){
objMC.gotoAndPlay("attack");
};
}
private function detectHitArea(){
if (objTargetMC){
if (objMC.isHitAreaCollision(objTargetMC)){
return (true);
};
return (false);
};
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
public function playBreak(){
if (objMC.currentLabel != "break"){
objMC.gotoAndPlay("break");
};
}
private function playDead(){
objMC.gotoAndPlay("dead");
}
private function timeActionComplete(_arg1:TimerEvent):void{
AI_lock = false;
}
private function playMoveAway(){
if (objTargetMC == null){
return;
};
if (objMC.currentLabel != "walk"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveToTarget(objTargetMC, -(speed));
if (objMC.x < objTargetMC.x){
objMC.setFlipLeft();
} else {
objMC.setFlipRight();
};
};
}
private function playHit(){
objMC.gotoAndPlay("hit");
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (actTimer){
actTimer.stop();
};
objMC.stop();
AI_paused_state = AI_state;
AI_lock = false;
} else {
if (actTimer){
actTimer.start();
};
objMC.play();
AI_state = AI_paused_state;
AI_lock = true;
};
}
public function playGuard(){
if (objMC.currentLabel != "guard"){
objMC.gotoAndPlay("guard");
};
}
private function playFatality(){
objMC.gotoAndPlay("fatality");
}
private function searchTarget(){
if (objTargetMC == null){
objTargetMC = worldMgr.searchAllyTarget(objMC);
};
}
private function timeAction(_arg1:int){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete);
actTimer = null;
};
actTimer = new Timer(_arg1, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timeActionComplete, false, 0, true);
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
private function AI_RUN(){
if ((((charState == _hit)) || ((charState == _dead)))){
AI_lock = false;
};
if (AI_lock){
if (AI_state == AI_IDLE){
} else {
if (AI_state == AI_MOVECLOSE){
playMoveClose();
if (detectHitArea()){
AI_lock = false;
};
} else {
if (AI_state == AI_MOVEAWAY){
playMoveAway();
} else {
if (AI_state == AI_ATTACK){
if (charState == _stand){
AI_lock = false;
};
} else {
if (AI_state == AI_GUARD){
};
};
};
};
};
};
}
public function isOffensive():Boolean{
if ((((charState == _attack)) || ((charState == _break)))){
return (true);
};
return (false);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
if (Math.random() < 0.7){
playDead();
} else {
playFatality();
};
destroy();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function destroy(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, timeAction);
actTimer = null;
};
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
objTargetMC = null;
worldMgr = null;
}
}
}//package
Section 51
//CharVindexClass (CharVindexClass)
package {
import flash.events.*;
public class CharVindexClass {
const _special = 4;
const _break = 3;
const _guard = 7;
const _move = 1;
const _dead = 6;
const _hit = 5;
const _stand = 0;
const _attack = 2;
private var worldMgr;// = null
private var speed:Number;// = 5
private var objMC;// = null
private var comboChain:Boolean;// = false
private var pushThis:Number;// = 0
private var multStr:Number;// = 1
private var charState:int;// = 0
private var isPaused:Boolean;// = false
public function CharVindexClass(_arg1, _arg2){
isPaused = false;
worldMgr = null;
objMC = null;
speed = 5;
comboChain = false;
pushThis = 0;
multStr = 1;
charState = 0;
super();
worldMgr = _arg1;
objMC = _arg2;
objMC.addEventListener(Event.ENTER_FRAME, animHandle, false, 0, true);
}
public function playStand(){
objMC.gotoAndPlay("stand");
}
public function playGuardToStand(){
if (objMC.currentLabel == "guard"){
objMC.gotoAndPlay("stand");
};
}
public function isEnableHit():Boolean{
if ((((((((((((charState == _stand)) || ((charState == _attack)))) || ((charState == _break)))) || ((charState == _guard)))) || ((charState == _move)))) || ((charState == _hit)))){
return (true);
};
return (false);
}
public function isState(_arg1:int):Boolean{
if (_arg1 == charState){
return (true);
};
return (false);
}
private function animHandle(_arg1:Event):void{
if (isPaused){
return;
};
if ((((objMC.currentLabel == "attack_1_chain")) && ((comboChain == true)))){
objMC.gotoAndPlay("attack_11");
comboChain = false;
};
if ((((objMC.currentLabel == "attack_11_chain")) && ((comboChain == true)))){
objMC.gotoAndPlay("attack_111");
comboChain = false;
};
if ((((objMC.currentLabel == "attack_12_chain")) && ((comboChain == true)))){
objMC.gotoAndPlay("attack_121");
comboChain = false;
};
if (objMC.currentLabel == "attack_11"){
if (objMC.isFaceRight()){
objMC.moveRight(1);
} else {
if (objMC.isFaceLeft()){
objMC.moveLeft(1);
};
};
};
if (objMC.currentLabel == "attack_111"){
if (objMC.isFaceRight()){
objMC.moveRight(2);
} else {
if (objMC.isFaceLeft()){
objMC.moveLeft(2);
};
};
};
if (objMC.currentLabel == "special_1"){
if (objMC.isFaceRight()){
objMC.moveRight(1);
} else {
if (objMC.isFaceLeft()){
objMC.moveLeft(1);
};
};
};
if (objMC.currentLabel == "special_2"){
if (objMC.isFaceRight()){
objMC.moveRight(1);
} else {
if (objMC.isFaceLeft()){
objMC.moveLeft(1);
};
};
};
if (objMC.currentLabel == "hit"){
objMC.movePush(pushThis);
};
if (objMC.currentLabel == "stand"){
charState = _stand;
} else {
if (objMC.currentLabel == "walk"){
charState = _move;
} else {
if (objMC.currentLabel == "guard"){
charState = _guard;
} else {
if (objMC.currentLabel == "hit"){
charState = _hit;
} else {
if (objMC.currentLabel == "dead"){
charState = _dead;
} else {
if (objMC.currentLabel == "break"){
charState = _break;
} else {
if ((((objMC.currentLabel == "special_1")) || ((objMC.currentLabel == "special_2")))){
charState = _special;
} else {
charState = _attack;
};
};
};
};
};
};
};
}
public function isGuard():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playAttack(){
if ((((objMC.currentLabel == "stand")) || ((objMC.currentLabel == "walk")))){
objMC.gotoAndPlay("attack_1");
comboChain = false;
} else {
if ((((objMC.currentLabel == "attack_1")) || ((objMC.currentLabel == "attack_1_chain")))){
comboChain = true;
} else {
if ((((objMC.currentLabel == "attack_11")) || ((objMC.currentLabel == "attack_11_chain")))){
comboChain = true;
} else {
if ((((objMC.currentLabel == "attack_12")) || ((objMC.currentLabel == "attack_12_chain")))){
comboChain = true;
};
};
};
};
}
public function setMultStr(_arg1:Number){
multStr = Math.max(_arg1, 1);
}
public function playMoveUp(){
if (objMC.currentLabel == "stand"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveUp(speed);
};
}
public function playBreak(){
if ((((objMC.currentLabel == "stand")) || ((objMC.currentLabel == "walk")))){
objMC.gotoAndPlay("break");
};
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
objMC.stop();
} else {
objMC.play();
};
}
public function playDead(){
objMC.gotoAndPlay("dead");
}
public function playWalkToStand(){
if (objMC.currentLabel == "walk"){
objMC.gotoAndPlay("stand");
};
}
public function playHit(){
objMC.gotoAndPlay("hit");
}
public function playGuard(){
if ((((objMC.currentLabel == "stand")) || ((objMC.currentLabel == "walk")))){
objMC.gotoAndPlay("guard");
};
}
public function isOffensive():Boolean{
if ((((((charState == _attack)) || ((charState == _special)))) || ((charState == _break)))){
return (true);
};
return (false);
}
public function playMoveLeft(){
if (objMC.currentLabel == "stand"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveLeft(speed);
objMC.setFlipLeft();
};
}
public function isDefensive():Boolean{
if (charState == _guard){
return (true);
};
return (false);
}
public function playSpecial1():Boolean{
if ((((((objMC.currentLabel == "stand")) || ((objMC.currentLabel == "walk")))) || ((objMC.currentLabel == "hit")))){
objMC.gotoAndPlay("special_1");
return (true);
};
return (false);
}
public function playSpecial2():Boolean{
if ((((((objMC.currentLabel == "stand")) || ((objMC.currentLabel == "walk")))) || ((objMC.currentLabel == "hit")))){
objMC.gotoAndPlay("special_2");
return (true);
};
return (false);
}
public function getIsPaused():Boolean{
return (isPaused);
}
public function setDamageHit(_arg1:StdAtkRes){
var _local2:*;
if (isEnableHit()){
if (_arg1.isHit()){
_local2 = null;
pushThis = _arg1.getPushTarget();
if (isGuard()){
objMC.setHealth(-1);
} else {
objMC.setHealth(-(_arg1.getDamage()));
};
if (objMC.isKoed()){
if (_arg1.getTypeHit() == 1){
_local2 = new _slash_hit();
} else {
if (_arg1.getTypeHit() == 2){
_local2 = new _blunt_hit();
} else {
if (_arg1.getTypeHit() == 3){
_local2 = new _kick_hit();
} else {
_local2 = new _arrow_hit();
};
};
};
playDead();
} else {
if (_arg1.getTypeHit() == 1){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _slash_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 2){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _blunt_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 3){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _kick_hit();
playHit();
} else {
_local2 = new _guard_hit();
};
} else {
if (_arg1.getTypeHit() == 4){
if ((((isGuard() == false)) || (_arg1.isUnblockable()))){
_local2 = new _arrow_hit();
playHit();
} else {
_local2 = new _arrow_guard();
};
};
};
};
};
};
if (_local2){
_local2.playSound();
};
};
};
}
public function getAttackHit():StdAtkRes{
var _local1:*;
_local1 = new StdAtkRes();
if (objMC){
if (objMC.currentFrame == 45){
_local1.setHit(Math.round((5 * multStr)), 1, 2, false);
};
if (objMC.currentFrame == 52){
_local1.setHit(Math.round((4 * multStr)), 2, 2.5, true);
};
if (objMC.currentFrame == 55){
_local1.setHit(Math.round((6 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 65){
_local1.setHit(Math.round((7 * multStr)), 1, 2, false);
};
if (objMC.currentFrame == 73){
_local1.setHit(Math.round((8 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 86){
_local1.setHit(Math.round((12 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 92){
_local1.setHit(Math.round((10 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 103){
_local1.setHit(Math.round((8 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 111){
_local1.setHit(Math.round((9 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 117){
_local1.setHit(Math.round((10 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 126){
_local1.setHit(Math.round((11 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 133){
_local1.setHit(Math.round((8 * multStr)), 2, 1, true);
};
if (objMC.currentFrame == 138){
_local1.setHit(Math.round((12 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 141){
_local1.setHit(Math.round((14 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 155){
_local1.setHit(Math.round((13 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 162){
_local1.setHit(Math.round((16 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 173){
_local1.setHit(Math.round((18 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 180){
_local1.setHit(Math.round((20 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 185){
_local1.setHit(Math.round((22 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 189){
_local1.setHit(Math.round((15 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 193){
_local1.setHit(Math.round((30 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 199){
_local1.setHit(Math.round((6 * multStr)), 2, 1, true);
};
if (objMC.currentFrame == 206){
_local1.setHit(Math.round((11 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 215){
_local1.setHit(Math.round((13 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 222){
_local1.setHit(Math.round((15 * multStr)), 1, 1, false);
};
if (objMC.currentFrame == 231){
_local1.setHit(Math.round((25 * multStr)), 1, 1, false);
};
};
return (_local1);
}
public function playMoveDown(){
if (objMC.currentLabel == "stand"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveDown(speed);
};
}
public function playMoveRight(){
if (objMC.currentLabel == "stand"){
objMC.gotoAndPlay("walk");
};
if (objMC.currentLabel == "walk"){
objMC.moveRight(speed);
objMC.setFlipRight();
};
}
public function destroy(){
objMC.removeEventListener(Event.ENTER_FRAME, animHandle);
objMC = null;
worldMgr = null;
}
}
}//package
Section 52
//ea_mc (ea_mc)
package {
public dynamic class ea_mc extends EntityClass {
public function ea_mc(){
addFrameScript(24, frame25, 48, frame49, 49, frame50, 72, frame73, 94, frame95, 104, frame105, 124, frame125, 179, frame180);
}
function frame180(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame49(){
gotoAndPlay("walk");
}
function frame50(){
gotoAndPlay("stand");
}
function frame73(){
gotoAndPlay("stand");
}
function frame95(){
gotoAndPlay("stand");
}
function frame105(){
gotoAndPlay("stand");
}
function frame125(){
stop();
}
}
}//package
Section 53
//eb_mc (eb_mc)
package {
public dynamic class eb_mc extends EntityClass {
public function eb_mc(){
addFrameScript(24, frame25, 54, frame55, 55, frame56, 90, frame91, 124, frame125, 140, frame141, 154, frame155, 176, frame177, 231, frame232);
}
function frame155(){
gotoAndPlay("stand");
}
function frame177(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame55(){
gotoAndPlay("walk");
}
function frame56(){
gotoAndPlay("stand");
}
function frame91(){
gotoAndPlay("stand");
}
function frame232(){
stop();
}
function frame125(){
gotoAndPlay("stand");
}
function frame141(){
gotoAndPlay(133);
}
}
}//package
Section 54
//egyptLand (egyptLand)
package {
import flash.display.*;
public dynamic class egyptLand extends Sprite {
public var bg3:MovieClip;
public var bg1:MovieClip;
public var bg2:MovieClip;
}
}//package
Section 55
//ending_lose_mc (ending_lose_mc)
package {
import flash.display.*;
public dynamic class ending_lose_mc extends MovieClip {
public var gmoverRetry:SimpleButton;
public var gmoverQuit:SimpleButton;
public var gAnotherGame:SimpleButton;
public function ending_lose_mc(){
addFrameScript(184, frame185);
}
function frame185(){
stop();
}
}
}//package
Section 56
//ending_movie (ending_movie)
package {
public dynamic class ending_movie extends BaseSound {
}
}//package
Section 57
//ending_movie_mc (ending_movie_mc)
package {
import flash.display.*;
public dynamic class ending_movie_mc extends MovieClip {
public var edMMenu:SimpleButton;
public var edPlayMore:SimpleButton;
public function ending_movie_mc(){
addFrameScript(689, frame690);
}
function frame690(){
stop();
}
}
}//package
Section 58
//EnemyManager (EnemyManager)
package {
import flash.events.*;
import flash.utils.*;
public class EnemyManager {
const persian_archer = 8;
const sparta_archer = 14;
const britons_fighter = 4;
const persian_fighter = 7;
const viking_archer = 2;
const persian_boss = 9;
const sparta_fighter = 13;
const viking_boss = 3;
const viking_fighter = 1;
const egypt_boss = 12;
const britons_boss = 6;
const egypt_fighter = 10;
const egypt_archer = 11;
const britons_archer = 5;
const sparta_boss = 15;
private var spawnTimer:Timer;// = null
private var totEnemySpawn:int;// = 0
private var limitEnemy:int;// = 0
private var lvStage:int;// = 0
private var worldMgr;// = null
private var parent_stage;
private var enemySpawn:int;// = 0
private var objEnemy;// = null
private var lvTitle:String;// = "buzz"
private var playerMgr;// = null
public function EnemyManager(_arg1){
objEnemy = null;
worldMgr = null;
playerMgr = null;
limitEnemy = 0;
totEnemySpawn = 0;
enemySpawn = 0;
lvTitle = "buzz";
lvStage = 0;
spawnTimer = null;
super();
parent_stage = _arg1;
}
public function battleOfPersianLand(_arg1:int){
lvStage = 3;
enemySpawn = 0;
if (_arg1 == 1){
limitEnemy = 5;
totEnemySpawn = 20;
lvTitle = "3 STAGE 1";
} else {
limitEnemy = 5;
totEnemySpawn = 25;
lvTitle = "3 STAGE 2";
};
parent_stage.addEventListener(Event.ENTER_FRAME, persianLandHandle, false, 0, true);
}
private function spartaLandHandle(_arg1:Event):void{
if ((((((((spawnTimer == null)) && ((enemySpawn < totEnemySpawn)))) && ((worldMgr.getTotEnemy() < limitEnemy)))) && ((playerMgr.isPaused == false)))){
enemySpawn++;
if (enemySpawn == 1){
spawnEnemy(sparta_fighter, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
if (enemySpawn == 35){
spawnEnemy(sparta_boss, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
spawnEnemy(getRandomEnemyType(lvStage), getRandomPosX(), getRandomPosY(), 1);
};
};
setDelaySpawn((3000 + (Math.random() * 300)));
};
if (playerMgr.getKill() >= totEnemySpawn){
parent_stage.removeEventListener(Event.ENTER_FRAME, spartaLandHandle);
};
}
private function brytonLandHandle(_arg1:Event):void{
if ((((((((spawnTimer == null)) && ((enemySpawn < totEnemySpawn)))) && ((worldMgr.getTotEnemy() < limitEnemy)))) && ((playerMgr.isPaused == false)))){
enemySpawn++;
if (enemySpawn == 1){
spawnEnemy(britons_fighter, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
if (enemySpawn == 20){
spawnEnemy(britons_boss, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
spawnEnemy(getRandomEnemyType(lvStage), getRandomPosX(), getRandomPosY(), 1);
};
};
setDelaySpawn((4000 + (Math.random() * 3000)));
};
if (playerMgr.getKill() >= totEnemySpawn){
parent_stage.removeEventListener(Event.ENTER_FRAME, brytonLandHandle);
};
}
public function getTitle():String{
return (lvTitle);
}
public function battleOfBritonLand(_arg1:int){
lvStage = 2;
enemySpawn = 0;
if (_arg1 == 1){
limitEnemy = 4;
totEnemySpawn = 15;
lvTitle = "2 STAGE 1";
} else {
limitEnemy = 5;
totEnemySpawn = 20;
lvTitle = "2 STAGE 2";
};
parent_stage.addEventListener(Event.ENTER_FRAME, brytonLandHandle, false, 0, true);
}
private function setDelaySpawn(_arg1:int){
if (spawnTimer){
spawnTimer.stop();
spawnTimer.removeEventListener(TimerEvent.TIMER, spawnDelay);
spawnTimer = null;
};
spawnTimer = new Timer(_arg1, 1);
spawnTimer.start();
spawnTimer.addEventListener(TimerEvent.TIMER_COMPLETE, spawnDelay, false, 0, true);
}
private function egyptLandHandle(_arg1:Event):void{
if ((((((((spawnTimer == null)) && ((enemySpawn < totEnemySpawn)))) && ((worldMgr.getTotEnemy() < limitEnemy)))) && ((playerMgr.isPaused == false)))){
enemySpawn++;
if (enemySpawn == 1){
spawnEnemy(egypt_fighter, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
if (enemySpawn == 30){
spawnEnemy(egypt_boss, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
spawnEnemy(getRandomEnemyType(lvStage), getRandomPosX(), getRandomPosY(), 1);
};
};
setDelaySpawn((3000 + (Math.random() * 3000)));
};
if (playerMgr.getKill() >= totEnemySpawn){
parent_stage.removeEventListener(Event.ENTER_FRAME, egyptLandHandle);
};
}
private function getRandomEnemyType(_arg1:int):int{
var _local2:int;
if (_arg1 == 1){
if (Math.random() < 0.6){
_local2 = viking_fighter;
} else {
_local2 = viking_archer;
};
} else {
if (_arg1 == 2){
if (Math.random() < 0.6){
_local2 = britons_fighter;
} else {
_local2 = britons_archer;
};
} else {
if (_arg1 == 3){
if (Math.random() < 0.6){
_local2 = persian_fighter;
} else {
_local2 = persian_archer;
};
} else {
if (_arg1 == 4){
if (Math.random() < 0.6){
_local2 = egypt_fighter;
} else {
_local2 = egypt_archer;
};
} else {
if (_arg1 == 5){
if (Math.random() < 0.6){
_local2 = sparta_fighter;
} else {
_local2 = sparta_archer;
};
};
};
};
};
};
return (_local2);
}
public function getEnemySpawn():int{
return (enemySpawn);
}
private function persianLandHandle(_arg1:Event):void{
if ((((((((spawnTimer == null)) && ((enemySpawn < totEnemySpawn)))) && ((worldMgr.getTotEnemy() < limitEnemy)))) && ((playerMgr.isPaused == false)))){
enemySpawn++;
if (enemySpawn == 1){
spawnEnemy(persian_fighter, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
if (enemySpawn == 25){
spawnEnemy(persian_boss, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
spawnEnemy(getRandomEnemyType(lvStage), getRandomPosX(), getRandomPosY(), 1);
};
};
setDelaySpawn((4000 + (Math.random() * 3000)));
};
if (playerMgr.getKill() >= totEnemySpawn){
parent_stage.removeEventListener(Event.ENTER_FRAME, persianLandHandle);
};
}
public function spawnEnemy(_arg1, _arg2, _arg3, _arg4){
var _local5:int;
var _local6:*;
_local5 = 0;
_local6 = null;
_local5 = 1;
while (_local5 <= _arg4) {
if (_arg1 == viking_fighter){
objEnemy = new vx_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharVikingFighterClass(worldMgr, objEnemy));
objEnemy.initHealth(50);
objEnemy.initExp(75);
} else {
if (_arg1 == viking_archer){
objEnemy = new va_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharVikingArcherClass(worldMgr, objEnemy));
objEnemy.initHealth(25);
objEnemy.initExp(45);
} else {
if (_arg1 == viking_boss){
objEnemy = new vb_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharVikingBossClass(worldMgr, objEnemy));
objEnemy.initHealth(400);
objEnemy.initExp(1000);
};
};
};
if (_arg1 == britons_fighter){
objEnemy = new bs_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharBritonsFighterClass(worldMgr, objEnemy));
objEnemy.initHealth(70);
objEnemy.initExp(100);
} else {
if (_arg1 == britons_archer){
objEnemy = new ba_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharBritonsArcherClass(worldMgr, objEnemy));
objEnemy.initHealth(50);
objEnemy.initExp(75);
} else {
if (_arg1 == britons_boss){
objEnemy = new bb_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharBritonsBossClass(worldMgr, objEnemy));
objEnemy.initHealth(550);
objEnemy.initExp(1500);
};
};
};
if (_arg1 == persian_fighter){
objEnemy = new ps_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharPersianFighterClass(worldMgr, objEnemy));
objEnemy.initHealth(120);
objEnemy.initExp(125);
} else {
if (_arg1 == persian_archer){
objEnemy = new pa_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharPersianArcherClass(worldMgr, objEnemy));
objEnemy.initHealth(80);
objEnemy.initExp(100);
} else {
if (_arg1 == persian_boss){
objEnemy = new pb_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharPersianBossClass(worldMgr, objEnemy));
objEnemy.initHealth(850);
objEnemy.initExp(2000);
};
};
};
if (_arg1 == egypt_fighter){
objEnemy = new es_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharEgyptFighterClass(worldMgr, objEnemy));
objEnemy.initHealth(125);
objEnemy.initExp(150);
} else {
if (_arg1 == egypt_archer){
objEnemy = new ea_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharEgyptArcherClass(worldMgr, objEnemy));
objEnemy.initHealth(100);
objEnemy.initExp(125);
} else {
if (_arg1 == egypt_boss){
objEnemy = new eb_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharEgyptBossClass(worldMgr, objEnemy));
objEnemy.initHealth(1000);
objEnemy.initExp(2500);
};
};
};
if (_arg1 == sparta_fighter){
objEnemy = new ss_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharSpartaFighterClass(worldMgr, objEnemy));
objEnemy.initHealth(160);
objEnemy.initExp(200);
} else {
if (_arg1 == sparta_archer){
objEnemy = new sa_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharSpartaArcherClass(worldMgr, objEnemy));
objEnemy.initHealth(150);
objEnemy.initExp(150);
} else {
if (_arg1 == sparta_boss){
objEnemy = new sb_mc();
objEnemy.createEntity(worldMgr, objEnemy._enemy, ((_arg2 - 50) + (Math.random() * 100)), ((_arg3 - 50) + (Math.random() * 100)));
objEnemy.createAI(new CharSpartaBossClass(worldMgr, objEnemy));
objEnemy.initHealth(1600);
objEnemy.initExp(3000);
};
};
};
_local5++;
};
if (objEnemy){
if (playerMgr.getObjPlayer().x < objEnemy.x){
objEnemy.setFlipLeft();
};
};
}
public function getStage():int{
return (lvStage);
}
public function battleOfSpartaLand(_arg1:int){
lvStage = 5;
enemySpawn = 0;
if (_arg1 == 1){
limitEnemy = 6;
totEnemySpawn = 30;
lvTitle = "5 STAGE 1";
} else {
limitEnemy = 6;
totEnemySpawn = 35;
lvTitle = "5 FINAL";
};
parent_stage.addEventListener(Event.ENTER_FRAME, spartaLandHandle, false, 0, true);
}
public function getTotEnemySpawn():int{
return (totEnemySpawn);
}
private function spawnDelay(_arg1:TimerEvent):void{
if (spawnTimer){
spawnTimer.stop();
spawnTimer.removeEventListener(TimerEvent.TIMER, spawnDelay);
spawnTimer = null;
};
}
private function getRandomPosX():int{
if (Math.random() < 0.6){
return ((playerMgr.getObjPlayer().x + 640));
};
return ((playerMgr.getObjPlayer().x - 640));
}
private function getRandomPosY():int{
return (((playerMgr.getObjPlayer().y - 50) + (Math.random() * 100)));
}
public function battleOfVikingLand(_arg1:int){
lvStage = 1;
enemySpawn = 0;
if (_arg1 == 1){
limitEnemy = 4;
totEnemySpawn = 10;
lvTitle = "1 STAGE 1";
} else {
limitEnemy = 5;
totEnemySpawn = 15;
lvTitle = "2 STAGE 1";
};
parent_stage.addEventListener(Event.ENTER_FRAME, vikingLandHandle, false, 0, true);
}
private function vikingLandHandle(_arg1:Event):void{
if ((((((((spawnTimer == null)) && ((enemySpawn < totEnemySpawn)))) && ((worldMgr.getTotEnemy() < limitEnemy)))) && ((playerMgr.isPaused == false)))){
enemySpawn++;
if (enemySpawn == 1){
spawnEnemy(viking_fighter, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
if (enemySpawn == 15){
spawnEnemy(viking_boss, (playerMgr.getObjPlayer().x + 640), getRandomPosY(), 1);
} else {
spawnEnemy(getRandomEnemyType(lvStage), getRandomPosX(), getRandomPosY(), 1);
};
};
setDelaySpawn((4000 + (Math.random() * 3000)));
};
if (playerMgr.getKill() >= totEnemySpawn){
parent_stage.removeEventListener(Event.ENTER_FRAME, vikingLandHandle);
};
}
public function create(_arg1, _arg2){
worldMgr = _arg1;
playerMgr = _arg2;
}
public function battleOfEgyptLand(_arg1:int){
lvStage = 4;
enemySpawn = 0;
if (_arg1 == 1){
limitEnemy = 5;
totEnemySpawn = 25;
lvTitle = "4 STAGE 1";
} else {
limitEnemy = 6;
totEnemySpawn = 30;
lvTitle = "4 STAGE 2";
};
parent_stage.addEventListener(Event.ENTER_FRAME, egyptLandHandle, false, 0, true);
}
}
}//package
Section 59
//EntityClass (EntityClass)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class EntityClass extends BaseMovieClip {
const _player = 1;
const _object_box = 6;
const _enemy = 3;
const _object_grass = 5;
const _object_box2 = 7;
const _object_wall = 8;
const _ally = 2;
const _item = 4;
private var entMaxSpecial:int;// = 1
public var healthBar:MovieClip;
private var AI;// = null
private var entMaxHealth:int;// = 1
public var _trace_spd_x:Number;// = 0
public var _trace_spd_y:Number;// = 0
private var entType:int;// = 1
public var bodyBox:MovieClip;
private var entKill:int;// = 0
public var hitAreaBox:MovieClip;
private var isPaused:Boolean;// = false
private var entHealth:int;// = 1
private var entExp:int;// = 0
public var hitBox:MovieClip;
private var entSpecial:int;// = 0
private var contSCN;// = null
private var actTimer:Timer;// = null
public var areaBox:MovieClip;
public function EntityClass(){
isPaused = false;
contSCN = null;
AI = null;
entType = 1;
entMaxHealth = 1;
entHealth = 1;
entMaxSpecial = 1;
entSpecial = 0;
entExp = 0;
entKill = 0;
_trace_spd_x = 0;
_trace_spd_y = 0;
actTimer = null;
super();
trace(" initialise entity class ... ok!!");
}
private function frameHandle(_arg1:Event):void{
if (isPaused){
return;
};
if (this.healthBar){
healthBar.val.scaleX = (entHealth / entMaxHealth);
};
if (isPlayer()){
return;
};
if (((isKoed()) && ((actTimer == null)))){
if (this.healthBar){
healthBar.visible = false;
};
actTimer = new Timer(5000, 1);
actTimer.start();
actTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeAction, false, 0, true);
AI = null;
};
}
public function getAI():Object{
return (AI);
}
public function moveDown(_arg1:Number){
this.y = (this.y + _arg1);
_trace_spd_y = _arg1;
}
public function createAI(_arg1){
AI = _arg1;
}
public function setPaused(_arg1:Boolean){
isPaused = _arg1;
if (isPaused){
if (AI){
AI.setPaused(true);
};
if (actTimer){
actTimer.stop();
};
} else {
if (AI){
AI.setPaused(false);
};
if (actTimer){
actTimer.start();
};
};
}
public function moveUp(_arg1:Number){
this.y = (this.y - _arg1);
_trace_spd_y = _arg1;
}
public function setExp(_arg1:int){
entExp = Math.max(Math.min((entExp + _arg1), 9999999), 0);
}
public function isEnemy():Boolean{
if (entType == _enemy){
return (true);
};
return (false);
}
public function getSpecial(_arg1:Boolean=false):int{
if (_arg1){
return (entMaxSpecial);
};
return (entSpecial);
}
public function destroyEntity(){
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, removeAction);
actTimer = null;
};
removeEventListener(Event.ENTER_FRAME, frameHandle);
if (AI){
AI.destroy();
};
AI = null;
contSCN.removeChild(this);
}
public function getEntType():int{
return (entType);
}
public function setFlipLeft(){
if (this.scaleX != -1){
this.scaleX = -1;
};
}
public function movePush(_arg1:Number){
this.x = (this.x + _arg1);
_trace_spd_x = _arg1;
}
public function initKill(_arg1:int){
entKill = _arg1;
}
public function isPlayer():Boolean{
if (entType == _player){
return (true);
};
return (false);
}
public function setType(_arg1:int){
entType = _arg1;
}
public function testCollision(_arg1, _arg2){
if (((_arg1.isKoed()) || (_arg2.isKoed()))){
return;
};
if (isCollisionFoot(_arg1, _arg2)){
pushObject(_arg1, _arg2);
};
}
public function moveRight(_arg1:Number){
this.x = (this.x + _arg1);
_trace_spd_x = _arg1;
}
public function moveToTarget(_arg1, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = (_arg1.x - this.x);
_local4 = (_arg1.y - this.y);
_local5 = Math.atan2(_local4, _local3);
this.x = (this.x + (_arg2 * Math.cos(_local5)));
this.y = (this.y + (_arg2 * Math.sin(_local5)));
}
public function getExp():int{
return (entExp);
}
public function initExp(_arg1:int){
entExp = _arg1;
}
public function isObject():Boolean{
if ((((entType == _object_box)) || ((entType == _object_box2)))){
return (true);
};
return (false);
}
public function isAlly():Boolean{
if ((((entType == _player)) || ((entType == _ally)))){
return (true);
};
return (false);
}
public function isKoed():Boolean{
if (entHealth <= 0){
return (true);
};
return (false);
}
public function isItem():Boolean{
if (entType == _item){
return (true);
};
return (false);
}
public function setHealth(_arg1:int){
entHealth = Math.max(Math.min((entHealth + _arg1), entMaxHealth), 0);
if (_arg1 < 0){
setSpecial((Math.abs(_arg1) * 0.1));
};
}
public function isFaceLeft(){
if (this.scaleX < 0){
return (true);
};
return (false);
}
public function getHealth(_arg1:Boolean=false):int{
if (_arg1){
return (entMaxHealth);
};
return (entHealth);
}
public function setFlipRight(){
if (this.scaleX != 1){
this.scaleX = 1;
};
}
public function moveLeft(_arg1:Number){
this.x = (this.x - _arg1);
_trace_spd_x = _arg1;
}
public function initSpecial(_arg1:int){
entMaxSpecial = (entSpecial = _arg1);
}
public function initHealth(_arg1:int){
entMaxHealth = (entHealth = _arg1);
}
public function isHitAreaCollision(_arg1):Boolean{
if (isCollisionArea(this, _arg1)){
return (true);
};
return (false);
}
public function isFaceRight(){
if (this.scaleX > 0){
return (true);
};
return (false);
}
public function getKill():int{
return (entKill);
}
private function removeAction(_arg1:TimerEvent):void{
if (actTimer){
actTimer.stop();
actTimer.removeEventListener(TimerEvent.TIMER, removeAction);
actTimer = null;
};
destroyEntity();
}
public function testHitAttackCollision(_arg1){
var _local2:StdAtkRes;
if (((AI) && (_arg1.getAI()))){
if (((_arg1.getAI().isEnableHit()) && ((_arg1.isKoed() == false)))){
if (isCollisionHit(this, _arg1)){
_local2 = AI.getAttackHit();
_local2.directionPush(this, _arg1);
_arg1.getAI().setDamageHit(_local2);
setSpecial((getSpecial(true) * 0.01));
if (_arg1.isKoed()){
entKill = Math.min((entKill + 1), 999999);
if (isAlly()){
entExp = Math.min((entExp + _arg1.getExp()), 999999);
};
};
};
};
};
}
public function setSpecial(_arg1:int){
entSpecial = Math.max(Math.min((entSpecial + _arg1), entMaxSpecial), 0);
}
public function createEntity(_arg1, _arg2:int, _arg3:int, _arg4:int){
contSCN = _arg1.getContainerScene();
entType = _arg2;
this.x = _arg3;
this.y = (_arg4 + (Math.random() * 0.001));
this.cacheAsBitmap = true;
if (entType == _player){
setupProperty(false, false);
} else {
if (entType == _ally){
setupProperty(false, false);
} else {
if (entType == _enemy){
setupProperty(false, false);
} else {
if ((((entType == _item)) || ((entType == _object_grass)))){
setupProperty(true, true);
} else {
if (entType == _object_box){
setupProperty(false, false);
} else {
if ((((entType == _object_box2)) || ((entType == _object_wall)))){
setupProperty(true, false);
};
};
};
};
};
};
addEventListener(Event.ENTER_FRAME, frameHandle, false, 0, true);
contSCN.addChild(this);
}
}
}//package
Section 60
//es_mc (es_mc)
package {
public dynamic class es_mc extends EntityClass {
public function es_mc(){
addFrameScript(24, frame25, 36, frame37, 37, frame38, 59, frame60, 64, frame65, 65, frame66, 75, frame76, 83, frame84, 109, frame110, 111, frame112, 167, frame168);
}
function frame168(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame37(){
gotoAndPlay("walk");
}
function frame38(){
gotoAndPlay("stand");
}
function frame60(){
gotoAndPlay("stand");
}
function frame65(){
stop();
}
function frame66(){
gotoAndPlay("stand");
}
function frame76(){
gotoAndPlay("stand");
}
function frame84(){
gotoAndPlay("stand");
}
function frame110(){
stop();
}
function frame112(){
stop();
}
}
}//package
Section 61
//GameManager (GameManager)
package {
import flash.events.*;
import flash.display.*;
public class GameManager extends Sprite {
private var worldMgr;
private var upArrow:Boolean;
private var menuMgr;
private var leftArrow:Boolean;
private var rightArrow:Boolean;
private var enemyMgr;
private var playerMgr;
private var downArrow:Boolean;
private var soundMgr;
private var thisParent;
public function GameManager(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
thisParent = _arg1;
soundMgr = _arg2;
worldMgr = _arg3;
menuMgr = _arg4;
playerMgr = _arg5;
enemyMgr = _arg6;
}
private function playStage(_arg1:int){
if (_arg1 == 1){
worldMgr.createBgScene(1);
playerMgr.create(worldMgr, enemyMgr);
enemyMgr.create(worldMgr, playerMgr);
menuMgr.showInterface();
soundMgr.playStageBgm();
};
}
public function initialise(){
worldMgr.create();
playerMgr.create(worldMgr, enemyMgr, menuMgr);
enemyMgr.create(worldMgr, playerMgr);
menuMgr.create(worldMgr, soundMgr, playerMgr, enemyMgr);
menuMgr.showMainMenu();
}
private function gameHandle(_arg1:Event):void{
}
private function keyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 80){
if (playerMgr.isPaused){
playerMgr.isPaused = false;
worldMgr.setPaused(playerMgr.isPaused);
} else {
playerMgr.isPaused = true;
worldMgr.setPaused(playerMgr.isPaused);
};
};
}
}
}//package
Section 62
//interface_all_mc (interface_all_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class interface_all_mc extends Sprite {
public var kill_txt:TextField;
public var sp_bar:MovieClip;
public var level_txt:TextField;
public var point_txt:TextField;
public var exp_txt:TextField;
public var hp_bar:MovieClip;
public var ether_txt:TextField;
public var life_mc:MovieClip;
public var bPMore:MovieClip;
public var bPause:SimpleButton;
public var potion_txt:TextField;
}
}//package
Section 63
//lost_scene (lost_scene)
package {
public dynamic class lost_scene extends BaseSound {
}
}//package
Section 64
//main_mc (main_mc)
package {
import flash.display.*;
public dynamic class main_mc extends MovieClip {
public var bPlayMore:SimpleButton;
public var bControls:SimpleButton;
public var bBack:SimpleButton;
public var bAddGame:SimpleButton;
public var bLogicButton:SimpleButton;
public var bCredit:SimpleButton;
public var boomboxer:MovieClip;
public var bPlay:SimpleButton;
public var bArcadeBomb:SimpleButton;
public function main_mc(){
addFrameScript(39, frame40, 40, frame41, 41, frame42);
}
function frame40(){
stop();
}
function frame41(){
stop();
}
function frame42(){
stop();
}
}
}//package
Section 65
//main_menu (main_menu)
package {
public dynamic class main_menu extends BaseSound {
}
}//package
Section 66
//MenuManager (MenuManager)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class MenuManager extends Sprite {
private var worldMgr;// = null
private var _mnState:int;// = 0
private var _playLv:int;// = 1
private var enemyMgr;// = null
private var playerMgr;// = null
private var soundMgr;// = null
private var backAttached:int;// = 2
private var objCont;// = null
private var objMenu;// = null
public function MenuManager(){
objCont = null;
objMenu = null;
worldMgr = null;
soundMgr = null;
playerMgr = null;
enemyMgr = null;
_playLv = 1;
_mnState = 0;
backAttached = 2;
super();
}
private function mainMenuHandle(_arg1:Event):void{
if (objMenu.currentFrame == 10){
soundMgr.playBgm(1);
};
if (objMenu.currentFrame == 39){
objMenu.bPlay.addEventListener(MouseEvent.CLICK, playClick, false, 0, true);
objMenu.bPlayMore.addEventListener(MouseEvent.CLICK, playMoreClick, false, 0, true);
if (backAttached == 2){
objMenu.bArcadeBomb.addEventListener(MouseEvent.CLICK, playArcadeClick, false, 0, true);
objMenu.bLogicButton.addEventListener(MouseEvent.CLICK, playLogicClick, false, 0, true);
};
objMenu.bAddGame.addEventListener(MouseEvent.CLICK, addGameClick, false, 0, true);
if (objMenu.bCredit){
objMenu.bCredit.addEventListener(MouseEvent.CLICK, creditClick, false, 0, true);
};
if (objMenu.bControls){
objMenu.bControls.addEventListener(MouseEvent.CLICK, controlsClick, false, 0, true);
};
backAttached = 1;
};
if (objMenu.currentFrame >= 41){
if (backAttached > 2){
backAttached--;
if (backAttached <= 2){
backAttached = 1;
};
};
if (backAttached == 1){
trace("in");
if (objMenu.bBack){
trace("inatt");
};
objMenu.bBack.addEventListener(MouseEvent.CLICK, backClick, false, 0, true);
backAttached = 0;
};
};
}
public function destroy(){
if (((objCont) && (objMenu))){
removeOpening();
removeMainMenu();
removeInterface();
removePause();
objCont.removeChild(objMenu);
};
}
public function create(_arg1, _arg2, _arg3, _arg4){
worldMgr = _arg1;
soundMgr = _arg2;
playerMgr = _arg3;
enemyMgr = _arg4;
objCont = worldMgr.getContainerMenu();
}
private function upgradeSpMove(_arg1:MouseEvent):void{
if ((((playerMgr.getSpMoveLv() == 0)) && ((playerMgr.getExperience() >= 500)))){
playerMgr.upgradeSpMove(1, 500);
} else {
if ((((playerMgr.getSpMoveLv() == 1)) && ((playerMgr.getExperience() >= 800)))){
playerMgr.upgradeSpMove(1, 800);
};
};
}
private function gmoverRetryClick(_arg1:MouseEvent):void{
if (objMenu.gmoverRetry){
objMenu.gmoverRetry.removeEventListener(MouseEvent.CLICK, gmoverRetryClick);
};
if (objMenu.gmoverQuit){
objMenu.gmoverQuit.removeEventListener(MouseEvent.CLICK, gmoverQuitClick);
};
levelSelect(_playLv);
playerMgr.START(true);
showInterface();
playerMgr.objFocusKey();
soundMgr.playBgm(3);
trace("SHOW GMOVER");
playerMgr.TRACESTAT();
}
public function showGameOver(){
playerMgr.ENDF();
worldMgr.destroyBgScene();
destroy();
objMenu = new ending_lose_mc();
objCont.addChild(objMenu);
soundMgr.playBgm(4);
objMenu.addEventListener(Event.ENTER_FRAME, gameoverHandle, false, 0, true);
}
private function addGameClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadebomb.com/free_website_games.html");
navigateToURL(_local2, "_blank");
}
private function creditClick(_arg1:MouseEvent):void{
backAttached = 6;
if (objMenu.bPlay){
objMenu.bPlay.removeEventListener(MouseEvent.CLICK, playClick);
};
if (objMenu.bPlayMore){
objMenu.bPlayMore.removeEventListener(MouseEvent.CLICK, playMoreClick);
};
if (objMenu.bAddGame){
objMenu.bAddGame.removeEventListener(MouseEvent.CLICK, addGameClick);
};
if (objMenu.bCredit){
objMenu.bCredit.removeEventListener(MouseEvent.CLICK, creditClick);
};
if (objMenu.bControls){
objMenu.bControls.removeEventListener(MouseEvent.CLICK, controlsClick);
};
objMenu.gotoAndStop(41);
}
private function buyEther(_arg1:MouseEvent):void{
if ((((playerMgr.getPoint() >= 300)) && ((playerMgr.getEther() < 10)))){
playerMgr.addEther(1, 300);
};
}
private function edPlayMoreClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadebomb.com");
navigateToURL(_local2, "_blank");
}
private function playLogicClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.artlogicgames.com");
navigateToURL(_local2, "_blank");
}
private function controlClick(_arg1:MouseEvent):void{
objMenu.gotoAndStop("control");
}
public function removeInterface(){
if (objMenu){
objMenu.removeEventListener(Event.ENTER_FRAME, interfaceHandle);
};
if (objMenu.bPause){
objMenu.bPause.removeEventListener(MouseEvent.CLICK, pauseClick);
};
if (objMenu.bPMore){
objMenu.bPMore.removeEventListener(MouseEvent.CLICK, playMoreClick);
};
}
private function gmoverAnotherClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadebomb.com");
navigateToURL(_local2, "_blank");
}
private function pauseClick(_arg1:MouseEvent):void{
if (playerMgr.getHealth() > 0){
playerMgr.isPaused = true;
worldMgr.setPaused(playerMgr.isPaused);
showPause();
trace("SHOW PAUSE");
playerMgr.TRACESTAT();
};
}
private function removeOpening(){
if (objMenu.bSkip){
objMenu.bSkip.removeEventListener(MouseEvent.CLICK, playClick);
};
objMenu.removeEventListener(Event.ENTER_FRAME, openingHandle);
}
private function endingHandle(_arg1:Event):void{
if (((objMenu.edMMenu) && (objMenu.edPlayMore))){
objMenu.edMMenu.addEventListener(MouseEvent.CLICK, gotoMMenuClick, false, 0, true);
objMenu.edMMenu.addEventListener(MouseEvent.CLICK, edPlayMoreClick, false, 0, true);
objMenu.removeEventListener(Event.ENTER_FRAME, endingHandle);
};
}
private function gotoMMenuClick(_arg1:MouseEvent):void{
if (objMenu.edMMenu){
objMenu.edMMenu.removeEventListener(MouseEvent.CLICK, gotoMMenuClick);
};
if (objMenu.edPlayMore){
objMenu.edMMenu.removeEventListener(MouseEvent.CLICK, edPlayMoreClick);
};
showMainMenu();
}
private function upgradeSpecial(_arg1:MouseEvent):void{
if ((((playerMgr.getSpecialLv() == 0)) && ((playerMgr.getExperience() >= 100)))){
playerMgr.upgradeSpecial(1, 100);
} else {
if ((((playerMgr.getSpecialLv() == 1)) && ((playerMgr.getExperience() >= 200)))){
playerMgr.upgradeSpecial(1, 200);
} else {
if ((((playerMgr.getSpecialLv() == 2)) && ((playerMgr.getExperience() >= 400)))){
playerMgr.upgradeSpecial(1, 400);
} else {
if ((((playerMgr.getSpecialLv() == 3)) && ((playerMgr.getExperience() >= 800)))){
playerMgr.upgradeSpecial(1, 800);
} else {
if ((((playerMgr.getSpecialLv() == 4)) && ((playerMgr.getExperience() >= 1000)))){
playerMgr.upgradeSpecial(1, 1000);
} else {
if ((((playerMgr.getSpecialLv() == 5)) && ((playerMgr.getExperience() >= 1200)))){
playerMgr.upgradeSpecial(1, 1200);
} else {
if ((((playerMgr.getSpecialLv() == 6)) && ((playerMgr.getExperience() >= 1400)))){
playerMgr.upgradeSpecial(1, 1400);
} else {
if ((((playerMgr.getSpecialLv() == 7)) && ((playerMgr.getExperience() >= 1600)))){
playerMgr.upgradeSpecial(1, 1600);
} else {
if ((((playerMgr.getSpecialLv() == 8)) && ((playerMgr.getExperience() >= 1800)))){
playerMgr.upgradeSpecial(1, 1800);
} else {
if ((((playerMgr.getSpecialLv() == 9)) && ((playerMgr.getExperience() >= 2000)))){
playerMgr.upgradeSpecial(1, 2000);
};
};
};
};
};
};
};
};
};
};
}
private function skipClick(_arg1:MouseEvent):void{
objMenu.stop();
objMenu.removeEventListener(Event.ENTER_FRAME, openingHandle);
_playLv = 1;
worldMgr.createBgScene(worldMgr.vikingLand);
playerMgr.START();
enemyMgr.battleOfVikingLand(1);
showInterface();
soundMgr.playBgm(3);
playerMgr.objFocusKey();
}
private function quitYesClick(_arg1:MouseEvent):void{
objMenu.bQuitYes.removeEventListener(MouseEvent.CLICK, quitYesClick);
objMenu.bQuitNo.removeEventListener(MouseEvent.CLICK, quitNoClick);
showMainMenu();
}
public function showClear(){
destroy();
objMenu = new change_lv();
objCont.addChild(objMenu);
soundMgr.setVolume(0.5);
if (_playLv == 1){
objMenu.bg.gotoAndPlay("viking_1");
} else {
if (_playLv == 2){
objMenu.bg.gotoAndPlay("viking_2");
} else {
if (_playLv == 3){
objMenu.bg.gotoAndPlay("britons_1");
} else {
if (_playLv == 4){
objMenu.bg.gotoAndPlay("britons_2");
} else {
if (_playLv == 5){
objMenu.bg.gotoAndPlay("persian_1");
} else {
if (_playLv == 6){
objMenu.bg.gotoAndPlay("persian_2");
} else {
if (_playLv == 7){
objMenu.bg.gotoAndPlay("egypt_1");
} else {
if (_playLv == 8){
objMenu.bg.gotoAndPlay("egypt_2");
} else {
if (_playLv == 9){
objMenu.bg.gotoAndPlay("spartan_1");
} else {
if (_playLv == 10){
objMenu.bg.gotoAndPlay("spartan_1");
};
};
};
};
};
};
};
};
};
};
objMenu.addEventListener(Event.ENTER_FRAME, clearHandle, false, 0, true);
}
private function resumeClick(_arg1:MouseEvent):void{
objMenu.p_resume_btn.removeEventListener(MouseEvent.CLICK, resumeClick);
objMenu.gotoAndPlay("fade");
}
private function playMoreClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadebomb.com");
navigateToURL(_local2, "_blank");
}
private function removeMainMenu(){
if (objMenu.bPlay){
objMenu.bPlay.removeEventListener(MouseEvent.CLICK, playClick);
};
if (objMenu.bArcadeBomb){
objMenu.bArcadeBomb.removeEventListener(MouseEvent.CLICK, playArcadeClick);
};
if (objMenu.bLogicButton){
objMenu.bLogicButton.removeEventListener(MouseEvent.CLICK, playLogicClick);
};
if (objMenu.bPlayMore){
objMenu.bPlayMore.removeEventListener(MouseEvent.CLICK, playMoreClick);
};
if (objMenu.bAddGame){
objMenu.bAddGame.removeEventListener(MouseEvent.CLICK, addGameClick);
};
if (objMenu.bCredit){
objMenu.bCredit.removeEventListener(MouseEvent.CLICK, creditClick);
};
if (objMenu.bControls){
objMenu.bControls.removeEventListener(MouseEvent.CLICK, controlsClick);
};
objMenu.removeEventListener(Event.ENTER_FRAME, mainMenuHandle);
}
private function nextClick(_arg1:MouseEvent):void{
objMenu.bNextLevel.removeEventListener(MouseEvent.CLICK, nextClick);
_playLv = Math.min((_playLv + 1), 15);
trace("SHOW CLEAR");
playerMgr.TRACESTAT();
levelSelect(_playLv);
playerMgr.NEXT();
showInterface();
playerMgr.objFocusKey();
soundMgr.setVolume(1);
}
private function playArcadeClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadebomb.com");
navigateToURL(_local2, "_blank");
}
private function controlsClick(_arg1:MouseEvent):void{
backAttached = 6;
if (objMenu.bPlay){
objMenu.bPlay.removeEventListener(MouseEvent.CLICK, playClick);
};
if (objMenu.bPlayMore){
objMenu.bPlayMore.removeEventListener(MouseEvent.CLICK, playMoreClick);
};
if (objMenu.bAddGame){
objMenu.bAddGame.removeEventListener(MouseEvent.CLICK, addGameClick);
};
if (objMenu.bCredit){
objMenu.bCredit.removeEventListener(MouseEvent.CLICK, creditClick);
};
if (objMenu.bControls){
objMenu.bControls.removeEventListener(MouseEvent.CLICK, controlsClick);
};
objMenu.gotoAndStop(42);
}
private function quitClick(_arg1:MouseEvent):void{
objMenu.gotoAndPlay("quit");
}
private function upgradeStrength(_arg1:MouseEvent):void{
if ((((playerMgr.getStrengthLv() == 0)) && ((playerMgr.getExperience() >= 100)))){
playerMgr.upgradeStrength(1, 100);
} else {
if ((((playerMgr.getStrengthLv() == 1)) && ((playerMgr.getExperience() >= 200)))){
playerMgr.upgradeStrength(1, 200);
} else {
if ((((playerMgr.getStrengthLv() == 2)) && ((playerMgr.getExperience() >= 400)))){
playerMgr.upgradeStrength(1, 400);
} else {
if ((((playerMgr.getStrengthLv() == 3)) && ((playerMgr.getExperience() >= 800)))){
playerMgr.upgradeStrength(1, 800);
} else {
if ((((playerMgr.getStrengthLv() == 4)) && ((playerMgr.getExperience() >= 1000)))){
playerMgr.upgradeStrength(1, 1000);
} else {
if ((((playerMgr.getStrengthLv() == 5)) && ((playerMgr.getExperience() >= 1200)))){
playerMgr.upgradeStrength(1, 1200);
} else {
if ((((playerMgr.getStrengthLv() == 6)) && ((playerMgr.getExperience() >= 1400)))){
playerMgr.upgradeStrength(1, 1400);
} else {
if ((((playerMgr.getStrengthLv() == 7)) && ((playerMgr.getExperience() >= 1600)))){
playerMgr.upgradeStrength(1, 1600);
} else {
if ((((playerMgr.getStrengthLv() == 8)) && ((playerMgr.getExperience() >= 1800)))){
playerMgr.upgradeStrength(1, 1800);
} else {
if ((((playerMgr.getStrengthLv() == 9)) && ((playerMgr.getExperience() >= 2000)))){
playerMgr.upgradeStrength(1, 2000);
};
};
};
};
};
};
};
};
};
};
}
private function upgradeHealth(_arg1:MouseEvent):void{
if ((((playerMgr.getHealthLv() == 0)) && ((playerMgr.getExperience() >= 100)))){
playerMgr.upgradeHealth(1, 100);
} else {
if ((((playerMgr.getHealthLv() == 1)) && ((playerMgr.getExperience() >= 200)))){
playerMgr.upgradeHealth(1, 200);
} else {
if ((((playerMgr.getHealthLv() == 2)) && ((playerMgr.getExperience() >= 400)))){
playerMgr.upgradeHealth(1, 400);
} else {
if ((((playerMgr.getHealthLv() == 3)) && ((playerMgr.getExperience() >= 800)))){
playerMgr.upgradeHealth(1, 800);
} else {
if ((((playerMgr.getHealthLv() == 4)) && ((playerMgr.getExperience() >= 1000)))){
playerMgr.upgradeHealth(1, 1000);
} else {
if ((((playerMgr.getHealthLv() == 5)) && ((playerMgr.getExperience() >= 1200)))){
playerMgr.upgradeHealth(1, 1200);
} else {
if ((((playerMgr.getHealthLv() == 6)) && ((playerMgr.getExperience() >= 1400)))){
playerMgr.upgradeHealth(1, 1400);
} else {
if ((((playerMgr.getHealthLv() == 7)) && ((playerMgr.getExperience() >= 1600)))){
playerMgr.upgradeHealth(1, 1600);
} else {
if ((((playerMgr.getHealthLv() == 8)) && ((playerMgr.getExperience() >= 1800)))){
playerMgr.upgradeHealth(1, 1800);
} else {
if ((((playerMgr.getHealthLv() == 9)) && ((playerMgr.getExperience() >= 2000)))){
playerMgr.upgradeHealth(1, 2000);
};
};
};
};
};
};
};
};
};
};
}
private function gameoverHandle(_arg1:Event):void{
if (((objMenu.gmoverRetry) && (objMenu.gmoverQuit))){
objMenu.gmoverRetry.addEventListener(MouseEvent.CLICK, gmoverRetryClick, false, 0, true);
objMenu.gmoverQuit.addEventListener(MouseEvent.CLICK, gmoverQuitClick, false, 0, true);
objMenu.gAnotherGame.addEventListener(MouseEvent.CLICK, gmoverAnotherClick, false, 0, true);
objMenu.removeEventListener(Event.ENTER_FRAME, endingHandle);
};
}
private function mapClick(_arg1:MouseEvent):void{
objMenu.gotoAndStop("map");
}
public function showEnding(){
destroy();
objMenu = new ending_movie_mc();
objCont.addChild(objMenu);
soundMgr.playBgm(5);
objMenu.addEventListener(Event.ENTER_FRAME, endingHandle, false, 0, true);
}
private function openingHandle(_arg1:Event):void{
if (objMenu.currentFrame == objMenu.totalFrames){
objMenu.stop();
_playLv = 1;
worldMgr.createBgScene(worldMgr.vikingLand);
playerMgr.START();
enemyMgr.battleOfVikingLand(1);
showInterface();
soundMgr.playBgm(3);
playerMgr.objFocusKey();
objMenu.removeEventListener(Event.ENTER_FRAME, openingHandle);
};
}
private function levelSelect(_arg1:int):void{
switch (_arg1){
case 1:
worldMgr.createBgScene(worldMgr.vikingLand);
enemyMgr.battleOfVikingLand(1);
break;
case 2:
worldMgr.createBgScene(worldMgr.vikingLand);
enemyMgr.battleOfVikingLand(2);
break;
case 3:
worldMgr.createBgScene(worldMgr.brytonLand);
enemyMgr.battleOfBritonLand(1);
break;
case 4:
worldMgr.createBgScene(worldMgr.brytonLand);
enemyMgr.battleOfBritonLand(2);
break;
case 5:
worldMgr.createBgScene(worldMgr.persianLand);
enemyMgr.battleOfPersianLand(1);
break;
case 6:
worldMgr.createBgScene(worldMgr.persianLand);
enemyMgr.battleOfPersianLand(2);
break;
case 7:
worldMgr.createBgScene(worldMgr.egyptLand);
enemyMgr.battleOfEgyptLand(1);
break;
case 8:
worldMgr.createBgScene(worldMgr.egyptLand);
enemyMgr.battleOfEgyptLand(2);
break;
case 9:
worldMgr.createBgScene(worldMgr.spartaLand);
enemyMgr.battleOfSpartaLand(1);
break;
case 10:
worldMgr.createBgScene(worldMgr.spartaLand);
enemyMgr.battleOfSpartaLand(2);
break;
};
}
public function showOpening(){
destroy();
objMenu = new opening_movie_mc();
objCont.addChild(objMenu);
objMenu.gotoAndPlay(1);
soundMgr.playBgm(2);
objMenu.addEventListener(Event.ENTER_FRAME, openingHandle, false, 0, true);
objMenu.bSkip.addEventListener(MouseEvent.CLICK, skipClick, false, 0, true);
}
private function buyPotion(_arg1:MouseEvent):void{
if ((((playerMgr.getPoint() >= 300)) && ((playerMgr.getPotion() < 10)))){
playerMgr.addPotion(1, 300);
};
}
private function playClick(_arg1:MouseEvent):void{
objMenu.boomboxer.stop();
showOpening();
backAttached = 2;
}
private function pauseHandle(_arg1:Event):void{
if (objMenu.p_resume_btn){
objMenu.p_resume_btn.addEventListener(MouseEvent.CLICK, resumeClick, false, 0, true);
};
if (objMenu.p_quit_btn){
objMenu.p_quit_btn.addEventListener(MouseEvent.CLICK, quitClick, false, 0, true);
};
if (objMenu.p_map_btn){
objMenu.p_map_btn.addEventListener(MouseEvent.CLICK, mapClick, false, 0, true);
};
if (objMenu.p_controls_btn){
objMenu.p_controls_btn.addEventListener(MouseEvent.CLICK, controlClick, false, 0, true);
};
if (objMenu.p_upgrade_btn){
objMenu.p_upgrade_btn.addEventListener(MouseEvent.CLICK, upgradeClick, false, 0, true);
};
if (objMenu.bPMore){
objMenu.bPMore.addEventListener(MouseEvent.CLICK, playMoreClick, false, 0, true);
} else {
if (objMenu.currentLabel == "end"){
showInterface();
playerMgr.objFocusKey();
playerMgr.isPaused = false;
worldMgr.setPaused(playerMgr.isPaused);
};
};
if (objMenu.map_mc){
if ((((enemyMgr.getStage() == 1)) && (!((objMenu.map_mc.currentLabel == "viking"))))){
objMenu.map_mc.gotoAndPlay("viking");
} else {
if ((((enemyMgr.getStage() == 2)) && (!((objMenu.map_mc.currentLabel == "britons"))))){
objMenu.map_mc.gotoAndPlay("britons");
} else {
if ((((enemyMgr.getStage() == 3)) && (!((objMenu.map_mc.currentLabel == "persian"))))){
objMenu.map_mc.gotoAndPlay("persian");
} else {
if ((((enemyMgr.getStage() == 4)) && (!((objMenu.map_mc.currentLabel == "egypt"))))){
objMenu.map_mc.gotoAndPlay("egypt");
} else {
if ((((enemyMgr.getStage() == 5)) && (!((objMenu.map_mc.currentLabel == "sparta"))))){
objMenu.map_mc.gotoAndPlay("sparta");
};
};
};
};
};
};
if (objMenu.currentLabel == "upgrade"){
if (objMenu.hpStat_txt){
objMenu.hpStat_txt.htmlText = String(((("<b>" + playerMgr.getHealth()) + " / ") + playerMgr.getHealthMax()));
};
if (objMenu.spStat_txt){
objMenu.spStat_txt.htmlText = String(((("<b>" + playerMgr.getSpecial()) + " / ") + playerMgr.getSpecialMax()));
};
if (objMenu.ptsStat_txt){
objMenu.ptsStat_txt.htmlText = String(("<b>" + playerMgr.getPoint()));
};
if (objMenu.expStat_txt){
objMenu.expStat_txt.htmlText = String(("<b>" + playerMgr.getExperience()));
};
if (objMenu.potionBuy_txt){
objMenu.potionBuy_txt.htmlText = String(("<b>" + playerMgr.getPotion()));
};
if (objMenu.etherBuy_txt){
objMenu.etherBuy_txt.htmlText = String(("<b>" + playerMgr.getEther()));
};
if (objMenu.add_hp_mc){
if (objMenu.add_hp_mc.currentFrame != (playerMgr.getHealthLv() + 1)){
objMenu.add_hp_mc.gotoAndStop((playerMgr.getHealthLv() + 1));
};
};
if (objMenu.add_special_mc){
if (objMenu.add_special_mc.currentFrame != (playerMgr.getSpecialLv() + 1)){
objMenu.add_special_mc.gotoAndStop((playerMgr.getSpecialLv() + 1));
};
};
if (objMenu.add_strength_mc){
if (objMenu.add_strength_mc.currentFrame != (playerMgr.getStrengthLv() + 1)){
objMenu.add_strength_mc.gotoAndStop((playerMgr.getStrengthLv() + 1));
};
};
if (objMenu.sp_mc){
if (objMenu.sp_mc.currentFrame != (playerMgr.getSpMoveLv() + 1)){
objMenu.sp_mc.gotoAndStop((playerMgr.getSpMoveLv() + 1));
};
};
if (objMenu.u_potion_btn){
objMenu.u_potion_btn.addEventListener(MouseEvent.CLICK, buyPotion, false, 0, true);
};
if (objMenu.u_potion_btn){
objMenu.u_ether_btn.addEventListener(MouseEvent.CLICK, buyEther, false, 0, true);
};
if (objMenu.bUpgradeHp){
objMenu.bUpgradeHp.addEventListener(MouseEvent.CLICK, upgradeHealth, false, 0, true);
};
if (objMenu.bUpgradeStr){
objMenu.bUpgradeStr.addEventListener(MouseEvent.CLICK, upgradeStrength, false, 0, true);
};
if (objMenu.bUpgradeSp){
objMenu.bUpgradeSp.addEventListener(MouseEvent.CLICK, upgradeSpecial, false, 0, true);
};
if (objMenu.sp_mc){
objMenu.sp_mc.addEventListener(MouseEvent.CLICK, upgradeSpMove, false, 0, true);
};
};
if (objMenu.bQuitYes){
objMenu.bQuitYes.addEventListener(MouseEvent.CLICK, quitYesClick, false, 0, true);
};
if (objMenu.bQuitNo){
objMenu.bQuitNo.addEventListener(MouseEvent.CLICK, quitNoClick, false, 0, true);
};
}
private function interfaceHandle(_arg1:Event):void{
objMenu.hp_bar.scaleX = (playerMgr.getHealth() / playerMgr.getHealthMax());
objMenu.sp_bar.scaleX = (playerMgr.getSpecial() / playerMgr.getSpecialMax());
objMenu.potion_txt.htmlText = String(("<b>" + playerMgr.getPotion()));
objMenu.ether_txt.htmlText = String(("<b>" + playerMgr.getEther()));
objMenu.life_mc.gotoAndStop((playerMgr.getLife() + 1));
objMenu.point_txt.htmlText = String(("<b>" + playerMgr.getPoint()));
objMenu.exp_txt.htmlText = String(("<b>" + playerMgr.getExperience()));
objMenu.level_txt.htmlText = String(("<b>" + enemyMgr.getTitle()));
objMenu.kill_txt.htmlText = String((((((((("<b>" + playerMgr.getKill()) + " / ") + enemyMgr.getTotEnemySpawn()) + " (") + worldMgr.getTotEnemy()) + "/") + enemyMgr.getEnemySpawn()) + ")"));
if ((((playerMgr.getKill() == enemyMgr.getTotEnemySpawn())) && ((worldMgr.getTotEnemy() == 0)))){
if (_playLv >= 10){
showEnding();
} else {
showClear();
};
};
if (playerMgr.isDead()){
showGameOver();
};
}
public function showInterface(){
destroy();
objMenu = new interface_all_mc();
objCont.addChild(objMenu);
objMenu.addEventListener(Event.ENTER_FRAME, interfaceHandle, false, 0, true);
objMenu.bPause.addEventListener(MouseEvent.CLICK, pauseClick, false, 0, true);
objMenu.bPMore.addEventListener(MouseEvent.CLICK, playMoreClick, false, 0, true);
}
public function playResume(){
if ((((((objMenu.currentLabel == "upgrade")) || ((objMenu.currentLabel == "control")))) || ((objMenu.currentLabel == "map")))){
objMenu.p_resume_btn.removeEventListener(MouseEvent.CLICK, resumeClick);
objMenu.gotoAndPlay("fade");
};
}
private function upgradeClick(_arg1:MouseEvent):void{
objMenu.gotoAndStop("upgrade");
}
public function removePause(){
if (objMenu){
objMenu.removeEventListener(Event.ENTER_FRAME, pauseHandle);
};
if (objMenu.p_resume_btn){
objMenu.p_resume_btn.removeEventListener(MouseEvent.CLICK, resumeClick);
};
if (objMenu.p_quit_btn){
objMenu.p_quit_btn.removeEventListener(MouseEvent.CLICK, quitClick);
};
if (objMenu.p_map_btn){
objMenu.p_map_btn.removeEventListener(MouseEvent.CLICK, mapClick);
};
if (objMenu.p_controls_btn){
objMenu.p_controls_btn.removeEventListener(MouseEvent.CLICK, controlClick);
};
if (objMenu.p_upgrade_btn){
objMenu.p_upgrade_btn.removeEventListener(MouseEvent.CLICK, upgradeClick);
};
if (objMenu.bPMore){
objMenu.bPMore.removeEventListener(MouseEvent.CLICK, playMoreClick);
};
}
public function showMainMenu(){
playerMgr.ENDF();
worldMgr.destroyBgScene();
destroy();
objMenu = new main_mc();
objCont.addChild(objMenu);
objMenu.gotoAndPlay(1);
objMenu.addEventListener(Event.ENTER_FRAME, mainMenuHandle, false, 0, true);
}
private function backClick(_arg1:MouseEvent):void{
if (objMenu.bBack){
objMenu.bBack.removeEventListener(MouseEvent.CLICK, backClick);
};
objMenu.gotoAndPlay(38);
}
private function gmoverQuitClick(_arg1:MouseEvent):void{
if (objMenu.gmoverRetry){
objMenu.gmoverRetry.removeEventListener(MouseEvent.CLICK, gmoverRetryClick);
};
if (objMenu.gmoverQuit){
objMenu.gmoverQuit.removeEventListener(MouseEvent.CLICK, gmoverQuitClick);
};
showMainMenu();
}
private function clearHandle(_arg1:Event):void{
if (objMenu.currentFrame == objMenu.totalFrames){
objMenu.bNextLevel.addEventListener(MouseEvent.CLICK, nextClick, false, 0, true);
objMenu.removeEventListener(Event.ENTER_FRAME, clearHandle);
};
}
public function showPause(){
destroy();
objMenu = new pause_upgrade_mc();
objCont.addChild(objMenu);
objMenu.gotoAndPlay(1);
objMenu.addEventListener(Event.ENTER_FRAME, pauseHandle, false, 0, true);
}
private function quitNoClick(_arg1:MouseEvent):void{
objMenu.bQuitYes.removeEventListener(MouseEvent.CLICK, quitYesClick);
objMenu.bQuitNo.removeEventListener(MouseEvent.CLICK, quitNoClick);
objMenu.gotoAndPlay("map");
}
}
}//package
Section 67
//mx_mc (mx_mc)
package {
public dynamic class mx_mc extends EntityClass {
public function mx_mc(){
addFrameScript(24, frame25, 39, frame40, 40, frame41, 48, frame49, 56, frame57, 68, frame69, 81, frame82, 97, frame98, 129, frame130, 195, frame196, 236, frame237, 240, frame241, 249, frame250, 271, frame272, 314, frame315);
}
function frame272(){
gotoAndPlay("stand");
}
function frame25(){
gotoAndPlay("stand");
}
function frame196(){
gotoAndPlay("stand");
}
function frame40(){
gotoAndPlay("walk");
}
function frame41(){
gotoAndPlay("stand");
}
function frame49(){
gotoAndPlay("stand");
}
function frame57(){
gotoAndPlay("stand");
}
function frame69(){
gotoAndPlay("stand");
}
function frame315(){
stop();
}
function frame82(){
gotoAndPlay("stand");
}
function frame98(){
gotoAndPlay("stand");
}
function frame237(){
gotoAndPlay("stand");
}
function frame241(){
stop();
}
function frame250(){
gotoAndPlay("stand");
}
function frame130(){
gotoAndPlay("stand");
}
}
}//package
Section 68
//opening_movie_mc (opening_movie_mc)
package {
import flash.display.*;
public dynamic class opening_movie_mc extends MovieClip {
public var bSkip:SimpleButton;
public function opening_movie_mc(){
addFrameScript(1014, frame1015);
}
function frame1015(){
stop();
}
}
}//package
Section 69
//opening_soundtrack (opening_soundtrack)
package {
public dynamic class opening_soundtrack extends BaseSound {
}
}//package
Section 70
//pa_mc (pa_mc)
package {
public dynamic class pa_mc extends EntityClass {
public function pa_mc(){
addFrameScript(24, frame25, 44, frame45, 64, frame65, 80, frame81, 93, frame94, 115, frame116, 170, frame171);
}
function frame171(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame45(){
gotoAndPlay("walk");
}
function frame65(){
gotoAndPlay("stand");
}
function frame81(){
gotoAndPlay("stand");
}
function frame94(){
gotoAndPlay("stand");
}
function frame116(){
stop();
}
}
}//package
Section 71
//pause_upgrade_mc (pause_upgrade_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class pause_upgrade_mc extends MovieClip {
public var bUpgradeHp:SimpleButton;
public var u_health_btn:SimpleButton;
public var ptsStat_txt:TextField;
public var add_hp_mc:MovieClip;
public var potionBuy_txt:TextField;
public var hpStat_txt:TextField;
public var u_special_btn:SimpleButton;
public var p_map_btn:SimpleButton;
public var bUpgradeSp:SimpleButton;
public var bQuitYes:SimpleButton;
public var p_quit_btn:SimpleButton;
public var u_ether_btn:SimpleButton;
public var bUpgradeStr:SimpleButton;
public var bQuitNo:SimpleButton;
public var p_resume_btn:SimpleButton;
public var p_upgrade_btn:SimpleButton;
public var spStat_txt:TextField;
public var add_special_mc:MovieClip;
public var map_mc:MovieClip;
public var u_potion_btn:SimpleButton;
public var bPMore:SimpleButton;
public var add_strength_mc:MovieClip;
public var p_controls_btn:SimpleButton;
public var etherBuy_txt:TextField;
public var sp_mc:MovieClip;
public var u_strength_btn:SimpleButton;
public var expStat_txt:TextField;
public function pause_upgrade_mc(){
addFrameScript(24, frame25, 25, frame26, 26, frame27, 31, frame32, 47, frame48);
}
function frame48(){
stop();
}
function frame26(){
stop();
}
function frame32(){
stop();
}
function frame25(){
stop();
}
function frame27(){
stop();
}
}
}//package
Section 72
//pb_mc (pb_mc)
package {
public dynamic class pb_mc extends EntityClass {
public function pb_mc(){
addFrameScript(24, frame25, 60, frame61, 97, frame98, 130, frame131, 144, frame145, 155, frame156, 179, frame180, 244, frame245);
}
function frame156(){
gotoAndPlay("stand");
}
function frame180(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame61(){
gotoAndPlay("walk");
}
function frame98(){
gotoAndPlay("stand");
}
function frame245(){
stop();
}
function frame131(){
gotoAndPlay("stand");
}
function frame145(){
stop();
}
}
}//package
Section 73
//persianLand (persianLand)
package {
import flash.display.*;
public dynamic class persianLand extends Sprite {
public var bg3:MovieClip;
public var bg1:MovieClip;
public var bg2:MovieClip;
}
}//package
Section 74
//PlayerManager (PlayerManager)
package {
import flash.events.*;
import flash.ui.*;
public class PlayerManager {
private var life:int;// = 3
private var guardHold:Boolean;
private var ether:int;// = 0
private var healthLv:int;// = 0
private var spMoveLv:int;// = 0
private var last_ether:int;// = 0
private var specialLv:int;// = 0
private var parent_stage;
private var trace_exp:int;// = 0
private var worldMgr;// = null
private var upArrow:Boolean;
private var menuMgr;// = null
private var leftArrow:Boolean;
private var speed:Number;// = 3
private var rightArrow:Boolean;
private var kill:int;// = 0
private var health:int;// = 0
private var healthMax:int;// = 0
private var experience:int;// = 0
private var last_potion:int;// = 0
private var enemyMgr;// = null
private var downArrow:Boolean;
private var last_spMoveLv:int;// = 0
private var last_healthLv:int;// = 0
private var point:int;// = 0
private var potion:int;// = 0
private var last_point:int;// = 0
private var strengthLv:int;// = 0
private var last_experience:int;// = 0
private var objPlayer;// = null
private var special:int;// = 0
private var last_specialLv:int;// = 0
private var specialMax:int;// = 0
private var objChar;// = null
private var last_strengthLv:int;// = 0
public var isPaused:Boolean;// = false
public function PlayerManager(_arg1){
isPaused = false;
objPlayer = null;
objChar = null;
speed = 3;
life = 3;
health = 0;
healthMax = 0;
special = 0;
specialMax = 0;
point = 0;
experience = 0;
potion = 0;
ether = 0;
kill = 0;
healthLv = 0;
specialLv = 0;
strengthLv = 0;
spMoveLv = 0;
last_healthLv = 0;
last_specialLv = 0;
last_strengthLv = 0;
last_spMoveLv = 0;
last_potion = 0;
last_ether = 0;
last_point = 0;
last_experience = 0;
worldMgr = null;
enemyMgr = null;
menuMgr = null;
trace_exp = 0;
super();
parent_stage = _arg1;
}
public function getObjPlayer(){
return (objPlayer);
}
public function upgradeSpMove(_arg1:int, _arg2:int){
spMoveLv = Math.max(Math.min((spMoveLv + _arg1), 2), 0);
experience = Math.max((experience - _arg2), 0);
}
public function retryStat(){
life = 3;
healthLv = last_healthLv;
specialLv = last_specialLv;
strengthLv = last_strengthLv;
spMoveLv = last_spMoveLv;
potion = last_potion;
ether = last_ether;
point = last_point;
experience = last_experience;
trace_exp = 0;
}
public function START(_arg1:Boolean=false){
objPlayer = new mx_mc();
objPlayer.createEntity(worldMgr, objPlayer._player, 250, 420);
objPlayer.createAI(new CharVindexClass(worldMgr, objPlayer));
objChar = objPlayer.getAI();
objPlayer.initHealth(150);
objPlayer.initSpecial(100);
objPlayer.x = 250;
objPlayer.y = 420;
objPlayer.gotoAndPlay("stand");
objPlayer.initKill(0);
objPlayer.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed, false, 0, true);
objPlayer.stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased, false, 0, true);
objPlayer.addEventListener(Event.ENTER_FRAME, controlHandle, false, 0, true);
if (_arg1){
retryStat();
} else {
resetAll();
};
saveStat();
isPaused = false;
worldMgr.setPaused(isPaused);
}
public function getEther():int{
return (ether);
}
public function getHealth():int{
return (health);
}
public function getExperience():int{
return (experience);
}
public function getSpecialLv():int{
return (specialLv);
}
public function getSpMoveLv():int{
return (spMoveLv);
}
public function saveStat(){
last_healthLv = healthLv;
last_specialLv = specialLv;
last_strengthLv = strengthLv;
last_spMoveLv = spMoveLv;
last_potion = potion;
last_ether = ether;
last_point = point;
last_experience = experience;
upgradeHealth(0, 0, false);
upgradeSpecial(0, 0, false);
upgradeStrength(0, 0, false);
}
public function getLife():int{
return (life);
}
public function getHealthLv():int{
return (healthLv);
}
public function upgradeStrength(_arg1:int, _arg2:int, _arg3:Boolean=true){
strengthLv = Math.max(Math.min((strengthLv + _arg1), 10), 0);
if (strengthLv == 0){
objPlayer.getAI().setMultStr(1);
} else {
if (strengthLv == 1){
objPlayer.getAI().setMultStr(1.1);
} else {
if (strengthLv == 2){
objPlayer.getAI().setMultStr(1.2);
} else {
if (strengthLv == 3){
objPlayer.getAI().setMultStr(1.3);
} else {
if (strengthLv == 4){
objPlayer.getAI().setMultStr(1.4);
} else {
if (strengthLv == 5){
objPlayer.getAI().setMultStr(1.5);
} else {
if (strengthLv == 6){
objPlayer.getAI().setMultStr(1.6);
} else {
if (strengthLv == 7){
objPlayer.getAI().setMultStr(1.7);
} else {
if (strengthLv == 8){
objPlayer.getAI().setMultStr(1.8);
} else {
if (strengthLv == 9){
objPlayer.getAI().setMultStr(2);
} else {
if (strengthLv == 10){
objPlayer.getAI().setMultStr(2.5);
};
};
};
};
};
};
};
};
};
};
};
if (_arg3){
experience = Math.max((experience - _arg2), 0);
};
}
public function objFocusKey(){
objPlayer.stage.focus = parent_stage;
rightArrow = false;
leftArrow = false;
upArrow = false;
downArrow = false;
guardHold = false;
}
public function getSpecial():int{
return (special);
}
public function getPotion():int{
return (potion);
}
public function addPotion(_arg1:int, _arg2:int){
potion = Math.min((potion + _arg1), 10);
point = Math.max((point - _arg2), 0);
}
public function upgradeHealth(_arg1:int, _arg2:int, _arg3:Boolean=true){
healthLv = Math.max(Math.min((healthLv + _arg1), 10), 0);
if (healthLv == 0){
objPlayer.initHealth(150);
} else {
if (healthLv == 1){
objPlayer.initHealth(200);
} else {
if (healthLv == 2){
objPlayer.initHealth(250);
} else {
if (healthLv == 3){
objPlayer.initHealth(300);
} else {
if (healthLv == 4){
objPlayer.initHealth(350);
} else {
if (healthLv == 5){
objPlayer.initHealth(400);
} else {
if (healthLv == 6){
objPlayer.initHealth(450);
} else {
if (healthLv == 7){
objPlayer.initHealth(500);
} else {
if (healthLv == 8){
objPlayer.initHealth(600);
} else {
if (healthLv == 9){
objPlayer.initHealth(750);
} else {
if (healthLv == 10){
objPlayer.initHealth(999);
};
};
};
};
};
};
};
};
};
};
};
if (_arg3){
experience = Math.max((experience - _arg2), 0);
};
}
public function getStrengthLv():int{
return (strengthLv);
}
public function isDead():Boolean{
if ((((objPlayer.currentFrame == 315)) && ((life <= 0)))){
return (true);
};
return (false);
}
public function getHealthMax():int{
return (healthMax);
}
private function keyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 85){
if (isPaused == false){
isPaused = true;
worldMgr.setPaused(isPaused);
menuMgr.showPause();
return;
};
menuMgr.playResume();
return;
};
if (isPaused){
return;
};
if (_arg1.keyCode == Keyboard.RIGHT){
rightArrow = true;
};
if (_arg1.keyCode == Keyboard.LEFT){
leftArrow = true;
};
if (_arg1.keyCode == Keyboard.UP){
upArrow = true;
};
if (_arg1.keyCode == Keyboard.DOWN){
downArrow = true;
};
if (_arg1.keyCode == 65){
objChar.playAttack();
};
if (_arg1.keyCode == 83){
objChar.playBreak();
};
if (_arg1.keyCode == 68){
guardHold = true;
};
if (_arg1.keyCode == 90){
if ((((spMoveLv >= 1)) && ((objPlayer.getSpecial() >= 80)))){
if (objChar.playSpecial1()){
objPlayer.setSpecial(-80);
};
};
};
if (_arg1.keyCode == 88){
if ((((spMoveLv >= 2)) && ((objPlayer.getSpecial() >= 100)))){
if (objChar.playSpecial2()){
objPlayer.setSpecial(-100);
};
};
};
if (_arg1.keyCode == 81){
if ((((((health > 0)) && ((potion > 0)))) && ((objPlayer.getHealth() < objPlayer.getHealth(true))))){
potion--;
objPlayer.setHealth((objPlayer.getHealth(true) * 0.5));
};
};
if (_arg1.keyCode == 87){
if ((((((health > 0)) && ((ether > 0)))) && ((objPlayer.getSpecial() < objPlayer.getSpecial(true))))){
ether--;
objPlayer.setSpecial((objPlayer.getSpecial(true) * 0.5));
};
};
}
private function keyReleased(_arg1:KeyboardEvent){
if (_arg1.keyCode == Keyboard.RIGHT){
rightArrow = false;
};
if (_arg1.keyCode == Keyboard.LEFT){
leftArrow = false;
};
if (_arg1.keyCode == Keyboard.UP){
upArrow = false;
};
if (_arg1.keyCode == Keyboard.DOWN){
downArrow = false;
};
if (_arg1.keyCode == 68){
guardHold = false;
};
}
public function resetAll(){
life = 3;
objPlayer.initHealth(150);
objPlayer.initSpecial(100);
point = 0;
experience = 0;
potion = 1;
ether = 0;
healthLv = 0;
specialLv = 0;
strengthLv = 0;
spMoveLv = 0;
}
public function getKill():int{
return (kill);
}
public function getSpecialMax():int{
return (specialMax);
}
public function addEther(_arg1:int, _arg2:int){
ether = Math.min((ether + _arg1), 10);
point = Math.max((point - _arg2), 0);
}
public function getPoint():int{
return (point);
}
private function controlHandle(_arg1:Event):void{
if (objPlayer){
if ((((objPlayer.currentFrame == 315)) && ((life > 0)))){
life--;
objPlayer.setHealth(objPlayer.getHealth(true));
objPlayer.gotoAndPlay("stand");
};
};
if (objPlayer){
health = objPlayer.getHealth();
healthMax = objPlayer.getHealth(true);
special = objPlayer.getSpecial();
specialMax = objPlayer.getSpecial(true);
if (trace_exp != objPlayer.getExp()){
experience = Math.min((experience + Math.round(((objPlayer.getExp() - trace_exp) * 0.75))), 99999);
point = Math.min((point + Math.round(((objPlayer.getExp() - trace_exp) * 0.4))), 99999);
};
trace_exp = objPlayer.getExp();
kill = objPlayer.getKill();
};
if (isPaused){
return;
};
if (upArrow){
objChar.playMoveUp();
};
if (downArrow){
objChar.playMoveDown();
};
if (leftArrow){
objChar.playMoveLeft();
};
if (rightArrow){
objChar.playMoveRight();
};
if (guardHold){
objChar.playGuard();
};
if ((((((((upArrow == false)) && ((downArrow == false)))) && ((leftArrow == false)))) && ((rightArrow == false)))){
objChar.playWalkToStand();
};
if (guardHold == false){
objChar.playGuardToStand();
};
worldMgr.updateWorld();
}
public function ENDF(){
if (objPlayer){
objChar = null;
objPlayer.gotoAndStop(1);
objPlayer.stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
objPlayer.stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased);
objPlayer.removeEventListener(Event.ENTER_FRAME, controlHandle);
objPlayer.destroyEntity();
objPlayer = null;
};
}
public function NEXT(){
objPlayer.x = 250;
objPlayer.y = 420;
objPlayer.gotoAndPlay("stand");
objPlayer.initKill(0);
saveStat();
isPaused = false;
worldMgr.setPaused(isPaused);
}
public function TRACESTAT(){
trace(((((((((((((("pts=" + String(last_point)) + " exp=") + String(last_experience)) + " potion=") + String(last_potion)) + " ether=") + String(last_ether)) + " lv=") + String(last_healthLv)) + "/") + String(last_strengthLv)) + "/") + String(last_specialLv)));
trace(((((((((((((("pts=" + String(point)) + " exp=") + String(experience)) + " potion=") + String(potion)) + " ether=") + String(ether)) + " lv=") + String(healthLv)) + "/") + String(strengthLv)) + "/") + String(specialLv)));
trace(("ent exp = " + String(objPlayer.getExp())));
}
public function create(_arg1, _arg2, _arg3){
worldMgr = _arg1;
enemyMgr = _arg2;
menuMgr = _arg3;
}
public function upgradeSpecial(_arg1:int, _arg2:int, _arg3:Boolean=true){
specialLv = Math.max(Math.min((specialLv + _arg1), 10), 0);
if (specialLv == 0){
objPlayer.initSpecial(100);
} else {
if (specialLv == 1){
objPlayer.initSpecial(120);
} else {
if (specialLv == 2){
objPlayer.initSpecial(150);
} else {
if (specialLv == 3){
objPlayer.initSpecial(200);
} else {
if (specialLv == 4){
objPlayer.initSpecial(240);
} else {
if (specialLv == 5){
objPlayer.initSpecial(280);
} else {
if (specialLv == 6){
objPlayer.initSpecial(320);
} else {
if (specialLv == 7){
objPlayer.initSpecial(360);
} else {
if (specialLv == 8){
objPlayer.initSpecial(400);
} else {
if (specialLv == 9){
objPlayer.initSpecial(450);
} else {
if (specialLv == 10){
objPlayer.initSpecial(600);
};
};
};
};
};
};
};
};
};
};
};
if (_arg3){
experience = Math.max((experience - _arg2), 0);
};
}
}
}//package
Section 75
//ps_mc (ps_mc)
package {
public dynamic class ps_mc extends EntityClass {
public function ps_mc(){
addFrameScript(24, frame25, 40, frame41, 57, frame58, 79, frame80, 84, frame85, 95, frame96, 122, frame123, 193, frame194);
}
function frame25(){
gotoAndPlay("stand");
}
function frame194(){
stop();
}
function frame41(){
gotoAndPlay("walk");
}
function frame58(){
gotoAndPlay("stand");
}
function frame80(){
gotoAndPlay("stand");
}
function frame85(){
stop();
}
function frame96(){
gotoAndPlay("stand");
}
function frame123(){
stop();
}
}
}//package
Section 76
//sa_mc (sa_mc)
package {
public dynamic class sa_mc extends EntityClass {
public function sa_mc(){
addFrameScript(24, frame25, 38, frame39, 60, frame61, 86, frame87, 97, frame98, 118, frame119, 175, frame176);
}
function frame176(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame39(){
gotoAndPlay("walk");
}
function frame61(){
gotoAndPlay("stand");
}
function frame87(){
gotoAndPlay("stand");
}
function frame98(){
gotoAndPlay("stand");
}
function frame119(){
stop();
}
}
}//package
Section 77
//sb_mc (sb_mc)
package {
public dynamic class sb_mc extends EntityClass {
public function sb_mc(){
addFrameScript(24, frame25, 45, frame46, 46, frame47, 70, frame71, 111, frame112, 126, frame127, 127, frame128, 137, frame138, 204, frame205, 291, frame292);
}
function frame292(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame46(){
gotoAndPlay("walk");
}
function frame47(){
gotoAndPlay("stand");
}
function frame71(){
gotoAndPlay("stand");
}
function frame205(){
stop();
}
function frame112(){
gotoAndPlay("stand");
}
function frame127(){
gotoAndPlay(119);
}
function frame128(){
gotoAndPlay("stand");
}
function frame138(){
gotoAndPlay("stand");
}
}
}//package
Section 78
//SoundManager (SoundManager)
package {
public class SoundManager {
public var opening_bgm;// = null
private var bgmFade:Boolean;// = false
public var stage_bgm;// = null
public var gameover_bgm;// = null
public var ending_bgm;// = null
public var mmenu_bgm;// = null
private var sndBgm;// = null
public function SoundManager(){
opening_bgm = null;
stage_bgm = null;
gameover_bgm = null;
ending_bgm = null;
mmenu_bgm = null;
sndBgm = null;
bgmFade = false;
super();
opening_bgm = new opening_soundtrack();
stage_bgm = new BGM();
gameover_bgm = new lost_scene();
ending_bgm = new ending_movie();
mmenu_bgm = new main_menu();
trace("init sound Manager ");
}
public function stopBgm(){
if (sndBgm){
sndBgm.stopSound();
};
}
public function fadeBgm(){
if (sndBgm){
sndBgm.fadeOut(false);
};
}
public function playBgm(_arg1:int){
if (sndBgm){
sndBgm.stopSound();
};
if (_arg1 == 1){
sndBgm = mmenu_bgm;
} else {
if (_arg1 == 2){
sndBgm = opening_bgm;
} else {
if (_arg1 == 3){
sndBgm = stage_bgm;
} else {
if (_arg1 == 4){
sndBgm = gameover_bgm;
} else {
if (_arg1 == 5){
sndBgm = ending_bgm;
};
};
};
};
};
sndBgm.playSoundLoop();
}
public function setVolume(_arg1:Number){
if (sndBgm){
sndBgm.setVolume(_arg1);
};
}
}
}//package
Section 79
//spartaLand (spartaLand)
package {
import flash.display.*;
public dynamic class spartaLand extends Sprite {
public var bg3:MovieClip;
public var bg1:MovieClip;
public var bg2:MovieClip;
}
}//package
Section 80
//ss_mc (ss_mc)
package {
public dynamic class ss_mc extends EntityClass {
public function ss_mc(){
addFrameScript(24, frame25, 41, frame42, 58, frame59, 82, frame83, 85, frame86, 86, frame87, 96, frame97, 127, frame128, 181, frame182);
}
function frame182(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame42(){
gotoAndPlay("walk");
}
function frame59(){
gotoAndPlay("stand");
}
function frame86(){
stop();
}
function frame87(){
gotoAndPlay("stand");
}
function frame83(){
gotoAndPlay("stand");
}
function frame97(){
gotoAndPlay("stand");
}
function frame128(){
stop();
}
}
}//package
Section 81
//StdAtkRes (StdAtkRes)
package {
public class StdAtkRes {
private var pushTarget:Number;// = 0
private var unblockable:Boolean;// = false
private var damage:int;// = 0
private var isTargetHit:Boolean;// = false
private var typeHit:int;// = 0
public function StdAtkRes(){
isTargetHit = false;
damage = 0;
typeHit = 0;
pushTarget = 0;
unblockable = false;
super();
}
public function setHit(_arg1:int=0, _arg2:int=0, _arg3:Number=0, _arg4:Boolean=false){
damage = _arg1;
typeHit = _arg2;
pushTarget = _arg3;
unblockable = _arg4;
isTargetHit = true;
}
public function getTypeHit():int{
return (typeHit);
}
public function isUnblockable():Boolean{
return (unblockable);
}
public function getDamage():int{
return (damage);
}
public function directionPush(_arg1, _arg2){
if (_arg1.x > _arg2.x){
pushTarget = -1;
};
}
public function isHit():Boolean{
return (isTargetHit);
}
public function getPushTarget():int{
return (pushTarget);
}
public function multDamage(_arg1:Number){
damage = (damage * _arg1);
}
}
}//package
Section 82
//TestX (TestX)
package {
public dynamic class TestX extends EntityClass {
}
}//package
Section 83
//va_mc (va_mc)
package {
public dynamic class va_mc extends EntityClass {
public function va_mc(){
addFrameScript(24, frame25, 43, frame44, 71, frame72, 81, frame82, 92, frame93, 128, frame129, 186, frame187);
}
function frame25(){
gotoAndPlay("stand");
}
function frame187(){
stop();
}
function frame44(){
gotoAndPlay("walk");
}
function frame72(){
gotoAndPlay("stand");
}
function frame82(){
gotoAndPlay("stand");
}
function frame93(){
gotoAndPlay("stand");
}
function frame129(){
stop();
}
}
}//package
Section 84
//vb_mc (vb_mc)
package {
public dynamic class vb_mc extends EntityClass {
public function vb_mc(){
addFrameScript(24, frame25, 61, frame62, 62, frame63, 90, frame91, 124, frame125, 135, frame136, 176, frame177, 177, frame178, 187, frame188, 253, frame254);
}
function frame177(){
stop();
}
function frame178(){
gotoAndPlay("stand");
}
function frame188(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame62(){
gotoAndPlay("walk");
}
function frame63(){
gotoAndPlay("stand");
}
function frame91(){
gotoAndPlay("stand");
}
function frame125(){
gotoAndPlay("stand");
}
function frame136(){
gotoAndPlay("stand");
}
function frame254(){
stop();
}
}
}//package
Section 85
//vikingLand (vikingLand)
package {
import flash.display.*;
public dynamic class vikingLand extends Sprite {
public var bg3:MovieClip;
public var bg1:MovieClip;
public var bg2:MovieClip;
}
}//package
Section 86
//VindexChronicle (VindexChronicle)
package {
import flash.display.*;
public class VindexChronicle extends Sprite {
private var stageRoot;
private var worldMgr;
private var menuMgr;
private var enemyMgr;
private var playerMgr;
private var soundMgr;
private var gameMgr;
public function VindexChronicle(_arg1){
stageRoot = _arg1;
}
public function Start(){
stageRoot.addChild(this);
soundMgr = new SoundManager();
worldMgr = new WorldManager(stageRoot);
menuMgr = new MenuManager();
playerMgr = new PlayerManager(stageRoot);
enemyMgr = new EnemyManager(stageRoot);
gameMgr = new GameManager(stageRoot, soundMgr, worldMgr, menuMgr, playerMgr, enemyMgr);
gameMgr.initialise();
}
}
}//package
Section 87
//WorldManager (WorldManager)
package {
import flash.display.*;
public class WorldManager extends Sprite {
const brytonLand = 2;
const document_width = 640;
const persianLand = 3;
const spartaLand = 5;
const document_height = 480;
const vikingLand = 1;
const egyptLand = 4;
private var parent_stage;
private var container_scene:DisplayObjectContainer;
private var container_menu:DisplayObjectContainer;
private var container_bgLayerBack:DisplayObjectContainer;
private var container_bgLayerFront:DisplayObjectContainer;
private var bgMgr;
private var totEnemy:int;// = 0
private var totAlly:int;// = 0
private var isPaused:Boolean;// = false
public function WorldManager(_arg1){
isPaused = false;
totAlly = 0;
totEnemy = 0;
super();
parent_stage = _arg1;
trace(" create world manager ... ok! ");
}
public function create(){
container_bgLayerBack = new Sprite();
parent_stage.addChild(container_bgLayerBack);
container_scene = new Sprite();
parent_stage.addChild(container_scene);
container_bgLayerFront = new Sprite();
parent_stage.addChild(container_bgLayerFront);
container_menu = new Sprite();
parent_stage.addChild(container_menu);
bgMgr = new BgManager();
bgMgr.init(document_width, document_height);
}
public function createBgScene(_arg1:int){
if (bgMgr.getBG()){
container_bgLayerBack.removeChild(bgMgr.getBG());
};
if (bgMgr.getBGF()){
container_bgLayerFront.removeChild(bgMgr.getBGF());
};
if (_arg1 == vikingLand){
bgMgr.createVikingLand();
} else {
if (_arg1 == brytonLand){
bgMgr.createBritonLand();
} else {
if (_arg1 == persianLand){
bgMgr.createPersianLand();
} else {
if (_arg1 == egyptLand){
bgMgr.createEgyptLand();
} else {
if (_arg1 == spartaLand){
bgMgr.createSpartaLand();
};
};
};
};
};
container_bgLayerBack.addChild(bgMgr.getBG());
bgMgr.x = 0;
bgMgr.y = 0;
}
public function getTotEnemy():int{
return (totEnemy);
}
public function addObjectBgBack(_arg1){
container_bgLayerBack.addChild(_arg1);
}
private function borderCollisionHandle(_arg1){
if (_arg1.isPlayer()){
if (_arg1.x < bgMgr.getLeftBorder()){
_arg1.x = bgMgr.getLeftBorder();
};
if (_arg1.x > bgMgr.getRightBorder()){
_arg1.x = bgMgr.getRightBorder();
};
if (_arg1.y < bgMgr.getTopBorder()){
_arg1.y = bgMgr.getTopBorder();
};
if (_arg1.y > bgMgr.getBottomBorder()){
_arg1.y = bgMgr.getBottomBorder();
};
} else {
if (_arg1.x < bgMgr.getRealLeftBorder()){
_arg1.x = bgMgr.getRealLeftBorder();
};
if (_arg1.x > bgMgr.getRealRightBorder()){
_arg1.x = bgMgr.getRealRightBorder();
};
if (_arg1.y < bgMgr.getRealTopBorder()){
_arg1.y = bgMgr.getRealTopBorder();
};
if (_arg1.y > bgMgr.getRealBottomBorder()){
_arg1.y = bgMgr.getRealBottomBorder();
};
};
}
public function setPaused(_arg1:Boolean){
var _local2:int;
var _local3:Array;
var _local4:int;
isPaused = _arg1;
_local2 = container_scene.numChildren;
_local3 = new Array(_local2);
_local4 = 0;
_local4 = 0;
while (_local4 < _local2) {
_local3[_local4] = container_scene.getChildAt(_local4);
_local4++;
};
_local4 = 0;
while (_local4 < _local2) {
if (_local3[_local4]){
_local3[_local4].setPaused(_arg1);
};
_local4++;
};
}
private function testEntCollision(_arg1:DisplayObjectContainer){
var _local2:int;
var _local3:Array;
var _local4:*;
var _local5:int;
_local2 = _arg1.numChildren;
if (_local2 < 2){
return;
};
_local3 = new Array(_local2);
_local5 = 0;
_local4 = 0;
while (_local4 < _local2) {
_local3[_local4] = _arg1.getChildAt(_local4);
_local4++;
};
_local4 = 0;
while (_local4 < _local2) {
_local5 = 0;
while (_local5 < _local2) {
if (_local4 != _local5){
_local3[_local4].testCollision(_local3[_local4], _local3[_local5]);
};
_local5++;
};
_local4++;
};
}
public function updateWorld():void{
if (isPaused){
return;
};
testEntHit(container_scene);
testEntCollision(container_scene);
updateViewBackground(container_scene);
bgMgr.refreshView();
testBorderCollision(container_scene);
sortChildrenByFauxZ(container_scene);
statCounting(container_scene);
}
public function addObject(_arg1){
container_scene.addChild(_arg1);
}
public function searchAllyTarget(_arg1):Object{
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:Number;
_local2 = container_scene.numChildren;
_local3 = new Array(_local2);
_local4 = 0;
_local4 = 0;
while (_local4 < _local2) {
_local3[_local4] = container_scene.getChildAt(_local4);
_local4++;
};
_local5 = null;
_local4 = 0;
while (_local4 < _local2) {
if (((!((_arg1 == _local3[_local4]))) && (((_local3[_local4].isPlayer()) || (_local3[_local4].isAlly()))))){
if (_local5){
_local6 = (_local3[_local4] - _arg1.x);
_local7 = (_local3[_local4] - _arg1.y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
if (_local8 < _local9){
_local9 = _local8;
_local5 = _local3[_local4];
};
} else {
_local6 = (_local3[_local4] - _arg1.x);
_local7 = (_local3[_local4] - _arg1.y);
_local9 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local5 = _local3[_local4];
};
};
_local4++;
};
return (_local5);
}
private function testBorderCollision(_arg1:DisplayObjectContainer){
var _local2:int;
var _local3:Array;
var _local4:int;
_local2 = _arg1.numChildren;
_local3 = new Array(_local2);
_local4 = 0;
_local4 = 0;
while (_local4 < _local2) {
_local3[_local4] = _arg1.getChildAt(_local4);
_local4++;
};
_local4 = 0;
while (_local4 < _local2) {
if (_local3[_local4]){
borderCollisionHandle(_local3[_local4]);
};
_local4++;
};
}
public function addObjectBgFront(_arg1){
container_bgLayerFront.addChild(_arg1);
}
public function getContainerScene():Object{
return (container_scene);
}
public function searchEnemyTarget(_arg1){
}
public function getTotAlly():int{
return (totAlly);
}
private function orderObjectHold(_arg1, _arg2):int{
if (_arg1.getZDepthVal() < _arg2.getZDepthVal()){
return (-1);
};
if (_arg1.getZDepthVal() > _arg2.getZDepthVal()){
return (1);
};
return (0);
}
public function getContainerMenu():Object{
return (container_menu);
}
private function testEntHit(_arg1:DisplayObjectContainer){
var _local2:int;
var _local3:Array;
var _local4:*;
var _local5:int;
_local2 = _arg1.numChildren;
_local3 = new Array(_local2);
_local5 = 0;
_local4 = 0;
while (_local4 < _local2) {
_local3[_local4] = _arg1.getChildAt(_local4);
_local4++;
};
_local4 = 0;
while (_local4 < _local2) {
if (_local3[_local4].isAlly()){
_local5 = 0;
while (_local5 < _local2) {
if (_local4 == _local5){
} else {
if (_local3[_local5].isEnemy()){
if (_local3[_local4].isHitAreaCollision(_local3[_local5])){
_local3[_local4].testHitAttackCollision(_local3[_local5]);
};
};
if (_local3[_local5].isObject()){
};
if (((_local3[_local4].isPlayer()) && (_local3[_local5].isItem()))){
};
};
_local5++;
};
};
if (_local3[_local4].isEnemy()){
_local5 = 0;
while (_local5 < _local2) {
if (_local4 == _local5){
} else {
if (_local3[_local5].isAlly()){
if (_local3[_local4].isHitAreaCollision(_local3[_local5])){
_local3[_local4].testHitAttackCollision(_local3[_local5]);
};
};
if (_local3[_local5].isObject()){
};
};
_local5++;
};
};
_local4++;
};
}
private function sortChildrenByFauxZ(_arg1:DisplayObjectContainer):Boolean{
var _local2:int;
var _local3:Boolean;
var _local4:Array;
var _local5:int;
var _local6:DisplayObject;
_local2 = _arg1.numChildren;
if (_local2 < 2){
return (false);
};
_local4 = new Array(_local2);
_local5 = -1;
while (++_local5 < _local2) {
_local4[_local5] = _arg1.getChildAt(_local5);
_local4[_local5].updateProperty();
};
_local4.sort(orderObjectHold);
_local5 = -1;
while (++_local5 < _local2) {
_local6 = DisplayObject(_local4[_local5]);
if (_local5 != _arg1.getChildIndex(_local6)){
_local3 = true;
_arg1.setChildIndex(_local6, _local5);
};
};
return (_local3);
}
private function updateViewBackground(_arg1:DisplayObjectContainer){
var _local2:int;
var _local3:Array;
var _local4:int;
_local2 = _arg1.numChildren;
_local3 = new Array(_local2);
_local4 = 0;
_local4 = 0;
while (_local4 < _local2) {
_local3[_local4] = _arg1.getChildAt(_local4);
_local4++;
};
_local4 = 0;
while (_local4 < _local2) {
if (_local3[_local4].isPlayer()){
bgMgr.updateView(_local3[_local4]);
break;
};
_local4++;
};
_local4 = 0;
while (_local4 < _local2) {
if (_local3[_local4].isPlayer() == false){
_local3[_local4].x = (_local3[_local4].x + bgMgr.getMoveBgX());
_local3[_local4].y = (_local3[_local4].y + bgMgr.getMoveBgY());
};
_local4++;
};
}
public function destroyBgScene(){
var _local1:int;
var _local2:Array;
var _local3:int;
_local1 = container_scene.numChildren;
_local2 = new Array(_local1);
_local3 = 0;
_local3 = 0;
while (_local3 < _local1) {
_local2[_local3] = container_scene.getChildAt(_local3);
_local3++;
};
_local3 = 0;
while (_local3 < _local1) {
if (_local2[_local3]){
_local2[_local3].destroyEntity();
};
_local3++;
};
if (bgMgr.getBG()){
container_bgLayerBack.removeChild(bgMgr.getBG());
};
if (bgMgr.getBGF()){
container_bgLayerFront.removeChild(bgMgr.getBGF());
};
bgMgr.destroy();
}
private function statCounting(_arg1:DisplayObjectContainer){
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
_local2 = _arg1.numChildren;
_local3 = new Array(_local2);
_local4 = 0;
_local4 = 0;
while (_local4 < _local2) {
_local3[_local4] = _arg1.getChildAt(_local4);
_local4++;
};
_local5 = 0;
_local6 = 0;
_local4 = 0;
while (_local4 < _local2) {
if (_local3[_local4].isAlly()){
_local5++;
} else {
if (_local3[_local4].isEnemy()){
_local6++;
};
};
_local4++;
};
if (((!((_local5 == totAlly))) || (!((_local6 == totEnemy))))){
totAlly = _local5;
totEnemy = _local6;
trace(((("totAlly = " + String(totAlly)) + " totEnemy = ") + String(totEnemy)));
};
}
public function destroy(){
}
}
}//package
Section 88
//vx_mc (vx_mc)
package {
public dynamic class vx_mc extends EntityClass {
public function vx_mc(){
addFrameScript(24, frame25, 48, frame49, 49, frame50, 59, frame60, 68, frame69, 74, frame75, 75, frame76, 82, frame83, 103, frame104, 171, frame172);
}
function frame172(){
stop();
}
function frame25(){
gotoAndPlay("stand");
}
function frame49(){
gotoAndPlay("walk");
}
function frame50(){
gotoAndPlay("stand");
}
function frame60(){
gotoAndPlay("stand");
}
function frame69(){
gotoAndPlay("stand");
}
function frame76(){
gotoAndPlay("stand");
}
function frame75(){
stop();
}
function frame83(){
gotoAndPlay("stand");
}
function frame104(){
stop();
}
}
}//package