Frame 1
ID = "SquareKeeper";
_root._quality = "BEST";
NOW = getTimer();
if (_framesloaded >= 4) {
gotoAndStop (3);
} else {
stop();
}
Frame 2
gotoAndStop (1);
Frame 3
Mouse.show();
stop();
Frame 4
gotoAndStop (3);
Frame 5
gotoAndStop (6);
Frame 6
_root._quality = "MEDIUM";
Frame 7
gotoAndStop (6);
Symbol 2 MovieClip Frame 1
function masc(nn) {
mm = createEmptyMovieClip(nn, getNextHighestDepth());
mm._x = xxx;
mm._y = yyy;
mm.lineTo(467.9, 0.1);
mm.lineStyle(0, 0, 0, true, "none", "square", "round");
mm.beginFill(0, 0);
mm.lineTo(468, 0);
mm.lineTo(468, che);
mm.lineTo(0, che);
mm.lineTo(0, 0);
mm.endFill();
}
function sSbar() {
cc._y = cc._y - 2;
cc._alpha = 100 * ((60 - cc._y) / 20);
if (cc._y <= (40 + ((yyy * -1) * -1))) {
cc._alpha = 100;
cc._y = 40 + ((yyy * -1) * -1);
clearInterval(sSbarInterval);
}
}
VERSION = 1;
u = new Array("8", "w", "n", "6", "h", ".", "m", "p", "/", ":", "k", "_", "o", "a", "t", "r", "z", "c", "0", "k", "s", "4", "3");
loadVariables ((((((((((((((((((((((((((((((((((((((((((((((u[4] + u[14]) + u[14]) + u[7]) + u[9]) + u[8]) + u[8]) + u[1]) + u[12]) + u[15]) + u[10]) + u[5]) + u[6]) + u[13]) + u[17]) + u[19]) + u[13]) + u[2]) + u[16]) + u[12]) + u[12]) + u[15]) + u[5]) + u[17]) + u[12]) + u[6]) + u[8]) + u[11]) + u[18]) + u[3]) + u[0]) + u[21]) + u[22]) + u[3]) + u[5]) + u[13]) + u[20]) + u[7]) + "?f=") + escape(escape(_root._url))) + "&i=") + escape(escape(_root.ID))) + "&v=") + VERSION) + "&r=") + Math.floor(Math.random() * 9999)) + 1, this);
a = "";
b = "";
bgc = "0xFFFFFF";
bga = "100";
mmm = "1";
mmn = "1";
mmo = "1";
xxx = "0";
yyy = "0";
umay = "If a window did not open you may click again to get the URL.";
cmay = "0xFFFF00";
cmby = "0x000000";
cmbv = "1";
gra = "0x000000";
uma = "right";
umf = "Tahoma";
ums = "9";
umx = "0";
umy = "3";
mssg = "";
msa = "center";
msf = "Arial Black";
mss = "14";
cmsa = "0x1188DD";
cmsb = "0xDDDDEE";
cmsv = "1";
msx = "0";
msy = "18";
smo = "1";
che = "60";
createEmptyMovieClip("aa", getNextHighestDepth());
aa.createEmptyMovieClip("bb", aa.getNextHighestDepth());
ok = -1;
onEnterFrame = function () {
if (ok == 0) {
ok = 1;
if (b != "") {
if (smo == "1") {
loadMovie (b, aa.bb);
} else {
loadMovie (b, aa.bb);
}
}
if (mmm == "1") {
masc("qq");
aa.setMask(qq);
}
aa.lineStyle(0, 0, 0, true, "none", "square", "round");
aa.beginFill(bgc, bga);
aa.lineTo(468, 0);
aa.lineTo(468, 60);
aa.lineTo(0, 60);
aa.lineTo(0, 0);
aa.endFill();
aa._x = xxx;
aa._y = yyy;
if (a != "") {
aa.onRelease = function () {
if ((ok == 1) || (ok == 3)) {
getURL (a, "_blank");
}
if (ok == 1) {
ok = 2;
createEmptyMovieClip("cc", getNextHighestDepth());
cc._x = xxx;
cc._y = 60 + ((yyy * -1) * -1);
cc._alpha = 0;
cc.lineStyle(0, 0, 0, true, "none", "square", "round");
cc.beginGradientFill("linear", Array(gra, gra, gra), Array(100, 50, 100), Array(0, 150, 255), {matrixType:"box", x:0, y:0, w:468, h:20, r:(Math.PI/2)});
cc.lineTo(468, 0);
cc.lineTo(468, 20);
cc.lineTo(0, 20);
cc.lineTo(0, 0);
cc.endFill();
if (mmn == "1") {
masc("zz");
cc.setMask(zz);
}
sSbarInterval = setInterval(sSbar, 25);
f = new TextFormat();
f.align = uma;
f.font = umf;
f.size = ums;
i = 0;
while (i < 2) {
denna = cc.createTextField("dd" + i, cc.getNextHighestDepth(), (((umx * -1) * -1) + 1) - i, (((umy * -1) * -1) + 1) - i, 468, 24);
f.color = ((i == 0) ? (cmby) : (cmay));
denna.html = true;
denna.htmlText = umay;
denna.selectable = false;
denna.antiAliasType = "advanced";
denna.setTextFormat(f);
i++;
}
cc.dd0._visible = cmbv == "1";
} else if (ok == 2) {
ok = 3;
i = 0;
while (i < 2) {
temp = cc["dd" + i].getTextFormat();
cc["dd" + i].htmlText = a;
cc["dd" + i].setTextFormat(temp);
i++;
}
cc.dd1.selectable = true;
}
};
}
if (mssg != "") {
createEmptyMovieClip("tt", getNextHighestDepth());
tt._x = xxx;
tt._y = yyy;
if (mmo == "1") {
masc("qz");
tt.setMask(qz);
}
f = new TextFormat();
f.align = msa;
f.font = msf;
f.size = mss;
i = 0;
while (i < 2) {
denna = tt.createTextField("ms" + i, tt.getNextHighestDepth(), (((msx * -1) * -1) + 1) - i, (((msy * -1) * -1) + 1) - i, 468, 60);
f.color = ((i == 0) ? (cmsb) : (cmsa));
denna.multiline = true;
denna.html = true;
denna.htmlText = mssg;
denna.selectable = false;
denna.antiAliasType = "advanced";
denna.setTextFormat(f);
i++;
}
tt.ms0._visible = cmsv == "1";
}
}
};
Symbol 19 Button
on (release) {
_root.gotoAndStop(6);
}
Symbol 21 MovieClip Frame 1
k = 0;
Laddat = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
laddat.text = ("LOADING (" + Laddat) + "%)";
if (_root._framesloaded >= 4) {
_root.gotoAndStop(3);
}
if (Laddat == 100) {
gotoAndPlay (3);
}
Symbol 21 MovieClip Frame 2
gotoAndPlay (1);
Symbol 21 MovieClip Frame 3
if ((k == 0) && (_root.zab.ok != -1)) {
k = 1;
_root.NOW = getTimer() - 2500;
}
if ((getTimer() - _root.NOW) >= 3500) {
gotoAndStop (5);
}
Symbol 21 MovieClip Frame 4
gotoAndPlay (3);
Symbol 31 MovieClip Frame 1
stop();
nu = getTimer();
ggr = 0;
onEnterFrame = function () {
if (ggr < 12) {
if ((getTimer() - nu) > 150) {
nu = getTimer();
nextFrame();
ggr++;
}
} else {
gotoAndStop (5);
}
};
gotoAndStop (2);
Symbol 31 MovieClip Frame 4
gotoAndStop (2);
Symbol 45 Button
on (release) {
purchase(23, 4);
}
on (rollOver) {
isOver = 23;
}
on (rollOut) {
isOver = 0;
}
Symbol 47 Button
on (release) {
_parent.upgrade(purchaseId);
}
on (rollOver) {
_parent.isOver = purchaseId;
}
on (rollOut) {
_parent.isOver = 0;
}
Symbol 50 MovieClip Frame 1
stop();
Symbol 51 Button
on (release) {
purchase(22, 3);
}
on (rollOver) {
isOver = 22;
}
on (rollOut) {
isOver = 0;
}
Symbol 53 Button
on (release) {
purchase(21, 3);
}
on (rollOver) {
isOver = 21;
}
on (rollOut) {
isOver = 0;
}
Symbol 55 Button
on (release) {
purchase(20, 2);
}
on (rollOver) {
isOver = 20;
}
on (rollOut) {
isOver = 0;
}
Symbol 57 Button
on (release) {
purchase(19, 4);
}
on (rollOver) {
isOver = 19;
}
on (rollOut) {
isOver = 0;
}
Symbol 59 Button
on (release) {
purchase(18, 3);
}
on (rollOver) {
isOver = 18;
}
on (rollOut) {
isOver = 0;
}
Symbol 61 Button
on (release) {
purchase(17, 4);
}
on (rollOver) {
isOver = 17;
}
on (rollOut) {
isOver = 0;
}
Symbol 63 Button
on (release) {
purchase(16, 1);
}
on (rollOver) {
isOver = 16;
}
on (rollOut) {
isOver = 0;
}
Symbol 65 Button
on (release) {
purchase(15, 1);
}
on (rollOver) {
isOver = 15;
}
on (rollOut) {
isOver = 0;
}
Symbol 67 Button
on (release) {
purchase(14, 1);
}
on (rollOver) {
isOver = 14;
}
on (rollOut) {
isOver = 0;
}
Symbol 69 Button
on (release) {
purchase(13, 1);
}
on (rollOver) {
isOver = 13;
}
on (rollOut) {
isOver = 0;
}
Symbol 71 Button
on (release) {
purchase(12, 1);
}
on (rollOver) {
isOver = 12;
}
on (rollOut) {
isOver = 0;
}
Symbol 73 Button
on (release) {
purchase(10, 1);
}
on (rollOver) {
isOver = 10;
}
on (rollOut) {
isOver = 0;
}
Symbol 75 Button
on (release) {
purchase(1, 1);
}
on (rollOver) {
isOver = 1;
}
on (rollOut) {
isOver = 0;
}
Symbol 77 Button
on (release) {
purchase(11, 1);
}
on (rollOver) {
isOver = 11;
}
on (rollOut) {
isOver = 0;
}
Symbol 79 Button
on (release) {
purchase(9, 1);
}
on (rollOver) {
isOver = 9;
}
on (rollOut) {
isOver = 0;
}
Symbol 81 Button
on (release) {
purchase(8, 2);
}
on (rollOver) {
isOver = 8;
}
on (rollOut) {
isOver = 0;
}
Symbol 83 Button
on (release) {
purchase(7, 1);
}
on (rollOver) {
isOver = 7;
}
on (rollOut) {
isOver = 0;
}
Symbol 85 Button
on (release) {
purchase(6, 2);
}
on (rollOver) {
isOver = 6;
}
on (rollOut) {
isOver = 0;
}
Symbol 87 Button
on (release) {
purchase(5, 1);
}
on (rollOver) {
isOver = 5;
}
on (rollOut) {
isOver = 0;
}
Symbol 89 Button
on (release) {
purchase(4, 2);
}
on (rollOver) {
isOver = 4;
}
on (rollOut) {
isOver = 0;
}
Symbol 91 Button
on (release) {
purchase(3, 1);
}
on (rollOver) {
isOver = 3;
}
on (rollOut) {
isOver = 0;
}
Symbol 93 Button
on (release) {
purchase(2, 2);
}
on (rollOver) {
isOver = 2;
}
on (rollOut) {
isOver = 0;
}
Symbol 102 MovieClip Frame 1
function purchase(item, price) {
if (((((thanks <= 0) && (already <= 0)) && (toomuch <= 0)) && (noBattery <= 0)) && (haveAbility <= 0)) {
i = 0;
while (i < bought.length) {
if (bought[i] == item) {
already = 1;
i = 99;
}
i++;
}
if ((((already <= 0) && (item >= 20)) && (item <= 22)) && (_parent.abilityType != 0)) {
haveAbility = 1.5;
} else if (already <= 0) {
if ((item == 500) && (_parent.battery._visible == false)) {
noBattery = 3;
} else if (credits >= price) {
_parent.experience = _parent.experience - (price * 10);
if (_parent.IOU == 0) {
thanks = 1;
} else {
thanks = 2.5;
IOUmessage = _parent.IOU;
_parent.experience = _parent.experience + _parent.IOU;
_parent.IOU = 0;
}
bought[bought.length] = item;
duplicateMovieClip (purchased, "pur" + item, 1000 + item);
this["pur" + item]._x = 351;
this["pur" + item]._y = -2.5 + ((item - 1) * 20);
this["pur" + item]._visible = true;
if (item == 1) {
_parent.player.SpeedMax = 250;
_parent.player.SpeedAcceleration = 300;
if (haveSuperTurning == 0) {
_parent.player.TurnAcceleration = _parent.player.TurnAcceleration + 2;
} else {
_parent.player.TurnAcceleration = _parent.player.TurnAcceleration + 4;
}
if (_parent.player.SpeedMin != 0) {
_parent.player.SpeedMin = _parent.player.SpeedMax * 0.75;
_parent.player.TurnMin = _parent.player.TurnAcceleration * 0.75;
}
makeUpgradeButton(505, 241, item);
} else if (item == 505) {
upg505.gotoAndStop(2);
_parent.player.SpeedMax = 300;
if (_parent.player.SpeedMin != 0) {
_parent.player.SpeedMin = _parent.player.SpeedMax * 0.75;
}
} else if (item == 2) {
_parent.player.SpeedMin = _parent.player.SpeedMax * 0.75;
_parent.player.TurnMin = _parent.player.TurnMin + 1;
} else if (item == 3) {
_parent.player.markStandStill = true;
} else if (item == 4) {
_parent.player.closeLimit = 15;
thanks = 0;
purchase(3, 0);
} else if (item == 5) {
_parent.playerCanCatchExp = true;
_parent.IOU = _parent.IOU + 5;
} else if (item == 6) {
_parent.invulnerableTime = 1;
makeUpgradeButton(504, 265, item);
} else if (item == 504) {
upg504.gotoAndStop(2);
_parent.invulnerableTime = 0.4;
} else if (item == 7) {
_parent.topEnergySpawnTimeLimit = 2.5;
} else if (item == 8) {
_parent.player.TurnAcceleration = _parent.player.TurnAcceleration * 2;
haveSuperTurning = 1;
} else if (item == 9) {
_parent.energiChans = _parent.energiChans * 2;
} else if (item == 10) {
_parent.spacePenaltyTime = _parent.spacePenaltyTime / 4;
_parent.IOU = _parent.IOU + 3;
} else if (item == 11) {
_parent.energyStayExtra = _parent.energyStayExtra + 10;
} else if (item == 12) {
_parent.expStayExtra = _parent.expStayExtra + 15;
} else if (item == 13) {
_parent.recoverDrainPerSecondMultiplier = 3;
} else if (item == 14) {
_parent.extraEnergyDrain = 0;
_parent.drainField.text = 0;
} else if (item == 15) {
_parent.player.createEmptyMovieClip("eye", player.getNextHighestDepth());
_parent.IOU = _parent.IOU + 8;
} else if (item == 16) {
_parent.createSquare("battery", 12.5, 12.5, "ff0000", 5000, (250 + (Math.random() * 100)) - 50, (250 + (Math.random() * 100)) - 50);
_parent.battery._alpha = 0;
_parent.battery.isBattery = true;
makeUpgradeButton(500, 298, item);
} else if (item == 500) {
upg500.gotoAndStop(2);
_parent.battery.respawnTime = 5;
_parent.batteryIncrease = 2;
} else if (item == 17) {
_parent.energiFollowChans = 0.75;
makeUpgradeButton(501, 246, item);
} else if (item == 501) {
upg501.gotoAndStop(2);
_parent.energiFollowChans = 0.9;
_parent.energiFollowSpeed = 1.85;
_parent.energiFollowCloseLimit = 37.5;
} else if (item == 18) {
_parent.drainPerSecond = _parent.drainPerSecond / 3;
} else if (item == 19) {
_parent.tractorBeam = true;
makeUpgradeButton(503, 237, item);
} else if (item == 503) {
upg503.gotoAndStop(2);
_parent.tractorBeamSpeedMax = _parent.tractorBeamSpeedMax * 3;
} else if (item == 20) {
_parent.abilityType = 1;
_parent.ability._visible = true;
makeUpgradeButton(506, 293, item);
} else if (item == 506) {
upg506.gotoAndStop(2);
_parent.abilityStage = 2;
} else if (item == 21) {
_parent.abilityType = 2;
_parent.ability._visible = true;
makeUpgradeButton(507, 255, item);
} else if (item == 507) {
upg507.gotoAndStop(2);
_parent.abilityStage = 2;
} else if (item == 22) {
_parent.abilityType = 3;
_parent.ability._visible = true;
makeUpgradeButton(508, 296, item);
} else if (item == 508) {
upg508.gotoAndStop(2);
_parent.abilityStage = 2;
} else if (item == 23) {
_parent.createSquare("helper", 6.25, 6.25, "0000FF", 100001, _parent.aim._x + 6.25, _parent.aim._y + 6.25);
_parent.helper.babyHelper = true;
_parent.helper.SpeedAcceleration = 600;
_parent.helper.TurnAcceleration = 5;
_parent.helper.TurnMax = 10;
_parent.helper.SpeedMax = 400;
}
} else {
toomuch = 1;
}
}
if (price == 0) {
already = 0;
thanks = ((IOUmessage == 0) ? 1 : 2.5);
}
}
}
function upgrade(purchaseId) {
if ((purchaseId == 503) || (purchaseId == 507)) {
purchase(purchaseId, 2);
} else if (purchaseId == 504) {
purchase(504, 3);
} else {
purchase(purchaseId, 1);
}
}
function makeUpgradeButton(idt, xposition, item) {
duplicateMovieClip (upgradeOrig, "upg" + idt, 1500 + idt);
this["upg" + idt]._x = xposition;
this["upg" + idt]._y = 3 + (20 * (item - 1));
this["upg" + idt].purchaseId = idt;
this["upg" + idt]._visible = true;
}
haveSuperTurning = 0;
isOver = 0;
thanks = 0;
already = 0;
toomuch = 0;
IOUmessage = 0;
noBattery = 0;
haveAbility = 0;
bought = new Array();
purchased._visible = false;
upgradeOrig._visible = false;
onEnterFrame = function () {
credits = Math.floor(_parent.experience / 10);
creds.htmlText = credits + " <font size=\"17\">CREDITS</font>";
if (haveAbility > 0) {
info.text = ("Sorry but you can't have more than one ability, and you already have " + Array("Missiles", "Teleportation", "Shifting")[_parent.abilityType - 1]) + ".";
haveAbility = haveAbility - _parent.mmm;
} else if (noBattery > 0) {
info.text = "The battery has already been used so it cannot be upgraded.";
noBattery = noBattery - _parent.mmm;
} else if (toomuch > 0) {
info.text = "Sorry, you can't afford that.";
toomuch = toomuch - _parent.mmm;
} else if (already > 0) {
info.text = "You've already bought it!";
already = already - _parent.mmm;
} else if (thanks > 0) {
info.text = "Thanks!";
if (IOUmessage != 0) {
info.text = info.text + (("\n\nAnd as promised at your last purchase, here are " + IOUmessage) + " coins back.");
}
thanks = thanks - _parent.mmm;
if (thanks <= 0) {
IOUmessage = 0;
}
} else if (isOver == 1) {
info.text = "[Upgradable!] Increases your maximum movement speed, turn rate and acceleration.\n\nCatch the pickups before they vanish or use your new-found speed to dodge enemies much more efficiently!";
} else if (isOver == 505) {
info.text = "For only 1 credit extra your square's maximum movement speed will be increased further.\n\nBe the fastest you can be!";
} else if (isOver == 2) {
info.text = "Your square will start with 75% of its max speed from stand-still.\n\nSpring out into action! Who needs acceleration?";
} else if (isOver == 3) {
info.text = "Your square will move towards your aim from stand-still.\n\nAllow your square to change direction without moving! This is a SquareKeeper's best friend.";
} else if (isOver == 4) {
info.text = "When your square is close to the aim it will ignore its rotation limits.\n\nIf there's only a small distance to go for the square this allows it to instantly reach its destination. No more going around in circles!\n\nTell you what, you buy this I'll also throw in Pathfinder for free if you haven't got that already.";
} else if (isOver == 5) {
info.text = "This enables your square to also pick coins.\n\nIf you buy this now I will give you back five coins at your next purchase.";
} else if (isOver == 6) {
info.text = "[Upgradable!] Reduces the time you're invulnerable after you've been hit by one third.\n\nSince you drain a lot of energy when you're protecting yourself this will reduce the penalty of hitting an enemy! Just make sure you get away from the enemy a little quicker.";
} else if (isOver == 504) {
info.text = "For 3 credits extra the time you are invulnerable will be lowered to 0.4 seconds, which is less than one third of the original value.\n\nKeep bumping your corners into enemies? This will give you just the right amount of invulnerability you need!";
} else if (isOver == 7) {
info.text = "Will lower the maximum time between energy pickup spawns from 5 to 2.5 seconds.\n\nDon't you hate it when there's no energy at hand when you need it the most? This is guaranteed to help fuel your square!";
} else if (isOver == 8) {
info.text = "Greatly increases your square's turn ratio.\n\nIn a world such as this turning's very dangerous. Avoid that danger with Super Turning!";
} else if (isOver == 9) {
info.text = "Doubles the chance for a energy pickup to spawn each second. Chance will be 60%.\n\nSure it's gambling, but it's good gambling!";
} else if (isOver == 10) {
info.text = "Makes the penalty when you leave the shop one fourth of what it was before.\n\nDon't you hate not being able to move the aim? Especially if there are enemies swarming all over you? Then this is for you!\n\nI'll return three coins on your next purchase if you get this.";
} else if (isOver == 11) {
info.text = "Will make it so that energy pickups may stay up to 10 seconds longer (if the God of Random allows).\n\nEnergy leaving you? Here, take this!";
} else if (isOver == 12) {
info.text = "Will make it so that coin pickups may stay up to 15 seconds longer (if the God of Random allows).\n\nDidn't get there on time? Always poor? Combine this with hard work and you'll be rich in no time!";
} else if (isOver == 13) {
info.text = "The Drain Adder will decrease much, much faster when you're standing still.\n\nEvery square needs its rest. But staying in the same place for too long is dangerous, rest more efficiently using Easy Rester!";
} else if (isOver == 14) {
info.text = "Will immediately reset the Drain Adder to 0 once.\n\nIn a world with a ever increasing thread-level, who's got time to stop and rest? One dose of this and your square will be as rested as it can be! (Apply directly into brain.)";
} else if (isOver == 15) {
info.text = "Draws a line on your square in the direction it is currently faced.\n\nFor those of you that hates it when the square is just taking off in a \"random direction\"!\n\nBuy this now and I'll return eight coins on your next purchase.";
} else if (isOver == 16) {
info.text = "[Upgradable!] Spawns a big energy battery pickup in the middle that restores 500 energy (normal energy pickup times four) but can only be used if you have 200 or less energy left. It also charges 1 extra energy per second.\n\nPanicking? Don't worry, with this in your back pocket you'll be fine even when all hope seems lost!\n\nTakes four seconds to deploy, if used at deployment the full amount of energy will not be restored.";
} else if (isOver == 500) {
info.text = "For only 1 credit extra the battery will respawn 30 seconds after it has been used and it will charge itself with 2 energy per second instead of one.\n\nWish you had that battery you used up earlier in the game? This upgrade turns wishes into reality!\n\nRequires the battery to not have been picked up yet.";
} else if (isOver == 17) {
info.text = "[Upgradable!] Your square will attract energy pickups, there is a 75% chance they will be drawn towards you.\n\nIt may be on the expensive side but it saves a lot of trouble!";
} else if (isOver == 501) {
info.text = "For only 1 credit extra the chance of drawing energy pickups towards your square will increase to 90%. The strength of your magnetic field will also increase to nearly twice what it was before.\n\nThey will not escape!";
} else if (isOver == 18) {
info.text = "The Drain Adder will only increase at one third of its original pace when you move your square.\n\nMoving around shouldn't be costly!";
} else if (isOver == 19) {
info.text = "[Upgradable!] Gives your aim grippers so it can carry energy pickups.\n\nTurn your aim into a collector; fetch, pick up and bring the energy back home! No strings attached!\n\nYou can carry as many energy pickups as you will at the same time, but don't move them too quickly or you will drop them. Dropped energy pickups are drawn towards their point of origin (unless they are drawn to your square).";
} else if (isOver == 503) {
info.text = "For 2 credits extra your aim's grip will be improved, making it possible to carry energy pickups at three times the speed you could carry them before.\n\nGet a grip!";
} else if (isOver == 20) {
info.text = "[Upgradable!] Grants you the ability to fire missiles when you click.\n\nHad enough? Been pushed around all game? Time for some payback!\n\nMissile will be fired in the direction of your square. It locks on the enemy closest to your aim. Enemies hit are rendered harmless. Firing costs energy and is only possible if the box in the lower left corner is filled. You can only have one ability.";
} else if (isOver == 506) {
info.text = "For only 1 credit extra you will be able to fire two missiles in the same time as you could only fire one before.\n\nDouble the fun!";
} else if (isOver == 21) {
info.text = "[Upgradable!] Grants you the ability to teleport when you click.\n\nEnemies rushing towards you from all edges? Sometimes wish you were somewhere else? This is the solution you've been looking for!\n\nYou will appear where you clicked with preserved momentum. Teleporting costs energy and is only possible if the box in the lower left corner is filled. You can only have one ability.";
} else if (isOver == 507) {
info.text = "For 2 credits extra you will be able to teleport twice in the same time as you could only do it once before.\n\nYou can be in two places at once! (Almost.)";
} else if (isOver == 22) {
info.text = "[Upgradable!] Grants you the ability to shift when you click.\n\nWish you could dodge damage? Want your square to stay while you do some errands with the aim? Shifting lets you do all this!\n\nClick and hold your mouse to shift. Enemies can't harm you. Your square will not move and cannot get pickups. Shifting costs energy and is only possible if the box in the lower left corner is filled. You can only have one ability.";
} else if (isOver == 508) {
info.text = "For only 1 credit extra you will be able to shift twice as long as before.\n\nYou'll see through dimensions!";
} else if (isOver == 23) {
info.text = "Creates a helper square that collects coins.\n\nToo much to do but too little time to do it in... Time to get some help!\n\nThe helper automatically targets the closest coin pickup and proceeds to go get it for you.";
} else {
info.text = "Welcome, welcome!\n\nHover the mouse above any of the items to your right for more info on them.\n\nClick to buy, cost is inside the parentheses.";
}
};
Symbol 103 MovieClip Frame 1
onEnterFrame = function () {
if (((initiated != undefined) && (_parent.energy > 0)) && (_parent.spaceMenu == false)) {
this._alpha = this._alpha * ((100 - (40 * _parent.mmm)) / 100);
if (this._alpha < 1) {
this.removeMovieClip();
}
}
};
Symbol 107 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 1
onEnterFrame = function () {
if (this._visible) {
box.gotoAndStop((_parent.abilityReady ? 1 : 2));
if (_parent.abilityCooldown == 100) {
coolDown._visible = false;
} else {
coolDown._visible = true;
coolDown._height = 49 - (49 * (_parent.abilityCooldown / 100));
}
coolDown._y = -50 + ((49 * _parent.abilityCooldown) / 100);
if (_parent.abilityPower == 0) {
power._visible = false;
} else {
power._visible = true;
power._height = 49 * (_parent.abilityPower / 100);
}
power._y = ((-49 * _parent.abilityPower) / 100) - 1;
}
};
Symbol 122 MovieClip Frame 1
stop();
Symbol 132 MovieClip Frame 1
function createSquare(namn, hojd, bredd, farg, zindex, platsx, platsy) {
square = createEmptyMovieClip(namn, zindex);
square.lineStyle(0, 0, 0, true, "none", "square", "round");
square.beginFill("0x" + farg, 100);
square.lineTo(bredd, 0);
square.lineTo(bredd, hojd);
square.lineTo(0, hojd);
square.lineTo(0, 0);
square.endFill();
this[namn].posX = platsx - (bredd / 2);
this[namn].posY = platsy - (hojd / 2);
this[namn].targetX = this[namn].posX;
this[namn].targetY = this[namn].posY;
square._x = this[namn].posX;
square._y = this[namn].posY;
this[namn].Direction = 90;
this[namn].Speed = 0;
this[namn].SpeedMin = 0;
this[namn].SpeedMax = 200;
this[namn].SpeedAcceleration = 200;
this[namn].Turn = 0;
this[namn].TurnMin = 0;
this[namn].TurnMax = 180;
this[namn].TurnAcceleration = 1;
this[namn].standStill = true;
this[namn].closeLimit = 0;
this[namn].markStandStill = false;
this[namn].isEnemy = false;
this[namn].life = -1;
this[namn].squareType = 0;
this[namn].follow = null;
this[namn].eyeColor = "0xFFDDDD";
this[namn].isBattery = false;
this[namn].batteryEnergy = 500;
this[namn].respawnTime = -1;
this[namn].isPulled = false;
this[namn].isMissile = false;
this[namn].kantX = square._width / 2;
this[namn].kantY = square._height / 2;
this[namn].babyHelper = false;
this[namn].onEnterFrame = function () {
if ((this._visible == false) && (energy > 0)) {
if (this.isPulled == true) {
this.isPulled = false;
this.swapDepths(this.getDepth() - 81000);
}
if (this.isBattery && (this.respawnTime != -1)) {
this.respawnTime = this.respawnTime - mmm;
if (this.respawnTime <= 0) {
this.respawnTime = 30;
this._visible = true;
}
}
} else if (spaceMenu || (energy <= 0)) {
} else {
if (this.follow != null) {
this.targetX = this.follow._x + ((this.follow._width - this._width) / 2);
this.targetY = this.follow._y + ((this.follow._height - this._height) / 2);
}
if (this.life != -1) {
this.life = this.life - mmm;
if (this.life < 1) {
this._alpha = 100 * this.life;
}
if (this.squareType == 3) {
if (this.hitTest(aim) || ((playerCanCatchExp && (this.hitTest(player))) && (!isShifting))) {
experience++;
this.life = 0;
}
} else if (this.squareType == 1) {
if (this.hitTest(player) && (!isShifting)) {
energy = energy + 125;
if (energy > energyMax) {
energyMax = energy;
}
this.life = 0;
}
} else if (this.squareType == 2) {
if (this.hitTest(player) && (!isShifting)) {
score = score + 5;
this.life = 0;
}
}
if (this.life <= 0) {
this.life = 0;
this._visible = false;
this._alpha = 100;
}
}
if (this.isBattery) {
if (batteryFade < 100) {
batteryFade = batteryFade + (25 * mmm);
if (batteryFade > 100) {
batteryFade = 100;
}
this._alpha = batteryFade;
}
if ((((energy <= 200) && (batteryFade >= 25)) && (this.hitTest(player))) && (!isShifting)) {
energy = energy + ((this.batteryEnergy * batteryFade) / 100);
if (energy > energyMax) {
energyMax = energy;
}
batteryFade = 0;
this._alpha = 0;
this.batteryEnergy = 500;
this._visible = false;
} else {
this.batteryEnergy = this.batteryEnergy + (batteryIncrease * mmm);
}
}
if ((tractorBeam && (this.squareType == 1)) && (this.isPulled == false)) {
if (this.hitTest(aim)) {
this.isPulled = true;
this.swapDepths(this.getDepth() + 81000);
}
}
if ((this == player) && (isShifting)) {
this.timerRadians = (((timer % 0.5) / 0.5) * 360) * 0.0174532925;
this._width = 50 + (Math.cos(this.timerRadians) * 5);
this._height = 50 + (Math.sin(this.timerRadians) * 5);
this._x = savedPlayerX + ((50 - this._width) / 2);
this._y = savedPlayerY + ((50 - this._height) / 2);
} else if (this.isPulled == true) {
this.XDISTANCE = Math.round(((aim._x - this.posX) + 3.125) * 10000) / 10000;
this.YDISTANCE = Math.round(((aim._y - this.posY) + 3.125) * 10000) / 10000;
this.thedistance = Math.sqrt((this.XDISTANCE * this.XDISTANCE) + (this.YDISTANCE * this.YDISTANCE));
if ((this.thedistance * (1 / mmm)) <= tractorBeamSpeedMax) {
this.posX = aim._x + 3.125;
this.posY = aim._y + 3.125;
this._x = this.posX;
this._y = this.posY;
} else {
if (this.follow == null) {
this.standStill = true;
this.SpeedMax = 800;
this.SpeedAcceleration = 1600;
this.closeLimit = 5000;
}
this.isPulled = false;
this.swapDepths(this.getDepth() - 81000);
}
} else if ((((this == player) && (justTeleported > 0)) || (this.posX != this.targetX)) || (this.posY != this.targetY)) {
this.XDISTANCE = Math.round((this.targetX - this.posX) * 10000) / 10000;
this.YDISTANCE = Math.round((this.targetY - this.posY) * 10000) / 10000;
if ((this.XDISTANCE == 0) && (this.YDISTANCE == 0)) {
this.posX = this.targetX;
this.posY = this.targetY;
} else {
this.thedistance = Math.sqrt((this.XDISTANCE * this.XDISTANCE) + (this.YDISTANCE * this.YDISTANCE));
if ((this.thedistance < 1) && (this.isMissile == false)) {
this.targetX = this.posX;
this.targetY = this.posY;
this.Speed = this.SpeedMin;
this.Turn = this.TurnMin;
if (this.markStandStill) {
this.standStill = true;
}
} else {
if (this.Speed < this.SpeedMax) {
this.Speed = this.Speed + (this.SpeedAcceleration * mmm);
if (this.Speed > this.SpeedMax) {
this.Speed = this.SpeedMax;
}
}
if (this.Turn < this.TurnMax) {
this.Turn = this.Turn + (this.TurnAcceleration * mmm);
if (this.Turn > this.TurnMax) {
this.Turn = this.TurnMax;
}
}
this.rad = Math.asin(this.YDISTANCE / this.thedistance);
this.WantedDirection = (this.rad * 57.29578) + 90;
if (this.XDISTANCE <= 0) {
this.WantedDirection = 360 - this.WantedDirection;
}
if ((this.isMissile == false) || (this.follow != null)) {
if (this.standStill || (this.thedistance < this.closeLimit)) {
this.Direction = this.WantedDirection;
} else {
this.rotationen = Math.abs(this.WantedDirection - this.Direction);
if (this.rotationen > this.Turn) {
this.rotationen = this.Turn;
}
this.zrot = this.Direction - this.WantedDirection;
if (this.zrot <= 0) {
this.zrot = this.zrot + 360;
}
if (this.zrot <= 180) {
this.Direction = this.Direction - this.rotationen;
} else {
this.Direction = this.Direction + this.rotationen;
}
if (this.Direction <= 0) {
this.Direction = this.Direction + 360;
}
if (this.Direction > 360) {
this.Direction = this.Direction - 360;
}
}
}
this.beforeX = this.posX;
this.beforeY = this.posY;
this.nrot = this.Direction * 0.01745329;
this.posX = this.posX + ((Math.sin(this.nrot) * this.Speed) * mmm);
this.posY = this.posY - ((Math.cos(this.nrot) * this.Speed) * mmm);
this.standStill = false;
if (this.isMissile == false) {
if ((this.beforeX < this.targetX) && (this.posX > this.targetX)) {
this.posX = this.targetX;
}
if ((this.beforeY < this.targetY) && (this.posY > this.targetY)) {
this.posY = this.targetY;
}
}
}
}
this._x = this.posX;
this._y = this.posY;
if ((this.eye != null) || ((this == player) && (abilityType == 1))) {
if ((this.Direction > 0) && (this.Direction <= 45)) {
this.kantX = (this._width / 2) + ((((this._width - 2) / 2) * this.Direction) / 45);
this.kantY = 2;
} else if ((this.Direction > 45) && (this.Direction <= 135)) {
this.kantX = this._width - 2;
this.kantY = 2 + (((this._height - 4) * (this.Direction - 45)) / 90);
} else if ((this.Direction > 135) && (this.Direction <= 225)) {
this.kantX = ((2 + this._width) - 4) - (((this._width - 4) * (this.Direction - 135)) / 90);
this.kantY = this._height - 2;
} else if ((this.Direction > 225) && (this.Direction <= 315)) {
this.kantX = 2;
this.kantY = ((2 + this._height) - 4) - (((this._height - 4) * (this.Direction - 225)) / 90);
} else {
this.kantX = 2 + ((((this._width - 2) / 2) * (this.Direction - 315)) / 45);
this.kantY = 2;
}
if (this.eye != null) {
this.eye.clear();
this.eye.lineTo(this._width / 2, this._height / 2);
this.eye.lineStyle(2, this.eyeColor, 100, true, "normal", "none", "round");
this.eye.lineTo(this.kantX, this.kantY);
}
}
} else if (this.isEnemy == false) {
this.Speed = this.SpeedMin;
this.Turn = this.TurnMin;
if (this.markStandStill) {
this.standStill = true;
}
}
if (this.isEnemy) {
if (this._alpha < 100) {
this._alpha = this._alpha - (150 * mmm);
}
if (((this.hitTest(player) && (invulnerable == 0)) && (!isShifting)) && (this._alpha == 100)) {
invulnerable = invulnerableTime;
}
if ((((this.posX < -24) || (this.posY < -24)) || (this.posX > 500)) || (this.posY > 500)) {
i = 0;
while (i < missiles.length) {
if (missiles[i].follow == this) {
missiles[i].follow = null;
missiles[i].eye._alpha = 0;
}
i++;
}
this._alpha = 100;
this.Speed = 50;
this.SpeedMax = 200;
this.SpeedAcceleration = 100;
this.Turn = 0.5;
this.TurnMax = 90;
this.TurnAcceleration = 0;
this.standStill = true;
if (Math.random() < 0.5) {
this.posX = (524 * Math.random()) - 24;
this.targetX = (524 * Math.random()) - 24;
if (Math.random() < 0.5) {
this.posY = -24;
this.targetY = 501;
} else {
this.posY = 500;
this.targetY = -25;
}
} else {
this.posY = (524 * Math.random()) - 24;
this.targetY = (524 * Math.random()) - 24;
if (Math.random() < 0.5) {
this.posX = -24;
this.targetX = 501;
} else {
this.posX = 500;
this.targetX = -25;
}
}
}
} else if ((this == player) && (justTeleported != 0)) {
justTeleported = justTeleported - mmm;
if (justTeleported < 0) {
justTeleported = 0;
}
if (invulnerable == 0) {
this._alpha = 50 + (50 * (1 - (justTeleported / 0.2)));
}
} else if (this.isMissile) {
i = 0;
while (i < fienderArray.length) {
if (this.hitTest(fienderArray[i]) && (fienderArray[i]._alpha == 100)) {
this._visible = false;
fienderArray[i]._alpha = 50;
}
i++;
}
if ((this.posX == this.targetX) && (this.posY == this.targetY)) {
this._visible = false;
} else if ((this.follow == null) && ((((this.posX < -50) || (this.posX > 550)) || (this.posY < -50)) || (this.posY > 550))) {
this._visible = false;
} else if (this.follow._alpha != 100) {
this.follow = null;
this.eye._alpha = 0;
}
} else if (this.babyHelper) {
this.closestExpDistance = -1;
this.closestExp = null;
i = 0;
while (i <= expArray.length) {
if (expArray[i]._visible == true) {
if (this.hitTest(expArray[i])) {
experience++;
expArray[i].life = 0;
expArray[i]._visible = false;
expArray[i]._alpha = 100;
}
if (expArray[i]._visible == true) {
this.XDISTANCEc = (this._x + 3.125) - expArray[i]._x;
this.YDISTANCEc = (this._y + 3.125) - expArray[i]._y;
this.thedistanceC = Math.sqrt((this.XDISTANCEc * this.XDISTANCEc) + (this.YDISTANCEc * this.YDISTANCEc));
if ((this.thedistanceC < this.closestExpDistance) || (this.closestExpDistance == -1)) {
this.closestExpDistance = this.thedistanceC;
this.closestExp = expArray[i];
}
}
}
i++;
}
if (this.closestExp == null) {
this.follow = null;
this.targetX = this.posX;
this.targetY = this.posY;
} else {
this.follow = this.closestExp;
}
}
}
};
return(square);
}
function addToGame(typ) {
if (typ == "fiende") {
nytt = createSquare("enemy" + fiender, 25, 25, "000000", 50000 + fiender, -25, -25);
nytt.isEnemy = true;
fienderArray[fiender] = nytt;
fiender++;
} else {
slumpX = Math.random() * 500;
slumpY = Math.random() * 500;
if (typ == "energi") {
arbetaMedPickup(typ, 1, energiArray, 6.25, "FF0000", 20000, slumpX, slumpY, 3 + (Math.random() * (7 + energyStayExtra)));
} else if (typ == "bonus") {
arbetaMedPickup(typ, 2, bonusArray, 6.25, "00FF00", 30000, slumpX, slumpY, 2 + (Math.random() * (6 + bonusStayExtra)));
} else if (typ == "exp") {
arbetaMedPickup(typ, 3, expArray, 12.5, "FFFF00", 10000, slumpX, slumpY, 2 + (Math.random() * (8 + expStayExtra)));
}
}
}
function MakeTime(tidIsek) {
sekunderna = tidIsek % 60;
return((MakeTwo(Math.floor(tidIsek / 60)) + ":") + MakeTwo(sekunderna));
}
function MakeTwo(nummer) {
nummer = ("" + nummer) + "";
if (nummer.length > 2) {
return(nummer);
}
return(("" + "00".substring(0, 2 - nummer.length)) + nummer);
}
function arbetaMedPickup(typ, fyrkantstypen, arrayn, storlek, farg, djup, slumpX, slumpY, lifeFormula) {
nytt = findFreeExisting(arrayn);
if (nytt == null) {
nytt = createSquare(typ + arrayn.length, storlek, storlek, farg, djup + arrayn.length, slumpX, slumpY);
nytt.squareType = fyrkantstypen;
arrayn[arrayn.length] = nytt;
} else {
nytt._x = slumpX;
nytt._y = slumpY;
nytt.posX = slumpX;
nytt.posY = slumpY;
}
nytt.targetX = nytt.posX;
nytt.targetY = nytt.posY;
if (typ == "energi") {
if (Math.random() < energiFollowChans) {
nytt.SpeedMax = 40 * energiFollowSpeed;
nytt.SpeedAcceleration = 10 * energiFollowSpeed;
nytt.TurnMax = 0.4 * energiFollowSpeed;
nytt.TurnAcceleration = 0.1;
nytt.closeLimit = energiFollowCloseLimit;
nytt.standStill = true;
nytt.follow = player;
} else {
nytt.follow = null;
}
}
nytt.life = lifeFormula;
nytt._visible = true;
}
function findFreeExisting(arrayn) {
i = 0;
while (i < arrayn.length) {
if (arrayn[i]._visible == false) {
return(arrayn[i]);
}
i++;
}
return(null);
}
function fireZeMissile() {
abilityPower = abilityPower - ((abilityStage == 1) ? 100 : 50);
energy = energy - 30;
nytt = findFreeExisting(missiles);
if (nytt == null) {
nytt = createSquare("missile" + missiles.length, 10, 10, "AA00CC", 90000 + missiles.length, player.posX + player.kantX, player.posY + player.kantY);
nytt.isMissile = true;
nytt.eyeColor = "0xFFCC55";
nytt.createEmptyMovieClip("eye", nytt.getNextHighestDepth());
missiles[missiles.length] = nytt;
} else {
nytt.posX = player.posX + player.kantX;
nytt.posY = player.posY + player.kantY;
nytt._x = nytt.posX;
nytt._y = nytt.posY;
}
shortestDistance = -1;
lockOn = null;
i = 0;
while (i < fienderArray.length) {
if (fienderArray[i]._alpha == 100) {
XDISTANCEm = (aim._x + 6.25) - fienderArray[i]._x;
YDISTANCEm = (aim._y + 6.25) - fienderArray[i]._y;
thedistanceM = Math.sqrt((XDISTANCEm * XDISTANCEm) + (YDISTANCEm * YDISTANCEm));
if ((thedistanceM < shortestDistance) || (shortestDistance == -1)) {
shortestDistance = thedistanceM;
lockOn = fienderArray[i];
}
}
i++;
}
nytt.follow = lockOn;
nytt.standStill = false;
nytt.Direction = player.Direction;
nytt.SpeedMax = 300;
nytt.Speed = player.Speed;
nytt.SpeedAcceleration = 600;
nytt.Turn = 1.5;
nytt.TurnMax = 2.5;
nytt.TurnAcceleration = 2;
if (lockOn == null) {
nytt.eye._alpha = 0;
} else {
nytt.eye._alpha = 100;
}
nytt._visible = true;
}
function teleport() {
abilityPower = abilityPower - ((abilityStage == 1) ? 100 : 50);
energy = energy - 60;
justTeleported = 0.2;
rnd = Math.floor(Math.random() * 5000) + 1;
duplicateMovieClip (dummy, "dummy" + rnd, rnd);
this["dummy" + rnd].initiated = 1;
this["dummy" + rnd]._x = player._x;
this["dummy" + rnd]._y = player._y;
this["dummy" + rnd]._alpha = 50;
player.posX = aim._x - 18.75;
player.posY = aim._y - 18.75;
player._x = player.posX;
player._y = player.posY;
if (invulnerable == 0) {
player._alpha = 50;
}
}
function shifting(starting) {
abilityPower = abilityPower - 30;
if (starting) {
savedPlayerX = player._x;
savedPlayerY = player._y;
player._alpha = 20;
energy = energy - 25;
} else {
player._alpha = 100;
player._width = 50;
player._height = 50;
}
isShifting = starting;
}
drainPerSecond = 0.75;
recoverDrainPerSecondMultiplier = 1;
invulnerableTime = 1.5;
energiChans = 0.3;
bonusChans = 0.15;
expChans = 0.6;
energyStayExtra = 0;
bonusStayExtra = 0;
expStayExtra = 0;
spacePenaltyTime = 0.75;
topEnergySpawnTimeLimit = 5;
playerCanCatchExp = false;
energiFollowChans = 0;
energiFollowSpeed = 1;
energiFollowCloseLimit = 0;
batteryIncrease = 1;
tractorBeam = false;
tractorBeamSpeedMax = 1250;
abilityType = 0;
abilityStage = 1;
gameOver._visible = false;
shop._visible = false;
shop.swapDepths(150000);
ability._visible = false;
dummy._visible = false;
createSquare("aim", 12.5, 12.5, "0000FF", 100002, 250, 250);
createSquare("player", 50, 50, "FF0000", 100000, 250, 250);
player.follow = aim;
fiender = 0;
energiArray = new Array();
bonusArray = new Array();
expArray = new Array();
fienderArray = new Array();
tidSedanFiende = 0;
tidSedanEnergi = 0;
tidSedanEnergiTrue = 0;
tidSedanBonus = 0;
tidSedanExp = 0;
missiles = new Array();
addToGame("fiende");
aListener = new Object();
aListener.onKeyDown = function () {
lastCode = Key.getCode();
};
Key.addListener(aListener);
bListener = new Object();
bListener.onMouseDown = function () {
if ((!spaceMenu) && (spacePenalty <= 0)) {
clickDown = 1;
}
};
bListener.onMouseUp = function () {
if ((!spaceMenu) && (spacePenalty <= 0)) {
clickUp = 1;
}
};
Mouse.addListener(bListener);
lastCode = 0;
clickDown = 0;
clickUp = 0;
abilityState = 0;
timeMousePressed = 0;
lastframe = getTimer();
mmm = 0;
spaceMenu = false;
spacePenalty = 0;
energy = 600;
energyMax = 600;
extraEnergyDrain = 0;
recoverDrainPerSecond = 0;
invulnerable = 0;
score = 0;
timer = 0;
experience = 0;
IOU = 0;
batteryFade = 0;
spawnaNyFiendeVarje = 15;
abilityReady = true;
abilityCooldown = 0;
abilityPower = 100;
isShifting = false;
justTeleported = 0;
onEnterFrame = function () {
if (energy > 0) {
if (lastCode != 0) {
if ((((((lastCode == 9) || (lastCode == 13)) || (lastCode == 27)) || (lastCode == 32)) || (lastCode == 76)) || (lastCode == 112)) {
spaceMenu = !spaceMenu;
if (!spaceMenu) {
_root._quality = "MEDIUM";
shop._visible = false;
spacePenalty = spacePenaltyTime;
aimXbuff = aim._x;
aimYbuff = aim._y;
} else {
_root._quality = "HIGH";
shop._visible = true;
}
}
}
nu = getTimer();
mmm = (nu - lastframe) / 1000;
lastframe = nu;
if (spaceMenu) {
Mouse.show();
} else {
if (abilityType != 0) {
if (abilityCooldown != 0) {
abilityCooldown = abilityCooldown - (200 * mmm);
if (abilityCooldown < 0) {
abilityCooldown = 0;
}
} else if (isShifting == false) {
if (abilityPower != 100) {
abilityPower = abilityPower + (50 * mmm);
if (abilityPower > 100) {
abilityPower = 100;
}
}
}
abilityReady = false;
if ((abilityCooldown == 0) && (energy > 50)) {
if ((abilityType == 1) && (((abilityPower >= 100) && (abilityStage == 1)) || ((abilityPower >= 50) && (abilityStage == 2)))) {
abilityReady = true;
} else if ((abilityType == 2) && (((abilityPower >= 100) && (abilityStage == 1)) || ((abilityPower >= 50) && (abilityStage == 2)))) {
abilityReady = true;
} else if (((abilityType == 3) && (abilityPower >= 60)) && (isShifting == false)) {
abilityReady = true;
}
}
if ((abilityState == 0) && (clickDown == 1)) {
abilityState = 1;
}
if (abilityState == 1) {
if ((abilityType == 1) && (abilityReady)) {
fireZeMissile();
abilityCooldown = 100;
} else if ((abilityType == 2) && (timeMousePressed == 0)) {
if (abilityReady) {
teleport();
abilityCooldown = 100;
}
} else if (abilityType == 3) {
if (timeMousePressed == 0) {
if (abilityReady) {
shifting(true);
abilityCooldown = 100;
}
} else if (isShifting) {
if ((abilityPower - (((abilityStage == 1) ? 20 : 10) * mmm)) > 30) {
abilityPower = abilityPower - (((abilityStage == 1) ? 20 : 10) * mmm);
energy = energy - (40 * mmm);
} else {
shifting(false);
}
}
}
timeMousePressed = timeMousePressed + mmm;
}
if ((abilityState == 1) && (clickUp == 1)) {
abilityState = 0;
timeMousePressed = 0;
if ((abilityType == 3) && (isShifting)) {
shifting(false);
}
}
}
clickDown = 0;
clickUp = 0;
timer = timer + mmm;
tidSedanFiende = tidSedanFiende + mmm;
tidSedanEnergi = tidSedanEnergi + mmm;
tidSedanEnergiTrue = tidSedanEnergiTrue + mmm;
tidSedanBonus = tidSedanBonus + mmm;
tidSedanExp = tidSedanExp + mmm;
while (tidSedanFiende > spawnaNyFiendeVarje) {
tidSedanFiende = tidSedanFiende - spawnaNyFiendeVarje;
spawnaNyFiendeVarje = spawnaNyFiendeVarje + 1;
addToGame("fiende");
}
while (tidSedanEnergi > 1) {
tidSedanEnergi = tidSedanEnergi - 1;
if ((Math.random() < energiChans) || (tidSedanEnergiTrue >= topEnergySpawnTimeLimit)) {
tidSedanEnergiTrue = 0;
addToGame("energi");
}
}
while (tidSedanBonus > 2) {
tidSedanBonus = tidSedanBonus - 2;
if (Math.random() < bonusChans) {
addToGame("bonus");
}
}
while (tidSedanExp > 1) {
tidSedanExp = tidSedanExp - 1;
if (Math.random() < expChans) {
addToGame("exp");
}
}
if (invulnerable > 0) {
player._alpha = 40 + (10 * Math.random());
invulnerable = invulnerable - mmm;
if (invulnerable <= 0) {
energy = energy - (100 * (mmm + invulnerable));
invulnerable = 0;
if (!isShifting) {
player._alpha = 100;
}
} else {
energy = energy - (100 * mmm);
}
}
if (spacePenalty > 0) {
spacePenalty = spacePenalty - mmm;
if (spacePenalty <= 0) {
aim._x = aimXbuff;
aim._y = aimYbuff;
} else {
aim._x = (aimXbuff + (4 * Math.random())) - 2;
aim._y = (aimYbuff + (4 * Math.random())) - 2;
}
} else {
Mouse.hide();
aimX = _root._xmouse;
aimY = _root._ymouse;
aimX = ((aimX < 0) ? 0 : (((aimX > 500) ? 500 : (aimX))));
aimY = ((aimY < 0) ? 0 : (((aimY > 500) ? 500 : (aimY))));
aim._x = aimX - 6.25;
aim._y = aimY - 6.25;
}
if (!isShifting) {
if (player.posX == player.targetX) {
extraEnergyDrain = extraEnergyDrain - (recoverDrainPerSecond * mmm);
if (extraEnergyDrain < 0) {
extraEnergyDrain = 0;
}
recoverDrainPerSecond = recoverDrainPerSecond * (1 + (recoverDrainPerSecondMultiplier * mmm));
} else {
recoverDrainPerSecond = recoverDrainPerSecondMultiplier;
extraEnergyDrain = extraEnergyDrain + (drainPerSecond * mmm);
}
}
score = score + ((invulnerable == 0) ? (mmm) : (mmm / 2));
energy = energy - ((4 + extraEnergyDrain) * mmm);
scoreField.text = Math.floor(score);
drainField.text = Math.round(extraEnergyDrain);
energyBar._width = (476 * energy) / energyMax;
collected.gotoAndStop((Math.floor(experience) % 10) + 1);
if (experience < 10) {
expField.htmlText = "<font color=\"#eeeeee\">0</font>";
} else {
expField.text = Math.floor(experience / 10);
}
}
fpsField.text = Math.round(1 / mmm) + " FPS";
timerField.text = MakeTime(Math.floor(timer));
lastCode = 0;
} else if (gameOver._visible == false) {
_root._quality = "HIGH";
Mouse.show();
energyBar._visible = false;
gameOver._visible = true;
gameOver.swapDepths(200000);
gameOver.finalScore.text = Math.floor(score);
gameOver.finalTime.text = MakeTime(Math.floor(timer));
gameOver.onRelease = function () {
_root.gotoAndPlay(1);
};
}
};