Frame 2
function FAQ_textBox() {
if (words.length) {
iterNum = iterNum + (1 + random(6));
if (iterNum > (words.length - 1)) {
iterNum = 0;
}
return("DID YOU KNOW:\n" + words[iterNum]);
}
return("THERE ARE NO WORDS TO USE\nPLEASE ADD SOME MORE");
}
function create_textBox() {
_root.textBox1.setText = FAQ_textBox();
_root.textBox1.CTime = 200;
_root.textBox1.removeReady = false;
_root.textBox1.createTextField("textA", 0, 235, 238, 370, 156);
_root.textBox1.createTextField("textB", -1, 237, 240, 370, 156);
_root.textBox1.formatA = new TextFormat();
_root.textBox1.formatA.size = 23;
_root.textBox1.formatA.bold = true;
_root.textBox1.formatA.color = 14866870 /* 0xE2D9B6 */;
_root.textBox1.formatA.font = "Sylfaen";
_root.textBox1.formatA.align = "center";
_root.textBox1.formatB = new TextFormat();
_root.textBox1.formatB.size = 23;
_root.textBox1.formatB.bold = true;
_root.textBox1.formatB.color = 12758887 /* 0xC2AF67 */;
_root.textBox1.formatB.font = "Sylfaen";
_root.textBox1.formatB.align = "center";
_root.textBox1.textA.wordWrap = true;
_root.textBox1.textB.wordWrap = true;
_root.textBox1.textA.selectable = false;
_root.textBox1.textB.selectable = false;
_root.textBox1.textA.type = "dynamic";
_root.textBox1.textB.type = "dynamic";
_root.textBox1.textA.text = _root.textBox1.setText;
_root.textBox1.textB.text = _root.textBox1.setText;
_root.textBox1.textA.setTextFormat(_root.textBox1.formatA);
_root.textBox1.textB.setTextFormat(_root.textBox1.formatB);
}
function remove_textBox() {
removeMovieClip(textBox1);
delete textBox1;
delete words;
delete FAQ_textBox;
delete remove_textBox;
delete create_textBox;
delete eval (manage_textBox());
delete onEnterFrame;
}
function manage_textBox() {
if (_root.textBox1.CTime < 1) {
create_textBox();
} else {
_root.textBox1.CTime = _root.textBox1.CTime - 1;
}
}
_root.createEmptyMovieClip("textBox1", 0);
words = ["That this game uses over 2000 lines of code?"];
words.push("That a dosage of over 200 rems will kill you?");
words.push("That shooting herion in your eye makes you 35.8% cooler?");
words.push("That /b/ is a place for intelligent people to go?");
words.push("Frank Sinatra had relations with the mafia?!");
words.push("LemonParty.org has great tips for making lemon margaritas?");
words.push("You lost The Game?");
words.push("My power level is over 9000?");
words.push("You can get high from sniffing markers, it is true!");
words.push("I forgot what I was going to say...");
words.push("Everybody poops, now you know you are not the only one!(What a relief!)");
words.push("To much herion could callapse you veins, but will be seeing pony's!");
words.push("It puts the lotion in the basket or else it gets the hose again?");
words.push("Verizon and AT&T get the same coverage?");
words.push("Woodchucks can't chuck wood?");
words.push("Woody Wood Pecker is bad nick-name?");
words.push("Smoking pot cannot kill you?");
words.push("Jimi Hendrix did LSD, AND SO SHOULD YOU!!!1");
words.push("Another name for pot is 'hash'?");
words.push("All rocks go to heaven?");
words.push("I own a horse?");
words.push("Killing orphans is not kosher?");
words.push("Pinochio stands for Posessed Doll?");
words.push("Doing herion will let you see the future?");
words.push("Drugs will make you creative and likable?");
words.push("Another word for Cocain is Charlie Sheen?");
words.push("Elvis Presley interogated Vietnamese is Japan?");
words.push("I am an ugly barnacle?");
words.push("No body loves you?");
words.push("Getting drunk kills your kidneys, but weed is harmless?");
words.push("Eevn if I srmacmble the wrods, uoy anc sltil raed tehm?");
iterNum = random(words.length - 2);
create_textBox();
_root.onEnterFrame = function () {
manage_textBox();
if (_root.textBox1.removeReady) {
remove_textBox();
}
};
Frame 36
_root.menuSounds = new Sound();
_root.menuSounds.attachSound("menuTheme_Sound");
_root.menuSounds.start(0, 999);
_root.buttonSounds = new Sound();
_root.buttonSounds.attachSound("pressButton_Sound");
delete _root.goBtn.onPress;
goBtn.onPress = function () {
_root.buttonSounds.start(0, 0);
_root.gotoAndPlay("goTime");
};
howToBtn.onPress = function () {
_root.buttonSounds.start(0, 0);
_root.gotoAndStop("tutor");
};
trophiesBTN.onPress = function () {
};
Frame 67
stop();
goBtn.onPress = function () {
_root.gotoAndPlay("goTime");
delete goBtn.onPress;
};
howToBtn.onPress = function () {
_root.gotoAndStop("tutor");
};
Frame 68
nextBtn.onPress = function () {
_root.nextFrame();
};
_root.backBtn._visible = false;
if (_root._currentframe == 68) {
_root.backBtn._visible = true;
}
backBtn.onPress = function () {
_root.prevFrame();
};
menuBtn.onPress = function () {
_root.gotoAndStop("mainStart");
};
Frame 104
_root.menuSounds.stop();
stop();
prefMenu.RHBTN.onPress = function () {
keyPref = {Right:39, Left:37, Up:38, Down:40, Fire:32};
_root.play();
};
prefMenu.LHBTN.onPress = function () {
keyPref = {Right:68, Left:65, Up:87, Down:83, Fire:32};
_root.play();
};
Frame 107
function addNum() {
if (dNum == undefined) {
dNum = 0;
}
return(dNum++);
}
function setUpStage() {
function create_Sky() {
_root.createEmptyMovieClip("Sky", layers.sky);
_root.Sky.attachMovie("skyAni1", "sky", 0);
_root.Sky.sky._x = 425;
_root.Sky.sky._y = 250;
}
function create_Sun() {
_root.createEmptyMovieClip("Sun", layers.sun);
_root.Sun.attachMovie("Burning Sun", "sun", 0);
_root.Sun.sun._xscale = 50;
_root.Sun.sun._yscale = 50;
_root.Sun.sun._x = 630;
_root.Sun.sun._y = 150;
}
function create_Island() {
_root.createEmptyMovieClip("Island", layers.island);
_root.Island.attachMovie("BGIsland1", "island", 0);
_root.Island.island._x = 1190;
_root.Island.island._y = 360;
}
function create_Fish() {
_root.createEmptyMovieClip("Fish", layers.fish);
}
function create_PowerOctopuss() {
_root.createEmptyMovieClip("PowerOctopuss", layers.PowerOctopuss);
}
function create_CannonGuy_body() {
_root.createEmptyMovieClip("CannonGuys", layers.CannonGuys);
}
function create_KnifeGuy_Knifes() {
_root.createEmptyMovieClip("KnifeGuy_Knifes", layers.KnifeGuy_Knife);
}
function create_ShotLaydee_Shots() {
_root.createEmptyMovieClip("ShotLaydee_Shots", layers.ShotLaydee_Shots);
}
function create_PieClown_Pies() {
_root.createEmptyMovieClip("PieClown_Pies", layers.PieClown_Pies);
}
function create_UnicyleClown_Puke() {
_root.createEmptyMovieClip("UnicycleClown_Puke", layers.UnicycleClown_Puke);
}
function create_TumorFreak_Hooks() {
_root.createEmptyMovieClip("TumorFreak_Hooks", layers.TumorFreak_Hooks);
}
function create_Baddies() {
_root.createEmptyMovieClip("Baddies", layers.baddies);
}
function create_Explosions() {
_root.createEmptyMovieClip("Explosions", layers.Explosions);
}
function create_FXBubbles() {
_root.createEmptyMovieClip("FXBubbles", layers.FXBubbles);
}
function create_FeatherEffect() {
_root.createEmptyMovieClip("FeatherEffect", layers.FeatherEffect);
}
function create_Boats() {
_root.createEmptyMovieClip("Boats", layers.boats);
}
function create_DeathShark() {
_root.createEmptyMovieClip("DeathShark", layers.DeathShark);
}
function create_AirMines() {
_root.createEmptyMovieClip("AirMines", layers.AirMines);
}
function create_SuperFireEffect() {
_root.createEmptyMovieClip("SuperFireEffect", layers.SuperFireEffect);
}
function create_ScoreBox() {
_root.createEmptyMovieClip("ScoreBox", layers.ScoreBox);
}
function create_Arsenal() {
_root.createEmptyMovieClip("Arsenal", layers.arsenal);
}
function create_ScoreBoard() {
_root.createEmptyMovieClip("ScoreBoard", layers.scoreBoard);
_root.ScoreBoard.createTextField("scoreBoard", 0, 0, 0, 30, 30);
_root.textFormat_score = new TextFormat();
_root.textFormat_score.size = 15;
_root.textFormat_score.font = "Papyrus";
_root.textFormat_score.bold = true;
_root.textFormat_score.color = "0xD50000";
ScoreBoard_score_glow = new flash.filters.GlowFilter(0, 50, 3, 3, 3, 3);
_root.ScoreBoard.scoreBoard.filters = [ScoreBoard_score_glow];
_root.ScoreBoard.scoreBoard.text = 0;
_root.ScoreBoard.scoreBoard.selectable = 0;
_root.ScoreBoard.scoreBoard.setTextFormat(_root.textFormat_score);
_root.ScoreBoard.scoreBoard._x = _root.Bird.bird._x;
_root.ScoreBoard.scoreBoard._y = _root.Bird.bird._y - _root.Bird.bird._height;
}
function create_Water() {
_root.createEmptyMovieClip("Water", layers.water);
_root.Water.attachMovie("waterLumpAni", "water", 0);
_root.Water.water._x = 584;
_root.Water.water._y = 440;
}
function create_SoundPanel() {
_root.createEmptyMovieClip("SoundPanel", layers.soundPanel);
_root.SoundPanel.attachMovie("Sound panel", "soundPanel", 0);
_root.SoundPanel.soundPanel._x = 786;
_root.SoundPanel.soundPanel._y = 30;
}
function create_HealthBar() {
_root.createEmptyMovieClip("HealthBar", layers.healthBar);
_root.HealthBar.attachMovie("Health meter", "healthBar", 0);
_root.HealthBar.healthBar._x = 40;
_root.HealthBar.healthBar._y = 35;
}
function create_AmmoDisplay() {
_root.createEmptyMovieClip("AmmoDisplay", layers.ammoDisplay);
_root.AmmoDisplay.attachMovie("HUD", "ammoDisplay", 0);
_root.AmmoDisplay.ammoDisplay._x = 700;
_root.AmmoDisplay.ammoDisplay._y = 500;
}
function create_Songs() {
_root.createEmptyMovieClip("Music", layers.music);
_root.Music.song = new Sound();
}
function create_ReadySetGo() {
_root.createEmptyMovieClip("ReadySetGo", layers.RSG);
_root.ReadySetGo.attachMovie("RSG", "readySetGo", 0);
_root.ReadySetGo.readySetGo._x = 425;
_root.ReadySetGo.readySetGo._y = 250;
_root.ReadySetGo.readySetGo.stop();
}
function create_ConsoleWindow() {
_root.createEmptyMovieClip("ConWin", layers.CW);
_root.ConWin.createTextField("con", 0, 10, 10, 300, 845);
_root.ConWin.con.format = new TextFormat();
_root.ConWin.con.format.color = 16777215 /* 0xFFFFFF */;
_root.ConWin.con.format.size = 18;
_root.ConWin.con.wordWrap = true;
_root.ConWin.con.selectable = false;
_root.ConWin.con.setTextFormat(_root.ConWin.con.format);
}
function create_PauseMenu() {
_root.createEmptyMovieClip("PauseMenu", layers.PauseMenu);
}
function create_FadeOutScreen() {
_root.createEmptyMovieClip("FadeOutScreen", layers.FadeOutScreen);
}
function create_DeathScene() {
_root.createEmptyMovieClip("DeathScene", layers.DeathScene);
}
function create_SFX() {
_root.createEmptyMovieClip("sound", layers.sound);
_root.createEmptyMovieClip("fireLoop", layers.fireLoop);
_root.createEmptyMovieClip("elecLoop", layers.elecLoop);
_root.createEmptyMovieClip("menuTheme", layers.menuTheme);
_root.menuTheme.menuTheme = new Sound();
_root.sound.sound = new Sound();
_root.fireLoop.fireLoop = new Sound();
_root.elecLoop.elecLoop = new Sound();
}
_root.create_Bird = function () {
_root.createEmptyMovieClip("Bird", layers.bird);
_root.Bird.attachMovie("BIRD_IDLE", "bird", 0);
_root.Bird.bird._x = -100;
_root.Bird.bird._y = 250;
_root.Bird.bird._xscale = 12;
_root.Bird.bird._yscale = 12;
};
create_Sky();
create_Sun();
create_Island();
create_Fish();
create_PowerOctopuss();
create_Boats();
create_SuperFireEffect();
create_Bird();
create_DeathShark();
create_Explosions();
create_AirMines();
create_ScoreBox();
create_CannonGuy_body();
create_KnifeGuy_Knifes();
create_ShotLaydee_Shots();
create_PieClown_Pies();
create_UnicyleClown_Puke();
create_TumorFreak_Hooks();
create_Baddies();
create_FXBubbles();
create_FeatherEffect();
create_Arsenal();
create_ScoreBoard();
create_Water();
create_SoundPanel();
create_HealthBar();
create_AmmoDisplay();
create_Songs();
create_ReadySetGo();
create_DeathScene();
create_ConsoleWindow();
create_FadeOutScreen();
create_PauseMenu();
create_SFX();
}
function toCon(inP) {
_root.ConWin.con.text = _root.ConWin.con.text + (((Math.floor(getTimer() / 1000) + " Second In: ") + inP) + newline);
_root.ConWin.con.setTextFormat(_root.ConWin.con.format);
}
function manage_VC() {
VCStats = {healthLow1:"in", tryAgain:"in", healthLow2:"in", newHighScore:"in", newPower:"in", outOfUltra:"in", readySetGo:"in"};
_root.catch_healthLow1 = function () {
if ((VCStats.healthLow1 == "in") && (birdStats.health < 30)) {
_root.AttachSoundFX("healthLow1");
VCStats.healthLow1 = "out";
} else if (birdStats.health > 30) {
VCStats.healthLow1 = "in";
}
};
_root.catch_tryAgain = function () {
if ((VCStats.tryAgain == "in") && (birdStats.dead)) {
_root.menuTheme.menuTheme.stop();
_root.sound.sound.stop();
_root.fireLoop.fireLoop.stop();
_root.elecLoop.elecLoop.stop();
_root.AttachSoundFX("tryAgain");
VCStats.tryAgain = "out";
} else if (!birdStats.dead) {
VCStats.tryAgain = "in";
}
};
_root.catch_healthLow2 = function () {
if ((VCStats.healthLow2 == "in") && (birdStats.health < 5)) {
_root.AttachSoundFX("healthLow2");
VCStats.healthLow2 = "out";
} else if (birdStats.health > 5) {
VCStats.healthLow2 = "in";
}
};
_root.catch_newHighScore = function () {
if (birdStats.score > birdStats.prevScore) {
_root.AttachSoundFX("readySetGo");
}
};
_root.catch_outOfUltra = function () {
if (((VCStats.outOfUltra == "in") && (!birdSuperTrip.TL)) && (powerOctopussStats.timesEaten)) {
_root.AttachSoundFX("outOfUltra");
VCStats.outOfUltra = "out";
} else if (birdSuperTrip.TL) {
VCStats.outOfUltra = "in";
}
};
_root.catch_readySetGo = function () {
if ((VCStats.readySetGo == "in") && (battleStats.waveNumber == 0)) {
_root.AttachSoundFX("readySetGo");
VCStats.readySetGo = "out";
} else if (battleStats.waveNumber) {
VCStats.readySetGo = "in";
}
};
}
function manage_Bird() {
function initiateVariables_bird() {
if (birdSpeeds == undefined) {
birdSpeeds = {rspd:0, lspd:0, dspd:0, uspd:0, xMomentum:0, yMomentum:0};
birdStats = {health:100, healthMax:100, precScore:0, score:0, highScore:0, currentForm:"BIRD_IDLE", formSwitch:"BIRD_IDLE", eatStage:0, timesDied:0, shotsFired:0, animated:true, presetSpd:10, dead:false, deathPhase:0};
birdBattle = {ammoTog:0, togKeyDown:0, ammoType:1, totalAmmoTypes:5, norm:20, normMax:20, rapi:40, rapiMax:40, fire:15, fireMax:15, elec:40, elecMax:40, home:8, homeMax:8, currentRR:8, maxRR:8};
if (keyPref == undefined) {
birdControlKeys = {Right:39, Left:37, Up:38, Down:40, Fire:32};
} else {
birdControlKeys = keyPref;
}
_root.bird_deathPhase = function () {
if (birdStats.health <= 0) {
birdStats.dead = true;
}
if (birdStats.dead) {
_root.catch_tryAgain();
pauseStats.globalPause = true;
targetBird._y = targetBird._y + birdSpeeds.yMomentum;
if (birdStats.deathPhase == 0) {
birdSpeeds.xMomentum = 0;
birdSpeeds.yMomentum = -10;
birdStats.deathPhase++;
}
if (birdStats.deathPhase == 1) {
if (birdSpeeds.yMomentum < 10) {
birdSpeeds.yMomentum = birdSpeeds.yMomentum + 1;
}
if (targetBird._y > 550) {
birdStats.deathPhase++;
}
}
if (birdStats.deathPhase == 2) {
_root.FadeOutScreen.lineStyle(0.25, 0, 100);
_root.FadeOutScreen.beginFill(0, 100);
_root.FadeOutScreen.lineTo(850, 0);
_root.FadeOutScreen.lineTo(850, 500);
_root.FadeOutScreen.lineTo(0, 500);
_root.FadeOutScreen.lineTo(0, 0);
_root.FadeOutScreen._alpha = 0;
birdStats.deathPhase++;
}
if (birdStats.deathPhase == 3) {
if (_root.FadeOutScreen._alpha < 100) {
_root.FadeOutScreen._alpha = _root.FadeOutScreen._alpha + 5;
} else {
_root.DeathScene.attachMovie("deathScreen", "deathScene", 0, {_x:425, _y:250});
_root.DeathScene.deathScene.RBTN.onPress = function () {
battleStats.waveDigit1 = 0;
battleStats.waveDigit2 = -1;
battleStats.waveNumber = -1;
sharkStats.isOut = false;
boatsStats.spawnBad = false;
boatsStats.boatsLeft = 0;
boatsStats.resetBoat = 1;
boatsStats.boatTrig = 0;
boatsStats.boatNum = 0;
_root.resetForNextRound();
_root.create_Bird();
birdStats.health = birdStats.healthMax;
birdStats.score = 0;
birdStats.currentForm = "BIRD_IDLE";
birdStats.eatStage = 0;
birdStats.animated = true;
birdStats.dead = false;
birdStats.deathPhase = 0;
birdStats.presetSpd = 8;
birdSuperTrip.TL = 0;
powerOctopussStats.timesEaten = 0;
birdSpeeds = {rspd:0, lspd:0, dspd:0, uspd:0, xMomentum:0, yMomentum:0};
birdBattle = {ammoTog:0, togKeyDown:0, ammoType:1, totalAmmoTypes:5, norm:20, normMax:20, rapi:40, rapiMax:40, fire:15, fireMax:15, elec:40, elecMax:40, home:8, homeMax:8, currentRR:8, maxRR:8};
birdBattle.togKeyDown = 0;
removeMovieClip(_root.DeathShark.shark1);
pauseStats.globalPause = false;
removeMovieClip(_root.DeathScene.deathScene);
battleStats.waveNumber = 0;
VCStats.readySetGo = "in";
Music.song.start(0, 99);
_root.catch_readySetGo();
};
_root.DeathScene.deathScene.MMBTN.onPress = function () {
_root.removeUselessVars();
_root.gotoAndPlay(1);
};
_root.DeathScene.deathScene.score = _root.birdStats.score;
birdStats.prevScore = birdStats.score;
if (birdStats.prevScore > birdStats.score) {
_root.catch_newHighScore();
birdStats.score = birdStats.highScore;
}
birdStats.deathPhase++;
}
}
if (birdStats.deathPhase == 4) {
if (_root.FadeOutScreen._alpha > 0) {
_root.FadeOutScreen._alpha = _root.FadeOutScreen._alpha - 10;
}
}
}
};
}
}
function control_bird() {
if (!birdStats.animated) {
targetBird._x = targetBird._x + ((birdSpeeds.rspd - birdSpeeds.lspd) + birdSpeeds.xMomentum);
targetBird._y = targetBird._y + ((birdSpeeds.dspd - birdSpeeds.uspd) + birdSpeeds.yMomentum);
if (birdSpeeds.xMomentum != 0) {
if (birdSpeeds.xMomentum > 0) {
birdSpeeds.xMomentum = birdSpeeds.xMomentum - 1;
} else {
birdSpeeds.xMomentum = birdSpeeds.xMomentum + 1;
}
}
if (birdSpeeds.yMomentum != 0) {
if (birdSpeeds.yMomentum > 0) {
birdSpeeds.yMomentum = birdSpeeds.yMomentum - 1;
} else {
birdSpeeds.yMomentum = birdSpeeds.yMomentum + 1;
}
}
if ((birdSpeeds.xMomentum < 2) && (birdSpeeds.xMomentum > -2)) {
birdSpeeds.xMomentum = 0;
}
if ((birdSpeeds.yMomentum < 2) && (birdSpeeds.yMomentum > -2)) {
birdSpeeds.yMomentum = 0;
}
if (Key.isDown(birdControlKeys.Right)) {
if (birdSpeeds.rspd < 10) {
birdSpeeds.rspd = birdSpeeds.rspd + 1;
}
} else if (birdSpeeds.rspd) {
birdSpeeds.rspd = birdSpeeds.rspd - 1;
}
if (Key.isDown(birdControlKeys.Left)) {
if (birdSpeeds.lspd < 10) {
birdSpeeds.lspd = birdSpeeds.lspd + 1;
}
} else if (birdSpeeds.lspd) {
birdSpeeds.lspd = birdSpeeds.lspd - 1;
}
if (Key.isDown(birdControlKeys.Up)) {
if (birdSpeeds.uspd < 10) {
birdSpeeds.uspd = birdSpeeds.uspd + 1;
}
} else if (birdSpeeds.uspd) {
birdSpeeds.uspd = birdSpeeds.uspd - 1;
}
if (Key.isDown(birdControlKeys.Down)) {
if (birdSpeeds.dspd < 10) {
birdSpeeds.dspd = birdSpeeds.dspd + 1;
}
} else if (birdSpeeds.dspd) {
birdSpeeds.dspd = birdSpeeds.dspd - 1;
}
if ((targetBird._x + 61) > 850) {
birdSpeeds.rspd = 0;
birdSpeeds.lspd = 0;
birdSpeeds.xMomentum = 0;
targetBird._x = targetBird._x - 1;
}
if ((targetBird._x - 61) < 0) {
birdSpeeds.rspd = 0;
birdSpeeds.lspd = 0;
birdSpeeds.xMomentum = 0;
targetBird._x = targetBird._x + 1;
}
if ((targetBird._y - 21) < 0) {
birdSpeeds.uspd = 0;
birdSpeeds.dspd = 0;
birdSpeeds.yMomentum = 0;
targetBird._y = targetBird._y + 1;
}
if ((targetBird._y + 21) > 460) {
birdSpeeds.uspd = 0;
birdSpeeds.dspd = 0;
birdSpeeds.yMomentum = 0;
targetBird._y = targetBird._y - 1;
}
}
}
function feed_bird() {
i = 0;
while (i < targetFish.length) {
if ((((targetBird._x + 20) > targetFish[i]._x) && ((targetBird._x - 10) < targetFish[i]._x)) && (targetBird._y > 430)) {
switch (targetFish[i].selType) {
case "norm" :
_root.birdBattle.norm = _root.birdBattle.normMax;
break;
case "rapi" :
_root.birdBattle.rapi = _root.birdBattle.rapiMax;
break;
case "fire" :
_root.birdBattle.fire = _root.birdBattle.fireMax;
break;
case "elec" :
_root.birdBattle.elec = _root.birdBattle.elecMax;
break;
case "home" :
_root.birdBattle.home = _root.birdBattle.homeMax;
break;
case "heal" :
_root.birdStats.health = _root.birdStats.health + 20;
if (_root.birdStats.health <= 110) {
break;
}
_root.birdStats.health = 110;
}
_root.AttachSoundFX("birdGulp_Sound");
removeMovieClip(targetFish[i]);
delete targetFish[i];
}
i++;
}
}
function preset_bird() {
if (birdStats.animated) {
targetBird = _root.Bird.bird;
if ((targetBird._x > 300) && (targetBird._x < 350)) {
birdStats.presetSpd = 8;
} else if ((targetBird._x > 350) && (targetBird._x < 430)) {
birdStats.presetSpd = 6;
} else if ((targetBird._x > 430) && (targetBird._x < 445)) {
birdStats.presetSpd = 2;
} else if ((targetBird._x > 445) && (targetBird._x < 450)) {
birdStats.animated = false;
}
targetBird._x = targetBird._x + birdStats.presetSpd;
}
}
function setMovieClip_bird() {
if (targetBird._y < 430) {
if (birdStats.eatStage == 2) {
birdStats.currentForm = "BIRD_OPEN_CLOSE";
if (targetBird._currentframe == targetBird._totalframes) {
birdStats.eatStage = 0;
}
} else if (Key.isDown(birdControlKeys.Right) || (Key.isDown(birdControlKeys.Up))) {
birdStats.currentForm = "BIRD_FLAP";
} else {
birdStats.currentForm = "BIRD_IDLE";
}
if (birdStats.formSwitch != birdStats.currentForm) {
repBirdX = targetBird._x;
repBirdY = targetBird._y;
if (targetBird._currentframe == targetBird._totalframes) {
_root.Bird.attachMovie(birdStats.currentForm, "bird", 0);
birdStats.formSwitch = birdStats.currentForm;
}
_root.Bird.bird._xscale = 12;
_root.Bird.bird._yscale = 12;
targetBird._x = repBirdX;
targetBird._y = repBirdY;
}
} else {
if (birdStats.formSwitch != birdStats.currentForm) {
repBirdX = targetBird._x;
repBirdY = targetBird._y;
_root.Bird.attachMovie(birdStats.currentForm, "bird", 0);
birdStats.formSwitch = birdStats.currentForm;
_root.Bird.bird._xscale = 12;
_root.Bird.bird._yscale = 12;
targetBird._x = repBirdX;
targetBird._y = repBirdY;
}
if (targetBird._currentframe == targetBird._totalframes) {
if (birdStats.eatStage == 1) {
birdStats.currentForm = "BIRD_OPEN_FULL";
birdStats.eatStage = 2;
}
if (birdStats.eatStage == 0) {
birdStats.currentForm = "BIRD_OPEN";
birdStats.eatStage = 1;
}
}
}
}
function manage_birdFeathers() {
if (featherStats == undefined) {
featherStats = {onStage:[], num:0};
}
var _local1 = 0;
while (_local1 < featherStats.onStage.length) {
if (featherStats.onStage[_local1]._currentframe == featherStats.onStage[_local1]._totalframes) {
removeMovieClip(featherStats.onStage[_local1]);
}
_local1++;
}
}
_root.catch_healthLow1();
_root.catch_healthLow2();
_root.applyMomentum = function (xMomentum, yMomentum) {
birdSpeeds.xMomentum = birdSpeeds.xMomentum + xMomentum;
birdSpeeds.yMomentum = birdSpeeds.yMomentum + yMomentum;
};
_root.hurtBird = function (damage, attacker) {
if (birdStats.health <= 0) {
birdStats.dead = true;
} else if (birdBattle.currentRR >= birdBattle.maxRR) {
createFXBubble(1, targetBird, damage);
_root.FeatherEffect.attachMovie("birdDamageEffect", "featherEffect" + featherStats.num, featherStats.num, {_x:targetBird._x, _xscale:20, _y:targetBird._y, _yscale:20});
featherStats.onStage.push(_root.FeatherEffect["featherEffect" + featherStats.num]);
featherStats.num++;
birdStats.health = birdStats.health - damage;
birdBattle.currentRR = 0;
_root.AttachSoundFX("playerHurt_Sound");
}
};
_root.birdRecover = function () {
if (birdBattle.currentRR < birdBattle.maxRR) {
birdBattle.currentRR++;
}
};
initiateVariables_bird();
if (!birdStats.dead) {
control_bird();
}
feed_bird();
preset_bird();
manage_birdFeathers();
_root.birdRecover();
setMovieClip_bird();
}
function manage_Arsenal() {
function initiateVaraibles_arsenal() {
if (arsenalStats == undefined) {
arsenalStats = {shotNum:0, shotsOnStage:[], homingOnStage:[], setDela:8, repDela:8, normDela:8, rapiDela:4, fireDela:10, elecDela:1, homeDela:20};
arsenalTweaks = {rotateRan:[-25, 0, 25], ranNum:0, elecDistort:[-10, -5, 0, 5, 10]};
AmmoModifiers = {norm:1.5, rapi:2.2, fire:3, elec:4, home:8};
birdSuperTrip = {TL:0, StandardEffect:20, rapidEffect:2, fireEffect:0, electricEffect:3, homingEffect:3, iterNum:1, TTtrans:2, firePlaying:false};
superFire_FX = {phase:0, removeTL:5};
elecGlow1 = new flash.filters.GlowFilter(5609983, 5, 3, 3, 5, 1);
colorTarg1 = new Color(targetBird);
colorTrans1 = new Object();
_root.create_homingMissile = function (version, target) {
_root.Arsenal.attachMovie("HOMING_SHOT", "homeShot" + arsenalStats.shotNum, arsenalStats.shotNum);
arsenalStats.homingOnStage.push(_root.Arsenal["homeShot" + arsenalStats.shotNum]);
_root.Arsenal["homeShot" + arsenalStats.shotNum]._x = targetBird._x - 10;
_root.Arsenal["homeShot" + arsenalStats.shotNum]._y = targetBird._y;
_root.Arsenal["homeShot" + arsenalStats.shotNum].setSpdY = 8;
_root.Arsenal["homeShot" + arsenalStats.shotNum].setSpdX = 2;
_root.Arsenal["homeShot" + arsenalStats.shotNum]._xscale = _root.Arsenal["homeShot" + arsenalStats.shotNum]._xscale - 50;
_root.Arsenal["homeShot" + arsenalStats.shotNum]._yscale = _root.Arsenal["homeShot" + arsenalStats.shotNum]._yscale - 50;
_root.Arsenal["homeShot" + arsenalStats.shotNum].damage = AmmoModifiers.home;
_root.Arsenal["homeShot" + arsenalStats.shotNum].version = version;
_root.Arsenal["homeShot" + arsenalStats.shotNum].targ = target;
_root.Arsenal["homeShot" + arsenalStats.shotNum].setType = "Homing";
_root.AmmoGroups.BirdShots.push(_root.Arsenal["homeShot" + arsenalStats.shotNum]);
birdBattle.home = birdBattle.home - 1;
};
}
}
function superTripMode() {
function manage_timerClip() {
if (birdSuperTrip.TL) {
if (_root.Bird.timerClip == undefined) {
_root.Bird.attachMovie("timerClip", "timerClip", 1, {_xscale:50, _yscale:50, _alpha:70});
}
_root.Bird.timerClip._x = _root.Bird.bird._x;
_root.Bird.timerClip._y = _root.Bird.bird._y - 60;
} else {
_root.catch_outOfUltra();
removeMovieClip(_root.Bird.timerClip);
}
}
function create_super_fireAttackClips() {
if (superFire_FX.phase == 0) {
superFire_FX.removeTL = 5;
if (_root.SuperFireEffect.fireTarget1 == undefined) {
_root.SuperFireEffect.attachMovie("superFire_1", "fireTarget1", 1);
_root.SuperFireEffect.fireTarget1._xscale = 1;
}
_root.SuperFireEffect.fireTarget1._x = targetBird._x - 15;
_root.SuperFireEffect.fireTarget1._y = targetBird._y;
_root.SuperFireEffect.fireTarget1._yscale = 18;
if (_root.SuperFireEffect.fireTarget1._currentframe == _root.SuperFireEffect.fireTarget1._totalframes) {
superFire_FX.phase = 0.3;
} else {
_root.SuperFireEffect.fireTarget1._xscale = _root.SuperFireEffect.fireTarget1._xscale + 3.8;
}
} else if (superFire_FX.phase == 0.3) {
if (_root.SuperFireEffect.fireTarget2 == undefined) {
_root.SuperFireEffect.attachMovie("superFire_2", "fireTarget2", 1);
}
_root.SuperFireEffect.fireTarget2._x = targetBird._x - 15;
_root.SuperFireEffect.fireTarget2._y = targetBird._y;
_root.SuperFireEffect.fireTarget2._xscale = 18;
i = 0;
while (i < 600) {
if ((_root.SuperFireEffect.fireTarget2._height + targetBird._y) < 440) {
_root.SuperFireEffect.fireTarget2._height = _root.SuperFireEffect.fireTarget2._height + 1;
} else {
_root.SuperFireEffect.fireTarget2._height = _root.SuperFireEffect.fireTarget2._height - 1;
}
i++;
}
}
}
function remove_super_fireAttackClips() {
if ((_root.SuperFireEffect.fireTarget3 == undefined) && (_root.SuperFireEffect.fireTarget2 != undefined)) {
_root.SuperFireEffect.attachMovie("superFire_3", "fireTarget3", 1);
_root.SuperFireEffect.fireTarget3._x = targetBird._x - 15;
_root.SuperFireEffect.fireTarget3._y = targetBird._y;
_root.SuperFireEffect.fireTarget3._xscale = 18;
_root.SuperFireEffect.fireTarget3._yscale = 18;
}
if (_root.SuperFireEffect.fireTarget3._currentframe == _root.SuperFireEffect.fireTarget3._totalframes) {
_root.SuperFireEffect.fireTarget3.stop();
_root.SuperFireEffect.fireTarget3._visible = false;
} else {
_root.SuperFireEffect.fireTarget3._xscale = _root.SuperFireEffect.fireTarget3._xscale - 3;
}
}
function modifyAttacks() {
function super_Standard() {
AmmoModifiers.norm = 20;
}
function super_Rapid() {
AmmoModifiers.rapi = 4;
arsenalStats.rapiDela = 2;
}
function super_Fire() {
if (Key.isDown(birdControlKeys.Fire)) {
create_super_fireAttackClips();
if (!birdSuperTrip.firePlaying) {
trace(0);
_root.fireLoop.fireloop.attachSound("fireLoop_Sound");
_root.fireLoop.fireloop.start(0, 0);
_root.fireLoop.fireLoop.onSoundComplete = function () {
birdSuperTrip.firePlaying = false;
};
birdSuperTrip.firePlaying = true;
}
i = 0;
while (i < BaddieGroups.BA.length) {
if ((((targetBird._x < (BaddieGroups.BA[i]._x + 50)) && (targetBird._x > (BaddieGroups.BA[i]._x - 50))) && (BaddieGroups.BA[i].health != "INFINITE")) && (BaddieGroups.BA[i].health > 0)) {
if (BaddieGroups.BA[i].delaTime == undefined) {
BaddieGroups.BA[i].delaTime = 0;
}
if (BaddieGroups.BA[i].delaTime <= 0) {
createFXBubble(1, BaddieGroups.BA[i], AmmoModifiers.fire);
BaddieGroups.BA[i].delaTime = 8;
} else {
BaddieGroups.BA[i].delaTime = BaddieGroups.BA[i].delaTime - 1;
}
BaddieGroups.BA[i].health = BaddieGroups.BA[i].health - AmmoModifiers.fire;
if (BaddieGroups.BA[B].health <= 0) {
BaddieGroups.BA[i].pattern = "dead";
}
burnEffect = {ra:BaddieGroups.BA[i].burn, rb:0, ga:BaddieGroups.BA[i].burn, gb:0, ba:BaddieGroups.BA[i].burn, bb:0, aa:100, ab:0};
BaddieGroups.BA[i].burn = BaddieGroups.BA[i].burn - 5;
burnTarget.setTransform(burnEffect);
if (!BaddieGroups.BA[i].health) {
BaddieGroups.BA[i].pattern = "dead";
}
break;
}
i++;
}
} else {
remove_super_fireAttackClips();
}
}
function super_Electric() {
AmmoModifiers.elec = 4;
}
function super_Homing() {
AmmoModifiers.home = 10;
}
if (!battleStats.peaceTimer) {
if (((birdBattle.ammoType == 1) && (birdBattle.norm)) && (birdSuperTrip.TL)) {
super_Standard();
}
if (((birdBattle.ammoType == 2) && (birdBattle.rapi)) && (birdSuperTrip.TL)) {
super_Rapid();
}
if (((birdBattle.ammoType == 3) && (birdBattle.fire)) && (birdSuperTrip.TL)) {
super_Fire();
} else {
remove_super_fireAttackClips();
}
if (((birdBattle.ammoType == 4) && (birdBattle.elec)) && (birdSuperTrip.TL)) {
super_Electric();
}
if (((birdBattle.ammoType == 5) && (birdBattle.home)) && (birdSuperTrip.TL)) {
super_Homing();
}
} else {
AmmoModifiers = {norm:1.5, rapi:2.2, fire:3, elec:4, home:8};
arsenalStats.rapiDela = 4;
}
}
function birdFlash() {
if (birdSuperTrip.TL) {
if (birdSuperTrip.iterNum) {
colorTrans1 = {ra:0, rb:0, ga:0, gb:0, ba:100, bb:0, aa:100, ab:0};
} else {
colorTrans1 = {ra:100, rb:0, ga:0, gb:0, ba:0, bb:0, aa:100, ab:0};
}
if (birdSuperTrip.TTtrans) {
birdSuperTrip.TTtrans = birdSuperTrip.TTtrans - 1;
} else {
if (birdSuperTrip.iterNum) {
birdSuperTrip.iterNum = 0;
} else {
birdSuperTrip.iterNum = 1;
}
birdSuperTrip.TTtrans = 2;
}
birdSuperTrip.TL = birdSuperTrip.TL - 1;
} else {
colorTrans1 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
}
colorTarg1.setTransform(colorTrans1);
}
manage_timerClip();
modifyAttacks();
birdFlash();
}
function create_bullets() {
if (!_root.arsenalStats.setDela) {
if (Key.isDown(birdControlKeys.Fire) && (!battleStats.peaceTimer)) {
switch (birdBattle.ammoType) {
case 1 :
demoSelAmmo = birdBattle.norm;
break;
case 2 :
demoSelAmmo = birdBattle.rapi;
break;
case 3 :
demoSelAmmo = birdBattle.fire;
break;
case 4 :
demoSelAmmo = birdBattle.elec;
break;
case 5 :
demoSelAmmo = birdBattle.home;
}
switch (birdBattle.ammoType) {
case 1 :
if (birdBattle.norm > 0) {
_root.Arsenal.attachMovie("NORMAL_SHOT", "normShot" + arsenalStats.shotNum, arsenalStats.shotNum);
arsenalStats.shotsOnStage.push(_root.Arsenal["normShot" + arsenalStats.shotNum]);
_root.Arsenal["normShot" + arsenalStats.shotNum]._x = targetBird._x;
_root.Arsenal["normShot" + arsenalStats.shotNum]._y = targetBird._y;
_root.Arsenal["normShot" + arsenalStats.shotNum]._xscale = 50;
_root.Arsenal["normShot" + arsenalStats.shotNum]._yscale = 50;
_root.Arsenal["normShot" + arsenalStats.shotNum].setSpdY = 6;
_root.Arsenal["normShot" + arsenalStats.shotNum].setSpdX = 3;
_root.Arsenal["normShot" + arsenalStats.shotNum].damage = AmmoModifiers.norm;
_root.Arsenal["normShot" + arsenalStats.shotNum].setType = "Normal";
_root.AmmoGroups.BirdShots.push(_root.Arsenal["normShot" + arsenalStats.shotNum]);
birdBattle.norm = birdBattle.norm - 1;
}
break;
case 2 :
if (birdBattle.rapi > 0) {
_root.Arsenal.attachMovie("NORMAL_SHOT", "rapiShot" + arsenalStats.shotNum, arsenalStats.shotNum);
arsenalStats.shotsOnStage.push(_root.Arsenal["rapiShot" + arsenalStats.shotNum]);
_root.Arsenal["rapiShot" + arsenalStats.shotNum]._x = targetBird._x;
_root.Arsenal["rapiShot" + arsenalStats.shotNum]._y = targetBird._y;
_root.Arsenal["rapiShot" + arsenalStats.shotNum]._xscale = 50;
_root.Arsenal["rapiShot" + arsenalStats.shotNum]._yscale = 50;
_root.Arsenal["rapiShot" + arsenalStats.shotNum].setSpdY = 12;
_root.Arsenal["rapiShot" + arsenalStats.shotNum].setSpdX = 0;
_root.Arsenal["rapiShot" + arsenalStats.shotNum].damage = AmmoModifiers.rapi;
_root.Arsenal["rapiShot" + arsenalStats.shotNum].setType = "Rapid";
_root.AmmoGroups.BirdShots.push(_root.Arsenal["rapiShot" + arsenalStats.shotNum]);
birdBattle.rapi = birdBattle.rapi - 1;
}
break;
case 3 :
if ((birdBattle.fire > 0) && (!birdSuperTrip.TL)) {
_root.Arsenal.attachMovie("FIRE_SHOT", "fireShot" + arsenalStats.shotNum, arsenalStats.shotNum);
arsenalStats.shotsOnStage.push(_root.Arsenal["fireShot" + arsenalStats.shotNum]);
_root.Arsenal["fireShot" + arsenalStats.shotNum]._x = targetBird._x;
_root.Arsenal["fireShot" + arsenalStats.shotNum]._y = targetBird._y;
_root.Arsenal["fireShot" + arsenalStats.shotNum]._xscale = 25;
_root.Arsenal["fireShot" + arsenalStats.shotNum]._yscale = 25;
_root.Arsenal["fireShot" + arsenalStats.shotNum].setSpdY = 10;
_root.Arsenal["fireShot" + arsenalStats.shotNum].damage = AmmoModifiers.fire;
_root.Arsenal["fireShot" + arsenalStats.shotNum].setType = "Fire";
_root.AmmoGroups.BirdShots.push(_root.Arsenal["fireShot" + arsenalStats.shotNum]);
birdBattle.fire = birdBattle.fire - 1;
}
break;
case 4 :
if (birdBattle.elec > 0) {
birdBattle.elec = birdBattle.elec - 1;
}
break;
case 5 :
if (birdBattle.home <= 0) {
break;
}
_root.AttachSoundFX("fireMissile_Sound");
if (!birdSuperTrip.TL) {
_root.create_homingMissile(0, undefined);
} else {
k = 0;
for(;;){
if (k >= BaddieGroups.BA.length) {
break;
}
if (BaddieGroups.BA[k].pattern != "NO_LONGER_ACTIVE") {
_root.create_homingMissile(1, BaddieGroups.BA[k]);
}
if (BaddieGroups.BA[k + 1].pattern != "NO_LONGER_ACTIVE") {
arsenalStats.shotNum++;
_root.create_homingMissile(1, BaddieGroups.BA[k + 1]);
}
if (BaddieGroups.BA[k + 2].pattern != "NO_LONGER_ACTIVE") {
arsenalStats.shotNum++;
_root.create_homingMissile(1, BaddieGroups.BA[k + 2]);
break;
}
k++;
};
}
}
if (demoSelAmmo) {
_root.arsenalStats.setDela = _root.arsenalStats.repDela;
if (arsenalStats.shotsOnStage[arsenalStats.shotNum].setSpdY == 12) {
arsenalTweaks.ranNum = random(3);
arsenalStats.shotsOnStage[arsenalStats.shotNum]._rotation = arsenalStats.shotsOnStage[arsenalStats.shotNum]._rotation + (arsenalTweaks.rotateRan[arsenalTweaks.ranNum] - 120);
_root.Arsenal["rapiShot" + arsenalStats.shotNum].setSpdX = arsenalTweaks.rotateRan[arsenalTweaks.ranNum] / 10;
}
}
if ((demoSelAmmo && (!((birdBattle.ammoType == 3) && (birdSuperTrip.TL)))) && (birdBattle.ammoType != 4)) {
_root.AttachSoundFX(("poop" + random(2)) + "_Sound", 0);
arsenalStats.shotNum++;
}
} else {
superElecStats = {LB1:random(850), LB2:random(850), LB3:random(850)};
}
} else {
_root.arsenalStats.setDela = _root.arsenalStats.setDela - 1;
}
}
function move_bullets() {
function manage_electric() {
_root.Arsenal.createEmptyMovieClip("electric", -1);
_root.Arsenal.createEmptyMovieClip("lightning1", -2);
_root.Arsenal.createEmptyMovieClip("lightning2", -3);
_root.Arsenal.createEmptyMovieClip("lightning3", -4);
nickNamElec = _root.Arsenal.electric;
nickNamElec.moveTo(targetBird._x - 20, targetBird._y);
nickNamElec.lineStyle(4.2, 2851071, 80);
nickNamElec.filters = [elecGlow1];
_root.Arsenal.lightning1.lineStyle(4.2, 2851071, 80);
_root.Arsenal.lightning1.filters = [elecGlow1];
_root.Arsenal.lightning2.lineStyle(4.2, 2851071, 80);
_root.Arsenal.lightning2.filters = [elecGlow1];
_root.Arsenal.lightning3.lineStyle(4.2, 2851071, 80);
_root.Arsenal.lightning3.filters = [elecGlow1];
if (superElecStats == undefined) {
superElecStats = {LB1:random(850), LB2:random(850), LB3:random(850), keyIsDown:false};
}
if ((Key.isDown(birdControlKeys.Fire) && (birdBattle.elec)) && (birdBattle.ammoType == 4)) {
if (!superElecStats.keyIsDown) {
_root.elecLoop.elecLoop.attachSound("electricLoop_Sound");
_root.elecLoop.elecLoop.setVolume(40);
_root.elecLoop.elecLoop.start(0, 0);
_root.elecLoop.elecLoop.onSoundComplete = function () {
superElecStats.keyIsDown = false;
};
superElecStats.keyIsDown = true;
}
if (!birdSuperTrip.TL) {
nickNamElec.moveTo(targetBird._x - 20, targetBird._y);
i = 1;
while (i < 25) {
nickNamElec.lineTo((targetBird._x + arsenalTweaks.elecDistort[random(5)]) - 20, targetBird._y + (i * 20));
i++;
}
} else {
_root.Arsenal.lightning1.moveTo((superElecStats.LB1 + arsenalTweaks.elecDistort[random(5)]) - 20, 0);
_root.Arsenal.lightning3.moveTo((superElecStats.LB3 + arsenalTweaks.elecDistort[random(5)]) - 20, 0);
_root.Arsenal.lightning2.moveTo((superElecStats.LB2 + arsenalTweaks.elecDistort[random(5)]) - 20, 0);
i = 1;
while (i < 25) {
_root.Arsenal.lightning1.lineTo((superElecStats.LB1 + arsenalTweaks.elecDistort[random(5)]) - 20, i * 20);
_root.Arsenal.lightning2.lineTo((superElecStats.LB2 + arsenalTweaks.elecDistort[random(5)]) - 20, i * 20);
_root.Arsenal.lightning3.lineTo((superElecStats.LB3 + arsenalTweaks.elecDistort[random(5)]) - 20, i * 20);
i++;
}
}
B = 0;
while (B < BaddieGroups.BA.length) {
if (!birdSuperTrip.TL) {
if (((targetBird._x + 50) > BaddieGroups.BA[B]._x) && ((targetBird._x - 50) < BaddieGroups.BA[B]._x)) {
if ((BaddieGroups.BA[B].pattern != "dead") && (BaddieGroups.BA[B].health != "INFINITE")) {
_root.birdStats.score = _root.birdStats.score + 10;
BaddieGroups.BA[B].health = BaddieGroups.BA[B].health - AmmoModifiers.elec;
createFXBubble(1, BaddieGroups.BA[B], AmmoModifiers.elec);
if (BaddieGroups.BA[B].health < 0) {
BaddieGroups.BA[B].pattern = "dead";
}
break;
}
}
} else if ((BaddieGroups.BA[B].hitTest(superElecStats.LB1, BaddieGroups.BA[B]._y, 1) || (BaddieGroups.BA[B].hitTest(superElecStats.LB2, BaddieGroups.BA[B]._y, 1))) || (BaddieGroups.BA[B].hitTest(superElecStats.LB3, BaddieGroups.BA[B]._y, 1))) {
if ((BaddieGroups.BA[B].pattern != "dead") && (BaddieGroups.BA[B].health != "INFINITE")) {
_root.birdStats.score = _root.birdStats.score + 10;
BaddieGroups.BA[B].health = BaddieGroups.BA[B].health - AmmoModifiers.elec;
createFXBubble(1, BaddieGroups.BA[B], AmmoModifiers.elec);
if (BaddieGroups.BA[B].health < 0) {
BaddieGroups.BA[B].pattern = "dead";
}
break;
}
}
B++;
}
}
}
function manage_homing() {
i = 0;
while (i < arsenalStats.homingOnStage.length) {
targetMissle = arsenalStats.homingOnStage[i];
if (targetMissle.targ == undefined) {
B = 0;
while (B < BaddieGroups.BA.length) {
if (((targetMissle._x + 150) > BaddieGroups.BA[B]._x) && ((targetMissle._x - 150) < BaddieGroups.BA[B]._x)) {
if ((BaddieGroups.BA[B].pattern != "dead") && (BaddieGroups.BA[B].pattern != "NO_LONGER_ACTIVE")) {
targetMissle.targ = BaddieGroups.BA[B];
}
}
B++;
}
targetMissle._y = targetMissle._y + targetMissle.setSpdY;
targetMissle._rotation = 180;
} else {
targetMissle.xd = targetMissle._x - targetMissle.targ._x;
targetMissle.yd = targetMissle._y - targetMissle.targ._y;
targetMissle.d = Math.atan2(targetMissle.yd, targetMissle.xd);
targetMissle._rotation = (targetMissle.d * 60) - 90;
targetMissle.dx = targetMissle.targ - targetMissle._x;
targetMissle.dy = targetMissle.targ - targetMissle._y;
targetMissle.d = Math.atan2(ty, tx);
targetMissle._rotation = (txy * 60) + 90;
targetMissle._y = targetMissle._y - (8 * Math.cos(0.016 * targetMissle._rotation));
targetMissle._x = targetMissle._x + (8 * Math.sin(0.016 * targetMissle._rotation));
if (((Math.abs(targetMissle._x - _root.targetMissle.targ._x) < 10) && (Math.abs(targetMissle._x - _root.targetMissle.targ._x) < 10)) && (Math.abs(targetMissle._y - _root.targetMissle.targ._y) < 10)) {
_root.AttachSoundFX("missileExplode_Sound");
removeMovieClip(targetMissle);
delete targetMissle;
}
if (BaddieGroups.BA[B].pattern == "dead") {
i = 0;
while (i < BaddieGroups.BA.length) {
if (BaddieGroups.BA[B].pattern != "dead") {
targetMissle.xDist = targetMissle._x - BaddieGroups.BA[B]._x;
targetMissle.yDist = targetMissle._y - BaddieGroups.BA[B]._y;
targetMissle.sqrtDist = Math.sqrt((targetMissle.xDist * targetMissle.xDist) + (targetMissle.yDist * targetMissle.yDist));
if (targetMissle.sqrtDist < 900) {
targetMissle.targ = BaddieGroups.BA[i];
break;
}
removeMovieClip(targetMissle);
delete targetMissle;
}
i++;
}
}
}
i++;
}
}
function manage_standard() {
i = 0;
while (i < arsenalStats.shotsOnStage.length) {
arsenalStats.shotsOnStage[i]._y = arsenalStats.shotsOnStage[i]._y + arsenalStats.shotsOnStage[i].setSpdY;
arsenalStats.shotsOnStage[i]._x = arsenalStats.shotsOnStage[i]._x - arsenalStats.shotsOnStage[i].setSpdX;
i++;
}
}
manage_electric();
manage_homing();
manage_standard();
superTripMode();
}
function remove_bullets() {
i = 0;
while (i < arsenalStats.shotsOnStage.length) {
if (arsenalStats.shotsOnStage[i]._y >= 530) {
removeMovieClip(arsenalStats.shotsOnStage[i]);
delete arsenalStats.shotsOnStage[i];
}
i++;
}
i = 0;
while (i < arsenalStats.homingOnStage.length) {
if (arsenalStats.homingOnStage[i]._y >= 530) {
removeMovieClip(arsenalStats.homingOnStage[i]);
delete arsenalStats.homingOnStage[i];
}
i++;
}
}
initiateVaraibles_arsenal();
create_bullets();
move_bullets();
remove_bullets();
}
function manage_AmmoDisplay() {
function toggleAmmoType() {
if ((((Key.isDown(67) && (!birdBattle.togKeyDown)) && (!battleStats.peaceTimer)) && (!birdStats.dead)) && (!pauseStats.globalPause)) {
if (birdBattle.ammoType < birdBattle.totalAmmoTypes) {
birdBattle.ammoType++;
} else {
birdBattle.ammoType = 1;
}
switch (birdBattle.ammoType) {
case 1 :
_root.toNormalAmmo();
break;
case 2 :
_root.toRapidAmmo();
break;
case 3 :
_root.toFireAmmo();
break;
case 4 :
_root.toElectricAmmo();
break;
case 5 :
_root.toHomingAmmo();
}
birdBattle.ammoTog = 1;
birdBattle.togKeyDown = 1;
} else if ((!Key.isDown(67)) && (birdBattle.togKeyDown)) {
birdBattle.togKeyDown = 0;
}
}
function initiateVariables_ammoDisplay() {
if (ammoDisplayStats == undefined) {
ammoDisplayStats = {position:"DOWN", moveTimer:120};
amPos = ammoDisplayStats.position;
amTimer = ammoDisplayStats.moveTimer;
targetDis = _root.AmmoDisplay.ammoDisplay;
maskTint = new Color(_root.AmmoDisplay.ammoDisplay.colorMask);
maskTint.setRGB(5592405);
_root.toRapidAmmo = function () {
amPos = "UP";
birdBattle.ammoType = 2;
maskTint.setRGB(58926);
if (_root.AmmoDisplay.ammoDisplay.ammoType != "Rapid") {
_root.AttachSoundFX("rapidSwitch_Sound", 0);
}
_root.AmmoDisplay.ammoDisplay.ammoType = "Rapid";
_root.arsenalStats.setDela = _root.arsenalStats.rapiDela;
_root.arsenalStats.repDela = _root.arsenalStats.setDela;
};
timerReset = 40;
_root.toNormalAmmo = function () {
amPos = "UP";
birdBattle.ammoType = 1;
maskTint.setRGB(5592405);
if (_root.AmmoDisplay.ammoDisplay.ammoType != "Stink Shot") {
_root.AttachSoundFX("normalSwitch_Sound", 0);
}
_root.AmmoDisplay.ammoDisplay.ammoType = "Stink Shot";
_root.arsenalStats.setDela = _root.arsenalStats.normDela;
_root.arsenalStats.repDela = _root.arsenalStats.setDela;
};
_root.toFireAmmo = function () {
amPos = "UP";
birdBattle.ammoType = 3;
if (_root.AmmoDisplay.ammoDisplay.ammoType != "BERNING") {
_root.AttachSoundFX("fireSwitch_Sound", 0);
}
maskTint.setRGB(15073280);
_root.AmmoDisplay.ammoDisplay.ammoType = "BERNING";
_root.arsenalStats.setDela = _root.arsenalStats.fireDela;
_root.arsenalStats.repDela = _root.arsenalStats.setDela;
};
_root.toElectricAmmo = function () {
amPos = "UP";
birdBattle.ammoType = 4;
maskTint.setRGB(6118);
if (_root.AmmoDisplay.ammoDisplay.ammoType != "Electric") {
if (birdSuperTrip.TL) {
_root.AttachSoundFX("switchSuperLightning_Sound");
} else {
_root.AttachSoundFX("switchElectric_Sound");
}
}
_root.AmmoDisplay.ammoDisplay.ammoType = "Electric";
_root.arsenalStats.setDela = _root.arsenalStats.elecDela;
_root.arsenalStats.repDela = _root.arsenalStats.setDela;
};
_root.toHomingAmmo = function () {
amPos = "UP";
birdBattle.ammoType = 5;
maskTint.setRGB(10830145);
if (_root.AmmoDisplay.ammoDisplay.ammoType != "Homing") {
_root.AttachSoundFX("homingSwitch_Sound", 0);
}
_root.AmmoDisplay.ammoDisplay.ammoType = "Homing";
_root.arsenalStats.setDela = _root.arsenalStats.homeDela;
_root.arsenalStats.repDela = _root.arsenalStats.setDela;
};
}
}
function move_ammoDisplay() {
if ((amPos == "DOWN") && (!amTimer)) {
if (targetDis._y < 550) {
targetDis._y = targetDis._y + 5;
}
} else {
amTimer = amTimer - 1;
}
if (amPos == "UP") {
if (targetDis._y > 500) {
targetDis._y = targetDis._y - 5;
} else {
amTimer = timerReset;
amPos = "DOWN";
}
}
}
function changeType_ammoDisplay() {
if (Key.isDown(49)) {
_root.toNormalAmmo();
} else if (Key.isDown(50)) {
_root.toRapidAmmo();
} else if (Key.isDown(51)) {
_root.toFireAmmo();
} else if (Key.isDown(52)) {
_root.toElectricAmmo();
} else if (Key.isDown(53)) {
_root.toHomingAmmo();
}
birdBattle.ammoTog = 0;
powerBar = _root.AmmoDisplay.ammoDisplay.powerBar;
switch (birdBattle.ammoType) {
case 1 :
powerBar._xscale = (_root.birdBattle.norm / _root.birdBattle.normMax) * 100;
break;
case 2 :
powerBar._xscale = (_root.birdBattle.rapi / _root.birdBattle.rapiMax) * 100;
break;
case 3 :
powerBar._xscale = (_root.birdBattle.fire / _root.birdBattle.fireMax) * 100;
break;
case 4 :
powerBar._xscale = (_root.birdBattle.elec / _root.birdBattle.elecMax) * 100;
break;
case 5 :
powerBar._xscale = (_root.birdBattle.home / _root.birdBattle.homeMax) * 100;
}
}
initiateVariables_ammoDisplay();
toggleAmmoType();
move_ammoDisplay();
changeType_ammoDisplay();
}
function manage_HealthBar() {
_root.HealthBar.healthBar.health = (birdStats.health / birdStats.healthMax) * 100;
if (!birdStats.health) {
birdStats.dead = true;
}
}
function manage_SoundPanel() {
function intitiateVariables_soundPanel() {
if (songStats == undefined) {
songStats = {songPlaying:0.5, isPlaying:0, secondsIn:0, selectedSong:0, songLibrary:["song_Fish", "song_CouldBe"]};
_root.Music.song.attachSound("song_Fish");
Music.song.start(songStats.secondsIn, 0);
}
}
function playSongs() {
if (songStats.isPlaying == 0.5) {
Music.song.stop();
songStats.isPlaying = 1;
_root.Music.song.attachSound(songStats.songLibrary[songStats.selectedSong]);
Music.song.start(0, 0);
}
}
if (!pauseStats.globalPause) {
songStats.secondsIn = songStats.secondsIn + 0.025;
}
_root.Music.song.onSoundComplete = function () {
songStats.isPlaying = 0.5;
songStats.secondsIn = 0;
_root.Music.song.attachSound(songStats.songLibrary[songStats.selectedSong]);
};
_root.SoundPanel.soundPanel.song1Btn.onPress = function () {
songStats.selectedSong = 0;
songStats.isPlaying = 0.5;
};
_root.SoundPanel.soundPanel.song2Btn.onPress = function () {
songStats.selectedSong = 1;
songStats.isPlaying = 0.5;
};
_root.SoundPanel.soundPanel.songXBtn.onPress = function () {
Music.song.stop();
songStats.isPlaying = 0;
};
playSongs();
intitiateVariables_soundPanel();
}
function create_explosion(targ) {
_root.Explosions.attachMovie("ExplosionClip1", "explosionClip" + explosionStats.num, explosionStats.num, {_x:targ._x, _y:targ._y, done:0});
_root.explosionStats.onStage.push(_root.Explosions["explosionClip" + explosionStats.num]);
explosionStats.num++;
}
function manage_Battle() {
function initiateVariables_battle() {
if (battleStats == undefined) {
battleStats = {waveNumber:0, peaceTimer:120, inBattle:0, reset:0, waveDigit1:0, waveDigit2:1, TTClipEvap:60};
AmmoModifiers = {norm:1, rapi:1.5, fire:3, elec:4, home:10};
}
_root.manage_WaveNumber = function () {
_root.ReadySetGo.attachMovie("wave", "wave", 1, {_x:347.9, _y:225, _xscale:134, _yscale:134});
_root.ReadySetGo.attachMovie("num" + battleStats.waveDigit1, "num1", 2, {_x:457.2, _y:230, _xscale:14, _yscale:14});
_root.ReadySetGo.attachMovie("num" + battleStats.waveDigit2, "num2", 3, {_x:499.8, _y:230, _xscale:14, _yscale:14});
_root.ReadySetGo.wave._x = _root.ReadySetGo.wave._x + 10;
_root.ReadySetGo.num1._x = _root.ReadySetGo.num1._x + 10;
_root.ReadySetGo.num2._x = _root.ReadySetGo.num2._x + 10;
};
_root.manage_waveClip = function () {
if (_root.ReadySetGo.wave != undefined) {
if (battleStats.TTClipEvap) {
battleStats.TTClipEvap = battleStats.TTClipEvap - 1;
} else if (_root.ReadySetGo.wave._alpha) {
_root.ReadySetGo.wave._alpha = _root.ReadySetGo.wave._alpha - 5;
_root.ReadySetGo.num1._alpha = _root.ReadySetGo.num1._alpha - 5;
_root.ReadySetGo.num2._alpha = _root.ReadySetGo.num2._alpha - 5;
}
}
};
}
function manage_Fish() {
function initiateVariables_Fish() {
if (fishStats == undefined) {
fishStats = {fishOnStage:[], fishNum:0, releaseTimer:(random(5) * 40) + 40, fishType:random(6), fishCounter:0};
}
}
function move_Fish() {
targetFish = _root.fishStats.fishOnStage;
i = 0;
while (i < targetFish.length) {
targetFish[i]._x = targetFish[i]._x + 5;
i++;
}
}
function create_Fish() {
if (boatsStats.boatsLeft) {
if (fishStats.releaseTimer) {
fishStats.releaseTimer = fishStats.releaseTimer - 1;
} else {
_root.Fish.attachMovie("fish" + fishStats.fishType, "fish" + fishStats.fishNum, fishStats.fishNum);
_root.fishStats.fishOnStage.push(_root.Fish["fish" + fishStats.fishNum]);
_root.fishStats.fishOnStage[fishStats.fishNum]._x = -30;
_root.fishStats.fishOnStage[fishStats.fishNum]._y = 464;
switch (fishStats.fishType) {
case 0 :
_root.fishStats.fishOnStage[fishStats.fishNum].selType = "elec";
break;
case 1 :
_root.fishStats.fishOnStage[fishStats.fishNum].selType = "rapi";
break;
case 2 :
_root.fishStats.fishOnStage[fishStats.fishNum].selType = "home";
break;
case 3 :
_root.fishStats.fishOnStage[fishStats.fishNum].selType = "fire";
break;
case 4 :
_root.fishStats.fishOnStage[fishStats.fishNum].selType = "norm";
break;
case 5 :
_root.fishStats.fishOnStage[fishStats.fishNum].selType = "heal";
}
_root.fishStats.fishNum++;
fishStats.releaseTimer = (random(5) * 40) + 40;
fishStats.fishType = random(6);
}
}
}
function remove_Fish() {
i = 0;
while (i < targetFish.length) {
if (targetFish[i]._x > 878) {
removeMovieClip(targetFish[i]);
delete targetFish[i];
}
i++;
}
}
function manage_PowerOctopuss() {
function create_PowerOctopussClip() {
if (_root.PowerOctopuss.powerOctopuss == undefined) {
_root.AttachSoundFX("goldenOctopussSpawn_Sound");
_root.PowerOctopuss.attachMovie("powerOctopuss", "powerOctopuss", 0);
_root.PowerOctopuss.powerOctopuss._x = -50;
_root.PowerOctopuss.powerOctopuss._y = 475;
_root.PowerOctopuss.powerOctopuss._xscale = 50;
_root.PowerOctopuss.powerOctopuss._yscale = 50;
}
}
function remove_PowerOctopuss() {
removeMovieClip(_root.PowerOctopuss.powerOctopuss);
delete _root.PowerOctopuss.powerOctopuss;
powerOctopussStats.TTrelease = random(5) * 40;
powerOctopussStats.RTrelease = 3;
}
if (powerOctopussStats == undefined) {
powerOctopussStats = {TTrelease:(random(4) * 40) + 40, RTrelease:0, timesEaten:0};
}
if (!powerOctopussStats.RTrelease) {
if (!powerOctopussStats.TTrelease) {
if (!battleStats.peaceTimer) {
create_PowerOctopussClip();
}
} else {
powerOctopussStats.TTrelease = powerOctopussStats.TTrelease - 1;
}
}
_root.PowerOctopuss.powerOctopuss._x = _root.PowerOctopuss.powerOctopuss._x + 10;
if (_root.PowerOctopuss.powerOctopuss._x > 900) {
remove_PowerOctopuss();
}
if ((((targetBird._x + 20) > _root.PowerOctopuss.powerOctopuss._x) && ((targetBird._x - 10) < _root.PowerOctopuss.powerOctopuss._x)) && (targetBird._y > 430)) {
powerOctopussStats.timesEaten++;
birdSuperTrip.TL = 200;
remove_PowerOctopuss();
}
}
function manage_DeathShark() {
function variables() {
if (sharkStats == undefined) {
sharkStats = {TLrelease:120, timesKilled:0, timesReleased:0, isOut:false, damage:90};
}
}
function removeShark(wasKilled, duePoints) {
if (wasKilled) {
_root.birdStats.score = _root.birdStats.score + duePoints;
}
removeMovieClip(_root.DeathShark.shark1);
delete _root.DeathShark.shark1;
sharkStats.isOut = false;
sharkStats.timesReleased++;
sharkStats.TLrelease = 120;
}
function killBird() {
if ((((DeathShark.shark1._x + 140) > targetBird._x) && (DeathShark.shark1._x < targetBird._x)) && (targetBird._y > 380)) {
_root.hurtBird(sharkStats.damage, "Shark");
_root.applyMomentum(5, -5);
}
}
function moveShark() {
if (sharkStats.isOut) {
DeathShark.shark1._x = DeathShark.shark1._x + 10;
if (DeathShark.shark1._x > 1000) {
removeShark(false, 0);
}
}
}
function killShark() {
}
function summonShark() {
if (sharkStats.isOut == false) {
if (targetBird._y > 400) {
if (sharkStats.TLrelease) {
sharkStats.TLrelease = sharkStats.TLrelease - 1;
} else {
_root.DeathShark.attachMovie("deathShark", "shark1", 0, {_x:-300, _y:430, _xscale:-100, health:50});
_root.AttachSoundFX("sharkSpawn_Sound");
sharkStats.isOut = true;
}
} else if (sharkStats.TLrelease < 120) {
sharkStats.TLrelease++;
}
}
}
variables();
moveShark();
killBird();
summonShark();
}
initiateVariables_Fish();
if (!battleStats.peaceTimer) {
create_Fish();
}
move_Fish();
remove_Fish();
manage_PowerOctopuss();
manage_DeathShark();
}
function manage_Boats() {
function initiateVariables_Boats() {
if (boatsStats == undefined) {
boatsStats = {spawnBad:false, boatsLeft:1, resetBoat:2, boatsOnStage:[], boatTrig:0, boatType:random(11), boatNum:0};
}
}
function move_Boats() {
boats = _root.boatsStats.boatsOnStage;
i = 0;
while (i < boats.length) {
boats[i]._x = boats[i]._x - 5;
i++;
}
}
function create_Boats() {
boatsStats.boatTrig = boats.length - 1;
if ((!boats.length) || (boats[boatsStats.boatTrig]._x < 325)) {
if (boatsStats.boatsLeft) {
boatsStats.spawnBad = true;
_root.Boats.attachMovie("boat" + boatsStats.boatType, "boat" + boatsStats.boatNum, boatsStats.boatNum);
boatsStats.boatsOnStage.push(_root.Boats["boat" + boatsStats.boatNum]);
targetBoat1 = _root.boatsStats.boatsOnStage[boatsStats.boatNum];
targetBoat1._x = 1100;
targetBoat1._y = 464;
setBoat = boatsStats.boatType;
preScale = 0;
if (((setBoat == 0) || (setBoat == 4)) || (setBoat == 8)) {
preScale = 80;
badTypeRep = 0;
slots = 1;
}
if (((setBoat == 1) || (setBoat == 6)) || (setBoat == 11)) {
preScale = 100;
badTypeRep = 1;
slots = 0;
}
if (((setBoat == 2) || (setBoat == 5)) || (setBoat == 9)) {
preScale = 45;
badTypeRep = 2;
slots = 0;
}
if (((setBoat == 3) || (setBoat == 7)) || (setBoat == 10)) {
preScale = 55;
badTypeRep = 3;
slots = 0;
}
targetBoat1._xscale = preScale;
targetBoat1._yscale = preScale;
boatsStats.boatType = random(11);
_root.boatsStats.boatNum++;
_root.boatsStats.boatsLeft = _root.boatsStats.boatsLeft - 1;
}
}
}
function remove_Boats() {
i = 0;
while (i < boats.length) {
if (boats[i]._x < -400) {
removeMovieClip(boats[i]);
delete boats[i];
if (((boats[boats.length - 1] == undefined) && (!boatsStats.boatsLeft)) && (targetFish[targetFish.length - 1] == undefined)) {
_root.catch_readySetGo();
resetForNextRound();
break;
}
}
i++;
}
}
initiateVariables_Boats();
if ((!battleStats.peaceTimer) && (boatsStats.boatsLeft)) {
create_Boats();
}
remove_Boats();
move_Boats();
}
function manage_AirMines() {
function initVariables() {
if (airMineStats == undefined) {
airMineStats = {onStage:[], num:0, TTrelease:160, RTrelease:0, speeds:[4, 5, 6], damage:50};
}
}
function create_airMines() {
if ((airMineStats.TTrelease <= 1) && (battleStats.peaceTimer < 2)) {
_root.AirMines.attachMovie("airMine", "airMine" + airMineStats.num, airMineStats.num);
airMineStats.onStage.push(_root.AirMines["airMine" + airMineStats.num]);
airMineRep = airMineStats.onStage[airMineStats.num];
airMineRep._x = 28 + random(822);
airMineRep._y = -73;
airMineRep.ySpd = airMineStats.speeds[random(2)];
airMineStats.num++;
airMineStats.TTrelease = 160;
} else {
airMineStats.TTrelease = airMineStats.TTrelease - 1;
}
}
function move_airMines() {
i = 0;
while (i < airMineStats.onStage.length) {
if (airMineStats.onStage[i].ySpd) {
airMineStats.onStage[i]._y = airMineStats.onStage[i]._y + airMineStats.onStage[i].ySpd;
if (airMineStats.onStage[i]._y > 448) {
create_explosion(airMineStats.onStage[i]);
airMineStats.onStage[i]._x = 440;
airMineStats.onStage[i]._y = -300;
airMineStats.onStage[i].ySpd = 0;
}
}
if (airMineStats.onStage[i].hitTest(targetBird)) {
_root.hurtBird(airMineStats.damage, "AirMine");
_root.applyMomentum(-((airMineStats.onStage[i]._x / 5) - (targetBird._x / 5)), -((airMineStats.onStage[i]._y / 5) - (targetBird._y / 5)));
create_explosion(airMineStats.onStage[i]);
airMineStats.onStage[i]._x = 440;
airMineStats.onStage[i]._y = -300;
airMineStats.onStage[i].ySpd = 0;
}
i++;
}
}
initVariables();
create_airMines();
move_airMines();
}
function manage_Explosions() {
function initiateVariables() {
if (explosionStats == undefined) {
explosionStats = {onStage:[], num:0};
}
}
i = 0;
while (i < explosionStats.onStage.length) {
if (!explosionStats.onStage[i].done) {
if (explosionStats.onStage[i]._currentframe == explosionStats.onStage[i]._totalframes) {
explosionStats.onStage[i].stop();
explosionStats.onStage[i]._x = -300;
explosionStats.onStage[i]._y = -300;
explosionStats.onStage[i].done = 1;
}
}
i++;
}
initiateVariables();
}
function manage_Baddies() {
function initVars_Baddies() {
if (baddieStats == undefined) {
baddieStats = {badNum:0, badType:random(6)};
baddieHealth = {CG:"INFINITE", KT:8, PC:3, SL:10, UC:13, TF:14};
BaddieGroups = {BA:[], CG:[], KT:[], SL:[], PC:[], TF:[], UC:[]};
}
}
function create_Baddies() {
if (slots > -1) {
_root.Baddies.createEmptyMovieClip("baddie" + baddieStats.badNum, baddieStats.badNum);
_root.Baddies["baddie" + baddieStats.badNum].attachMovie("baddie_IDLE" + baddieStats.badType, "baddie", 0);
BaddieGroups.BA.push(_root.Baddies["baddie" + baddieStats.badNum]);
badTarget1 = BaddieGroups.BA[BaddieGroups.BA.length - 1];
badTarget1._x = targetBoat1._x;
badTarget1._y = targetBoat1._y;
if (baddieStats.badType == 0) {
BaddieGroups.CG.push(_root.Baddies["baddie" + baddieStats.badNum]);
_root.Baddies["baddie" + baddieStats.badNum].setType = "Cannon Guy";
_root.Baddies["baddie" + baddieStats.badNum].health = baddieHealth.CG;
badTarget1._yscale = 30;
badTarget1._xscale = 30;
}
if (baddieStats.badType == 1) {
BaddieGroups.KT.push(_root.Baddies["baddie" + baddieStats.badNum]);
_root.Baddies["baddie" + baddieStats.badNum].setType = "Knife Thrower";
_root.Baddies["baddie" + baddieStats.badNum].health = baddieHealth.KT;
badTarget1._yscale = 10;
badTarget1._xscale = 10;
}
if (baddieStats.badType == 2) {
BaddieGroups.PC.push(_root.Baddies["baddie" + baddieStats.badNum]);
_root.Baddies["baddie" + baddieStats.badNum].setType = "Pie Clown";
_root.Baddies["baddie" + baddieStats.badNum].health = baddieHealth.PC;
badTarget1._yscale = 12;
badTarget1._xscale = 12;
}
if (baddieStats.badType == 3) {
BaddieGroups.SL.push(_root.Baddies["baddie" + baddieStats.badNum]);
_root.Baddies["baddie" + baddieStats.badNum].setType = "Shot Laydee";
_root.Baddies["baddie" + baddieStats.badNum].health = baddieHealth.SL;
badTarget1._yscale = 18;
badTarget1._xscale = 18;
}
if (baddieStats.badType == 4) {
BaddieGroups.TF.push(_root.Baddies["baddie" + baddieStats.badNum]);
_root.Baddies["baddie" + baddieStats.badNum].setType = "Tumor Freak";
_root.Baddies["baddie" + baddieStats.badNum].health = baddieHealth.TF;
badTarget1._yscale = 20;
badTarget1._xscale = 20;
}
if (baddieStats.badType == 5) {
BaddieGroups.UC.push(_root.Baddies["baddie" + baddieStats.badNum]);
_root.Baddies["baddie" + baddieStats.badNum].setType = "Unicycle Clown";
_root.Baddies["baddie" + baddieStats.badNum].health = baddieHealth.UC;
badTarget1._yscale = 20;
badTarget1._xscale = 20;
}
badTarget1.setBoat = badTypeRep;
badTarget1.slots = slots;
badTarget1.burn = 100;
burnTarget = new Color(badTarget1);
burnEffect = new Object();
baddieStats.badType = random(6);
baddieStats.badNum++;
}
}
function move_Baddies() {
i = 0;
while (i < BaddieGroups.BA.length) {
badRep1 = BaddieGroups.BA;
badRep1[i]._x = badRep1[i]._x - 5;
if (BaddieGroups.BA[i]._x < -200) {
BaddieGroups.BA[i]._x = 550;
BaddieGroups.BA[i]._y = -300;
BaddieGroups.BA[i].pattern = "NO_LONGER_ACTIVE";
removeMovieClip(BaddieGroups.BA[i].baddie);
}
i++;
}
}
function manage_CannonGuy() {
i = 0;
while (i < BaddieGroups.CG.length) {
badRepCG = BaddieGroups.CG;
if (badRepCG[i].hadSet == undefined) {
if (slots) {
if (badRepCG[i].setBoat == 0) {
badRepCG[i].xAdj = -10;
badRepCG[i].yAdj = 230;
}
} else {
if (badRepCG[i].setBoat == 0) {
badRepCG[i].xAdj = 150;
badRepCG[i].yAdj = 130;
}
if (badRepCG[i].setBoat == 1) {
badRepCG[i].xAdj = 80;
badRepCG[i].yAdj = 90;
}
if (badRepCG[i].setBoat == 2) {
badRepCG[i].xAdj = 30;
badRepCG[i].yAdj = 70;
}
if (badRepCG[i].setBoat == 3) {
badRepCG[i].xAdj = 70;
badRepCG[i].yAdj = 70;
}
}
badRepCG[i]._x = badRepCG[i]._x - badRepCG[i].xAdj;
badRepCG[i]._y = badRepCG[i]._y - badRepCG[i].yAdj;
createFXBubble(0, badRepCG[i], 0);
badRepCG[i].pattern = "idle";
slots = slots - 1;
badRepCG[i].hadSet = 1;
}
if (badRepCG[i].pattern == "idle") {
if (badRepCG[i]._x < 750) {
badRepCG[i].pattern = "prepfire";
badRepCG[i].attachMovie("baddie_prepfire0", "baddie", 0);
}
}
if (badRepCG[i].pattern == "prepfire") {
if (badRepCG[i].baddie._currentframe == badRepCG[i].baddie._totalframes) {
badRepCG[i].pattern = "fire";
_root.AttachSoundFX("cannonShot_Sound", 0);
badRepCG[i].attachMovie("baddie_fire0", "baddie", 0);
}
}
if (badRepCG[i].pattern == "fire") {
if (badRepCG[i].baddie._currentframe == badRepCG[i].baddie._totalframes) {
badRepCG[i].baddie.stop();
_root.CannonGuys.attachMovie("CannonGuy_body0", "CG_b" + CannonGuyStats.CGnum, CannonGuyStats.CGnum);
_root.CannonGuyStats.CG.push(_root.CannonGuys["CG_b" + CannonGuyStats.CGnum]);
CannonGuyStats.CGnum++;
badRepCG[i].pattern = "finished";
}
}
i++;
}
}
function manage_knifeThrower() {
i = 0;
while (i < BaddieGroups.KT.length) {
badRepKT = BaddieGroups.KT;
if ((badRepKT[i].hadSet == undefined) && (badRepKT[i] != undefined)) {
if (slots) {
if (badRepKT[i].setBoat == 0) {
badRepKT[i].xAdj = -10;
badRepKT[i].yAdj = 200;
}
} else {
if (badRepKT[i].setBoat == 0) {
badRepKT[i].xAdj = 130;
badRepKT[i].yAdj = 100;
}
if (badRepKT[i].setBoat == 1) {
badRepKT[i].xAdj = 55;
badRepKT[i].yAdj = 68;
}
if (badRepKT[i].setBoat == 2) {
badRepKT[i].xAdj = 0;
badRepKT[i].yAdj = 65;
}
if (badRepKT[i].setBoat == 3) {
badRepKT[i].xAdj = 30;
badRepKT[i].yAdj = 70;
}
}
badRepKT[i]._x = badRepKT[i]._x - badRepKT[i].xAdj;
badRepKT[i]._y = badRepKT[i]._y - badRepKT[i].yAdj;
createFXBubble(0, badRepKT[i], 0);
slots = slots - 1;
badRepKT[i].hadSet = 1;
badRepKT[i].pattern = "idle";
}
if (badRepKT[i].pattern == "idle") {
if ((targetBird._x > (badRepKT[i]._x - 300)) && (targetBird._x < (badRepKT[i]._x + 300))) {
badRepKT[i].pattern = "reload";
badRepKT[i].attachMovie("baddie_reload1", "baddie", 0);
badRepKT[i]._y = badRepKT[i]._y - 25;
if (targetBird._x > badRepKT[i]._x) {
badRepKT[i]._x = badRepKT[i]._x + 25;
} else {
badRepKT[i]._x = badRepKT[i]._x - 25;
}
}
}
if (badRepKT[i].pattern == "reload") {
if (badRepKT[i].baddie._currentframe == badRepKT[i].baddie._totalframes) {
_root.AttachSoundFX("knifePull_Sound", 0);
if (targetBird._x < badRepKT[i]._x) {
badRepKT[i]._xscale = 10;
} else {
badRepKT[i]._xscale = -10;
}
if (targetBird._y > (badRepKT[i]._y - 50)) {
badRepKT[i].pattern = "attackX";
badRepKT[i].attachMovie("baddie_attackX1", "baddie", 0);
} else {
badRepKT[i].pattern = "attackY";
badRepKT[i].attachMovie("baddie_reloadY1", "baddie", 0);
}
}
}
if (badRepKT[i]._x > -100) {
if (((badRepKT[i].baddie._currentframe == 1) && (badRepKT[i].pattern == "attackX")) || (badRepKT[i].pattern == "attackY")) {
_root.AttachSoundFX("throwKnife_Sound", 0);
_root.KnifeGuy_Knifes.attachMovie("baddie_shot1", "knife" + KnifeGuyStats.kNum, KnifeGuyStats.kNum);
_root.KnifeGuyStats.KT.push(_root.KnifeGuy_Knifes["knife" + KnifeGuyStats.kNum]);
KGSrep = _root.KnifeGuyStats.KT[KnifeGuyStats.kNum];
if (badRepKT[i].pattern == "attackX") {
KGSrep.setDirY = 0;
}
if (badRepKT[i].pattern == "attackY") {
KGSrep.setDirY = 1;
}
if (badRepKT[i]._xscale == 10) {
KGSrep.setDir = 1;
} else {
KGSrep.setDir = -1;
}
KGSrep.setTo = badRepKT[i];
KnifeGuyStats.kNum++;
badRepKT[i].pattern = "reload";
}
}
if (badRepKT[i].pattern == "dead") {
if (badRepKT[i].setDead != undefined) {
if (badRepKT[i].baddie._currentframe == badRepKT[i].baddie._totalframes) {
badRepKT[i].baddie.stop();
badRepKT[i]._x = 550;
badRepKT[i]._y = -300;
badRepKT[i].pattern = "NO_LONGER_ACTIVE";
}
} else {
_root.AttachSoundFX(("death" + random(2)) + "_Sound", 0);
badRepKT[i].attachMovie("baddie_dead1", "baddie", 0);
badRepKT[i].setDead = 0;
}
}
i++;
}
}
function manage_KnifeGuy_Knifes() {
if (KnifeGuyStats == undefined) {
KnifeGuyStats = {KT:[], kNum:0, damage:8};
}
i = 0;
while (i < KnifeGuyStats.KT.length) {
kRep1 = KnifeGuyStats.KT;
if (kRep1[i].isSet == undefined) {
kRep1[i]._xscale = kRep1[i].setDir * 10;
kRep1[i]._yscale = 10;
kRep1[i]._x = kRep1[i].setTo._x;
kRep1[i]._y = kRep1[i].setTo._y;
kRep1[i].isSet = 1;
}
kRep1[i]._y = kRep1[i]._y - (kRep1[i].setDirY * 2.5);
kRep1[i]._x = kRep1[i]._x - (kRep1[i].setDir * 10);
kRep1[i]._rotation = kRep1[i]._rotation + 45;
if (((kRep1[i]._x < -50) || (kRep1[i]._x > 900)) || (kRep1[i]._y < -50)) {
removeMovieClip(kRep1[i]);
delete kRep[i];
}
if (kRep1[i].hitTest(targetBird)) {
_root.hurtBird(KnifeGuyStats.damage, "KnifeGuy");
removeMovieClip(kRep1[i]);
delete kRep[i];
}
i++;
}
}
function manage_Pie_Clown() {
i = 0;
while (i < BaddieGroups.PC.length) {
badRepPC = BaddieGroups.PC;
if (badRepPC[i].hadSet == undefined) {
if (slots) {
if (badRepPC[i].setBoat == 0) {
badRepPC[i].xAdj = -30;
badRepPC[i].yAdj = 210;
}
} else {
if (badRepPC[i].setBoat == 0) {
badRepPC[i].xAdj = 140;
badRepPC[i].yAdj = 120;
}
if (badRepPC[i].setBoat == 1) {
badRepPC[i].xAdj = 20;
badRepPC[i].yAdj = 60;
}
if (badRepPC[i].setBoat == 2) {
badRepPC[i].xAdj = 0;
badRepPC[i].yAdj = 60;
}
if (badRepPC[i].setBoat == 3) {
badRepPC[i].xAdj = 30;
badRepPC[i].yAdj = 70;
}
}
badRepPC[i]._x = badRepPC[i]._x - badRepPC[i].xAdj;
badRepPC[i]._y = badRepPC[i]._y - badRepPC[i].yAdj;
createFXBubble(0, badRepPC[i], 0);
badRepPC[i].pattern = "idle";
slots = slots - 1;
badRepPC[i].hadSet = 1;
}
if (badRepPC[i].pattern == "idle") {
if (badRepPC[i]._x < 850) {
badRepPC[i].pattern = "reload";
badRepPC[i].attachMovie("baddie_reload2", "baddie", 0);
}
}
if (badRepPC[i].pattern == "reload") {
if (badRepPC[i].baddie._currentframe == badRepPC[i].baddie._totalframes) {
badRepPC[i].baddie.stop();
if ((_root.targetBird._x > (badRepPC[i]._x - 250)) && (_root.targetBird._x < (badRepPC[i]._x + 250))) {
if (_root.targetBird._y < (badRepPC[i]._y - 80)) {
badRepPC[i].pattern = "attackY";
badRepPC[i].attachMovie("baddie_attackY2", "baddie", 0);
} else {
badRepPC[i].pattern = "attackX";
badRepPC[i].attachMovie("baddie_attackX2", "baddie", 0);
}
if (targetBird._x > badRepPC[i]._x) {
badRepPC[i]._xscale = -12;
} else {
badRepPC[i]._xscale = 12;
}
}
}
}
if (((badRepPC[i].baddie._currentframe == 1) && (badRepPC[i].pattern == "attackY")) || (badRepPC[i].pattern == "attackX")) {
_root.PieClown_Pies.attachMovie("baddie_Pie1", "pie" + PieClownStats.pNum, PieClownStats.pNum);
_root.PieClownStats.P.push(_root.PieClown_Pies["pie" + PieClownStats.pNum]);
pieRep1 = _root.PieClownStats.P;
if (badRepPC[i].pattern == "attackX") {
pieRep1[pieRep1.length - 1].setDirY = -1;
pieRep1[pieRep1.length - 1].turnY = 0;
pieRep1[pieRep1.length - 1].turnX = 20;
} else {
pieRep1[pieRep1.length - 1].setDirY = 1;
pieRep1[pieRep1.length - 1].turnY = 15;
pieRep1[pieRep1.length - 1].turnX = 0;
}
if (badRepPC[i]._xscale == 12) {
pieRep1[pieRep1.length - 1].setDirX = -1;
} else {
pieRep1[pieRep1.length - 1].setDirX = 1;
}
pieRep1[pieRep1.length - 1].setTo = badRepPC[i];
badRepPC[i].pattern = "reload";
PieClownStats.pNum++;
}
if (badRepPC[i].pattern == "dead") {
if (badRepPC[i].setDead != undefined) {
if (badRepPC[i].baddie._currentframe == badRepPC[i].baddie._totalframes) {
badRepPC[i].baddie.stop();
}
} else {
_root.AttachSoundFX(("death" + random(2)) + "_Sound", 0);
badRepPC[i].attachMovie("baddie_dead2", "baddie", 0);
badRepPC[i].setDead = 0;
}
}
i++;
}
}
function manage_PieClown_Pies() {
if (PieClownStats == undefined) {
PieClownStats = {P:[], pNum:0, damage:8};
}
i = 0;
while (i < PieClownStats.P.length) {
if (pieRep1[i].isSet == undefined) {
if (pieRep1[i].setDirX == -1) {
pieRep1[i]._rotation = 270;
} else {
pieRep1[i]._rotation = 90;
}
pieRep1[i]._xscale = 30;
pieRep1[i]._yscale = 30;
pieRep1[i]._x = pieRep1[i].setTo._x;
pieRep1[i]._y = pieRep1[i].setTo._y;
pieRep1[i].isSet = 1;
}
pieRep1[i]._x = pieRep1[i]._x + (pieRep1[i].setDirX * pieRep1[i].turnX);
pieRep1[i]._y = pieRep1[i]._y - (pieRep1[i].setDirY * pieRep1[i].turnY);
if (pieRep1[i].setDirY == -1) {
if (pieRep1[i].turnX) {
pieRep1[i]._rotation = pieRep1[i]._rotation - 5;
pieRep1[i].turnX = pieRep1[i].turnX - 0.5;
pieRep1[i].turnY = pieRep1[i].turnY + 0.5;
}
} else if (pieRep1[i].turnY) {
pieRep1[i]._rotation = pieRep1[i]._rotation + 5;
pieRep1[i].turnX = pieRep1[i].turnX + 0.5;
pieRep1[i].turnY = pieRep1[i].turnY - 0.5;
}
if ((pieRep1[i]._y > 520) || (pieRep1[i]._y < -20)) {
removeMovieClip(pieRep1[i]);
delete pieRep1[i];
}
if (pieRep1[i].hitTest(targetBird)) {
_root.hurtBird(PieClownStats.damage, "PieClown");
removeMovieClip(pieRep1[i]);
delete pieRep1[i];
}
i++;
}
}
function manage_Shot_laydee() {
i = 0;
while (i < BaddieGroups.SL.length) {
badRepSL = BaddieGroups.SL;
if (badRepSL[i].hadSet == undefined) {
if (slots) {
if (badRepSL[i].setBoat == 0) {
badRepSL[i].xAdj = -10;
badRepSL[i].yAdj = 240;
}
} else {
if (badRepSL[i].setBoat == 0) {
badRepSL[i].xAdj = 160;
badRepSL[i].yAdj = 150;
}
if (badRepSL[i].setBoat == 1) {
badRepSL[i].xAdj = 30;
badRepSL[i].yAdj = 90;
}
if (badRepSL[i].setBoat == 2) {
badRepSL[i].xAdj = 20;
badRepSL[i].yAdj = 80;
}
if (badRepSL[i].setBoat == 3) {
badRepSL[i].xAdj = 50;
badRepSL[i].yAdj = 90;
}
}
badRepSL[i]._x = badRepSL[i]._x - badRepSL[i].xAdj;
badRepSL[i]._y = badRepSL[i]._y - badRepSL[i].yAdj;
createFXBubble(0, badRepSL[i], 0);
badRepSL[i].pattern = "idle";
slots = slots - 1;
badRepSL[i].hadSet = 1;
}
if (badRepSL[i].pattern == "idle") {
if (targetBird._x > badRepSL[i]._x) {
badRepSL[i]._xscale = -18;
} else {
badRepSL[i]._xscale = 18;
}
if (targetBird._y < (badRepSL[i]._y - 150)) {
badRepSL[i].pattern = "attackY";
_root.badRepSL[i].attachMovie("baddie_shotY3", "baddie", 0);
}
if ((targetBird._y > (badRepSL[i]._y - 150)) && (targetBird._y < (badRepSL[i]._y - 50))) {
badRepSL[i].pattern = "attackXY";
_root.badRepSL[i].attachMovie("baddie_shotXY3", "baddie", 0);
}
if (targetBird._y > (badRepSL[i]._y - 50)) {
badRepSL[i].pattern = "attackX";
_root.badRepSL[i].attachMovie("baddie_shotX3", "baddie", 0);
}
}
badFrame3 = badRepSL[i].baddie._currentframe;
if (((badFrame3 == 15) || (badFrame3 == 25)) || (badFrame3 == 35)) {
_root.AttachSoundFX("throwPie_Sound", 0);
sRep3 = ShotLaydeeStats.S;
_root.ShotLaydee_Shots.attachMovie("baddie_shot3", "shot" + ShotLaydeeStats.sNum, ShotLaydeeStats.sNum);
ShotLaydeeStats.S.push(_root.ShotLaydee_Shots["shot" + ShotLaydeeStats.sNum]);
if (badRepSL[i].pattern == "attackXY") {
if (badRepSL[i]._xscale > 1) {
sRep3[sRep3.length - 1].xDir = -1.5;
} else {
sRep3[sRep3.length - 1].xDir = 1.5;
}
sRep3[sRep3.length - 1].yDir = -1.5;
} else if (badRepSL[i].pattern == "attackY") {
sRep3[sRep3.length - 1].yDir = -2;
sRep3[sRep3.length - 1].xDir = 0;
} else {
sRep3[sRep3.length - 1].yDir = 0;
if (badRepSL[i]._xscale > 1) {
sRep3[sRep3.length - 1].xDir = -1;
} else {
sRep3[sRep3.length - 1].xDir = 1;
}
}
sRep3[sRep3.length - 1].setTo = badRepSL[i];
ShotLaydeeStats.sNum++;
sRep3 = ShotLaydeeStats.S;
}
if ((badRepSL[i].baddie._currentframe == (badRepSL[i].baddie._totalframes - 1)) && (badRepSL[i].pattern != "dead")) {
badRepSL[i].pattern = "idle";
}
if (badRepSL[i].pattern == "dead") {
if (badRepSL[i].setDead != undefined) {
if (badRepSL[i].baddie._currentframe == badRepSL[i].baddie._totalframes) {
badRepSL[i].baddie.stop();
}
} else {
_root.AttachSoundFX("deathGirl_Sound", 0);
badRepSL[i].setDead = 0;
badRepSL[i].attachMovie("baddie_dead3", "baddie", 0);
}
}
i++;
}
}
function manage_ShotLaydee_Shots() {
if (ShotLaydeeStats == undefined) {
ShotLaydeeStats = {S:[], sNum:0, damage:5};
}
i = 0;
while (i < ShotLaydeeStats.S.length) {
if (sRep3[i].isSet == undefined) {
sRep3[i]._x = sRep3[i].setTo._x;
sRep3[i]._y = sRep3[i].setTo._y;
sRep3[i].isSet = 1;
}
sRep3[i]._x = sRep3[i]._x + (sRep3[i].xDir * 10);
sRep3[i]._y = sRep3[i]._y + (sRep3[i].yDir * 10);
if (((sRep3[i]._x < -5) || (sRep3[i]._x > 855)) || (sRep3[i]._y < -5)) {
removeMovieClip(sRep3[i]);
delete sRep3[i];
}
if (sRep3[i].hitTest(targetBird)) {
_root.hurtBird(ShotLaydeeStats.damage, "ShotLayde");
removeMovieClip(sRep3[i]);
delete sRep3[i];
}
i++;
}
}
function manage_TumorFreak() {
i = 0;
while (i < BaddieGroups.TF.length) {
badRepTF = BaddieGroups.TF;
if (badRepTF[i].hadSet == undefined) {
if (slots) {
if (badRepTF[i].setBoat == 0) {
badRepTF[i].xAdj = -10;
badRepTF[i].yAdj = 215;
}
} else {
if (badRepTF[i].setBoat == 0) {
badRepTF[i].xAdj = 160;
badRepTF[i].yAdj = 135;
}
if (badRepTF[i].setBoat == 1) {
badRepTF[i].xAdj = 30;
badRepTF[i].yAdj = 75;
}
if (badRepTF[i].setBoat == 2) {
badRepTF[i].xAdj = 30;
badRepTF[i].yAdj = 60;
}
if (badRepTF[i].setBoat == 3) {
badRepTF[i].xAdj = 50;
badRepTF[i].yAdj = 90;
}
}
badRepTF[i]._x = badRepTF[i]._x - badRepTF[i].xAdj;
badRepTF[i]._y = badRepTF[i]._y - badRepTF[i].yAdj;
createFXBubble(0, badRepTF[i], 0);
badRepTF[i].pattern = "idle";
slots = slots - 1;
badRepTF[i].hadSet = 1;
}
if (badRepTF[i].pattern == "idle") {
if (_root.targetBird._y > (badRepTF[i]._y - 100)) {
if ((_root.targetBird._x > (badRepTF[i]._x - 50)) && (_root.targetBird._x < (badRepTF[i]._x + 50))) {
badRepTF[i]._y = badRepTF[i]._y - 18;
badRepTF[i]._x = badRepTF[i]._x + 4;
badRepTF[i].pattern = "attack";
badRepTF[i].attachMovie("baddie_attack4", "baddie", 0);
}
}
}
if (badRepTF[i].pattern == "attack") {
if (badRepTF[i].baddie._currentframe == badRepTF[i].baddie._totalframes) {
badRepTF[i]._y = badRepTF[i]._y + 18;
badRepTF[i]._x = badRepTF[i]._x - 4;
badRepTF[i].pattern = "idle";
badRepTF[i].attachMovie("baddie_IDLE4", "baddie", 0);
}
badRepTFcf = badRepTF[i].baddie._currentframe;
if (((badRepTFcf == 21) || (badRepTFcf == 27)) || (badRepTFcf == 37)) {
_root.TumorFreak_Hooks.attachMovie("baddie_hook4", "hook" + TumorFreakStats.hNum, TumorFreakStats.hNum);
TumorFreakStats.H.push(_root.TumorFreak_Hooks["hook" + TumorFreakStats.hNum]);
hookRep5_1 = TumorFreakStats.H[TumorFreakStats.hNum];
if (badRepTFcf == 21) {
hookRep5_1.xDir = 1;
hookRep5_1.yDir = 0;
} else if (badRepTFcf == 27) {
hookRep5_1.xDir = 0;
hookRep5_1.yDir = -1;
} else if (badRepTFcf == 37) {
hookRep5_1.xDir = -1;
hookRep5_1.yDir = 0;
}
hookRep5_1._x = badRepTF[i]._x;
hookRep5_1._y = badRepTF[i]._y;
TumorFreakStats.hNum++;
}
}
if (badRepTF[i].pattern == "dead") {
if (badRepTF[i].setDead != undefined) {
if (badRepTF[i].baddie._currentframe == badRepTF[i].baddie._totalframes) {
badRepTF[i].baddie.stop();
}
} else {
_root.AttachSoundFX(("death" + random(2)) + "_Sound", 0);
badRepTF[i].attachMovie("baddie_dead4", "baddie", 0);
badRepTF[i].setDead = 0;
}
}
i++;
}
}
function manage_tumorFreak_Hooks() {
if (TumorFreakStats == undefined) {
TumorFreakStats = {H:[], hNum:0, damage:15};
}
i = 0;
while (i < TumorFreakStats.H.length) {
hookRep5_2 = TumorFreakStats.H[i];
hookRep5_2._x = hookRep5_2._x + (hookRep5_2.xDir * 10);
hookRep5_2._y = hookRep5_2._y + (hookRep5_2.yDir * 10);
if (((hookRep5_2._x > 875) || (hookRep5_2._x < -25)) || (hookRep5_2._y < -25)) {
removeMovieClip(hookRep5_2);
delete hookRep5_2;
}
if (hookRep5_2.hitTest(targetBird)) {
_root.hurtBird(TumorFreakStats.damage, "TumorFreak");
removeMovieClip(hookRep5_2);
delete hookRep5_2;
}
i++;
}
}
function manage_UnicycleClown() {
i = 0;
while (i < BaddieGroups.UC.length) {
badRepUC = BaddieGroups.UC;
if (badRepUC[i].hadSet == undefined) {
if (slots) {
if (badRepUC[i].setBoat == 0) {
badRepUC[i].xAdj = -40;
badRepUC[i].yAdj = 245;
}
} else {
if (badRepUC[i].setBoat == 0) {
badRepUC[i].xAdj = 100;
badRepUC[i].yAdj = 157;
}
if (badRepUC[i].setBoat == 1) {
badRepUC[i].xAdj = 30;
badRepUC[i].yAdj = 110;
}
if (badRepUC[i].setBoat == 2) {
badRepUC[i].xAdj = 30;
badRepUC[i].yAdj = 110;
}
if (badRepUC[i].setBoat == 3) {
badRepUC[i].xAdj = 50;
badRepUC[i].yAdj = 110;
}
}
badRepUC[i]._x = badRepUC[i]._x - badRepUC[i].xAdj;
badRepUC[i]._y = badRepUC[i]._y - badRepUC[i].yAdj;
createFXBubble(0, badRepUC[i], 0);
badRepUC[i].pattern = "idle";
slots = slots - 1;
badRepUC[i].hadSet = 1;
}
if (badRepUC[i].pattern == "idle") {
if ((_root.targetBird._x > (badRepUC[i]._x - 120)) && (_root.targetBird._x < (badRepUC[i]._x + 120))) {
_root.badRepUC[i].attachMovie("baddie_attack5", "baddie", 0);
badRepUC[i].pattern = "attack";
}
if (_root.targetBird._x > badRepUC[i]._x) {
badRepUC[i]._xscale = -20;
} else {
badRepUC[i]._xscale = 20;
}
}
if (badRepUC[i].pattern == "attack") {
if (badRepUC[i].baddie._currentframe == 1) {
_root.AttachSoundFX("clownPuke_Sound", 0.5);
_root.UnicycleClown_Puke.attachMovie("baddie_puke5", "puke" + PukeStats.pNum, PukeStats.pNum);
_root.PukeStats.P.push(_root.UnicycleClown_Puke["puke" + PukeStats.pNum]);
pRep5_1 = _root.PukeStats.P[PukeStats.pNum];
if (badRepUC[i]._xscale > 1) {
pRep5_1.xDir = -20;
pRep5_1._xscale = 80;
} else {
pRep5_1.xDir = 20;
pRep5_1._xscale = -80;
}
pRep5_1._x = badRepUC[i]._x;
pRep5_1._y = badRepUC[i]._y - 35;
pRep5_1.owner = badRepUC[i];
pRep5_1.yDir = 0;
PukeStats.pNum++;
}
if (badRepUC[i].baddie._currentframe == badRepUC[i].baddie._totalframes) {
_root.badRepUC[i].attachMovie("baddie_IDLE5", "baddie", 0);
badRepUC[i].pattern = "idle";
}
}
if (badRepUC[i].pattern == "dead") {
if (badRepUC[i].setDead != undefined) {
if (badRepUC[i].baddie._currentframe == badRepUC[i].baddie._totalframes) {
badRepUC[i].baddie.stop();
}
} else {
_root.AttachSoundFX(("death" + random(2)) + "_Sound", 0);
badRepUC[i].attachMovie("baddie_dead5", "baddie", 0);
badRepUC[i].setDead = 0;
}
}
i++;
}
}
function manage_UnicycleClown_Puke() {
if (PukeStats == undefined) {
PukeStats = {P:[], pNum:0, damage:11};
}
i = 0;
while (i < PukeStats.P.length) {
pRep5_2 = PukeStats.P;
if (pRep5_2[i].yDir < 20) {
pRep5_2[i].yDir = pRep5_2[i].yDir + 0.5;
}
if (pRep5_2[i].xDir > 0) {
pRep5_2[i].xDir = pRep5_2[i].xDir - 0.5;
pRep5_2[i]._rotation = pRep5_2[i]._rotation + 3;
} else if (pRep5_2[i].xDir < 0) {
pRep5_2[i].xDir = pRep5_2[i].xDir + 0.5;
pRep5_2[i]._rotation = pRep5_2[i]._rotation - 3;
}
pRep5_2[i]._x = pRep5_2[i]._x + pRep5_2[i].xDir;
pRep5_2[i]._y = pRep5_2[i]._y + pRep5_2[i].yDir;
if (pRep5_2[i]._y > 500) {
removeMovieClip(pRep5_2[i]);
delete pRep5_2[i];
}
if (pRep5_2[i].hitTest(targetBird)) {
_root.hurtBird(PukeStats.damage, "PieClown");
removeMovieClip(pRep5_2[i]);
delete pRep5_2[i];
}
i++;
}
}
function manage_CannonGuy_body() {
if (CannonGuyStats == undefined) {
CannonGuyStats = {CGnum:0, CG:[], damage:20};
}
i = 0;
while (i < CannonGuyStats.CG.length) {
CGrep = CannonGuyStats.CG;
if (CGrep[i].isSet == undefined) {
CGrep[i]._x = 50 + random(750);
CGrep[i]._y = -200;
CGrep[i]._rotation = 180;
CGrep[i]._xscale = 30;
CGrep[i]._yscale = 30;
CGrep[i].TTF = 20;
CGrep[i].isSet = true;
}
if (CGrep[i].hitTest(targetBird)) {
_root.hurtBird(CannonGuyStats.damage, "CannonGuy");
}
if (CGrep[i].TTF) {
CGrep[i].TTF = CGrep[i].TTF - 1;
} else if (CGrep[i]._y < 650) {
CGrep[i]._y = CGrep[i]._y + 20;
}
i++;
}
}
initVars_Baddies();
move_Baddies();
create_Baddies();
manage_CannonGuy();
manage_CannonGuy_body();
manage_knifeThrower();
manage_KnifeGuy_Knifes();
manage_Pie_Clown();
manage_PieClown_Pies();
manage_Shot_laydee();
manage_ShotLaydee_Shots();
manage_TumorFreak();
manage_tumorFreak_Hooks();
manage_UnicycleClown();
manage_UnicycleClown_Puke();
}
function launch_ReadySetGo() {
if (_root.ReadySetGo.readySetGo._currentframe == 1) {
_root.catch_readySetGo();
_root.ReadySetGo.readySetGo.play();
}
if (_root.ReadySetGo.readySetGo._currentframe == _root.ReadySetGo.readySetGo._totalframes) {
_root.ReadySetGo.readySetGo.stop();
}
}
_root.resetForNextRound = function () {
_root.toNormalAmmo();
battleStats.TTClipEvap = 100;
battleStats.waveNumber++;
battleStats.waveDigit2++;
if (battleStats.waveDigit2 > 9) {
battleStats.waveDigit2 = 0;
battleStats.waveDigit1++;
}
battleStats.peaceTimer = 120;
powerOctopussStats.RTrelease = powerOctopussStats.RTrelease - 1;
i = 0;
while (i < boatsStats.boatsOnStage.length) {
removeMovieClip(boatsStats.boatsOnStage[i]);
i++;
}
boatsStats.boatsLeft = boatsStats.resetBoat;
boatsStats.resetBoat++;
boatsStats.boatNum = 0;
boatsStats.boatsOnStage = [];
boatsStats.boatTrig = 0;
i = 0;
while (i < arsenalStats.shotsOnStage.length) {
removeMovieClip(arsenalStats.shotsOnStage[i]);
i++;
}
i = 0;
while (i < arsenalStats.homingOnStage.length) {
removeMovieClip(arsenalStats.homingOnStage[i]);
i++;
}
arsenalStats.shotNum = 0;
arsenalStats.shotsOnStage = [];
arsenalStats.homingOnStage = [];
arsenalStats = {shotNum:0, shotsOnStage:[], homingOnStage:[], setDela:8, repDela:8, normDela:8, rapiDela:4, fireDela:10, elecDela:1, homeDela:20};
i = 0;
while (i < fishStats.fishOnStage.length) {
removeMovieClip(fishStats.fishOnStage[i]);
i++;
}
fishStats.fishOnStage = [];
fishStats.fishNum = 0;
i = 0;
while (i < BaddieGroups.KT.length) {
removeMovieClip(BaddieGroups.KT[i]);
i++;
}
i = 0;
while (i < BaddieGroups.PC.length) {
removeMovieClip(BaddieGroups.PC[i]);
i++;
}
i = 0;
while (i < BaddieGroups.CG.length) {
removeMovieClip(BaddieGroups.CG[i]);
i++;
}
CannonGuyStats.CGnum = 0;
i = 0;
while (i < BaddieGroups.SL.length) {
removeMovieClip(BaddieGroups.SL[i]);
i++;
}
i = 0;
while (i < BaddieGroups.TF.length) {
removeMovieClip(BaddieGroups.TF[i]);
i++;
}
i = 0;
while (i < BaddieGroups.UC.length) {
removeMovieClip(BaddieGroups.UC[i]);
i++;
}
i = 0;
while (i < KnifeGuyStats.KT.length) {
removeMovieClip(KnifeGuyStats.KT[i]);
i++;
}
KnifeGuyStats.KGnum = 0;
i = 0;
while (i < PieClownStats.P.length) {
removeMovieClip(PieClownStats.P[i]);
i++;
}
PieClownStats.pNum = 0;
i = 0;
while (i < ShotLaydeeStats.S.length) {
removeMovieClip(ShotLaydeeStats.S[i]);
i++;
}
ShotLaydeeStats.sNum = 0;
i = 0;
while (i < TumorFreakStats.H.length) {
removeMovieClip(TumorFreakStats.H[i]);
i++;
}
i = 0;
while (i < PukeStats.P.length) {
removeMovieClip(PukeStats.P[i]);
i++;
}
i = 0;
while (i < CannonGuyStats.CG.length) {
removeMovieClip(CannonGuyStats.CG[i]);
i++;
}
i = 0;
while (i < KnifeGuyStats.KG.length) {
removeMovieClip(KnifeGuyStats.KG[i]);
i++;
}
i = 0;
while (i < airMineStats.onStage.length) {
removeMovieClip(airMineStats.onStage[i]);
i++;
}
airMineStats.num = 0;
airMineStats.onStage = [];
BaddieGroups = {BA:[], CG:[], KT:[], SL:[], PC:[], TF:[], UC:[]};
baddieStats.badNum = 0;
i = 0;
while (i < FXBubbleStats.B.length) {
removeMovieClip(FXBubbleStats.B[i]);
delete FXBubbleStats.B[i];
i++;
}
i = 0;
while (i < featherStats.onStage.length) {
removeMovieClip(featherStats.onStage[i]);
i++;
}
featherStats.num = 0;
featherStats.onStage = [];
FXBubbleStats.bNum = 0;
FXBubbleStats = {B:[], bNum:0};
phraseBubbleFormat = new TextFormat();
phraseBubbleFormat.size = 12;
phraseBubbleFormat.color = 16711680 /* 0xFF0000 */;
phraseBubbleFormat.bold = true;
phraseBubbleFormat.font = "Comic Sans MS";
arsenalTweaks = {rotateRan:[-25, 0, 25], ranNum:0, elecDistort:[-10, -5, 0, 5, 10]};
AmmoModifiers = {norm:1, rapi:1.5, fire:3, elec:4, home:10};
elecGlow1 = new flash.filters.GlowFilter(5609983, 5, 3, 3, 5, 1);
baddieStats.badNum = 0;
if (!battleStats.waveNumber) {
_root.ReadySetGo.readySetGo.play();
} else {
_root.manage_WaveNumber();
}
};
_root.manage_waveClip();
initiateVariables_battle();
if (battleStats.peaceTimer <= 100) {
launch_ReadySetGo();
}
if (battleStats.peaceTimer) {
battleStats.peaceTimer = battleStats.peaceTimer - 1;
}
manage_Boats();
manage_Fish();
manage_Baddies();
manage_AirMines();
manage_Explosions();
}
function manage_DamageSystem() {
if (AmmoGroups == undefined) {
AmmoGroups = {BirdShots:[], BaddieShots:[]};
}
A = 0;
while (A < AmmoGroups.BirdShots.length) {
B = 0;
while (B < BaddieGroups.BA.length) {
if (AmmoGroups.BirdShots[A].setType != undefined) {
BirdAmRep = AmmoGroups.BirdShots[A];
if (((BirdAmRep._x < (BaddieGroups.BA[B]._x + 50)) && (BirdAmRep._x > (BaddieGroups.BA[B]._x - 50))) && (BirdAmRep._y > (BaddieGroups.BA[B]._y - 55))) {
if (BaddieGroups.BA[B].health != "INFINITE") {
if (BaddieGroups.BA[B].health > 0) {
createFXBubble(1, BaddieGroups.BA[B], BirdAmRep.damage);
BaddieGroups.BA[B].health = BaddieGroups.BA[B].health - BirdAmRep.damage;
switch (BirdAmRep.setType) {
case "Homing" :
_root.birdStats.score = _root.birdStats.score + 100;
create_explosion(BaddieGroups.BA[B]);
_root.AttachSoundFX("missileExplode_Sound");
break;
case "Fire" :
_root.birdStats.score = _root.birdStats.score + 30;
createFXBubble(1, BaddieGroups.BA[B], BirdAmRep.fire);
burnEffect = {ra:BaddieGroups.BA[B].burn, rb:0, ga:BaddieGroups.BA[B].burn, gb:0, ba:BaddieGroups.BA[B].burn, bb:0, aa:100, ab:0};
BaddieGroups.BA[B].burn = BaddieGroups.BA[B].burn - 5;
burnTarget.setTransform(burnEffect);
break;
case "Normal" :
_root.birdStats.score = _root.birdStats.score + 10;
break;
case "Rapid" :
_root.birdStats.score = _root.birdStats.score + 5;
}
removeMovieClip(BirdAmRep);
delete BirdAmRep;
}
}
}
if ((BaddieGroups.BA[B].health <= 0) && (BaddieGroups.BA[B].health != "INFINITE")) {
BaddieGroups.BA[B].pattern = "dead";
}
}
B++;
}
A++;
}
}
function manage_Island() {
targetIsland = _root.Island.island;
targetIsland._x = targetIsland._x - 1.5;
if (targetIsland._x < -160) {
targetIsland._x = 1190;
}
}
function manage_Score() {
function initiateVariables_ScoreFormat() {
if (scoreStats == undefined) {
scoreStats = {colors:["0x00FF00", "0x0000FF", "0xFF0000"], iterNum:0};
baddiePhrases = ["Winning!", "Fo' Shizzle~", "Purple Drank"];
}
}
function manage_ScoreBox() {
function create_ScoreBox_TextFormat() {
if (ScoreBox.ScoreFormat == undefined) {
_root.ScoreBox.ScoreFormat = new TextFormat();
_root.ScoreBox.ScoreFormat.bold = true;
_root.ScoreBox.ScoreFormat.font = "Comic Sans MS";
_root.ScoreBox.ScoreFormat.size = 12;
}
if (scoreStats.iterNum == 4) {
scoreStats.iterNum = 0;
}
_root.ScoreBox.ScoreFormat.color = scoreStats.colors[scoreStats.iterNum];
scoreStats.iterNum++;
}
function create_ScoreBox_ScoreBox() {
_root.ScoreBox.createTextField("scoreBox", 0, 0, 0, 100, 17);
_root.ScoreBox.scoreBox.text = _root.birdStats.score;
_root.ScoreBox.scoreBox.setTextFormat(_root.ScoreBox.ScoreFormat);
_root.ScoreBox.scoreBox.selectable = false;
}
function manage_ScoreBox_XY() {
_root.ScoreBox.scoreBox._x = _root.targetBird._x - 25;
_root.ScoreBox.scoreBox._y = (_root.targetBird._y - _root.targetBird._height) - 5;
}
initiateVariables_ScoreFormat();
create_ScoreBox_TextFormat();
create_ScoreBox_ScoreBox();
manage_ScoreBox_XY();
}
manage_ScoreBox();
}
function manage_FXBubbles() {
function initiateFXBubbles() {
if (FXBubbleStats == undefined) {
FXBubbleStats = {B:[], bNum:0};
phraseBubbleFormat = new TextFormat();
phraseBubbleFormat.size = 12;
phraseBubbleFormat.color = 16711680 /* 0xFF0000 */;
phraseBubbleFormat.bold = true;
phraseBubbleFormat.font = "Comic Sans MS";
}
}
function evaporateBubble() {
i = 0;
while (i < FXBubbleStats.B.length) {
if (FXBubbleStats.B[i] != undefined) {
FXBubbleStats.B[i]._x = FXBubbleStats.B[i]._x - 5;
}
if (FXBubbleStats.B[i]._x < -300) {
removeMovieClip(FXBubbleStats.B[i]);
delete FXBubbleStats.B[i];
}
if (FXBubbleStats.B[i].TTevap != -5) {
if (FXBubbleStats.B[i].TTevap) {
FXBubbleStats.B[i].TTevap = FXBubbleStats.B[i].TTevap - 1;
} else if (FXBubbleStats.B[i]._alpha > 0) {
FXBubbleStats.B[i]._alpha = FXBubbleStats.B[i]._alpha - 5;
FXBubbleStats.B[i].setText._xscale = FXBubbleStats.B[i].setText._xscale - 5;
FXBubbleStats.B[i].setText._yscale = FXBubbleStats.B[i].setText._yscale - 5;
FXBubbleStats.B[i].setText._x = FXBubbleStats.B[i].setText._x + ((FXBubbleStats.B[i].setText._xscale / 100) * 2.5);
FXBubbleStats.B[i].setText._y = FXBubbleStats.B[i].setText._y + (FXBubbleStats.B[i].setText._yscale / 100);
} else {
removeMovieClip(FXBubbleStats.B[i]);
delete FXBubbleStats.B[i];
}
} else if ((FXBubbleStats.B[i].targ.health <= 0) || (FXBubbleStats.B[i].targ == undefined)) {
removeMovieClip(FXBubbleStats.B[i]);
delete FXBubbleStats.B[i];
}
i++;
}
}
initiateFXBubbles();
evaporateBubble();
}
function manage_PauseMenu() {
function initiateVaraibles() {
if (pauseStats == undefined) {
pauseStats = {pauseBTN:"UP", globalPause:false};
_root.remove_PauseMenu = function () {
_root.Sky.sky.sky.play();
_root.SoundPanel.soundPanel.play();
_root.Bird.bird.play();
_root.Sun.sun.play();
_root.Sun.sun.sun.play();
_root.Sun.sun.sun.sunTwirl.play();
_root.Sun.sun.sun.sunEyes.play();
_root.Sun.sun.sun.sun.play();
_root.Sun.sun.sun.sun.ray1.play();
_root.Sun.sun.sun.sun.ray2.play();
_root.Sun.sun.sun.sun.ray3.play();
_root.Sun.sun.sun.sun.ray4.play();
_root.Water.water.water1.play();
_root.Water.water.water2.play();
_root.menuTheme.menuTheme.stop();
if (battleStats.peaceTimer > 0) {
_root.ReadySetGo.readySetGo.play();
}
i = 0;
while (i < _root.BaddieGroups.BA.length) {
_root.BaddieGroups.BA[i].baddie.play();
i++;
}
removeMovieClip(_root.PauseMenu.pauseMenu);
_root.PowerOctopuss.powerOctopuss.play();
_root.PowerOctopuss.powerOctopuss.poweroctopuss.play();
_root.PowerOctopuss.powerOctopuss.poweroctopuss.octoHead.play();
_root.Music.song.start(songStats.secondsIn, 0);
pauseStats.globalPause = false;
};
_root.attach_PauseMenu = function () {
_root.Sky.sky.sky.stop();
_root.SoundPanel.soundPanel.stop();
_root.Bird.bird.stop();
_root.Sun.sun.stop();
_root.Sun.sun.sun.stop();
_root.Sun.sun.sun.sunTwirl.stop();
_root.Sun.sun.sun.sunEyes.stop();
_root.Sun.sun.sun.sun.stop();
_root.Sun.sun.sun.sun.ray1.stop();
_root.Sun.sun.sun.sun.ray2.stop();
_root.Sun.sun.sun.sun.ray3.stop();
_root.Sun.sun.sun.sun.ray4.stop();
_root.Water.water.water1.stop();
_root.Water.water.water2.stop();
_root.ReadySetGo.readySetGo.stop();
_root.menuTheme.menuTheme.stop();
i = 0;
while (i < _root.BaddieGroups.BA.length) {
_root.BaddieGroups.BA[i].baddie.stop();
i++;
}
_root.PowerOctopuss.powerOctopuss.stop();
_root.PowerOctopuss.powerOctopuss.poweroctopuss.stop();
_root.PowerOctopuss.powerOctopuss.poweroctopuss.octoHead.stop();
_root.PauseMenu.attachMovie("pauseMenu", "pauseMenu", 0);
_root.PauseMenu.pauseMenu.RTG_BTN.onPress = function () {
remove_PauseMenu();
};
_root.PauseMenu.pauseMenu.MM_BTN.onPress = function () {
_root.removeUselessVars();
removeMovieClip(_root.PauseMenu.pauseMenu);
_root.gotoAndPlay(1);
};
_root.PauseMenu.pauseMenu._x = 425;
_root.PauseMenu.pauseMenu._y = 250;
_root.Music.song.stop();
_root.menuTheme.menuTheme.attachSound("pauseMenuTheme_Sound");
_root.menuTheme.menuTheme.start(0, 999);
pauseStats.globalPause = true;
};
}
}
function manage_trophies() {
}
function manage_pause() {
if (Key.isDown(80) && (pauseStats.pauseBTN == "UP")) {
pauseStats.pauseBTN = "DOWN";
if (pauseStats.globalPause) {
remove_PauseMenu();
} else {
attach_PauseMenu();
}
} else if ((!Key.isDown(80)) && (pauseStats.pauseBTN == "DOWN")) {
pauseStats.pauseBTN = "UP";
}
}
initiateVaraibles();
manage_trophies();
manage_pause();
}
function onEnterFrame() {
if ((!pauseStats.globalPause) && (!birdStats.deathPhase)) {
_root.ScoreBoard.scoreBoard.selectable = false;
manage_Island();
manage_Bird();
manage_Arsenal();
manage_Battle();
manage_SoundPanel();
manage_HealthBar();
manage_AmmoDisplay();
manage_DamageSystem();
manage_Score();
manage_FXBubbles();
}
_root.bird_deathPhase();
if (!birdStats.deathPhase) {
manage_PauseMenu();
}
}
songStats = undefined;
stop();
_highquality = 0;
_root.Stage.showMenu = false;
_root.layers = {sky:addNum(), sun:addNum(), island:addNum(), CannonGuys:addNum(), KnifeGuy_Knife:addNum(), ShotLaydee_Shots:addNum(), PieClown_Pies:addNum(), baddies:addNum(), boats:addNum(), AirMines:addNum(), PowerOctopuss:addNum(), UnicycleClown_Puke:addNum(), TumorFreak_Hooks:addNum(), fish:addNum(), Explosions:addNum(), FXBubbles:addNum(), FeatherEffect:addNum(), SuperFireEffect:addNum(), bird:addNum(), ScoreBox:addNum(), arsenal:addNum(), scoreBoard:addNum(), DeathShark:addNum(), water:addNum(), soundPanel:addNum(), healthBar:addNum(), ammoDisplay:addNum(), music:addNum(), RSG:addNum(), CW:addNum(), PauseMenu:addNum(), DeathScene:addNum(), FadeOutScreen:addNum(), sound:addNum(), fireLoop:addNum(), elecLoop:addNum(), menuTheme:addNum()};
setUpStage();
_root.AttachSoundFX = function (instanceName, delay) {
_root.sound.sound.attachSound(instanceName);
_root.sound.sound.setVolume(100);
_root.sound.sound.start(delay, 0);
};
_root.removeUselessVars = function () {
dNum = 0;
birdBattle.togKeyDown = 0;
birdBattle.ammoType = 1;
battleStats.waveDigit1 = 0;
battleStats.waveDigit2 = 0;
battleStats.waveNumber = 0;
sharkStats.isOut = false;
boatsStats.spawnBad = false;
boatsStats.boatsLeft = 0;
boatsStats.resetBoat = 1;
boatsStats.boatTrig = 0;
boatsStats.boatNum = 0;
_root.resetForNextRound();
pauseStats.globalPause = false;
birdStats.health = birdStats.healthMax;
birdStats.score = 0;
birdStats.currentForm = "BIRD_IDLE";
birdStats.eatStage = 0;
birdStats.animated = true;
birdStats.dead = false;
birdStats.deathPhase = 0;
birdStats.presetSpd = 8;
birdSuperTrip.TL = 0;
powerOctopussStats.timesEaten = 0;
birdSpeeds = {rspd:0, lspd:0, dspd:0, uspd:0, xMomentum:0, yMomentum:0};
birdBattle = {ammoTog:0, togKeyDown:0, ammoType:1, totalAmmoTypes:5, norm:20, normMax:20, rapi:40, rapiMax:40, fire:15, fireMax:15, elec:40, elecMax:40, home:8, homeMax:8, currentRR:8, maxRR:8};
battleStats.waveNumber = 0;
removeMovieClip(_root.DeathShark.shark1);
removeMovieClip(_root.DeathScene.deathScene);
removeMovieClip(_root.ReadySetGo.wave);
removeMovieClip(_root.ReadySetGo.num1);
removeMovieClip(_root.ReadySetGo.num2);
removeMovieClip(_root.ReadySetGo.readySetGo);
removeMovieClip(_root.Sky);
removeMovieClip(_root.Sun);
removeMovieClip(_root.Island);
removeMovieClip(_root.Bird);
removeMovieClip(_root.ScoreBox);
removeMovieClip(_root.Arsenal);
removeMovieClip(_root.ScoreBoard);
removeMovieClip(_root.Water);
removeMovieClip(_root.SoundPanel);
removeMovieClip(_root.HealthBar);
removeMovieClip(_root.AmmoDisplay);
removeMovieClip(_root.Songs);
removeMovieClip(_root.ReadySetGo);
removeMovieClip(_root.ConsoleWindow);
removeMovieClip(_root.FadeOutScreen);
removeMovieClip(_root.PauseMenu);
removeMovieClip(_root.SFX);
removeMovieClip(_root.PowerOctopuss);
removeMovieClip(_root.DeathShark);
removeMovieClip(_root.Explosions);
stopAllSounds();
};
_root.createFXBubble = function (setType, targ, attackDam) {
if ((((setType == 1) || (setType == 0)) && (targ != undefined)) && (attackDam != undefined)) {
if (setType == 1) {
_root.FXBubbles.attachMovie("FXDamageClip", "FXClip" + FXBubbleStats.bNum, FXBubbleStats.bNum);
FXBubbleStats.B.push(_root.FXBubbles["FXClip" + FXBubbleStats.bNum]);
FXBubbleStats.B[FXBubbleStats.bNum].targ = targ;
FXBubbleStats.B[FXBubbleStats.bNum].TTevap = 10;
FXBubbleStats.B[FXBubbleStats.bNum].setText = attackDam;
FXBubbleStats.B[FXBubbleStats.bNum]._x = FXBubbleStats.B[FXBubbleStats.bNum].targ._x - (FXBubbleStats.B[FXBubbleStats.bNum].targ._width / 2);
FXBubbleStats.B[FXBubbleStats.bNum]._y = FXBubbleStats.B[FXBubbleStats.bNum].targ._y - (FXBubbleStats.B[FXBubbleStats.bNum].targ._height / 4);
} else {
_root.FXBubbles.attachMovie("FXBubbleClip", "FXClip" + FXBubbleStats.bNum, FXBubbleStats.bNum);
FXBubbleStats.B.push(_root.FXBubbles["FXClip" + FXBubbleStats.bNum]);
FXBubbleStats.B[FXBubbleStats.bNum].targ = targ;
FXBubbleStats.B[FXBubbleStats.bNum].createTextField("setText", 0, -90, -30, 60, 50);
FXBubbleStats.B[FXBubbleStats.bNum]._x = FXBubbleStats.B[FXBubbleStats.bNum].targ._x - (FXBubbleStats.B[FXBubbleStats.bNum].targ._width / 2);
FXBubbleStats.B[FXBubbleStats.bNum].setText.align = "Left";
FXBubbleStats.B[FXBubbleStats.bNum].setText.wordWrap = true;
FXBubbleStats.B[FXBubbleStats.bNum].TTevap = -5;
FXBubbleStats.B[FXBubbleStats.bNum].setText.text = baddiePhrases[random(3)];
FXBubbleStats.B[FXBubbleStats.bNum]._y = FXBubbleStats.B[FXBubbleStats.bNum].targ._y - (FXBubbleStats.B[FXBubbleStats.bNum].targ._height / 4);
FXBubbleStats.B[FXBubbleStats.bNum].setText.setTextFormat(phraseBubbleFormat);
}
FXBubbleStats.B[FXBubbleStats.bNum].setText.selectable = false;
FXBubbleStats.bNum++;
}
};
manage_VC();
Symbol 835 MovieClip Frame 40
stop();
Symbol 849 Button
on (release) {
startMovie();
}
Symbol 850 Button
on (release) {
_root.textBox1.removeReady = true;
startMovie();
}
Symbol 851 MovieClip Frame 1
function timerHandler() {
if (!loadingComplete) {
var _local4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._xscale = 100 * _local4;
if (_local4 == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop ("loaded");
}
return(undefined);
}
}
dt = getTimer() - time;
time = time + dt;
frameAccum = frameAccum + dt;
var _local3 = 0;
while ((frameAccum >= FRAME_TIME) && (_local3 < MAX_FRAME_SKIP)) {
advanceFrame(tankLogo, true, true);
advanceFrame(loadingText, false, true);
advanceFrame(barGfx, false, true);
if (loadingComplete) {
advanceFrame(this, false, false);
}
(frameAccum = frameAccum - FRAME_TIME);
_local3++;
}
updateAfterEvent();
}
function advanceFrame(clip, recurse, loop) {
if (!clip) {
return(undefined);
}
clip.stop();
if (clip._currentframe == clip._totalframes) {
if (loop) {
clip.gotoAndStop(1);
}
} else {
clip.nextFrame();
}
if (recurse) {
for (childName in clip) {
if (typeof(clip[childName]) == "movieclip") {
advanceFrame(clip[childName], recurse, loop);
}
}
}
}
function startMovie() {
clearInterval(intervalId);
_root.play();
}
_root.stop();
stop();
var FRAME_TIME = 33.3333333333333;
var AUTO_PLAY = false;
var MAX_FRAME_SKIP = 5;
var loadingComplete;
var intervalId;
var time;
var frameAccum;
loadingComplete = false;
intervalId = setInterval(this, "timerHandler", FRAME_TIME / 2);
frameAccum = 0;
time = getTimer();
timerHandler();