Frame 1
MochiAd.showPreGameAd({id:"7ecff3cef8862272", res:"650x400"});
Stage.showMenu = false;
Frame 2
rustyIntro.onRelease = function () {
getURL ("http://www.rustyarcade.com/index.php?ref=mecha_martyr&src=intro", "_blank");
};
stop();
Frame 3
function startLevel() {
motivationMessage = "Kill the grunts";
time_elapsed_min = 0;
_root.levelsDone = 0;
gameover.swapDepths(1000);
ui.swapDepths(997);
coverLeft.swapDepths(996);
coverRight.swapDepths(995);
_root.gamePaused = false;
resetPowerKeys();
sidePower = 0;
upPower = 0;
reloadSpeed = 0;
chopperAngle = 0;
activeWeapons = true;
gamePlaying = true;
level_score = 0;
default_score = 15;
goodHouses = new Array();
badHouses = new Array();
enemyStack = new Array();
enemyIDLoop = 0;
enemyWeaponStack = new Array();
enemyWeaponIDLoop = 0;
weaponStack = new Array();
weaponIDLoop = 0;
chopper.velx = 0;
chopper.vely = 0;
stats.health = 100;
chopper.health = stats.health;
chopper_health = chopper.health;
stats.levelUpDistance = 60;
gi.enemiesKilled = 0;
gi.choppersKilled = 0;
gi.planesKilled = 0;
gi.bulletsShot = 0;
gi.timeelapsed = 0;
gi.bulletsShotDown = 0;
gi.levelUpTime = stats.levelUpDistance;
gi.usedCheats = false;
chopper.weapon = 2;
chopper.nades = 1;
chopper.shurkiens = 0;
chopper.brandys = 0;
currentAmmo = "oo";
originalScaleWidth = santa._xscale;
chopper.turret = 1;
chopper.armor = 1;
chopper.wings = 1;
chopper.engine = 1;
chopper_turret = chopper.turret;
chopper_armor = chopper.armor;
chopper_wings = chopper.wings;
chopper_engine = chopper.engine;
stats.money = 0;
total_monies = stats.money;
level_on_playing = 1;
}
function playSound(mc, sound, offset, loops, volumeMod) {
if (muteVal) {
playingSound = new Sound(mc);
playingSound.attachSound(sound);
if (volumeMod == undefined) {
volUse = mainVolume;
} else if (mainVolume > volumeMod) {
volUse = volumeMod;
}
playingSound.setVolume(volUse);
if (loops == undefined) {
loops = 1;
}
if (offset == undefined) {
offset = 0;
}
playingSound.start(offset, loops);
}
return(playingSound);
}
function playASound(sound) {
if (muteVal) {
soundMc = this.createEmptyMovieClip("soundMc", 20000);
playingSound = new Sound(soundMc);
playingSound.attachSound(sound);
playingSound.setVolume(mainVolume);
if (loops == undefined) {
loops = 1;
}
if (offset == undefined) {
offset = 0;
}
playingSound.start(offset, loops);
}
}
function stopSound(snd) {
snd.stop();
}
function calculateDamageExp() {
if (_root.chopper.turret >= 10) {
return(0);
}
return(Math.round((Math.pow(_root.chopper.turret, 1.5) * 400) / 10) * 10);
}
function calculateAgilityExp() {
if (_root.chopper.wings >= 10) {
return(0);
}
return(Math.round((Math.pow(_root.chopper.wings, 1.3) * 300) / 10) * 10);
}
function calculateArmorExp() {
if (_root.chopper.armor >= 12) {
return(0);
}
return(Math.round((Math.pow(_root.chopper.armor, 1.3) * 500) / 10) * 10);
}
function calculateSpeedExp() {
if (_root.chopper.engine >= 10) {
return(0);
}
return(Math.round((Math.pow(_root.chopper.engine, 1.2) * 200) / 10) * 10);
}
function randBetween(left, right) {
diff = right - left;
return(random(diff) + left);
}
function addMoney(mon) {
stats.money = stats.money + mon;
_root.total_monies = _root.total_monies + mon;
}
function takeMoney(mon) {
stats.money = stats.money - mon;
_root.total_monies = _root.total_monies - mon;
}
function canAfford(mon) {
return((stats.money - mon) >= 0);
}
function removeFromStack(stack, mc, moveFrame) {
if (moveFrame == undefined) {
moveFrame = true;
}
var _local4 = 0;
i = 0;
while (i < stack.length) {
if (stack[i] == mc) {
if (moveFrame) {
stack[i].gotoAndStop(stack[i]._currentframe + 1);
}
stack = stack.splice(i, 1);
}
i++;
}
}
function removeAllSpawns() {
santa.removeMovieClip();
ui.removeMovieClip();
removeStack(enemyWeaponStack);
removeStack(weaponStack);
removeStack(enemyStack);
}
function removeStack(stack, part) {
i = 0;
while (i < stack.length) {
if (part == undefined) {
removeMovieClip(stack[i]);
} else {
removeMovieClip(stack[i][part]);
}
i++;
}
stack = [];
}
function spawnEnemy(type, place) {
if (type == undefined) {
type = 1;
}
var _local4 = enemyIDLoop;
if (_root["enemy" + (_local4 + 1)] == undefined) {
if (enemyIDLoop > 30) {
enemyIDLoop = 0;
} else {
enemyIDLoop++;
}
var _local2 = "enemy" + _local4;
duplicateMovieClip (enemy_orig, _local2, 20 + _local4);
enemyStack.push(_root[_local2]);
if (place == undefined) {
var _local7 = vcam._x + (random(2) * vcam._width);
} else {
var _local5 = _root.vcam._x - place;
if (Math.abs(_local5) < (_root.vcam._width / 2)) {
if (_local5 >= 0) {
place = _root.vcam._x + (_root.vcam._width / 1.8);
}
if (_local5 < 0) {
place = _root.vcam._x - (_root.vcam._width / 1.8);
}
}
var _local7 = place;
}
setProperty(_local2, _x , _local7);
setProperty(_local2, _y , (ground._y - 20) + ((enemyIDLoop / 30) * 40));
_root[_local2]._type = type;
_root[_local2].gotoAndStop((type * 6) - 5);
}
}
function spawnEnemyWeapon(type, mc) {
var _local5 = enemyWeaponIDLoop;
if (enemyWeaponIDLoop > 100) {
enemyWeaponIDLoop = 0;
} else {
enemyWeaponIDLoop++;
}
var _local3 = "we" + _local5;
duplicateMovieClip (eweapon_orig, _local3, 250 + _local5);
enemyWeaponStack.push(_root[_local3]);
if (type == 3) {
var _local7 = mc._x + 15;
var _local6 = mc._y - (mc._height * 0.3);
_root[_local3]._damage = 7;
} else if (type == 2) {
var _local7 = mc._x;
var _local6 = mc._y - (mc._height * 0.6);
_root[_local3]._damage = 5;
} else if (type == 4) {
if (mc._xscale > 0) {
var _local7 = mc._x + 30;
} else {
var _local7 = mc._x - 30;
}
var _local6 = mc._y - 90;
_root[_local3]._damage = 8;
} else if (type == 5) {
if (mc._xscale > 0) {
var _local7 = mc._x + 40;
} else {
var _local7 = mc._x - 40;
}
var _local6 = mc._y - 90;
_root[_local3]._damage = 3;
} else if (type == 6) {
var _local7 = mc._x;
var _local6 = mc._y - 110;
_root[_local3]._damage = 20;
} else if (type == 7) {
var _local7 = mc._x + 10;
var _local6 = mc._y + 15;
_root[_local3]._damage = 40;
} else if (type == 8) {
var _local7 = mc._x + 10;
var _local6 = mc._y - 8;
_root[_local3]._damage = 50;
} else {
var _local7 = mc._x + 15;
var _local6 = mc._y - (mc._height * 0.6);
_root[_local3]._damage = 3;
}
setProperty(_local3, _x , _local7);
setProperty(_local3, _y , _local6);
_root[_local3]._type = type;
_root[_local3].gotoAndStop((2 * type) - 1);
}
function spawnWeapon(type, mc) {
var _local3 = weaponIDLoop;
if (weaponIDLoop > 100) {
weaponIDLoop = 0;
} else {
weaponIDLoop++;
}
var _local2 = "w" + _local3;
removeFromStack(weaponStack, _root[_local2], false);
if (type == 1) {
duplicateMovieClip (weapon_orig, _local2, 100 + _local3);
} else {
duplicateMovieClip (weapon_orig, _local2, 200 + type);
}
weaponStack.push(_root[_local2]);
var _local6 = mc._x + (sidePower * 1.7);
var _local5 = mc._y + (upPower * 1.7);
setProperty(_local2, _x , _local6);
setProperty(_local2, _y , _local5);
_root[_local2]._type = type;
_root[_local2].gotoAndStop((2 * type) - 1);
}
function santaDies(mc) {
gamePlaying = false;
gameover.gotoAndPlay("die");
}
function updateDeadChopperVel(mc) {
if (mc._y < (ground._y + 300)) {
upPower = upPower + stats.PRESGRAVITY;
mc._y = mc._y + upPower;
} else {
mc.removeMovieClip();
}
}
function updateChopperVel(mc) {
gi.timeelapsed = gi.timeelapsed + 0.0333333333333333;
if (gi.levelUpTime > 0) {
gi.levelUpTime = gi.levelUpTime - 0.0333333333333333;
} else {
gi.levelUpTime = 0;
}
time_elapsed_sec = Math.round(gi.timeelapsed) % 60;
time_elapsed_min = Math.floor(gi.timeelapsed / 60);
if (time_elapsed_sec < 10) {
time_elapsed_sec = "0" + time_elapsed_sec;
}
time_elapsed = (time_elapsed_min + ":") + time_elapsed_sec;
time_elapsed_sec = Math.round(gi.levelUpTime) % 60;
time_elapsed_min = Math.floor(gi.levelUpTime / 60);
if (time_elapsed_sec < 10) {
time_elapsed_sec = "0" + time_elapsed_sec;
}
lvl_time_elapsed = (time_elapsed_min + ":") + time_elapsed_sec;
total_monies = stats.money;
weapons(mc);
if (rightDown) {
sidePower = sidePower + stats.speed;
} else if (leftDown) {
sidePower = sidePower - stats.speed;
} else if (sidePower < 0) {
sidePower = sidePower + stats.power_down;
if (sidePower > 0) {
sidePower = 0;
}
} else if (sidePower > 0) {
sidePower = sidePower - stats.power_down;
if (sidePower < 0) {
sidePower = 0;
}
}
if (upDown) {
upPower = upPower - stats.speed;
} else if (downDown) {
upPower = upPower + stats.speed;
upPower = upPower + stats.GRAVITY;
} else {
if (upPower < 0) {
upPower = upPower + stats.power_down;
if (upPower > 0) {
upPower = 0;
}
} else if (upPower > 0) {
upPower = upPower - stats.power_down;
if (upPower < 0) {
upPower = 0;
}
}
upPower = upPower + stats.GRAVITY;
}
if (upPower > stats.MAX_POWER) {
upPower = stats.MAX_POWER;
} else if (upPower < (-stats.MAX_POWER)) {
upPower = -stats.MAX_POWER;
}
if (sidePower > stats.MAX_POWER) {
sidePower = stats.MAX_POWER;
} else if (sidePower < (-stats.MAX_POWER)) {
sidePower = -stats.MAX_POWER;
}
if (((mc._y - (mc._height / 2)) < ceiling._y) && (upPower < 0)) {
upPower = 0;
}
if (((mc._y + (mc._height / 2)) > (ground._y - 100)) && (upPower > 0)) {
upPower = 0;
}
if (((mc._x - (mc._width / 2)) < left._x) && (sidePower < 0)) {
sidePower = -sidePower;
}
if (((mc._x + (mc._width / 2)) > right._x) && (sidePower > 0)) {
sidePower = -sidePower;
}
var _local4 = _root._xmouse - mc._x;
var _local5 = _root._ymouse - mc._y;
var _local3 = Math.atan2(_local5, _local4);
_local3 = 57.2957795130823 * _local3;
chopperAngle = _local3;
if ((_local3 < -90) || (_local3 > 90)) {
mc._xscale = -originalScaleWidth;
_local3 = _local3 + 180;
} else {
mc._xscale = originalScaleWidth;
}
mc._rotation = _local3;
mc._x = mc._x + sidePower;
mc._y = mc._y + upPower;
_local4 = _root._xmouse - vcam._x;
_local5 = (_root._ymouse + 100) - vcam._y;
if (_local4 > 400) {
_local4 = 400;
} else if (_local4 < -400) {
_local4 = -400;
}
if (_local5 > 200) {
_local5 = 200;
} else if (_local5 < -200) {
_local5 = -200;
}
vcam._x = vcam._x + ((mc._x - vcam._x) / 15);
vcam._x = vcam._x + (_local4 / 30);
if ((vcam._x - (vcam._width / 2)) < left._x) {
vcam._x = left._x + (vcam._width / 2);
} else if ((vcam._x + (vcam._width / 2)) > right._x) {
vcam._x = right._x - (vcam._width / 2);
}
vcam._y = vcam._y + ((mc._y - vcam._y) / 15);
vcam._y = vcam._y + (_local5 / 20);
if (((vcam._y - (vcam._height / 2)) + 50) < ceiling._y) {
vcam._y = (ceiling._y + (vcam._height / 2)) - 50;
} else if ((vcam._y + (vcam._height / 2)) > (ground._y + 20)) {
vcam._y = (ground._y + 20) - (vcam._height / 2);
}
}
function weapons(mc) {
uiWeapon = chopper.weapon;
enemiesKilled = gi.enemiesKilled;
if (weaponFire && (mc.turret._currentframe == 1)) {
mc.turret.gotoAndStop(2);
} else if ((!weaponFire) && (mc.turret._currentframe == 2)) {
mc.turret.gotoAndStop(1);
}
if (chopper.cooldown <= 0) {
weaponFire = false;
stopSound(gunFireSound);
laserHiss = playSound(this, "laserHiss");
}
if (weaponFire) {
spawnWeapon(1, mc);
if (chopper.turret >= 4) {
spawnWeapon(1, mc);
}
if (chopper.turret >= 7) {
spawnWeapon(1, mc);
}
chopper.cooldown = chopper.cooldown - 0.3;
} else if (chopper.cooldown < stats.cooldown) {
chopper.cooldown++;
}
if ((weaponDown == 1) && (activeWeapons)) {
if (((chopper.weapon == 2) || ((chopper.weapon == 3) && (chopper.shurikens > 0))) || ((chopper.weapon == 4) && (chopper.brandys > 0))) {
weaponDown = 0;
spawnWeapon(chopper.weapon, mc);
switch (chopper.weapon) {
case 2 :
chopper.nades = 2;
ui.uiMC.grenade1.gotoAndPlay(1);
break;
case 3 :
chopper.shurikens = 2;
ui.uiMC.grenade2.gotoAndPlay(1);
break;
case 4 :
chopper.brandys = 2;
ui.uiMC.grenade3.gotoAndPlay(1);
break;
default :
chopper.nades = 2;
}
}
}
}
function resetPowerKeys() {
rightDown = false;
leftDown = false;
upDown = false;
downDown = false;
weaponFire = false;
weaponDown = 0;
}
function chooseGrenade(type) {
if (type == 2) {
_root.ui.uiMC.grenadeSelector._x = _root.ui.uiMC.grenade1._x;
} else if (type == 3) {
_root.ui.uiMC.grenadeSelector._x = _root.ui.uiMC.grenade2._x;
} else if (type == 4) {
_root.ui.uiMC.grenadeSelector._x = _root.ui.uiMC.grenade3._x;
}
chopper.weapon = type;
}
function updateLevelLevels(useTrueVals) {
if (useTrueVals) {
updateBodyLevel(trueBody);
updateTurretLevel(trueTurret);
updateEngineLevel(trueEngine);
updateWingLevel(trueWing);
} else {
updateBodyLevel();
updateTurretLevel();
updateEngineLevel();
updateWingLevel();
}
chopper_turret = chopper.turret;
chopper_armor = chopper.armor;
chopper_wings = chopper.wings;
chopper_engine = chopper.engine;
}
function updateBodyLevel(mc, trueVal) {
if (trueVal) {
trueBody = mc;
}
if (mc != undefined) {
lastBody = mc;
} else {
mc = lastBody;
}
mc.gotoAndStop(chopper.armor);
}
function updateTurretLevel(mc, trueVal) {
if (trueVal) {
trueTurret = mc;
}
if (mc != undefined) {
lastTurret = mc;
} else {
mc = lastTurret;
}
mc.gotoAndStop(chopper.turret);
}
function updateWingLevel(mc, trueVal) {
if (trueVal) {
trueWing = mc;
}
if (mc != undefined) {
lastWing = mc;
} else {
mc = lastWing;
}
mc.gotoAndStop(chopper.wings);
}
function updateEngineLevel(mc, trueVal) {
if (trueVal) {
trueEngine = mc;
}
if (mc != undefined) {
lastEngine = mc;
} else {
mc = lastEngine;
}
mc.gotoAndStop(chopper.engine);
}
function soundComplete() {
if (soundPlaying == "song1") {
soundPlaying = "song2";
} else if (soundPlaying == "song2") {
soundPlaying = "song3";
} else if (soundPlaying == "song3") {
soundPlaying = "song1";
}
backgroundMusic.attachSound(soundPlaying);
backgroundMusic.start(0, 1);
}
mochi.MochiServices.connect("7ecff3cef8862272");
var stats = new Object();
stats.speed = 0.2;
stats.health = 100;
stats.power_down = 0.08;
stats.GRAVITY = 0;
stats.PRESGRAVITY = 0.3;
stats.AIR_RESIST = 0.03;
stats.MAX_RIGHT_ROTATE = 40;
stats.MAX_LEFT_ROTATE = 30;
stats.MAX_POWER = 5;
stats.money = 0;
stats.levelUpDistance = 60;
stats.cooldown = 100;
var gi = new Object();
gi.enemiesKilled = 0;
gi.choppersKilled = 0;
gi.planesKilled = 0;
gi.bulletsShotDown = 0;
gi.bulletsShot = 0;
gi.timeelapsed = 0;
gi.levelUpTime = 0;
gi.usedCheats = false;
var chopper = new Object();
chopper.velx = 0;
chopper.vely = 0;
chopper.health = 100;
chopper.weapon = 2;
chopper.nades = 1;
chopper.shurikens = 0;
chopper.brandys = 0;
chopper.turret = 1;
chopper.armor = 1;
chopper.wings = 1;
chopper.engine = 1;
chopper.cooldown = 100;
numMedals = 12;
firstPlay = true;
firstPlayTut = false;
var medals = new Array(numMedals);
i = 0;
while (i < numMedals) {
medals[i] = false;
i++;
}
if (mainVolume == undefined) {
mainVolume = 70;
}
if (muteVal == undefined) {
muteVal = true;
}
totalScore = 0;
var enemyStack = new Array();
var enemyIDLoop = 0;
var enemyWeaponStack = new Array();
var enemyWeaponIDLoop = 0;
var weaponStack = new Array();
var weaponIDLoop = 0;
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (gamePlaying && (!gamePaused)) {
Mouse.hide();
if (aimCursor.getDepth() < (_root.getNextHighestDepth() - 1)) {
aimCursor.swapDepths(_root.getNextHighestDepth());
}
trace(aimCursor.getDepth());
if (chopper.cooldown >= ((stats.cooldown / 100) * 25)) {
gunFireSound = playSound(santa, "gunFire5", 0.06, 99, 70);
weaponFire = true;
} else {
playSound(santa, "grinding");
}
}
};
mouseListener.onMouseUp = function () {
stopSound(gunFireSound);
weaponFire = false;
};
mouseListener.onMouseWheel = function (delta) {
if (delta > 0) {
if (chopper.weapon == 2) {
if (chopper.shurikens > 0) {
chooseGrenade(3);
} else if (chopper.brandys > 0) {
chooseGrenade(4);
}
} else if (chopper.weapon == 3) {
if (chopper.brandys > 0) {
chooseGrenade(4);
} else {
chooseGrenade(2);
}
} else if (chopper.weapon == 4) {
chooseGrenade(2);
}
} else if (chopper.weapon == 2) {
if (chopper.brandys > 0) {
chooseGrenade(4);
} else if (chopper.shurikens > 0) {
chooseGrenade(3);
}
} else if (chopper.weapon == 3) {
chooseGrenade(2);
} else if (chopper.weapon == 4) {
if (chopper.shurikens > 0) {
chooseGrenade(3);
} else {
chooseGrenade(2);
}
}
};
Mouse.addListener(mouseListener);
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (Key.getCode() == 68) {
rightDown = true;
} else if (Key.getCode() == 65) {
leftDown = true;
}
if (Key.getCode() == 87) {
upDown = true;
} else if (Key.getCode() == 83) {
downDown = true;
}
if ((Key.getCode() == 32) && ((((chopper.weapon == 2) && (chopper.nades == 1)) || ((chopper.weapon == 3) && (chopper.shurikens == 1))) || ((chopper.weapon == 4) && (chopper.brandys == 1)))) {
weaponDown = 1;
}
if (Key.getCode() == 49) {
chooseGrenade(2);
} else if ((Key.getCode() == 50) && (chopper.shurikens > 0)) {
chooseGrenade(3);
} else if ((Key.getCode() == 51) && (chopper.brandys > 0)) {
chooseGrenade(4);
}
};
keyListener.onKeyUp = function () {
if (Key.getCode() == 68) {
rightDown = false;
}
if (Key.getCode() == 65) {
leftDown = false;
}
if (Key.getCode() == 87) {
upDown = false;
}
if (Key.getCode() == 83) {
downDown = false;
}
if (Key.getCode() == 81) {
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
} else if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
} else if (_root._quality == "HIGH") {
_root._quality = "LOW";
}
}
if (Key.getCode() == 78) {
backgroundMusic.stop();
soundComplete();
}
if (Key.getCode() == 77) {
muteVal = !muteVal;
if (!muteVal) {
backgroundMusic.setVolume(0);
} else {
backgroundMusic.setVolume(mainVolume);
}
}
if (((Key.getCode() == 80) && (!_root.gamePaused)) && (_root.gamePlaying)) {
_root.gamePaused = true;
_root.gameover.gotoAndPlay("paused");
}
};
Key.addListener(keyListener);
ranSound = random(3);
if (ranSound == 0) {
soundPlaying = "song1";
} else if (ranSound == 1) {
soundPlaying = "song2";
} else if (ranSound == 2) {
soundPlaying = "song3";
}
backgroundMusic = playSound(bgmusic, soundPlaying);
bgmusic.swapDepths(20001);
backgroundMusic.onSoundComplete = soundComplete;
Frame 4
function updateMonies() {
monies = stats.money;
}
function gotoLevel(num) {
_root.levelNumber = num;
gotoAndStop(num +9);
}
removeMovieClip(gameover);
if (retryVar != undefined) {
gotoAndStop(retryVar +9);
retryVar = undefined;
}
health_level = Math.round(((stats.health - 100) / 10) + 1);
speed_level = Math.round(((stats.MAX_POWER - 5) / 0.1) + 1);
agility_level = Math.round(((stats.speed - 0.2) / 0.01) + 1);
updateMonies();
stop();
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("0a82e299", this, 10301, true);
Frame 5
stop();
Instance of Symbol 136 MovieClip in Frame 5
onClipEvent (mouseDown) {
if (this.hitTest(_level0._xmouse, _level0._ymouse)) {
followMouse = true;
}
}
onClipEvent (enterFrame) {
if (followMouse) {
this._x = _level0._xmouse - _parent._x;
if (this._x < lineStart) {
this._x = lineStart;
} else if (this._x > lineEnd) {
this._x = lineEnd;
}
}
}
onClipEvent (mouseUp) {
if (followMouse) {
followMouse = false;
_root.mainVolume = (this._x - lineStart) / lineRatio;
if (_root.mainVolume < 0) {
_root.mainVolume = 0;
} else if (_root.mainVolume > 100) {
_root.mainVolume = 100;
}
_root.backgroundMusic.setVolume(_root.mainVolume);
}
}
onClipEvent (load) {
linemc = _parent.audioslider;
lineStart = linemc._x - (linemc._width / 2);
lineEnd = linemc._x + (linemc._width / 2);
lineLength = lineEnd - lineStart;
lineRatio = lineLength / 100;
this._x = (_root.mainVolume * lineRatio) + lineStart;
followMouse = false;
}
Frame 6
stop();
Frame 7
if (submitScore == 1) {
mochi.MochiScores.showLeaderboard({boardID:"a8b663eea7cc8149", score:playerScore, onClose:function () {
gotoAndStop ("mainMenu");
}});
submitScore = 0;
} else {
mochi.MochiScores.showLeaderboard({boardID:"a8b663eea7cc8149", onClose:function () {
gotoAndStop ("mainMenu");
}});
}
Frame 8
stop();
Frame 9
stop();
Frame 10
function rangeLeft() {
return(left._x);
}
function rangeRight() {
return(right._x);
}
startLevel();
spawnEnemy(1, santa._x);
Mouse.hide();
aimCursor.swapDepths(_root.getNextHighestDepth());
firstPlay = false;
createEmptyMovieClip("level", 22222);
level.onEnterFrame = function () {
aimCursor._x = _xmouse;
aimCursor._y = _ymouse;
if ((!_root.gamePaused) && (_root.gamePlaying)) {
if (_root.medalGotIden != undefined) {
_root.medalGotIden = undefined;
_root.ui.achievement.gotoAndPlay(35);
}
if (gi.levelUpTime <= 0) {
_root.levelsDone++;
switch (levelsDone) {
case 1 :
spawnEnemy(2, santa._x);
motivationMessage = "Here come the rockets";
break;
case 2 :
spawnEnemy(3, santa._x);
motivationMessage = "Can you handle the grenaders?";
break;
case 3 :
spawnEnemy(4, santa._x);
motivationMessage = "Another minute. Motorbikes this time";
break;
case 4 :
spawnEnemy(5, santa._x);
motivationMessage = "Hey you're getting good at this";
break;
case 5 :
spawnEnemy(6, santa._x);
motivationMessage = "Tanks a comin'";
break;
case 6 :
spawnEnemy(7, santa._x);
motivationMessage = "Aiie the helicopters";
break;
case 7 :
spawnEnemy(8, santa._x);
motivationMessage = "Bring the pain";
break;
case 8 :
spawnEnemy(8, santa._x);
spawnEnemy(7, santa._x);
motivationMessage = "Here comes the smackdown";
break;
case 9 :
motivationMessage = "A minute can be a really long time";
break;
case 10 :
motivationMessage = "I have to think this through";
break;
case 11 :
motivationMessage = "Okay, you're going down this time";
break;
case 12 :
motivationMessage = "This time, for sure";
break;
case 13 :
motivationMessage = "You're becoming a pain";
break;
case 14 :
motivationMessage = "Seriously, let's call it even?";
break;
default :
motivationMessage = "Survive one minute";
}
gameover.gotoAndPlay("levelUp");
}
var _local2 = 120 - (gi.timeelapsed / 2);
if (_local2 < 60) {
_local2 = 60;
}
if ((random(_local2) < 1) && (!_root.gamePaused)) {
if ((gi.timeelapsed > 420) && (random(10) < 2)) {
spawnEnemy(8, randBetween(rangeLeft(), rangeRight()));
} else if ((gi.timeelapsed > 360) && (random(10) < 3)) {
spawnEnemy(7, randBetween(rangeLeft(), rangeRight()));
} else if ((gi.timeelapsed > 300) && (random(10) < 4)) {
spawnEnemy(6, randBetween(rangeLeft(), rangeRight()));
} else if ((gi.timeelapsed > 240) && (random(10) < 5)) {
spawnEnemy(5, randBetween(rangeLeft(), rangeRight()));
} else if ((gi.timeelapsed > 180) && (random(10) < 6)) {
spawnEnemy(4, randBetween(rangeLeft(), rangeRight()));
} else if ((gi.timeelapsed > 120) && (random(10) < 7)) {
spawnEnemy(3, randBetween(rangeLeft(), rangeRight()));
} else if ((gi.timeelapsed > 60) && (random(10) < 8)) {
spawnEnemy(2, randBetween(rangeLeft(), rangeRight()));
} else {
spawnEnemy(1, randBetween(rangeLeft(), rangeRight()));
}
}
}
};
stop();
Instance of Symbol 1080 MovieClip "enemy_orig" in Frame 10
onClipEvent (load) {
if (this._name == "enemy_orig") {
alive = false;
} else {
alive = true;
}
travelling = false;
facingRight = _xscale;
canFire = 0;
startFrame = (this._type * 6) - 5;
if (this._type == 1) {
speed = (random(20) / 10) + 4;
randomStopper = random(11) - 5;
if (randomStopper < speed) {
randomStopper = speed + 1;
}
distanceFollow = random(50) + 200;
distanceInvisible = random(100) + 1000;
distanceStop = random(20) + 100;
fireLength = 4;
health = 20;
} else if (this._type == 2) {
speed = (random(10) / 10) + 3;
randomStopper = random(21) - 10;
if (randomStopper < speed) {
randomStopper = speed + 1;
}
distanceFollow = random(50) + 400;
distanceInvisible = random(50) + 1000;
distanceStop = random(50) + 300;
fireLength = 12;
health = 40;
} else if (this._type == 3) {
speed = (random(10) / 10) + 2;
randomStopper = random(31) - 15;
if (randomStopper < speed) {
randomStopper = speed + 1;
}
distanceFollow = random(50) + 400;
distanceInvisible = random(50) + 1000;
distanceStop = random(50) + 200;
fireLength = 19;
health = 60;
} else if (this._type == 4) {
speed = (random(10) / 10) + 8;
distanceFollow = random(30) + 400;
distanceInvisible = random(50) + 1000;
fireLength = 12;
health = 150;
} else if (this._type == 5) {
speed = (random(10) / 10) + 7;
distanceFollow = random(30) + 400;
distanceInvisible = random(50) + 1000;
fireLength = 17;
health = 600;
} else if (this._type == 6) {
speed = 2;
distanceFollow = random(30) + 500;
distanceInvisible = random(50) + 1000;
distanceStop = random(20) + 400;
health = 1500;
fireLength = 11;
} else if (this._type == 7) {
speed = (random(6) / 10) + 4;
upspeed = 1;
directionRandom = 0.2;
distanceFollow = random(30) + 800;
distanceInvisible = random(50) + 1000;
distanceStop = random(20) + 400;
this._y = -10 + random(150);
defaultY = this._y;
fireLength = 17;
health = 2000;
falling = 0;
} else if (this._type == 8) {
speed = (random(6) / 10) + 12;
uppySpeed = 1.5 + (random(10) / 10);
upperLimit = -60;
lowerLimit = 70;
distanceFollow = random(30) + 400;
distanceInvisible = random(50) + 2000;
this._y = -60 + random(110);
defaultY = this._y;
fireLength = 18;
health = 3000;
falling = 0;
}
this.stop();
}
onClipEvent (enterFrame) {
colorTrans.redOffset = 0;
if ((alive && (_root.gamePlaying)) && (!_root.gamePaused)) {
var distanceToSanta = (this._x - _root.santa._x);
var absDistanceToSanta = Math.abs(distanceToSanta);
if (((this._type <= 3) || (this._type == 7)) || (this._type == 6)) {
if (absDistanceToSanta > distanceInvisible) {
if (random(40) == 0) {
this._xscale = facingRight;
} else if (random(40) == 1) {
this._xscale = -facingRight;
}
} else {
if (distanceToSanta <= 0) {
this._xscale = facingRight;
} else {
this._xscale = -facingRight;
}
if (absDistanceToSanta > distanceFollow) {
travelling = true;
}
}
if (this._type == 7) {
var distanceToTravel = (_root.santa._y - this._y);
if (distanceToTravel > (upspeed * 10)) {
this._y = this._y + upspeed;
directionRandom = 0.2;
} else if (distanceToTravel < ((-upspeed) * 10)) {
this._y = this._y - upspeed;
directionRandom = -0.2;
} else {
this._y = this._y + directionRandom;
}
}
if (travelling) {
this.gotoAndStop(startFrame + 2);
var distanceToTravel = (_root.santa._x - this._x);
if (distanceToTravel > 0) {
this._x = this._x + speed;
this._xscale = facingRight;
} else {
this._x = this._x - speed;
this._xscale = -facingRight;
}
if ((Math.abs(distanceToTravel) < distanceStop) || (absDistanceToSanta > distanceInvisible)) {
this.gotoAndStop(startFrame);
travelling = false;
}
} else if (((random(20) == 0) && (canFire == 0)) && (absDistanceToSanta < distanceFollow)) {
this.gotoAndStop(startFrame + 1);
_root.spawnEnemyWeapon(this._type, this);
canFire = 60;
} else if (canFire < (60 - fireLength)) {
this.gotoAndStop(startFrame);
} else if ((this._type == 7) && (canFire == 50)) {
_root.spawnEnemyWeapon(this._type, this);
}
if (canFire > 0) {
canFire--;
}
} else if ((this._type <= 5) || (this._type == 8)) {
if (!travelling) {
if (absDistanceToSanta < distanceInvisible) {
if (distanceToSanta <= 0) {
this._xscale = facingRight;
} else {
this._xscale = -facingRight;
}
travelling = true;
if (distanceToSanta < 0) {
directionOfTravel = 1;
} else {
directionOfTravel = -1;
}
}
} else {
if (this._type == 8) {
this._y = this._y + uppySpeed;
if (this._y > lowerLimit) {
this._y = lowerLimit;
uppySpeed = uppySpeed * -1;
} else if (this._y < upperLimit) {
this._y = upperLimit;
uppySpeed = uppySpeed * -1;
}
if (((_root.santa._y - this._y) < 0) && (uppySpeed > 0)) {
uppySpeed = uppySpeed * -1;
}
}
this._x = this._x + (speed * directionOfTravel);
if (((directionOfTravel > 0) && (this._x > (_root.vcam._x + 600))) || ((directionOfTravel < 0) && (this._x < (_root.vcam._x - 600)))) {
travelling = false;
}
if (((distanceToSanta < 0) && (directionOfTravel > 0)) || ((distanceToSanta > 0) && (directionOfTravel < 0))) {
sameDirection = true;
} else {
sameDirection = false;
}
if ((((canFire == 0) && (absDistanceToSanta < distanceFollow)) && (sameDirection)) && (absDistanceToSanta > 200)) {
this.gotoAndStop(startFrame + 1);
_root.spawnEnemyWeapon(this._type, this);
if (((((this._type == 2) || (this._type == 4)) || (this._type == 6)) || (this._type == 7)) || (this._type == 8)) {
_root.playSound(this, "missileLaunch");
}
canFire = 30;
} else if (canFire < (30 - fireLength)) {
this.gotoAndStop(startFrame);
} else if ((this._type == 5) && ((canFire % 2) == 0)) {
_root.playSound(this, "gunFire5");
_root.spawnEnemyWeapon(this._type, this);
}
if (canFire > 0) {
canFire--;
}
}
}
var colorTrans = (new flash.geom.ColorTransform());
i = 0;
while (i < _root.weaponStack.length) {
if (this.hitTest(_root.weaponStack[i])) {
if (_root.weaponStack[i]._active) {
if (((((_root.weaponStack[i]._type == 4) || (_root.weaponStack[i]._type == 3)) || (_root.weaponStack[i]._type == 2)) && (!_root.weaponStack[i]._alive)) || (_root.weaponStack[i]._type == 1)) {
colorTrans.redOffset = 100;
if (this._type <= 3) {
_root.weaponStack[i]._bloody = true;
if (_root.weaponStack[i]._type == 3) {
health = health - (_root.weaponStack[i]._damage / 2);
} else {
health = health - _root.weaponStack[i]._damage;
}
} else if (_root.weaponStack[i]._type == 2) {
health = health - (_root.weaponStack[i]._damage / 2);
} else {
health = health - _root.weaponStack[i]._damage;
}
if ((_root.weaponStack[i]._type == 1) && (_root.chopper.turret < 5)) {
_root.weaponStack[i]._active = false;
_root.weaponStack[i]._alive = false;
}
}
} else {
colorTrans.redOffset = 0;
}
if (health <= 0) {
alive = false;
if (_root.weaponStack[i]._type == 1) {
this.gotoAndStop(startFrame + 3);
} else if (_root.weaponStack[i]._type == 2) {
this.gotoAndStop(startFrame + 4);
} else if (_root.weaponStack[i]._type == 3) {
this.gotoAndStop(startFrame + 5);
} else if (_root.weaponStack[i]._type == 4) {
this.gotoAndStop(startFrame + 4);
}
_root.removeFromStack(_root.enemyStack, this, false);
_root.addMoney(this._type * 100);
_root.gi.enemiesKilled++;
if (this._type == 1) {
_root.playSound(this, "manDie");
} else if (this._type == 2) {
_root.playSound(this, "manDie");
} else if (this._type == 3) {
_root.playSound(this, "manDie");
} else if (this._type == 6) {
_root.playSound(this, "explodeCar");
} else if (this._type == 6) {
_root.playSound(this, "explodeCar");
} else if (this._type == 6) {
_root.playSound(this, "explodeCar");
} else if (this._type == 7) {
_root.gi.choppersKilled++;
_root.playSound(this, "diePlane");
} else if (this._type == 8) {
_root.gi.planesKilled++;
_root.playSound(this, "diePlane");
}
}
}
i++;
}
} else if (!_root.gamePlaying) {
}
var trans = (new flash.geom.Transform(this));
trans.colorTransform = colorTrans;
if (_root.levelOver) {
}
if ((!alive) && ((this._type == 7) || (this._type == 8))) {
falling = falling + 0.3;
this._y = this._y + falling;
}
if ((!alive) && (((this._type == 4) || (this._type == 5)) || (this._type == 8))) {
if (speed >= 0.5) {
speed = speed - 0.1;
} else {
speed = 0;
}
this._x = this._x + (speed * directionOfTravel);
}
}
Instance of Symbol 1216 MovieClip "santa" in Frame 10
onClipEvent (enterFrame) {
if (_root.gamePlaying && (!_root.gamePaused)) {
_root.updateChopperVel(this);
i = 0;
while (i < _root.enemyWeaponStack.length) {
if (this.hitTest(_root.enemyWeaponStack[i]._x, _root.enemyWeaponStack[i]._y, true)) {
_root.enemyWeaponStack[i]._alive = false;
_root.chopper.health = _root.chopper.health - _root.enemyWeaponStack[i]._damage;
_root.chopper_health = Math.round(_root.chopper.health);
if (_root.chopper.health > 40) {
this.gotoAndStop(3);
} else if (_root.chopper.health > 0) {
_root.playSound(this, "warningHealth");
this.gotoAndStop(4);
} else if (_root.chopper.health <= 0) {
_root.chopper_health = 0;
_root.santaDies(this);
this.gotoAndStop(5);
}
_root.removeFromStack(_root.enemyWeaponStack, _root.enemyWeaponStack[i]);
}
i++;
}
if (!Key.isDown(68)) {
_root.rightDown = false;
}
if (!Key.isDown(65)) {
_root.leftDown = false;
}
if (!Key.isDown(87)) {
_root.upDown = false;
}
if (!Key.isDown(83)) {
_root.downDown = false;
}
} else if (!_root.gamePlaying) {
_root.updateDeadChopperVel(this);
}
}
onClipEvent (load) {
this.gotoAndStop(2);
this.swapDepths(400);
}
Instance of Symbol 1278 MovieClip "weapon_orig" in Frame 10
onClipEvent (load) {
if (this._name == "weapon_orig") {
removeMovieClip(this);
_alive = false;
no_sploded = false;
} else {
_alive = true;
no_sploded = true;
}
_active = true;
type = _type;
if (type == 1) {
var xDist = (_root._xmouse - this._x);
var yDist = (_root._ymouse - this._y);
var angle = Math.atan2(yDist, xDist);
this._rotation = 57.2957795130823 * angle;
var fastVal = (random(30) + 40);
this._x = this._x + (Math.cos(angle) * fastVal);
this._y = this._y + (Math.sin(angle) * fastVal);
var fastVal = 50;
velx = Math.cos(angle) * (random(7) + fastVal);
vely = Math.sin(angle) * (random(7) + fastVal);
this._damage = (_root.chopper.turret + 3) / 3;
this.main_bullet.gotoAndStop(_root.chopper.turret);
fuse = 10;
} else if (type == 2) {
velx = _root.sidePower;
vely = _root.upPower;
fuse = 60;
this._damage = 10;
} else if (type == 3) {
velx = _root.sidePower;
vely = _root.upPower;
fuse = 70;
this._damage = 20;
} else if (type == 4) {
velx = _root.sidePower;
vely = _root.upPower;
fuse = 80;
this._damage = 30;
}
stop();
}
onClipEvent (enterFrame) {
if (_alive && (!_root.gamePaused)) {
this._x = this._x + velx;
this._y = this._y + vely;
if (type != 1) {
vely = vely + _root.stats.PRESGRAVITY;
if (velx >= _root.stats.AIR_RESIST) {
velx = velx - _root.stats.AIR_RESIST;
} else if (velx <= (-_root.stats.AIR_RESIST)) {
velx = velx + _root.stats.AIR_RESIST;
} else {
velx = 0;
}
}
if (this._y > _root.ground._y) {
if (type == 1) {
this._y = _root.ground._y;
_active = false;
_alive = false;
} else {
this._y = _root.ground._y;
vely = 0;
velx = 0;
}
} else if ((type == 1) && (this._y < _root.ceiling._y)) {
this._y = _root.ceiling._y;
_active = false;
_alive = false;
}
if (fuse <= 0) {
if (type == 2) {
_root.playSound(this, "grenadeExplosion");
} else if (type == 3) {
_root.playSound(this, "grenadeExplosion2");
} else if (type == 4) {
_root.playSound(this, "grenadeExplosion3");
}
_alive = false;
}
fuse--;
}
if ((!_alive) && (no_sploded)) {
this.gotoAndStop(this._currentframe + 1);
if (_bloody) {
this.bullet_splode.gotoAndStop(2);
} else {
this.bullet_splode.gotoAndStop(1);
}
no_sploded = false;
}
}
Instance of Symbol 1316 MovieClip "eweapon_orig" in Frame 10
onClipEvent (load) {
if (this._name == "eweapon_orig") {
removeMovieClip(this);
this._alive = false;
} else {
this._alive = true;
}
if (this._type == 1) {
velx = _root.santa._x - this._x;
vely = _root.santa._y - this._y;
angle = Math.atan2(velx, vely);
angle = angle + ((random(5) - 2) * 0.1);
velx = Math.sin(angle) * 10;
vely = Math.cos(angle) * 10;
} else if (this._type == 2) {
velx = _root.santa._x - this._x;
vely = _root.santa._y - this._y;
angle = Math.atan2(velx, vely);
if (angle < 0) {
angle = angle - ((random(3) + 2) * 0.1);
} else {
angle = angle + ((random(3) + 2) * 0.1);
}
velx = Math.sin(angle) * 15;
vely = Math.cos(angle) * 15;
} else if (this._type == 3) {
directionOfSanta = _root.santa._x - this._x;
velx = directionOfSanta / 100;
if (velx > 0) {
velx = velx + (random(50) / 40);
} else {
velx = velx - (random(50) / 40);
}
vely = -((random(50) / 10) + 13);
} else if (this._type == 4) {
directionOfSanta = _root.santa._x - this._x;
velx = directionOfSanta / 35;
vely = -((random(70) / 10) + 6);
} else if (this._type == 5) {
directionOfSanta = _root.santa._x - this._x;
velx = _root.santa._x - this._x;
vely = _root.santa._y - this._y;
angle = Math.atan2(velx, vely);
angle = angle + ((random(3) - 1) * 0.01);
velx = Math.sin(angle) * 12;
vely = Math.cos(angle) * 12;
} else if (this._type == 6) {
directionOfSanta = _root.santa._x - this._x;
velx = directionOfSanta / 100;
if (velx > 0) {
velx = velx + (random(50) / 40);
} else {
velx = velx - (random(50) / 40);
}
vely = -((random(30) / 10) + 13);
} else if (this._type == 7) {
velx = _root.santa._x - this._x;
if (velx > 0) {
velx = 21;
} else {
velx = -21;
}
vely = (random(5) - 2) * 0.1;
} else if (this._type == 8) {
velx = _root.santa._x - this._x;
if (velx > 0) {
velx = 20;
} else {
velx = -20;
}
vely = 3;
fuse = 120;
}
this._x = this._x + velx;
this._y = this._y + vely;
angle = Math.atan2(velx, vely);
this._rotation = 180 - (angle * 57.2957795130823);
stop();
}
onClipEvent (enterFrame) {
if (_alive && (!_root.gamePaused)) {
if ((this._type == 1) || (this._type == 5)) {
} else if (((this._type == 2) || (this._type == 3)) || (this._type == 4)) {
vely = vely + _root.stats.PRESGRAVITY;
} else if (this._type == 6) {
vely = vely + (_root.stats.PRESGRAVITY / 1.6);
} else if (this._type == 8) {
var tmpvelx = (_root.santa._x - this._x);
var tmpvely = (_root.santa._y - this._y);
angle = Math.atan2(tmpvelx, tmpvely);
if (angle < 0) {
angle = angle - ((random(3) + 2) * 0.1);
} else {
angle = angle + ((random(3) + 2) * 0.1);
}
tmpvelx = Math.sin(angle) * 10;
tmpvely = Math.cos(angle) * 10;
velx = velx + ((tmpvelx - velx) / 15);
vely = vely + ((tmpvely - vely) / 15);
fuse--;
if (fuse <= 0) {
_root.removeFromStack(_root.enemyWeaponStack, this);
this._alive = false;
}
}
this._x = this._x + velx;
this._y = this._y + vely;
angle = Math.atan2(velx, vely);
this._rotation = 180 - (angle * 57.2957795130823);
if (this._y > _root.ground._y) {
_root.removeFromStack(_root.enemyWeaponStack, this);
this._y = _root.ground._y;
this._alive = false;
} else if ((this._type == 1) || (this._type == 5)) {
if (this._y < _root.ceiling._y) {
_root.removeFromStack(_root.enemyWeaponStack, this);
this._y = _root.ceiling._y;
this._alive = false;
}
} else if ((this._type != 1) && (this._type != 5)) {
i = 0;
while (i < _root.weaponStack.length) {
if (this.hitTest(_root.weaponStack[i]) && (_root.weaponStack[i]._active)) {
_root.removeFromStack(_root.enemyWeaponStack, this);
_root.gi.bulletsShotDown++;
this._alive = false;
}
i++;
}
}
} else if (!_alive) {
this._rotation = 0;
}
}
Instance of Symbol 1354 MovieClip "vcam" in Frame 10
onClipEvent (enterFrame) {
_root.ui._x = this._x;
_root.ui._y = this._y;
_root.gameover._x = this._x;
_root.gameover._y = this._y;
_root.far_bg._x = this._x;
}
Frame 11
removeAllSpawns();
if (_root.submitScore == 1) {
gotoAndStop ("highScores");
} else {
gotoAndStop (4);
}
Symbol 1586 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.7");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 1587 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.43");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local3 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servicesURL != undefined) {
_servicesURL = urlOptions().servicesURL;
}
allowDomains(_servicesURL);
_clip = clip.createEmptyMovieClip(_local3, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip((((_servicesURL + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
trace("connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
if (_root.mochiad_options) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static var _servicesURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
}
Symbol 1588 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if ((options.clip == null) || (options.clip == undefined)) {
options.clip = mochi.MochiServices.clip;
}
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 1589 MovieClip [__Packages.mochi.MochiDigits] Frame 0
class mochi.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 33 MovieClip Frame 112
_root.play();
Symbol 49 Button
on (release) {
_root.getURL("http://www.rustyarcade.com/index.php?ref=mecha_martyr&src=main_menu", "_blank");
}
Symbol 56 Button
on (release) {
if (_root.firstPlay) {
_root.firstPlayTut = true;
_root.gotoAndStop("instructions");
} else {
_root.gotoLevel(1);
}
}
Symbol 59 Button
on (release) {
_root.gotoAndStop("options");
}
Symbol 62 Button
on (release) {
getURL ("http://www.rustyarcade.com/article.php?id=17", "_blank");
}
Symbol 66 Button
on (release) {
_root.firstPlay = false;
_root.gotoAndStop("instructions");
}
Symbol 69 Button
on (release) {
_root.gotoAndStop("highScores");
}
Symbol 72 Button
on (release) {
_root.gotoAndStop("medalRoom");
}
Symbol 92 MovieClip Frame 1
mecha_room.head_mc.onRollOver = function () {
mecha_room.head_mc.grids_mc.play();
upgrade_menu.upgrade_options.gotoAndStop(3);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.head_mc.onRollOut = function () {
mecha_room.head_mc.grids_mc.gotoAndStop(1);
};
mecha_room.body_mc.onRollOver = function () {
mecha_room.body_mc.grids_mc.play();
upgrade_menu.upgrade_options.gotoAndStop(4);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.body_mc.onRollOut = function () {
mecha_room.body_mc.grids_mc.gotoAndStop(1);
};
mecha_room.wings_mc.onRollOver = function () {
mecha_room.wings_mc.grids_mc.play();
upgrade_menu.upgrade_options.gotoAndStop(5);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.wings_mc.onRollOut = function () {
mecha_room.wings_mc.grids_mc.gotoAndStop(1);
};
mecha_room.engine_mc.onRollOver = function () {
mecha_room.engine_mc.grids_mc.play();
upgrade_menu.upgrade_options.gotoAndStop(6);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.engine_mc.onRollOut = function () {
mecha_room.engine_mc.grids_mc.gotoAndStop(1);
};
Symbol 111 Button
on (release) {
_root.gotoAndStop("mainMenu");
}
Symbol 119 Button
on (release) {
_root._quality = "LOW";
}
Symbol 123 Button
on (release) {
_root._quality = "MEDIUM";
}
Symbol 127 Button
on (release) {
_root._quality = "HIGH";
}
Symbol 130 MovieClip Frame 1
if (_parent._parent == _root.gameover) {
doneBtn._y = 2000;
}
Symbol 140 Button
on (release) {
nextFrame();
}
Symbol 141 Button
on (release) {
if (_root.firstPlayTut) {
_root.firstPlayTut = false;
_root.gotoLevel(1);
} else {
_root.gotoAndStop("mainMenu");
}
}
Symbol 157 Button
on (release) {
prevFrame();
}
Symbol 181 MovieClip Frame 1
if (specialDisplay) {
this.gotoAndStop(50);
} else {
this.play();
}
Symbol 181 MovieClip Frame 50
_root.chopper.nades = 1;
stop();
Symbol 184 MovieClip Frame 1
if (specialDisplay && (_root.chopper.shurikens > 0)) {
this.gotoAndStop(155);
}
Symbol 184 MovieClip Frame 6
if (specialDisplay || (_root.chopper.shurikens <= 0)) {
gotoAndPlay (1);
}
Symbol 184 MovieClip Frame 105
_root.chopper.shurikens = 1;
stop();
Symbol 187 MovieClip Frame 1
if (specialDisplay && (_root.chopper.brandys > 0)) {
this.gotoAndStop(155);
}
Symbol 187 MovieClip Frame 5
if (specialDisplay || (_root.chopper.brandys <= 0)) {
this.gotoAndPlay(1);
}
Symbol 187 MovieClip Frame 155
_root.chopper.brandys = 1;
stop();
Symbol 197 MovieClip Frame 1
if (_root.chopper.cooldown < 0) {
this._xscale = 0;
} else {
this._xscale = (_root.chopper.cooldown / _root.stats.cooldown) * 100;
if (this._xscale <= 25) {
cooldownbar.gotoAndStop(2);
} else {
cooldownbar.gotoAndStop(1);
}
}
Symbol 244 MovieClip Frame 12
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 13
stop();
Symbol 348 MovieClip Frame 1
_root.updateEngineLevel(this);
Symbol 394 MovieClip Frame 1
_root.updateWingLevel(this);
Symbol 419 MovieClip Frame 1
_root.updateBodyLevel(this);
Symbol 455 MovieClip Frame 1
_root.updateTurretLevel(this);
Symbol 466 MovieClip Frame 1
stop();
Symbol 475 Button
on (release) {
_root.getURL("http://www.rustyarcade.com/index.php?ref=mecha_martyr&src=high_scores", "_blank");
}
Symbol 533 Button
on (release) {
_root.gotoAndStop("mainMenu");
}
Symbol 534 Button
on (release) {
_root.getURL("http://www.rustyarcade.com/index.php?ref=mecha_martyr&src=medal_room", "_blank");
}
Symbol 539 Button
on (release) {
getURL ("http://www.rustyarcade.com/article.php?id=17", "_blank");
}
Symbol 542 MovieClip Frame 1
function getMedal(num) {
_root.medals[num] = true;
_root.mbox["med" + num]._alpha = 100;
trace("got medal " + num);
}
i = 0;
while (i < 12) {
if (_root.medals[0]) {
_root.mbox["med" + i]._alpha = 100;
} else {
_root.mbox["med" + i]._alpha = 20;
}
i++;
}
med0.onRollOver = function () {
unlockMsg = "Survive for 1 minute";
};
med1.onRollOver = function () {
unlockMsg = "Survive for 5 minutes";
};
med2.onRollOver = function () {
unlockMsg = "Survive for 10 minutes";
};
med3.onRollOver = function () {
unlockMsg = "Survive for 15 minutes";
};
med4.onRollOver = function () {
unlockMsg = "Kill 10 enemies";
};
med5.onRollOver = function () {
unlockMsg = "Kill 50 enemies";
};
med6.onRollOver = function () {
unlockMsg = "Kill 100 enemies";
};
med7.onRollOver = function () {
unlockMsg = "Kill 200 enemies";
};
med8.onRollOver = function () {
unlockMsg = "Shoot 10 rockets out of the sky";
};
med9.onRollOver = function () {
unlockMsg = "Shoot 100 rockets out of the sky";
};
med10.onRollOver = function () {
unlockMsg = "Kill 10 helicopters";
};
med11.onRollOver = function () {
unlockMsg = "Kill 10 planes";
};
if ((_root.medals[0] == false) && (_root.gi.timeelapsed >= 60)) {
getMedal(0);
}
if ((_root.medals[1] == false) && (_root.gi.timeelapsed >= 300)) {
getMedal(1);
}
if ((_root.medals[2] == false) && (_root.gi.timeelapsed >= 600)) {
getMedal(2);
}
if ((_root.medals[3] == false) && (_root.gi.timeelapsed >= 900)) {
getMedal(3);
}
if ((_root.medals[4] == false) && (_root.gi.enemiesKilled >= 20)) {
getMedal(4);
}
if ((_root.medals[5] == false) && (_root.gi.enemiesKilled >= 50)) {
getMedal(5);
}
if ((_root.medals[6] == false) && (_root.gi.enemiesKilled >= 100)) {
getMedal(6);
}
if ((_root.medals[7] == false) && (_root.gi.enemiesKilled >= 200)) {
getMedal(7);
}
if ((_root.medals[8] == false) && (_root.gi.bulletsShotDown >= 10)) {
getMedal(8);
}
if ((_root.medals[9] == false) && (_root.gi.bulletsShotDown >= 100)) {
getMedal(9);
}
if ((_root.medals[10] == false) && (_root.gi.choppersKilled >= 20)) {
getMedal(10);
}
if ((_root.medals[11] == false) && (_root.gi.planesKilled >= 10)) {
getMedal(11);
}
Symbol 656 MovieClip Frame 120
_parent.removeMovieClip();
Symbol 687 MovieClip Frame 129
_parent.removeMovieClip();
Symbol 726 MovieClip Frame 58
_parent.removeMovieClip();
Symbol 783 MovieClip Frame 123
_parent.removeMovieClip();
Symbol 813 MovieClip Frame 119
_parent.removeMovieClip();
Symbol 867 MovieClip Frame 121
_parent.removeMovieClip();
Symbol 897 MovieClip Frame 120
_parent.removeMovieClip();
Symbol 957 MovieClip Frame 47
_parent.removeMovieClip();
Symbol 990 MovieClip Frame 47
_parent.removeMovieClip();
Symbol 1034 MovieClip Frame 47
_parent.removeMovieClip();
Symbol 1060 MovieClip Frame 47
_parent.removeMovieClip();
Symbol 1079 MovieClip Frame 47
_parent.removeMovieClip();
Symbol 1083 MovieClip Frame 1
_root.updateWingLevel(this, true);
Symbol 1095 MovieClip Frame 1
_root.updateBodyLevel(this, true);
Symbol 1096 MovieClip Frame 1
_root.updateEngineLevel(this, true);
Symbol 1097 MovieClip Frame 1
if (_root.sidePower > 2) {
_parent.gotoAndStop(2);
} else {
_parent.gotoAndStop(1);
}
Symbol 1108 MovieClip Frame 1
_root.updateTurretLevel(this, true);
Symbol 1114 MovieClip Frame 1
stop();
Symbol 1115 MovieClip Frame 1
if (_root.sidePower > 2) {
_parent.gotoAndStop(2);
} else {
_parent.gotoAndStop(1);
}
Symbol 1143 MovieClip Frame 18
_parent.gotoAndStop(1);
Symbol 1188 MovieClip Frame 18
_parent.gotoAndStop(1);
Symbol 1215 MovieClip Frame 48
_parent.gotoAndStop(1);
Symbol 1216 MovieClip Frame 1
stop();
Symbol 1232 MovieClip Frame 6
_root.removeFromStack(_root.weaponStack, _parent._parent, false);
removeMovieClip(_parent._parent);
Symbol 1240 MovieClip Frame 8
_root.removeFromStack(_root.weaponStack, _parent._parent, false);
removeMovieClip(_parent._parent);
Symbol 1249 MovieClip Frame 16
_root.removeFromStack(_root.weaponStack, _parent, false);
removeMovieClip(_parent);
Symbol 1264 MovieClip Frame 30
_root.removeFromStack(_root.weaponStack, _parent, false);
removeMovieClip(_parent);
Symbol 1277 MovieClip Frame 21
_root.removeFromStack(_root.weaponStack, _parent, false);
removeMovieClip(_parent);
Symbol 1285 MovieClip Frame 5
removeMovieClip(_parent);
Symbol 1297 MovieClip Frame 16
removeMovieClip(_parent);
Symbol 1308 MovieClip Frame 30
removeMovieClip(_parent);
Symbol 1315 MovieClip Frame 21
removeMovieClip(_parent);
Symbol 1325 Button
on (release) {
if ((!_root.gamePaused) && (_root.gamePlaying)) {
_root.gamePaused = true;
_root.gameover.gotoAndPlay("paused");
}
}
Symbol 1327 MovieClip Frame 1
if (_root.chopper.health < 0) {
this._xscale = 0;
} else {
this._xscale = (_root.chopper.health / _root.stats.health) * 100;
}
Symbol 1341 MovieClip Frame 34
function getMedal(num, msg) {
_root.medals[num] = true;
_root.medalGot = num;
_root.medalGotIden = true;
_root.survivalMsg = msg;
}
if ((_root.medals[0] == false) && (_root.gi.timeelapsed >= 60)) {
getMedal(0, "Survive for 1 minute");
}
if ((_root.medals[1] == false) && (_root.gi.timeelapsed >= 300)) {
getMedal(1, "Survive for 5 minutes");
}
if ((_root.medals[2] == false) && (_root.gi.timeelapsed >= 600)) {
getMedal(2, "Survive for 10 minutes");
}
if ((_root.medals[3] == false) && (_root.gi.timeelapsed >= 900)) {
getMedal(3, "Survive for 15 minutes");
}
if ((_root.medals[4] == false) && (_root.gi.enemiesKilled >= 10)) {
getMedal(4, "Kill 10 enemies");
}
if ((_root.medals[5] == false) && (_root.gi.enemiesKilled >= 50)) {
getMedal(5, "Kill 50 enemies");
}
if ((_root.medals[6] == false) && (_root.gi.enemiesKilled >= 100)) {
getMedal(6, "Kill 100 enemies");
}
if ((_root.medals[7] == false) && (_root.gi.enemiesKilled >= 200)) {
getMedal(7, "Kill 200 enemies");
}
if ((_root.medals[8] == false) && (_root.gi.bulletsShotDown >= 10)) {
getMedal(8, "Shoot 10 rockets out of the sky");
}
if ((_root.medals[9] == false) && (_root.gi.bulletsShotDown >= 100)) {
getMedal(9, "Shoot 100 rockets out of the sky");
}
if ((_root.medals[10] == false) && (_root.gi.choppersKilled >= 20)) {
getMedal(10, "Kill 10 helicopters");
}
if ((_root.medals[11] == false) && (_root.gi.planesKilled >= 10)) {
getMedal(11, "Kill 10 planes");
}
gotoAndPlay (1);
Instance of Symbol 1338 MovieClip in Symbol 1341 MovieClip Frame 44
onClipEvent (load) {
this.gotoAndStop(_root.medalGot + 1);
}
Symbol 1341 MovieClip Frame 158
_root.medalGot = undefined;
Symbol 1344 MovieClip Frame 12
if (_root.gi.levelUpTime < 10) {
specialLevelMessage = Math.round(_root.gi.levelUpTime) + " seconds till upgrade";
} else {
gotoAndPlay (1);
}
Symbol 1354 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local4 = sX / this._width;
var _local3 = sY / this._height;
_parent._x = cX - (this._x * _local4);
_parent._y = cY - (this._y * _local3);
_parent._xscale = 100 * _local4;
_parent._yscale = 100 * _local3;
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
parentColor.setTransform(camColor.getTransform());
this._visible = false;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Symbol 1377 MovieClip Frame 1
this.gotoAndStop(_root.level_on_playing);
Symbol 1385 Button
on (release) {
if (!_root.gi.usedCheats) {
_root.submitScore = 1;
_root.playerScore = _root.gi.timeelapsed * 1000;
_root.gotoAndStop("reroute");
removeMovieClip(_root.gameover);
} else {
cheatMsg = "You used cheats and are not eligible to submit a score. Restart without cheats to be able to submit";
}
}
Symbol 1397 Button
on (release) {
getURL ("http://www.rustyarcade.com/index.php?ref=mecha_martyr&src=die_screen", "_blank");
}
Symbol 1400 Button
on (release) {
_root.gotoAndStop("reroute");
removeMovieClip(_root.gameover);
}
Symbol 1403 MovieClip Frame 1
cheatMsg = "You died. But the fight will go on. Try again";
Symbol 1422 Button
on (release) {
_root.gotoAndStop("reroute");
_root.killscreen._x = 325;
_root.killscreen.gotoAndPlay(1);
}
Symbol 1423 MovieClip Frame 1
monies = "$" + _root.stats.money;
kills = _root.gi.enemiesKilled;
Symbol 1427 Button
on (release) {
getURL ("http://www.rustyarcade.com/article.php?id=17", "_blank");
}
Symbol 1434 Button
on (release) {
_root.gamePaused = false;
_root.gameover.gotoAndStop("normal");
}
Symbol 1437 Button
on (release) {
getURL ("http://www.rustyarcade.com/index.php?ref=mecha_martyr&src=pause", "_blank");
}
Symbol 1441 Button
on (release) {
_root.gotoAndStop("reroute");
removeMovieClip(_root.gameover);
}
Symbol 1443 MovieClip Frame 1
if (_parent._parent == _root.gameover) {
doneBtn._y = 2000;
}
Symbol 1491 Button
on (release) {
if ((_root.chopper.health < _root.stats.health) && (_root.canAfford(lowRepairExp))) {
_root.chopper.health = _root.chopper.health + 50;
if (_root.chopper.health > _root.stats.health) {
_root.chopper.health = _root.stats.health;
}
_root.takeMoney(lowRepairExp);
_root.chopper_health = Math.round(_root.chopper.health);
}
}
Symbol 1499 Button
on (release) {
if ((_root.chopper.health < _root.stats.health) && (_root.canAfford(highRepairExp))) {
_root.chopper.health = _root.stats.health;
_root.takeMoney(highRepairExp);
_root.chopper_health = Math.round(_root.chopper.health);
}
}
Symbol 1502 MovieClip Frame 16
stop();
Symbol 1516 MovieClip Frame 1
stop();
Symbol 1525 Button
on (release) {
if ((_root.chopper.turret < 10) && (_root.canAfford(damageExp))) {
_root.chopper.turret++;
_root.stats.cooldown = _root.stats.cooldown + 25;
_root.takeMoney(damageExp);
damageExp = _root.calculateDamageExp();
_root.playSound(this, "levelUp");
}
_root.updateLevelLevels();
}
Symbol 1537 MovieClip Frame 1
stop();
Symbol 1542 Button
on (release) {
if ((_root.chopper.armor < 12) && (_root.canAfford(armorExp))) {
var health_percentage = (_root.chopper.health / _root.stats.health);
_root.stats.health = _root.stats.health + 50;
_root.chopper.health = health_percentage * _root.stats.health;
_root.chopper_health = _root.chopper.health;
_root.chopper.armor++;
_root.takeMoney(armorExp);
armorExp = _root.calculateArmorExp();
_root.playSound(this, "levelUp");
}
_root.updateLevelLevels();
}
Symbol 1545 MovieClip Frame 1
stop();
Symbol 1550 Button
on (release) {
if ((_root.chopper.wings < 10) && (_root.canAfford(agilityExp))) {
_root.chopper.wings++;
_root.stats.speed = _root.stats.speed + 0.3;
_root.takeMoney(agilityExp);
agilityExp = _root.calculateAgilityExp();
_root.playSound(this, "levelUp");
}
_root.updateLevelLevels();
}
Symbol 1552 MovieClip Frame 1
stop();
Symbol 1557 Button
on (release) {
if ((_root.chopper.engine < 10) && (_root.canAfford(speedExp))) {
_root.chopper.engine++;
_root.stats.MAX_POWER = _root.stats.MAX_POWER + 0.3;
_root.takeMoney(speedExp);
speedExp = _root.calculateSpeedExp();
_root.playSound(this, "levelUp");
}
_root.updateLevelLevels();
}
Symbol 1564 Button
on (release) {
if ((_root.chopper.brandys < 1) && (_root.canAfford(grenade2Exp))) {
_root.chopper.brandys = 1;
_root.takeMoney(grenade2Exp);
ui.uiMC.grenade3.gotoAndPlay(1);
_root.playSound(this, "levelUp");
}
}
Symbol 1565 Button
on (release) {
if ((_root.chopper.shurikens < 1) && (_root.canAfford(grenade1Exp))) {
_root.chopper.shurikens = 1;
_root.takeMoney(grenade1Exp);
ui.uiMC.grenade2.gotoAndPlay(1);
_root.playSound(this, "levelUp");
}
}
Symbol 1566 MovieClip Frame 1
stop();
Symbol 1566 MovieClip Frame 2
lowRepairExp = 300;
highRepairExp = 2000;
Symbol 1566 MovieClip Frame 3
damageExp = _root.calculateDamageExp();
Instance of Symbol 1516 MovieClip in Symbol 1566 MovieClip Frame 3
onClipEvent (enterFrame) {
this.gotoAndStop(_root.chopper.turret);
}
Symbol 1566 MovieClip Frame 4
armorExp = _root.calculateArmorExp();
Instance of Symbol 1537 MovieClip in Symbol 1566 MovieClip Frame 4
onClipEvent (enterFrame) {
this.gotoAndStop(_root.chopper.armor);
}
Symbol 1566 MovieClip Frame 5
agilityExp = _root.calculateAgilityExp();
Instance of Symbol 1545 MovieClip in Symbol 1566 MovieClip Frame 5
onClipEvent (enterFrame) {
this.gotoAndStop(_root.chopper.wings);
}
Symbol 1566 MovieClip Frame 6
speedExp = _root.calculateSpeedExp();
Instance of Symbol 1552 MovieClip in Symbol 1566 MovieClip Frame 6
onClipEvent (enterFrame) {
this.gotoAndStop(_root.chopper.engine);
}
Symbol 1566 MovieClip Frame 7
grenade1Exp = 3000;
grenade2Exp = 5000;
Instance of Symbol 184 MovieClip in Symbol 1566 MovieClip Frame 7
onClipEvent (load) {
specialDisplay = true;
}
Instance of Symbol 187 MovieClip in Symbol 1566 MovieClip Frame 7
onClipEvent (load) {
specialDisplay = true;
}
Instance of Symbol 181 MovieClip in Symbol 1568 MovieClip Frame 1
onClipEvent (load) {
specialDisplay = true;
}
Instance of Symbol 184 MovieClip in Symbol 1568 MovieClip Frame 1
onClipEvent (load) {
specialDisplay = true;
}
Instance of Symbol 187 MovieClip in Symbol 1568 MovieClip Frame 1
onClipEvent (load) {
specialDisplay = true;
}
Symbol 1569 Button
on (release) {
_root.updateLevelLevels(true);
_root.level_on_playing++;
_root.gameover.gotoAndPlay(1);
}
Symbol 1570 Button
on (release) {
getURL ("http://www.rustyarcade.com/index.php?ref=mecha_martyr&src=upgrade_screen", "_blank");
}
Symbol 1572 Button
on (release) {
if (cheatsBox._currentframe == 1) {
cheatsBox.gotoAndPlay(1);
} else if (cheatsBox._currentframe == 20) {
cheatsBox.gotoAndPlay(20);
}
}
Symbol 1576 Button
on (release) {
if (cheat == "RustyRules") {
happyText = "You got +10 exp";
_root.addMoney(100);
cheat = "";
_root.gi.usedCheats = true;
}
}
Symbol 1579 Button
on (release) {
_parent.gotoAndPlay(20);
}
Symbol 1583 MovieClip Frame 1
stop();
Symbol 1583 MovieClip Frame 20
stop();
Symbol 1584 MovieClip Frame 1
mecha_room.head_mc.onRollOver = function () {
mecha_room.head_mc.grids_mc.play();
};
mecha_room.head_mc.onRelease = function () {
upgrade_menu.upgrade_options.gotoAndStop(3);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.head_mc.onRollOut = function () {
mecha_room.head_mc.grids_mc.gotoAndStop(1);
};
mecha_room.body_mc.onRollOver = function () {
mecha_room.body_mc.grids_mc.play();
};
mecha_room.body_mc.onRelease = function () {
upgrade_menu.upgrade_options.gotoAndStop(4);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.body_mc.onRollOut = function () {
mecha_room.body_mc.grids_mc.gotoAndStop(1);
};
mecha_room.wings_mc.onRollOver = function () {
mecha_room.wings_mc.grids_mc.play();
};
mecha_room.wings_mc.onRelease = function () {
upgrade_menu.upgrade_options.gotoAndStop(5);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.wings_mc.onRollOut = function () {
mecha_room.wings_mc.grids_mc.gotoAndStop(1);
};
mecha_room.engine_mc.onRollOver = function () {
mecha_room.engine_mc.grids_mc.play();
};
mecha_room.engine_mc.onRelease = function () {
upgrade_menu.upgrade_options.gotoAndStop(6);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.engine_mc.onRollOut = function () {
mecha_room.engine_mc.grids_mc.gotoAndStop(1);
};
mecha_room.health_mc.onRelease = function () {
upgrade_menu.upgrade_options.gotoAndStop(2);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.grenade_mc.onRelease = function () {
upgrade_menu.upgrade_options.gotoAndStop(7);
upgrade_menu.upgrade_options.shine_upgrade.gotoAndPlay(1);
};
mecha_room.grenade_mc.onRollOver = function () {
mecha_room.grenade_mc.grids_mc.play();
};
mecha_room.grenade_mc.onRollOut = function () {
mecha_room.grenade_mc.grids_mc.gotoAndStop(1);
};
Symbol 1585 MovieClip Frame 1
_root.gamePaused = true;
Symbol 1585 MovieClip Frame 13
_root.playSound(this, "clunk");
Symbol 1585 MovieClip Frame 87
_root.gamePaused = false;
stop();
Symbol 1585 MovieClip Frame 88
_root.gamePaused = true;
_root.gamePlaying = false;
_root.Mouse.show();
Symbol 1585 MovieClip Frame 139
stop();
Symbol 1585 MovieClip Frame 140
_root.Mouse.show();
Symbol 1585 MovieClip Frame 193
stop();
Symbol 1585 MovieClip Frame 194
_root.Mouse.show();
Instance of Symbol 136 MovieClip in Symbol 1585 MovieClip Frame 216
onClipEvent (mouseDown) {
if (this.hitTest(_level0._xmouse, _level0._ymouse)) {
followMouse = true;
}
}
onClipEvent (enterFrame) {
if (followMouse) {
this._x = _root._xmouse - _parent._x;
if (this._x < lineStart) {
this._x = lineStart;
} else if (this._x > lineEnd) {
this._x = lineEnd;
}
}
}
onClipEvent (mouseUp) {
followMouse = false;
_root.mainVolume = (this._x - lineStart) / lineRatio;
if (_root.mainVolume < 0) {
_root.mainVolume = 0;
} else if (_root.mainVolume > 100) {
_root.mainVolume = 100;
}
_root.backgroundMusic.setVolume(_root.mainVolume);
}
onClipEvent (load) {
linemc = _parent.audioslider;
lineStart = linemc._x - (linemc._width / 2);
lineEnd = linemc._x + (linemc._width / 2);
lineLength = lineEnd - lineStart;
lineRatio = lineLength / 100;
this._x = (_root.mainVolume * lineRatio) + lineStart;
followMouse = false;
}
Symbol 1585 MovieClip Frame 217
stop();
Symbol 1585 MovieClip Frame 218
_root.gamePaused = true;
_root.gi.levelUpTime = _root.stats.levelUpDistance;
_root.Mouse.show();
Symbol 1585 MovieClip Frame 247
stop();