Section 1
//SpecialCharToString (com.flawsome.utils.SpecialCharToString)
package com.flawsome.utils {
public class SpecialCharToString {
public function SpecialCharToString():void{
super();
}
public static function convert(newVal):String{
var line:*;
var string:String = "";
var special:Object = {8:"backspace", 9:"tab", 13:"enter", 16:"shift", 17:"ctrl", 20:"caps", 32:"spacebar", 33:"pgup", 34:"pgdwn", 35:"end", 36:"home", 37:"left", 38:"up", 39:"right", 40:"down", 46:"del", 144:"nmlck", 145:"sclck", 19:"pause", 186:";", 187:"=", 189:"-", 191:"/", 192:"`", 219:"[", 220:"|", 221:"]", 222:"'", 188:",", 190:".", 191:"/", 96:"0", 97:"1", 98:"2", 99:"3", 100:"4", 101:"5", 102:"6", 103:"7", 104:"8", 105:"9", 106:"*", 107:"+", 109:"-", 110:".", 111:"/"};
var specialChar:Boolean;
for (line in special) {
if ((((line == newVal)) && ((specialChar == false)))){
specialChar = true;
string = special[line];
};
};
if (!specialChar){
string = String.fromCharCode(newVal);
};
return (string);
}
}
}//package com.flawsome.utils
Section 2
//KeyObject (com.senocular.utils.KeyObject)
package com.senocular.utils {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class KeyObject extends Proxy {
private static var keysDown:Object;
private static var stage:Stage;
public function KeyObject(stage:Stage){
super();
construct(stage);
}
private function keyReleased(evt:KeyboardEvent):void{
delete keysDown[evt.keyCode];
}
public function deconstruct():void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased);
keysDown = new Object();
KeyObject.stage = null;
}
public function construct(stage:Stage):void{
KeyObject.stage = stage;
keysDown = new Object();
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
}
private function keyPressed(evt:KeyboardEvent):void{
keysDown[evt.keyCode] = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
return (((name in Keyboard)) ? Keyboard[name] : -1);
}
public function isDown(keyCode:uint):Boolean{
return (Boolean((keyCode in keysDown)));
}
}
}//package com.senocular.utils
Section 3
//Sine (fl.motion.easing.Sine)
package fl.motion.easing {
public class Sine {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
}
}//package fl.motion.easing
Section 4
//Btn (game.overheadShooter.configAndMenus.Btn)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
public class Btn extends MovieClip {
public function Btn():void{
super();
alpha = 0;
addEventListener(MouseEvent.MOUSE_OVER, over);
addEventListener(MouseEvent.MOUSE_OUT, out);
addEventListener(MouseEvent.MOUSE_DOWN, down);
}
private function down(evt:Event):void{
MovieClip(root).SFX("sfxMenuPress");
}
private function over(evt:Event):void{
alpha = 0.4;
MovieClip(root).SFX("sfxMenuOver");
}
private function out(evt:Event):void{
alpha = 0;
}
}
}//package game.overheadShooter.configAndMenus
Section 5
//ChangeControl (game.overheadShooter.configAndMenus.ChangeControl)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
public class ChangeControl extends MovieClip {
public function ChangeControl():void{
super();
alpha = 0;
addEventListener(MouseEvent.MOUSE_OVER, over);
addEventListener(MouseEvent.MOUSE_OUT, out);
addEventListener(MouseEvent.MOUSE_DOWN, changeSetup);
}
private function specialCharConversion(newVal):String{
var line:*;
var string:String = "";
var special:Object = {8:"bs", 9:"tab", 13:"enter", 16:"shift", 17:"ctrl", 20:"caps", 32:"sb", 33:"pbup", 34:"pgdwn", 35:"end", 36:"home", 37:"left", 38:"up", 39:"right", 40:"down", 46:"del", 144:"nmlck", 145:"sclck", 19:"pause", 186:";", 187:"=", 189:"-", 191:"/", 192:"`", 219:"[", 220:"|", 221:"]", 222:"'", 188:",", 190:".", 191:"/", 96:"0", 97:"1", 98:"2", 99:"3", 100:"4", 101:"5", 102:"6", 103:"7", 104:"8", 105:"9", 106:"*", 107:"+", 109:"-", 110:".", 111:"/"};
var specialChar:Boolean;
for (line in special) {
if ((((line == newVal)) && ((specialChar == false)))){
specialChar = true;
string = special[line];
};
};
if (!specialChar){
string = String.fromCharCode(newVal);
};
MovieClip(root).delay = 0;
return (string);
}
private function over(evt:Event):void{
alpha = 0.4;
}
private function changeSetup(evt:Event):void{
if (MovieClip(root).delay == 0){
MovieClip(root).delay = 1;
stage.addEventListener(KeyboardEvent.KEY_DOWN, changeControl);
MovieClip(root).MENU.customControls.txtCaption.text = "press any key";
};
}
private function out(evt:Event):void{
alpha = 0;
}
private function changeControl(evt:KeyboardEvent):void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, changeControl);
var control:String = name;
var newVal:Number = evt.keyCode;
var newValCharacter:String = specialCharConversion(newVal);
MovieClip(root).stats[control] = newVal;
MovieClip(root).MENU.customControls.txtCaption.text = ((name + " changed to ") + newValCharacter);
MovieClip(root).MENU.displayCustomControls();
}
}
}//package game.overheadShooter.configAndMenus
Section 6
//Cursor (game.overheadShooter.configAndMenus.Cursor)
package game.overheadShooter.configAndMenus {
import flash.display.*;
public class Cursor extends MovieClip {
public var helper:MovieClip;
public function Cursor():void{
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package game.overheadShooter.configAndMenus
Section 7
//HackSelectScreen (game.overheadShooter.configAndMenus.HackSelectScreen)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class HackSelectScreen extends MovieClip {
public var godMode:MovieClip;
public var ultimaLaser:MovieClip;
public var fancyFeet:MovieClip;
public var txtCaption:TextField;
public var nightmare:MovieClip;
public var btnBack:Btn;
public var mushroom:MovieClip;
public var sloth:MovieClip;
private var hacks:Object;
public var txtDescription:TextField;
public var suicide:MovieClip;
public var blindFold:MovieClip;
public var ultdAmmo:MovieClip;
public var slowKill:MovieClip;
public function HackSelectScreen():void{
super();
}
public function init(setup:Boolean=true){
var hack:*;
hacks = MovieClip(root).stats.hacks;
if (setup){
txtCaption.text = "Select hacks from below";
for (hack in hacks) {
this[hack].txtHackName.text = hack;
this[hack].btn.addEventListener(MouseEvent.MOUSE_OVER, rolloverText);
if (hacks[hack][0] > 0){
this[hack].btn.addEventListener(MouseEvent.MOUSE_UP, activateHack);
this[hack].txtHackName.mouseEnabled = false;
this[hack].alpha = 1;
if (hacks[hack][0] == 1){
this[hack].gotoAndStop("inactive");
};
if (hacks[hack][0] == 2){
this[hack].gotoAndStop("active");
};
} else {
this[hack].alpha = 0.25;
this[hack].gotoAndStop("locked");
};
};
txtDescription.text = "Play through the game to unlock hacks";
} else {
for (hack in hacks) {
this[hack].btn.removeEventListener(MouseEvent.MOUSE_OVER, rolloverText);
this[hack].btn.removeEventListener(MouseEvent.MOUSE_UP, activateHack);
};
};
}
private function rolloverText(evt:MouseEvent):void{
var hack:String = evt.target.parent.name;
var displayText:String = ((hacks[hack][0])>0) ? hacks[hack][1] : hacks[hack][3];
txtDescription.text = displayText;
}
private function activateHack(evt:MouseEvent):void{
var hack:String = evt.target.parent.name;
if (hacks[hack][0] == 1){
hacks[hack][0] = 2;
this[hack].gotoAndStop("active");
} else {
if (hacks[hack][0] == 2){
hacks[hack][0] = 1;
this[hack].gotoAndStop("inactive");
};
};
txtCaption.text = ("Score Multiplier: " + MovieClip(root).stats.scoreMultiplier);
}
}
}//package game.overheadShooter.configAndMenus
Section 8
//HeadsUpDisplay (game.overheadShooter.configAndMenus.HeadsUpDisplay)
package game.overheadShooter.configAndMenus {
import flash.display.*;
import flash.text.*;
public class HeadsUpDisplay extends MovieClip {
public var grenadeBackdrop:MovieClip;
public var healthDisplay:MovieClip;
public var currentGun:MovieClip;
public var currentGrenade:MovieClip;
public var hudWeapon0:MovieClip;
public var hudWeapon1:MovieClip;
public var hudWeapon2:MovieClip;
public var hudWeapon4:MovieClip;
public var hudWeapon5:MovieClip;
public var hudWeapon6:MovieClip;
public var hudWeapon7:MovieClip;
public var hudWeapon8:MovieClip;
public var hudWeapon9:MovieClip;
public var hudWeapon3:MovieClip;
public var bossHealth:MovieClip;
public var txtGrenadeAmmo:TextField;
public var txtGunAmmo:TextField;
public var txtGun:TextField;
public var gunBackdrop:MovieClip;
public var txtGrenade:TextField;
public function HeadsUpDisplay():void{
super();
}
}
}//package game.overheadShooter.configAndMenus
Section 9
//IngameOptions (game.overheadShooter.configAndMenus.IngameOptions)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class IngameOptions extends MovieClip {
public var btnBack:Btn;
public var txt1Name:TextField;
public var txt2Name:TextField;
public var btnEnd:Btn;
public function IngameOptions():void{
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
function Back(evt:Event):void{
MovieClip(root).optionsMenu(false);
}
function End(evt:Event):void{
MovieClip(root).optionsMenu(false, true);
}
public function setup(setup:Boolean):void{
if (setup == true){
this.btnEnd.addEventListener(MouseEvent.CLICK, End);
this.btnEnd.buttonMode = true;
this.btnBack.addEventListener(MouseEvent.CLICK, Back);
this.btnBack.buttonMode = true;
} else {
this.btnEnd.removeEventListener(MouseEvent.CLICK, End);
this.btnEnd.buttonMode = false;
this.btnBack.removeEventListener(MouseEvent.CLICK, Back);
this.btnBack.buttonMode = false;
};
}
}
}//package game.overheadShooter.configAndMenus
Section 10
//IntroScreen (game.overheadShooter.configAndMenus.IntroScreen)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import game.overheadShooter.misc.*;
public class IntroScreen extends MovieClip {
var speed:Number;// = 0
public var txtTitle:TextField;
public var txtDescription:TextField;
public var terrain:MovieClip;
public var heli:Helicopter;
var counter:Number;// = 0
public function IntroScreen():void{
heli = new Helicopter();
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
function displayText():void{
var Title:String = "";
var Description:String = "";
Title = levelTitle();
Description = MovieClip(root).stats.levelInfo[(MovieClip(root).currentLevel + "Description")];
this.txtTitle.text = Title;
this.txtDescription.text = Description;
}
function countdown(evt:Event):void{
counter = (counter + 1);
if (counter > 100){
removeEventListener(Event.ENTER_FRAME, countdown);
MovieClip(root).fadeToLevel();
};
}
function levelTitle():String{
var levelName:String = "";
var indexStartingPoint:Number = 0;
var currentStage:String = MovieClip(root).currentLevel.substr(0, (MovieClip(root).currentLevel.length - 1));
trace(currentStage);
levelName = MovieClip(root).stats.levelInfo[(MovieClip(root).currentLevel + "Title")];
if (currentStage == "marsh"){
indexStartingPoint = 10;
} else {
if (currentStage == "badlands"){
indexStartingPoint = 13;
} else {
if (currentStage == "tundra"){
indexStartingPoint = 11;
} else {
if (currentStage == "hive"){
indexStartingPoint = 8;
};
};
};
};
levelName = levelName.substr(indexStartingPoint, levelName.length);
return (levelName);
}
public function startUp():void{
displayText();
heli.x = 170;
heli.y = 162;
heli.scaleX = 1.85;
heli.scaleY = 1.85;
heli.rotation = 180;
this.addChildAt(heli, 2);
heli.speedUp();
counter = 0;
addEventListener(Event.ENTER_FRAME, countdown);
heli.coast(true);
terrain.gotoAndStop(MovieClip(root).currentLevel);
}
}
}//package game.overheadShooter.configAndMenus
Section 11
//LEVEL (game.overheadShooter.configAndMenus.LEVEL)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.flawsome.utils.*;
import game.overheadShooter.effects.*;
import game.overheadShooter.miniGame.*;
public class LEVEL extends MovieClip {
var Event3:Boolean;// = false
var Event5:Boolean;// = false
var counter:Number;// = 0
var Event1:Boolean;// = false
public var displayTextArray:Array;
var Event6:Boolean;// = false
var Event8:Boolean;// = false
var seconds:Number;// = 0
var Event10:Boolean;// = false
var Event11:Boolean;// = false
var Event12:Boolean;// = false
var Event13:Boolean;// = false
var Event14:Boolean;// = false
var Event15:Boolean;// = false
var Event16:Boolean;// = false
var Event17:Boolean;// = false
var Event18:Boolean;// = false
var Event19:Boolean;// = false
public var terrain:MovieClip;
var Event21:Boolean;// = false
var Event23:Boolean;// = false
var Event25:Boolean;// = false
var Event20:Boolean;// = false
var Event22:Boolean;// = false
var Event24:Boolean;// = false
var Event2:Boolean;// = false
var Event4:Boolean;// = false
var Event7:Boolean;// = false
var Event9:Boolean;// = false
public function LEVEL():void{
displayTextArray = new Array();
super();
addFrameScript(0, frame1);
}
public function hive(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
Event1 = true;
scrollSpeed(-1.5, 0);
};
if ((((seconds > 3)) && ((Event20 == false)))){
interval = (seconds % 20);
if (interval == 4){
spawnMonster("Skeleton", 2);
};
if (interval == 5){
spawnMonster("Skeleton", 3);
};
if (interval == 6){
spawnMonster("Skeleton", 2);
};
if (interval == 7){
spawnMonster("IceFatty", 3);
};
if (interval == 8){
spawnMonster("Goblin", 2);
};
if (interval == 9){
spawnMonster("Skeleton", 3);
};
if (interval == 10){
spawnMonster("MarauderRifle", 2);
};
if (interval == 11){
spawnMonster("MercenaryRifle", 3);
};
if (interval == 12){
spawnMonster("MercenaryRifle", 2);
};
if (interval == 13){
spawnMonster("ToxicSpider", 3);
};
if (interval == 14){
spawnMonster("Spider", 2);
};
if (interval == 15){
spawnMonster("Spider", 3);
};
if (interval == 16){
spawnMonster("Spider", 2);
};
if (interval == 17){
spawnMonster("Skeleton", 3);
};
if (interval == 18){
spawnMonster("Skeleton", 2);
};
};
if (Event21 == true){
interval = (seconds % 19);
if (interval == 1){
spawnMonster("Spider", 3);
};
if (interval == 2){
spawnMonster("Spider", 4);
};
if (interval == 3){
spawnMonster("Demon", 3);
};
if (interval == 4){
spawnMonster("Demon", 4);
};
if (interval == 5){
spawnMonster("GoblinSpear", 3);
};
if (interval == 6){
spawnMonster("HammerOgre", 4);
};
if (interval == 7){
spawnMonster("Goblin", 3);
};
if (interval == 8){
spawnMonster("Spider", 4);
};
if (interval == 9){
spawnMonster("Spider", 3);
};
if (interval == 11){
spawnMonster("HighSkeletonMage", 4);
};
if (interval == 13){
spawnMonster("HighSkeletonMage", 3);
};
if (interval == 14){
spawnMonster("Spider", 4);
};
if (interval == 15){
spawnMonster("Goblin", 3);
};
};
if (Event22 == true){
interval = (seconds % 19);
if (interval == 1){
spawnMonster("MarauderSpikedClub", 4);
};
if (interval == 2){
spawnMonster("MarauderSpikedClub", 1);
};
if (interval == 3){
spawnMonster("MarauderSpikedClub", 4);
};
if (interval == 4){
spawnMonster("MarauderSpikedClub", 1);
};
if (interval == 5){
spawnMonster("MarauderRifle", 4);
};
if (interval == 6){
spawnMonster("SnowFiend", 1);
};
if (interval == 8){
spawnMonster("MercenaryRifle", 4);
};
if (interval == 9){
spawnMonster("MercenaryRifle", 1);
};
if (interval == 11){
spawnMonster("MercenarySword", 4);
};
if (interval == 13){
spawnMonster("MercenarySword", 1);
};
if (interval == 14){
spawnMonster("IceFatty", 4);
};
if (interval == 15){
spawnMonster("IceFatty", 1);
};
};
if (Event23 == true){
interval = (seconds % 19);
if (interval == 1){
spawnMonster("SkeleKnight", 1);
};
if (interval == 2){
spawnMonster("CyborgNinja", 2);
};
if (interval == 3){
spawnMonster("CyborgMarine", 1);
};
if (interval == 5){
spawnMonster("SkeleKnight", 1);
};
if (interval == 6){
spawnMonster("HighSkeletonSwordsman", 2);
};
if (interval == 8){
spawnMonster("HighSkeletonBandit", 1);
};
if (interval == 9){
spawnMonster("HighSkeletonMage", 2);
};
if (interval == 11){
spawnMonster("MercenaryGatling", 1);
};
if (interval == 13){
spawnMonster("CyborgNinja", 2);
};
if (interval == 14){
spawnMonster("HighSkeletonSwordsman", 1);
};
if (interval == 15){
spawnMonster("HighSkeletonBandit", 2);
};
};
if ((((((MovieClip(root).Level.terrain.x <= -852)) && ((Event2 == false)))) && ((Event1 == true)))){
MovieClip(root).Level.terrain.x = -852;
MovieClip(root).Level.terrain.y = 0;
scrollSpeed(-1.1, -1.1);
Event2 = true;
Event13 = false;
};
if ((((((MovieClip(root).Level.terrain.x <= -2068)) && ((Event13 == false)))) && ((Event2 == true)))){
MovieClip(root).Level.terrain.x = -2068;
scrollSpeed(0, 0);
Event13 = true;
Event3 = false;
Event20 = true;
};
if ((((((Event13 == true)) && ((Event3 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
caption((("Rotation " + (MovieClip(root).stats.hiveTemp + 1)) + "\n1/4 Complete"), 3);
scrollSpeed(0, -1.5);
Event4 = false;
Event3 = true;
Event21 = true;
counter = 0;
seconds = 0;
};
if ((((((MovieClip(root).Level.terrain.y <= -2761)) && ((Event4 == false)))) && ((Event3 == true)))){
MovieClip(root).Level.terrain.x = -2068;
MovieClip(root).Level.terrain.y = -2761;
scrollSpeed(1.1, -1.1);
Event4 = true;
Event15 = false;
};
if ((((((MovieClip(root).Level.terrain.y <= -3977)) && ((Event15 == false)))) && ((Event4 == true)))){
MovieClip(root).Level.terrain.y = -3977;
scrollSpeed(0, 0);
Event15 = true;
Event5 = false;
Event21 = false;
};
if ((((((Event15 == true)) && ((Event5 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
caption((("Rotation " + (MovieClip(root).stats.hiveTemp + 1)) + "\n2/4 Complete"), 3);
scrollSpeed(1.5, 0);
Event6 = false;
Event5 = true;
Event22 = true;
counter = 0;
seconds = 0;
};
if ((((((MovieClip(root).Level.terrain.x >= 868)) && ((Event6 == false)))) && ((Event5 == true)))){
MovieClip(root).Level.terrain.x = 868;
MovieClip(root).Level.terrain.y = -3977;
scrollSpeed(1.1, 1.1);
Event6 = true;
Event17 = false;
};
if ((((((MovieClip(root).Level.terrain.x >= 2084)) && ((Event17 == false)))) && ((Event6 == true)))){
MovieClip(root).Level.terrain.x = 2084;
scrollSpeed(0, 0);
Event17 = true;
Event7 = false;
Event22 = false;
};
if ((((((Event17 == true)) && ((Event7 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
caption((("Rotation " + (MovieClip(root).stats.hiveTemp + 1)) + "\n3/4 Complete"), 3);
scrollSpeed(0, 1.5);
Event8 = false;
Event7 = true;
Event23 = true;
counter = 0;
seconds = 0;
};
if ((((((MovieClip(root).Level.terrain.y >= -1216)) && ((Event8 == false)))) && ((Event7 == true)))){
MovieClip(root).Level.terrain.x = 2084;
MovieClip(root).Level.terrain.y = -1216;
scrollSpeed(-1.1, 1.1);
Event8 = true;
Event19 = false;
};
if ((((((MovieClip(root).Level.terrain.y >= 0)) && ((Event19 == false)))) && ((Event8 == true)))){
MovieClip(root).Level.terrain.y = 0;
scrollSpeed(0, 0);
Event19 = true;
Event9 = false;
Event23 = false;
};
if ((((((Event19 == true)) && ((Event9 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
scrollSpeed(-1.5, 0);
Event9 = true;
Event2 = false;
Event20 = false;
counter = 0;
seconds = 0;
MovieClip(root).stats.hiveTemp++;
if (MovieClip(root).stats.hiveTemp > MovieClip(root).stats.hiveRotations){
MovieClip(root).stats.hiveRotations = MovieClip(root).stats.hiveTemp;
caption(("New Highscore!\nHive rotations: " + MovieClip(root).stats.hiveTemp), 3);
if (MovieClip(root).stats.levelInfo.hiveUnlocked != 4){
MovieClip(root).stats.levelInfo.hiveUnlocked = 4;
MovieClip(root).stats.stagesComplete++;
MovieClip(root).stats.progressPoints++;
};
if (MovieClip(root).stats.levelInfo.miniGame4Unlocked == 1){
caption((((((("New Highscore!\nHive rotations: " + MovieClip(root).stats.hiveTemp) + "\n\nSecret Mission ") + String.fromCharCode(222)) + "The Last Stand") + String.fromCharCode(222)) + " Unlocked!"), 3);
MovieClip(root).stats.levelInfo.miniGame4Unlocked = 2;
MovieClip(root).stats.secretMissionsUnlocked++;
MovieClip(root).stats.progressPoints++;
};
} else {
caption(((("Hive rotations: " + MovieClip(root).stats.hiveTemp) + "\nRecord: ") + MovieClip(root).stats.hiveRotations), 3);
};
Event24 = true;
};
if ((((Event24 == true)) && ((seconds > 4)))){
Event24 = false;
MovieClip(root).char.slowPlayer();
caption("You grow tired...", 2);
};
}
public function marsh2(evt:Event):void{
var interval:Number;
var intervals:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
interval = (seconds % 24);
if (interval == 0){
spawnMonster("Spider", 3);
};
if (interval == 3){
spawnMonster("Skeleton", 3);
};
if (interval == 6){
spawnMonster("Spider", 3);
};
if (interval == 7){
spawnMonster("Spider", 3);
};
if (interval == 10){
spawnMonster("Spider", 3);
};
if (interval == 15){
spawnMonster("ToxicSpider", 3);
};
if (interval == 19){
spawnMonster("Spider", 3);
};
if (interval == 22){
spawnMonster("Spider", 3);
};
};
if ((((seconds > 3)) && ((Event2 == false)))){
Event2 = true;
scrollSpeed(0, -0.75);
};
if ((((MovieClip(root).Level.terrain.y < -1900)) && ((Event3 == false)))){
Event1 = true;
Event3 = true;
scrollSpeed(0, 0);
counter = 0;
seconds = 0;
setMusic("boss");
};
if ((((Event3 == true)) && ((Event4 == false)))){
intervals = (seconds % 14);
if (intervals == 0){
spawnMonster("Skeleton");
};
if (intervals == 2){
spawnMonster("Skeleton");
};
if (intervals == 4){
spawnMonster("Skeleton");
};
if (intervals == 6){
spawnMonster("Skeleton");
};
if (intervals == 8){
spawnMonster("Skeleton");
};
if (intervals == 10){
spawnMonster("Skeleton");
};
if (intervals == 12){
spawnMonster("Skeleton");
};
if (intervals == 13){
Event4 = true;
};
};
if ((((Event4 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, marsh2);
heliPickup();
};
}
public function badlands2(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
Event1 = true;
scrollSpeed(-3.5, 0);
};
if ((((MovieClip(root).Level.terrain.x <= -700)) && ((Event3 == false)))){
Event3 = true;
scrollSpeed(-0.6, 0);
};
if ((((Event3 == true)) && ((Event4 == false)))){
interval = (seconds % 5);
if (interval == 0){
spawnMonster("MarauderSpikedClub");
};
if (interval == 2){
spawnMonster("MarauderSpikedClub");
};
};
if ((((MovieClip(root).Level.terrain.x <= -1000)) && ((Event4 == false)))){
Event4 = true;
};
if ((((Event4 == true)) && ((Event5 == false)))){
interval = (seconds % 9);
if (interval == 0){
spawnMonster("MarauderRifle");
};
if (interval == 3){
spawnMonster("MarauderSpikedClub");
};
if (interval == 6){
spawnMonster("MarauderSpikedClub");
};
};
if ((((MovieClip(root).Level.terrain.x <= -1300)) && ((Event5 == false)))){
Event5 = true;
};
if ((((Event5 == true)) && ((Event6 == false)))){
interval = (seconds % 9);
if (interval == 0){
spawnMonster("MarauderRifle");
};
if (interval == 2){
spawnMonster("MarauderRifle");
};
if (interval == 4){
spawnMonster("MarauderSpikedClub");
};
};
if ((((MovieClip(root).Level.terrain.x <= -1510)) && ((Event6 == false)))){
Event6 = true;
setMusic("boss");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderGatling");
spawnMonster("MarauderGatling");
spawnMonster("MarauderRifle");
scrollSpeed(0, 0);
};
if ((((Event6 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, badlands2);
heliPickup();
};
}
public function badlands4(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
scrollSpeed(-0.6, 0);
Event1 = true;
};
if ((((seconds > 3)) && ((Event2 == false)))){
interval = (seconds % 22);
if (interval == 4){
spawnMonster("CyborgNinja");
};
if (interval == 8){
spawnMonster("CyborgMarine");
};
if (interval == 12){
spawnMonster("CyborgMarine");
};
};
if ((((MovieClip(root).Level.terrain.x <= -1510)) && ((Event2 == false)))){
Event2 = true;
scrollSpeed(0, 0);
};
if ((((((Event2 == true)) && ((Event3 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
counter = 0;
seconds = 0;
Event3 = true;
setMusic("threat", 1);
caption("Threat Detected", 2);
};
if ((((Event3 == true)) && ((Event4 == false)))){
interval = (seconds % 4);
if (interval == 3){
Event4 = true;
};
};
if ((((((Event4 == true)) && ((MovieClip(root).monsterArray.length == 0)))) && ((Event5 == false)))){
spawnMonster("CyborgBoss");
setMusic("boss");
Event5 = true;
};
if ((((Event5 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, badlands4);
heliPickup();
};
}
public function scrollSpeed(X:Number, Y:Number):void{
MovieClip(root).scrollSpeedX = X;
MovieClip(root).scrollSpeedY = Y;
}
public function tundra2(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
Event1 = true;
scrollSpeed(0, -1);
};
if ((((seconds > 3)) && ((Event2 == false)))){
interval = (seconds % 39);
if (interval == 4){
spawnMonster("Spider", 2);
};
if (interval == 5){
spawnMonster("Spider", 4);
};
if (interval == 6){
spawnMonster("Spider", 2);
};
if (interval == 7){
spawnMonster("Spider", 4);
};
if (interval == 14){
spawnMonster("SkeleKnight", 3);
};
if (interval == 15){
spawnMonster("SkeleKnight", 3);
};
if (interval == 16){
spawnMonster("IceFatty", 3);
};
if (interval == 20){
spawnMonster("SkeleKnight", 3);
};
if (interval == 22){
spawnMonster("SkeleKnight", 3);
};
if (interval == 27){
spawnMonster("SnowFiend", 3);
};
if (interval == 30){
spawnMonster("SkeleKnight", 3);
};
if (interval == 33){
spawnMonster("SkeleKnight", 3);
};
if (interval == 36){
spawnMonster("SkeleKnight", 3);
};
if (interval == 37){
spawnMonster("IceFatty", 3);
};
if (interval == 39){
spawnMonster("IceFatty", 3);
};
};
if ((((MovieClip(root).Level.terrain.y <= -1623)) && ((Event2 == false)))){
scrollSpeed(0, 0);
Event2 = true;
};
if ((((((Event2 == true)) && ((Event3 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
counter = 0;
seconds = 0;
Event3 = true;
setMusic("threat", 1);
caption("Threat Detected", 2);
};
if ((((Event3 == true)) && ((Event4 == false)))){
interval = (seconds % 4);
if (interval == 3){
Event4 = true;
};
};
if ((((((Event4 == true)) && ((MovieClip(root).monsterArray.length == 0)))) && ((Event5 == false)))){
Event5 = true;
setMusic("boss");
spawnMonster("WyrmBoss");
};
if ((((Event5 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, tundra2);
heliPickup();
};
}
public function badlands1(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
interval = (seconds % 3);
if (interval == 0){
spawnMonster("Demon");
};
};
if ((((seconds > 3)) && ((Event2 == false)))){
Event2 = true;
scrollSpeed(-0.5, 0);
};
if ((((MovieClip(root).Level.terrain.x <= -790)) && ((Event1 == false)))){
Event1 = true;
scrollSpeed(0, 0);
};
if ((((((Event1 == true)) && ((MovieClip(root).monsterArray.length == 0)))) && ((Event3 == false)))){
spawnMonster("HammerOgre");
spawnMonster("HammerOgre");
setMusic("boss");
Event3 = true;
};
if ((((Event3 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, badlands1);
heliPickup();
};
}
public function badlands3(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
interval = (seconds % 14);
if (interval == 4){
caption("Ambush!", 2);
setMusic("threat");
spawnMonster("Goblin");
};
if (interval == 5){
spawnMonster("Goblin");
};
if (interval == 6){
spawnMonster("GoblinSpear");
};
if (interval == 7){
setMusic("boss");
spawnMonster("Goblin");
};
if (interval == 8){
spawnMonster("GoblinSpear");
};
if (interval == 9){
spawnMonster("Goblin");
};
if (interval == 10){
spawnMonster("GoblinSpear");
};
if (interval == 12){
spawnMonster("Demon");
};
if (interval == 13){
spawnMonster("Demon");
Event1 = true;
};
};
if ((((((Event1 == true)) && ((MovieClip(root).monsterArray.length == 0)))) && ((Event2 == false)))){
setMusic("stage");
spawnMonster("HammerOgre", 2);
scrollSpeed(-0.6, 0);
counter = 0;
seconds = 0;
Event2 = true;
};
if ((((Event2 == true)) && ((Event3 == false)))){
interval = (seconds % 24);
if (interval == 3){
spawnMonster("Goblin", 2);
};
if (interval == 6){
spawnMonster("GoblinSpear", 2);
};
if (interval == 8){
spawnMonster("SpikeDemon", 2);
};
if (interval == 11){
spawnMonster("Goblin", 2);
};
if (interval == 13){
spawnMonster("Demon", 2);
};
if (interval == 15){
spawnMonster("Goblin", 2);
};
if (interval == 18){
spawnMonster("Goblin", 2);
};
if (interval == 22){
spawnMonster("Demon", 2);
};
if (interval == 23){
spawnMonster("Goblin", 2);
};
};
if ((((MovieClip(root).Level.terrain.x <= -1510)) && ((Event3 == false)))){
Event3 = true;
scrollSpeed(0, 0);
};
if ((((Event3 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, badlands3);
heliPickup();
};
}
public function tundra1(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
Event1 = true;
scrollSpeed(0, -0.6);
};
if ((((seconds > 3)) && ((Event2 == false)))){
interval = (seconds % 39);
if (interval == 4){
spawnMonster("MercenarySword", 3);
};
if (interval == 5){
spawnMonster("MercenarySword", 3);
};
if (interval == 6){
MovieClip(root).addMonster("Civilian", (320 + (60 * Math.random())), 570);
};
if (interval == 10){
spawnMonster("MercenarySword", 3);
};
if (interval == 12){
spawnMonster("MercenarySword", 3);
};
if (interval == 14){
spawnMonster("MercenaryGatling", 3);
};
if (interval == 16){
MovieClip(root).addMonster("Civilian", (310 + (80 * Math.random())), 570);
};
if (interval == 18){
spawnMonster("MercenaryRifle", 3);
};
if (interval == 22){
spawnMonster("MercenaryRifle", 3);
};
if (interval == 24){
spawnMonster("MercenarySword", 3);
};
if (interval == 30){
spawnMonster("MercenaryGatling", 3);
};
if (interval == 33){
spawnMonster("MercenaryRifle", 3);
};
if (interval == 36){
spawnMonster("MercenaryRifle", 3);
};
if (interval == 37){
spawnMonster("MercenarySword", 3);
};
};
if ((((MovieClip(root).Level.terrain.y <= -2834)) && ((Event2 == false)))){
scrollSpeed(0, 0);
Event2 = true;
};
if ((((Event2 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, tundra1);
heliPickup();
};
}
public function tundra4(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
Event1 = true;
scrollSpeed(0, -1);
};
if ((((Event1 == true)) && ((Event2 == false)))){
interval = (seconds % 8);
if (interval == 0){
spawnMonster("SkeleKnight", 3);
};
if (interval == 2){
spawnMonster("HighSkeletonSwordsman", 3);
};
if (interval == 4){
spawnMonster("SkeleKnight", 3);
};
if (interval == 6){
spawnMonster("HighSkeletonSwordsman", 3);
};
if (interval == 5){
spawnMonster("IceFatty", 3);
};
};
if ((((MovieClip(root).Level.terrain.y <= -500)) && ((Event2 == false)))){
scrollSpeed(0, 0);
Event2 = true;
};
if ((((((Event2 == true)) && ((Event3 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
Event3 = true;
spawnMonster("SnowFiend", 2);
spawnMonster("SnowFiend", 4);
spawnMonster("HighSkeletonArcher", 1);
spawnMonster("SkeleKnight", 1);
spawnMonster("HighSkeletonArcher", 3);
spawnMonster("SkeleKnight", 3);
};
if ((((((Event3 == true)) && ((Event4 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
Event4 = true;
scrollSpeed(0, -1.5);
};
if ((((Event4 == true)) && ((Event5 == false)))){
interval = (seconds % 2);
if (interval == 0){
spawnMonster("SkeleKnight", 3);
};
};
if ((((MovieClip(root).Level.terrain.y <= -1040)) && ((Event5 == false)))){
Event5 = true;
scrollSpeed(0, 0);
};
if ((((((Event5 == true)) && ((Event6 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
counter = 0;
seconds = 0;
Event6 = true;
setMusic("threat", 1);
caption("Threat Detected", 2);
};
if ((((Event6 == true)) && ((Event7 == false)))){
interval = (seconds % 4);
if (interval == 3){
Event7 = true;
};
};
if ((((((Event7 == true)) && ((MovieClip(root).monsterArray.length == 0)))) && ((Event8 == false)))){
Event8 = true;
setMusic("boss");
spawnMonster("DemonGod");
};
if ((((Event8 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, tundra4);
heliPickup();
};
}
function tundra8(evt:Event):void{
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
Event1 = true;
spawnMonster("CyborgBoss");
setMusic("boss");
};
if ((((Event1 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, tundra1);
heliPickup();
};
}
function ping(X:Number, Y:Number):void{
var here:Point = new Point(X, Y);
MovieClip(root).screenPing(here);
}
function resetCounter():void{
counter = 0;
seconds = 0;
}
public function tundra3(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((MovieClip(root).Level.terrain.y >= 0)))){
scrollSpeed(0, -1.5);
};
if (MovieClip(root).Level.terrain.y <= -950){
scrollSpeed(0, 1.5);
};
if ((((seconds > 3)) && ((Event1 == false)))){
interval = (seconds % 60);
if (interval == 4){
spawnMonster("SkeleKnight", 4);
};
if (interval == 5){
spawnMonster("SkeleKnight", 4);
};
if (interval == 6){
spawnMonster("SkeleKnight", 4);
};
if (interval == 15){
spawnMonster("SnowFiend", 4);
};
if (interval == 20){
spawnMonster("SkeleKnight", 4);
};
if (interval == 22){
spawnMonster("IceFatty", 4);
};
if (interval == 24){
spawnMonster("SkeleKnight", 4);
};
if (interval == 25){
spawnMonster("HighSkeletonArcher", 4);
};
if (interval == 26){
spawnMonster("HighSkeletonArcher", 4);
};
if (interval == 32){
spawnMonster("SnowFiend", 4);
};
if (interval == 36){
spawnMonster("SkeleKnight", 4);
};
if (interval == 37){
spawnMonster("IceFatty", 4);
};
if (interval == 40){
spawnMonster("HighSkeletonSwordsman", 4);
};
if (interval == 50){
spawnMonster("SnowFiend", 4);
};
if (interval == 58){
spawnMonster("Spider", 4);
};
if (interval == 59){
spawnMonster("Spider", 4);
};
};
if ((((seconds > 120)) && ((Event1 == false)))){
Event1 = true;
};
if ((((Event1 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
scrollSpeed(0, 0);
this.removeEventListener(Event.ENTER_FRAME, tundra3);
heliPickup();
};
}
public function startLevel():void{
if (MovieClip(root).currentLevel == "special - whatever"){
} else {
MovieClip(root).spawnPlayer(316, 262);
if (MovieClip(root).normalLevel()){
MovieClip(root).heliExit(370, 262);
};
};
reset();
stage.focus = this;
MovieClip(root).stats.success = false;
MovieClip(root).stats.currentBounty = MovieClip(root).stats.levelInfo[(MovieClip(root).currentLevel + "Bounty")];
this.addEventListener(Event.ENTER_FRAME, this[MovieClip(root).currentLevel]);
}
public function removeMiniGameListeners():void{
removeEventListener(Event.ENTER_FRAME, miniGame2);
removeEventListener(Event.ENTER_FRAME, miniGame3);
}
public function reset():void{
counter = 0;
seconds = 0;
Event1 = false;
Event2 = false;
Event3 = false;
Event4 = false;
Event5 = false;
Event6 = false;
Event7 = false;
Event8 = false;
Event9 = false;
Event10 = false;
Event11 = false;
Event12 = false;
Event13 = false;
Event14 = false;
Event15 = false;
Event16 = false;
Event17 = false;
Event18 = false;
Event19 = false;
Event20 = false;
Event21 = false;
Event22 = false;
Event23 = false;
Event24 = false;
Event25 = false;
scrollSpeed(0, 0);
MovieClip(root).stats.resetCurrentStats();
}
function heliPickup():void{
MovieClip(root).char.castrate();
MovieClip(root).stats.success = true;
MovieClip(root).heliEnter();
MovieClip(root).gameMouseSetup(false);
}
public function marsh1(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
Event1 = true;
caption((((((((("Use " + SpecialCharToString.convert(MovieClip(root).stats.moveUp)) + ", ") + SpecialCharToString.convert(MovieClip(root).stats.moveLeft)) + ", ") + SpecialCharToString.convert(MovieClip(root).stats.moveDown)) + ", ") + SpecialCharToString.convert(MovieClip(root).stats.moveRight)) + " to move around."), 3);
};
if ((((seconds > 7)) && ((Event2 == false)))){
Event2 = true;
caption("Hold the left mouse button down for automatic fire.", 4);
};
if ((((seconds > 12)) && ((Event3 == false)))){
Event3 = true;
caption("Enemies may spawn from any location. Kill them before they kill you.", 4);
};
if ((((seconds > 17)) && ((Event4 == false)))){
Event4 = true;
spawnMonster("Skeleton", undefined, "laser");
};
if ((((((MovieClip(root).monsterArray.length == (0 > 0))) && ((Event5 == false)))) && ((Event4 == true)))){
Event5 = true;
caption("Some enemies drop weapons or\nhealth items.", 3);
};
if ((((((Event5 == true)) && ((Event6 == false)))) && ((MovieClip(root).pickupArray.length == 0)))){
resetCounter();
Event6 = true;
caption("The laser gun has been added to your HUD.", 3);
ping(65, 45);
};
if ((((((Event6 == true)) && ((Event7 == false)))) && ((seconds > 4)))){
Event7 = true;
Event8 = true;
caption((("Press " + SpecialCharToString.convert(MovieClip(root).stats.nextGun)) + " to switch guns."), 3);
};
if ((((((Event8 == true)) && ((Event9 == false)))) && ((seconds > 8)))){
Event9 = true;
caption("Watch out!", 1);
spawnMonster("Spider", undefined, "nothing");
};
if ((((((Event9 == true)) && ((Event10 == false)))) && ((seconds > 9)))){
Event10 = true;
spawnMonster("Spider", undefined, "poison");
};
if ((((((((Event10 == true)) && ((Event11 == false)))) && ((MovieClip(root).pickupArray.length == 0)))) && ((MovieClip(root).monsterArray.length == 0)))){
resetCounter();
Event11 = true;
caption("You just picked up some poison grenades.", 3);
ping(535, 490);
};
if ((((((Event11 == true)) && ((Event12 == false)))) && ((seconds > 4)))){
Event12 = true;
caption("Hitting an enemy with one of these will poison them, causing passive damage.", 4);
};
if ((((((Event12 == true)) && ((Event13 == false)))) && ((seconds > 9)))){
Event13 = true;
caption((("Toss a poison grenade using " + SpecialCharToString.convert(MovieClip(root).stats.throwGrenade)) + "."), 3);
};
if ((((((Event13 == true)) && ((Event14 == false)))) && ((seconds > 13)))){
Event14 = true;
caption("As you play, and become injured, blood will fill up the screen.", 4);
};
if ((((((Event14 == true)) && ((Event15 == false)))) && ((seconds > 14)))){
Event15 = true;
MovieClip(root).char.damage(-100, 0, 0);
MovieClip(root).char.damage(20, 0, 0);
};
if ((((((Event15 == true)) && ((Event16 == false)))) && ((seconds > 15)))){
Event16 = true;
MovieClip(root).char.damage(20, 0, 0);
};
if ((((((Event16 == true)) && ((Event17 == false)))) && ((seconds > 16)))){
Event17 = true;
MovieClip(root).char.damage(20, 0, 0);
};
if ((((((Event17 == true)) && ((Event18 == false)))) && ((seconds > 17)))){
Event18 = true;
MovieClip(root).char.damage(20, 0, 0);
};
if ((((((Event18 == true)) && ((Event19 == false)))) && ((seconds > 18)))){
Event19 = true;
caption("If blood fills up the entire screen you die.", 3);
};
if ((((((Event19 == true)) && ((Event20 == false)))) && ((seconds > 22)))){
Event20 = true;
MovieClip(root).char.damage(-100, 0, 0);
caption("Good luck.", 2);
};
if ((((((Event20 == true)) && ((Event21 == false)))) && ((seconds > 25)))){
interval = (seconds % 6);
if (interval == 0){
spawnMonster("Spider");
};
if (interval == 3){
spawnMonster("Skeleton");
};
};
if ((((((Event20 == true)) && ((Event22 == false)))) && ((seconds > 25)))){
Event22 = true;
scrollSpeed(0, -0.5);
};
if ((((MovieClip(root).Level.terrain.y < -540)) && ((Event21 == false)))){
Event21 = true;
scrollSpeed(0, 0);
};
if ((((((Event21 == true)) && ((Event23 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
Event23 = true;
caption("View/edit a full list of controls from the main menu.", 4);
resetCounter();
};
if ((((Event23 == true)) && ((seconds > 4)))){
this.removeEventListener(Event.ENTER_FRAME, marsh1);
heliPickup();
};
}
function spawnMonster(monsterType:String, side=undefined, gift:String=""):void{
MovieClip(root).addMonster(monsterType, undefined, undefined, side, gift);
}
public function marsh3(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
interval = (seconds % 20);
if (interval == 3){
spawnMonster("Spider", 3);
};
if (interval == 4){
spawnMonster("Goblin", 3);
};
if (interval == 6){
spawnMonster("Goblin", 3);
};
if (interval == 9){
spawnMonster("Goblin", 3);
};
if (interval == 11){
spawnMonster("GoblinSpear", 3);
};
if (interval == 13){
spawnMonster("Spider", 3);
};
if (interval == 16){
spawnMonster("Goblin", 3);
};
if (interval == 19){
spawnMonster("Goblin", 3);
};
};
if ((((seconds > 3)) && ((Event2 == false)))){
Event2 = true;
scrollSpeed(0, -1.5);
};
if ((((MovieClip(root).Level.terrain.y < -2500)) && ((Event1 == false)))){
Event1 = true;
};
if ((((Event1 == true)) && ((Event3 == false)))){
interval = (seconds % 20);
if (interval == 0){
spawnMonster("Goblin", 3);
};
if (interval == 1){
spawnMonster("Goblin", 3);
};
if (interval == 3){
spawnMonster("Spider", 3);
};
if (interval == 7){
spawnMonster("GoblinSpear", 3);
};
if (interval == 11){
spawnMonster("Goblin", 3);
};
if (interval == 12){
spawnMonster("ToxicSpider", 3);
};
if (interval == 13){
spawnMonster("ToxicSpider", 3);
};
if (interval == 15){
spawnMonster("Goblin", 3);
};
if (interval == 17){
spawnMonster("Spider", 3);
};
if (interval == 18){
spawnMonster("Spider", 3);
};
if (interval == 19){
spawnMonster("Goblin", 3);
};
};
if ((((MovieClip(root).Level.terrain.y < -3260)) && ((Event3 == false)))){
Event3 = true;
scrollSpeed(0, 0);
counter = 0;
seconds = 0;
};
if ((((Event3 == true)) && ((Event4 == false)))){
interval = (seconds % 5);
if (interval == 0){
spawnMonster("Spider");
};
if (interval == 1){
spawnMonster("Spider");
};
if (interval == 2){
spawnMonster("Spider");
};
if (interval == 3){
spawnMonster("Spider");
};
if (interval == 4){
spawnMonster("Spider");
Event4 = true;
};
};
if ((((((Event4 == true)) && ((Event5 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
counter = 0;
seconds = 0;
Event5 = true;
setMusic("threat", 1);
caption("Threat Detected", 2);
};
if ((((Event5 == true)) && ((Event6 == false)))){
interval = (seconds % 4);
if (interval == 3){
Event6 = true;
};
};
if ((((((Event6 == true)) && ((Event7 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
setMusic("boss");
spawnMonster("SpiderBoss");
Event7 = true;
};
if ((((Event7 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, marsh3);
heliPickup();
};
}
public function marsh4(evt:Event):void{
var interval:Number;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
interval = (seconds % 43);
if (interval == 5){
spawnMonster("HighSkeletonSwordsman", 3);
};
if (interval == 6){
spawnMonster("HighSkeletonSwordsman", 3);
};
if (interval == 7){
spawnMonster("HighSkeletonSwordsman", 3);
};
if (interval == 8){
spawnMonster("HighSkeletonSwordsman", 3);
};
if (interval == 13){
spawnMonster("HighSkeletonArcher", 3);
};
if (interval == 14){
spawnMonster("HighSkeletonArcher", 3);
};
if (interval == 15){
spawnMonster("HighSkeletonBandit", 3);
};
if (interval == 20){
spawnMonster("HighSkeletonSwordsman", 3);
};
if (interval == 21){
spawnMonster("HighSkeletonSwordsman", 3);
};
if (interval == 22){
spawnMonster("HighSkeletonMage", 3);
};
if (interval == 26){
spawnMonster("HighSkeletonSwordsman", 3);
};
if (interval == 29){
spawnMonster("HighSkeletonBandit", 3);
};
if (interval == 31){
spawnMonster("HighSkeletonBandit", 3);
};
if (interval == 34){
spawnMonster("HighSkeletonMage", 3);
};
if (interval == 35){
spawnMonster("HighSkeletonMage", 3);
};
if (interval == 36){
spawnMonster("HighSkeletonSwordsman", 3);
};
};
if ((((seconds > 3)) && ((Event2 == false)))){
Event2 = true;
scrollSpeed(0, -1);
};
if ((((MovieClip(root).Level.terrain.y < -3260)) && ((Event3 == false)))){
Event1 = true;
Event3 = true;
scrollSpeed(0, 0);
};
if ((((((Event3 == true)) && ((Event4 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
counter = 0;
seconds = 0;
Event4 = true;
setMusic("threat", 1);
caption("Threat Detected", 2);
};
if ((((Event4 == true)) && ((Event5 == false)))){
interval = (seconds % 4);
if (interval == 3){
Event5 = true;
};
};
if ((((((Event5 == true)) && ((MovieClip(root).monsterArray.length == 0)))) && ((Event6 == false)))){
setMusic("boss");
spawnMonster("BossSkeleMage");
Event6 = true;
};
if ((((Event6 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
this.removeEventListener(Event.ENTER_FRAME, marsh4);
heliPickup();
};
}
private function setMusic(type:String, loops:Number=2147483647, killPrevious:Boolean=true):void{
MovieClip(root).setMusic(type, loops, killPrevious);
}
function frame1(){
stop();
}
public function caption(words:String, seconds:Number):void{
var displayIndex:Number = 0;
while (displayTextArray.length > 0) {
displayTextArray[displayIndex].Remove();
displayIndex = (displayIndex + 1);
};
var txt:DisplayText = new DisplayText(words, seconds);
displayTextArray.push(txt);
MovieClip(root).addChild(txt);
}
public function miniGame1(evt:Event):void{
var interval:Number;
var dropLocation:Point;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 1)) && ((Event1 == false)))){
Event1 = true;
caption(("Zombies eat brains\nHighscore: " + MovieClip(root).stats.totalKills.zombie), 3);
};
if (seconds > 3){
interval = (seconds % 20);
if (interval == 4){
spawnMonster("Zombie");
};
};
if (((((seconds % 60) == 59)) && ((MovieClip(root).char.speed > 2)))){
MovieClip(root).char.slowPlayer();
caption("You grow tired...", 2);
dropLocation = new Point(Math.min(Math.max((700 * Math.random()), 100), 600), Math.min(Math.max((525 * Math.random()), 100), 425));
MovieClip(root).dropGoodies(dropLocation.x, dropLocation.y, "scatter");
ping(dropLocation.x, dropLocation.y);
};
}
public function miniGame2(evt:Event):void{
var minigame:MiniGame2;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 1)) && ((Event1 == false)))){
setMusic("stage");
Event1 = true;
caption(("Welcome to Nuclear Hitman\nHighscore: " + MovieClip(root).stats.totalKills.assassinationLevel), 3);
};
if ((((seconds > 4)) && ((Event2 == false)))){
Event2 = true;
caption("Use the movement keys to guide a missile into the demon enemies", 4);
};
if ((((seconds > 8)) && ((Event3 == false)))){
Event3 = true;
caption("Avoid civilians", 2);
};
if ((((seconds > 8)) && ((Event4 == false)))){
Event4 = true;
minigame = new MiniGame2();
MovieClip(root).addChild(minigame);
minigame.init();
};
}
public function miniGame4(evt:Event):void{
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 3)) && ((Event1 == false)))){
caption("Wave 1", 2);
counter = 0;
seconds = 0;
Event1 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event1 == true)))) && ((Event2 == false)))){
Event2 = true;
setMusic("stage");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderSpikedClub");
spawnMonster("MarauderRifle");
spawnMonster("MarauderRifle");
};
if ((((((Event2 == true)) && ((Event3 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 1){
MovieClip(root).stats.totalKills.wavesComplete = 1;
};
caption("Wave 2", 2);
counter = 0;
seconds = 0;
Event3 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event3 == true)))) && ((Event4 == false)))){
Event4 = true;
setMusic("stage");
spawnMonster("Demon");
spawnMonster("Demon");
spawnMonster("Demon");
spawnMonster("Demon");
spawnMonster("Demon");
spawnMonster("Demon");
spawnMonster("GoblinSpear");
spawnMonster("Goblin");
spawnMonster("Goblin");
spawnMonster("Goblin");
};
if ((((((Event4 == true)) && ((Event5 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 2){
MovieClip(root).stats.totalKills.wavesComplete = 2;
};
caption("Wave 3", 2);
counter = 0;
seconds = 0;
Event5 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event5 == true)))) && ((Event6 == false)))){
Event6 = true;
setMusic("stage");
spawnMonster("IceFatty");
spawnMonster("IceFatty");
spawnMonster("IceFatty");
spawnMonster("IceFatty");
spawnMonster("HammerOgre");
spawnMonster("MercenarySword");
spawnMonster("MercenarySword");
spawnMonster("MercenarySword");
spawnMonster("MercenarySword");
spawnMonster("MercenarySword");
};
if ((((((Event6 == true)) && ((Event7 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 3){
MovieClip(root).stats.totalKills.wavesComplete = 3;
};
caption("Wave 4", 2);
counter = 0;
seconds = 0;
Event7 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event7 == true)))) && ((Event8 == false)))){
Event8 = true;
setMusic("stage");
spawnMonster("HighSkeletonBandit");
spawnMonster("HighSkeletonBandit");
spawnMonster("HighSkeletonBandit");
spawnMonster("HighSkeletonBandit");
spawnMonster("Skeleton");
spawnMonster("Skeleton");
spawnMonster("Skeleton");
spawnMonster("Skeleton");
spawnMonster("Skeleton");
spawnMonster("Skeleton");
};
if ((((((Event8 == true)) && ((Event9 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 4){
MovieClip(root).stats.totalKills.wavesComplete = 4;
};
caption("Wave 5", 2);
counter = 0;
seconds = 0;
Event9 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event9 == true)))) && ((Event10 == false)))){
Event10 = true;
setMusic("stage");
spawnMonster("MercenaryRifle");
spawnMonster("MercenaryRifle");
spawnMonster("MarauderRifle");
spawnMonster("MarauderRifle");
spawnMonster("MarauderGatling");
spawnMonster("MarauderGatling");
spawnMonster("MercenaryGatling");
spawnMonster("MercenaryGatling");
};
if ((((((Event10 == true)) && ((Event11 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 5){
MovieClip(root).stats.totalKills.wavesComplete = 5;
};
caption("Wave 6", 2);
counter = 0;
seconds = 0;
Event11 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event11 == true)))) && ((Event12 == false)))){
Event12 = true;
setMusic("stage");
spawnMonster("HighSkeletonSwordsman");
spawnMonster("HighSkeletonSwordsman");
spawnMonster("HighSkeletonSwordsman");
spawnMonster("HighSkeletonSwordsman");
spawnMonster("HighSkeletonArcher");
spawnMonster("HighSkeletonMage");
spawnMonster("HighSkeletonBandit");
spawnMonster("HighSkeletonMage");
spawnMonster("HighSkeletonArcher");
spawnMonster("HighSkeletonArcher");
};
if ((((((Event12 == true)) && ((Event13 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 6){
MovieClip(root).stats.totalKills.wavesComplete = 6;
};
caption("Wave 7", 2);
counter = 0;
seconds = 0;
Event13 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event13 == true)))) && ((Event14 == false)))){
Event14 = true;
setMusic("stage");
spawnMonster("HammerOgre");
spawnMonster("HammerOgre");
spawnMonster("HammerOgre");
spawnMonster("SpikeDemon");
spawnMonster("SpikeDemon");
};
if ((((((Event14 == true)) && ((Event15 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 7){
MovieClip(root).stats.totalKills.wavesComplete = 7;
};
caption("Wave 8", 2);
counter = 0;
seconds = 0;
Event15 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event15 == true)))) && ((Event16 == false)))){
Event16 = true;
setMusic("stage");
spawnMonster("SkeleKnight");
spawnMonster("SkeleKnight");
spawnMonster("SkeleKnight");
spawnMonster("SkeleKnight");
spawnMonster("MercenaryGatling");
spawnMonster("MercenaryGatling");
spawnMonster("SnowFiend");
spawnMonster("SnowFiend");
spawnMonster("HighSkeletonMage");
spawnMonster("HighSkeletonMage");
};
if ((((((Event16 == true)) && ((Event17 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 8){
MovieClip(root).stats.totalKills.wavesComplete = 8;
};
caption("Wave 9", 2);
counter = 0;
seconds = 0;
Event17 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event17 == true)))) && ((Event18 == false)))){
Event18 = true;
setMusic("stage");
spawnMonster("CyborgNinja");
spawnMonster("CyborgNinja");
spawnMonster("CyborgNinja");
spawnMonster("CyborgNinja");
spawnMonster("CyborgMarine");
spawnMonster("CyborgMarine");
spawnMonster("CyborgMarine");
spawnMonster("CyborgMarine");
};
if ((((((Event18 == true)) && ((Event19 == false)))) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 9){
MovieClip(root).stats.totalKills.wavesComplete = 9;
};
caption("Wave 10\nFinal Wave", 2);
counter = 0;
seconds = 0;
Event19 = true;
setMusic("threat", 1);
};
if ((((((seconds > 3)) && ((Event19 == true)))) && ((Event20 == false)))){
Event20 = true;
setMusic("boss");
spawnMonster("BossSkeleMage");
spawnMonster("CyborgBoss");
spawnMonster("CyborgMarine");
spawnMonster("CyborgNinja");
spawnMonster("Demon");
spawnMonster("DemonGod");
spawnMonster("EggSac");
spawnMonster("Goblin");
spawnMonster("GoblinSpear");
spawnMonster("HammerOgre");
spawnMonster("HighSkeletonArcher");
spawnMonster("HighSkeletonBandit");
spawnMonster("HighSkeletonMage");
spawnMonster("HighSkeletonSwordsman");
spawnMonster("IceFatty");
spawnMonster("MarauderGatling");
spawnMonster("MarauderRifle");
spawnMonster("MercenaryGatling");
spawnMonster("MercenaryRifle");
spawnMonster("MercenarySword");
spawnMonster("SkeleKnight");
spawnMonster("Skeleton");
spawnMonster("SnowFiend");
spawnMonster("Spider");
spawnMonster("SpiderBoss");
spawnMonster("SpikeDemon");
spawnMonster("ToxicSpider");
spawnMonster("WyrmBoss");
};
if ((((Event20 == true)) && ((MovieClip(root).monsterArray.length == 0)))){
if (MovieClip(root).stats.totalKills.wavesComplete < 10){
MovieClip(root).stats.totalKills.wavesComplete = 10;
};
if ((((MovieClip(root).stats.hacks.blindFold[0] == 0)) && (MovieClip(root).stats.scoreMultiplier))){
MovieClip(root).stats.hacks.blindFold[0] = 1;
MovieClip(root).stats.hacksUnlocked = (MovieClip(root).stats.hacksUnlocked + 1);
MovieClip(root).stats.progressPoints = (MovieClip(root).stats.progressPoints + 1);
MovieClip(root).Level.caption("Blind-Fold Challenge Unlocked!\n\n(Toggle Hacks in the Options Menu)", 4);
};
this.removeEventListener(Event.ENTER_FRAME, miniGame4);
heliPickup();
};
}
public function miniGame3(evt:Event):void{
var minigame:MiniGame3;
counter = (counter + 1);
seconds = (counter / 31);
if ((((seconds > 1)) && ((Event1 == false)))){
setMusic("stage");
Event1 = true;
caption(("Welcome to Civilian Brutality\nHighscore: " + MovieClip(root).stats.totalKills.civiliansBrutalized), 3);
};
if ((((seconds > 4)) && ((Event2 == false)))){
Event2 = true;
caption("Use the movement keys to control the tank", 3);
};
if ((((seconds > 7)) && ((Event3 == false)))){
Event3 = true;
caption("Shoot missiles with the mouse", 3);
};
if ((((seconds > 10)) && ((Event4 == false)))){
Event4 = true;
caption("Kill as many civilians as you can!", 3);
};
if ((((seconds > 10)) && ((Event5 == false)))){
Event5 = true;
minigame = new MiniGame3();
MovieClip(root).addChild(minigame);
minigame.init();
};
}
}
}//package game.overheadShooter.configAndMenus
Section 12
//LoadSaveMenu (game.overheadShooter.configAndMenus.LoadSaveMenu)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.text.*;
public class LoadSaveMenu extends MovieClip {
public var slot1Info:TextField;
public var slot3Info:TextField;
public var slot4Info:TextField;
public var slot2Info:TextField;
public var slot2Options:MovieClip;
public var slot4Date:TextField;
public var txtCaption:TextField;
public var slot4Options:MovieClip;
public var slot1Date:TextField;
public var slot2Date:TextField;
public var slot3Date:TextField;
private var currentSlot:String;
public var btnBack:Btn;
public var slot3Options:MovieClip;
public var slot1Options:MovieClip;
public var slot1:Btn;
public var slot2:Btn;
public var slot3:Btn;
public var slot4:Btn;
public function LoadSaveMenu():void{
super();
}
public function init(startup:Boolean=true, caption:String="select a slot to save/load"):void{
if (startup){
txtCaption.text = caption;
setup("slot1");
setup("slot2");
setup("slot3");
setup("slot4");
btnBack.visible = true;
btnBack.addEventListener(MouseEvent.MOUSE_DOWN, back);
} else {
close("slot1");
close("slot2");
close("slot3");
close("slot4");
MovieClip(root).MENU.main(true);
};
}
private function showOptions():void{
this[(currentSlot + "Info")].visible = false;
this[(currentSlot + "Date")].visible = false;
this[(currentSlot + "Options")].visible = true;
this[(currentSlot + "Options")].btnLoad.addEventListener(MouseEvent.MOUSE_DOWN, loadGame);
this[(currentSlot + "Options")].btnSave.addEventListener(MouseEvent.MOUSE_DOWN, saveGame);
this[(currentSlot + "Options")].btnCancel.addEventListener(MouseEvent.MOUSE_DOWN, hideOptions);
}
private function back(evt:Event):void{
btnBack.removeEventListener(MouseEvent.MOUSE_DOWN, back);
init(false);
}
private function checkSlot(evt:MouseEvent):void{
var slot:String = evt.target.name;
currentSlot = slot;
var so:SharedObject = SharedObject.getLocal("operationOnslaught");
if (so.data[slot]){
trace("slot occupied");
slot1.visible = false;
slot2.visible = false;
slot3.visible = false;
slot4.visible = false;
btnBack.visible = false;
showOptions();
} else {
trace("slot empty");
saveGame();
};
}
private function saveGame(evt:Event=null):void{
trace("Saving");
MovieClip(root).stats.WriteData(currentSlot, true);
hideOptions();
init(true, "game data saved");
MovieClip(root).SFX("sfxPickup");
}
private function close(slot:String):void{
this[slot].visible = true;
this[(slot + "Options")].visible = false;
this[slot].removeEventListener(MouseEvent.MOUSE_DOWN, checkSlot);
}
private function hideOptions(evt:Event=null):void{
this[(currentSlot + "Info")].visible = true;
this[(currentSlot + "Date")].visible = true;
this[(currentSlot + "Options")].visible = false;
this[(currentSlot + "Options")].btnLoad.removeEventListener(MouseEvent.MOUSE_DOWN, loadGame);
this[(currentSlot + "Options")].btnSave.removeEventListener(MouseEvent.MOUSE_DOWN, saveGame);
this[(currentSlot + "Options")].btnCancel.removeEventListener(MouseEvent.MOUSE_DOWN, hideOptions);
init();
}
private function setup(slot:String):void{
var score:Number;
var currentDate:Date;
var months:Array;
this[slot].visible = true;
this[(slot + "Options")].visible = false;
this[slot].addEventListener(MouseEvent.MOUSE_DOWN, checkSlot);
var so:SharedObject = SharedObject.getLocal("operationOnslaught");
if (so.data[slot]){
score = (((so.data[slot].score + (so.data[slot].score * so.data[slot].hiveRotations)) + (so.data[slot].totalKills.zombie * so.data[slot].totalKills.assassinationLevel)) + ((so.data[slot].totalKills.civiliansBrutalized * so.data[slot].totalKills.wavesComplete) * 10));
this[(slot + "Info")].text = (((((((((((((("current score: " + score) + "\n") + so.data[slot].progressPoints) + "/") + MovieClip(root).stats.progressMax) + " things unlocked\n") + so.data[slot].totalKills.total) + " monsters killed\nrescued ") + so.data[slot].deaths) + " times\n") + Math.floor(((so.data[slot].progressPoints / MovieClip(root).stats.progressMax) * 100))) + "% complete\n") + so.data[slot].credits) + " credits");
currentDate = so.data.dates[slot];
months = ["Jan.", "Feb.", "March", "April", "May", "June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."];
this[(slot + "Date")].text = ((((months[currentDate.getMonth()] + " ") + currentDate.date) + ", ") + currentDate.getFullYear());
} else {
this[(slot + "Info")].text = "";
this[(slot + "Date")].text = "empty slot";
};
}
private function loadGame(evt:Event=null):void{
trace("Loading");
MovieClip(root).stats.WriteData(currentSlot, false);
hideOptions();
init(true, "game data loaded");
MovieClip(root).SFX("sfxPickup");
}
}
}//package game.overheadShooter.configAndMenus
Section 13
//LoopingMenuTerrain (game.overheadShooter.configAndMenus.LoopingMenuTerrain)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
public class LoopingMenuTerrain extends MovieClip {
public var terrainLoop:MovieClip;
public function LoopingMenuTerrain():void{
super();
x = ((-(width) / 3) - 500);
y = (-(height) / 3);
addEventListener(Event.ENTER_FRAME, loopTerrain);
}
function loopTerrain(evt:Event):void{
this.terrainLoop.y = (this.terrainLoop.y - 2);
if (this.terrainLoop.y <= -((terrainLoop.height / 3))){
this.terrainLoop.y = 0;
};
}
}
}//package game.overheadShooter.configAndMenus
Section 14
//MainMenu (game.overheadShooter.configAndMenus.MainMenu)
package game.overheadShooter.configAndMenus {
import gs.*;
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.geom.*;
import fl.motion.easing.*;
import flash.net.*;
import flash.ui.*;
public class MainMenu extends MovieClip {
public var selectOptions:MovieClip;
public var currentStage:String;// = ""
public var levelMarsh:Point;
public var levelTundra:Point;
public var selectShop:MovieClip;
public var levelHive:Point;
public var autosaveMenu:MovieClip;
public var customControls:MovieClip;
public var loadSaveLocation:Point;
public var selectStage:MovieClip;
public var intro:MovieClip;
public var optionsLocation:Point;
public var secretLocation:Point;
public var controlsLocation:Point;
public var mainLocation:Point;
public var selectLoadSave:LoadSaveMenu;
public var levelSelect:Point;
public var stats:MovieClip;
public var levelBadlands:Point;
public var stageOverLocation:Point;
public var shopLocation:Point;
public var selectSecret:MovieClip;
var time:Number;// = 1
public var selectMain:MovieClip;
public var selectHacks:HackSelectScreen;
var store:Shop;
public var campaignLocation:Point;
public var selectLevel:MovieClip;
public var stageOver:MovieClip;
public function MainMenu():void{
mainLocation = new Point(0, 0);
campaignLocation = new Point(1400, 1050);
secretLocation = new Point(-1400, -1050);
loadSaveLocation = new Point(0, 1050);
optionsLocation = new Point(1400, -1050);
shopLocation = new Point(-1400, 1050);
stageOverLocation = new Point(0, -1050);
levelMarsh = new Point(2800, 2100);
levelBadlands = new Point(0, 2100);
levelTundra = new Point(2800, 0);
levelHive = new Point(0, 0);
levelSelect = new Point(0, 0);
controlsLocation = new Point(2800, 0);
store = new Shop();
super();
this.y = -525;
}
function btnQuality(evt:Event):void{
if (stage.quality.toString() == "LOW"){
stage.quality = StageQuality.MEDIUM;
} else {
if (stage.quality.toString() == "MEDIUM"){
stage.quality = StageQuality.HIGH;
} else {
if (stage.quality.toString() == "HIGH"){
stage.quality = StageQuality.LOW;
};
};
};
selectOptions.txtCaption.text = ("Current quality: " + stage.quality.toString());
}
function checkUnlocked(level:String):String{
var numStages:Number = 0;
if (level != "hive"){
if (MovieClip(root).stats.levelInfo[(level + "1Unlocked")] == 4){
numStages++;
};
if (MovieClip(root).stats.levelInfo[(level + "2Unlocked")] == 4){
numStages++;
};
if (MovieClip(root).stats.levelInfo[(level + "3Unlocked")] == 4){
numStages++;
};
if (MovieClip(root).stats.levelInfo[(level + "4Unlocked")] == 4){
numStages++;
};
return ((numStages + "/4 stages complete"));
} else {
};
return (!NULL!);
}
public function campaign(setup:Boolean):void{
if (setup == true){
fxIn(campaignLocation);
stageCheck("marsh");
stageCheck("badlands");
stageCheck("tundra");
hiveCheck("hive");
selectStage.txt1Bounty.text = checkUnlocked("marsh");
selectStage.txt2Bounty.text = checkUnlocked("badlands");
selectStage.txt3Bounty.text = checkUnlocked("tundra");
selectStage.txt4Bounty.text = checkUnlocked("hive");
this.selectStage.btnMarsh.addEventListener(MouseEvent.CLICK, btnMarsh);
this.selectStage.btnMarsh.buttonMode = true;
this.selectStage.btnBadlands.addEventListener(MouseEvent.CLICK, btnBadlands);
this.selectStage.btnBadlands.buttonMode = true;
this.selectStage.btnTundra.addEventListener(MouseEvent.CLICK, btnTundra);
this.selectStage.btnTundra.buttonMode = true;
this.selectStage.btnHive.addEventListener(MouseEvent.CLICK, btnHive);
this.selectStage.btnHive.buttonMode = true;
this.selectStage.btnBackFromCampaign.addEventListener(MouseEvent.CLICK, btnBackFromCampaign);
this.selectStage.btnBackFromCampaign.buttonMode = true;
} else {
this.selectStage.btnMarsh.removeEventListener(MouseEvent.CLICK, btnMarsh);
this.selectStage.btnMarsh.buttonMode = false;
this.selectStage.btnBadlands.removeEventListener(MouseEvent.CLICK, btnBadlands);
this.selectStage.btnBadlands.buttonMode = false;
this.selectStage.btnTundra.removeEventListener(MouseEvent.CLICK, btnTundra);
this.selectStage.btnTundra.buttonMode = false;
this.selectStage.btnHive.removeEventListener(MouseEvent.CLICK, btnHive);
this.selectStage.btnHive.buttonMode = false;
this.selectStage.btnBackFromCampaign.removeEventListener(MouseEvent.CLICK, btnBackFromCampaign);
this.selectStage.btnBackFromCampaign.buttonMode = false;
};
}
function checkStatus(levelName:String, levelLevel:String){
if (MovieClip(root).stats.levelInfo[((levelName + levelLevel) + "Unlocked")] == 1){
this.selectLevel[("levelThumb" + levelLevel)].status.gotoAndStop("locked");
};
if (MovieClip(root).stats.levelInfo[((levelName + levelLevel) + "Unlocked")] == 2){
this.selectLevel[("levelThumb" + levelLevel)].status.gotoAndPlay("unlocked");
};
if (MovieClip(root).stats.levelInfo[((levelName + levelLevel) + "Unlocked")] > 2){
this.selectLevel[("levelThumb" + levelLevel)].status.gotoAndStop("open");
};
}
function bountyCheck(level:String, stageNum:Number):String{
if (MovieClip(root).stats.levelInfo[((level + stageNum) + "Unlocked")] == 4){
return ("Completed");
};
return ((MovieClip(root).stats.levelInfo[((level + stageNum) + "Bounty")] + " credit bounty"));
}
function levelthumb4roll(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "4Unlocked")] > 1){
this.selectLevel.txtCaption.text = "Difficulty Level: Insane";
} else {
this.selectLevel.txtCaption.text = "Level Locked";
};
}
public function lbClose():void{
Mouse.hide();
selectOptions.scoreBtns.campaign.addEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.hive.addEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.miniGame1.addEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.miniGame2.addEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.miniGame3.addEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.miniGame4.addEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.campaign.buttonMode = true;
selectOptions.scoreBtns.hive.buttonMode = true;
selectOptions.scoreBtns.miniGame1.buttonMode = true;
selectOptions.scoreBtns.miniGame2.buttonMode = true;
selectOptions.scoreBtns.miniGame3.buttonMode = true;
selectOptions.scoreBtns.miniGame4.buttonMode = true;
this.selectOptions.btnControls.addEventListener(MouseEvent.CLICK, btnControls);
this.selectOptions.btnControls.buttonMode = true;
this.selectOptions.btnSpecials.addEventListener(MouseEvent.CLICK, btnSpecials);
this.selectOptions.btnSpecials.buttonMode = true;
this.selectOptions.btnQuality.addEventListener(MouseEvent.CLICK, btnQuality);
this.selectOptions.btnQuality.buttonMode = true;
this.selectOptions.showScores.btn.addEventListener(MouseEvent.CLICK, showScores);
this.selectOptions.showScores.btn.buttonMode = true;
this.selectOptions.btnBackFromOptions.addEventListener(MouseEvent.CLICK, btnBackFromOptions);
this.selectOptions.btnBackFromOptions.buttonMode = true;
}
private function checkLockStatus(levelName:String):Boolean{
var activated:Boolean;
if (MovieClip(root).stats.levelInfo[(levelName + "Unlocked")] == 2){
activated = true;
};
return (activated);
}
private function specialCharConversion(newVal):String{
var line:*;
var string:String = "";
var special:Object = {8:"bs", 9:"tab", 13:"enter", 16:"shift", 17:"ctrl", 20:"caps", 32:"sb", 33:"pbup", 34:"pgdwn", 35:"end", 36:"home", 37:"left", 38:"up", 39:"right", 40:"down", 46:"del", 144:"nmlck", 145:"sclck", 19:"pause", 186:";", 187:"=", 189:"-", 191:"/", 192:"`", 219:"[", 220:"|", 221:"]", 222:"'", 188:",", 190:".", 191:"/", 96:"0", 97:"1", 98:"2", 99:"3", 100:"4", 101:"5", 102:"6", 103:"7", 104:"8", 105:"9", 106:"*", 107:"+", 109:"-", 110:".", 111:"/"};
var specialChar:Boolean;
for (line in special) {
if ((((line == newVal)) && ((specialChar == false)))){
specialChar = true;
string = special[line];
};
};
if (!specialChar){
string = String.fromCharCode(newVal);
};
MovieClip(root).delay = 0;
return (string);
}
function btnBackFromOptions(evt:Event):void{
options(false);
main(true);
}
function btnControls(evt:Event):void{
options(false);
controls(true);
}
function levelTitle(levelNumber:String):String{
var levelName:String = "";
var indexStartingPoint:Number = 0;
levelName = MovieClip(root).stats.levelInfo[((currentStage + levelNumber) + "Title")];
if (currentStage == "marsh"){
indexStartingPoint = 10;
} else {
if (currentStage == "badlands"){
indexStartingPoint = 13;
} else {
if (currentStage == "tundra"){
indexStartingPoint = 11;
} else {
if (currentStage == "hive"){
indexStartingPoint = 8;
};
};
};
};
trace(("test pls levelName: " + levelName));
trace(("test pls indexStartingPoint: " + indexStartingPoint));
levelName = levelName.substr(indexStartingPoint, levelName.length);
return (levelName);
}
function levelthumb2roll(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "2Unlocked")] > 1){
this.selectLevel.txtCaption.text = "Difficulty Level: Medium";
} else {
this.selectLevel.txtCaption.text = "Level Locked";
};
}
function btnMarsh(evt:Event):void{
if (MovieClip(root).stats.levelInfo["marsh1Unlocked"] > 1){
campaign(false);
level("marsh");
};
}
function backFromSpecials(evt:Event):void{
options(true);
specials(false);
}
function btnSecret(evt:Event):void{
main(false);
secret(true);
}
public function btnBackFromShop(evt:Event):void{
shop(false);
main(true);
}
function secretthumb2roll(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "2Unlocked")] > 1){
this.selectSecret.txtCaption.text = "Guide a Nuke";
} else {
this.selectSecret.txtCaption.text = "Level Locked";
};
}
function launchSecret(level:String):void{
MovieClip(root).currentLevel = (currentStage + level);
MovieClip(root).launchIntro();
}
function secretthumb4roll(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "4Unlocked")] > 1){
this.selectSecret.txtCaption.text = "Certain Doom";
} else {
this.selectSecret.txtCaption.text = "Level Locked";
};
}
private function enterMenu(evt:Event=null):void{
autosaveMenu.slot2.removeEventListener(MouseEvent.MOUSE_DOWN, enterMenu);
autosaveMenu.slot1.removeEventListener(MouseEvent.MOUSE_DOWN, loadAutosave);
main(true);
}
function btnSpecials(evt:Event):void{
options(false);
specials(true);
}
public function secretOld(setup:Boolean):void{
if (setup == true){
fxIn(secretLocation);
this.selectSecret.btnSecret1.addEventListener(MouseEvent.CLICK, btnSecret1);
this.selectSecret.btnSecret1.buttonMode = true;
this.selectSecret.btnSecret2.addEventListener(MouseEvent.CLICK, btnSecret2);
this.selectSecret.btnSecret2.buttonMode = true;
this.selectSecret.btnSecret3.addEventListener(MouseEvent.CLICK, btnSecret3);
this.selectSecret.btnSecret3.buttonMode = true;
this.selectSecret.btnSecret4.addEventListener(MouseEvent.CLICK, btnSecret4);
this.selectSecret.btnSecret4.buttonMode = true;
this.selectSecret.btnBackFromSecret.addEventListener(MouseEvent.CLICK, btnBackFromSecret);
this.selectSecret.btnBackFromSecret.buttonMode = true;
} else {
this.selectSecret.btnSecret1.removeEventListener(MouseEvent.CLICK, btnSecret1);
this.selectSecret.btnSecret1.buttonMode = false;
this.selectSecret.btnSecret2.removeEventListener(MouseEvent.CLICK, btnSecret2);
this.selectSecret.btnSecret2.buttonMode = false;
this.selectSecret.btnSecret3.removeEventListener(MouseEvent.CLICK, btnSecret3);
this.selectSecret.btnSecret3.buttonMode = false;
this.selectSecret.btnSecret4.removeEventListener(MouseEvent.CLICK, btnSecret4);
this.selectSecret.btnSecret4.buttonMode = false;
this.selectSecret.btnBackFromSecret.removeEventListener(MouseEvent.CLICK, btnBackFromSecret);
this.selectSecret.btnBackFromSecret.buttonMode = false;
};
}
function btnLoad(evt:Event):void{
main(false);
loadSave(true);
}
function btnShop(evt:Event):void{
main(false);
shop(true);
}
function hiveCheck(levelName:String){
if (MovieClip(root).stats.levelInfo[(levelName + "Unlocked")] == 1){
this.selectStage[(levelName + "Status")].gotoAndStop("locked");
} else {
if (MovieClip(root).stats.levelInfo[(levelName + "Unlocked")] == 2){
this.selectStage[(levelName + "Status")].gotoAndPlay("unlocked");
} else {
this.selectStage[(levelName + "Status")].gotoAndStop("open");
};
};
}
public function lbDisplay(showMouse:Boolean=true):void{
if (showMouse){
Mouse.show();
};
selectOptions.scoreBtns.campaign.removeEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.hive.removeEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.miniGame1.removeEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.miniGame2.removeEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.miniGame3.removeEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.miniGame4.removeEventListener(MouseEvent.CLICK, launchLeaderboard);
selectOptions.scoreBtns.campaign.buttonMode = false;
selectOptions.scoreBtns.hive.buttonMode = false;
selectOptions.scoreBtns.miniGame1.buttonMode = false;
selectOptions.scoreBtns.miniGame2.buttonMode = false;
selectOptions.scoreBtns.miniGame3.buttonMode = false;
selectOptions.scoreBtns.miniGame4.buttonMode = false;
this.selectOptions.btnControls.removeEventListener(MouseEvent.CLICK, btnControls);
this.selectOptions.btnControls.buttonMode = false;
this.selectOptions.btnSpecials.removeEventListener(MouseEvent.CLICK, btnSpecials);
this.selectOptions.btnSpecials.buttonMode = false;
this.selectOptions.btnQuality.removeEventListener(MouseEvent.CLICK, btnQuality);
this.selectOptions.btnQuality.buttonMode = false;
this.selectOptions.showScores.btn.removeEventListener(MouseEvent.CLICK, showScores);
this.selectOptions.showScores.btn.buttonMode = false;
this.selectOptions.btnBackFromOptions.removeEventListener(MouseEvent.CLICK, btnBackFromOptions);
this.selectOptions.btnBackFromOptions.buttonMode = false;
}
function setup(evt:Event):void{
selectLevel.x = -2800;
selectLevel.y = -2100;
}
private function showScores(evt:Event):void{
selectOptions.showScores.visible = false;
selectOptions.scoreBtns.visible = true;
}
function btnBadlands(evt:Event):void{
if (MovieClip(root).stats.levelInfo["badlands1Unlocked"] > 1){
campaign(false);
level("badlands");
};
}
public function loadSave(setup:Boolean):void{
if (setup == true){
fxIn(loadSaveLocation);
this.selectLoadSave.init();
};
}
public function level(levelName:String):void{
MovieClip(root).menuCursor.blip();
if (levelName == "marsh"){
currentStage = "marsh";
levelSelect.x = levelMarsh.x;
levelSelect.y = levelMarsh.y;
};
if (levelName == "badlands"){
currentStage = "badlands";
levelSelect.x = levelBadlands.x;
levelSelect.y = levelBadlands.y;
};
if (levelName == "tundra"){
currentStage = "tundra";
levelSelect.x = levelTundra.x;
levelSelect.y = levelTundra.y;
};
if (levelName == "hive"){
currentStage = "hive";
levelSelect.x = levelHive.x;
levelSelect.y = levelHive.y;
};
var setup:Boolean;
if (levelName == ""){
setup = false;
};
if (setup == true){
selectLevel.visible = true;
selectLevel.x = -(levelSelect.x);
selectLevel.y = -(levelSelect.y);
fxIn(levelSelect);
this.selectLevel.levelThumb1.gotoAndStop((levelName + "1"));
this.selectLevel.levelThumb2.gotoAndStop((levelName + "2"));
this.selectLevel.levelThumb3.gotoAndStop((levelName + "3"));
this.selectLevel.levelThumb4.gotoAndStop((levelName + "4"));
this.selectLevel.leveltxt1.text = levelTitle("1");
this.selectLevel.leveltxt2.text = levelTitle("2");
this.selectLevel.leveltxt3.text = levelTitle("3");
this.selectLevel.leveltxt4.text = levelTitle("4");
selectLevel.txt1Bounty.text = bountyCheck(levelName, 1);
selectLevel.txt2Bounty.text = bountyCheck(levelName, 2);
selectLevel.txt3Bounty.text = bountyCheck(levelName, 3);
selectLevel.txt4Bounty.text = bountyCheck(levelName, 4);
checkStatus(levelName, "1");
checkStatus(levelName, "2");
checkStatus(levelName, "3");
checkStatus(levelName, "4");
this.selectLevel.btnLevel1.addEventListener(MouseEvent.CLICK, levelthumb1);
this.selectLevel.btnLevel1.addEventListener(MouseEvent.ROLL_OVER, levelthumb1roll);
this.selectLevel.btnLevel1.buttonMode = true;
this.selectLevel.btnLevel2.addEventListener(MouseEvent.CLICK, levelthumb2);
this.selectLevel.btnLevel2.addEventListener(MouseEvent.ROLL_OVER, levelthumb2roll);
this.selectLevel.btnLevel2.buttonMode = true;
this.selectLevel.btnLevel3.addEventListener(MouseEvent.CLICK, levelthumb3);
this.selectLevel.btnLevel3.addEventListener(MouseEvent.ROLL_OVER, levelthumb3roll);
this.selectLevel.btnLevel3.buttonMode = true;
this.selectLevel.btnLevel4.addEventListener(MouseEvent.CLICK, levelthumb4);
this.selectLevel.btnLevel4.addEventListener(MouseEvent.ROLL_OVER, levelthumb4roll);
this.selectLevel.btnLevel4.buttonMode = true;
this.selectLevel.btnBackFromLevel.addEventListener(MouseEvent.CLICK, btnBackFromLevel);
this.selectLevel.btnBackFromLevel.addEventListener(MouseEvent.ROLL_OVER, btnBackFromLevelroll);
this.selectLevel.btnBackFromLevel.buttonMode = true;
} else {
this.selectLevel.btnLevel1.removeEventListener(MouseEvent.CLICK, levelthumb1);
this.selectLevel.btnLevel1.removeEventListener(MouseEvent.ROLL_OVER, levelthumb1roll);
this.selectLevel.btnLevel1.buttonMode = false;
this.selectLevel.btnLevel2.removeEventListener(MouseEvent.CLICK, levelthumb2);
this.selectLevel.btnLevel2.removeEventListener(MouseEvent.ROLL_OVER, levelthumb2roll);
this.selectLevel.btnLevel2.buttonMode = false;
this.selectLevel.btnLevel3.removeEventListener(MouseEvent.CLICK, levelthumb3);
this.selectLevel.btnLevel3.removeEventListener(MouseEvent.ROLL_OVER, levelthumb3roll);
this.selectLevel.btnLevel3.buttonMode = false;
this.selectLevel.btnLevel4.removeEventListener(MouseEvent.CLICK, levelthumb4);
this.selectLevel.btnLevel4.removeEventListener(MouseEvent.ROLL_OVER, levelthumb4roll);
this.selectLevel.btnLevel4.buttonMode = false;
this.selectLevel.btnBackFromLevel.removeEventListener(MouseEvent.CLICK, btnBackFromLevel);
this.selectLevel.btnBackFromLevel.removeEventListener(MouseEvent.ROLL_OVER, btnBackFromLevelroll);
this.selectLevel.btnBackFromLevel.buttonMode = false;
};
}
function btnSecret2(evt:Event):void{
secret(false);
main(true);
}
function btnSecret3(evt:Event):void{
secret(false);
main(true);
}
function btnSecret4(evt:Event):void{
secret(false);
main(true);
}
function btnBackFromControls(evt:Event):void{
if (MovieClip(root).delay == 0){
options(true);
controls(false);
};
}
function btnSecret1(evt:Event):void{
secret(false);
main(true);
}
function launchLevel(level:String):void{
MovieClip(root).currentLevel = (currentStage + level);
MovieClip(root).launchIntro();
}
function btnCampaign(evt:Event):void{
main(false);
campaign(true);
}
public function fxIn(place:Point, time="sandwich", mute:Boolean=false):void{
if (time == "sandwich"){
time = this.time;
};
trace(("fxIn: " + time));
if (!mute){
MovieClip(root).SFX("sfxMenuWoosh");
};
MovieClip(root).menuCursor.blip();
TweenLite.to(this, time, {x:place.x, y:place.y, ease:Sine.easeInOut});
var terrainWidth:Number = MovieClip(root).loopTerrain.width;
var terrainHeight:Number = MovieClip(root).loopTerrain.height;
var terrainLocation:Point = new Point((((-(terrainWidth) / 3) + (place.x / 2)) - 500), ((-(terrainHeight) / 3) + (place.y / 2)));
TweenLite.to(MovieClip(root).loopTerrain, time, {x:terrainLocation.x, y:terrainLocation.y, ease:Sine.easeInOut});
}
function levelthumb1roll(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "1Unlocked")] > 1){
this.selectLevel.txtCaption.text = "Difficulty Level: Easy";
} else {
this.selectLevel.txtCaption.text = "Level Locked";
};
}
public function options(setup:Boolean):void{
if (setup == true){
selectOptions.showScores.visible = true;
selectOptions.scoreBtns.visible = false;
lbClose();
fxIn(optionsLocation);
selectOptions.showScores.txtHighscore.text = ("Your Highscore: " + MovieClip(root).stats.highscore);
selectOptions.txtHacks.text = (MovieClip(root).stats.hacksUnlocked + "/10 Hacks Unlocked");
selectOptions.txtCaption.text = "please select an option";
this.selectOptions.btnControls.addEventListener(MouseEvent.CLICK, btnControls);
this.selectOptions.btnControls.buttonMode = true;
this.selectOptions.btnSpecials.addEventListener(MouseEvent.CLICK, btnSpecials);
this.selectOptions.btnSpecials.buttonMode = true;
this.selectOptions.btnQuality.addEventListener(MouseEvent.CLICK, btnQuality);
this.selectOptions.btnQuality.buttonMode = true;
this.selectOptions.showScores.btn.addEventListener(MouseEvent.CLICK, showScores);
this.selectOptions.showScores.btn.buttonMode = true;
this.selectOptions.btnBackFromOptions.addEventListener(MouseEvent.CLICK, btnBackFromOptions);
this.selectOptions.btnBackFromOptions.buttonMode = true;
} else {
this.selectOptions.btnControls.removeEventListener(MouseEvent.CLICK, btnControls);
this.selectOptions.btnControls.buttonMode = false;
this.selectOptions.btnSpecials.removeEventListener(MouseEvent.CLICK, btnSpecials);
this.selectOptions.btnSpecials.buttonMode = false;
this.selectOptions.btnQuality.removeEventListener(MouseEvent.CLICK, btnQuality);
this.selectOptions.btnQuality.buttonMode = false;
this.selectOptions.showScores.btn.removeEventListener(MouseEvent.CLICK, showScores);
this.selectOptions.showScores.btn.buttonMode = false;
this.selectOptions.btnBackFromOptions.removeEventListener(MouseEvent.CLICK, btnBackFromOptions);
this.selectOptions.btnBackFromOptions.buttonMode = false;
lbDisplay(false);
};
}
function levelthumb3(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "3Unlocked")] > 1){
level("");
launchLevel("3");
if (MovieClip(root).stats.levelInfo[(currentStage + "3Unlocked")] == 2){
MovieClip(root).stats.levelInfo[(currentStage + "3Unlocked")] = 3;
};
};
}
function btnOptions(evt:Event):void{
main(false);
options(true);
}
function btnStats(evt:Event):void{
options(false);
main(true);
}
function levelthumb3roll(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "3Unlocked")] > 1){
this.selectLevel.txtCaption.text = "Difficulty Level: Hard";
} else {
this.selectLevel.txtCaption.text = "Level Locked";
};
}
public function displayCustomControls():void{
var control:*;
var controls:Object = {controla:"moveLeft", controlb:"moveRight", controlc:"moveUp", controld:"moveDown", controle:"throwGrenade", controlf:"optionsMenu", controlg:"nextGun", controlh:"nextGrenade"};
for each (control in controls) {
trace(("txt" + control));
trace(specialCharConversion(MovieClip(root).stats[control]));
customControls[("txt" + control)].text = specialCharConversion(MovieClip(root).stats[control]);
};
}
function levelthumb1(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "1Unlocked")] > 1){
level("");
launchLevel("1");
if (MovieClip(root).stats.levelInfo[(currentStage + "1Unlocked")] == 2){
MovieClip(root).stats.levelInfo[(currentStage + "1Unlocked")] = 3;
};
};
}
function levelthumb2(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "2Unlocked")] > 1){
level("");
launchLevel("2");
if (MovieClip(root).stats.levelInfo[(currentStage + "2Unlocked")] == 2){
MovieClip(root).stats.levelInfo[(currentStage + "2Unlocked")] = 3;
};
};
}
private function prune(mc:MovieClip):void{
MovieClip(root).removeChild(mc);
}
private function loadAutosave(evt:Event):void{
MovieClip(root).stats.WriteData("autosave", false);
MovieClip(root).SFX("sfxPickup");
enterMenu();
}
public function controls(setup:Boolean):void{
if (setup == true){
customControls.visible = true;
fxIn(controlsLocation);
this.customControls.txtCaption.text = "select a control to change";
displayCustomControls();
this.customControls.btnBack.addEventListener(MouseEvent.CLICK, btnBackFromControls);
this.customControls.btnBack.buttonMode = true;
} else {
this.customControls.btnBack.removeEventListener(MouseEvent.CLICK, btnBackFromControls);
this.customControls.btnBack.buttonMode = false;
};
}
public function secret(setup:Boolean):void{
MovieClip(root).menuCursor.blip();
currentStage = "miniGame";
if (setup == true){
fxIn(secretLocation);
this.selectSecret.levelThumb1.gotoAndStop((currentStage + "1"));
this.selectSecret.levelThumb2.gotoAndStop((currentStage + "2"));
this.selectSecret.levelThumb3.gotoAndStop((currentStage + "3"));
this.selectSecret.levelThumb4.gotoAndStop((currentStage + "4"));
this.selectSecret.leveltxt1.text = levelTitle("1");
this.selectSecret.leveltxt2.text = levelTitle("2");
this.selectSecret.leveltxt3.text = levelTitle("3");
this.selectSecret.leveltxt4.text = levelTitle("4");
this.selectSecret.txt1Bounty.text = (("Highscore: " + MovieClip(root).stats.totalKills.zombie) + " reaped");
this.selectSecret.txt2Bounty.text = (("Highscore: " + MovieClip(root).stats.totalKills.assassinationLevel) + " assassinations");
this.selectSecret.txt3Bounty.text = (("Highscore: " + MovieClip(root).stats.totalKills.civiliansBrutalized) + " silenced");
this.selectSecret.txt4Bounty.text = (("Highscore: " + MovieClip(root).stats.totalKills.wavesComplete) + "/10 waves");
checkSecretStatus(currentStage, "1");
checkSecretStatus(currentStage, "2");
checkSecretStatus(currentStage, "3");
checkSecretStatus(currentStage, "4");
this.selectSecret.btnLevel1.addEventListener(MouseEvent.CLICK, secretthumb1);
this.selectSecret.btnLevel1.addEventListener(MouseEvent.ROLL_OVER, secretthumb1roll);
this.selectSecret.btnLevel1.buttonMode = true;
this.selectSecret.btnLevel2.addEventListener(MouseEvent.CLICK, secretthumb2);
this.selectSecret.btnLevel2.addEventListener(MouseEvent.ROLL_OVER, secretthumb2roll);
this.selectSecret.btnLevel2.buttonMode = true;
this.selectSecret.btnLevel3.addEventListener(MouseEvent.CLICK, secretthumb3);
this.selectSecret.btnLevel3.addEventListener(MouseEvent.ROLL_OVER, secretthumb3roll);
this.selectSecret.btnLevel3.buttonMode = true;
this.selectSecret.btnLevel4.addEventListener(MouseEvent.CLICK, secretthumb4);
this.selectSecret.btnLevel4.addEventListener(MouseEvent.ROLL_OVER, secretthumb4roll);
this.selectSecret.btnLevel4.buttonMode = true;
this.selectSecret.btnBackFromLevel.addEventListener(MouseEvent.CLICK, btnBackFromSecret);
this.selectSecret.btnBackFromLevel.addEventListener(MouseEvent.ROLL_OVER, btnBackFromSecretroll);
this.selectSecret.btnBackFromLevel.buttonMode = true;
} else {
this.selectSecret.btnLevel1.removeEventListener(MouseEvent.CLICK, secretthumb1);
this.selectSecret.btnLevel1.removeEventListener(MouseEvent.ROLL_OVER, secretthumb1roll);
this.selectSecret.btnLevel1.buttonMode = false;
this.selectSecret.btnLevel2.removeEventListener(MouseEvent.CLICK, secretthumb2);
this.selectSecret.btnLevel2.removeEventListener(MouseEvent.ROLL_OVER, secretthumb2roll);
this.selectSecret.btnLevel2.buttonMode = false;
this.selectSecret.btnLevel3.removeEventListener(MouseEvent.CLICK, secretthumb3);
this.selectSecret.btnLevel3.removeEventListener(MouseEvent.ROLL_OVER, secretthumb3roll);
this.selectSecret.btnLevel3.buttonMode = false;
this.selectSecret.btnLevel4.removeEventListener(MouseEvent.CLICK, secretthumb4);
this.selectSecret.btnLevel4.removeEventListener(MouseEvent.ROLL_OVER, secretthumb4roll);
this.selectSecret.btnLevel4.buttonMode = false;
this.selectSecret.btnBackFromLevel.removeEventListener(MouseEvent.CLICK, btnBackFromSecret);
this.selectSecret.btnBackFromLevel.removeEventListener(MouseEvent.ROLL_OVER, btnBackFromSecretroll);
this.selectSecret.btnBackFromLevel.buttonMode = false;
};
}
public function main(setup:Boolean):void{
if (setup == true){
MovieClip(root).delay = 0;
customControls.visible = false;
selectLevel.visible = false;
selectHacks.visible = false;
selectMain.visible = true;
fxIn(mainLocation);
if (((((((((((((((((((((((((checkLockStatus("marsh1")) || (checkLockStatus("marsh2")))) || (checkLockStatus("marsh3")))) || (checkLockStatus("marsh4")))) || (checkLockStatus("badlands1")))) || (checkLockStatus("badlands2")))) || (checkLockStatus("badlands3")))) || (checkLockStatus("badlands4")))) || (checkLockStatus("tundra1")))) || (checkLockStatus("btundra2")))) || (checkLockStatus("tundra3")))) || (checkLockStatus("tundra4")))) || (checkLockStatus("hive")))){
selectMain.statusCampaign.gotoAndPlay("unlocked");
} else {
selectMain.statusCampaign.gotoAndStop("open");
};
if (((((((checkLockStatus("miniGame1")) || (checkLockStatus("miniGame2")))) || (checkLockStatus("miniGame3")))) || (checkLockStatus("miniGame4")))){
selectMain.statusSecret.gotoAndPlay("unlocked");
} else {
selectMain.statusSecret.gotoAndStop("open");
};
selectMain.txt1Bounty.text = ((13 - MovieClip(root).stats.stagesComplete) + " levels incomplete");
selectMain.txt2Bounty.text = (("You have " + MovieClip(root).stats.credits) + " credits");
selectMain.txt3Bounty.text = "";
selectMain.txt4Bounty.text = (MovieClip(root).stats.secretMissionsUnlocked + " missions unlocked");
this.selectMain.btnCampaign.addEventListener(MouseEvent.CLICK, btnCampaign);
this.selectMain.btnCampaign.buttonMode = true;
this.selectMain.btnShop.addEventListener(MouseEvent.CLICK, btnShop);
this.selectMain.btnShop.buttonMode = true;
this.selectMain.btnOptions.addEventListener(MouseEvent.CLICK, btnOptions);
this.selectMain.btnOptions.buttonMode = true;
this.selectMain.btnSecret.addEventListener(MouseEvent.CLICK, btnSecret);
this.selectMain.btnSecret.buttonMode = true;
this.selectMain.btnLoad.addEventListener(MouseEvent.CLICK, btnLoad);
this.selectMain.btnLoad.buttonMode = true;
} else {
this.selectMain.btnCampaign.removeEventListener(MouseEvent.CLICK, btnCampaign);
this.selectMain.btnCampaign.buttonMode = false;
this.selectMain.btnShop.removeEventListener(MouseEvent.CLICK, btnShop);
this.selectMain.btnShop.buttonMode = false;
this.selectMain.btnOptions.removeEventListener(MouseEvent.CLICK, btnOptions);
this.selectMain.btnOptions.buttonMode = false;
this.selectMain.btnSecret.removeEventListener(MouseEvent.CLICK, btnSecret);
this.selectMain.btnSecret.buttonMode = false;
this.selectMain.btnLoad.removeEventListener(MouseEvent.CLICK, btnLoad);
this.selectMain.btnLoad.buttonMode = false;
};
}
function levelthumb4(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "4Unlocked")] > 1){
level("");
launchLevel("4");
if (MovieClip(root).stats.levelInfo[(currentStage + "4Unlocked")] == 2){
MovieClip(root).stats.levelInfo[(currentStage + "4Unlocked")] = 3;
};
};
}
function btnBackFromSecret(evt:Event):void{
secret(false);
main(true);
}
function btnBackFromSecretroll(evt:Event):void{
this.selectSecret.txtCaption.text = "Return to Main Menu";
}
function secretthumb1roll(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "1Unlocked")] > 1){
this.selectSecret.txtCaption.text = "Zombies eat brains";
} else {
this.selectSecret.txtCaption.text = "Level Locked";
};
}
function secretthumb4(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "4Unlocked")] > 1){
secret(false);
launchSecret("4");
MovieClip(root).stats.levelInfo[(currentStage + "4Unlocked")] = 3;
};
}
private function launchLeaderboard(evt:Event):void{
var evt = evt;
Mouse.show();
var leaderboardName:String = evt.target.name;
var boardIDs:Object = {campaign:"4ae2d7bea3ee4eb7", hive:"0e07cb05538233ed", miniGame1:"d437c59b80683f1d", miniGame2:"ef1d27af0e57f801", miniGame3:"1cff33d27b27d616", miniGame4:"8a04ddf7794b66f1"};
MochiScores.showLeaderboard({boardID:boardIDs[leaderboardName], onDisplay:lbDisplay, onClose:lbClose, onError:lbClose});
//unresolved jump
var _slot1 = e;
selectOptions.txtCaption.text = "connection error";
}
function secretthumb1(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "1Unlocked")] > 1){
secret(false);
launchSecret("1");
MovieClip(root).stats.levelInfo[(currentStage + "1Unlocked")] = 3;
};
}
function secretthumb2(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "2Unlocked")] > 1){
secret(false);
launchSecret("2");
MovieClip(root).stats.levelInfo[(currentStage + "2Unlocked")] = 3;
};
}
private function checkAutosave(evt:Event):void{
var score:Number;
var so:SharedObject = SharedObject.getLocal("operationOnslaught");
stage.removeEventListener(MouseEvent.MOUSE_UP, checkAutosave);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, checkAutosave);
var slot:String = "autosave";
if (!so.data[slot]){
enterMenu();
} else {
intro.visible = false;
autosaveMenu.visible = true;
autosaveMenu.slot2.addEventListener(MouseEvent.MOUSE_DOWN, enterMenu);
autosaveMenu.slot1.addEventListener(MouseEvent.MOUSE_DOWN, loadAutosave);
score = (((so.data[slot].score + (so.data[slot].score * so.data[slot].hiveRotations)) + (so.data[slot].totalKills.zombie * so.data[slot].totalKills.assassinationLevel)) + ((so.data[slot].totalKills.civiliansBrutalized * so.data[slot].totalKills.wavesComplete) * 10));
autosaveMenu["slot1Info"].text = (((((((((((((("current score: " + score) + "\n") + so.data[slot].progressPoints) + "/") + MovieClip(root).stats.progressMax) + " things unlocked\n") + so.data[slot].totalKills.total) + " monsters killed\nrescued ") + so.data[slot].deaths) + " times\n") + Math.floor(((so.data[slot].progressPoints / MovieClip(root).stats.progressMax) * 100))) + "% complete\n") + so.data[slot].credits) + " credits");
};
TweenLite.to(MovieClip(root).letterbox, 1, {frame:MovieClip(root).letterbox.totalFrames, ease:Sine.easeInOut, onComplete:prune, onCompleteParams:[MovieClip(root).letterbox]});
}
function stageCheck(levelName:String){
if ((((((((MovieClip(root).stats.levelInfo[(levelName + "1Unlocked")] == 1)) && ((MovieClip(root).stats.levelInfo[(levelName + "2Unlocked")] == 1)))) && ((MovieClip(root).stats.levelInfo[(levelName + "3Unlocked")] == 1)))) && ((MovieClip(root).stats.levelInfo[(levelName + "4Unlocked")] == 1)))){
this.selectStage[(levelName + "Status")].gotoAndStop("locked");
} else {
if ((((((((MovieClip(root).stats.levelInfo[(levelName + "1Unlocked")] == 2)) || ((MovieClip(root).stats.levelInfo[(levelName + "2Unlocked")] == 2)))) || ((MovieClip(root).stats.levelInfo[(levelName + "3Unlocked")] == 2)))) || ((MovieClip(root).stats.levelInfo[(levelName + "4Unlocked")] == 2)))){
this.selectStage[(levelName + "Status")].gotoAndPlay("unlocked");
} else {
this.selectStage[(levelName + "Status")].gotoAndStop("open");
};
};
}
function secretthumb3roll(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "3Unlocked")] > 1){
this.selectSecret.txtCaption.text = "Snuff the Populace";
} else {
this.selectSecret.txtCaption.text = "Level Locked";
};
}
public function specials(setup:Boolean):void{
if (setup == true){
selectHacks.visible = true;
selectMain.visible = false;
fxIn(mainLocation);
selectHacks.init();
selectHacks.btnBack.addEventListener(MouseEvent.MOUSE_DOWN, backFromSpecials);
} else {
selectHacks.init(false);
selectHacks.btnBack.removeEventListener(MouseEvent.MOUSE_DOWN, backFromSpecials);
};
}
function btnBackFromLevelroll(evt:Event):void{
this.selectLevel.txtCaption.text = "Return to Stage Select";
}
function secretthumb3(evt:Event):void{
if (MovieClip(root).stats.levelInfo[(currentStage + "3Unlocked")] > 1){
secret(false);
launchSecret("3");
MovieClip(root).stats.levelInfo[(currentStage + "3Unlocked")] = 3;
};
}
function btnBackFromCampaign(evt:Event):void{
campaign(false);
main(true);
}
function btnBackFromLevel(evt:Event):void{
level("");
campaign(true);
}
public function fromIntro():void{
addEventListener(Event.ADDED_TO_STAGE, setup);
fxIn(stageOverLocation, 0, true);
stageOver.visible = false;
autosaveMenu.visible = false;
stage.addEventListener(MouseEvent.MOUSE_UP, checkAutosave);
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkAutosave);
}
function btnTundra(evt:Event):void{
if (MovieClip(root).stats.levelInfo["tundra1Unlocked"] > 1){
campaign(false);
level("tundra");
};
}
function checkSecretStatus(levelName:String, levelLevel:String){
if (MovieClip(root).stats.levelInfo[((levelName + levelLevel) + "Unlocked")] == 1){
this.selectSecret[("levelThumb" + levelLevel)].status.gotoAndStop("locked");
};
if (MovieClip(root).stats.levelInfo[((levelName + levelLevel) + "Unlocked")] == 2){
this.selectSecret[("levelThumb" + levelLevel)].status.gotoAndPlay("unlocked");
};
if (MovieClip(root).stats.levelInfo[((levelName + levelLevel) + "Unlocked")] > 2){
this.selectSecret[("levelThumb" + levelLevel)].status.gotoAndStop("open");
};
}
function btnHive(evt:Event):void{
if (MovieClip(root).stats.levelInfo["hiveUnlocked"] > 1){
currentStage = "hive";
campaign(false);
launchLevel("");
if (MovieClip(root).stats.levelInfo[(currentStage + "Unlocked")] == 2){
MovieClip(root).stats.levelInfo[(currentStage + "Unlocked")] = 3;
};
};
}
public function shop(setup:Boolean):void{
if (setup == true){
fxIn(shopLocation);
addChild(store);
store.setup(true);
} else {
store.setup(false);
removeChild(store);
};
}
}
}//package game.overheadShooter.configAndMenus
Section 15
//MenuCursor (game.overheadShooter.configAndMenus.MenuCursor)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
public class MenuCursor extends MovieClip {
public function MenuCursor():void{
super();
addFrameScript(0, frame1);
}
function follow(evt:Event):void{
x = stage.mouseX;
y = stage.mouseY;
}
public function blip():void{
gotoAndPlay(2);
}
public function chill():void{
removeEventListener(Event.ENTER_FRAME, follow);
}
public function setup():void{
addEventListener(Event.ENTER_FRAME, follow);
mouseEnabled = false;
mouseChildren = false;
}
function frame1(){
stop();
}
}
}//package game.overheadShooter.configAndMenus
Section 16
//PreloaderPls (game.overheadShooter.configAndMenus.PreloaderPls)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
public class PreloaderPls extends MovieClip {
public function PreloaderPls():void{
super();
}
public function init():void{
addEventListener(Event.ENTER_FRAME, checkLoad);
}
private function checkLoad(evt:Event):void{
var total:Number = stage.loaderInfo.bytesTotal;
var loaded:Number = stage.loaderInfo.bytesLoaded;
if (loaded == total){
removeEventListener(Event.ENTER_FRAME, checkLoad);
MovieClip(root).play();
};
}
}
}//package game.overheadShooter.configAndMenus
Section 17
//Shop (game.overheadShooter.configAndMenus.Shop)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
public class Shop extends MovieClip {
var gunInfo:Object;
var ID:Number;// = 0
public function Shop():void{
gunInfo = {gun1title:"Automatic", gun1max:4, gun1level:1, gun1ammo:0, gun1description:"Upgrade: Concussive rounds. Adds concussive force to each round shot, causing enemies to be pushed back.", gun1cartridgeSize:20, gun1cartridgeCost:20, gun1upgradeCost:20, gun2title:"Laser", gun2max:4, gun2level:1, gun2ammo:0, gun2description:"Upgrade: Richochet beam. Adds ricochet to lasers shot.", gun2cartridgeSize:15, gun2cartridgeCost:20, gun2upgradeCost:25, gun3title:"Shotgun", gun3max:2, gun3level:1, gun3ammo:0, gun3description:"Upgrade: Explosive rounds. Adds explosive damage to your shotgun shells.", gun3cartridgeSize:15, gun3cartridgeCost:20, gun3upgradeCost:50, gun4title:"Compact Bow", gun4max:4, gun4level:1, gun4ammo:0, gun4description:"Upgrade: Poison arrows. Adds poison damage to your arrows.", gun4cartridgeSize:10, gun4cartridgeCost:20, gun4upgradeCost:40, gun5title:"Flamethrower", gun5max:4, gun5level:1, gun5ammo:0, gun5description:"Upgrade: Liquid propulsion. Increases the distance of the flame shot.", gun5cartridgeSize:10, gun5cartridgeCost:20, gun5upgradeCost:30, gun6title:"Scatter Missile", gun6max:3, gun6level:1, gun6ammo:0, gun6description:"Upgrade: Intelligent missiles. Increases the homing abilities of missiles.", gun6cartridgeSize:5, gun6cartridgeCost:20, gun6upgradeCost:30, gun7title:"Rocket Launcher", gun7max:4, gun7level:1, gun7ammo:0, gun7description:"Upgrade: Napalm rockets. Adds fire damage to your rockets.", gun7cartridgeSize:5, gun7cartridgeCost:20, gun7upgradeCost:30, gun8title:"Flash Bang", gun8max:4, gun8level:1, gun8ammo:0, gun8description:"Upgrade: Intense flash. Increases the length of time enemies are confused after being flash banged.", gun8cartridgeSize:5, gun8cartridgeCost:20, gun8upgradeCost:30, gun9title:"Poison Grenade", gun9max:4, gun9level:1, gun9ammo:0, gun9description:"Upgrade: Cloud radius. Expands the area englufed in poison.", gun9cartridgeSize:5, gun9cartridgeCost:20, gun9upgradeCost:30, gun0title:"Mine", gun0max:4, gun0level:1, gun0ammo:0, gun0description:"Upgrade: Napalm mines. Adds fire damage to your mines.", gun0cartridgeSize:5, gun0cartridgeCost:20, gun0upgradeCost:30, special1title:"Armor", special1max:5, special1level:1, special1description:"Upgrade: Impact absorption. Take less damage from enemies.", special1upgradeCost:40, special2title:"Force Field", special2max:5, special2level:1, special2description:"Upgrade: Electro shield. Increases the maximum amount of damage you can take.", special2upgradeCost:40, special3title:"Speed", special3max:4, special3level:1, special3description:"Upgrade: Lightweight equipment. Move faster.", special3upgradeCost:40};
super();
}
function updateDisplay():void{
var i:* = 0;
while (i < 10) {
MovieClip(parent).selectShop[("txtLvl" + i)].text = ((("LVL " + gunInfo[(("gun" + i) + "level")]) + "/") + gunInfo[(("gun" + i) + "max")]);
MovieClip(parent).selectShop[("txtAmmo" + i)].text = gunInfo[(("gun" + i) + "ammo")];
i++;
};
var j:* = 1;
while (j < 4) {
MovieClip(parent).selectShop[(("special" + j) + "lvl")].text = ((("LVL " + gunInfo[(("special" + j) + "level")]) + "/") + gunInfo[(("special" + j) + "max")]);
j++;
};
MovieClip(parent).selectShop.txtCaption.text = (("You have " + MovieClip(root).stats.credits) + " credits");
}
function buySpecialUpgrade(evt:Event):void{
var credits:Number = MovieClip(root).stats.credits;
if ((((credits >= (gunInfo[(("special" + ID) + "upgradeCost")] * gunInfo[(("special" + ID) + "level")]))) && ((gunInfo[(("special" + ID) + "level")] < gunInfo[(("special" + ID) + "max")])))){
credits = (credits - gunInfo[(("special" + ID) + "upgradeCost")]);
gunInfo[(("special" + ID) + "level")] = (gunInfo[(("special" + ID) + "level")] + 1);
MovieClip(root).stats.credits = credits;
MovieClip(parent).selectShop.Upgrade.txtCaption.text = (("Upgrade for " + (gunInfo[(("special" + ID) + "upgradeCost")] * gunInfo[(("special" + ID) + "level")])) + " credits");
gunSetup("special");
};
setInfo();
}
function btnSpecial1(evt:Event):void{
ID = 1;
gunSetup("special");
}
function btnSpecial2(evt:Event):void{
ID = 2;
gunSetup("special");
}
function btnSpecial3(evt:Event):void{
ID = 3;
gunSetup("special");
}
function gunSetup(type:String="gun"){
if (type == "gun"){
MovieClip(parent).selectShop.btnAmmo.visible = true;
MovieClip(parent).selectShop.btnUpgrade.visible = true;
MovieClip(parent).selectShop.Ammo.alpha = 1;
MovieClip(parent).selectShop.Upgrade.alpha = 1;
setHighlight(MovieClip(parent).selectShop[("btnGun" + ID)]);
MovieClip(parent).selectShop.btnAmmo.addEventListener(MouseEvent.CLICK, buyAmmo);
MovieClip(parent).selectShop.btnAmmo.buttonMode = true;
MovieClip(parent).selectShop.btnUpgrade.removeEventListener(MouseEvent.CLICK, buySpecialUpgrade);
MovieClip(parent).selectShop.btnUpgrade.addEventListener(MouseEvent.CLICK, buyUpgrade);
MovieClip(parent).selectShop.btnUpgrade.buttonMode = true;
MovieClip(parent).selectShop.txtInfo.text = ((((((gunInfo[(("gun" + ID) + "title")] + " lvl ") + gunInfo[(("gun" + ID) + "level")]) + "\n\nYou currently have ") + gunInfo[(("gun" + ID) + "ammo")]) + " rounds left\n\n") + gunInfo[(("gun" + ID) + "description")]);
MovieClip(parent).selectShop.Upgrade.txtTitle.text = "Upgrade";
if (gunInfo[(("gun" + ID) + "level")] < gunInfo[(("gun" + ID) + "max")]){
MovieClip(parent).selectShop.Upgrade.txtCaption.text = (("Upgrade for " + (gunInfo[(("gun" + ID) + "upgradeCost")] * gunInfo[(("gun" + ID) + "level")])) + " credits");
} else {
MovieClip(parent).selectShop.Upgrade.txtCaption.text = "Maxiumum upgrade";
};
MovieClip(parent).selectShop.Ammo.txtCaption.text = (((gunInfo[(("gun" + ID) + "cartridgeSize")] + " rounds for ") + gunInfo[(("gun" + ID) + "cartridgeCost")]) + " credits");
};
if (type == "special"){
MovieClip(parent).selectShop.btnAmmo.visible = false;
MovieClip(parent).selectShop.btnUpgrade.visible = true;
MovieClip(parent).selectShop.Ammo.alpha = 0.4;
MovieClip(parent).selectShop.Upgrade.alpha = 1;
setHighlight(MovieClip(parent).selectShop[("btnSpecial" + ID)]);
MovieClip(parent).selectShop.btnAmmo.removeEventListener(MouseEvent.CLICK, buyAmmo);
MovieClip(parent).selectShop.btnAmmo.buttonMode = false;
MovieClip(parent).selectShop.btnUpgrade.removeEventListener(MouseEvent.CLICK, buyUpgrade);
MovieClip(parent).selectShop.btnUpgrade.addEventListener(MouseEvent.CLICK, buySpecialUpgrade);
MovieClip(parent).selectShop.btnUpgrade.buttonMode = true;
MovieClip(parent).selectShop.txtInfo.text = ((((gunInfo[(("special" + ID) + "title")] + " lvl ") + gunInfo[(("special" + ID) + "level")]) + "\n\n") + gunInfo[(("special" + ID) + "description")]);
MovieClip(parent).selectShop.Upgrade.txtTitle.text = "Upgrade";
if (gunInfo[(("special" + ID) + "level")] < gunInfo[(("special" + ID) + "max")]){
MovieClip(parent).selectShop.Upgrade.txtCaption.text = (("Upgrade for " + (gunInfo[(("special" + ID) + "upgradeCost")] * gunInfo[(("special" + ID) + "level")])) + " credits");
} else {
MovieClip(parent).selectShop.Upgrade.txtCaption.text = "Maxiumum upgrade";
};
};
}
function getInfo():void{
gunInfo.gun1level = MovieClip(root).stats.gunLevels["1"];
gunInfo.gun1ammo = MovieClip(root).stats.ammoAuto;
gunInfo.gun2level = MovieClip(root).stats.gunLevels["2"];
gunInfo.gun2ammo = MovieClip(root).stats.ammoLaser;
gunInfo.gun3level = MovieClip(root).stats.gunLevels["3"];
gunInfo.gun3ammo = MovieClip(root).stats.ammoShotgun;
gunInfo.gun4level = MovieClip(root).stats.gunLevels["4"];
gunInfo.gun4ammo = MovieClip(root).stats.ammoBow;
gunInfo.gun5level = MovieClip(root).stats.gunLevels["5"];
gunInfo.gun5ammo = MovieClip(root).stats.ammoFlame;
gunInfo.gun6level = MovieClip(root).stats.gunLevels["6"];
gunInfo.gun6ammo = MovieClip(root).stats.ammoScatter;
gunInfo.gun7level = MovieClip(root).stats.gunLevels["7"];
gunInfo.gun7ammo = MovieClip(root).stats.ammoRocket;
gunInfo.gun8level = MovieClip(root).stats.gunLevels["8"];
gunInfo.gun8ammo = MovieClip(root).stats.ammoFlashBang;
gunInfo.gun9level = MovieClip(root).stats.gunLevels["9"];
gunInfo.gun9ammo = MovieClip(root).stats.ammoPoison;
gunInfo.gun0level = MovieClip(root).stats.gunLevels["0"];
gunInfo.gun0ammo = MovieClip(root).stats.ammoMine;
gunInfo.special1level = MovieClip(root).stats.specialLevels["1"];
gunInfo.special2level = MovieClip(root).stats.specialLevels["2"];
gunInfo.special3level = MovieClip(root).stats.specialLevels["3"];
updateDisplay();
}
function btnGun0(evt:Event):void{
ID = 0;
gunSetup();
}
function btnGun1(evt:Event):void{
ID = 1;
gunSetup();
}
function btnGun2(evt:Event):void{
ID = 2;
gunSetup();
}
function btnGun3(evt:Event):void{
ID = 3;
gunSetup();
}
function setInfo():void{
MovieClip(root).stats.gunLevels["1"] = gunInfo.gun1level;
MovieClip(root).stats.ammoAuto = gunInfo.gun1ammo;
MovieClip(root).stats.gunLevels["2"] = gunInfo.gun2level;
MovieClip(root).stats.ammoLaser = gunInfo.gun2ammo;
MovieClip(root).stats.gunLevels["3"] = gunInfo.gun3level;
MovieClip(root).stats.ammoShotgun = gunInfo.gun3ammo;
MovieClip(root).stats.gunLevels["4"] = gunInfo.gun4level;
MovieClip(root).stats.ammoBow = gunInfo.gun4ammo;
MovieClip(root).stats.gunLevels["5"] = gunInfo.gun5level;
MovieClip(root).stats.ammoFlame = gunInfo.gun5ammo;
MovieClip(root).stats.gunLevels["6"] = gunInfo.gun6level;
MovieClip(root).stats.ammoScatter = gunInfo.gun6ammo;
MovieClip(root).stats.gunLevels["7"] = gunInfo.gun7level;
MovieClip(root).stats.ammoRocket = gunInfo.gun7ammo;
MovieClip(root).stats.gunLevels["8"] = gunInfo.gun8level;
MovieClip(root).stats.ammoFlashBang = gunInfo.gun8ammo;
MovieClip(root).stats.gunLevels["9"] = gunInfo.gun9level;
MovieClip(root).stats.ammoPoison = gunInfo.gun9ammo;
MovieClip(root).stats.gunLevels["0"] = gunInfo.gun0level;
MovieClip(root).stats.ammoMine = gunInfo.gun0ammo;
MovieClip(root).stats.specialLevels["1"] = gunInfo.special1level;
MovieClip(root).stats.specialLevels["2"] = gunInfo.special2level;
MovieClip(root).stats.specialLevels["3"] = gunInfo.special3level;
updateDisplay();
}
function btnGun5(evt:Event):void{
ID = 5;
gunSetup();
}
function btnGun6(evt:Event):void{
ID = 6;
gunSetup();
}
function btnGun8(evt:Event):void{
ID = 8;
gunSetup();
}
function btnGun9(evt:Event):void{
ID = 9;
gunSetup();
}
function buyUpgrade(evt:Event):void{
var credits:Number = MovieClip(root).stats.credits;
if ((((credits >= (gunInfo[(("gun" + ID) + "upgradeCost")] * gunInfo[(("gun" + ID) + "level")]))) && ((gunInfo[(("gun" + ID) + "level")] < gunInfo[(("gun" + ID) + "max")])))){
credits = (credits - gunInfo[(("gun" + ID) + "upgradeCost")]);
gunInfo[(("gun" + ID) + "level")] = (gunInfo[(("gun" + ID) + "level")] + 1);
MovieClip(root).stats.credits = credits;
MovieClip(parent).selectShop.Upgrade.txtCaption.text = (("Upgrade for " + (gunInfo[(("gun" + ID) + "upgradeCost")] * gunInfo[(("gun" + ID) + "level")])) + " credits");
gunSetup();
};
setInfo();
}
function btnGun4(evt:Event):void{
ID = 4;
gunSetup();
}
private function setHighlight(copyThis:MovieClip):void{
var highlight:MovieClip = MovieClip(parent).selectShop.highlight;
highlight.visible = true;
highlight.x = copyThis.x;
highlight.y = copyThis.y;
highlight.width = copyThis.width;
highlight.height = copyThis.height;
}
function btnGun7(evt:Event):void{
ID = 7;
gunSetup();
}
function buyAmmo(evt:Event):void{
var credits:Number = MovieClip(root).stats.credits;
if (credits >= gunInfo[(("gun" + ID) + "cartridgeCost")]){
gunInfo[(("gun" + ID) + "ammo")] = (gunInfo[(("gun" + ID) + "ammo")] + gunInfo[(("gun" + ID) + "cartridgeSize")]);
credits = (credits - gunInfo[(("gun" + ID) + "cartridgeCost")]);
MovieClip(root).stats.credits = credits;
gunSetup();
};
setInfo();
}
public function setup(setup:Boolean=true):void{
MovieClip(parent).selectShop.highlight.visible = false;
MovieClip(parent).selectShop.btnAmmo.visible = false;
MovieClip(parent).selectShop.btnUpgrade.visible = false;
if (setup == true){
getInfo();
MovieClip(parent).selectShop.Ammo.alpha = 0.4;
MovieClip(parent).selectShop.Upgrade.alpha = 0.4;
MovieClip(parent).selectShop.btnAmmo.removeEventListener(MouseEvent.CLICK, buyAmmo);
MovieClip(parent).selectShop.btnAmmo.buttonMode = false;
MovieClip(parent).selectShop.btnUpgrade.removeEventListener(MouseEvent.CLICK, buyUpgrade);
MovieClip(parent).selectShop.btnUpgrade.removeEventListener(MouseEvent.CLICK, buySpecialUpgrade);
MovieClip(parent).selectShop.btnUpgrade.buttonMode = false;
MovieClip(parent).selectShop.txtInfo.text = "Welcome to the shop.\n\nClick a weapon below to purchase ammunition or an upgrade. Passive armor, shield, and speed upgrades are also available.";
MovieClip(parent).selectShop.btnGun1.addEventListener(MouseEvent.CLICK, btnGun1);
MovieClip(parent).selectShop.btnGun1.buttonMode = true;
MovieClip(parent).selectShop.btnGun2.addEventListener(MouseEvent.CLICK, btnGun2);
MovieClip(parent).selectShop.btnGun2.buttonMode = true;
MovieClip(parent).selectShop.btnGun3.addEventListener(MouseEvent.CLICK, btnGun3);
MovieClip(parent).selectShop.btnGun3.buttonMode = true;
MovieClip(parent).selectShop.btnGun4.addEventListener(MouseEvent.CLICK, btnGun4);
MovieClip(parent).selectShop.btnGun4.buttonMode = true;
MovieClip(parent).selectShop.btnGun5.addEventListener(MouseEvent.CLICK, btnGun5);
MovieClip(parent).selectShop.btnGun5.buttonMode = true;
MovieClip(parent).selectShop.btnGun6.addEventListener(MouseEvent.CLICK, btnGun6);
MovieClip(parent).selectShop.btnGun6.buttonMode = true;
MovieClip(parent).selectShop.btnGun7.addEventListener(MouseEvent.CLICK, btnGun7);
MovieClip(parent).selectShop.btnGun7.buttonMode = true;
MovieClip(parent).selectShop.btnGun8.addEventListener(MouseEvent.CLICK, btnGun8);
MovieClip(parent).selectShop.btnGun8.buttonMode = true;
MovieClip(parent).selectShop.btnGun9.addEventListener(MouseEvent.CLICK, btnGun9);
MovieClip(parent).selectShop.btnGun9.buttonMode = true;
MovieClip(parent).selectShop.btnGun0.addEventListener(MouseEvent.CLICK, btnGun0);
MovieClip(parent).selectShop.btnGun0.buttonMode = true;
MovieClip(parent).selectShop.btnSpecial1.addEventListener(MouseEvent.CLICK, btnSpecial1);
MovieClip(parent).selectShop.btnSpecial1.buttonMode = true;
MovieClip(parent).selectShop.btnSpecial2.addEventListener(MouseEvent.CLICK, btnSpecial2);
MovieClip(parent).selectShop.btnSpecial2.buttonMode = true;
MovieClip(parent).selectShop.btnSpecial3.addEventListener(MouseEvent.CLICK, btnSpecial3);
MovieClip(parent).selectShop.btnSpecial3.buttonMode = true;
MovieClip(parent).selectShop.btnBack.addEventListener(MouseEvent.CLICK, MovieClip(parent).btnBackFromShop);
MovieClip(parent).selectShop.btnBack.buttonMode = true;
MovieClip(parent).selectShop.btnGun1.alpha = 0;
MovieClip(parent).selectShop.btnGun2.alpha = 0;
MovieClip(parent).selectShop.btnGun3.alpha = 0;
MovieClip(parent).selectShop.btnGun4.alpha = 0;
MovieClip(parent).selectShop.btnGun5.alpha = 0;
MovieClip(parent).selectShop.btnGun6.alpha = 0;
MovieClip(parent).selectShop.btnGun7.alpha = 0;
MovieClip(parent).selectShop.btnGun8.alpha = 0;
MovieClip(parent).selectShop.btnGun9.alpha = 0;
MovieClip(parent).selectShop.btnGun0.alpha = 0;
MovieClip(parent).selectShop.btnSpecial1.alpha = 0;
MovieClip(parent).selectShop.btnSpecial2.alpha = 0;
MovieClip(parent).selectShop.btnSpecial3.alpha = 0;
} else {
MovieClip(parent).selectShop.btnGun1.removeEventListener(MouseEvent.CLICK, btnGun1);
MovieClip(parent).selectShop.btnGun1.buttonMode = false;
MovieClip(parent).selectShop.btnGun2.removeEventListener(MouseEvent.CLICK, btnGun2);
MovieClip(parent).selectShop.btnGun2.buttonMode = false;
MovieClip(parent).selectShop.btnGun3.removeEventListener(MouseEvent.CLICK, btnGun3);
MovieClip(parent).selectShop.btnGun3.buttonMode = false;
MovieClip(parent).selectShop.btnGun4.removeEventListener(MouseEvent.CLICK, btnGun4);
MovieClip(parent).selectShop.btnGun4.buttonMode = false;
MovieClip(parent).selectShop.btnGun5.removeEventListener(MouseEvent.CLICK, btnGun5);
MovieClip(parent).selectShop.btnGun5.buttonMode = false;
MovieClip(parent).selectShop.btnGun6.removeEventListener(MouseEvent.CLICK, btnGun6);
MovieClip(parent).selectShop.btnGun6.buttonMode = false;
MovieClip(parent).selectShop.btnGun7.removeEventListener(MouseEvent.CLICK, btnGun7);
MovieClip(parent).selectShop.btnGun7.buttonMode = false;
MovieClip(parent).selectShop.btnGun8.removeEventListener(MouseEvent.CLICK, btnGun8);
MovieClip(parent).selectShop.btnGun8.buttonMode = false;
MovieClip(parent).selectShop.btnGun9.removeEventListener(MouseEvent.CLICK, btnGun9);
MovieClip(parent).selectShop.btnGun9.buttonMode = false;
MovieClip(parent).selectShop.btnGun0.removeEventListener(MouseEvent.CLICK, btnGun0);
MovieClip(parent).selectShop.btnGun0.buttonMode = false;
MovieClip(parent).selectShop.btnSpecial1.removeEventListener(MouseEvent.CLICK, btnSpecial1);
MovieClip(parent).selectShop.btnSpecial1.buttonMode = false;
MovieClip(parent).selectShop.btnSpecial2.removeEventListener(MouseEvent.CLICK, btnSpecial2);
MovieClip(parent).selectShop.btnSpecial2.buttonMode = false;
MovieClip(parent).selectShop.btnSpecial3.removeEventListener(MouseEvent.CLICK, btnSpecial3);
MovieClip(parent).selectShop.btnSpecial3.buttonMode = false;
MovieClip(parent).selectShop.btnBack.removeEventListener(MouseEvent.CLICK, MovieClip(parent).btnBackFromShop);
MovieClip(parent).selectShop.btnBack.buttonMode = false;
};
}
}
}//package game.overheadShooter.configAndMenus
Section 18
//StageOverHighscore (game.overheadShooter.configAndMenus.StageOverHighscore)
package game.overheadShooter.configAndMenus {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.text.*;
import flash.ui.*;
public class StageOverHighscore extends MovieClip {
private var boardID:String;
public var txtScore:TextField;
private var score:String;
public var btnSubmit:Btn;
private var boardNames:Object;
public var btnView:Btn;
public var txtSubmit:TextField;
private var boardIDs:Object;
public var txtView:TextField;
private var scoreSubmitted:Boolean;
public function StageOverHighscore():void{
boardIDs = {campaign:"4ae2d7bea3ee4eb7", hive:"0e07cb05538233ed", miniGame1:"d437c59b80683f1d", miniGame2:"ef1d27af0e57f801", miniGame3:"1cff33d27b27d616", miniGame4:"8a04ddf7794b66f1"};
boardNames = {campaign:"Campaign", hive:"The Hive", miniGame1:"Zombies", miniGame2:"Nuclear Hitman", miniGame3:"Civilian Brutality", miniGame4:"The Last Stand"};
super();
alpha = 0;
}
public function reset():void{
btnSubmit.removeEventListener(MouseEvent.MOUSE_UP, submit);
btnView.removeEventListener(MouseEvent.MOUSE_UP, view);
alpha = 0;
}
private function submit(evt:Event):void{
var evt = evt;
hideBtns();
scoreSubmitted = true;
MochiScores.showLeaderboard({boardID:boardID, score:score, onDisplay:onDisplay, onClose:onClose, onError:onError, showTableRank:true});
//unresolved jump
var _slot1 = e;
onError();
}
public function onClose():void{
Mouse.hide();
showBtns();
}
public function onDisplay():void{
Mouse.show();
}
private function view(evt:Event):void{
var evt = evt;
hideBtns();
MochiScores.showLeaderboard({boardID:boardID, onDisplay:onDisplay, onClose:onClose, onError:onError, showTableRank:true});
//unresolved jump
var _slot1 = e;
onError();
}
public function onError():void{
trace("Error connecting to leaderboards");
txtScore.text = "leaderboard connection fail";
hideBtns();
}
private function hideBtns():void{
txtSubmit.alpha = 0.25;
txtView.alpha = 0.25;
btnSubmit.visible = false;
btnView.visible = false;
btnSubmit.removeEventListener(MouseEvent.MOUSE_UP, submit);
btnView.removeEventListener(MouseEvent.MOUSE_UP, view);
}
private function showBtns():void{
if (!scoreSubmitted){
txtSubmit.alpha = 1;
};
txtView.alpha = 1;
if (!scoreSubmitted){
btnSubmit.visible = true;
};
btnView.visible = true;
if (!scoreSubmitted){
btnSubmit.addEventListener(MouseEvent.MOUSE_UP, submit);
};
btnView.addEventListener(MouseEvent.MOUSE_UP, view);
}
public function setup(boardName:String, score:String){
alpha = 1;
var displayName:String = (boardNames[boardName]) ? boardNames[boardName] : boardNames.campaign;
scoreSubmitted = false;
txtScore.text = ((displayName + " score: ") + score);
boardID = (boardIDs[boardName]) ? boardIDs[boardName] : boardIDs.campaign;
this.score = score;
showBtns();
}
}
}//package game.overheadShooter.configAndMenus
Section 19
//Stats (game.overheadShooter.configAndMenus.Stats)
package game.overheadShooter.configAndMenus {
import flash.utils.*;
import flash.net.*;
public class Stats {
public var mercenaryGatling:Object;
public var bountyEarned:Number;// = 0
public var success:Boolean;// = false
public var ammoFlame:Number;// = 0
public var highSkeletonBandit:Object;
public var moveDown:Number;// = 83
public var ammoScatter:Number;// = 0
public var marauderGatling:Object;
public var progressMax:Number;// = 27
public var ammoFlashBang:Number;// = 0
public var ammoBow:Number;// = 0
public var optionsMenu:Number;// = 80
public var highSkeletonMage:Object;
public var hiveRotations:Number;// = 0
public var marauderSpikedClub:Object;
public var newlyUnlocked:String;// = ""
public var highSkeletonSwordsman:Object;
public var stagesUnlocked:Number;// = 2
public var ammoMine:Number;// = 0
public var ammoRocket:Number;// = 0
public var cyborgBoss:Object;
public var zombie:Object;
public var moveUp:Number;// = 87
public var nextGun:Number;// = 81
public var marauderRifle:Object;
public var goblinSpear:Object;
public var skeleton:Object;
public var ammoShotgun:Number;// = 0
public var levelInfo:Object;
public var babySpider:Object;
public var secretMissionsUnlocked:Number;// = 0
public var totalDistance:Number;// = 0
public var distanceTitle:String;// = ""
public var fireLeft:Number;// = 74
public var hiveTemp:Number;// = 0
public var fireUp:Number;// = 73
public var mercenaryRifle:Object;
public var skeleKnight:Object;
public var snowFiend:Object;
public var ammoPoison:Number;// = 0
public var progressPoints:Number;// = 0
public var moveLeft:Number;// = 65
public var highSkeletonArcher:Object;
public var deaths:Number;// = 0
public var hacks:Object;
public var civilian:Object;
public var spikeDemon:Object;
public var fireRight:Number;// = 76
public var throwGrenade:Number;// = 32
public var currentBounty:Number;// = 0
public var scoreTemp:Number;// = 0
public var currentDistance:Number;// = 0
public var specialLevels:Object;
public var eggSac:Object;
public var demonGod:Object;
public var score:Number;// = 0
public var creditsTemp:Number;// = 0
public var hacksUnlocked:Number;// = 0
public var currentScore:Number;// = 0
public var ammoAuto:Number;// = 20
public var credits:Number;// = 0
public var iceFatty:Object;
public var stagesComplete:Number;// = 0
public var mercenarySword:Object;
public var ammoLaser:Number;// = 0
public var playerSpeedCurrent:Number;
public var cyborgNinja:Object;
public var cyborgMarine:Object;
public var playerSpeedNorm:Number;// = 4
public var moveRight:Number;// = 68
public var wyrmBoss:Object;
public var gunLevels:Object;
public var kills:Object;
public var goblin:Object;
public var nextGrenade:Number;// = 69
public var spider:Object;
public var demon:Object;
public var totalKills:Object;
public var bossSkeleMage:Object;
public var hammerOgre:Object;
public var spiderBoss:Object;
public var toxicSpider:Object;
public var fireDown:Number;// = 75
public function Stats():void{
gunLevels = {1:1, 2:1, 3:1, 4:1, 5:1, 6:1, 7:1, 8:1, 9:1, 0:1};
specialLevels = {1:1, 2:1, 3:1};
levelInfo = {marsh1Title:"Marsh 1 - Tutorial", marsh1Description:"A brief introductory mission", marsh1Bounty:5, marsh1Unlocked:2, marsh2Title:"Marsh 2 - Rogue Skeleton Gang", marsh2Description:"Cross the marsh and engage the skeleton rogues", marsh2Bounty:20, marsh2Unlocked:2, marsh3Title:"Marsh 3 - Goblin Huntin'", marsh3Description:"Beware of spiders", marsh3Bounty:45, marsh3Unlocked:1, marsh4Title:"Marsh 4 - Undead Crusaders", marsh4Description:"Make your way through the undead horde and eliminate the skeleton king", marsh4Bounty:120, marsh4Unlocked:1, badlands1Title:"Badlands 1 - Demon Threat", badlands1Description:"Demons have been spotted on the outskirts of town", badlands1Bounty:30, badlands1Unlocked:1, badlands2Title:"Badlands 2 - Raid the Raiders", badlands2Description:"Armed men are gathering, probably plotting destruction. There is no time for evidence! Make a preemptive strike", badlands2Bounty:55, badlands2Unlocked:1, badlands3Title:"Badlands 3 - Hostile Outpost", badlands3Description:"Infiltrate a near-by demon campsite", badlands3Bounty:80, badlands3Unlocked:1, badlands4Title:"Badlands 4 - Cyborg Madness", badlands4Description:"Experimental weapons have gained sentience", badlands4Bounty:160, badlands4Unlocked:1, tundra1Title:"Tundra 1 - Negotiation", tundra1Description:"Rogue mercenaries are holding hostages; Take no mercy", tundra1Bounty:65, tundra1Unlocked:1, tundra2Title:"Tundra 2 - Wyrm Squash", tundra2Description:"Find and exterminate the wyrm god", tundra2Bounty:80, tundra2Unlocked:1, tundra3Title:"Tundra 3 - Cold as Hell", tundra3Description:"An arctic-demon army is invading, defend the shores", tundra3Bounty:100, tundra3Unlocked:1, tundra4Title:"Tundra 4 - Ice Gods", tundra4Description:"Assassinate the demon god", tundra4Bounty:220, tundra4Unlocked:1, hiveTitle:"Hive - Perpetuality", hiveDescription:"It's only a matter of time", hiveBounty:300, hiveUnlocked:1, miniGame1Title:"Zombies", miniGame1Description:"eat brains", miniGame1Bounty:"", miniGame1Unlocked:1, miniGame2Title:"Nuclear Hitman", miniGame2Description:"Assassination by nuke", miniGame2Bounty:"", miniGame2Unlocked:1, miniGame3Title:"Civilian Brutality", miniGame3Description:"Put an end to civilian riots", miniGame3Bounty:"", miniGame3Unlocked:1, miniGame4Title:"The Last Stand", miniGame4Description:"ultra-mega-hell wrath awaits", miniGame4Bounty:"", miniGame4Unlocked:1};
kills = {current:0, temp:0, babySpider:0, bossSkeleMage:0, civilian:0, cyborgBoss:0, cyborgMarine:0, cyborgNinja:0, demon:0, demonGod:0, eggSac:0, goblin:0, goblinSpear:0, hammerOgre:0, highSkeletonArcher:0, highSkeletonBandit:0, highSkeletonMage:0, highSkeletonSwordsman:0, iceFatty:0, marauderGatling:0, marauderRifle:0, marauderSpikedClub:0, mercenaryGatling:0, mercenaryRifle:0, mercenarySword:0, monster:0, skeleKnight:0, skeleton:0, snowFiend:0, spider:0, spiderBoss:0, spikeDemon:0, toxicSpider:0, wyrmBoss:0, zombie:0, assassinationLevel:0, civiliansBrutalized:0};
totalKills = {total:0, babySpider:0, bossSkeleMage:0, civilian:0, cyborgBoss:0, cyborgMarine:0, cyborgNinja:0, demon:0, demonGod:0, eggSac:0, goblin:0, goblinSpear:0, hammerOgre:0, highSkeletonArcher:0, highSkeletonBandit:0, highSkeletonMage:0, highSkeletonSwordsman:0, iceFatty:0, marauderGatling:0, marauderRifle:0, marauderSpikedClub:0, mercenaryGatling:0, mercenaryRifle:0, mercenarySword:0, monster:0, skeleKnight:0, skeleton:0, snowFiend:0, spider:0, spiderBoss:0, spikeDemon:0, toxicSpider:0, wyrmBoss:0, zombie:0, civiliansBrutalized:0, assassinationLevel:0, wavesComplete:0};
playerSpeedCurrent = playerSpeedNorm;
demon = {health:100, speed:2, generosity:0.2, damage:6, push:5, worth:10};
demonGod = {health:3500, speed:4, generosity:1, damage:10, push:5, worth:450};
hammerOgre = {health:150, speed:3, generosity:0.35, damage:10, push:5, worth:13};
spikeDemon = {health:250, speed:3, generosity:0.9, damage:3, push:5, worth:30};
marauderSpikedClub = {health:50, speed:2.5, generosity:0.2, damage:6, push:3, worth:5};
marauderRifle = {health:60, speed:2.5, generosity:0.2, damage:2, push:3, worth:6};
marauderGatling = {health:60, speed:2, generosity:0.2, damage:3, push:3, worth:6};
mercenarySword = {health:80, speed:2.5, generosity:0.2, damage:6, push:3, worth:7};
mercenaryRifle = {health:80, speed:2.5, generosity:0.2, damage:2, push:3, worth:7};
mercenaryGatling = {health:80, speed:2, generosity:0.2, damage:3, push:3, worth:7};
skeleton = {health:60, speed:2, generosity:0.2, damage:3, push:3, worth:5};
skeleKnight = {health:85, speed:2.5, generosity:0.2, damage:6, push:3, worth:8};
iceFatty = {health:120, speed:1.5, generosity:0.3, damage:3, push:3, worth:8};
snowFiend = {health:160, speed:4, generosity:0.4, damage:3, push:3, worth:14};
zombie = {health:50, speed:2, generosity:0.2, damage:5, push:3, worth:1};
goblin = {health:50, speed:3, generosity:0.2, damage:5, push:3, worth:5};
goblinSpear = {health:70, speed:3, generosity:0.3, damage:5, push:3, worth:7};
highSkeletonSwordsman = {health:80, speed:2.5, generosity:0.2, damage:6, push:3, worth:9};
highSkeletonBandit = {health:80, speed:2.5, generosity:0.4, damage:5, push:3, worth:9};
highSkeletonArcher = {health:80, speed:2.5, generosity:0.2, damage:5, push:3, worth:9};
highSkeletonMage = {health:80, speed:2.5, generosity:0.2, damage:5, push:3, worth:9};
cyborgMarine = {health:140, speed:7, generosity:0.2, damage:10, push:5, worth:15};
cyborgNinja = {health:140, speed:7, generosity:0.3, damage:10, push:12, worth:15};
spider = {health:50, speed:2, generosity:0.2, damage:2, push:4, worth:4};
toxicSpider = {health:60, speed:3, generosity:0.3, damage:3, push:5, worth:7};
babySpider = {health:20, speed:3.5, damage:1, push:3, worth:1};
civilian = {health:50, speed:3.5, generosity:0.2, damage:10, push:5, worth:0};
eggSac = {health:20};
bossSkeleMage = {health:700, generosity:1, speed:7, damage:8, push:20, worth:250};
wyrmBoss = {health:2000, speed:10, generosity:1, damage:10, push:20, worth:300};
spiderBoss = {health:700, speed:5, generosity:1, damage:3, push:20, worth:180};
cyborgBoss = {health:1200, speed:7, generosity:1, damage:3, push:20, worth:220};
hacks = {slowKill:[0, "Slows time when a kill is made.", 1, "Lay 1,000 zombies to rest in minigame1 to unlock this hack."], ultdAmmo:[0, "Unlimited ammunition. Money and kills earned will be ignored.", 0, "Assassinate 5 monsters in minigame2 to unlock this hack."], godMode:[0, "Cannot be hurt. Money and kills earned will be ignored.", 0, "Display incredible failure to unlock this hack."], suicide:[0, "Player starts with 1HP. Money and kills earned will be doubled.", 2, "Slay the demon boss in tundra4 to unlock this challenge."], nightmare:[0, "Doubles enemy speed, health, and strength. Money and kills earned will be doubled.", 2, "Slay the cyborg boss in badlands4 to unlock this challenge."], sloth:[0, "Player moves at 1/2 speed. Money and kills earned will be doubled.", 2, "Betray an innocent to unlock this challenge."], fancyFeet:[0, "Player moves at 2x speed. Money and kills earned will be halved.", 0.5, "Complete tundra3 to unlock this hack."], mushroom:[0, "???", 1, "Kill 500 enemies in the campaign to unlock this hack."], blindFold:[0, "Enemies are invisible. Money and kills earned will be doubled.", 2, "Survive all 10 waves in minigame4 to unlock this challenge."], ultimaLaser:[0, "Significantly upgrades the laser gun. Money and kills earned will be ignored.", 0, "Brutalize 100 civilians in minigame3 to unlock this hack."]};
super();
}
public function WriteData(slot:String, save:Boolean=true):void{
var savedData:Object;
var unlockData:*;
var hackData:*;
var attribute:*;
var so:SharedObject = SharedObject.getLocal("operationOnslaught");
if (!save){
savedData = clone(so.data[slot]);
for (unlockData in savedData.levelInfo) {
this.levelInfo[unlockData] = savedData.levelInfo[unlockData];
};
delete savedData.levelInfo;
for (hackData in savedData.hacks) {
this.hacks[hackData][0] = savedData.hacks[hackData];
};
delete savedData.hacks;
for (attribute in savedData) {
this[attribute] = savedData[attribute];
};
};
if (save){
if (so.data[slot]){
delete so.data[slot];
};
so.data[slot] = new Object();
so.data[slot].moveLeft = moveLeft;
so.data[slot].moveRight = moveRight;
so.data[slot].moveUp = moveUp;
so.data[slot].moveDown = moveDown;
so.data[slot].throwGrenade = throwGrenade;
so.data[slot].optionsMenu = optionsMenu;
so.data[slot].nextGun = nextGun;
so.data[slot].nextGrenade = nextGrenade;
so.data[slot].ammoAuto = ammoAuto;
so.data[slot].ammoLaser = ammoLaser;
so.data[slot].ammoShotgun = ammoShotgun;
so.data[slot].ammoBow = ammoBow;
so.data[slot].ammoFlame = ammoFlame;
so.data[slot].ammoScatter = ammoScatter;
so.data[slot].ammoRocket = ammoRocket;
so.data[slot].ammoFlashBang = ammoFlashBang;
so.data[slot].ammoPoison = ammoPoison;
so.data[slot].ammoMine = ammoMine;
so.data[slot].gunLevels = gunLevels;
so.data[slot].specialLevels = specialLevels;
if (!so.data[slot].levelInfo){
so.data[slot].levelInfo = new Object();
};
so.data[slot].levelInfo.marsh1Unlocked = levelInfo.marsh1Unlocked;
so.data[slot].levelInfo.marsh2Unlocked = levelInfo.marsh2Unlocked;
so.data[slot].levelInfo.marsh3Unlocked = levelInfo.marsh3Unlocked;
so.data[slot].levelInfo.marsh4Unlocked = levelInfo.marsh4Unlocked;
so.data[slot].levelInfo.badlands1Unlocked = levelInfo.badlands1Unlocked;
so.data[slot].levelInfo.badlands2Unlocked = levelInfo.badlands2Unlocked;
so.data[slot].levelInfo.badlands3Unlocked = levelInfo.badlands3Unlocked;
so.data[slot].levelInfo.badlands4Unlocked = levelInfo.badlands4Unlocked;
so.data[slot].levelInfo.tundra1Unlocked = levelInfo.tundra1Unlocked;
so.data[slot].levelInfo.tundra2Unlocked = levelInfo.tundra2Unlocked;
so.data[slot].levelInfo.tundra3Unlocked = levelInfo.tundra3Unlocked;
so.data[slot].levelInfo.tundra4Unlocked = levelInfo.tundra4Unlocked;
so.data[slot].levelInfo.hiveUnlocked = levelInfo.hiveUnlocked;
so.data[slot].levelInfo.miniGame1Unlocked = levelInfo.miniGame1Unlocked;
so.data[slot].levelInfo.miniGame2Unlocked = levelInfo.miniGame2Unlocked;
so.data[slot].levelInfo.miniGame3Unlocked = levelInfo.miniGame3Unlocked;
so.data[slot].levelInfo.miniGame4Unlocked = levelInfo.miniGame4Unlocked;
so.data[slot].totalDistance = totalDistance;
so.data[slot].hiveRotations = hiveRotations;
so.data[slot].kills = kills;
so.data[slot].totalKills = totalKills;
so.data[slot].credits = credits;
so.data[slot].score = score;
so.data[slot].deaths = deaths;
so.data[slot].stagesUnlocked = stagesUnlocked;
so.data[slot].stagesComplete = stagesComplete;
so.data[slot].secretMissionsUnlocked = secretMissionsUnlocked;
so.data[slot].hacksUnlocked = hacksUnlocked;
so.data[slot].progressPoints = progressPoints;
if (!so.data[slot].hacks){
so.data[slot].hacks = new Object();
};
so.data[slot].hacks.slowKill = hacks.slowKill[0];
so.data[slot].hacks.ultdAmmo = hacks.ultdAmmo[0];
so.data[slot].hacks.godMode = hacks.godMode[0];
so.data[slot].hacks.suicide = hacks.suicide[0];
so.data[slot].hacks.nightmare = hacks.nightmare[0];
so.data[slot].hacks.sloth = hacks.sloth[0];
so.data[slot].hacks.fancyFeet = hacks.fancyFeet[0];
so.data[slot].hacks.mushroom = hacks.mushroom[0];
so.data[slot].hacks.blindFold = hacks.blindFold[0];
so.data[slot].hacks.ultimaLaser = hacks.ultimaLaser[0];
if (!so.data.dates){
so.data.dates = new Object();
};
so.data.dates[slot] = new Date();
};
}
public function get scoreMultiplier():Number{
var hack:*;
var scoreMultiplier:Number = 1;
for each (hack in hacks) {
if (hack[0] == 2){
scoreMultiplier = (scoreMultiplier * hack[2]);
};
};
return (scoreMultiplier);
}
public function unlockCheck(levelName:String):void{
if (success == true){
if (levelName == "marsh1"){
unlockLevel("marsh2");
};
if (levelName == "marsh2"){
unlockLevel("marsh3");
};
if (levelName == "marsh3"){
unlockLevel("marsh4");
unlockLevel("badlands1");
};
if (levelName == "marsh4"){
unlockSecretLevel("miniGame1");
};
if (levelName == "badlands1"){
unlockLevel("badlands2");
};
if (levelName == "badlands2"){
unlockLevel("badlands3");
};
if (levelName == "badlands3"){
unlockLevel("badlands4");
unlockLevel("tundra1");
};
if (levelName == "badlands4"){
unlockSecretLevel("miniGame2");
newlyUnlocked = (newlyUnlocked + unlockHack("nightmare", "+ Nightmare Challenge Unlocked!\n"));
};
if (levelName == "tundra1"){
unlockLevel("tundra2");
};
if (levelName == "tundra2"){
unlockLevel("tundra3");
};
if (levelName == "tundra3"){
unlockLevel("tundra4");
unlockLevel("hive");
newlyUnlocked = (newlyUnlocked + unlockHack("fancyFeet", "+ Fancy-Feet Hack Unlocked!\n"));
};
if (levelName == "tundra4"){
unlockSecretLevel("miniGame3");
newlyUnlocked = (newlyUnlocked + unlockHack("suicide", "+ Suicide Challenge Unlocked!\n"));
};
if (((!((levelInfo[(levelName + "Unlocked")] == 4))) && (!((levelName == "miniGame4"))))){
levelInfo[(levelName + "Unlocked")] = 4;
stagesComplete++;
};
if (totalKills.civilian > 0){
newlyUnlocked = (newlyUnlocked + unlockHack("sloth", "+ Sloth Challenge Unlocked!\n"));
};
if (totalKills.total >= 500){
newlyUnlocked = (newlyUnlocked + unlockHack("mushroom", "+ Mushroom Mode Unlocked!\n"));
};
if (totalKills.total >= 1337){
};
};
}
private function clone(source:Object){
var copier:ByteArray = new ByteArray();
copier.writeObject(source);
copier.position = 0;
return (copier.readObject());
}
public function get highscore():int{
var highscore:int = (((score + (score * hiveRotations)) + (totalKills.zombie * totalKills.assassinationLevel)) + ((totalKills.civiliansBrutalized * totalKills.wavesComplete) * 10));
return (highscore);
}
function unlockHack(hack:String, displayText:String):String{
if (hacks[hack][0] < 1){
hacksUnlocked = (hacksUnlocked + 1);
progressPoints = (progressPoints + 1);
hacks[hack][0] = 1;
return ((displayText + " (Toggle Hacks in the Options Menu)\n"));
};
return ("");
}
public function resetStats():void{
}
function unlockLevel(levelName:String):void{
if (levelInfo[(levelName + "Unlocked")] == 1){
stagesUnlocked = (stagesUnlocked + 1);
progressPoints = (progressPoints + 1);
levelInfo[(levelName + "Unlocked")] = 2;
newlyUnlocked = (newlyUnlocked + (((("+ " + String.fromCharCode(222)) + levelInfo[(levelName + "Title")]) + String.fromCharCode(222)) + " Unlocked!\n"));
};
}
public function resetCurrentStats():void{
var i:*;
currentBounty = 0;
currentScore = 0;
bountyEarned = 0;
creditsTemp = 0;
scoreTemp = 0;
currentDistance = 0;
hiveTemp = 0;
newlyUnlocked = "";
for (i in kills) {
kills[i] = 0;
};
}
public function addKill(monstersName:String):void{
kills[monstersName] = (kills[monstersName] - 1);
totalKills[monstersName] = (totalKills[monstersName] + 1);
kills.current = (kills.current + 1);
kills.temp = (kills.temp + 1);
currentScore = (currentScore + this[monstersName].worth);
scoreTemp = (scoreTemp + this[monstersName].worth);
}
function unlockSecretLevel(levelName:String):void{
if (levelInfo[(levelName + "Unlocked")] == 1){
secretMissionsUnlocked = (secretMissionsUnlocked + 1);
progressPoints = (progressPoints + 1);
levelInfo[(levelName + "Unlocked")] = 2;
newlyUnlocked = (newlyUnlocked + (((("+ Secret Mission " + String.fromCharCode(222)) + levelInfo[(levelName + "Title")]) + String.fromCharCode(222)) + " Unlocked!\n"));
};
}
}
}//package game.overheadShooter.configAndMenus
Section 20
//BlackTransition (game.overheadShooter.effects.BlackTransition)
package game.overheadShooter.effects {
import gs.*;
import flash.display.*;
public class BlackTransition extends MovieClip {
var toDo:Function;
public function BlackTransition():void{
toDo = new Function();
super();
}
public function Start(doThis:Function):void{
toDo = doThis;
this.y = 825;
TweenLite.to(this, 1.5, {y:0, onComplete:Finish});
}
public function revealLevel():void{
MovieClip(root).introScreen.heli.coast(false);
MovieClip(root).introScreen.visible = false;
MovieClip(root).removeChild(MovieClip(root).introScreen);
MovieClip(root).launchLevel();
}
function Finish():void{
toDo();
TweenLite.to(this, 1.5, {y:-825, onComplete:Exit});
}
public function revealMenu():void{
MovieClip(root).stageOverDisplaySetup();
}
function Exit():void{
MovieClip(parent).removeChild(this);
}
public function revealIntro():void{
MovieClip(root).mainMenu(false);
MovieClip(root).introScreen.visible = true;
MovieClip(root).introScreen.startUp();
}
}
}//package game.overheadShooter.effects
Section 21
//Blood (game.overheadShooter.effects.Blood)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class Blood extends MovieClip {
var frames:Number;// = 11
public function Blood():void{
super();
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 22
//BloodParticle (game.overheadShooter.effects.BloodParticle)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class BloodParticle extends MovieClip {
private var delay:Number;// = 2
private var myPoint:Point;
private var endPoint:Point;
private var startPoint:Point;
public function BloodParticle(startPoint:Point, endPoint:Point):void{
super();
x = startPoint.x;
y = startPoint.y;
this.startPoint = startPoint;
this.endPoint = endPoint;
addEventListener(Event.ADDED_TO_STAGE, added);
scaleX = 0.6;
scaleY = 0.6;
}
private function added(evt:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, added);
addEventListener(Event.ENTER_FRAME, action);
alpha = 0;
}
private function action2(evt:Event):void{
delay++;
if (delay == 2){
MovieClip(root).squirt(x, y);
myPoint = Point.interpolate(endPoint, startPoint, 0.1);
x = myPoint.x;
y = myPoint.y;
};
if (delay == 3){
myPoint = Point.interpolate(endPoint, startPoint, 0.3);
x = myPoint.x;
y = myPoint.y;
MovieClip(root).squirt(x, y);
};
if (delay == 4){
myPoint = Point.interpolate(endPoint, startPoint, 0.6);
x = myPoint.x;
y = myPoint.y;
MovieClip(root).squirt(x, y);
};
if (delay == 5){
myPoint = Point.interpolate(endPoint, startPoint, 0.9);
x = myPoint.x;
y = myPoint.y;
MovieClip(root).squirt(x, y);
};
if (delay == 6){
myPoint = Point.interpolate(endPoint, startPoint, 1);
x = myPoint.x;
y = myPoint.y;
MovieClip(root).spatter(x, y);
MovieClip(root).enterScreenShake();
removeEventListener(Event.ENTER_FRAME, action2);
MovieClip(parent).removeChild(this);
};
}
private function action(evt:Event):void{
if (delay > 0){
alpha = (alpha + 0.2);
scaleX = (scaleX * 1.5);
scaleY = (scaleY * 1.5);
} else {
removeEventListener(Event.ENTER_FRAME, action);
addEventListener(Event.ENTER_FRAME, action2);
};
delay--;
}
}
}//package game.overheadShooter.effects
Section 23
//BloodSquirt (game.overheadShooter.effects.BloodSquirt)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class BloodSquirt extends MovieClip {
var frames:Number;// = 3
public function BloodSquirt():void{
super();
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 24
//BossExplosion (game.overheadShooter.effects.BossExplosion)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class BossExplosion extends MovieClip {
var type:String;// = "red"
var frames:Number;// = 15
var scale:Number;// = 1
public function BossExplosion(type:String, scale):void{
super();
this.scale = scale;
addEventListener(Event.ENTER_FRAME, countDown);
this.type = type;
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
if (frames == 15){
MovieClip(root).spatter(this.x, this.y, type, scale, false);
};
if (frames == 12){
MovieClip(root).squirt((this.x + 15), (this.y + 15), type, scale);
MovieClip(root).squirt((this.x + 15), (this.y - 15), type, scale);
MovieClip(root).squirt((this.x - 15), (this.y + 15), type, scale);
MovieClip(root).squirt((this.x - 15), (this.y - 15), type, scale);
};
if (frames == 9){
MovieClip(root).spatter((this.x + 30), this.y, type, scale, false);
MovieClip(root).spatter(this.x, (this.y + 30), type, scale, false);
MovieClip(root).spatter((this.x - 30), this.y, type, scale, false);
MovieClip(root).spatter(this.x, (this.y - 30), type, scale, false);
MovieClip(root).spatter((this.x + 20), (this.y + 20), type, scale, false);
MovieClip(root).spatter((this.x + 20), (this.y - 20), type, scale, false);
MovieClip(root).spatter((this.x - 20), (this.y + 20), type, scale, false);
MovieClip(root).spatter((this.x - 20), (this.y - 20), type, scale, false);
};
if (frames == 6){
MovieClip(root).spatter((this.x + 70), this.y, type, scale, false);
MovieClip(root).spatter(this.x, (this.y + 70), type, scale, false);
MovieClip(root).spatter((this.x - 70), this.y, type, scale, false);
MovieClip(root).spatter(this.x, (this.y - 70), type, scale, false);
MovieClip(root).spatter((this.x + 50), (this.y + 50), type, scale, false);
MovieClip(root).spatter((this.x + 50), (this.y - 50), type, scale, false);
MovieClip(root).spatter((this.x - 50), (this.y + 50), type, scale, false);
MovieClip(root).spatter((this.x - 50), (this.y - 50), type, scale, false);
};
if (frames == 3){
MovieClip(root).squirt((this.x + 40), this.y, type, scale);
MovieClip(root).squirt(this.x, (this.y + 40), type, scale);
MovieClip(root).squirt((this.x - 40), this.y, type, scale);
MovieClip(root).squirt(this.x, (this.y - 40), type, scale);
MovieClip(root).squirt((this.x + 30), (this.y + 30), type, scale);
MovieClip(root).squirt((this.x + 30), (this.y - 30), type, scale);
MovieClip(root).squirt((this.x - 30), (this.y + 30), type, scale);
MovieClip(root).squirt((this.x - 30), (this.y - 30), type, scale);
};
if (frames == 1){
MovieClip(root).squirt((this.x + 90), this.y, type, scale);
MovieClip(root).squirt(this.x, (this.y + 90), type, scale);
MovieClip(root).squirt((this.x - 90), this.y, type, scale);
MovieClip(root).squirt(this.x, (this.y - 90), type, scale);
MovieClip(root).squirt((this.x + 65), (this.y + 65), type, scale);
MovieClip(root).squirt((this.x + 65), (this.y - 65), type, scale);
MovieClip(root).squirt((this.x - 65), (this.y + 65), type, scale);
MovieClip(root).squirt((this.x - 65), (this.y - 65), type, scale);
};
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 25
//BreakLand (game.overheadShooter.effects.BreakLand)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class BreakLand extends MovieClip {
var frames:Number;// = 6
public function BreakLand():void{
super();
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames == 6){
scaleX = 0.8;
scaleY = 0.8;
};
if (frames == 5){
scaleX = 1;
scaleY = 1;
};
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 26
//DamageText (game.overheadShooter.effects.DamageText)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class DamageText extends MovieClip {
public var txt:TextField;
var frames:Number;// = 30
public function DamageText(dam:Number):void{
super();
addEventListener(Event.ENTER_FRAME, countDown);
txt.text = dam.toString();
}
function countDown(evt:Event):void{
if (MovieClip(root) != null){
this.y = (this.y + (MovieClip(root).scrollSpeedY - 2));
this.x = (this.x + MovieClip(root).scrollSpeedX);
};
if (frames > 0){
this.alpha = (this.alpha - 0.05);
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 27
//DisplayText (game.overheadShooter.effects.DisplayText)
package game.overheadShooter.effects {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class DisplayText extends MovieClip {
public var txt:TextField;
var counter:Number;// = 0
public function DisplayText(words:String, seconds:Number):void{
super();
this.txt.text = words;
counter = (seconds * 31);
addEventListener(Event.ENTER_FRAME, countdown);
}
function countdown(evt:Event):void{
counter = (counter - 1);
if (counter < 1){
removeEventListener(Event.ENTER_FRAME, countdown);
TweenLite.to(this, 0.5, {alpha:0, onComplete:Exit});
};
}
public function Remove():void{
var arrayIndex:Number = MovieClip(root).Level.displayTextArray.indexOf(this);
MovieClip(root).Level.displayTextArray.splice(arrayIndex, 1);
this.visible = false;
}
function Exit():void{
if (this.visible == true){
Remove();
};
MovieClip(parent).removeChild(this);
}
}
}//package game.overheadShooter.effects
Section 28
//FlashBang (game.overheadShooter.effects.FlashBang)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class FlashBang extends MovieClip {
var diminish:Number;// = 0.05
var frames:Number;// = 10
public function FlashBang():void{
super();
this.x = 0;
this.y = 0;
this.alpha = 0.9;
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
if (frames > 0){
this.alpha = (this.alpha - diminish);
diminish = (diminish + diminish);
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 29
//ForceField (game.overheadShooter.effects.ForceField)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class ForceField extends MovieClip {
var frames:Number;// = 4
public function ForceField(rot:Number):void{
super();
addFrameScript(4, frame5, 9, frame10);
rotation = (rot + 90);
addEventListener(Event.ENTER_FRAME, countDown);
}
function frame5(){
stop();
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
function frame10(){
stop();
}
}
}//package game.overheadShooter.effects
Section 30
//LiquidMageFlame (game.overheadShooter.effects.LiquidMageFlame)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class LiquidMageFlame extends MovieClip {
var frames:Number;// = 18
public function LiquidMageFlame():void{
super();
addFrameScript(17, frame18);
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
function frame18(){
stop();
}
}
}//package game.overheadShooter.effects
Section 31
//PoisonEmitter (game.overheadShooter.effects.PoisonEmitter)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class PoisonEmitter extends MovieClip {
var life:Number;// = 11
var counter:Number;// = 0
public function PoisonEmitter():void{
super();
addEventListener(Event.ADDED_TO_STAGE, setup);
}
function expand(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
life--;
counter++;
if (counter == 1){
MovieClip(root).poisonSmoke(this.x, this.y);
MovieClip(root).SFX("sfxPoisonCloud");
};
if (counter == 6){
MovieClip(root).poisonSmoke((this.x + 20), (this.y + 20));
MovieClip(root).poisonSmoke((this.x - 20), (this.y + 20));
MovieClip(root).poisonSmoke((this.x + 20), (this.y - 20));
MovieClip(root).poisonSmoke((this.x - 20), (this.y - 20));
MovieClip(root).SFX("sfxPoisonCloud");
};
if (counter == 11){
MovieClip(root).poisonSmoke((this.x + 40), this.y);
MovieClip(root).poisonSmoke((this.x - 40), this.y);
MovieClip(root).poisonSmoke(this.x, (this.y - 40));
MovieClip(root).poisonSmoke(this.x, (this.y + 40));
MovieClip(root).SFX("sfxPoisonCloud");
};
if (counter == 16){
MovieClip(root).poisonSmoke((this.x + 40), (this.y + 40));
MovieClip(root).poisonSmoke((this.x - 40), (this.y - 40));
MovieClip(root).poisonSmoke((this.x + 40), (this.y - 40));
MovieClip(root).poisonSmoke((this.x - 40), (this.y + 40));
MovieClip(root).SFX("sfxPoisonCloud");
};
if (counter == 21){
MovieClip(root).poisonSmoke((this.x + 60), (this.y + 60));
MovieClip(root).poisonSmoke((this.x - 60), (this.y + 60));
MovieClip(root).poisonSmoke((this.x - 60), (this.y - 60));
MovieClip(root).poisonSmoke((this.x + 60), (this.y - 60));
MovieClip(root).poisonSmoke((this.x + 20), (this.y + 70));
MovieClip(root).poisonSmoke((this.x - 20), (this.y + 70));
MovieClip(root).poisonSmoke((this.x - 20), (this.y - 70));
MovieClip(root).poisonSmoke((this.x + 20), (this.y - 70));
MovieClip(root).poisonSmoke((this.x + 70), (this.y + 20));
MovieClip(root).poisonSmoke((this.x - 70), (this.y + 20));
MovieClip(root).poisonSmoke((this.x - 70), (this.y - 20));
MovieClip(root).poisonSmoke((this.x + 70), (this.y - 20));
MovieClip(root).SFX("sfxPoisonCloud");
};
if (counter == 26){
MovieClip(root).poisonSmoke((this.x + 100), this.y);
MovieClip(root).poisonSmoke((this.x - 100), this.y);
MovieClip(root).poisonSmoke(this.x, (this.y + 100));
MovieClip(root).poisonSmoke(this.x, (this.y - 100));
MovieClip(root).poisonSmoke((this.x + 100), (this.y + 40));
MovieClip(root).poisonSmoke((this.x - 100), (this.y + 40));
MovieClip(root).poisonSmoke((this.x - 100), (this.y - 40));
MovieClip(root).poisonSmoke((this.x + 100), (this.y - 40));
MovieClip(root).poisonSmoke((this.x + 80), (this.y + 80));
MovieClip(root).poisonSmoke((this.x - 80), (this.y + 80));
MovieClip(root).poisonSmoke((this.x - 80), (this.y - 80));
MovieClip(root).poisonSmoke((this.x + 80), (this.y - 80));
MovieClip(root).poisonSmoke((this.x + 40), (this.y + 100));
MovieClip(root).poisonSmoke((this.x - 40), (this.y + 100));
MovieClip(root).poisonSmoke((this.x - 40), (this.y - 100));
MovieClip(root).poisonSmoke((this.x + 40), (this.y - 100));
MovieClip(root).SFX("sfxPoisonCloud");
};
if (life < 1){
removeEventListener(Event.ENTER_FRAME, expand);
MovieClip(parent).removeChild(this);
};
}
function setup(evt:Event):void{
life = ((MovieClip(root).stats.gunLevels["9"] * 5) + 6);
removeEventListener(Event.ADDED_TO_STAGE, setup);
addEventListener(Event.ENTER_FRAME, expand);
}
}
}//package game.overheadShooter.effects
Section 32
//PoisonIcon (game.overheadShooter.effects.PoisonIcon)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class PoisonIcon extends MovieClip {
public var frames:Number;// = 4
public function PoisonIcon():void{
super();
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 33
//PoisonSmoke (game.overheadShooter.effects.PoisonSmoke)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class PoisonSmoke extends MovieClip {
var duration:Number;// = 10
var frames:Number;// = 8
var monsterIndex:Number;// = 0
var totalMonsters:Number;// = 0
public function PoisonSmoke():void{
super();
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
monsterIndex = -1;
totalMonsters = MovieClip(root).monsterArray.length;
if (totalMonsters > 0){
do {
monsterIndex = (monsterIndex + 1);
if (MovieClip(root).monsterArray[monsterIndex].hitTestObject(this) == true){
MovieClip(root).monsterArray[monsterIndex].setPoison(duration);
};
} while (monsterIndex < (totalMonsters - 1));
};
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 34
//ScreenPing (game.overheadShooter.effects.ScreenPing)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class ScreenPing extends MovieClip {
var frames:Number;// = 120
public function ScreenPing():void{
super();
addFrameScript(19, frame20);
addEventListener(Event.ENTER_FRAME, countDown);
this.scaleX = 4;
this.scaleY = 4;
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
this.rotation = (this.rotation + 10);
frames = (frames - 1);
if (scaleX > 1){
this.scaleX = (this.scaleX - 0.2);
this.scaleY = (this.scaleY - 0.2);
};
if (frames < 10){
alpha = (alpha - 0.1);
};
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
function frame20(){
stop();
}
}
}//package game.overheadShooter.effects
Section 35
//ShieldShatter (game.overheadShooter.effects.ShieldShatter)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class ShieldShatter extends MovieClip {
var frames:Number;// = 5
public function ShieldShatter():void{
super();
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 36
//ShieldSplinter (game.overheadShooter.effects.ShieldSplinter)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class ShieldSplinter extends MovieClip {
var frames:Number;// = 3
public function ShieldSplinter():void{
super();
addFrameScript(0, frame1);
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
function frame1(){
stop();
}
}
}//package game.overheadShooter.effects
Section 37
//SmallExplosion (game.overheadShooter.effects.SmallExplosion)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class SmallExplosion extends MovieClip {
var frames:Number;// = 7
public function SmallExplosion():void{
super();
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 38
//SmokeTrail (game.overheadShooter.effects.SmokeTrail)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class SmokeTrail extends MovieClip {
var frames:Number;// = 3
public function SmokeTrail():void{
super();
addEventListener(Event.ENTER_FRAME, countDown);
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.effects
Section 39
//Spike (game.overheadShooter.effects.Spike)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class Spike extends MovieClip {
var frames:Number;// = 31
public var damage:Number;// = 10
var sinkTimer:Number;// = 0
var monsterIndex:Number;// = 0
var push:Number;// = 10
var totalMonsters:Number;// = 0
public function Spike():void{
super();
addFrameScript(5, frame6);
addEventListener(Event.ENTER_FRAME, countDown);
}
function inflictDamage():void{
trace("spiked!");
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
}
function frame6(){
stop();
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
frames = (frames - 1);
if ((((frames < 1)) && ((sinkTimer < 1)))){
sinkTimer = 1;
};
if ((((MovieClip(root).char.hitZone.hitTestObject(this) == true)) && ((sinkTimer < 1)))){
inflictDamage();
sinkTimer = 1;
};
if (sinkTimer > 0){
if (sinkTimer == 1){
gotoAndPlay("submerge");
};
sinkTimer = (sinkTimer + 1);
if (sinkTimer > 7){
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
};
}
}
}//package game.overheadShooter.effects
Section 40
//TargetBlip (game.overheadShooter.effects.TargetBlip)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class TargetBlip extends MovieClip {
var frames:Number;// = 31
public function TargetBlip():void{
super();
addFrameScript(19, frame20);
addEventListener(Event.ENTER_FRAME, countDown);
this.alpha = 0.25;
}
function countDown(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (frames > 0){
this.rotation = (this.rotation + 10);
this.alpha = (this.alpha - 0.01);
frames = (frames - 1);
} else {
removeEventListener(Event.ENTER_FRAME, countDown);
MovieClip(parent).removeChild(this);
};
}
function frame20(){
stop();
}
}
}//package game.overheadShooter.effects
Section 41
//WarpHole (game.overheadShooter.effects.WarpHole)
package game.overheadShooter.effects {
import flash.events.*;
import flash.display.*;
public class WarpHole extends MovieClip {
var acceleration:Number;// = 0.05
var frames:Number;// = 10
public function WarpHole():void{
super();
addEventListener(Event.ADDED_TO_STAGE, added);
}
function closingPortal(evt:Event):void{
acceleration = (acceleration + 0.05);
scaleX = (scaleX - acceleration);
scaleY = (scaleY - acceleration);
if (scaleX <= 0){
removeEventListener(Event.ENTER_FRAME, closingPortal);
visible = false;
addEventListener(Event.ADDED_TO_STAGE, added);
};
}
public function collapse():void{
acceleration = 0.05;
addEventListener(Event.ENTER_FRAME, closingPortal);
}
function added(evt:Event){
removeEventListener(Event.ADDED_TO_STAGE, added);
addEventListener(Event.ENTER_FRAME, Scroll);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, closingPortal);
removeEventListener(Event.ENTER_FRAME, Scroll);
MovieClip(parent).removeChild(this);
}
function Scroll(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
}
}
}//package game.overheadShooter.effects
Section 42
//GuidedMissile (game.overheadShooter.miniGame.GuidedMissile)
package game.overheadShooter.miniGame {
import flash.events.*;
import flash.display.*;
import com.senocular.utils.*;
public class GuidedMissile extends MovieClip {
var maxSpeed:Number;// = 20
var moveRight:Number;
var moveUp:Number;
var travelSpeed:Number;// = 10
var moveDown:Number;
var counter:Number;// = 0
var vertSpeed:Number;// = 0
var key:KeyObject;
var accel:Number;// = 2
var horiSpeed:Number;// = 0
var driftDistance:Number;// = 435
var moveLeft:Number;
public function GuidedMissile(X:Number, Y:Number):void{
super();
x = X;
y = Y;
}
private function flying(evt:Event):void{
counter++;
if ((counter % 2) == 0){
MovieClip(root).smokeTrail(x, (y + 10));
};
if ((counter % 5) == 0){
MovieClip(root).smallExplosion(x, (y + 10), false);
};
if (key.isDown(moveLeft)){
horiSpeed = (((horiSpeed - accel))<=-(maxSpeed)) ? -(maxSpeed) : (horiSpeed - accel);
};
if (key.isDown(moveRight)){
horiSpeed = (((horiSpeed + accel))>=maxSpeed) ? maxSpeed : (horiSpeed + accel);
};
if (key.isDown(moveUp)){
vertSpeed = (((vertSpeed - accel))<=-(maxSpeed)) ? -(maxSpeed) : (vertSpeed - accel);
};
if (key.isDown(moveDown)){
vertSpeed = (((vertSpeed + accel))>=maxSpeed) ? maxSpeed : (vertSpeed + accel);
};
x = (x + horiSpeed);
rotation = horiSpeed;
checkBounds();
if (y < driftDistance){
y++;
};
}
public function checkControls():void{
moveLeft = MovieClip(root).stats.moveLeft;
moveRight = MovieClip(root).stats.moveRight;
moveUp = MovieClip(root).stats.moveUp;
moveDown = MovieClip(root).stats.moveDown;
}
public function explode():void{
MovieClip(root).mediumExplosion(x, y, 6);
removeEventListener(Event.ENTER_FRAME, flying);
MovieClip(root).enterScreenShake();
MovieClip(parent).removeChild(this);
}
function checkBounds():void{
if (this.x < 0){
this.x = 0;
horiSpeed = (horiSpeed + (accel * 2));
};
if (this.x > MovieClip(root).StageWidth){
this.x = MovieClip(root).StageWidth;
horiSpeed = (horiSpeed - (accel * 2));
};
if (this.y < 0){
this.y = 0;
};
if (this.y > MovieClip(root).StageHeight){
this.y = MovieClip(root).StageHeight;
};
}
public function fly():void{
addEventListener(Event.ENTER_FRAME, flying);
checkControls();
key = new KeyObject(stage);
}
}
}//package game.overheadShooter.miniGame
Section 43
//Mg2Civ (game.overheadShooter.miniGame.Mg2Civ)
package game.overheadShooter.miniGame {
import flash.events.*;
import flash.display.*;
public class Mg2Civ extends MovieClip {
public var animation:MovieClip;
var speed:Number;// = 10
var type:String;
public function Mg2Civ(type:String="stand"):void{
super();
addFrameScript(0, frame1);
this.type = type;
addEventListener(Event.ADDED_TO_STAGE, setup);
}
public function explode():void{
MovieClip(root).spatter(x, y, "red", 3);
removeEventListener(Event.ENTER_FRAME, walking);
removeEventListener(Event.ENTER_FRAME, Scroll);
MovieClip(parent).removeChild(this);
}
private function randomFrame(mc:MovieClip):void{
var frame:Number = Math.round((mc.totalFrames * Math.random()));
mc.gotoAndStop(frame);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, walking);
removeEventListener(Event.ENTER_FRAME, Scroll);
MovieClip(parent).removeChild(this);
}
public function setup(evt:Event):void{
randomFrame(this);
randomFrame(animation);
removeEventListener(Event.ADDED_TO_STAGE, setup);
addEventListener(Event.ENTER_FRAME, Scroll);
if (Math.random() > 0.5){
rotation = 90;
} else {
rotation = -90;
speed = (speed * -1);
};
scaleX = 3;
scaleY = 3;
if (type == "patrol"){
addEventListener(Event.ENTER_FRAME, walking);
animation.play();
};
if (type == "stand"){
rotation = (360 * Math.random());
};
}
private function Scroll(evt:Event):void{
y = (y + MovieClip(root).scrollSpeedY);
x = (x + MovieClip(root).scrollSpeedX);
}
private function walking(evt:Event):void{
x = (x + speed);
checkBounds();
}
function frame1(){
stop();
}
function checkBounds():void{
if (this.x < 0){
this.x = 0;
speed = (speed * -1);
rotation = (rotation + 180);
};
if (this.x > MovieClip(root).StageWidth){
this.x = MovieClip(root).StageWidth;
speed = (speed * -1);
rotation = (rotation - 180);
};
}
}
}//package game.overheadShooter.miniGame
Section 44
//Mg2Enemy (game.overheadShooter.miniGame.Mg2Enemy)
package game.overheadShooter.miniGame {
import flash.events.*;
import flash.display.*;
public class Mg2Enemy extends MovieClip {
public function Mg2Enemy():void{
super();
addFrameScript(0, frame1);
addEventListener(Event.ADDED_TO_STAGE, setup);
}
public function explode():void{
MovieClip(root).bossDeath(x, y, "red", 3);
removeEventListener(Event.ENTER_FRAME, Scroll);
gotoAndStop("sweep");
}
function frame1(){
stop();
}
private function Scroll(evt:Event):void{
y = (y + MovieClip(root).scrollSpeedY);
x = (x + MovieClip(root).scrollSpeedX);
}
public function setup(evt:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, setup);
addEventListener(Event.ENTER_FRAME, Scroll);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, Scroll);
MovieClip(parent).removeChild(this);
}
}
}//package game.overheadShooter.miniGame
Section 45
//Mg2HUD (game.overheadShooter.miniGame.Mg2HUD)
package game.overheadShooter.miniGame {
import flash.display.*;
public class Mg2HUD extends MovieClip {
public var life1:MovieClip;
public var life2:MovieClip;
public var life3:MovieClip;
public var Mask:MovieClip;
public var missile:MovieClip;
public function Mg2HUD(X:Number, Y:Number):void{
super();
x = X;
y = Y;
}
public function update(distance:Number, max:Number):void{
var myDis:Number = ((distance * 630) / max);
if (myDis > 630){
myDis = 630;
};
missile.x = myDis;
Mask.width = myDis;
}
}
}//package game.overheadShooter.miniGame
Section 46
//Mg2Player (game.overheadShooter.miniGame.Mg2Player)
package game.overheadShooter.miniGame {
import flash.events.*;
import flash.display.*;
public class Mg2Player extends MovieClip {
public var legs:MovieClip;
var speed:Number;// = 10
public var char:MovieClip;
var counter:Number;// = 0
public function Mg2Player(X:Number, Y:Number):void{
super();
addFrameScript(0, frame1);
x = X;
y = Y;
scaleX = 3;
scaleY = 3;
walk();
}
private function shooting(evt:Event):void{
counter++;
if (counter > 14){
counter = 0;
gotoAndStop("stand");
removeEventListener(Event.ENTER_FRAME, shooting);
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, Scroll);
MovieClip(parent).removeChild(this);
}
private function walk():void{
addEventListener(Event.ENTER_FRAME, walking);
gotoAndStop("stand");
}
function frame1(){
stop();
}
private function Scroll(evt:Event):void{
y = (y + MovieClip(root).scrollSpeedY);
x = (x + MovieClip(root).scrollSpeedX);
}
private function walking(evt:Event):void{
y = (y - speed);
legs.nextFrame();
if (y < 390){
y = 390;
shoot();
addEventListener(Event.ENTER_FRAME, Scroll);
removeEventListener(Event.ENTER_FRAME, walking);
};
}
private function launchMissile():void{
this.dispatchEvent(new Event("MISSILE_LAUNCH", true));
}
private function shoot():void{
addEventListener(Event.ENTER_FRAME, shooting);
gotoAndStop("fire");
launchMissile();
MovieClip(root).enterScreenShake();
}
}
}//package game.overheadShooter.miniGame
Section 47
//Mg3Civ (game.overheadShooter.miniGame.Mg3Civ)
package game.overheadShooter.miniGame {
import flash.events.*;
import flash.display.*;
public class Mg3Civ extends MovieClip {
private var StageWidth:Number;// = 525
public var animation:MovieClip;
private var StageHeight:Number;// = 700
private var toasted:Boolean;// = false
private var speed:Number;// = 5
private var visiRange:Number;// = 25
private var randomRot:Number;// = 30
public var counter:int;// = 0
public function Mg3Civ():void{
super();
addFrameScript(0, frame1);
}
public function remove():void{
var arrayIndex:Number;
if (!toasted){
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
removeEventListener(Event.ENTER_FRAME, everyFrame);
MovieClip(parent).removeChild(this);
};
}
function frame1(){
stop();
}
private function everyFrame(evt:Event):void{
counter++;
x = (x + (Math.cos((((rotation - 90) * Math.PI) / 180)) * speed));
y = (y + (Math.sin((((rotation - 90) * Math.PI) / 180)) * speed));
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
kill();
}
public function kill():void{
var arrayIndex:Number;
if (!toasted){
toasted = true;
removeEventListener(Event.ENTER_FRAME, everyFrame);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills.civiliansBrutalized = (MovieClip(root).stats.kills.civiliansBrutalized + 1);
if (MovieClip(root).stats.kills.civiliansBrutalized > MovieClip(root).stats.totalKills.civiliansBrutalized){
MovieClip(root).stats.totalKills.civiliansBrutalized = MovieClip(root).stats.kills.civiliansBrutalized;
};
if ((((MovieClip(root).stats.kills.civiliansBrutalized >= 100)) && ((MovieClip(root).stats.hacks.ultimaLaser[0] == 0)))){
MovieClip(root).stats.hacks.ultimaLaser[0] = 1;
MovieClip(root).stats.hacksUnlocked = (MovieClip(root).stats.hacksUnlocked + 1);
MovieClip(root).stats.progressPoints = (MovieClip(root).stats.progressPoints + 1);
MovieClip(root).Level.caption("Ultima-Laser Hack Unlocked!\n\n(Toggle Hacks in the Options Menu)", 4);
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent).removeChild(this);
};
}
public function init(rot:Number):void{
randomRot = (randomRot * Math.random());
if (Math.random() > 0.5){
randomRot = (randomRot * -1);
};
rotation = (rot + randomRot);
addEventListener(Event.ENTER_FRAME, everyFrame);
}
}
}//package game.overheadShooter.miniGame
Section 48
//MiniGame2 (game.overheadShooter.miniGame.MiniGame2)
package game.overheadShooter.miniGame {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class MiniGame2 extends MovieClip {
var patrolEnemies:Number;// = 0.25
var levelEnemies:Number;// = 6
var delay:Number;
var obstacles:Array;
var lives:Number;// = 3
var level:Number;// = 0
var travelSpeed:Number;// = 10
var target:Mg2Enemy;
var baseEnemies:Number;// = 18
var originalOffset:Number;// = 600
private var firstTime:Boolean;// = true
var HUD:Mg2HUD;
var npcPlayer:Mg2Player;
var missile:GuidedMissile;
var maxDistance:Number;// = 8755
public function MiniGame2():void{
obstacles = new Array();
super();
}
function shuffle(a:Array):Array{
var temp:*;
var rand:int;
var len:int = a.length;
var i:int = (len - 1);
while (i > 0) {
rand = Math.floor((Math.random() * len));
temp = a[i];
a[i] = a[rand];
a[rand] = temp;
i--;
};
return (a);
}
private function checkCollision(evt:Event):void{
var obstacle:MovieClip;
var arrayIndex:Number;
updateHUD();
var hit:Boolean;
var test:Point = new Point(missile.x, missile.y);
test.x = (test.x + (Math.cos((((missile.rotation - 90) * Math.PI) / 180)) * 44));
test.y = (test.y + (Math.sin((((missile.rotation - 90) * Math.PI) / 180)) * 44));
trace(MovieClip(root).Level.terrain.y);
if (target.hitTestPoint(test.x, test.y, true)){
hit = true;
missile.explode();
target.explode();
nextLevel();
};
for each (obstacle in obstacles) {
if (((obstacle.hitTestPoint(test.x, test.y, true)) && ((hit == false)))){
arrayIndex = obstacles.indexOf(obstacle);
obstacles.splice(arrayIndex, 1);
trace(obstacle.y);
hit = true;
obstacle.explode();
missile.explode();
failure();
};
};
if (hit){
removeEventListener(Event.ENTER_FRAME, checkCollision);
};
}
public function init(setup:Boolean=true):void{
if (setup){
npcPlayer = new Mg2Player(230, 610);
addChild(npcPlayer);
addObstacles();
if (!HUD){
HUD = new Mg2HUD(34, 491);
addChild(HUD);
};
addEventListener("MISSILE_LAUNCH", launchMissile);
MovieClip(root).Level.scrollSpeed(0, travelSpeed);
} else {
npcPlayer.remove();
removeEventListener("MISSILE_LAUNCH", launchMissile);
};
}
private function nextLevel():void{
MovieClip(root).Level.caption("Target Eliminated", 2);
if ((((level == 5)) && ((MovieClip(root).stats.hacks.ultdAmmo[0] == 0)))){
MovieClip(root).stats.hacksUnlocked = (MovieClip(root).stats.hacksUnlocked + 1);
MovieClip(root).stats.progressPoints = (MovieClip(root).stats.progressPoints + 1);
MovieClip(root).stats.hacks.ultdAmmo[0] = 1;
MovieClip(root).Level.caption("Unlimited Ammo Unlocked!\n\n(Toggle Hacks in the Options Menu)", 4);
};
MovieClip(root).Level.scrollSpeed(0, 0);
MovieClip(root).setMusic("victory", 1);
delay = 31;
addEventListener(Event.ENTER_FRAME, resetLevel);
init(false);
}
private function failure():void{
HUD[("life" + lives)].gotoAndStop("dead");
lives--;
MovieClip(root).Level.caption((("You have " + lives) + " chances left"), 2);
if (lives == 1){
MovieClip(root).Level.caption((("You have " + lives) + " chance left"), 2);
};
MovieClip(root).Level.scrollSpeed(0, 0);
level--;
MovieClip(root).setMusic("death", 1);
delay = 31;
init(false);
if (lives > 0){
addEventListener(Event.ENTER_FRAME, resetLevel);
} else {
MovieClip(root).endLevel();
addEventListener(Event.ENTER_FRAME, killThis);
MovieClip(root).Level.removeMiniGameListeners();
};
}
private function launchMissile(evt:Event):void{
if (firstTime){
firstTime = false;
} else {
MovieClip(root).setMusic("stage");
};
MovieClip(root).setMusic("stage");
MovieClip(root).SFX("sfxRocket");
missile = new GuidedMissile((npcPlayer.x + 20), (npcPlayer.y - 60));
MovieClip(root).Level.addChild(missile);
missile.fly();
addEventListener(Event.ENTER_FRAME, checkCollision);
}
public function addObstacles():void{
var obRef:MovieClip;
var obstacle:Mg2Civ;
var obstacle2:Mg2Civ;
var iiii:* = (obstacles.length - 1);
while (iiii > -1) {
obRef = obstacles[iiii];
obstacles.pop();
obRef.remove();
iiii--;
};
if (MovieClip(root).stats.totalKills.assassinationLevel < level){
MovieClip(root).stats.totalKills.assassinationLevel = level;
};
MovieClip(root).stats.kills.assassinationLevel = level;
level++;
MovieClip(root).Level.caption(("Level " + level.toString()), 2);
var standingObstacles:Number = (baseEnemies + (level * levelEnemies));
var movingObstacles:Number = Math.floor((standingObstacles * patrolEnemies));
if (movingObstacles > 0){
standingObstacles = (standingObstacles - movingObstacles);
};
var ii:* = standingObstacles;
while (ii > 0) {
obstacle = new Mg2Civ();
obstacles.push(obstacle);
ii--;
};
var iii:* = movingObstacles;
while (iii > 0) {
obstacle2 = new Mg2Civ("patrol");
obstacles.push(obstacle2);
iii--;
};
obstacles = shuffle(obstacles);
var spacer:Number = ((maxDistance - originalOffset) / (obstacles.length + 1));
var i:* = (obstacles.length - 1);
while (i > -1) {
obstacles[i].x = (20 + (Math.random() * (MovieClip(root).stage.stageWidth - 40)));
trace((obstacles[i].x + "<- starting spot"));
obstacles[i].y = (-1 * (originalOffset + (spacer * i)));
MovieClip(root).Level.addChild(obstacles[i]);
i--;
};
if (target){
target.remove();
};
target = new Mg2Enemy();
target.x = (MovieClip(root).stage.stageWidth / 2);
target.y = -(maxDistance);
MovieClip(root).Level.addChild(target);
}
private function killThis(evt:Event):void{
var obstacle:MovieClip;
delay--;
if (delay <= 0){
for each (obstacle in obstacles) {
obstacle.remove();
};
if (target){
target.remove();
};
removeEventListener(Event.ENTER_FRAME, killThis);
MovieClip(parent).removeChild(this);
};
}
private function updateHUD():void{
var distance:Number = MovieClip(root).Level.terrain.y;
var max:Number = 8850;
HUD.update(distance, max);
}
private function resetLevel(evt:Event):void{
var obstacle:MovieClip;
var arrayIndex:Number;
if (delay > 0){
delay--;
} else {
if (delay == 0){
MovieClip(root).Level.scrollSpeed(0, (-(travelSpeed) * 5));
};
for each (obstacle in obstacles) {
if (obstacle.hitTestObject(target)){
arrayIndex = obstacles.indexOf(obstacle);
obstacles.splice(arrayIndex, 1);
obstacle.explode();
};
};
};
if (MovieClip(root).Level.terrain.y <= 0){
MovieClip(root).Level.terrain.y = 0;
removeEventListener(Event.ENTER_FRAME, resetLevel);
init();
};
updateHUD();
}
}
}//package game.overheadShooter.miniGame
Section 49
//MiniGame3 (game.overheadShooter.miniGame.MiniGame3)
package game.overheadShooter.miniGame {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class MiniGame3 extends MovieClip {
private var delay:Number;// = 31
private var boundsRange:Number;// = 80
var FrameRate:int;// = 31
private var StageWidth:Number;// = 700
var maxAmmo:int;// = 6
var ammo:int;
var char:RazorTank;
var HUD:Mg3HUD;
var spawnEvery:int;// = 15
private var StageHeight:Number;// = 525
var maxCivs:int;// = 15
private var cooldown:Number;// = 0
private var heat:Number;// = 155
var counter:int;// = 0
var gameLength:int;// = 60
public function MiniGame3():void{
ammo = maxAmmo;
super();
}
function updateCursorLocation(cursorDistance:Number):void{
var mouseLocation:Point = new Point(MovieClip(root).cursor.x, MovieClip(root).cursor.y);
var charLocation:Point = new Point(char.x, char.y);
var xDis:Number = (charLocation.x - mouseLocation.x);
var yDis:Number = (charLocation.y - mouseLocation.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).cursor.helper.rotation = (((angle * 180) / Math.PI) - 90);
MovieClip(root).cursor.helper.alpha = ((cursorDistance - 100) / 100);
}
private function everyFrame(evt:Event):void{
var civ2:*;
var civ:*;
counter++;
if (((((counter % spawnEvery) == 0)) && ((MovieClip(root).monsterArray.length < maxCivs)))){
spawnCiv();
};
if ((counter % FrameRate) == 0){
updateHUD();
};
updateCursorLocation(Point.distance(new Point(mouseX, mouseY), new Point(char.x, char.y)));
for each (civ2 in MovieClip(root).monsterArray) {
if (char.blade.hitTestObject(civ2)){
civ2.kill();
updateHUD();
if (char.blade.currentFrame < char.blade.totalFrames){
char.blade.nextFrame();
};
};
};
for each (civ in MovieClip(root).monsterArray) {
if (civ.counter > 80){
if ((((((((civ.x > (boundsRange + StageWidth))) || ((civ.x < -(boundsRange))))) || ((civ.y > (boundsRange + StageHeight))))) || ((civ.y < -(boundsRange))))){
civ.remove();
};
};
};
if (cooldown > 0){
cooldown--;
} else {
if (ammo < maxAmmo){
ammo++;
cooldown = heat;
MovieClip(root).SFX("sfxSwitch");
};
};
var timePassed:Number = Math.floor((counter / FrameRate));
var timeLeft:Number = (gameLength - timePassed);
if (timeLeft <= 0){
end();
};
}
private function end():void{
MovieClip(root).endLevel();
removeEventListener(Event.ENTER_FRAME, everyFrame);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, fireRocket);
addEventListener(Event.ENTER_FRAME, killThis);
MovieClip(root).Level.removeMiniGameListeners();
}
public function init(setup:Boolean=true):void{
if (setup){
char = new RazorTank(350, 263);
MovieClip(root).Level.addChild(char);
char.setup();
HUD = new Mg3HUD();
addChild(HUD);
addEventListener(Event.ENTER_FRAME, everyFrame);
stage.addEventListener(MouseEvent.MOUSE_DOWN, fireRocket);
MovieClip(root).gameMouseSetup();
MovieClip(root).cursorSwitch("rocket");
};
}
private function killThis(evt:Event):void{
delay--;
if (delay <= 0){
removeEventListener(Event.ENTER_FRAME, killThis);
char.remove();
MovieClip(parent).removeChild(this);
};
}
private function fireRocket(evt:Event):void{
var mouseLocation:Point;
var charLocation:Point;
var xDis:Number;
var yDis:Number;
var angle:Number;
if (ammo > 0){
ammo--;
updateHUD();
mouseLocation = new Point(MovieClip(root).cursor.x, MovieClip(root).cursor.y);
charLocation = new Point(char.x, char.y);
xDis = (charLocation.x - mouseLocation.x);
yDis = (charLocation.y - mouseLocation.y);
angle = Math.atan2(yDis, xDis);
MovieClip(root).shootScatter(char.x, char.y, (((angle * 180) / Math.PI) - 90));
};
}
private function spawnCiv():void{
var randomY:Number;
var monster:Mg3Civ = new Mg3Civ();
var fiftyFifty:Number = Math.random();
var spacer:Number = 100;
var randomX:Number = ((StageWidth + spacer) * Math.random());
randomY = ((StageHeight + spacer) * Math.random());
var align:Number = (spacer / 2);
if (fiftyFifty < 0.25){
monster.x = (randomX - align);
monster.y = -(spacer);
} else {
if (fiftyFifty < 0.5){
monster.x = (StageWidth + spacer);
monster.y = (randomY - align);
} else {
if (fiftyFifty < 0.75){
monster.x = (randomX - align);
monster.y = (StageHeight + spacer);
} else {
monster.x = -(spacer);
monster.y = (randomY - align);
};
};
};
MovieClip(root).Level.addChild(monster);
MovieClip(root).monsterArray.push(monster);
var xDis:Number = (monster.x - 350);
var yDis:Number = (monster.y - 263);
var angle:Number = Math.atan2(yDis, xDis);
var thisRotation:Number = (((angle * 180) / Math.PI) - 90);
monster.init(thisRotation);
}
private function updateHUD():void{
var missile:MovieClip;
var visi:Boolean;
trace("updating hud");
var timePassed:Number = Math.floor((counter / FrameRate));
var timeLeft:Number = (gameLength - timePassed);
HUD.txtTime.text = ("Time left: " + timeLeft);
HUD.txtKills.text = (MovieClip(root).stats.kills.civiliansBrutalized + " civilians brutalized");
var i:int = maxAmmo;
while (i > 0) {
missile = HUD[("missile" + i)];
visi = ((i)<=ammo) ? true : false;
missile.visible = visi;
i--;
};
}
function shuffle(a:Array):Array{
var temp:*;
var rand:int;
var len:int = a.length;
var i:int = (len - 1);
while (i > 0) {
rand = Math.floor((Math.random() * len));
temp = a[i];
a[i] = a[rand];
a[rand] = temp;
i--;
};
return (a);
}
}
}//package game.overheadShooter.miniGame
Section 50
//RazorTank (game.overheadShooter.miniGame.RazorTank)
package game.overheadShooter.miniGame {
import flash.events.*;
import flash.display.*;
import com.senocular.utils.*;
public class RazorTank extends MovieClip {
private var acceleration:Number;// = 2
private var maxTurn:Number;// = 6
private var maxSpeed:Number;// = 8
private var speed:Number;// = 0
var moveRight:Number;// = 68
var moveUp:Number;// = 87
var moveDown:Number;// = 83
public var blade:MovieClip;
var key:KeyObject;
private var turningAcceleration:Number;// = 1
public var treadLeft:MovieClip;
public var treadRight:MovieClip;
var moveLeft:Number;// = 65
private var turn:Number;// = 0
public function RazorTank(X:Number, Y:Number):void{
super();
x = X;
y = Y;
}
public function setup():void{
key = new KeyObject(stage);
checkControls();
this.addEventListener(Event.ENTER_FRAME, everyFrame);
}
private function everyFrame(evt:Event):void{
blade.rotation = (blade.rotation + 10);
if (key.isDown(moveUp)){
speed = (speed + acceleration);
};
if (key.isDown(moveDown)){
speed = (speed - acceleration);
};
if (key.isDown(moveRight)){
turn = (turn + turningAcceleration);
};
if (key.isDown(moveLeft)){
turn = (turn - turningAcceleration);
};
if (speed > maxSpeed){
speed = maxSpeed;
};
if (speed < -(maxSpeed)){
speed = -(maxSpeed);
};
if (turn > maxTurn){
turn = maxTurn;
};
if (turn < -(maxTurn)){
turn = -(maxTurn);
};
var thisTurn:Number = ((turn * speed) / maxSpeed);
if (speed > 0){
rotation = (rotation + thisTurn);
treadRight.nextFrame();
treadLeft.nextFrame();
};
if (speed < 0){
rotation = (rotation - thisTurn);
treadRight.prevFrame();
treadLeft.prevFrame();
};
x = (x + (Math.cos((((this.rotation + 90) * Math.PI) / 180)) * speed));
y = (y + (Math.sin((((this.rotation + 90) * Math.PI) / 180)) * speed));
checkBounds();
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, everyFrame);
MovieClip(parent).removeChild(this);
}
function checkBounds():void{
if (this.x < 0){
this.x = 0;
};
if (this.x > 700){
this.x = 700;
};
if (this.y < 0){
this.y = 0;
};
if (this.y > 525){
this.y = 525;
};
}
public function checkControls():void{
moveLeft = MovieClip(root).stats.moveLeft;
moveRight = MovieClip(root).stats.moveRight;
moveUp = MovieClip(root).stats.moveUp;
moveDown = MovieClip(root).stats.moveDown;
}
}
}//package game.overheadShooter.miniGame
Section 51
//Helicopter (game.overheadShooter.misc.Helicopter)
package game.overheadShooter.misc {
import flash.events.*;
import flash.display.*;
public class Helicopter extends MovieClip {
var explode:Boolean;// = false
var delay:Number;// = 5
var speed:Number;// = 100
var exitSpeed:Number;// = 0.5
var pickupSpeed:Number;// = 20
var alreadySpeeding:Boolean;// = false
public var blades:MovieClip;
public function Helicopter(explode:Boolean=false):void{
super();
this.explode = explode;
}
public function chill():void{
removeEventListener(Event.ENTER_FRAME, flyOff);
removeEventListener(Event.ENTER_FRAME, fly);
speed = 0;
}
public function coast(setup:Boolean):void{
if (setup == true){
addEventListener(Event.ENTER_FRAME, drift);
} else {
removeEventListener(Event.ENTER_FRAME, drift);
};
}
public function ExitScreen():void{
speed = 0;
addEventListener(Event.ENTER_FRAME, flyOff);
}
function drift(evt:Event):void{
this.y = (this.y + 0.5);
MovieClip(root).introScreen.terrain.y = (MovieClip(root).introScreen.terrain.y - 12);
}
public function speedUp():void{
addEventListener(Event.ENTER_FRAME, fly);
}
function flyOff(evt:Event):void{
if (delay > 0){
delay = (delay - 1);
} else {
delay--;
if (delay == -20){
MovieClip(root).setMusic("stage");
};
if (alreadySpeeding == false){
alreadySpeeding = true;
speedUp();
};
if (speed >= 150){
this.scaleX = (this.scaleX + 0.01);
this.scaleY = (this.scaleY + 0.01);
};
if (this.scaleX > 0.9){
this.y = (this.y + exitSpeed);
exitSpeed = (exitSpeed + 0.5);
};
if (this.y > 690){
chill();
MovieClip(parent).removeChild(this);
};
};
}
function fly(evt:Event):void{
if (speed < 150){
speed = (speed + 5);
};
blades.rotation = (blades.rotation + speed);
if (speed < 90){
blades.gotoAndStop(1);
} else {
blades.gotoAndStop(2);
};
}
function flyIn(evt:Event):void{
if (pickupSpeed > 0){
this.y = (this.y + pickupSpeed);
pickupSpeed = (pickupSpeed - 0.5);
};
if (this.scaleX > 0.7){
this.scaleX = (this.scaleX - 0.005);
this.scaleY = (this.scaleY - 0.005);
} else {
delay = 310;
removeEventListener(Event.ENTER_FRAME, flyIn);
removeEventListener(Event.ENTER_FRAME, fly);
addEventListener(Event.ENTER_FRAME, land);
};
}
public function EnterScreen():void{
speed = 100;
speedUp();
addEventListener(Event.ENTER_FRAME, flyIn);
MovieClip(root).setMusic("victory", 1);
}
function land(evt:Event):void{
if (speed > 0){
speed = (speed - 5);
} else {
if (delay == 310){
if (!explode){
MovieClip(root).endLevel();
};
};
delay = (delay - 1);
};
if (delay == 290){
if (explode){
trace("explode here");
removeEventListener(Event.ENTER_FRAME, land);
MovieClip(parent).removeChild(this);
};
};
blades.rotation = (blades.rotation + speed);
if (speed < 90){
blades.gotoAndStop(1);
} else {
blades.gotoAndStop(2);
};
if (delay < 0){
trace("gg pls");
removeEventListener(Event.ENTER_FRAME, land);
MovieClip(parent).removeChild(this);
};
}
}
}//package game.overheadShooter.misc
Section 52
//Pickup (game.overheadShooter.misc.Pickup)
package game.overheadShooter.misc {
import flash.events.*;
import flash.display.*;
public class Pickup extends MovieClip {
var thisGift:String;// = ""
public function Pickup():void{
super();
addEventListener(Event.ENTER_FRAME, checkForPickup);
}
function checkBounds():void{
if (this.x < -40){
remove();
} else {
if (this.x > (MovieClip(root).StageWidth + 40)){
remove();
} else {
if (this.y < -40){
remove();
} else {
if (this.y > (MovieClip(root).StageHeight + 40)){
remove();
};
};
};
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, checkForPickup);
var arrayIndex:Number = MovieClip(root).pickupArray.indexOf(this);
MovieClip(root).pickupArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function Is(gift:String):void{
thisGift = gift;
this.gotoAndStop(gift);
}
function pickUp():void{
MovieClip(root).SFX("sfxPickup");
if (thisGift == "auto"){
MovieClip(root).stats.ammoAuto = (MovieClip(root).stats.ammoAuto + 20);
if (MovieClip(root).stats.ammoAuto <= 20){
MovieClip(root).char.gunSwitch("auto");
};
} else {
if (thisGift == "laser"){
MovieClip(root).stats.ammoLaser = (MovieClip(root).stats.ammoLaser + 15);
if (MovieClip(root).stats.ammoLaser <= 15){
MovieClip(root).char.gunSwitch("laser");
};
} else {
if (thisGift == "rocket"){
MovieClip(root).stats.ammoRocket = (MovieClip(root).stats.ammoRocket + 3);
if (MovieClip(root).stats.ammoRocket <= 3){
MovieClip(root).char.gunSwitch("rocket");
};
} else {
if (thisGift == "scatter"){
MovieClip(root).stats.ammoScatter = (MovieClip(root).stats.ammoScatter + 3);
if (MovieClip(root).stats.ammoScatter <= 3){
MovieClip(root).char.gunSwitch("scatter");
};
} else {
if (thisGift == "mine"){
MovieClip(root).stats.ammoMine = (MovieClip(root).stats.ammoMine + 3);
if (MovieClip(root).stats.ammoMine <= 3){
MovieClip(root).char.nadeSwitch("mine");
};
} else {
if (thisGift == "healthSmall"){
MovieClip(root).char.damage(-20, 0, 0);
} else {
if (thisGift == "healthLarge"){
MovieClip(root).char.damage(-40, 0, 0);
} else {
if (thisGift == "poison"){
MovieClip(root).stats.ammoPoison = (MovieClip(root).stats.ammoPoison + 3);
if (MovieClip(root).stats.ammoPoison <= 3){
MovieClip(root).char.nadeSwitch("poison");
};
} else {
if (thisGift == "bow"){
MovieClip(root).stats.ammoBow = (MovieClip(root).stats.ammoBow + 15);
if (MovieClip(root).stats.ammoBow <= 15){
MovieClip(root).char.gunSwitch("bow");
};
} else {
if (thisGift == "shotgun"){
MovieClip(root).stats.ammoShotgun = (MovieClip(root).stats.ammoShotgun + 15);
if (MovieClip(root).stats.ammoShotgun <= 15){
MovieClip(root).char.gunSwitch("shotgun");
};
} else {
if (thisGift == "flashBang"){
MovieClip(root).stats.ammoFlashBang = (MovieClip(root).stats.ammoFlashBang + 3);
if (MovieClip(root).stats.ammoFlashBang <= 3){
MovieClip(root).char.nadeSwitch("flashBang");
};
} else {
if (thisGift == "flame"){
MovieClip(root).stats.ammoFlame = (MovieClip(root).stats.ammoFlame + 8);
if (MovieClip(root).stats.ammoFlame <= 8){
MovieClip(root).char.gunSwitch("flame");
};
};
};
};
};
};
};
};
};
};
};
};
};
remove();
}
function checkForPickup(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
this.rotation = (this.rotation + 2);
if (this.hitTestObject(MovieClip(root).char.hitZone)){
removeEventListener(Event.ENTER_FRAME, checkForPickup);
pickUp();
} else {
checkBounds();
};
}
}
}//package game.overheadShooter.misc
Section 53
//Player (game.overheadShooter.misc.Player)
package game.overheadShooter.misc {
import gs.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Player extends MovieClip {
var gunMax:Point;
var gunFrame:String;// = "autoFire"
var moveDown:Number;// = 83
var seven:Number;// = 55
var bulletAccuracy:Number;// = 0.02
public var legs:MovieClip;
var sevenNum:Number;// = 103
private var gunToggleCooldown:int;
var shotgunPush:Number;// = 10
var grenadeAniReset:Boolean;// = false
public var speed:Number;// = 4
var moveUp:Number;// = 87
var two:Number;// = 50
var playerBeingHit:Boolean;// = false
var autoCoolDown:Number;// = 0
var one:Number;// = 49
var scatterCoolDown:Number;// = 0
public var dead:Boolean;// = false
var eightNum:Number;// = 104
var rocketCoolDown:Number;// = 0
var bulletIncrement:Number;
var eight:Number;// = 56
var toggleWeapon:Number;// = 81
var dir:Number;
var autoPower:Number;// = 5
var energy:Number;// = 0
var ammoLaser:Number;// = 30
var shotgunPower:Number;// = 18
public var playerHealth:Number;// = 100
var zero:Number;// = 48
var five:Number;// = 53
var inertia:Number;
var fourNum:Number;// = 100
var nine:Number;// = 57
var moveRight:Number;// = 68
var nextGrenade:Number;// = 69
private var toggleCooldown:int;// = 10
var six:Number;// = 54
var actions:Object;
var threeNum:Number;// = 99
var diagonalSpeed:Number;
var monsterIndex:Number;// = 0
var optionsMenu:Number;// = 79
var nadeCoolDown:Number;// = 0
var four:Number;// = 52
var totalMonsters:Number;// = 0
public var gun:String;// = "auto"
var sixNum:Number;// = 102
var oneNum:Number;// = 97
var nextGun:Number;// = 81
public var grenade:String;// = "poison"
var firingAnimation:Boolean;// = false
public var char:MovieClip;
var monsterHit:Boolean;// = false
var fireLeft:Number;// = 74
var autoPush:Number;// = 1.5
var fireUp:Number;// = 73
private var hacks:Object;
var firing:Boolean;// = false
var fiveNum:Number;// = 101
var bowCoolDown:Number;// = 0
var laserCoolDown:Number;// = 0
var moveLeft:Number;// = 65
private var nadeToggleCooldown:int;
var nineNum:Number;// = 105
var fireRight:Number;// = 76
var throwGrenade:Number;// = 32
var delay:Number;
var bulletP:Point;
var twoNum:Number;// = 98
var ammoAuto:Number;// = 500
var three:Number;// = 51
var legRotation:Number;// = 0
var shotgunCoolDown:Number;// = 0
var playerLocation:Point;
var zeroNum:Number;// = 96
var gunRange:Number;// = 500
var flameCoolDown:Number;// = 0
public var hitZone:MovieClip;
var mouseIsDown:Boolean;// = false
var fireDown:Number;// = 75
public function Player():void{
diagonalSpeed = (speed * 0.75);
gunMax = new Point(0, 0);
bulletP = new Point(0, 0);
bulletIncrement = bulletAccuracy;
playerLocation = new Point(0, 0);
actions = new Object();
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25, 25, frame26, 26, frame27, 27, frame28, 28, frame29, 29, frame30, 30, frame31, 31, frame32, 32, frame33, 33, frame34, 34, frame35, 45, frame46, 46, frame47, 47, frame48, 48, frame49, 49, frame50, 50, frame51);
}
public function endow():void{
root.addEventListener(MouseEvent.MOUSE_DOWN, setFire);
firing = false;
mouseIsDown = false;
checkControls();
}
private function deathCountdown(evt:Event):void{
if (delay > 0){
delay--;
} else {
removeEventListener(Event.ENTER_FRAME, deathCountdown);
MovieClip(root).endLevel();
};
}
function shoot():void{
if (gun == "auto"){
fireAuto();
} else {
if (gun == "laser"){
fireLaser();
} else {
if (gun == "scatter"){
fireScatter();
} else {
if (gun == "rocket"){
fireRocket();
} else {
if (gun == "shotgun"){
fireShotgun();
} else {
if (gun == "bow"){
fireBow();
} else {
if (gun == "flame"){
fireFlame();
};
};
};
};
};
};
};
}
function fireLaser():void{
if (firingAnimation == false){
firingAnimation = true;
this.gotoAndPlay(gunFrame);
};
if (laserCoolDown < 1){
laserCoolDown = 9;
MovieClip(root).shootLaser(this.x, this.y, this.rotation, MovieClip(root).stats.gunLevels["2"]);
MovieClip(root).SFX("sfxLaser");
if (MovieClip(root).stats.ammoLaser > 1){
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoLaser = (MovieClip(root).stats.ammoLaser - 1);
};
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoLaser.toString();
} else {
MovieClip(root).stats.ammoLaser = (MovieClip(root).stats.ammoLaser - 1);
laserCoolDown = 0;
gunSwitch("auto");
};
};
laserCoolDown = (laserCoolDown - 1);
}
public function slowPlayer():void{
if ((speed - 2) > 2){
speed = (speed - 2);
} else {
speed = 2;
};
diagonalSpeed = (speed * 0.75);
}
function frame11(){
stop();
}
function frame12(){
stop();
}
function frame13(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("rocket");
char.nade.gotoAndStop("flashBang");
}
function frame14(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("rocket");
char.nade.gotoAndStop("poison");
}
function frame15(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("rocket");
char.nade.gotoAndStop("mine");
}
function frame16(){
stop();
}
function updateCursorLocation(cursorDistance:Number):void{
MovieClip(root).cursor.helper.rotation = rotation;
MovieClip(root).cursor.helper.alpha = ((cursorDistance - 100) / 100);
}
function frame19(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("scatter");
char.nade.gotoAndStop("poison");
}
function grenadeCheck():void{
if (MovieClip(root).stats.ammoFlashBang > 0){
nadeSwitch("flashBang");
} else {
if (MovieClip(root).stats.ammoPoison > 0){
nadeSwitch("poison");
} else {
if (MovieClip(root).stats.ammoMine > 0){
nadeSwitch("mine");
} else {
resetHud();
};
};
};
}
function frame17(){
stop();
}
function frame18(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("scatter");
char.nade.gotoAndStop("flashBang");
}
function frame10(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("laser");
char.nade.gotoAndStop("mine");
}
function frame2(){
stop();
}
function frame4(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("auto");
char.nade.gotoAndStop("poison");
}
function frame5(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("auto");
char.nade.gotoAndStop("mine");
}
function frame7(){
stop();
}
function frame9(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("laser");
char.nade.gotoAndStop("poison");
}
function frame3(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("auto");
char.nade.gotoAndStop("flashBang");
}
function frame23(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("shotgun");
char.nade.gotoAndStop("flashBang");
}
function frame24(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("shotgun");
char.nade.gotoAndStop("poison");
}
function switchWeapon():void{
if (gun == "auto"){
gun = "laser";
gunFrame = "laserFire";
this.gotoAndStop(gun);
} else {
if (gun == "laser"){
gun = "auto";
gunFrame = "autoFire";
this.gotoAndStop(gun);
};
};
firingAnimation = false;
}
function frame26(){
stop();
}
function frame1(){
stop();
}
function frame22(){
stop();
}
function frame6(){
stop();
}
function frame27(){
stop();
}
function frame21(){
stop();
}
public function setup():void{
this.visible = true;
dead = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, abilityCheck);
this.addEventListener(Event.ENTER_FRAME, everyFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, abilityCheck);
root.addEventListener(MouseEvent.MOUSE_DOWN, setFire);
root.addEventListener(MouseEvent.MOUSE_UP, killFire);
stage.removeEventListener(KeyboardEvent.KEY_UP, checkMovement);
stage.addEventListener(KeyboardEvent.KEY_UP, checkMovement);
resetHud();
autoPush = (0.5 + MovieClip(root).stats.gunLevels[1]);
if (MovieClip(root).stats.specialLevels["2"] > 1){
energy = (MovieClip(root).stats.specialLevels["2"] * 15);
};
speed = (3 + MovieClip(root).stats.specialLevels["3"]);
diagonalSpeed = (speed * 0.75);
hacks = MovieClip(root).stats.hacks;
if (hacks.suicide[0] == 2){
playerHealth = 1;
energy = 0;
};
if (hacks.fancyFeet[0] == 2){
speed = (speed * 2);
diagonalSpeed = (speed * 0.75);
};
if (hacks.mushroom[0] == 2){
TweenLite.to(this, 0, {tint:(0xFF00 * Math.random())});
} else {
TweenLite.to(this, 0, {tint:null});
};
}
private function cycleGun():void{
var guns:Object;
var gunIndex:int;
var ammo:Array;
var gunFound:Boolean;
var nextGun:int;
var weapon:*;
if (gunToggleCooldown == 0){
gunToggleCooldown = toggleCooldown;
guns = {auto:0, laser:1, shotgun:2, bow:3, flame:4, scatter:5, rocket:6};
gunIndex = guns[gun];
ammo = [MovieClip(root).stats.ammoAuto, MovieClip(root).stats.ammoLaser, MovieClip(root).stats.ammoShotgun, MovieClip(root).stats.ammoBow, MovieClip(root).stats.ammoFlame, MovieClip(root).stats.ammoScatter, MovieClip(root).stats.ammoRocket];
nextGun = gunIndex;
while (!(gunFound)) {
nextGun++;
nextGun = (nextGun % ammo.length);
if ((((ammo[nextGun] > 0)) || ((nextGun == 0)))){
gunFound = true;
};
};
for (weapon in guns) {
if (guns[weapon] == nextGun){
gunSwitch(weapon);
};
};
};
}
function frame8(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("laser");
char.nade.gotoAndStop("flashBang");
}
public function remove():void{
this.removeEventListener(Event.ENTER_FRAME, everyFrame);
}
function frame30(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("bow");
char.nade.gotoAndStop("mine");
}
function frame28(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("bow");
char.nade.gotoAndStop("flashBang");
}
function frame29(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("bow");
char.nade.gotoAndStop("poison");
}
function frame25(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("shotgun");
char.nade.gotoAndStop("mine");
}
function frame32(){
stop();
}
function frame34(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("flame");
char.nade.gotoAndStop("poison");
}
public function gunSwitch(gunType:String):void{
if (gunType != gun){
gun = gunType;
gunFrame = (gunType + "Fire");
firingAnimation = false;
MovieClip(root).cursorSwitch(gun);
};
resetHud();
}
function frame35(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("flame");
char.nade.gotoAndStop("mine");
}
function frame31(){
stop();
}
function frame33(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("flame");
char.nade.gotoAndStop("flashBang");
}
public function castrate():void{
root.removeEventListener(MouseEvent.MOUSE_DOWN, setFire);
firing = false;
mouseIsDown = false;
throwGrenade = 9999;
optionsMenu = 9999;
}
function frame46(){
stop();
}
function frame47(){
stop();
}
function fireRocket():void{
if (firingAnimation == false){
firingAnimation = true;
this.gotoAndPlay(gunFrame);
};
if ((((rocketCoolDown < 1)) && ((nadeCoolDown < 1)))){
rocketCoolDown = 14;
MovieClip(root).shootRocket(this.x, this.y, this.rotation);
MovieClip(root).SFX("sfxRocket");
if (MovieClip(root).stats.ammoRocket > 1){
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoRocket = (MovieClip(root).stats.ammoRocket - 1);
};
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoRocket.toString();
} else {
MovieClip(root).stats.ammoRocket = (MovieClip(root).stats.ammoRocket - 1);
rocketCoolDown = 0;
gunSwitch("auto");
};
};
rocketCoolDown = (rocketCoolDown - 1);
}
function tossGrenade():void{
if (nadeCoolDown < 1){
if ((((((MovieClip(root).stats.ammoFlashBang > 0)) || ((MovieClip(root).stats.ammoPoison > 0)))) || ((MovieClip(root).stats.ammoMine > 0)))){
grenadeAniReset = true;
gotoAndStop(((gun + grenade) + "Throw"));
nadeCoolDown = 8;
};
};
}
function fireFlame():void{
if (firingAnimation == false){
firingAnimation = true;
this.gotoAndPlay(gunFrame);
};
if ((((flameCoolDown < 1)) && ((nadeCoolDown < 1)))){
flameCoolDown = 6;
MovieClip(root).shootFlame(this.x, this.y, this.rotation);
MovieClip(root).SFX("sfxFlame");
if (MovieClip(root).stats.ammoFlame > 1){
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoFlame = (MovieClip(root).stats.ammoFlame - 1);
};
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoFlame.toString();
} else {
MovieClip(root).stats.ammoFlame = (MovieClip(root).stats.ammoFlame - 1);
flameCoolDown = 0;
gunSwitch("auto");
};
};
flameCoolDown = (flameCoolDown - 1);
}
function frame48(){
stop();
}
function killFire(evt:MouseEvent):void{
mouseIsDown = false;
}
function frame20(){
stop();
char.gotoAndPlay(1);
char.gun.gotoAndStop("scatter");
char.nade.gotoAndStop("mine");
}
function frame51(){
stop();
}
function frame50(){
stop();
}
function frame49(){
stop();
}
function fireShotgun():void{
var shotgunDmg:*;
if (firingAnimation == false){
firingAnimation = true;
this.gotoAndPlay(gunFrame);
};
if ((((shotgunCoolDown < 1)) && ((nadeCoolDown < 1)))){
shotgunCoolDown = 12;
gunMax.x = (this.x - (Math.cos((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
gunMax.y = (this.y - (Math.sin((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
playerLocation.x = this.x;
playerLocation.y = this.y;
bulletAccuracy = bulletIncrement;
totalMonsters = MovieClip(root).monsterArray.length;
MovieClip(root).SFX("sfxShotgun");
if (totalMonsters > 0){
do {
monsterIndex = -1;
bulletAccuracy = (bulletAccuracy + bulletIncrement);
bulletP = Point.interpolate(gunMax, playerLocation, bulletAccuracy);
do {
monsterIndex = (monsterIndex + 1);
if (MovieClip(root).monsterArray[monsterIndex].hitTestPoint(bulletP.x, bulletP.y, true) == true){
shotgunDmg = shotgunPower;
if (MovieClip(root).stats.gunLevels["3"] > 1){
MovieClip(root).smallExplosion(MovieClip(root).monsterArray[monsterIndex].x, MovieClip(root).monsterArray[monsterIndex].y);
shotgunDmg = (shotgunDmg + 5);
};
MovieClip(root).monsterArray[monsterIndex].damage(shotgunDmg, shotgunPush, this.rotation);
monsterHit = true;
};
} while ((((monsterHit == false)) && ((monsterIndex < (totalMonsters - 1)))));
} while ((((monsterHit == false)) && ((bulletAccuracy < 1))));
if (monsterHit == false){
if (MovieClip(root).stats.gunLevels["3"] > 1){
MovieClip(root).smallExplosion(gunMax.x, gunMax.y);
};
MovieClip(root).smokeTrail(gunMax.x, gunMax.y);
};
if (MovieClip(root).stats.ammoShotgun > 1){
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoShotgun = (MovieClip(root).stats.ammoShotgun - 1);
};
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoShotgun.toString();
} else {
MovieClip(root).stats.ammoShotgun = (MovieClip(root).stats.ammoShotgun - 1);
shotgunCoolDown = 0;
gunSwitch("auto");
};
};
monsterHit = false;
};
shotgunCoolDown = (shotgunCoolDown - 1);
}
function fireAuto():void{
if (firingAnimation == false){
firingAnimation = true;
this.gotoAndPlay(gunFrame);
};
if ((((autoCoolDown < 1)) && ((nadeCoolDown < 1)))){
autoCoolDown = 3;
gunMax.x = (this.x - (Math.cos((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
gunMax.y = (this.y - (Math.sin((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
playerLocation.x = this.x;
playerLocation.y = this.y;
bulletAccuracy = bulletIncrement;
totalMonsters = MovieClip(root).monsterArray.length;
MovieClip(root).SFX("sfxAuto");
if (totalMonsters > 0){
do {
monsterIndex = -1;
bulletAccuracy = (bulletAccuracy + bulletIncrement);
bulletP = Point.interpolate(gunMax, playerLocation, bulletAccuracy);
do {
monsterIndex = (monsterIndex + 1);
if (MovieClip(root).monsterArray[monsterIndex].hitTestPoint(bulletP.x, bulletP.y, true) == true){
if (MovieClip(root).stats.ammoAuto > 0){
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoAuto = (MovieClip(root).stats.ammoAuto - 1);
};
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoAuto.toString();
MovieClip(root).monsterArray[monsterIndex].damage(autoPower, autoPush, this.rotation);
} else {
MovieClip(root).monsterArray[monsterIndex].damage((autoPower / 2), autoPush, this.rotation);
};
monsterHit = true;
};
} while ((((monsterHit == false)) && ((monsterIndex < (totalMonsters - 1)))));
} while ((((monsterHit == false)) && ((bulletAccuracy < 1))));
if ((((monsterHit == false)) && ((MovieClip(root).stats.ammoAuto > 0)))){
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoAuto = (MovieClip(root).stats.ammoAuto - 1);
};
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoAuto.toString();
MovieClip(root).smokeTrail(gunMax.x, gunMax.y);
} else {
if (monsterHit == false){
MovieClip(root).smokeTrail(gunMax.x, gunMax.y);
};
};
if (MovieClip(root).stats.ammoAuto == 0){
MovieClip(root).HUD.txtGunAmmo.text = "ULTD";
};
};
monsterHit = false;
};
autoCoolDown = (autoCoolDown - 1);
}
function everyFrame(evt:Event):void{
if (nadeToggleCooldown > 0){
nadeToggleCooldown--;
};
if (gunToggleCooldown > 0){
gunToggleCooldown--;
};
if (((actions[moveLeft]) && (actions[moveUp]))){
this.x = (this.x - diagonalSpeed);
this.y = (this.y - diagonalSpeed);
legRotation = -45;
legs.nextFrame();
} else {
if (((actions[moveUp]) && (actions[moveRight]))){
this.x = (this.x + diagonalSpeed);
this.y = (this.y - diagonalSpeed);
legRotation = 45;
legs.nextFrame();
} else {
if (((actions[moveRight]) && (actions[moveDown]))){
this.x = (this.x + diagonalSpeed);
this.y = (this.y + diagonalSpeed);
legRotation = 135;
legs.nextFrame();
} else {
if (((actions[moveDown]) && (actions[moveLeft]))){
this.x = (this.x - diagonalSpeed);
this.y = (this.y + diagonalSpeed);
legRotation = -135;
legs.nextFrame();
} else {
if (actions[moveLeft]){
this.x = (this.x - speed);
legRotation = -90;
legs.nextFrame();
} else {
if (actions[moveRight]){
this.x = (this.x + speed);
legRotation = 90;
legs.nextFrame();
} else {
if (actions[moveUp]){
this.y = (this.y - speed);
legRotation = 0;
legs.nextFrame();
} else {
if (actions[moveDown]){
this.y = (this.y + speed);
legRotation = -180;
legs.nextFrame();
};
};
};
};
};
};
};
};
if (((actions[throwGrenade]) && ((nadeCoolDown < 1)))){
tossGrenade();
};
if (playerBeingHit == true){
if (inertia > 0){
this.x = (this.x - (Math.cos(dir) * inertia));
this.y = (this.y - (Math.sin(dir) * inertia));
inertia = (inertia - 1);
} else {
playerBeingHit = false;
inertia = 0;
};
};
var mouseLocation:Point = new Point(MovieClip(root).cursor.x, MovieClip(root).cursor.y);
var charLocation:Point = new Point(this.x, this.y);
var xDis:Number = (charLocation.x - mouseLocation.x);
var yDis:Number = (charLocation.y - mouseLocation.y);
var angle:Number = Math.atan2(yDis, xDis);
this.rotation = (((angle * 180) / Math.PI) - 90);
updateCursorLocation(Point.distance(mouseLocation, charLocation));
legs.rotation = (legRotation - rotation);
if ((((firing == true)) && ((mouseIsDown == true)))){
shoot();
} else {
if (firing == true){
if ((((gun == "laser")) && ((laserCoolDown > 0)))){
laserCoolDown = (laserCoolDown - 1);
} else {
if ((((gun == "scatter")) && ((scatterCoolDown > 0)))){
scatterCoolDown = (scatterCoolDown - 1);
} else {
if ((((gun == "rocket")) && ((rocketCoolDown > 0)))){
rocketCoolDown = (rocketCoolDown - 1);
} else {
if ((((gun == "shotgun")) && ((shotgunCoolDown > 0)))){
shotgunCoolDown = (shotgunCoolDown - 1);
} else {
if ((((gun == "bow")) && ((bowCoolDown > 0)))){
bowCoolDown = (bowCoolDown - 1);
} else {
if ((((gun == "auto")) && ((autoCoolDown > 0)))){
autoCoolDown = (autoCoolDown - 1);
} else {
if ((((gun == "flame")) && ((flameCoolDown > 0)))){
flameCoolDown = (flameCoolDown - 1);
} else {
firing = false;
};
};
};
};
};
};
};
};
};
if (nadeCoolDown > 0){
nadeCoolDown = (nadeCoolDown - 1);
firingAnimation = true;
if (nadeCoolDown == 2){
if (grenade == "poison"){
MovieClip(root).SFX("sfxSwing2");
MovieClip(root).shootPoison(this.x, this.y, this.rotation);
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoPoison = (MovieClip(root).stats.ammoPoison - 1);
};
MovieClip(root).HUD.txtGrenadeAmmo.text = MovieClip(root).stats.ammoPoison.toString();
if (MovieClip(root).stats.ammoPoison < 1){
grenadeCheck();
};
} else {
if (grenade == "flashBang"){
MovieClip(root).SFX("sfxSwing2");
MovieClip(root).shootFlashBang(this.x, this.y, this.rotation);
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoFlashBang = (MovieClip(root).stats.ammoFlashBang - 1);
};
MovieClip(root).HUD.txtGrenadeAmmo.text = MovieClip(root).stats.ammoFlashBang.toString();
if (MovieClip(root).stats.ammoFlashBang < 1){
grenadeCheck();
};
} else {
if (grenade == "mine"){
MovieClip(root).SFX("sfxSwing2");
MovieClip(root).shootMine(this.x, this.y, this.rotation);
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoMine = (MovieClip(root).stats.ammoMine - 1);
};
MovieClip(root).HUD.txtGrenadeAmmo.text = MovieClip(root).stats.ammoMine.toString();
if (MovieClip(root).stats.ammoMine < 1){
grenadeCheck();
};
};
};
};
};
} else {
if ((((firing == true)) && ((grenadeAniReset == true)))){
grenadeAniReset = false;
firingAnimation = false;
} else {
if (firing == false){
firingAnimation = false;
gotoAndPlay(gun);
grenadeAniReset = false;
};
};
};
checkBounds();
}
function resetHud():void{
var ammoAuto:Number = MovieClip(root).stats.ammoAuto;
var ammoLaser:Number = MovieClip(root).stats.ammoLaser;
var ammoShotgun:Number = MovieClip(root).stats.ammoShotgun;
var ammoBow:Number = MovieClip(root).stats.ammoBow;
var ammoFlame:Number = MovieClip(root).stats.ammoFlame;
var ammoScatter:Number = MovieClip(root).stats.ammoScatter;
var ammoRocket:Number = MovieClip(root).stats.ammoRocket;
var ammoFlashBang:Number = MovieClip(root).stats.ammoFlashBang;
var ammoPoison:Number = MovieClip(root).stats.ammoPoison;
var ammoMine:Number = MovieClip(root).stats.ammoMine;
var grenadeHave:Boolean;
MovieClip(root).HUD.grenadeBackdrop.visible = true;
MovieClip(root).HUD.currentGrenade.visible = true;
MovieClip(root).HUD.hudWeapon1.visible = true;
MovieClip(root).HUD.hudWeapon1.gun.alpha = 0.4;
if (ammoLaser > 0){
MovieClip(root).HUD.hudWeapon2.visible = true;
MovieClip(root).HUD.hudWeapon2.gun.alpha = 0.4;
} else {
MovieClip(root).HUD.hudWeapon2.visible = false;
};
if (ammoShotgun > 0){
MovieClip(root).HUD.hudWeapon3.visible = true;
MovieClip(root).HUD.hudWeapon3.gun.alpha = 0.4;
} else {
MovieClip(root).HUD.hudWeapon3.visible = false;
};
if (ammoBow > 0){
MovieClip(root).HUD.hudWeapon4.visible = true;
MovieClip(root).HUD.hudWeapon4.gun.alpha = 0.4;
} else {
MovieClip(root).HUD.hudWeapon4.visible = false;
};
if (ammoFlame > 0){
MovieClip(root).HUD.hudWeapon5.visible = true;
MovieClip(root).HUD.hudWeapon5.gun.alpha = 0.4;
} else {
MovieClip(root).HUD.hudWeapon5.visible = false;
};
if (ammoScatter > 0){
MovieClip(root).HUD.hudWeapon6.visible = true;
MovieClip(root).HUD.hudWeapon6.gun.alpha = 0.4;
} else {
MovieClip(root).HUD.hudWeapon6.visible = false;
};
if (ammoRocket > 0){
MovieClip(root).HUD.hudWeapon7.visible = true;
MovieClip(root).HUD.hudWeapon7.gun.alpha = 0.4;
} else {
MovieClip(root).HUD.hudWeapon7.visible = false;
};
if (ammoFlashBang > 0){
MovieClip(root).HUD.hudWeapon8.visible = true;
MovieClip(root).HUD.hudWeapon8.gun.alpha = 0.4;
grenadeHave = true;
} else {
MovieClip(root).HUD.hudWeapon8.visible = false;
};
if (ammoPoison > 0){
MovieClip(root).HUD.hudWeapon9.visible = true;
MovieClip(root).HUD.hudWeapon9.gun.alpha = 0.4;
grenadeHave = true;
} else {
MovieClip(root).HUD.hudWeapon9.visible = false;
};
if (ammoMine > 0){
MovieClip(root).HUD.hudWeapon0.visible = true;
MovieClip(root).HUD.hudWeapon0.gun.alpha = 0.4;
grenadeHave = true;
} else {
MovieClip(root).HUD.hudWeapon0.visible = false;
};
if (gun == "auto"){
MovieClip(root).HUD.hudWeapon1.gun.alpha = 1;
MovieClip(root).HUD.txtGun.text = "AUTOMATIC";
MovieClip(root).HUD.txtGunAmmo.text = (MovieClip(root).stats.ammoAuto) ? MovieClip(root).stats.ammoAuto.toString() : "ULTD";
};
if (gun == "laser"){
MovieClip(root).HUD.hudWeapon2.gun.alpha = 1;
MovieClip(root).HUD.txtGun.text = "LASER";
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoLaser.toString();
};
if (gun == "shotgun"){
MovieClip(root).HUD.hudWeapon3.gun.alpha = 1;
MovieClip(root).HUD.txtGun.text = "SHOTGUN";
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoShotgun.toString();
};
if (gun == "bow"){
MovieClip(root).HUD.hudWeapon4.gun.alpha = 1;
MovieClip(root).HUD.txtGun.text = "COMPOUND BOW";
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoBow.toString();
};
if (gun == "flame"){
MovieClip(root).HUD.hudWeapon5.gun.alpha = 1;
MovieClip(root).HUD.txtGun.text = "FLAMETHROWER";
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoFlame.toString();
};
if (gun == "scatter"){
MovieClip(root).HUD.hudWeapon6.gun.alpha = 1;
MovieClip(root).HUD.txtGun.text = "SCATTER LOCK";
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoScatter.toString();
};
if (gun == "rocket"){
MovieClip(root).HUD.hudWeapon7.gun.alpha = 1;
MovieClip(root).HUD.txtGun.text = "ROCKET";
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoRocket.toString();
};
if ((((grenade == "flashBang")) && ((grenadeHave == true)))){
MovieClip(root).HUD.hudWeapon8.gun.alpha = 1;
MovieClip(root).HUD.txtGrenade.text = "FLASH BANG";
MovieClip(root).HUD.txtGrenadeAmmo.text = MovieClip(root).stats.ammoFlashBang.toString();
};
if ((((grenade == "poison")) && ((grenadeHave == true)))){
MovieClip(root).HUD.hudWeapon9.gun.alpha = 1;
MovieClip(root).HUD.txtGrenade.text = "POISON";
MovieClip(root).HUD.txtGrenadeAmmo.text = MovieClip(root).stats.ammoPoison.toString();
};
if ((((grenade == "mine")) && ((grenadeHave == true)))){
MovieClip(root).HUD.hudWeapon0.gun.alpha = 1;
MovieClip(root).HUD.txtGrenade.text = "MINE";
MovieClip(root).HUD.txtGrenadeAmmo.text = MovieClip(root).stats.ammoMine.toString();
};
if (grenadeHave == false){
MovieClip(root).HUD.grenadeBackdrop.visible = false;
MovieClip(root).HUD.currentGrenade.visible = false;
MovieClip(root).HUD.txtGrenade.text = "";
MovieClip(root).HUD.txtGrenadeAmmo.text = "";
} else {
MovieClip(root).HUD.currentGrenade.gotoAndStop(grenade);
};
MovieClip(root).HUD.currentGun.gotoAndStop(gun);
}
public function damage(dam:Number, push:Number, monsterDir:Number):void{
var heal:Boolean;
if (dam < 0){
heal = true;
} else {
dam = (dam + Math.round((3 * Math.random())));
dam = (dam - (MovieClip(root).stats.specialLevels["1"] - 1));
if (dam < 1){
dam = 1;
};
};
playerBeingHit = true;
if ((((energy > 0)) && ((heal == false)))){
energy = (energy - dam);
if (energy > 0){
MovieClip(root).forceField(this.x, this.y, ((monsterDir * 180) / Math.PI));
MovieClip(root).SFX("sfxShieldBuzz");
} else {
MovieClip(root).forceField(this.x, this.y, ((monsterDir * 180) / Math.PI), true);
damage(Math.abs(energy), push, monsterDir);
MovieClip(root).SFX("sfxShieldDown");
};
} else {
if (hacks.godMode[0] != 2){
playerHealth = (playerHealth - dam);
};
if (dam > 0){
MovieClip(root).SFX("sfxDamage");
MovieClip(root).squirt(this.x, this.y);
};
if (playerHealth <= 0){
this.visible = false;
trace(("Use this string: " + MovieClip(root).currentLevel));
if ((((MovieClip(root).currentLevel == "marsh1")) && ((MovieClip(root).stats.hacks.godMode[0] == 0)))){
MovieClip(root).stats.hacksUnlocked = (MovieClip(root).stats.hacksUnlocked + 1);
MovieClip(root).stats.progressPoints = (MovieClip(root).stats.progressPoints + 1);
MovieClip(root).stats.hacks.godMode[0] = 1;
MovieClip(root).Level.caption("God Mode Unlocked!\n\n(Toggle Hacks in the Options Menu)", 4);
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
castrate();
trace("castration pls1");
};
MovieClip(parent.parent).spatter(this.x, this.y);
if (!dead){
trace("castration pls2");
moveUp = 9999;
moveRight = 9999;
moveDown = 9999;
moveLeft = 9999;
MovieClip(root).setMusic("death", 1);
delay = 80;
addEventListener(Event.ENTER_FRAME, deathCountdown);
dead = true;
};
};
if (playerHealth > 100){
playerHealth = 100;
};
MovieClip(root).HUD.healthDisplay.height = ((MovieClip(root).StageHeight * (100 - playerHealth)) / 100);
MovieClip(root).HUD.healthDisplay.gotoAndPlay(1);
};
MovieClip(root).damageText(this.x, this.y, dam);
inertia = push;
dir = monsterDir;
}
private function cycleGrenade():void{
var guns:Object;
var gunIndex:int;
var ammo:Array;
var currentAmmo:int;
var gunFound:Boolean;
var nextGun:int;
var weapon:*;
if (nadeToggleCooldown == 0){
nadeToggleCooldown = toggleCooldown;
guns = {flashBang:0, poison:1, mine:2};
gunIndex = guns[grenade];
ammo = [MovieClip(root).stats.ammoFlashBang, MovieClip(root).stats.ammoPoison, MovieClip(root).stats.ammoMine];
currentAmmo = ammo[gunIndex];
nextGun = gunIndex;
if (currentAmmo > 0){
while (!(gunFound)) {
nextGun++;
nextGun = (nextGun % ammo.length);
if (ammo[nextGun] > 0){
gunFound = true;
};
};
for (weapon in guns) {
if (guns[weapon] == nextGun){
nadeSwitch(weapon);
};
};
};
};
}
function fireScatter():void{
if (firingAnimation == false){
firingAnimation = true;
this.gotoAndPlay(gunFrame);
};
if ((((scatterCoolDown < 1)) && ((nadeCoolDown < 1)))){
scatterCoolDown = 14;
MovieClip(root).shootScatter(this.x, this.y, this.rotation);
MovieClip(root).SFX("sfxRocket");
if (MovieClip(root).stats.ammoScatter > 1){
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoScatter = (MovieClip(root).stats.ammoScatter - 1);
};
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoScatter.toString();
} else {
MovieClip(root).stats.ammoScatter = (MovieClip(root).stats.ammoScatter - 1);
scatterCoolDown = 0;
gunSwitch("auto");
};
};
scatterCoolDown = (scatterCoolDown - 1);
}
function fireBow():void{
if (firingAnimation == false){
firingAnimation = true;
this.gotoAndPlay(gunFrame);
};
if ((((bowCoolDown < 1)) && ((nadeCoolDown < 1)))){
bowCoolDown = 12;
MovieClip(root).shootBow(this.x, this.y, this.rotation);
MovieClip(root).SFX("sfxBow");
if (MovieClip(root).stats.ammoBow > 1){
if (hacks.ultdAmmo[0] != 2){
MovieClip(root).stats.ammoBow = (MovieClip(root).stats.ammoBow - 1);
};
MovieClip(root).HUD.txtGunAmmo.text = MovieClip(root).stats.ammoBow.toString();
} else {
MovieClip(root).stats.ammoBow = (MovieClip(root).stats.ammoBow - 1);
bowCoolDown = 0;
gunSwitch("auto");
};
};
bowCoolDown = (bowCoolDown - 1);
}
function setFire(evt:MouseEvent):void{
firing = true;
mouseIsDown = true;
}
public function nadeSwitch(nade:String):void{
MovieClip(root).SFX("sfxSwitch");
grenade = nade;
resetHud();
}
private function checkMovement(KB:KeyboardEvent):void{
actions[KB.keyCode] = false;
}
function checkBounds():void{
if (this.x < 0){
this.x = 0;
};
if (this.x > MovieClip(root).StageWidth){
this.x = MovieClip(root).StageWidth;
};
if (this.y < 0){
this.y = 0;
};
if (this.y > MovieClip(root).StageHeight){
this.y = MovieClip(root).StageHeight;
};
}
public function checkControls():void{
moveLeft = MovieClip(root).stats.moveLeft;
moveRight = MovieClip(root).stats.moveRight;
moveUp = MovieClip(root).stats.moveUp;
moveDown = MovieClip(root).stats.moveDown;
fireLeft = MovieClip(root).stats.fireLeft;
fireRight = MovieClip(root).stats.fireRight;
fireUp = MovieClip(root).stats.fireUp;
fireDown = MovieClip(root).stats.fireDown;
throwGrenade = MovieClip(root).stats.throwGrenade;
nextGun = MovieClip(root).stats.nextGun;
nextGrenade = MovieClip(root).stats.nextGrenade;
optionsMenu = MovieClip(root).stats.optionsMenu;
}
function abilityCheck(KB:KeyboardEvent):void{
actions[KB.keyCode] = true;
if ((((KB.keyCode == one)) || ((KB.keyCode == oneNum)))){
gunSwitch("auto");
if (MovieClip(root).stats.ammoAuto == 0){
MovieClip(root).HUD.txtGunAmmo.text = "ULTD";
};
} else {
if ((((KB.keyCode == two)) || ((KB.keyCode == twoNum)))){
if (MovieClip(root).stats.ammoLaser > 0){
gunSwitch("laser");
};
} else {
if ((((KB.keyCode == three)) || ((KB.keyCode == threeNum)))){
if (MovieClip(root).stats.ammoShotgun > 0){
gunSwitch("shotgun");
};
} else {
if ((((KB.keyCode == four)) || ((KB.keyCode == fourNum)))){
if (MovieClip(root).stats.ammoBow > 0){
gunSwitch("bow");
};
} else {
if ((((KB.keyCode == five)) || ((KB.keyCode == fiveNum)))){
if (MovieClip(root).stats.ammoFlame > 0){
gunSwitch("flame");
};
} else {
if ((((KB.keyCode == six)) || ((KB.keyCode == sixNum)))){
if (MovieClip(root).stats.ammoScatter > 0){
gunSwitch("scatter");
};
} else {
if ((((KB.keyCode == seven)) || ((KB.keyCode == sevenNum)))){
if (MovieClip(root).stats.ammoRocket > 0){
gunSwitch("rocket");
};
} else {
if ((((KB.keyCode == eight)) || ((KB.keyCode == eightNum)))){
if (MovieClip(root).stats.ammoFlashBang > 0){
nadeSwitch("flashBang");
};
} else {
if ((((KB.keyCode == nine)) || ((KB.keyCode == nineNum)))){
if (MovieClip(root).stats.ammoPoison > 0){
nadeSwitch("poison");
};
} else {
if ((((KB.keyCode == zero)) || ((KB.keyCode == zeroNum)))){
if (MovieClip(root).stats.ammoMine > 0){
nadeSwitch("mine");
};
} else {
if (KB.keyCode == optionsMenu){
MovieClip(root).optionsMenu();
} else {
if (KB.keyCode == nextGun){
cycleGun();
} else {
if (KB.keyCode == nextGrenade){
cycleGrenade();
};
};
};
};
};
};
};
};
};
};
};
};
};
}
}
}//package game.overheadShooter.misc
Section 54
//BabySpider (game.overheadShooter.monsters.BabySpider)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class BabySpider extends MovieClip {
var coolDown:Number;// = 0
public var monsterSpeed:Number;// = 3
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var swingSword:Boolean;// = false
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "babySpider"
var flashBangInterval:Number;// = 0
public var offsetlegs:MovieClip;
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 11
var hitPlayer:Boolean;// = false
public var health:Number;// = 50
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function BabySpider():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if ((((distance < 35)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
coolDown = 15;
};
if (coolDown > 0){
coolDown = (coolDown - 1);
};
if ((((coolDown < 1)) && ((hitPlayer == true)))){
hitPlayer = false;
};
}
function frame1(){
stop();
offsetlegs.gotoAndPlay(5);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 55
//BossSkeleMage (game.overheadShooter.monsters.BossSkeleMage)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import game.overheadShooter.effects.*;
public class BossSkeleMage extends MovieClip {
var flashBangDuration:Number;// = 0
var castRazors:Boolean;// = false
var generosity:Number;// = 0.2
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var target:Point;
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var helmetBroken:Boolean;// = false
var MonstersName:String;// = "bossSkeleMage"
var shieldBroken:Boolean;// = false
var POI:Point;
var flashBangInterval:Number;// = 0
var charge:Boolean;// = false
var currentlyFlashBanged:Boolean;// = false
var backup:Boolean;// = false
var poisonDuration:Number;// = 0
public var skele:MovieClip;
var hole:WarpHole;
var swingFrames:Number;// = 11
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
public var hitZone:MovieClip;
var chargeAndCast:Boolean;// = false
var actionCounter:Number;// = 0
var flameDuration:Number;// = 0
var castRaise:Boolean;// = false
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var swing:Boolean;// = false
public function BossSkeleMage():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
POI = new Point(0, 0);
target = new Point(0, 0);
hole = new WarpHole();
super();
addFrameScript(0, frame1, 2, frame3);
this.addEventListener(Event.ADDED, setup);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function randomSpawn(X:Number, Y:Number):void{
var chance:Number = Math.random();
if (chance < 0.33){
MovieClip(root).addMonster("Spider", (X + 25), Y);
MovieClip(root).addMonster("Spider", (X - 25), Y);
MovieClip(root).addMonster("Spider", X, (Y - 25));
} else {
if (chance < 0.66){
MovieClip(root).addMonster("HighSkeletonSwordsman", X, Y);
} else {
MovieClip(root).addMonster("ToxicSpider", X, Y);
};
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
function warpHole(X:Number, Y:Number):void{
hole.x = X;
hole.y = Y;
hole.scaleX = 1;
hole.scaleY = 1;
hole.visible = true;
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(root).bossDeath(this.x, this.y, "dust");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
hole.remove();
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(root).HUD.bossHealth.visible = false;
MovieClip(parent).removeChild(this);
} else {
MovieClip(root).HUD.bossHealth.bar.height = ((310 * health) / MovieClip(root).stats[MonstersName].health);
if (health > 100){
MovieClip(root).splinter(this.x, this.y, this.rotation, "gold", 0);
} else {
if (helmetBroken == false){
helmetBroken = true;
MovieClip(root).shatter(this.x, this.y, this.rotation, "gold");
};
MovieClip(parent.parent).squirt(this.x, this.y, "dust");
};
};
}
function randomLocation():void{
this.x = (Math.random() * 700);
this.y = (Math.random() * 525);
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function pickACorner():void{
var chance:Number = Math.random();
if (chance < 0.25){
POI.x = 20;
POI.y = 20;
target.x = 510;
target.y = 335;
} else {
if (chance < 0.5){
POI.x = 680;
POI.y = 20;
target.x = 190;
target.y = 335;
} else {
if (chance < 0.75){
POI.x = 680;
POI.y = 505;
target.x = 190;
target.y = 190;
} else {
POI.x = 20;
POI.y = 505;
target.x = 510;
target.y = 190;
};
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - POI.x);
var yDis:Number = (this.y - POI.y);
var distance:Number = Point.distance(monsterLocation, POI);
var angle:Number = Math.atan2(yDis, xDis);
if (chargeAndCast == true){
if (actionCounter == 0){
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < monsterSpeed){
actionCounter = 1;
};
} else {
if (actionCounter > 0){
if (actionCounter == 1){
this.gotoAndStop("runningCast");
POI.x = target.x;
POI.y = target.y;
};
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
actionCounter = (actionCounter + 1);
if (actionCounter == 17){
warpHole(target.x, target.y);
randomSpawn(target.x, target.y);
MovieClip(root).liquidFlameBall(target.x, target.y);
};
if ((((distance < monsterSpeed)) && ((actionCounter > 17)))){
actionCounter = -1;
hole.collapse();
};
} else {
if (actionCounter < 0){
scaleX = (scaleX - 0.15);
scaleY = (scaleY - 0.15);
actionCounter = (actionCounter - 1);
if (actionCounter < -6){
randomLocation();
MovieClip(root).liquidFlameBall(this.x, this.y);
MovieClip(root).SFX("sfxExplosion");
scaleX = 1;
scaleY = 1;
decide();
};
};
};
};
};
if (charge == true){
if (actionCounter == 150){
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
actionCounter = (actionCounter - 1);
if (distance > 100){
this.rotation = (((angle * 180) / Math.PI) - 90);
} else {
actionCounter = 149;
};
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
} else {
if (actionCounter > 50){
this.rotation = (((angle * 180) / Math.PI) - 55);
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
actionCounter = (actionCounter - 0.5);
if (distance < 45){
actionCounter = 50;
};
} else {
if (actionCounter >= 41){
POI = charLocation;
this.rotation = (((angle * 180) / Math.PI) - 90);
if (actionCounter == 50){
gotoAndStop("swing");
MovieClip(root).SFX("sfxSwing");
};
if ((((hitZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
actionCounter = (actionCounter - 1);
} else {
if (actionCounter >= 25){
if (actionCounter == 40){
this.gotoAndStop("backup");
};
POI = charLocation;
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x + ((Math.cos(angle) * monsterSpeed) / 2));
this.y = (this.y + ((Math.sin(angle) * monsterSpeed) / 2));
actionCounter = (actionCounter - 1);
} else {
decide();
hitPlayer = false;
};
};
};
};
};
if (castRazors == true){
if (actionCounter == 0){
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
distance = Point.distance(monsterLocation, POI);
if (distance < monsterSpeed){
actionCounter = 1;
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
};
} else {
if (actionCounter == 1){
gotoAndStop("standingCast");
this.rotation = (((angle * 180) / Math.PI) - 90);
};
actionCounter = (actionCounter + 1);
if (actionCounter == 11){
MovieClip(root).skullRazor((rotation - 80), (this.x - (Math.cos((angle - 45)) * 50)), (this.y - (Math.sin((angle - 45)) * 50)), false);
MovieClip(root).skullRazor((rotation - 100), (this.x - (Math.cos((angle + 45)) * 50)), (this.y - (Math.sin((angle + 45)) * 50)), true);
};
if (actionCounter == 14){
MovieClip(root).skullRazor((rotation - 80), (this.x - (Math.cos((angle - 60)) * 70)), (this.y - (Math.sin((angle - 60)) * 70)), false);
MovieClip(root).skullRazor((rotation - 100), (this.x - (Math.cos((angle + 60)) * 70)), (this.y - (Math.sin((angle + 60)) * 70)), true);
};
if (actionCounter > 25){
decide();
};
};
};
if (castRaise == true){
if (actionCounter == 0){
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
distance = Point.distance(monsterLocation, POI);
if (distance < monsterSpeed){
actionCounter = 1;
POI.x = target.x;
POI.y = target.y;
};
} else {
if (actionCounter == 1){
actionCounter = 2;
gotoAndStop("standingCast");
this.rotation = (((angle * 180) / Math.PI) - 90);
};
actionCounter = (actionCounter + 1);
if (actionCounter == 13){
MovieClip(root).liquidFlameBall(target.x, target.y);
randomSpawn(target.x, target.y);
};
if (actionCounter > 25){
decide();
};
};
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function frame1(){
stop();
skele.gotoAndPlay(1);
hitZone.stop();
}
function decide():void{
var chance:Number = Math.random();
if (chance < 0.25){
charge = true;
chargeAndCast = false;
castRazors = false;
castRaise = false;
actionCounter = 150;
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
this.gotoAndStop("charge");
} else {
if (chance < 0.5){
charge = false;
chargeAndCast = true;
castRazors = false;
castRaise = false;
pickACorner();
actionCounter = 0;
this.gotoAndStop("charge");
} else {
if (chance < 0.75){
charge = false;
chargeAndCast = false;
castRazors = true;
castRaise = false;
pickACorner();
actionCounter = 0;
POI.x = 350;
POI.y = 262;
this.gotoAndStop("charge");
} else {
charge = false;
chargeAndCast = false;
castRazors = false;
castRaise = true;
pickACorner();
actionCounter = 0;
POI.x = 350;
POI.y = 262;
this.gotoAndStop("charge");
};
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function frame3(){
hitZone.gotoAndPlay(1);
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
actionCounter = 350;
this.gotoAndStop("charge");
charge = true;
hole.visible = false;
MovieClip(root).Level.addChild(hole);
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
MovieClip(root).HUD.bossHealth.visible = true;
MovieClip(root).HUD.bossHealth.bar.height = 310;
}
}
}//package game.overheadShooter.monsters
Section 56
//Civilian (game.overheadShooter.monsters.Civilian)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Civilian extends MovieClip {
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "civilian"
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
public var beacon:MovieClip;
var swingFrames:Number;// = 16
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
var actionCounter:Number;// = 0
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function Civilian():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
MovieClip(root).poisonPing(this.x, this.y, "flash");
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 60)) && ((actionCounter == 0)))){
actionCounter = 1;
gotoAndPlay("break");
beacon.gotoAndPlay("rescued");
};
if (actionCounter > 0){
actionCounter++;
if (actionCounter == 13){
rotation = 0;
beacon.rotation = -(rotation);
gotoAndPlay("run");
MovieClip(root).dropGoodies(this.x, this.y);
};
if (actionCounter > 12){
this.y = (this.y - monsterSpeed);
};
};
if (y < -50){
remove();
};
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function frame3(){
stop();
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
rotation = (360 * Math.random());
beacon.rotation = -(rotation);
}
}
}//package game.overheadShooter.monsters
Section 57
//CyborgBoss (game.overheadShooter.monsters.CyborgBoss)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class CyborgBoss extends MovieClip {
var gunMax:Point;
public var monsterSpeed:Number;// = 2
var bulletP:Point;
public var dam:Number;// = 10
var offset:Number;// = 0
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var bulletAccuracy:Number;// = 0.05
var swingCounter:Number;// = 0
var monsterSwingAnimation:Boolean;// = false
var push:Number;// = 5
var MonstersName:String;// = "cyborgBoss"
var shieldBroken:Boolean;// = false
var shootGun:Boolean;// = false
var rotationCounter:Number;// = 0
var bulletIncrement:Number;
var flashBangInterval:Number;// = 0
var monsterLocation:Point;
var currentlyFlashBanged:Boolean;// = false
var sideStep:Boolean;// = false
var swingFrames:Number;// = 39
var poisonDuration:Number;// = 0
public var health:Number;// = 75
var gunRange:Number;// = 250
public var upperBody:MovieClip;
var actionCounter:Number;// = 0
var flameDuration:Number;// = 0
public var shield:MovieClip;
var poisonInterval:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var playerHit:Boolean;// = false
var flashBangDuration:Number;// = 0
public function CyborgBoss():void{
originalSpeed = monsterSpeed;
gunMax = new Point(0, 0);
bulletP = new Point(0, 0);
bulletIncrement = bulletAccuracy;
monsterLocation = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
function laserBlast(rot:Number):void{
MovieClip(root).SFX("sfxLaser");
MovieClip(root).redLaser((this.x + (Math.cos(((this.rotation * Math.PI) / 180)) * 35)), (this.y + (Math.sin(((this.rotation * Math.PI) / 180)) * 35)), (this.rotation + rot));
MovieClip(root).redLaser((this.x + (Math.cos(((this.rotation * Math.PI) / 180)) * -35)), (this.y + (Math.sin(((this.rotation * Math.PI) / 180)) * -35)), (this.rotation - rot));
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function shieldRotate():void{
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
shield.rotation = ((((angle * 180) / Math.PI) - 90) - this.rotation);
}
function grenadeSurround():void{
MovieClip(root).SFX("sfxRocket");
MovieClip(root).cyBomb(this.x, this.y, this.rotation);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 20), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 40), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 60), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 80), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 100));
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 120), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 140), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 160), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 180), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 200), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 220), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 240), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 260), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 280));
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 300), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 320), true);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 340), true);
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
var xDis:Number;
var yDis:Number;
var distance:Number;
var angle:Number;
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var distanceFromCenter:Number = Point.distance(monsterLocation, new Point(350, 263));
if (actionCounter == 0){
if (distanceFromCenter > monsterSpeed){
upperBody.visible = false;
xDis = (this.x - 350);
yDis = (this.y - 263);
angle = Math.atan2(yDis, xDis);
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
} else {
actionCounter = 1;
};
};
if (actionCounter == 1){
if (swingCounter < swingFrames){
if (swingCounter == 0){
xDis = (this.x - MovieClip(this.parent.parent).char.x);
yDis = (this.y - MovieClip(this.parent.parent).char.y);
distance = Point.distance(monsterLocation, charLocation);
angle = Math.atan2(yDis, xDis);
this.rotation = (((angle * 180) / Math.PI) - 90);
this.gotoAndStop("shoot");
};
if (swingCounter == 5){
laserBlast(70);
};
if (swingCounter == 7){
laserBlast(63);
};
if (swingCounter == 9){
laserBlast(55);
};
if (swingCounter == 11){
laserBlast(40);
};
if (swingCounter == 13){
laserBlast(25);
};
if (swingCounter == 15){
laserBlast(10);
};
if (swingCounter == 17){
laserBlast(3);
};
if (swingCounter == 34){
grenadeLaunch();
};
swingCounter = (swingCounter + 1);
} else {
this.gotoAndStop("spin");
upperBody.visible = true;
actionCounter = 2;
swingCounter = 0;
upperBody.rotation = 0;
};
};
if (actionCounter > 1){
xDis = (this.x - MovieClip(this.parent.parent).char.x);
yDis = (this.y - MovieClip(this.parent.parent).char.y);
distance = Point.distance(monsterLocation, charLocation);
angle = Math.atan2(yDis, xDis);
if ((((actionCounter < 10)) || ((((actionCounter > 100)) && ((actionCounter < 110)))))){
this.rotation = (((angle * 180) / Math.PI) + 90);
this.rotation = (this.rotation + actionCounter);
} else {
if ((((actionCounter < 50)) || ((((actionCounter >= 110)) && ((actionCounter < 150)))))){
this.rotation = (this.rotation + 10);
} else {
if ((((actionCounter < 60)) || ((((actionCounter >= 160)) && ((actionCounter < 170)))))){
this.rotation = (((angle * 180) / Math.PI) - 90);
this.rotation = (this.rotation + (40 - actionCounter));
} else {
this.rotation = (this.rotation - 10);
};
};
};
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
this.upperBody.rotation = (this.upperBody.rotation + 20);
if ((actionCounter % 8) == 1){
laserBlast(((360 - upperBody.rotation) - 90));
};
if ((actionCounter % 35) == 18){
grenadeSurround();
};
actionCounter++;
if (actionCounter > 200){
actionCounter = 0;
this.gotoAndStop("walk");
};
};
}
function grenadeLaunch():void{
MovieClip(root).SFX("sfxRocket");
MovieClip(root).cyBomb(this.x, this.y, this.rotation);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 15));
MovieClip(root).cyBomb(this.x, this.y, (this.rotation - 15), true);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(root).bossDeath(this.x, this.y, "oil");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(root).HUD.bossHealth.visible = false;
MovieClip(parent).removeChild(this);
} else {
MovieClip(root).HUD.bossHealth.bar.height = ((310 * health) / MovieClip(root).stats[MonstersName].health);
if (health > 200){
shieldRotate();
shield.gotoAndPlay(1);
MovieClip(root).SFX("sfxShieldBuzz");
} else {
if (shieldBroken == false){
shieldBroken = true;
shieldRotate();
shield.gotoAndPlay("depleted");
MovieClip(root).SFX("sfxShieldDown");
};
MovieClip(parent.parent).squirt(this.x, this.y, "oil");
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function frame1(){
stop();
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
if (Math.random() > 0.5){
offset = -10;
} else {
offset = -170;
};
MovieClip(root).HUD.bossHealth.visible = true;
MovieClip(root).HUD.bossHealth.bar.height = 310;
}
}
}//package game.overheadShooter.monsters
Section 58
//CyborgMarine (game.overheadShooter.monsters.CyborgMarine)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class CyborgMarine extends MovieClip {
var gunMax:Point;
public var monsterSpeed:Number;// = 2
var bulletP:Point;
public var dam:Number;// = 10
var offset:Number;// = 0
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var bulletAccuracy:Number;// = 0.05
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var push:Number;// = 5
var MonstersName:String;// = "cyborgMarine"
var shieldBroken:Boolean;// = false
var shootGun:Boolean;// = false
var rotationCounter:Number;// = 0
var bulletIncrement:Number;
var flashBangInterval:Number;// = 0
var monsterLocation:Point;
var currentlyFlashBanged:Boolean;// = false
var sideStep:Boolean;// = false
var swingFrames:Number;// = 20
var poisonDuration:Number;// = 0
public var health:Number;// = 75
var gunRange:Number;// = 250
var flameDuration:Number;// = 0
public var shield:MovieClip;
var poisonInterval:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var playerHit:Boolean;// = false
var flashBangDuration:Number;// = 0
public function CyborgMarine():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
gunMax = new Point(0, 0);
bulletP = new Point(0, 0);
bulletIncrement = bulletAccuracy;
monsterLocation = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function shoot():void{
MovieClip(root).SFX("sfxRocket");
MovieClip(root).cyBomb(this.x, this.y, this.rotation);
MovieClip(root).cyBomb(this.x, this.y, (this.rotation + 15));
MovieClip(root).cyBomb(this.x, this.y, (this.rotation - 15));
}
function shieldRotate():void{
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
shield.rotation = ((((angle * 180) / Math.PI) - 90) - this.rotation);
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((((distance < 200)) && ((sideStep == false)))) && ((shootGun == false)))){
sideStep = true;
rotationCounter = 31;
};
if (sideStep == true){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) + offset);
};
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
rotationCounter = (rotationCounter - 1);
if (rotationCounter < 1){
sideStep = false;
shootGun = true;
this.rotation = (((angle * 180) / Math.PI) - 95);
};
};
if (shootGun == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("shoot");
};
if (swingCounter == 11){
shoot();
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("run");
shootGun = false;
swingCounter = swingFrames;
};
};
if ((((shootGun == false)) && ((sideStep == false)))){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame1(){
stop();
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y, "oil");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
if (health > 40){
shieldRotate();
shield.gotoAndPlay(1);
MovieClip(root).SFX("sfxShieldBuzz");
} else {
if (shieldBroken == false){
shieldBroken = true;
shieldRotate();
shield.gotoAndPlay("depleted");
MovieClip(root).SFX("sfxShieldDown");
};
MovieClip(parent.parent).squirt(this.x, this.y, "oil");
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
if (Math.random() > 0.5){
offset = -10;
} else {
offset = -170;
};
}
}
}//package game.overheadShooter.monsters
Section 59
//CyborgNinja (game.overheadShooter.monsters.CyborgNinja)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class CyborgNinja extends MovieClip {
var gunMax:Point;
var generosity:Number;// = 0.2
public var monsterSpeed:Number;// = 2
var bulletP:Point;
public var dam:Number;// = 10
var swordOut:Boolean;// = false
var offset:Number;// = 0
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var bulletAccuracy:Number;// = 0.05
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var push:Number;// = 5
var MonstersName:String;// = "cyborgNinja"
var shieldBroken:Boolean;// = false
var rotationCounter:Number;// = 0
var bulletIncrement:Number;
var swingBlade:Boolean;// = false
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var sideStep:Boolean;// = false
var swingFrames:Number;// = 18
var flashBangInterval:Number;// = 0
var monsterLocation:Point;
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
var gunRange:Number;// = 250
var unsheathCounter:Number;// = 0
public var hitZone:MovieClip;
var flameDuration:Number;// = 0
public var shield:MovieClip;
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function CyborgNinja():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
gunMax = new Point(0, 0);
bulletP = new Point(0, 0);
bulletIncrement = bulletAccuracy;
monsterLocation = new Point(0, 0);
super();
addFrameScript(0, frame1, 3, frame4);
this.addEventListener(Event.ADDED, setup);
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function shieldRotate():void{
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
shield.rotation = ((((angle * 180) / Math.PI) - 90) - this.rotation);
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function hitCheck():void{
var testPoint:Point = new Point(this.x, this.y);
var testPoint2:Point = new Point(this.x, this.y);
var testPoint3:Point = new Point(this.x, this.y);
var testPoint4:Point = new Point(this.x, this.y);
var testPoint5:Point = new Point(this.x, this.y);
testPoint.x = (testPoint.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * 80));
testPoint.y = (testPoint.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * 80));
testPoint2.x = (testPoint2.x + (Math.cos((((this.rotation - 110) * Math.PI) / 180)) * 80));
testPoint2.y = (testPoint2.y + (Math.sin((((this.rotation - 110) * Math.PI) / 180)) * 80));
testPoint3.x = (testPoint3.x + (Math.cos((((this.rotation - 70) * Math.PI) / 180)) * 80));
testPoint3.y = (testPoint3.y + (Math.sin((((this.rotation - 70) * Math.PI) / 180)) * 80));
testPoint4.x = (testPoint4.x + (Math.cos((((this.rotation - 110) * Math.PI) / 180)) * 40));
testPoint4.y = (testPoint4.y + (Math.sin((((this.rotation - 110) * Math.PI) / 180)) * 40));
testPoint5.x = (testPoint5.x + (Math.cos((((this.rotation - 70) * Math.PI) / 180)) * 40));
testPoint5.y = (testPoint5.y + (Math.sin((((this.rotation - 70) * Math.PI) / 180)) * 40));
if ((((((((((MovieClip(root).char.hitTestPoint(testPoint.x, testPoint.y, true) == true)) || ((MovieClip(root).char.hitTestPoint(testPoint2.x, testPoint2.y, true) == true)))) || ((MovieClip(root).char.hitTestPoint(testPoint3.x, testPoint3.y, true) == true)))) || ((MovieClip(root).char.hitTestPoint(testPoint4.x, testPoint4.y, true) == true)))) || ((MovieClip(root).char.hitTestPoint(testPoint5.x, testPoint5.y, true) == true)))){
MovieClip(root).char.damage(dam, push, this.rotation);
hitPlayer = true;
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 250)) && ((swordOut == false)))){
swordOut = true;
unsheathCounter = 20;
};
if ((((((swordOut == true)) && ((sideStep == false)))) && ((swingBlade == false)))){
if (unsheathCounter == 20){
gotoAndStop("unsheath");
};
unsheathCounter = (unsheathCounter - 1);
if (unsheathCounter == 10){
MovieClip(root).SFX("sfxMagicCast");
};
if (unsheathCounter < 1){
sideStep = true;
rotationCounter = 31;
};
};
if (sideStep == true){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) + offset);
};
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
if (rotationCounter == 31){
gotoAndStop("runWithBlade");
};
rotationCounter = (rotationCounter - 1);
if (rotationCounter < 1){
sideStep = false;
swingBlade = true;
this.rotation = (((angle * 180) / Math.PI) - 90);
};
};
if (swingBlade == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swing");
};
if (swingCounter == 10){
MovieClip(root).SFX("sfxSwing");
};
if ((((hitPlayer == false)) && ((MovieClip(root).char.hitZone.hitTestObject(hitZone) == true)))){
hitCheck();
MovieClip(root).char.damage(dam, push, this.rotation);
hitPlayer = true;
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
hitPlayer = false;
swingBlade = false;
swingCounter = swingFrames;
sideStep = true;
rotationCounter = 31;
};
};
if ((((((swingBlade == false)) && ((sideStep == false)))) && ((swordOut == false)))){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function frame1(){
stop();
}
function frame4(){
hitZone.gotoAndPlay(2);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y, "oil");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
if (health > 40){
shieldRotate();
shield.gotoAndPlay(1);
MovieClip(root).SFX("sfxShieldBuzz");
} else {
if (shieldBroken == false){
shieldBroken = true;
shieldRotate();
shield.gotoAndPlay("depleted");
MovieClip(root).SFX("sfxShieldDown");
};
MovieClip(parent.parent).squirt(this.x, this.y, "oil");
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
if (Math.random() > 0.5){
offset = -40;
} else {
offset = -130;
};
}
}
}//package game.overheadShooter.monsters
Section 60
//Demon (game.overheadShooter.monsters.Demon)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Demon extends MovieClip {
var spearThrown:Boolean;// = false
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var throwSpear:Boolean;// = false
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "demon"
var push:Number;// = 5
var throwFrames:Number;// = 14
var flashBangInterval:Number;// = 0
var swingAxe:Boolean;// = false
var poisonDuration:Number;// = 0
var throwDelay:Number;// = 5
var monsterThrowAnimation:Boolean;// = false
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 12
var spearOffset:Number;// = 4
public var health:Number;// = 100
public var axeZone:MovieClip;
var flameDuration:Number;// = 0
public var monster:MovieClip;
var spearRange:Number;// = 200
var poisonInterval:Number;// = 0
var playerHit:Boolean;// = false
var generosity:Number;// = 1
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function Demon():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function frame1(){
stop();
monster.rightLeg.gotoAndPlay(11);
axeZone.gotoAndStop(1);
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function frame4(){
stop();
axeZone.gotoAndStop(4);
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((((distance < 70)) && ((throwSpear == false)))) && ((swingAxe == false)))){
swingAxe = true;
};
if (swingAxe == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swing");
};
if (swingCounter == 10){
MovieClip(root).SFX("sfxSwing");
};
if ((((axeZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((playerHit == false)))){
playerHit = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("thrown");
swingAxe = false;
swingCounter = swingFrames;
playerHit = false;
};
};
if (throwSpear == true){
if (throwDelay > 0){
gotoAndPlay("throw");
throwDelay = (throwDelay - 1);
} else {
if (monsterThrowAnimation == false){
gotoAndStop("throw");
monsterThrowAnimation = true;
addEventListener(Event.ENTER_FRAME, spearTimer);
};
if ((((monsterThrowAnimation == true)) && ((throwFrames == 0)))){
throwSpear = false;
gotoAndStop("thrown");
} else {
throwFrames = (throwFrames - 1);
};
};
};
if ((((distance < spearRange)) && ((spearThrown == false)))){
throwSpear = true;
spearThrown = true;
};
if ((((throwSpear == false)) && ((swingAxe == false)))){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame2(){
stop();
monster.rightLeg.gotoAndPlay(11);
axeZone.gotoAndStop(1);
}
function frame3(){
stop();
axeZone.gotoAndStop(1);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function spearTimer(evt:Event):void{
if ((((spearOffset < 1)) && ((health > 0)))){
removeEventListener(Event.ENTER_FRAME, spearTimer);
MovieClip(root).throwSpear(this.x, this.y, this.rotation);
} else {
spearOffset = (spearOffset - 1);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 61
//DemonGod (game.overheadShooter.monsters.DemonGod)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class DemonGod extends MovieClip {
var memory:Array;
var gunMax:Point;
private var healthFull:Number;
var Location2:Point;
var flameInterval:Number;// = 0
var subPhase:Number;// = 1
var swingCounter:Number;
var push:Number;// = 5
var MonstersName:String;// = "demonGod"
var hoverStep:Number;// = 1
var bulletAccuracy:Number;// = 0.05
var flashBangInterval:Number;// = 0
public var demonGodArmor:MovieClip;
public var heli:MovieClip;
var currentlyFlashBanged:Boolean;// = false
public var ship:MovieClip;
var swingFrames:Number;// = 12
public var health:Number;// = 100
var hoverSpeed:Number;// = 0
var generosity:Number;// = 1
var startHere:Point;
var phase:Number;// = 1
var myRot:Number;// = 0
public var monsterSpeed:Number;// = 2
var bulletP:Point;
public var dam:Number;// = 10
var target:Point;
var currentlyPoisoned:Boolean;// = false
var bulletIncrement:Number;
var monsterSwingAnimation:Boolean;// = false
var monsterThrowAnimation:Boolean;// = false
var poisonDuration:Number;// = 0
var spearOffset:Number;// = 4
var Location:Point;
var gunRange:Number;// = 300
public var hitZone:MovieClip;
var actionCounter:Number;// = 0
var poisonInterval:Number;// = 0
var flameDuration:Number;// = 0
var playerHit:Boolean;// = false
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public var originalSpeed:Number;
public function DemonGod():void{
healthFull = health;
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
gunMax = new Point(0, 0);
bulletP = new Point(0, 0);
bulletIncrement = bulletAccuracy;
startHere = new Point(0, 0);
memory = new Array();
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
this.addEventListener(Event.ADDED, setup);
removeChild(demonGodArmor);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
private function hookSmoke(angleOffset:Number):void{
var distanceToHook:Number = (132 * ship.chains.scaleX);
var thisX:Number = (x + (Math.cos((((ship.chains.rotation - angleOffset) * Math.PI) / 180)) * -(distanceToHook)));
var thisY:Number = (y + (Math.sin((((ship.chains.rotation - angleOffset) * Math.PI) / 180)) * -(distanceToHook)));
MovieClip(root).smokeTrail(thisX, thisY);
}
function shoot(offset:Number=90):void{
var shootGun:Boolean;
startHere.x = (this.x + (Math.cos((((this.rotation - offset) * Math.PI) / 180)) * 90));
startHere.y = (this.y + (Math.sin((((this.rotation - offset) * Math.PI) / 180)) * 90));
gunMax.x = (startHere.x - (Math.cos((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
gunMax.y = (startHere.y - (Math.sin((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
bulletAccuracy = (bulletAccuracy + bulletIncrement);
bulletP = Point.interpolate(gunMax, startHere, bulletAccuracy);
if (MovieClip(root).char.hitTestPoint(bulletP.x, bulletP.y, true) == true){
MovieClip(root).char.damage(dam, push, this.rotation);
shootGun = false;
};
if (shootGun == true){
MovieClip(root).smokeTrail(bulletP.x, bulletP.y);
MovieClip(root).splinter(bulletP.x, bulletP.y, this.rotation, "dark", 0);
if (Math.random() > 0.5){
MovieClip(root).SFX("sfxAuto");
};
};
}
private function resetSpeed():void{
monsterSpeed = originalSpeed;
}
private function gravityBlood():void{
var X:Number = (10 * Math.random());
var Y:Number = (10 * Math.random());
if (Math.random() > 0.5){
X = (X * -1);
};
if (Math.random() > 0.5){
Y = (Y * -1);
};
MovieClip(root).bloodParticle(new Point((x + (X * 2)), (y + (Y * 2))), new Point(((700 / 2) + (X * 2)), (((525 / 2) - 15) + (Y * 2))));
}
function frame1(){
stop();
}
function frame2(){
hitZone.gotoAndPlay("swing1");
}
function frame3(){
hitZone.gotoAndStop(1);
}
function frame4(){
hitZone.gotoAndStop(1);
}
function frame5(){
hitZone.gotoAndPlay("swing2");
}
function frame6(){
hitZone.gotoAndStop(1);
}
function frame7(){
hitZone.gotoAndStop(1);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
if (phase > 4){
push = 0;
};
if (phase != 4){
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
if (phase == 20){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(root).bossDeath(this.x, this.y, "black");
MovieClip(root).HUD.bossHealth.visible = false;
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
if (phase == 1){
resetHealth();
MovieClip(root).bossDeath(this.x, this.y, "oil");
addChild(demonGodArmor);
demonGodArmor.gotoAndPlay(1);
gotoAndStop("barrage");
actionCounter = 0;
};
if (phase == 2){
resetHealth();
removeChild(demonGodArmor);
gotoAndStop("armorBreak");
actionCounter = 0;
subPhase = 0;
};
if (phase == 3){
MovieClip(root).bossDeath(this.x, this.y);
gotoAndStop("dead");
actionCounter = 0;
subPhase = 0;
MovieClip(root).HUD.bossHealth.visible = false;
resetHealth();
alpha = 0.3;
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(root).flashBangFlash(true);
trace((("Phase: " + phase) + " has ended"));
phase++;
};
} else {
if (phase == 1){
MovieClip(parent.parent).squirt(this.x, this.y, "oil");
if ((((health < (healthFull - ((healthFull / 5) * 1)))) && ((subPhase == 1)))){
subPhase++;
ship.cover.gotoAndStop("crack1");
MovieClip(root).SFX("sfxBreak");
};
if ((((health < (healthFull - ((healthFull / 5) * 2)))) && ((subPhase == 2)))){
subPhase++;
ship.cover.gotoAndStop("crack2");
MovieClip(root).SFX("sfxBreak");
};
if ((((health < (healthFull - ((healthFull / 5) * 3)))) && ((subPhase == 3)))){
subPhase++;
ship.cover.gotoAndStop("crack3");
MovieClip(root).SFX("sfxBreak");
};
if ((((health < (healthFull - ((healthFull / 5) * 4)))) && ((subPhase == 4)))){
subPhase++;
ship.cover.gotoAndStop("shatter");
MovieClip(root).SFX("sfxBreak");
MovieClip(root).SFX("sfxShieldDown");
};
};
if (phase == 2){
MovieClip(parent.parent).squirt(this.x, this.y, "yellow");
};
if (phase == 3){
if (subPhase == 0){
MovieClip(parent.parent).squirt(this.x, this.y, "yellow");
} else {
MovieClip(parent.parent).squirt(this.x, this.y, "red");
};
};
if (phase > 4){
MovieClip(parent.parent).squirt(this.x, this.y);
};
MovieClip(root).HUD.bossHealth.bar.height = ((310 * health) / healthFull);
};
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = (MovieClip(root).stats[MonstersName].health / 4);
healthFull = health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
ship.chains.visible = false;
memory.push(heli);
removeChild(heli);
scaleX = 1.15;
scaleY = 1.15;
MovieClip(root).HUD.bossHealth.visible = true;
MovieClip(root).HUD.bossHealth.bar.height = 310;
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
private function resetHealth():void{
health = healthFull;
MovieClip(root).HUD.bossHealth.bar.height = ((310 * health) / healthFull);
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if ((((health > 0)) && (!((phase == 4))))){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if ((((flameInterval < 1)) && (!((phase == 4))))){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
var centerStage:Point;
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((phase == 1)) && ((actionCounter == 0)))){
if (ship.gun.y < 38){
ship.gun.y++;
};
this.rotation = (((angle * 180) / Math.PI) - 90);
ship.cover.rotation = -(rotation);
ship.base.rotation = -(rotation);
accelerate();
if (distance > 160){
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
} else {
actionCounter = 1;
resetSpeed();
};
};
if ((((((phase == 1)) && ((actionCounter > 0)))) && ((actionCounter < 30)))){
if (ship.gun.y < 38){
ship.gun.y++;
};
actionCounter++;
if (actionCounter == 5){
MovieClip(root).shipFlame(x, y, rotation, dam, push);
};
};
if ((((phase == 1)) && ((actionCounter == 30)))){
if (ship.gun.y > -12){
ship.gun.y--;
};
centerStage = new Point((MovieClip(root).stage.stageWidth / 2), (MovieClip(root).stage.stageHeight / 2));
xDis = (this.x - centerStage.x);
yDis = (this.y - centerStage.y);
distance = Point.distance(monsterLocation, centerStage);
angle = Math.atan2(yDis, xDis);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
accelerate();
if (distance <= monsterSpeed){
resetSpeed();
actionCounter++;
};
};
if ((((phase == 1)) && ((actionCounter == 31)))){
if (ship.gun.y > -12){
ship.gun.y--;
};
this.rotation = (((angle * 180) / Math.PI) - 90);
ship.cover.rotation = -(rotation);
ship.base.rotation = -(rotation);
if (!ship.chains.visible){
ship.chains.scaleX = 0.35;
ship.chains.scaleY = 0.35;
ship.chains.visible = true;
};
if (ship.chains.scaleX < 1){
ship.chains.scaleX = (ship.chains.scaleX + 0.05);
ship.chains.scaleY = (ship.chains.scaleY + 0.05);
} else {
ship.chains.scaleX = 1;
ship.chains.scaleY = 1;
actionCounter++;
target = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
};
myRot = (myRot + 15);
ship.chains.rotation = (-(rotation) + myRot);
chainCheck();
};
if ((((phase == 1)) && ((actionCounter == 32)))){
if (ship.gun.y > -12){
ship.gun.y--;
};
xDis = (this.x - target.x);
yDis = (this.y - target.y);
distance = Point.distance(monsterLocation, target);
angle = Math.atan2(yDis, xDis);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
accelerate();
myRot = (myRot + 15);
ship.chains.rotation = (-(rotation) + myRot);
if (distance < monsterSpeed){
resetSpeed();
actionCounter++;
};
chainCheck();
};
if ((((phase == 1)) && ((actionCounter == 33)))){
if (ship.gun.y < 38){
ship.gun.y++;
};
this.rotation = (((angle * 180) / Math.PI) - 90);
ship.cover.rotation = -(rotation);
ship.base.rotation = -(rotation);
if (ship.chains.scaleX > 0.35){
ship.chains.scaleX = (ship.chains.scaleX - 0.05);
ship.chains.scaleY = (ship.chains.scaleY - 0.05);
myRot = (myRot + 15);
ship.chains.rotation = (-(rotation) + myRot);
} else {
ship.chains.visible = false;
actionCounter = 0;
};
chainCheck();
};
if (phase == 2){
actionCounter = demonGodArmor.currentFrame;
if (actionCounter == 1){
hitZone.gotoAndPlay(2);
};
if (actionCounter < 27){
rotation = (((angle * 180) / Math.PI) - 90);
};
if (actionCounter == 27){
target = new Point((charLocation.x - (Math.cos(angle) * -70)), (charLocation.y - (Math.sin(angle) * -70)));
Location = new Point(x, y);
};
if (actionCounter == 28){
Location2 = Point.interpolate(target, Location, 0.1);
x = Location2.x;
y = Location2.y;
};
if (actionCounter == 29){
Location2 = Point.interpolate(target, Location, 0.25);
x = Location2.x;
y = Location2.y;
};
if (actionCounter == 30){
Location2 = Point.interpolate(target, Location, 0.75);
x = Location2.x;
y = Location2.y;
};
if (actionCounter == 31){
Location2 = Point.interpolate(target, Location, 0.9);
x = Location2.x;
y = Location2.y;
};
if (actionCounter == 32){
Location2 = Point.interpolate(target, Location, 1);
x = Location2.x;
y = Location2.y;
};
if (actionCounter == 35){
MovieClip(root).SFX("sfxSwing");
};
if ((((actionCounter >= 35)) && ((actionCounter <= 37)))){
if (hitZone.hitTestObject(MovieClip(root).char)){
MovieClip(root).char.damage((dam / 10), (push * 3), angle);
};
};
if (actionCounter > 45){
rotation = (((angle * 180) / Math.PI) - 90);
};
if (actionCounter == 57){
MovieClip(root).demonGodFireball(x, y, rotation, dam);
};
};
if (phase == 3){
if (actionCounter == 20){
gotoAndStop("hunt");
subPhase = 1;
};
if ((((actionCounter > 19)) && ((subPhase == 1)))){
this.rotation = (((angle * 180) / Math.PI) - 90);
accelerate();
if (distance > 55){
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
} else {
subPhase = 2;
actionCounter = 0;
resetSpeed();
};
};
if (subPhase == 2){
if (actionCounter == 0){
gotoAndStop("swing");
};
if (subPhase == 5){
MovieClip(root).SFX("sfxSwing");
};
if (hitZone.hitTestObject(MovieClip(root).char)){
MovieClip(root).char.damage(dam, (push * 3), angle);
};
if (actionCounter > 14){
subPhase = 1;
actionCounter = 19;
};
};
actionCounter++;
};
if (phase == 4){
if (actionCounter == 0){
MovieClip(root).heliEnter(true);
};
if (actionCounter < 31){
scaleX = (scaleX + 0.02);
scaleY = (scaleY + 0.02);
};
if (actionCounter > 50){
scaleX = (scaleX - 0.01);
scaleY = (scaleY - 0.01);
if ((actionCounter % 6) == 0){
gravityBlood();
};
};
if (actionCounter == 111){
phase++;
alpha = 1;
x = 350;
y = 262;
MovieClip(root).bossDeath(this.x, this.y, "black");
MovieClip(root).HUD.bossHealth.visible = true;
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(root).flashBangFlash();
gotoAndStop("copter");
MovieClip(root).setMusic("boss");
addChild(memory[0]);
scaleX = 1;
scaleY = 1;
actionCounter = 0;
};
actionCounter++;
};
if (phase > 4){
if (actionCounter < 64){
rotation = (((angle * 180) / Math.PI) - 90);
heli.gun1.blast.visible = false;
heli.gun2.blast.visible = false;
};
if (actionCounter == 32){
bulletAccuracy = bulletIncrement;
};
if (actionCounter == 64){
heli.gun1.blast.visible = true;
heli.gun2.blast.visible = true;
bulletAccuracy = bulletIncrement;
};
if (actionCounter > 64){
shoot(110);
shoot(70);
};
if (actionCounter == 90){
actionCounter = 0;
};
actionCounter++;
};
}
private function chainCheck():void{
var xDis:Number;
var yDis:Number;
var angle:Number;
if (((((((ship.chains.hook1.hitTestObject(MovieClip(root).char)) || (ship.chains.hook2.hitTestObject(MovieClip(root).char)))) || (ship.chains.hook3.hitTestObject(MovieClip(root).char)))) || (ship.chains.hook4.hitTestObject(MovieClip(root).char)))){
xDis = (this.x - MovieClip(this.parent.parent).char.x);
yDis = (this.y - MovieClip(this.parent.parent).char.y);
angle = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(dam, push, angle);
};
hookSmoke(0);
hookSmoke(90);
hookSmoke(180);
hookSmoke(270);
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
private function accelerate():void{
monsterSpeed = (monsterSpeed + 0.02);
}
}
}//package game.overheadShooter.monsters
Section 62
//EggSac (game.overheadShooter.monsters.EggSac)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class EggSac extends MovieClip {
var currentlyFlashBanged:Boolean;// = false
var flashBangDuration:Number;// = 0
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
public var health:Number;// = 20
var lifeSpan;// = 64
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlamed:Boolean;// = false
public function EggSac():void{
super();
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
lifeSpan = (lifeSpan - 1);
if (lifeSpan < 1){
MovieClip(root).babySpider(this.x, this.y);
this.damage(100, 0, 0);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
var MonstersName:String = "eggSac";
health = MovieClip(root).stats[MonstersName].health;
}
}
}//package game.overheadShooter.monsters
Section 63
//Goblin (game.overheadShooter.monsters.Goblin)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Goblin extends MovieClip {
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var flameInterval:Number;// = 0
var push:Number;// = 5
var currentlyPoisoned:Boolean;// = false
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "goblin"
var shieldBroken:Boolean;// = false
var flashBangInterval:Number;// = 0
var swingAxe:Boolean;// = false
var currentlyFlashBanged:Boolean;// = false
var poisonDuration:Number;// = 0
var swingFrames:Number;// = 21
public var swingZone:MovieClip;
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function Goblin():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 60)) && ((swingAxe == false)))){
swingAxe = true;
};
if (swingAxe == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swing");
};
if (swingCounter == 10){
MovieClip(root).SFX("sfxSwing");
};
if ((((swingZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("walk");
swingAxe = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if (swingAxe == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame1(){
stop();
}
function frame2(){
swingZone.gotoAndPlay(2);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y, "yellow");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y, "yellow");
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
}
}//package game.overheadShooter.monsters
Section 64
//GoblinSpear (game.overheadShooter.monsters.GoblinSpear)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class GoblinSpear extends MovieClip {
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "goblinSpear"
var shieldBroken:Boolean;// = false
var flashBangInterval:Number;// = 0
var swingAxe:Boolean;// = false
var currentlyFlashBanged:Boolean;// = false
var poisonDuration:Number;// = 0
var swingFrames:Number;// = 12
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
public var hitZone:MovieClip;
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function GoblinSpear():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 60)) && ((swingAxe == false)))){
swingAxe = true;
};
if (swingAxe == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("attack");
};
if (swingCounter == 10){
MovieClip(root).SFX("sfxSwing");
};
if ((((hitZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("walk");
swingAxe = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if (swingAxe == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame1(){
stop();
}
function frame2(){
hitZone.gotoAndPlay(2);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y, "yellow");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y, "yellow");
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
}
}//package game.overheadShooter.monsters
Section 65
//HammerOgre (game.overheadShooter.monsters.HammerOgre)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class HammerOgre extends MovieClip {
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var swingSword:Boolean;// = false
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "hammerOgre"
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 26
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
public var hitZone:MovieClip;
var poisonInterval:Number;// = 0
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function HammerOgre():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 70)) && ((swingSword == false)))){
swingSword = true;
};
if (swingSword == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swing");
};
if (swingCounter == 15){
MovieClip(root).SFX("sfxSwing");
};
if ((((hitZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("walk");
swingSword = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if (swingSword == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame1(){
stop();
hitZone.stop();
}
function frame2(){
hitZone.gotoAndPlay(1);
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 66
//HighSkeletonArcher (game.overheadShooter.monsters.HighSkeletonArcher)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class HighSkeletonArcher extends MovieClip {
var delay:Number;// = 0
var generosity:Number;// = 0.2
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 3
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var push:Number;// = 5
var helmetBroken:Boolean;// = false
var MonstersName:String;// = "highSkeletonArcher"
var shootArrow:Boolean;// = false
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
public var skele:MovieClip;
var swingFrames:Number;// = 19
public var health:Number;// = 75
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
public var helmet:MovieClip;
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function HighSkeletonArcher():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((((distance < 300)) && ((shootArrow == false)))) && ((delay < 1)))){
shootArrow = true;
swingCounter = swingFrames;
};
if (shootArrow == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("shoot");
};
if (swingCounter == 9){
MovieClip(root).skeleArrow(this.x, this.y, this.rotation);
};
swingCounter = (swingCounter - 1);
} else {
delay = 40;
this.gotoAndPlay("walk");
monsterSwingAnimation = false;
shootArrow = false;
};
};
if (shootArrow == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
if (delay > 0){
delay = (delay - 1);
};
}
function frame1(){
stop();
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y, "dust");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
if (health > 50){
MovieClip(root).splinter(this.x, this.y, this.rotation, "dark", 0);
} else {
if (helmetBroken == false){
helmetBroken = true;
this.helmet.nextFrame();
MovieClip(root).shatter(this.x, this.y, this.rotation, "helmet");
};
MovieClip(parent.parent).squirt(this.x, this.y, "dust");
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 67
//HighSkeletonBandit (game.overheadShooter.monsters.HighSkeletonBandit)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import game.overheadShooter.projectiles.*;
public class HighSkeletonBandit extends MovieClip {
var generosity:Number;// = 0.2
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 3
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var swingCounter:Number;// = 0
var monsterSwingAnimation:Boolean;// = false
var push:Number;// = 5
var helmetBroken:Boolean;// = false
var MonstersName:String;// = "highSkeletonBandit"
var knife1:Object;
var flashBangInterval:Number;// = 0
var knife2:Object;
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
public var skele:MovieClip;
var firstKnife:Boolean;// = true
public var health:Number;// = 75
var throwKnife:Boolean;// = false
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
public var helmet:MovieClip;
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
var knives:Number;// = 2
public function HighSkeletonBandit():void{
originalSpeed = monsterSpeed;
super();
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
if (knife1 != null){
knife1.explode();
};
if (knife2 != null){
knife2.explode();
};
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
public function collectKnife():void{
knives = (knives + 1);
if (knives == 1){
this.skele.play();
knife1 = null;
} else {
knife2 = null;
};
}
function throwCleaver(X:Number, Y:Number, rot:Number, flip:Boolean=false):void{
var cleaver:ProjectileCleaver = new ProjectileCleaver(rot, this, dam, flip);
cleaver.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 40));
cleaver.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 40));
MovieClip(root).Level.addChild(cleaver);
if (firstKnife == true){
knife1 = cleaver;
firstKnife = false;
} else {
knife2 = cleaver;
firstKnife = true;
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 250)) && ((throwKnife == false)))){
throwKnife = true;
knives = 0;
};
if (throwKnife == true){
if (knives < 2){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndPlay("throw");
};
swingCounter = (swingCounter + 1);
if (swingCounter == 5){
throwCleaver(this.x, this.y, this.rotation);
MovieClip(root).SFX("sfxSwing2");
};
if (swingCounter == 15){
throwCleaver(this.x, this.y, this.rotation, true);
MovieClip(root).SFX("sfxSwing1");
};
} else {
this.gotoAndPlay("walk");
monsterSwingAnimation = false;
throwKnife = false;
swingCounter = 0;
};
};
if (throwKnife == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
if (knife1 != null){
knife1.explode();
};
if (knife2 != null){
knife2.explode();
};
MovieClip(parent.parent).spatter(this.x, this.y, "dust");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
if (health > 50){
MovieClip(root).splinter(this.x, this.y, this.rotation, "dark", 0);
} else {
if (helmetBroken == false){
helmetBroken = true;
this.helmet.nextFrame();
MovieClip(root).shatter(this.x, this.y, this.rotation, "helmet");
};
MovieClip(parent.parent).squirt(this.x, this.y, "dust");
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 68
//HighSkeletonMage (game.overheadShooter.monsters.HighSkeletonMage)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class HighSkeletonMage extends MovieClip {
var generosity:Number;// = 0.2
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 2
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var push:Number;// = 5
var helmetBroken:Boolean;// = false
var MonstersName:String;// = "highSkeletonMage"
var flashBangInterval:Number;// = 0
var castMagic:Boolean;// = false
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
public var skele:MovieClip;
var swingFrames:Number;// = 22
public var health:Number;// = 75
var flameDuration:Number;// = 0
var cooldown:Number;// = 0
var poisonInterval:Number;// = 0
public var helmet:MovieClip;
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function HighSkeletonMage():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((((distance < 250)) && ((castMagic == false)))) && ((cooldown < 1)))){
castMagic = true;
swingCounter = swingFrames;
};
if (cooldown >= 1){
cooldown--;
};
if (castMagic == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("shoot");
};
if (swingCounter == 11){
MovieClip(root).mageFlame(this.x, this.y, this.rotation);
};
swingCounter = (swingCounter - 1);
} else {
this.gotoAndPlay("walk");
monsterSwingAnimation = false;
castMagic = false;
cooldown = 31;
};
};
if (castMagic == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function frame1(){
stop();
}
function frame2(){
stop();
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y, "dust");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
if (health > 50){
MovieClip(root).splinter(this.x, this.y, this.rotation, "dark", 0);
} else {
if (helmetBroken == false){
helmetBroken = true;
this.helmet.nextFrame();
MovieClip(root).shatter(this.x, this.y, this.rotation, "helmet");
};
MovieClip(parent.parent).squirt(this.x, this.y, "dust");
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 69
//HighSkeletonSwordsman (game.overheadShooter.monsters.HighSkeletonSwordsman)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class HighSkeletonSwordsman extends MovieClip {
var generosity:Number;// = 0.2
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var swingCounter:Number;
var swingSword:Boolean;// = false
var monsterSwingAnimation:Boolean;// = false
var push:Number;// = 5
var helmetBroken:Boolean;// = false
var MonstersName:String;// = "highSkeletonSwordsman"
var shieldBroken:Boolean;// = false
var flashBangInterval:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var poisonDuration:Number;// = 0
public var skele:MovieClip;
public var swordZone:MovieClip;
var swingFrames:Number;// = 11
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
public var helmet:MovieClip;
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function HighSkeletonSwordsman():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 60)) && ((swingSword == false)))){
swingSword = true;
};
if ((((swingSword == true)) && ((health > 70)))){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swingShield");
};
if (swingCounter == 8){
MovieClip(root).SFX("sfxSwing");
};
if ((((swordZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
if (health > 70){
this.gotoAndStop("walkShield");
} else {
this.gotoAndStop("walkNoShield");
};
swingSword = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if ((((swingSword == true)) && ((health <= 70)))){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swingNoShield");
};
if ((((swordZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
if (health > 70){
this.gotoAndStop("walkShield");
} else {
this.gotoAndStop("walkNoShield");
};
swingSword = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if (swingSword == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame4(){
stop();
swordZone.gotoAndStop(4);
}
function frame1(){
stop();
swordZone.gotoAndStop(1);
}
function frame2(){
stop();
swordZone.gotoAndStop(2);
}
function frame3(){
stop();
swordZone.gotoAndStop(3);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y, "dust");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
if (health > 70){
MovieClip(root).splinter(this.x, this.y, this.rotation, "gold");
} else {
if (shieldBroken == false){
shieldBroken = true;
MovieClip(root).shatter(this.x, this.y, this.rotation, "gold");
this.gotoAndStop("walkNoShield");
swingSword = false;
swingCounter = swingFrames;
};
if (health > 50){
MovieClip(root).splinter(this.x, this.y, this.rotation, "dark", 0);
} else {
if (helmetBroken == false){
helmetBroken = true;
this.helmet.nextFrame();
MovieClip(root).shatter(this.x, this.y, this.rotation, "helmet");
};
MovieClip(parent.parent).squirt(this.x, this.y, "dust");
};
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 70
//IceFatty (game.overheadShooter.monsters.IceFatty)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class IceFatty extends MovieClip {
var delay:Number;// = 0
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var helmetBroken:Boolean;// = false
var MonstersName:String;// = "iceFatty"
var flashBangInterval:Number;// = 0
var castMagic:Boolean;// = false
var currentlyFlashBanged:Boolean;// = false
var poisonDuration:Number;// = 0
var swingFrames:Number;// = 20
public var health:Number;// = 75
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function IceFatty():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((((distance < 250)) && ((castMagic == false)))) && ((delay < 1)))){
castMagic = true;
swingCounter = swingFrames;
};
if (delay > 0){
delay = (delay - 1);
};
if (castMagic == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("shoot");
};
if (swingCounter == 9){
MovieClip(root).iceShot(this.x, this.y, this.rotation);
MovieClip(root).iceShot(this.x, this.y, (this.rotation + 15));
MovieClip(root).iceShot(this.x, this.y, (this.rotation - 15));
};
if (swingCounter == 11){
MovieClip(root).SFX("sfxBelly");
};
swingCounter = (swingCounter - 1);
} else {
this.gotoAndPlay("walk");
monsterSwingAnimation = false;
castMagic = false;
delay = 31;
};
};
if (castMagic == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame1(){
stop();
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
}
}//package game.overheadShooter.monsters
Section 71
//MarauderGatling (game.overheadShooter.monsters.MarauderGatling)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class MarauderGatling extends MovieClip {
var gunMax:Point;
var coolDown:Number;// = 0
var bulletIncrement:Number;
var bulletP:Point;
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var bulletAccuracy:Number;// = 0.05
public var monsterSpeed:Number;// = 2
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var push:Number;// = 5
var MonstersName:String;// = "marauderGatling"
var shootGun:Boolean;// = false
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 20
public var health:Number;// = 75
var gunRange:Number;// = 300
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
var startHere:Point;
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var playerHit:Boolean;// = false
var flashBangDuration:Number;// = 0
public function MarauderGatling():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
gunMax = new Point(0, 0);
bulletP = new Point(0, 0);
bulletIncrement = bulletAccuracy;
startHere = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
function shoot():void{
startHere.x = (this.x + (Math.cos((((this.rotation - 70) * Math.PI) / 180)) * 40));
startHere.y = (this.y + (Math.sin((((this.rotation - 70) * Math.PI) / 180)) * 40));
gunMax.x = (startHere.x - (Math.cos((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
gunMax.y = (startHere.y - (Math.sin((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
bulletAccuracy = (bulletAccuracy + bulletIncrement);
bulletP = Point.interpolate(gunMax, startHere, bulletAccuracy);
if (MovieClip(root).char.hitTestPoint(bulletP.x, bulletP.y, true) == true){
MovieClip(root).char.damage(dam, push, this.rotation);
monsterSwingAnimation = false;
this.gotoAndPlay("walk");
swingCounter = 0;
shootGun = false;
};
if (shootGun == true){
MovieClip(root).smokeTrail(bulletP.x, bulletP.y);
MovieClip(root).splinter(bulletP.x, bulletP.y, this.rotation, "dark", 0);
MovieClip(root).SFX("sfxAuto");
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((((distance < 250)) && ((shootGun == false)))) && ((coolDown < 1)))){
coolDown = 64;
shootGun = true;
bulletAccuracy = bulletIncrement;
};
if ((((shootGun == true)) && ((swingCounter < 31)))){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("shoot");
};
shoot();
swingCounter = (swingCounter + 1);
} else {
if (shootGun == true){
monsterSwingAnimation = false;
this.gotoAndPlay("walk");
swingCounter = 0;
shootGun = false;
};
};
if (shootGun == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
if (coolDown > 0){
coolDown = (coolDown - 1);
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function frame1(){
stop();
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 72
//MarauderRifle (game.overheadShooter.monsters.MarauderRifle)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class MarauderRifle extends MovieClip {
var gunMax:Point;
var bulletIncrement:Number;
var bulletP:Point;
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var bulletAccuracy:Number;// = 0.05
public var monsterSpeed:Number;// = 2
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var shootGun:Boolean;// = false
var MonstersName:String;// = "marauderRifle"
var flashBangInterval:Number;// = 0
var monsterLocation:Point;
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 20
public var health:Number;// = 75
var gunRange:Number;// = 250
var flameDuration:Number;// = 0
var cooldown:Number;// = 0
var generosity:Number;// = 0.2
var playerHit:Boolean;// = false
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function MarauderRifle():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
gunMax = new Point(0, 0);
bulletP = new Point(0, 0);
bulletIncrement = bulletAccuracy;
monsterLocation = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function shoot():void{
gunMax.x = (this.x - (Math.cos((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
gunMax.y = (this.y - (Math.sin((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
monsterLocation.x = this.x;
monsterLocation.y = this.y;
bulletAccuracy = bulletIncrement;
MovieClip(root).SFX("sfxAuto");
do {
bulletAccuracy = (bulletAccuracy + bulletIncrement);
bulletP = Point.interpolate(gunMax, monsterLocation, bulletAccuracy);
if (MovieClip(root).char.hitTestPoint(bulletP.x, bulletP.y, true) == true){
MovieClip(root).char.damage(dam, push, this.rotation);
playerHit = true;
};
} while ((((playerHit == false)) && ((bulletAccuracy < 1))));
if (playerHit == false){
MovieClip(root).smokeTrail(gunMax.x, gunMax.y);
MovieClip(root).splinter(bulletP.x, bulletP.y, this.rotation, "dark", 0);
};
playerHit = false;
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((((distance < 200)) && ((shootGun == false)))) && ((cooldown < 1)))){
shootGun = true;
};
if (cooldown >= 1){
cooldown--;
};
if (shootGun == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("shoot");
};
if (swingCounter == 10){
shoot();
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("walk");
shootGun = false;
swingCounter = swingFrames;
cooldown = 31;
};
};
if (shootGun == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function frame1(){
stop();
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 73
//MarauderSpikedClub (game.overheadShooter.monsters.MarauderSpikedClub)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class MarauderSpikedClub extends MovieClip {
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var swingSword:Boolean;// = false
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "marauderSpikedClub"
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 16
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
public var hitZone:MovieClip;
var poisonInterval:Number;// = 0
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function MarauderSpikedClub():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 60)) && ((swingSword == false)))){
swingSword = true;
};
if (swingSword == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swing");
};
if ((((hitZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
if (swingCounter == 10){
MovieClip(root).SFX("sfxSwing");
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("walk");
swingSword = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if (swingSword == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame1(){
stop();
hitZone.stop();
}
function frame2(){
hitZone.gotoAndPlay(1);
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 74
//MercenaryGatling (game.overheadShooter.monsters.MercenaryGatling)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class MercenaryGatling extends MovieClip {
var gunMax:Point;
var coolDown:Number;// = 0
var bulletIncrement:Number;
var bulletP:Point;
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var bulletAccuracy:Number;// = 0.05
public var monsterSpeed:Number;// = 2
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var push:Number;// = 5
var MonstersName:String;// = "mercenaryGatling"
var shootGun:Boolean;// = false
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 20
public var health:Number;// = 75
var gunRange:Number;// = 300
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
var startHere:Point;
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var playerHit:Boolean;// = false
var flashBangDuration:Number;// = 0
public function MercenaryGatling():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
gunMax = new Point(0, 0);
bulletP = new Point(0, 0);
bulletIncrement = bulletAccuracy;
startHere = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
function shoot():void{
startHere.x = (this.x + (Math.cos((((this.rotation - 70) * Math.PI) / 180)) * 40));
startHere.y = (this.y + (Math.sin((((this.rotation - 70) * Math.PI) / 180)) * 40));
gunMax.x = (startHere.x - (Math.cos((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
gunMax.y = (startHere.y - (Math.sin((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
bulletAccuracy = (bulletAccuracy + bulletIncrement);
bulletP = Point.interpolate(gunMax, startHere, bulletAccuracy);
if (MovieClip(root).char.hitTestPoint(bulletP.x, bulletP.y, true) == true){
MovieClip(root).char.damage(dam, push, this.rotation);
monsterSwingAnimation = false;
this.gotoAndPlay("walk");
swingCounter = 0;
shootGun = false;
};
if (shootGun == true){
MovieClip(root).smokeTrail(bulletP.x, bulletP.y);
MovieClip(root).splinter(bulletP.x, bulletP.y, this.rotation, "dark", 0);
MovieClip(root).SFX("sfxAuto");
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((((distance < 250)) && ((shootGun == false)))) && ((coolDown < 1)))){
coolDown = 64;
shootGun = true;
bulletAccuracy = bulletIncrement;
};
if ((((shootGun == true)) && ((swingCounter < 31)))){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("shoot");
};
shoot();
swingCounter = (swingCounter + 1);
} else {
if (shootGun == true){
monsterSwingAnimation = false;
this.gotoAndPlay("walk");
swingCounter = 0;
shootGun = false;
};
};
if (shootGun == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
if (coolDown > 0){
coolDown = (coolDown - 1);
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function frame1(){
stop();
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 75
//MercenaryRifle (game.overheadShooter.monsters.MercenaryRifle)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class MercenaryRifle extends MovieClip {
var gunMax:Point;
var bulletIncrement:Number;
var bulletP:Point;
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var bulletAccuracy:Number;// = 0.05
public var monsterSpeed:Number;// = 2
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var shootGun:Boolean;// = false
var MonstersName:String;// = "mercenaryRifle"
var flashBangInterval:Number;// = 0
var monsterLocation:Point;
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 20
public var health:Number;// = 75
var gunRange:Number;// = 250
var flameDuration:Number;// = 0
var cooldown:Number;// = 0
var generosity:Number;// = 0.2
var playerHit:Boolean;// = false
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function MercenaryRifle():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
gunMax = new Point(0, 0);
bulletP = new Point(0, 0);
bulletIncrement = bulletAccuracy;
monsterLocation = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function shoot():void{
gunMax.x = (this.x - (Math.cos((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
gunMax.y = (this.y - (Math.sin((((this.rotation + 90) * Math.PI) / 180)) * gunRange));
monsterLocation.x = this.x;
monsterLocation.y = this.y;
bulletAccuracy = bulletIncrement;
MovieClip(root).SFX("sfxAuto");
do {
bulletAccuracy = (bulletAccuracy + bulletIncrement);
bulletP = Point.interpolate(gunMax, monsterLocation, bulletAccuracy);
if (MovieClip(root).char.hitTestPoint(bulletP.x, bulletP.y, true) == true){
MovieClip(root).char.damage(dam, push, this.rotation);
playerHit = true;
};
} while ((((playerHit == false)) && ((bulletAccuracy < 1))));
if (playerHit == false){
MovieClip(root).smokeTrail(gunMax.x, gunMax.y);
MovieClip(root).splinter(bulletP.x, bulletP.y, this.rotation, "dark", 0);
};
playerHit = false;
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((((distance < 200)) && ((shootGun == false)))) && ((cooldown < 1)))){
shootGun = true;
};
if (cooldown >= 1){
cooldown--;
};
if (shootGun == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("shoot");
};
if (swingCounter == 10){
shoot();
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("walk");
shootGun = false;
swingCounter = swingFrames;
cooldown = 31;
};
};
if (shootGun == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function frame1(){
stop();
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 76
//MercenarySword (game.overheadShooter.monsters.MercenarySword)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class MercenarySword extends MovieClip {
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var swingSword:Boolean;// = false
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "mercenarySword"
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 16
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
public var hitZone:MovieClip;
var poisonInterval:Number;// = 0
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function MercenarySword():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 60)) && ((swingSword == false)))){
swingSword = true;
};
if (swingSword == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swing");
};
if ((((hitZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
if (swingCounter == 10){
MovieClip(root).SFX("sfxSwing");
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("walk");
swingSword = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if (swingSword == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame1(){
stop();
hitZone.stop();
}
function frame2(){
hitZone.gotoAndPlay(1);
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 77
//SkeleKnight (game.overheadShooter.monsters.SkeleKnight)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class SkeleKnight extends MovieClip {
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var swingSword:Boolean;// = false
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "skeleKnight"
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 16
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
public var hitZone:MovieClip;
var poisonInterval:Number;// = 0
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function SkeleKnight():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 60)) && ((swingSword == false)))){
swingSword = true;
};
if (swingSword == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swing");
};
if (swingCounter == 10){
MovieClip(root).SFX("sfxSwing");
};
if ((((hitZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("walk");
swingSword = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if (swingSword == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame1(){
stop();
hitZone.stop();
}
function frame2(){
hitZone.gotoAndPlay(1);
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y, "dust");
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y, "dust");
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 78
//Skeleton (game.overheadShooter.monsters.Skeleton)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Skeleton extends MovieClip {
public var giftType:String;// = ""
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var flameInterval:Number;// = 0
var push:Number;// = 5
var currentlyPoisoned:Boolean;// = false
var shieldBroken:Boolean;// = false
var swingSword:Boolean;// = false
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "skeleton"
var swingCounter:Number;
var flashBangInterval:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var poisonDuration:Number;// = 0
var swingFrames:Number;// = 11
public var skele:MovieClip;
public var swordZone:MovieClip;
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function Skeleton():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 60)) && ((swingSword == false)))){
swingSword = true;
};
if ((((swingSword == true)) && ((health > 40)))){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swingShield");
};
if (swingCounter == 8){
MovieClip(root).SFX("sfxSwing");
};
if ((((swordZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
if (health > 40){
this.gotoAndStop("walkShield");
} else {
this.gotoAndStop("walkNoShield");
};
swingSword = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if ((((swingSword == true)) && ((health <= 40)))){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("swingNoShield");
};
if ((((swordZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
if (health > 40){
this.gotoAndStop("walkShield");
} else {
this.gotoAndStop("walkNoShield");
};
swingSword = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if (swingSword == false){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
}
function frame4(){
stop();
swordZone.gotoAndStop(4);
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function frame1(){
stop();
swordZone.gotoAndStop(1);
}
function frame2(){
stop();
swordZone.gotoAndStop(2);
}
function frame3(){
stop();
swordZone.gotoAndStop(3);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y, "dust");
if (giftType != ""){
MovieClip(root).dropGoodies(x, y, giftType);
} else {
MovieClip(parent.parent).drop(generosity, this.x, this.y);
};
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
if (health > 40){
MovieClip(root).splinter(this.x, this.y, this.rotation);
} else {
if (shieldBroken == false){
shieldBroken = true;
MovieClip(root).shatter(this.x, this.y, this.rotation);
this.gotoAndStop("walkNoShield");
swingSword = false;
swingCounter = swingFrames;
};
MovieClip(parent.parent).squirt(this.x, this.y, "dust");
};
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 79
//SnowFiend (game.overheadShooter.monsters.SnowFiend)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import game.overheadShooter.projectiles.*;
public class SnowFiend extends MovieClip {
var currentlyPoisoned:Boolean;// = false
public var dam:Number;// = 10
public var monsterSpeed:Number;// = 2
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;// = 0
var monsterSwingAnimation:Boolean;// = false
var helmetBroken:Boolean;// = false
var MonstersName:String;// = "snowFiend"
var POI:Point;
var flashBangInterval:Number;// = 0
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var spear:Object;
public var health:Number;// = 75
var actionCounter:Number;// = 0
var generosity:Number;// = 0.2
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function SnowFiend():void{
originalSpeed = monsterSpeed;
POI = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
if (spear != null){
spear.explode();
};
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function throwSpear(X:Number, Y:Number, rot:Number):void{
MovieClip(root).SFX("sfxSwing5");
spear = new ProjectileSnowSpear((rot - 5));
spear.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 190));
spear.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 190));
MovieClip(root).Level.addChild(spear);
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - POI.x);
var yDis:Number = (this.y - POI.y);
var distance:Number = Point.distance(monsterLocation, POI);
var angle:Number = Math.atan2(yDis, xDis);
if (actionCounter == 0){
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < 280){
actionCounter = 1;
};
};
if (actionCounter == 1){
if (swingCounter < 21){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("throw");
};
swingCounter = (swingCounter + 1);
if (swingCounter == 11){
throwSpear(this.x, this.y, this.rotation);
};
if (swingCounter == 20){
POI.x = spear.x;
POI.y = spear.y;
};
} else {
this.gotoAndStop("walkNoSpear");
monsterSwingAnimation = false;
actionCounter = 3;
swingCounter = 0;
};
};
if (actionCounter == 3){
POI.x = spear.x;
POI.y = spear.y;
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < 105){
actionCounter = 4;
};
};
if (actionCounter == 4){
if (swingCounter < 10){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("get spear");
};
swingCounter = (swingCounter + 1);
if (swingCounter == 7){
collectSpear();
};
if (swingCounter == 9){
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
};
} else {
this.gotoAndStop("walkSpear");
monsterSwingAnimation = false;
actionCounter = 0;
swingCounter = 0;
};
};
}
public function collectSpear():void{
spear.remove();
spear = null;
}
function frame1(){
stop();
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
if (spear != null){
spear.explode();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 80
//Spider (game.overheadShooter.monsters.Spider)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Spider extends MovieClip {
public var giftType:String;// = ""
var coolDown:Number;// = 0
public var monsterSpeed:Number;// = 3
public var dam:Number;// = 10
var flameInterval:Number;// = 0
var push:Number;// = 5
var currentlyPoisoned:Boolean;// = false
var swingCounter:Number;
var swingSword:Boolean;// = false
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "spider"
var flashBangInterval:Number;// = 0
public var offsetlegs:MovieClip;
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 11
var hitPlayer:Boolean;// = false
public var health:Number;// = 50
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function Spider():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if ((((distance < 35)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
coolDown = 15;
};
if (coolDown > 0){
coolDown = (coolDown - 1);
};
if ((((coolDown < 1)) && ((hitPlayer == true)))){
hitPlayer = false;
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function frame1(){
stop();
offsetlegs.gotoAndPlay(5);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
if (giftType != ""){
MovieClip(root).dropGoodies(x, y, giftType);
} else {
MovieClip(parent.parent).drop(generosity, this.x, this.y);
};
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 81
//SpiderBoss (game.overheadShooter.monsters.SpiderBoss)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class SpiderBoss extends MovieClip {
var btmRight:Point;
var btmLeft:Point;
var counter:Number;// = 0
var topLeft:Point;
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var target:Point;
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "spiderBoss"
var POI:Point;
var flashBangInterval:Number;// = 0
var castMagic:Boolean;// = false
var currentlyFlashBanged:Boolean;// = false
var poisonDuration:Number;// = 0
var swingFrames:Number;// = 60
var topRight:Point;
var Switch:Boolean;// = true
public var health:Number;// = 75
var actionCounter:Number;// = 1
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function SpiderBoss():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
topLeft = new Point(100, 100);
topRight = new Point(600, 100);
btmLeft = new Point(100, 425);
btmRight = new Point(600, 425);
POI = new Point(0, 0);
target = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
function pickACorner():void{
var chance:Number = Math.random();
trace(("Chance: " + chance));
if (chance < 0.25){
POI.x = topLeft.x;
POI.y = topLeft.y;
} else {
if (chance < 0.5){
POI.x = topRight.x;
POI.y = topRight.y;
} else {
if (chance < 0.75){
POI.x = btmLeft.x;
POI.y = btmLeft.y;
} else {
POI.x = btmRight.x;
POI.y = btmRight.y;
};
};
};
trace(POI);
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - POI.x);
var yDis:Number = (this.y - POI.y);
var distance:Number = Point.distance(monsterLocation, POI);
var angle:Number = Math.atan2(yDis, xDis);
if (actionCounter == 1){
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < monsterSpeed){
actionCounter = 2;
gotoAndStop("lay");
distance = 999;
counter = 0;
};
};
if (actionCounter == 2){
if (counter < 8){
counter = (counter + 1);
} else {
actionCounter = 3;
gotoAndStop("walk");
counter = 0;
cycleCorner();
distance = 999;
MovieClip(root).spiderSac((this.x + 7), (this.y + 7), this.rotation);
MovieClip(root).spiderSac(this.x, (this.y - 7), this.rotation, 4);
MovieClip(root).spiderSac((this.x - 7), (this.y + 7), this.rotation, 8);
};
};
if (actionCounter == 3){
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < monsterSpeed){
actionCounter = 4;
cycleCorner();
distance = 999;
};
};
if (actionCounter == 4){
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < monsterSpeed){
actionCounter = 5;
gotoAndStop("lay");
counter = 0;
distance = 999;
};
};
if (actionCounter == 5){
if (counter < 8){
counter = (counter + 1);
} else {
actionCounter = 6;
gotoAndStop("walk");
counter = 0;
cycleCorner();
distance = 999;
MovieClip(root).spiderSac((this.x + 7), (this.y + 7), this.rotation);
MovieClip(root).spiderSac(this.x, (this.y - 7), this.rotation, 4);
MovieClip(root).spiderSac((this.x - 7), (this.y + 7), this.rotation, 8);
};
};
if (actionCounter == 6){
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < monsterSpeed){
actionCounter = 7;
distance = 999;
};
};
if (actionCounter == 7){
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
xDis = (this.x - POI.x);
yDis = (this.y - POI.y);
distance = Point.distance(monsterLocation, POI);
angle = Math.atan2(yDis, xDis);
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < 180){
actionCounter = 8;
gotoAndStop("spit");
};
};
if (actionCounter == 8){
if (counter < 17){
counter = (counter + 1);
if (counter == 11){
MovieClip(root).acidSpit(this.x, this.y, this.rotation);
};
} else {
actionCounter = 1;
gotoAndStop("walk");
counter = 0;
pickACorner();
};
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function cycleCorner():void{
trace("cycling");
if ((((POI.x == topRight.x)) && ((POI.y == topRight.y)))){
POI.x = topLeft.x;
POI.y = topLeft.y;
} else {
if ((((POI.x == topLeft.x)) && ((POI.y == topLeft.y)))){
POI.x = btmLeft.x;
POI.y = btmLeft.y;
} else {
if ((((POI.x == btmLeft.x)) && ((POI.y == btmLeft.y)))){
POI.x = btmRight.x;
POI.y = btmRight.y;
} else {
POI.x = topRight.x;
POI.y = topRight.y;
};
};
};
}
function frame1(){
stop();
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(root).bossDeath(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(root).HUD.bossHealth.visible = false;
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
MovieClip(root).HUD.bossHealth.bar.height = ((310 * health) / MovieClip(root).stats[MonstersName].health);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
pickACorner();
MovieClip(root).HUD.bossHealth.visible = true;
MovieClip(root).HUD.bossHealth.bar.height = 310;
}
}
}//package game.overheadShooter.monsters
Section 82
//SpikeDemon (game.overheadShooter.monsters.SpikeDemon)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class SpikeDemon extends MovieClip {
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var target:Point;
var currentlyPoisoned:Boolean;// = false
var strut:Boolean;// = false
var walkToCorner:Boolean;// = true
var push:Number;// = 5
var strutCooldown:Number;// = 0
var swingCounter:Number;
var flameInterval:Number;// = 0
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "spikeDemon"
var flashBangInterval:Number;// = 0
var castMagic:Boolean;// = false
var poisonDuration:Number;// = 0
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 60
var strutCounter:Number;// = 0
var strutDirection:Number;// = 1
public var health:Number;// = 75
var flameDuration:Number;// = 0
var generosity:Number;// = 0.2
var poisonInterval:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function SpikeDemon():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
target = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function pickACorner():void{
var chance:Number = Math.random();
if (chance < 0.25){
target.x = 510;
target.y = 335;
} else {
if (chance < 0.5){
target.x = 190;
target.y = 335;
} else {
if (chance < 0.75){
target.x = 190;
target.y = 190;
} else {
target.x = 510;
target.y = 190;
};
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(root).char.x, MovieClip(root).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if (walkToCorner == true){
WalkToCorner();
};
if (castMagic == true){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("cast");
this.rotation = (((angle * 180) / Math.PI) - 90);
strutCounter = (31 * 5);
};
if (swingCounter == 30){
MovieClip(root).castSpikes(this.x, this.y, this.rotation);
};
swingCounter = (swingCounter - 1);
} else {
this.gotoAndPlay("walk");
swingCounter = swingFrames;
monsterSwingAnimation = false;
castMagic = false;
randomizeStrut();
strut = true;
};
};
if (strut == true){
if (currentlyFlashBanged == false){
this.rotation = (90 * strutDirection);
};
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * monsterSpeed));
checkBounds();
strutCounter = (strutCounter - 1);
if (strutCounter < 1){
strut = false;
castMagic = true;
};
};
if (strutCooldown > 0){
strutCooldown = (strutCooldown - 1);
};
}
function WalkToCorner():void{
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - target.x);
var yDis:Number = (this.y - target.y);
var distance:Number = Point.distance(monsterLocation, target);
var angle:Number = Math.atan2(yDis, xDis);
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < monsterSpeed){
walkToCorner = false;
castMagic = true;
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function checkBounds():void{
if ((((((((this.x < 0)) || ((this.y < 0)))) || ((this.x > 700)))) || ((((this.y > 525)) && ((strutCooldown < 1)))))){
strutDirection = (strutDirection + 2);
strutCooldown = 31;
if ((((((((this.x < -20)) || ((this.y < -20)))) || ((this.x > 720)))) || ((this.y > 545)))){
castMagic = false;
strut = false;
castMagic = false;
walkToCorner = true;
pickACorner();
};
};
}
function randomizeStrut():void{
var rnd:Number = (Math.random() * 3);
rnd = Math.floor(rnd);
strutDirection = (rnd + 1);
}
function frame1(){
stop();
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
pickACorner();
}
}
}//package game.overheadShooter.monsters
Section 83
//ToxicSpider (game.overheadShooter.monsters.ToxicSpider)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ToxicSpider extends MovieClip {
var attackThisWay:Number;// = 0
var coolDown:Number;// = 0
public var monsterSpeed:Number;// = 3
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var hatchDelay:Number;// = 0
var MonstersName:String;// = "toxicSpider"
var flashBangInterval:Number;// = 0
var jump:Boolean;// = false
var poisonDuration:Number;// = 0
public var offsetlegs:MovieClip;
var currentlyFlashBanged:Boolean;// = false
var swingFrames:Number;// = 11
var hatch:Boolean;// = false
var decisionTime:Number;// = 124
var walk:Boolean;// = true
var hitPlayer:Boolean;// = false
public var health:Number;// = 70
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
var generosity:Number;// = 0.2
var jumpCounter:Number;// = 0
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function ToxicSpider():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((currentlyFlashBanged == false)) && ((walk == true)))){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
decisionTime = (decisionTime - 1);
if (decisionTime < 1){
decide();
};
if (walk == true){
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
if (jump == true){
if (jumpCounter > 10){
jumpCounter = (jumpCounter - 1);
this.rotation = (((angle * 180) / Math.PI) - 90);
this.gotoAndStop("halt");
attackThisWay = angle;
} else {
if (jumpCounter > 8){
jumpCounter = (jumpCounter - 1);
this.x = (this.x - ((Math.cos(attackThisWay) * monsterSpeed) * 3));
this.y = (this.y - ((Math.sin(attackThisWay) * monsterSpeed) * 3));
this.scaleX = 1.25;
this.scaleY = 1.25;
this.gotoAndStop("leap1");
} else {
if (jumpCounter > 4){
jumpCounter = (jumpCounter - 1);
this.x = (this.x - ((Math.cos(attackThisWay) * monsterSpeed) * 3));
this.y = (this.y - ((Math.sin(attackThisWay) * monsterSpeed) * 3));
this.gotoAndStop("leap2");
this.scaleX = 1.5;
this.scaleY = 1.5;
} else {
if (jumpCounter > 2){
jumpCounter = (jumpCounter - 1);
this.x = (this.x - ((Math.cos(attackThisWay) * monsterSpeed) * 2.5));
this.y = (this.y - ((Math.sin(attackThisWay) * monsterSpeed) * 2.5));
this.gotoAndStop("leap3");
this.scaleX = 1.25;
this.scaleY = 1.25;
} else {
if (jumpCounter > 0){
jumpCounter = (jumpCounter - 1);
this.x = (this.x - ((Math.cos(angle) * monsterSpeed) * 0.5));
this.y = (this.y - ((Math.sin(angle) * monsterSpeed) * 0.5));
this.gotoAndStop("leap4");
this.scaleX = 1;
this.scaleY = 1;
} else {
jump = false;
walk = true;
};
};
};
};
};
};
if (hatch == true){
if (hatchDelay == 18){
this.rotation = (((angle * 180) / Math.PI) - 90);
this.gotoAndStop("eggLay");
};
if (hatchDelay == 14){
MovieClip(root).spiderSac(this.x, this.y, this.rotation);
};
hatchDelay = (hatchDelay - 1);
if (hatchDelay < 1){
hatch = false;
walk = true;
this.gotoAndStop("walking");
};
};
if ((((distance < 35)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
coolDown = 15;
};
if (coolDown > 0){
coolDown = (coolDown - 1);
};
if ((((coolDown < 1)) && ((hitPlayer == true)))){
hitPlayer = false;
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
function frame1(){
stop();
offsetlegs.gotoAndPlay(5);
}
function decide():void{
decisionTime = (2 * 31);
var chance:Number = Math.random();
if (chance < 0.33){
walk = false;
jump = false;
hatch = true;
hatchDelay = 18;
} else {
if (chance < 0.66){
walk = false;
jump = true;
hatch = false;
jumpCounter = 22;
} else {
walk = true;
jump = false;
hatch = false;
this.gotoAndStop("walking");
};
};
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 84
//WyrmBoss (game.overheadShooter.monsters.WyrmBoss)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class WyrmBoss extends MovieClip {
var counter:Number;// = 0
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var target:Point;
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var monsterSwingAnimation:Boolean;// = false
var MonstersName:String;// = "wyrmBoss"
var POI:Point;
var flashBangInterval:Number;// = 0
var castMagic:Boolean;// = false
var currentlyFlashBanged:Boolean;// = false
var poisonDuration:Number;// = 0
var swingFrames:Number;// = 60
var Switch:Boolean;// = true
public var health:Number;// = 75
var actionCounter:Number;// = 1
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function WyrmBoss():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
POI = new Point(0, 0);
target = new Point(0, 0);
super();
addFrameScript(0, frame1);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(POI.x, POI.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - POI.x);
var yDis:Number = (this.y - POI.y);
var distance:Number = Point.distance(monsterLocation, POI);
var angle:Number = Math.atan2(yDis, xDis);
if (actionCounter == 1){
breakGround();
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < monsterSpeed){
actionCounter = 2;
scaleX = 0.5;
scaleY = 0.5;
this.visible = true;
gotoAndStop("open");
counter = 0;
};
};
if (actionCounter == 2){
counter = (counter + 1);
if (scaleX < 1){
scaleX = (scaleX + 0.05);
scaleY = (scaleY + 0.05);
};
if (counter < 30){
this.rotation = ((30 - counter) * -5);
};
if (counter == 50){
MovieClip(root).spikeTail(this.x, this.y, (this.rotation + ((360 / 6) * 1)), 10, true);
MovieClip(root).spikeTail(this.x, this.y, (this.rotation + ((360 / 6) * 2)), 10, true);
MovieClip(root).spikeTail(this.x, this.y, (this.rotation + ((360 / 6) * 3)), 10, true);
MovieClip(root).spikeTail(this.x, this.y, (this.rotation + ((360 / 6) * 4)), 10, true);
MovieClip(root).spikeTail(this.x, this.y, (this.rotation + ((360 / 6) * 5)), 10, true);
MovieClip(root).spikeTail(this.x, this.y, (this.rotation + ((360 / 6) * 6)), 10);
};
if (counter == 100){
actionCounter = 3;
counter = 0;
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
};
};
if (actionCounter == 3){
counter = (counter + 1);
if (counter == 2){
this.rotation = (((angle * 180) / Math.PI) - 90);
gotoAndStop("shoot");
};
if (counter == 6){
MovieClip(root).spikeTail(this.x, this.y, this.rotation, 5, true);
MovieClip(root).spikeTail(this.x, this.y, (this.rotation + 20), 5, true);
MovieClip(root).spikeTail(this.x, this.y, (this.rotation - 20), 5);
};
if (counter == 24){
MovieClip(root).spikeTail(this.x, this.y, this.rotation, 15, true);
MovieClip(root).spikeTail(this.x, this.y, (this.rotation + 20), 15, true);
MovieClip(root).spikeTail(this.x, this.y, (this.rotation - 20), 15);
};
if (counter == 24){
gotoAndStop("close");
};
if (counter >= 24){
scaleX = (scaleX - 0.05);
scaleY = (scaleY - 0.05);
rotation = (rotation - 20);
if (scaleX <= 0.5){
actionCounter = 4;
counter = 0;
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
this.visible = false;
};
};
};
if (actionCounter == 4){
breakGround();
this.rotation = (((angle * 180) / Math.PI) - 90);
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
if (distance < monsterSpeed){
actionCounter = 5;
counter = 0;
POI.x = MovieClip(root).char.x;
POI.y = MovieClip(root).char.y;
};
};
if (actionCounter == 5){
counter = (counter + 1);
if (counter == 10){
this.rotation = (((angle * 180) / Math.PI) - 90);
MovieClip(root).spikeTail(this.x, this.y, this.rotation, 5);
};
if (counter > 60){
counter = 0;
actionCounter = 1;
POI.x = 350;
POI.y = 263;
};
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
function frame1(){
stop();
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
var arrayIndex:Number;
var charLocation:Point;
var monsterLocation:Point;
var distance:Number;
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
this.removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(root).bossDeath(this.x, this.y);
MovieClip(parent.parent).drop(generosity, this.x, this.y);
arrayIndex = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + 1);
charLocation = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
monsterLocation = new Point(this.x, this.y);
distance = Point.distance(monsterLocation, charLocation);
MovieClip(root).stats.currentDistance = (MovieClip(root).stats.currentDistance + distance);
MovieClip(root).HUD.bossHealth.visible = false;
MovieClip(parent).removeChild(this);
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
MovieClip(root).HUD.bossHealth.bar.height = ((310 * health) / MovieClip(root).stats[MonstersName].health);
};
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function breakGround():void{
if (Switch == true){
MovieClip(root).groundBreak(this.x, this.y);
Switch = false;
} else {
Switch = true;
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
POI.x = 350;
POI.y = 263;
this.visible = false;
MovieClip(root).HUD.bossHealth.visible = true;
MovieClip(root).HUD.bossHealth.bar.height = 310;
}
}
}//package game.overheadShooter.monsters
Section 85
//Zombie (game.overheadShooter.monsters.Zombie)
package game.overheadShooter.monsters {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Zombie extends MovieClip {
var deaths:Number;// = 0
public var monsterSpeed:Number;// = 2
public var dam:Number;// = 10
var currentlyPoisoned:Boolean;// = false
var flameInterval:Number;// = 0
var push:Number;// = 5
var swingCounter:Number;
var MonstersName:String;// = "zombie"
var shieldBroken:Boolean;// = false
var monsterSwingAnimation:Boolean;// = false
var flashBangInterval:Number;// = 0
var swingAxe:Boolean;// = false
var currentlyFlashBanged:Boolean;// = false
var poisonDuration:Number;// = 0
var swingFrames:Number;// = 12
var hitPlayer:Boolean;// = false
public var health:Number;// = 75
public var hitZone:MovieClip;
public var head:MovieClip;
var backupCounter:Number;// = 0
var flameDuration:Number;// = 0
var poisonInterval:Number;// = 0
var generosity:Number;// = 0.2
public var originalSpeed:Number;
var currentlyFlamed:Boolean;// = false
var flashBangDuration:Number;// = 0
public function Zombie():void{
originalSpeed = monsterSpeed;
swingCounter = swingFrames;
super();
addFrameScript(0, frame1, 1, frame2);
this.addEventListener(Event.ADDED, setup);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, monsterAction);
removeEventListener(Event.ENTER_FRAME, poisoned);
removeEventListener(Event.ENTER_FRAME, flamed);
var arrayIndex:Number = MovieClip(root).monsterArray.indexOf(this);
MovieClip(root).monsterArray.splice(arrayIndex, 1);
MovieClip(parent).removeChild(this);
}
public function damage(dam:Number, push:Number, playerDir:Number):void{
dam = Math.round((dam + (3 * Math.random())));
health = (health - dam);
this.x = (this.x - (Math.cos((((playerDir + 90) * Math.PI) / 180)) * push));
this.y = (this.y - (Math.sin((((playerDir + 90) * Math.PI) / 180)) * push));
MovieClip(root).damageText(this.x, this.y, dam);
if (health <= 0){
if (MovieClip(parent.parent).slowKillMode == true){
MovieClip(parent.parent).enterSlowMo();
};
if (MovieClip(parent.parent).screenShakeMode == true){
MovieClip(parent.parent).enterScreenShake();
};
MovieClip(parent.parent).spatter(this.x, this.y);
deaths = (deaths + 1);
rebirth();
backupCounter = 24;
MovieClip(root).stats.kills[MonstersName] = (MovieClip(root).stats.kills[MonstersName] + deaths);
if ((((MovieClip(root).stats.kills[MonstersName] > MovieClip(root).stats.totalKills[MonstersName])) && (MovieClip(root).stats.scoreMultiplier))){
MovieClip(root).stats.totalKills[MonstersName] = MovieClip(root).stats.kills[MonstersName];
};
trace(("Zombies killed: " + MovieClip(root).stats.kills[MonstersName]));
if ((((((MovieClip(root).stats.kills[MonstersName] > 1000)) && ((MovieClip(root).stats.hacks.slowKill[0] == 0)))) && (MovieClip(root).stats.scoreMultiplier))){
MovieClip(root).stats.hacks.slowKill[0] = 1;
MovieClip(root).stats.hacksUnlocked = (MovieClip(root).stats.hacksUnlocked + 1);
MovieClip(root).stats.progressPoints = (MovieClip(root).stats.progressPoints + 1);
MovieClip(root).Level.caption("Slow-Kill Hack Unlocked!\n\n(Toggle Hacks in the Options Menu)", 4);
};
} else {
MovieClip(parent.parent).squirt(this.x, this.y);
};
}
function flashBanged(evt:Event):void{
if (flashBangDuration < 1){
currentlyFlashBanged = false;
removeEventListener(Event.ENTER_FRAME, flashBanged);
monsterSpeed = originalSpeed;
} else {
if (flashBangInterval < 1){
flashBangDuration = (flashBangDuration - 1);
monsterSpeed = (monsterSpeed / 1.5);
flashBangInterval = 10;
} else {
flashBangInterval = (flashBangInterval - 1);
};
};
}
public function setPoison(poisonLength:Number):void{
poisonDuration = (poisonDuration + poisonLength);
if (currentlyPoisoned == false){
currentlyPoisoned = true;
addEventListener(Event.ENTER_FRAME, poisoned);
};
}
function flamed(evt:Event):void{
var flameDamage:Number = Math.round((10 * Math.random()));
if (flameDuration < 1){
currentlyFlamed = false;
removeEventListener(Event.ENTER_FRAME, flamed);
} else {
if (flameInterval < 1){
flameDuration = (flameDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y, "flame");
damage(flameDamage, 0, 0);
};
flameInterval = 10;
} else {
flameInterval = (flameInterval - 1);
};
};
}
public function setFlashBang(flashBangLength:Number):void{
flashBangDuration = (flashBangDuration + flashBangLength);
MovieClip(root).poisonPing(this.x, this.y, "flash");
if (currentlyFlashBanged == false){
currentlyFlashBanged = true;
addEventListener(Event.ENTER_FRAME, flashBanged);
};
}
function poisoned(evt:Event):void{
var poisonDamage:Number = Math.round((10 * Math.random()));
if (poisonDuration < 1){
currentlyPoisoned = false;
removeEventListener(Event.ENTER_FRAME, poisoned);
} else {
if (poisonInterval < 1){
poisonDuration = (poisonDuration - 1);
if (health > 0){
MovieClip(root).poisonPing(this.x, this.y);
damage(poisonDamage, 0, 0);
};
poisonInterval = 10;
} else {
poisonInterval = (poisonInterval - 1);
};
};
}
function monsterAction(evt:Event):void{
var interval:Number;
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var charLocation:Point = new Point(MovieClip(this.parent.parent).char.x, MovieClip(this.parent.parent).char.y);
var monsterLocation:Point = new Point(this.x, this.y);
var xDis:Number = (this.x - MovieClip(this.parent.parent).char.x);
var yDis:Number = (this.y - MovieClip(this.parent.parent).char.y);
var distance:Number = Point.distance(monsterLocation, charLocation);
var angle:Number = Math.atan2(yDis, xDis);
if ((((distance < 20)) && ((swingAxe == false)))){
swingAxe = true;
};
if ((((swingAxe == true)) && ((backupCounter < 1)))){
if (swingCounter > 0){
if (monsterSwingAnimation == false){
monsterSwingAnimation = true;
this.gotoAndStop("attack");
};
if ((((hitZone.hitTestObject(MovieClip(root).char.hitZone) == true)) && ((hitPlayer == false)))){
hitPlayer = true;
MovieClip(root).char.damage(dam, push, angle);
};
swingCounter = (swingCounter - 1);
} else {
monsterSwingAnimation = false;
this.gotoAndStop("walk");
swingAxe = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
if ((((swingAxe == false)) && ((backupCounter < 1)))){
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - (Math.cos(angle) * monsterSpeed));
this.y = (this.y - (Math.sin(angle) * monsterSpeed));
};
if (backupCounter > 0){
if (backupCounter == 24){
this.gotoAndStop("backup");
};
interval = (backupCounter % 5);
if (interval == 0){
MovieClip(parent.parent).spatter(this.x, this.y);
};
backupCounter = (backupCounter - 1);
if (currentlyFlashBanged == false){
this.rotation = (((angle * 180) / Math.PI) - 90);
};
this.x = (this.x - ((Math.cos(angle) * monsterSpeed) / -2));
this.y = (this.y - ((Math.sin(angle) * monsterSpeed) / -2));
if (backupCounter == 0){
monsterSwingAnimation = false;
this.gotoAndStop("walk");
swingAxe = false;
swingCounter = swingFrames;
hitPlayer = false;
};
};
}
function frame1(){
stop();
}
function frame2(){
hitZone.gotoAndPlay(2);
}
public function setFlame(flameLength:Number):void{
flameDuration = (flameDuration + flameLength);
if (currentlyFlamed == false){
currentlyFlamed = true;
addEventListener(Event.ENTER_FRAME, flamed);
};
}
function rebirth():void{
health = (MovieClip(root).stats[MonstersName].health + (deaths * 10));
monsterSpeed = (MovieClip(root).stats[MonstersName].speed + (deaths * 0.1));
originalSpeed = monsterSpeed;
if (monsterSpeed > MovieClip(root).char.speed){
head.visible = false;
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, monsterAction);
health = MovieClip(root).stats[MonstersName].health;
monsterSpeed = MovieClip(root).stats[MonstersName].speed;
originalSpeed = monsterSpeed;
generosity = MovieClip(root).stats[MonstersName].generosity;
dam = MovieClip(root).stats[MonstersName].damage;
push = MovieClip(root).stats[MonstersName].push;
}
}
}//package game.overheadShooter.monsters
Section 86
//ProjectileArrow (game.overheadShooter.projectiles.ProjectileArrow)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ProjectileArrow extends MovieClip {
var StageHeight:Number;// = 525
var speed:Number;// = 25
var StageWidth:Number;// = 700
var damage:Number;// = 20
var playerHit:Boolean;// = false
var arrowRange:Number;// = 25
var hitSomething:Boolean;// = false
var monsterIndex:Number;// = 0
var push:Number;// = 10
var totalMonsters:Number;// = 0
public function ProjectileArrow(rot:Number):void{
super();
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
monsterIndex = -1;
totalMonsters = MovieClip(root).monsterArray.length;
var removed:Boolean;
var extra:Point = new Point(this.x, this.y);
extra.x = (extra.x + ((Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed) / 3));
extra.y = (extra.y + ((Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed) / 3));
var extra2:Point = new Point(this.x, this.y);
extra2.x = (extra2.x + ((Math.cos((((this.rotation - 90) * Math.PI) / 180)) * -(speed)) / 3));
extra2.y = (extra2.y + ((Math.sin((((this.rotation - 90) * Math.PI) / 180)) * -(speed)) / 3));
if (totalMonsters > 0){
do {
monsterIndex = (monsterIndex + 1);
if ((((((MovieClip(root).monsterArray[monsterIndex].hitTestPoint(this.x, this.y, true) == true)) || ((MovieClip(root).monsterArray[monsterIndex].hitTestPoint(extra.x, extra.y, true) == true)))) || ((MovieClip(root).monsterArray[monsterIndex].hitTestPoint(extra2.x, extra2.y, true) == true)))){
if ((((MovieClip(root).monsterArray[monsterIndex].health > damage)) && ((MovieClip(root).stats.gunLevels["4"] > 1)))){
MovieClip(root).monsterArray[monsterIndex].setPoison((MovieClip(root).stats.gunLevels["4"] - 1));
};
MovieClip(root).monsterArray[monsterIndex].damage(damage, push, this.rotation);
hitSomething = true;
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
removed = true;
};
} while ((((monsterIndex < (totalMonsters - 1))) && ((hitSomething == false))));
};
if (removed == false){
if ((((((((((this.x > (arrowRange + StageWidth))) || ((this.x < -(arrowRange))))) || ((this.y > (arrowRange + StageHeight))))) || ((this.y < -(arrowRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
}
}
}//package game.overheadShooter.projectiles
Section 87
//ProjectileCleaver (game.overheadShooter.projectiles.ProjectileCleaver)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileCleaver extends MovieClip {
public var spinning:MovieClip;
var speed:Number;// = 25
var StageWidth:Number;// = 525
var bandit:Object;
var push:Number;// = 10
var StageHeight:Number;// = 700
var flip:Boolean;// = false
var damage:Number;// = 20
var playerHit:Boolean;// = false
var arrowRange:Number;// = 25
var originalSpeed:Number;
public function ProjectileCleaver(rot:Number, bandit:Object, damage:Number, flip:Boolean=false):void{
originalSpeed = -(speed);
super();
addFrameScript(0, frame1);
this.damage = damage;
this.bandit = bandit;
if (flip == true){
this.flip = flip;
this.gotoAndStop(2);
};
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function remove():void{
bandit.collectKnife();
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
playerHit = true;
}
function frame1(){
stop();
}
public function explode():void{
MovieClip(root).smallExplosion(this.x, this.y);
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (flip == true){
this.spinning.rotation = (this.spinning.rotation - 30);
} else {
this.spinning.rotation = (this.spinning.rotation + 30);
};
if ((((MovieClip(root).char.hitZone.hitTestPoint(this.x, this.y, true) == true)) && ((playerHit == false)))){
inflictDamage();
};
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
speed = (speed - 1);
if (speed <= originalSpeed){
remove();
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
}
}
}//package game.overheadShooter.projectiles
Section 88
//ProjectileCyborgBomb (game.overheadShooter.projectiles.ProjectileCyborgBomb)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ProjectileCyborgBomb extends MovieClip {
var speed:Number;// = 14
private var mute:Boolean;
var push:Number;// = 10
public var damage:Number;// = 20
public function ProjectileCyborgBomb(rot:Number, mute:Boolean):void{
super();
this.mute = mute;
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function payload():void{
MovieClip(root).mediumExplosion(this.x, this.y, 2, mute);
var extra:Point = new Point(this.x, this.y);
extra.x = (extra.x + 10);
var extra2:Point = new Point(this.x, this.y);
extra2.y = (extra2.y + 10);
var extra3:Point = new Point(this.x, this.y);
extra3.x = (extra3.x - 10);
var extra4:Point = new Point(this.x, this.y);
extra4.y = (extra4.y - 10);
if ((((((((MovieClip(root).char.hitZone.hitTestPoint(extra.x, extra.y, true) == true)) || ((MovieClip(root).char.hitZone.hitTestPoint(extra2.x, extra2.y, true) == true)))) || ((MovieClip(root).char.hitZone.hitTestPoint(extra3.x, extra3.y, true) == true)))) || ((MovieClip(root).char.hitZone.hitTestPoint(extra4.x, extra4.y, true) == true)))){
MovieClip(root).char.damage(damage, push, this.rotation);
};
MovieClip(parent).removeChild(this);
}
function fly(evt:Event):void{
if (speed > 0){
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
speed = (speed - 1);
} else {
removeEventListener(Event.ENTER_FRAME, fly);
payload();
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
speed = (speed + (Math.random() * 5));
}
}
}//package game.overheadShooter.projectiles
Section 89
//ProjectileDemonGodFireball (game.overheadShooter.projectiles.ProjectileDemonGodFireball)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileDemonGodFireball extends MovieClip {
var spearRange:Number;// = 200
var StageHeight:Number;// = 525
var speed:Number;// = 15
var StageWidth:Number;// = 700
public var damage:Number;// = 10
var playerHit:Boolean;// = false
var push:Number;// = 10
public function ProjectileDemonGodFireball(rot:Number):void{
super();
this.rotation = rot;
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (MovieClip(root).char.hitZone.hitTestPoint(this.x, this.y, true) == true){
inflictDamage();
};
if ((((((((((this.x > (spearRange + StageHeight))) || ((this.x < -(spearRange))))) || ((this.y > (spearRange + StageHeight))))) || ((this.y < -(spearRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
playerHit = true;
}
}
}//package game.overheadShooter.projectiles
Section 90
//ProjectileDemonGodFlame (game.overheadShooter.projectiles.ProjectileDemonGodFlame)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileDemonGodFlame extends MovieClip {
public var hit3:MovieClip;
var frames:Number;// = 25
var dam:Number;
var playerHit:Boolean;// = false
var angle:Number;
var push:Number;
public var hit1:MovieClip;
public var hit2:MovieClip;
public function ProjectileDemonGodFlame(rot:Number, dam:Number, push:Number):void{
super();
this.dam = dam;
this.push = push;
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function burn(evt:Event):void{
var xDis:Number;
var yDis:Number;
var angle:Number;
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
frames--;
if ((((((frames < 20)) && ((frames > 5)))) && ((playerHit == false)))){
if (((((hit1.hitTestObject(MovieClip(root).char)) || (hit2.hitTestObject(MovieClip(root).char)))) || (hit1.hitTestObject(MovieClip(root).char)))){
xDis = (this.x - MovieClip(root).char.x);
yDis = (this.y - MovieClip(root).char.y);
angle = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(dam, push, angle);
playerHit = true;
};
};
if (frames < 1){
removeEventListener(Event.ENTER_FRAME, burn);
MovieClip(parent).removeChild(this);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, burn);
}
}
}//package game.overheadShooter.projectiles
Section 91
//ProjectileFireBall (game.overheadShooter.projectiles.ProjectileFireBall)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileFireBall extends MovieClip {
var speed:Number;// = 8
var StageWidth:Number;// = 525
var rocketRange:Number;// = 35
var duration:Number;// = 8
var monsterIndex:Number;// = 0
var push:Number;// = 1
var StageHeight:Number;// = 700
var hitSomething:Boolean;// = false
var afterburn:Number;// = 2
var damage:Number;// = 0
var playerHit:Boolean;// = false
var totalMonsters:Number;// = 0
public function ProjectileFireBall(rot:Number):void{
super();
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function fly(evt:Event):void{
if (duration == 8){
stop();
};
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
if (speed > 0){
speed = (speed - 1);
};
monsterIndex = -1;
totalMonsters = MovieClip(root).monsterArray.length;
hitSomething = false;
if (totalMonsters > 0){
do {
monsterIndex = (monsterIndex + 1);
if (MovieClip(root).monsterArray[monsterIndex].hitTestObject(this) == true){
if (MovieClip(root).monsterArray[monsterIndex].health > damage){
MovieClip(root).monsterArray[monsterIndex].setFlame(afterburn);
MovieClip(root).monsterArray[monsterIndex].damage(damage, push, this.rotation);
} else {
MovieClip(root).monsterArray[monsterIndex].damage(damage, push, this.rotation);
};
hitSomething = true;
};
} while ((((monsterIndex < (totalMonsters - 1))) && ((hitSomething == false))));
};
duration = (duration - 1);
if (duration < 1){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
duration = (duration + ((MovieClip(root).stats.gunLevels["5"] - 1) * 4));
speed = (speed + ((MovieClip(root).stats.gunLevels["5"] - 1) * 2));
}
}
}//package game.overheadShooter.projectiles
Section 92
//ProjectileFlashBang (game.overheadShooter.projectiles.ProjectileFlashBang)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileFlashBang extends MovieClip {
var totalMonsters:Number;// = 0
var speed:Number;// = 16
public var flashBang:MovieClip;
var StageWidth:Number;// = 525
var monsterIndex:Number;// = -1
var push:Number;// = 10
var StageHeight:Number;// = 700
var hitSomething:Boolean;// = false
var damage:Number;// = 20
var playerHit:Boolean;// = false
var laserRange:Number;// = 25
public function ProjectileFlashBang(rot:Number):void{
super();
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function payload():void{
MovieClip(root).smallExplosion(this.x, this.y);
MovieClip(root).flashBangFlash();
totalMonsters = MovieClip(root).monsterArray.length;
if (totalMonsters > 0){
do {
monsterIndex = (monsterIndex + 1);
MovieClip(root).monsterArray[monsterIndex].setFlashBang((5 + (3 * MovieClip(root).stats.gunLevels["8"])));
} while (monsterIndex < (totalMonsters - 1));
};
MovieClip(parent).removeChild(this);
}
function fly(evt:Event):void{
if (speed > 0){
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
flashBang.rotation = (flashBang.rotation - (speed * 2));
speed = (speed - 1);
} else {
removeEventListener(Event.ENTER_FRAME, fly);
payload();
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
}
}
}//package game.overheadShooter.projectiles
Section 93
//ProjectileIcicle (game.overheadShooter.projectiles.ProjectileIcicle)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileIcicle extends MovieClip {
var spearRange:Number;// = 200
var StageHeight:Number;// = 525
var speed:Number;// = 10
var StageWidth:Number;// = 700
public var damage:Number;// = 10
var playerHit:Boolean;// = false
public var push:Number;// = 10
public function ProjectileIcicle(rot:Number):void{
super();
this.rotation = rot;
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (MovieClip(root).char.hitZone.hitTestPoint(this.x, this.y, true) == true){
inflictDamage();
};
if ((((((((((this.x > (spearRange + StageHeight))) || ((this.x < -(spearRange))))) || ((this.y > (spearRange + StageHeight))))) || ((this.y < -(spearRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
playerHit = true;
}
}
}//package game.overheadShooter.projectiles
Section 94
//ProjectileLaser (game.overheadShooter.projectiles.ProjectileLaser)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ProjectileLaser extends MovieClip {
var StageHeight:Number;// = 700
public var speed:Number;// = 25
var StageWidth:Number;// = 525
public var damage:Number;// = 15
var laserRange:Number;// = 25
public var level:Number;// = 1
var hitSomething:Boolean;// = false
var monsterIndex:Number;// = 0
var playerHit:Boolean;// = false
var push:Number;// = 10
var totalMonsters:Number;// = 0
public function ProjectileLaser(rot:Number):void{
super();
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
monsterIndex = -1;
totalMonsters = MovieClip(root).monsterArray.length;
var removed:Boolean;
var extra:Point = new Point(this.x, this.y);
extra.x = (extra.x + ((Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed) / 3));
extra.y = (extra.y + ((Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed) / 3));
var extra2:Point = new Point(this.x, this.y);
extra2.x = (extra2.x + ((Math.cos((((this.rotation - 90) * Math.PI) / 180)) * -(speed)) / 3));
extra2.y = (extra2.y + ((Math.sin((((this.rotation - 90) * Math.PI) / 180)) * -(speed)) / 3));
if (totalMonsters > 0){
do {
monsterIndex = (monsterIndex + 1);
if ((((((MovieClip(root).monsterArray[monsterIndex].hitTestPoint(this.x, this.y, true) == true)) || ((MovieClip(root).monsterArray[monsterIndex].hitTestPoint(extra.x, extra.y, true) == true)))) || ((MovieClip(root).monsterArray[monsterIndex].hitTestPoint(extra2.x, extra2.y, true) == true)))){
MovieClip(root).monsterArray[monsterIndex].damage(damage, push, this.rotation);
while (level > 1) {
MovieClip(root).shootLaser(this.x, this.y, (360 * Math.random()));
level--;
};
hitSomething = true;
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
removed = true;
};
} while ((((monsterIndex < (totalMonsters - 1))) && ((hitSomething == false))));
};
if (removed == false){
if ((((((((((this.x > (laserRange + StageHeight))) || ((this.x < -(laserRange))))) || ((this.y > (laserRange + StageHeight))))) || ((this.y < -(laserRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
}
}
}//package game.overheadShooter.projectiles
Section 95
//ProjectileMageFireball (game.overheadShooter.projectiles.ProjectileMageFireball)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ProjectileMageFireball extends MovieClip {
var spearRange:Number;// = 200
var StageHeight:Number;// = 525
var speed:Number;// = 15
var StageWidth:Number;// = 700
public var damage:Number;// = 10
var playerHit:Boolean;// = false
var push:Number;// = 10
public function ProjectileMageFireball(rot:Number):void{
super();
this.rotation = rot;
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
var extra:Point = new Point(this.x, this.y);
extra.x = (extra.x + (Math.cos((((this.rotation - 180) * Math.PI) / 180)) * 15));
extra.y = (extra.y + (Math.sin((((this.rotation - 180) * Math.PI) / 180)) * 15));
var extra2:Point = new Point(this.x, this.y);
extra2.x = (extra2.x + (Math.cos(((this.rotation * Math.PI) / 180)) * 15));
extra2.y = (extra2.y + (Math.sin(((this.rotation * Math.PI) / 180)) * 15));
if ((((((MovieClip(root).char.hitZone.hitTestPoint(this.x, this.y, true) == true)) || ((MovieClip(root).char.hitZone.hitTestPoint(extra.x, extra.y, true) == true)))) || ((MovieClip(root).char.hitZone.hitTestPoint(extra2.x, extra2.y, true) == true)))){
inflictDamage();
};
if ((((((((((this.x > (spearRange + StageHeight))) || ((this.x < -(spearRange))))) || ((this.y > (spearRange + StageHeight))))) || ((this.y < -(spearRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
playerHit = true;
}
}
}//package game.overheadShooter.projectiles
Section 96
//ProjectileMine (game.overheadShooter.projectiles.ProjectileMine)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileMine extends MovieClip {
var StageHeight:Number;// = 700
var speed:Number;// = 16
var StageWidth:Number;// = 525
var extraRoom:Number;// = 20
var damage:Number;// = 50
var playerHit:Boolean;// = false
var monsterIndex:Number;// = 0
var push:Number;// = 10
var totalMonsters:Number;// = 0
var hitSomething:Boolean;// = false
public function ProjectileMine(rot:Number):void{
super();
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function fly(evt:Event):void{
var removed:Boolean;
if (MovieClip(root).stats.success == true){
MovieClip(root).smallExplosion(this.x, this.y);
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (speed > 0){
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
speed = (speed - 1);
};
monsterIndex = -1;
totalMonsters = MovieClip(root).monsterArray.length;
removed = false;
if (totalMonsters > 0){
do {
monsterIndex = (monsterIndex + 1);
if (MovieClip(root).monsterArray[monsterIndex].hitTestPoint(this.x, this.y, true) == true){
if ((((MovieClip(root).monsterArray[monsterIndex].health > damage)) && ((MovieClip(root).stats.gunLevels["0"] > 1)))){
MovieClip(root).monsterArray[monsterIndex].setFlame((MovieClip(root).stats.gunLevels["0"] - 1));
};
MovieClip(root).monsterArray[monsterIndex].damage(damage, push, this.rotation);
hitSomething = true;
MovieClip(root).smallExplosion(this.x, this.y);
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
removed = true;
};
} while ((((monsterIndex < (totalMonsters - 1))) && ((hitSomething == false))));
};
if (removed == false){
if ((((((((((this.x > (extraRoom + StageHeight))) || ((this.x < -(extraRoom))))) || ((this.y > (extraRoom + StageHeight))))) || ((this.y < -(extraRoom))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
};
};
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
}
}
}//package game.overheadShooter.projectiles
Section 97
//ProjectilePoisonGrenade (game.overheadShooter.projectiles.ProjectilePoisonGrenade)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectilePoisonGrenade extends MovieClip {
var speed:Number;// = 16
public var poisonImage:MovieClip;
public function ProjectilePoisonGrenade(rot:Number):void{
super();
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
poisonImage.rotation = (poisonImage.rotation - (speed * 3));
speed = (speed - 1);
if (speed < 1){
MovieClip(root).poisonSmokeStart(this.x, this.y);
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
}
}
}//package game.overheadShooter.projectiles
Section 98
//ProjectileRazorSkull (game.overheadShooter.projectiles.ProjectileRazorSkull)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileRazorSkull extends MovieClip {
var StageWidth:Number;// = 700
var spearRange:Number;// = 200
var StageHeight:Number;// = 525
var rot:Number;// = 1
var speed:Number;// = 0.5
var driftSpeed:Number;// = 0
public var graphic:MovieClip;
var playerHit:Boolean;// = false
var driftUp:Boolean;// = true
public var damage:Number;// = 10
var push:Number;// = 10
public function ProjectileRazorSkull(rota:Number, flip:Boolean):void{
super();
this.rotation = rota;
if (flip == false){
driftUp = true;
} else {
driftUp = false;
};
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
if (rot < 150){
rot = (rot + rot);
};
graphic.rotation = (graphic.rotation + rot);
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (MovieClip(root).char.hitZone.hitTestObject(this) == true){
inflictDamage();
};
if ((((((((((this.x > (spearRange + StageHeight))) || ((this.x < -(spearRange))))) || ((this.y > (spearRange + StageHeight))))) || ((this.y < -(spearRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
if (rot >= 150){
this.x = (this.x + ((Math.cos(((this.rotation * Math.PI) / 180)) * speed) + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * driftSpeed)));
this.y = (this.y + ((Math.sin(((this.rotation * Math.PI) / 180)) * speed) + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * driftSpeed)));
speed = (speed + 0.5);
if (driftUp == true){
driftSpeed = (driftSpeed + 0.5);
if (driftSpeed > 5){
driftUp = false;
};
} else {
driftSpeed = (driftSpeed - 0.5);
if (driftSpeed < -5){
driftUp = true;
};
};
};
};
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
playerHit = true;
}
}
}//package game.overheadShooter.projectiles
Section 99
//ProjectileRedLaser (game.overheadShooter.projectiles.ProjectileRedLaser)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileRedLaser extends MovieClip {
var spearRange:Number;// = 200
var StageHeight:Number;// = 525
var speed:Number;// = 25
var StageWidth:Number;// = 700
public var damage:Number;// = 10
var playerHit:Boolean;// = false
var push:Number;// = 10
public function ProjectileRedLaser(rot:Number):void{
super();
this.rotation = rot;
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (MovieClip(root).char.hitZone.hitTestPoint(this.x, this.y, true) == true){
inflictDamage();
};
if ((((((((((this.x > (spearRange + StageHeight))) || ((this.x < -(spearRange))))) || ((this.y > (spearRange + StageHeight))))) || ((this.y < -(spearRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
playerHit = true;
}
}
}//package game.overheadShooter.projectiles
Section 100
//ProjectileRocket (game.overheadShooter.projectiles.ProjectileRocket)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ProjectileRocket extends MovieClip {
var StageHeight:Number;// = 700
var speed:Number;// = 5
var StageWidth:Number;// = 525
var rocketRange:Number;// = 35
var damage:Number;// = 80
var playerHit:Boolean;// = false
var hitSomething:Boolean;// = false
var monsterIndex:Number;// = 0
var push:Number;// = 10
var totalMonsters:Number;// = 0
public function ProjectileRocket(rot:Number):void{
super();
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
speed = (speed + 1);
monsterIndex = -1;
totalMonsters = MovieClip(root).monsterArray.length;
var removed:Boolean;
var extra:Point = new Point(this.x, this.y);
extra.x = (extra.x + ((Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed) / 3));
extra.y = (extra.y + ((Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed) / 3));
var extra2:Point = new Point(this.x, this.y);
extra2.x = (extra2.x + ((Math.cos((((this.rotation - 90) * Math.PI) / 180)) * -(speed)) / 3));
extra2.y = (extra2.y + ((Math.sin((((this.rotation - 90) * Math.PI) / 180)) * -(speed)) / 3));
if (totalMonsters > 0){
do {
monsterIndex = (monsterIndex + 1);
if ((((((MovieClip(root).monsterArray[monsterIndex].hitTestPoint(this.x, this.y, true) == true)) || ((MovieClip(root).monsterArray[monsterIndex].hitTestPoint(extra.x, extra.y, true) == true)))) || ((MovieClip(root).monsterArray[monsterIndex].hitTestPoint(extra2.x, extra2.y, true) == true)))){
if ((((MovieClip(root).monsterArray[monsterIndex].health > damage)) && ((MovieClip(root).stats.gunLevels["7"] > 1)))){
MovieClip(root).monsterArray[monsterIndex].setFlame((MovieClip(root).stats.gunLevels["7"] - 1));
};
MovieClip(root).monsterArray[monsterIndex].damage(damage, push, this.rotation);
hitSomething = true;
MovieClip(root).smallExplosion(this.x, this.y);
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
removed = true;
};
} while ((((monsterIndex < (totalMonsters - 1))) && ((hitSomething == false))));
};
if (removed == false){
if ((((((((((this.x > (rocketRange + StageHeight))) || ((this.x < -(rocketRange))))) || ((this.y > (rocketRange + StageHeight))))) || ((this.y < -(rocketRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
MovieClip(root).smokeTrail(this.x, this.y);
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
}
}
}//package game.overheadShooter.projectiles
Section 101
//ProjectileScatter (game.overheadShooter.projectiles.ProjectileScatter)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileScatter extends MovieClip {
var StageHeight:Number;// = 700
var lifeSpan:Number;// = 5
var speed:Number;// = 30
var StageWidth:Number;// = 525
var damage:Number;// = 20
var laserRange:Number;// = 25
var hitSomething:Boolean;// = false
var monsterIndex:Number;// = 0
var playerHit:Boolean;// = false
var push:Number;// = 10
var totalMonsters:Number;// = 0
public function ProjectileScatter(rot:Number):void{
super();
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (lifeSpan > 0){
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
MovieClip(root).smokeTrail(this.x, this.y);
lifeSpan = (lifeSpan - 1);
} else {
MovieClip(root).scatterPayload(this.x, this.y);
MovieClip(root).smallExplosion(this.x, this.y);
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
}
}
}//package game.overheadShooter.projectiles
Section 102
//ProjectileScatterMini (game.overheadShooter.projectiles.ProjectileScatterMini)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ProjectileScatterMini extends MovieClip {
var delay:Number;
var speed:Number;// = 3
var StageWidth:Number;// = 525
var checks:Number;// = 1
var target:Point;
var push:Number;// = 10
var StageHeight:Number;// = 700
var hitSomething:Boolean;// = false
var damage:Number;// = 20
var laserRange:Number;// = 25
var blownUp:Boolean;// = false
var playerHit:Boolean;// = false
var counter:Number;// = 10
var totalMonsters:Number;// = 0
public function ProjectileScatterMini(rot:Number):void{
delay = (10 + (10 * Math.random()));
target = new Point(0, 0);
super();
this.rotation = rot;
this.addEventListener(Event.ADDED, setup);
}
function fly(evt:Event):void{
speed = (speed - 0.1);
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (delay > 0){
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
MovieClip(root).smokeTrail(this.x, this.y);
delay = (delay - 1);
} else {
findTarget();
this.removeEventListener(Event.ENTER_FRAME, fly);
};
}
function setup(evt:Event):void{
this.removeEventListener(Event.ADDED, setup);
this.addEventListener(Event.ENTER_FRAME, fly);
checks = MovieClip(root).stats.gunLevels["6"];
}
function attack(evt:Event):void{
counter--;
if ((((counter < 1)) && ((checks > 0)))){
counter = 10;
removeEventListener(Event.ENTER_FRAME, attack);
findTarget();
return;
};
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
speed = (speed + 1);
MovieClip(root).smokeTrail(this.x, this.y);
var monsterIndex:Number = -1;
totalMonsters = MovieClip(root).monsterArray.length;
var removed:Boolean;
if (totalMonsters > 0){
do {
monsterIndex = (monsterIndex + 1);
if (MovieClip(root).monsterArray[monsterIndex].hitTestPoint(this.x, this.y, true) == true){
MovieClip(root).monsterArray[monsterIndex].damage(damage, push, this.rotation);
hitSomething = true;
MovieClip(root).smallExplosion(this.x, this.y);
removeEventListener(Event.ENTER_FRAME, attack);
MovieClip(parent).removeChild(this);
removed = true;
};
} while ((((monsterIndex < (totalMonsters - 1))) && ((hitSomething == false))));
};
if (removed == false){
if ((((((((((this.x > (laserRange + StageHeight))) || ((this.x < -(laserRange))))) || ((this.y > (laserRange + StageHeight))))) || ((this.y < -(laserRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, attack);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
};
}
function findTarget():void{
checks--;
totalMonsters = MovieClip(root).monsterArray.length;
var index:Number = 0;
var currentDistance:Number = 0;
var closestDistance:Number = 99999;
var currentMonster:Point = new Point(0, 0);
var thisMissile:Point = new Point(this.x, this.y);
var xDis:Number = 0;
var yDis:Number = 0;
var angle:Number = 0;
if (totalMonsters > 0){
do {
currentMonster.x = MovieClip(root).monsterArray[index].x;
currentMonster.y = MovieClip(root).monsterArray[index].y;
currentDistance = Point.distance(thisMissile, currentMonster);
if (currentDistance < closestDistance){
closestDistance = currentDistance;
target.x = currentMonster.x;
target.y = currentMonster.y;
};
index = (index + 1);
} while (index < totalMonsters);
} else {
blownUp = true;
MovieClip(root).smallExplosion(this.x, this.y);
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
};
if (blownUp == false){
xDis = (this.x - target.x);
yDis = (this.y - target.y);
angle = Math.atan2(yDis, xDis);
this.rotation = (((angle * 180) / Math.PI) - 90);
MovieClip(root).targetBlip(target);
this.removeEventListener(Event.ENTER_FRAME, fly);
this.addEventListener(Event.ENTER_FRAME, attack);
};
}
}
}//package game.overheadShooter.projectiles
Section 103
//ProjectileSkeleArrow (game.overheadShooter.projectiles.ProjectileSkeleArrow)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileSkeleArrow extends MovieClip {
var spearRange:Number;// = 200
var StageHeight:Number;// = 525
var speed:Number;// = 25
var StageWidth:Number;// = 700
public var damage:Number;// = 10
var playerHit:Boolean;// = false
var push:Number;// = 10
public function ProjectileSkeleArrow(rot:Number):void{
super();
this.rotation = rot;
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (MovieClip(root).char.hitZone.hitTestPoint(this.x, this.y, true) == true){
inflictDamage();
};
if ((((((((((this.x > (spearRange + StageHeight))) || ((this.x < -(spearRange))))) || ((this.y > (spearRange + StageHeight))))) || ((this.y < -(spearRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
playerHit = true;
}
}
}//package game.overheadShooter.projectiles
Section 104
//ProjectileSnowSpear (game.overheadShooter.projectiles.ProjectileSnowSpear)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileSnowSpear extends MovieClip {
var spearRange:Number;// = 200
var StageHeight:Number;// = 525
var speed:Number;// = 15
var StageWidth:Number;// = 700
public var damage:Number;// = 10
var playerHit:Boolean;// = false
var push:Number;// = 10
var life:Number;// = 12
public function ProjectileSnowSpear(rot:Number):void{
super();
addFrameScript(0, frame1);
this.rotation = rot;
addEventListener(Event.ENTER_FRAME, fly);
}
public function explode():void{
MovieClip(root).smallExplosion(this.x, this.y);
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (MovieClip(root).char.hitZone.hitTestPoint(this.x, this.y, true) == true){
inflictDamage();
};
if (life > 1){
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
life = (life - 1);
} else {
if (life == 1){
life = 0;
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
gotoAndStop("stuck");
};
};
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
if ((((playerHit == false)) && ((life > 1)))){
MovieClip(root).char.damage(damage, push, angle);
life = 1;
};
playerHit = true;
}
function frame1(){
stop();
}
}
}//package game.overheadShooter.projectiles
Section 105
//ProjectileSpear (game.overheadShooter.projectiles.ProjectileSpear)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileSpear extends MovieClip {
var spearRange:Number;// = 200
var StageHeight:Number;// = 525
var speed:Number;// = 10
var StageWidth:Number;// = 700
public var damage:Number;// = 10
var playerHit:Boolean;// = false
var push:Number;// = 10
public function ProjectileSpear(rot:Number):void{
super();
this.rotation = rot;
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (MovieClip(root).char.hitZone.hitTestPoint(this.x, this.y, true) == true){
inflictDamage();
};
if ((((((((((this.x > (spearRange + StageHeight))) || ((this.x < -(spearRange))))) || ((this.y > (spearRange + StageHeight))))) || ((this.y < -(spearRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
playerHit = true;
}
}
}//package game.overheadShooter.projectiles
Section 106
//ProjectileSpiderSpit (game.overheadShooter.projectiles.ProjectileSpiderSpit)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileSpiderSpit extends MovieClip {
var spearRange:Number;// = 200
var StageHeight:Number;// = 525
var speed:Number;// = 15
var StageWidth:Number;// = 700
public var damage:Number;// = 10
var playerHit:Boolean;// = false
var push:Number;// = 10
public function ProjectileSpiderSpit(rot:Number):void{
super();
this.rotation = rot;
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (MovieClip(root).char.hitZone.hitTestPoint(this.x, this.y, true) == true){
inflictDamage();
};
if ((((((((((this.x > (spearRange + StageHeight))) || ((this.x < -(spearRange))))) || ((this.y > (spearRange + StageHeight))))) || ((this.y < -(spearRange))))) || ((playerHit == true)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
}
function inflictDamage():void{
var xDis:Number = (this.x - MovieClip(root).char.x);
var yDis:Number = (this.y - MovieClip(root).char.y);
var angle:Number = Math.atan2(yDis, xDis);
MovieClip(root).char.damage(damage, push, angle);
playerHit = true;
}
}
}//package game.overheadShooter.projectiles
Section 107
//ProjectileSpikeEmitter (game.overheadShooter.projectiles.ProjectileSpikeEmitter)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileSpikeEmitter extends MovieClip {
var Switch:Boolean;// = true
var StageHeight:Number;// = 525
var speed:Number;// = 25
var StageWidth:Number;// = 700
public function ProjectileSpikeEmitter(rot:Number):void{
super();
this.rotation = rot;
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (Switch == true){
MovieClip(root).spike(this.x, this.y, this.rotation);
Switch = false;
} else {
Switch = true;
};
if ((((((((this.x > StageWidth)) || ((this.x < 0)))) || ((this.y > StageHeight)))) || ((this.y < 0)))){
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
} else {
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
};
}
}
}//package game.overheadShooter.projectiles
Section 108
//ProjectileWyrmTail (game.overheadShooter.projectiles.ProjectileWyrmTail)
package game.overheadShooter.projectiles {
import flash.events.*;
import flash.display.*;
public class ProjectileWyrmTail extends MovieClip {
private var mute:Boolean;
var frames:Number;// = 42
public var speed:Number;// = 25
public var tail:MovieClip;
var playerHit:Boolean;// = false
var Switch:Boolean;// = true
public var dam:Number;// = 10
public var push:Number;// = 5
var life:Number;// = 10
public function ProjectileWyrmTail(rot:Number, lifeSpan:Number, mute:Boolean=false):void{
super();
addFrameScript(0, frame1);
this.mute = mute;
this.rotation = rot;
life = lifeSpan;
addEventListener(Event.ENTER_FRAME, fly);
}
function fly(evt:Event):void{
this.y = (this.y + MovieClip(root).scrollSpeedY);
this.x = (this.x + MovieClip(root).scrollSpeedX);
if (life > 0){
breakGround();
life = (life - 1);
this.x = (this.x + (Math.cos((((this.rotation - 90) * Math.PI) / 180)) * speed));
this.y = (this.y + (Math.sin((((this.rotation - 90) * Math.PI) / 180)) * speed));
} else {
if (frames > 0){
frames = (frames - 1);
if (frames == 41){
play();
};
if ((((tail.hitTestPoint(MovieClip(root).char.x, MovieClip(root).char.y, true) == true)) && ((playerHit == false)))){
playerHit = true;
MovieClip(root).char.damage(dam, push, this.rotation);
};
} else {
removeEventListener(Event.ENTER_FRAME, fly);
MovieClip(parent).removeChild(this);
};
};
}
function breakGround():void{
if (Switch == true){
MovieClip(root).groundBreak(this.x, this.y, mute);
Switch = false;
} else {
Switch = true;
};
}
function frame1(){
stop();
}
}
}//package game.overheadShooter.projectiles
Section 109
//OverheadShooter (game.overheadShooter.OverheadShooter)
package game.overheadShooter {
import gs.*;
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.utils.*;
import flash.geom.*;
import game.overheadShooter.configAndMenus.*;
import flash.net.*;
import flash.media.*;
import game.overheadShooter.projectiles.*;
import game.overheadShooter.misc.*;
import game.overheadShooter.effects.*;
import game.overheadShooter.monsters.*;
import flash.system.*;
import flash.ui.*;
public dynamic class OverheadShooter extends MovieClip {
var flameFrame:Number;// = 0
var shakeTime:Number;// = 0
var ingameOptions:IngameOptions;
public var scrollSpeedX:Number;// = 0
public var scrollSpeedY:Number;// = -0.5
private var musicChannel:SoundChannel;
public var pickupArray:Array;
public var slowKillMode:Boolean;// = false
public var tail:ProjectileWyrmTail;
public var char:Player;
public var mochiID:String;// = "1be44dbfd9104551"
public var MENU:MainMenu;
public var Level:LEVEL;
public var cursor:Cursor;
var slowTime:Number;// = 0
public var preloader:PreloaderPls;
public var delay:Number;// = 0
public var StageWidth:Number;// = 700
public var currentLevel:String;// = ""
public var menuCursor:MenuCursor;
public var stats:Stats;
public var StageHeight:Number;// = 525
public var monsterArray:Array;
public var blackTransition:BlackTransition;
var stageRef;
public var screenShakeMode:Boolean;// = true
public var HUD:HeadsUpDisplay;
public var heliDropHere:MovieClip;
private var SFXChannel:SoundChannel;
var adviceCounter:Number;// = -1
public var letterbox:MovieClip;
public var loopTerrain:LoopingMenuTerrain;
public var introScreen:IntroScreen;
var shakeToggle:Boolean;// = false
public function OverheadShooter():void{
stats = new Stats();
Level = new LEVEL();
loopTerrain = new LoopingMenuTerrain();
MENU = new MainMenu();
menuCursor = new MenuCursor();
ingameOptions = new IngameOptions();
stageRef = Level;
monsterArray = new Array();
pickupArray = new Array();
char = new Player();
cursor = new Cursor();
introScreen = new IntroScreen();
blackTransition = new BlackTransition();
HUD = new HeadsUpDisplay();
musicChannel = new SoundChannel();
SFXChannel = new SoundChannel();
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
MochiServices.connect(mochiID, root, connectError);
MochiAd.showPreGameAd({clip:root, id:"1be44dbfd9104551", res:"700x525", background:0xFFFFFF, color:16721446, outline:16721446, no_bg:true});
fscommand("trapallkeys", "true");
var my_menu:ContextMenu = new ContextMenu();
my_menu.hideBuiltInItems();
my_menu.builtInItems.quality = true;
var website:* = new ContextMenuItem("Flawsome Interactive");
var email:* = new ContextMenuItem("chris@flawsome.com");
var copyright:* = new ContextMenuItem("Copyright: 2008 - 2009", false, false);
website.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, launchSite);
email.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, launchEmail);
my_menu.customItems.push(website, email, copyright);
contextMenu = my_menu;
}
public function skullRazor(rot:Number, X:Number, Y:Number, flip:Boolean):void{
var skull:ProjectileRazorSkull = new ProjectileRazorSkull(rot, flip);
skull.x = X;
skull.y = Y;
skull.damage = stats.bossSkeleMage.damage;
Level.addChild(skull);
}
public function shootLaser(X:Number, Y:Number, rot:Number, level:Number=1):void{
var laser:ProjectileLaser = new ProjectileLaser(rot);
laser.x = (X + (Math.cos((((rot - 82) * Math.PI) / 180)) * 71));
laser.y = (Y + (Math.sin((((rot - 82) * Math.PI) / 180)) * 71));
if (stats.hacks.ultimaLaser[0] == 2){
TweenLite.to(laser, 0, {tint:0xFF00});
level = 10;
laser.speed = 10;
laser.damage = 30;
};
laser.level = level;
Level.addChild(laser);
}
public function enterScreenShake(shakeTime:Number=6):void{
if (this.shakeTime < shakeTime){
this.shakeTime = shakeTime;
};
addEventListener(Event.ENTER_FRAME, screenShake);
}
public function dropGoodies(X:Number, Y:Number, giftType:String=""):void{
var luck:Number;
var gift:Pickup;
var howManyPickups:Number;
var luckIncrement:Number;
if (giftType != "nothing"){
SFX("sfxPickupDrop");
luck = Math.random();
gift = new Pickup();
pickupArray.push(gift);
howManyPickups = 12;
gift.x = X;
gift.y = Y;
luckIncrement = (1 / howManyPickups);
if (giftType != ""){
gift.Is(giftType);
} else {
if (luck < (luckIncrement * 1)){
gift.Is("auto");
} else {
if (luck < (luckIncrement * 2)){
gift.Is("shotgun");
} else {
if (luck < (luckIncrement * 3)){
gift.Is("laser");
} else {
if (luck < (luckIncrement * 4)){
gift.Is("rocket");
} else {
if (luck < (luckIncrement * 5)){
gift.Is("scatter");
} else {
if (luck < (luckIncrement * 6)){
gift.Is("bow");
} else {
if (luck < (luckIncrement * 7)){
gift.Is("flame");
} else {
if (luck < (luckIncrement * 8)){
gift.Is("healthSmall");
} else {
if (luck < (luckIncrement * 9)){
gift.Is("healthLarge");
} else {
if (luck < (luckIncrement * 10)){
gift.Is("poison");
} else {
if (luck < (luckIncrement * 11)){
gift.Is("flashBang");
} else {
if (luck < (luckIncrement * 12)){
gift.Is("mine");
};
};
};
};
};
};
};
};
};
};
};
};
};
Level.addChild(gift);
};
}
public function spike(X:Number, Y:Number, rot:Number=0):void{
var pointy:Spike = new Spike();
enterScreenShake(2);
pointy.x = X;
pointy.y = Y;
pointy.damage = stats.spikeDemon.damage;
pointy.rotation = (rot - 45);
Level.addChildAt(pointy, 1);
splinter(X, Y, 0, "dark", 0);
}
public function drop(generosity:Number, X:Number, Y:Number):void{
var luck:Number = Math.random();
if (generosity > luck){
dropGoodies(X, Y);
};
}
function screenShake(evt:Event):void{
if (shakeTime > 0){
Level.x = 0;
Level.y = 0;
if (shakeToggle == true){
Level.x = (Level.x + (Math.random() * shakeTime));
Level.y = (Level.y + (Math.random() * shakeTime));
shakeToggle = false;
} else {
Level.x = (Level.x - (Math.random() * shakeTime));
Level.y = (Level.y - (Math.random() * shakeTime));
shakeToggle = true;
};
shakeTime = (shakeTime - 1);
} else {
removeEventListener(Event.ENTER_FRAME, screenShake);
Level.x = 0;
Level.y = 0;
};
}
public function shootMine(X:Number, Y:Number, rot:Number):void{
var mine:ProjectileMine = new ProjectileMine(rot);
mine.x = (X + (Math.cos((((rot - 122) * Math.PI) / 180)) * 40));
mine.y = (Y + (Math.sin((((rot - 122) * Math.PI) / 180)) * 40));
Level.addChildAt(mine, 1);
}
public function optionsMenu(setup:Boolean=true, killPlayer:Boolean=false):void{
if (setup == true){
gameMouseSetup(false);
Mouse.show();
char.castrate();
HUD.visible = false;
addChild(ingameOptions);
ingameOptions.setup(true);
stage.frameRate = 0;
} else {
gameMouseSetup();
ingameOptions.setup(false);
removeChild(ingameOptions);
stage.frameRate = 31;
if (killPlayer){
char.damage(9999, 0, 0);
} else {
char.endow();
};
HUD.visible = true;
stage.focus = Level;
};
}
public function mediumExplosion(X:Number, Y:Number, scale:Number=2, mute:Boolean=false):void{
enterScreenShake(3);
if (!mute){
SFX("sfxExplosion");
};
var boom:SmallExplosion = new SmallExplosion();
var randomPls:Number = Math.random();
if (randomPls < 0.33){
boom.gotoAndStop(1);
} else {
if (randomPls < 0.66){
boom.gotoAndStop(2);
} else {
boom.gotoAndStop(3);
};
};
boom.x = X;
boom.y = Y;
boom.scaleX = scale;
boom.scaleY = scale;
Level.addChild(boom);
}
public function targetBlip(here:Point){
var target:TargetBlip = new TargetBlip();
target.x = here.x;
target.y = here.y;
Level.addChild(target);
}
public function bossDeath(X:Number, Y:Number, type:String="red", scale:Number=1):void{
SFX("sfxBossBlood");
var bossBlood:BossExplosion = new BossExplosion(type, scale);
bossBlood.x = X;
bossBlood.y = Y;
Level.addChild(bossBlood);
}
public function shootBow(X:Number, Y:Number, rot:Number):void{
var arrows:ProjectileArrow = new ProjectileArrow(rot);
arrows.x = (X + (Math.cos((((rot - 70) * Math.PI) / 180)) * 40));
arrows.y = (Y + (Math.sin((((rot - 70) * Math.PI) / 180)) * 40));
Level.addChild(arrows);
}
public function iceShot(X:Number, Y:Number, rot:Number):void{
var shot:ProjectileIcicle = new ProjectileIcicle(rot);
shot.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 70));
shot.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 70));
shot.damage = stats.iceFatty.damage;
shot.push = stats.iceFatty.push;
Level.addChild(shot);
}
public function cursorSwitch(frameTitle:String):void{
SFX("sfxSwitch");
cursor.gotoAndStop(frameTitle);
}
public function squirt(X:Number, Y:Number, type:String="red", scale:Number=1):void{
var bloodSquirt:BloodSquirt = new BloodSquirt();
var randomPls:Number = Math.random();
var randomScale:Number = (scale + (Math.random() * scale));
if (randomPls < 0.2){
bloodSquirt.gotoAndStop((type + "1"));
} else {
if (randomPls < 0.4){
bloodSquirt.gotoAndStop((type + "2"));
} else {
if (randomPls < 0.6){
bloodSquirt.gotoAndStop((type + "3"));
} else {
if (randomPls < 0.8){
bloodSquirt.gotoAndStop((type + "4"));
} else {
bloodSquirt.gotoAndStop((type + "5"));
};
};
};
};
bloodSquirt.x = X;
bloodSquirt.y = Y;
bloodSquirt.scaleX = randomScale;
bloodSquirt.scaleY = randomScale;
Level.addChild(bloodSquirt);
}
public function cyBomb(X:Number, Y:Number, rot:Number, mute:Boolean=false):void{
var nade:ProjectileCyborgBomb = new ProjectileCyborgBomb(rot, mute);
nade.x = (X + (Math.cos((((rot - 65) * Math.PI) / 180)) * 40));
nade.y = (Y + (Math.sin((((rot - 65) * Math.PI) / 180)) * 40));
nade.damage = stats.cyborgMarine.damage;
Level.addChild(nade);
}
public function shootPoison(X:Number, Y:Number, rot:Number):void{
var nade:ProjectilePoisonGrenade = new ProjectilePoisonGrenade(rot);
nade.x = (X + (Math.cos((((rot - 122) * Math.PI) / 180)) * 40));
nade.y = (Y + (Math.sin((((rot - 122) * Math.PI) / 180)) * 40));
Level.addChild(nade);
}
public function poisonSmoke(X:Number, Y:Number):void{
var cloud:PoisonSmoke = new PoisonSmoke();
var randomPls:Number = Math.random();
if (randomPls < 0.2){
cloud.gotoAndStop(1);
} else {
if (randomPls < 0.4){
cloud.gotoAndStop(2);
} else {
if (randomPls < 0.6){
cloud.gotoAndStop(3);
} else {
if (randomPls < 0.8){
cloud.gotoAndStop(4);
} else {
cloud.gotoAndStop(5);
};
};
};
};
cloud.x = X;
cloud.y = Y;
Level.addChild(cloud);
}
public function spawnPlayer(X:Number, Y:Number):void{
addEventListener(Event.ENTER_FRAME, levelScroll);
if (normalLevel()){
char.visible = true;
char.x = X;
char.y = Y;
Level.addChild(char);
trace((currentLevel + "<--"));
char.playerHealth = 100;
char.dead = false;
HUD.healthDisplay.height = 0;
char.setup();
char.checkControls();
} else {
char.visible = false;
};
}
public function castSpikes(X:Number, Y:Number, rot:Number):void{
SFX("sfxMagicCast");
enterScreenShake();
var spike1:ProjectileSpikeEmitter = new ProjectileSpikeEmitter(rot);
var spike2:ProjectileSpikeEmitter = new ProjectileSpikeEmitter((rot + 30));
var spike3:ProjectileSpikeEmitter = new ProjectileSpikeEmitter((rot - 30));
spike1.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 90));
spike1.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 90));
spike2.x = (X + (Math.cos((((rot - 45) * Math.PI) / 180)) * 90));
spike2.y = (Y + (Math.sin((((rot - 45) * Math.PI) / 180)) * 90));
spike3.x = (X + (Math.cos((((rot - 135) * Math.PI) / 180)) * 90));
spike3.y = (Y + (Math.sin((((rot - 135) * Math.PI) / 180)) * 90));
Level.addChild(spike1);
Level.addChild(spike2);
Level.addChild(spike3);
}
public function damageText(X:Number, Y:Number, dam:Number):void{
var txt:DamageText = new DamageText(dam);
txt.x = X;
txt.y = Y;
Level.addChild(txt);
}
public function shipFlame(X:Number, Y:Number, rot:Number, dam:Number, push:Number):void{
SFX("sfxFlame");
var demonFlame:ProjectileDemonGodFlame = new ProjectileDemonGodFlame(rot, dam, push);
demonFlame.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 85));
demonFlame.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 85));
Level.addChild(demonFlame);
}
function updateStageOverDisplay():void{
var progressBarMaxWidth:Number = 437;
delay = (delay + 1);
MENU.stageOver.txtLeft.text = ((((((((((((((((((((((("\n" + stats.levelInfo[(currentLevel + "Title")]) + " - Complete\n\nMonsters Killed: ") + stats.kills.current) + "\nScore Earned: ") + stats.currentScore) + " Points\nCredits Earned: $") + stats.bountyEarned) + "\n\nAVG. Distance From Kill: ") + Math.floor((stats.totalDistance / stats.totalKills.total))) + " ft.\nTotal Monsters Killed: ") + stats.totalKills.total) + "\nTotal Score: ") + stats.highscore) + " Points\nTotal Credits: $") + stats.credits) + "\n\nYou've Unlocked:\n") + stats.stagesUnlocked) + "/13 Stages\n") + stats.secretMissionsUnlocked) + "/4 Secret Missions\n") + stats.hacksUnlocked) + "/10 Hacks\n\nJust Unlocked:\n") + stats.newlyUnlocked);
MENU.stageOver.txtProgress.text = (Math.floor(((stats.progressPoints / stats.progressMax) * 100)) + "% Complete");
MENU.stageOver.progressBar.width = ((stats.progressPoints / stats.progressMax) * progressBarMaxWidth);
if (!stats.success){
MENU.stageOver.txtLeft.text = (((("\n" + stats.levelInfo[(currentLevel + "Title")]) + " - Failed\n\nYou have died ") + stats.deaths) + " times.");
};
if (currentLevel == "miniGame1"){
MENU.stageOver.txtLeft.text = ((((("\n" + stats.levelInfo[(currentLevel + "Title")]) + "\n\nYou nearly killed ") + stats.kills.zombie) + " zombies\nHighscore: ") + stats.totalKills.zombie);
};
if (currentLevel == "miniGame2"){
MENU.stageOver.txtLeft.text = ((((("\n" + stats.levelInfo[(currentLevel + "Title")]) + "\n\nYou assassinated ") + stats.kills.assassinationLevel) + " enemy bosses\nHighscore: ") + stats.totalKills.assassinationLevel);
};
if (currentLevel == "miniGame3"){
MENU.stageOver.txtLeft.text = ((((("\n" + stats.levelInfo[(currentLevel + "Title")]) + "\n\nYou silenced ") + stats.kills.civiliansBrutalized) + " civilians\nHighscore: ") + stats.totalKills.civiliansBrutalized);
};
}
public function babySpider(X:Number, Y:Number):void{
var baby:BabySpider = new BabySpider();
monsterArray.push(baby);
baby.x = X;
baby.y = Y;
Level.addChildAt(baby, 1);
}
public function connectError(status:String):void{
trace("Error connecting to mochi");
trace("backup preloader being used");
preloader.init();
}
public function poisonSmokeStart(X:Number, Y:Number):void{
var emitter:PoisonEmitter = new PoisonEmitter();
emitter.x = X;
emitter.y = Y;
Level.addChild(emitter);
}
public function skeleArrow(X:Number, Y:Number, rot:Number):void{
SFX("sfxBow");
var arrows:ProjectileSkeleArrow = new ProjectileSkeleArrow(rot);
arrows.x = (X + (Math.cos((((rot - 65) * Math.PI) / 180)) * 40));
arrows.y = (Y + (Math.sin((((rot - 65) * Math.PI) / 180)) * 40));
arrows.damage = stats.highSkeletonArcher.damage;
Level.addChild(arrows);
}
function frame3(){
setupFromIntro();
}
function frame4(){
}
public function endLevel():void{
Level.removeEventListener(Event.ENTER_FRAME, Level[currentLevel]);
Level.scrollSpeed(0, 0);
if (((((((!(stats.success)) && (!((currentLevel == "miniGame1"))))) && (!((currentLevel == "miniGame2"))))) && (!((currentLevel == "miniGame3"))))){
if ((((currentLevel == "hive")) && (stats.hiveTemp))){
stats.success = true;
} else {
stats.resetCurrentStats();
if (normalLevel()){
stats.deaths++;
};
};
};
mainMenu(true);
loopTerrain.visible = false;
MENU.visible = false;
addChild(blackTransition);
blackTransition.Start(blackTransition.revealMenu);
}
public function gameMouseSetup(setup:Boolean=true):void{
if (setup == true){
Mouse.hide();
addChild(cursor);
cursor.visible = true;
addEventListener(MouseEvent.MOUSE_MOVE, cursorFollow);
} else {
Mouse.hide();
removeChild(cursor);
removeEventListener(MouseEvent.MOUSE_MOVE, cursorFollow);
};
}
function frame1(){
stop();
}
public function SFX(type:String, killPrevious:Boolean=false):void{
if (type == "sfxSwing"){
type = (type + (Math.round((4 * Math.random())) + 1));
};
if (killPrevious){
SFXChannel.stop();
};
var soundClass:Class = (getDefinitionByName(type) as Class);
var sfx:* = new (soundClass);
SFXChannel = sfx.play();
}
function stageOverDisplay(evt:Event):void{
var monstersName:String;
var sendScore:String;
var displayThis:String = "";
if (delay > 0){
delay = (delay - 1);
} else {
displayThis = (displayThis + "\n\n\n");
monstersName = "";
if (stats.kills.demon > 0){
trace(("Kills: " + stats.kills.demon));
displayThis = (displayThis + addKill("demon", "Demons"));
} else {
if (stats.kills.babySpider > 0){
displayThis = (displayThis + addKill("babySpider", "Baby Spiders"));
} else {
if (stats.kills.skeleton > 0){
displayThis = (displayThis + addKill("skeleton", "Skeleton Rogues"));
} else {
if (stats.kills.spider > 0){
displayThis = (displayThis + addKill("spider", "Spiders"));
} else {
if (stats.kills.toxicSpider > 0){
displayThis = (displayThis + addKill("toxicSpider", "Toxic Spiders"));
} else {
if (stats.kills.highSkeletonSwordsman > 0){
displayThis = (displayThis + addKill("highSkeletonSwordsman", "High Skeleton Swordsmen"));
} else {
if (stats.kills.highSkeletonArcher > 0){
displayThis = (displayThis + addKill("highSkeletonArcher", "High Skeleton Archers"));
} else {
if (stats.kills.highSkeletonBandit > 0){
displayThis = (displayThis + addKill("highSkeletonBandit", "High Skeleton Bandits"));
} else {
if (stats.kills.highSkeletonMage > 0){
displayThis = (displayThis + addKill("highSkeletonMage", "High Skeleton Mages"));
} else {
if (stats.kills.marauderSpikedClub > 0){
displayThis = (displayThis + addKill("marauderSpikedClub", "Marauder Muscles"));
} else {
if (stats.kills.marauderRifle > 0){
displayThis = (displayThis + addKill("marauderRifle", "Marauder Riflemen"));
} else {
if (stats.kills.marauderGatling > 0){
displayThis = (displayThis + addKill("marauderGatling", "Marauder Heavy Gunners"));
} else {
if (stats.kills.hammerOgre > 0){
displayThis = (displayThis + addKill("hammerOgre", "Hammer Ogres"));
} else {
if (stats.kills.goblin > 0){
displayThis = (displayThis + addKill("goblin", " Goblin Grunts"));
} else {
if (stats.kills.goblinSpear > 0){
displayThis = (displayThis + addKill("goblinSpear", "Goblin Brutes"));
} else {
if (stats.kills.cyborgNinja > 0){
displayThis = (displayThis + addKill("cyborgNinja", "Ninja Cyborgs"));
} else {
if (stats.kills.cyborgMarine > 0){
displayThis = (displayThis + addKill("cyborgMarine", "Marine Cyborgs"));
} else {
if (stats.kills.bossSkeleMage > 0){
displayThis = (displayThis + addKill("bossSkeleMage", "Skeleton King"));
} else {
if (stats.kills.demonGod > 0){
displayThis = (displayThis + addKill("demonGod", "Demon God"));
} else {
if (stats.kills.spikeDemon > 0){
displayThis = (displayThis + addKill("spikeDemon", "Spike Demons"));
} else {
if (stats.kills.mercenarySword > 0){
displayThis = (displayThis + addKill("mercenarySword", "Mercenary Swordsmen"));
} else {
if (stats.kills.mercenaryRifle > 0){
displayThis = (displayThis + addKill("mercenaryRifle", "Mercenary Riflemen"));
} else {
if (stats.kills.mercenaryGatling > 0){
displayThis = (displayThis + addKill("mercenaryGatling", "Mercenary Gunners"));
} else {
if (stats.kills.skeleKnight > 0){
displayThis = (displayThis + addKill("skeleKnight", "Skeleton Knights"));
} else {
if (stats.kills.iceFatty > 0){
displayThis = (displayThis + addKill("iceFatty", "Ice Fatties"));
} else {
if (stats.kills.snowFiend > 0){
displayThis = (displayThis + addKill("snowFiend", "Snow Fiends"));
} else {
if (stats.kills.civilian > 0){
displayThis = (displayThis + addKill("civilian", "Civilians (tsk tsk)"));
delay = (delay + 30);
} else {
if (stats.kills.eggSac > 0){
displayThis = (displayThis + addKill("eggSac", "Egg Sacs"));
} else {
if (stats.kills.wyrmBoss > 0){
displayThis = (displayThis + addKill("wyrmBoss", "Wyrm God"));
} else {
if (stats.kills.spiderBoss > 0){
displayThis = (displayThis + addKill("spiderBoss", "Spider God"));
} else {
if (stats.kills.cyborgBoss > 0){
displayThis = (displayThis + addKill("cyborgBoss", "Cyborg Terminator"));
} else {
displayThis = (displayThis + "\n\n");
if (stats.currentBounty > 1000){
displayThis = (displayThis + ("+ $" + stats.currentBounty));
stats.currentBounty = (stats.currentBounty - 500);
stats.bountyEarned = (stats.bountyEarned + 500);
stats.creditsTemp = (stats.creditsTemp + 500);
} else {
if (stats.currentBounty > 100){
displayThis = (displayThis + ("+ $" + stats.currentBounty));
stats.currentBounty = (stats.currentBounty - 100);
stats.bountyEarned = (stats.bountyEarned + 100);
stats.creditsTemp = (stats.creditsTemp + 100);
} else {
if (stats.currentBounty > 10){
displayThis = (displayThis + ("+ $" + stats.currentBounty));
stats.currentBounty = (stats.currentBounty - 10);
stats.bountyEarned = (stats.bountyEarned + 10);
stats.creditsTemp = (stats.creditsTemp + 10);
} else {
if (stats.currentBounty > 0){
displayThis = (displayThis + ("+ $" + stats.currentBounty));
stats.currentBounty = (stats.currentBounty - 1);
stats.bountyEarned = (stats.bountyEarned + 1);
stats.creditsTemp = (stats.creditsTemp + 1);
} else {
displayThis = (displayThis + "\n\n");
if (stats.currentDistance > 0){
displayThis = (displayThis + (("+ " + Math.floor((stats.currentDistance / stats.kills.current))) + " ft. AVG."));
stats.totalDistance = (stats.totalDistance + stats.currentDistance);
stats.currentDistance = 0;
delay = (delay + 10);
} else {
displayThis = (displayThis + "\n");
if (stats.kills.temp > 10){
displayThis = (displayThis + (("+ " + stats.kills.temp) + " kills"));
stats.totalKills.total = (stats.totalKills.total + 10);
stats.kills.temp = (stats.kills.temp - 10);
delay = (delay + 1);
} else {
if (stats.kills.temp > 0){
displayThis = (displayThis + (("+ " + stats.kills.temp) + " kills"));
stats.totalKills.total = (stats.totalKills.total + 1);
stats.kills.temp = (stats.kills.temp - 1);
delay = (delay + 1);
} else {
displayThis = (displayThis + "\n");
if (stats.scoreTemp > 0){
displayThis = (displayThis + (("+ " + stats.currentScore) + " Points"));
stats.score = (stats.score + stats.currentScore);
stats.scoreTemp = 0;
delay = (delay + 10);
} else {
displayThis = (displayThis + "\n");
if (stats.creditsTemp > 0){
displayThis = (displayThis + ("+ $" + stats.bountyEarned));
stats.credits = (stats.credits + stats.bountyEarned);
stats.creditsTemp = 0;
delay = (delay + 10);
} else {
removeEventListener(Event.ENTER_FRAME, stageOverDisplay);
MENU.stageOver.btnContinue.addEventListener(MouseEvent.CLICK, exitStageOver);
stats.unlockCheck(currentLevel);
MENU.stageOver.txtCaption.text = "Click Here to Continue";
trace(("Just ended: " + currentLevel));
if (currentLevel == "miniGame1"){
sendScore = stats.kills.zombie;
} else {
if (currentLevel == "miniGame2"){
sendScore = stats.kills.assassinationLevel;
} else {
if (currentLevel == "miniGame3"){
sendScore = stats.kills.civiliansBrutalized;
} else {
if (currentLevel == "miniGame4"){
sendScore = stats.totalKills.wavesComplete;
} else {
if (currentLevel == "hive"){
sendScore = stats.hiveTemp.toString();
} else {
sendScore = stats.highscore.toString();
};
};
};
};
};
MENU.stageOver.highscores.setup(currentLevel, sendScore);
autosave();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
MENU.stageOver.txtRight.text = displayThis;
updateStageOverDisplay();
};
if (MENU.stageOver.txtCaption.text == "Click Here to Continue"){
if (((((((!(stats.success)) && (!((currentLevel == "miniGame1"))))) && (!((currentLevel == "miniGame2"))))) && (!((currentLevel == "miniGame3"))))){
MENU.stageOver.txtLeft.text = (MENU.stageOver.txtLeft.text + randomAdvice());
};
};
}
function levelScroll(evt:Event):void{
Level.terrain.x = (Level.terrain.x + scrollSpeedX);
Level.terrain.y = (Level.terrain.y + scrollSpeedY);
char.y = (char.y + scrollSpeedY);
char.x = (char.x + scrollSpeedX);
}
function exitStageOver(evt:MouseEvent):void{
MENU.stageOver.btnContinue.removeEventListener(MouseEvent.CLICK, exitStageOver);
MENU.main(true);
MENU.stageOver.txtCaption.text = "";
stats.resetCurrentStats();
MENU.stageOver.highscores.reset();
MochiScores.closeLeaderboard();
}
public function heliExit(X:Number, Y:Number):void{
var heli:Helicopter = new Helicopter();
heli.x = X;
heli.y = Y;
heli.scaleX = 0.69;
heli.scaleY = 0.69;
heli.rotation = 180;
heliDropHere.addChild(heli);
heli.ExitScreen();
trace(currentLevel);
}
public function enterSlowMo():void{
slowTime = 6;
stage.frameRate = 12;
addEventListener(Event.ENTER_FRAME, slowMo);
}
public function spikeTail(X:Number, Y:Number, rot:Number, lifeSpan:Number=10, mute:Boolean=false):void{
var tail:ProjectileWyrmTail = new ProjectileWyrmTail(rot, lifeSpan, mute);
tail.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 50));
tail.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 50));
tail.dam = stats.wyrmBoss.damage;
tail.push = stats.wyrmBoss.push;
tail.speed = stats.wyrmBoss.speed;
Level.addChild(tail);
}
public function launchIntro():void{
setMusic("stageIntro", 1);
addChild(introScreen);
introScreen.visible = false;
introScreen.gotoAndStop(currentLevel);
introScreen.terrain.x = 0;
introScreen.terrain.y = 0;
trace(currentLevel);
addChild(blackTransition);
blackTransition.Start(blackTransition.revealIntro);
}
function frame2(){
stop();
}
function slowMo(evt:Event):void{
if (slowTime > 0){
slowTime = (slowTime - 1);
} else {
removeEventListener(Event.ENTER_FRAME, slowMo);
stage.frameRate = 31;
};
}
public function splinter(X:Number, Y:Number, rot:Number, type:String="wood", offset:Number=18):void{
var shieldSplinter:ShieldSplinter = new ShieldSplinter();
var randomPls:Number = Math.random();
var randomScale:Number = (1 + Math.random());
shieldSplinter.rotation = rot;
if (randomPls < 0.25){
shieldSplinter.gotoAndStop((type + "1"));
} else {
if (randomPls < 0.5){
shieldSplinter.gotoAndStop((type + "2"));
} else {
if (randomPls < 0.75){
shieldSplinter.gotoAndStop((type + "3"));
} else {
shieldSplinter.gotoAndStop((type + "4"));
};
};
};
shieldSplinter.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * offset));
shieldSplinter.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * offset));
shieldSplinter.scaleX = randomScale;
shieldSplinter.scaleY = randomScale;
Level.addChild(shieldSplinter);
}
public function flashBangFlash(mute:Boolean=false):void{
if (!mute){
SFX("sfxFlashbang");
};
var flashBang:FlashBang = new FlashBang();
Level.addChild(flashBang);
}
public function launchLevel():void{
if (stats.hacks.slowKill[0] == 2){
slowKillMode = true;
} else {
slowKillMode = false;
};
stats.resetCurrentStats();
if (normalLevel()){
this.addChild(HUD);
HUD.visible = true;
} else {
HUD.visible = false;
cursor.visible = false;
};
HUD.bossHealth.visible = false;
Level.x = 0;
Level.y = 0;
Level.terrain.gotoAndStop(currentLevel);
Level.terrain.x = 0;
Level.terrain.y = 0;
this.addChildAt(Level, 0);
Level.startLevel();
if (normalLevel()){
gameMouseSetup();
};
}
public function throwSpear(X:Number, Y:Number, rot:Number):void{
SFX("sfxSwing5");
var spear:ProjectileSpear = new ProjectileSpear((rot - 10));
spear.x = (X + (Math.cos((((rot - 70) * Math.PI) / 180)) * 86));
spear.y = (Y + (Math.sin((((rot - 70) * Math.PI) / 180)) * 86));
spear.damage = stats.demon.damage;
Level.addChild(spear);
}
private function launchSite(evt:Event):void{
navigateToURL(new URLRequest("http://www.flawsome.com/"));
}
private function randomAdvice():String{
var advice:Array = ["For automatic fire hold down the left mouse button.", "You can buy speed, armor, and shield upgrades in the shop.", "Complete the last stage of each biosphere to unlock all 4 mini games.", "Upgrade weapons at the shop to increase your power!", "Getting cornered? Use flashbangs to slow enemies down and open an escape route.", "You can save your game at any time by hitting the LOAD/SAVE GAME option from the main menu.", "Big enemy causing trouble? Hit 'em with a poison grenade while you pick off the little guys.", "Remember to use your secondary weapons (mines, grenades, flashbangs).", "Going for a high score? Difficulty-increasing hacks can be unlocked to mulitply scores.", "Music getting old? You've probably found it by now, but there's a volume setting in the options."];
adviceCounter++;
adviceCounter = (adviceCounter % advice.length);
return (("\n\nHint: \n" + advice[adviceCounter]));
}
public function poisonPing(X:Number, Y:Number, type:String="poison"){
var ping:PoisonIcon = new PoisonIcon();
ping.x = X;
ping.y = Y;
ping.gotoAndPlay(type);
if (type == "flash"){
ping.frames = 15;
};
addChild(ping);
}
function cursorFollow(evt:MouseEvent):void{
cursor.x = this.mouseX;
cursor.y = this.mouseY;
}
public function shootFlame(X:Number, Y:Number, rot:Number):void{
var ball:ProjectileFireBall = new ProjectileFireBall(rot);
if (flameFrame > 3){
ball.gotoAndPlay(1);
flameFrame = 0;
} else {
if (flameFrame > 2){
ball.gotoAndPlay(2);
flameFrame = (flameFrame + 1);
} else {
if (flameFrame > 1){
ball.gotoAndPlay(3);
flameFrame = (flameFrame + 1);
} else {
ball.gotoAndPlay(4);
flameFrame = (flameFrame + 1);
};
};
};
ball.x = (X + (Math.cos((((rot - 79) * Math.PI) / 180)) * 50));
ball.y = (Y + (Math.sin((((rot - 79) * Math.PI) / 180)) * 50));
Level.addChild(ball);
}
private function launchEmail(evt:Event):void{
navigateToURL(new URLRequest("mailto:chris@flawsome.com?subject=Operation:Onslaught"));
}
public function fadeToLevel():void{
blackTransition.Start(blackTransition.revealLevel);
addChild(blackTransition);
}
public function addKill(monstersName:String, properlyFormattedName:String):String{
var string:String = "";
stats.addKill(monstersName);
string = (string + (((((("+ " + stats.kills[monstersName]) + " ") + properlyFormattedName) + " killed\n+ ") + stats[monstersName].worth) + " points"));
return (string);
}
public function bloodParticle(startPoint:Point, endPoint:Point):void{
var particle:BloodParticle = new BloodParticle(startPoint, endPoint);
Level.addChild(particle);
}
public function spiderSac(X:Number, Y:Number, rot:Number, offset:Number=1):void{
var sac:EggSac = new EggSac();
monsterArray.push(sac);
sac.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * -20));
sac.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * -20));
sac.gotoAndPlay(offset);
Level.addChildAt(sac, 1);
}
public function shootScatter(X:Number, Y:Number, rot:Number):void{
var scatter:ProjectileScatter = new ProjectileScatter(rot);
scatter.x = (X + (Math.cos((((rot - 82) * Math.PI) / 180)) * 71));
scatter.y = (Y + (Math.sin((((rot - 82) * Math.PI) / 180)) * 71));
Level.addChild(scatter);
}
public function mainMenu(setup:Boolean):void{
if (setup == true){
setMusic("menu");
stop();
Mouse.hide();
addChild(loopTerrain);
addChild(MENU);
addChild(menuCursor);
menuCursor.setup();
} else {
removeChild(loopTerrain);
removeChild(MENU);
menuCursor.chill();
removeChild(menuCursor);
};
}
private function autosave():void{
stats.WriteData("autosave");
trace("-- AUTOSAVING --");
}
public function heliEnter(explode:Boolean=false):void{
var heli:Helicopter = new Helicopter(explode);
heli.x = (StageWidth / 2);
heli.y = -170;
heli.rotation = 180;
Level.addChild(heli);
heli.EnterScreen();
}
public function groundBreak(X:Number, Y:Number, mute:Boolean=false):void{
enterScreenShake(3);
var Break:BreakLand = new BreakLand();
var randomPls:Number = Math.random();
var increment:Number = (1 / 8);
if (((!(mute)) && ((Math.random() > 0.6)))){
SFX("sfxExplosion");
};
if (randomPls < increment){
Break.gotoAndStop(1);
} else {
if (randomPls < (increment * 2)){
Break.gotoAndStop(2);
} else {
if (randomPls < (increment * 3)){
Break.gotoAndStop(3);
} else {
if (randomPls < (increment * 4)){
Break.gotoAndStop(4);
} else {
if (randomPls < (increment * 5)){
Break.gotoAndStop(5);
} else {
if (randomPls < (increment * 6)){
Break.gotoAndStop(6);
} else {
if (randomPls < (increment * 7)){
Break.gotoAndStop(7);
} else {
if (randomPls < (increment * 8)){
Break.gotoAndStop(8);
};
};
};
};
};
};
};
};
Break.x = X;
Break.y = Y;
Level.addChildAt(Break, 1);
}
public function redLaser(X:Number, Y:Number, rot:Number):void{
var shot:ProjectileRedLaser = new ProjectileRedLaser(rot);
shot.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 75));
shot.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 75));
shot.damage = stats.cyborgBoss.damage;
Level.addChild(shot);
}
private function loopCheck(evt:Event):void{
trace("sound finished!!");
setMusic("menu");
}
public function acidSpit(X:Number, Y:Number, rot:Number):void{
var spit:ProjectileSpiderSpit = new ProjectileSpiderSpit(rot);
spit.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 85));
spit.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 85));
spit.damage = stats.spiderBoss.damage;
Level.addChild(spit);
}
public function smallExplosion(X:Number, Y:Number, sound:Boolean=true):void{
if (sound){
SFX("sfxExplosion");
};
if (sound){
enterScreenShake(3);
};
var boom:SmallExplosion = new SmallExplosion();
var randomPls:Number = Math.random();
if (randomPls < 0.33){
boom.gotoAndStop(1);
} else {
if (randomPls < 0.66){
boom.gotoAndStop(2);
} else {
boom.gotoAndStop(3);
};
};
boom.x = X;
boom.y = Y;
Level.addChild(boom);
}
public function spatter(X:Number, Y:Number, type:String="red", scale:Number=1, sound:Boolean=true):void{
if (sound){
SFX("sfxBlood");
};
var bloodSpatter:Blood = new Blood();
bloodSpatter.x = X;
bloodSpatter.y = Y;
bloodSpatter.scaleX = scale;
bloodSpatter.scaleY = scale;
bloodSpatter.gotoAndPlay(type);
Level.addChild(bloodSpatter);
}
public function shootRocket(X:Number, Y:Number, rot:Number):void{
var rocket:ProjectileRocket = new ProjectileRocket(rot);
rocket.x = (X + (Math.cos((((rot - 82) * Math.PI) / 180)) * 71));
rocket.y = (Y + (Math.sin((((rot - 82) * Math.PI) / 180)) * 71));
Level.addChild(rocket);
}
public function forceField(X:Number, Y:Number, rot:Number, down:Boolean=false):void{
var shield:ForceField = new ForceField(rot);
shield.x = X;
shield.y = Y;
if (down == true){
shield.gotoAndPlay("depleted");
};
Level.addChild(shield);
}
public function normalLevel():Boolean{
if ((((currentLevel == "miniGame2")) || ((currentLevel == "miniGame3")))){
return (false);
};
return (true);
}
public function shatter(X:Number, Y:Number, rot:Number, type:String="wood"):void{
SFX("sfxBreak");
var shieldShatter:ShieldShatter = new ShieldShatter();
shieldShatter.rotation = rot;
shieldShatter.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 18));
shieldShatter.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 18));
shieldShatter.gotoAndPlay(type);
Level.addChild(shieldShatter);
}
public function mageFlame(X:Number, Y:Number, rot:Number):void{
SFX("sfxFlame");
var fireball:ProjectileMageFireball = new ProjectileMageFireball(rot);
fireball.x = (X + (Math.cos((((rot - 90) * Math.PI) / 180)) * 55));
fireball.y = (Y + (Math.sin((((rot - 90) * Math.PI) / 180)) * 5));
fireball.damage = stats.highSkeletonMage.damage;
Level.addChild(fireball);
}
public function setMusic(type:String, loops:Number=2147483647, killPrevious:Boolean=true, startingLocation:Number=0):void{
var music:Sound;
if (killPrevious){
musicChannel.stop();
};
if (type == "menu"){
music = new soundMenu();
};
if (type == "stageIntro"){
music = new soundBadlandsIntro();
};
if (type == "stage"){
music = new soundBadlands();
};
if (type == "victory"){
music = new soundVictory();
};
if (type == "death"){
music = new soundDeath();
};
if (type == "boss"){
music = new soundBoss();
};
if (type == "threat"){
music = new soundThreat();
};
musicChannel = music.play(startingLocation, loops);
if (startingLocation == 400){
musicChannel.addEventListener(Event.SOUND_COMPLETE, loopCheck);
} else {
musicChannel.removeEventListener(Event.SOUND_COMPLETE, loopCheck);
};
}
public function setupFromIntro(offset:int=400):void{
setMusic("menu", 1, true, offset);
stop();
Mouse.hide();
addChild(loopTerrain);
addChild(MENU);
setChildIndex(letterbox, getChildIndex(MENU));
addChild(menuCursor);
menuCursor.setup();
MENU.fromIntro();
}
public function shootFlashBang(X:Number, Y:Number, rot:Number):void{
var nade:ProjectileFlashBang = new ProjectileFlashBang(rot);
nade.x = (X + (Math.cos((((rot - 122) * Math.PI) / 180)) * 40));
nade.y = (Y + (Math.sin((((rot - 122) * Math.PI) / 180)) * 40));
Level.addChild(nade);
}
public function stageOverDisplaySetup():void{
char.remove();
while (monsterArray.length > 0) {
monsterArray[0].remove();
};
while (pickupArray.length > 0) {
pickupArray[0].remove();
};
MENU.fxIn(MENU.stageOverLocation, 0, true);
MENU.stageOver.visible = true;
MENU.intro.visible = false;
MENU.autosaveMenu.visible = false;
MENU.visible = true;
loopTerrain.visible = true;
delay = 64;
stats.currentBounty = (stats.currentBounty * stats.scoreMultiplier);
stats.currentScore = (stats.currentScore * stats.scoreMultiplier);
stats.bountyEarned = (stats.bountyEarned * stats.scoreMultiplier);
stats.creditsTemp = (stats.creditsTemp * stats.scoreMultiplier);
stats.scoreTemp = (stats.scoreTemp * stats.scoreMultiplier);
trace(("score multiplier: " + stats.scoreMultiplier));
updateStageOverDisplay();
addEventListener(Event.ENTER_FRAME, stageOverDisplay);
}
public function smokeTrail(X:Number, Y:Number):void{
var trail:SmokeTrail = new SmokeTrail();
var randomPls:Number = Math.random();
if (randomPls < 0.2){
trail.gotoAndStop(1);
} else {
if (randomPls < 0.4){
trail.gotoAndStop(2);
} else {
if (randomPls < 0.6){
trail.gotoAndStop(3);
} else {
if (randomPls < 0.8){
trail.gotoAndStop(4);
} else {
trail.gotoAndStop(5);
};
};
};
};
trail.x = X;
trail.y = Y;
Level.addChild(trail);
}
public function demonGodFireball(X:Number, Y:Number, rot:Number, dam:Number):void{
SFX("sfxMagicCast");
var fireball:ProjectileDemonGodFireball = new ProjectileDemonGodFireball(rot);
fireball.x = (X + (Math.cos((((rot - 80) * Math.PI) / 180)) * 92));
fireball.y = (Y + (Math.sin((((rot - 80) * Math.PI) / 180)) * 92));
fireball.damage = dam;
Level.addChild(fireball);
}
public function liquidFlameBall(X:Number, Y:Number):void{
SFX("sfxMagicCast");
enterScreenShake(2);
var flame:LiquidMageFlame = new LiquidMageFlame();
flame.x = X;
flame.y = Y;
Level.addChild(flame);
}
public function scatterPayload(X:Number, Y:Number):void{
var mini1:ProjectileScatterMini = new ProjectileScatterMini(60);
var mini2:ProjectileScatterMini = new ProjectileScatterMini(120);
var mini3:ProjectileScatterMini = new ProjectileScatterMini(180);
var mini4:ProjectileScatterMini = new ProjectileScatterMini(240);
var mini5:ProjectileScatterMini = new ProjectileScatterMini(300);
var mini6:ProjectileScatterMini = new ProjectileScatterMini(360);
mini1.x = X;
mini2.x = X;
mini3.x = X;
mini4.x = X;
mini5.x = X;
mini6.x = X;
mini1.y = Y;
mini2.y = Y;
mini3.y = Y;
mini4.y = Y;
mini5.y = Y;
mini6.y = Y;
Level.addChild(mini1);
Level.addChild(mini2);
Level.addChild(mini3);
Level.addChild(mini4);
Level.addChild(mini5);
Level.addChild(mini6);
}
public function addMonster(monsterType:String, X=undefined, Y=undefined, side=undefined, gift:String=""):void{
var fiftyFifty:Number;
var spacer:Number;
var randomX:Number;
var randomY:Number;
var align:Number;
var monsterClass:Class = (getDefinitionByName(("game.overheadShooter.monsters." + monsterType)) as Class);
var monster:* = new (monsterClass);
monsterArray.push(monster);
if (gift != ""){
monster.giftType = gift;
};
if (X == undefined){
fiftyFifty = Math.random();
spacer = 100;
randomX = ((StageWidth + spacer) * Math.random());
randomY = ((StageHeight + spacer) * Math.random());
align = (spacer / 2);
if (side != undefined){
fiftyFifty = (side * 0.24);
};
if (fiftyFifty < 0.25){
monster.x = (randomX - align);
monster.y = -(spacer);
} else {
if (fiftyFifty < 0.5){
monster.x = (StageWidth + spacer);
monster.y = (randomY - align);
} else {
if (fiftyFifty < 0.75){
monster.x = (randomX - align);
monster.y = (StageHeight + spacer);
} else {
monster.x = -(spacer);
monster.y = (randomY - align);
};
};
};
} else {
monster.x = X;
monster.y = Y;
};
Level.addChild(monster);
trace((monsterType + " spawned"));
if (stats.hacks.nightmare[0] == 2){
if (monster.health){
monster.health = (monster.health * 2);
};
if (monster.monsterSpeed){
monster.monsterSpeed = (monster.monsterSpeed * 2);
};
if (monster.originalSpeed){
monster.originalSpeed = (monster.originalSpeed * 2);
};
if (monster.dam){
monster.dam = (monster.dam * 2);
};
};
if (stats.hacks.mushroom[0] == 2){
TweenLite.to(monster, 0, {tint:(0xFF00 * Math.random())});
};
if (stats.hacks.blindFold[0] == 2){
monster.alpha = 0;
};
}
public function screenPing(here:Point){
var ping:ScreenPing = new ScreenPing();
ping.x = here.x;
ping.y = here.y;
addChild(ping);
}
}
}//package game.overheadShooter
Section 110
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
public class TweenLite {
public var delay:Number;
protected var _initted:Boolean;
protected var _subTweens:Array;
public var startTime:int;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
protected var _active:Boolean;
public var tweens:Array;
public var vars:Object;
public var initTime:int;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 6.21;
private static var _sprite:Sprite = new Sprite();
protected static var _all:Dictionary = new Dictionary();
public static var killDelayedCallsTo:Function = killTweensOf;
protected static var _curTime:uint;
private static var _listening:Boolean;
public function TweenLite($target:Object, $duration:Number, $vars:Object){
super();
if ($target == null){
return;
};
if (((((!(($vars.overwrite == false))) && (!(($target == null))))) || ((_all[$target] == undefined)))){
delete _all[$target];
_all[$target] = new Dictionary();
};
_all[$target][this] = this;
this.vars = $vars;
this.duration = (($duration) || (0.001));
this.delay = (($vars.delay) || (0));
this.target = $target;
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
};
this.tweens = [];
_subTweens = [];
_hst = (_initted = false);
_active = ((($duration == 0)) && ((this.delay == 0)));
if (!_classInitted){
_curTime = getTimer();
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
_classInitted = true;
};
this.initTime = _curTime;
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (_active))){
initTweenVals();
this.startTime = _curTime;
if (_active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
};
if (((!(_listening)) && (!(_active)))){
_timer.addEventListener("timer", killGarbage);
_timer.start();
_listening = true;
};
}
protected function addSubTween($proxy:Function, $target:Object, $props:Object, $info:Object=null):void{
var p:String;
var sub:Object = {proxy:$proxy, target:$target, info:$info};
_subTweens.push(sub);
for (p in $props) {
if ($target.hasOwnProperty(p)){
if (typeof($props[p]) == "number"){
this.tweens.push({o:$target, p:p, s:$target[p], c:($props[p] - $target[p]), sub:sub});
} else {
this.tweens.push({o:$target, p:p, s:$target[p], c:Number($props[p]), sub:sub});
};
};
};
_hst = true;
}
public function initTweenVals($hrp:Boolean=false, $reservedProps:String=""):void{
var p:String;
var i:int;
var endArray:Array;
var clr:ColorTransform;
var endClr:ColorTransform;
var tp:Object;
var isDO = (this.target is DisplayObject);
if ((this.target is Array)){
endArray = ((this.vars.endArray) || ([]));
i = 0;
while (i < endArray.length) {
if (((!((this.target[i] == endArray[i]))) && (!((this.target[i] == undefined))))){
this.tweens.push({o:this.target, p:i.toString(), s:this.target[i], c:(endArray[i] - this.target[i])});
};
i++;
};
} else {
for (p in this.vars) {
if ((((((((((((((((((((((((((((((((((((p == "ease")) || ((p == "delay")))) || ((p == "overwrite")))) || ((p == "onComplete")))) || ((p == "onCompleteParams")))) || ((p == "onCompleteScope")))) || ((p == "runBackwards")))) || ((p == "onUpdate")))) || ((p == "onUpdateParams")))) || ((p == "onUpdateScope")))) || ((p == "autoAlpha")))) || ((p == "onStart")))) || ((p == "onStartParams")))) || ((p == "onStartScope")))) || ((p == "renderOnStart")))) || ((p == "proxiedEase")))) || ((p == "easeParams")))) || ((($hrp) && (!(($reservedProps.indexOf(((" " + p) + " ")) == -1))))))){
} else {
if ((((p == "tint")) && (isDO))){
clr = this.target.transform.colorTransform;
endClr = new ColorTransform();
if (this.vars.alpha != undefined){
endClr.alphaMultiplier = this.vars.alpha;
delete this.vars.alpha;
i = (this.tweens.length - 1);
while (i > -1) {
if (this.tweens[i].p == "alpha"){
this.tweens.splice(i, 1);
break;
};
i--;
};
} else {
endClr.alphaMultiplier = this.target.alpha;
};
if (((((!((this.vars[p] == null))) && (!((this.vars[p] == ""))))) || ((this.vars[p] == 0)))){
endClr.color = this.vars[p];
};
addSubTween(tintProxy, {progress:0}, {progress:1}, {target:this.target, color:clr, endColor:endClr});
} else {
if ((((p == "frame")) && (isDO))){
addSubTween(frameProxy, {frame:this.target.currentFrame}, {frame:this.vars[p]}, {target:this.target});
} else {
if ((((p == "volume")) && (((isDO) || ((this.target is SoundChannel)))))){
addSubTween(volumeProxy, this.target.soundTransform, {volume:this.vars[p]}, {target:this.target});
} else {
if (this.target.hasOwnProperty(p)){
if (typeof(this.vars[p]) == "number"){
this.tweens.push({o:this.target, p:p, s:this.target[p], c:(this.vars[p] - this.target[p])});
} else {
this.tweens.push({o:this.target, p:p, s:this.target[p], c:Number(this.vars[p])});
};
};
};
};
};
};
};
};
if (this.vars.runBackwards == true){
i = (this.tweens.length - 1);
while (i > -1) {
tp = this.tweens[i];
tp.s = (tp.s + tp.c);
tp.c = (tp.c * -1);
i--;
};
};
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = !((((this.vars.runBackwards == true)) && ((this.target.alpha == 0))));
};
_initted = true;
}
public function get active():Boolean{
if (_active){
return (true);
};
if (((_curTime - this.initTime) / 1000) > this.delay){
_active = true;
this.startTime = (this.initTime + (this.delay * 1000));
if (!_initted){
initTweenVals();
} else {
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(this.vars.onStartScope, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function render($t:uint):void{
var tp:Object;
var i:int;
var time:Number = (($t - this.startTime) / 1000);
if (time > this.duration){
time = this.duration;
};
var factor:Number = this.vars.ease(time, 0, 1, this.duration);
i = (this.tweens.length - 1);
while (i > -1) {
tp = this.tweens[i];
tp.o[tp.p] = (tp.s + (factor * tp.c));
i--;
};
if (_hst){
i = (_subTweens.length - 1);
while (i > -1) {
_subTweens[i].proxy(_subTweens[i]);
i--;
};
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(this.vars.onUpdateScope, this.vars.onUpdateParams);
};
if (time == this.duration){
complete(true);
};
}
protected function easeProxy($t:Number, $b:Number, $c:Number, $d:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function complete($skipRender:Boolean=false):void{
if (!$skipRender){
if (!_initted){
initTweenVals();
};
this.startTime = (_curTime - (this.duration * 1000));
render(_curTime);
return;
};
if ((((typeof(this.vars.autoAlpha) == "number")) && ((this.target.alpha == 0)))){
this.target.visible = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(this.vars.onCompleteScope, this.vars.onCompleteParams);
};
removeTween(this);
}
public static function easeOut($t:Number, $b:Number, $c:Number, $d:Number):Number{
$t = ($t / $d);
return ((((-($c) * $t) * ($t - 2)) + $b));
}
public static function frameProxy($o:Object):void{
$o.info.target.gotoAndStop(Math.round($o.target.frame));
}
public static function removeTween($t:TweenLite=null):void{
if (((!(($t == null))) && (!((_all[$t.target] == undefined))))){
delete _all[$t.target][$t];
};
}
public static function killTweensOf($tg:Object=null, $complete:Boolean=false):void{
var o:Object;
var tw:*;
if (((!(($tg == null))) && (!((_all[$tg] == undefined))))){
if ($complete){
o = _all[$tg];
for (tw in o) {
o[tw].complete(false);
};
};
delete _all[$tg];
};
}
public static function delayedCall($delay:Number, $onComplete:Function, $onCompleteParams:Array=null, $onCompleteScope=null):TweenLite{
return (new TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, onCompleteScope:$onCompleteScope, overwrite:false}));
}
public static function from($target:Object, $duration:Number, $vars:Object):TweenLite{
$vars.runBackwards = true;
return (new TweenLite($target, $duration, $vars));
}
public static function executeAll($e:Event=null):void{
var a:Dictionary;
var p:Object;
var tw:Object;
var t:uint = (_curTime = getTimer());
if (_listening){
a = _all;
for each (p in a) {
for (tw in p) {
if (((!((p[tw] == undefined))) && (p[tw].active))){
p[tw].render(t);
};
};
};
};
}
public static function volumeProxy($o:Object):void{
$o.info.target.soundTransform = $o.target;
}
public static function killGarbage($e:TimerEvent):void{
var found:Boolean;
var p:Object;
var twp:Object;
var tw:Object;
var tg_cnt:uint;
for (p in _all) {
found = false;
for (twp in _all[p]) {
found = true;
break;
};
if (!found){
delete _all[p];
} else {
tg_cnt++;
};
};
if (tg_cnt == 0){
_timer.removeEventListener("timer", killGarbage);
_timer.stop();
_listening = false;
};
}
public static function tintProxy($o:Object):void{
var n:Number = $o.target.progress;
var r:Number = (1 - n);
var sc:Object = $o.info.color;
var ec:Object = $o.info.endColor;
$o.info.target.transform.colorTransform = new ColorTransform(((sc.redMultiplier * r) + (ec.redMultiplier * n)), ((sc.greenMultiplier * r) + (ec.greenMultiplier * n)), ((sc.blueMultiplier * r) + (ec.blueMultiplier * n)), ((sc.alphaMultiplier * r) + (ec.alphaMultiplier * n)), ((sc.redOffset * r) + (ec.redOffset * n)), ((sc.greenOffset * r) + (ec.greenOffset * n)), ((sc.blueOffset * r) + (ec.blueOffset * n)), ((sc.alphaOffset * r) + (ec.alphaOffset * n)));
}
public static function to($target:Object, $duration:Number, $vars:Object):TweenLite{
return (new TweenLite($target, $duration, $vars));
}
}
}//package gs
Section 111
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (width:Number, height: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;
var ad_timeout:Number = 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();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = 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 (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
finished = true;
chk.started = getTimer();
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (this.root == null){
finished = true;
};
if (finished){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(server:String):String{
var hostname:String = server.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (hostname);
};
Security.allowDomain("*");
Security.allowDomain(hostname);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(hostname);
return (hostname);
}
public static function unload(clip:Object):Boolean{
if (((clip.clip) && (clip.clip._mochiad))){
clip = clip.clip;
};
if (clip.origFrameRate != undefined){
clip.stage.frameRate = clip.origFrameRate;
};
if (!clip._mochiad){
return (false);
};
if (clip._mochiad._containerLCName != undefined){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
};
if (clip._mochiad.onUnload){
clip._mochiad.onUnload();
};
delete clip._mochiad_loaded;
delete clip._mochiad;
return (true);
}
public static function showInterLevelAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = options;
var DEFAULTS:Object = {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 (width:Number, height: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;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = 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();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = 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{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var p:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 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 (msec:Number):void{
var _chk:Object = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = (msec - 250);
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (finished){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(options:Object, defaults:Object):Object{
var k:String;
var pairs:Array;
var i:Number;
var kv:Array;
var optcopy:Object = {};
for (k in defaults) {
optcopy[k] = defaults[k];
};
if (options){
for (k in options) {
optcopy[k] = options[k];
};
};
if (optcopy.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."));
};
options = optcopy.clip.loaderInfo.parameters.mochiad_options;
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
optcopy[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
if (optcopy.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (optcopy);
}
public static function _cleanup(mc:Object):void{
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = mc;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
lc.client = null;
lc.close();
//unresolved jump
var _slot1 = e;
};
setTimeout(f, 0);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(options:Object):MovieClip{
var clip:Object;
var mc:MovieClip;
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 = options;
var DEFAULTS:Object = {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 (!(clip is DisplayObject)){
trace("Warning: Object passed as container clip not a descendant of the DisplayObject type");
return (null);
};
if (MovieClip(clip).stage == null){
trace("Warning: Container clip for ad is not attached to the stage");
return (null);
};
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
//unresolved jump
var _slot1 = e;
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."));
var depth:Number = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = 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;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
var lv:URLVariables = 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();
mc.regContLC = function (lc_name:String):void{
mc._containerLCName = lc_name;
};
loader = new Loader();
g = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (io:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
if (!options.skip){
loader.load(req);
};
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(base:Object, methodName:String, argsArray:Array):Object{
var nameArray:Array = methodName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
if (typeof(base[nameArray[i]]) == "function"){
return (base[nameArray[i]].apply(base, argsArray));
};
return (undefined);
}
public static function createEmptyMovieClip(parent:Object, name:String, depth:Number):MovieClip{
var mc:MovieClip = new MovieClip();
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
parent[name] = mc;
mc["_name"] = name;
return (mc);
}
public static function _getRes(options:Object, clip:Object):Array{
var xy:Array;
var b:Object = clip.getBounds(clip.root);
var w:Number = 0;
var h:Number = 0;
if (typeof(options.res) != "undefined"){
xy = options.res.split("x");
w = parseFloat(xy[0]);
h = parseFloat(xy[1]);
} else {
w = (b.xMax - b.xMin);
h = (b.yMax - b.yMin);
};
if ((((w == 0)) || ((h == 0)))){
w = clip.stage.stageWidth;
h = clip.stage.stageHeight;
};
return ([w, h]);
}
public static function adShowing(mc:Object):void{
mc.origFrameRate = mc.stage.frameRate;
mc.stage.frameRate = 30;
}
public static function getValue(base:Object, objectName:String):Object{
var nameArray:Array = objectName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
return (base[nameArray[i]]);
}
public static function rpc(clip:Object, callbackID:Number, arg:Object):void{
var _local4:Object;
var _local5:Object;
switch (arg.id){
case "setValue":
MochiAd.setValue(clip, arg.objectName, arg.value);
break;
case "getValue":
_local4 = MochiAd.getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + arg.id));
};
}
public static function setValue(base:Object, objectName:String, value:Object):void{
var nameArray:Array = objectName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return;
};
base = base[nameArray[i]];
i++;
};
base[nameArray[i]] = value;
}
public static function showPreGameAd(options:Object):void{
var clip:Object;
var ad_msec:Number;
var fadeout_time:Number;
var mc:MovieClip;
var w:Number;
var h:Number;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = options;
var DEFAULTS:Object = {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 (width:Number, height: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 (percent:Number):void{
}, progress_override:function (_clip:Object):Number{
return (NaN);
}, bar_offset:0};
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;
var ad_timeout:Number = options.ad_timeout;
if (options.skip){
ad_timeout = 0;
};
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);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = 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);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
var bar_w:Number = ((w - bar.x) - 10);
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(bar_w, 0);
backing.lineTo(bar_w, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(bar_w, 0);
inside.lineTo(bar_w, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(bar_w, 0);
outline.lineTo(bar_w, 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 p:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var progress:Number = Math.min(1, options.progress_override(clip));
var f:Function = function (ev:Event):void{
ev.target.removeEventListener(ev.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (msec:Number):void{
var _chk:Object = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = msec;
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s:String):Object{
trace(("[MOCHIAD rpcTestFn] " + s));
return (s);
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (lc_name:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _clip:Object = this.parent.parent.root;
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
var clip_total:Number = _clip.loaderInfo.bytesTotal;
var clip_loaded:Number = _clip.loaderInfo.bytesLoaded;
var clip_progress:Number = Math.min(1, options.progress_override(_clip));
if (clip_progress == 1){
complete = true;
};
if (complete){
clip_loaded = Math.max(1, clip_loaded);
clip_total = clip_loaded;
};
var clip_pcnt:Number = ((100 * clip_loaded) / clip_total);
if (!isNaN(clip_progress)){
clip_pcnt = (100 * clip_progress);
};
var ad_pcnt:Number = ((100 * elapsed) / chk.ad_msec);
var _inside:Object = this._mochiad_bar._inside;
var pcnt:Number = Math.min(100, Math.min(((clip_pcnt) || (0)), ad_pcnt));
pcnt = Math.max(this.last_pcnt, pcnt);
this.last_pcnt = pcnt;
_inside.scaleX = (pcnt * 0.01);
options.ad_progress(pcnt);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:clip_pcnt});
if (clip_pcnt >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((elapsed > chk.ad_timeout)) && ((clip_pcnt == 100)))){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (((complete) && (finished))){
if (unloaded){
MochiAd.unload(_clip);
} else {
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(options:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(options);
}
public static function showTimedAd(options:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(options);
}
public static function doOnEnterFrame(mc:MovieClip):void{
var mc = mc;
var f:Function = function (ev:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
ev.target.removeEventListener(ev.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 112
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public static function triggerEvent(eventType:String, args:Object):void{
MochiSocial.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
MochiSocial.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
MochiSocial.addEventListener(eventType, delegate);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(options:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:options}, null, null);
}
public static function showItem(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:options}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(options:Object=null):void{
if (((!(options)) || (!((typeof(options.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:options}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 113
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function reencode():void{
var newEncode:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function set value(v:Number):void{
setValue(v);
}
public function toString():String{
var s:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi.as3
Section 114
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
super();
eventTable = {};
}
public function triggerEvent(event:String, args:Object):void{
var i:Object;
if (eventTable[event] == undefined){
return;
};
for (i in eventTable[event]) {
var _local6 = eventTable[event];
_local6[i](args);
};
}
public function removeEventListener(event:String, delegate:Function):void{
var s:Object;
if (eventTable[event] == undefined){
eventTable[event] = [];
return;
};
for (s in eventTable[event]) {
if (eventTable[event][s] != delegate){
} else {
eventTable[event].splice(Number(s), 1);
};
};
}
public function addEventListener(event:String, delegate:Function):void{
removeEventListener(event, delegate);
eventTable[event].push(delegate);
}
}
}//package mochi.as3
Section 115
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function trackEvent(tag:String, value=null):void{
MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function startSession(achievementID:String):void{
MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function setNotifications(clip:MovieClip, style:Object):void{
var s:Object;
var args:Object = {};
for (s in style) {
args[s] = style[s];
};
args.clip = clip;
MochiServices.send("events_setNotifications", args, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(tag:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
}
}//package mochi.as3
Section 116
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
super();
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(event:Object):void{
if (!this[(event.id + KEY_SALT)]){
this[(event.id + KEY_SALT)] = 0;
};
if (!this[event.id]){
this[event.id] = 0;
};
this[(event.id + KEY_SALT)] = (this[(event.id + KEY_SALT)] + event.count);
this[event.id] = (this[event.id] + event.count);
if (event.privateProperties.consumable){
if (!this[event.privateProperties.tag]){
this[event.privateProperties.tag] = 0;
};
this[event.privateProperties.tag] = (this[event.privateProperties.tag] + (event.privateProperties.inc * event.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[name]){
return (MochiDigits(_consumableProperties[name]).value);
};
return (undefined);
}
private function loggedIn(args:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(name):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[name] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(index:int):int{
return (((index)>=_names.length) ? 0 : (index + 1));
}
private function putConsumableBag(userData:MochiUserData):void{
_syncPending = false;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
var d:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(value is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:value});
return;
};
if (_consumableProperties[name]){
d = MochiDigits(_consumableProperties[name]);
if (d.value == value){
return;
};
d.value = value;
} else {
_names.push(name);
_consumableProperties[name] = new MochiDigits(value);
};
_syncID++;
}
private function itemOwned(event:Object):void{
_storeSync[event.id] = {properties:event.properties, count:event.count};
}
private function sync(e:Event=null):void{
var key:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var output:Object = {};
for (key in _consumableProperties) {
output[key] = MochiDigits(_consumableProperties[key]).value;
};
MochiUserData.put(CONSUMER_KEY, output, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(index:int):String{
return (_names[(index - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(name):Boolean{
if (!_consumableProperties[name]){
return (false);
};
_names.splice(_names.indexOf(name), 1);
delete _consumableProperties[name];
return (true);
}
private function getConsumableBag(userData:MochiUserData):void{
var key:String;
var unsynced:Number;
if (userData.error){
triggerEvent(ERROR, {type:IO_ERROR, error:userData.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (userData.data){
for (key in userData.data) {
_names.push(key);
_consumableProperties[key] = new MochiDigits(userData.data[key]);
};
};
for (key in _storeSync) {
unsynced = _storeSync[key].count;
if (_consumableProperties[(key + KEY_SALT)]){
unsynced = (unsynced - _consumableProperties[key]);
};
if (unsynced == 0){
} else {
newItems({id:key, count:unsynced, properties:_storeSync[key].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(args:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
}
}//package mochi.as3
Section 117
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(options:Object=null):void{
var n:Number;
var options = options;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
public static function requestList(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
public static function scoresArrayToObjects(scores:Object):Object{
var i:Number;
var j:Number;
var o:Object;
var row_obj:Object;
var item:String;
var param:String;
var so:Object = {};
for (item in scores) {
if (typeof(scores[item]) == "object"){
if (((!((scores[item].cols == null))) && (!((scores[item].rows == null))))){
so[item] = [];
o = scores[item];
j = 0;
while (j < o.rows.length) {
row_obj = {};
i = 0;
while (i < o.cols.length) {
row_obj[o.cols[i]] = o.rows[j][i];
i++;
};
so[item].push(row_obj);
j++;
};
} else {
so[item] = {};
for (param in scores[item]) {
so[item][param] = scores[item][param];
};
};
} else {
so[item] = scores[item];
};
};
return (so);
}
public static function submit(score:Number, name:String, callbackObj:Object=null, callbackMethod:Object=null):void{
score = Number(score);
if (isNaN(score)){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((score == Number.NEGATIVE_INFINITY)) || ((score == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(score) != score){
trace((("WARNING: Submitted score '" + String(score)) + "' will be truncated"));
};
score = Number(score);
};
};
MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
public static function onClose(args:Object=null):void{
if (((((args) && ((args.error == true)))) && (onErrorHandler))){
if (args.errorCode == null){
args.errorCode = "IOError";
};
onErrorHandler(args.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(boardID:String):void{
MochiServices.warnID(boardID, true);
MochiScores.boardID = boardID;
MochiServices.send("scores_setBoardID", {boardID:boardID});
}
}
}//package mochi.as3
Section 118
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(pkg:Object):void{
var methodName:String;
var pkg = pkg;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + _slot1.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + _slot1.toString()));
};
};
delete _callbacks[cb];
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName));
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_queue.push({methodName:methodName, args:args, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_nextCallbackID++;
};
};
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var b:int;
var loader:Loader;
var avm1_bytecode:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var header:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var footer:Array = [0, 64, 0, 0, 0];
var mc:MovieClip = new MovieClip();
var lc:LocalConnection = new LocalConnection();
var lc_name:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
var ba:ByteArray = new ByteArray();
var cpool:ByteArray = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
var actionLength:uint = ((avm1_bytecode.length + cpool.length) + 4);
var fileLength:uint = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
var rect:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
_mochiLocalConnection.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
};
return (hostname);
}
public static function getVersion():String{
return ("3.8 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(bid:String, leaderboard:Boolean):void{
bid = bid.toLowerCase();
if (bid.length != 16){
trace((("WARNING: " + (leaderboard) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (bid == "1e113c7239048b3f"){
if (leaderboard){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (bid == "84993a1de4031cd8"){
if (leaderboard){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var i:Number = 0;
while (i < bid.length) {
switch (bid.charAt(i)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + bid));
return;
};
i++;
};
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
request = _queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _callbacks[request.callbackID];
};
delete _callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(pkg:Object):void{
var target:String = pkg.target;
var event:String = pkg.event;
switch (target){
case "events":
MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins":
MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "sync":
servicesSync.triggerEvent(pkg.event, pkg.args);
break;
};
}
private static function urlOptions(clip:Object):Object{
var options:String;
var pairs:Array;
var i:Number;
var kv:Array;
var opts:Object = {};
if (clip.stage){
options = clip.stage.loaderInfo.parameters.mochiad_options;
} else {
options = clip.loaderInfo.parameters.mochiad_options;
};
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (container != null){
if ((container is DisplayObjectContainer)){
_container = container;
};
};
if (doAdd){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function loadError(ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function loadLCBridge(clip:Object):void{
var loader:Loader;
var clip = clip;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (ev:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servURL){
_servURL = urlOptions(clip).servURL;
};
var servicesURL:String = (_servURL + _services);
if (urlOptions(clip).servicesURL){
servicesURL = urlOptions(clip).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(servicesURL);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var req:URLRequest = new URLRequest(servicesURL);
var vars:URLVariables = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
vars.api_version = getVersion();
if (widget){
vars.widget = true;
};
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (errorCode:String):void{
trace(errorCode);
};
};
};
}
public static function updateCopy(args:Object):void{
MochiServices.send("coins_updateCopy", args, null, null);
}
public static function bringToTop(e:Event=null):void{
var e = e;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
}
public static function connectWait(e:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 119
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(properties:Object):void{
MochiServices.send("coins_saveUserProperties", properties);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(eventType:String, args:Object):void{
_dispatcher.triggerEvent(eventType, args);
}
public static function addEventListener(eventType:String, delegate:Function):void{
_dispatcher.addEventListener(eventType, delegate);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(options:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:options});
}
public static function removeEventListener(eventType:String, delegate:Function):void{
_dispatcher.removeEventListener(eventType, delegate);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (args:Object):void{
_user_info = args;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (args:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 120
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
super();
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(name, value):void{
if (_syncContainer[name] == value){
return;
};
var n:String = name.toString();
_syncContainer[n] = value;
MochiServices.send("sync_propUpdate", {name:n, value:value});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(name){
return (_syncContainer[name]);
}
public function triggerEvent(eventType:String, args:Object):void{
switch (eventType){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[args.name] = args.value;
break;
};
}
}
}//package mochi.as3
Section 121
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(key:String="", callback:Function=null){
super();
this.key = key;
this.callback = callback;
}
public function serialize(obj):ByteArray{
var arr:ByteArray = new ByteArray();
arr.objectEncoding = ObjectEncoding.AMF3;
arr.writeObject(obj);
arr.compress();
return (arr);
}
public function errorHandler(event:IOErrorEvent):void{
data = null;
error = event;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function putEvent(obj):void{
request("put", serialize(obj));
}
public function deserialize(arr:ByteArray){
arr.objectEncoding = ObjectEncoding.AMF3;
arr.uncompress();
return (arr.readObject());
}
public function securityErrorHandler(event:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + event.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
callback(this);
//unresolved jump
var _slot1 = e;
trace(("[MochiUserData] exception during callback: " + _slot1));
}
public function request(_operation:String, _data:ByteArray):void{
var _operation = _operation;
var _data = _data;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.load(req);
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _slot1.toString())));
}
public function completeHandler(event:Event):void{
var event = event;
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
//unresolved jump
var _slot1 = e;
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + _slot1.toString())));
return;
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(key:String, callback:Function):void{
var userData:MochiUserData = new MochiUserData(key, callback);
userData.getEvent();
}
public static function put(key:String, obj, callback:Function):void{
var userData:MochiUserData = new MochiUserData(key, callback);
userData.putEvent(obj);
}
}
}//package mochi.as3
Section 122
//bossSkeleCasting_195 (Operation_Onslaught_fla.bossSkeleCasting_195)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class bossSkeleCasting_195 extends MovieClip {
public function bossSkeleCasting_195(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 123
//bossSkeleRunningCast_190 (Operation_Onslaught_fla.bossSkeleRunningCast_190)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class bossSkeleRunningCast_190 extends MovieClip {
public function bossSkeleRunningCast_190(){
addFrameScript(41, frame42);
}
function frame42(){
gotoAndPlay(27);
}
}
}//package Operation_Onslaught_fla
Section 124
//bossSkeleSwingZone_189 (Operation_Onslaught_fla.bossSkeleSwingZone_189)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class bossSkeleSwingZone_189 extends MovieClip {
public function bossSkeleSwingZone_189(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 125
//civilianBreak_380 (Operation_Onslaught_fla.civilianBreak_380)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class civilianBreak_380 extends MovieClip {
public function civilianBreak_380(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 126
//civilianHelpArea_372 (Operation_Onslaught_fla.civilianHelpArea_372)
package Operation_Onslaught_fla {
import flash.display.*;
import flash.text.*;
public dynamic class civilianHelpArea_372 extends MovieClip {
public var txtHot:TextField;
public function civilianHelpArea_372(){
addFrameScript(19, frame20, 36, frame37);
}
function frame37(){
stop();
}
function frame20(){
gotoAndPlay(1);
}
}
}//package Operation_Onslaught_fla
Section 127
//cleaverForSpin_524 (Operation_Onslaught_fla.cleaverForSpin_524)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class cleaverForSpin_524 extends MovieClip {
public function cleaverForSpin_524(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 128
//cyborgNinjaSwingZone_204 (Operation_Onslaught_fla.cyborgNinjaSwingZone_204)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class cyborgNinjaSwingZone_204 extends MovieClip {
public function cyborgNinjaSwingZone_204(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 129
//cyborgShield_215 (Operation_Onslaught_fla.cyborgShield_215)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class cyborgShield_215 extends MovieClip {
public function cyborgShield_215(){
addFrameScript(4, frame5, 9, frame10);
}
function frame5(){
stop();
}
function frame10(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 130
//demonGodBreakArmor_412 (Operation_Onslaught_fla.demonGodBreakArmor_412)
package Operation_Onslaught_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class demonGodBreakArmor_412 extends MovieClip {
public var armor:MovieClip;
public function demonGodBreakArmor_412(){
addFrameScript(1, frame2, 12, frame13, 18, frame19);
}
function frame19(){
stop();
}
function frame2(){
armor.gotoAndPlay(2);
}
function frame13(){
MovieClip(root).SFX("sfxBreak");
}
}
}//package Operation_Onslaught_fla
Section 131
//demonGodChest_395 (Operation_Onslaught_fla.demonGodChest_395)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class demonGodChest_395 extends MovieClip {
public function demonGodChest_395(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 132
//demonGodHelicopter_384 (Operation_Onslaught_fla.demonGodHelicopter_384)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class demonGodHelicopter_384 extends MovieClip {
public var gun1:MovieClip;
public var gun2:MovieClip;
public var blades:MovieClip;
public function demonGodHelicopter_384(){
addFrameScript(0, frame1, 2, frame3, 4, frame5, 6, frame7);
}
function frame1(){
blades.rotation = (blades.rotation + 10);
}
function frame5(){
blades.rotation = (blades.rotation + 10);
}
function frame7(){
blades.rotation = (blades.rotation + 10);
}
function frame3(){
blades.rotation = (blades.rotation + 10);
}
}
}//package Operation_Onslaught_fla
Section 133
//demonGodShipCover_411 (Operation_Onslaught_fla.demonGodShipCover_411)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class demonGodShipCover_411 extends MovieClip {
public function demonGodShipCover_411(){
addFrameScript(0, frame1, 4, frame5, 8, frame9);
}
function frame5(){
play();
}
function frame9(){
stop();
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 134
//demonGodSwingArea_383 (Operation_Onslaught_fla.demonGodSwingArea_383)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class demonGodSwingArea_383 extends MovieClip {
public function demonGodSwingArea_383(){
addFrameScript(0, frame1, 38, frame39, 47, frame48);
}
function frame48(){
stop();
}
function frame39(){
stop();
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 135
//goblinSpearHitZone_308 (Operation_Onslaught_fla.goblinSpearHitZone_308)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class goblinSpearHitZone_308 extends MovieClip {
public function goblinSpearHitZone_308(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 136
//goblinSwingZone_24 (Operation_Onslaught_fla.goblinSwingZone_24)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class goblinSwingZone_24 extends MovieClip {
public function goblinSwingZone_24(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 137
//gunsForThrow_283 (Operation_Onslaught_fla.gunsForThrow_283)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class gunsForThrow_283 extends MovieClip {
public var gun:MovieClip;
public function gunsForThrow_283(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 138
//HackCheckbox_492 (Operation_Onslaught_fla.HackCheckbox_492)
package Operation_Onslaught_fla {
import flash.display.*;
import game.overheadShooter.configAndMenus.*;
import flash.text.*;
public dynamic class HackCheckbox_492 extends MovieClip {
public var txtHackName:TextField;
public var btn:Btn;
public function HackCheckbox_492(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 139
//helicopterBlades_530 (Operation_Onslaught_fla.helicopterBlades_530)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class helicopterBlades_530 extends MovieClip {
public var bladesMoving:MovieClip;
public function helicopterBlades_530(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 140
//highSkeleHelmet_70 (Operation_Onslaught_fla.highSkeleHelmet_70)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class highSkeleHelmet_70 extends MovieClip {
public function highSkeleHelmet_70(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 141
//highSkeleWalkingBanditCleaverToss_82 (Operation_Onslaught_fla.highSkeleWalkingBanditCleaverToss_82)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class highSkeleWalkingBanditCleaverToss_82 extends MovieClip {
public function highSkeleWalkingBanditCleaverToss_82(){
addFrameScript(29, frame30, 34, frame35);
}
function frame30(){
stop();
}
function frame35(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 142
//hudCurrentlyEquipped_514 (Operation_Onslaught_fla.hudCurrentlyEquipped_514)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class hudCurrentlyEquipped_514 extends MovieClip {
public function hudCurrentlyEquipped_514(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 143
//hudCurrentlyEquippedGrenade_515 (Operation_Onslaught_fla.hudCurrentlyEquippedGrenade_515)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class hudCurrentlyEquippedGrenade_515 extends MovieClip {
public function hudCurrentlyEquippedGrenade_515(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 144
//IngameOptions2_490 (Operation_Onslaught_fla.IngameOptions2_490)
package Operation_Onslaught_fla {
import flash.display.*;
import game.overheadShooter.configAndMenus.*;
import flash.text.*;
public dynamic class IngameOptions2_490 extends MovieClip {
public var btnQuality:Btn;
public var txt1Bounty:TextField;
public var txt2Bounty:TextField;
public var txt4Bounty:TextField;
public var txtCaption:TextField;
public var txtCurrentQuality:TextField;
public var btnEnd:Btn;
public var btnBack:Btn;
public var btnOffline:Btn;
public var txt1Name:TextField;
public var txt2Name:TextField;
public var txt3Name:TextField;
public var txt4Name:TextField;
public var btnControls:Btn;
public function IngameOptions2_490(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 145
//intro_4 (Operation_Onslaught_fla.intro_4)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class intro_4 extends MovieClip {
public var axe:MovieClip;
public function intro_4(){
addFrameScript(374, frame375);
}
function frame375(){
MovieClip(root).nextFrame();
}
}
}//package Operation_Onslaught_fla
Section 146
//introCopter_15 (Operation_Onslaught_fla.introCopter_15)
package Operation_Onslaught_fla {
import flash.events.*;
import flash.display.*;
public dynamic class introCopter_15 extends MovieClip {
public var blades:MovieClip;
public function introCopter_15(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, rotateBlades);
}
public function rotateBlades(evt:Event):void{
blades.rotation = (blades.rotation + 150);
}
}
}//package Operation_Onslaught_fla
Section 147
//introTerrain_21 (Operation_Onslaught_fla.introTerrain_21)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class introTerrain_21 extends MovieClip {
public function introTerrain_21(){
addFrameScript(17, frame18, 18, frame19, 19, frame20, 20, frame21);
}
function frame20(){
gotoAndStop("tundra1");
}
function frame18(){
gotoAndStop("marsh1");
}
function frame19(){
gotoAndStop("badlands1");
}
function frame21(){
gotoAndStop("hive");
}
}
}//package Operation_Onslaught_fla
Section 148
//letterbox_3 (Operation_Onslaught_fla.letterbox_3)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class letterbox_3 extends MovieClip {
public function letterbox_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 149
//levelThumb_447 (Operation_Onslaught_fla.levelThumb_447)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class levelThumb_447 extends MovieClip {
public var status:MovieClip;
public function levelThumb_447(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 150
//lockedGraphic_448 (Operation_Onslaught_fla.lockedGraphic_448)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class lockedGraphic_448 extends MovieClip {
public function lockedGraphic_448(){
addFrameScript(0, frame1, 81, frame82);
}
function frame1(){
stop();
}
function frame82(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 151
//lockedGraphicForStages_452 (Operation_Onslaught_fla.lockedGraphicForStages_452)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class lockedGraphicForStages_452 extends MovieClip {
public function lockedGraphicForStages_452(){
addFrameScript(0, frame1, 81, frame82);
}
function frame1(){
stop();
}
function frame82(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 152
//mg2CivIcon_442 (Operation_Onslaught_fla.mg2CivIcon_442)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class mg2CivIcon_442 extends MovieClip {
public function mg2CivIcon_442(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 153
//monsterAxeSwingFrame_128 (Operation_Onslaught_fla.monsterAxeSwingFrame_128)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class monsterAxeSwingFrame_128 extends MovieClip {
public function monsterAxeSwingFrame_128(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 154
//nadeDuringToss_279 (Operation_Onslaught_fla.nadeDuringToss_279)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class nadeDuringToss_279 extends MovieClip {
public function nadeDuringToss_279(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 155
//PlayerHealth_516 (Operation_Onslaught_fla.PlayerHealth_516)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class PlayerHealth_516 extends MovieClip {
public function PlayerHealth_516(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 156
//playerLegs_267 (Operation_Onslaught_fla.playerLegs_267)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class playerLegs_267 extends MovieClip {
public function playerLegs_267(){
addFrameScript(0, frame1, 13, frame14);
}
function frame14(){
gotoAndStop(1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 157
//razorBlade_434 (Operation_Onslaught_fla.razorBlade_434)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class razorBlade_434 extends MovieClip {
public function razorBlade_434(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 158
//razorTankTreads_432 (Operation_Onslaught_fla.razorTankTreads_432)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class razorTankTreads_432 extends MovieClip {
public function razorTankTreads_432(){
addFrameScript(0, frame1, 1, frame2, 21, frame22);
}
function frame1(){
gotoAndStop(21);
}
function frame2(){
stop();
}
function frame22(){
gotoAndStop(2);
}
}
}//package Operation_Onslaught_fla
Section 159
//skullRazorForAni_200 (Operation_Onslaught_fla.skullRazorForAni_200)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class skullRazorForAni_200 extends MovieClip {
public var graphic:MovieClip;
public function skullRazorForAni_200(){
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 160
//terrain_22 (Operation_Onslaught_fla.terrain_22)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class terrain_22 extends MovieClip {
public function terrain_22(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 161
//wyrmPoint_499 (Operation_Onslaught_fla.wyrmPoint_499)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class wyrmPoint_499 extends MovieClip {
public function wyrmPoint_499(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 162
//wyrmTentacle_497 (Operation_Onslaught_fla.wyrmTentacle_497)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class wyrmTentacle_497 extends MovieClip {
public function wyrmTentacle_497(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 163
//wyrmTentacleClosed_498 (Operation_Onslaught_fla.wyrmTentacleClosed_498)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class wyrmTentacleClosed_498 extends MovieClip {
public function wyrmTentacleClosed_498(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 164
//zombieHitZone_248 (Operation_Onslaught_fla.zombieHitZone_248)
package Operation_Onslaught_fla {
import flash.display.*;
public dynamic class zombieHitZone_248 extends MovieClip {
public function zombieHitZone_248(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Operation_Onslaught_fla
Section 165
//Mg3HUD (Mg3HUD)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Mg3HUD extends MovieClip {
public var txtKills:TextField;
public var missile1:MovieClip;
public var missile2:MovieClip;
public var missile3:MovieClip;
public var missile4:MovieClip;
public var missile5:MovieClip;
public var missile6:MovieClip;
public var txtTime:TextField;
}
}//package
Section 166
//sfxAuto (sfxAuto)
package {
import flash.media.*;
public dynamic class sfxAuto extends Sound {
}
}//package
Section 167
//sfxBelly (sfxBelly)
package {
import flash.media.*;
public dynamic class sfxBelly extends Sound {
}
}//package
Section 168
//sfxBlood (sfxBlood)
package {
import flash.media.*;
public dynamic class sfxBlood extends Sound {
}
}//package
Section 169
//sfxBossBlood (sfxBossBlood)
package {
import flash.media.*;
public dynamic class sfxBossBlood extends Sound {
}
}//package
Section 170
//sfxBow (sfxBow)
package {
import flash.media.*;
public dynamic class sfxBow extends Sound {
}
}//package
Section 171
//sfxBreak (sfxBreak)
package {
import flash.media.*;
public dynamic class sfxBreak extends Sound {
}
}//package
Section 172
//sfxDamage (sfxDamage)
package {
import flash.media.*;
public dynamic class sfxDamage extends Sound {
}
}//package
Section 173
//sfxExplosion (sfxExplosion)
package {
import flash.media.*;
public dynamic class sfxExplosion extends Sound {
}
}//package
Section 174
//sfxFlame (sfxFlame)
package {
import flash.media.*;
public dynamic class sfxFlame extends Sound {
}
}//package
Section 175
//sfxFlashbang (sfxFlashbang)
package {
import flash.media.*;
public dynamic class sfxFlashbang extends Sound {
}
}//package
Section 176
//sfxGush (sfxGush)
package {
import flash.media.*;
public dynamic class sfxGush extends Sound {
}
}//package
Section 177
//sfxLaser (sfxLaser)
package {
import flash.media.*;
public dynamic class sfxLaser extends Sound {
}
}//package
Section 178
//sfxMagicCast (sfxMagicCast)
package {
import flash.media.*;
public dynamic class sfxMagicCast extends Sound {
}
}//package
Section 179
//sfxMenuOver (sfxMenuOver)
package {
import flash.media.*;
public dynamic class sfxMenuOver extends Sound {
}
}//package
Section 180
//sfxMenuPress (sfxMenuPress)
package {
import flash.media.*;
public dynamic class sfxMenuPress extends Sound {
}
}//package
Section 181
//sfxMenuWoosh (sfxMenuWoosh)
package {
import flash.media.*;
public dynamic class sfxMenuWoosh extends Sound {
}
}//package
Section 182
//sfxPickup (sfxPickup)
package {
import flash.media.*;
public dynamic class sfxPickup extends Sound {
}
}//package
Section 183
//sfxPickupDrop (sfxPickupDrop)
package {
import flash.media.*;
public dynamic class sfxPickupDrop extends Sound {
}
}//package
Section 184
//sfxPoisonCloud (sfxPoisonCloud)
package {
import flash.media.*;
public dynamic class sfxPoisonCloud extends Sound {
}
}//package
Section 185
//sfxRocket (sfxRocket)
package {
import flash.media.*;
public dynamic class sfxRocket extends Sound {
}
}//package
Section 186
//sfxShieldBuzz (sfxShieldBuzz)
package {
import flash.media.*;
public dynamic class sfxShieldBuzz extends Sound {
}
}//package
Section 187
//sfxShieldDown (sfxShieldDown)
package {
import flash.media.*;
public dynamic class sfxShieldDown extends Sound {
}
}//package
Section 188
//sfxShotgun (sfxShotgun)
package {
import flash.media.*;
public dynamic class sfxShotgun extends Sound {
}
}//package
Section 189
//sfxSwing1 (sfxSwing1)
package {
import flash.media.*;
public dynamic class sfxSwing1 extends Sound {
}
}//package
Section 190
//sfxSwing2 (sfxSwing2)
package {
import flash.media.*;
public dynamic class sfxSwing2 extends Sound {
}
}//package
Section 191
//sfxSwing3 (sfxSwing3)
package {
import flash.media.*;
public dynamic class sfxSwing3 extends Sound {
}
}//package
Section 192
//sfxSwing4 (sfxSwing4)
package {
import flash.media.*;
public dynamic class sfxSwing4 extends Sound {
}
}//package
Section 193
//sfxSwing5 (sfxSwing5)
package {
import flash.media.*;
public dynamic class sfxSwing5 extends Sound {
}
}//package
Section 194
//sfxSwitch (sfxSwitch)
package {
import flash.media.*;
public dynamic class sfxSwitch extends Sound {
}
}//package
Section 195
//soundBadlands (soundBadlands)
package {
import flash.media.*;
public dynamic class soundBadlands extends Sound {
}
}//package
Section 196
//soundBadlandsIntro (soundBadlandsIntro)
package {
import flash.media.*;
public dynamic class soundBadlandsIntro extends Sound {
}
}//package
Section 197
//soundBoss (soundBoss)
package {
import flash.media.*;
public dynamic class soundBoss extends Sound {
}
}//package
Section 198
//soundDeath (soundDeath)
package {
import flash.media.*;
public dynamic class soundDeath extends Sound {
}
}//package
Section 199
//soundMenu (soundMenu)
package {
import flash.media.*;
public dynamic class soundMenu extends Sound {
}
}//package
Section 200
//soundThreat (soundThreat)
package {
import flash.media.*;
public dynamic class soundThreat extends Sound {
}
}//package
Section 201
//soundVictory (soundVictory)
package {
import flash.media.*;
public dynamic class soundVictory extends Sound {
}
}//package