Frame 1
System.useCodepage = true;
with (Stage) {
showMenu = false;
scaleMode = "noScale";
}
snd_chk = true;
snd_ary = ["click1_snd", "click2_snd", "reload_snd", "result_snd", "wind_snd", "bump_snd", "bigJump_snd", "jump_snd", "reach_snd", "die1_snd", "die2_snd", "die3_snd", "attack_snd", "weapon1_snd", "weapon2_snd", "weapon3_snd", "fly_attack_snd", "cha_damage_snd", "get_item_snd", "create_evil_snd", "error_snd", "bg_snd", "intro_snd"];
var i = 0;
while (i < snd_ary.length) {
var snd_str = snd_ary[i];
this[snd_str] = new Sound(this);
this[snd_str].attachSound(snd_str);
i++;
}
game_init = function () {
g = 2;
jump_value = 20;
totalLevel = 5;
arrow_pos_ary = [{x:53, y:-99}, {x:51, y:-105}, {x:45, y:-111}, {x:40, y:-116}, {x:34, y:-124}, {x:-4, y:-130}, {x:-23, y:-134}, {x:-30, y:-130}, {x:-38, y:-122}];
runAddPower = {evil1:1.018, evil2:1.025, evil3:1.035};
create_intervalTime_ary = [{totalTime:1300, decreaseTime:10}, {totalTime:1000, decreaseTime:15}, {totalTime:700, decreaseTime:20}, {totalTime:600, decreaseTime:25}, {totalTime:550, decreaseTime:28}];
evil_score_ary = [50, 60, 70];
evilTotalNum_ary = [30, 40, 50, 60, 70, 80, 90, 90, 90, 90, 90, 90, 90];
itemCreate_ratio = [5, 6, 7, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12];
this.createEmptyMovieClip("control", 1);
this.createEmptyMovieClip("evil_mc", 50);
this.createEmptyMovieClip("explose_effect_mc", 99);
this.createEmptyMovieClip("ball_mc", 100);
this.createEmptyMovieClip("score_mc", 103);
this.createEmptyMovieClip("damage_rect", 105);
this.createEmptyMovieClip("interval_mc", 200);
if (ui_item_mc.getDepth() != 60) {
(ui_item_mc.oriDepth = ui_item_mc.getDepth());
ui_item_mc.swapDepths(60);
}
};
stage_set = function () {
level = 1;
score = 0;
};
game_start = function (init) {
_quality = "medium";
game_play = true;
life_gage = 100;
ui_life_mc.mask_mc._xscale = 100;
ui_life_mc.level = level;
itemRef_ary = [1, 2, 3];
getItem_ary = [];
var _local3 = 1;
while (_local3 <= 3) {
ui_item_mc["item" + _local3]._visible = false;
ui_item_mc["item" + _local3].gotoAndStop(1);
_local3++;
}
ui_item_mc.sndIcon_mc.onPress = function () {
snd_chk = !snd_chk;
if (snd_chk) {
ui_item_mc.sndIcon_mc.play();
(game_play ? (snd_attach("bg_snd", "loop")) : (snd_attach("result_snd")));
} else {
ui_item_mc.sndIcon_mc.gotoAndStop(1);
stopAllSounds();
}
};
angle_val = 3;
useBullet_num = 0;
totalBullet_num = 12;
_local3 = 1;
while (_local3 <= totalBullet_num) {
bullet_mc["b" + _local3].gotoAndStop(1);
_local3++;
}
bullet_mc.reload_alert_mc.gotoAndStop(1);
cha_mc.gotoAndStop(5);
cha_mc.angle = -90;
cha_mc.initx = cha_mc._x;
cha_mc.inity = cha_mc._y;
divide_val = 15;
key_shoot = false;
evilTotalNum = evilTotalNum_ary[level - 1];
expire_evilNum = 0;
evil_mc.num = 0;
if (cha_mc.getDepth() != 101) {
cha_mc.swapDepths(101);
}
if (bullet_mc.getDepth() != 104) {
bullet_mc.swapDepths(104);
}
for (var _local6 in evil_mc) {
var _local4 = evil_mc[_local6];
if (typeof(_local4) == "movieclip") {
delete_item(_local4);
}
}
bg_mc.initx = bg_mc._x;
bg_mc.inity = bg_mc._y;
bg_mc.maxx = bg_mc._width / 2;
bg_mc.minx = Stage.width - (bg_mc._width / 2);
cha_mc.min_angle = -150;
cha_mc.max_angle = -30;
cha_mc.bg_ratio = (bg_mc.minx - bg_mc.maxx) / (cha_mc.max_angle - cha_mc.min_angle);
cha_mc.b = bg_mc.maxx - (cha_mc.bg_ratio * cha_mc.min_angle);
target_mc._visible = true;
target_mc._rotation = -90;
control.onEnterFrame = function () {
if (game_play) {
if (!cha_mc.shoot_chk) {
if (Key.isDown(37) || (Key.isDown(39))) {
if (Key.isDown(37)) {
cha_mc.angle = Math.max(cha_mc.angle - angle_val, cha_mc.min_angle);
} else {
cha_mc.angle = Math.min(cha_mc.angle + angle_val, cha_mc.max_angle);
}
bg_mc._x = (cha_mc.bg_ratio * cha_mc.angle) + cha_mc.b;
evil_mc._x = bg_mc._x - bg_mc.initx;
ball_mc._x = bg_mc._x - bg_mc.initx;
var _local2 = Math.floor(Math.abs(cha_mc.angle - cha_mc.max_angle) / divide_val) + 1;
cha_mc.gotoAndStop(_local2);
var _local3 = arrow_pos_ary[_local2 - 1];
var _local1 = new Object();
_local1.x = _local3.x;
_local1.y = _local3.y;
cha_mc.localToGlobal(_local1);
target_mc._x = _local1.x;
target_mc._y = _local1.y;
var _local5 = 500;
var _local4 = (330 + random(60)) - 30;
var _local7 = cha_mc._x + (Math.cos((cha_mc.angle * Math.PI) / 180) * _local5);
var _local6 = cha_mc._y + (Math.sin((cha_mc.angle * Math.PI) / 180) * _local4);
target_mc._rotation = (Math.atan2(_local6 - target_mc._y, _local7 - target_mc._x) * 180) / Math.PI;
target_mc._visible = true;
}
}
if (Key.isDown(38)) {
reload_bullet();
}
if (Key.isDown(40) && (!key_shoot)) {
useItem();
} else if (Key.isDown(32)) {
if (cha_mc.shoot_chk || (useBullet_num >= totalBullet_num)) {
return(undefined);
}
shoot_ready();
}
}
};
evil_mc.onEnterFrame = function () {
for (var _local3 in this) {
if (typeof(this[_local3]) == "movieclip") {
var _local2 = this[_local3];
if (_local2.mode == "run") {
_local2._x = _local2._x + (_local2.xRatio * _local2.run_power);
if (_local2.runType == "zigzag") {
_local2.angle_ra = _local2.angle_ra + 0.1;
_local2.xrunPower = _local2.xrunPower + 0.03;
_local2._x = _local2._x + (Math.cos(_local2.angle_ra) * _local2.xrunPower);
}
_local2._y = _local2._y + (_local2.yRatio * _local2.run_power);
_local2._xscale = (_local2._y * _local2.scaleRatio) + _local2.b;
_local2._yscale = Math.abs(_local2._xscale);
_local2.mirror_chk && ((_local2._xscale = _local2._xscale * -1));
_local2.run_power = _local2.run_power * _local2.runAddPower;
if (_local2._y >= _local2.ty) {
_local2.gotoAndStop("attack");
_local2.mode = "attack";
snd_attach("attack_snd");
}
if (_local2.subType == "outer") {
if (((_local2._x + (_local2._width / 2)) < -150) || (_local2._x > 850)) {
_local2.subType = undefined;
_local2.mode = "jump";
((_local2._x > 350) ? ((_local2._x = 700 + (_local2._width / 2))) : ((_local2._x = -(_local2._width / 2))));
_local2._y = _local2.ty;
_local2.tx = (cha_mc._x + random(300)) - 150;
_local2._xscale = _local2._y * _local2.scaleRatio;
_local2._yscale = Math.abs(_local2._xscale);
_local2.gotoAndStop("attack");
snd_attach("bigJump_snd");
snd_attach("attack_snd");
}
}
} else if (_local2.mode == "jump") {
_local2._x = _local2._x + ((_local2.tx - _local2._x) * 0.3);
}
}
}
};
var _local8 = create_intervalTime_ary[level - 1];
create_intervalTime = _local8.totalTime;
decrease_evilTime = _local8.decreaseTime;
create_evil_interval = setInterval(create_evil, 2000);
dep_control_interval = setInterval(dep_control, 60);
snd_attach("bg_snd", "loop");
snd_stop("result_snd");
snd_stop("intro_snd");
};
game_out = function (flag) {
if (!game_play) {
return(undefined);
}
_quality = "high";
game_play = false;
clearAllInterval();
successChk = flag;
result_window();
};
result_window = function () {
result_window_interval = setInterval(result_window_f, 2000);
};
result_window_f = function () {
clearInterval(result_window_interval);
var _local3 = _root.attachMovie("result_window_mc", "result_window_mc", 107);
_local3.tx = 365;
_local3.ty = 260;
_local3._x = _local3.tx;
_local3._y = _local3.ty - 300;
_local3.onEnterFrame = function () {
smoothMove(this, this.tx, this.ty, 0.1);
if (Math.abs(this.ty - this._y) < 0.1) {
delete this.onEnterFrame;
this._x = this.tx;
this._y = this.ty;
}
};
snd_attach("wind_snd");
if (successChk) {
_local3.gotoAndStop("success_frame");
if (level >= totalLevel) {
_local3.gotoAndStop("clear_frame");
} else {
_local3.gotoAndStop("success_frame");
}
} else {
_local3.gotoAndStop("fail_frame");
}
snd_stop("bg_snd");
snd_attach("result_snd", "loop");
};
result_window_btn_enable = function (flag) {
with (result_window_mc) {
next_btn.enabled = (help_btn.enabled = (restart_btn.enabled = (save_btn.enabled = flag)));
}
};
next_stage = function () {
delete_item(result_window_mc);
level++;
game_start();
};
game_restart = function () {
delete_item(result_window_mc);
stage_set();
game_start();
};
shoot_ready = function () {
cha_mc.m.gotoAndPlay("shoot_frame");
cha_mc.shoot_chk = true;
useBullet();
};
shoot = function (angle) {
target_mc._visible = false;
if (angle == undefined) {
angle = cha_mc.angle;
}
var _local7 = ball_mc.getNextHighestDepth();
var _local3 = ball_mc.attachMovie("bullet_blur", "b" + _local7, _local7);
var _local14 = cha_mc._currentframe;
var _local11 = arrow_pos_ary[_local14 - 1];
var _local5 = new Object();
_local5.x = _local11.x;
_local5.y = _local11.y;
cha_mc.localToGlobal(_local5);
_local3.sx = _local5.x;
_local3.sy = _local5.y;
_local3._x = _local3.sx;
_local3._y = _local3.sy;
var _local13 = 500;
var _local12 = (330 + random(60)) - 30;
var _local9 = cha_mc._x + (Math.cos((angle * Math.PI) / 180) * _local13);
var _local8 = cha_mc._y + (Math.sin((angle * Math.PI) / 180) * _local12);
_local3.cx = _local9 - _local3._x;
_local3.cy = _local8 - _local3._y;
_local3._rotation = (Math.atan2(_local8 - _local3._y, _local9 - _local3._x) * 180) / Math.PI;
_local3.duration = 500;
_local3.sTime = getTimer();
_local3.onEnterFrame = function () {
easingMove(this);
var _local5 = ball_mc.getNextHighestDepth();
var _local3 = ball_mc.attachMovie("bullet_effect" + (random(5) + 1), "e" + _local5, _local5);
_local3._x = this._x;
_local3._y = this._y;
_local3._rotation = this._rotation;
_local3._alpha = random(50) + 30;
_local3._xscale = (_local3._yscale = this._xscale);
for (var _local4 in evil_mc) {
var _local2 = evil_mc[_local4];
if (((typeof(_local2) == "movieclip") && (_local2._name.indexOf("evil") != -1)) && (_local2.mode != "die")) {
if (_local2.m.hit_m.hitTest(this)) {
damage_evil(_local2, ax);
delete_item(this);
snd_attach("fly_attack_snd");
break;
}
}
}
};
snd_attach("wind_snd");
};
shootItem = function () {
target_mc._visible = false;
switch (useItemChk) {
case 1 :
var _local10 = cha_mc.angle;
var _local9 = 8;
var _local8 = [50, 100, 150, 200, 250, 300, 350, 400];
var _local3 = 1;
while (_local3 <= _local9) {
var _local7 = _local10 + (((3 - _local3) * 45) / (_local9 - 1));
var _local4 = interval_mc.getNextHighestDepth();
var _local5 = interval_mc.createEmptyMovieClip("interval" + _local4, _local4);
var _local6 = _local8.splice(random(_local8.length), 1)[0];
_local5.interval = setInterval(shootItem1_f, _local6, _local7, _local5);
_local3++;
}
break;
case 2 :
var _local14 = ball_mc.getNextHighestDepth();
var _local5 = ball_mc.attachMovie("weapon2_mc", "b" + _local14, _local14);
var _local18 = cha_mc._currentframe;
var _local15 = arrow_pos_ary[_local18 - 1];
var _local12 = new Object();
_local12.x = _local15.x;
_local12.y = _local15.y;
cha_mc.localToGlobal(_local12);
_local5.sx = _local12.x;
_local5.sy = _local12.y;
_local5._x = _local5.sx;
_local5._y = _local5.sy;
var _local17 = 500;
var _local16 = (330 + random(60)) - 30;
var _local20 = cha_mc._x + (Math.cos((cha_mc.angle * Math.PI) / 180) * _local17);
var _local19 = cha_mc._y + (Math.sin((cha_mc.angle * Math.PI) / 180) * _local16);
_local5.cx = _local20 - _local5._x;
_local5.cy = _local19 - _local5._y;
_local5.duration = 1000;
_local5.sTime = getTimer();
_local5.ro = 0;
_local5.addXPower = 100;
_local5.onEnterFrame = function () {
easingMove2(this);
this.ro = this.ro + 0.2;
this.addXPower = this.addXPower * 0.95;
this._x = this._x + (Math.cos(this.ro) * this.addXPower);
var _local5 = ball_mc.getNextHighestDepth();
var _local3 = ball_mc.attachMovie("bullet_effect" + (random(5) + 1), "e" + _local5, _local5);
_local3._x = this._x;
_local3._y = this._y;
_local3._rotation = this._rotation;
_local3._alpha = random(50) + 30;
_local3._xscale = (_local3._yscale = this._xscale);
for (var _local4 in evil_mc) {
var _local2 = evil_mc[_local4];
if ((((typeof(_local2) == "movieclip") && (_local2._name.indexOf("evil") != -1)) && (_local2.mode != "die")) && (_local2.mode != "jump")) {
if (_local2.m.hit_m.hitTest(this)) {
damage_evil(_local2, ax);
snd_attach("fly_attack_snd");
}
}
}
};
break;
case 3 :
_local14 = ball_mc.getNextHighestDepth();
_local5 = ball_mc.attachMovie("weapon3_mc", "b" + _local14, _local14);
_local18 = cha_mc._currentframe;
_local15 = arrow_pos_ary[_local18 - 1];
_local12 = new Object();
_local12.x = _local15.x;
_local12.y = _local15.y;
cha_mc.localToGlobal(_local12);
_local5.sx = _local12.x;
_local5.sy = _local12.y;
_local5._x = _local5.sx;
_local5._y = _local5.sy;
_local17 = 500;
_local16 = 320;
_local20 = cha_mc._x + (Math.cos((cha_mc.angle * Math.PI) / 180) * _local17);
_local19 = cha_mc._y + (Math.sin((cha_mc.angle * Math.PI) / 180) * _local16);
_local5.cx = _local20 - _local5._x;
_local5.cy = _local19 - _local5._y;
_local5.duration = 1500;
_local5.sTime = getTimer();
_local5.onEnterFrame = function () {
easingMove3(this);
if (this._y > 230) {
this.m._rotation = this.m._rotation + 20;
}
for (var _local3 in evil_mc) {
var _local2 = evil_mc[_local3];
if ((((typeof(_local2) == "movieclip") && (_local2._name.indexOf("evil") != -1)) && (_local2.mode != "die")) && (_local2.mode != "jump")) {
if (_local2.m.hit_m.hitTest(this)) {
damage_evil(_local2, ax);
snd_attach("fly_attack_snd");
}
}
}
};
}
if (useItemChk != 2) {
snd_attach(("weapon" + useItemChk) + "_snd");
} else if (snd_chk) {
_local5.fly_snd = new Sound(_local5);
_local5.fly_snd.attachSound("weapon2_snd");
_local5.fly_snd.start(0, 999);
}
useItemChk = undefined;
};
shootItem1_f = function (angle, mc) {
clearInterval(mc.interval);
delete_item(mc);
shoot(angle);
};
easingMove = function (mc) {
var _local3 = getTimer() - mc.sTime;
var _local4 = mc.duration;
var _local2 = ((((((p = (_local3 / _local4) - 1)) * p) * p) * p) * p) + 1;
mc._x = (mc.cx * _local2) + mc.sx;
mc._y = (mc.cy * _local2) + mc.sy;
mc._xscale = (-40 * _local2) + 100;
mc._yscale = mc._xscale;
if (_local3 >= mc.duration) {
delete_item(mc);
}
};
easingMove2 = function (mc) {
var _local3 = getTimer() - mc.sTime;
var _local4 = mc.duration;
var _local2 = ((((((p = (_local3 / _local4) - 1)) * p) * p) * p) * p) + 1;
mc._x = (mc.cx * _local2) + mc.sx;
mc._y = (mc.cy * _local2) + mc.sy;
mc._xscale = (-40 * _local2) + 100;
mc._yscale = mc._xscale;
if (_local3 >= mc.duration) {
mc.fly_snd.stop("weapon2_snd");
delete_item(mc);
}
};
easingMove3 = function (mc) {
var _local3 = getTimer() - mc.sTime;
var _local4 = mc.duration;
var _local2 = ((((((p = (_local3 / _local4) - 1)) * p) * p) * p) * p) + 1;
mc._x = (mc.cx * _local2) + mc.sx;
mc._y = (mc.cy * _local2) + mc.sy;
mc._xscale = (-80 * _local2) + 100;
mc._yscale = mc._xscale;
mc._x = mc._x + (((random(10) - 5) * mc._xscale) * 0.01);
if (_local3 >= mc.duration) {
delete_item(mc);
}
};
useBullet = function () {
useBullet_num++;
if (useBullet_num == totalBullet_num) {
bullet_mc.reload_alert_mc.gotoAndStop("view");
}
bullet_mc["b" + useBullet_num].gotoAndStop("empty_frame");
var _local4 = 360 / totalBullet_num;
var _local2 = 1;
while (_local2 <= totalBullet_num) {
var _local3 = bullet_mc["b" + _local2];
if (_local2 > useBullet_num) {
(_local3.gotoAndStop(1));// not popped
} else {
(_local3.gotoAndStop("empty"));// not popped
}
_local2++;
}
bullet_mc.mover = 0;
bullet_mc.tr = _local4 * useBullet_num;
bullet_mc.onEnterFrame = function () {
elasticRotate(this, this.tr, 0.4, 0.6);
if (Math.abs(this.mover) < 0.5) {
delete this.onEnterFrame;
this._rotation = this.tr;
this.mover = 0;
}
};
};
reload_bullet = function () {
if (key_reload) {
return(undefined);
}
if (useBullet_num < totalBullet_num) {
score_cul((totalBullet_num - useBullet_num) * -1, bullet_mc, false);
}
useBullet_num = 0;
bullet_mc.mover = 0;
bullet_mc.tr = 0;
bullet_mc.onEnterFrame = function () {
elasticRotate(this, this.tr, 0.8, 0.7);
if (Math.abs(this.mover) < 0.5) {
delete this.onEnterFrame;
this._rotation = this.tr;
this.mover = 0;
}
};
var _local2 = 1;
while (_local2 <= totalBullet_num) {
bullet_mc["b" + _local2].gotoAndStop(1);
_local2++;
}
bullet_mc.reload_alert_mc.gotoAndStop(1);
key_reload = true;
snd_attach("reload_snd");
};
elasticRotate = function (mc, tr, ratio, friction) {
mc.mover = ((tr - mc.totalr) * ratio) + (mc.mover * friction);
mc.totalr = mc.totalr + mc.mover;
mc._rotation = mc.totalr;
};
create_evil = function () {
if (!game_play) {
return(undefined);
}
clearInterval(create_evil_interval);
var type = (random(3) + 1);
var dep_num = evil_mc.getNextHighestDepth();
evil_mc.num++;
(evil_mc.num >= 100) && ((evil_mc.num = 0));
var mc = evil_mc.attachMovie(("evil" + type) + "_mc", "evil" + evil_mc.num, dep_num);
var bornNum = (random(13) + 1);
mc._x = eval ("born" + bornNum)._x;
mc._y = eval ("born" + bornNum)._y;
mc.initx = mc._x;
var sscale = 5;
mc._xscale = (mc._yscale = sscale);
if (random(3) == 0) {
mc.mirror_chk = true;
}
mc.type = type;
if (random(3) == 0) {
mc.runType = "zigzag";
mc.angle_ra = 0;
mc.xrunPower = 0.5;
}
if (((mc.runType == "zigzag") || (!((mc.type == 2) && (random(2) == 0)))) || (level <= 2)) {
var dx = (((cha_mc._x + random(300)) - 150) - mc._x);
var dy = (cha_mc._y - mc._y);
} else {
mc.subType = "outer";
var dx;
((mc._x > 350) ? ((dx = 900 - mc._x)) : ((dx = -200 - mc._x)));
dy = 380 - mc._y;
}
var angle = Math.atan2(dy, dx);
mc.run_power = 0.2;
mc.xRatio = Math.cos(angle);
mc.yRatio = Math.sin(angle);
var min_val = 10;
var max_val = 100;
var sy = mc._y;
var ty = 500;
mc.scaleRatio = (max_val - min_val) / (ty - sy);
mc.b = min_val - (mc.scaleRatio * sy);
mc.runAddPower = runAddPower["evil" + type];
mc.ty = ty;
mc.mode = "run";
mc.startTime = getTimer();
create_evil_interval = setInterval(create_evil, (Math.random() * 1000) + create_intervalTime);
(create_intervalTime > 300) && ((create_intervalTime = create_intervalTime - decrease_evilTime));
evilTotalNum--;
if (evilTotalNum <= 0) {
clearInterval(create_evil_interval);
}
if (mc.type == 3) {
snd_attach("runEffect_snd");
}
snd_attach("create_evil_snd");
};
dep_control = function () {
var _local4 = new Array();
var _local3 = new Array();
for (var _local5 in evil_mc) {
if (typeof(evil_mc[_local5]) == "movieclip") {
var _local1 = evil_mc[_local5];
_local4.push(_local1._y);
_local3.push(_local1.getDepth());
}
}
_local4.sort(order);
_local3.sort(order);
while (_local4.length > 0) {
var _local2 = _local4.shift();
for (var _local5 in evil_mc) {
if (typeof(evil_mc[_local5]) == "movieclip") {
var _local1 = evil_mc[_local5];
if (_local1._y == _local2) {
_local1.swapDepths(_local3.shift());
break;
}
}
}
}
};
order = function (a, b) {
return(a - b);
};
damage_cha = function (from_mc) {
var _local2 = _root.damage_rect.attachMovie("damage_rect_mc", "damage_mc", 1);
shake(10);
explose_effect(cha_mc._x, cha_mc._y - 120, from_mc);
life_gage = Math.max(0, life_gage - 7);
ui_life_mc.mask_mc._xscale = life_gage;
expire_evilNum++;
if (life_gage <= 0) {
game_out(false);
} else if (expire_evilNum >= evilTotalNum_ary[level - 1]) {
game_out(true);
}
snd_attach("cha_damage_snd");
};
damage_evil = function (mc, bullet_addx) {
mc.mode = "die";
mc.gotoAndStop("die");
if (random(2) == 0) {
mc.die_jump = true;
var addx = (bullet_addx * 0.5);
if (Math.abs(addx) > 8) {
mc.addx = ((addx > 0) ? 8 : -8);
} else {
mc.addx = addx;
}
mc.addy = -jump_value;
mc.ty = mc._y;
mc.onEnterFrame = function () {
this._y = this._y + this.addy;
this._x = this._x + this.addx;
this.addx = this.addx * 0.98;
this.addy = this.addy + g;
this.addy = this.addy * 0.95;
if (this._y >= this.ty) {
expire_mc(this);
}
};
}
if (mc._y > 300) {
shake(1);
}
explose_effect(mc);
var _local4 = (getTimer() - mc.startTime) / 1000;
var _local3 = (evil_score_ary[mc.type - 1] / _local4) * 0.5;
var _local5 = Math.min(Math.ceil((_local3 * _local3) * 0.1), 100);
score_cul(_local5, mc);
if ((getItem_ary.length < 3) && (random(itemCreate_ratio[level - 1]) == 0)) {
createItem(mc);
}
expire_evilNum++;
if (expire_evilNum >= evilTotalNum_ary[level - 1]) {
game_out(true);
}
snd_attach(("die" + mc.type) + "_snd");
};
itemStat = function () {
var _local1 = 1;
while (_local1 <= 3) {
var _local2 = ui_item_mc["item" + _local1];
if (_local1 <= getItem_ary.length) {
_local2._visible = true;
_local2.gotoAndStop(getItem_ary[_local1 - 1]);
} else {
_local2._visible = false;
_local2.gotoAndStop(1);
}
_local1++;
}
};
createItem = function (tmc) {
var num = itemRef_ary.splice(random(itemRef_ary.length), 1)[0];
getItem_ary.push(num);
var _local3 = evil_mc.getNextHighestDepth();
var _local2 = evil_mc.attachMovie(("item" + num) + "_mc", "item" + _local3, _local3);
_local2._x = tmc._x;
_local2._y = tmc._y;
_local2._xscale = (_local2._yscale = return_equation(204, 460, 40, 100, tmc._y));
_local2.type = num;
_local2.addy = (-45 * _local2._yscale) / 100;
_local2.sy = _local2._y;
_local2.onEnterFrame = function () {
this._y = this._y + this.addy;
this.addy = this.addy + 3;
if (this._y >= this.sy) {
delete this.onEnterFrame;
this._y = this.sy;
this.num = 0;
this._alpha = 50;
this.expireInterval = setInterval(expireItem, 50, this);
snd_attach("reach_snd");
}
};
itemStat();
snd_attach("get_item_snd");
};
expireItem = function (mc) {
mc.num++;
(((mc.num % 2) == 0) ? ((mc._alpha = 80)) : ((mc._alpha = 100 - (mc.num * 10))));
(mc._alpha <= 0) && (clearInterval(mc.expireInterval)delete_item(mc));
};
useItem = function () {
if (getItem_ary.length == 0) {
return(undefined);
}
cha_mc.shoot_chk = true;
useItemChk = getItem_ary.shift();
itemRef_ary.push(useItemChk);
cha_mc.m.gotoAndPlay("shoot_frame");
itemStat();
key_shoot = true;
};
shake = function (num) {
clearInterval(shake_interval);
cha_mc.shake_xval = ((num * random(2)) * 2) - 1;
cha_mc.shake_yval = (num * 2) + random(num * 2);
cha_mc.shake_num = 0;
shake_interval = setInterval(shake_f, 50);
};
shake_f = function () {
cha_mc._x = cha_mc.initx + cha_mc.shake_xval;
cha_mc._y = cha_mc.inity + cha_mc.shake_yval;
bg_mc._x = bg_mc.initx + ((-cha_mc.shake_xval) * 0.9);
bg_mc._y = bg_mc.inity + ((-cha_mc.shake_yval) * 0.7);
cha_mc.shake_xval = cha_mc.shake_xval * (-0.1 * (random(4) + 3));
cha_mc.shake_yval = cha_mc.shake_yval * -0.6;
cha_mc.shake_num++;
if (cha_mc.shake_num > 4) {
clearInterval(shake_interval);
cha_mc._x = cha_mc.initx;
cha_mc._y = cha_mc.inity;
bg_mc._x = bg_mc.initx;
bg_mc._y = bg_mc.inity;
}
};
explose_effect = function (sx, sy, mc) {
var _local6 = 1;
while (_local6 <= 7) {
var _local3 = explose_effect_mc.getNextHighestDepth();
var _local2 = explose_effect_mc.attachMovie("explose_effect_g", "e" + _local3, _local3);
_local2._x = sx + ((random(10) * 5) * ((random(2) * 2) - 1));
_local2._y = (sy + random(80)) - 40;
_local2._xscale = (_local2._yscale = random(70) + 50);
_local2._rotation = random(360);
var _local5 = (-random(120)) - 30;
var _local10 = 200;
var _local9 = 500;
var _local7 = 20;
var _local8 = 40;
if (mc != cha_mc) {
var _local4 = return_equation(_local10, _local9, _local7, _local8, mc._y);
} else {
var _local4 = random(30) + 5;
}
_local2.ax = Math.cos((_local5 * Math.PI) / 180) * _local4;
_local2.ay = Math.sin((_local5 * Math.PI) / 180) * _local4;
_local2.gotoAndStop(random(_local2._totalframes) + 1);
_local2.snum = 0;
_local2.tnum = random(30) + 7;
_local2.onEnterFrame = function () {
this._x = this._x + this.ax;
this._y = this._y + this.ay;
this.ay = this.ay + (g * 0.8);
this.snum++;
if (this.snum >= this.tnum) {
delete_item(this);
}
};
_local6++;
}
};
expire_mc = function (mc) {
mc.follow_num = 0;
mc.onEnterFrame = function () {
mc.follow_num++;
if ((mc.follow_num % 3) == 0) {
mc._alpha = 30;
} else {
mc._alpha = 100;
}
if (mc.follow_num > 10) {
delete_item(mc);
}
};
};
view_help = function (flag) {
if (flag) {
var _local2 = this.attachMovie("help_mc", "help_mc", 108);
_local2.tx = 350;
_local2.ty = 250;
_local2._x = _local2.tx;
_local2._y = _local2.ty - 300;
_local2.gotoAndStop("game_continue_frame");
_local2.onEnterFrame = function () {
smoothMove(this, this.tx, this.ty, 0.2);
if (Math.abs(this.ty - this._y) < 0.5) {
delete this.onEnterFrame;
this._y = this.ty;
}
};
result_window_btn_enable(false);
snd_attach("wind_snd");
} else {
delete_item(help_mc);
result_window_btn_enable(true);
}
};
save_score = function () {
score_ary = new Array();
var _local2 = new LoadVars();
_local2.f_score = score;
_local2.f_kind = 0;
var _local3 = "/data/flash/GetUserID.asp?ran=" + (Math.random() * 10000);
_local2.onLoad = function (success) {
if (success) {
if (Number(this.myid) == 0) {
result_window_mc.gotoAndStop("notLogin_frame");
Selection.setFocus("_root.result_window_mc.id_txt");
} else {
view_rank(this);
}
} else {
alert("data error ! ");
}
};
_local2.sendAndLoad(_local3, _local2, "post");
};
login_exec = function () {
var _local2 = new LoadVars();
_local2.score = score;
var _local3 = "/data/flash/userLogin.asp";
_local2.onLoad = function (success) {
if (success) {
if (chkData(this.myid)) {
view_rank(this);
} else {
result_window_mc.gotoAndStop("badLogin_frame");
Selection.setFocus("_root.result_window_mc.id_txt");
}
} else {
alert("error data ! ");
}
};
_local2.f_id = result_window_mc.id_txt.text;
_local2.f_pwd = result_window_mc.pass_txt.text;
_local2.f_score = score;
_local2.f_kind = 0;
_local2.sendAndLoad(_local3, _local2, "post");
};
chkData = function (str) {
var _local1;
(((String(str).length > 0) && (str != undefined)) ? (_local1 = true) : (_local1 = false));
return(_local1);
};
view_rank = function (load_var) {
result_window_mc.gotoAndStop("ranking_frame");
myid = load_var.myid;
var _local4 = false;
var _local1 = 1;
while (_local1 <= 10) {
if (chkData(load_var["member_nick" + _local1])) {
var _local2 = result_window_mc["field" + _local1];
_local2.num_txt.text = _local1;
_local2.nick_txt.text = load_var["member_nick" + _local1];
_local2.score_txt.text = load_var["member_score" + _local1];
_local2.date_txt.text = load_var["member_date" + _local1];
if (myid == load_var["member_id" + _local1]) {
_local2.gotoAndStop("active_frame");
_local4 = true;
} else {
_local2.gotoAndStop(1);
}
}
_local1++;
}
myfield = result_window_mc.myfield;
if (!_local4) {
myfield._visible = true;
myfield.num_txt.text = load_var.myrank;
myfield.nick_txt.text = load_var.mynick;
myfield.score_txt.text = load_var.myscore;
myfield.date_txt.text = load_var.mydate;
myfield.gotoAndStop("active_frame");
} else {
myfield._visible = false;
}
};
smoothMove = function (mc, tx, ty, sp) {
var _local3 = tx - mc._x;
var _local2 = ty - mc._y;
mc._x = mc._x + (_local3 * sp);
mc._y = mc._y + (_local2 * sp);
};
elasticMove = function (mc, tx, ty, f_ratio) {
mc.movex = ((tx - mc._x) * elastic_ratio) + (mc.movex * f_ratio);
mc.movey = ((ty - mc._y) * elastic_ratio) + (mc.movey * f_ratio);
mc._x = mc._x + mc.movex;
mc._y = mc._y + mc.movey;
};
elasticScale = function (mc, tscale, f_ratio) {
mc.movexs = ((tscale - mc._xscale) * elastic_ratio) + (mc.movexs * f_ratio);
mc.moveys = ((tscale - mc._yscale) * elastic_ratio) + (mc.moveys * f_ratio);
mc._xscale = mc._xscale + mc.movexs;
mc._yscale = mc._yscale + mc.moveys;
};
clearAllInterval = function () {
var _local2 = setInterval(function () {
}, 100);
var _local1 = 0;
while (_local1 <= _local2) {
clearInterval(_local1);
_local1++;
}
};
_global.delete_item = function (mc) {
if (typeof(mc) == "movieclip") {
for (var _local2 in mc) {
delete_item(mc[_local2]);
}
delete mc.onEnterFrame;
mc.removeMovieClip();
} else {
}
};
_global.snd_attach = function (name, loop) {
if (snd_chk != false) {
if (loop == undefined) {
eval (name).start();
} else if (typeof(loop) == "number") {
eval (name).start(0, loop);
} else {
eval (name).start(0, 100000);
}
}
};
_global.snd_stop = function (name) {
eval (name).stop(name);
};
return_equation = function (min, max, min_val, max_val, val_num) {
var _local1 = (max_val - min_val) / (max - min);
var _local2 = min_val - (_local1 * min);
return((_local1 * val_num) + _local2);
};
score_cul = function (addScore, tmc, display_chk) {
score = score + addScore;
if (score < 0) {
score = 0;
}
if (display_chk == undefined) {
var _local2 = ui_score_mc.getNextHighestDepth();
var _local1 = score_mc.attachMovie("fly_score_mc", "f" + _local2, _local2);
_local1._x = tmc._x;
_local1._y = (tmc._y - tmc._height) + 20;
_local1.m.score_txt.text = ((addScore > 0) ? ("+" + addScore) : ("-" + Math.abs(addScore)));
}
};
alert = function (str) {
getURL (("javascript:alert (\"" + str) + "\");");
};
key_up = true;
myListen = new Object();
myListen.onKeyDown = function () {
if (key_up) {
key_up = undefined;
if (Key.isDown(16)) {
}
if (Key.isDown(65)) {
}
}
};
myListen.onKeyUp = function () {
if (!key_up) {
key_up = true;
}
if (Key.getCode() == 40) {
key_shoot = false;
}
if (Key.getCode() == 38) {
key_reload = undefined;
}
};
Key.addListener(myListen);
Instance of Symbol 305 MovieClip in Frame 1
onClipEvent (load) {
this.mask_mc._xscale = 0;
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_root.play();
} else {
_root.stop();
}
}
onClipEvent (enterFrame) {
var loaded = _root.getBytesLoaded();
var total = _root.getBytesTotal();
percent = (loaded / total) * 100;
this.percent_txt.text = (Math.floor(percent * 10) / 10) + "%";
this.mask_mc._xscale = percent;
if (percent >= 100) {
_root.play();
}
}
Frame 2
stop();
snd_attach("intro_snd", "loop");
Instance of Symbol 298 MovieClip [help_mc] in Frame 2
onClipEvent (load) {
this._xscale = (this._yscale = 0);
this.sTime = getTimer();
duration = 800;
c = 100 - this._xscale;
b = this._xscale;
this.onEnterFrame = function () {
var _local2 = getTimer() - this.sTime;
_local2 = _local2 / duration;
this._xscale = ((((((((c * _local2) * _local2) * _local2) * _local2) * _local2) * _local2) * _local2) * _local2) + b;
this._yscale = this._xscale;
if (_local2 >= 0.98) {
delete this.onEnterFrame;
(this._xscale = (this._yscale = 100));
snd_attach("weapon2_snd");
}
};
}
Frame 3
stop();
game_init();
stage_set();
game_start();
Instance of Symbol 313 MovieClip "target_mc" in Frame 3
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 413 MovieClip "cha_mc" in Frame 3
onClipEvent (load) {
this.gotoAndStop(5);
}
Instance of Symbol 424 MovieClip "bullet_mc" in Frame 3
onClipEvent (load) {
this.totalr = 0;
}
Instance of Symbol 455 MovieClip "ui_item_mc" in Frame 3
onClipEvent (load) {
var i = 1;
while (i <= 3) {
this["item" + i].gotoAndStop(1);
this["item" + i]._visible = false;
i++;
}
}
Symbol 27 MovieClip [fly_score_mc] Frame 22
stop();
delete_item(this);
Symbol 31 MovieClip [bullet_effect1] Frame 14
stop();
_root.delete_item(this);
Symbol 35 MovieClip [bullet_effect2] Frame 11
stop();
_root.delete_item(this);
Symbol 39 MovieClip [bullet_effect3] Frame 11
stop();
_root.delete_item(this);
Symbol 43 MovieClip [bullet_effect4] Frame 13
stop();
_root.delete_item(this);
Symbol 50 MovieClip [bullet_effect5] Frame 14
stop();
_root.delete_item(this);
Symbol 84 MovieClip Frame 9
_root.damage_cha(this._parent);
Symbol 84 MovieClip Frame 19
stop();
delete_item(this._parent);
Symbol 96 MovieClip Frame 10
if (!this._parent.die_jump) {
_root.expire_mc(this._parent);
}
stop();
Symbol 97 MovieClip [evil3_mc] Frame 2
stop();
Symbol 129 MovieClip Frame 11
_root.damage_cha(this._parent);
Symbol 129 MovieClip Frame 16
stop();
delete_item(this._parent);
Symbol 139 MovieClip Frame 7
if (!this._parent.die_jump) {
_root.expire_mc(this._parent);
}
stop();
Symbol 140 MovieClip [evil2_mc] Frame 2
stop();
Symbol 166 MovieClip Frame 9
_root.damage_cha(this._parent);
Symbol 166 MovieClip Frame 12
stop();
delete_item(this._parent);
Symbol 180 MovieClip Frame 11
if (!this._parent.die_jump) {
_root.expire_mc(this._parent);
}
stop();
Symbol 181 MovieClip Frame 18
stop();
this._parent.mode = "run";
this._parent.gotoAndStop("normal");
Symbol 182 MovieClip [evil1_mc] Frame 2
stop();
Symbol 185 MovieClip [damage_rect_mc] Frame 5
stop();
delete_item(this);
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 20
stop();
Symbol 219 Button
on (release, keyPress "<Enter>") {
_root.next_stage();
snd_attach("click2_snd");
}
on (rollOver) {
snd_attach("click1_snd");
}
Symbol 225 Button
on (press) {
getURL ("http://9dragons.acclaim.com/entry.jsp?ref=G9-G001-C04-0307", "new");
}
Symbol 233 Button
on (press) {
getURL ("http://9dragons.acclaim.com/entry.jsp?ref=G9-G001-C02-0307", "new");
}
Symbol 236 Button
on (release, keyPress "<Enter>") {
_root.game_restart();
snd_attach("click2_snd");
}
on (rollOver) {
snd_attach("click1_snd");
}
Symbol 237 Button
on (press) {
getURL ("http://9dragons.acclaim.com/entry.jsp?ref=G9-G001-C02-0307", "new");
}
Symbol 239 Button
on (press) {
getURL ("http://9dragons.acclaim.com/entry.jsp?ref=G9-G001-C02-0307", "new");
}
Symbol 245 MovieClip [ball_mc] Frame 2
stop();
Symbol 277 Button
on (release, keyPress "<Enter>") {
gotoAndStop ("init_after_frame");
snd_attach("click2_snd");
}
on (rollOver) {
snd_attach("click1_snd");
}
Symbol 279 Button
on (press) {
getURL ("http://9dragons.acclaim.com/entry.jsp?ref=G9-G001-C04-0307", "new");
}
Symbol 282 Button
on (release) {
_root.view_help(false);
snd_attach("click2_snd");
}
on (rollOver) {
snd_attach("click1_snd");
}
Symbol 298 MovieClip [help_mc] Frame 10
stop();
Instance of Symbol 285 MovieClip in Symbol 298 MovieClip [help_mc] Frame 29
onClipEvent (load) {
var ty = this._y;
this._alpha = 20;
this._y = this._y - 200;
this.onEnterFrame = function () {
if (this._alpha < 100) {
this._alpha = this._alpha + 5;
}
_root.smoothMove(this, this._x, this.ty, 0.5);
if ((this._alpha >= 100) && (Math.abs(this.ty - this._y) < 1)) {
delete this.onEnterFrame;
this._y = this.ty;
}
};
}
Instance of Symbol 288 MovieClip in Symbol 298 MovieClip [help_mc] Frame 29
onClipEvent (load) {
var ty = this._y;
this._alpha = 20;
this._y = this._y + 200;
this.onEnterFrame = function () {
if (this._alpha < 100) {
this._alpha = this._alpha + 5;
}
_root.smoothMove(this, this._x, this.ty, 0.5);
if ((this._alpha >= 100) && (Math.abs(this.ty - this._y) < 1)) {
delete this.onEnterFrame;
this._y = this.ty;
}
};
}
Instance of Symbol 291 MovieClip in Symbol 298 MovieClip [help_mc] Frame 29
onClipEvent (load) {
var ty = this._y;
this._alpha = 20;
this._y = this._y - 200;
this.onEnterFrame = function () {
if (this._alpha < 100) {
this._alpha = this._alpha + 5;
}
_root.smoothMove(this, this._x, this.ty, 0.5);
if ((this._alpha >= 100) && (Math.abs(this.ty - this._y) < 1)) {
delete this.onEnterFrame;
this._y = this.ty;
}
};
}
Instance of Symbol 294 MovieClip in Symbol 298 MovieClip [help_mc] Frame 29
onClipEvent (load) {
var ty = this._y;
this._alpha = 20;
this._y = this._y - 200;
snd_attach("weapon1_snd");
gamePlayF = function (mc) {
clearInterval(mc.interval);
snd_attach("weapon1_snd");
_root.play();
};
this.onEnterFrame = function () {
if (this._alpha < 100) {
this._alpha = this._alpha + 5;
}
_root.smoothMove(this, this._x, this.ty, 0.5);
if ((this._alpha >= 100) && (Math.abs(this.ty - this._y) < 1)) {
delete this.onEnterFrame;
this._y = this.ty;
this.interval = setInterval(this.gamePlayF, 500, this);
}
};
}
Instance of Symbol 296 MovieClip in Symbol 298 MovieClip [help_mc] Frame 29
on (press) {
getURL ("http://www.ninedragons.co.kr/", "_blank");
}
Symbol 324 MovieClip Frame 2
stop();
Symbol 324 MovieClip Frame 5
_parent.chk_shoot();
Symbol 324 MovieClip Frame 12
this._parent.shoot_chk = undefined;
stop();
Symbol 335 MovieClip Frame 2
stop();
Symbol 335 MovieClip Frame 5
_parent.chk_shoot();
Symbol 335 MovieClip Frame 12
this._parent.shoot_chk = undefined;
stop();
Symbol 346 MovieClip Frame 2
stop();
Symbol 346 MovieClip Frame 5
_parent.chk_shoot();
Symbol 346 MovieClip Frame 12
this._parent.shoot_chk = undefined;
stop();
Symbol 357 MovieClip Frame 2
stop();
Symbol 357 MovieClip Frame 5
_parent.chk_shoot();
Symbol 357 MovieClip Frame 12
this._parent.shoot_chk = undefined;
stop();
Symbol 368 MovieClip Frame 2
stop();
Symbol 368 MovieClip Frame 5
_parent.chk_shoot();
Symbol 368 MovieClip Frame 12
this._parent.shoot_chk = undefined;
stop();
Symbol 379 MovieClip Frame 2
stop();
Symbol 379 MovieClip Frame 5
_parent.chk_shoot();
Symbol 379 MovieClip Frame 12
this._parent.shoot_chk = undefined;
stop();
Symbol 390 MovieClip Frame 2
stop();
Symbol 390 MovieClip Frame 5
_parent.chk_shoot();
Symbol 390 MovieClip Frame 12
this._parent.shoot_chk = undefined;
stop();
Symbol 401 MovieClip Frame 2
stop();
Symbol 401 MovieClip Frame 4
_parent.chk_shoot();
Symbol 401 MovieClip Frame 12
this._parent.shoot_chk = undefined;
stop();
Symbol 412 MovieClip Frame 2
stop();
Symbol 412 MovieClip Frame 5
_parent.chk_shoot();
Symbol 412 MovieClip Frame 12
this._parent.shoot_chk = undefined;
stop();
Symbol 413 MovieClip Frame 1
chk_shoot = function () {
if (_root.useItemChk) {
_root.shootItem();
} else {
_root.shoot();
}
};
Symbol 423 MovieClip Frame 3
stop();