Section 1
//AbstractAniNumberSprite (component.AbstractAniNumberSprite)
package component {
import flash.events.*;
import util.*;
import flash.utils.*;
public class AbstractAniNumberSprite extends AbstractNumberSprite {
protected var stopTimer:Timer;
protected var num:uint;
public function AbstractAniNumberSprite(){
stopTimer = new Timer(NumberUtilities.random(300, 1500), 1);
stopTimer.addEventListener(TimerEvent.TIMER, stopToNumFrame);
super();
}
override public function set number(_arg1:uint):void{
num = _arg1;
if (stopTimer.running){
stopTimer.stop();
gotoAndStop(num);
} else {
stopTimer.start();
play();
};
}
private function stopToNumFrame(_arg1:TimerEvent):void{
gotoAndStop(num);
}
}
}//package component
Section 2
//AbstractNumberSprite (component.AbstractNumberSprite)
package component {
import flash.display.*;
public class AbstractNumberSprite extends MovieClip {
public function AbstractNumberSprite(_arg1:uint=10){
gotoAndStop(_arg1);
}
public function set number(_arg1:uint):void{
gotoAndStop(_arg1);
}
}
}//package component
Section 3
//AniNumberSprite (component.AniNumberSprite)
package component {
public class AniNumberSprite extends AbstractAniNumberSprite {
}
}//package component
Section 4
//BigCandySymbol (component.BigCandySymbol)
package component {
import map.*;
public class BigCandySymbol extends AbstractAnimateTile {
}
}//package component
Section 5
//BlueHeart (component.BlueHeart)
package component {
import map.*;
public class BlueHeart extends AbstractAnimateTile {
}
}//package component
Section 6
//ButtonSprite (component.ButtonSprite)
package component {
import flash.display.*;
public class ButtonSprite extends SimpleButton {
private var onImage:DisplayObject;
private var overImage:DisplayObject;
public function ButtonSprite(_arg1:Class, _arg2:Class, _arg3:int=0, _arg4:int=0):void{
this.x = _arg3;
this.y = _arg4;
onImage = new (_arg1);
overImage = new (_arg2);
downState = drawOnButton();
overState = drawOverButton();
upState = drawOnButton();
hitTestState = drawOverButton();
useHandCursor = true;
}
private function drawOverButton():DisplayObject{
return (overImage);
}
private function drawOnButton():DisplayObject{
return (onImage);
}
}
}//package component
Section 7
//CandySprite (component.CandySprite)
package component {
import map.*;
public class CandySprite extends AbstractAnimateTile {
}
}//package component
Section 8
//EnermySymbol (component.EnermySymbol)
package component {
import map.*;
public class EnermySymbol extends AbstractAnimateTile {
}
}//package component
Section 9
//FireFlower (component.FireFlower)
package component {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class FireFlower extends Sprite {
private var moveTimer:Timer;
private var _speed:Number;
private var gravity:Number;// = 0.5
private var angle_unit:int;
private var _list:Array;
private var num:uint;
private var _target:Sprite;
public function FireFlower(_arg1:Class, _arg2:Sprite, _arg3:int, _arg4:int, _arg5:uint=12, _arg6:uint=0){
var _local7:uint;
var _local8:Bitmap;
gravity = 0.5;
super();
num = _arg5;
_target = _arg2;
this.x = (_arg3 + 16);
this.y = (_arg4 + 16);
_list = new Array(num);
_speed = _arg6;
angle_unit = Math.floor((360 / num));
_local7 = 0;
while (_local7 < num) {
_local8 = (new (_arg1) as Bitmap);
addChild(_local8);
_list[_local7] = _local8;
_local7++;
};
moveTimer = new Timer(20, 13);
moveTimer.addEventListener(TimerEvent.TIMER, fire);
moveTimer.addEventListener(TimerEvent.TIMER_COMPLETE, clearFire);
_target.addChild(this);
moveTimer.start();
}
private function clearFire(_arg1:TimerEvent):void{
moveTimer.removeEventListener(TimerEvent.TIMER, fire);
moveTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, clearFire);
_target.removeChild(this);
}
private function fire(_arg1:TimerEvent):void{
var _local2:uint;
_local2 = 0;
while (_local2 < num) {
move(_list[_local2], (_local2 * angle_unit));
_local2++;
};
}
private function move(_arg1:Bitmap, _arg2:uint):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = ((_arg2 * Math.PI) / 180);
_local4 = (Math.cos(_local3) * _speed);
_local5 = (Math.sin(_local3) * _speed);
_arg1.x = (_arg1.x + _local4);
_arg1.y = (_arg1.y + _local5);
_speed = (_speed + 0.08);
}
}
}//package component
Section 10
//NumberSprite (component.NumberSprite)
package component {
import flash.display.*;
public class NumberSprite extends MovieClip {
public function set number(_arg1:uint):void{
gotoAndStop(_arg1);
}
}
}//package component
Section 11
//PercentageBar (component.PercentageBar)
package component {
import flash.geom.*;
import flash.display.*;
import flash.filters.*;
public class PercentageBar extends Sprite {
private var _emphasize_color:uint;
public function PercentageBar(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint){
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Boolean;
var _local13:Boolean;
var _local14:Number;
var _local15:BitmapFilter;
var _local16:Array;
super();
this.x = _arg1;
this.y = _arg2;
this._emphasize_color = _arg6;
graphics.beginFill(_arg5);
graphics.drawRect(0, 0, _arg3, _arg4);
graphics.endFill();
_local8 = 1;
_local9 = 2;
_local10 = 2;
_local11 = 3;
_local12 = false;
_local13 = false;
_local14 = BitmapFilterQuality.HIGH;
_local15 = new GlowFilter(_arg7, _local8, _local9, _local10, _local11, _local14, _local12, _local13);
_local16 = new Array();
_local16.push(_local15);
filters = _local16;
}
private function getBarColorTransform(_arg1:uint):ColorTransform{
var _local2:uint;
var _local3:uint;
var _local4:uint;
_arg1 = (100 - _arg1);
_local2 = ((_emphasize_color >> 16) & 0xFF);
_local3 = ((_emphasize_color >> 8) & 0xFF);
_local4 = (_emphasize_color & 0xFF);
return (new ColorTransform(1, 1, 1, 1, (_local2 + _arg1), (_local3 + _arg1), (_local4 + _arg1), 0));
}
public function set barLength(_arg1:uint):void{
var _local2:ColorTransform;
scaleX = (_arg1 / 100);
_local2 = new ColorTransform();
transform.colorTransform = getBarColorTransform(_arg1);
}
}
}//package component
Section 12
//PolyNumber (component.PolyNumber)
package component {
import flash.display.*;
public class PolyNumber extends Sprite {
protected var numbers:Array;
protected var old_strlen:uint;// = 0
public function PolyNumber(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:Class, _arg5:uint=0, _arg6:uint=0){
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:AbstractNumberSprite;
old_strlen = 0;
super();
this.x = _arg5;
this.y = _arg6;
_local7 = _arg2;
numbers = new Array(_local7);
_local8 = (_local7 * _arg3);
_local9 = 0;
while (_local9 < 7) {
_local10 = new (_arg4);
_local10.x = (_local8 - ((_local9 + 1) * _arg3));
if (_local9 == 0){
addChild(_local10);
};
numbers[_local9] = _local10;
_local9++;
};
setNumerToNumbers(_arg1);
}
public function initNumber():void{
var _local1:uint;
var _local2:uint;
var _local3:int;
var _local4:AbstractNumberSprite;
_local1 = 0;
_local2 = (numbers.length - 1);
_local3 = _local2;
while (_local3 >= 0) {
_local4 = numbers[_local1];
if (((!((_local3 == 0))) && (contains(_local4)))){
removeChild(_local4);
};
_local3--;
_local1++;
};
old_strlen = 0;
}
public function setNumerToNumbers(_arg1:uint):void{
var _local2:String;
var _local3:uint;
var _local4:int;
var _local5:int;
var _local6:uint;
var _local7:AbstractNumberSprite;
_local2 = _arg1.toString();
_local3 = 0;
_local4 = (_local2.length - 1);
_local5 = _local4;
while (_local5 >= 0) {
_local6 = parseInt(_local2.charAt(_local5));
_local6 = ((_local6 == 0)) ? 10 : _local6;
_local7 = numbers[_local3];
_local7.number = _local6;
if (!contains(_local7)){
addChild(_local7);
};
_local5--;
_local3++;
};
if (old_strlen > _local4){
removeChildAt(old_strlen);
};
old_strlen = _local4;
}
}
}//package component
Section 13
//RedHeart (component.RedHeart)
package component {
import map.*;
public class RedHeart extends AbstractAnimateTile {
}
}//package component
Section 14
//ScreenCover (component.ScreenCover)
package component {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class ScreenCover extends Sprite {
private var total_msg:uint;// = 0
private var px:uint;// = 0
private var calltime:uint;// = 10
private var tile_count:uint;// = 0
private var CoverSnd:Class;
private var widthTiles:uint;
private var height_start:uint;// = 0
private var _color:uint;
private var tile_list:Array;
private var heightTiles:uint;
private var tilesize:uint;
private var total_tiles:uint;
public static const REMOVE_COMP:String = "remove_comp";
public static const COVER_COMP:String = "cover_comp";
public function ScreenCover(_arg1:uint, _arg2:uint=32, _arg3:uint=16, _arg4:uint=14){
var _local5:Timer;
CoverSnd = ScreenCover_CoverSnd;
px = 0;
height_start = 0;
tile_count = 0;
total_msg = 0;
calltime = 10;
super();
this._color = _arg1;
this.tilesize = _arg2;
this.widthTiles = _arg3;
this.heightTiles = _arg4;
this.total_tiles = (_arg3 * _arg4);
tile_list = new Array(total_tiles);
_local5 = new Timer(calltime, ((_arg4 * 2) + 2));
_local5.addEventListener(TimerEvent.TIMER, makeTile);
_local5.start();
makeOverraySnd();
}
private function makeOverraySnd():void{
var _local1:Sound;
var _local2:SoundChannel;
var _local3:SoundTransform;
_local1 = (new CoverSnd() as Sound);
_local2 = _local1.play();
_local3 = new SoundTransform();
_local3.volume = 0.5;
_local2.soundTransform = _local3;
}
private function sendBuildCompMSG(_arg1:Event):void{
total_msg++;
if (tile_count == total_msg){
this.dispatchEvent(new Event(ScreenCover.COVER_COMP));
};
}
private function removeTile(_arg1:Event):void{
var _local2:ScreenTile;
_local2 = (_arg1.target as ScreenTile);
removeChild(_local2);
_local2 = null;
total_msg++;
if (total_msg == total_tiles){
this.dispatchEvent(new Event(ScreenCover.REMOVE_COMP));
};
}
public function startRemoveTiles():void{
var _local1:Timer;
px = 0;
height_start = 0;
tile_count = 0;
total_msg = 0;
_local1 = new Timer(calltime, ((heightTiles * 2) + 2));
_local1.addEventListener(TimerEvent.TIMER, clearTile);
_local1.start();
makeOverraySnd();
}
private function clearTile(_arg1:TimerEvent):void{
var _local2:uint;
var _local3:int;
height_start = (height_start + ((px >= widthTiles)) ? 1 : 0);
_local2 = height_start;
while (_local2 < heightTiles) {
_local3 = (px - _local2);
if (_local3 >= 0){
tile_list[tile_count].clear();
tile_count++;
} else {
break;
};
_local2++;
};
px++;
}
private function makeTile(_arg1:TimerEvent):void{
var _local2:uint;
var _local3:int;
var _local4:ScreenTile;
height_start = (height_start + ((px >= widthTiles)) ? 1 : 0);
_local2 = height_start;
while (_local2 < heightTiles) {
_local3 = (px - _local2);
if (_local3 >= 0){
_local4 = new ScreenTile(_color, (_local3 * tilesize), (_local2 * tilesize));
_local4.addEventListener(ScreenTile.REMOVE_ME, removeTile);
_local4.addEventListener(ScreenTile.CREATE_COMP, sendBuildCompMSG);
addChild(_local4);
tile_list[tile_count] = _local4;
tile_count++;
} else {
break;
};
_local2++;
};
px++;
}
}
}//package component
import flash.events.*;
import flash.display.*;
import util.*;
import flash.filters.*;
import flash.utils.*;
class ScreenTile extends Sprite {
private var color:uint;
private var alpha_val:Number;// = 0.2
public static const CREATE_COMP:String = "create_comp";
public static const REMOVE_ME:String = "remove_me";
private static var GLOW_EFFECT:GlowEffecter = new GlowEffecter();
private function ScreenTile(_arg1:uint, _arg2:uint, _arg3:uint){
var _local4:Timer;
alpha_val = 0.2;
super();
this.color = _arg1;
this.x = _arg2;
this.y = _arg3;
this.name = name;
this.alpha = 0;
this.graphics.beginFill(_arg1, 1);
this.graphics.drawRect(0, 0, 50, 50);
this.graphics.endFill();
this.useHandCursor = false;
_local4 = new Timer(10, 5);
_local4.addEventListener(TimerEvent.TIMER, modifyAlpha);
_local4.addEventListener(TimerEvent.TIMER_COMPLETE, setGlowEffet);
_local4.start();
}
private function clear():void{
var _local1:Timer;
alpha_val = -(alpha_val);
this.filters = null;
_local1 = new Timer(10, 5);
_local1.addEventListener(TimerEvent.TIMER, modifyAlpha);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, sendRemoveMassage);
_local1.start();
}
private function setGlowEffet(_arg1:TimerEvent):void{
var _local2:BitmapFilter;
var _local3:Array;
GLOW_EFFECT.color = color;
_local2 = GLOW_EFFECT.getBitmapFilter();
_local3 = new Array();
_local3.push(_local2);
this.filters = _local3;
this.dispatchEvent(new Event(ScreenTile.CREATE_COMP));
}
private function sendRemoveMassage(_arg1:TimerEvent):void{
this.dispatchEvent(new Event(ScreenTile.REMOVE_ME));
}
private function modifyAlpha(_arg1:TimerEvent):void{
this.alpha = (this.alpha + alpha_val);
}
}
Section 15
//ScreenCover_CoverSnd (component.ScreenCover_CoverSnd)
package component {
import mx.core.*;
public class ScreenCover_CoverSnd extends SoundAsset {
}
}//package component
Section 16
//SmallCandySymbol (component.SmallCandySymbol)
package component {
import map.*;
public class SmallCandySymbol extends AbstractAnimateTile {
}
}//package component
Section 17
//Smoke (component.Smoke)
package component {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Smoke extends MovieClip {
private var timer:Timer;
private var target:Sprite;
public function Smoke(_arg1:Sprite, _arg2:uint=0, _arg3:uint=0){
this.x = _arg2;
this.y = _arg3;
this.target = _arg1;
this.gotoAndStop(1);
_arg1.addChild(this);
this.play();
timer = new Timer(1);
timer.addEventListener(TimerEvent.TIMER, checkEndFrame);
timer.start();
}
private function checkEndFrame(_arg1:Event):void{
var _local2:MovieClip;
if (currentFrame == totalFrames){
gotoAndStop(totalFrames);
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, checkEndFrame);
timer = null;
_local2 = this;
target.removeChild(_local2);
_local2 = null;
};
}
}
}//package component
Section 18
//Twister (component.Twister)
package component {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Twister extends Sprite {
private var rad:Number;// = 40
private var golden_angle:Number;// = 0
private var Image:Class;
private var timer:Timer;
private var speed:Number;
private var golden_ratio:Number;// = 0.618033988654363
private var maxNum:uint;// = 200
private var target:Sprite;
private var rgrowth:Number;// = 1.007
private var vr:Number;// = 0
private var degerater:Number;
private var rot:Number;// = 0
public function Twister(_arg1:Sprite, _arg2:Class, _arg3:int=0, _arg4:int=0, _arg5:Number=1, _arg6:Number=0, _arg7:int=10, _arg8:uint=20, _arg9:uint=45, _arg10:uint=200, _arg11:uint=3, _arg12:Boolean=true){
var _local13:uint;
golden_ratio = (1 / 1.618033989);
golden_angle = 0;
rgrowth = 1.007;
rad = 40;
rot = 0;
maxNum = 200;
vr = 0;
super();
this.target = _arg1;
this.Image = _arg2;
this.x = _arg3;
this.y = _arg4;
this.degerater = _arg5;
this.maxNum = _arg10;
this.speed = _arg11;
golden_angle = ((360 - (360 * golden_ratio)) + _arg6);
rad = (rad + _arg7);
_local13 = 0;
while (_local13 < _arg10) {
attachImage(_local13);
_local13++;
};
timer = new Timer(_arg8, _arg9);
timer.addEventListener(TimerEvent.TIMER, showMotion);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, destroy);
if (_arg12){
timer.start();
};
_arg1.addChild(this);
}
public function stop():void{
if (((!((timer == null))) && (timer.running))){
timer.stop();
};
}
private function showMotion(_arg1:TimerEvent):void{
var _local2:uint;
_local2 = (this.numChildren - 1);
removeChildAt(_local2);
--_local2;
removeChildAt(_local2);
--_local2;
removeChildAt(_local2);
--_local2;
removeChildAt(_local2);
this.rotation = (this.rotation + speed);
speed = (speed - 0.05);
}
private function attachImage(_arg1:uint):void{
var _local2:DisplayObject;
rot = (rot + golden_angle);
golden_angle = (golden_angle * degerater);
rot = (rot - (Math.round((rot / 360)) * 360));
rad = (rad * rgrowth);
_local2 = new Image();
_local2.x = (Math.cos(((rot * Math.PI) / 180)) * rad);
_local2.y = (Math.sin(((rot * Math.PI) / 180)) * rad);
_local2.rotation = rot;
addChild(_local2);
}
public function start():void{
timer.start();
}
private function destroy(_arg1:Event):void{
var _local2:Twister;
timer = null;
_local2 = this;
target.removeChild(_local2);
_local2 = null;
}
}
}//package component
Section 19
//ISoundUser (effect.ISoundUser)
package effect {
public interface ISoundUser {
function get orderNum():uint;
}
}//package effect
Section 20
//SoundManager (effect.SoundManager)
package effect {
import flash.events.*;
import flash.media.*;
import mvc.view.*;
import mvc.model.*;
import flash.utils.*;
public class SoundManager {
private var BGmusic:Class;
private var bg_sound_volume:Number;
private var bg_channel:SoundChannel;
private var duration:uint;
private var bg_sound:Sound;
private var initStartTime:uint;
private var _char:AbstractCharacter;
private var effect_sound_volume:Number;
private var EffectSnd1:Class;
private var EffectSnd2:Class;
private var EffectSnd3:Class;
private var EffectSnd4:Class;
private var EffectSnd5:Class;
private var EffectSnd6:Class;
private var EffectSnd0:Class;
private var effect_sound_list:Array;
private var timer:Timer;
private var EffectSnd7:Class;
private var effect_channel_list:Array;
private var startTime:uint;
private var BGEnd:Class;
private var default_volume:Number;// = 0.5
private static var _instance:SoundManager;
public function SoundManager(_arg1:GameModel, _arg2:ItemEffectManager, _arg3:AbstractCharacter, _arg4:Controller, _arg5:Sound, _arg6:uint, _arg7:uint, _arg8:uint){
EffectSnd0 = SoundManager_EffectSnd0;
EffectSnd1 = SoundManager_EffectSnd1;
EffectSnd2 = SoundManager_EffectSnd2;
EffectSnd3 = SoundManager_EffectSnd3;
EffectSnd4 = SoundManager_EffectSnd4;
EffectSnd5 = SoundManager_EffectSnd5;
EffectSnd6 = SoundManager_EffectSnd6;
EffectSnd7 = SoundManager_EffectSnd7;
BGmusic = SoundManager_BGmusic;
BGEnd = SoundManager_BGEnd;
default_volume = 0.5;
bg_sound_volume = default_volume;
effect_sound_volume = default_volume;
super();
this.startTime = _arg6;
this.duration = _arg7;
this.initStartTime = _arg8;
_char = _arg3;
this.bg_sound = _arg5;
effect_sound_list = new Array(8);
effect_channel_list = new Array(8);
effect_sound_list[0] = (new EffectSnd0() as Sound);
effect_sound_list[1] = (new EffectSnd1() as Sound);
effect_sound_list[2] = (new EffectSnd2() as Sound);
effect_sound_list[3] = (new EffectSnd3() as Sound);
effect_sound_list[4] = (new EffectSnd4() as Sound);
effect_sound_list[5] = (new EffectSnd5() as Sound);
effect_sound_list[6] = (new EffectSnd6() as Sound);
effect_sound_list[7] = (new EffectSnd7() as Sound);
_arg3.addEventListener(AbstractCharacter.DAMAGED, playEffectSnd);
_arg3.addEventListener(AbstractCharacter.DEAD, playEndSnd);
_arg1.addEventListener(GameModel.EFFECT_SOUND, playEffectSnd);
_arg2.addEventListener(ItemEffectManager.EFFECT_SOUND, playEffectSnd);
_arg4.addEventListener(Controller.KEY_PRESS_SOUND, onkeyPress);
}
public function getEffectSoundVolume():Number{
return (effect_sound_volume);
}
private function onkeyPress(_arg1:Event):void{
onSoundPlayAt(6);
}
public function onSoundPlayAt(_arg1:uint):void{
effect_channel_list[_arg1] = effect_sound_list[_arg1].play(0, 1);
setVolume(effect_channel_list[_arg1], effect_sound_volume);
}
public function mute():void{
setBGSoundVolume(0);
}
private function setVolume(_arg1:SoundChannel, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.volume = _arg2;
_arg1.soundTransform = _local3;
}
public function set char(_arg1:AbstractCharacter):void{
_char.removeEventListener(AbstractCharacter.DAMAGED, playEffectSnd);
_char.removeEventListener(AbstractCharacter.DEAD, playEndSnd);
_char = _arg1;
_char.addEventListener(AbstractCharacter.DAMAGED, playEffectSnd);
_char.addEventListener(AbstractCharacter.DEAD, playEndSnd);
}
public function playEffectSnd(_arg1:Event):void{
onSoundPlayAt((_arg1.target.orderNum as uint));
}
public function resetVolume():void{
setBGSoundVolume(default_volume);
}
public function playBGmusic():void{
var _local1:Timer;
timer = new Timer(duration);
timer.addEventListener(TimerEvent.TIMER, repeatBgMusic);
timer.start();
_local1 = new Timer(initStartTime, 1);
_local1.addEventListener(TimerEvent.TIMER, repeatBgMusic);
_local1.start();
}
private function repeatBgMusic(_arg1:TimerEvent):void{
bg_channel = bg_sound.play(startTime);
setVolume(bg_channel, bg_sound_volume);
}
public function stopBGmusic():void{
timer.stop();
bg_channel.stop();
}
private function playEndSnd(_arg1:Event):void{
stopBGmusic();
bg_sound = (new BGEnd() as Sound);
bg_channel = bg_sound.play();
setVolume(bg_channel, bg_sound_volume);
}
public function setBGSoundVolume(_arg1:Number):void{
bg_sound_volume = _arg1;
setVolume(bg_channel, _arg1);
}
public function getBGSoundVolume():Number{
return (bg_sound_volume);
}
public function setEffectSoundVolume(_arg1:Number):void{
effect_sound_volume = _arg1;
}
}
}//package effect
Section 21
//SoundManager_BGEnd (effect.SoundManager_BGEnd)
package effect {
import mx.core.*;
public class SoundManager_BGEnd extends SoundAsset {
}
}//package effect
Section 22
//SoundManager_BGmusic (effect.SoundManager_BGmusic)
package effect {
import mx.core.*;
public class SoundManager_BGmusic extends SoundAsset {
}
}//package effect
Section 23
//SoundManager_EffectSnd0 (effect.SoundManager_EffectSnd0)
package effect {
import mx.core.*;
public class SoundManager_EffectSnd0 extends SoundAsset {
}
}//package effect
Section 24
//SoundManager_EffectSnd1 (effect.SoundManager_EffectSnd1)
package effect {
import mx.core.*;
public class SoundManager_EffectSnd1 extends SoundAsset {
}
}//package effect
Section 25
//SoundManager_EffectSnd2 (effect.SoundManager_EffectSnd2)
package effect {
import mx.core.*;
public class SoundManager_EffectSnd2 extends SoundAsset {
}
}//package effect
Section 26
//SoundManager_EffectSnd3 (effect.SoundManager_EffectSnd3)
package effect {
import mx.core.*;
public class SoundManager_EffectSnd3 extends SoundAsset {
}
}//package effect
Section 27
//SoundManager_EffectSnd4 (effect.SoundManager_EffectSnd4)
package effect {
import mx.core.*;
public class SoundManager_EffectSnd4 extends SoundAsset {
}
}//package effect
Section 28
//SoundManager_EffectSnd5 (effect.SoundManager_EffectSnd5)
package effect {
import mx.core.*;
public class SoundManager_EffectSnd5 extends SoundAsset {
}
}//package effect
Section 29
//SoundManager_EffectSnd6 (effect.SoundManager_EffectSnd6)
package effect {
import mx.core.*;
public class SoundManager_EffectSnd6 extends SoundAsset {
}
}//package effect
Section 30
//SoundManager_EffectSnd7 (effect.SoundManager_EffectSnd7)
package effect {
import mx.core.*;
public class SoundManager_EffectSnd7 extends SoundAsset {
}
}//package effect
Section 31
//BigCandy (map.items.BigCandy)
package map.items {
import map.*;
public class BigCandy extends AbstractItem {
public static const BIGCANDY:String = "bigcandy";
override protected function hitAction():void{
EFFECT_MANAGER.showEffect(BIGCANDY, this);
}
}
}//package map.items
Section 32
//BlueCandy (map.items.BlueCandy)
package map.items {
import map.*;
public class BlueCandy extends AbstractItem {
public static const BLUECANDY:String = "bluecandy";
override protected function hitAction():void{
EFFECT_MANAGER.showEffect(BLUECANDY, this);
}
}
}//package map.items
Section 33
//GoldCandy (map.items.GoldCandy)
package map.items {
import map.*;
public class GoldCandy extends AbstractItem {
public static const GOLDCANDY:String = "goldcandy";
override protected function hitAction():void{
EFFECT_MANAGER.showEffect(GOLDCANDY, this);
}
}
}//package map.items
Section 34
//PurpleCandy (map.items.PurpleCandy)
package map.items {
import map.*;
public class PurpleCandy extends AbstractItem {
public static const PURPLECANDY:String = "purplecandy";
override protected function hitAction():void{
EFFECT_MANAGER.showEffect(PURPLECANDY, this);
}
}
}//package map.items
Section 35
//RedCandy (map.items.RedCandy)
package map.items {
import map.*;
public class RedCandy extends AbstractItem {
public static const REDCANDY:String = "redcandy";
override protected function hitAction():void{
EFFECT_MANAGER.showEffect(REDCANDY, this);
}
}
}//package map.items
Section 36
//SmallCandy (map.items.SmallCandy)
package map.items {
import map.*;
public class SmallCandy extends AbstractItem {
public static const SMALLCANDY:String = "smallcandy";
override protected function hitAction():void{
EFFECT_MANAGER.showEffect(SMALLCANDY, this);
}
}
}//package map.items
Section 37
//GreenBrickTile (map.tiles.GreenBrickTile)
package map.tiles {
import flash.display.*;
import map.*;
public class GreenBrickTile extends AbstractBrickTile {
private var Img:Class;
public static const GREEN_BRICK:String = "green_brick";
public function GreenBrickTile(){
Img = GreenBrickTile_Img;
super();
this.addChild((new Img() as Bitmap));
}
override protected function hitAction():void{
EFFECT_MANAGER.showEffect(GREEN_BRICK, this);
}
}
}//package map.tiles
Section 38
//GreenBrickTile_Img (map.tiles.GreenBrickTile_Img)
package map.tiles {
import mx.core.*;
public class GreenBrickTile_Img extends BitmapAsset {
}
}//package map.tiles
Section 39
//AbstractAnimateTile (map.AbstractAnimateTile)
package map {
import flash.events.*;
import flash.display.*;
import mvc.model.*;
public class AbstractAnimateTile extends MovieClip {
protected var total_frame:uint;// = 4
public static var FRAME_MANAGER:FrameNumberManager;
public function AbstractAnimateTile(){
total_frame = 4;
super();
gotoAndStop(getCurrentFrameNum());
addListeners();
}
protected function removeListeners(_arg1:Event):void{
removeEventListener(FrameNumberManager.FRAME_CHANGE, setCurrentFrame);
FRAME_MANAGER.removeEventListener(Event.REMOVED_FROM_STAGE, removeListeners);
removeEventListener(Event.REMOVED_FROM_STAGE, removeListeners);
}
protected function getCurrentFrameNum():uint{
var _local1:uint;
_local1 = (FrameNumberManager.FRAME_NUM % total_frame);
return (((_local1 == 0)) ? total_frame : _local1);
}
protected function addListeners():void{
addEventListener(Event.REMOVED_FROM_STAGE, removeListeners);
FRAME_MANAGER.addEventListener(FrameNumberManager.FRAME_CHANGE, setCurrentFrame);
}
protected function setCurrentFrame(_arg1:Event):void{
gotoAndStop(getCurrentFrameNum());
}
}
}//package map
Section 40
//AbstractBrickTile (map.AbstractBrickTile)
package map {
import flash.events.*;
import mvc.view.*;
public class AbstractBrickTile extends AbstractHitcheckStaticTile {
protected function hitAction():void{
throw (new Event("hitAction 오버라이드 하셈"));
}
override protected function checkHitCharacter(_arg1:Event):void{
if (((this.hitTestObject(CHAR)) && (AbstractCharacter.IS_BREAK))){
hitAction();
};
}
}
}//package map
Section 41
//AbstractHasEffectionTile (map.AbstractHasEffectionTile)
package map {
import flash.events.*;
import mvc.view.*;
public class AbstractHasEffectionTile extends AbstractAnimateTile {
protected static const HIT_RANGE:uint = 32;
protected static const TILE_HALF_SIZE:uint = 16;
public static var CHAR:AbstractCharacter;
public static var HIT_CHECKER:TimeEventChecker;
protected function checkHitCharacter(_arg1:Event):void{
throw (new Error("Override"));
}
override protected function removeListeners(_arg1:Event):void{
super.removeListeners(_arg1);
HIT_CHECKER.removeEventListener(Event.CHANGE, checkHitCharacter);
}
override protected function addListeners():void{
super.addListeners();
HIT_CHECKER.addEventListener(Event.CHANGE, checkHitCharacter);
}
}
}//package map
Section 42
//AbstractHitcheckStaticTile (map.AbstractHitcheckStaticTile)
package map {
import flash.events.*;
import flash.display.*;
import mvc.view.*;
import mvc.model.*;
public class AbstractHitcheckStaticTile extends Sprite {
protected static const HIT_RANGE:uint = 32;
protected static const TILE_HALF_SIZE:uint = 16;
public static var CHAR:AbstractCharacter;
public static var HIT_CHECKER:TimeEventChecker;
public static var EFFECT_MANAGER:ItemEffectManager;
public function AbstractHitcheckStaticTile(){
addListeners();
}
protected function checkHitCharacter(_arg1:Event):void{
throw (new Error("Override"));
}
protected function removeListeners(_arg1:Event):void{
HIT_CHECKER.removeEventListener(Event.CHANGE, checkHitCharacter);
removeEventListener(Event.REMOVED_FROM_STAGE, removeListeners);
}
protected function addListeners():void{
addEventListener(Event.REMOVED_FROM_STAGE, removeListeners);
HIT_CHECKER.addEventListener(Event.CHANGE, checkHitCharacter);
}
}
}//package map
Section 43
//AbstractItem (map.AbstractItem)
package map {
import flash.events.*;
import mvc.model.*;
public class AbstractItem extends AbstractHasEffectionTile {
public static var EFFECT_MANAGER:ItemEffectManager;
public function AbstractItem(){
total_frame = 4;
}
protected function hitAction():void{
throw (new Error("hitAction Override"));
}
override protected function checkHitCharacter(_arg1:Event):void{
if (this.hitTestObject(CHAR)){
hitAction();
};
}
}
}//package map
Section 44
//AbstrectTileImage (map.AbstrectTileImage)
package map {
import flash.geom.*;
import flash.display.*;
public class AbstrectTileImage {
public var mapSnRange:Array;
public var tileData:String;
public var mapStartPoint:Point;
public function getTileimage(_arg1:uint):DisplayObject{
throw (new Error("getTileimage는 override 되어야함"));
}
}
}//package map
Section 45
//TimeEventChecker (map.TimeEventChecker)
package map {
import flash.events.*;
import mvc.view.*;
import mvc.model.*;
import flash.utils.*;
public class TimeEventChecker extends EventDispatcher {
private var move_hit_Timer:Timer;
private var stageOutCheckTimer:Timer;
var _char:AbstractCharacter;
public static const STAGEOUT_CHECK:String = "stageout_check";
public function TimeEventChecker(_arg1:AbstractCharacter, _arg2:Controller){
_char = _arg1;
move_hit_Timer = new Timer(28);
move_hit_Timer.addEventListener(TimerEvent.TIMER, onCheckMoveHitChar);
stageOutCheckTimer = new Timer(1000);
stageOutCheckTimer.addEventListener(TimerEvent.TIMER, onStageOutCheck);
_arg2.addEventListener(Controller.START_GAME, startCheck);
_arg2.addEventListener(Controller.STOP_GAME, stopCheck);
}
private function onStageOutCheck(_arg1:TimerEvent):void{
dispatchEvent(new Event(TimeEventChecker.STAGEOUT_CHECK));
}
private function onCheckMoveHitChar(_arg1:TimerEvent):void{
dispatchEvent(new Event(Event.CHANGE));
}
private function stopCheck(_arg1:Event):void{
move_hit_Timer.stop();
stageOutCheckTimer.stop();
}
private function startCheck(_arg1:Event):void{
move_hit_Timer.start();
stageOutCheckTimer.start();
}
public function set char(_arg1:AbstractCharacter):void{
_char = _arg1;
}
}
}//package map
Section 46
//AbstractTileCollection (mvc.model.AbstractTileCollection)
package mvc.model {
import flash.utils.*;
public class AbstractTileCollection {
public var _horisonTileNum:uint;
public var _verticalTileNum:uint;
protected var mapData:Array;
public static const widthTiles:uint = 16;
public static const tileHalfSize:uint = 16;
public static const heightTiles:uint = 14;
public static const tileSize:uint = 32;
public function AbstractTileCollection(_arg1:String){
initMapData(_arg1);
}
public function getVerticalTileData(_arg1:uint, _arg2:uint, _arg3:uint):ByteArray{
var _local4:ByteArray;
var _local5:uint;
var _local6:uint;
_local4 = new ByteArray();
_local5 = (_arg2 + _arg3);
_local6 = _arg2;
while (_local6 < _local5) {
mapData[_local6].position = _arg1;
_local4.writeByte(mapData[_local6].readByte());
_local6++;
};
return (_local4);
}
protected function initMapData(_arg1:String):void{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:uint;
_local2 = _arg1.split("||");
_verticalTileNum = _local2.length;
mapData = new Array(_verticalTileNum);
_local3 = _local2[0].split(",");
_horisonTileNum = _local3.length;
_local4 = 0;
while (_local4 < _verticalTileNum) {
_local3 = _local2[_local4].split(",");
mapData[_local4] = new ByteArray();
_local5 = 0;
while (_local5 < _horisonTileNum) {
mapData[_local4].writeByte(parseInt(_local3[_local5]));
_local5++;
};
mapData[_local4].position = 0;
_local4++;
};
_arg1 = null;
_local3 = null;
_local2 = null;
}
public function setTileData(_arg1:uint, _arg2:uint, _arg3:uint):void{
mapData[_arg2][_arg1] = _arg3;
}
public function getHorizonTileData(_arg1:uint, _arg2:uint, _arg3:uint):ByteArray{
var _local4:ByteArray;
var _local5:uint;
var _local6:uint;
_local4 = new ByteArray();
_local5 = (_arg1 + _arg3);
mapData[_arg2].position = _arg1;
_local6 = _arg1;
while (_local6 < _local5) {
_local4.writeByte(mapData[_arg2].readByte());
_local6++;
};
return (_local4);
}
}
}//package mvc.model
Section 47
//ActiveObjectTileCollection (mvc.model.ActiveObjectTileCollection)
package mvc.model {
import flash.utils.*;
public class ActiveObjectTileCollection extends AbstractTileCollection {
private var _total_enermy:uint;// = 0
public function ActiveObjectTileCollection(_arg1:String){
_total_enermy = 0;
super(_arg1);
}
override protected function initMapData(_arg1:String):void{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:uint;
var _local6:int;
_local2 = _arg1.split("||");
_verticalTileNum = _local2.length;
mapData = new Array(_verticalTileNum);
_local3 = _local2[0].split(",");
_horisonTileNum = _local3.length;
_local4 = 0;
while (_local4 < _verticalTileNum) {
_local3 = _local2[_local4].split(",");
mapData[_local4] = new ByteArray();
_local5 = 0;
while (_local5 < _horisonTileNum) {
_local6 = parseInt(_local3[_local5]);
if (_local6 > 0){
_total_enermy++;
};
mapData[_local4].writeByte(_local6);
_local5++;
};
mapData[_local4].position = 0;
_local4++;
};
_arg1 = null;
_local3 = null;
_local2 = null;
}
public function get totalEnermy():uint{
return (_total_enermy);
}
}
}//package mvc.model
Section 48
//BackgroundTileCollection (mvc.model.BackgroundTileCollection)
package mvc.model {
public class BackgroundTileCollection extends AbstractTileCollection {
public function BackgroundTileCollection(_arg1:String){
super(_arg1);
}
}
}//package mvc.model
Section 49
//Controller (mvc.model.Controller)
package mvc.model {
import flash.events.*;
import flash.display.*;
import mvc.view.*;
import flash.utils.*;
public class Controller extends EventDispatcher {
private var game_model:GameModel;
private var _target:Stage;
private var _char:AbstractCharacter;
public static const SHOW_CHANGER:String = "show_changer";
public static const INITGAME_BY_DEAD:String = "initgame_by_dead";
public static const KEY_PRESS_SOUND:String = "key_press_sound";
public static const STOP_GAME:String = "stop_game";
public static const START_GAME:String = "start_game";
public function Controller(_arg1:Stage, _arg2:AbstractCharacter){
_target = _arg1;
_char = _arg2;
addKeyEventListener();
_char.addEventListener(AbstractCharacter.DAMAGED, onDamaged);
_char.addEventListener(AbstractCharacter.DEAD, onDead);
_char.addEventListener(AbstractCharacter.RECOVERY, onRecovery);
}
public function stop():void{
dispatchEvent(new Event(Controller.STOP_GAME));
clearKeyEventListener();
}
private function onKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 39:
game_model.ax = (game_model._isSlopeClimb) ? -(_char.slope_speedX) : -(_char.speedX);
game_model._isRight = true;
break;
case 37:
game_model.ax = (game_model._isSlopeClimb) ? _char.slope_speedX : _char.speedX;
game_model._isRight = false;
break;
case 65:
game_model.jump(_char.speedY);
break;
case 80:
dispatchEvent(new Event(Controller.STOP_GAME));
clearKeyEventListener();
dispatchEvent(new Event(Controller.KEY_PRESS_SOUND));
_target.addEventListener(KeyboardEvent.KEY_DOWN, onPressAnyKeyDown);
break;
case 81:
dispatchEvent(new Event(Controller.STOP_GAME));
dispatchEvent(new Event(Controller.SHOW_CHANGER));
clearKeyEventListener();
dispatchEvent(new Event(Controller.KEY_PRESS_SOUND));
break;
case 83:
_char.specialSkill();
break;
default:
break;
};
}
private function addKeyEventListener():void{
_target.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
_target.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
}
private function onKeyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 39:
game_model.ax = 0;
break;
case 37:
game_model.ax = 0;
break;
case 83:
_char.initSkill();
break;
default:
break;
};
}
public function killAfterEffect():void{
game_model.killAfterEffect();
}
public function get charHealthRatio():uint{
return (AbstractCharacter.CHARHEALTH);
}
private function onRecovery(_arg1:Event):void{
addKeyEventListener();
}
public function start():void{
dispatchEvent(new Event(Controller.START_GAME));
addKeyEventListener();
}
private function onDead(_arg1:Event):void{
var _local2:Timer;
clearKeyEventListener();
_local2 = new Timer(4000, 1);
_local2.addEventListener(TimerEvent.TIMER, onInitGameByDead);
_local2.start();
}
public function setModel(_arg1:GameModel):void{
this.game_model = _arg1;
}
private function onPressAnyKeyDown(_arg1:KeyboardEvent):void{
dispatchEvent(new Event(Controller.START_GAME));
_target.removeEventListener(KeyboardEvent.KEY_DOWN, onPressAnyKeyDown);
addKeyEventListener();
}
private function onInitGameByDead(_arg1:Event):void{
this.dispatchEvent(new Event(Controller.INITGAME_BY_DEAD));
AbstractCharacter.initManaHealth();
}
public function set char(_arg1:AbstractCharacter):void{
_char.removeEventListener(AbstractCharacter.DAMAGED, onDamaged);
_char.removeEventListener(AbstractCharacter.DEAD, onDead);
_char.removeEventListener(AbstractCharacter.RECOVERY, onRecovery);
_char = _arg1;
_char.addEventListener(AbstractCharacter.DAMAGED, onDamaged);
_char.addEventListener(AbstractCharacter.DEAD, onDead);
_char.addEventListener(AbstractCharacter.RECOVERY, onRecovery);
}
private function onDamaged(_arg1:Event):void{
clearKeyEventListener();
game_model.onDamaged();
}
public function get enermyKilledRatio():uint{
return (game_model.enermyKilledRatio);
}
private function clearKeyEventListener():void{
_target.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
_target.removeEventListener(KeyboardEvent.KEY_UP, onKeyUp);
}
}
}//package mvc.model
Section 50
//FrameNumberManager (mvc.model.FrameNumberManager)
package mvc.model {
import flash.events.*;
import flash.utils.*;
public class FrameNumberManager extends EventDispatcher {
private var changeTimer:Timer;
public static const FRAME_CHANGE:String = "frame_change";
public static var FRAME_NUM:uint = 1;
public function FrameNumberManager(){
changeTimer = new Timer(400);
changeTimer.addEventListener(TimerEvent.TIMER, onChangFrameFocus);
}
public function stop():void{
changeTimer.stop();
}
private function onChangFrameFocus(_arg1:TimerEvent):void{
FRAME_NUM++;
dispatchEvent(new Event(_slot1.FRAME_CHANGE));
}
public function start():void{
changeTimer.start();
}
}
}//package mvc.model
Section 51
//FrontBackgroundTileCollection (mvc.model.FrontBackgroundTileCollection)
package mvc.model {
public class FrontBackgroundTileCollection extends AbstractTileCollection {
public function FrontBackgroundTileCollection(_arg1:String){
super(_arg1);
}
}
}//package mvc.model
Section 52
//GameModel (mvc.model.GameModel)
package mvc.model {
import flash.events.*;
import mvc.view.*;
import flash.utils.*;
import effect.*;
public class GameModel extends EventDispatcher implements ISoundUser {
private const tileHalfSize:uint = 16;
private const _gravity:Number = 0.4;
private const standardY:uint = 192;
private const tileSize:uint = 32;
private const standardRightX:uint = 192;
private const standardLeftX:uint = 288;
var _isSlopeClimb:Boolean;// = false
private var _bgmap_view:BackgroundMapView;
private var stagetile_collection:StageTileCollection;
private var limit_px:int;
private var limit_py:int;
private var modelTimer:Timer;
private var activemap:ActiveObjectMapView;
private var jumping:Boolean;// = false
private var controller:Controller;
private var unitSize:uint;// = 64
private var _stagemap_view:StageMapView;
private var gravitylimit:uint;// = 10
private var _char:AbstractCharacter;
var ax:Number;// = 0
private var ay:Number;// = 0
private var _orderNum:uint;
private var vx:Number;// = 0
private var vy:Number;// = 0
private var frame_number_manager:FrameNumberManager;
var _isRight:Boolean;// = true
private var map_load_manager:MapLoadManager;
private var endX:uint;// = 0
private var frontBgmap_view:FrontBackgroundMapView;
private var friction:Number;// = 0.9
private var _killedEnermy:uint;// = 0
public static const EFFECT_SOUND:String = "effect_sound";
public function GameModel(_arg1:MapLoadManager, _arg2:Controller, _arg3:ActiveObjectMapView, _arg4:FrontBackgroundMapView, _arg5:FrameNumberManager){
ay = 0;
ax = 0;
vx = 0;
vy = 0;
friction = 0.9;
endX = 0;
unitSize = 64;
gravitylimit = 10;
jumping = false;
_isSlopeClimb = false;
_isRight = true;
_killedEnermy = 0;
super();
this.map_load_manager = _arg1;
this.stagetile_collection = _arg1.stagetile_collection;
this.controller = _arg2;
this.activemap = _arg3;
this.frontBgmap_view = _arg4;
this.frame_number_manager = _arg5;
modelTimer = new Timer(10);
modelTimer.addEventListener(TimerEvent.TIMER, onMove);
_arg2.addEventListener(Controller.START_GAME, startModel);
_arg2.addEventListener(Controller.STOP_GAME, stopModel);
}
public function setChar(_arg1:AbstractCharacter):void{
_char = _arg1;
_char.x = (map_load_manager.charStartPoint.x * tileSize);
_char.y = (map_load_manager.charStartPoint.y * tileSize);
_char.addEventListener(AbstractCharacter.DEAD, onDamaged);
}
public function get enermyKilledRatio():uint{
return (Math.floor(((_killedEnermy / activemap.totalEnermy) * 100)));
}
public function get velocityY():Number{
return (vy);
}
private function setTileMapPosX(_arg1:Number):void{
_stagemap_view.x = (_stagemap_view.x + _arg1);
activemap.x = _stagemap_view.x;
_bgmap_view.addX = (_arg1 * 0.2);
frontBgmap_view.addX = (_arg1 * 1.2);
}
public function set velocityX(_arg1:Number):void{
vx = (vx + (_isRight) ? -(_arg1) : _arg1);
}
public function jump(_arg1:Number):void{
if (((!(jumping)) && ((vy == 0)))){
vy = (vy - _arg1);
jumping = true;
_orderNum = 1;
this.dispatchEvent(new Event(GameModel.EFFECT_SOUND));
};
}
private function isMoveMapForFalling(_arg1:Number):Boolean{
return ((((((limit_py > Math.abs((_stagemap_view.y - _arg1)))) && ((_char.y < standardY)))) && ((_char.y > (standardY - _char.charHeight)))));
}
private function calcMoveX(_arg1:Number):void{
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
var _local9:Number;
var _local10:Boolean;
var _local11:Number;
if (vx < 0){
_local2 = ((_char.x + tileHalfSize) + Math.abs((_stagemap_view.x + vx)));
if ((((limit_px > Math.abs((_stagemap_view.x + vx)))) && ((_char.x > standardRightX)))){
_local3 = stagetile_collection.isGoHorizon(_local2, _arg1, _char.charHeight);
_local4 = (_local3) ? 0 : stagetile_collection.getTileGapX((_local2 + vx), Math.floor((_local2 / tileSize)));
setTileMapPosX((_local3) ? vx : (((_stagemap_view.x - _local4) > 0)) ? _stagemap_view.x : -(_local4));
_stagemap_view.drawAxisXRightMapTiles();
activemap.drawAxisXRightMapTiles();
_bgmap_view.drawAxisXRightMapTiles();
frontBgmap_view.drawAxisXRightMapTiles();
} else {
_local5 = stagetile_collection.isGoHorizon(_local2, _arg1, _char.charHeight);
_local6 = (_local5) ? _char.x : stagetile_collection.getTileGapX((tileHalfSize + Math.abs(_stagemap_view.x)), Math.floor((_local2 / tileSize)));
_char.x = ((((_char.x < endX)) && (_local5))) ? (_char.x - vx) : _local6;
};
} else {
if (vx > 0){
_local7 = ((_char.x + Math.abs(_stagemap_view.x)) - (vx + tileSize));
if (((((((_stagemap_view.x + vx) < 0)) && ((_char.x > standardRightX)))) && ((_char.x < standardLeftX)))){
_local8 = stagetile_collection.isGoHorizon((_local7 + tileSize), _arg1, _char.charHeight);
_local9 = (_local8) ? 0 : stagetile_collection.getTileGapX((_local7 + vx), Math.ceil((_local7 / tileSize)));
setTileMapPosX((_local8) ? vx : -(_local9));
_stagemap_view.drawAxisXLeftMapTiles();
activemap.drawAxisXLeftMapTiles();
_bgmap_view.drawAxisXLeftMapTiles();
frontBgmap_view.drawAxisXLeftMapTiles();
} else {
_local10 = stagetile_collection.isGoHorizon((_local7 + tileSize), _arg1, _char.charHeight);
_local11 = (_local10) ? _char.x : stagetile_collection.getTileGapX(-((tileSize + _stagemap_view.x)), Math.ceil((_local7 / tileSize)));
_char.x = (((((_char.x - vx) > 0)) && (_local10))) ? (_char.x - vx) : _local11;
};
};
};
}
public function killAfterEffect():void{
vy = _char.killingEffectJump;
jumping = true;
_orderNum = 2;
this.dispatchEvent(new Event(GameModel.EFFECT_SOUND));
_killedEnermy++;
}
public function get orderNum():uint{
return (_orderNum);
}
private function isMoveMapForJump(_arg1:Number):Boolean{
return ((((_stagemap_view.y < _arg1)) && ((_char.y < standardY))));
}
private function setTileMapPosY(_arg1:Number):void{
_stagemap_view.y = (_stagemap_view.y + _arg1);
frontBgmap_view.y = (activemap.y = _stagemap_view.y);
_bgmap_view.addY = (_arg1 * 0.4);
if (_arg1 < 0){
_stagemap_view.drawAxisYDownTiles();
activemap.drawAxisYDownTiles();
_bgmap_view.drawAxisYDownTiles();
frontBgmap_view.drawAxisYDownTiles();
} else {
_stagemap_view.drawAxisYUpTiles();
activemap.drawAxisYUpTiles();
_bgmap_view.drawAxisYUpTiles();
frontBgmap_view.drawAxisYUpTiles();
};
}
private function calcMoveY(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
if (vy < 0){
if (stagetile_collection.isJump(_arg1, (_arg2 - _char.charHeight), _char.charHeight)){
if (isMoveMapForJump(vy)){
vy = (vy + ((vy > gravitylimit)) ? 0 : _gravity);
setTileMapPosY((((_stagemap_view.y - vy) > 0)) ? 0 : -(vy));
} else {
vy = (vy + ((vy > gravitylimit)) ? 0 : _gravity);
_char.y = (_char.y + vy);
};
} else {
vy = (-(vy) * 0.3);
vx = 0;
};
} else {
if (stagetile_collection.isOnSlope(_arg1, _arg2, _char.charHeight)){
_local3 = (((stagetile_collection.getSlopeHeight(_arg1, _arg2) + _stagemap_view.y) - _char.charHeight) - _char.y);
_isSlopeClimb = (_local3 < 0);
if (_isSlopeClimb){
if (isMoveMapForJump(_local3)){
setTileMapPosY(-(_local3));
} else {
_char.y = (_char.y + _local3);
};
ax = (((!((ax == 0))) && (!((Math.abs(ax) == _char.slope_speedX))))) ? (_isRight) ? -(_char.slope_speedX) : _char.slope_speedX : ax;
} else {
_isSlopeClimb = false;
if (isMoveMapForFalling(_local3)){
setTileMapPosY(-(_local3));
} else {
_char.y = (_char.y + _local3);
};
};
jumping = false;
vy = 0;
} else {
if (stagetile_collection.isOnFall(_arg1, _arg2, _char.charHeight)){
if (isMoveMapForFalling(vy)){
vy = (vy + ((vy > gravitylimit)) ? 0 : _gravity);
setTileMapPosY(-(vy));
} else {
vy = (vy + ((vy > gravitylimit)) ? 0 : _gravity);
_char.y = (_char.y + vy);
};
} else {
_isSlopeClimb = false;
ax = ((ax)!=0) ? (_isRight) ? -(_char.speedX) : _char.speedX : 0;
_local4 = (((Math.floor((_arg2 / tileSize)) * tileSize) + _stagemap_view.y) - _char.charHeight);
_char.y = _local4;
setTileMapPosY((_local4 - _char.y));
jumping = false;
vy = 0;
};
};
};
}
public function set velocityY(_arg1:Number):void{
vy = (vy - _arg1);
}
private function startModel(_arg1:Event):void{
_char.actStart();
modelTimer.start();
frame_number_manager.start();
}
private function stopModel(_arg1:Event):void{
modelTimer.stop();
_char.actStop();
frame_number_manager.stop();
}
private function onMove(_arg1:TimerEvent):void{
var _local2:Number;
vx = (vx + ax);
vx = (vx * friction);
vx = ((Math.abs(vx) < 0.25)) ? 0 : vx;
_local2 = ((_char.y + Math.abs(_stagemap_view.y)) + tileSize);
calcMoveX(_local2);
calcMoveY((Math.abs(_stagemap_view.x) + _char.x), ((_char.y + _char.charHeight) + Math.abs(_stagemap_view.y)));
_char.setStatus(vx, vy, ax, jumping, _isRight);
}
public function setMapView(_arg1:StageMapView, _arg2:BackgroundMapView, _arg3:uint, _arg4:uint):void{
_stagemap_view = _arg1;
_bgmap_view = _arg2;
limit_px = (_stagemap_view.totalWidth - _arg3);
limit_py = (_stagemap_view.totalHeight - _arg4);
endX = (_arg3 - tileSize);
}
public function onDamaged(_arg1:Event=null):void{
ax = 0;
vx = 0;
}
}
}//package mvc.model
Section 53
//ItemEffectManager (mvc.model.ItemEffectManager)
package mvc.model {
import component.*;
import flash.events.*;
import flash.display.*;
import mvc.view.*;
import flash.utils.*;
import effect.*;
import map.items.*;
import map.tiles.*;
public class ItemEffectManager extends EventDispatcher implements ISoundUser {
private var stagetile_collection:StageTileCollection;
private var controller:Controller;
private var stagemap_view:AbstrectMapView;
private var candynum_displayer:CandyNumDisplayer;
private var _orderNum:uint;
private var tileSize:uint;// = 32
private var _ratioList:Array;
private var Paticle0:Class;
private var Paticle1:Class;
private var Paticle2:Class;
private var eatenBigCandy:uint;// = 0
private var eatenSmallCandy:uint;// = 0
public static const EFFECT_SOUND:String = "effect_sound";
public static const GO_RESULTPAGE:String = "go_resultpage";
public static const GOLD_EFFECT:String = "gold_effect";
public static const PURPLE_EFFECT:String = "purple_effect";
public static const GO_STAGEMAP:String = "go_stagemap";
public static const BLUE_EFFECT:String = "blue_effect";
public static const RED_EFFECT:String = "red_effect";
public function ItemEffectManager(_arg1:MapLoadManager, _arg2:AbstrectMapView, _arg3:CandyNumDisplayer, _arg4:Controller){
Paticle0 = ItemEffectManager_Paticle0;
Paticle1 = ItemEffectManager_Paticle1;
Paticle2 = ItemEffectManager_Paticle2;
tileSize = AbstractTileCollection.tileSize;
eatenBigCandy = 0;
eatenSmallCandy = 0;
super();
this.stagetile_collection = _arg1.stagetile_collection;
this.stagemap_view = _arg2;
this.candynum_displayer = _arg3;
this.controller = _arg4;
_arg4.addEventListener(Controller.INITGAME_BY_DEAD, goStageMap);
}
private function redCandyEffect(_arg1:TimerEvent):void{
AbstractCharacter.addHealth(10);
}
private function restartgame(_arg1:TimerEvent):void{
controller.start();
}
public function goStageMap(_arg1:Event=null):void{
controller.stop();
this.dispatchEvent(new Event(ItemEffectManager.GO_STAGEMAP));
}
private function blueCandyEffect(_arg1:TimerEvent):void{
AbstractCharacter.addMana(10);
}
public function showResultPage():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:Number;
controller.stop();
_local1 = Math.floor(((eatenBigCandy / stagetile_collection.totalBigCandy) * 100));
_local2 = Math.floor(((eatenSmallCandy / stagetile_collection.totalSmallCandy) * 100));
_local3 = controller.enermyKilledRatio;
_local4 = controller.charHealthRatio;
_local5 = ((((_local1 + _local2) + _local3) + _local4) / 4);
_ratioList = [_local1, _local2, _local3, _local4, _local5];
this.dispatchEvent(new Event(ItemEffectManager.GO_RESULTPAGE));
}
private function removeEffectedObj(_arg1:DisplayObject):void{
stagetile_collection.setTileData(Math.floor((_arg1.x / tileSize)), Math.floor((_arg1.y / tileSize)), 0);
stagemap_view.removeChild(_arg1);
_arg1 = null;
}
public function get ratioList():Array{
return (_ratioList);
}
private function goldCandyEffect(_arg1:TimerEvent):void{
AbstractCharacter.addMana(15);
AbstractCharacter.addHealth(15);
}
public function get orderNum():uint{
return (_orderNum);
}
private function effectCandy(_arg1:uint, _arg2:DisplayObject):void{
stagetile_collection.setTileData(Math.floor((_arg2.x / tileSize)), Math.floor((_arg2.y / tileSize)), 0);
stagemap_view.removeChild(_arg2);
_arg2 = null;
AbstractCharacter.addCandy(_arg1);
candynum_displayer.reflashCandyNumDisplay();
}
public function showEffect(_arg1:String, _arg2:DisplayObject):void{
var _local3:Timer;
var _local4:FireFlower;
var _local5:FireFlower;
var _local6:FireFlower;
switch (_arg1){
case GreenBrickTile.GREEN_BRICK:
removeEffectedObj(_arg2);
_orderNum = 7;
_local4 = new FireFlower(Paticle2, stagemap_view, _arg2.x, _arg2.y, 20);
this.dispatchEvent(new Event(ItemEffectManager.EFFECT_SOUND));
break;
case SmallCandy.SMALLCANDY:
effectCandy(1, _arg2);
_local5 = new FireFlower(Paticle0, stagemap_view, _arg2.x, _arg2.y);
_orderNum = 3;
this.dispatchEvent(new Event(ItemEffectManager.EFFECT_SOUND));
eatenSmallCandy++;
break;
case BigCandy.BIGCANDY:
effectCandy(10, _arg2);
_local6 = new FireFlower(Paticle1, stagemap_view, _arg2.x, _arg2.y);
_orderNum = 3;
this.dispatchEvent(new Event(ItemEffectManager.EFFECT_SOUND));
eatenBigCandy++;
break;
case BlueCandy.BLUECANDY:
controller.stop();
removeEffectedObj(_arg2);
_local3 = new Timer(300, 4);
_local3.addEventListener(TimerEvent.TIMER, blueCandyEffect);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, restartgame);
_orderNum = 0;
this.dispatchEvent(new Event(ItemEffectManager.EFFECT_SOUND));
_local3.start();
this.dispatchEvent(new Event(ItemEffectManager.BLUE_EFFECT));
break;
case GoldCandy.GOLDCANDY:
controller.stop();
removeEffectedObj(_arg2);
_local3 = new Timer(300, 4);
_local3.addEventListener(TimerEvent.TIMER, goldCandyEffect);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, restartgame);
_orderNum = 0;
this.dispatchEvent(new Event(ItemEffectManager.EFFECT_SOUND));
_local3.start();
this.dispatchEvent(new Event(ItemEffectManager.GOLD_EFFECT));
break;
case PurpleCandy.PURPLECANDY:
controller.stop();
removeEffectedObj(_arg2);
_local3 = new Timer(300, 4);
_local3.addEventListener(TimerEvent.TIMER, purpleCandyEffect);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, restartgame);
_orderNum = 0;
this.dispatchEvent(new Event(ItemEffectManager.EFFECT_SOUND));
_local3.start();
this.dispatchEvent(new Event(ItemEffectManager.PURPLE_EFFECT));
break;
case RedCandy.REDCANDY:
controller.stop();
removeEffectedObj(_arg2);
_local3 = new Timer(300, 4);
_local3.addEventListener(TimerEvent.TIMER, redCandyEffect);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, restartgame);
_orderNum = 0;
this.dispatchEvent(new Event(ItemEffectManager.EFFECT_SOUND));
_local3.start();
this.dispatchEvent(new Event(ItemEffectManager.RED_EFFECT));
break;
};
}
private function purpleCandyEffect(_arg1:TimerEvent):void{
AbstractCharacter.addMana(5);
AbstractCharacter.addHealth(5);
}
}
}//package mvc.model
Section 54
//ItemEffectManager_Paticle0 (mvc.model.ItemEffectManager_Paticle0)
package mvc.model {
import mx.core.*;
public class ItemEffectManager_Paticle0 extends BitmapAsset {
}
}//package mvc.model
Section 55
//ItemEffectManager_Paticle1 (mvc.model.ItemEffectManager_Paticle1)
package mvc.model {
import mx.core.*;
public class ItemEffectManager_Paticle1 extends BitmapAsset {
}
}//package mvc.model
Section 56
//ItemEffectManager_Paticle2 (mvc.model.ItemEffectManager_Paticle2)
package mvc.model {
import mx.core.*;
public class ItemEffectManager_Paticle2 extends BitmapAsset {
}
}//package mvc.model
Section 57
//MapLoadManager (mvc.model.MapLoadManager)
package mvc.model {
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import map.*;
public class MapLoadManager {
public var musicInitTime:uint;
public var charStartPoint:Point;
public var activetile_collection:ActiveObjectTileCollection;
public var backGround:Bitmap;
public var active_tileImageMaker:AbstrectTileImage;
public var stagetile_collection:StageTileCollection;
public var front_bgtile_collection:FrontBackgroundTileCollection;
public var stage_tileImageMaker:AbstrectTileImage;
public var bgtile_collection:BackgroundTileCollection;
public var bg_music:Sound;
public var bg_tileImageMaker:AbstrectTileImage;
public var musicPoint:Point;
public var front_bg_tileImageMaker:AbstrectTileImage;
public function mapLoad(_arg1:Object):void{
stage_tileImageMaker = new _arg1.StageTileImage();
active_tileImageMaker = new _arg1.ActiveObjectTileImage();
bg_tileImageMaker = new _arg1.BackgroundTileImage();
front_bg_tileImageMaker = new _arg1.FrontBackgroundTileImage();
charStartPoint = _arg1.charStartPoint.clone();
backGround = new _arg1.backGround();
bg_music = (new _arg1.BgMusic() as Sound);
musicPoint = _arg1.MusicPoint.clone();
musicInitTime = _arg1.MusicInitTime.valueOf();
stagetile_collection = new StageTileCollection(stage_tileImageMaker.tileData);
activetile_collection = new ActiveObjectTileCollection(active_tileImageMaker.tileData);
bgtile_collection = new BackgroundTileCollection(bg_tileImageMaker.tileData);
front_bgtile_collection = new FrontBackgroundTileCollection(front_bg_tileImageMaker.tileData);
_arg1 = null;
}
}
}//package mvc.model
Section 58
//StageTileCollection (mvc.model.StageTileCollection)
package mvc.model {
import flash.utils.*;
public class StageTileCollection extends AbstractTileCollection {
private const slope_tile:uint = 100;
private const tileHalfSizeGap:uint = 13;
private const item_tile_limit:uint = 7;
private const no_hit_tile:uint = 63;
private const hit_tile:uint = 192;
private const gap:uint = 3;
private const item_tile:uint = 0;
private var _total_smallCandy:uint;// = 0
private var slope_height_list:Array;
private var slope_list:Array;
private var _total_bigCandy:uint;// = 0
public function StageTileCollection(_arg1:String){
_total_bigCandy = 0;
_total_smallCandy = 0;
slope_list = new Array(-1, 1, -0.5, 0.5, -0.5, 0.5, -0.333, 0.333, -0.333, 0.333, -0.333, 0.333);
slope_height_list = new Array(3, 3, 0, 24, -16, 8, 0, 24, -11, 13, -21, 3);
super(_arg1);
}
public function get totalSmallCandy():uint{
return (_total_smallCandy);
}
public function isGoHorizon(_arg1:Number, _arg2:Number, _arg3:uint):Boolean{
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (_arg2 < _arg3){
return (true);
};
_local4 = Math.floor((_arg1 / tileSize));
_local5 = mapData[Math.floor((_arg2 / tileSize))][_local4];
_local6 = mapData[Math.floor(((_arg2 - tileSize) / tileSize))][_local4];
return ((((_local5 < hit_tile)) && ((_local6 < hit_tile))));
}
public function isOnSlope(_arg1:Number, _arg2:Number, _arg3:uint):Boolean{
var _local4:uint;
if (_arg2 < _arg3){
return (false);
};
_local4 = Math.floor((_arg1 / tileSize));
return (((getSlopeTileTypeCheck(mapData[Math.floor((_arg2 / tileSize))][_local4])) || (getSlopeTileTypeCheck(mapData[(Math.floor((_arg2 / tileSize)) - 1)][_local4]))));
}
public function isOnFall(_arg1:Number, _arg2:Number, _arg3:uint):Boolean{
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (_arg2 < _arg3){
return (true);
};
_local4 = Math.floor((_arg2 / tileSize));
_local5 = mapData[_local4][Math.floor(((_arg1 + gap) / tileSize))];
_local6 = mapData[_local4][Math.floor(((_arg1 + tileHalfSizeGap) / tileSize))];
return ((((_local5 < slope_tile)) && ((_local6 < slope_tile))));
}
public function getTileGapX(_arg1:Number, _arg2:uint):Number{
return (((tileSize * _arg2) - _arg1));
}
public function isEnermyGoHorizon(_arg1:Number, _arg2:Number, _arg3:uint):Boolean{
var _local4:uint;
var _local5:uint;
var _local6:uint;
_local4 = Math.floor((_arg1 / tileSize));
_local5 = mapData[Math.floor((_arg2 / tileSize))][_local4];
_local6 = mapData[Math.floor(((_arg2 + _arg3) / tileSize))][_local4];
return ((((_local5 < hit_tile)) && ((_local6 < hit_tile))));
}
public function get totalBigCandy():uint{
return (_total_bigCandy);
}
private function getSlopeTileTypeCheck(_arg1:uint):Boolean{
return ((((_arg1 < slope_tile)) && ((_arg1 > no_hit_tile))));
}
override protected function initMapData(_arg1:String):void{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:uint;
var _local6:int;
_local2 = _arg1.split("||");
_verticalTileNum = _local2.length;
mapData = new Array(_verticalTileNum);
_local3 = _local2[0].split(",");
_horisonTileNum = _local3.length;
_local4 = 0;
while (_local4 < _verticalTileNum) {
_local3 = _local2[_local4].split(",");
mapData[_local4] = new ByteArray();
_local5 = 0;
while (_local5 < _horisonTileNum) {
_local6 = parseInt(_local3[_local5]);
if (_local6 == 1){
_total_smallCandy++;
} else {
if (_local6 == 2){
_total_bigCandy++;
};
};
mapData[_local4].writeByte(_local6);
_local5++;
};
mapData[_local4].position = 0;
_local4++;
};
_arg1 = null;
_local3 = null;
_local2 = null;
}
public function isJump(_arg1:Number, _arg2:Number, _arg3:uint):Boolean{
var _local4:uint;
var _local5:uint;
var _local6:uint;
if (_arg2 < 0){
return (false);
};
_local4 = Math.floor((_arg2 / tileSize));
_local5 = mapData[_local4][Math.floor(((_arg1 + gap) / tileSize))];
_local6 = mapData[_local4][Math.floor(((_arg1 + tileHalfSizeGap) / tileSize))];
return ((((_local5 < hit_tile)) && ((_local6 < hit_tile))));
}
public function getSlopeHeight(_arg1:Number, _arg2:Number):Number{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Number;
var _local7:Number;
var _local8:uint;
var _local9:uint;
_local3 = Math.floor((_arg1 / tileSize));
_local4 = Math.floor((_arg2 / tileSize));
_local5 = (Math.floor((_arg2 / tileSize)) - 1);
_local6 = (_arg1 - (_local3 * tileSize));
_local8 = mapData[_local4][_local3];
if (getSlopeTileTypeCheck(_local8)){
_local9 = ((_local8 - 64) % 12);
_local7 = (((_local4 * tileSize) + (slope_list[_local9] * _local6)) + slope_height_list[_local9]);
} else {
_local8 = mapData[_local5][_local3];
_local9 = ((_local8 - 64) % 12);
_local7 = (((_local5 * tileSize) + (slope_list[_local9] * _local6)) + slope_height_list[_local9]);
};
_local7 = (_local7 + (((_local8 % 2) == 0)) ? tileSize : 0);
return (_local7);
}
}
}//package mvc.model
Section 59
//AbstractCharacter (mvc.view.AbstractCharacter)
package mvc.view {
import component.*;
import flash.events.*;
import flash.display.*;
import util.*;
import flash.filters.*;
import mvc.model.*;
import flash.utils.*;
import effect.*;
public class AbstractCharacter extends MovieClip implements ISoundUser {
protected var actType:uint;// = 8
public var slope_speedX:Number;// = 0.4
protected var recovered_mana:uint;// = 1
public var charHeight:uint;// = 60
protected var isDamagedStatus:Boolean;// = false
protected var mana_add_timer:Timer;
public var killingEffectJump:int;// = -4
protected var isDamage:Boolean;// = false
protected var oldVx:Number;// = 0
protected var shieldTimer:Timer;
protected var mana_use_time:uint;// = 40
protected var offset:uint;// = 1
protected var shieldTimerisStop:Boolean;// = false
protected var mana_use_timer:Timer;
protected var _orderNum:uint;
protected var mana_consumption:uint;// = 0
protected var mana_recover_time:uint;// = 400
public var speedX:Number;// = 0.5
public var speedY:uint;// = 8
public static const RECOVERY:String = "recovery";
public static const DEAD:String = "dead";
public static const DAMAGED:String = "damaged";
protected static var MANA:int = 100;
public static var IS_BREAK:Boolean = false;
protected static var HEALTH_BAR:PercentageBar;
public static var USE_SKILL:Boolean = false;
protected static var HEALTH:int = 100;
public static var IS_INVINCIBLITY:Boolean = false;
protected static var CNADIES:uint = 0;
protected static var MANA_BAR:PercentageBar;
public static var GAME_MODEL:GameModel;
public function AbstractCharacter(){
speedX = 0.5;
speedY = 8;
slope_speedX = 0.4;
charHeight = 60;
killingEffectJump = -4;
mana_consumption = 0;
recovered_mana = 1;
mana_use_time = 40;
mana_recover_time = 400;
actType = 8;
isDamage = false;
isDamagedStatus = false;
offset = 1;
oldVx = 0;
shieldTimerisStop = false;
super();
IS_INVINCIBLITY = false;
USE_SKILL = false;
actType = (this.totalFrames / 4);
shieldTimer = new Timer(100, 20);
shieldTimer.addEventListener(TimerEvent.TIMER, flickerChar);
shieldTimer.addEventListener(TimerEvent.TIMER_COMPLETE, damageInit);
}
protected function damageInit(_arg1:TimerEvent):void{
isDamage = false;
}
public function specialSkill():void{
if (MANA > mana_consumption){
if (!USE_SKILL){
USE_SKILL = true;
if (mana_add_timer.running){
mana_add_timer.stop();
};
mana_use_timer.start();
};
} else {
initSkill();
};
}
public function damageFromEnermy(_arg1:AbstrectEnermy):void{
if (!isDamage){
isDamage = true;
isDamagedStatus = true;
HEALTH = (HEALTH - _arg1.damage);
HEALTH = ((HEALTH < 0)) ? 0 : HEALTH;
HEALTH_BAR.barLength = HEALTH;
if (HEALTH <= 0){
dead();
} else {
damaged();
};
};
}
public function get orderNum():uint{
return (_orderNum);
}
protected function dead():void{
dispatchEvent(new Event(AbstractCharacter.DEAD));
if (mana_add_timer.running){
mana_add_timer.stop();
};
if (mana_use_timer.running){
mana_use_timer.stop();
};
}
protected function flickerChar(_arg1:TimerEvent):void{
var _local2:GlowEffecter;
var _local3:BitmapFilter;
var _local4:Array;
if ((shieldTimer.currentCount % 2) == 1){
_local2 = new GlowEffecter(16751001, 1, 6);
_local3 = _local2.getBitmapFilter();
_local4 = new Array();
_local4.push(_local3);
this.filters = _local4;
} else {
filters = null;
};
}
public function setStatus(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Boolean):void{
var _local6:Boolean;
var _local7:uint;
var _local8:Number;
_local6 = (_arg2 > 0);
_local7 = 1;
if (HEALTH == 0){
_local7 = (_arg5) ? 8 : (8 + actType);
} else {
if (isDamagedStatus){
_local7 = (_arg5) ? 7 : (7 + actType);
} else {
if (!USE_SKILL){
if (_arg4){
_local7 = (_local6) ? (_arg5) ? 4 : (4 + actType) : (_arg5) ? 3 : (3 + actType);
} else {
_local7 = ((_arg1 == 0)) ? (_arg5) ? 1 : (1 + actType) : (_arg5) ? 2 : (2 + actType);
_local8 = Math.abs(_arg1);
if ((((((oldVx > _local8)) && ((_local8 > 0)))) && ((_local8 < 2)))){
_local7 = (_arg5) ? 5 : (5 + actType);
};
};
} else {
_local7 = (_arg5) ? 6 : (6 + actType);
};
};
};
if (_local7 != offset){
offset = _local7;
gotoAndStop(offset);
};
oldVx = _local8;
}
protected function recovery(_arg1:TimerEvent):void{
dispatchEvent(new Event(AbstractCharacter.RECOVERY));
shieldTimer.reset();
isDamagedStatus = false;
shieldTimer.start();
}
public function actStop():void{
if (mana_add_timer.running){
mana_add_timer.stop();
};
if (mana_use_timer.running){
mana_use_timer.stop();
};
if (shieldTimer.running){
shieldTimer.stop();
shieldTimerisStop = true;
};
gotoAndStop((currentFrame + (actType * 2)));
}
public function initSkill():void{
AbstractCharacter.IS_BREAK = (USE_SKILL = false);
if (mana_use_timer.running){
mana_use_timer.stop();
};
if (!mana_add_timer.running){
mana_add_timer.start();
};
}
protected function damaged():void{
var _local1:Timer;
_orderNum = 4;
dispatchEvent(new Event(AbstractCharacter.DAMAGED));
_local1 = new Timer(2000, 1);
_local1.addEventListener(TimerEvent.TIMER, recovery);
_local1.start();
}
public function setModel(_arg1:GameModel):void{
GAME_MODEL = _arg1;
}
public function isDamageToEnermy(_arg1:Number):Boolean{
return (((!(isDamagedStatus)) && (((AbstractCharacter.IS_INVINCIBLITY) || ((((GAME_MODEL.velocityY > 0)) && ((_arg1 > (y + charHeight)))))))));
}
public function actStart():void{
gotoAndStop((currentFrame - (actType * 2)));
if (shieldTimerisStop){
shieldTimer.start();
shieldTimerisStop = false;
};
initSkill();
}
public static function addCandy(_arg1:uint):void{
CNADIES = (CNADIES + _arg1);
if (CNADIES > 99){
CNADIES = (CNADIES - 100);
initManaHealth();
MANA_BAR.barLength = MANA;
HEALTH_BAR.barLength = HEALTH;
};
}
public static function addMana(_arg1:uint):void{
if ((MANA + _arg1) > 100){
MANA = 100;
} else {
MANA = (MANA + _arg1);
};
MANA_BAR.barLength = MANA;
}
public static function setManaBar(_arg1:PercentageBar):void{
MANA_BAR = _arg1;
MANA_BAR.barLength = MANA;
}
public static function get candy():uint{
return (CNADIES);
}
public static function addHealth(_arg1:uint):void{
if ((HEALTH + _arg1) > 100){
HEALTH = 100;
} else {
HEALTH = (HEALTH + _arg1);
};
HEALTH_BAR.barLength = HEALTH;
}
public static function setHealthBar(_arg1:PercentageBar):void{
HEALTH_BAR = _arg1;
HEALTH_BAR.barLength = HEALTH;
}
public static function initManaHealth():void{
MANA = 100;
HEALTH = 100;
}
public static function get CHARHEALTH():uint{
return (HEALTH);
}
}
}//package mvc.view
Section 60
//AbstrectEnermy (mvc.view.AbstrectEnermy)
package mvc.view {
import flash.events.*;
import flash.display.*;
import mvc.model.*;
import map.*;
import flash.utils.*;
public class AbstrectEnermy extends MovieClip {
protected var actType:uint;// = 3
protected var _xOffset:uint;
protected var isRight:Boolean;// = false
protected var charHeight:uint;// = 50
protected var _yOffset:uint;
protected var _gravity:Number;// = 0.5
protected var segment:uint;// = 0
protected var ay:Number;// = 0
protected var actTotalNum:uint;// = 3
protected var speed:Number;// = 2
protected var act_decision_interval:uint;// = 3000
protected var act_decision_timer:Timer;
protected var _damage:uint;
protected var vx:Number;// = 0
protected var vy:Number;// = 0
protected static const GRAVITY:Number = 0.5;
protected static const tileSize:uint = AbstrectMapView.tileSize;
protected static const tileHalfSize:uint = (tileSize * 0.5);
public static var CONTROLLER:Controller;
public static var CHARACTER:AbstractCharacter;
public static var MAP:ActiveObjectMapView;
public static var EVENT_CHECKER:TimeEventChecker;
public static var COLLECTION:StageTileCollection;
public function AbstrectEnermy(){
actType = 3;
actTotalNum = 3;
vx = 0;
vy = 0;
ay = 0;
segment = 0;
speed = 2;
isRight = false;
act_decision_interval = 3000;
charHeight = 50;
_gravity = 0.5;
super();
actType = (this.totalFrames / 4);
act_decision_timer = new Timer(act_decision_interval);
act_decision_timer.addEventListener(TimerEvent.TIMER, onActDecision);
addEventListener(Event.REMOVED_FROM_STAGE, removeListeners);
addListeners();
onActDecision();
}
protected function destroy():void{
var _local1:Timer;
EVENT_CHECKER.removeEventListener(Event.CHANGE, checkMoveHitCharacter);
act_decision_timer.removeEventListener(TimerEvent.TIMER, onActDecision);
MAP.setTileData(_xOffset, _yOffset, 0);
gotoAndStop((3 + (isRight) ? 0 : actType));
act_decision_timer.stop();
EVENT_CHECKER.removeEventListener(TimeEventChecker.STAGEOUT_CHECK, checkStageOutCharacter);
_local1 = new Timer(1500, 1);
_local1.addEventListener(TimerEvent.TIMER, removedStage);
_local1.start();
}
override public function set name(_arg1:String):void{
var _local2:Array;
_local2 = _arg1.split("_");
_xOffset = parseInt(_local2[0]);
_yOffset = parseInt(_local2[1]);
super.name = _arg1;
}
protected function removeListeners(_arg1:Event):void{
EVENT_CHECKER.removeEventListener(TimeEventChecker.STAGEOUT_CHECK, checkStageOutCharacter);
EVENT_CHECKER.removeEventListener(Event.CHANGE, checkMoveHitCharacter);
CONTROLLER.removeEventListener(Controller.STOP_GAME, activationStop);
CONTROLLER.removeEventListener(Controller.START_GAME, activationStart);
removeEventListener(Event.REMOVED_FROM_STAGE, removeListeners);
}
public function get xOffset():uint{
return (_xOffset);
}
protected function onActDecision(_arg1:TimerEvent=null):void{
var _local2:uint;
_local2 = ((Math.random() > 0.8)) ? 1 : 2;
if (_local2 == 1){
vx = 0;
} else {
vx = ((Math.random() > 0.5)) ? speed : -(speed);
isRight = ((vx > 0)) ? true : false;
};
gotoAndStop((_local2 + (isRight) ? 0 : actType));
}
protected function setReverseDirection():void{
if (vx != 0){
vx = (vx * -1);
isRight = ((vx > 0)) ? true : false;
gotoAndStop(((currentFrame % actType) + (isRight) ? 0 : actType));
};
}
protected function onMove():void{
throw (new Error("Override onMove"));
}
protected function checkStageOutCharacter(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = (x + MAP.x);
_local3 = (y + MAP.y);
if (((((((((_local2 + width) < 0)) || (((_local2 - width) > 550)))) || (((_local3 + charHeight) < 0)))) || (((_local3 - charHeight) > 500)))){
MAP.removeActiveObj(this);
};
}
public function get yOffset():uint{
return (_yOffset);
}
public function get damage():uint{
return (_damage);
}
protected function activationStart(_arg1:Event):void{
EVENT_CHECKER.addEventListener(Event.CHANGE, checkMoveHitCharacter);
EVENT_CHECKER.addEventListener(TimeEventChecker.STAGEOUT_CHECK, checkStageOutCharacter);
gotoAndStop((currentFrame - (actType * 2)));
act_decision_timer.start();
}
protected function checkMoveHitCharacter(_arg1:Event):void{
if (this.hitTestObject(CHARACTER)){
if (CHARACTER.isDamageToEnermy(y)){
CONTROLLER.killAfterEffect();
destroy();
} else {
CHARACTER.damageFromEnermy(this);
};
};
onMove();
}
protected function removedStage(_arg1:TimerEvent):void{
CONTROLLER.removeEventListener(Controller.STOP_GAME, activationStop);
CONTROLLER.removeEventListener(Controller.START_GAME, activationStart);
removeEventListener(Event.REMOVED_FROM_STAGE, removeListeners);
MAP.removeActiveObj(this);
}
protected function activationStop(_arg1:Event):void{
EVENT_CHECKER.removeEventListener(Event.CHANGE, checkMoveHitCharacter);
EVENT_CHECKER.removeEventListener(TimeEventChecker.STAGEOUT_CHECK, checkStageOutCharacter);
act_decision_timer.stop();
gotoAndStop((currentFrame + (actType * 2)));
}
protected function addListeners():void{
CONTROLLER.addEventListener(Controller.STOP_GAME, activationStop);
CONTROLLER.addEventListener(Controller.START_GAME, activationStart);
EVENT_CHECKER.addEventListener(Event.CHANGE, checkMoveHitCharacter);
EVENT_CHECKER.addEventListener(TimeEventChecker.STAGEOUT_CHECK, checkStageOutCharacter);
act_decision_timer.start();
}
}
}//package mvc.view
Section 61
//AbstrectMapView (mvc.view.AbstrectMapView)
package mvc.view {
import flash.display.*;
import mvc.model.*;
import map.*;
import flash.utils.*;
public class AbstrectMapView extends Sprite {
protected var _totalHeightTiles:uint;
protected var _tileImageMaker:AbstrectTileImage;
protected var oldYoffset:int;// = 0
protected var _collection:AbstractTileCollection;
protected var widthTiles:uint;
protected var _totalWidthTiles:uint;
protected var _totalWidth:uint;
protected var heightTiles:uint;
protected var _totalHeight:uint;
protected var oldXoffset:int;// = 0
public static const tileSize:uint = AbstractTileCollection.tileSize;
public function AbstrectMapView(_arg1:AbstrectTileImage){
oldXoffset = 0;
oldYoffset = 0;
super();
_tileImageMaker = _arg1;
}
public function drawAxisYUpTiles():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = Math.abs(Math.round((x / tileSize)));
_local2 = Math.abs(Math.round((y / tileSize)));
if (_local2 != oldYoffset){
if (_local1 > oldXoffset){
_local3 = _local1;
_local4 = oldXoffset;
} else {
_local3 = _local1;
_local4 = oldXoffset;
};
addHorizonTiles(_local3, _local2, _collection.getHorizonTileData(_local3, _local2, widthTiles));
_local5 = (_local2 + heightTiles);
if (_local5 < _totalHeightTiles){
removeHorizonTiles(_local4, _local5, _collection.getHorizonTileData(_local4, _local5, widthTiles));
};
oldYoffset = _local2;
};
}
protected function initMap(_arg1:AbstractTileCollection):void{
widthTiles = AbstractTileCollection.widthTiles;
heightTiles = AbstractTileCollection.heightTiles;
_totalWidth = (_arg1._horisonTileNum * tileSize);
_totalHeight = (_arg1._verticalTileNum * tileSize);
_totalWidthTiles = _arg1._horisonTileNum;
_totalHeightTiles = _arg1._verticalTileNum;
}
protected function initBuildMap(_arg1:AbstractTileCollection):void{
var _local2:uint;
var _local3:uint;
oldXoffset = _tileImageMaker.mapStartPoint.x;
oldYoffset = _tileImageMaker.mapStartPoint.y;
this.x = (this.x - (oldXoffset * tileSize));
this.y = (this.y - (oldYoffset * tileSize));
_local2 = (oldXoffset + widthTiles);
_local3 = oldXoffset;
while (_local3 < _local2) {
addVerticalTiles(_local3, oldYoffset, _arg1.getVerticalTileData(_local3, oldYoffset, heightTiles));
_local3++;
};
}
public function drawAxisXLeftMapTiles():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = Math.abs(Math.round((x / tileSize)));
_local2 = Math.abs(Math.round((y / tileSize)));
if (_local1 != oldXoffset){
if (_local2 > oldYoffset){
_local3 = _local2;
_local4 = oldYoffset;
} else {
_local3 = oldYoffset;
_local4 = _local2;
};
addVerticalTiles(_local1, _local3, _collection.getVerticalTileData(_local1, _local3, heightTiles));
_local5 = (widthTiles + _local1);
if (_local5 < _totalWidthTiles){
removeVerticalTiles(_local5, _local4, _collection.getVerticalTileData(_local5, _local4, heightTiles));
};
oldXoffset = _local1;
};
}
protected function removeTile(_arg1:DisplayObject):void{
removeChildAt(getChildIndex(_arg1));
_arg1 = null;
}
protected function removeHorizonTiles(_arg1:uint, _arg2:uint, _arg3:ByteArray):void{
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:DisplayObject;
_local4 = (_arg1 + _arg3.length);
_arg3.position = 0;
_local5 = _arg1;
while (_local5 < _local4) {
_local6 = _arg3.readByte();
if (Boolean(_local6)){
_local7 = getChildByName(((_local5 + "_") + _arg2));
if (_local7 != null){
removeTile(_local7);
};
};
_local5++;
};
}
public function drawAxisYDownTiles():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = Math.abs(Math.round((x / tileSize)));
_local2 = Math.abs(Math.round((y / tileSize)));
if (_local2 != oldYoffset){
if (_local1 > oldXoffset){
_local3 = _local1;
_local4 = oldXoffset;
} else {
_local3 = _local1;
_local4 = oldXoffset;
};
_local5 = (oldYoffset + heightTiles);
if (_local5 < _totalHeightTiles){
addHorizonTiles(_local3, _local5, _collection.getHorizonTileData(_local3, _local5, widthTiles));
removeHorizonTiles(_local4, oldYoffset, _collection.getHorizonTileData(_local4, oldYoffset, widthTiles));
};
oldYoffset = _local2;
};
}
protected function addVerticalTiles(_arg1:uint, _arg2:uint, _arg3:ByteArray):void{
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:int;
var _local9:DisplayObject;
_local4 = _arg3.length;
_arg3.position = 0;
_local5 = (_arg1 * tileSize);
_local6 = 0;
while (_local6 < _local4) {
_local7 = _arg3.readUnsignedByte();
_local8 = (_arg2 + _local6);
_local9 = getChildByName(((_arg1 + "_") + _local8));
if (((Boolean(_local7)) && ((_local9 == null)))){
addTile(_local5, (_local8 * tileSize), _local7, ((_arg1 + "_") + _local8));
};
_local6++;
};
}
public function drawAxisXRightMapTiles():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = Math.abs(Math.round((x / tileSize)));
_local2 = Math.abs(Math.round((y / tileSize)));
if (_local1 != oldXoffset){
if (_local2 > oldYoffset){
_local3 = _local2;
_local4 = oldYoffset;
} else {
_local3 = oldYoffset;
_local4 = _local2;
};
_local5 = (widthTiles + oldXoffset);
if (_local5 < _totalWidthTiles){
addVerticalTiles(_local5, _local3, _collection.getVerticalTileData(_local5, _local3, heightTiles));
removeVerticalTiles(oldXoffset, _local4, _collection.getVerticalTileData(oldXoffset, _local4, heightTiles));
};
oldXoffset = _local1;
};
}
public function get totalHeight():uint{
return (_totalHeight);
}
protected function removeVerticalTiles(_arg1:uint, _arg2:uint, _arg3:ByteArray):void{
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:DisplayObject;
_local4 = (_arg2 + _arg3.length);
_arg3.position = 0;
_local5 = _arg2;
while (_local5 < _local4) {
_local6 = _arg3.readByte();
if (Boolean(_local6)){
_local7 = getChildByName(((_arg1 + "_") + _local5));
if (_local7 != null){
removeTile(_local7);
};
};
_local5++;
};
}
public function get totalWidth():uint{
return (_totalWidth);
}
protected function addTile(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:String):void{
var _local5:DisplayObject;
_local5 = _tileImageMaker.getTileimage(_arg3);
_local5.x = _arg1;
_local5.y = _arg2;
_local5.name = _arg4;
addChild(_local5);
}
protected function addHorizonTiles(_arg1:uint, _arg2:uint, _arg3:ByteArray):void{
var _local4:uint;
var _local5:Number;
var _local6:uint;
var _local7:uint;
var _local8:DisplayObject;
_local4 = (_arg1 + _arg3.length);
_arg3.position = 0;
_local5 = (_arg2 * tileSize);
_local6 = _arg1;
while (_local6 < _local4) {
_local7 = _arg3.readUnsignedByte();
_local8 = getChildByName(((_local6 + "_") + _arg2));
if (((Boolean(_local7)) && ((_local8 == null)))){
addTile((_local6 * tileSize), _local5, _local7, ((_local6 + "_") + _arg2));
};
_local6++;
};
}
}
}//package mvc.view
Section 62
//ActiveObjectMapView (mvc.view.ActiveObjectMapView)
package mvc.view {
import flash.display.*;
import mvc.model.*;
import flash.utils.*;
public class ActiveObjectMapView extends AbstrectMapView {
public function ActiveObjectMapView(_arg1:MapLoadManager){
super(_arg1.active_tileImageMaker);
_collection = _arg1.activetile_collection;
initMap(_collection);
initBuildMap(_collection);
}
public function setTileData(_arg1:uint, _arg2:uint, _arg3:uint):void{
_collection.setTileData(_arg1, _arg2, _arg3);
}
override protected function removeHorizonTiles(_arg1:uint, _arg2:uint, _arg3:ByteArray):void{
}
public function get totalEnermy():uint{
return ((_collection as ActiveObjectTileCollection).totalEnermy);
}
override protected function removeVerticalTiles(_arg1:uint, _arg2:uint, _arg3:ByteArray):void{
}
public function removeActiveObj(_arg1:DisplayObject):void{
if (((this.contains(_arg1)) && (!((_arg1 == null))))){
removeChildAt(getChildIndex(_arg1));
_arg1 = null;
};
}
}
}//package mvc.view
Section 63
//BackgroundMapView (mvc.view.BackgroundMapView)
package mvc.view {
import mvc.model.*;
public class BackgroundMapView extends AbstrectMapView {
private var map_limit_y:int;
private var map_limit_x:int;
private var limit_YPos:int;// = 0
private var limit_XPos:int;// = 0
public function BackgroundMapView(_arg1:MapLoadManager){
limit_XPos = 0;
limit_YPos = 0;
super(_arg1.bg_tileImageMaker);
_collection = _arg1.bgtile_collection;
initMap(_collection);
initBuildMap(_collection);
map_limit_x = (0x0200 - _totalWidth);
map_limit_y = (448 - _totalHeight);
}
public function set addY(_arg1:Number):void{
_arg1 = (_arg1 + y);
y = ((_arg1 > 0)) ? 0 : ((_arg1 < map_limit_y)) ? map_limit_y : _arg1;
}
public function set addX(_arg1:Number):void{
_arg1 = (_arg1 + x);
x = ((_arg1 > 0)) ? 0 : ((_arg1 < map_limit_x)) ? map_limit_x : _arg1;
}
}
}//package mvc.view
Section 64
//CandyNumDisplayer (mvc.view.CandyNumDisplayer)
package mvc.view {
import component.*;
import flash.display.*;
public class CandyNumDisplayer extends Sprite {
private var digit_sprite:NumberSprite;
private var decimal_sprite:NumberSprite;
private var candy_sprite:CandySprite;
public function CandyNumDisplayer(){
candy_sprite = new CandySprite();
candy_sprite.x = 0;
candy_sprite.y = 0;
decimal_sprite = new NumberSprite();
digit_sprite = new NumberSprite();
decimal_sprite.x = 35;
digit_sprite.x = (decimal_sprite.x + decimal_sprite.width);
decimal_sprite.y = (digit_sprite.y = 6);
digit_sprite.gotoAndStop(10);
addChild(candy_sprite);
addChild(digit_sprite);
count(AbstractCharacter.candy);
}
private function count(_arg1:uint):void{
var _local2:uint;
var _local3:uint;
_local2 = (_arg1 % 10);
_local2 = (((_arg1 % 10) == 0)) ? 10 : _local2;
_local3 = Math.floor((_arg1 / 10));
digit_sprite.gotoAndStop(_local2);
if (_local3 > 0){
if (this.numChildren == 2){
addChild(decimal_sprite);
};
decimal_sprite.gotoAndStop(_local3);
} else {
if (this.numChildren == 3){
removeChild(decimal_sprite);
};
};
}
public function reflashCandyNumDisplay():void{
count(AbstractCharacter.candy);
}
}
}//package mvc.view
Section 65
//CharChangeDisplayer (mvc.view.CharChangeDisplayer)
package mvc.view {
import flash.events.*;
import flash.display.*;
import util.*;
import flash.filters.*;
import effect.*;
public class CharChangeDisplayer extends Sprite {
private var color_list:Array;
private var BgImg:Class;
private var select_offset:int;
private var MoonRabbitImg:Class;
private var sound_manager:SoundManager;
private var YojoImg:Class;
private var char_list:Array;
private var MoonBoyImg:Class;
public static const KEY_PRESS:String = "choose_char";
public static const CHOOSE_CHAR:String = "choose_char";
public function CharChangeDisplayer(_arg1:Stage, _arg2:uint, _arg3:SoundManager){
var _local4:Sprite;
var _local5:Bitmap;
var _local6:Sprite;
var _local7:Bitmap;
var _local8:Sprite;
var _local9:Bitmap;
var _local10:Sprite;
BgImg = CharChangeDisplayer_BgImg;
YojoImg = CharChangeDisplayer_YojoImg;
MoonBoyImg = CharChangeDisplayer_MoonBoyImg;
MoonRabbitImg = CharChangeDisplayer_MoonRabbitImg;
super();
char_list = new Array(3);
color_list = new Array(0xFFFF, 16733525, 0xFFFF00);
_local4 = new Sprite();
_local4.addChild((new BgImg() as Bitmap));
_local5 = (new YojoImg() as Bitmap);
_local6 = new Sprite();
_local6.addChild(_local5);
_local6.x = 8;
char_list[1] = _local6;
_local7 = (new MoonBoyImg() as Bitmap);
_local8 = new Sprite();
_local8.addChild(_local7);
_local8.x = (_local6.x + 40);
char_list[2] = _local8;
_local9 = (new MoonRabbitImg() as Bitmap);
_local10 = new Sprite();
_local10.addChild(_local9);
_local10.x = (_local8.x + 40);
char_list[0] = _local10;
_local6.y = (_local8.y = (_local10.y = 8));
addChild(_local4);
addChild(_local6);
addChild(_local8);
addChild(_local10);
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, onSelectChar);
select_offset = _arg2;
setGlow(char_list[select_offset], select_offset);
this.sound_manager = _arg3;
}
private function getRectBox(_arg1:uint, _arg2:uint=32, _arg3:uint=32):Sprite{
var _local4:Sprite;
_local4 = new Sprite();
_local4.graphics.beginFill(_arg1);
_local4.graphics.drawRect(0, 0, _arg2, _arg3);
_local4.graphics.endFill();
return (_local4);
}
private function setGlow(_arg1:Sprite, _arg2:uint):void{
var _local3:GlowEffecter;
var _local4:BitmapFilter;
var _local5:Array;
_local3 = new GlowEffecter(color_list[_arg2], 1);
_local3.strength = 6;
_local3.thickness = 6;
_local4 = _local3.getBitmapFilter();
_local5 = new Array();
_local5.push(_local4);
_arg1.filters = _local5;
}
public function remove():void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onSelectChar);
}
private function onSelectChar(_arg1:KeyboardEvent):void{
var _local2:uint;
if (_arg1.keyCode == 67){
char_list[(select_offset % 3)].filters = null;
select_offset++;
_local2 = (select_offset % 3);
setGlow(char_list[_local2], _local2);
sound_manager.onSoundPlayAt(6);
} else {
if (_arg1.keyCode == 13){
this.dispatchEvent(new Event(CharChangeDisplayer.CHOOSE_CHAR));
sound_manager.onSoundPlayAt(6);
};
};
}
public function get chooseNum():uint{
return ((select_offset % 3));
}
}
}//package mvc.view
Section 66
//CharChangeDisplayer_BgImg (mvc.view.CharChangeDisplayer_BgImg)
package mvc.view {
import mx.core.*;
public class CharChangeDisplayer_BgImg extends BitmapAsset {
}
}//package mvc.view
Section 67
//CharChangeDisplayer_MoonBoyImg (mvc.view.CharChangeDisplayer_MoonBoyImg)
package mvc.view {
import mx.core.*;
public class CharChangeDisplayer_MoonBoyImg extends BitmapAsset {
}
}//package mvc.view
Section 68
//CharChangeDisplayer_MoonRabbitImg (mvc.view.CharChangeDisplayer_MoonRabbitImg)
package mvc.view {
import mx.core.*;
public class CharChangeDisplayer_MoonRabbitImg extends BitmapAsset {
}
}//package mvc.view
Section 69
//CharChangeDisplayer_YojoImg (mvc.view.CharChangeDisplayer_YojoImg)
package mvc.view {
import mx.core.*;
public class CharChangeDisplayer_YojoImg extends BitmapAsset {
}
}//package mvc.view
Section 70
//EffectView (mvc.view.EffectView)
package mvc.view {
import component.*;
import flash.events.*;
import flash.display.*;
import mvc.model.*;
public class EffectView extends Sprite {
private var _itemEffectManager:ItemEffectManager;
private var GoldIMG:Class;
private var _char:AbstractCharacter;
private var PurpleIMG:Class;
private var target:Sprite;
private var RedIMG:Class;
private var BlueIMG:Class;
public function EffectView(){
BlueIMG = EffectView_BlueIMG;
GoldIMG = EffectView_GoldIMG;
PurpleIMG = EffectView_PurpleIMG;
RedIMG = EffectView_RedIMG;
super();
this.target = target;
}
private function showRedEffect(_arg1:Event):void{
var _local2:Twister;
_local2 = new Twister(this, RedIMG, getX(), getY(), 1.0002, 0.1, 0);
}
public function set itemEffectManager(_arg1:ItemEffectManager):void{
this._itemEffectManager = _arg1;
_itemEffectManager.addEventListener(ItemEffectManager.BLUE_EFFECT, showBlueEffect);
_itemEffectManager.addEventListener(ItemEffectManager.GOLD_EFFECT, showGoldEffect);
_itemEffectManager.addEventListener(ItemEffectManager.PURPLE_EFFECT, showPurpleEffect);
_itemEffectManager.addEventListener(ItemEffectManager.RED_EFFECT, showRedEffect);
}
private function showPurpleEffect(_arg1:Event):void{
var _local2:Twister;
_local2 = new Twister(this, PurpleIMG, getX(), getY(), 1, 3, 10);
}
private function showBlueEffect(_arg1:Event):void{
var _local2:Twister;
_local2 = new Twister(this, BlueIMG, getX(), getY(), 1, -3, 10);
}
public function set char(_arg1:AbstractCharacter):void{
this._char = _arg1;
}
private function getX():Number{
return (_char.x);
}
private function getY():Number{
return ((_char.y + (_char.height * 0.5)));
}
private function showGoldEffect(_arg1:Event):void{
var _local2:Twister;
_local2 = new Twister(this, GoldIMG, getX(), getY(), 1.0006, -6, 20);
}
}
}//package mvc.view
Section 71
//EffectView_BlueIMG (mvc.view.EffectView_BlueIMG)
package mvc.view {
import mx.core.*;
public class EffectView_BlueIMG extends BitmapAsset {
}
}//package mvc.view
Section 72
//EffectView_GoldIMG (mvc.view.EffectView_GoldIMG)
package mvc.view {
import mx.core.*;
public class EffectView_GoldIMG extends BitmapAsset {
}
}//package mvc.view
Section 73
//EffectView_PurpleIMG (mvc.view.EffectView_PurpleIMG)
package mvc.view {
import mx.core.*;
public class EffectView_PurpleIMG extends BitmapAsset {
}
}//package mvc.view
Section 74
//EffectView_RedIMG (mvc.view.EffectView_RedIMG)
package mvc.view {
import mx.core.*;
public class EffectView_RedIMG extends BitmapAsset {
}
}//package mvc.view
Section 75
//FrontBackgroundMapView (mvc.view.FrontBackgroundMapView)
package mvc.view {
import mvc.model.*;
public class FrontBackgroundMapView extends AbstrectMapView {
private var map_limit_y:int;
private var map_limit_x:int;
private var limit_YPos:int;// = 0
private var limit_XPos:int;// = 0
public function FrontBackgroundMapView(_arg1:MapLoadManager){
limit_XPos = 0;
limit_YPos = 0;
super(_arg1.front_bg_tileImageMaker);
_collection = _arg1.front_bgtile_collection;
initMap(_collection);
initBuildMap(_collection);
map_limit_x = (0x0200 - _totalWidth);
map_limit_y = (448 - _totalHeight);
}
public function set addX(_arg1:Number):void{
_arg1 = (_arg1 + x);
x = ((_arg1 > 0)) ? 0 : ((_arg1 < map_limit_x)) ? map_limit_x : _arg1;
}
}
}//package mvc.view
Section 76
//Moonboy (mvc.view.Moonboy)
package mvc.view {
import flash.events.*;
import flash.utils.*;
public class Moonboy extends AbstractCharacter {
private var special_speedX:Number;// = 0.4
public function Moonboy(){
special_speedX = 0.4;
super();
speedX = 0.5;
slope_speedX = 0.5;
speedY = 10;
charHeight = 60;
mana_consumption = 4;
killingEffectJump = -5;
mana_use_time = 30;
gotoAndStop(1);
mana_add_timer = new Timer(mana_recover_time);
mana_add_timer.addEventListener(TimerEvent.TIMER, autoAddMana);
mana_use_timer = new Timer(mana_use_time);
mana_use_timer.addEventListener(TimerEvent.TIMER, autoUseMana);
}
private function autoUseMana(_arg1:TimerEvent):void{
if (MANA > mana_consumption){
MANA = (MANA - mana_consumption);
GAME_MODEL.velocityX = special_speedX;
MANA_BAR.barLength = MANA;
IS_BREAK = (IS_INVINCIBLITY = true);
} else {
initSkill();
};
}
private function autoAddMana(_arg1:TimerEvent):void{
if (MANA < 100){
MANA = (MANA + recovered_mana);
MANA_BAR.barLength = MANA;
IS_BREAK = (IS_INVINCIBLITY = false);
} else {
mana_add_timer.stop();
};
}
}
}//package mvc.view
Section 77
//Moonrabbit (mvc.view.Moonrabbit)
package mvc.view {
import flash.events.*;
import flash.utils.*;
public class Moonrabbit extends AbstractCharacter {
private var special_speedX:Number;// = 1
public function Moonrabbit(){
special_speedX = 1;
super();
speedX = 0.4;
slope_speedX = 0.3;
speedY = 10;
charHeight = 60;
mana_consumption = 2;
killingEffectJump = -5;
mana_use_time = 30;
gotoAndStop(1);
mana_add_timer = new Timer(mana_recover_time);
mana_add_timer.addEventListener(TimerEvent.TIMER, autoAddMana);
mana_use_timer = new Timer(mana_use_time);
mana_use_timer.addEventListener(TimerEvent.TIMER, autoUseMana);
}
private function autoUseMana(_arg1:TimerEvent):void{
if (MANA > mana_consumption){
MANA = (MANA - mana_consumption);
GAME_MODEL.velocityX = special_speedX;
MANA_BAR.barLength = MANA;
IS_INVINCIBLITY = true;
} else {
initSkill();
};
}
private function autoAddMana(_arg1:TimerEvent):void{
if (MANA < 100){
MANA = (MANA + recovered_mana);
MANA_BAR.barLength = MANA;
IS_INVINCIBLITY = false;
} else {
mana_add_timer.stop();
};
}
}
}//package mvc.view
Section 78
//StageMapView (mvc.view.StageMapView)
package mvc.view {
import mvc.model.*;
public class StageMapView extends AbstrectMapView {
public function StageMapView(_arg1:MapLoadManager){
super(_arg1.stage_tileImageMaker);
_collection = _arg1.stagetile_collection;
initMap(_collection);
initBuildMap(_collection);
}
}
}//package mvc.view
Section 79
//Yojo (mvc.view.Yojo)
package mvc.view {
import flash.events.*;
import flash.utils.*;
public class Yojo extends AbstractCharacter {
private var special_speedY:Number;// = 1.2
public function Yojo(){
special_speedY = 1.2;
super();
speedX = 0.6;
slope_speedX = 0.3;
speedY = 11;
charHeight = 60;
mana_consumption = 7;
killingEffectJump = -8;
mana_use_time = 30;
gotoAndStop(1);
mana_add_timer = new Timer(mana_recover_time);
mana_add_timer.addEventListener(TimerEvent.TIMER, autoAddMana);
mana_use_timer = new Timer(mana_use_time);
mana_use_timer.addEventListener(TimerEvent.TIMER, autoUseMana);
}
private function autoUseMana(_arg1:TimerEvent):void{
if (MANA > mana_consumption){
MANA = (MANA - mana_consumption);
GAME_MODEL.velocityY = special_speedY;
MANA_BAR.barLength = MANA;
} else {
initSkill();
};
}
private function autoAddMana(_arg1:TimerEvent):void{
if (MANA < 100){
MANA = (MANA + recovered_mana);
MANA_BAR.barLength = MANA;
} else {
mana_add_timer.stop();
};
}
}
}//package mvc.view
Section 80
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "2.0.1.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 81
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "2.0.1.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 82
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "2.0.1.0";
}
}//package mx.core
Section 83
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 84
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function set height(_arg1:Number):void;
function get scaleY():Number;
function move(_arg1:Number, _arg2:Number):void;
function get scaleX():Number;
function set mask(_arg1:DisplayObject):void;
function set scaleX(_arg1:Number):void;
function set name(_arg1:String):void;
function set scaleY(_arg1:Number):void;
function get visible():Boolean;
function get measuredWidth():Number;
function set visible(_arg1:Boolean):void;
function get alpha():Number;
function get height():Number;
function get width():Number;
function get parent():DisplayObjectContainer;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set y(_arg1:Number):void;
function get x():Number;
function get y():Number;
function set alpha(_arg1:Number):void;
}
}//package mx.core
Section 85
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function get repeaters():Array;
function get instanceIndices():Array;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 86
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 87
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "2.0.1.0";
}
}//package mx.core
Section 88
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import flash.utils.*;
import mx.core.*;
public class NameUtil {
mx_internal static const VERSION:String = "2.0.1.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local3:DisplayObject;
var _local4:String;
var _local5:Array;
_local3 = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
var _local2:String;
var _local3:int;
var _local4:int;
if (!_arg1){
return (null);
};
_local2 = getQualifiedClassName(_arg1);
_local3 = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
_local4 = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 89
//GameOverMassage (pages.msgsprite.GameOverMassage)
package pages.msgsprite {
import flash.display.*;
import pages.*;
public class GameOverMassage extends AbstractMassage {
private var MsgImage:Class;
public function GameOverMassage(){
MsgImage = GameOverMassage_MsgImage;
super((new MsgImage() as Bitmap), 150);
}
}
}//package pages.msgsprite
Section 90
//GameOverMassage_MsgImage (pages.msgsprite.GameOverMassage_MsgImage)
package pages.msgsprite {
import mx.core.*;
public class GameOverMassage_MsgImage extends BitmapAsset {
}
}//package pages.msgsprite
Section 91
//AbstractExplainPage (pages.AbstractExplainPage)
package pages {
import flash.display.*;
public class AbstractExplainPage extends Sprite implements IActivate {
public function stopActivate():void{
throw (new Error("AbstractExplainPage stopActivate 오버라이드 해라"));
}
public function deactivate():void{
throw (new Error("AbstractExplainPage deactivate 오버라이드 해라"));
}
public function activate():void{
throw (new Error("AbstractExplainPage activate 오버라이드 해라"));
}
}
}//package pages
Section 92
//AbstractFrontPage (pages.AbstractFrontPage)
package pages {
import flash.display.*;
public class AbstractFrontPage extends Sprite implements IActivate {
public static const SHOW_STAGE_MAP:String = "show_stage_map";
public static const SHOW_EXPLAIN:String = "show_explain";
public function stopActivate():void{
throw (new Error("AbstractFrontPage stopActivate 오버라이드 해라"));
}
public function deactivate():void{
throw (new Error("AbstractFrontPage deactivate 오버라이드 해라"));
}
public function activate():void{
throw (new Error("AbstractFrontPage activate 오버라이드 해라"));
}
}
}//package pages
Section 93
//AbstractMassage (pages.AbstractMassage)
package pages {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class AbstractMassage extends Sprite {
private var timer:Timer;
private var image:Bitmap;
private var targetY:Number;
public function AbstractMassage(_arg1:Bitmap, _arg2:int){
this.image = _arg1;
targetY = _arg2;
image.x = ((0x0200 - image.width) * 0.5);
image.y = -(image.height);
timer = new Timer(30);
timer.addEventListener(TimerEvent.TIMER, onMove);
}
private function onMove(_arg1:TimerEvent):void{
var _local2:Number;
_local2 = ((targetY - image.y) * 0.8);
image.y = (image.y + _local2);
if (Math.abs(_local2) < 1){
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, onMove);
timer = null;
image.y = targetY;
};
}
public function start():void{
addChild(image);
timer.start();
}
}
}//package pages
Section 94
//AbstractResultPage (pages.AbstractResultPage)
package pages {
import component.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import mvc.model.*;
import map.*;
import flash.utils.*;
public class AbstractResultPage extends Sprite implements IActivate {
protected var pd_list:Array;
protected var counter:uint;// = 0
protected var bg_channel:SoundChannel;
protected var smallCandyPD:PercentageDisplayer;
protected var initStartTime:uint;
protected var small_candy:SmallCandySymbol;
protected var enermy_symbol:EnermySymbol;
protected var _dancer:MovieClip;
protected var red_heart:RedHeart;
protected var healthPD:PercentageDisplayer;
protected var big_candy:BigCandySymbol;
protected var startTime:uint;
protected var bg_sound:Sound;
protected var soundtimer:Timer;
protected var duration:uint;
protected var _target:Sprite;
protected var _msg:AbstractMassage;
protected var enermyPD:PercentageDisplayer;
protected var frame_manager:FrameNumberManager;
protected var bigCandyPD:PercentageDisplayer;
public static const ADD_NEXT_BTN:String = "add_next_btn";
public function AbstractResultPage(_arg1:Sprite, _arg2:AbstractMassage, _arg3:MovieClip, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint, _arg8:Class){
var _local9:int;
var _local10:int;
var _local11:uint;
var _local12:uint;
counter = 0;
super();
AbstractAnimateTile.FRAME_MANAGER = (frame_manager = new FrameNumberManager());
frame_manager.start();
big_candy = new BigCandySymbol();
small_candy = new SmallCandySymbol();
enermy_symbol = new EnermySymbol();
red_heart = new RedHeart();
red_heart.x = (red_heart.x - 3);
red_heart.scaleY = (red_heart.scaleX = 1.5);
bg_sound = (new (_arg8) as Sound);
_target = _arg1;
_msg = _arg2;
_dancer = _arg3;
_dancer.x = 150;
_dancer.y = 300;
_local9 = 0;
_local10 = 65;
_local11 = 170;
_local12 = 280;
pd_list = new Array(4);
pd_list[0] = (bigCandyPD = new PercentageDisplayer(big_candy, _arg4, _local12, _local11));
++_local9;
pd_list[1] = (smallCandyPD = new PercentageDisplayer(small_candy, _arg5, _local12, (_local11 + (_local10 * _local9))));
++_local9;
pd_list[2] = (enermyPD = new PercentageDisplayer(enermy_symbol, _arg6, _local12, (_local11 + (_local10 * _local9))));
++_local9;
pd_list[3] = (healthPD = new PercentageDisplayer(red_heart, _arg7, _local12, (_local11 + (_local10 * _local9))));
}
public function stopActivate():void{
removeChild(_dancer);
_dancer = null;
frame_manager.stop();
soundtimer.stop();
bg_channel.stop();
}
private function setVolume(_arg1:SoundChannel, _arg2:Number):void{
var _local3:SoundTransform;
_local3 = _arg1.soundTransform;
_local3.volume = _arg2;
_arg1.soundTransform = _local3;
}
private function playBGmusic():void{
var _local1:Timer;
soundtimer = new Timer(duration);
soundtimer.addEventListener(TimerEvent.TIMER, repeatBgMusic);
soundtimer.start();
_local1 = new Timer(initStartTime, 1);
_local1.addEventListener(TimerEvent.TIMER, repeatBgMusic);
_local1.start();
}
public function deactivate():void{
var _local1:AbstractResultPage;
removeChild(bigCandyPD);
removeChild(smallCandyPD);
removeChild(enermyPD);
removeChild(healthPD);
removeChild(_msg);
_local1 = this;
_target.removeChild(_local1);
_local1 = null;
}
private function showPercentage(_arg1:TimerEvent):void{
var _local2:PercentageDisplayer;
_local2 = pd_list[counter];
addChild(_local2);
_local2.start();
counter++;
}
private function showResultMsg(_arg1:TimerEvent):void{
addChild(_msg);
_msg.start();
this.dispatchEvent(new Event(AbstractResultPage.ADD_NEXT_BTN));
}
private function repeatBgMusic(_arg1:TimerEvent):void{
bg_channel = bg_sound.play(startTime);
setVolume(bg_channel, 0.6);
}
public function activate():void{
var _local1:Timer;
var _local2:Timer;
addChild(_dancer);
_local1 = new Timer(800, 4);
_local1.addEventListener(TimerEvent.TIMER, showPercentage);
_local1.start();
_local2 = new Timer(5000, 1);
_local2.addEventListener(TimerEvent.TIMER, showResultMsg);
_local2.start();
playBGmusic();
}
}
}//package pages
Section 95
//AbstractStageMap (pages.AbstractStageMap)
package pages {
import flash.display.*;
public class AbstractStageMap extends Sprite implements IActivate {
public static const BUILD_STAGE:String = "build_stage";
public function stopActivate():void{
throw (new Error("AbstractStageMap stopActivate 오버라이드 해라"));
}
public function deactivate():void{
throw (new Error("AbstractStageMap deactivate 오버라이드 해라"));
}
public function activate():void{
throw (new Error("AbstractStageMap activate 오버라이드 해라"));
}
}
}//package pages
Section 96
//AbstrectMovie (pages.AbstrectMovie)
package pages {
import flash.display.*;
public class AbstrectMovie extends Sprite implements IActivate {
public function stopActivate():void{
throw (new Error("AbstrectMovie stopActivate 오버라이드 해라"));
}
public function deactivate():void{
throw (new Error("AbstrectMovie deactivate 오버라이드 해라"));
}
public function activate():void{
throw (new Error("AbstrectMovie activate 오버라이드 해라"));
}
}
}//package pages
Section 97
//PercentageDisplayer (pages.PercentageDisplayer)
package pages {
import component.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class PercentageDisplayer extends Sprite {
private var timer:Timer;
private var _percentage:uint;
private var _image:DisplayObject;
private var PercentImg:Class;
private var _percentageSprite:PolyNumber;
private var _targetX:int;
public function PercentageDisplayer(_arg1:DisplayObject, _arg2:uint, _arg3:int, _arg4:int){
var _local5:Bitmap;
PercentImg = PercentageDisplayer_PercentImg;
super();
_image = _arg1;
_percentage = _arg2;
_percentageSprite = new PolyNumber(0, 3, 28, AniNumberSprite, 60, 0);
_targetX = _arg3;
_local5 = (new PercentImg() as Bitmap);
_local5.x = (_percentageSprite.x + 85);
_local5.y = (_local5.y - 8);
addChild(_local5);
this.x = (0x0200 + this.width);
this.y = _arg4;
timer = new Timer(30);
timer.addEventListener(TimerEvent.TIMER, onMove);
}
public function stop():void{
timer.stop();
}
private function onMove(_arg1:TimerEvent):void{
var _local2:Number;
_local2 = ((_targetX - x) * 0.8);
x = (x + _local2);
if (Math.abs(_local2) < 1){
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, onMove);
timer = null;
x = _targetX;
_percentageSprite.setNumerToNumbers(_percentage);
};
}
public function start():void{
addChild(_image);
addChild(_percentageSprite);
timer.start();
}
}
}//package pages
Section 98
//PercentageDisplayer_PercentImg (pages.PercentageDisplayer_PercentImg)
package pages {
import mx.core.*;
public class PercentageDisplayer_PercentImg extends BitmapAsset {
}
}//package pages
Section 99
//GlowEffecter (util.GlowEffecter)
package util {
import flash.filters.*;
public class GlowEffecter {
private var _strength:uint;
private var _color:uint;
private var _thickness:uint;
private var _alpha:Number;
public function GlowEffecter(_arg1:uint=0xFFFFFF, _arg2:Number=0.9, _arg3:uint=5, _arg4:uint=8){
_color = _arg1;
_alpha = _arg2;
_thickness = _arg3;
_strength = _arg4;
}
public function set strength(_arg1:uint):void{
_strength = _arg1;
}
public function set color(_arg1:uint):void{
_color = _arg1;
}
public function set thickness(_arg1:uint):void{
_thickness = _arg1;
}
public function set alpha(_arg1:Number):void{
_alpha = _arg1;
}
public function getBitmapFilter():BitmapFilter{
return (new GlowFilter(_color, _alpha, _thickness, _thickness, _strength, BitmapFilterQuality.MEDIUM, false, false));
}
}
}//package util
Section 100
//HangulTextField (util.HangulTextField)
package util {
import flash.text.*;
public class HangulTextField {
private var fontFromSWF:Class;
private var yOffset:uint;// = 0
private var toggleSWFFont:String;// = "포티니트8"
private static var _instance:HangulTextField = null;
public function HangulTextField(){
fontFromSWF = HangulTextField_fontFromSWF;
toggleSWFFont = "포티니트8";
yOffset = 0;
super();
}
public function getTextBox(_arg1:String, _arg2:uint, _arg3:uint, _arg4:uint=0, _arg5:Number=0, _arg6:Number=0, _arg7:uint=12, _arg8:Boolean=false):TextField{
var _local9:TextFormat;
var _local10:TextField;
_local9 = new TextFormat();
_local9.font = toggleSWFFont;
_local9.color = _arg4;
_local9.size = _arg7;
_local9.bold = _arg8;
_local10 = new TextField();
_local10.x = _arg5;
_local10.y = _arg6;
_local10.width = _arg2;
_local10.height = _arg3;
_local10.embedFonts = true;
_local10.defaultTextFormat = _local9;
_local10.antiAliasType = AntiAliasType.ADVANCED;
_local10.autoSize = TextFieldAutoSize.LEFT;
_local10.selectable = false;
_local10.background = false;
_local10.border = false;
_local10.multiline = true;
_local10.wordWrap = true;
_local10.text = _arg1;
return (_local10);
}
public function getTextField(_arg1:String, _arg2:uint=0, _arg3:Number=0, _arg4:Number=0, _arg5:uint=12, _arg6:Boolean=false):TextField{
var _local7:TextFormat;
var _local8:TextField;
_local7 = new TextFormat();
_local7.font = toggleSWFFont;
_local7.color = _arg2;
_local7.size = _arg5;
_local7.bold = _arg6;
_local8 = new TextField();
_local8.embedFonts = true;
_local8.defaultTextFormat = _local7;
_local8.antiAliasType = AntiAliasType.ADVANCED;
_local8.autoSize = TextFieldAutoSize.LEFT;
_local8.selectable = false;
_local8.text = _arg1;
_local8.x = _arg3;
_local8.y = _arg4;
return (_local8);
}
public function getInputTextField(_arg1:String, _arg2:uint=0, _arg3:Number=0, _arg4:Number=0, _arg5:uint=12, _arg6:Boolean=false):TextField{
var _local7:TextFormat;
var _local8:TextField;
_local7 = new TextFormat();
_local7.font = toggleSWFFont;
_local7.color = _arg2;
_local7.size = _arg5;
_local7.bold = _arg6;
_local8 = new TextField();
_local8.embedFonts = true;
_local8.type = TextFieldType.INPUT;
_local8.defaultTextFormat = _local7;
_local8.antiAliasType = AntiAliasType.ADVANCED;
_local8.autoSize = TextFieldAutoSize.LEFT;
_local8.selectable = true;
_local8.text = _arg1;
_local8.x = _arg3;
_local8.y = _arg4;
return (_local8);
}
public static function getInstance():HangulTextField{
if (HangulTextField._instance == null){
HangulTextField._instance = new (HangulTextField);
};
return (HangulTextField._instance);
}
}
}//package util
Section 101
//HangulTextField_fontFromSWF (util.HangulTextField_fontFromSWF)
package util {
import mx.core.*;
public class HangulTextField_fontFromSWF extends FontAsset {
}
}//package util
Section 102
//NodeSaver (util.NodeSaver)
package util {
import flash.net.*;
public class NodeSaver {
private var offset_str:String;
private var offsetShareObj:SharedObject;
public function NodeSaver(){
offsetShareObj = SharedObject.getLocal("yojoWonderland");
if (offsetShareObj.data.stage == null){
offset_str = (offsetShareObj.data.stage = "1");
offsetShareObj.flush();
};
if (offset_str == null){
offset_str = "1";
writeStageOffset = offset_str;
};
}
public function get readStageOffset():String{
return (offset_str);
}
public function set writeStageOffset(_arg1:String):void{
offset_str = (offsetShareObj.data.stage = _arg1);
offsetShareObj.flush();
}
public function removeStageOffset():void{
offsetShareObj.clear();
}
}
}//package util
Section 103
//NumberUtilities (util.NumberUtilities)
package util {
public class NumberUtilities {
private static var _aUniqueIDs:Array;
public static function random(_arg1:Number, _arg2:Number=0, _arg3:Number=1):Number{
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
_local4 = ((_arg2 - _arg1) + (1 * _arg3));
_local5 = (Math.random() * _local4);
_local5 = (_local5 + _arg1);
return (floor(_local5, _arg3));
}
public static function ceil(_arg1:Number, _arg2:Number=1):Number{
return ((Math.ceil((_arg1 / _arg2)) * _arg2));
}
public static function getUnique():Number{
var _local1:Date;
var _local2:Number;
if (_aUniqueIDs == null){
_aUniqueIDs = new Array();
};
_local1 = new Date();
_local2 = _local1.getTime();
while (!(isUnique(_local2))) {
_local2 = (_local2 + NumberUtilities.random(_local1.getTime(), (2 * _local1.getTime())));
};
_aUniqueIDs.push(_local2);
return (_local2);
}
private static function isUnique(_arg1:Number):Boolean{
var _local2:Number;
_local2 = 0;
while (_local2 < _aUniqueIDs.length) {
if (_aUniqueIDs[_local2] == _arg1){
return (false);
};
_local2++;
};
return (true);
}
public static function floor(_arg1:Number, _arg2:Number=1):Number{
return ((Math.floor((_arg1 / _arg2)) * _arg2));
}
public static function simpleRandom(_arg1:int):int{
return (Math.floor((Math.random() * _arg1)));
}
public static function round(_arg1:Number, _arg2:Number=1):Number{
return ((Math.round((_arg1 / _arg2)) * _arg2));
}
}
}//package util
Section 104
//GameMain (GameMain)
package {
import component.*;
import flash.events.*;
import flash.display.*;
import mvc.view.*;
import mvc.model.*;
import map.*;
import effect.*;
import pages.msgsprite.*;
public class GameMain extends Sprite implements IActivate {
private var hit_checker:TimeEventChecker;
private var map_load_manager:MapLoadManager;
private var char:AbstractCharacter;
private var sound_manager:SoundManager;
private var candy_displayer:CandyNumDisplayer;
private var effect_view:EffectView;
private var stagemap_view:StageMapView;
private var Rect1:Class;
private var Rect3:Class;
private var _target:Sprite;
private var Rect0:Class;
private var item_effect_manager:ItemEffectManager;
private var activemap_view:ActiveObjectMapView;
private var controller:Controller;
private var char_offset:uint;// = 1
private var frame_number_manager:FrameNumberManager;
private var game_model:GameModel;
private var Rect2:Class;
private var bgmap_view:BackgroundMapView;
private var frontBgmap_view:FrontBackgroundMapView;
private var _stage:Stage;
public static const SHOW_STAGEMAP:String = "show_stagemap";
public static const SHOW_RESULTPAGE:String = "show_resultpage";
public function GameMain(_arg1:Sprite, _arg2:Stage){
char_offset = 1;
Rect0 = GameMain_Rect0;
Rect1 = GameMain_Rect1;
Rect2 = GameMain_Rect2;
Rect3 = GameMain_Rect3;
super();
_target = _arg1;
_stage = _arg2;
map_load_manager = new MapLoadManager();
}
public function activate():void{
controller.start();
frame_number_manager.start();
controller.addEventListener(Controller.SHOW_CHANGER, showChanger);
char.addEventListener(AbstractCharacter.DEAD, showGameOverMsg);
sound_manager.playBGmusic();
}
private function exchangeChar(_arg1:Event):void{
var _local2:CharChangeDisplayer;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Smoke;
_local2 = (_arg1.target as CharChangeDisplayer);
_local3 = _local2.chooseNum;
if (char_offset != _local3){
char.removeEventListener(AbstractCharacter.DEAD, showGameOverMsg);
_local4 = char.x;
_local5 = char.y;
removeChild(char);
char = null;
switch (_local3){
case 0:
setChar(new Moonrabbit());
break;
case 1:
setChar(new Yojo());
break;
case 2:
setChar(new Moonboy());
break;
};
char_offset = _local3;
char.x = _local4;
char.y = _local5;
addChildAt(char, getChildIndex(activemap_view));
_local6 = new Smoke(effect_view, (_local4 - 35), (_local5 - 12));
sound_manager.onSoundPlayAt(5);
};
_local2.remove();
removeChild(_local2);
_local2 = null;
controller.start();
}
private function removeListeners():void{
item_effect_manager.removeEventListener(ItemEffectManager.GO_STAGEMAP, showStageMap);
item_effect_manager.removeEventListener(ItemEffectManager.GO_RESULTPAGE, showResultPage);
controller.removeEventListener(Controller.SHOW_CHANGER, showChanger);
char.removeEventListener(AbstractCharacter.DEAD, showGameOverMsg);
}
public function stopActivate():void{
sound_manager.stopBGmusic();
}
private function setChar(_arg1:AbstractCharacter):void{
controller.char = (AbstrectEnermy.CHARACTER = (char = _arg1));
AbstrectEnermy.CONTROLLER = controller;
game_model.setChar(char);
effect_view.char = (sound_manager.char = (hit_checker.char = char));
AbstractHitcheckStaticTile.CHAR = (AbstractHasEffectionTile.CHAR = char);
char.addEventListener(AbstractCharacter.DEAD, showGameOverMsg);
}
private function showResultPage(_arg1:Event):void{
removeListeners();
dispatchEvent(new Event(GameMain.SHOW_RESULTPAGE));
}
private function showChanger(_arg1:Event):void{
var _local2:CharChangeDisplayer;
_local2 = new CharChangeDisplayer(stage, char_offset, sound_manager);
_local2.name = "changer";
_local2.x = ((0x0200 - _local2.width) * 0.5);
_local2.y = ((448 - _local2.height) * 0.5);
addChild(_local2);
_local2.addEventListener(CharChangeDisplayer.CHOOSE_CHAR, exchangeChar);
}
public function get ratioList():Array{
return (item_effect_manager.ratioList);
}
public function setMapToGame(_arg1:Object):void{
map_load_manager.mapLoad(_arg1);
buildGame();
}
public function deactivate():void{
var _local1:GameMain;
_local1 = this;
_target.removeChild(_local1);
_local1 = null;
}
private function buildGame():void{
var _local1:Array;
AbstractHitcheckStaticTile.CHAR = (AbstractHasEffectionTile.CHAR = (AbstrectEnermy.CHARACTER = (char = new Yojo())));
AbstrectEnermy.CONTROLLER = (controller = new Controller(_stage, char));
AbstrectEnermy.COLLECTION = map_load_manager.stagetile_collection;
stagemap_view = new StageMapView(map_load_manager);
bgmap_view = new BackgroundMapView(map_load_manager);
AbstrectEnermy.MAP = (activemap_view = new ActiveObjectMapView(map_load_manager));
frontBgmap_view = new FrontBackgroundMapView(map_load_manager);
_local1 = map_load_manager.front_bg_tileImageMaker.mapSnRange;
frame_number_manager = new FrameNumberManager();
game_model = new GameModel(map_load_manager, controller, activemap_view, frontBgmap_view, frame_number_manager);
game_model.setChar(char);
game_model.setMapView(stagemap_view, bgmap_view, 0x0200, 448);
AbstractCharacter.GAME_MODEL = game_model;
AbstractAnimateTile.FRAME_MANAGER = frame_number_manager;
controller.setModel(game_model);
char.setModel(game_model);
hit_checker = new TimeEventChecker(char, controller);
AbstractHitcheckStaticTile.HIT_CHECKER = (AbstrectEnermy.EVENT_CHECKER = (AbstractHasEffectionTile.HIT_CHECKER = hit_checker));
effect_view = new EffectView();
effect_view.char = char;
addChild(map_load_manager.backGround);
addChild(bgmap_view);
addChild(stagemap_view);
addChild(activemap_view);
addChild(char);
addChild(effect_view);
addChild(frontBgmap_view);
createBasicUI();
item_effect_manager = new ItemEffectManager(map_load_manager, stagemap_view, candy_displayer, controller);
effect_view.itemEffectManager = (AbstractHitcheckStaticTile.EFFECT_MANAGER = (AbstractItem.EFFECT_MANAGER = item_effect_manager));
sound_manager = new SoundManager(game_model, item_effect_manager, char, controller, map_load_manager.bg_music, map_load_manager.musicPoint.x, map_load_manager.musicPoint.y, map_load_manager.musicInitTime);
item_effect_manager.addEventListener(ItemEffectManager.GO_STAGEMAP, showStageMap);
item_effect_manager.addEventListener(ItemEffectManager.GO_RESULTPAGE, showResultPage);
}
private function showGameOverMsg(_arg1:Event):void{
var _local2:GameOverMassage;
_local2 = new GameOverMassage();
addChild(_local2);
_local2.start();
}
private function showStageMap(_arg1:Event):void{
removeListeners();
dispatchEvent(new Event(GameMain.SHOW_STAGEMAP));
}
private function createBasicUI():void{
var _local1:Bitmap;
var _local2:Bitmap;
var _local3:Bitmap;
var _local4:Bitmap;
var _local5:BlueHeart;
var _local6:PercentageBar;
var _local7:RedHeart;
var _local8:PercentageBar;
_local1 = (new Rect0() as Bitmap);
_local2 = (new Rect1() as Bitmap);
_local3 = (new Rect2() as Bitmap);
_local4 = (new Rect3() as Bitmap);
_local1.x = 0;
_local2.x = 496;
_local2.y = (_local1.y = 16);
_local4.x = (_local3.x = 0);
_local3.y = 0;
_local4.y = 432;
addChild(_local1);
addChild(_local2);
addChild(_local3);
addChild(_local4);
_local5 = new BlueHeart();
_local5.x = 10;
_local6 = new PercentageBar(50, 437, 150, 5, 35071, 0xFF, 13311);
AbstractCharacter.setManaBar(_local6);
_local7 = new RedHeart();
_local7.x = 220;
_local8 = new PercentageBar(260, 437, 150, 5, 16733593, 0xFF0000, 0x660022);
_local7.y = (_local5.y = 422);
AbstractCharacter.setHealthBar(_local8);
candy_displayer = new CandyNumDisplayer();
candy_displayer.x = 420;
candy_displayer.y = 420;
addChild(_local5);
addChild(_local6);
addChild(_local7);
addChild(_local8);
addChild(candy_displayer);
}
}
}//package
Section 105
//GameMain_Rect0 (GameMain_Rect0)
package {
import mx.core.*;
public class GameMain_Rect0 extends BitmapAsset {
}
}//package
Section 106
//GameMain_Rect1 (GameMain_Rect1)
package {
import mx.core.*;
public class GameMain_Rect1 extends BitmapAsset {
}
}//package
Section 107
//GameMain_Rect2 (GameMain_Rect2)
package {
import mx.core.*;
public class GameMain_Rect2 extends BitmapAsset {
}
}//package
Section 108
//GameMain_Rect3 (GameMain_Rect3)
package {
import mx.core.*;
public class GameMain_Rect3 extends BitmapAsset {
}
}//package
Section 109
//IActivate (IActivate)
package {
public interface IActivate {
function activate():void;
function deactivate():void;
function stopActivate():void;
}
}//package
Section 110
//YojoGameManager (YojoGameManager)
package {
import component.*;
import flash.events.*;
import flash.display.*;
import pages.*;
import util.*;
import flash.text.*;
import flash.net.*;
public class YojoGameManager extends Sprite {
private var progress_bar:PercentageBar;
private var pre_event:String;
private var nextstage_btn:ButtonSprite;
private var MainOnImg:Class;
private var loader:Loader;
private var NextOnImg:Class;
private var screen_cover:ScreenCover;
private var stage_offset:uint;
private var MainOverImg:Class;
private var map_path:String;
private var ratioList:Array;
private var next_event:String;
private var actvatedTarget:IActivate;
private var result_page:AbstractResultPage;
private var intro_movie:AbstrectMovie;
private var stage_map:AbstractStageMap;
private var logo:DisplayObject;
private var node_saver:NodeSaver;
private var NextOverImg:Class;
private var Logo:Class;
private var main_btn:ButtonSprite;
private var explain_page:AbstractExplainPage;
private var front_page:AbstractFrontPage;
private var game_main:GameMain;
private var absolute_path:String;
private var loaded_tfd:TextField;
private static const LOAD_MAINPAGE:String = "load_frontpage";
private static const LOAD_GAME_RESULT:String = "load_game_result";
private static const LOAD_STAGE_MAP:String = "load_stage_map";
private static const LOAD_GAME:String = "load_game";
private static const LOAD_EXPLAIN:String = "load_explain";
public function YojoGameManager(){
MainOnImg = YojoGameManager_MainOnImg;
MainOverImg = YojoGameManager_MainOverImg;
NextOnImg = YojoGameManager_NextOnImg;
NextOverImg = YojoGameManager_NextOverImg;
Logo = YojoGameManager_Logo;
super();
absolute_path = "";
stage.showDefaultContextMenu = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
node_saver = new NodeSaver();
stage_offset = parseInt(node_saver.readStageOffset);
next_event = _slot1.LOAD_MAINPAGE;
makeScreen();
}
private function removeCoverComplete(_arg1:Event):void{
removeChild(screen_cover);
screen_cover = null;
actvatedTarget.activate();
}
private function removeGameComponent(_arg1:Event):void{
if (pre_event != null){
switch (pre_event){
case _slot1.LOAD_MAINPAGE:
front_page.removeEventListener(AbstractFrontPage.SHOW_STAGE_MAP, showMap);
front_page.removeEventListener(AbstractFrontPage.SHOW_EXPLAIN, showExplain);
removeChild(front_page);
front_page = null;
break;
case _slot1.LOAD_EXPLAIN:
removeChild(main_btn);
main_btn = null;
explain_page.deactivate();
break;
case _slot1.LOAD_STAGE_MAP:
removeChild(main_btn);
main_btn = null;
stage_map.deactivate();
break;
case _slot1.LOAD_GAME:
game_main.deactivate();
break;
case _slot1.LOAD_GAME_RESULT:
removeChild(nextstage_btn);
nextstage_btn = null;
result_page.deactivate();
break;
};
};
}
private function setEventName(_arg1:String):void{
pre_event = next_event;
next_event = _arg1;
}
private function buildStageMap(_arg1:Event):void{
var _local2:Object;
main_btn = makeMainBtn();
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, buildStageMap);
_local2 = loader.content;
actvatedTarget = (stage_map = new _local2.Stage_map_cls(this, stage_offset));
_local2 = null;
addChildAt(stage_map, getChildIndex(screen_cover));
addChildAt(main_btn, getChildIndex(screen_cover));
stage_map.addEventListener(AbstractStageMap.BUILD_STAGE, loadGameInit);
onLoadComplete();
}
private function makeMainBtn():ButtonSprite{
var _local1:ButtonSprite;
_local1 = new ButtonSprite(MainOnImg, MainOverImg, 445, 375);
_local1.addEventListener(MouseEvent.CLICK, gotoMain);
return (_local1);
}
private function buildExplainPage(_arg1:Event):void{
var _local2:Object;
main_btn = makeMainBtn();
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, buildExplainPage);
_local2 = loader.content;
actvatedTarget = (explain_page = new _local2.Explain_page_cls(this));
_local2 = null;
addChildAt(explain_page, getChildIndex(screen_cover));
addChildAt(main_btn, getChildIndex(screen_cover));
onLoadComplete();
}
private function showMap(_arg1:Event):void{
front_page.deactivate();
setEventName(_slot1.LOAD_STAGE_MAP);
makeScreen();
}
private function buildIntroMovie(_arg1:Event):void{
var _local2:Object;
main_btn = makeMainBtn();
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, buildFrontPage);
_local2 = loader.content;
actvatedTarget = (intro_movie = new _local2.Intro_movie_cls(this));
_local2 = null;
addChildAt(intro_movie, getChildIndex(screen_cover));
addChildAt(main_btn, getChildIndex(screen_cover));
onLoadComplete();
}
private function showMapFromGame(_arg1:Event):void{
game_main.removeEventListener(GameMain.SHOW_STAGEMAP, showMapFromGame);
game_main.removeEventListener(GameMain.SHOW_RESULTPAGE, showResultFromGame);
game_main.stopActivate();
setEventName(_slot1.LOAD_STAGE_MAP);
makeScreen();
}
private function showExplain(_arg1:Event):void{
front_page.deactivate();
setEventName(_slot1.LOAD_EXPLAIN);
makeScreen();
}
private function makeProgressDisplayer():void{
progress_bar = new PercentageBar(175, 300, 162, 1, 0xE6008A, 0xFF0000, 16724940);
progress_bar.barLength = 0;
loaded_tfd = HangulTextField.getInstance().getTextField("0%", 0xE6008A, 175, 280);
logo = (new Logo() as Bitmap);
logo.x = ((0x0200 - logo.width) * 0.5);
logo.y = ((448 - logo.height) * 0.45);
addChild(logo);
addChild(progress_bar);
addChild(loaded_tfd);
}
private function buildResultPage(_arg1:Event):void{
var _local2:Object;
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, buildResultPage);
_local2 = loader.content;
actvatedTarget = (result_page = new _local2.result_page_cls(this, ratioList));
result_page.addEventListener(AbstractResultPage.ADD_NEXT_BTN, addNextStageBtn);
_local2 = null;
addChildAt(result_page, getChildIndex(screen_cover));
onLoadComplete();
}
private function onDisplayProgress(_arg1:ProgressEvent):void{
var _local2:uint;
_local2 = Math.floor(((_arg1.bytesLoaded * 100) / _arg1.bytesTotal));
progress_bar.barLength = _local2;
loaded_tfd.text = (_local2 + "%");
loaded_tfd.x = (175 + Math.floor(progress_bar.width));
}
private function loadGameInit(_arg1:Event):void{
stage_map.removeEventListener(AbstractStageMap.BUILD_STAGE, loadGameInit);
map_path = _arg1.target.targetstage;
stage_map.stopActivate();
setEventName(_slot1.LOAD_GAME);
makeScreen();
}
private function showResultFromGame(_arg1:Event):void{
ratioList = game_main.ratioList;
game_main.stopActivate();
setEventName(_slot1.LOAD_GAME_RESULT);
makeScreen();
}
private function getResultGrade(_arg1:Number):String{
var _local2:String;
if (_arg1 > 95){
_local2 = "Perfect";
} else {
if (_arg1 > 85){
_local2 = "Great";
} else {
if (_arg1 > 75){
_local2 = "Cool";
} else {
_local2 = "Bad";
};
};
};
return (_local2);
}
private function buildGame(_arg1:Event):void{
var _local2:Object;
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, buildGame);
_local2 = loader.content;
actvatedTarget = (game_main = new GameMain(this, stage));
game_main.setMapToGame(_local2);
game_main.addEventListener(GameMain.SHOW_STAGEMAP, showMapFromGame);
game_main.addEventListener(GameMain.SHOW_RESULTPAGE, showResultFromGame);
_local2 = null;
addChildAt(game_main, getChildIndex(screen_cover));
onLoadComplete();
}
private function buildFrontPage(_arg1:Event):void{
var _local2:Object;
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, buildFrontPage);
_local2 = loader.content;
actvatedTarget = (front_page = new _local2.Front_page_cls());
_local2 = null;
front_page.addEventListener(AbstractFrontPage.SHOW_STAGE_MAP, showMap);
front_page.addEventListener(AbstractFrontPage.SHOW_EXPLAIN, showExplain);
addChildAt(front_page, getChildIndex(screen_cover));
onLoadComplete();
}
private function makeNextStageBtn():ButtonSprite{
var _local1:ButtonSprite;
_local1 = new ButtonSprite(NextOnImg, NextOverImg, 445, 375);
_local1.addEventListener(MouseEvent.CLICK, gotoNextStage);
return (_local1);
}
private function gotoNextStage(_arg1:MouseEvent):void{
nextstage_btn.enabled = false;
if (stage_offset < 8){
stage_offset++;
node_saver.writeStageOffset = stage_offset.toString();
};
nextstage_btn.removeEventListener(MouseEvent.CLICK, gotoNextStage);
result_page.removeEventListener(AbstractResultPage.ADD_NEXT_BTN, addNextStageBtn);
actvatedTarget.stopActivate();
setEventName(_slot1.LOAD_STAGE_MAP);
makeScreen();
}
private function startLoadGameComponent(_arg1:Event):void{
var _local2:String;
switch (next_event){
case _slot1.LOAD_MAINPAGE:
makeProgressDisplayer();
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, buildFrontPage);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onDisplayProgress);
loader.load(new URLRequest((absolute_path + "FrontPageLibrary.swf")));
break;
case _slot1.LOAD_EXPLAIN:
makeProgressDisplayer();
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, buildExplainPage);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onDisplayProgress);
loader.load(new URLRequest((absolute_path + "ExplainPageLibrary.swf")));
break;
case _slot1.LOAD_STAGE_MAP:
makeProgressDisplayer();
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, buildStageMap);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onDisplayProgress);
loader.load(new URLRequest((absolute_path + "StageMapLibrary.swf")));
break;
case _slot1.LOAD_GAME:
makeProgressDisplayer();
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, buildGame);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onDisplayProgress);
loader.load(new URLRequest(((absolute_path + map_path) + ".swf")));
break;
case _slot1.LOAD_GAME_RESULT:
_local2 = getResultGrade(ratioList[4]);
makeProgressDisplayer();
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, buildResultPage);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onDisplayProgress);
loader.load(new URLRequest(((absolute_path + _local2) + "ResultPageLib.swf")));
break;
};
}
private function onLoadComplete():void{
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, onDisplayProgress);
loader = null;
removeChild(progress_bar);
removeChild(loaded_tfd);
removeChild(logo);
progress_bar = null;
loaded_tfd = null;
logo = null;
screen_cover.startRemoveTiles();
}
private function gotoMain(_arg1:MouseEvent):void{
main_btn.enabled = false;
main_btn.removeEventListener(MouseEvent.CLICK, gotoMain);
actvatedTarget.stopActivate();
setEventName(_slot1.LOAD_MAINPAGE);
makeScreen();
}
private function addNextStageBtn(_arg1:Event):void{
nextstage_btn = makeNextStageBtn();
addChild(nextstage_btn);
}
private function makeScreen():void{
screen_cover = new ScreenCover(0xFFFFFF);
addChild(screen_cover);
screen_cover.addEventListener(ScreenCover.COVER_COMP, startLoadGameComponent);
screen_cover.addEventListener(ScreenCover.COVER_COMP, removeGameComponent);
screen_cover.addEventListener(ScreenCover.REMOVE_COMP, removeCoverComplete);
}
}
}//package
Section 111
//YojoGameManager_Logo (YojoGameManager_Logo)
package {
import mx.core.*;
public class YojoGameManager_Logo extends BitmapAsset {
}
}//package
Section 112
//YojoGameManager_MainOnImg (YojoGameManager_MainOnImg)
package {
import mx.core.*;
public class YojoGameManager_MainOnImg extends BitmapAsset {
}
}//package
Section 113
//YojoGameManager_MainOverImg (YojoGameManager_MainOverImg)
package {
import mx.core.*;
public class YojoGameManager_MainOverImg extends BitmapAsset {
}
}//package
Section 114
//YojoGameManager_NextOnImg (YojoGameManager_NextOnImg)
package {
import mx.core.*;
public class YojoGameManager_NextOnImg extends BitmapAsset {
}
}//package
Section 115
//YojoGameManager_NextOverImg (YojoGameManager_NextOverImg)
package {
import mx.core.*;
public class YojoGameManager_NextOverImg extends BitmapAsset {
}
}//package