Section 1
//arrowammo_icon_36 (shunpo_fla.arrowammo_icon_36)
package shunpo_fla {
import flash.display.*;
import flash.text.*;
public dynamic class arrowammo_icon_36 extends MovieClip {
public var arrowtext:TextField;
}
}//package shunpo_fla
Section 2
//banner_115 (shunpo_fla.banner_115)
package shunpo_fla {
import flash.display.*;
public dynamic class banner_115 extends MovieClip {
public function banner_115(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 3
//birdstop_221 (shunpo_fla.birdstop_221)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class birdstop_221 extends MovieClip {
public var temp:int;
public function birdstop_221(){
addFrameScript(0, frame1, 8, frame9, 18, frame19, 28, frame29, 38, frame39, 40, frame41, 42, frame43);
}
function frame1(){
}
function frame19(){
if ((Math.random() * 8) < 7){
this.gotoAndPlay(10);
} else {
temp = (Math.random() * 5);
if (temp == 0){
this.gotoAndPlay(1);
} else {
if (temp == 1){
this.gotoAndPlay(10);
} else {
if (temp == 2){
this.gotoAndPlay(20);
} else {
if (temp == 3){
this.gotoAndPlay(30);
} else {
if (temp == 4){
this.gotoAndPlay(40);
};
};
};
};
};
if ((Math.random() * 10) < 1){
this.scaleX = -(this.scaleX);
};
};
}
function frame9(){
if ((Math.random() * 8) < 7){
this.gotoAndPlay(1);
} else {
temp = (Math.random() * 5);
if (temp == 0){
this.gotoAndPlay(1);
} else {
if (temp == 1){
this.gotoAndPlay(10);
} else {
if (temp == 2){
this.gotoAndPlay(20);
} else {
if (temp == 3){
this.gotoAndPlay(30);
} else {
if (temp == 4){
this.gotoAndPlay(40);
};
};
};
};
};
if ((Math.random() * 10) < 1){
this.scaleX = -(this.scaleX);
};
if ((Math.random() * 10) < 1){
MovieClip(this.parent).flyaway();
};
};
}
function frame29(){
if ((Math.random() * 8) < 7){
this.gotoAndPlay(20);
} else {
temp = (Math.random() * 5);
if (temp == 0){
this.gotoAndPlay(1);
} else {
if (temp == 1){
this.gotoAndPlay(10);
} else {
if (temp == 2){
this.gotoAndPlay(20);
} else {
if (temp == 3){
this.gotoAndPlay(30);
} else {
if (temp == 4){
this.gotoAndPlay(40);
};
};
};
};
};
if ((Math.random() * 10) < 1){
this.scaleX = -(this.scaleX);
};
};
}
function frame39(){
if ((Math.random() * 2) < 1){
this.gotoAndPlay(30);
} else {
this.gotoAndPlay(1);
};
}
function frame43(){
this.gotoAndPlay(1);
}
function frame41(){
if (!MovieClip(parent).onscarecrow){
if (this.scaleX < 0){
this.x = (this.x + 7);
} else {
this.x = (this.x - 7);
};
};
}
}
}//package shunpo_fla
Section 4
//bloodspurt_191 (shunpo_fla.bloodspurt_191)
package shunpo_fla {
import flash.display.*;
public dynamic class bloodspurt_191 extends MovieClip {
public function bloodspurt_191(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package shunpo_fla
Section 5
//bossdialoganim_147 (shunpo_fla.bossdialoganim_147)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class bossdialoganim_147 extends MovieClip {
public var enemydialog:MovieClip;
public function bossdialoganim_147(){
addFrameScript(0, frame1, 1, frame2, 11, frame12, 23, frame24);
}
function frame12(){
stop();
}
function frame1(){
enemydialog.visible = false;
stop();
}
function frame24(){
stop();
enemydialog.visible = false;
}
function frame2(){
enemydialog.visible = true;
enemydialog.buttonMode = true;
enemydialog.addEventListener(MouseEvent.CLICK, enemydialogEvent);
}
public function enemydialogEvent(_arg1:Event):void{
this.play();
StatsManager.instance.bossDialogClick();
}
}
}//package shunpo_fla
Section 6
//bowdialog_135 (shunpo_fla.bowdialog_135)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class bowdialog_135 extends MovieClip {
public var btn2:SimpleButton;
public var btn1:SimpleButton;
public function bowdialog_135(){
addFrameScript(0, frame1);
}
public function btn1ClickEvent(_arg1:Event):void{
this.visible = false;
StatsManager.instance.location = 37;
MovieClip(parent.parent).transition.gotoAndPlay(25);
}
function frame1(){
btn1.addEventListener(MouseEvent.CLICK, btn1ClickEvent);
btn2.addEventListener(MouseEvent.CLICK, btn2ClickEvent);
}
public function btn2ClickEvent(_arg1:Event):void{
this.visible = false;
}
}
}//package shunpo_fla
Section 7
//catapultdialog_141 (shunpo_fla.catapultdialog_141)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class catapultdialog_141 extends MovieClip {
public var btn2:SimpleButton;
public var btn1:SimpleButton;
public function catapultdialog_141(){
addFrameScript(0, frame1);
}
public function cbtn2ClickEvent(_arg1:Event):void{
this.visible = false;
StatsManager.instance.fireAtCamp();
}
function frame1(){
btn1.addEventListener(MouseEvent.CLICK, cbtn1ClickEvent);
btn2.addEventListener(MouseEvent.CLICK, cbtn2ClickEvent);
}
public function cbtn1ClickEvent(_arg1:Event):void{
this.visible = false;
StatsManager.instance.fireAtGate();
}
}
}//package shunpo_fla
Section 8
//dashcloud_183 (shunpo_fla.dashcloud_183)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class dashcloud_183 extends MovieClip {
public function dashcloud_183(){
addFrameScript(0, frame1);
}
function frame1(){
this.visible = MovieClip(parent.parent.parent).shouldDrawSmoke();
}
}
}//package shunpo_fla
Section 9
//enemy_shieldarm_270 (shunpo_fla.enemy_shieldarm_270)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy_shieldarm_270 extends MovieClip {
public var shield:MovieClip;
}
}//package shunpo_fla
Section 10
//enemy1_attack_238 (shunpo_fla.enemy1_attack_238)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy1_attack_238 extends MovieClip {
public var head:MovieClip;
public function enemy1_attack_238(){
addFrameScript(15, frame16, 19, frame20);
}
function frame16(){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon);
}
function frame20(){
MovieClip(parent.parent).moveAgain();
}
}
}//package shunpo_fla
Section 11
//enemy1_die_2_250 (shunpo_fla.enemy1_die_2_250)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy1_die_2_250 extends MovieClip {
public var pt;
public var xpos;
public var xvel;
public var bp;
public var bloodspurt:MovieClip;
public var marker:MovieClip;
public var rot;
public var head;
public function enemy1_die_2_250(){
addFrameScript(1, frame2, 18, frame19, 29, frame30);
}
function frame30(){
stop();
MovieClip(parent.parent).deathAnimDone = true;
}
function frame19(){
if (bp != null){
bp.setActive(false);
};
}
function frame2(){
if ((((Player.stageMode == 1)) || (ParticleSystemManager.isAbleToSupport()))){
bp = ParticleSystemManager.instance.createParticleSystem(BloodParticleSystem.typeCode, 0, 0, this);
bp.setMarker(marker);
bp.setNumber(10);
bp.setVel(6);
bloodspurt.visible = false;
};
marker.visible = false;
xvel = ((Math.random() * 3) + 3);
xpos = 0;
rot = -(((Math.random() * 10) + 10));
if ((Math.random() * 2) < 1){
xvel = -(xvel);
xpos = 50;
rot = -(rot);
};
pt = new Point(xpos, (-80 - (Math.random() * 20)));
pt = this.localToGlobal(pt);
pt = EnemyManager.instance.getGameStage().globalToLocal(pt);
head = ProjectileManager.instance.createProjectile(3, pt.x, pt.y, xvel, ((Math.random() * 3) + 3));
head.rot = rot;
}
}
}//package shunpo_fla
Section 12
//enemy1_die_240 (shunpo_fla.enemy1_die_240)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy1_die_240 extends MovieClip {
public var bp;
public var bloodspurt:MovieClip;
public var marker:MovieClip;
public function enemy1_die_240(){
addFrameScript(1, frame2, 18, frame19, 29, frame30);
}
function frame19(){
if (bp != null){
bp.setActive(false);
};
}
function frame30(){
stop();
MovieClip(parent.parent).deathAnimDone = true;
}
function frame2(){
if ((((Player.stageMode == 1)) || (ParticleSystemManager.isAbleToSupport()))){
bp = ParticleSystemManager.instance.createParticleSystem(BloodParticleSystem.typeCode, 0, 0, this);
bp.setMarker(marker);
bloodspurt.visible = false;
};
marker.visible = false;
}
}
}//package shunpo_fla
Section 13
//enemy1_die_3_245 (shunpo_fla.enemy1_die_3_245)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy1_die_3_245 extends MovieClip {
public var pt;
public var xpos;
public var xvel;
public var bp;
public var arm;
public var bloodspurt:MovieClip;
public var marker:MovieClip;
public var xscale;
public var rot;
public function enemy1_die_3_245(){
addFrameScript(1, frame2, 18, frame19, 29, frame30);
}
function frame30(){
stop();
MovieClip(parent.parent).deathAnimDone = true;
}
function frame19(){
if (bp != null){
bp.setActive(false);
};
}
function frame2(){
if ((((Player.stageMode == 1)) || (ParticleSystemManager.isAbleToSupport()))){
bp = ParticleSystemManager.instance.createParticleSystem(BloodParticleSystem.typeCode, 0, 0, this);
bp.setMarker(marker);
bp.setNumber(10);
bloodspurt.visible = false;
};
marker.visible = false;
xvel = ((Math.random() * 3) + 5);
xpos = 0;
rot = ((Math.random() * 10) + 15);
xscale = -1;
if (MovieClip(parent.parent).currentFrame == 1){
xvel = -(xvel);
xpos = 30;
rot = -(rot);
xscale = 1;
};
pt = new Point(xpos, -30);
pt = this.localToGlobal(pt);
pt = EnemyManager.instance.getGameStage().globalToLocal(pt);
arm = ProjectileManager.instance.createProjectile(4, pt.x, pt.y, xvel, ((Math.random() * 3) + 3));
arm.rot = rot;
arm.scaleX = xscale;
}
}
}//package shunpo_fla
Section 14
//enemy1_die_byarrow1_255 (shunpo_fla.enemy1_die_byarrow1_255)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy1_die_byarrow1_255 extends MovieClip {
public var bp;
public var bloodspurt:MovieClip;
public var marker:MovieClip;
public function enemy1_die_byarrow1_255(){
addFrameScript(1, frame2, 5, frame6, 31, frame32);
}
function frame6(){
if (bp != null){
bp.setActive(false);
};
}
function frame2(){
if ((((Player.stageMode == 1)) || (ParticleSystemManager.isAbleToSupport()))){
bp = ParticleSystemManager.instance.createParticleSystem(BloodParticleSystem.typeCode, 0, 0, this);
bp.setMarker(marker);
bp.setNumber(15);
bp.setVel(12);
bloodspurt.visible = false;
};
marker.visible = false;
}
function frame32(){
stop();
MovieClip(parent.parent).deathAnimDone = true;
}
}
}//package shunpo_fla
Section 15
//enemy1_direction_235 (shunpo_fla.enemy1_direction_235)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy1_direction_235 extends MovieClip {
public var enemy:MovieClip;
public function enemy1_direction_235(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 16
//enemy1_stop_84 (shunpo_fla.enemy1_stop_84)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy1_stop_84 extends MovieClip {
public var head:MovieClip;
}
}//package shunpo_fla
Section 17
//enemy1_walk_236 (shunpo_fla.enemy1_walk_236)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy1_walk_236 extends MovieClip {
public var head:MovieClip;
}
}//package shunpo_fla
Section 18
//enemy2_aimingtop_290 (shunpo_fla.enemy2_aimingtop_290)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy2_aimingtop_290 extends MovieClip {
public var bow:MovieClip;
public var head:MovieClip;
public function enemy2_aimingtop_290(){
addFrameScript(0, frame1);
}
function frame1(){
if (!MovieClip(root).pauseGame){
this.rotation = MovieClip(parent.parent.parent).getAimAngle(this);
};
}
}
}//package shunpo_fla
Section 19
//enemy2_aimingtop2_291 (shunpo_fla.enemy2_aimingtop2_291)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy2_aimingtop2_291 extends MovieClip {
public var bow:MovieClip;
public var head:MovieClip;
public function enemy2_aimingtop2_291(){
addFrameScript(0, frame1);
}
function frame1(){
this.rotation = MovieClip(parent.parent.parent).lastAimAngle;
}
}
}//package shunpo_fla
Section 20
//enemy2_direction_286 (shunpo_fla.enemy2_direction_286)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy2_direction_286 extends MovieClip {
public var enemy:MovieClip;
public function enemy2_direction_286(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 21
//enemy2_shoot_289 (shunpo_fla.enemy2_shoot_289)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy2_shoot_289 extends MovieClip {
public var bow:MovieClip;
public var head:MovieClip;
public var aimtop:MovieClip;
public function enemy2_shoot_289(){
addFrameScript(3, frame4, 4, frame5, 19, frame20);
}
function frame20(){
MovieClip(parent.parent).doStop();
}
function frame4(){
if ((Math.random() * 2) < 1){
this.gotoAndPlay(1);
};
}
function frame5(){
MovieClip(parent.parent).shootArrow(aimtop.bow);
}
}
}//package shunpo_fla
Section 22
//enemy2_stop_89 (shunpo_fla.enemy2_stop_89)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy2_stop_89 extends MovieClip {
public var bow:MovieClip;
public var head:MovieClip;
}
}//package shunpo_fla
Section 23
//enemy2_walking_287 (shunpo_fla.enemy2_walking_287)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy2_walking_287 extends MovieClip {
public var bow:MovieClip;
public var head:MovieClip;
}
}//package shunpo_fla
Section 24
//enemy3_attack_279 (shunpo_fla.enemy3_attack_279)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy3_attack_279 extends MovieClip {
public var weapon:MovieClip;
public var head:MovieClip;
public function enemy3_attack_279(){
addFrameScript(2, frame3, 3, frame4, 4, frame5, 19, frame20);
}
function frame3(){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon);
}
function frame20(){
MovieClip(parent.parent).moveAgain();
MovieClip(parent.parent).setReload(false);
}
function frame4(){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon);
}
function frame5(){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon);
MovieClip(parent.parent).setReload(true);
}
}
}//package shunpo_fla
Section 25
//enemy3_direction_277 (shunpo_fla.enemy3_direction_277)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy3_direction_277 extends MovieClip {
public var enemy:MovieClip;
public function enemy3_direction_277(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 26
//enemy3_stop_95 (shunpo_fla.enemy3_stop_95)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy3_stop_95 extends MovieClip {
public var weapon:MovieClip;
public var head:MovieClip;
}
}//package shunpo_fla
Section 27
//enemy3_walk_278 (shunpo_fla.enemy3_walk_278)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy3_walk_278 extends MovieClip {
public var weapon:MovieClip;
public var head:MovieClip;
}
}//package shunpo_fla
Section 28
//enemy4_attack_284 (shunpo_fla.enemy4_attack_284)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy4_attack_284 extends MovieClip {
public var weapon:MovieClip;
public var head:MovieClip;
public function enemy4_attack_284(){
addFrameScript(0, frame1, 5, frame6);
}
function frame6(){
if (MovieClip(parent.parent).isNearPlayer()){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon.tip);
};
}
function frame1(){
if (MovieClip(parent.parent).isNearPlayer()){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon.tip);
};
}
}
}//package shunpo_fla
Section 29
//enemy4_direction_282 (shunpo_fla.enemy4_direction_282)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy4_direction_282 extends MovieClip {
public var enemy:MovieClip;
public function enemy4_direction_282(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 30
//enemy4_stop_75 (shunpo_fla.enemy4_stop_75)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy4_stop_75 extends MovieClip {
public var head:MovieClip;
}
}//package shunpo_fla
Section 31
//enemy4_walk_283 (shunpo_fla.enemy4_walk_283)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy4_walk_283 extends MovieClip {
public var head:MovieClip;
}
}//package shunpo_fla
Section 32
//enemy5_attack_274 (shunpo_fla.enemy5_attack_274)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy5_attack_274 extends MovieClip {
public var shield:MovieClip;
public var head:MovieClip;
public function enemy5_attack_274(){
addFrameScript(11, frame12, 19, frame20);
}
function frame12(){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon);
}
function frame20(){
MovieClip(parent.parent).actionState = 1;
}
}
}//package shunpo_fla
Section 33
//enemy5_direction_268 (shunpo_fla.enemy5_direction_268)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy5_direction_268 extends MovieClip {
public var enemy:MovieClip;
public function enemy5_direction_268(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 9, frame10);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 34
//enemy5_squat_269 (shunpo_fla.enemy5_squat_269)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy5_squat_269 extends MovieClip {
public var shield:MovieClip;
public var head:MovieClip;
public function enemy5_squat_269(){
addFrameScript(2, frame3);
}
function frame3(){
stop();
}
}
}//package shunpo_fla
Section 35
//enemy5_stop_275 (shunpo_fla.enemy5_stop_275)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy5_stop_275 extends MovieClip {
public var shield:MovieClip;
}
}//package shunpo_fla
Section 36
//enemy5_walk_272 (shunpo_fla.enemy5_walk_272)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy5_walk_272 extends MovieClip {
public var shield:MovieClip;
public var head:MovieClip;
}
}//package shunpo_fla
Section 37
//enemy6_attack_260 (shunpo_fla.enemy6_attack_260)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy6_attack_260 extends MovieClip {
public var weapon:MovieClip;
public var weapon1:MovieClip;
public var weapon2:MovieClip;
public function enemy6_attack_260(){
addFrameScript(10, frame11, 22, frame23, 23, frame24, 24, frame25, 29, frame30);
}
function frame25(){
if (MovieClip(parent.parent).isNearPlayer()){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon1);
};
if (MovieClip(parent.parent).isNearPlayer()){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon2);
};
}
function frame23(){
if (MovieClip(parent.parent).isNearPlayer()){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon1);
};
}
function frame24(){
if (MovieClip(parent.parent).isNearPlayer()){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon1);
};
}
function frame30(){
if (MovieClip(parent.parent).isNearPlayer()){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon1);
};
if (MovieClip(parent.parent).isNearPlayer()){
MovieClip(parent.parent).checkEnemyWeaponHitPlayer(this.weapon2);
};
gotoAndPlay(1);
}
function frame11(){
this.gotoAndPlay(1);
}
}
}//package shunpo_fla
Section 38
//enemy6_die_262 (shunpo_fla.enemy6_die_262)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy6_die_262 extends MovieClip {
public var bp;
public var bloodspurt:MovieClip;
public var marker:MovieClip;
public function enemy6_die_262(){
addFrameScript(0, frame1, 58, frame59, 59, frame60);
}
function frame1(){
if ((((Player.stageMode == 1)) || (ParticleSystemManager.isAbleToSupport()))){
bp = ParticleSystemManager.instance.createParticleSystem(BloodParticleSystem.typeCode, 0, 0, this);
bp.setMarker(marker);
bp.setVel(10);
bloodspurt.visible = false;
};
marker.visible = false;
}
function frame59(){
if (bp != null){
bp.setActive(false);
};
}
function frame60(){
stop();
MovieClip(parent.parent).deathAnimDone = true;
}
}
}//package shunpo_fla
Section 39
//enemy6_direction_257 (shunpo_fla.enemy6_direction_257)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy6_direction_257 extends MovieClip {
public var enemy:MovieClip;
public function enemy6_direction_257(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 9, frame10, 10, frame11);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
function frame11(){
stop();
}
}
}//package shunpo_fla
Section 40
//enemy6_jump_264 (shunpo_fla.enemy6_jump_264)
package shunpo_fla {
import flash.display.*;
public dynamic class enemy6_jump_264 extends MovieClip {
public var weapon:MovieClip;
}
}//package shunpo_fla
Section 41
//enemy6_jumpstart_263 (shunpo_fla.enemy6_jumpstart_263)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy6_jumpstart_263 extends MovieClip {
public var enemy:MovieClip;
public var dashcloud2:MovieClip;
public var dashcloud1:MovieClip;
public function enemy6_jumpstart_263(){
addFrameScript(14, frame15);
}
function frame15(){
MovieClip(parent.parent).jumpDownStart();
stop();
}
}
}//package shunpo_fla
Section 42
//enemy6_throwspear_265 (shunpo_fla.enemy6_throwspear_265)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class enemy6_throwspear_265 extends MovieClip {
public var weapon:MovieClip;
public function enemy6_throwspear_265(){
addFrameScript(7, frame8);
}
function frame8(){
MovieClip(parent.parent).throwSpear();
}
}
}//package shunpo_fla
Section 43
//enemycatapultoperator_294 (shunpo_fla.enemycatapultoperator_294)
package shunpo_fla {
import flash.display.*;
public dynamic class enemycatapultoperator_294 extends MovieClip {
public var head:MovieClip;
public function enemycatapultoperator_294(){
addFrameScript(0, frame1, 20, frame21, 39, frame40);
}
function frame1(){
stop();
}
function frame21(){
gotoAndPlay(1);
}
function frame40(){
stop();
}
}
}//package shunpo_fla
Section 44
//enemydialog_145 (shunpo_fla.enemydialog_145)
package shunpo_fla {
import flash.display.*;
import flash.text.*;
public dynamic class enemydialog_145 extends MovieClip {
public var words:TextField;
public var pic1:MovieClip;
}
}//package shunpo_fla
Section 45
//enemydialoganim_144 (shunpo_fla.enemydialoganim_144)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class enemydialoganim_144 extends MovieClip {
public var enemydialog:MovieClip;
public function enemydialoganim_144(){
addFrameScript(0, frame1, 1, frame2, 11, frame12, 23, frame24);
}
function frame12(){
stop();
}
function frame1(){
enemydialog.visible = false;
stop();
}
function frame24(){
stop();
enemydialog.visible = false;
}
function frame2(){
enemydialog.visible = true;
enemydialog.buttonMode = true;
enemydialog.addEventListener(MouseEvent.CLICK, enemydialogEvent);
}
public function enemydialogEvent(_arg1:Event):void{
this.play();
StatsManager.instance.enemyDialogClick();
}
}
}//package shunpo_fla
Section 46
//enemyicon_82 (shunpo_fla.enemyicon_82)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class enemyicon_82 extends MovieClip {
public var enemy:MovieClip;
public function enemyicon_82(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
enemy.buttonMode = true;
enemy.addEventListener(MouseEvent.CLICK, enemyEvent);
}
public function enemyEvent(_arg1:Event):void{
StatsManager.instance.gotoLevel(StatsManager.instance.getPatrolLocation(this));
}
}
}//package shunpo_fla
Section 47
//enemyicon_individual_83 (shunpo_fla.enemyicon_individual_83)
package shunpo_fla {
import flash.display.*;
public dynamic class enemyicon_individual_83 extends MovieClip {
public var katana:MovieClip;
public var shield:MovieClip;
public var enemy:MovieClip;
public var spear:MovieClip;
public var sword:MovieClip;
}
}//package shunpo_fla
Section 48
//foreground_11 (shunpo_fla.foreground_11)
package shunpo_fla {
import flash.display.*;
public dynamic class foreground_11 extends MovieClip {
public var g3:MovieClip;
public var g1:MovieClip;
public var g2:MovieClip;
public function foreground_11(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 49
//founddialog_125 (shunpo_fla.founddialog_125)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class founddialog_125 extends MovieClip {
public var btn2:SimpleButton;
public var btn1:SimpleButton;
public function founddialog_125(){
addFrameScript(0, frame1);
}
public function btn1ClickEvent(_arg1:Event):void{
this.visible = false;
StatsManager.instance.hp = (StatsManager.instance.hp + 10);
StatsManager.instance.totalItems++;
}
function frame1(){
btn1.addEventListener(MouseEvent.CLICK, btn1ClickEvent);
btn2.addEventListener(MouseEvent.CLICK, btn2ClickEvent);
}
public function btn2ClickEvent(_arg1:Event):void{
this.visible = false;
StatsManager.instance.armor++;
StatsManager.instance.totalItems++;
}
}
}//package shunpo_fla
Section 50
//friendlyicon_99 (shunpo_fla.friendlyicon_99)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class friendlyicon_99 extends MovieClip {
public var friendly:MovieClip;
public function friendlyicon_99(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
friendly.buttonMode = true;
friendly.addEventListener(MouseEvent.CLICK, friendlyEvent);
}
public function friendlyEvent(_arg1:Event):void{
StatsManager.instance.gotoLevel(StatsManager.instance.getFriendlyLocation(this));
}
}
}//package shunpo_fla
Section 51
//friendlyicon_individual_100 (shunpo_fla.friendlyicon_individual_100)
package shunpo_fla {
import flash.display.*;
public dynamic class friendlyicon_individual_100 extends MovieClip {
public var katana:MovieClip;
public var shield:MovieClip;
public var enemy:MovieClip;
public var spear:MovieClip;
public var sword:MovieClip;
}
}//package shunpo_fla
Section 52
//friendlyspear_105 (shunpo_fla.friendlyspear_105)
package shunpo_fla {
import flash.display.*;
public dynamic class friendlyspear_105 extends MovieClip {
public var tip:MovieClip;
}
}//package shunpo_fla
Section 53
//gate_113 (shunpo_fla.gate_113)
package shunpo_fla {
import flash.display.*;
public dynamic class gate_113 extends MovieClip {
public function gate_113(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package shunpo_fla
Section 54
//grass_12 (shunpo_fla.grass_12)
package shunpo_fla {
import flash.display.*;
public dynamic class grass_12 extends MovieClip {
public function grass_12(){
addFrameScript(28, frame29);
}
function frame29(){
if ((Math.random() * 5) > 3){
this.gotoAndPlay(21);
};
}
}
}//package shunpo_fla
Section 55
//guardtower_people_232 (shunpo_fla.guardtower_people_232)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class guardtower_people_232 extends MovieClip {
public var enemy:MovieClip;
public function guardtower_people_232(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 20, frame21, 24, frame25);
}
function frame1(){
stop();
this.down = false;
}
function frame25(){
stop();
this.down = false;
}
function frame13(){
stop();
this.down = true;
}
function frame21(){
if ((Math.random() * 3) < 1){
gotoAndPlay(20);
};
}
function frame11(){
if ((Math.random() * 3) < 1){
gotoAndPlay(10);
};
}
}
}//package shunpo_fla
Section 56
//guardtowericon_112 (shunpo_fla.guardtowericon_112)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class guardtowericon_112 extends MovieClip {
public function guardtowericon_112(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
stop();
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, clickEvent);
}
function frame2(){
stop();
}
public function clickEvent(_arg1:Event):void{
StatsManager.instance.gotoLevel(13);
}
}
}//package shunpo_fla
Section 57
//healthbar_38 (shunpo_fla.healthbar_38)
package shunpo_fla {
import flash.display.*;
public dynamic class healthbar_38 extends MovieClip {
public function healthbar_38(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 58
//hexdialog_128 (shunpo_fla.hexdialog_128)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class hexdialog_128 extends MovieClip {
public var next:SimpleButton;
public var btn1:SimpleButton;
public var selected:MovieClip;
public var back:SimpleButton;
public function hexdialog_128(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
public function btn1ClickEvent(_arg1:Event):void{
this.visible = false;
}
public function back3ClickEvent(_arg1:Event):void{
this.gotoAndPlay(3);
}
public function nextClickEvent(_arg1:Event):void{
nextFrame();
}
function frame3(){
btn1.addEventListener(MouseEvent.CLICK, btn1ClickEvent);
next.addEventListener(MouseEvent.CLICK, nextClickEvent);
back.addEventListener(MouseEvent.CLICK, back2ClickEvent);
stop();
}
function frame6(){
btn1.addEventListener(MouseEvent.CLICK, btn1ClickEvent);
back.addEventListener(MouseEvent.CLICK, back5ClickEvent);
stop();
}
function frame1(){
btn1.addEventListener(MouseEvent.CLICK, btn1ClickEvent);
next.addEventListener(MouseEvent.CLICK, nextClickEvent);
stop();
}
function frame4(){
btn1.addEventListener(MouseEvent.CLICK, btn1ClickEvent);
next.addEventListener(MouseEvent.CLICK, nextClickEvent);
back.addEventListener(MouseEvent.CLICK, back3ClickEvent);
stop();
}
function frame5(){
btn1.addEventListener(MouseEvent.CLICK, btn1ClickEvent);
next.addEventListener(MouseEvent.CLICK, nextClickEvent);
back.addEventListener(MouseEvent.CLICK, back4ClickEvent);
stop();
}
public function back2ClickEvent(_arg1:Event):void{
this.gotoAndPlay(2);
}
function frame2(){
btn1.addEventListener(MouseEvent.CLICK, btn1ClickEvent);
next.addEventListener(MouseEvent.CLICK, nextClickEvent);
back.addEventListener(MouseEvent.CLICK, back1ClickEvent);
stop();
}
public function back1ClickEvent(_arg1:Event):void{
this.gotoAndPlay(1);
}
public function back5ClickEvent(_arg1:Event):void{
this.gotoAndPlay(5);
}
public function back4ClickEvent(_arg1:Event):void{
this.gotoAndPlay(4);
}
}
}//package shunpo_fla
Section 59
//hexgrid_111 (shunpo_fla.hexgrid_111)
package shunpo_fla {
import flash.display.*;
public dynamic class hexgrid_111 extends MovieClip {
public var hex_3_0:Hex;
public var hex_3_1:Hex;
public var hex_3_3:Hex;
public var hex_3_5:Hex;
public var hex_3_4:Hex;
public var hex_3_6:Hex;
public var hex_3_7:Hex;
public var hex_3_8:Hex;
public var hex_3_2:Hex;
public var hex_3_9:Hex;
public var hex_2_0:Hex;
public var hex_2_4:Hex;
public var hex_2_5:Hex;
public var hex_2_6:Hex;
public var hex_2_7:Hex;
public var hex_2_9:Hex;
public var hex_2_3:Hex;
public var hex_3_11:Hex;
public var hex_3_10:Hex;
public var hex_1_1:Hex;
public var hex_1_2:Hex;
public var hex_1_5:Hex;
public var hex_1_6:Hex;
public var hex_1_4:Hex;
public var hex_1_7:Hex;
public var hex_1_8:Hex;
public var hex_1_3:Hex;
public var hex_9_5:Hex;
public var hex_9_8:Hex;
public var hex_9_6:Hex;
public var hex_1_0:Hex;
public var hex_9_4:Hex;
public var hex_4_10:Hex;
public var hex_9_7:Hex;
public var hex_10_4:Hex;
public var hex_10_5:Hex;
public var hex_10_6:Hex;
public var hex_10_7:Hex;
public var hex_0_0:Hex;
public var hex_0_1:Hex;
public var hex_0_2:Hex;
public var hex_0_4:Hex;
public var hex_0_5:Hex;
public var hex_0_6:Hex;
public var hex_0_7:Hex;
public var hex_0_8:Hex;
public var hex_0_9:Hex;
public var hex_0_3:Hex;
public var hex_8_4:Hex;
public var hex_8_5:Hex;
public var hex_8_6:Hex;
public var hex_8_7:Hex;
public var hex_8_8:Hex;
public var hex_7_4:Hex;
public var hex_7_5:Hex;
public var hex_7_7:Hex;
public var hex_5_10:Hex;
public var hex_7_9:Hex;
public var hex_5_11:Hex;
public var hex_7_6:Hex;
public var hex_7_8:Hex;
public var hex_0_10:Hex;
public var hex_6_5:Hex;
public var hex_6_6:Hex;
public var hex_6_9:Hex;
public var hex_6_3:Hex;
public var hex_6_8:Hex;
public var hex_5_1:Hex;
public var hex_5_5:Hex;
public var hex_5_7:Hex;
public var hex_5_2:Hex;
public var hex_5_6:Hex;
public var hex_1_11:Hex;
public var hex_5_0:Hex;
public var hex_5_4:Hex;
public var hex_5_3:Hex;
public var hex_1_10:Hex;
public var hex_4_0:Hex;
public var hex_4_4:Hex;
public var hex_4_7:Hex;
public var hex_4_8:Hex;
public var hex_4_5:Hex;
public var hex_4_6:Hex;
public var hex_4_3:Hex;
public var hex_2_10:Hex;
}
}//package shunpo_fla
Section 60
//hexinside_48 (shunpo_fla.hexinside_48)
package shunpo_fla {
import flash.display.*;
public dynamic class hexinside_48 extends MovieClip {
public function hexinside_48(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 61
//hexplayericon_116 (shunpo_fla.hexplayericon_116)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class hexplayericon_116 extends MovieClip {
public var selected:MovieClip;
public var highlight:MovieClip;
public var hexplayer:MovieClip;
public function hexplayericon_116(){
addFrameScript(0, frame1);
}
function frame1(){
highlight.visible = false;
selected.visible = false;
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, phexClickEvent);
this.addEventListener(MouseEvent.MOUSE_OVER, phexOverEvent);
this.addEventListener(MouseEvent.MOUSE_OUT, phexOutEvent);
}
public function phexOutEvent(_arg1:Event):void{
highlight.visible = false;
}
public function phexOverEvent(_arg1:Event):void{
if (HexManager.heroLocation.side == 2){
highlight.visible = true;
};
}
public function phexClickEvent(_arg1:Event):void{
HexManager.playerHexClick(this);
}
}
}//package shunpo_fla
Section 62
//introanim_154 (shunpo_fla.introanim_154)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class introanim_154 extends MovieClip {
public var closebutton:SimpleButton;
public var clicky2:SimpleButton;
public var clicky:SimpleButton;
public function introanim_154(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
}
public function clicky2ClickEvent(_arg1:Event):void{
this.visible = false;
StatsManager.instance.map.gui.missionstart.gotoAndPlay(2);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
closebutton.addEventListener(MouseEvent.CLICK, closebuttonClickEvent);
clicky.addEventListener(MouseEvent.CLICK, clickyClickEvent);
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
function frame11(){
stop();
clicky2.addEventListener(MouseEvent.CLICK, clicky2ClickEvent);
}
public function closebuttonClickEvent(_arg1:Event):void{
this.visible = false;
StatsManager.instance.map.gui.missionstart.gotoAndPlay(2);
}
public function clickyClickEvent(_arg1:Event):void{
this.nextFrame();
}
}
}//package shunpo_fla
Section 63
//location_72 (shunpo_fla.location_72)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class location_72 extends MovieClip {
public var chest:MovieClip;
public function location_72(){
addFrameScript(0, frame1, 1, frame2);
}
public function locationMouseOutEvent(_arg1:Event):void{
gotoAndStop(1);
}
public function locationMouseOverEvent(_arg1:Event):void{
gotoAndStop(2);
}
function frame1(){
stop();
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_OVER, locationMouseOverEvent);
this.addEventListener(MouseEvent.MOUSE_OUT, locationMouseOutEvent);
this.addEventListener(MouseEvent.MOUSE_UP, locationMouseUpEvent);
}
function frame2(){
stop();
}
public function locationMouseUpEvent(_arg1:Event):void{
var _local2:*;
_local2 = this.name.substr(6);
StatsManager.instance.gotoLevel(_local2);
}
}
}//package shunpo_fla
Section 64
//MainTimeline (shunpo_fla.MainTimeline)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var overworldMode:Boolean;
public var statsManager;
public var gameStage:MovieClip;
public var hinttext:TextField;
public var hptext:TextField;
public var healthbar:MovieClip;
public var t2:tree2;
public var t3:tree2;
public var t1:tree1;
public var smallsticker:SimpleButton;
public var t4:tree1;
public var loadingtext:TextField;
public var mutebutton:MovieClip;
public var f2:MovieClip;
public var redbg:MovieClip;
public var continuebutton:SimpleButton;
public var password:TextField;
public var cloud2:MovieClip;
public var cloud4:MovieClip;
public var cloud6:MovieClip;
public var f1:MovieClip;
public var cloud3:MovieClip;
public var cloud7:MovieClip;
public var cloud1:MovieClip;
public var cloud5:MovieClip;
public var cloud8:MovieClip;
public var jumptostrat:Boolean;
public var scoretext:TextField;
public var stagebg1:MovieClip;
public var stagebg2:MovieClip;
public var initMode:Boolean;
public var stageManager;
public var playericon;
public var player:MovieClip;
public var thing:MovieClip;
public var lutbutton:SimpleButton;
public var enemyManager;
public var pauseGame:Boolean;
public var slashcanvas:MovieClip;
public var samuraipic:MovieClip;
public var staticbg:MovieClip;
public var scoremessage:TextField;
public var cloudspeed;
public var foreground:MovieClip;
public var arrowammoicon:MovieClip;
public var transition:MovieClip;
public var canvas:MovieClip;
public var guicover:MovieClip;
public var map:MovieClip;
public var playbutton:SimpleButton;
public var playercanvas:MovieClip;
public var projectileManager;
public var particleSystemManager;
public var scoreboard:MovieClip;
public var soundManager;
public var tt1:tree1;
public var tt2:tree2;
public var tt3:tree2;
public var tt4:tree1;
public var mousePressed:Boolean;
public var e4sticker:SimpleButton;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
public function ptitleClickEvent(_arg1:Event):void{
thing.removeEventListener(Event.ENTER_FRAME, titleloop);
if (password.text.toLowerCase() == "strategy mode"){
jumptostrat = true;
};
play();
}
public function mouseMoveEvent(_arg1:MouseEvent){
if (initMode){
return;
};
if (overworldMode){
return;
};
player.drawLine(mousePressed, mouseX, mouseY, canvas);
}
public function onComplete(_arg1:Event):void{
nextFrame();
}
public function mouseUpEvent(_arg1:MouseEvent){
if (initMode){
return;
};
if (overworldMode){
return;
};
player.mouseUp(mouseX, mouseY, canvas, mousePressed);
mousePressed = false;
}
function frame2(){
stop();
playbutton.addEventListener(MouseEvent.CLICK, ptitleClickEvent);
smallsticker.addEventListener(MouseEvent.CLICK, se4ClickEvent);
lutbutton.addEventListener(MouseEvent.CLICK, lutClickEvent);
thing.addEventListener(Event.ENTER_FRAME, titleloop);
cloudspeed = new Array();
jumptostrat = false;
}
function frame4(){
initMode = false;
overworldMode = false;
if (map != null){
stage.removeChild(map);
};
mousePressed = false;
pauseGame = false;
enemyManager.reinit(gameStage);
projectileManager.reinit(gameStage);
particleSystemManager.reinit(gameStage);
stageManager.reinit(gameStage);
playercanvas.addChild(player);
player.reinit();
redbg.visible = false;
scoreboard.visible = false;
continuebutton.visible = false;
continuebutton.addEventListener(MouseEvent.CLICK, onMouseClickEvent);
stop();
stageManager.init();
StatsManager.instance.addScore(0);
StatsManager.instance.displayHP();
transition.transition.gotoAndPlay(2);
arrowammoicon.visible = false;
guicover.visible = false;
StatsManager.instance.battlesFought++;
if (StatsManager.instance.location == 13){
StageManager.instance.showHint("Use your bow to eliminate the archers in the guardtower");
};
if (((SoundManager.instance.isPlaying) && (SoundManager.instance.playSounds))){
mutebutton.gotoAndStop(2);
} else {
if (((!(SoundManager.instance.isPlaying)) && (SoundManager.instance.playSounds))){
mutebutton.gotoAndStop(3);
} else {
if (((!(SoundManager.instance.isPlaying)) && (!(SoundManager.instance.playSounds)))){
mutebutton.gotoAndStop(4);
};
};
};
mutebutton.buttonMode = true;
mutebutton.addEventListener(MouseEvent.CLICK, muteClickEvent);
}
function frame3(){
initMode = true;
mousePressed = false;
pauseGame = false;
overworldMode = false;
enemyManager = new EnemyManager(gameStage);
statsManager = new StatsManager();
soundManager = new SoundManager();
projectileManager = new ProjectileManager(gameStage);
particleSystemManager = new ParticleSystemManager(gameStage);
stageManager = new StageManager(gameStage);
player = Player.createPlayer(100, 350, this);
redbg.visible = false;
stage.addEventListener(Event.ENTER_FRAME, gameloop);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveEvent);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownEvent);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpEvent);
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
if (!jumptostrat){
goFightstage();
} else {
StatsManager.instance.strategyMode();
goOverworld();
};
}
function frame5(){
stop();
initMode = false;
overworldMode = true;
map = new overworld();
stage.addChild(map);
map.transition.gotoAndPlay(2);
playericon = new player_icon();
map.playercanvas.addChild(playericon);
map.y = -830;
statsManager.setMap(map);
statsManager.setRoot(this);
statsManager.setPlayerIcon(playericon);
statsManager.displayCircles();
statsManager.hideMapMsg();
HexManager.reinit();
}
function frame6(){
stop();
e4sticker.addEventListener(MouseEvent.CLICK, e4ClickEvent);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
function frame1(){
MochiAd.showPreGameAd({clip:root, id:"8d49e85f7cb105ed", res:"720x400"});
}
public function lutClickEvent(_arg1:Event):void{
var url:String;
var request:URLRequest;
var event = _arg1;
url = "http://lutc.blogspot.com";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
public function reportKeyUp(_arg1:KeyboardEvent):void{
if (initMode){
return;
};
if (overworldMode){
return;
};
switch (_arg1.keyCode){
case Keyboard.SPACE:
if (Player.stageMode == 1){
return;
};
pauseGame = !(pauseGame);
if (pauseGame){
enemyManager.pauseGame();
Player.instance.displayScoreMessage("Paused");
} else {
enemyManager.unpauseGame();
Player.instance.displayScoreMessage("");
};
break;
case Keyboard.SHIFT:
if ((((Player.stageMode == 1)) || ((Player.stageMode == 2)))){
return;
};
player.setAimingArrow(false, mouseX, mouseY);
mousePressed = false;
arrowammoicon.visible = false;
break;
case 65:
case 37:
Player.instance.keyScrollLeft = false;
break;
case 68:
case 39:
Player.instance.keyScrollRight = false;
break;
};
}
public function onMouseClickEvent(_arg1:Event):void{
StatsManager.instance.died();
goOverworld();
}
public function overworldloop(){
if (initMode){
return;
};
if (map.gui.introanim.visible){
return;
};
HexManager.update();
map.uparrow.visible = false;
map.downarrow.visible = false;
StatsManager.instance.totalTiming++;
if ((((mouseY < 50)) && ((map.y < -10)))){
map.uparrow.visible = true;
StatsManager.instance.moveMap(10);
};
if ((((mouseY > 350)) && ((map.y > -830)))){
map.downarrow.visible = true;
StatsManager.instance.moveMap(-10);
};
}
public function muteClickEvent(_arg1:Event):void{
if (mutebutton.currentFrame == 2){
mutebutton.gotoAndStop(3);
} else {
if (mutebutton.currentFrame == 3){
mutebutton.gotoAndStop(4);
} else {
if (mutebutton.currentFrame == 4){
mutebutton.gotoAndStop(2);
};
};
};
}
public function titleloop(_arg1:Event){
f1.x = (f1.x - 2);
f2.x = (f2.x - 2);
if (f1.x <= -1300){
f1.x = 1300;
};
if (f2.x <= -1300){
f2.x = 1300;
};
titleClouds();
t1.x = (t1.x - 2);
t2.x = (t2.x - 2);
t3.x = (t3.x - 2);
t4.x = (t4.x - 2);
if (t1.x < -200){
t1.x = (900 + (Math.random() * 400));
};
if (t2.x < -200){
t2.x = (900 + (Math.random() * 400));
};
if (t3.x < -200){
t3.x = (900 + (Math.random() * 400));
};
if (t4.x < -200){
t4.x = (900 + (Math.random() * 400));
};
tt1.x = (tt1.x - 1);
tt2.x = (tt2.x - 1);
tt3.x = (tt3.x - 1);
tt4.x = (tt4.x - 1);
if (tt1.x < -100){
tt1.x = (800 + (Math.random() * 200));
};
if (tt2.x < -100){
tt2.x = (800 + (Math.random() * 200));
};
if (tt3.x < -100){
tt3.x = (800 + (Math.random() * 200));
};
if (tt4.x < -100){
tt4.x = (800 + (Math.random() * 200));
};
}
public function onProgress(_arg1:ProgressEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = _arg1.target.bytesLoaded;
_local3 = _arg1.target.bytesTotal;
_local4 = (_local2 / _local3);
loadingtext.text = _local4.toString();
}
public function goOverworld(){
overworldMode = true;
gotoAndStop(1, "overworld");
}
public function titleClouds(){
var _local1:*;
var _local2:*;
if (cloudspeed.length == 0){
_local1 = 1;
while (_local1 <= 8) {
cloudspeed[_local1] = Math.random();
getChildByName(("cloud" + _local1)).y = (50 + (Math.random() * 200));
if ((Math.random() * 3) < 1){
getChildByName(("cloud" + _local1)).visible = false;
};
_local1++;
};
};
_local1 = 1;
while (_local1 <= 8) {
_local2 = getChildByName(("cloud" + _local1));
_local2.x = (_local2.x - cloudspeed[_local1]);
if (_local2.x < -100){
_local2.x = 820;
_local2.y = (50 + (Math.random() * 200));
cloudspeed[_local1] = Math.random();
if ((Math.random() * 3) < 1){
_local2.visible = false;
};
};
_local1++;
};
}
public function gameloop(_arg1:Event):void{
if (initMode){
return;
};
if (overworldMode){
overworldloop();
} else {
player.update(mousePressed, mouseX, mouseY);
if (!pauseGame){
enemyManager.update();
projectileManager.update();
particleSystemManager.update();
stageManager.update();
};
};
}
public function se4ClickEvent(_arg1:Event):void{
var url:String;
var request:URLRequest;
var event = _arg1;
url = "http://www.goldenjoystick.com/";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
public function e4ClickEvent(_arg1:Event):void{
var url:String;
var request:URLRequest;
var event = _arg1;
url = "http://www.e4.com/joystick/";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
public function reportKeyDown(_arg1:KeyboardEvent):void{
if (initMode){
return;
};
if (overworldMode){
return;
};
switch (_arg1.keyCode){
case Keyboard.SHIFT:
if (StatsManager.instance.hasBow){
arrowammoicon.visible = true;
};
StatsManager.instance.displayArrowAmmo();
if (((((((!(StatsManager.instance.hasBow)) || ((StatsManager.instance.arrowAmmo <= 0)))) || ((Player.stageMode == 1)))) || ((Player.stageMode == 2)))){
return;
};
player.setAimingArrow(true, mouseX, mouseY);
break;
case 65:
case 37:
Player.instance.keyScrollLeft = true;
break;
case 68:
case 39:
Player.instance.keyScrollRight = true;
break;
};
}
public function mouseDownEvent(_arg1:MouseEvent){
if (initMode){
return;
};
if (overworldMode){
return;
};
mousePressed = true;
player.mouseDown(mouseX, mouseY, canvas);
}
public function goFightstage(){
overworldMode = false;
gotoAndStop(1, "fightstage");
}
}
}//package shunpo_fla
Section 65
//maptextbox_124 (shunpo_fla.maptextbox_124)
package shunpo_fla {
import flash.display.*;
import flash.text.*;
public dynamic class maptextbox_124 extends MovieClip {
public var textbox:TextField;
}
}//package shunpo_fla
Section 66
//mission_161 (shunpo_fla.mission_161)
package shunpo_fla {
import flash.display.*;
public dynamic class mission_161 extends MovieClip {
public function mission_161(){
addFrameScript(0, frame1, 54, frame55);
}
function frame1(){
stop();
}
function frame55(){
stop();
}
}
}//package shunpo_fla
Section 67
//missionaccomplished_159 (shunpo_fla.missionaccomplished_159)
package shunpo_fla {
import flash.display.*;
public dynamic class missionaccomplished_159 extends MovieClip {
public function missionaccomplished_159(){
addFrameScript(0, frame1, 54, frame55);
}
function frame1(){
stop();
}
function frame55(){
stop();
}
}
}//package shunpo_fla
Section 68
//missionstart_163 (shunpo_fla.missionstart_163)
package shunpo_fla {
import flash.display.*;
public dynamic class missionstart_163 extends MovieClip {
public function missionstart_163(){
addFrameScript(0, frame1, 54, frame55);
}
function frame1(){
stop();
}
function frame55(){
stop();
}
}
}//package shunpo_fla
Section 69
//mute_43 (shunpo_fla.mute_43)
package shunpo_fla {
import flash.display.*;
public dynamic class mute_43 extends MovieClip {
public function mute_43(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
SoundManager.instance.stopMusic();
}
function frame1(){
stop();
}
function frame4(){
stop();
SoundManager.instance.playSounds = false;
}
function frame2(){
stop();
SoundManager.instance.playMusic();
SoundManager.instance.playSounds = true;
}
}
}//package shunpo_fla
Section 70
//overworldGUI_120 (shunpo_fla.overworldGUI_120)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class overworldGUI_120 extends MovieClip {
public var bossdialog:MovieClip;
public var turnnumber:TextField;
public var endturnbutton:SimpleButton;
public var infoicon:SimpleButton;
public var stratinstructionbtn:SimpleButton;
public var hexdialog:MovieClip;
public var itemfounddialog:MovieClip;
public var playerdialog:MovieClip;
public var bowfounddialog:MovieClip;
public var missionstart:MovieClip;
public var introanim:MovieClip;
public var catapultdialog:MovieClip;
public var mutebutton:MovieClip;
public var strategymode:MovieClip;
public var stats:MovieClip;
public var words:TextField;
public var maptextbox:MovieClip;
public var missionaccomplished:MovieClip;
public var mission:MovieClip;
public var enemydialog:MovieClip;
public function overworldGUI_120(){
addFrameScript(0, frame1);
}
public function statsClickEvent(_arg1:Event):void{
if (!StatsManager.instance.bossDefeated){
stats.visible = false;
};
}
public function mute2ClickEvent(_arg1:Event):void{
if (mutebutton.currentFrame == 2){
mutebutton.gotoAndStop(3);
} else {
if (mutebutton.currentFrame == 3){
mutebutton.gotoAndStop(4);
} else {
if (mutebutton.currentFrame == 4){
mutebutton.gotoAndStop(2);
};
};
};
}
public function hexdialogClickEvent(_arg1:Event):void{
StatsManager.instance.map.gui.hexdialog.gotoAndStop(1);
StatsManager.instance.map.gui.hexdialog.visible = true;
}
function frame1(){
infoicon.addEventListener(MouseEvent.CLICK, infoClickEvent);
stats.buttonMode = true;
stats.addEventListener(MouseEvent.CLICK, statsClickEvent);
endturnbutton.addEventListener(MouseEvent.CLICK, endturnClickEvent);
stratinstructionbtn.addEventListener(MouseEvent.CLICK, hexdialogClickEvent);
if (((SoundManager.instance.isPlaying) && (SoundManager.instance.playSounds))){
mutebutton.gotoAndStop(2);
} else {
if (((!(SoundManager.instance.isPlaying)) && (SoundManager.instance.playSounds))){
mutebutton.gotoAndStop(3);
} else {
if (((!(SoundManager.instance.isPlaying)) && (!(SoundManager.instance.playSounds)))){
mutebutton.gotoAndStop(4);
};
};
};
mutebutton.buttonMode = true;
mutebutton.addEventListener(MouseEvent.CLICK, mute2ClickEvent);
}
public function infoClickEvent(_arg1:Event):void{
StatsManager.instance.displayStats();
}
public function endturnClickEvent(_arg1:Event):void{
HexManager.endPlayerTurn();
}
}
}//package shunpo_fla
Section 71
//patrolicon1_74 (shunpo_fla.patrolicon1_74)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class patrolicon1_74 extends MovieClip {
public var weapon:MovieClip;
public var enemy:MovieClip;
public var head:MovieClip;
public function patrolicon1_74(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
enemy.buttonMode = true;
enemy.addEventListener(MouseEvent.CLICK, enemyEvent);
}
function frame2(){
stop();
}
public function enemyEvent(_arg1:Event):void{
StatsManager.instance.gotoLevel(StatsManager.instance.getPatrolLocation(this));
}
}
}//package shunpo_fla
Section 72
//patrolicon2_110 (shunpo_fla.patrolicon2_110)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class patrolicon2_110 extends MovieClip {
public var enemy:MovieClip;
public function patrolicon2_110(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
enemy.buttonMode = true;
enemy.addEventListener(MouseEvent.CLICK, enemyEvent);
}
public function enemyEvent(_arg1:Event):void{
StatsManager.instance.gotoLevel(StatsManager.instance.getPatrolLocation(this));
}
}
}//package shunpo_fla
Section 73
//playerdialog_139 (shunpo_fla.playerdialog_139)
package shunpo_fla {
import flash.display.*;
import flash.text.*;
public dynamic class playerdialog_139 extends MovieClip {
public var words:TextField;
}
}//package shunpo_fla
Section 74
//playerdialoganim_138 (shunpo_fla.playerdialoganim_138)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class playerdialoganim_138 extends MovieClip {
public var playerdialog:MovieClip;
public function playerdialoganim_138(){
addFrameScript(0, frame1, 1, frame2, 11, frame12, 23, frame24);
}
function frame12(){
stop();
}
function frame1(){
playerdialog.visible = false;
stop();
}
function frame24(){
stop();
playerdialog.visible = false;
}
function frame2(){
playerdialog.visible = true;
playerdialog.buttonMode = true;
playerdialog.addEventListener(MouseEvent.CLICK, playerdialogEvent);
}
public function playerdialogEvent(_arg1:Event):void{
this.play();
StatsManager.instance.playerDialogClick();
}
}
}//package shunpo_fla
Section 75
//reinforceanim_51 (shunpo_fla.reinforceanim_51)
package shunpo_fla {
import flash.display.*;
public dynamic class reinforceanim_51 extends MovieClip {
public function reinforceanim_51(){
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
gotoAndStop(1);
}
function frame1(){
stop();
}
}
}//package shunpo_fla
Section 76
//samurai_aimingtop_206 (shunpo_fla.samurai_aimingtop_206)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class samurai_aimingtop_206 extends MovieClip {
public function samurai_aimingtop_206(){
addFrameScript(0, frame1, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14);
}
function frame10(){
Player.instance.setArrowPower(8);
}
function frame14(){
Player.instance.setArrowPower(13);
}
function frame12(){
Player.instance.setArrowPower(10);
}
function frame6(){
Player.instance.setArrowPower(4);
}
function frame7(){
Player.instance.setArrowPower(5);
}
function frame1(){
Player.instance.setArrowPower(3);
gotoAndStop(4);
}
function frame13(){
Player.instance.setArrowPower(11);
}
function frame4(){
stop();
Player.instance.setArrowPower(3);
}
function frame5(){
Player.instance.setArrowPower(3);
}
function frame9(){
Player.instance.setArrowPower(7);
}
function frame8(){
Player.instance.setArrowPower(6);
}
function frame11(){
Player.instance.setArrowPower(9);
}
}
}//package shunpo_fla
Section 77
//samurai_aimingtop2_213 (shunpo_fla.samurai_aimingtop2_213)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class samurai_aimingtop2_213 extends MovieClip {
public function samurai_aimingtop2_213(){
addFrameScript(0, frame1);
}
function frame1(){
if (!MovieClip(root).pauseGame){
this.rotation = MovieClip(parent.parent.parent).getAimAngle();
};
}
}
}//package shunpo_fla
Section 78
//samurai_arrow_reload_201 (shunpo_fla.samurai_arrow_reload_201)
package shunpo_fla {
import flash.display.*;
public dynamic class samurai_arrow_reload_201 extends MovieClip {
public var aimtop:MovieClip;
public function samurai_arrow_reload_201(){
addFrameScript(11, frame12);
}
function frame12(){
MovieClip(parent).gotoAndStop(21);
}
}
}//package shunpo_fla
Section 79
//samurai_arrowaim_205 (shunpo_fla.samurai_arrowaim_205)
package shunpo_fla {
import flash.display.*;
public dynamic class samurai_arrowaim_205 extends MovieClip {
public var aimtop:MovieClip;
public function samurai_arrowaim_205(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package shunpo_fla
Section 80
//samurai_die_186 (shunpo_fla.samurai_die_186)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class samurai_die_186 extends MovieClip {
public var pt;
public var xpos;
public var xvel;
public var bp;
public var bloodspurt:MovieClip;
public var marker:MovieClip;
public var hat;
public var rot;
public function samurai_die_186(){
addFrameScript(0, frame1, 22, frame23, 24, frame25, 30, frame31, 32, frame33, 39, frame40, 41, frame42, 46, frame47, 48, frame49, 59, frame60);
}
function frame1(){
bp = ParticleSystemManager.instance.createParticleSystem(BloodParticleSystem.typeCode, 0, 0, this);
bp.setMarker(marker);
bp.setNumber(15);
bp.setVel(7);
bloodspurt.visible = false;
marker.visible = false;
xvel = 3;
xpos = 0;
rot = 30;
if ((Math.random() * 2) < 1){
xvel = -(xvel);
xpos = 50;
rot = -(rot);
};
pt = new Point(xpos, -85);
pt = this.localToGlobal(pt);
pt = EnemyManager.instance.getGameStage().globalToLocal(pt);
hat = ProjectileManager.instance.createProjectile(7, pt.x, pt.y, xvel, 15);
hat.rot = rot;
stage.frameRate = 12;
}
function frame25(){
if (bp != null){
bp.setActive(true);
};
}
function frame23(){
if (bp != null){
bp.setActive(false);
};
bp.setVel(9);
bp.setNumber(15);
}
function frame31(){
if (bp != null){
bp.setActive(false);
};
}
function frame40(){
if (bp != null){
bp.setActive(false);
};
bp.setNumber(10);
}
function frame33(){
if (bp != null){
bp.setActive(true);
};
}
function frame47(){
if (bp != null){
bp.setActive(false);
};
}
function frame49(){
if (bp != null){
bp.setActive(true);
};
}
function frame42(){
if (bp != null){
bp.setActive(true);
};
}
function frame60(){
stop();
if (bp != null){
bp.setActive(false);
};
}
}
}//package shunpo_fla
Section 81
//samurai_diearrow_196 (shunpo_fla.samurai_diearrow_196)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class samurai_diearrow_196 extends MovieClip {
public var pt;
public var xpos;
public var xvel;
public var bp;
public var marker:MovieClip;
public var hat;
public var rot;
public function samurai_diearrow_196(){
addFrameScript(0, frame1, 18, frame19, 49, frame50);
}
function frame1(){
bp = ParticleSystemManager.instance.createParticleSystem(BloodParticleSystem.typeCode, 0, 0, this);
bp.setMarker(marker);
bp.setNumber(10);
bp.setVel(6);
marker.visible = false;
xvel = 3;
xpos = 0;
rot = 30;
if ((Math.random() * 2) < 1){
xvel = -(xvel);
xpos = 50;
rot = -(rot);
};
pt = new Point(xpos, -85);
pt = this.localToGlobal(pt);
pt = EnemyManager.instance.getGameStage().globalToLocal(pt);
hat = ProjectileManager.instance.createProjectile(7, pt.x, pt.y, xvel, 15);
hat.rot = rot;
stage.frameRate = 12;
}
function frame19(){
if (bp != null){
bp.setActive(false);
};
}
function frame50(){
stop();
}
}
}//package shunpo_fla
Section 82
//samurai_falling_anim_178 (shunpo_fla.samurai_falling_anim_178)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class samurai_falling_anim_178 extends MovieClip {
public function samurai_falling_anim_178(){
addFrameScript(9, frame10);
}
function frame10(){
MovieClip(parent.parent).land();
}
}
}//package shunpo_fla
Section 83
//samurai_holding_anim_175 (shunpo_fla.samurai_holding_anim_175)
package shunpo_fla {
import flash.display.*;
public dynamic class samurai_holding_anim_175 extends MovieClip {
public function samurai_holding_anim_175(){
addFrameScript(8, frame9, 9, frame10);
}
function frame10(){
MovieClip(parent).gotoAndStop(1);
}
function frame9(){
if (Player.stageMode == 1){
this.stop();
} else {
if (!((Math.random() * 3) < 1)){
this.gotoAndPlay(1);
};
};
}
}
}//package shunpo_fla
Section 84
//samurai_knife_86 (shunpo_fla.samurai_knife_86)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class samurai_knife_86 extends MovieClip {
public function samurai_knife_86(){
addFrameScript(0, frame1);
}
function frame1(){
MovieClip(parent).weapon = this;
}
}
}//package shunpo_fla
Section 85
//samurai_left_174 (shunpo_fla.samurai_left_174)
package shunpo_fla {
import flash.display.*;
public dynamic class samurai_left_174 extends MovieClip {
public var player:MovieClip;
public function samurai_left_174(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 9, frame10, 10, frame11, 14, frame15, 15, frame16, 19, frame20, 20, frame21, 21, frame22, 49, frame50, 50, frame51, 51, frame52);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
function frame22(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame21(){
stop();
}
function frame20(){
stop();
}
function frame2(){
stop();
}
function frame15(){
stop();
}
function frame11(){
stop();
}
function frame51(){
stop();
}
function frame52(){
stop();
}
function frame50(){
stop();
}
}
}//package shunpo_fla
Section 86
//samurai_posing_transition_177 (shunpo_fla.samurai_posing_transition_177)
package shunpo_fla {
import flash.display.*;
public dynamic class samurai_posing_transition_177 extends MovieClip {
public function samurai_posing_transition_177(){
addFrameScript(8, frame9, 9, frame10);
}
function frame10(){
MovieClip(parent).gotoAndStop(3);
}
function frame9(){
if (Player.stageMode == 1){
this.stop();
};
}
}
}//package shunpo_fla
Section 87
//samurai_sheathing_216 (shunpo_fla.samurai_sheathing_216)
package shunpo_fla {
import flash.display.*;
public dynamic class samurai_sheathing_216 extends MovieClip {
public function samurai_sheathing_216(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
}
}
}//package shunpo_fla
Section 88
//samurai_sheathing_anim_215 (shunpo_fla.samurai_sheathing_anim_215)
package shunpo_fla {
import flash.display.*;
public dynamic class samurai_sheathing_anim_215 extends MovieClip {
public function samurai_sheathing_anim_215(){
addFrameScript(8, frame9, 9, frame10);
}
function frame10(){
MovieClip(parent).gotoAndStop(1);
}
function frame9(){
if (!((Math.random() * 3) < 1)){
this.gotoAndPlay(1);
};
}
}
}//package shunpo_fla
Section 89
//samurai_shootarrow_212 (shunpo_fla.samurai_shootarrow_212)
package shunpo_fla {
import flash.display.*;
public dynamic class samurai_shootarrow_212 extends MovieClip {
public var aimtop:MovieClip;
public function samurai_shootarrow_212(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
if (Player.stageMode == 1){
stop();
};
}
function frame20(){
MovieClip(parent).gotoAndStop(21);
}
}
}//package shunpo_fla
Section 90
//samurai_shunpo_jumpstart_184 (shunpo_fla.samurai_shunpo_jumpstart_184)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class samurai_shunpo_jumpstart_184 extends MovieClip {
public var dashcloud2:MovieClip;
public var dashcloud1:MovieClip;
public function samurai_shunpo_jumpstart_184(){
addFrameScript(3, frame4, 14, frame15);
}
function frame15(){
MovieClip(parent.parent).shunpoEnd();
}
function frame4(){
MovieClip(parent.parent).drawSlash();
}
}
}//package shunpo_fla
Section 91
//samurai_shunpo_start_182 (shunpo_fla.samurai_shunpo_start_182)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class samurai_shunpo_start_182 extends MovieClip {
public var dashcloud1:MovieClip;
public function samurai_shunpo_start_182(){
addFrameScript(3, frame4, 14, frame15);
}
function frame15(){
MovieClip(parent.parent).shunpoEnd();
}
function frame4(){
MovieClip(parent.parent).drawSlash();
}
}
}//package shunpo_fla
Section 92
//scoreboard_34 (shunpo_fla.scoreboard_34)
package shunpo_fla {
import flash.display.*;
public dynamic class scoreboard_34 extends MovieClip {
public function scoreboard_34(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package shunpo_fla
Section 93
//shield_271 (shunpo_fla.shield_271)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class shield_271 extends MovieClip {
public var stuckarrow1:stuck_arrow;
public var stuckarrow2:stuck_arrow;
public var stuckarrow3:stuck_arrow;
public function shield_271(){
addFrameScript(0, frame1);
}
function frame1(){
if (MovieClip(parent.parent.parent.parent).stuckarrow1rot == 0){
stuckarrow1.visible = false;
} else {
stuckarrow1.visible = true;
stuckarrow1.rotation = MovieClip(parent.parent.parent.parent).stuckarrow1rot;
};
if (MovieClip(parent.parent.parent.parent).stuckarrow2rot == 0){
stuckarrow2.visible = false;
} else {
stuckarrow2.visible = true;
stuckarrow2.rotation = MovieClip(parent.parent.parent.parent).stuckarrow2rot;
};
if (MovieClip(parent.parent.parent.parent).stuckarrow3rot == 0){
stuckarrow3.visible = false;
} else {
stuckarrow2.visible = true;
stuckarrow2.rotation = MovieClip(parent.parent.parent.parent).stuckarrow3rot;
};
}
}
}//package shunpo_fla
Section 94
//shieldicon_87 (shunpo_fla.shieldicon_87)
package shunpo_fla {
import flash.display.*;
public dynamic class shieldicon_87 extends MovieClip {
public var head:MovieClip;
}
}//package shunpo_fla
Section 95
//spear_76 (shunpo_fla.spear_76)
package shunpo_fla {
import flash.display.*;
public dynamic class spear_76 extends MovieClip {
public var tip:MovieClip;
}
}//package shunpo_fla
Section 96
//stagebg1canvas_28 (shunpo_fla.stagebg1canvas_28)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
public dynamic class stagebg1canvas_28 extends MovieClip {
public var tuticon2:MovieClip;
public var tuticon3:MovieClip;
public var tuticon1:SimpleButton;
public var newbanner:MovieClip;
public var stagebg1:MovieClip;
public function stagebg1canvas_28(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
tuticon2.visible = false;
tuticon3.visible = false;
newbanner.visible = false;
tuticon1.addEventListener(MouseEvent.CLICK, tut1Event);
}
public function tut1Event(_arg1:Event):void{
tuticon1.visible = false;
newbanner.visible = true;
if (tuticon3.visible){
return;
};
tuticon2.visible = true;
StageManager.instance.showHint("Draw a line along the dotted line to slash with your sword.\rMove mouse to the edge of the screen to scroll.\rYou may also use A-D or arrow keys to scroll.\rPress spacebar to pause.");
StatsManager.instance.gotBanner();
}
}
}//package shunpo_fla
Section 97
//stagebg2canvas_21 (shunpo_fla.stagebg2canvas_21)
package shunpo_fla {
import flash.display.*;
public dynamic class stagebg2canvas_21 extends MovieClip {
public var stagebg2:MovieClip;
public function stagebg2canvas_21(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 98
//staticbg_all_17 (shunpo_fla.staticbg_all_17)
package shunpo_fla {
import flash.display.*;
public dynamic class staticbg_all_17 extends MovieClip {
public function staticbg_all_17(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
function frame11(){
stop();
}
}
}//package shunpo_fla
Section 99
//statssheet_149 (shunpo_fla.statssheet_149)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public dynamic class statssheet_149 extends MovieClip {
public var achievementkills:MovieClip;
public var hp:TextField;
public var achievementheadshot:MovieClip;
public var slashes:TextField;
public var achievementbanner:MovieClip;
public var achievementarrowheadshot:MovieClip;
public var deflect:TextField;
public var objective:TextField;
public var sectorlabel:MovieClip;
public var sectorcount:TextField;
public var achievementfights:MovieClip;
public var achievementdeaths:MovieClip;
public var timing:TextField;
public var deaths:TextField;
public var arrows:TextField;
public var score:TextField;
public var turns:TextField;
public var combo:TextField;
public var sectortotal:TextField;
public var battles:TextField;
public var achievementitem:MovieClip;
public var achievementhex:MovieClip;
public var banners:TextField;
public var achievementmaxslash:MovieClip;
public var kills:TextField;
public var headshots:TextField;
public var smallsmallsticker:SimpleButton;
public var mission:TextField;
public var items:TextField;
public var contbtn:SimpleButton;
public var arrowheadshots:TextField;
public function statssheet_149(){
addFrameScript(0, frame1);
}
public function sse4ClickEvent(_arg1:Event):void{
var url:String;
var request:URLRequest;
var event = _arg1;
url = "http://www.goldenjoystick.com/";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
function frame1(){
if (!StatsManager.instance.bossDefeated){
contbtn.visible = false;
};
contbtn.addEventListener(MouseEvent.CLICK, contClickEvent);
smallsmallsticker.addEventListener(MouseEvent.CLICK, sse4ClickEvent);
}
public function contClickEvent(_arg1:Event):void{
var url:String;
var request:URLRequest;
var event = _arg1;
url = "http://lutc.blogspot.com";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
}
}//package shunpo_fla
Section 100
//strategymodeanim_157 (shunpo_fla.strategymodeanim_157)
package shunpo_fla {
import flash.display.*;
public dynamic class strategymodeanim_157 extends MovieClip {
public function strategymodeanim_157(){
addFrameScript(0, frame1, 54, frame55);
}
function frame1(){
stop();
}
function frame55(){
stop();
StatsManager.instance.showPlayerDialog("Use the troops to clear a path to the enemy commander's tent");
}
}
}//package shunpo_fla
Section 101
//tent_114 (shunpo_fla.tent_114)
package shunpo_fla {
import flash.display.*;
public dynamic class tent_114 extends MovieClip {
public function tent_114(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package shunpo_fla
Section 102
//transition_41 (shunpo_fla.transition_41)
package shunpo_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class transition_41 extends MovieClip {
public function transition_41(){
addFrameScript(0, frame1, 23, frame24, 47, frame48, 59, frame60, 82, frame83, 119, frame120, 152, frame153);
}
function frame153(){
stop();
}
function frame1(){
stop();
}
function frame24(){
stop();
}
function frame83(){
stop();
}
function frame120(){
stop();
MovieClip(parent.parent).goOverworld();
}
function frame48(){
stop();
StatsManager.instance.transitionOut();
}
function frame60(){
stop();
}
}
}//package shunpo_fla
Section 103
//transition2_40 (shunpo_fla.transition2_40)
package shunpo_fla {
import flash.display.*;
public dynamic class transition2_40 extends MovieClip {
public var transition:MovieClip;
}
}//package shunpo_fla
Section 104
//ArmProjectile (ArmProjectile)
package {
public class ArmProjectile extends Projectile {
public var bp;
public var rot:int;// = 20
public static var gravity:Number = 1;
public static var typeCode:int = 4;
public function ArmProjectile(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
rot = 20;
super();
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
ttlMax = (10 * 24);
ttl = ttlMax;
}
override public function update(){
if (!flying){
doDissappear();
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (this.rotation + rot);
velY = (velY - gravity);
if ((((this.y > Player.groundY)) && ((velY < 0)))){
if (velY > -5){
flying = false;
};
velY = (-(velY) / 3);
velX = ((velX * 3) / 4);
rot = (rot / 2);
};
}
}
}//package
Section 105
//Arrow (Arrow)
package {
import flash.display.*;
import flash.events.*;
public class Arrow extends Projectile {
public static var gravity:Number = 1;
public static var typeCode:int = 1;
public function Arrow(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
addFrameScript(0, frame1, 1, frame2);
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, onClick);
}
override public function breakarrow(){
var _local1:*;
flying = false;
visible = false;
_local1 = ProjectileManager.instance.createProjectile(Arrow_broken.typeCode, this.x, this.y, (-10 + (Math.random() * 20)), (-5 + (Math.random() * 10)));
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function update(){
if (!flying){
doDissappear();
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (Math.atan((-(velY) / velX)) * (180 / Math.PI));
velY = (velY - gravity);
if (this.hitTestObject(MovieClip(parent.parent).player)){
if (MovieClip(parent.parent).player.gotArrowHit(this)){
this.visible = false;
this.flying = false;
};
};
if (this.y > (Player.groundY - 15)){
if ((Math.random() * 3) > 1){
flying = false;
this.gotoAndStop(2);
};
};
}
function onClick(_arg1:MouseEvent):void{
if (Player.stageMode == 2){
return;
};
this.visible = false;
this.flying = false;
StatsManager.instance.addArrowAmmo();
}
}
}//package
Section 106
//Arrow_broken (Arrow_broken)
package {
public class Arrow_broken extends Projectile {
public static var gravity:Number = 1;
public static var typeCode:int = 6;
public function Arrow_broken(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
addFrameScript(0, frame1);
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
}
function frame1(){
stop();
}
override public function update(){
if (!flying){
doDissappear();
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (this.rotation + 20);
velY = (velY - gravity);
if (this.y > (Player.groundY - 15)){
if ((Math.random() * 3) > 1){
flying = false;
this.visible = false;
};
};
}
}
}//package
Section 107
//Arrow_player (Arrow_player)
package {
import flash.display.*;
import flash.events.*;
public class Arrow_player extends Projectile {
public var killingHit:Boolean;// = false
var enemyTarget:Enemy;
public var sharpend:MovieClip;
var stopcentering:Boolean;// = false
var centered:Boolean;// = false
var simulating:Boolean;// = false
public static var gravity:Number = 1;
public static var typeCode:int = 5;
public function Arrow_player(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
simulating = false;
killingHit = false;
centered = false;
stopcentering = false;
super();
addFrameScript(0, frame1, 1, frame2);
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, onClick);
}
override public function breakarrow(){
var _local1:*;
_local1 = ProjectileManager.instance.createProjectile(Arrow_broken.typeCode, this.x, this.y, (-10 + (Math.random() * 20)), (-5 + (Math.random() * 10)));
}
function frame1(){
stop();
}
public function unfreeze(){
flying = true;
stopcentering = true;
}
function frame2(){
stop();
}
override public function update(){
if (!flying){
if (!killingHit){
doDissappear();
};
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (Math.atan((-(velY) / velX)) * (180 / Math.PI));
velY = (velY - gravity);
if ((((Player.stageMode == 1)) && (!(stopcentering)))){
if (!centered){
centered = true;
Player.instance.centrePlayer();
};
MovieClip(parent).x = (MovieClip(parent).x - this.velX);
MovieClip(parent.parent).playercanvas.x = (MovieClip(parent.parent).playercanvas.x - this.velX);
};
if (EnemyManager.instance.checkArrowHit(this)){
flying = false;
if (Player.stageMode == 1){
this.x = enemyTarget.x;
EnemyManager.instance.freezeCounter = 36;
} else {
this.visible = false;
};
};
if ((((((((Player.stageMode == 1)) && ((EnemyManager.instance.freezeCounter <= 0)))) && (!(enemyTarget.isDead())))) || (((((((((!((enemyTarget == null))) && (!(enemyTarget.isDead())))) && (killingHit))) && (!(simulating)))) && ((Math.abs((enemyTarget.getPlayerPos().x - enemyTarget.x)) < Math.abs((enemyTarget.getPlayerPos().x - this.x)))))))){
enemyTarget.setArrowShot(true);
enemyTarget.die();
trace("autokill");
stopcentering = true;
this.visible = false;
};
if (this.y > (Player.groundY - 15)){
if ((Math.random() * 3) > 1){
flying = false;
if ((((this.x > 0)) && ((this.x < MovieClip(parent.parent).foreground.width)))){
MovieClip(parent.parent).stagebg1.addChild(this);
};
};
};
if ((((this.x < 0)) || ((this.x > StageManager.instance.stageWidth)))){
this.visible = false;
this.flying = false;
};
}
public function simulateHit(_arg1:Enemy):Boolean{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
simulating = true;
killingHit = false;
_local2 = this.x;
_local3 = this.y;
_local4 = velX;
_local5 = velY;
_local6 = _arg1.x;
_local7 = _arg1.y;
enemyTarget = _arg1;
while (((this.flying) && (!(killingHit)))) {
if (_arg1.currentFrame == 1){
_arg1.x = (_arg1.x + _arg1.speed);
} else {
_arg1.x = (_arg1.x - _arg1.speed);
};
this.update();
};
this.x = _local2;
this.y = _local3;
velX = _local4;
velY = _local5;
this.visible = true;
_arg1.x = _local6;
_arg1.y = _local7;
flying = true;
simulating = false;
return (killingHit);
}
public function isSimulation():Boolean{
return (simulating);
}
public function disable(){
flying = false;
visible = false;
killingHit = false;
}
function onClick(_arg1:MouseEvent):void{
if (Player.stageMode == 2){
return;
};
this.disable();
StatsManager.instance.addArrowAmmo();
}
}
}//package
Section 108
//BallProjectile (BallProjectile)
package {
import flash.display.*;
public class BallProjectile extends Projectile {
public var bp;
public var rot:int;// = 20
public static var gravity:Number = 1;
public static var typeCode:int = 9;
public function BallProjectile(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
rot = 20;
super();
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
ttl = 24;
}
override public function breakarrow(){
velX = -(velX);
velY = -(velY);
}
override public function update(){
if (!flying){
doDissappear();
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (this.rotation - rot);
velY = (velY - gravity);
if ((((this.y <= 0)) && ((velY > 5)))){
Enemy_catapult.instance.destroy();
flying = false;
visible = false;
};
if (this.hitTestObject(MovieClip(parent.parent).player)){
if (MovieClip(parent.parent).player.gotBallHit(this)){
};
};
if ((((this.y > (Player.groundY - 5))) && ((velY < 0)))){
if (velY > -5){
flying = false;
};
velY = (-(velY) / 3);
velX = ((velX * 3) / 4);
rot = (rot / 2);
};
}
}
}//package
Section 109
//BloodParticle (BloodParticle)
package {
import flash.display.*;
public class BloodParticle extends MovieClip {
var ttl:int;// = -1
var maxttl:int;// = 0
var velX:Number;// = 0
var gravity:Number;// = 0
var velY:Number;// = 0
var manager:BloodParticleSystem;
var owner:MovieClip;
public function BloodParticle(_arg1:MovieClip, _arg2:BloodParticleSystem){
velX = 0;
velY = 0;
ttl = -1;
maxttl = 0;
gravity = 0;
super();
this.owner = _arg1;
this.manager = _arg2;
this.visible = false;
}
public function init(_arg1:int, _arg2:int, _arg3:Number, _arg4:int, _arg5:Number, _arg6:int, _arg7:int, _arg8:Number){
this.x = _arg1;
this.y = _arg2;
this.gravity = _arg8;
_arg3 = ((_arg3 + ((Math.random() * 2) * _arg4)) - _arg4);
_arg5 = ((_arg5 + ((Math.random() * 2) * _arg6)) - _arg6);
maxttl = _arg7;
velX = (Math.sin((_arg3 * (Math.PI / 180))) * _arg5);
velY = ((Math.cos((_arg3 * (Math.PI / 180))) * _arg5) * -1);
this.ttl = _arg7;
this.visible = true;
this.scaleX = (0.6 + ((Math.random() * 4) / 10));
this.scaleY = (0.6 + ((Math.random() * 4) / 10));
}
public function isDead(){
return ((ttl < 0));
}
public function update(){
if (ttl < 0){
return;
};
if (ttl == 0){
this.visible = false;
manager.decreaseCount();
};
ttl--;
this.x = (this.x + velX);
this.y = (this.y + velY);
velY = (velY + gravity);
this.alpha = ((ttl / maxttl) + 0.1);
}
}
}//package
Section 110
//BloodParticleSystem (BloodParticleSystem)
package {
import flash.display.*;
public class BloodParticleSystem extends ParticleSystem {
public static var typeCode:int = 1;
public function BloodParticleSystem(_arg1:Number, _arg2:Number, _arg3:MovieClip){
var _local4:*;
var _local5:*;
super();
this.owner = _arg3;
this.px = _arg1;
this.py = _arg2;
pnumber = 15;
pangle = 50;
panglevariance = 10;
pvel = 9;
pvelvariance = 2;
pgravity = 0.6;
pttl = 25;
totalCount = (pnumber * pttl);
_local4 = 0;
while (_local4 < totalCount) {
_local5 = new BloodParticle(_arg3, this);
_arg3.addChild(_local5);
particles.push(_local5);
_local5.visible = false;
_local4++;
};
}
}
}//package
Section 111
//BodyProjectile (BodyProjectile)
package {
public class BodyProjectile extends Projectile {
public var bp;
public var rot:int;// = 20
public static var gravity:Number = 0.8;
public static var typeCode:int = 8;
public function BodyProjectile(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
rot = 20;
super();
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
rot = 5;
}
override public function update(){
if (!flying){
doDissappear();
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (Math.atan((-(velY) / velX)) * (180 / Math.PI));
this.scaleX = (this.scaleX - 0.01);
this.scaleY = (this.scaleY - 0.01);
this.alpha = (this.alpha - 0.01);
velY = (velY - gravity);
if ((((this.y > (Player.groundY - 5))) && ((velY < 0)))){
flying = false;
visible = false;
};
}
}
}//package
Section 112
//bossdie (bossdie)
package {
import flash.media.*;
public dynamic class bossdie extends Sound {
}
}//package
Section 113
//crash (crash)
package {
import flash.media.*;
public dynamic class crash extends Sound {
}
}//package
Section 114
//Enemy (Enemy)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy extends MovieClip {
const STOP_STATE = 0;
const JUMPUP_STATE = 4;
const MOVE_STATE = 1;
const JUMPDOWN_STATE = 5;
const ATTACK_STATE = 2;
const DIE_STATE = 3;
var hp:int;// = 1
var destinationX:Number;// = 0
var enemyManager;// = null
public var removeMe:Boolean;// = false
public var speed:int;// = 5
var dead:Boolean;// = false
var arrowshot:Boolean;// = false
public var actionState:int;// = 0
public var type:int;// = 0
var frozen:Boolean;// = false
public var deathAnimDone:Boolean;// = false
var AIcounter:int;// = 0
var disappearCounter:int;
var disappearCounterMax:int;// = 240
var headshot:Boolean;// = false
var player:Player;// = null
var AIcounterMax:int;// = 30
public function Enemy(){
actionState = STOP_STATE;
removeMe = false;
type = 0;
hp = 1;
speed = 5;
destinationX = 0;
AIcounterMax = 30;
AIcounter = 0;
disappearCounterMax = (10 * 24);
disappearCounter = disappearCounterMax;
dead = false;
deathAnimDone = false;
frozen = false;
headshot = false;
arrowshot = false;
player = null;
enemyManager = null;
super();
}
public function getPlayerPos():Point{
return (MovieClip(parent).globalToLocal(new Point(Player.instance.x, Player.instance.y)));
}
public function isNearPlayer():Boolean{
return ((Math.abs((getPlayerPos().x - this.x)) < 100));
}
public function getPlayerIsFacingLeft():Boolean{
return (MovieClip(parent.parent).player.isFacingLeft());
}
public function pauseGame(){
MovieClip(this).enemy.enemy.stop();
if (MovieClip(this).enemy.enemy.bloodspurt != null){
MovieClip(this).enemy.enemy.bloodspurt.stop();
};
}
public function getPlayerIsRunning():Boolean{
return (MovieClip(parent.parent).player.getIsRunning());
}
public function isHeadshot():Boolean{
return (((headshot) && (!(dead))));
}
public function checkEnemyWeaponHitPlayer(_arg1:MovieClip){
if (!isNearPlayer()){
return;
};
MovieClip(parent.parent).player.checkEnemyWeaponHitPlayer(_arg1);
}
public function setManager(_arg1:EnemyManager){
this.enemyManager = _arg1;
}
public function setArrowShot(_arg1:Boolean){
arrowshot = _arg1;
}
public function faceDestination(){
if (destinationX < this.x){
if (this.currentFrame != 2){
this.gotoAndStop(2);
};
} else {
if (this.currentFrame != 1){
this.gotoAndStop(1);
};
};
}
public function freeze(){
MovieClip(this).enemy.enemy.stop();
frozen = true;
}
public function die(){
}
public function getPlayerShunpoDestination():int{
return (MovieClip(parent).globalToLocal(MovieClip(parent.parent).player.getShunpoDestination()).x);
}
public function hit(_arg1:int, _arg2:int):Boolean{
if (hp > 0){
hp--;
return (true);
};
return (false);
}
public function doDisappear(){
if ((((((((Player.stageMode == 1)) && ((this.alpha == 1)))) || (removeMe))) || ((disappearCounter < 0)))){
return;
};
disappearCounter--;
if (disappearCounter < 24){
this.alpha = (disappearCounter / 24);
};
if (disappearCounter == 0){
enemyManager.getGameStage().removeChild(this);
disappearCounter = -1;
removeMe = true;
};
}
public function facePlayer(){
if (getPlayerPos().x < this.x){
if (this.currentFrame != 2){
this.gotoAndStop(2);
};
} else {
if (this.currentFrame != 1){
this.gotoAndStop(1);
};
};
}
public function isHitFront(_arg1:int, _arg2:int){
var _local3:*;
_local3 = new Point(_arg1, _arg2);
_local3 = enemyManager.getGameStage().globalToLocal(_local3);
if ((((this.currentFrame == 1)) && ((_local3.x > this.x)))){
return (true);
};
if ((((this.currentFrame == 2)) && ((_local3.x < this.x)))){
return (true);
};
return (false);
}
public function unpauseGame(){
if ((((disappearCounter > 0)) && (!(deathAnimDone)))){
MovieClip(this).enemy.enemy.play();
if (MovieClip(this).enemy.enemy.bloodspurt != null){
MovieClip(this).enemy.enemy.bloodspurt.play();
};
};
}
public function getPlayerDestination():int{
return (MovieClip(parent).globalToLocal(MovieClip(parent.parent).player.getDestination()).x);
}
public function isDead():Boolean{
return (dead);
}
public function isColliding():Boolean{
return (enemyManager.isColliding(this));
}
public function update(){
}
public function arrowHit(_arg1:Arrow_player):Boolean{
return (true);
}
public function setPosition(_arg1:int, _arg2:int){
this.x = _arg1;
this.y = _arg2;
}
public function getHP():int{
return (hp);
}
public function setDead(_arg1:Boolean){
dead = _arg1;
}
public function getPlayerIsShunpo():Boolean{
return (MovieClip(parent.parent).player.getIsShunpo());
}
public function reactShunpo(_arg1:Array, _arg2:Array){
}
}
}//package
Section 115
//Enemy_bird (Enemy_bird)
package {
import flash.display.*;
public class Enemy_bird extends Enemy {
var destinationY;
var flystraight;// = false
var flying:Boolean;// = false
var oldx;// = 0
var yspeed;
public var onscarecrow:Boolean;// = false
public var flybird:MovieClip;
public static var typeCode:int = 101;
public function Enemy_bird(){
flying = false;
flystraight = false;
oldx = 0;
onscarecrow = false;
super();
addFrameScript(0, frame1, 1, frame2);
type = typeCode;
hp = 0;
}
public function flyTo(_arg1, _arg2){
flying = true;
destinationX = _arg1;
destinationY = _arg2;
this.gotoAndStop(2);
oldx = this.x;
yspeed = (Math.random() * 10);
if (_arg1 < this.x){
this.scaleX = 1;
} else {
this.scaleX = -1;
};
}
function frame2(){
stop();
}
function frame1(){
stop();
}
override public function die(){
dead = true;
}
override public function unpauseGame(){
if (flybird != null){
flybird.play();
};
}
public function flyStraight(_arg1, _arg2, _arg3){
if (_arg3 < _arg1){
this.scaleX = 1;
} else {
this.scaleX = -1;
};
flystraight = true;
this.gotoAndStop(2);
oldx = _arg1;
destinationX = _arg3;
this.x = _arg1;
this.y = _arg2;
}
override public function freeze(){
this.visible = false;
}
override public function isDead():Boolean{
return (true);
}
override public function update(){
var _local1:*;
var _local2:*;
var _local3:Enemy_bird;
var _local4:*;
if (Player.stageMode == 1){
freeze();
frozen = true;
};
if (!visible){
return;
};
if (frozen){
return;
};
if (((((!(flystraight)) && (!(flying)))) && (isNearPlayer()))){
if ((Math.random() * 2) < 1){
return;
};
flyaway();
_local1 = 0;
while (_local1 < EnemyManager.instance.enemyList.length) {
_local2 = EnemyManager.instance.enemyList[_local1];
if (_local2.type == 101){
_local3 = _local2;
if (((((!(_local3.flying)) && (!(_local3.flystraight)))) && ((Math.abs((_local3.x - this.x)) < 200)))){
if ((Math.random() * 2) < 1){
_local4 = (_local3.x + (Math.random() * 200));
} else {
_local4 = (_local3.x - (Math.random() * 200));
};
_local3.flyTo(_local4, -20);
};
};
_local1++;
};
} else {
if (flying){
if (destinationX > oldx){
this.x = (this.x + ((Math.random() * 10) + 10));
} else {
this.x = (this.x - ((Math.random() * 10) + 10));
};
this.y = (this.y - yspeed);
yspeed = (yspeed + ((Math.random() * 4) - 2));
if (((((!(onscarecrow)) && ((this.y <= destinationY)))) || (((onscarecrow) && ((this.y <= (destinationY - MovieClip(this.parent).y))))))){
flying = false;
this.visible = false;
};
} else {
if (flystraight){
if (destinationX > oldx){
this.x = (this.x + 5);
} else {
if (destinationX < oldx){
this.x = (this.x - 5);
};
};
this.y = (this.y + ((Math.random() * 2) - 1));
if ((((this.x < 0)) || ((this.x > StageManager.instance.stageWidth)))){
flystraight = false;
this.visible = false;
};
};
};
};
}
override public function pauseGame(){
if (flybird != null){
flybird.stop();
};
}
override public function hit(_arg1:int, _arg2:int):Boolean{
if (hp > 0){
hp--;
return (true);
};
return (false);
}
public function flyaway(){
var _local1:*;
if (flying){
return;
};
if ((Math.random() * 2) < 1){
_local1 = (this.x + (Math.random() * 200));
} else {
_local1 = (this.x - (Math.random() * 200));
};
flyTo(_local1, -20);
}
}
}//package
Section 116
//Enemy_catapult (Enemy_catapult)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy_catapult extends Enemy {
public var operator:MovieClip;
var moved:Boolean;// = false
public static var instance:Enemy_catapult;
public static var typeCode:int = 103;
public function Enemy_catapult(){
moved = false;
super();
addFrameScript(0, frame1, 1, frame2, 34, frame35);
speed = 0;
hp = 1;
AIcounterMax = 12;
destinationX = this.x;
actionState = STOP_STATE;
instance = this;
}
function AI(){
var _local1:*;
var _local2:*;
_local1 = new Point(x, y);
_local1 = MovieClip(this.parent).localToGlobal(_local1);
_local2 = MovieClip(Player.instance.parent).localToGlobal(new Point(Player.instance.x, Player.instance.y));
if ((((((this.currentFrame == 1)) && (((_local1.x - _local2.x) > 400)))) && (((Math.random() * 5) < 1)))){
shootBall();
};
}
function frame2(){
}
function frame1(){
stop();
}
override public function die(){
dead = true;
}
override public function unpauseGame(){
}
function frame35(){
operator.gotoAndPlay(10);
}
override public function freeze(){
frozen = true;
}
override public function isDead():Boolean{
return (true);
}
public function shootBall(){
var _local1:*;
gotoAndPlay(2);
_local1 = EnemyManager.instance.getGameStage().globalToLocal(new Point(Player.instance.x, Player.instance.y));
ProjectileManager.instance.createProjectile(BallProjectile.typeCode, ((_local1.x + 200) + (Math.random() * 100)), -100, (-5 - (Math.random() * 10)), -10);
}
override public function update(){
var _local1:*;
if ((((Player.stageMode == 1)) && (!(moved)))){
_local1 = new Point(x, y);
_local1 = MovieClip(this.parent).localToGlobal(_local1);
_local1 = EnemyManager.instance.getGameStage().globalToLocal(_local1);
this.setPosition(_local1.x, _local1.y);
EnemyManager.instance.getGameStage().addChild(this);
moved = true;
};
if (((frozen) || ((Player.stageMode == 1)))){
return;
};
if ((((hp == 0)) && (!((this.operator.currentFrame == 40))))){
this.gotoAndStop(24);
this.operator.gotoAndStop(40);
};
AIcounter--;
if (AIcounter <= 0){
AIcounter = AIcounterMax;
if (hp > 0){
AI();
};
};
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
return (false);
}
override public function pauseGame(){
}
override public function hit(_arg1:int, _arg2:int):Boolean{
return (false);
}
public function destroy(){
this.operator.gotoAndStop(40);
hp = 0;
Player.instance.displayScoreMessage("Disabled Catapult Operator: +1000");
StatsManager.instance.addScore(1000);
StageManager.instance.showHint("");
}
}
}//package
Section 117
//Enemy_guardtower (Enemy_guardtower)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy_guardtower extends Enemy {
var e2dead:Boolean;// = false
var ducking:Boolean;// = false
var moved:Boolean;// = false
var e1dead:Boolean;// = false
public var enemy1:MovieClip;
public var enemy2:MovieClip;
public var enemy3:MovieClip;
var e3dead:Boolean;// = false
public static var typeCode:int = 102;
public function Enemy_guardtower(){
ducking = false;
e1dead = false;
e2dead = false;
e3dead = false;
moved = false;
super();
speed = 0;
hp = 3;
AIcounterMax = 12;
destinationX = this.x;
actionState = STOP_STATE;
}
function AI(){
if (!ducking){
if ((Math.random() * 10) < 1){
duck();
} else {
if ((Math.random() * 4) < 1){
doAttack();
};
};
} else {
if ((Math.random() * 10) < 1){
comeout();
} else {
if ((Math.random() * 25) < 1){
spawnSpear();
};
};
};
}
override public function die(){
dead = true;
}
override public function unpauseGame(){
}
override public function freeze(){
frozen = true;
}
function duck(){
if (!ducking){
if (!e1dead){
enemy1.gotoAndPlay(10);
};
if (!e2dead){
enemy2.gotoAndPlay(10);
};
if (!e3dead){
enemy3.gotoAndPlay(10);
};
ducking = true;
};
}
function doAttack(){
var _local1:*;
_local1 = 0;
while (_local1 < hp) {
shootArrow();
_local1++;
};
}
override public function update(){
var _local1:*;
if ((((Player.stageMode == 1)) && (!(moved)))){
_local1 = new Point(x, y);
_local1 = MovieClip(this.parent).localToGlobal(_local1);
_local1 = EnemyManager.instance.getGameStage().globalToLocal(_local1);
this.setPosition(_local1.x, _local1.y);
EnemyManager.instance.getGameStage().addChild(this);
moved = true;
};
if (frozen){
return;
};
AIcounter--;
if (AIcounter <= 0){
AIcounter = AIcounterMax;
AI();
};
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
duck();
if (((_arg1.hitTestObject(enemy1)) && (!(enemy1.down)))){
e1dead = true;
hp--;
enemy1.visible = false;
spawnSpear();
createFaller();
Player.instance.displayScoreMessage("+100");
StatsManager.instance.addScore(100);
return (true);
};
if (((_arg1.hitTestObject(enemy2)) && (!(enemy2.down)))){
e2dead = true;
hp--;
enemy2.visible = false;
spawnSpear();
createFaller();
Player.instance.displayScoreMessage("+100");
StatsManager.instance.addScore(100);
return (true);
};
if (((_arg1.hitTestObject(enemy3)) && (!(enemy3.down)))){
e3dead = true;
hp--;
enemy3.visible = false;
spawnSpear();
createFaller();
Player.instance.displayScoreMessage("+100");
StatsManager.instance.addScore(100);
return (true);
};
return (false);
}
override public function pauseGame(){
}
function spawnSpear(){
var _local1:*;
_local1 = 0;
while (_local1 < (4 - hp)) {
EnemyManager.instance.createEnemyType(4);
_local1++;
};
if (hp == 0){
EnemyManager.instance.setEnemyInWaiting(0);
Player.instance.displayScoreMessage("Defeated Guard Tower: +1000");
StatsManager.instance.addScore(1000);
StageManager.instance.showHint("Defeat the remaining guards");
};
}
public function shootArrow(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local1 = new Point(x, y);
_local1 = MovieClip(this.parent).localToGlobal(_local1);
_local1 = EnemyManager.instance.getGameStage().globalToLocal(_local1);
_local2 = _local1.x;
_local3 = (_local1.y - 300);
_local4 = ((Math.random() * 25) + 5);
_local5 = ((Math.random() * 20) - 5);
_local6 = EnemyManager.instance.gameStage.globalToLocal(new Point(Player.instance.x, Player.instance.y));
if (_local2 > _local6.x){
_local4 = -(Math.abs(_local4));
};
_local7 = ProjectileManager.instance.createProjectile(Arrow.typeCode, _local2, _local3, _local4, _local5);
if (_local4 < 0){
_local7.scaleX = -1;
};
}
function createFaller(){
var _local1:*;
var _local2:*;
_local1 = ((Math.random() * 2) - 4);
_local2 = ProjectileManager.instance.createProjectile(8, x, (y - 250), _local1, 8);
MovieClip(parent).addChild(_local2);
MovieClip(parent).setChildIndex(_local2, MovieClip(parent).getChildIndex(this));
SoundManager.instance.playDie();
}
override public function hit(_arg1:int, _arg2:int):Boolean{
return (false);
}
function comeout(){
if (ducking){
if (!e1dead){
enemy1.gotoAndPlay(20);
};
if (!e2dead){
enemy2.gotoAndPlay(20);
};
if (!e3dead){
enemy3.gotoAndPlay(20);
};
ducking = false;
doAttack();
};
}
}
}//package
Section 118
//Enemy_scarecrow (Enemy_scarecrow)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy_scarecrow extends Enemy {
var yscale:Number;// = 1
var bird:Enemy_bird;// = null
var dark:Number;
var xscale:Number;// = 1
public var ignore;// = false
public static var typeCode:int = 100;
public function Enemy_scarecrow(){
var _local1:int;
xscale = 1;
yscale = 1;
bird = null;
ignore = false;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
_local1 = (Math.random() * 5);
if (_local1 < 3){
bird = new Enemy_bird();
if (_local1 == 0){
bird.setPosition(-40, -135);
} else {
if (_local1 == 1){
bird.setPosition(40, -135);
} else {
if (_local1 == 2){
bird.setPosition(0, -165);
};
};
};
EnemyManager.instance.enemyList.push(bird);
this.addChild(bird);
bird.onscarecrow = true;
};
this.rotation = (-10 + (Math.random() * 20));
this.y = (this.y + (10 + (Math.random() * 25)));
dark = (-(Math.random()) * 60);
xscale = (((Math.random() * 2) + 8) / 10);
yscale = (((Math.random() * 2) + 8) / 10);
if ((Math.random() * 2) < 1){
xscale = -(xscale);
};
this.scaleX = xscale;
this.scaleY = yscale;
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame1(){
stop();
}
override public function die(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
if (StatsManager.instance.location == 36){
MovieClip(parent.parent).stagebg1.tuticon2.visible = false;
MovieClip(parent.parent).stagebg1.tuticon3.visible = true;
};
if (bird != null){
bird.visible = false;
};
dead = true;
SoundManager.instance.playScarecrowDie();
if (Player.stageMode == 1){
this.gotoAndStop(4);
} else {
this.gotoAndStop(2);
};
this.rotation = (this.rotation + 5);
_local1 = -(((Math.random() * 5) + 2));
_local2 = ((Math.random() * 5) + 20);
if ((Math.random() * 2) < 1){
_local2 = -(_local2);
_local1 = -(_local1);
};
_local3 = new Point(-20, -120);
_local3 = this.localToGlobal(_local3);
_local3 = EnemyManager.instance.getGameStage().globalToLocal(_local3);
if (Player.stageMode == 1){
_local4 = ProjectileManager.instance.createProjectile(101, _local3.x, _local3.y, _local1, 35);
} else {
_local4 = ProjectileManager.instance.createProjectile(100, _local3.x, _local3.y, _local1, 35);
};
_local4.rot = _local2;
_local4.scaleX = xscale;
_local4.scaleY = yscale;
}
override public function unpauseGame(){
}
override public function freeze(){
if (bird != null){
bird.visible = false;
};
}
override public function isDead():Boolean{
if (((ignore) && (!(dead)))){
return (false);
};
return (dead);
}
override public function update(){
if (Player.stageMode == 1){
if (dead){
gotoAndStop(4);
} else {
gotoAndStop(3);
};
};
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
if (_arg1.isSimulation()){
if (hp == 1){
_arg1.killingHit = true;
};
return (true);
};
if (hp > 0){
hp--;
if (hp <= 0){
if (_arg1.killingHit){
freeze();
} else {
if (bird != null){
bird.flyaway();
};
die();
};
};
return (true);
};
return (false);
}
override public function pauseGame(){
}
override public function hit(_arg1:int, _arg2:int):Boolean{
if (bird != null){
bird.flyaway();
};
if (hp > 0){
hp--;
return (true);
};
return (false);
}
}
}//package
Section 119
//Enemy_squirrel (Enemy_squirrel)
package {
import flash.display.*;
public class Enemy_squirrel extends Enemy {
public var squirrel:MovieClip;
var running:Boolean;// = false
public static var typeCode:int = 102;
public function Enemy_squirrel(){
running = false;
super();
addFrameScript(0, frame1, 1, frame2);
type = typeCode;
if ((Math.random() * 2) < 1){
this.scaleX = -1;
};
hp = 0;
}
function frame2(){
stop();
}
function frame1(){
stop();
}
override public function die(){
dead = true;
}
override public function unpauseGame(){
if (this.squirrel != null){
this.squirrel.play();
};
}
override public function freeze(){
this.visible = false;
}
override public function isDead():Boolean{
return (true);
}
override public function update(){
if (Player.stageMode == 1){
freeze();
frozen = true;
};
if (((!(visible)) || (frozen))){
return;
};
if (running){
if (this.scaleX == 1){
this.x = (this.x + 10);
} else {
this.x = (this.x - 10);
};
if ((((this.x < -50)) || ((this.x > (StageManager.instance.stageWidth + 50))))){
this.visible = false;
};
if ((Math.random() * 8) < 1){
running = false;
this.gotoAndStop(1);
};
} else {
if ((Math.random() * 20) < 1){
running = true;
this.gotoAndStop(2);
};
};
}
override public function pauseGame(){
if (this.squirrel != null){
this.squirrel.stop();
};
}
override public function hit(_arg1:int, _arg2:int):Boolean{
if (hp > 0){
hp--;
return (true);
};
return (false);
}
}
}//package
Section 120
//Enemy_target (Enemy_target)
package {
public class Enemy_target extends Enemy {
public static var typeCode:int = 101;
public function Enemy_target(){
this.rotation = (-10 + (Math.random() * 20));
speed = 0;
}
override public function die(){
dead = true;
}
override public function unpauseGame(){
}
override public function freeze(){
}
override public function update(){
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
if (_arg1.y < (this.y - 97)){
return (false);
};
if (_arg1.isSimulation()){
if (hp == 1){
_arg1.killingHit = true;
};
return (true);
};
if (hp > 0){
hp--;
if (hp <= 0){
if (_arg1.killingHit){
freeze();
};
};
return (true);
};
return (false);
}
override public function pauseGame(){
}
override public function hit(_arg1:int, _arg2:int):Boolean{
if (hp > 0){
hp--;
return (true);
};
return (false);
}
}
}//package
Section 121
//Enemy1 (Enemy1)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy1 extends Enemy {
public var enemy:MovieClip;
public static var typeCode:int = 1;
public function Enemy1(){
addFrameScript(0, frame1, 1, frame2);
speed = 2;
AIcounterMax = 48;
destinationX = this.x;
actionState = MOVE_STATE;
}
public function moveAgain(){
destinationX = getPlayerPos().x;
faceDestination();
actionState = MOVE_STATE;
speed = ((Math.random() * 2) + 2);
}
function AI(){
var _local1:*;
if (Player.stageMode == 1){
return;
};
_local1 = getPlayerPos().x;
if (Math.abs((_local1 - this.x)) > 50){
destinationX = _local1;
faceDestination();
actionState = MOVE_STATE;
speed = ((Math.random() * 2) + 2);
} else {
actionState = ATTACK_STATE;
};
}
function frame2(){
stop();
}
function frame1(){
stop();
}
override public function die(){
dead = true;
SoundManager.instance.playDie();
StatsManager.instance.kills++;
if (headshot){
enemy.gotoAndStop(6);
} else {
if (((arrowshot) && ((Player.stageMode == 1)))){
enemy.gotoAndStop(7);
} else {
if (!arrowshot){
if ((Math.random() * 2) < 1){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
};
if ((Math.random() * 10) > 1){
enemy.gotoAndStop(4);
} else {
enemy.gotoAndStop(5);
};
};
};
}
override public function freeze(){
this.enemy.enemy.stop();
frozen = true;
}
function doAttack(){
facePlayer();
if (enemy.currentFrame != 3){
enemy.gotoAndStop(3);
};
}
override public function update(){
if (isDead()){
doDisappear();
return;
};
if (frozen){
return;
};
AIcounter--;
if (AIcounter <= 0){
AIcounter = AIcounterMax;
AI();
};
if ((((hp > 0)) && ((Math.abs((getPlayerPos().x - this.x)) <= 50)))){
actionState = ATTACK_STATE;
};
switch (actionState){
case STOP_STATE:
doStop();
break;
case MOVE_STATE:
doMove();
break;
case ATTACK_STATE:
doAttack();
break;
case DIE_STATE:
die();
break;
};
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
if (_arg1.y < (this.y - 97)){
return (false);
};
if (_arg1.isSimulation()){
if (hp == 1){
_arg1.killingHit = true;
};
return (true);
};
if (hp > 0){
hp--;
arrowshot = true;
if (((!((MovieClip(this).enemy.enemy == null))) && (MovieClip(this).enemy.enemy.head.hitTestObject(_arg1)))){
headshot = true;
};
if (hp <= 0){
if (_arg1.killingHit){
freeze();
if (headshot){
Player.instance.displayScoreMessage("Coup de Grace Arrow Headshot: +5000");
StatsManager.instance.addScore(5000);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("Coup de Grace: +500");
StatsManager.instance.addScore(500);
};
} else {
die();
if (headshot){
Player.instance.displayScoreMessage("Arrow Headshot: +400");
StatsManager.instance.addScore(400);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("+100");
StatsManager.instance.addScore(100);
};
};
};
return (true);
};
return (false);
}
function doMove(){
if (enemy.currentFrame != 2){
enemy.gotoAndStop(2);
};
if ((this.x - destinationX) > speed){
this.x = (this.x - speed);
} else {
if ((this.x - destinationX) < -(speed)){
this.x = (this.x + speed);
} else {
actionState = STOP_STATE;
facePlayer();
};
};
}
function doStop(){
if (enemy.currentFrame != 1){
enemy.gotoAndStop(1);
};
}
override public function hit(_arg1:int, _arg2:int):Boolean{
var _local3:*;
if (hp > 0){
hp--;
_local3 = new Point(_arg1, _arg2);
if (MovieClip(this).enemy.enemy.head.hitTestPoint(_local3.x, _local3.y)){
headshot = true;
};
return (true);
};
return (false);
}
}
}//package
Section 122
//Enemy2 (Enemy2)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy2 extends Enemy {
var reloadCounter:int;
var maxReloadCounter:int;// = 96
public var lastAimAngle:int;// = 0
public var enemy:MovieClip;
public static var typeCode:int = 2;
public function Enemy2(){
maxReloadCounter = (4 * 24);
reloadCounter = maxReloadCounter;
lastAimAngle = 0;
super();
addFrameScript(0, frame1, 1, frame2);
speed = 2;
AIcounterMax = (5 * 24);
destinationX = this.x;
actionState = MOVE_STATE;
}
public function getAimAngle(_arg1:MovieClip):int{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
if (frozen){
return (_arg1.rotation);
};
_local2 = this.x;
_local3 = (this.y - 50);
_local4 = (getPlayerPos().x + 10);
_local5 = (getPlayerPos().y - 50);
_local6 = 20;
if (_local2 > _local4){
_local6 = -(_local6);
};
_local7 = ((_local4 - _local2) / _local6);
_local8 = (((_local5 + (((0.5 * Arrow.gravity) * _local7) * _local7)) - _local3) / _local7);
lastAimAngle = ((Math.atan2(_local8, _local6) * 180) / Math.PI);
if (_local6 < 0){
lastAimAngle = (((-(Math.atan2(_local8, _local6)) * 180) / Math.PI) - 180);
};
return (lastAimAngle);
}
function AI(){
var _local1:*;
if (Player.stageMode == 1){
return;
};
_local1 = getPlayerPos().x;
if (((((((Math.random() * 25) < 1)) || ((this.x < 70)))) || ((this.x > (StageManager.instance.stageWidth - 30))))){
actionState = MOVE_STATE;
if (Math.abs((this.x - _local1)) < 700){
if ((this.x - _local1) > 0){
destinationX = (this.x + (Math.random() * 100));
} else {
destinationX = (this.x - (Math.random() * 100));
};
};
if (destinationX < 0){
destinationX = (Math.random() * 150);
} else {
if (destinationX > StageManager.instance.stageWidth){
destinationX = (StageManager.instance.stageWidth - (Math.random() * 150));
};
};
faceDestination();
} else {
actionState = ATTACK_STATE;
if (enemy.currentFrame != 1){
enemy.gotoAndStop(1);
};
};
}
function frame2(){
stop();
}
function frame1(){
stop();
}
override public function die(){
dead = true;
SoundManager.instance.playDie();
StatsManager.instance.kills++;
if (headshot){
enemy.gotoAndStop(6);
} else {
if (((arrowshot) && ((Player.stageMode == 1)))){
enemy.gotoAndStop(7);
} else {
if (!arrowshot){
if ((Math.random() * 2) < 1){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
};
if ((Math.random() * 10) > 1){
enemy.gotoAndStop(4);
} else {
enemy.gotoAndStop(5);
};
};
};
}
override public function freeze(){
this.enemy.enemy.stop();
frozen = true;
}
function doAttack(){
facePlayer();
if (enemy.currentFrame != 3){
enemy.gotoAndStop(3);
};
}
override public function update(){
if (isDead()){
doDisappear();
return;
};
if (frozen){
return;
};
AIcounter--;
if (AIcounter <= 0){
AIcounter = AIcounterMax;
AI();
};
switch (actionState){
case STOP_STATE:
doStop();
break;
case MOVE_STATE:
doMove();
break;
case ATTACK_STATE:
facePlayer();
reloadCounter--;
if (reloadCounter <= 0){
reloadCounter = maxReloadCounter;
doAttack();
};
break;
case DIE_STATE:
die();
break;
};
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
if (_arg1.y < (this.y - 95)){
return (false);
};
if (_arg1.isSimulation()){
if (hp == 1){
_arg1.killingHit = true;
};
return (true);
};
if (hp > 0){
hp--;
arrowshot = true;
if (MovieClip(this).enemy.enemy != null){
if (MovieClip(this).enemy.enemy.aimtop != null){
if (MovieClip(this).enemy.enemy.aimtop.head.hitTestObject(_arg1)){
headshot = true;
};
} else {
if (MovieClip(this).enemy.enemy.head != null){
if (MovieClip(this).enemy.enemy.head.hitTestObject(_arg1)){
headshot = true;
};
};
};
};
if (hp <= 0){
if (_arg1.killingHit){
freeze();
if (headshot){
Player.instance.displayScoreMessage("Coup de Grace Arrow Headshot: +5000");
StatsManager.instance.addScore(5000);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("Coup de Grace: +500");
StatsManager.instance.addScore(500);
};
} else {
die();
if (headshot){
Player.instance.displayScoreMessage("Arrow Headshot: +400");
StatsManager.instance.addScore(400);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("+100");
StatsManager.instance.addScore(100);
};
};
};
return (true);
};
return (false);
}
function doMove(){
if (enemy.currentFrame != 2){
enemy.gotoAndStop(2);
};
if ((destinationX - this.x) < -(speed)){
this.x = (this.x - speed);
} else {
if ((destinationX - this.x) > speed){
this.x = (this.x + speed);
} else {
actionState = ATTACK_STATE;
if (enemy.currentFrame != 1){
enemy.gotoAndStop(1);
};
};
};
}
public function shootArrow(_arg1:MovieClip){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local2 = this.x;
_local3 = (this.y - 80);
_local4 = ((Math.random() * 200) - 100);
_local5 = 2;
if (getPlayerIsFacingLeft()){
_local5 = -(_local5);
};
_local6 = 20;
if (_local2 > getPlayerPos().x){
_local6 = -(_local6);
};
_local7 = ((this.x - getPlayerPos().x) / (_local5 - _local6));
_local8 = ((getPlayerPos().y - 125) + _local4);
_local9 = (((_local8 + (((0.5 * Arrow.gravity) * _local7) * _local7)) - _local3) / _local7);
_local10 = ProjectileManager.instance.createProjectile(Arrow.typeCode, _local2, _local3, _local6, _local9);
if (_local6 < 0){
_local10.scaleX = -1;
};
}
public function doStop(){
facePlayer();
if (enemy.currentFrame != 1){
enemy.gotoAndStop(1);
};
}
override public function hit(_arg1:int, _arg2:int):Boolean{
var _local3:*;
if ((((this.enemy.currentFrame == 1)) || ((this.enemy.currentFrame == 3)))){
if (this.enemy.enemy.aimtop != null){
if (this.enemy.enemy.aimtop.bow.hitTestPoint(_arg1, _arg2, true)){
return (false);
};
} else {
if (this.enemy.enemy.bow != null){
if (this.enemy.enemy.bow.hitTestPoint(_arg1, _arg2, true)){
return (false);
};
};
};
};
if (hp > 0){
hp--;
_local3 = new Point(_arg1, _arg2);
if (MovieClip(this).enemy.enemy.aimtop != null){
if (MovieClip(this).enemy.enemy.aimtop.head.hitTestPoint(_local3.x, _local3.y)){
headshot = true;
};
};
if (MovieClip(this).enemy.enemy.head != null){
if (MovieClip(this).enemy.enemy.head.hitTestPoint(_local3.x, _local3.y)){
headshot = true;
};
};
return (true);
};
return (false);
}
}
}//package
Section 123
//Enemy3 (Enemy3)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy3 extends Enemy {
public var enemy:MovieClip;
var reload:Boolean;// = false
public static var typeCode:int = 3;
public function Enemy3(){
reload = false;
super();
addFrameScript(0, frame1, 1, frame2);
speed = 3;
AIcounterMax = 48;
destinationX = this.x;
actionState = MOVE_STATE;
}
public function moveAgain(){
destinationX = getPlayerPos().x;
faceDestination();
actionState = MOVE_STATE;
speed = ((Math.random() * 2) + 2);
}
function AI(){
var _local1:*;
if (Player.stageMode == 1){
return;
};
_local1 = getPlayerPos().x;
if (Math.abs((_local1 - this.x)) > 70){
destinationX = _local1;
faceDestination();
actionState = MOVE_STATE;
speed = ((Math.random() * 3) + 2);
} else {
if (!reload){
actionState = ATTACK_STATE;
};
};
}
function frame2(){
stop();
}
function frame1(){
stop();
}
override public function die(){
dead = true;
SoundManager.instance.playDie();
StatsManager.instance.kills++;
if (headshot){
enemy.gotoAndStop(6);
} else {
if (((arrowshot) && ((Player.stageMode == 1)))){
enemy.gotoAndStop(7);
} else {
if (!arrowshot){
if ((Math.random() * 2) < 1){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
};
if ((Math.random() * 10) > 1){
enemy.gotoAndStop(4);
} else {
enemy.gotoAndStop(5);
};
};
};
}
override public function freeze(){
this.enemy.enemy.stop();
frozen = true;
}
public function setReload(_arg1:Boolean){
reload = _arg1;
}
function doAttack(){
facePlayer();
if (((!(reload)) && (!((enemy.currentFrame == 3))))){
enemy.gotoAndStop(3);
};
}
override public function update(){
if (isDead()){
doDisappear();
return;
};
if (frozen){
return;
};
AIcounter--;
if (AIcounter <= 0){
AIcounter = AIcounterMax;
AI();
};
if ((((((((((hp > 0)) && ((Math.abs((getPlayerPos().x - this.x)) <= 70)))) && (!(reload)))) && ((this.x > 20)))) && ((this.x < (Player.instance.windowWidth - 20))))){
actionState = ATTACK_STATE;
};
switch (actionState){
case STOP_STATE:
doStop();
break;
case MOVE_STATE:
doMove();
break;
case ATTACK_STATE:
doAttack();
break;
case DIE_STATE:
die();
break;
};
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
if (_arg1.y < (this.y - 100)){
return (false);
};
if (_arg1.isSimulation()){
if (hp == 1){
_arg1.killingHit = true;
};
return (true);
};
if (hp > 0){
hp--;
arrowshot = true;
if (((!((MovieClip(this).enemy.enemy == null))) && (MovieClip(this).enemy.enemy.head.hitTestObject(_arg1)))){
headshot = true;
};
if (hp <= 0){
if (_arg1.killingHit){
freeze();
if (headshot){
Player.instance.displayScoreMessage("Coup de Grace Arrow Headshot: +5000");
StatsManager.instance.addScore(5000);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("Coup de Grace: +500");
StatsManager.instance.addScore(500);
};
} else {
die();
if (headshot){
Player.instance.displayScoreMessage("Arrow Headshot: +400");
StatsManager.instance.addScore(400);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("+100");
StatsManager.instance.addScore(100);
};
};
};
return (true);
};
return (false);
}
function doMove(){
reload = false;
if (enemy.currentFrame != 2){
enemy.gotoAndStop(2);
};
if ((this.x - destinationX) > speed){
this.x = (this.x - speed);
} else {
if ((this.x - destinationX) < -(speed)){
this.x = (this.x + speed);
} else {
actionState = STOP_STATE;
};
};
}
override public function pauseGame(){
if ((((MovieClip(this).enemy.currentFrame == 3)) && ((((MovieClip(this).enemy.enemy.currentFrame == 3)) || ((MovieClip(this).enemy.enemy.currentFrame == 4)))))){
MovieClip(this).enemy.enemy.gotoAndStop(5);
} else {
MovieClip(this).enemy.enemy.stop();
};
}
function doStop(){
if (enemy.currentFrame != 1){
enemy.gotoAndStop(1);
};
}
override public function hit(_arg1:int, _arg2:int):Boolean{
var _local3:*;
if ((((((this.enemy.currentFrame == 1)) || ((this.enemy.currentFrame == 2)))) || ((this.enemy.currentFrame == 3)))){
if (this.enemy.enemy.weapon != null){
if (this.enemy.enemy.weapon.hitTestPoint(_arg1, _arg2)){
return (false);
};
};
};
if (hp > 0){
hp--;
_local3 = new Point(_arg1, _arg2);
if (MovieClip(this).enemy.enemy.head.hitTestPoint(_local3.x, _local3.y)){
headshot = true;
};
return (true);
};
return (false);
}
}
}//package
Section 124
//Enemy4 (Enemy4)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy4 extends Enemy {
public var enemy:MovieClip;
public static var typeCode:int = 4;
public function Enemy4(){
addFrameScript(0, frame1, 1, frame2);
speed = 3;
AIcounterMax = 24;
destinationX = this.x;
actionState = MOVE_STATE;
}
function AI(){
var _local1:*;
if (Player.stageMode == 1){
return;
};
_local1 = getPlayerPos().x;
if (Math.abs((_local1 - this.x)) > 400){
destinationX = _local1;
faceDestination();
actionState = MOVE_STATE;
speed = ((Math.random() * 3) + 1);
} else {
if (((((Math.random() * 2) < 1)) || ((Math.abs((_local1 - this.x)) < 200)))){
if (_local1 < this.x){
destinationX = (_local1 - 500);
} else {
destinationX = (_local1 + 500);
};
faceDestination();
actionState = ATTACK_STATE;
speed = 8;
};
};
}
function frame2(){
stop();
}
function frame1(){
stop();
}
override public function die(){
dead = true;
SoundManager.instance.playDie();
StatsManager.instance.kills++;
if (headshot){
enemy.gotoAndStop(6);
} else {
if (((arrowshot) && ((Player.stageMode == 1)))){
facePlayer();
enemy.gotoAndStop(7);
} else {
if (!arrowshot){
if ((Math.random() * 2) < 1){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
};
if ((Math.random() * 10) > 1){
enemy.gotoAndStop(4);
} else {
enemy.gotoAndStop(5);
};
};
};
}
override public function freeze(){
this.enemy.enemy.stop();
frozen = true;
}
function doAttack(){
if (enemy.currentFrame != 3){
enemy.gotoAndStop(3);
};
if ((this.x - destinationX) > speed){
this.x = (this.x - speed);
} else {
if ((this.x - destinationX) < -(speed)){
this.x = (this.x + speed);
} else {
this.x = destinationX;
actionState = STOP_STATE;
};
};
}
override public function update(){
if (isDead()){
doDisappear();
return;
};
if (frozen){
return;
};
AIcounter--;
if ((((AIcounter <= 0)) && (!((actionState == ATTACK_STATE))))){
AIcounter = AIcounterMax;
AI();
};
switch (actionState){
case STOP_STATE:
doStop();
break;
case MOVE_STATE:
doMove();
break;
case ATTACK_STATE:
doAttack();
break;
case DIE_STATE:
die();
break;
};
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
if (_arg1.y < (this.y - 97)){
return (false);
};
if (enemy.currentFrame == 3){
if (_arg1.y < (this.y - 75)){
return (false);
};
};
if (_arg1.isSimulation()){
if (hp == 1){
_arg1.killingHit = true;
};
return (true);
};
if (hp > 0){
hp--;
arrowshot = true;
if (((!((MovieClip(this).enemy.enemy == null))) && (MovieClip(this).enemy.enemy.head.hitTestObject(_arg1)))){
headshot = true;
};
if (hp <= 0){
if (_arg1.killingHit){
freeze();
if (headshot){
Player.instance.displayScoreMessage("Coup de Grace Arrow Headshot: +5000");
StatsManager.instance.addScore(5000);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("Coup de Grace: +500");
StatsManager.instance.addScore(500);
};
} else {
die();
if (headshot){
Player.instance.displayScoreMessage("Arrow Headshot: +400");
StatsManager.instance.addScore(400);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("+100");
StatsManager.instance.addScore(100);
};
};
};
return (true);
};
return (false);
}
function doMove(){
faceDestination();
if (enemy.currentFrame != 2){
enemy.gotoAndStop(2);
};
if ((this.x - destinationX) > speed){
this.x = (this.x - speed);
} else {
if ((this.x - destinationX) < -(speed)){
this.x = (this.x + speed);
} else {
actionState = STOP_STATE;
};
};
}
function doStop(){
facePlayer();
if (enemy.currentFrame != 1){
enemy.gotoAndStop(1);
};
}
override public function hit(_arg1:int, _arg2:int):Boolean{
var _local3:*;
if (hp > 0){
hp--;
_local3 = new Point(_arg1, _arg2);
if (MovieClip(this).enemy.enemy.head.hitTestPoint(_local3.x, _local3.y)){
headshot = true;
};
return (true);
};
return (false);
}
}
}//package
Section 125
//Enemy5 (Enemy5)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy5 extends Enemy {
public var stuckarrow3rot;// = 0
public var stuckarrow1rot;// = 0
public var enemy:MovieClip;
public var stuckarrow2rot;// = 0
public static var typeCode:int = 5;
public function Enemy5(){
stuckarrow1rot = 0;
stuckarrow2rot = 0;
stuckarrow3rot = 0;
super();
addFrameScript(0, frame1, 1, frame2);
speed = 1;
AIcounterMax = 24;
destinationX = this.x;
actionState = MOVE_STATE;
}
function AI(){
var _local1:*;
if (Player.stageMode == 1){
return;
};
_local1 = getPlayerPos().x;
if ((((actionState == STOP_STATE)) && (((Math.random() * 3) < 2)))){
return;
};
if (((((((Math.random() * 4) < 1)) && ((this.x > 20)))) && ((this.x < (Player.instance.windowWidth - 20))))){
actionState = STOP_STATE;
} else {
if (Math.abs((_local1 - this.x)) > 50){
destinationX = _local1;
faceDestination();
actionState = MOVE_STATE;
speed = ((Math.random() * 3) + 1);
} else {
actionState = ATTACK_STATE;
};
};
}
function frame2(){
stop();
}
function frame1(){
stop();
}
override public function die(){
dead = true;
SoundManager.instance.playDie();
StatsManager.instance.kills++;
if (headshot){
enemy.gotoAndStop(6);
} else {
if (((arrowshot) && ((Player.stageMode == 1)))){
enemy.gotoAndStop(7);
} else {
if (!arrowshot){
if ((Math.random() * 2) < 1){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
};
if ((Math.random() * 10) > 1){
enemy.gotoAndStop(4);
} else {
enemy.gotoAndStop(5);
};
};
};
}
override public function freeze(){
this.enemy.enemy.stop();
frozen = true;
}
function doAttack(){
facePlayer();
if (enemy.currentFrame != 3){
enemy.gotoAndStop(3);
};
}
override public function update(){
if (isDead()){
doDisappear();
return;
};
if (frozen){
return;
};
AIcounter--;
if (AIcounter <= 0){
AIcounter = AIcounterMax;
AI();
};
if ((((hp > 0)) && ((Math.abs((getPlayerPos().x - this.x)) <= 50)))){
actionState = ATTACK_STATE;
};
switch (actionState){
case STOP_STATE:
doStop();
break;
case MOVE_STATE:
doMove();
break;
case ATTACK_STATE:
doAttack();
break;
case DIE_STATE:
die();
break;
};
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
if (_arg1.y < (this.y - 95)){
return (false);
};
if ((((((enemy.currentFrame == 1)) && (!((enemy.enemy == null))))) && ((enemy.enemy.currentFrame == 3)))){
if (_arg1.y < (this.y - 75)){
return (false);
};
};
if (hp > 0){
if (((!((enemy.enemy.shield == null))) && (!(enemy.enemy.shield.shield.hitTestObject(_arg1))))){
if (_arg1.isSimulation()){
if (hp == 1){
_arg1.killingHit = true;
};
return (true);
};
hp--;
if (MovieClip(this).enemy.enemy.head.hitTestObject(_arg1)){
headshot = true;
};
if (hp <= 0){
if (_arg1.killingHit){
freeze();
if (headshot){
Player.instance.displayScoreMessage("Coup de Grace Arrow Headshot: +5000");
StatsManager.instance.addScore(5000);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("Coup de Grace: +500");
StatsManager.instance.addScore(500);
};
} else {
die();
if (headshot){
Player.instance.displayScoreMessage("Arrow Headshot: +400");
StatsManager.instance.addScore(400);
StatsManager.instance.arrowHeadShots++;
} else {
Player.instance.displayScoreMessage("+100");
StatsManager.instance.addScore(100);
};
};
};
} else {
if (_arg1.isSimulation()){
_arg1.killingHit = false;
return (true);
};
if (this.currentFrame == 1){
this.x = (this.x - 20);
} else {
this.x = (this.x + 20);
};
_arg1.disable();
if ((Math.random() * 3) < 1){
_arg1.breakarrow();
} else {
if (!enemy.enemy.shield.shield.stuckarrow1.visible){
enemy.enemy.shield.shield.stuckarrow1.rotation = _arg1.rotation;
enemy.enemy.shield.shield.stuckarrow1.visible = true;
stuckarrow1rot = _arg1.rotation;
} else {
if (!enemy.enemy.shield.shield.stuckarrow2.visible){
enemy.enemy.shield.shield.stuckarrow2.rotation = _arg1.rotation;
enemy.enemy.shield.shield.stuckarrow2.visible = true;
stuckarrow2rot = _arg1.rotation;
} else {
if (!enemy.enemy.shield.shield.stuckarrow3.visible){
enemy.enemy.shield.shield.stuckarrow3.rotation = _arg1.rotation;
enemy.enemy.shield.shield.stuckarrow3.visible = true;
stuckarrow3rot = _arg1.rotation;
} else {
_arg1.breakarrow();
};
};
};
};
return (true);
};
};
return (false);
}
function doMove(){
if (enemy.currentFrame != 2){
enemy.gotoAndStop(2);
};
if ((this.x - destinationX) > speed){
this.x = (this.x - speed);
} else {
if ((this.x - destinationX) < -(speed)){
this.x = (this.x + speed);
} else {
actionState = STOP_STATE;
};
};
}
function doStop(){
if (enemy.currentFrame != 1){
enemy.gotoAndStop(1);
};
}
override public function hit(_arg1:int, _arg2:int):Boolean{
var _local3:*;
if (hp > 0){
if (!enemy.enemy.shield.shield.hitTestPoint(_arg1, _arg2)){
hp--;
_local3 = new Point(_arg1, _arg2);
if (MovieClip(this).enemy.enemy.head.hitTestPoint(_local3.x, _local3.y)){
headshot = true;
};
};
return (true);
};
return (false);
}
}
}//package
Section 126
//Enemy6 (Enemy6)
package {
import flash.display.*;
public class Enemy6 extends Enemy {
var fallVel;// = 0
var reloadMax:int;// = 24
public var enemy:MovieClip;
var reload:int;
public static var typeCode:int = 6;
public function Enemy6(){
reloadMax = 24;
reload = reloadMax;
fallVel = 0;
super();
addFrameScript(0, frame1, 1, frame2);
speed = 5;
AIcounterMax = 24;
destinationX = this.x;
actionState = MOVE_STATE;
hp = 3;
}
public function shouldDrawSmoke():Boolean{
return (true);
}
function AI(){
var _local1:*;
_local1 = getPlayerPos().x;
if (Math.abs((_local1 - this.x)) > 400){
destinationX = _local1;
faceDestination();
actionState = MOVE_STATE;
speed = ((Math.random() * 3) + 2);
} else {
if (((((Math.random() * 2) < 1)) || ((Math.abs((_local1 - this.x)) <= 400)))){
if (_local1 < this.x){
destinationX = (_local1 - 500);
} else {
destinationX = (_local1 + 500);
};
faceDestination();
actionState = ATTACK_STATE;
speed = 15;
};
};
}
public function jumpDownStart(){
actionState = JUMPDOWN_STATE;
enemy.gotoAndStop(11);
this.y = (this.y - (25 * 10));
if (this.currentFrame == 1){
this.x = (this.x + (30 * 10));
} else {
this.x = (this.x - (30 * 10));
};
fallVel = 0;
}
function frame2(){
stop();
}
function frame1(){
stop();
}
override public function die(){
SoundManager.instance.playBossDie();
StatsManager.instance.bossDefeated = true;
StatsManager.instance.hexState[2][5].side = 2;
StatsManager.instance.kills++;
this.y = Player.groundY;
dead = true;
if (this.x > getPlayerPos().x){
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
};
if (enemy.currentFrame != 4){
enemy.gotoAndStop(4);
};
}
override public function reactShunpo(_arg1:Array, _arg2:Array){
if (checkHitBeforeShunpo(_arg1, _arg2)){
enemy.gotoAndStop(10);
actionState = JUMPUP_STATE;
};
}
override public function unpauseGame(){
if ((((disappearCounter > 0)) && (!(deathAnimDone)))){
MovieClip(this).enemy.enemy.play();
};
}
override public function freeze(){
frozen = true;
this.y = Player.groundY;
enemy.gotoAndStop(1);
if (Player.instance.currentFrame == 1){
this.x = (getPlayerPos().x + 12);
} else {
this.x = (getPlayerPos().x - 12);
};
}
public function throwSpear(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
_local1 = this.x;
_local2 = (this.y - 100);
_local3 = 0;
_local4 = 30;
if (getPlayerIsFacingLeft()){
_local4 = -(_local4);
};
_local5 = 20;
if (_local1 > getPlayerPos().x){
_local5 = -(_local5);
};
_local6 = (-15 + (Math.random() * 20));
_local7 = ProjectileManager.instance.createProjectile(Javalin.typeCode, _local1, _local2, _local5, _local6);
if (_local5 < 0){
_local7.scaleX = -1;
};
_local8 = 0;
_local9 = 0;
while (_local9 < _local8) {
_local6 = (-25 + (Math.random() * 20));
_local7 = ProjectileManager.instance.createProjectile(Javalin.typeCode, _local1, _local2, _local5, _local6);
if (_local5 < 0){
_local7.scaleX = -1;
};
_local9++;
};
}
function doAttack(){
if (enemy.currentFrame != 3){
enemy.gotoAndStop(3);
};
if ((this.x - destinationX) > speed){
this.x = (this.x - speed);
} else {
if ((this.x - destinationX) < -(speed)){
this.x = (this.x + speed);
} else {
this.x = destinationX;
actionState = STOP_STATE;
};
};
if ((((((((reload <= 0)) && ((Math.abs((this.x - getPlayerPos().x)) < 150)))) && (!((enemy.enemy == null))))) && ((enemy.enemy.currentFrame < 23)))){
enemy.enemy.gotoAndPlay(23);
reload = reloadMax;
};
}
override public function update(){
var _local1:*;
if (((isDead()) || (frozen))){
return;
};
reload--;
if ((((((((((reload <= 0)) && ((Math.abs((this.x - getPlayerPos().x)) < 150)))) && (!((actionState == ATTACK_STATE))))) && (!((actionState == JUMPUP_STATE))))) && (!((actionState == JUMPDOWN_STATE))))){
_local1 = getPlayerPos().x;
if (_local1 < this.x){
destinationX = (_local1 - 500);
} else {
destinationX = (_local1 + 500);
};
faceDestination();
actionState = ATTACK_STATE;
speed = 15;
};
AIcounter--;
if ((((((((AIcounter <= 0)) && (!((actionState == ATTACK_STATE))))) && (!((actionState == JUMPUP_STATE))))) && (!((actionState == JUMPDOWN_STATE))))){
AIcounter = AIcounterMax;
AI();
};
switch (actionState){
case STOP_STATE:
doStop();
break;
case MOVE_STATE:
doMove();
break;
case ATTACK_STATE:
doAttack();
break;
case DIE_STATE:
die();
break;
case JUMPUP_STATE:
jumpup();
break;
case JUMPDOWN_STATE:
jumpdown();
break;
};
}
override public function arrowHit(_arg1:Arrow_player):Boolean{
var _local2:*;
if (_arg1.isSimulation()){
return (true);
};
_arg1.breakarrow();
if ((((enemy.currentFrame == 3)) && (!((enemy.enemy == null))))){
enemy.enemy.gotoAndPlay(23);
} else {
_local2 = getPlayerPos().x;
if (_local2 < this.x){
destinationX = (_local2 - 500);
} else {
destinationX = (_local2 + 500);
};
faceDestination();
actionState = ATTACK_STATE;
speed = 15;
};
return (true);
}
function doMove(){
faceDestination();
if (enemy.currentFrame != 2){
enemy.gotoAndStop(2);
};
if ((this.x - destinationX) > speed){
this.x = (this.x - speed);
} else {
if ((this.x - destinationX) < -(speed)){
this.x = (this.x + speed);
} else {
actionState = STOP_STATE;
};
};
}
override public function pauseGame(){
MovieClip(this).enemy.enemy.stop();
}
function doStop(){
facePlayer();
if (enemy.currentFrame != 1){
enemy.gotoAndStop(1);
};
}
public function jumpup(){
}
public function getPositionAfter15():int{
var _local1:*;
_local1 = 1;
if (this.currentFrame == 2){
_local1 = -1;
};
return ((this.x + ((speed * 15) * _local1)));
}
override public function hit(_arg1:int, _arg2:int):Boolean{
if ((((hp > 0)) && ((actionState == JUMPDOWN_STATE)))){
hp--;
Player.instance.displayScoreMessage("Landed a hit: +500");
StatsManager.instance.addScore(500);
SoundManager.instance.playPunch();
if (hp == 0){
Player.instance.displayScoreMessage("Boss defeated: +5000");
StatsManager.instance.addScore(5000);
};
return (true);
};
return (false);
}
public function checkHitBeforeShunpo(_arg1:Array, _arg2:Array):Boolean{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
_local3 = new Array();
_local4 = new Array();
_local3.push(_arg1[0]);
_local4.push(_arg2[0]);
_local5 = 1;
while (_local5 < _arg1.length) {
_local8 = ((_arg1[_local5] - _arg1[(_local5 - 1)]) / 4);
_local9 = ((_arg2[_local5] - _arg2[(_local5 - 1)]) / 4);
_local3.push((_arg1[(_local5 - 1)] + _local8));
_local4.push((_arg2[(_local5 - 1)] + _local9));
_local3.push((_arg1[(_local5 - 1)] + (2 * _local8)));
_local4.push((_arg2[(_local5 - 1)] + (2 * _local9)));
_local3.push((_arg1[(_local5 - 1)] + (3 * _local8)));
_local4.push((_arg2[(_local5 - 1)] + (3 * _local9)));
_local3.push(_arg1[_local5]);
_local4.push(_arg2[_local5]);
_local5++;
};
_local6 = enemyManager.getGameStage().x;
_local7 = 0;
while (_local7 < _local3.length) {
if (((((!(isDead())) && ((Math.abs(((x - _local3[_local7]) + _local6)) < 100)))) && (MovieClip(this).hitTestPoint(_local3[_local7], _local4[_local7], true)))){
if ((((this.hp > 0)) && (!((actionState == JUMPDOWN_STATE))))){
return (true);
};
};
_local7++;
};
return (false);
}
public function jumpdown(){
facePlayer();
fallVel = (fallVel + 0.5);
this.y = (this.y + fallVel);
if (this.currentFrame == 1){
this.x = (this.x - 5);
} else {
this.x = (this.x + 5);
};
if (this.y >= Player.groundY){
actionState = STOP_STATE;
this.y = Player.groundY;
};
}
}
}//package
Section 127
//enemybanner (enemybanner)
package {
import flash.display.*;
import flash.events.*;
public dynamic class enemybanner extends MovieClip {
public var oldbanner:SimpleButton;
public var newbanner:MovieClip;
public function enemybanner(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
newbanner.visible = false;
oldbanner.addEventListener(MouseEvent.CLICK, bannerEvent);
}
public function bannerEvent(_arg1:Event):void{
if (!newbanner.visible){
StatsManager.instance.gotBanner();
newbanner.visible = true;
};
}
}
}//package
Section 128
//EnemyManager (EnemyManager)
package {
import flash.display.*;
public class EnemyManager {
var cleanUpCounter:int;
public var frozen:Boolean;// = false
var gameStage:MovieClip;
var cleanUpCounterMax:int;// = 480
public var freezeCounterMax:int;// = 48
public var enemyList;
var enemyInWaiting:int;// = 0
var frozenArrow;
public var freezeCounter:int;
public static var instance:EnemyManager;
public function EnemyManager(_arg1:MovieClip){
enemyList = new Array();
freezeCounterMax = 48;
freezeCounter = freezeCounterMax;
frozen = false;
enemyInWaiting = 0;
cleanUpCounterMax = (20 * 24);
cleanUpCounter = cleanUpCounterMax;
super();
this.gameStage = _arg1;
instance = this;
}
public function pauseGame(){
var _local1:*;
Player.stageMode = 2;
_local1 = 0;
while (_local1 < enemyList.length) {
enemyList[_local1].pauseGame();
_local1++;
};
StageManager.instance.desaturate(MovieClip(gameStage.root).staticbg);
StageManager.instance.desaturate(gameStage);
Player.instance.pauseGame();
MovieClip(gameStage.root).foreground.g1.stop();
MovieClip(gameStage.root).foreground.g2.stop();
MovieClip(gameStage.root).foreground.g3.stop();
StageManager.instance.desaturate(MovieClip(gameStage.parent).stagebg1);
StageManager.instance.desaturate(MovieClip(gameStage.parent).stagebg2);
}
public function countHeadshot():int{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < enemyList.length) {
if (enemyList[_local2].isHeadshot()){
_local1++;
};
_local2++;
};
return (_local1);
}
public function reactShunpo(_arg1:Array, _arg2:Array){
var _local3:*;
_local3 = 0;
while (_local3 < enemyList.length) {
if (!enemyList[_local3].isDead()){
enemyList[_local3].reactShunpo(_arg1, _arg2);
};
_local3++;
};
}
public function unpauseGame(){
var _local1:*;
Player.stageMode = 0;
_local1 = 0;
while (_local1 < enemyList.length) {
enemyList[_local1].unpauseGame();
_local1++;
};
if (checkDeath()){
freezeCounter = 1;
};
StageManager.instance.clearFilter(MovieClip(gameStage.root).staticbg);
StageManager.instance.clearFilter(gameStage);
Player.instance.unpauseGame();
MovieClip(gameStage.root).foreground.g1.play();
MovieClip(gameStage.root).foreground.g2.play();
MovieClip(gameStage.root).foreground.g3.play();
StageManager.instance.clearFilter(MovieClip(gameStage.parent).stagebg1);
StageManager.instance.clearFilter(MovieClip(gameStage.parent).stagebg2);
}
public function finishPlayerDie(){
StageManager.instance.makeDark(gameStage, -300);
StageManager.instance.makeDark(MovieClip(gameStage.parent).playercanvas, -300);
MovieClip(gameStage.parent).redbg.visible = true;
MovieClip(gameStage.parent).stagebg1.visible = false;
MovieClip(gameStage.parent).stagebg2.visible = false;
StageManager.instance.l1.visible = false;
StageManager.instance.l2.visible = false;
StageManager.instance.r1.visible = false;
StageManager.instance.r2.visible = false;
StageManager.instance.showHint("");
}
public function createRandomEnemyNoArrow(_arg1){
var _local2:*;
var _local3:*;
_local2 = -100;
if ((Math.random() * 2) > 1){
_local2 = (StageManager.instance.stageWidth + 100);
};
_local3 = Math.floor(((Math.random() * _arg1) + 1));
if (_local3 == 2){
return;
};
createEnemy(_local3, _local2, 350);
}
public function createGuardTower(_arg1:int, _arg2:int){
var _local3:*;
_local3 = new Enemy_guardtower();
MovieClip(gameStage.parent).stagebg2.addChild(_local3);
_local3.x = _arg1;
_local3.y = _arg2;
_local3.setManager(this);
enemyList.push(_local3);
}
public function register(_arg1:Enemy){
_arg1.setManager(this);
enemyList.push(_arg1);
}
public function createCatapult(_arg1:int, _arg2:int){
var _local3:*;
_local3 = new Enemy_catapult();
MovieClip(gameStage.parent).stagebg2.addChild(_local3);
_local3.x = _arg1;
_local3.y = _arg2;
_local3.setManager(this);
enemyList.push(_local3);
_local3.scaleX = 0.8;
_local3.scaleY = 0.8;
}
public function getEnemyInWaiting(){
return (enemyInWaiting);
}
public function setEnemyInWaiting(_arg1:int){
enemyInWaiting = _arg1;
}
public function reinit(_arg1:MovieClip){
this.gameStage = _arg1;
enemyList = new Array();
cleanUpCounter = cleanUpCounterMax;
frozen = false;
freezeCounter = freezeCounterMax;
frozenArrow = null;
}
public function showContinue(){
MovieClip(gameStage.parent).continuebutton.visible = true;
}
public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
if (frozen){
freezeCounter--;
if (freezeCounter == 0){
_local2 = countDying();
if (_local2 > StatsManager.instance.maxCombo){
StatsManager.instance.maxCombo = _local2;
};
_local3 = countHeadshot();
if (Player.instance.getIsDead()){
Player.instance.deathAnim();
} else {
killDying();
};
if (frozenArrow != null){
frozenArrow.unfreeze();
} else {
if ((((_local2 == 1)) && ((_local3 == 0)))){
Player.instance.displayScoreMessage("Coup de Grace: +500");
StatsManager.instance.addScore(500);
} else {
if ((((_local2 == 1)) && ((_local3 == 1)))){
Player.instance.displayScoreMessage("Coup de Grace Headshot: +1000");
StatsManager.instance.addScore(1000);
} else {
if ((((_local2 > 1)) && ((_local3 == 0)))){
Player.instance.displayScoreMessage(((("Coup de Grace Combo: " + _local2) + "x") + (_local2 * 500)));
StatsManager.instance.addScore(((_local2 * _local2) * 500));
} else {
if ((((_local2 > 1)) && ((_local3 == _local2)))){
Player.instance.displayScoreMessage(((("Coup de Grace Headshot Combo: " + _local3) + "x") + (_local3 * 1000)));
StatsManager.instance.addScore(((_local3 * _local3) * 1000));
} else {
if ((((_local2 > 1)) && ((_local3 > 0)))){
Player.instance.displayScoreMessage(((((((("Coup de Grace Combo/Headshot: " + (_local2 - _local3)) + "x") + (_local2 * 500)) + " + ") + _local3) + "x") + (_local2 * 1000)));
StatsManager.instance.addScore(((((_local2 - _local3) * _local2) * 500) + ((_local3 * _local2) * 1000)));
};
};
};
};
};
};
};
if ((((freezeCounter == (-2 * 24))) || ((((StatsManager.instance.location == 37)) && ((freezeCounter == 12)))))){
if (!Player.instance.getIsDead()){
showScoreboard();
};
};
};
_local1 = 0;
while (_local1 < enemyList.length) {
enemyList[_local1].update();
_local1++;
};
cleanUpCounter--;
if ((((cleanUpCounter <= 0)) || ((enemyList.length > 50)))){
cleanUpCounter = cleanUpCounterMax;
cleanUp();
};
}
public function cleanUp(){
var _local1:*;
var _local2:*;
_local1 = new Array();
_local2 = 0;
while (_local2 < enemyList.length) {
if (!enemyList[_local2].removeMe){
_local1.push(enemyList[_local2]);
};
_local2++;
};
enemyList = _local1;
}
public function checkDeath():Boolean{
var _local1:*;
var _local2:*;
_local1 = countDying();
if (_local1 > StatsManager.instance.maxCombo){
StatsManager.instance.maxCombo = _local1;
};
_local2 = countHeadshot();
if ((((countAlive() == _local1)) && ((enemyInWaiting == 0)))){
freezeDying();
return (true);
};
killDying();
if ((((_local1 == 1)) && ((_local2 == 0)))){
Player.instance.displayScoreMessage("+100");
StatsManager.instance.addScore(100);
} else {
if ((((_local1 == 1)) && ((_local2 == 1)))){
Player.instance.displayScoreMessage("Headshot: +200");
StatsManager.instance.addScore(200);
} else {
if ((((_local1 > 1)) && ((_local2 == 0)))){
Player.instance.displayScoreMessage(((("Combo: " + _local1) + "x") + (_local1 * 100)));
StatsManager.instance.addScore(((_local1 * _local1) * 100));
} else {
if ((((_local1 > 1)) && ((_local2 == _local1)))){
Player.instance.displayScoreMessage(((("Headshot Combo: " + _local2) + "x") + (_local2 * 200)));
StatsManager.instance.addScore(((_local2 * _local2) * 200));
} else {
if ((((_local1 > 1)) && ((_local2 > 0)))){
Player.instance.displayScoreMessage(((((((("Combo/Headshot: " + (_local1 - _local2)) + "x") + (_local1 * 100)) + " + ") + _local2) + "x") + (_local1 * 200)));
StatsManager.instance.addScore(((((_local1 - _local2) * _local1) * 100) + ((_local2 * _local1) * 200)));
};
};
};
};
};
return (false);
}
public function createEnemyType(_arg1){
var _local2:*;
_local2 = -100;
if ((Math.random() * 2) > 1){
_local2 = (StageManager.instance.stageWidth + 100);
};
createEnemy(_arg1, _local2, 350);
}
public function freezeDyingArrow(_arg1:Arrow_player){
var _local2:*;
frozenArrow = _arg1;
_local2 = 0;
while (_local2 < enemyList.length) {
if (((!(enemyList[_local2].isDead())) && ((enemyList[_local2].hp <= 0)))){
enemyList[_local2].freeze();
};
_local2++;
};
frozen = true;
freezeCounter = freezeCounterMax;
Player.stageMode = 1;
StageManager.instance.makeDark(gameStage, -300);
StageManager.instance.makeDark(MovieClip(gameStage.parent).playercanvas, -300);
MovieClip(gameStage.parent).redbg.visible = true;
MovieClip(gameStage.parent).stagebg1.visible = false;
MovieClip(gameStage.parent).stagebg2.visible = false;
MovieClip(gameStage.parent).guicover.visible = true;
StageManager.instance.l1.visible = false;
StageManager.instance.l2.visible = false;
StageManager.instance.r1.visible = false;
StageManager.instance.r2.visible = false;
StageManager.instance.showHint("");
}
public function freezeDying(){
var _local1:*;
_local1 = 0;
while (_local1 < enemyList.length) {
if (((!(enemyList[_local1].isDead())) && ((enemyList[_local1].hp <= 0)))){
enemyList[_local1].freeze();
};
_local1++;
};
frozen = true;
freezeCounter = freezeCounterMax;
Player.stageMode = 1;
StageManager.instance.makeDark(gameStage, -300);
StageManager.instance.makeDark(MovieClip(gameStage.parent).playercanvas, -300);
MovieClip(gameStage.parent).redbg.visible = true;
MovieClip(gameStage.parent).stagebg1.visible = false;
MovieClip(gameStage.parent).stagebg2.visible = false;
MovieClip(gameStage.parent).guicover.visible = true;
StageManager.instance.l1.visible = false;
StageManager.instance.l2.visible = false;
StageManager.instance.r1.visible = false;
StageManager.instance.r2.visible = false;
StageManager.instance.showHint("");
}
public function countDying():int{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < enemyList.length) {
if (((!(enemyList[_local2].isDead())) && ((enemyList[_local2].hp <= 0)))){
_local1++;
};
_local2++;
};
return (_local1);
}
public function createRandomEnemySide(_arg1, _arg2){
var _local3:*;
var _local4:*;
_local3 = -100;
if (_arg2){
_local3 = (StageManager.instance.stageWidth + 100);
};
_local4 = Math.floor(((Math.random() * _arg1) + 1));
createEnemy(_local4, _local3, 350);
}
public function playerDie(){
var _local1:*;
_local1 = 0;
while (_local1 < enemyList.length) {
enemyList[_local1].pauseGame();
enemyList[_local1].freeze();
if (enemyList[_local1].isDead()){
enemyList[_local1].visible = false;
};
_local1++;
};
frozen = true;
freezeCounter = freezeCounterMax;
Player.stageMode = 1;
StageManager.instance.makeDark(gameStage, -300);
StageManager.instance.makeDark(MovieClip(gameStage.parent).playercanvas, -300);
MovieClip(gameStage.parent).redbg.visible = true;
MovieClip(gameStage.parent).stagebg1.visible = false;
MovieClip(gameStage.parent).stagebg2.visible = false;
MovieClip(gameStage.parent).canvas.graphics.clear();
MovieClip(gameStage.parent).guicover.visible = true;
StageManager.instance.l1.visible = false;
StageManager.instance.l2.visible = false;
StageManager.instance.r1.visible = false;
StageManager.instance.r2.visible = false;
StageManager.instance.showHint("");
}
public function createRandomEnemy(_arg1){
var _local2:*;
var _local3:*;
_local2 = -100;
if ((Math.random() * 2) > 1){
_local2 = (StageManager.instance.stageWidth + 100);
};
_local3 = Math.floor(((Math.random() * _arg1) + 1));
createEnemy(_local3, _local2, 350);
}
public function playerDieArrow(){
var _local1:*;
_local1 = 0;
while (_local1 < enemyList.length) {
enemyList[_local1].pauseGame();
StageManager.instance.desaturate(enemyList[_local1]);
enemyList[_local1].freeze();
if (enemyList[_local1].isDead()){
enemyList[_local1].visible = false;
};
_local1++;
};
StageManager.instance.desaturate(MovieClip(gameStage.root).staticbg);
MovieClip(gameStage.root).foreground.g1.stop();
MovieClip(gameStage.root).foreground.g2.stop();
MovieClip(gameStage.root).foreground.g3.stop();
StageManager.instance.desaturate(MovieClip(gameStage.parent).stagebg1);
StageManager.instance.desaturate(MovieClip(gameStage.parent).stagebg2);
MovieClip(gameStage.parent).canvas.graphics.clear();
freezeCounter = freezeCounterMax;
Player.stageMode = 1;
MovieClip(gameStage.parent).guicover.visible = true;
}
public function checkHit(_arg1:Array, _arg2:Array){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
_local3 = new Array();
_local4 = new Array();
_local3.push(_arg1[0]);
_local4.push(_arg2[0]);
_local5 = 1;
while (_local5 < _arg1.length) {
_local8 = ((_arg1[_local5] - _arg1[(_local5 - 1)]) / 4);
_local9 = ((_arg2[_local5] - _arg2[(_local5 - 1)]) / 4);
_local3.push((_arg1[(_local5 - 1)] + _local8));
_local4.push((_arg2[(_local5 - 1)] + _local9));
_local3.push((_arg1[(_local5 - 1)] + (2 * _local8)));
_local4.push((_arg2[(_local5 - 1)] + (2 * _local9)));
_local3.push((_arg1[(_local5 - 1)] + (3 * _local8)));
_local4.push((_arg2[(_local5 - 1)] + (3 * _local9)));
_local3.push(_arg1[_local5]);
_local4.push(_arg2[_local5]);
_local5++;
};
_local6 = gameStage.x;
_local7 = 0;
while (_local7 < enemyList.length) {
_local10 = false;
_local11 = 0;
while (_local11 < _local3.length) {
if (((((((!(enemyList[_local7].isDead())) && (!(_local10)))) && ((Math.abs(((enemyList[_local7].x - _local3[_local11]) + _local6)) < 100)))) && (MovieClip(enemyList[_local7]).hitTestPoint(_local3[_local11], _local4[_local11], true)))){
if (enemyList[_local7].hit(_local3[_local11], _local4[_local11])){
_local10 = true;
};
};
_local11++;
};
_local7++;
};
}
public function createEnemy(_arg1:int, _arg2:int, _arg3:int):Enemy{
var _local4:Enemy;
if (enemyInWaiting == 0){
return (null);
};
enemyInWaiting--;
switch (_arg1){
case Enemy_scarecrow.typeCode:
_local4 = new Enemy_scarecrow();
break;
case Enemy_target.typeCode:
_local4 = new Enemy_target();
break;
case Enemy1.typeCode:
_local4 = new Enemy1();
break;
case Enemy2.typeCode:
_local4 = new Enemy2();
break;
case Enemy3.typeCode:
_local4 = new Enemy3();
break;
case Enemy4.typeCode:
_local4 = new Enemy4();
break;
case Enemy5.typeCode:
_local4 = new Enemy5();
break;
case Enemy6.typeCode:
_local4 = new Enemy6();
break;
};
gameStage.addChild(_local4);
_local4.setManager(this);
enemyList.push(_local4);
_local4.setPosition(_arg2, _arg3);
return (_local4);
}
public function killDying(){
var _local1:*;
_local1 = 0;
while (_local1 < enemyList.length) {
if (((!(enemyList[_local1].isDead())) && ((enemyList[_local1].hp <= 0)))){
enemyList[_local1].die();
};
_local1++;
};
}
public function showScoreboard(){
MovieClip(gameStage.parent).scoreboard.visible = true;
MovieClip(gameStage.parent).transition.transition.gotoAndPlay(90);
}
public function checkArrowHit(_arg1:MovieClip):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < enemyList.length) {
if (((((!(enemyList[_local2].isDead())) && ((((Math.abs((enemyList[_local2].x - _arg1.x)) < 100)) || (!((MovieClip(enemyList[_local2].parent) == gameStage))))))) && (MovieClip(enemyList[_local2]).hitTestObject(_arg1)))){
if (enemyList[_local2].arrowHit(_arg1)){
return (true);
};
};
_local2++;
};
return (false);
}
public function getGameStage():MovieClip{
return (gameStage);
}
public function isColliding(_arg1:Enemy):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < enemyList.length) {
if (((((!(enemyList[_local2].isDead())) && (!((_arg1 == enemyList[_local2]))))) && ((Math.abs((_arg1.x - enemyList[_local2].x)) < 50)))){
return (true);
};
_local2++;
};
return (false);
}
public function countAlive():int{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < enemyList.length) {
if (!enemyList[_local2].isDead()){
_local1++;
};
_local2++;
};
return (_local1);
}
}
}//package
Section 129
//HatProjectile (HatProjectile)
package {
import flash.display.*;
public class HatProjectile extends Projectile {
var counter;// = 10
public var bp;
public var rot:int;// = 20
public static var gravity:Number = 1;
public static var typeCode:int = 7;
public function HatProjectile(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
rot = 20;
counter = 10;
super();
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
}
override public function update(){
if (!flying){
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (this.rotation + rot);
velY = (velY - gravity);
if ((((this.y > (Player.groundY - 5))) && ((velY < 0)))){
if (velY > -5){
flying = false;
Player.instance.player.player.bp.setActive(false);
};
velY = (-(velY) / 3);
velX = ((velX * 3) / 4);
rot = (rot / 2);
MovieClip(EnemyManager.instance.getGameStage().parent).stage.frameRate = 24;
EnemyManager.instance.finishPlayerDie();
EnemyManager.instance.showContinue();
};
}
}
}//package
Section 130
//HeadProjectile (HeadProjectile)
package {
public class HeadProjectile extends Projectile {
public var bp;
public var rot:int;// = 20
public static var gravity:Number = 1;
public static var typeCode:int = 3;
public function HeadProjectile(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
rot = 20;
super();
addFrameScript(0, frame1);
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
StatsManager.instance.headshotCount++;
}
function frame1(){
stop();
}
override public function update(){
if (!flying){
doDissappear();
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (this.rotation + rot);
velY = (velY - gravity);
if ((((this.y > (Player.groundY - 5))) && ((velY < 0)))){
if (velY > -5){
flying = false;
};
velY = (-(velY) / 3);
velX = ((velX * 3) / 4);
rot = (rot / 2);
};
}
}
}//package
Section 131
//Hex (Hex)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
public class Hex extends MovieClip {
public var reinforceanim:MovieClip;
public var hex:MovieClip;
public var selecthighlight:MovieClip;
public var num:TextField;
var info:HexInfo;
public var highlight:MovieClip;
public function Hex(){
addFrameScript(0, frame1);
}
public function select(){
selecthighlight.visible = true;
}
public function init(_arg1:HexInfo){
this.info = _arg1;
}
public function hexOutEvent(_arg1:Event):void{
highlight.visible = false;
}
public function getColumn(){
return (info.column);
}
public function hexOverEvent(_arg1:Event):void{
highlight.visible = true;
}
public function hexClickEvent(_arg1:Event):void{
HexManager.hexClick(this);
}
function frame1(){
highlight.visible = false;
selecthighlight.visible = false;
this.addEventListener(MouseEvent.CLICK, hexClickEvent);
this.addEventListener(MouseEvent.MOUSE_OVER, hexOverEvent);
this.addEventListener(MouseEvent.MOUSE_OUT, hexOutEvent);
}
public function getHexInfo():HexInfo{
return (info);
}
public function getRow(){
return (info.row);
}
public function updateDisplay(){
var _local1:*;
hex.gotoAndStop(info.side);
num.text = info.strength.toString();
num.x = -23;
num.y = -20;
num.scaleX = 1;
num.scaleY = 1;
if (info.strength == 0){
num.text = "";
};
if (info.hasPlayer){
_local1 = new Point(x, y);
_local1 = StatsManager.instance.map.hexgrid.localToGlobal(_local1);
_local1 = StatsManager.instance.map.globalToLocal(_local1);
StatsManager.instance.map.hexplayer.x = _local1.x;
StatsManager.instance.map.hexplayer.y = (_local1.y - 8);
num.x = -4;
num.y = -8;
num.scaleX = 0.8;
num.scaleY = 0.8;
};
}
public function unselect(){
selecthighlight.visible = false;
}
}
}//package
Section 132
//HexInfo (HexInfo)
package {
public class HexInfo {
public var strength:int;// = 0
public var column:int;// = -1
public var side:int;// = 1
public var row:int;// = -1
public var hasPlayer:Boolean;// = false
public function HexInfo(_arg1:int, _arg2:int){
side = 1;
row = -1;
column = -1;
strength = 0;
hasPlayer = false;
super();
this.row = _arg1;
this.column = _arg2;
}
public function getHex():Hex{
return (StatsManager.instance.map.hexgrid.getChildByName(((("hex_" + row) + "_") + column)));
}
}
}//package
Section 133
//HexManager (HexManager)
package {
import flash.display.*;
public class HexManager {
public static var selectedHex:Hex;
static var engagedStrength = -1;
public static var isPlayerTurn:Boolean = true;
public static var instance:HexManager;
public static var enemiesToFight:int = 0;
static var maxCounter = 12;
public static var playerSelected:Boolean = false;
public static var heroLocation:HexInfo;
static var counter = maxCounter;
public function HexManager(){
instance = this;
}
public static function canMove(_arg1:Hex, _arg2:Hex):Boolean{
if ((((_arg1 == null)) || ((_arg2 == null)))){
return (false);
};
if (_arg1.info.strength == 1){
return (false);
};
if (_arg1.info.side == _arg2.info.side){
return (false);
};
if ((((_arg1.getRow() == _arg2.getRow())) && ((Math.abs((_arg1.getColumn() - _arg2.getColumn())) == 1)))){
return (true);
};
if (((((((_arg1.getRow() % 2) == 0)) && ((Math.abs((_arg1.getRow() - _arg2.getRow())) == 1)))) && ((((_arg1.getColumn() == _arg2.getColumn())) || ((_arg1.getColumn() == (_arg2.getColumn() - 1))))))){
return (true);
};
if (((((!(((_arg1.getRow() % 2) == 0))) && ((Math.abs((_arg1.getRow() - _arg2.getRow())) == 1)))) && ((((_arg1.getColumn() == _arg2.getColumn())) || ((_arg1.getColumn() == (_arg2.getColumn() + 1))))))){
return (true);
};
return (false);
}
public static function reinit(){
selectedHex = null;
counter = maxCounter;
}
public static function selectHex(_arg1:Hex){
if (((isSurroundedByFriendly(_arg1)) || ((_arg1.info.strength == 1)))){
return;
};
if (selectedHex != null){
selectedHex.unselect();
};
selectedHex = _arg1;
_arg1.select();
}
public static function update(){
if (StatsManager.instance.mission == 4){
if (!isPlayerTurn){
counter--;
if (counter == 0){
counter = maxCounter;
if (!enemyMove()){
endEnemyTurn();
};
};
};
};
}
public static function endEnemyTurn(){
isPlayerTurn = true;
StatsManager.instance.map.gui.words.text = "";
StatsManager.instance.turn++;
StatsManager.instance.displayTurn();
reinforceForces(3);
StatsManager.instance.map.gui.endturnbutton.visible = true;
trace("player moves");
}
public static function enemyMove():Boolean{
var _local1:*;
var _local2:*;
var _local3:Hex;
_local1 = 0;
while (_local1 <= 10) {
_local2 = 0;
while (_local2 <= 11) {
_local3 = StatsManager.instance.map.hexgrid.getChildByName(((("hex_" + _local1) + "_") + _local2));
if (((!((_local3 == null))) && ((_local3.info.side == 3)))){
if (individualEnemyMove(_local3)){
return (true);
};
};
_local2++;
};
_local1++;
};
return (false);
}
static function isClear(_arg1:Hex):Boolean{
var _local2:*;
var _local3:*;
var _local4:Hex;
_local2 = (_arg1.getRow() - 2);
while (_local2 <= (_arg1.getRow() + 2)) {
_local3 = (_arg1.getColumn() - 2);
while (_local3 <= (_arg1.getColumn() + 2)) {
_local4 = StatsManager.instance.map.hexgrid.getChildByName(((("hex_" + _local2) + "_") + _local3));
if (_local4 != null){
if ((((_local4.info.side == 3)) && ((_local4.info.strength > 1)))){
return (false);
};
};
_local3++;
};
_local2++;
};
return (true);
}
static function isNextToPlayer(_arg1:Hex):Boolean{
var _local2:*;
var _local3:*;
var _local4:Hex;
_local2 = (_arg1.getRow() - 1);
while (_local2 <= (_arg1.getRow() + 1)) {
_local3 = (_arg1.getColumn() - 1);
while (_local3 <= (_arg1.getColumn() + 1)) {
_local4 = StatsManager.instance.map.hexgrid.getChildByName(((("hex_" + _local2) + "_") + _local3));
if (_local4 != null){
if (_local4.info.hasPlayer){
return (true);
};
};
_local3++;
};
_local2++;
};
return (false);
}
public static function reinforceForces(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:Hex;
var _local5:*;
var _local6:*;
_local2 = 0;
while (_local2 <= 10) {
_local3 = 0;
while (_local3 <= 11) {
_local4 = StatsManager.instance.map.hexgrid.getChildByName(((("hex_" + _local2) + "_") + _local3));
if (((!((_local4 == null))) && ((_local4.info.side == _arg1)))){
_local5 = 3;
if (_arg1 == 3){
_local5 = 2;
};
_local6 = (Math.random() * _local5);
if (((!((_local6 == 0))) && (!((_local4.info.strength == 10))))){
_local4.reinforceanim.gotoAndPlay(2);
};
_local4.info.strength = (_local4.info.strength + _local6);
if (_local4.info.strength > 10){
_local4.info.strength = 10;
};
if (StatsManager.instance.hexCheat){
if (_arg1 == 2){
_local4.info.strength = 10;
};
};
_local4.updateDisplay();
};
_local3++;
};
_local2++;
};
}
static function individualEnemyMove(_arg1:Hex):Boolean{
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:int;
var _local7:*;
_local2 = getOptions(_arg1);
if ((((_local2.length == 0)) || (isNextToPlayer(_arg1)))){
return (false);
};
_local3 = new Array();
_local4 = new Array();
_local5 = new Array();
_local7 = 0;
while (_local7 < _local2.length) {
if ((((_local2[_local7].info.side == 1)) || ((((_local2[_local7].info.side == 2)) && ((_local2[_local7].info.strength < _arg1.info.strength)))))){
_local5.push(_local2[_local7]);
} else {
if ((((_local2[_local7].info.side == 2)) && ((_local2[_local7].info.strength == _arg1.info.strength)))){
_local3.push(_local2[_local7]);
} else {
if ((((_local2[_local7].info.side == 2)) && ((_local2[_local7].info.strength == (_arg1.info.strength + 1))))){
_local4.push(_local2[_local7]);
};
};
};
_local7++;
};
if (_arg1.info.strength == 2){
if (isClear(_arg1)){
trace("easy");
_local6 = (Math.random() * _local5.length);
moveTo(_arg1, _local5[_local6]);
return (true);
};
return (false);
} else {
if (_local5.length > 0){
trace("easy");
_local6 = (Math.random() * _local5.length);
moveTo(_arg1, _local5[_local6]);
return (true);
};
if (_local3.length > 0){
trace("risky");
_local6 = (Math.random() * _local3.length);
moveTo(_arg1, _local3[_local6]);
return (true);
};
if (_local4.length > 0){
if ((Math.random() * 3) > 1){
return (false);
};
trace("very risky");
_local6 = (Math.random() * _local4.length);
moveTo(_arg1, _local4[_local6]);
return (true);
};
};
return (false);
}
public static function died(){
heroLocation.side = 3;
heroLocation.strength = engagedStrength;
}
public static function winsFight(_arg1:Hex, _arg2:Hex){
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:*;
if ((((_arg2.getRow() == 2)) && ((_arg2.getColumn() == 5)))){
StatsManager.instance.map.gui.words.text = "The enemy commander decimated your troops. Send in the samurai!";
return (false);
};
if (StatsManager.instance.hexCheat){
if (_arg1.info.side == 2){
return (true);
};
if (_arg2.info.side == 2){
return (false);
};
};
_local3 = 0;
_local4 = 0;
_local6 = 0;
while (_local6 < _arg1.info.strength) {
_local5 = ((Math.random() * 6) + 1);
_local3 = (_local3 + _local5);
_local6++;
};
_local6 = 0;
while (_local6 < _arg2.info.strength) {
_local5 = ((Math.random() * 6) + 1);
_local4 = (_local4 + _local5);
_local6++;
};
return ((_local3 >= _local4));
}
static function getOptions(_arg1:Hex):Array{
var _local2:Array;
var _local3:*;
var _local4:*;
var _local5:Hex;
_local2 = new Array();
_local3 = (_arg1.getRow() - 1);
while (_local3 <= (_arg1.getRow() + 1)) {
_local4 = (_arg1.getColumn() - 1);
while (_local4 <= (_arg1.getColumn() + 1)) {
_local5 = StatsManager.instance.map.hexgrid.getChildByName(((("hex_" + _local3) + "_") + _local4));
if (((((!((_local5 == null))) && (!(_local5.info.hasPlayer)))) && (canMove(_arg1, _local5)))){
_local2.push(_local5);
};
_local4++;
};
_local3++;
};
return (_local2);
}
static function isSurroundedByFriendly(_arg1:Hex):Boolean{
var _local2:*;
var _local3:*;
var _local4:Hex;
_local2 = (_arg1.getRow() - 1);
while (_local2 <= (_arg1.getRow() + 1)) {
_local3 = (_arg1.getColumn() - 1);
while (_local3 <= (_arg1.getColumn() + 1)) {
_local4 = StatsManager.instance.map.hexgrid.getChildByName(((("hex_" + _local2) + "_") + _local3));
if (_local4 != null){
if (_local4.info.side != _arg1.info.side){
return (false);
};
};
_local3++;
};
_local2++;
};
return (true);
}
public static function moveTo(_arg1:Hex, _arg2:Hex){
if (_arg2.info.side == 1){
_arg2.info.side = _arg1.info.side;
_arg2.info.strength = (_arg1.info.strength - 1);
_arg1.info.strength = 1;
_arg1.updateDisplay();
_arg2.updateDisplay();
if (isPlayerTurn){
selectHex(_arg2);
};
} else {
if (_arg1.info.side != _arg2.info.side){
if (winsFight(_arg1, _arg2)){
_arg2.info.side = _arg1.info.side;
_arg2.info.strength = (_arg1.info.strength - 1);
_arg1.info.strength = 1;
_arg1.updateDisplay();
_arg2.updateDisplay();
if (isPlayerTurn){
selectHex(_arg2);
};
} else {
_arg1.info.strength = 1;
_arg1.updateDisplay();
};
};
};
}
public static function hexClick(_arg1:Hex){
if (!isPlayerTurn){
return;
};
if (((playerSelected) && (playerCanMove(_arg1)))){
heroLocation.hasPlayer = false;
heroLocation.getHex().updateDisplay();
_arg1.info.hasPlayer = true;
_arg1.updateDisplay();
heroLocation = _arg1.info;
if (_arg1.info.side == 2){
StatsManager.instance.map.gui.words.text = "";
};
if (((((!(StatsManager.instance.banner3taken)) && ((heroLocation.row == 2)))) && ((heroLocation.column == 0)))){
StatsManager.instance.banner3taken = true;
StatsManager.instance.map.newbanner3.visible = true;
StatsManager.instance.totalBanners++;
StatsManager.instance.totalScore = (StatsManager.instance.totalScore + 2000);
};
if (((((!(StatsManager.instance.banner4taken)) && ((heroLocation.row == 0)))) && ((heroLocation.column == 8)))){
StatsManager.instance.banner4taken = true;
StatsManager.instance.map.newbanner4.visible = true;
StatsManager.instance.totalBanners++;
StatsManager.instance.totalScore = (StatsManager.instance.totalScore + 2000);
};
if (((((!(StatsManager.instance.banner5taken)) && ((heroLocation.row == 5)))) && ((heroLocation.column == 10)))){
StatsManager.instance.banner5taken = true;
StatsManager.instance.map.newbanner5.visible = true;
StatsManager.instance.totalBanners++;
StatsManager.instance.totalScore = (StatsManager.instance.totalScore + 2000);
};
if (((((!(StatsManager.instance.hexitemtaken)) && ((heroLocation.row == 0)))) && ((heroLocation.column == 0)))){
StatsManager.instance.hexitemtaken = true;
StatsManager.instance.map.hexitem.visible = false;
StatsManager.instance.getItem();
};
if (((((((!(StatsManager.instance.bossDefeated)) && ((heroLocation.row == 2)))) && ((heroLocation.column == 5)))) && ((heroLocation.side == 3)))){
StatsManager.instance.map.gui.words.text = "Warning - This is the final battle in the game.";
};
return;
};
playerSelected = false;
StatsManager.instance.map.hexplayer.selected.visible = false;
if ((((selectedHex == null)) && (!((_arg1.info.side == 2))))){
return;
};
if ((((selectedHex == null)) || ((selectedHex.info.side == _arg1.info.side)))){
selectHex(_arg1);
} else {
if (canMove(selectedHex, _arg1)){
moveTo(selectedHex, _arg1);
};
};
}
public static function playerHexClick(_arg1:MovieClip){
if (!isPlayerTurn){
return;
};
playerSelected = !(playerSelected);
_arg1.selected.visible = playerSelected;
if (selectedHex != null){
selectedHex.unselect();
selectedHex = null;
};
}
public static function playerCanMove(_arg1:Hex):Boolean{
var _local2:Hex;
_local2 = heroLocation.getHex();
if ((((_local2 == null)) || ((_arg1 == null)))){
return (false);
};
if ((((((_local2.info.side == 3)) || ((_local2.info.side == 1)))) && ((((_arg1.info.side == 3)) || ((_arg1.info.side == 1)))))){
return (false);
};
if ((((_local2.getRow() == _arg1.getRow())) && ((Math.abs((_local2.getColumn() - _arg1.getColumn())) == 1)))){
return (true);
};
if (((((((_local2.getRow() % 2) == 0)) && ((Math.abs((_local2.getRow() - _arg1.getRow())) == 1)))) && ((((_local2.getColumn() == _arg1.getColumn())) || ((_local2.getColumn() == (_arg1.getColumn() - 1))))))){
return (true);
};
if (((((!(((_local2.getRow() % 2) == 0))) && ((Math.abs((_local2.getRow() - _arg1.getRow())) == 1)))) && ((((_local2.getColumn() == _arg1.getColumn())) || ((_local2.getColumn() == (_arg1.getColumn() + 1))))))){
return (true);
};
return (false);
}
public static function endPlayerTurn(){
isPlayerTurn = false;
StatsManager.instance.map.gui.endturnbutton.visible = false;
StatsManager.instance.map.gui.words.text = "The enemy is on the move.";
if (selectedHex != null){
selectedHex.unselect();
selectedHex = null;
};
reinforceForces(2);
if (heroLocation.side == 3){
enemiesToFight = heroLocation.strength;
engagedStrength = heroLocation.strength;
heroLocation.strength = 1;
if (((((((!(StatsManager.instance.bossDefeated)) && ((heroLocation.row == 2)))) && ((heroLocation.column == 5)))) && ((heroLocation.side == 3)))){
StatsManager.instance.map.gui.bossdialog.gotoAndPlay(2);
} else {
heroLocation.side = 2;
StatsManager.instance.location = 100;
StatsManager.instance.map.transition.gotoAndPlay(25);
};
} else {
if (heroLocation.side == 1){
heroLocation.side = 2;
heroLocation.strength = 1;
heroLocation.getHex().updateDisplay();
} else {
trace("computer moves");
};
};
}
}
}//package
Section 134
//hit1 (hit1)
package {
import flash.media.*;
public dynamic class hit1 extends Sound {
}
}//package
Section 135
//hit2 (hit2)
package {
import flash.media.*;
public dynamic class hit2 extends Sound {
}
}//package
Section 136
//hit3 (hit3)
package {
import flash.media.*;
public dynamic class hit3 extends Sound {
}
}//package
Section 137
//Javalin (Javalin)
package {
import flash.display.*;
public class Javalin extends Projectile {
public var tip:MovieClip;
public static var gravity:Number = 1;
public static var typeCode:int = 2;
public function Javalin(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
addFrameScript(0, frame1, 1, frame2);
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
ttlMax = (2 * 24);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
override public function update(){
if (!flying){
doDissappear();
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (Math.atan((-(velY) / velX)) * (180 / Math.PI));
velY = (velY - gravity);
if (this.hitTestObject(MovieClip(parent.parent).player)){
MovieClip(parent.parent).player.gotHit();
};
if (this.y > (Player.groundY - 30)){
if ((Math.random() * 3) > 1){
flying = false;
this.gotoAndStop(2);
};
};
}
}
}//package
Section 138
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.6");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 139
//music1 (music1)
package {
import flash.media.*;
public dynamic class music1 extends Sound {
}
}//package
Section 140
//overworld (overworld)
package {
import flash.display.*;
public dynamic class overworld extends MovieClip {
public var link_1_2:MovieClip;
public var link_27_28:MovieClip;
public var link_16_19:MovieClip;
public var tentsquash:MovieClip;
public var link_16_17:MovieClip;
public var objective0:MovieClip;
public var objective1:MovieClip;
public var objective3:MovieClip;
public var link_11_13:MovieClip;
public var link_22_25:MovieClip;
public var objective2:MovieClip;
public var link_11_12:MovieClip;
public var link_0_2:MovieClip;
public var objective5:MovieClip;
public var link_22_23:MovieClip;
public var link_33_35:MovieClip;
public var objective4:MovieClip;
public var link_7_8:MovieClip;
public var link_33_34:MovieClip;
public var uparrow:scrollarrow;
public var link_34_35:MovieClip;
public var link_12_14:MovieClip;
public var link_23_26:MovieClip;
public var link_7_12:MovieClip;
public var link_17_20:MovieClip;
public var link_23_24:MovieClip;
public var downarrow:scrollarrow;
public var hexitem:MovieClip;
public var link_18_19:MovieClip;
public var gate:MovieClip;
public var link_13_14:MovieClip;
public var link_24_27:MovieClip;
public var mask2:MovieClip;
public var link_29_31:MovieClip;
public var newbanner2:MovieClip;
public var newbanner3:MovieClip;
public var newbanner4:MovieClip;
public var newbanner5:MovieClip;
public var newbanner6:MovieClip;
public var friendly1:MovieClip;
public var circle10:MovieClip;
public var circle12:MovieClip;
public var circle14:MovieClip;
public var circle16:MovieClip;
public var circle17:MovieClip;
public var circle18:MovieClip;
public var link_18_38:MovieClip;
public var circle15:MovieClip;
public var friendly3:MovieClip;
public var circle13:MovieClip;
public var circle11:MovieClip;
public var link_30_32:MovieClip;
public var mask3:MovieClip;
public var circle20:MovieClip;
public var circle19:MovieClip;
public var circle24:MovieClip;
public var circle26:MovieClip;
public var circle27:MovieClip;
public var circle29:MovieClip;
public var link_9_10:MovieClip;
public var circle25:MovieClip;
public var circle23:MovieClip;
public var link_13_15:MovieClip;
public var circle28:MovieClip;
public var link_30_33:MovieClip;
public var circle30:MovieClip;
public var link_4_7:MovieClip;
public var circle32:MovieClip;
public var circle33:MovieClip;
public var circle34:MovieClip;
public var circle35:MovieClip;
public var circle36:MovieClip;
public var circle38:MovieClip;
public var circle39:MovieClip;
public var mask1:MovieClip;
public var gui:MovieClip;
public var circle22:MovieClip;
public var link_19_20:MovieClip;
public var link_25_26:MovieClip;
public var circle37:MovieClip;
public var hexgrid:MovieClip;
public var circle21:MovieClip;
public var circle31:MovieClip;
public var link_14_16:MovieClip;
public var transition:MovieClip;
public var link_29_32:MovieClip;
public var link_18_22:MovieClip;
public var friendly2:MovieClip;
public var link_20_21:MovieClip;
public var link_31_34:MovieClip;
public var circle2:MovieClip;
public var circle4:MovieClip;
public var patrol1:MovieClip;
public var patrol2:MovieClip;
public var patrol5:MovieClip;
public var circle3:MovieClip;
public var patrol7:MovieClip;
public var patrol12:MovieClip;
public var patrol3:MovieClip;
public var patrol4:MovieClip;
public var circle1:MovieClip;
public var patrol6:MovieClip;
public var patrol10:MovieClip;
public var link_31_32:MovieClip;
public var patrol13:MovieClip;
public var circle8:MovieClip;
public var circle0:MovieClip;
public var playercanvas:MovieClip;
public var patrol11:MovieClip;
public var patrol9:MovieClip;
public var link_4_39:MovieClip;
public var circle9:MovieClip;
public var patrol8:MovieClip;
public var circle5:MovieClip;
public var circle7:MovieClip;
public var link_20_24:MovieClip;
public var link_3_4:MovieClip;
public var link_3_6:MovieClip;
public var link_5_10:MovieClip;
public var link_15_16:MovieClip;
public var guardtower:MovieClip;
public var linkout1:MovieClip;
public var linkout2:MovieClip;
public var linkout3:MovieClip;
public var link_2_3:MovieClip;
public var link_26_27:MovieClip;
public var link_15_18:MovieClip;
public var link_2_5:MovieClip;
public var circle6:MovieClip;
public var newbanner:MovieClip;
public var link_19_23:MovieClip;
public var link_10_11:MovieClip;
public var hexplayer:MovieClip;
public var link_21_28:MovieClip;
public var link_32_33:MovieClip;
public var link_29_30:MovieClip;
public var playercanvas2:MovieClip;
public var link_32_34:MovieClip;
public var link_0_36:MovieClip;
}
}//package
Section 141
//ParticleSystem (ParticleSystem)
package {
import flash.display.*;
import flash.utils.*;
public class ParticleSystem {
var indexpos:int;// = 0
var pvel;// = 9
var active;// = true
var px;// = 0
var py;// = 0
var count;// = 0
var panglevariance;// = 10
var particleTimer:Timer;
var pangle;// = 50
var pvelvariance;// = 2
var pttl;// = 30
var totalCount;
var particles;
var owner:MovieClip;
var pgravity;// = 0.6
var pnumber;// = 20
var marker:MovieClip;// = null
var removeMe:Boolean;// = false
public function ParticleSystem(){
particles = new Array();
active = true;
marker = null;
count = 0;
totalCount = (pnumber * pttl);
removeMe = false;
indexpos = 0;
pnumber = 20;
px = 0;
py = 0;
pangle = 50;
panglevariance = 10;
pvel = 9;
pvelvariance = 2;
pgravity = 0.6;
pttl = 30;
super();
}
public function setNumber(_arg1){
pnumber = _arg1;
}
public function setActive(_arg1:Boolean){
active = _arg1;
}
public function decreaseCount(){
count--;
}
public function setVel(_arg1){
pvel = _arg1;
}
public function getNextParticle(_arg1):Array{
var _local2:*;
var _local3:*;
_local2 = new Array();
_local3 = indexpos;
while (_local3 < totalCount) {
if (particles[_local3].isDead()){
_local2.push(particles[_local3]);
if (_local2.length == _arg1){
indexpos = (_local3 + 1);
if (indexpos >= totalCount){
indexpos = 0;
};
return (_local2);
};
};
_local3++;
};
indexpos = 0;
return (_local2);
}
public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
if (removeMe){
return;
};
if (((!(active)) && ((count <= 0)))){
_local2 = 0;
while (_local2 < totalCount) {
owner.removeChild(particles[_local2]);
_local2++;
};
removeMe = true;
};
if (((!(active)) && ((pnumber > 0)))){
pnumber--;
} else {
if (active){
followMarker();
_local3 = getNextParticle(pnumber);
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4].init(px, py, pangle, panglevariance, pvel, pvelvariance, pttl, pgravity);
count++;
_local4++;
};
};
};
_local1 = 0;
while (_local1 < particles.length) {
particles[_local1].update();
_local1++;
};
}
public function followMarker(){
if (marker == null){
return;
};
this.px = marker.x;
this.py = marker.y;
this.pangle = marker.rotation;
}
public function setMarker(_arg1:MovieClip){
this.marker = _arg1;
}
public function isActive():Boolean{
return (active);
}
}
}//package
Section 142
//ParticleSystemManager (ParticleSystemManager)
package {
import flash.display.*;
public class ParticleSystemManager {
var gameStage:MovieClip;
var cleanUpCounter:int;
var cleanUpCounterMax:int;// = 720
static var particleSystemList = new Array();
public static var instance:ParticleSystemManager;
public function ParticleSystemManager(_arg1:MovieClip){
cleanUpCounterMax = (30 * 24);
cleanUpCounter = cleanUpCounterMax;
super();
this.gameStage = _arg1;
instance = this;
}
public function reinit(_arg1:MovieClip){
this.gameStage = _arg1;
particleSystemList = new Array();
cleanUpCounter = cleanUpCounterMax;
}
public function cleanUp(){
var _local1:*;
var _local2:*;
_local1 = new Array();
_local2 = 0;
while (_local2 < particleSystemList.length) {
if (!particleSystemList[_local2].removeMe){
_local1.push(particleSystemList[_local2]);
};
_local2++;
};
particleSystemList = _local1;
}
public function update(){
var _local1:*;
_local1 = 0;
while (_local1 < particleSystemList.length) {
particleSystemList[_local1].update();
_local1++;
};
cleanUpCounter--;
if ((((cleanUpCounter <= 0)) || ((particleSystemList.length > 50)))){
cleanUpCounter = cleanUpCounterMax;
cleanUp();
};
}
public function createParticleSystem(_arg1:int, _arg2:int, _arg3:int, _arg4:MovieClip):ParticleSystem{
var _local5:ParticleSystem;
switch (_arg1){
case BloodParticleSystem.typeCode:
_local5 = new BloodParticleSystem(_arg2, _arg3, _arg4);
break;
};
particleSystemList.push(_local5);
return (_local5);
}
public function getGameStage():MovieClip{
return (gameStage);
}
public static function isAbleToSupport():Boolean{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < particleSystemList.length) {
if (particleSystemList[_local2].isActive()){
_local1++;
};
_local2++;
};
return ((_local1 < 2));
}
}
}//package
Section 143
//Player (Player)
package {
import flash.display.*;
import flash.geom.*;
public class Player extends MovieClip {
const gameStageBorder = 30;
const scrollSpeed = 15;
const windowWidth = 720;
var destinationX:int;// = 0
var destinationY:int;// = 0
var shunpoJump:Boolean;// = false
var isShunPo:Boolean;// = false
public var keyScrollLeft;// = false
var standingRange:int;// = 100
var arrowPower:int;// = 0
var runSpeed:int;// = 20
var aimAngle;// = 0
var PAUSE_MOVE;// = 3
var clickThreshhold:int;// = 5
var isDead:Boolean;// = false
public var player:MovieClip;
var NORMAL;// = 0
var getHitTimer:int;// = 0
var hasSlash:Boolean;// = false
var shunpoCounter:int;// = -1
var arrayY:Array;
var arrayX:Array;
var STAGEEND;// = 1
var isRunning:Boolean;// = false
var arrayX_temp:Array;
var oldMouseX:int;// = 0
var oldMouseY:int;// = 0
public var keyScrollRight;// = false
var fallingCounter:int;// = -1
var maxDistance:int;// = 300
var arrowCharging:Boolean;// = false
var aimingArrow:Boolean;// = false
var distanceLeft:int;// = 0
var arrayY_temp:Array;
var fallingCounterMax:int;// = 15
var shunpoCounterMax:int;// = 20
var PAUSE;// = 2
var isFalling:Boolean;// = false
var walkSpeed:int;// = 2
public static const groundY = 350;
public static var stageMode:int = 0;
public static var instance:MovieClip;
public function Player(){
maxDistance = 300;
aimingArrow = false;
arrowPower = 0;
arrowCharging = false;
destinationX = 0;
destinationY = 0;
arrayX_temp = new Array();
arrayY_temp = new Array();
arrayX = new Array();
arrayY = new Array();
oldMouseX = 0;
oldMouseY = 0;
distanceLeft = 0;
walkSpeed = 2;
runSpeed = 20;
standingRange = 100;
isRunning = false;
isShunPo = false;
shunpoJump = false;
isFalling = false;
hasSlash = false;
clickThreshhold = 5;
getHitTimer = 0;
isDead = false;
keyScrollLeft = false;
keyScrollRight = false;
shunpoCounter = -1;
shunpoCounterMax = 20;
fallingCounter = -1;
fallingCounterMax = 15;
NORMAL = 0;
STAGEEND = 1;
PAUSE = 2;
PAUSE_MOVE = 3;
aimAngle = 0;
super();
addFrameScript(0, frame1, 1, frame2);
destinationX = this.x;
destinationY = this.y;
instance = this;
}
public function getAimAngle(){
return (aimAngle);
}
public function shouldDrawSmoke():Boolean{
return ((getDistance(arrayX[0], arrayY[0], arrayX[(arrayX.length - 1)], arrayY[(arrayY.length - 1)]) >= (maxDistance - 20)));
}
public function mouseUp(_arg1:int, _arg2:int, _arg3:MovieClip, _arg4:Boolean){
if ((((((Player.stageMode == 2)) || ((Player.stageMode == 1)))) || (!(_arg4)))){
return;
};
if (aimingArrow){
arrowCharging = false;
if (this.player.currentFrame == 21){
fireArrow();
};
} else {
hasSlash = (((arrayX_temp.length > clickThreshhold)) || ((getDistance(arrayX_temp[0], arrayY_temp[0], arrayX_temp[(arrayX_temp.length - 1)], arrayY_temp[(arrayY_temp.length - 1)]) > 10)));
if (!hasSlash){
destinationX = _arg1;
destinationY = _arg2;
_arg3.graphics.clear();
_arg3.graphics.moveTo(_arg1, _arg2);
isRunning = false;
} else {
destinationX = arrayX_temp[0];
destinationY = arrayY_temp[0];
arrayX = arrayX_temp.slice();
arrayY = arrayY_temp.slice();
isRunning = (Math.abs((destinationX - this.x)) > standingRange);
};
};
}
public function checkEnemyWeaponHitPlayer(_arg1:MovieClip){
if (player.hitTestObject(_arg1)){
gotHit();
};
}
public function getAimingArrow():Boolean{
return (aimingArrow);
}
function frame2(){
stop();
}
function frame1(){
stop();
}
public function setArrowPower(_arg1){
arrowPower = _arg1;
}
public function getIsRunning():Boolean{
return (isRunning);
}
public function unpauseGame(){
player.player.play();
if (player.player.dashcloud1 != null){
Player.instance.player.player.dashcloud1.play();
};
if (player.player.dashcloud2 != null){
Player.instance.player.player.dashcloud2.play();
};
}
public function centrePlayerScroll(){
var _local1:*;
if (isShunPo){
return;
};
_local1 = (this.x - (windowWidth / 2));
if (_local1 > 10){
_local1 = 10;
} else {
if (_local1 < -10){
_local1 = -10;
};
};
MovieClip(parent.parent).gameStage.x = (MovieClip(parent.parent).gameStage.x - _local1);
MovieClip(this.parent).x = (MovieClip(this.parent).x - _local1);
}
public function drawSlash(){
var _local1:*;
var _local2:*;
var _local3:*;
MovieClip(root).canvas.graphics.clear();
MovieClip(root).canvas.graphics.moveTo(mouseX, mouseY);
_local1 = maxDistance;
MovieClip(root).slashcanvas.graphics.moveTo(arrayX[0], arrayY[0]);
_local2 = 1;
while (_local2 <= (arrayX.length - 1)) {
_local3 = getDistance(arrayX[(_local2 - 1)], arrayY[(_local2 - 1)], arrayX[_local2], arrayY[_local2]);
MovieClip(root).slashcanvas.graphics.lineStyle((10 - (10 * ((maxDistance - _local1) / maxDistance))), 0xCCCCCC, 1, false, LineScaleMode.NONE, CapsStyle.ROUND, JointStyle.ROUND, 3);
MovieClip(root).slashcanvas.graphics.lineTo(arrayX[_local2], arrayY[_local2]);
_local1 = (_local1 - _local3);
_local2++;
};
}
public function deathAnim(){
if ((Math.random() * 2) < 1){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
this.player.gotoAndStop(15);
}
public function centrePlayer(){
var _local1:*;
_local1 = (this.x - (windowWidth / 2));
MovieClip(parent.parent).gameStage.x = (MovieClip(parent.parent).gameStage.x - _local1);
MovieClip(this.parent).x = (MovieClip(this.parent).x - _local1);
MovieClip(parent.parent).stagebg1.x = (MovieClip(parent.parent).stagebg1.x - _local1);
MovieClip(parent.parent).stagebg2.x = (MovieClip(parent.parent).stagebg2.x - (_local1 / 3));
}
public function movement(_arg1:Boolean){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (isFalling){
return;
};
_local2 = walkSpeed;
_local3 = walkSpeed;
if (isRunning){
_local3 = runSpeed;
_local2 = standingRange;
};
_local4 = ((hasSlash) && (!(isRunning)));
if (((!(_local4)) && (((this.x - destinationX) < -(_local2))))){
this.x = (this.x + _local3);
if ((((((_local3 == runSpeed)) && (!((player.currentFrame == 6))))) && (!(isShunPo)))){
player.gotoAndStop(6);
} else {
if (((((!((_local3 == runSpeed))) && (!((player.currentFrame == 2))))) && (!(isShunPo)))){
player.gotoAndStop(2);
};
};
} else {
if (((!(_local4)) && (((this.x - destinationX) > _local2)))){
this.x = (this.x - _local3);
if ((((((_local3 == runSpeed)) && (!((player.currentFrame == 6))))) && (!(isShunPo)))){
player.gotoAndStop(6);
} else {
if (((((!((_local3 == runSpeed))) && (!((player.currentFrame == 2))))) && (!(isShunPo)))){
player.gotoAndStop(2);
};
};
} else {
this.x = destinationX;
if (!hasSlash){
if (((((((!(isShunPo)) && (!((player.currentFrame == 1))))) && (!((player.currentFrame == 3))))) && (!((player.currentFrame == 4))))){
player.gotoAndStop(1);
};
} else {
if (!isShunPo){
isShunPo = true;
isRunning = false;
hasSlash = false;
_local5 = (destinationX - arrayX[0]);
_local6 = 0;
while (_local6 <= (arrayX.length - 1)) {
arrayX[_local6] = (arrayX[_local6] + _local5);
_local6++;
};
if ((this.y - destinationY) > 150){
player.gotoAndStop(11);
shunpoJump = true;
} else {
player.gotoAndStop(10);
};
SoundManager.instance.playSlash();
shunpoCounter = shunpoCounterMax;
EnemyManager.instance.reactShunpo(arrayX, arrayY);
EnemyManager.instance.checkHit(arrayX, arrayY);
ProjectileManager.instance.checkHit(arrayX, arrayY);
};
};
};
};
}
public function update(_arg1:Boolean, _arg2:int, _arg3:int){
StatsManager.instance.timing++;
if (isDead){
return;
};
if (stageMode != STAGEEND){
if (keyScrollLeft){
scrollGameStage(_arg1, 50, 0);
} else {
if (keyScrollRight){
scrollGameStage(_arg1, (windowWidth - 50), 0);
} else {
scrollGameStage(_arg1, _arg2, _arg3);
};
};
};
if ((((stageMode == NORMAL)) || ((stageMode == PAUSE_MOVE)))){
if (!aimingArrow){
movement(_arg1);
facing();
} else {
getAimingAngle(_arg2, _arg3);
if (arrowCharging){
if (this.player.currentFrame == 21){
this.player.player.aimtop.nextFrame();
};
};
};
if (getHitTimer > 0){
getHitTimer--;
};
if (((isShunPo) && ((shunpoCounter > 0)))){
shunpoCounter--;
} else {
if (shunpoCounter == 0){
shunpoCounter = -1;
shunpoEnd();
trace("forced shunpo end");
};
};
if (((isFalling) && ((fallingCounter > 0)))){
fallingCounter--;
} else {
if (fallingCounter == 0){
fallingCounter = -1;
land();
trace("forced land");
};
};
};
}
public function getShunpoDestination():Point{
return (new Point(arrayX[(arrayX.length - 1)], arrayY[(arrayY.length - 1)]));
}
public function mouseDown(_arg1:int, _arg2:int, _arg3:MovieClip){
if (aimingArrow){
arrowCharging = true;
} else {
_arg3.graphics.clear();
_arg3.x = 0;
arrayX_temp = new Array();
arrayY_temp = new Array();
arrayX_temp.push(_arg1);
arrayY_temp.push(_arg2);
_arg3.graphics.moveTo(_arg1, _arg2);
oldMouseX = _arg1;
oldMouseY = _arg2;
distanceLeft = maxDistance;
};
}
public function gotBallHit(_arg1:Projectile){
var _local2:*;
if (((!(isShunPo)) && ((getHitTimer == 0)))){
getHitTimer = 12;
_local2 = StatsManager.instance.getChanceToDeflect();
if ((Math.random() * 100) > _local2){
StatsManager.instance.hp--;
StatsManager.instance.displayHP();
if (StatsManager.instance.hp <= 0){
this.y = groundY;
this.player.gotoAndStop(15);
isDead = true;
if (_arg1.getVelX() < 0){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
EnemyManager.instance.playerDie();
} else {
MovieClip(this.parent.parent).transition.transition.gotoAndPlay(150);
};
};
return (true);
//unresolved jump
};
return (false);
}
public function getDestination():Point{
return (new Point(destinationX, destinationY));
}
public function displayScoreMessage(_arg1:String){
MovieClip(this.parent.parent).scoremessage.text = _arg1;
}
public function pauseGame(){
if (player.player != null){
player.player.stop();
};
if (player.player.dashcloud1 != null){
Player.instance.player.player.dashcloud1.stop();
};
if (player.player.dashcloud2 != null){
Player.instance.player.player.dashcloud2.stop();
};
}
public function getAimingAngle(_arg1:int, _arg2:int){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (instance.player.currentFrame != 21){
return;
};
_local3 = new Point(this.player.player.aimtop.x, this.player.player.aimtop.y);
_local3 = this.player.player.localToGlobal(_local3);
_local4 = (_arg1 - _local3.x);
_local5 = ((_arg2 - _local3.y) + 20);
if (_local4 > 0){
this.gotoAndStop(1);
} else {
if (_local4 < 0){
this.gotoAndStop(2);
};
};
if (this.currentFrame == 1){
_local6 = ((-(Math.atan2(_local5, _local4)) * 180) / Math.PI);
if (_local6 > 50){
_local6 = 50;
} else {
if (_local6 < -20){
_local6 = -20;
};
};
this.player.player.aimtop.rotation = _local6;
aimAngle = _local6;
} else {
_local6 = (((Math.atan2(_local5, _local4) * 180) / Math.PI) + 180);
if ((((_local6 > 50)) && ((_local6 < 200)))){
_local6 = 50;
} else {
if ((((_local6 < 340)) && ((_local6 > 60)))){
_local6 = 340;
};
};
this.player.player.aimtop.rotation = _local6;
aimAngle = _local6;
};
}
public function drawLine(_arg1:Boolean, _arg2:int, _arg3:int, _arg4:MovieClip){
var _local5:*;
if (((((((((((_arg1) && ((distanceLeft > 0)))) && (!(isShunPo)))) && (!(aimingArrow)))) && (!((Player.stageMode == 2))))) && (!((Player.stageMode == 1))))){
_local5 = getDistance(oldMouseX, oldMouseY, _arg2, _arg3);
_arg4.graphics.lineStyle((9 - (9 * ((maxDistance - distanceLeft) / maxDistance))), 0x990000, 1, false, LineScaleMode.NONE, CapsStyle.ROUND, JointStyle.ROUND, 3);
_arg4.graphics.lineTo(_arg2, _arg3);
distanceLeft = (distanceLeft - _local5);
if (((!((_arg2 == oldMouseX))) || (!((_arg3 == oldMouseY))))){
arrayX_temp.push(_arg2);
arrayY_temp.push(_arg3);
};
oldMouseX = _arg2;
oldMouseY = _arg3;
};
}
function getDistance(_arg1:int, _arg2:int, _arg3:int, _arg4:int):int{
var _local5:*;
var _local6:*;
_local5 = Math.abs((_arg1 - _arg3));
_local6 = Math.abs((_arg2 - _arg4));
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public function getIsShunpo():Boolean{
return (isShunPo);
}
public function shunpoEnd(){
MovieClip(root).slashcanvas.graphics.clear();
getEnemyManager().checkHit(arrayX, arrayY);
ProjectileManager.instance.checkHit(arrayX, arrayY);
if (stageMode != 2){
EnemyManager.instance.checkDeath();
};
if (arrayX[(arrayX.length - 1)] > arrayX[(arrayX.length - 8)]){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
this.x = arrayX[(arrayX.length - 1)];
if (this.x < 50){
this.x = 50;
} else {
if (this.x > (windowWidth - 50)){
this.x = (windowWidth - 50);
};
};
isFalling = (((arrayY[(arrayY.length - 1)] < 140)) && (!(shunpoJump)));
destinationX = this.x;
destinationY = this.y;
if (isFalling){
fallingCounter = fallingCounterMax;
player.gotoAndStop(5);
this.y = arrayY[(arrayY.length - 1)];
} else {
if (shunpoJump){
land();
} else {
player.gotoAndStop(3);
};
};
shunpoJump = false;
isShunPo = false;
arrayX = new Array();
arrayY = new Array();
StatsManager.instance.slashCount++;
}
public function gotHit(){
var _local1:*;
if (((!(isShunPo)) && ((getHitTimer == 0)))){
getHitTimer = 12;
_local1 = StatsManager.instance.getChanceToDeflect();
if ((Math.random() * 100) > _local1){
StatsManager.instance.hp--;
if (StatsManager.instance.location == 101){
StatsManager.instance.hp--;
};
StatsManager.instance.displayHP();
if (StatsManager.instance.hp <= 0){
isDead = true;
pauseGame();
EnemyManager.instance.playerDie();
} else {
MovieClip(this.parent.parent).transition.transition.gotoAndPlay(150);
};
} else {
displayScoreMessage("Dodged enemy hit");
};
};
}
public function getEnemyManager():EnemyManager{
return (EnemyManager.instance);
}
public function gotArrowHit(_arg1:Projectile){
var _local2:*;
if (((!(isShunPo)) && ((getHitTimer == 0)))){
getHitTimer = 12;
_local2 = StatsManager.instance.getChanceToDeflect();
if ((Math.random() * 100) > _local2){
StatsManager.instance.hp--;
StatsManager.instance.displayHP();
if (StatsManager.instance.hp <= 0){
this.y = groundY;
this.player.gotoAndStop(16);
isDead = true;
if (_arg1.getVelX() < 0){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
EnemyManager.instance.playerDieArrow();
} else {
MovieClip(this.parent.parent).transition.transition.gotoAndPlay(150);
};
return (true);
} else {
displayScoreMessage("Dodged arrow");
return (false);
};
//unresolved jump
};
return (false);
}
public function fireArrow(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:Enemy;
var _local8:*;
this.player.gotoAndStop(23);
_local1 = MovieClip(StageManager.instance.gameStage).globalToLocal(new Point(this.x, this.y));
if (this.currentFrame == 1){
_local1.x = (_local1.x + 10);
} else {
_local1.x = (_local1.x - 10);
};
_local2 = (arrowPower * 4);
_local3 = aimAngle;
_local4 = (_local2 * Math.cos(((_local3 * Math.PI) / 180)));
_local5 = (_local2 * Math.sin(((_local3 * Math.PI) / 180)));
if (this.currentFrame == 2){
_local4 = -(_local4);
};
_local6 = ProjectileManager.instance.createProjectile(Arrow_player.typeCode, _local1.x, (_local1.y - 70), _local4, _local5);
if (this.currentFrame == 2){
_local6.scaleX = -1;
};
if ((((EnemyManager.instance.getEnemyInWaiting() == 0)) && ((EnemyManager.instance.countAlive() == 1)))){
_local8 = 0;
while (_local8 < EnemyManager.instance.enemyList.length) {
if (!EnemyManager.instance.enemyList[_local8].isDead()){
_local7 = EnemyManager.instance.enemyList[_local8];
};
_local8++;
};
if (_local6.simulateHit(_local7)){
EnemyManager.instance.freezeDyingArrow(_local6);
};
};
StatsManager.instance.arrowAmmo--;
if (StatsManager.instance.arrowAmmo == 0){
aimingArrow = false;
};
StatsManager.instance.displayArrowAmmo();
StatsManager.instance.arrowCount++;
}
public function getIsDead():Boolean{
return (isDead);
}
public function setPosition(_arg1:int, _arg2:int){
this.x = _arg1;
this.y = _arg2;
this.destinationX = _arg1;
this.destinationY = _arg2;
}
public function reinit(){
stageMode = 0;
isDead = false;
aimingArrow = false;
isShunPo = false;
isRunning = false;
isFalling = false;
hasSlash = false;
keyScrollLeft = false;
keyScrollRight = false;
shunpoCounter = -1;
}
public function setAimingArrow(_arg1:Boolean, _arg2:int, _arg3:int){
if ((((((((((((_arg1 == true)) && (!(isShunPo)))) && (!(isRunning)))) && (!(isFalling)))) && (!(aimingArrow)))) && (!(hasSlash)))){
MovieClip(parent.parent).canvas.graphics.clear();
aimingArrow = true;
destinationX = this.x;
destinationY = this.y;
if (this.x < _arg2){
this.gotoAndStop(1);
} else {
if (this.x > _arg2){
this.gotoAndStop(2);
};
};
this.player.gotoAndStop(20);
aimingArrow = _arg1;
} else {
if (_arg1 == false){
aimingArrow = false;
};
};
}
public function isFacingLeft():Boolean{
return ((this.currentFrame == 2));
}
public function facing(){
if ((((destinationX > this.x)) && (!(isFalling)))){
if (this.currentFrame != 1){
this.gotoAndStop(1);
};
} else {
if ((((destinationX < this.x)) && (!(isFalling)))){
if (this.currentFrame != 2){
this.gotoAndStop(2);
};
};
};
}
public function scrollGameStage(_arg1:Boolean, _arg2:int, _arg3:int){
var _local4:*;
if (((((_arg1) && (!(aimingArrow)))) || ((stageMode == STAGEEND)))){
return;
};
if (StageManager.instance.l1 != null){
StageManager.instance.l1.visible = false;
};
if (StageManager.instance.l2 != null){
StageManager.instance.l2.visible = false;
};
if (StageManager.instance.r1 != null){
StageManager.instance.r1.visible = false;
};
if (StageManager.instance.r2 != null){
StageManager.instance.r2.visible = false;
};
_local4 = 1;
if (((((!(isShunPo)) && ((_arg2 <= 50)))) && ((MovieClip(parent.parent).gameStage.x < ((0 - gameStageBorder) + 10))))){
StageManager.instance.l1.visible = true;
if (_arg2 <= 25){
_local4 = 1.5;
StageManager.instance.l2.visible = true;
};
MovieClip(parent.parent).gameStage.x = (MovieClip(parent.parent).gameStage.x + (scrollSpeed * _local4));
MovieClip(parent.parent).canvas.x = (MovieClip(parent.parent).canvas.x + (scrollSpeed * _local4));
MovieClip(parent.parent).foreground.x = (MovieClip(parent.parent).foreground.x + (scrollSpeed * _local4));
if (MovieClip(parent.parent).stagebg1 != null){
MovieClip(parent.parent).stagebg1.x = (MovieClip(parent.parent).stagebg1.x + (scrollSpeed * _local4));
};
if (MovieClip(parent.parent).stagebg2 != null){
MovieClip(parent.parent).stagebg2.x = (MovieClip(parent.parent).stagebg2.x + ((scrollSpeed * _local4) / 3));
};
this.x = (this.x + (scrollSpeed * _local4));
destinationX = (destinationX + (scrollSpeed * _local4));
} else {
if (((((!(isShunPo)) && ((_arg2 >= (windowWidth - 50))))) && (((MovieClip(parent.parent).gameStage.x + StageManager.instance.stageWidth) > (windowWidth + gameStageBorder))))){
StageManager.instance.r1.visible = true;
if (_arg2 >= (windowWidth - 25)){
_local4 = 1.5;
StageManager.instance.r2.visible = true;
};
MovieClip(parent.parent).gameStage.x = (MovieClip(parent.parent).gameStage.x - (scrollSpeed * _local4));
MovieClip(parent.parent).canvas.x = (MovieClip(parent.parent).canvas.x - (scrollSpeed * _local4));
MovieClip(parent.parent).foreground.x = (MovieClip(parent.parent).foreground.x - (scrollSpeed * _local4));
if (MovieClip(parent.parent).stagebg1 != null){
MovieClip(parent.parent).stagebg1.x = (MovieClip(parent.parent).stagebg1.x - (scrollSpeed * _local4));
};
if (MovieClip(parent.parent).stagebg2 != null){
MovieClip(parent.parent).stagebg2.x = (MovieClip(parent.parent).stagebg2.x - ((scrollSpeed * _local4) / 3));
};
this.x = (this.x - (scrollSpeed * _local4));
destinationX = (destinationX - (scrollSpeed * _local4));
};
};
}
public function land(){
isFalling = false;
player.gotoAndStop(4);
this.y = groundY;
if (this.currentFrame == 1){
this.x = (this.x + 40);
destinationX = this.x;
} else {
this.x = (this.x - 40);
destinationX = this.x;
};
}
public static function createPlayer(_arg1:int, _arg2:int, _arg3:MovieClip):Player{
var _local4:*;
_local4 = new (Player);
_arg3.playercanvas.addChild(_local4);
_local4.x = _arg1;
_local4.y = _arg2;
_local4.destinationX = _arg1;
_local4.destinationY = _arg2;
instance = _local4;
return (_local4);
}
}
}//package
Section 144
//player_icon (player_icon)
package {
import flash.display.*;
public dynamic class player_icon extends MovieClip {
public var player:MovieClip;
public function player_icon(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 145
//Projectile (Projectile)
package {
import flash.display.*;
public class Projectile extends MovieClip {
var ttl:int;
var ttlMax:int;// = 720
var removeMe:Boolean;// = false
var velX:Number;// = 0
var velY:Number;// = 0
var flying:Boolean;// = true
public static var gravity:Number = 1;
public function Projectile(){
velX = 0;
velY = 0;
flying = true;
ttlMax = (30 * 24);
ttl = ttlMax;
removeMe = false;
super();
}
public function stopMotion(){
velX = 0;
velY = 0;
}
public function breakarrow(){
}
public function isFlying():Boolean{
return (flying);
}
public function remove(){
MovieClip(this.parent).removeChild(this);
}
public function doDissappear(){
if (Player.stageMode == 1){
return;
};
if (ttl > 0){
ttl--;
if (ttl < 24){
this.alpha = (ttl / 24);
};
if (ttl <= 0){
removeMe = true;
};
};
}
public function setFlying(_arg1:Boolean){
flying = _arg1;
}
public function update(){
}
public function getVelX():Number{
return (velX);
}
}
}//package
Section 146
//ProjectileManager (ProjectileManager)
package {
import flash.display.*;
public class ProjectileManager {
var cleanUpCounterMax:int;// = 1440
var projectileList;
var cleanUpCounter:int;
var gameStage:MovieClip;
public static var instance:ProjectileManager;
public function ProjectileManager(_arg1:MovieClip){
projectileList = new Array();
cleanUpCounterMax = (60 * 24);
cleanUpCounter = cleanUpCounterMax;
super();
this.gameStage = _arg1;
instance = this;
}
public function reinit(_arg1:MovieClip){
this.gameStage = _arg1;
projectileList = new Array();
cleanUpCounter = cleanUpCounterMax;
}
public function cleanUp(){
var _local1:*;
var _local2:*;
_local1 = new Array();
_local2 = 0;
while (_local2 < projectileList.length) {
if (!projectileList[_local2].removeMe){
_local1.push(projectileList[_local2]);
} else {
projectileList[_local2].remove();
};
_local2++;
};
projectileList = _local1;
}
public function createProjectile(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number):Projectile{
var _local6:Projectile;
switch (_arg1){
case Arrow.typeCode:
_local6 = new Arrow(_arg2, _arg3, _arg4, _arg5);
break;
case Javalin.typeCode:
_local6 = new Javalin(_arg2, _arg3, _arg4, _arg5);
break;
case HeadProjectile.typeCode:
_local6 = new HeadProjectile(_arg2, _arg3, _arg4, _arg5);
break;
case ArmProjectile.typeCode:
_local6 = new ArmProjectile(_arg2, _arg3, _arg4, _arg5);
break;
case Arrow_player.typeCode:
_local6 = new Arrow_player(_arg2, _arg3, _arg4, _arg5);
break;
case Arrow_broken.typeCode:
_local6 = new Arrow_broken(_arg2, _arg3, _arg4, _arg5);
break;
case HatProjectile.typeCode:
_local6 = new HatProjectile(_arg2, _arg3, _arg4, _arg5);
break;
case BodyProjectile.typeCode:
_local6 = new BodyProjectile(_arg2, _arg3, _arg4, _arg5);
break;
case BallProjectile.typeCode:
_local6 = new BallProjectile(_arg2, _arg3, _arg4, _arg5);
break;
case ScarecrowProjectile.typeCode:
_local6 = new ScarecrowProjectile(_arg2, _arg3, _arg4, _arg5);
break;
case ScarecrowProjectileBlack.typeCode:
_local6 = new ScarecrowProjectileBlack(_arg2, _arg3, _arg4, _arg5);
break;
};
if ((((_arg1 == Arrow.typeCode)) || ((_arg1 == BallProjectile.typeCode)))){
MovieClip(gameStage.parent).stagebg1.addChild(_local6);
} else {
gameStage.addChild(_local6);
};
projectileList.push(_local6);
return (_local6);
}
public function update(){
var _local1:*;
_local1 = 0;
while (_local1 < projectileList.length) {
projectileList[_local1].update();
_local1++;
};
cleanUpCounter--;
if ((((cleanUpCounter <= 0)) || ((projectileList.length > 50)))){
cleanUpCounter = cleanUpCounterMax;
cleanUp();
};
}
public function checkHit(_arg1:Array, _arg2:Array){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local3 = new Array();
_local4 = new Array();
_local3.push(_arg1[0]);
_local4.push(_arg2[0]);
_local5 = 1;
while (_local5 < _arg1.length) {
_local8 = ((_arg1[_local5] - _arg1[(_local5 - 1)]) / 4);
_local9 = ((_arg2[_local5] - _arg2[(_local5 - 1)]) / 4);
_local3.push((_arg1[(_local5 - 1)] + _local8));
_local4.push((_arg2[(_local5 - 1)] + _local9));
_local3.push((_arg1[(_local5 - 1)] + (2 * _local8)));
_local4.push((_arg2[(_local5 - 1)] + (2 * _local9)));
_local3.push((_arg1[(_local5 - 1)] + (3 * _local8)));
_local4.push((_arg2[(_local5 - 1)] + (3 * _local9)));
_local3.push(_arg1[_local5]);
_local4.push(_arg2[_local5]);
_local5++;
};
_local6 = gameStage.x;
_local7 = 0;
while (_local7 < projectileList.length) {
_local10 = 0;
while (_local10 < _local3.length) {
if (((projectileList[_local7].isFlying()) && (MovieClip(projectileList[_local7]).hitTestPoint(_local3[_local10], _local4[_local10], true)))){
projectileList[_local7].breakarrow();
};
_local10++;
};
_local7++;
};
}
public function makeInvis(){
var _local1:*;
_local1 = 0;
while (_local1 < projectileList.length) {
projectileList[_local1].visible = false;
_local1++;
};
}
public function getGameStage():MovieClip{
return (gameStage);
}
}
}//package
Section 147
//punch (punch)
package {
import flash.media.*;
public dynamic class punch extends Sound {
}
}//package
Section 148
//ScarecrowProjectile (ScarecrowProjectile)
package {
public class ScarecrowProjectile extends Projectile {
public var bp;
public var rot:int;// = 5
public static var gravity:Number = 2;
public static var typeCode:int = 100;
public function ScarecrowProjectile(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
rot = 5;
super();
addFrameScript(0, frame1);
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
}
function frame1(){
stop();
}
override public function update(){
if (!flying){
doDissappear();
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (this.rotation + rot);
velY = (velY - gravity);
if (this.y > (Player.groundY - 10)){
flying = false;
};
}
}
}//package
Section 149
//ScarecrowProjectileBlack (ScarecrowProjectileBlack)
package {
public class ScarecrowProjectileBlack extends Projectile {
public var bp;
public var rot:int;// = 5
public static var gravity:Number = 2;
public static var typeCode:int = 101;
public function ScarecrowProjectileBlack(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
rot = 5;
super();
addFrameScript(0, frame1);
this.x = _arg1;
this.y = _arg2;
this.velX = _arg3;
this.velY = _arg4;
}
function frame1(){
stop();
}
override public function update(){
if (!flying){
doDissappear();
return;
};
this.x = (this.x + velX);
this.y = (this.y - velY);
this.rotation = (this.rotation + rot);
velY = (velY - gravity);
if (this.y > (Player.groundY - 10)){
flying = false;
};
}
}
}//package
Section 150
//scrollarrow (scrollarrow)
package {
import flash.display.*;
public dynamic class scrollarrow extends MovieClip {
}
}//package
Section 151
//SoundManager (SoundManager)
package {
import flash.media.*;
public class SoundManager {
public var isPlaying;// = true
public var sc:SoundChannel;
public var bgmusic1:Sound;
public var playSounds;// = true
public static var instance:SoundManager;
public function SoundManager(){
bgmusic1 = new music1();
isPlaying = true;
playSounds = true;
super();
instance = this;
sc = bgmusic1.play(0, 999);
}
public function stopMusic(){
if (isPlaying){
sc.stop();
isPlaying = false;
};
}
public function playMusic(){
if (!isPlaying){
sc = bgmusic1.play(0, 999);
isPlaying = true;
};
}
public function playSlash(){
var _local1:int;
var _local2:Sound;
if (!playSounds){
return;
};
_local1 = (Math.random() * 3);
if (_local1 == 0){
_local2 = new sword1();
_local2.play();
} else {
if (_local1 == 1){
_local2 = new sword2();
_local2.play();
} else {
if (_local1 == 2){
_local2 = new sword3();
_local2.play();
};
};
};
}
public function playDie(){
var _local1:int;
var _local2:Sound;
if (!playSounds){
return;
};
_local1 = (Math.random() * 3);
if (_local1 == 0){
_local2 = new hit1();
_local2.play();
} else {
if (_local1 == 1){
_local2 = new hit2();
_local2.play();
} else {
if (_local1 == 2){
_local2 = new hit3();
_local2.play();
};
};
};
}
public function playPunch(){
var _local1:Sound;
_local1 = new punch();
_local1.play();
}
public function playScarecrowDie(){
var _local1:int;
var _local2:Sound;
if (!playSounds){
return;
};
_local1 = (Math.random() * 2);
if (_local1 == 0){
_local2 = new hit1();
_local2.play();
} else {
if (_local1 == 1){
_local2 = new hit2();
_local2.play();
};
};
}
public function playCrash(){
var _local1:Sound;
if (!playSounds){
return;
};
_local1 = new crash();
_local1.play();
}
public function playBossDie(){
var _local1:Sound;
if (!playSounds){
return;
};
_local1 = new bossdie();
_local1.play();
}
}
}//package
Section 152
//StageManager (StageManager)
package {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class StageManager {
public var r2:MovieClip;
var colorMax;// = 11
var colorCounterMax;// = 2
var colorCounter;
var autoCreateBirds:Boolean;// = true
var stageNum:int;// = 0
public var gameStage:MovieClip;
var cloudspeed;
public var l1:MovieClip;
public var l2:MovieClip;
var counterMax:int;// = 12
var stageVar:int;// = 0
var noclouds:Boolean;// = false
var color;// = 1
public var stageWidth:int;// = 800
var counter:int;
var enemyCountMax:int;// = 0
public var r1:MovieClip;
public static var instance:StageManager;
public function StageManager(_arg1:MovieClip){
stageNum = 0;
counterMax = 12;
counter = counterMax;
stageWidth = 800;
enemyCountMax = 0;
stageVar = 0;
cloudspeed = new Array();
noclouds = false;
autoCreateBirds = true;
colorCounterMax = 2;
colorCounter = colorCounterMax;
colorMax = 11;
color = 1;
super();
this.gameStage = _arg1;
instance = this;
}
public function makeDark(_arg1:MovieClip, _arg2:int){
var _local3:Array;
var _local4:ColorMatrixFilter;
_local3 = [1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0];
_local4 = new ColorMatrixFilter(_local3);
_arg1.filters = [_local4];
}
public function updateColorCounter(){
colorCounter--;
if (colorCounter == 0){
colorCounter = colorCounterMax;
color++;
if (color > colorMax){
color = 1;
};
};
}
public function init(){
initStage(StatsManager.instance.location);
}
public function changeColor(_arg1:MovieClip, _arg2:uint){
var _local3:ColorTransform;
_local3 = _arg1.transform.colorTransform;
_local3.color = _arg2;
_arg1.transform.colorTransform = _local3;
}
public function createRandomTree():MovieClip{
var _local1:MovieClip;
if ((Math.random() * 2) < 1){
_local1 = new tree1();
} else {
_local1 = new tree2();
};
return (_local1);
}
public function initScenary(_arg1:int, _arg2:int, _arg3:int, _arg4:MovieClip){
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:int;
if (autoCreateBirds){
if ((Math.random() * 2) < 1){
_local5 = ((Math.random() * 10) + 1);
_local6 = 0;
while (_local6 < _local5) {
_local7 = createBird((Math.random() * stageWidth), 350);
if ((Math.random() * 4) < 1){
_local7.flyStraight((stageWidth - (Math.random() * 50)), (20 + (Math.random() * 50)), -50);
};
_local6++;
};
};
if ((Math.random() * 4) < 1){
_local8 = (Math.random() * 3);
_local6 = 0;
while (_local6 < _local8) {
createSquirrel((Math.random() * stageWidth), 350);
_local6++;
};
};
};
switch (_arg1){
case -1:
MovieClip(gameStage.parent).stagebg1.gotoAndStop(2);
MovieClip(gameStage.parent).stagebg2.gotoAndStop(2);
MovieClip(gameStage.parent).staticbg.gotoAndStop(1);
break;
case -2:
MovieClip(gameStage.parent).stagebg1.gotoAndStop(3);
MovieClip(gameStage.parent).stagebg2.gotoAndStop(2);
MovieClip(gameStage.parent).staticbg.gotoAndStop(2);
break;
case 1:
MovieClip(gameStage.parent).staticbg.gotoAndStop(1);
StageManager.instance.createTrees(_arg2, 9397305, _arg3, 16482326, _arg4);
break;
case 2:
MovieClip(gameStage.parent).staticbg.gotoAndStop(2);
StageManager.instance.createTrees(_arg2, 9397305, _arg3, 16482326, _arg4);
break;
case 3:
MovieClip(gameStage.parent).staticbg.gotoAndStop(3);
StageManager.instance.createTrees(_arg2, 0x525700, _arg3, 0x9BB700, _arg4);
break;
case 4:
MovieClip(gameStage.parent).staticbg.gotoAndStop(4);
StageManager.instance.createTrees(_arg2, 1653510, _arg3, 2711305, _arg4);
break;
case 5:
MovieClip(gameStage.parent).staticbg.gotoAndStop(5);
StageManager.instance.createTrees(_arg2, 3300460, _arg3, 6261921, _arg4);
break;
case 6:
MovieClip(gameStage.parent).staticbg.gotoAndStop(6);
StageManager.instance.createTrees(_arg2, 677255, _arg3, 6664950, _arg4);
break;
case 7:
MovieClip(gameStage.parent).staticbg.gotoAndStop(7);
StageManager.instance.createTrees(_arg2, 5192058, _arg3, 8742829, _arg4);
break;
case 8:
MovieClip(gameStage.parent).staticbg.gotoAndStop(8);
StageManager.instance.createTrees(_arg2, 2568731, _arg3, 3821096, _arg4);
break;
case 9:
MovieClip(gameStage.parent).staticbg.gotoAndStop(9);
StageManager.instance.createTrees(_arg2, 4660054, _arg3, 7023751, _arg4);
break;
case 10:
MovieClip(gameStage.parent).staticbg.gotoAndStop(10);
StageManager.instance.createTrees(_arg2, 1446193, _arg3, 3945361, _arg4);
break;
case 11:
MovieClip(gameStage.parent).staticbg.gotoAndStop(11);
break;
};
}
public function showHint(_arg1:String){
MovieClip(gameStage.parent).hinttext.text = _arg1;
}
public function moveClouds(){
var _local1:*;
var _local2:*;
if (cloudspeed.length == 0){
_local1 = 1;
while (_local1 <= 8) {
cloudspeed[_local1] = Math.random();
MovieClip(gameStage.parent).getChildByName(("cloud" + _local1)).y = (50 + (Math.random() * 200));
if (((noclouds) || (((Math.random() * 3) < 1)))){
MovieClip(gameStage.parent).getChildByName(("cloud" + _local1)).visible = false;
};
_local1++;
};
};
_local1 = 1;
while (_local1 <= 8) {
_local2 = MovieClip(gameStage.parent).getChildByName(("cloud" + _local1));
_local2.x = (_local2.x - cloudspeed[_local1]);
if (_local2.x < -100){
_local2.x = 820;
_local2.y = (50 + (Math.random() * 200));
cloudspeed[_local1] = Math.random();
if (((noclouds) || (((Math.random() * 3) < 1)))){
_local2.visible = false;
};
};
_local1++;
};
}
public function desaturate(_arg1:MovieClip){
var _local2:Array;
var _local3:ColorMatrixFilter;
_local2 = [0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11, 0, 0, 0, 0, 0, 1, 0];
_local3 = new ColorMatrixFilter(_local2);
_arg1.filters = [_local3];
}
public function clearFilter(_arg1:MovieClip){
_arg1.filters = null;
}
public function reinit(_arg1:MovieClip){
this.gameStage = _arg1;
counter = counterMax;
l1 = new scrollarrow();
l1.x = 12;
l1.y = 180;
l1.visible = false;
l2 = new scrollarrow();
l2.x = 27;
l2.y = 180;
l2.visible = false;
r1 = new scrollarrow();
r1.scaleX = -1;
r1.x = 710;
r1.y = 180;
r1.visible = false;
r2 = new scrollarrow();
r2.scaleX = -1;
r2.x = 695;
r2.y = 180;
r2.visible = false;
MovieClip(_arg1.parent).addChild(l1);
MovieClip(_arg1.parent).addChild(l2);
MovieClip(_arg1.parent).addChild(r1);
MovieClip(_arg1.parent).addChild(r2);
cloudspeed = new Array();
noclouds = false;
}
public function initStage(_arg1){
var _local2:*;
stageNum = _arg1;
stageWidth = 720;
enemyCountMax = 0;
stageVar = 0;
noclouds = false;
autoCreateBirds = true;
switch (_arg1){
case 36:
Player.instance.setPosition(80, 350);
stageWidth = 1300;
EnemyManager.instance.setEnemyInWaiting(4);
EnemyManager.instance.createEnemy(100, 500, 350);
EnemyManager.instance.createEnemy(100, 1105, 350);
EnemyManager.instance.createEnemy(100, 1015, 350);
EnemyManager.instance.createEnemy(100, 925, 350);
autoCreateBirds = false;
initScenary(-1, 0, 0, null);
noclouds = true;
_local2 = 0;
while (_local2 < 5) {
createBird((200 + (Math.random() * 300)), 350);
_local2++;
};
showHint("Tutorial - Click on the banner to walk towards it.");
break;
case 37:
Player.instance.setPosition(80, 350);
stageWidth = 1300;
EnemyManager.instance.setEnemyInWaiting(1);
EnemyManager.instance.createEnemy(101, 1200, 350);
initScenary(7, 0, 0, null);
ProjectileManager.instance.createProjectile(Arrow.typeCode, 300, 200, 1, 0);
ProjectileManager.instance.createProjectile(Arrow.typeCode, 320, 200, 1, 0);
ProjectileManager.instance.createProjectile(Arrow.typeCode, 340, 200, 1, 0);
ProjectileManager.instance.createProjectile(Arrow.typeCode, 360, 200, 1, 0);
ProjectileManager.instance.createProjectile(Arrow.typeCode, 380, 200, 1, 0);
showHint("Click on arrows to pick them up.\rHold shift to equip your bow.\rPress and hold left mouse button to pull back on the bow.");
break;
case 0:
Player.instance.setPosition(100, 350);
stageWidth = 720;
initScenary(2, 1, 4, null);
EnemyManager.instance.setEnemyInWaiting(1);
EnemyManager.instance.createEnemy(1, 700, 350);
break;
case 1:
Player.instance.setPosition(360, 350);
stageWidth = 720;
initScenary(-2, 2, 4, null);
EnemyManager.instance.setEnemyInWaiting(8);
EnemyManager.instance.createEnemy(1, 700, 350);
EnemyManager.instance.createEnemy(1, 800, 350);
EnemyManager.instance.createEnemy(1, 900, 350);
EnemyManager.instance.createEnemy(1, 1000, 350);
EnemyManager.instance.createEnemy(1, -400, 350);
EnemyManager.instance.createEnemy(1, -300, 350);
EnemyManager.instance.createEnemy(1, -200, 350);
EnemyManager.instance.createEnemy(1, -100, 350);
break;
case 2:
Player.instance.setPosition(100, 350);
stageWidth = 720;
initScenary(3, 2, 4, null);
EnemyManager.instance.setEnemyInWaiting(3);
EnemyManager.instance.createEnemy(1, 700, 350);
EnemyManager.instance.createEnemy(1, 600, 350);
EnemyManager.instance.createEnemy(1, -100, 350);
break;
case 3:
Player.instance.setPosition(360, 350);
stageWidth = 720;
initScenary(3, 3, 4, null);
EnemyManager.instance.setEnemyInWaiting(6);
EnemyManager.instance.createEnemy(1, 700, 350);
EnemyManager.instance.createEnemy(3, 800, 350);
EnemyManager.instance.createEnemy(1, 900, 350);
EnemyManager.instance.createEnemy(3, -300, 350);
EnemyManager.instance.createEnemy(1, -200, 350);
EnemyManager.instance.createEnemy(3, -100, 350);
break;
case 5:
Player.instance.setPosition(100, 350);
stageWidth = 1300;
initScenary(4, 2, 5, null);
EnemyManager.instance.setEnemyInWaiting(5);
EnemyManager.instance.createEnemy(1, 700, 350);
EnemyManager.instance.createEnemy(1, 800, 350);
EnemyManager.instance.createEnemy(1, 900, 350);
EnemyManager.instance.createEnemy(2, 1200, 350);
EnemyManager.instance.createEnemy(2, 1100, 350);
noclouds = true;
break;
case 6:
Player.instance.setPosition(360, 350);
stageWidth = 1300;
initScenary(3, 2, 5, null);
EnemyManager.instance.setEnemyInWaiting(10);
EnemyManager.instance.createEnemy(3, 1300, 350);
EnemyManager.instance.createEnemy(3, 1200, 350);
EnemyManager.instance.createEnemy(3, 1100, 350);
EnemyManager.instance.createEnemy(3, 1000, 350);
EnemyManager.instance.createEnemy(3, 900, 350);
EnemyManager.instance.createEnemy(3, 0, 350);
EnemyManager.instance.createEnemy(3, -100, 350);
EnemyManager.instance.createEnemy(3, -200, 350);
EnemyManager.instance.createEnemy(3, -300, 350);
EnemyManager.instance.createEnemy(3, -400, 350);
break;
case 8:
Player.instance.setPosition(360, 350);
stageWidth = 1300;
autoCreateBirds = false;
initScenary(-2, 0, 0, null);
EnemyManager.instance.setEnemyInWaiting(8);
EnemyManager.instance.createEnemy(4, 1300, 350);
EnemyManager.instance.createEnemy(4, 1250, 350);
EnemyManager.instance.createEnemy(4, 1200, 350);
EnemyManager.instance.createEnemy(4, 1150, 350);
EnemyManager.instance.createEnemy(4, -100, 350);
EnemyManager.instance.createEnemy(4, -150, 350);
EnemyManager.instance.createEnemy(4, -200, 350);
EnemyManager.instance.createEnemy(4, -250, 350);
_local2 = 0;
while (_local2 < 10) {
createBird((100 + (Math.random() * 1100)), 350);
_local2++;
};
break;
case 9:
Player.instance.setPosition(100, 350);
stageWidth = 1300;
initScenary(4, 5, 5, null);
noclouds = true;
EnemyManager.instance.setEnemyInWaiting(10);
EnemyManager.instance.createEnemy(2, 900, 350);
EnemyManager.instance.createEnemy(2, 1000, 350);
EnemyManager.instance.createEnemy(2, 1100, 350);
EnemyManager.instance.createEnemy(2, 1200, 350);
EnemyManager.instance.createEnemy(2, 1300, 350);
EnemyManager.instance.createEnemy(2, -100, 350);
EnemyManager.instance.createEnemy(2, -200, 350);
EnemyManager.instance.createEnemy(2, -300, 350);
EnemyManager.instance.createEnemy(2, -400, 350);
EnemyManager.instance.createEnemy(2, -500, 350);
break;
case 10:
Player.instance.setPosition(360, 350);
stageWidth = 1300;
initScenary(4, 3, 5, null);
noclouds = true;
EnemyManager.instance.setEnemyInWaiting(10);
EnemyManager.instance.createEnemy(2, 1100, 350);
EnemyManager.instance.createEnemy(2, 1200, 350);
EnemyManager.instance.createEnemy(2, 1300, 350);
EnemyManager.instance.createEnemy(1, 1100, 350);
EnemyManager.instance.createEnemy(1, 1200, 350);
EnemyManager.instance.createEnemy(2, -400, 350);
EnemyManager.instance.createEnemy(2, -300, 350);
EnemyManager.instance.createEnemy(2, -200, 350);
EnemyManager.instance.createEnemy(1, -100, 350);
EnemyManager.instance.createEnemy(1, -100, 350);
break;
case 11:
Player.instance.setPosition(100, 350);
stageWidth = 1300;
initScenary(4, 4, 5, null);
noclouds = true;
EnemyManager.instance.setEnemyInWaiting(11);
EnemyManager.instance.createEnemy(2, 1300, 350);
EnemyManager.instance.createEnemy(2, 1200, 350);
EnemyManager.instance.createEnemy(2, 1100, 350);
EnemyManager.instance.createEnemy(1, 1100, 350);
EnemyManager.instance.createEnemy(1, 1000, 350);
EnemyManager.instance.createEnemy(1, 900, 350);
EnemyManager.instance.createEnemy(1, 800, 350);
EnemyManager.instance.createEnemy(1, 700, 350);
EnemyManager.instance.createEnemy(3, 1300, 350);
EnemyManager.instance.createEnemy(3, 1200, 350);
EnemyManager.instance.createEnemy(3, 1100, 350);
break;
case 13:
Player.instance.setPosition(100, 350);
stageWidth = 1300;
initScenary(8, 2, 5, createBanner());
EnemyManager.instance.setEnemyInWaiting(-1);
EnemyManager.instance.createGuardTower(500, 350);
break;
case 4:
case 7:
case 12:
case 14:
Player.instance.setPosition(360, 350);
stageWidth = 1300;
initScenary(5, 2, 8, null);
EnemyManager.instance.setEnemyInWaiting(25);
enemyCountMax = 5;
break;
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
Player.instance.setPosition(360, 350);
stageWidth = 900;
if (_arg1 == 17){
initScenary(-2, 2, 5, null);
} else {
if (_arg1 <= 16){
initScenary(6, 2, 5, null);
} else {
if (_arg1 >= 18){
initScenary(7, 2, 5, null);
};
};
};
EnemyManager.instance.setEnemyInWaiting(25);
enemyCountMax = 5;
break;
case 21:
Player.instance.setPosition(360, 350);
stageWidth = 900;
initScenary(7, 2, 5, null);
EnemyManager.instance.setEnemyInWaiting(6);
EnemyManager.instance.createEnemy(5, 700, 350);
EnemyManager.instance.createEnemy(5, 800, 350);
EnemyManager.instance.createEnemy(5, 900, 350);
EnemyManager.instance.createEnemy(5, -300, 350);
EnemyManager.instance.createEnemy(5, -200, 350);
EnemyManager.instance.createEnemy(5, -100, 350);
break;
case 28:
Player.instance.setPosition(360, 350);
stageWidth = 900;
initScenary(8, 2, 5, null);
EnemyManager.instance.setEnemyInWaiting(40);
enemyCountMax = 8;
break;
case 22:
case 24:
case 26:
if ((((StatsManager.instance.getBuildersLeft() == 0)) && ((((_arg1 == 22)) || ((_arg1 == 24)))))){
stageWidth = 2400;
MovieClip(gameStage.parent).foreground.gotoAndStop(2);
initScenary(8, 2, 5, createBanner());
EnemyManager.instance.createCatapult(1100, 350);
showHint("To defeat the catapult hit it back in the balls.\rDefeat all the soldiers to clear the area.");
} else {
stageWidth = 900;
initScenary(9, 2, 5, null);
};
Player.instance.setPosition(360, 350);
EnemyManager.instance.setEnemyInWaiting(25);
enemyCountMax = 5;
break;
case 25:
case 23:
case 27:
if ((((StatsManager.instance.getBuildersLeft() == 0)) && ((_arg1 == 23)))){
stageWidth = 2400;
MovieClip(gameStage.parent).foreground.gotoAndStop(2);
initScenary(8, 2, 5, createBanner());
EnemyManager.instance.createCatapult(1100, 350);
showHint("To defeat the catapult hit it back in the balls.\rDefeat all the soldiers to clear the area.");
} else {
stageWidth = 900;
initScenary(9, 2, 5, null);
};
Player.instance.setPosition(360, 350);
EnemyManager.instance.setEnemyInWaiting(25);
enemyCountMax = 5;
break;
case 100:
Player.instance.setPosition(360, 350);
if (HexManager.enemiesToFight < 5){
stageWidth = 720;
} else {
if (HexManager.enemiesToFight <= 8){
stageWidth = 900;
} else {
stageWidth = 1300;
};
};
if ((Math.random() * 2) < 1){
initScenary(10, 2, 5, null);
} else {
initScenary(11, 2, 5, null);
};
EnemyManager.instance.setEnemyInWaiting((HexManager.enemiesToFight * 5));
enemyCountMax = HexManager.enemiesToFight;
makeDark(gameStage, -25);
makeDark(MovieClip(gameStage.parent).playercanvas, -25);
break;
case 101:
Player.instance.setPosition(100, 350);
stageWidth = 1300;
initScenary(8, 2, 5, createBanner());
EnemyManager.instance.setEnemyInWaiting(1);
EnemyManager.instance.createEnemy(6, 800, 350);
break;
};
}
public function createBanner():MovieClip{
var _local1:*;
_local1 = new enemybanner();
_local1.x = (100 + (Math.random() * (stageWidth - 200)));
_local1.y = 350;
gameStage.addChild(_local1);
_local1.rotation = (_local1.rotation + ((Math.random() * 20) - 10));
makeDark(_local1, -50);
return (_local1);
}
public function createBird(_arg1, _arg2):Enemy_bird{
var _local3:*;
_local3 = new Enemy_bird();
_local3.setPosition(_arg1, _arg2);
EnemyManager.instance.enemyList.push(_local3);
MovieClip(gameStage.parent).foreground.addChild(_local3);
return (_local3);
}
public function update(){
if (Player.instance.getIsDead()){
return;
};
moveClouds();
counter--;
if (counter <= 0){
counter = counterMax;
switch (stageNum){
case 4:
case 7:
case 12:
case 14:
if (EnemyManager.instance.countAlive() < enemyCountMax){
EnemyManager.instance.createRandomEnemy(3);
};
break;
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
if (EnemyManager.instance.countAlive() < enemyCountMax){
EnemyManager.instance.createRandomEnemyNoArrow(4);
};
break;
case 28:
if (EnemyManager.instance.countAlive() < enemyCountMax){
EnemyManager.instance.createRandomEnemyNoArrow(4);
};
break;
case 22:
case 24:
case 26:
if (EnemyManager.instance.countAlive() < enemyCountMax){
EnemyManager.instance.createRandomEnemy(4);
};
break;
case 25:
case 23:
case 27:
if (EnemyManager.instance.countAlive() < enemyCountMax){
EnemyManager.instance.createRandomEnemyNoArrow(5);
};
break;
case 100:
if (EnemyManager.instance.countAlive() < enemyCountMax){
EnemyManager.instance.createRandomEnemy(5);
};
break;
};
};
}
public function createSquirrel(_arg1, _arg2){
var _local3:*;
_local3 = new Enemy_squirrel();
_local3.setPosition(_arg1, _arg2);
EnemyManager.instance.enemyList.push(_local3);
MovieClip(gameStage.parent).foreground.addChild(_local3);
}
public function createTrees(_arg1:int, _arg2:uint, _arg3:int, _arg4:uint, _arg5:MovieClip){
var _local6:MovieClip;
var _local7:MovieClip;
var _local8:MovieClip;
var _local9:*;
var _local10:*;
_local6 = MovieClip(gameStage.parent).stagebg1;
_local7 = MovieClip(gameStage.parent).stagebg2;
_local9 = 0;
while (_local9 < _arg1) {
if ((Math.random() * 2) < 1){
_local8 = new tree1();
} else {
_local8 = new tree2();
};
_local8.name = ("tree" + _local9);
_local8.y = (Player.groundY + 15);
_local8.x = (((Math.random() * StageManager.instance.stageWidth) * 3) / 4);
_local10 = ((10 + (Math.random() * 3)) / 10);
_local8.scaleY = _local10;
_local8.scaleX = _local10;
if ((Math.random() * 2) < 1){
_local8.scaleX = -(_local8.scaleX);
};
_local8.rotation = (-5 + (Math.random() * 10));
_local6.addChild(_local8);
StageManager.instance.changeColor(_local8, _arg2);
if (_arg5 != null){
while (_arg5.hitTestObject(_local8)) {
_local8.x = (_local8.x + 10);
};
};
_local9++;
};
_local9 = 0;
while (_local9 < _arg3) {
if ((Math.random() * 2) < 1){
_local8 = new tree1();
} else {
_local8 = new tree2();
};
_local8.name = ("tree" + _local9);
_local8.y = (Player.groundY + 15);
_local8.x = (((Math.random() * StageManager.instance.stageWidth) * 3) / 4);
_local10 = ((10 + (Math.random() * 3)) / 20);
_local8.scaleY = _local10;
_local8.scaleX = _local10;
if ((Math.random() * 2) < 1){
_local8.scaleX = -(_local8.scaleX);
};
_local8.rotation = (-5 + (Math.random() * 10));
_local7.addChild(_local8);
StageManager.instance.changeColor(_local8, _arg4);
_local9++;
};
}
}
}//package
Section 153
//StatsLevel (StatsLevel)
package {
public class StatsLevel {
public var highestCombo:int;// = 0
public var completed:Boolean;// = false
public var hasItem:Boolean;// = false
public var kills:int;// = 0
public var headshots:int;// = 0
public var points:int;// = 0
public var arrowHeadShots:int;// = 0
public var hidden:Boolean;// = false
public var visited:Boolean;// = false
public var timeTaken:int;// = -1
public var stylePoints:int;// = 0
public function StatsLevel(){
completed = false;
visited = false;
hidden = false;
timeTaken = -1;
hasItem = false;
points = 0;
stylePoints = 0;
headshots = 0;
arrowHeadShots = 0;
kills = 0;
highestCombo = 0;
super();
}
}
}//package
Section 154
//StatsManager (StatsManager)
package {
import flash.display.*;
import flash.net.*;
public class StatsManager {
var banner2taken:Boolean;// = false
public var battlesFought:int;// = 0
public var hp:int;// = 10
var patrolsDown;
public var playerIcon:MovieClip;
var tentSquash:Boolean;// = false
var patrolsLoc;
var totalArrowHeadShots:int;// = 0
var hexState;
var mission4init:Boolean;// = false
public var armor:int;// = 0
var previousArrowAmmo:int;// = 0
var root;
public var banner4taken:Boolean;// = false
public var timing:int;// = 0
var patrolsLocOld;
var engagedPatrol;// = -1
public var headshotCount:int;// = 0
public var map:MovieClip;
var banner1taken:Boolean;// = false
public var showAll:Boolean;// = false
var domination:Boolean;// = false
public var levels;
var totalHeadshotCount:int;// = 0
public var maxHP:int;// = 3
public var arrowAmmo:int;// = 3
public var hexCheat:Boolean;// = false
public var turn:int;// = 1
var gateState:int;// = 1
public var maxCombo:int;// = 0
public var mission:int;// = 0
public var arrowCount:int;// = 0
public var slashCount:int;// = 0
public var bossDefeated:Boolean;// = false
public var banner3taken:Boolean;// = false
public var totalTiming:int;// = 0
public var arrowHeadShots:int;// = 0
public var location:int;// = 36
var patrolsDead;
var totalScore:int;// = 0
public var skipFights:Boolean;// = false
public var banners:int;// = 0
public var previousLocation:int;// = 0
public var hasBow:Boolean;// = false
var totalLevels:int;// = 39
public var kills:int;// = 0
public var hexitemtaken:Boolean;// = false
var previousScore:int;// = 0
public var totalItems:int;// = 0
public var banner5taken:Boolean;// = false
public var totalBanners:int;// = 0
var totalKills:int;// = 0
var totalDeaths:int;// = 0
var totalSlashCount:int;// = 0
var totalArrowCount:int;// = 0
public static var instance:StatsManager;
public function StatsManager(){
var _local1:*;
var _local2:*;
var _local3:*;
hasBow = false;
arrowAmmo = 3;
previousArrowAmmo = 0;
armor = 0;
maxHP = 3;
location = 36;
previousLocation = 0;
showAll = false;
skipFights = false;
levels = new Array();
mission = 0;
totalLevels = 39;
gateState = 1;
tentSquash = false;
hp = 10;
timing = 0;
slashCount = 0;
arrowCount = 0;
headshotCount = 0;
banners = 0;
kills = 0;
arrowHeadShots = 0;
maxCombo = 0;
totalTiming = 0;
totalSlashCount = 0;
totalHeadshotCount = 0;
totalArrowCount = 0;
totalBanners = 0;
totalScore = 0;
totalKills = 0;
totalArrowHeadShots = 0;
previousScore = 0;
totalDeaths = 0;
battlesFought = 0;
totalItems = 0;
turn = 1;
banner1taken = false;
banner2taken = false;
banner3taken = false;
banner4taken = false;
banner5taken = false;
hexitemtaken = false;
mission4init = false;
hexState = new Array();
hexCheat = false;
bossDefeated = false;
domination = false;
patrolsDown = new Array(false, true, false);
patrolsDead = new Array(true, false, true, false, false, true, true, false, false, false, false, false, false, false);
patrolsLoc = new Array(40, 7, 12, 15, 16, 19, 20, 21, 25, 26, 27, 22, 23, 24);
patrolsLocOld = new Array();
engagedPatrol = -1;
super();
instance = this;
new HexManager();
_local1 = 0;
while (_local1 <= totalLevels) {
levels.push(new StatsLevel());
_local1++;
};
_local2 = 0;
while (_local2 <= 10) {
hexState[_local2] = new Array();
_local3 = 0;
while (_local3 <= 11) {
hexState[_local2][_local3] = new HexInfo(_local2, _local3);
_local3++;
};
_local2++;
};
location = 36;
levels[36].visited = true;
levels[1].hasItem = true;
levels[6].hasItem = true;
levels[8].hasItem = true;
levels[9].hasItem = true;
levels[21].hasItem = true;
levels[27].hasItem = true;
}
public function displayHex(){
var _local1:*;
var _local2:*;
var _local3:Hex;
addArrowAmmo();
addArrowAmmo();
map.hexgrid.visible = true;
_local1 = 0;
while (_local1 <= totalLevels) {
MovieClip(map.getChildByName(("circle" + _local1))).visible = false;
_local2 = 0;
while (_local2 <= totalLevels) {
if (map.getChildByName(((("link_" + _local1) + "_") + _local2)) != null){
map.getChildByName(((("link_" + _local1) + "_") + _local2)).visible = false;
};
_local2++;
};
_local1++;
};
map.gui.endturnbutton.visible = HexManager.isPlayerTurn;
if (!HexManager.isPlayerTurn){
StatsManager.instance.map.gui.words.text = "The enemy is on the move.";
};
map.linkout1.visible = false;
map.linkout2.visible = false;
map.linkout3.visible = false;
map.friendly1.visible = false;
map.friendly2.visible = false;
map.friendly3.visible = false;
map.patrol1.visible = false;
map.patrol2.visible = false;
map.patrol3.visible = false;
map.patrol4.visible = false;
map.patrol5.visible = false;
map.patrol6.visible = false;
map.patrol7.visible = false;
map.patrol8.visible = false;
map.patrol9.visible = false;
map.patrol10.visible = false;
map.patrol11.visible = false;
map.patrol12.visible = false;
map.patrol13.visible = false;
map.gui.itemfounddialog.visible = false;
map.gui.bowfounddialog.visible = false;
map.gui.catapultdialog.visible = false;
map.gui.hexdialog.visible = false;
map.gui.stats.visible = false;
map.objective0.visible = false;
map.objective1.visible = false;
map.objective2.visible = false;
map.objective3.visible = false;
map.objective4.visible = false;
map.objective5.visible = true;
playerIcon.visible = false;
map.friendly1.visible = true;
map.friendly1.x = map.circle18.x;
map.friendly1.y = map.circle18.y;
map.friendly1.scaleX = -1;
map.friendly2.visible = true;
map.friendly2.x = map.circle19.x;
map.friendly2.y = map.circle19.y;
map.friendly3.visible = true;
map.friendly3.x = map.circle20.x;
map.friendly3.y = map.circle20.y;
map.friendly3.scaleX = -1;
if (tentSquash){
map.tentsquash.gotoAndStop(2);
};
map.newbanner.visible = banner1taken;
map.newbanner2.visible = banner2taken;
map.newbanner3.visible = banner3taken;
map.newbanner4.visible = banner4taken;
map.newbanner5.visible = banner5taken;
map.newbanner6.visible = bossDefeated;
map.hexitem.visible = !(hexitemtaken);
map.gate.gotoAndStop(gateState);
if (gateState >= 15){
map.hexgrid.removeChild(map.hexgrid.hex_10_5);
};
if (gateState >= 10){
map.hexgrid.removeChild(map.hexgrid.hex_10_6);
};
if (gateState >= 5){
map.hexgrid.removeChild(map.hexgrid.hex_10_7);
};
if (!mission4init){
initMission4();
};
_local1 = 0;
while (_local1 <= 10) {
_local2 = 0;
while (_local2 <= 11) {
_local3 = map.hexgrid.getChildByName(((("hex_" + _local1) + "_") + _local2));
if (_local3 != null){
_local3.init(hexState[_local1][_local2]);
_local3.updateDisplay();
};
_local2++;
};
_local1++;
};
if (bossDefeated){
map.objective5.visible = false;
displayStats();
map.gui.missionaccomplished.gotoAndPlay(2);
map.gui.words.text = "";
};
}
public function getFriendlyLocation(_arg1:MovieClip):int{
if (_arg1.name == "friendly1"){
if (turn == 29){
return (38);
};
if (turn >= 30){
return (18);
};
} else {
if (_arg1.name == "friendly2"){
if (turn == 24){
return (39);
};
if (turn == 25){
return (4);
};
if (turn == 26){
return (7);
};
if (turn == 27){
return (12);
};
if (turn == 28){
return (14);
};
if (turn == 29){
return (16);
};
if (turn >= 30){
return (19);
};
} else {
if (_arg1.name == "friendly3"){
if (turn == 29){
return (21);
};
if (turn >= 30){
return (20);
};
};
};
};
return (0);
}
public function sumScore():int{
var _local1:int;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 <= totalLevels) {
_local1 = (_local1 + (levels[_local2].points + levels[_local2].stylePoints));
_local2++;
};
return (_local1);
}
public function displayStats(){
var _local1:*;
var _local2:int;
var _local3:int;
map.gui.stats.achievementitem.visible = (totalItems == 7);
map.gui.stats.achievementbanner.visible = (totalBanners == 7);
map.gui.stats.achievementhex.visible = (((mission == 4)) && ((countFriendlyHex() == countTotalHex())));
map.gui.stats.achievementmaxslash.visible = (maxCombo >= 6);
map.gui.stats.achievementarrowheadshot.visible = (totalArrowHeadShots >= 20);
map.gui.stats.achievementheadshot.visible = (totalHeadshotCount >= 100);
map.gui.stats.achievementkills.visible = (totalKills >= 300);
map.gui.stats.achievementfights.visible = (battlesFought >= 30);
map.gui.stats.achievementdeaths.visible = false;
if (bossDefeated){
if (map.gui.stats.achievementitem.visible){
totalScore = (totalScore + 50000);
};
if (map.gui.stats.achievementbanner.visible){
totalScore = (totalScore + 50000);
};
if (map.gui.stats.achievementmaxslash.visible){
totalScore = (totalScore + 50000);
};
if (map.gui.stats.achievementarrowheadshot.visible){
totalScore = (totalScore + 50000);
};
if (map.gui.stats.achievementheadshot.visible){
totalScore = (totalScore + 50000);
};
if (map.gui.stats.achievementkills.visible){
totalScore = (totalScore + 50000);
};
if (map.gui.stats.achievementfights.visible){
totalScore = (totalScore + 50000);
};
if (totalDeaths == 0){
map.gui.stats.achievementdeaths.visible = true;
totalScore = (totalScore + 50000);
};
totalScore = (totalScore + (countFriendlyHex() * 10000));
};
map.gui.stats.visible = true;
map.gui.stats.hp.text = hp;
map.gui.stats.deflect.text = (armor * 10);
map.gui.stats.battles.text = battlesFought;
_local1 = (totalTiming / 24);
_local2 = (_local1 / 60);
_local3 = (_local1 % 60);
map.gui.stats.timing.text = (((_local2 + " min ") + _local3) + " sec");
map.gui.stats.kills.text = totalKills;
map.gui.stats.deaths.text = totalDeaths;
map.gui.stats.score.text = totalScore;
map.gui.stats.slashes.text = totalSlashCount;
map.gui.stats.combo.text = maxCombo;
map.gui.stats.headshots.text = totalHeadshotCount;
map.gui.stats.arrows.text = totalArrowCount;
map.gui.stats.arrowheadshots.text = totalArrowHeadShots;
map.gui.stats.items.text = totalItems;
map.gui.stats.banners.text = totalBanners;
map.gui.stats.turns.text = turn;
map.gui.stats.sectorlabel.visible = (mission == 4);
map.gui.stats.sectorcount.visible = (mission == 4);
map.gui.stats.sectortotal.visible = (mission == 4);
if (mission == 4){
map.gui.stats.sectorcount.text = countFriendlyHex();
map.gui.stats.sectortotal.text = countTotalHex();
};
if (mission == 0){
map.gui.stats.mission.text = "Stall the construction of the enemy gates until friendly forces arrive.";
map.gui.stats.objective.text = "move towards the gates.";
} else {
if (mission == 1){
map.gui.stats.mission.text = "Stall the construction of the enemy gates until friendly forces arrive.";
map.gui.stats.objective.text = "take down the guard tower.";
} else {
if (mission == 2){
map.gui.stats.mission.text = "Stall the construction of the enemy gates until friendly forces arrive.";
map.gui.stats.objective.text = "eliminate the gate builders.";
} else {
if (mission == 3){
map.gui.stats.mission.text = "Stall the construction of the the enemy gates until friendly forces arrive.";
map.gui.stats.objective.text = (("friendly forces arriving in " + (30 - turn)) + " turns.");
} else {
if (bossDefeated){
map.gui.stats.mission.text = "Congratulations! You have won the game";
map.gui.stats.objective.text = "Mission Accomplished!";
} else {
if (mission == 4){
map.gui.stats.mission.text = "defeat the enemy commander.";
map.gui.stats.objective.text = "use troops to clear a path to the enemy commander tent.";
};
};
};
};
};
};
}
public function nextTurn(){
turn++;
if (showAll){
movePatrols();
};
StageManager.instance.updateColorCounter();
if ((((getBuildersLeft() > 0)) && ((gateState <= 28)))){
gateState++;
};
}
function playEnemyDialog():Boolean{
var _local1:int;
switch (location){
case 0:
showEnemyDialog("Hey you there! Get over here!");
return (true);
case 4:
case 7:
case 12:
case 14:
_local1 = (Math.random() * 5);
if (_local1 == 0){
showEnemyDialog("STOP!");
} else {
if (_local1 == 1){
showEnemyDialog("Die!");
} else {
if (_local1 == 2){
showEnemyDialog("Intruder!");
} else {
if (_local1 == 3){
showEnemyDialog("Enemy contact!");
} else {
if (_local1 == 4){
showEnemyDialog("Meet your maker!");
};
};
};
};
};
return (true);
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
_local1 = (Math.random() * 5);
if (_local1 == 0){
showEnemyDialog("STOP!");
} else {
if (_local1 == 1){
showEnemyDialog("Die!");
} else {
if (_local1 == 2){
showEnemyDialog("Intruder!");
} else {
if (_local1 == 3){
showEnemyDialog("Enemy contact!");
} else {
if (_local1 == 4){
showEnemyDialog("Meet your maker!");
};
};
};
};
};
return (true);
case 22:
case 23:
case 24:
if ((((getBuildersLeft() == 0)) && ((mission == 2)))){
showEnemyDialog("Bring out the catapult!");
return (true);
};
break;
case 28:
showPlayerDialog("Ambush!");
return (true);
};
return (false);
}
public function getPatrolLocation(_arg1:MovieClip){
var _local2:*;
_local2 = 1;
while (_local2 <= 13) {
if (_arg1.name == ("patrol" + _local2)){
return (patrolsLoc[_local2]);
};
_local2++;
};
}
public function showPlayerDialog(_arg1:String){
map.gui.playerdialog.playerdialog.words.text = _arg1;
map.gui.playerdialog.gotoAndPlay(2);
}
public function getChanceToDeflect():int{
return ((armor * 10));
}
public function fireAtCamp(){
tentSquash = true;
SoundManager.instance.playCrash();
map.tentsquash.gotoAndStop(2);
displayCircles();
}
public function displayHP(){
if (hp == 1){
MovieClip(Player.instance.parent.parent).healthbar.gotoAndStop(2);
};
MovieClip(Player.instance.parent.parent).healthbar.width = (hp * 10);
MovieClip(Player.instance.parent.parent).hptext.text = hp;
}
public function updateStats(){
totalTiming = (totalTiming + timing);
totalSlashCount = (totalSlashCount + slashCount);
totalHeadshotCount = (totalHeadshotCount + headshotCount);
totalArrowCount = (totalArrowCount + arrowCount);
totalBanners = (totalBanners + banners);
totalKills = (totalKills + kills);
totalArrowHeadShots = (totalArrowHeadShots + arrowHeadShots);
stageReset();
}
public function initMission4(){
var _local1:*;
map.gui.strategymode.gotoAndPlay(2);
map.gui.words.text = "State saved. Password - strategy mode";
mission4init = true;
_local1 = 4;
while (_local1 <= 7) {
hexState[10][_local1].side = 2;
hexState[10][_local1].strength = 6;
_local1++;
};
hexState[10][4].hasPlayer = true;
HexManager.heroLocation = hexState[10][4];
hexState[1][4].side = 3;
hexState[1][4].strength = 7;
hexState[1][7].side = 3;
hexState[1][7].strength = 7;
hexState[3][4].side = 3;
hexState[3][4].strength = 7;
hexState[3][7].side = 3;
hexState[3][7].strength = 7;
hexState[2][5].side = 3;
hexState[2][5].strength = 7;
if (!tentSquash){
hexState[4][5].side = 3;
hexState[4][5].strength = 7;
};
if (!patrolsDead[8]){
hexState[7][4].side = 3;
hexState[7][4].strength = 4;
};
if (!patrolsDead[9]){
hexState[7][6].side = 3;
hexState[7][6].strength = 4;
};
if (!patrolsDead[10]){
hexState[7][8].side = 3;
hexState[7][8].strength = 4;
};
}
public function displayTurn(){
map.gui.turnnumber.text = ("TURN " + turn);
}
public function showMapMsg(_arg1:String){
map.gui.maptextbox.textbox.text = _arg1;
map.gui.maptextbox.visible = false;
}
public function hideMapMsg(){
map.gui.maptextbox.textbox.text = "";
map.gui.maptextbox.visible = false;
}
public function countTotalHex():int{
var _local1:int;
var _local2:*;
var _local3:*;
var _local4:Hex;
_local1 = 0;
_local2 = 0;
while (_local2 <= 10) {
_local3 = 0;
while (_local3 <= 11) {
_local4 = map.hexgrid.getChildByName(((("hex_" + _local2) + "_") + _local3));
if (_local4 != null){
_local1++;
};
_local3++;
};
_local2++;
};
return (_local1);
}
public function fireAtGate(){
SoundManager.instance.playCrash();
if (gateState >= 25){
gateState = 19;
} else {
if (gateState >= 15){
gateState = 10;
} else {
gateState = 1;
};
};
map.gate.gotoAndStop(gateState);
map.link_18_22.visible = true;
map.link_19_23.visible = true;
map.link_20_24.visible = true;
displayCircles();
}
public function bossDialogClick(){
StatsManager.instance.location = 101;
StatsManager.instance.map.transition.gotoAndPlay(25);
}
public function setRoot(_arg1){
this.root = _arg1;
}
public function playerDialogClick(){
if ((((location == 28)) && (skipFights))){
displayCircles();
return;
};
if (location == 28){
map.transition.gotoAndPlay(25);
} else {
if (mission == 4){
map.gui.hexdialog.visible = true;
};
};
}
public function enemyDialogClick(){
if (skipFights){
displayCircles();
return;
};
map.transition.gotoAndPlay(25);
}
public function displayCircles(){
var _local1:*;
var _local2:MovieClip;
var _local3:*;
map.gui.introanim.visible = false;
if (mission == 4){
displayTurn();
displayHex();
return;
};
stageEnd();
movePlayerIcon();
displayFriendlies();
displayPatrol();
displayTurn();
displayObjective();
map.hexgrid.visible = false;
map.gui.endturnbutton.visible = false;
map.gui.stratinstructionbtn.visible = false;
map.newbanner.visible = banner1taken;
map.newbanner2.visible = banner2taken;
map.newbanner3.visible = false;
map.newbanner4.visible = false;
map.newbanner5.visible = false;
map.newbanner6.visible = false;
map.hexitem.visible = false;
if (!showAll){
_local1 = 0;
while (_local1 <= totalLevels) {
_local2 = MovieClip(map.getChildByName(("circle" + _local1)));
if (!levels[_local1].hasItem){
_local2.chest.visible = false;
};
if (!levels[_local1].visited){
_local2.visible = false;
};
_local1++;
};
_local1 = 0;
while (_local1 <= totalLevels) {
_local3 = 0;
while (_local3 <= totalLevels) {
if (map.getChildByName(((("link_" + _local1) + "_") + _local3)) != null){
if (((!(levels[_local1].visited)) && (!(levels[_local3].visited)))){
map.getChildByName(((("link_" + _local1) + "_") + _local3)).visible = false;
} else {
map.getChildByName(((("link_" + _local1) + "_") + _local3)).visible = true;
};
if (((levels[_local1].visited) || (levels[_local3].visited))){
map.getChildByName(("circle" + _local1)).visible = true;
map.getChildByName(("circle" + _local3)).visible = true;
};
};
_local3++;
};
_local1++;
};
} else {
_local1 = 0;
while (_local1 <= totalLevels) {
_local2 = MovieClip(map.getChildByName(("circle" + _local1)));
if (!levels[_local1].hasItem){
_local2.chest.visible = false;
};
_local1++;
};
};
map.gate.gotoAndStop(gateState);
if (gateState == 25){
if (location < 22){
showPlayerDialog("I am too late. Gate construction is complete. I need to find another way in.");
} else {
showPlayerDialog("I am too late. Gate construction is complete.");
};
};
if (map.gate.currentFrame >= 7){
map.link_20_24.visible = false;
};
if (map.gate.currentFrame >= 15){
map.link_19_23.visible = false;
};
if (map.gate.currentFrame >= 25){
map.link_18_22.visible = false;
map.link_21_28.visible = true;
map.link_27_28.visible = true;
map.circle28.visible = true;
} else {
map.link_21_28.visible = false;
map.link_27_28.visible = false;
map.circle28.visible = false;
};
if (tentSquash){
map.tentsquash.gotoAndStop(2);
};
}
public function addScore(_arg1:int){
totalScore = (totalScore + _arg1);
MovieClip(Player.instance.parent.parent).scoretext.text = ("score " + totalScore);
}
public function getItem(){
map.gui.itemfounddialog.visible = true;
}
public function goTitleStage(){
root.goTitleStage();
}
public function movePatrols(){
var _local1:*;
patrolsLocOld = patrolsLoc.slice();
_local1 = 1;
while (_local1 <= 2) {
switch (patrolsLoc[_local1]){
case 14:
patrolsDown[_local1] = true;
patrolsLoc[_local1] = 12;
break;
case 12:
if (patrolsDown[_local1]){
patrolsLoc[_local1] = 7;
} else {
patrolsLoc[_local1] = 14;
};
break;
case 7:
if (patrolsDown[_local1]){
patrolsLoc[_local1] = 4;
} else {
patrolsLoc[_local1] = 12;
};
break;
case 4:
patrolsDown[_local1] = false;
patrolsLoc[_local1] = 7;
break;
};
_local1++;
};
_local1 = 3;
while (_local1 <= 6) {
switch (patrolsLoc[_local1]){
case 18:
patrolsLoc[_local1] = 15;
break;
case 17:
patrolsLoc[_local1] = 20;
break;
default:
if (patrolsLoc[_local1] < 17){
var _local2 = patrolsLoc;
var _local3 = _local1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
} else {
if (patrolsLoc[_local1] > 18){
_local2 = patrolsLoc;
_local3 = _local1;
_local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
};
};
};
_local1++;
};
}
public function displayObjective(){
map.objective0.visible = (mission == 0);
map.objective1.visible = (mission == 1);
map.objective2.visible = (mission == 2);
map.objective3.visible = (mission == 2);
map.objective4.visible = (mission == 2);
map.objective5.visible = (mission == 4);
}
public function setMap(_arg1:MovieClip){
this.map = _arg1;
if (mission == 4){
moveMap(630);
} else {
if ((((location >= 5)) && ((location <= 14)))){
moveMap(200);
} else {
if ((((location >= 15)) && ((location <= 17)))){
moveMap(400);
} else {
if ((((location >= 18)) && ((location <= 28)))){
moveMap(500);
};
};
};
};
}
public function movePlayerIcon(){
if (MovieClip(map.getChildByName(("circle" + location))).x < MovieClip(map.getChildByName(("circle" + previousLocation))).x){
playerIcon.scaleX = -1;
} else {
playerIcon.scaleX = 1;
};
playerIcon.x = MovieClip(map.getChildByName(("circle" + location))).x;
playerIcon.y = MovieClip(map.getChildByName(("circle" + location))).y;
if (location == 15){
map.playercanvas2.addChild(playerIcon);
} else {
if ((((location == 13)) || ((location >= 18)))){
map.playercanvas.addChild(playerIcon);
};
};
if ((((mission <= 1)) && ((location == 13)))){
map.guardtower.gotoAndStop(3);
};
}
public function checkPlayerMeetPatrols():Boolean{
var _local1:*;
_local1 = 1;
while (_local1 <= 13) {
if ((((((location == patrolsLoc[_local1])) || ((location == patrolsLocOld[_local1])))) && (!(patrolsDead[_local1])))){
patrolsDead[_local1] = true;
engagedPatrol = _local1;
return (true);
};
_local1++;
};
engagedPatrol = -1;
return (false);
}
public function showEnemyDialog(_arg1:String){
map.gui.enemydialog.enemydialog.words.text = _arg1;
map.gui.enemydialog.gotoAndPlay(2);
}
public function loadData(){
var _local1:SharedObject;
_local1 = SharedObject.getLocal("strawhatsamurai");
if (_local1.data.saved == undefined){
trace("No data");
return;
};
arrowAmmo = _local1.data.arrowAmmo;
hp = _local1.data.hp;
gateState = _local1.data.gateState;
tentSquash = _local1.data.tentSquash;
armor = _local1.data.armor;
battlesFought = _local1.data.battlesFought;
totalTiming = _local1.data.totalTiming;
totalKills = _local1.data.totalKills;
totalDeaths = _local1.data.totalDeaths;
totalScore = _local1.data.totalScore;
totalSlashCount = _local1.data.totalSlashCount;
maxCombo = _local1.data.maxCombo;
totalHeadshotCount = _local1.data.totalHeadshotCount;
totalArrowCount = _local1.data.totalArrowCount;
totalArrowHeadShots = _local1.data.totalArrowHeadShots;
totalItems = _local1.data.totalItems;
totalBanners = _local1.data.totalBanners;
turn = _local1.data.turn;
trace(((((turn + " ") + totalBanners) + " ") + totalItems));
}
public function transitionOut(){
stageReset();
root.overworldMode = false;
root.goFightstage();
}
public function strategyMode(){
mission = 4;
bossDefeated = false;
hasBow = true;
arrowAmmo = 3;
hp = 15;
gateState = 10;
tentSquash = false;
loadData();
}
public function moveMap(_arg1:int){
map.y = (map.y + _arg1);
map.uparrow.y = (map.uparrow.y - _arg1);
map.downarrow.y = (map.downarrow.y - _arg1);
map.transition.y = (map.transition.y - _arg1);
map.gui.y = (map.gui.y - _arg1);
map.mask1.y = (map.mask1.y - _arg1);
map.mask2.y = (map.mask2.y - _arg1);
map.mask3.y = (map.mask3.y - _arg1);
}
public function saveData(){
var _local1:SharedObject;
_local1 = SharedObject.getLocal("strawhatsamurai");
_local1.data.saved = true;
_local1.data.arrowAmmo = arrowAmmo;
_local1.data.hp = hp;
_local1.data.gateState = gateState;
_local1.data.tentSquash = tentSquash;
_local1.data.armor = armor;
_local1.data.battlesFought = battlesFought;
_local1.data.totalTiming = totalTiming;
_local1.data.totalKills = totalKills;
_local1.data.totalDeaths = totalDeaths;
_local1.data.totalScore = totalScore;
_local1.data.totalSlashCount = totalSlashCount;
_local1.data.maxCombo = maxCombo;
_local1.data.totalHeadshotCount = totalHeadshotCount;
_local1.data.totalArrowCount = totalArrowCount;
_local1.data.totalArrowHeadShots = totalArrowHeadShots;
_local1.data.totalItems = totalItems;
_local1.data.totalBanners = totalBanners;
_local1.data.turn = turn;
_local1.flush();
}
public function addArrowAmmo(){
arrowAmmo++;
if (arrowAmmo > 10){
arrowAmmo = 10;
};
}
public function gotBanner(){
Player.instance.displayScoreMessage("Banner Converted: +2000");
addScore(2000);
banners++;
if (location == 13){
banner1taken = true;
};
if (getBuildersLeft() == 0){
banner2taken = true;
};
}
public function gotoLevel(_arg1:int){
var _local2:*;
var _local3:*;
if ((((mission <= 1)) && ((((_arg1 == 4)) || ((_arg1 == 12)))))){
map.guardtower.gotoAndStop(2);
showPlayerDialog("I need to take out the guard tower before i can go into the open.");
map.objective0.visible = false;
map.objective1.visible = true;
mission = 1;
return;
};
if (_arg1 < location){
_local2 = _arg1;
_local3 = location;
} else {
_local2 = location;
_local3 = _arg1;
};
if (((!((_local2 == _local3))) && ((map.getChildByName(((("link_" + _local2) + "_") + _local3)) == null)))){
return;
};
if (((!((_local2 == _local3))) && (!(map.getChildByName(((("link_" + _local2) + "_") + _local3)).visible)))){
return;
};
previousLocation = location;
previousScore = totalScore;
previousArrowAmmo = arrowAmmo;
location = _arg1;
nextTurn();
movePlayerIcon();
if (((!(levels[_arg1].visited)) || (checkPlayerMeetPatrols()))){
levels[_arg1].visited = true;
if (playEnemyDialog()){
return;
};
if (!skipFights){
map.transition.gotoAndPlay(25);
} else {
displayCircles();
trace(("fight" + location));
};
} else {
displayCircles();
};
}
public function died(){
if (mission != 4){
if (engagedPatrol == -1){
levels[location].visited = false;
} else {
patrolsDead[engagedPatrol] = false;
};
location = previousLocation;
hp = 10;
} else {
HexManager.died();
hp = 15;
};
totalScore = (totalScore - 10000);
if (totalScore < 0){
totalScore = 0;
};
arrowAmmo = previousArrowAmmo;
totalDeaths++;
banners = 0;
}
public function displayPatrol(){
var _local1:*;
var _local2:*;
if (!showAll){
map.patrol1.visible = false;
map.patrol2.visible = false;
map.patrol3.visible = false;
map.patrol4.visible = false;
map.patrol5.visible = false;
map.patrol6.visible = false;
map.patrol7.visible = false;
map.patrol8.visible = false;
map.patrol9.visible = false;
map.patrol10.visible = false;
map.patrol11.visible = false;
map.patrol12.visible = false;
map.patrol13.visible = false;
} else {
_local1 = 1;
while (_local1 <= 13) {
if (patrolsDead[_local1]){
map.getChildByName(("patrol" + _local1)).visible = false;
};
_local1++;
};
_local1 = 1;
while (_local1 <= 13) {
_local2 = map.getChildByName(("patrol" + _local1));
_local2.x = MovieClip(map.getChildByName(("circle" + patrolsLoc[_local1]))).x;
_local2.y = MovieClip(map.getChildByName(("circle" + patrolsLoc[_local1]))).y;
if ((((_local1 >= 3)) && ((_local1 <= 6)))){
if (patrolsLoc[_local1] < 18){
_local2.scaleX = -1;
} else {
_local2.scaleX = 1;
};
};
_local1++;
};
};
}
public function countFriendlyHex():int{
var _local1:int;
var _local2:*;
var _local3:*;
var _local4:Hex;
_local1 = 0;
_local2 = 0;
while (_local2 <= 10) {
_local3 = 0;
while (_local3 <= 11) {
_local4 = map.hexgrid.getChildByName(((("hex_" + _local2) + "_") + _local3));
if (_local4 != null){
if (_local4.getHexInfo().side == 2){
_local1++;
};
};
_local3++;
};
_local2++;
};
return (_local1);
}
public function displayFriendlies(){
var _local1:*;
map.link_18_38.visible = false;
map.circle38.visible = false;
map.link_4_39.visible = false;
map.circle39.visible = false;
map.linkout1.visible = false;
map.linkout2.visible = false;
map.linkout3.visible = false;
map.friendly1.visible = false;
map.friendly2.visible = false;
map.friendly3.visible = false;
if (showAll){
levels[38].visited = true;
levels[39].visited = true;
};
switch (turn){
case 24:
map.linkout2.visible = true;
map.link_4_39.visible = true;
map.circle39.visible = true;
map.friendly2.visible = true;
map.friendly2.x = map.circle39.x;
map.friendly2.y = map.circle39.y;
break;
case 25:
map.linkout2.visible = true;
map.link_4_39.visible = true;
map.circle39.visible = true;
map.friendly2.visible = true;
map.friendly2.x = map.circle4.x;
map.friendly2.y = map.circle4.y;
patrolsDead[2] = true;
break;
case 26:
map.linkout2.visible = true;
map.link_4_39.visible = true;
map.circle39.visible = true;
map.friendly2.visible = true;
map.friendly2.x = map.circle7.x;
map.friendly2.y = map.circle7.y;
patrolsDead[1] = true;
break;
case 27:
map.linkout2.visible = true;
map.link_4_39.visible = true;
map.circle39.visible = true;
map.friendly2.visible = true;
map.friendly2.x = map.circle12.x;
map.friendly2.y = map.circle12.y;
break;
case 28:
map.linkout2.visible = true;
map.link_4_39.visible = true;
map.circle39.visible = true;
map.friendly2.visible = true;
map.friendly2.x = map.circle14.x;
map.friendly2.y = map.circle14.y;
break;
case 29:
map.linkout2.visible = true;
map.link_4_39.visible = true;
map.circle39.visible = true;
map.friendly2.visible = true;
map.friendly2.x = map.circle16.x;
map.friendly2.y = map.circle16.y;
map.linkout1.visible = true;
map.link_18_38.visible = true;
map.circle38.visible = true;
map.friendly1.visible = true;
map.friendly1.x = map.circle38.x;
map.friendly1.y = map.circle38.y;
map.linkout3.visible = true;
map.friendly3.visible = true;
map.friendly3.x = map.circle21.x;
map.friendly3.y = map.circle21.y;
patrolsDead[7] = true;
break;
};
if (turn >= 30){
_local1 = 1;
while (_local1 <= 7) {
patrolsDead[_local1] = true;
_local1++;
};
map.linkout2.visible = true;
map.link_4_39.visible = true;
map.circle39.visible = true;
map.friendly2.visible = true;
map.friendly2.x = map.circle19.x;
map.friendly2.y = map.circle19.y;
map.linkout1.visible = true;
map.link_18_38.visible = true;
map.circle38.visible = true;
map.friendly1.visible = true;
map.friendly1.x = map.circle18.x;
map.friendly1.y = map.circle18.y;
map.friendly1.scaleX = -1;
map.linkout3.visible = true;
map.friendly3.visible = true;
map.friendly3.x = map.circle20.x;
map.friendly3.y = map.circle20.y;
map.friendly3.scaleX = -1;
};
}
public function displayArrowAmmo(){
MovieClip(Player.instance.parent.parent).arrowammoicon.arrowtext.text = arrowAmmo;
}
public function getBuildersLeft():int{
var _local1:*;
_local1 = 0;
if (!patrolsDead[11]){
_local1++;
};
if (!patrolsDead[12]){
_local1++;
};
if (!patrolsDead[13]){
_local1++;
};
return (_local1);
}
public function stageReset(){
timing = 0;
slashCount = 0;
headshotCount = 0;
arrowCount = 0;
banners = 0;
kills = 0;
arrowHeadShots = 0;
Player.instance.gotoAndStop(1);
Player.instance.player.gotoAndStop(1);
}
public function setPlayerIcon(_arg1:MovieClip){
this.playerIcon = _arg1;
}
public function stageEnd(){
var _local1:*;
updateStats();
if (hasBow){
addArrowAmmo();
addArrowAmmo();
};
map.gui.itemfounddialog.visible = false;
map.gui.bowfounddialog.visible = false;
map.gui.catapultdialog.visible = false;
map.gui.hexdialog.visible = false;
map.gui.stats.visible = false;
switch (location){
case 36:
if (turn == 1){
map.gui.mission.gotoAndPlay(2);
map.gui.introanim.visible = true;
showPlayerDialog("Let's do this!");
};
break;
case 0:
if (turn == 2){
showPlayerDialog("This place is crawling with enemy troops. I need to be careful.");
};
break;
case 1:
if (levels[1].hasItem){
getItem();
levels[1].hasItem = false;
};
break;
case 5:
if (!hasBow){
hasBow = true;
map.gui.bowfounddialog.visible = true;
};
break;
case 6:
if (levels[6].hasItem){
getItem();
levels[6].hasItem = false;
};
break;
case 8:
if (levels[8].hasItem){
getItem();
levels[8].hasItem = false;
};
break;
case 9:
if (levels[9].hasItem){
getItem();
levels[9].hasItem = false;
};
break;
case 13:
mission = 2;
showAll = true;
if (getBuildersLeft() > 0){
showPlayerDialog("I can see everything from up here... those builders need to be eliminated.");
};
levels[4].visited = true;
levels[7].visited = true;
_local1 = 12;
while (_local1 <= 27) {
levels[_local1].visited = true;
_local1++;
};
break;
case 21:
if (levels[21].hasItem){
getItem();
levels[21].hasItem = false;
};
break;
case 27:
if (levels[27].hasItem){
getItem();
levels[27].hasItem = false;
};
break;
case 37:
location = 5;
break;
case 22:
case 23:
case 24:
if ((((getBuildersLeft() == 0)) && ((mission == 2)))){
mission = 3;
map.gui.catapultdialog.visible = true;
if (turn < 24){
showPlayerDialog((("Held enemy at bay for " + (24 - turn)) + " turns"));
turn = 24;
};
if (gateState >= 25){
map.gui.catapultdialog.btn2.visible = false;
};
};
break;
};
if ((((turn > 30)) && ((gateState < 25)))){
mission = 4;
saveData();
trace("State saved");
};
}
}
}//package
Section 155
//stuck_arrow (stuck_arrow)
package {
import flash.display.*;
public dynamic class stuck_arrow extends MovieClip {
public function stuck_arrow(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 156
//sword1 (sword1)
package {
import flash.media.*;
public dynamic class sword1 extends Sound {
}
}//package
Section 157
//sword2 (sword2)
package {
import flash.media.*;
public dynamic class sword2 extends Sound {
}
}//package
Section 158
//sword3 (sword3)
package {
import flash.media.*;
public dynamic class sword3 extends Sound {
}
}//package
Section 159
//tree1 (tree1)
package {
import flash.display.*;
public dynamic class tree1 extends MovieClip {
}
}//package
Section 160
//tree2 (tree2)
package {
import flash.display.*;
public dynamic class tree2 extends MovieClip {
}
}//package