[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (1.1 KiB) ●
stop();
Stage.showMenu = false;
gobut._visible = false;
_root.so = SharedObject.getLocal("inf2");
if (_root.so.data.losses == undefined) {
_root.so.data.onepwins = 0;
_root.so.data.twopwins = 0;
_root.so.data.bgplays = new Array(0, 0, 0, 0, 0);
_root.so.data.fgplays = new Array(0, 0, 0, 0, 0);
_root.so.data.onepthreeonone = false;
_root.so.data.onepsixontwo = false;
_root.so.data.onepsixonone = 0;
_root.so.data.onepart = 0;
_root.so.data.onepcav = false;
_root.so.data.onepgrenades = false;
_root.so.data.onepnoswitch = 0;
_root.so.data.losses = 0;
_root.so.data.folds = new Array(0, 0, 0, 0);
trace("NO DATA CREATING NEW SAVE FILE");
}
_root.tot1ploss = _root.so.data.losses;
_root.tot1pwins = _root.so.data.onepwins;
this.onEnterFrame = function () {
bl = _root.getBytesLoaded();
bt = _root.getBytesTotal();
perc = (bl / bt) * 100;
dabar.bar._xscale = perc;
if (perc >= 100) {
delete this.onEnterFrame;
dabar._visible = false;
gobut._visible = true;
bolt.gotoAndPlay(2);
gobut.onPress = function () {
this._parent.tranny.gotoAndPlay(2);
};
}
};
Frame 3 (8 B)
stop();
Frame 4 (8 B)
stop();
Frame 5 (74.72 KiB) ● ● ● ●
function resetAll() {
_root.gamesup = false;
_root.aiclose = false;
_root.iknowit = false;
stopAllSounds();
delete this.onEnterFrame;
_root.g.unloadMovie();
_root.g.removeMovieClip();
_root.water.unloadMovie();
_root.water.removeMovieClip();
_root.dudes.unloadMovie();
_root.dudes.removeMovieClip();
_root.pw.unloadMovie();
_root.pw.removeMovieClip();
_root.cover.unloadMovie();
_root.cover.removeMovieClip();
_root.hud.unloadMovie();
_root.hud.removeMovieClip();
_root.bg.unloadMovie();
_root.bg.removeMovieClip();
_root.gameover.unloadMovie();
_root.gameover.removeMovieClip();
_root.gotoAndStop(3);
}
function chkAchieve(vin) {
stopAllSounds();
h = _root.attachMovie("gameover", "gameover", 888);
var _local2 = false;
if (vin == "good") {
_root.fanfaresound.start();
h.picos._visible = true;
h.ubers._visible = false;
if (aion) {
_root.so.data.onepwins = _root.so.data.onepwins + 1;
}
if (!_root.aion) {
_root.so.data.twopwins = _root.so.data.twopwins + 1;
}
if ((((team0.length == 1) && (team1.length == 3)) && (!_root.so.data.onepthreeonone)) && (aion)) {
_root.so.data.onepthreeonone = true;
_local2 = true;
}
if ((((team0.length == 2) && (team1.length == 6)) && (!_root.so.data.onepsixontwo)) && (aion)) {
_root.so.data.onepsixontwo = true;
_local2 = true;
}
if (((team0.length == 1) && (team1.length == 6)) && (aion)) {
_root.so.data.onepsixonone = _root.so.data.onepsixonone + 1;
if (_root.so.data.onepsixonone == 3) {
_local2 = true;
}
}
if ((_root.abletomove == false) && (aion)) {
_root.so.data.onepart = _root.so.data.onepart + 1;
if ((_root.so.data.onepart == 1) || (_root.so.data.onepart == 5)) {
_local2 = true;
}
}
if (_root.cavern && (!_root.so.data.onepcav)) {
_root.so.data.onepcav = true;
_local2 = true;
}
if ((_root.abletoswitch == false) && (aion)) {
_root.so.data.onepnoswitch = _root.so.data.onepnoswitch + 1;
if (_root.so.data.onepnoswitch == 2) {
_local2 = true;
}
}
if (((((((!_root.so.data.onepgrenades) && (goodweaps[0] == 0)) && (goodweaps[2] == 0)) && (goodweaps[3] == 0)) && (goodweaps[4] == 0)) && (goodweaps[5] == 0)) && (aion)) {
_root.so.data.onepgrenades = true;
_local2 = true;
}
} else {
losesound.start();
h.picos._visible = false;
h.ubers._visible = true;
_root.so.data.losses = _root.so.data.losses + 1;
}
_root.tot1ploss = _root.so.data.losses;
_root.tot1pwins = _root.so.data.onepwins;
var _local4 = 0;
i = 0;
while (i < _root.so.data.bgplays.length) {
if (i == _root.bgid) {
_root.so.data.bgplays[i] = _root.so.data.bgplays[i] + 1;
}
if (_root.so.data.bgplays[i] > 0) {
_local4 = _local4 + 1;
}
i++;
}
if ((_local4 >= _root.so.data.bgplays.length) && (!_root.so.data.bggotten)) {
_local2 = true;
_root.so.data.bggotten = true;
}
var _local3 = 0;
i = 0;
while (i < _root.so.data.fgplays.length) {
if (i == _root.fgid) {
_root.so.data.fgplays[i] = _root.so.data.fgplays[i] + 1;
}
if (_root.so.data.fgplays[i] > 0) {
_local3 = _local3 + 1;
}
i++;
}
if ((_local3 >= _root.so.data.fgplays.length) && (!_root.so.data.fggotten)) {
_local2 = true;
_root.so.data.fggotten = true;
}
if (_local2) {
h.adv._visible = true;
} else {
h.adv._visible = false;
}
}
function clearTel() {
_root.panon = false;
_root.airstrike = false;
_root.teleportation = false;
_root.teletubby.unloadMovie();
_root.teletubby.removeMovieClip();
}
function flashIt() {
this.attachMovie("flashthing", "flashit", 9999);
}
function chkTel() {
if (_root.sel.Yvel < 1.5) {
_root.clearTel();
_root.readytoswitchweapons = false;
_root.teletimer = _root.teletimer + 1;
if (_root.teletimer > 10) {
_root.turncv = 1;
clearInterval(_root.teltimer);
}
}
}
function freshInst(mod, who) {
k = hud.createEmptyMovieClip("inst", 199);
if (mod == 0) {
i = 0;
while (i < 2) {
w = k.attachMovie("invblock", "block" + i, i);
w._x = w._width * i;
if (i == 0) {
w.holder.attachMovie("icon_switch", "guts", 0);
w.nam = "'S'";
}
if (i == 1) {
w.holder.attachMovie("icon_check", "guts", 0);
w.nam = "SPACE";
}
w.amt._visible = false;
i++;
}
}
if (mod == 1) {
i = 0;
while (i < 2) {
w = k.attachMovie("invblock", "block" + i, i);
w._x = w._width * i;
if (i == 0) {
w.holder.attachMovie("icon_leftright", "guts", 0);
w.nam = "ARROWS";
}
if (i == 1) {
w.holder.attachMovie("icon_aim", "guts", 0);
w.nam = "SPACE";
}
w.amt._visible = false;
i++;
}
}
if (mod == 2) {
offsetx = 0;
i = 0;
while (i < (who.myweaps.length + 1)) {
w = k.attachMovie("invblock", "block" + i, i);
w._x = (w._width * i) - (offsetx * w._width);
if (who.myweaps[i] != -1) {
if ((who.myweaps[i] > 0) || (i >= who.myweaps.length)) {
if (i < who.myweaps.length) {
w.nam = i + 1;
w.holder.attachMovie("item" + i, "guts", 0);
w.amt.amt = who.myweaps[i];
w.amt.inf._visible = false;
} else {
w.holder.attachMovie("icon_esc", "guts", 0);
w.amt._visible = false;
w.nam = "'ESC'";
}
} else {
w._visible = false;
offsetx = offsetx + 1;
}
} else {
w.nam = i + 1;
w.holder.attachMovie("item" + i, "guts", 0);
w.amt.inf._visible = true;
w.amt.amt = "";
}
i++;
}
}
if (mod == 3) {
i = 0;
while (i < 2) {
w = k.attachMovie("invblock", "block" + i, i);
w._x = w._width * i;
if (i == 0) {
w.holder.attachMovie("icon_updown", "guts", 0);
w.nam = "ARROWS";
}
if (i == 1) {
w.holder.attachMovie("icon_power", "guts", 0);
w.nam = "SPACE";
}
w.amt._visible = false;
i++;
}
}
if (mod == 4) {
i = 0;
while (i < 1) {
w = k.attachMovie("invblock", "block" + i, i);
w._x = w._width * i;
if (i == 0) {
w.holder.attachMovie("icon_go", "guts", 0);
w.nam = "SPACE";
}
w.amt._visible = false;
i++;
}
}
if (mod == 5) {
i = 0;
while (i < 2) {
w = k.attachMovie("invblock", "block" + i, i);
w._x = w._width * i;
if (i == 0) {
w.holder.attachMovie("icon_leftright", "guts", 0);
w.nam = "ARROWS";
}
if (i == 1) {
w.holder.attachMovie("icon_go", "guts", 0);
w.nam = "SPACE";
}
w.amt._visible = false;
i++;
}
}
k._y = -520;
k.goal = -420;
k._x = 350 - (k._width / 2);
k.onEnterFrame = function () {
if (!_root.loadinglevel) {
var _local3 = this.goal - this._y;
this._y = this._y + (_local3 / 3);
var _local4 = Math.abs(_local3);
if (_local4 <= 1) {
this._y = this.goal;
delete this.onEnterFrame;
}
}
};
}
function clearInst() {
hud.inst.onEnterFrame = function () {
var _local2 = -550 - this._y;
this._y = this._y + (_local2 / 4);
var _local3 = Math.abs(_local2);
if (_local3 <= 1) {
this._y = this._y + _local2;
delete this.onEnterFrame;
}
};
}
function initLvl(bgcol, fgcol, inside, fgtex, bgtex) {
circcount = 0;
panspeed = 10;
_root.grav = 0.5;
b = _root.createEmptyMovieClip("g", 1);
mainmusic = new Sound(b);
_root.curtrack = random(3);
mainmusic.attachSound("bgmusic" + _root.curtrack);
w = _root.attachMovie("waterclip", "water", 98);
w._y = 470;
_root.createEmptyMovieClip("dudes", 4);
_root.createEmptyMovieClip("pw", 2);
c = _root.createEmptyMovieClip("cover", 3);
c.beginFill(bgcol, 100);
c.moveTo(-600, -600);
c.lineTo(3500, -600);
c.lineTo(3500, 3500);
c.lineTo(-600, 3500);
c.endFill();
backy = c.attachMovie("bg" + bgtex, "bg", 0);
cover.setMask(pw);
_root.attachMovie("HUD", "hud", 99);
hud._y = 426;
updateHUDdudes(team0.length, 0);
updateHUDdudes(team1.length, 1);
e = _root.createEmptyMovieClip("bg", 0);
e.beginFill(bgcol, 100);
e.lineTo(700, 0);
e.lineTo(700, 550);
e.lineTo(0, 550);
e.endFill();
e.attachMovie("bg" + bgtex, "bg", 0);
var _local3 = random(100) - 200;
var _local2 = random(200) + 400;
var _local12 = random(100) + 200;
var _local11 = random(550);
var _local5 = (_local3 + random(150)) + 400;
var _local10 = (_local2 - random(150)) - 50;
var _local14 = random(100) + 400;
var _local13 = random(550);
var _local4 = (_local5 + random(150)) + 200;
var _local31 = random(550);
var _local20 = random(100) + 750;
var _local18 = random(550);
var _local9 = (_local4 + random(250)) + 550;
var _local30 = random(350);
var _local22 = random(200) + 1350;
var _local21 = random(350);
var _local8 = (_local9 + random(150)) + 100;
var _local29 = random(550);
var _local16 = random(200) + 1700;
var _local15 = random(550);
var _local7 = (_local8 + random(150)) + 300;
var _local27 = random(550);
var _local19 = random(200) + 2200;
var _local17 = random(550);
var _local6 = (_local7 + random(150)) + 400;
var _local24 = random(550);
var _local28 = random(200) + 2700;
var _local25 = random(550);
var _local26 = (_local6 + random(150)) + 600;
var _local23 = random(550) + 300;
b.lineStyle(lineweight, 0);
b.beginFill(fgcol, 100);
b.moveTo(_local3, _local2);
b.curveTo(_local12, _local11, _local5, _local10);
b.curveTo(_local14, _local13, _local4, _local31);
b.curveTo(_local20, _local18, _local9, _local30);
b.curveTo(_local22, _local21, _local8, _local29);
b.curveTo(_local16, _local15, _local7, _local27);
b.curveTo(_local19, _local17, _local6, _local24);
b.curveTo(_local28, _local25, _local26, _local23);
b.curveTo(3800, 1200, 2000, 1200);
b.curveTo(-100, 1200, _local3, _local2);
b.endFill();
tx = b.createEmptyMovieClip("texture", 2);
tx.beginFill(16777215, 100);
tx.moveTo(_local3, _local2);
tx.curveTo(_local12, _local11, _local5, _local10);
tx.curveTo(_local14, _local13, _local4, _local31);
tx.curveTo(_local20, _local18, _local9, _local30);
tx.curveTo(_local22, _local21, _local8, _local29);
tx.curveTo(_local16, _local15, _local7, _local27);
tx.curveTo(_local19, _local17, _local6, _local24);
tx.curveTo(_local28, _local25, _local26, _local23);
tx.curveTo(3800, 1200, 2000, 1200);
tx.curveTo(-100, 1200, _local3, _local2);
tx.cacheAsBitmap = true;
ingrid = b.attachMovie("texture" + fgtex, "tex", 1);
ingrid.setMask(tx);
if (inside) {
_local3 = random(100) - 200;
_local2 = random(200) - 100;
_local12 = random(100) + 200;
_local11 = random(550) - 300;
_local5 = (_local3 + random(150)) + 400;
_local10 = (_local2 - random(150)) - 150;
_local14 = random(100) + 400;
_local13 = random(550) - 300;
_local4 = (_local5 + random(150)) + 200;
_local31 = random(750) - 400;
_local20 = random(100) + 750;
_local18 = random(550) - 300;
_local9 = (_local4 + random(250)) + 550;
_local30 = random(750) - 400;
_local22 = random(200) + 1350;
_local21 = random(350) - 300;
_local8 = (_local9 + random(150)) + 300;
_local29 = random(750) - 400;
_local16 = random(200) + 1700;
_local15 = random(550) - 300;
_local7 = (_local8 + random(150)) + 300;
_local27 = random(750) - 400;
_local19 = random(200) + 2200;
_local17 = random(550) - 300;
_local6 = (_local7 + random(150)) + 400;
_local24 = random(750) - 400;
_local28 = random(200) + 2700;
_local25 = random(550) - 300;
_local26 = (_local6 + random(150)) + 600;
_local23 = random(750) - 700;
r = b.createEmptyMovieClip("topp", -3);
r.lineStyle(lineweight, 0);
r.beginFill(fgcol, 100);
r.moveTo(_local3, _local2);
r.curveTo(_local12, _local11, _local5, _local10);
r.curveTo(_local14, _local13, _local4, _local31);
r.curveTo(_local20, _local18, _local9, _local30);
r.curveTo(_local22, _local21, _local8, _local29);
r.curveTo(_local16, _local15, _local7, _local27);
r.curveTo(_local19, _local17, _local6, _local24);
r.curveTo(_local28, _local25, _local26, _local23);
r.curveTo(3800, -1200, 2500, -1900);
r.curveTo(-100, -1200, _local3, _local2);
tp = b.createEmptyMovieClip("texture2", -2);
tp.beginFill(fgcol, 100);
tp.moveTo(_local3, _local2);
tp.curveTo(_local12, _local11, _local5, _local10);
tp.curveTo(_local14, _local13, _local4, _local31);
tp.curveTo(_local20, _local18, _local9, _local30);
tp.curveTo(_local22, _local21, _local8, _local29);
tp.curveTo(_local16, _local15, _local7, _local27);
tp.curveTo(_local19, _local17, _local6, _local24);
tp.curveTo(_local28, _local25, _local26, _local23);
tp.curveTo(3800, -1200, 2500, -1900);
tp.curveTo(-100, -1200, _local3, _local2);
tp.endFill();
tp.cacheAsBitmap = true;
ingrid2 = b.attachMovie("texture" + fgtex, "tex2", -1);
ingrid2.setMask(tp);
}
b.cacheAsBitmap = true;
alignAll();
_root.attachMovie("levload", "levload", 9998281);
_root.physactive = true;
_root.loadinglevel = true;
_root.halfcv = 0;
_root.second = setInterval(half2, 100);
}
function changeVol(main) {
main.slider._x = main._xmouse;
if (main.slider._x < (main.thing._x + 10)) {
main.slider._x = main.thing._x + 10;
}
if (main.slider._x > (main.thing._width + 10)) {
main.slider._x = main.thing._width + 10;
}
var _local2 = ((main.slider._x - 24) / 28) * 100;
mainmusic.setVolume(_local2);
}
function switchTracks() {
if (_root.curtrack < 2) {
_root.curtrack = _root.curtrack + 1;
} else {
_root.curtrack = 0;
}
mainmusic.stop();
mainmusic = new Sound(_root.g);
mainmusic.attachSound("bgmusic" + _root.curtrack);
mainmusic.start(0, 999);
var _local2 = ((hud.volcontrol.slider._x - 24) / 28) * 100;
mainmusic.setVolume(_local2);
}
function half2() {
halfcv = halfcv + 1;
if (halfcv >= 3) {
if (!_root.madeteam) {
team0cv = 0;
team1cv = 0;
masterturn = "good";
updateHP();
makeTeam0();
makeTeam1();
_root.allvirts = setInterval(getVirts, 5);
_root.g.cacheAsBitmap = true;
clearPointers();
showPointer();
_root.madeteam = true;
}
if ((halfcv > 6) && (!_root.chkout)) {
i = 0;
while (i < team0.length) {
var yo = eval ("dudes.good" + i);
var cv = 0;
while (r.hitTest(yo._x, yo._y, true) && (cv < 900)) {
yo._y = yo._y + 2;
yo.virty = yo.virty + 2;
yo._x = yo._x + 0.5;
yo.virtx = yo.virtx + 0.5;
cv = cv + 1;
}
if (g.hitTest(yo.virtx, yo.virty - 15, true)) {
makeDivot(yo._x, yo._y + 10, random(200) + 100, yo);
}
i++;
}
i = 0;
while (i < team1.length) {
var yo = eval ("dudes.bad" + i);
var cv = 0;
while (r.hitTest(yo._x, yo._y, true) && (cv < 900)) {
yo._y = yo._y + 2;
yo.virty = yo.virty + 2;
yo._x = yo._x + 0.5;
yo.virtx = yo.virtx + 0.5;
cv = cv + 1;
}
if (g.hitTest(yo.virtx, yo.virty - 15, true)) {
makeDivot(yo._x, yo._y + 10, random(200) + 100, yo);
}
i++;
}
_root.chkout = true;
}
if (halfcv > 18) {
_root.levload.unloadMovie();
_root.levload.removeMovieClip();
_root.loadinglevel = false;
_root.selecting = true;
halfcv = 0;
_root.madeteam = false;
_root.chkout = false;
mainmusic.start(0, 999);
mainmusic.setVolume(25);
clearInterval(_root.second);
}
}
}
function updateHP() {
var team0max = 0;
var team0total = 0;
var team0count = team0.length;
i = 0;
while (i < team0.length) {
var d = eval ("dudes.good" + i);
if (d.dead) {
team0count = team0count - 1;
}
team0max = team0max + parseInt(d.maxhp);
team0total = team0total + parseInt(d.hp);
i++;
}
hud.team0bar._xscale = (team0total / _root.team0maxhp) * 100;
var team1max = 0;
var team1total = 0;
var team1count = team1.length;
i = 0;
while (i < team1.length) {
var d = eval ("dudes.bad" + i);
if (d.dead) {
team1count = team1count - 1;
}
team1max = team1max + parseInt(d.maxhp);
team1total = team1total + parseInt(d.hp);
i++;
}
updateHUDdudes(team0count, 0);
updateHUDdudes(team1count, 1);
hud.team1bar._xscale = (team1total / _root.team1maxhp) * 100;
}
function updateHUDdudes(cv, which) {
i = 0;
while (i < 5) {
if (which == 0) {
var thing0 = eval ("hud.g" + i);
thing0._visible = false;
} else {
var thing1 = eval ("hud.d" + i);
thing1._visible = false;
}
i++;
}
i = 0;
while (i < cv) {
if (which == 0) {
var thing = eval ("hud.g" + i);
} else {
var thing = eval ("hud.d" + i);
}
thing._visible = true;
i++;
}
}
function getTurn(switcheroo) {
clearTel();
if (switcheroo) {
clearInst();
var alldead = false;
var dfg = 0;
i = 0;
while (i < team1.length) {
var turd = eval ("dudes.bad" + i);
if (turd.dead) {
dfg = dfg + 1;
}
i++;
}
if (dfg == team1.length) {
alldead = true;
}
if ((!alldead) && (aion)) {
_root.aiclose = false;
_root.iknowit = false;
}
}
_root.projtype = 1;
var beenswitched = false;
_root.beenreset = false;
offscreen.unloadMovie();
offscreen.removeMovieClip();
_root.team0maxhp = 0;
_root.team1maxhp = 0;
var dead0cv = team0.length;
var dead1cv = team1.length;
d = 0;
while (d < team0.length) {
var w = eval ("_root.dudes.good" + d);
w.bar._xscale = w._xscale;
w.bar.dabar._xscale = w.hp;
w.hittable = true;
if (!w.dead) {
w.bar._visible = true;
} else {
dead0cv = dead0cv - 1;
w.guts.gotoAndStop("dead");
w._xscale = 100;
}
_root.team0maxhp = _root.team0maxhp + parseInt(w.maxhp);
d++;
}
d = 0;
while (d < team1.length) {
var w = eval ("_root.dudes.bad" + d);
w.bar._xscale = w._xscale;
w.bar.dabar._xscale = w.hp;
w.hittable = true;
w.thinking._visible = false;
if (!w.dead) {
w.bar._visible = true;
} else {
dead1cv = dead1cv - 1;
w.guts.gotoAndStop("dead");
w._xscale = 100;
}
_root.team1maxhp = _root.team1maxhp + parseInt(w.maxhp);
d++;
}
updateHP();
if ((dead0cv == 0) && (dead1cv == 0)) {
trace("TIE!!!!");
hud.team0bar._xscale = 0;
hud.team1bar._xscale = 0;
var noloop = true;
var vinner = "good";
} else {
if (dead0cv == 0) {
var vinner = "bad";
hud.team0bar._xscale = 0;
var noloop = true;
}
if (dead1cv == 0) {
var vinner = "good";
hud.team1bar._xscale = 0;
var noloop = true;
}
}
if (switcheroo) {
if ((masterturn == "bad") && (!beenswitched)) {
masterturn = "good";
beenswitched = true;
}
if ((masterturn == "good") && (!beenswitched)) {
masterturn = "bad";
beenswitched = true;
}
}
if (masterturn == "good") {
team0cv = team0cv + 1;
if (team0cv > (team0.length - 1)) {
team0cv = 0;
}
var whobe = eval ("dudes.good" + team0cv);
}
if (masterturn == "bad") {
team1cv = team1cv + 1;
if (team1cv > (team1.length - 1)) {
team1cv = 0;
}
var whobe = eval ("dudes.bad" + team1cv);
}
if (!noloop) {
if ((!aion) || (_root.masterturn == "good")) {
freshInst(0);
}
if (whobe.dead) {
getTurn();
} else {
clearInterval(_root.waitforit);
clearInterval(_root.effectsWaiter);
_root.turncv = _root.maxturn;
_root.sel.guts.gotoAndStop("rest");
_root.retreatcv = 0;
_root.sel.retreating = false;
_root.waitforretreat = false;
_root.sel.aiming = false;
_root.waiting = false;
_root.physactive = false;
_root.sel = whobe;
_root.sel.retreating = false;
_root.sel.aiming = false;
clearPointers();
showPointer();
_root.selecting = true;
if (_root.aion) {
if (masterturn == "bad") {
_root.aiknown = false;
}
}
}
} else {
_root.gamesup = true;
_root.chkAchieve(vinner);
}
}
function showPointer() {
_root.sel.pointer._visible = true;
}
function clearPointers() {
d = 0;
while (d < team0.length) {
var w = eval ("_root.dudes.good" + d);
w.pointer._visible = false;
w.aimer._visible = false;
d++;
}
d = 0;
while (d < team1.length) {
var w = eval ("_root.dudes.bad" + d);
w.pointer._visible = false;
w.aimer._visible = false;
d++;
}
}
function getNormal(who) {
if (who.r == undefined) {
if (who.ject) {
who.r = who._height;
} else {
who.r = who._height / 2;
}
who.seg = 200;
}
var _local4 = 0;
who.xval = 0;
who.yval = 0;
i = 1;
while (i < who.seg) {
var _local3 = who.virtx + (who.r * Math.sin((i * (360 / who.seg)) * (Math.PI/180)));
var _local2 = who.virty - (who.r * Math.cos((i * (360 / who.seg)) * (Math.PI/180)));
if (g.hitTest(_local3, _local2, true) && (!cover.hitTest(_local3, _local2, true))) {
_local4++;
who.xval = who.xval + _local3;
who.yval = who.yval + _local2;
}
i++;
}
if (_local4 > 0) {
who._rotation = ((Math.atan2(who.virtx - (who.xval / _local4), who.virty - (who.yval / _local4)) / (Math.PI/180)) * -1) + 180;
}
}
function makeTeam0() {
_root.team0maxhp = 0;
h = 0;
while (h < team0.length) {
d = dudes.attachMovie(team0[h], "good" + h, h);
d._x = random(2300) + 150;
d._y = 600;
d.hittable = true;
d.myweaps = new Array();
i = 0;
while (i < goodweaps.length) {
d.myweaps[i] = goodweaps[i];
i++;
}
var _local3 = new Color(d.aimer.guts.col);
_local3.setRGB(9025731);
_local3 = new Color(d.pointer.col);
_local3.setRGB(9025731);
_local3 = new Color(d.bar.dabar);
_local3.setRGB(1208728);
d.id = h;
d.typ = "good";
d.Yvel = 0;
d.Xvel = 0;
while (g.hitTest(d._x, d._y, true)) {
d._y = d._y - 0.2;
}
d.startcv = 0;
d.onEnterFrame = function () {
phys(this);
};
d.speed = 2;
h++;
}
_root.sel = dudes.good0;
}
function makeTeam1() {
_root.team1maxhp = 0;
h = 0;
while (h < team1.length) {
d = dudes.attachMovie(team1[h], "bad" + h, h + 100);
d._x = random(2300) + 150;
d._y = 600;
d.id = h;
d.thinking._visible = false;
d.hittable = true;
d.myweaps = new Array();
i = 0;
while (i < badweaps.length) {
d.myweaps[i] = badweaps[i];
i++;
}
var _local3 = new Color(d.aimer.guts.col);
_local3.setRGB(16711680);
_local3 = new Color(d.pointer.col);
_local3.setRGB(16711680);
_local3 = new Color(d.bar.dabar);
_local3.setRGB(16711680);
d.typ = "bad";
d.Yvel = 0;
d.Xvel = 0;
while (g.hitTest(d._x, d._y, true)) {
d._y = d._y - 0.2;
}
d.startcv = 0;
d.onEnterFrame = function () {
phys(this);
};
h++;
}
}
function getVirts() {
t = 0;
while (t < team0.length) {
var thing = eval ("dudes.good" + t);
thing.virtx = thing._x + g._x;
thing.virty = thing._y + g._y;
t++;
}
t = 0;
while (t < team1.length) {
var thing = eval ("dudes.bad" + t);
thing.virtx = thing._x + g._x;
thing.virty = thing._y + g._y;
t++;
}
alignAll();
}
function phys(who) {
if ((!panon) && (!_root.firing)) {
if ((_root.physactive || (who.startcv < 2)) || (_root.sel == who)) {
who.bounced = false;
who.mycurx = who._x;
who.mycury = who._y;
who.Yvel = who.Yvel + _root.grav;
who.storex = who._x;
who.storey = who._y;
who.storevirtx = who.virtx;
who.storevirty = who.virty;
var _local3 = 0;
if (who.jumping) {
var _local4 = -who._rotation;
who._rotation = who._rotation + (_local4 / 2);
}
while ((g.hitTest(who.virtx, who.virty + (who.Yvel / 2), true) && (!cover.hitTest(who.virtx, who.virty + (who.Yvel / 2), true))) && (!who.bounced)) {
who._y = who._y - 1;
if ((who.Yvel >= 14) && (!_root.loadinglevel)) {
trace("OUCH FELL TOO FAR! " + who.Yvel);
if (!who.dead) {
who.guts.gotoAndStop("rest");
getNormal(who);
}
who.hp = who.hp - 5;
if (_root.sel == who) {
_root.retreatcv = _root.maxretreat - 1;
_root.turncv = 1;
_root.getTurn(true);
}
}
who.onground = true;
who.virty = who.virty - 1;
who.Yvel = 1;
_local3 = _local3 + 1;
if (!Key.isDown(38)) {
who.jumping = false;
}
if ((_local3 > 10) && (who.startcv >= 2)) {
who._x = who.storex;
who._y = who.storey - 1;
who.virtx = who.storevirtx;
who.virty = who.storevirty - 1;
who.bounced = true;
who.Xvel = who.Xvel * -2;
}
}
while ((g.hitTest(who.virtx + (who._width / 4), who.virty - 25, true) && (!cover.hitTest(who.virtx + (who._width / 4), who.virty - 25, true))) && (who.startcv >= 2)) {
who._x = who._x - 0.5;
who.virtx = who.virtx - 0.5;
}
while ((g.hitTest(who.virtx - (who._width / 4), who.virty - 25, true) && (!cover.hitTest(who.virtx - (who._width / 4), who.virty - 25, true))) && (who.startcv >= 2)) {
who._x = who._x + 0.5;
who.virtx = who.virtx + 0.5;
}
if (((who.mycurx != who.myprevx) || (who.mycury != who.myprevy)) || (who.startcv < 2)) {
who.startcv = who.startcv + 1;
getNormal(who);
}
lookahead2(who);
who.myprevx = who.mycurx;
who.myprevy = who.mycury;
if ((who._y > 588) && (!_root.loadinglevel)) {
if (!who.drowned) {
splooshsound.start();
who.drowned = true;
}
who.hp = who.hp - who.hp;
who._visible = false;
who.dead = true;
if (_root.sel == who) {
_root.retreatcv = _root.maxretreat;
turncv = 1;
}
updateHP();
}
if (((who._x > 2900) && (!_root.loadinglevel)) || ((who._x < 90) && (!_root.loadinglevel))) {
if (!who.drowned) {
splooshsound.start();
who.drowned = true;
}
who.hp = who.hp - who.hp;
who._visible = false;
who.dead = true;
if (_root.sel == who) {
_root.retreatcv = _root.maxretreat;
turncv = 1;
}
updateHP();
}
}
}
}
function lookahead2(who) {
var _local6 = who.virtx + who.Xvel;
var _local5 = who.virty + who.Yvel;
if ((g.hitTest(_local6, _local5, true) && (!cover.hitTest(_local6, _local5, true))) && (!who.onground)) {
var _local4 = Math.atan2(who.Yvel, who.Xvel);
var _local3 = Math.cos(_local4);
var _local2 = Math.sin(_local4);
while ((!g.hitTest(who.virtx, who.virty, true)) || (cover.hitTest(who.virtx, who.virty, true))) {
who._x = who._x + _local3;
who.virtx = who.virtx + _local3;
who._y = who._y + _local2;
who.virty = who.virty + _local2;
}
} else {
who._y = who._y + who.Yvel;
var _local7 = Math.abs(who.Xvel);
if (_local7 < 1) {
who.Xvel = 0;
}
who._x = who._x + who.Xvel;
if (who.onground) {
who.Xvel = who.Xvel * 0.3;
} else {
who.Xvel = who.Xvel * 0.9;
}
}
}
function alignAll() {
dudes._x = g._x;
dudes._y = g._y;
pw._x = g._x;
pw._y = g._y;
cover._x = g._x;
cover._y = g._y;
backy._x = -g._x;
backy._y = -g._y;
water._x = 0;
water._y = g._y + 560;
}
function centerOn(who) {
var _local4 = 350 - who._x;
var _local2 = _local4 - g._x;
g._x = g._x + (_local2 / 8);
var _local3 = 225 - who._y;
var _local5 = _local3 - g._y;
g._y = g._y + (_local5 / 8);
var _local6 = Math.abs(_local2);
lockedin = false;
if (_local6 < 1) {
g._x = _local4;
g._y = _local3;
_root.lockedin = true;
}
if ((_root.g._x >= -120) || (_root.g._x <= -2120)) {
_root.lockedin = true;
}
alignAll();
}
function effectsWaiter() {
var rdytoroll = true;
v = 0;
while (v < team0.length) {
var chker = eval ("dudes.good" + v);
var absy = Math.abs(chker.Yvel);
var absx = Math.abs(chker.Xvel);
if (((absy > 1) || (!chker.onground)) || (absx > 1)) {
if (!_root.sel.retreating) {
rdytoroll = false;
}
}
v++;
}
v = 0;
while (v < team1.length) {
var chker = eval ("dudes.bad" + v);
var absy = Math.abs(chker.Yvel);
var absx = Math.abs(chker.Xvel);
if (((absy > 1) || (!chker.onground)) || (absx > 1)) {
if (!_root.sel.retreating) {
rdytoroll = false;
}
}
v++;
}
if (rdytoroll) {
v = 0;
while (v < team0.length) {
var thing = eval ("dudes.good" + v);
while (g.hitTest(thing.virtx, thing.virty, true) && (!cover.hitTest(thing.virtx, thing.virty, true))) {
thing._y = thing._y - 0.1;
thing.virty = thing.virty - 0.1;
}
if ((((!thing.rec) && (thing.needtorecover)) && (thing != _root.sel)) && (!thing.dead)) {
thing.guts.gotoAndStop("recover");
}
v++;
}
v = 0;
while (v < team1.length) {
var thing = eval ("dudes.bad" + v);
while (g.hitTest(thing.virtx, thing.virty, true) && (!cover.hitTest(thing.virtx, thing.virty, true))) {
thing._y = thing._y - 0.1;
thing.virty = thing.virty - 0.1;
}
if ((((!thing.rec) && (thing.needtorecover)) && (thing != _root.sel)) && (!thing.dead)) {
thing.guts.gotoAndStop("recover");
}
if (((((thing == _root.sel) && (_root.aion)) && (!thing.rec)) && (thing.needtorecover)) && (!thing.dead)) {
thing.guts.gotoAndStop("recover");
}
v++;
}
var retreat = true;
_root.waitforretreat = false;
_root.sel.aiming = false;
_root.sel.retreating = true;
_root.waiting = false;
_root.physactive = false;
}
if (retreat) {
_root.retreatcv = _root.retreatcv + 1;
if (_root.masterturn == "good") {
_root.shownum0 = Math.floor(_root.maxretreat - retreatcv);
} else {
_root.shownum1 = Math.floor(_root.maxretreat - retreatcv);
if (aion && (!sel.dead)) {
if (_root.sel._xscale == 100) {
if (g.hitTest(_root.sel.virtx + 5, _root.sel.virty + 10, true) && (!cover.hitTest(_root.sel.virtx + 5, _root.sel.virty + 10, true))) {
_root.sel.needtorecover = false;
_root.sel.guts.gotoAndStop("walk");
_root.sel.gx = _root.sel._x;
if ((sel.gx <= (sel.px + 3)) && (sel.px != undefined)) {
_root.sel.Yvel = _root.sel.Yvel - _root.sel.jmpht;
_root.sel._y = _root.sel._y - _root.sel.jmpht;
_root.sel.virty = _root.sel.virty - _root.sel.jmpht;
jumpsound.start();
}
_root.sel.Xvel = _root.sel.Xvel + 6;
if (!sel.jumping) {
_root.sel.px = _root.sel._x;
}
} else {
_root.sel.guts.gotoAndStop("rest");
}
}
if (_root.sel._xscale == -100) {
if (g.hitTest(_root.sel.virtx - 5, _root.sel.virty + 10, true) && (!cover.hitTest(_root.sel.virtx - 5, _root.sel.virty + 10, true))) {
_root.sel.needtorecover = false;
_root.sel.guts.gotoAndStop("walk");
_root.sel.gx = _root.sel._x;
if ((sel.gx >= (sel.px - 3)) && (sel.px != undefined)) {
_root.sel.Yvel = _root.sel.Yvel - _root.sel.jmpht;
_root.sel._y = _root.sel._y - _root.sel.jmpht;
_root.sel.virty = _root.sel.virty - _root.sel.jmpht;
jumpsound.start();
}
_root.sel.Xvel = _root.sel.Xvel - 6;
if (!sel.jumping) {
_root.sel.px = _root.sel._x;
}
} else {
_root.sel.guts.gotoAndStop("rest");
}
}
}
}
}
if (_root.retreatcv >= _root.maxretreat) {
v = 0;
while (v < team0.length) {
var thing = eval ("dudes.good" + v);
thing.rec = false;
thing.needtorecover = false;
v++;
}
v = 0;
while (v < team1.length) {
var thing = eval ("dudes.bad" + v);
thing.rec = false;
thing.needtorecover = false;
v++;
}
if (!sel.dead) {
_root.sel.guts.gotoAndStop("rest");
}
_root.retreatcv = 0;
_root.sel.retreating = false;
_root.sel.Yvel = 0;
_root.sel.Xvel = 0;
getNormal(_root.sel);
clearInterval(_root.waitforit);
clearInterval(_root.effectsWaiter);
while ((!g.hitTest(_root.sel.virtx, _root.sel.virty, true)) || (cover.hitTest(_root.sel.virtx, _root.sel.virty, true))) {
_root.sel._y = _root.sel._y + 0.5;
_root.sel.virty = _root.sel.virty + 0.5;
}
while (g.hitTest(_root.sel.virtx, _root.sel.virty, true) && (!cover.hitTest(_root.sel.virtx, _root.sel.virty, true))) {
_root.sel._y = _root.sel._y - 0.1;
_root.sel.virty = _root.sel.virty - 0.1;
}
getTurn(true);
}
}
function testSplode(circ) {
var rad = (circ._width / 2);
var centx = (circ._x + g._x);
var centy = (circ._y + g._y);
r = 0;
while (r < rad) {
p = 1;
while (p < 45) {
var day = (centy + (Math.sin(p) * r));
var dax = (centx + (Math.cos(p) * r));
b = 0;
while (b < team0.length) {
var thing = eval ("dudes.good" + b);
if (thing.hitTest(dax, day, true) && (!thing.beenhit)) {
applySplode(thing, centx, centy, dax, day, circ._width);
}
b++;
}
b = 0;
while (b < team1.length) {
var thing = eval ("dudes.bad" + b);
if (thing.hitTest(dax, day, true) && (!thing.beenhit)) {
applySplode(thing, centx, centy, dax, day, circ._width);
}
b++;
}
p++;
}
r = r + 5;
}
b = 0;
while (b < team0.length) {
var thing = eval ("dudes.good" + b);
thing.beenhit = false;
b++;
}
b = 0;
while (b < team1.length) {
var thing = eval ("dudes.bad" + b);
thing.beenhit = false;
b++;
}
}
function applySplode(thing, centx, centy, dax, day, powa) {
thing.beenhit = true;
if ((!thing.dead) && (thing.hp > 0)) {
thing.guts.gotoAndStop("hit");
thing.needtorecover = true;
thing.onground = false;
var _local7 = centy - day;
var _local8 = centx - dax;
if (_local7 == 0) {
_local7 = -1;
}
var _local14 = Math.sqrt((_local7 * _local7) + (_local8 * _local8));
var _local10 = Math.atan(_local8 / _local7);
var _local9 = 100 - _local14;
var _local5 = (Math.cos(_local10) * _local9) / 2.5;
var _local6 = -Math.abs((Math.sin(_local10) * _local9) / 10);
if (_local8 > 0) {
if (_local5 > 0) {
_local5 = _local5 * -1;
}
}
if (projtype == 3) {
_local6 = _local6 * 4;
_local5 = _local5 * 1.5;
}
thing.Xvel = _local5;
thing.Yvel = _local6;
thing.virtx = dudes._x + thing._x;
thing.virty = dudes._y + thing._y;
var _local13 = thing.virtx + (thing.Xvel * 1.5);
var _local12 = thing.virty + (thing.Yvel * 1.5);
if (g.hitTest(_local13, _local12, true) && (!cover.hitTest(_local13, _local12, true))) {
var _local11 = Math.atan2(thing.Yvel, thing.Xvel);
var _local4 = Math.cos(_local11);
var _local3 = Math.sin(_local11);
while ((!g.hitTest(thing.virtx, thing.virty, true)) || (cover.hitTest(thing.virtx, thing.virty, true))) {
thing._x = thing._x + _local4;
thing.virtx = thing.virtx + _local4;
thing._y = thing._y + _local3;
thing.virty = thing.virty + _local3;
}
getNormal(who);
} else {
thing._x = thing._x + thing.Xvel;
thing._y = thing._y + thing.Yvel;
}
if ((!_root.aion) || (_root.masterturn == "good")) {
thing.hp = thing.hp - Math.floor(Math.abs(_local5) + Math.abs(_local6));
}
if (_root.aion && (masterturn == "bad")) {
if (thing.typ == "good") {
thing.hp = thing.hp - (Math.floor(Math.abs(_local5) + Math.abs(_local6)) * 2);
} else {
thing.hp = thing.hp - Math.floor(Math.abs(_local5) + Math.abs(_local6));
}
}
if (thing.hp <= 0) {
thing.hp = 0;
thing.guts.gotoAndStop("dead");
thing._xscale = 100;
thing.cacheAsBitmap = true;
thing.dead = true;
}
if (thing == _root.sel) {
thing.inv = true;
}
updateHP();
}
}
function makeDivot(dax, day, size, who) {
f = pw.attachMovie("circ", "circ" + circcount, circcount);
sp = _root.dudes.attachMovie("bigsplode", "bigsplode", dudes.getNextHighestDepth());
sp._x = dax;
sp._y = day + (size / 2.2);
while (sp._width < (size / 2)) {
sp._xscale = sp._xscale + 1;
sp._yscale = sp._xscale;
}
f._x = dax;
f._y = day;
f._width = size;
f._height = size;
circcount = circcount + 1;
_root.firing = false;
if ((!_root.loadinglevel) && (!_root.beenreset)) {
var _local3 = who;
_root.airtotal = _root.airtotal - 1;
if ((!_local3.airstrike) || (_root.airtotal == 0)) {
_root.physactive = true;
_root.waiting = true;
_root.effectcv = 0;
_root.retreatcv = 0;
_root.testingtime = false;
_root.waitforit = setInterval(effectsWaiter, 100);
_root.beenreset = true;
}
if (size > 0) {
testSplode(f);
splodesound.start();
}
_local3.unloadMovie();
_local3.removeMovieClip();
_local3.stopit = true;
_local3.exit = true;
delete _local3.onEnterFrame;
}
}
function traceX() {
p = 0;
while (p < team0.length) {
var thing = eval ("dudes.good" + p);
p++;
}
p = 0;
while (p < team1.length) {
var thing = eval ("dudes.bad" + p);
p++;
}
}
function runBounce(who) {
tinksound.start();
var _local2 = Math.abs(who.Xvel) + (Math.abs(who.Yvel) * 0.2);
if (_local2 < 0.5) {
who.stopit = true;
}
while ((g.hitTest(who.virtx, who.topy, true) && (!cover.hitTest(who.virtx, who.topy, true))) && (who.Yvel < 0)) {
who._y = who._y + 0.5;
who.virty = who.virty + 0.5;
who.topy = who.topy + 0.5;
}
while ((g.hitTest(who.virtx, who.boty, true) && (!cover.hitTest(who.virtx, who.boty, true))) && (who.Yvel > 0)) {
who._y = who._y - 0.5;
who.virty = who.virty - 0.5;
who.boty = who.boty - 0.5;
}
getNormal(who);
who._rotation = who._rotation - 90;
var _local6 = who._rotation;
var _local3 = _local6 * (Math.PI/180);
var _local5 = who.Xvel * 0.3;
var _local4 = 0.5;
who.Xvel = (Math.cos(_local3) * _local2) + _local5;
who.Yvel = Math.sin(_local3) * (_local2 * _local4);
who._x = who._x + ((Math.cos(_local3) * _local2) + _local5);
who._y = who._y + (Math.sin(_local3) * (_local2 * _local4));
who.virtx = who.virtx + ((Math.cos(_local3) * _local2) + _local5);
who.virty = who.virty + (Math.sin(_local3) * (_local2 * _local4));
who.rightx = who.rightx + ((Math.cos(_local3) * _local2) + _local5);
who.leftx = who.leftx + ((Math.cos(_local3) * _local2) + _local5);
who.topy = who.topy + (Math.sin(_local3) * (_local2 * _local4));
who.boty = who.boty + (Math.sin(_local3) * (_local2 * _local4));
}
function lookahead(who, typ, origin) {
if (typ == 1) {
var beensploded = false;
var x1 = who.virtx;
var x2 = (who.virtx + who.Xvel);
var y1 = who.virty;
var y2 = (who.virty + who.Yvel);
var distx = (x2 - x1);
var disty = (y2 - y1);
var angle = Math.atan2(disty, distx);
var gox = Math.cos(angle);
var goy = Math.sin(angle);
storex = who._x;
storey = who._y;
if (x1 < x2) {
while (x1 < x2) {
x1 = x1 + gox;
y1 = y1 + goy;
storex = storex + gox;
storey = storey + goy;
t = 0;
while (t < team0.length) {
var yib = eval ("dudes.good" + t);
if (yib.hittable) {
if ((((origin._xscale == 100) && (yib._x > (origin._x + 5))) || ((origin._xscale == -100) && (yib._x < (origin._x - 5)))) || (who.airstrike)) {
if (((yib.hitTest(x1, y1, true) && (yib != _root.sel)) && (!beensploded)) && (!yib.dead)) {
who._x = yib._x;
who._y = yib._y - (yib._height / 2);
who.virtx = yib.virtx;
who.virty = yib.virty - (yib._height / 2);
makeDivot(who._x, who._y, who.blastradius, who);
who.airstrike = false;
}
}
}
t++;
}
t = 0;
while (t < team1.length) {
var yib = eval ("dudes.bad" + t);
if (yib.hittable) {
if ((((origin._xscale == 100) && (yib._x > (origin._x + 5))) || ((origin._xscale == -100) && (yib._x < (origin._x - 5)))) || (who.airstrike)) {
if (((yib.hitTest(x1, y1, true) && (yib != _root.sel)) && (!beensploded)) && (!yib.dead)) {
who._x = yib._x;
who._y = yib._y - (yib._height / 2);
who.virtx = yib.virtx;
who.virty = yib.virty - (yib._height / 2);
makeDivot(who._x, who._y, who.blastradius, who);
who.airstrike = false;
}
}
}
t++;
}
}
} else {
while (x1 > x2) {
x1 = x1 + gox;
y1 = y1 + goy;
storex = storex + gox;
storey = storey + goy;
t = 0;
while (t < team0.length) {
var yib = eval ("dudes.good" + t);
if (yib.hittable) {
if ((((origin._xscale == 100) && (yib._x > (origin._x + 5))) || ((origin._xscale == -100) && (yib._x < (origin._x - 5)))) || (who.airstrike)) {
if (((yib.hitTest(x1, y1, true) && (yib != _root.sel)) && (!beensploded)) && (!yib.dead)) {
who._x = yib._x;
who._y = yib._y - (yib._height / 2);
who.virtx = yib.virtx;
who.virty = yib.virty - (yib._height / 2);
makeDivot(who._x, who._y, who.blastradius, who);
who.airstrike = false;
beensploded = true;
}
}
}
t++;
}
t = 0;
while (t < team1.length) {
var yib = eval ("dudes.bad" + t);
if (yib.hittable) {
if ((((origin._xscale == 100) && (yib._x > (origin._x + 5))) || ((origin._xscale == -100) && (yib._x < (origin._x - 5)))) || (who.airstrike)) {
if (((yib.hitTest(x1, y1, true) && (yib != _root.sel)) && (!beensploded)) && (!yib.dead)) {
who._x = yib._x;
who._y = yib._y - (yib._height / 2);
who.virtx = yib.virtx;
who.virty = yib.virty - (yib._height / 2);
makeDivot(who._x, who._y, who.blastradius, who);
who.airstrike = false;
beensploded = true;
}
}
}
t++;
}
}
}
}
var nextx = (who.virtx + who.Xvel);
var nexty = (who.virty + who.Yvel);
if (g.hitTest(nextx, nexty, true) && (!cover.hitTest(nextx, nexty, true))) {
var rads = (who._rotation * (Math.PI/180));
var gox = Math.cos(rads);
var goy = Math.sin(rads);
var cv = 0;
while (((!g.hitTest(who.virtx, who.virty, true)) && (cv < 400)) || (cover.hitTest(who.virtx, who.virty, true) && (cv < 400))) {
cv++;
who._x = who._x + gox;
who.virtx = who.virtx + gox;
who._y = who._y + goy;
who.virty = who.virty + goy;
}
if (typ == 1) {
makeDivot(who._x, who._y, who.blastradius, who);
}
} else {
who._x = who._x + who.Xvel;
who.Xvel = who.Xvel * 0.99;
who._y = who._y + who.Yvel;
who.Yvel = who.Yvel + 0.7;
}
}
function cannonBall(who) {
who.cv = who.cv + 1;
if (((who.virty < 0) && (who.virtx > 0)) && (who.virtx < 700)) {
off = _root.attachMovie("offscreen", "offscreen", 105);
off._x = who.virtx;
off._y = 50;
off.pointer._rotation = -90;
off.dist = Math.floor(who.virty - 50);
} else if (((off._x != undefined) && (who.virtx > 0)) && (who.virtx < 700)) {
off._visible = false;
off.unloadMovie();
off.removeMovieClip();
}
if ((who.virtx < 0) || (who.virtx > 700)) {
off = _root.attachMovie("offscreen", "offscreen", 105);
if (who.virty < 430) {
off._y = who.virty;
} else {
off._y = 430;
}
if (who.virtx < 0) {
off._x = 50;
off.pointer._rotation = -180;
off.dist = Math.floor(who.virtx);
}
if (who.virtx > 700) {
off._x = 650;
off.dist = Math.floor(who.virtx - 700);
}
}
if (who.cv == 60) {
who.gotoAndStop("blink");
}
if (who.cv > 90) {
delete who.onEnterFrame;
off._visible = false;
off.unloadMovie();
off.unloadMovieClip();
who.stopit = true;
who.exit = true;
makeDivot(who._x, who._y, who.blastradius, who);
_root.physactive = true;
_root.waiting = true;
_root.firing = false;
who.unloadMovie();
who.removeMovieClip();
}
if (!who.stopit) {
who.virtx = dudes._x + who._x;
who.virty = dudes._y + who._y;
who.leftx = ((dudes._x + who._x) - (who._width / 3)) + (who.Xvel / 2);
who.rightx = ((dudes._x + who._x) + (who._width / 3)) + (who.Xvel / 2);
who.topy = ((dudes._y + who._y) - (who._height / 3)) + (who.Yvel / 2);
who.boty = ((dudes._y + who._y) + (who._height / 3)) + (who.Yvel / 2);
lookahead(who, 0);
centerOn(who);
who.angle = Math.atan2(who.Yvel, who.Xvel);
who.finale = (who.angle * 180) / Math.PI;
who._rotation = who.finale;
if (((((g.hitTest(who.virtx, who.virty, true) && (!cover.hitTest(who.virtx, who.virty, true))) || (g.hitTest(who.leftx, who.virty, true) && (!cover.hitTest(who.leftx, who.virty, true)))) || (g.hitTest(who.rightx, who.virty, true) && (!cover.hitTest(who.rightx, who.virty, true)))) || (g.hitTest(who.virtx, who.topy, true) && (!cover.hitTest(who.virtx, who.topy, true)))) || (g.hitTest(who.virtx, who.boty, true) && (!cover.hitTest(who.virtx, who.boty, true)))) {
getNormal(who);
runBounce(who);
}
} else {
who.Xvel = 0;
who.Yvel = who.Yvel + 0.7;
who._y = who._y + who.Yvel;
who.virty = who.virty + who.Yvel;
while (g.hitTest(who.virtx, who.virty, true) && (!cover.hitTest(who.virtx, who.virty, true))) {
who._y = who._y - 1;
who.virty = who.virty - 1;
}
getNormal(who);
}
if (who._y > 588) {
who.stopit = true;
who.exit = true;
_root.physactive = true;
_root.waiting = true;
_root.firing = false;
makeDivot(who._x, who._y, 0, who);
off._visible = false;
off.unloadMovie();
off.unloadMovieClip();
splooshsound.start();
delete who.onEnterFrame;
who.unloadMovie();
who.removeMovieClip();
}
}
function powerBall(who, origin) {
who.cv = who.cv + 1;
if (!origin.hittable) {
var _local5 = who._x - origin._x;
var _local4 = who._y - origin._y;
if ((_local5 != 0) && (_local4 != 0)) {
who.closeness = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
}
if (who.closeness > 75) {
origin.hittable = true;
}
}
if (((who.virty < 0) && (who.virtx > 0)) && (who.virtx < 700)) {
off = _root.attachMovie("offscreen", "offscreen", 105);
off._x = who.virtx;
off._y = 50;
off.pointer._rotation = -90;
off.dist = Math.floor(who.virty - 50);
} else if (((off._x != undefined) && (who.virtx > 0)) && (who.virtx < 700)) {
off._visible = false;
off.unloadMovie();
off.unloadMovieClip();
}
if ((who.virtx < 0) || (who.virtx > 700)) {
off = _root.attachMovie("offscreen", "offscreen", 105);
if (who.virty < 430) {
off._y = who.virty;
} else {
off._y = 430;
}
if (who.virtx < 0) {
off._x = 50;
off.pointer._rotation = -180;
off.dist = Math.floor(who.virtx);
}
if (who.virtx > 700) {
off._x = 650;
off.dist = Math.floor(who.virtx - 700);
}
}
if (who._y > 588) {
who.stopit = true;
who.exit = true;
_root.physactive = true;
_root.waiting = true;
_root.firing = false;
makeDivot(who._x, who._y, 0, who);
off._visible = false;
off.unloadMovie();
off.removeMovieClip();
splooshsound.start();
delete who.onEnterFrame;
who.unloadMovie();
who.removeMovieClip();
}
if (!who.stopit) {
who.virtx = dudes._x + who._x;
who.virty = dudes._y + who._y;
who.leftx = ((dudes._x + who._x) - (who._width / 3)) + (who.Xvel / 2);
who.rightx = ((dudes._x + who._x) + (who._width / 3)) + (who.Xvel / 2);
who.topy = ((dudes._y + who._y) - (who._height / 3)) + (who.Yvel / 2);
who.boty = ((dudes._y + who._y) + (who._height / 3)) + (who.Yvel / 2);
lookahead(who, 1, origin);
centerOn(who);
who.angle = Math.atan2(who.Yvel, who.Xvel);
who.finale = (who.angle * 180) / Math.PI;
who._rotation = who.finale;
if (((((g.hitTest(who.virtx, who.virty, true) && (!cover.hitTest(who.virtx, who.virty, true))) || (g.hitTest(who.leftx, who.virty, true) && (!cover.hitTest(who.leftx, who.virty, true)))) || (g.hitTest(who.rightx, who.virty, true) && (!cover.hitTest(who.rightx, who.virty, true)))) || (g.hitTest(who.virtx, who.topy, true) && (!cover.hitTest(who.virtx, who.topy, true)))) || (g.hitTest(who.virtx, who.boty, true) && (!cover.hitTest(who.virtx, who.boty, true)))) {
getNormal(who);
makeDivot(who._x, who._y, who.blastradius, who);
}
}
}
function makeProjectile(who, typ) {
if (typ == 0) {
p = _root.dudes.attachMovie("cannonball", "proj", 99);
p.bouncefactor = 3;
p.ybounce = 0.9;
p.cv = 0;
p.ject = true;
p.onEnterFrame = function () {
cannonBall(this);
};
}
if (typ == 3) {
p = _root.dudes.attachMovie("nuke", "proj", 99);
p.bouncefactor = 3;
p.ybounce = 0.9;
p.cv = 0;
p.ject = true;
p.onEnterFrame = function () {
cannonBall(this);
};
}
if (typ == 1) {
p = _root.dudes.attachMovie("powerball", "proj", 99);
p.cv = 0;
p.ject = true;
who.hittable = false;
p.airstrike = false;
_root.airstrike = false;
p.onEnterFrame = function () {
powerBall(this, who);
};
}
p._x = who._x + who.aimer._x;
p._y = who._y + who.aimer._y;
if (who._xscale == 100) {
var _local5 = who._rotation + who.aimer._rotation;
} else {
var _local5 = (who._rotation + (who.aimer._rotation * -1)) - 180;
}
var _local4 = _local5 * (Math.PI/180);
p.gox = Math.cos(_local4);
p.goy = Math.sin(_local4);
p.Xvel = p.gox * who.powa;
p.Yvel = p.goy * who.powa;
checkRicochet(p, true, typ, who);
}
function checkRicochet(who, clearem, typ, origin) {
who.virtx = dudes._x + who._x;
who.virty = dudes._y + who._y;
var xgoal = (who.virtx + who.Xvel);
var ygoal = (who.virty + who.Yvel);
if (typ == 1) {
var beensploded = false;
var x1 = who.virtx;
var x2 = (who.virtx + who.Xvel);
var y1 = who.virty;
var y2 = (who.virty + who.Yvel);
var distx = (x2 - x1);
var disty = (y2 - y1);
var angle = Math.atan2(disty, distx);
var gox = Math.cos(angle);
var goy = Math.sin(angle);
if (x1 < x2) {
while (x1 < x2) {
x1 = x1 + gox;
y1 = y1 + goy;
who._x = who._x + gox;
who._y = who._y + goy;
who.virtx = who.virtx + gox;
who.virty = who.virty + goy;
t = 0;
while (t < team0.length) {
var yib = eval ("dudes.good" + t);
if (yib.hittable) {
if (((origin._xscale == 100) && (yib._x > (origin._x + 5))) || ((origin._xscale == -100) && (yib._x < (origin._x - 5)))) {
if (((yib.hitTest(x1, y1, true) && (yib != _root.sel)) && (!beensploded)) && (!yib.dead)) {
who._x = yib._x;
who._y = yib._y - (yib._height / 2);
who.virtx = yib.virtx;
who.virty = yib.virty - (yib._height / 2);
makeDivot(yib._x, yib._y - (yib._height / 2), 200, who);
beensploded = true;
}
}
}
t++;
}
t = 0;
while (t < team1.length) {
var yib = eval ("dudes.bad" + t);
if (yib.hittable) {
if (((origin._xscale == 100) && (yib._x > (origin._x + 5))) || ((origin._xscale == -100) && (yib._x < (origin._x - 5)))) {
if (((yib.hitTest(x1, y1, true) && (yib != _root.sel)) && (!beensploded)) && (!yib.dead)) {
who._x = yib._x;
who._y = yib._y - (yib._height / 2);
who.virtx = yib.virtx;
who.virty = yib.virty - (yib._height / 2);
makeDivot(yib._x, yib._y - (yib._height / 2), 200, who);
beensploded = true;
}
}
}
t++;
}
}
} else {
while (x1 > x2) {
x1 = x1 + gox;
y1 = y1 + goy;
who._x = who._x + gox;
who._y = who._y + goy;
who.virtx = who.virtx + gox;
who.virty = who.virty + goy;
t = 0;
while (t < team0.length) {
var yib = eval ("dudes.good" + t);
if (yib.hittable) {
if (((origin._xscale == 100) && (yib._x > (origin._x + 5))) || ((origin._xscale == -100) && (yib._x < (origin._x - 5)))) {
if (((yib.hitTest(x1, y1, true) && (yib != _root.sel)) && (!beensploded)) && (!yib.dead)) {
who._x = yib._x;
who._y = yib._y - (yib._height / 2);
who.virtx = yib.virtx;
who.virty = yib.virty - (yib._height / 2);
makeDivot(yib._x, yib._y - (yib._height / 2), 200, who);
beensploded = true;
}
}
}
t++;
}
t = 0;
while (t < team1.length) {
var yib = eval ("dudes.bad" + t);
if (yib.hittable) {
if (((origin._xscale == 100) && (yib._x > (origin._x + 5))) || ((origin._xscale == -100) && (yib._x < (origin._x - 5)))) {
if (((yib.hitTest(x1, y1, true) && (yib != _root.sel)) && (!beensploded)) && (!yib.dead)) {
who._x = yib._x;
who._y = yib._y - (yib._height / 2);
who.virtx = yib.virtx;
who.virty = yib.virty - (yib._height / 2);
makeDivot(yib._x, yib._y - (yib._height / 2), 200, who);
beensploded = true;
}
}
}
t++;
}
}
}
}
if ((g.hitTest(xgoal, ygoal, true) && (!cover.hitTest(xgoal, ygoal, true))) && (!beensploded)) {
var cv = 0;
while (((!g.hitTest(who.virtx, who.virty, true)) && (cv < 350)) || (cover.hitTest(who.virtx, who.virty, true) && (cv < 350))) {
cv++;
who._x = who._x + who.gox;
who.virtx = who.virtx + who.gox;
who._y = who._y + who.goy;
who.virty = who.virty + who.goy;
}
getNormal(who);
if (typ == 0) {
runBounce(who);
}
if (typ == 1) {
makeDivot(who._x, who._y, 200, who);
}
} else {
who._x = who._x + who.Xvel;
who._y = who._y + who.Yvel;
}
if (clearem) {
clearPointers();
}
}
function controls() {
if ((!aion) || (masterturn == "good")) {
if (Key.isDown(27)) {
if (_root.sel.aiming) {
_root.sel.aiming = false;
_root.sel.aimer._visible = false;
_root.readytoswitchweapons = false;
_root.sel.rdy = false;
rdytocharge = false;
freshInst(1, sel);
}
}
if (!_root.loadinglevel) {
if (_root.selecting) {
if (!Key.isDown(83)) {
sup = true;
} else if (sup) {
if (_root.abletoswitch) {
getTurn();
switchsound.start();
_root.sel.guts.gotoAndStop("rest");
}
sup = false;
}
}
if ((!Key.isDown(32)) && (!_root.sel.retreating)) {
spaceup = true;
} else if (spaceup) {
if (!_root.sel.retreating) {
if ((!_root.sel.aiming) && (!_root.selecting)) {
freshInst(2, sel);
powersound.start();
_root.sel.aiming = true;
if (sel.myweaps[0] == 0) {
_root.projtype = 0;
}
_root.sel.guts.gotoAndStop("aiming");
_root.sel.aimer._visible = true;
_root.sel.aimer.gotoAndPlay(1);
_root.readytoswitchweapons = true;
_root.sel.powa = 0;
}
if (_root.selecting) {
selsound.start();
selsound.setVolume(30);
freshInst(1);
_root.selecting = false;
_root.turncv = _root.maxturn;
_root.testingtime = true;
}
}
spaceup = false;
}
if (_root.sel.aiming) {
if (!Key.isDown(32)) {
_root.sel.rdy = true;
rdytocharge = true;
loopedy = false;
}
if ((((Key.isDown(32) && (_root.sel.rdy)) && (!_root.teleportation)) && (!_root.airstrike)) && (_root.projtype != 4)) {
if (rdytocharge) {
clearInst();
chargesound.start();
rdytocharge = false;
}
_root.readytoswitchweapons = false;
var max = 40;
var inc = (max / 5);
if (_root.sel.powa < max) {
_root.sel.powa = _root.sel.powa + 1;
}
if (sel.powa >= max) {
if (!loopedy) {
chargesound.stop();
chargeloop.start();
chargeloop.onSoundComplete = function () {
this.start();
};
loopedy = true;
}
}
i = 0;
while (i < 5) {
var thing = eval ("_root.sel.guts.aimclip.arm1.powerthing.pow" + i);
if (_root.sel.powa >= (inc * i)) {
thing._visible = true;
} else {
thing._visible = false;
}
i++;
}
_root.sel.buildingup = true;
} else if (Key.isDown(32) && (!_root.sel.punching)) {
if (((projtype == 4) && (!teleportation)) && (!airstrike)) {
if (sel.myweaps[3] > 0) {
sel.myweaps[3] = sel.myweaps[3] - 1;
}
clearInst();
_root.sel.punching = true;
_root.sel.guts.gotoAndStop("punch");
d = 0;
while (d < team0.length) {
var w = eval ("_root.dudes.good" + d);
w.bar._visible = false;
w.pointer._visible = false;
d++;
}
d = 0;
while (d < team1.length) {
var w = eval ("_root.dudes.bad" + d);
w.bar._visible = false;
w.pointer._visible = false;
d++;
}
_root.sel.aimer._visible = false;
_root.readytoswitchweapons = false;
_root.sel.buildingup = false;
_root.sel.rdy = false;
_root.waitforretreat = true;
_root.testingtime = false;
}
}
}
if ((!Key.isDown(32)) && (_root.sel.buildingup)) {
_root.readytoswitchweapons = false;
chargesound.stop();
chargeloop.stop();
throwsound.start();
if ((sel.myweaps[5] > 0) && (projtype == 3)) {
sel.myweaps[5] = sel.myweaps[5] - 1;
}
if ((sel.myweaps[0] > 0) && (projtype == 0)) {
sel.myweaps[0] = sel.myweaps[0] - 1;
}
if ((sel.myweaps[1] > 0) && (projtype == 1)) {
sel.myweaps[1] = sel.myweaps[1] - 1;
}
d = 0;
while (d < team0.length) {
var w = eval ("_root.dudes.good" + d);
w.bar._visible = false;
d++;
}
d = 0;
while (d < team1.length) {
var w = eval ("_root.dudes.bad" + d);
w.bar._visible = false;
d++;
}
_root.sel.buildingup = false;
_root.sel.rdy = false;
_root.sel.aiming = false;
_root.waitforretreat = true;
makeProjectile(_root.sel, _root.projtype);
_root.sel.guts.gotoAndStop("rest");
_root.testingtime = false;
}
if (!Key.isDown(80)) {
pup = true;
} else if ((pup && (!_root.teleportation)) && (!_root.airstrike)) {
if (!panon) {
panon = true;
_root.attachMovie("pansign", "pansign", 999);
} else {
panon = false;
pansign.unloadMovie();
pansign.removeMovieClip();
}
pup = false;
}
if (panon) {
if ((!_root.teleportation) && (!_root.airstrike)) {
if (Key.isDown(39)) {
g._x = g._x - panspeed;
}
if (Key.isDown(37)) {
g._x = g._x + panspeed;
}
if (Key.isDown(40)) {
g._y = g._y - panspeed;
}
if (Key.isDown(38)) {
g._y = g._y + panspeed;
}
} else {
if (Key.isDown(39)) {
if ((g._x > -2120) && (_root.teletubby._x >= 350)) {
g._x = g._x - panspeed;
} else if (_root.teletubby._x < 700) {
_root.teletubby._x = _root.teletubby._x + panspeed;
} else {
_root.teletubby._x = 700;
}
}
if (Key.isDown(37)) {
if ((g._x < -120) && (_root.teletubby._x < 350)) {
g._x = g._x + panspeed;
} else if (_root.teletubby._x > 0) {
_root.teletubby._x = _root.teletubby._x - panspeed;
} else {
_root.teletubby._x = 0;
}
}
if (Key.isDown(40)) {
if ((g._y > -120) && (_root.teletubby._y >= 225)) {
g._y = g._y - panspeed;
} else if (_root.teletubby._y < 450) {
_root.teletubby._y = _root.teletubby._y + panspeed;
} else {
_root.teletubby._y = 450;
}
}
if (Key.isDown(38)) {
if ((g._y < 500) && (_root.teletubby._y < 225)) {
g._y = g._y + panspeed;
} else if (_root.teletubby._y > 0) {
_root.teletubby._y = _root.teletubby._y - panspeed;
} else {
_root.teletubby._y = 0;
}
}
}
} else {
if ((!_root.selecting) && (!who.retreating)) {
if (!_root.sel.aiming) {
if (_root.abletomove) {
if (Key.isDown(39) && (!Key.isDown(37))) {
_root.sel.Xvel = _root.sel.Xvel + _root.sel.speed;
_root.sel._xscale = 100;
_root.sel.guts.gotoAndStop("walk");
_root.sel.bar._xscale = _root.sel._xscale;
}
if (Key.isDown(37) && (!Key.isDown(39))) {
_root.sel.Xvel = _root.sel.Xvel - _root.sel.speed;
_root.sel._xscale = -100;
_root.sel.bar._xscale = _root.sel._xscale;
_root.sel.guts.gotoAndStop("walk");
}
if ((!Key.isDown(37)) && (!Key.isDown(39))) {
_root.sel.guts.gotoAndStop("rest");
}
if (Key.isDown(38) && (!_root.sel.jumping)) {
_root.sel.Yvel = _root.sel.Yvel - _root.sel.jmpht;
_root.sel._y = _root.sel._y - _root.sel.jmpht;
_root.sel.virty = _root.sel.virty - _root.sel.jmpht;
_root.sel.jumping = true;
jumpsound.start();
}
}
}
if (_root.sel.aiming) {
if (Key.isDown(39) && (!Key.isDown(37))) {
_root.sel._xscale = 100;
}
if (Key.isDown(37) && (!Key.isDown(39))) {
_root.sel._xscale = -100;
}
if (Key.isDown(38)) {
if (_root.sel.aimer._rotation > -86) {
_root.sel.aimer._rotation = _root.sel.aimer._rotation - 3;
}
}
if (Key.isDown(40)) {
if (_root.sel.aimer._rotation < 86) {
_root.sel.aimer._rotation = _root.sel.aimer._rotation + 3;
}
}
}
}
if (((!_root.firing) && (!_root.waiting)) && (!_root.loadinglevel)) {
centerOn(_root.sel);
}
}
}
} else if (!_root.loadinglevel) {
if (aion && (!_root.gamesup)) {
centerOn(_root.sel);
if (!_root.iknowit) {
var maxbing = 9999999;
i = 0;
while (i < team1.length) {
var ub = eval ("dudes.bad" + i);
if (!ub.dead) {
n = 0;
while (n < team0.length) {
var tex = eval ("dudes.good" + n);
if (!tex.dead) {
var clobx = (ub._x - tex._x);
var cloby = (ub._y - tex._y);
var clob = Math.abs((clobx * clobx) + (cloby * cloby));
if (clob < maxbing) {
maxbing = clob;
_root.myclosedude = ub;
}
}
n++;
}
}
i++;
}
_root.iknowit = true;
}
if (_root.iknowit && (!_root.aiclose)) {
if (_root.sel != _root.myclosedude) {
getTurn();
} else {
_root.aiclose = true;
}
}
if (_root.aiclose) {
if (!_root.aiknown) {
_root.sel.guts.gotoAndStop("rest");
_root.sel.thinking._visible = true;
_root.sel.pointer._visible = false;
_root.sel._xscale = 100;
}
if (_root.lockedin) {
if (!_root.aiknown) {
var daindex = chkAIShot();
if (daindex == undefined) {
trace("I don't know what to do!");
_root.getTurn(true);
} else {
_root.aiknown = true;
_root.aicv = 0;
_root.sel.thinking._visible = false;
var startrot = (-5 - _root.sel._rotation);
_root.sel.aimer._visible = true;
_root.sel.aimer.gotoAndPlay(1);
_root.sel.aimer._rotation = startrot - (3 * daindex);
if (sel.aimer._rotation < -90) {
_root.sel._xscale = -100;
sel.aimer._rotation = (sel._rotation + (sel.aimer._rotation * -1)) - 180;
} else {
_root.sel._xscale = 100;
}
i = 0;
while (i < team0.length) {
var thing = eval ("dudes.good" + i);
thing.bar._visible = false;
i++;
}
i = 0;
while (i < team1.length) {
var thing = eval ("dudes.bad" + i);
thing.bar._visible = false;
i++;
}
_root.projtype = 1;
}
}
}
}
if (aiknown) {
_root.aicv = _root.aicv + 1;
if (_root.aicv == 30) {
_root.dudes.raytrace.unloadMovie();
_root.dudes.raytrace.removeMovieClip();
_root.readytoswitchweapons = false;
_root.sel.buildingup = false;
_root.sel.rdy = false;
_root.sel.aiming = false;
_root.sel.powa = 34.5;
_root.waitforretreat = true;
makeProjectile(_root.sel, _root.projtype);
_root.sel.guts.gotoAndStop("rest");
_root.testingtime = false;
}
}
}
}
}
function testPunch(who, block) {
_root.physactive = true;
_root.waiting = true;
_root.effectcv = 0;
_root.retreatcv = 0;
_root.testingtime = false;
_root.waitforit = setInterval(effectsWaiter, 100);
_root.beenreset = true;
i = 0;
while (i < team0.length) {
var dude = eval ("dudes.good" + i);
if (block.hitTest(dude) && (dude != who)) {
if (dude._x < who._x) {
var offset = -5;
} else {
var offset = 5;
}
applySplode(dude, who.virtx, who.virty, who.virtx + offset, who.virty + offset, 150);
pp = _root.dudes.attachMovie("punchpoof", "poof", 989);
pp._x = dude._x;
pp._y = dude._y - 45;
pp._xscale = 105;
pp._yscale = pp._xscale;
}
i++;
}
i = 0;
while (i < team1.length) {
var dude = eval ("dudes.bad" + i);
if (block.hitTest(dude) && (dude != who)) {
if (dude._x < who._x) {
var offset = -5;
} else {
var offset = 5;
}
applySplode(dude, who.virtx, who.virty, who.virtx + offset, who.virty, 150);
pp = _root.dudes.attachMovie("punchpoof", "poof", 989);
pp._x = dude._x;
pp._y = dude._y - 45;
pp._xscale = 105;
pp._yscale = pp._xscale;
}
i++;
}
}
function chkAIShot() {
_root.airstrike = false;
var who = _root.sel;
var rot = (-5 - who._rotation);
var cv = 0;
r = _root.dudes.createEmptyMovieClip("raytrace", 989999);
var res = new Array();
var rescv = 0;
while (rot > (-175 - who._rotation)) {
res[rescv] = new Array();
res[rescv][0] = 0;
res[rescv][1] = 0;
var pow = 35;
var curx = who._x;
var cury = (who._y - 30);
var dangle = (who._rotation + rot);
var rads = (dangle * (Math.PI/180));
var gox = Math.cos(rads);
var goy = Math.sin(rads);
var Xvel = (gox * pow);
var Yvel = (goy * pow);
_root.starconnect = false;
f = 0;
while (f < 115) {
i = 0;
while (i < team0.length) {
var dud = eval ("dudes.good" + i);
var mydx = (who._x - dud._x);
var mydy = (who._y - dud._y);
var mydist = Math.sqrt((mydx * mydx) + (mydy * mydy));
if (mydist > 100) {
if (!dud.dead) {
var dadistx = (curx - dud._x);
var dadisty = (cury - dud._y);
var hyp = Math.sqrt((dadistx * dadistx) + (dadisty * dadisty));
if (hyp < 75) {
if (_root.debug) {
t = r.attachMovie("star", "test", cv);
t._x = curx;
t._y = cury;
}
curx = curx + Xvel;
cury = cury + Yvel;
cv++;
Xvel = Xvel * 0.99;
Yvel = Yvel + 0.7;
res[rescv][1] = res[rescv][1] + 1;
_root.starconnect = true;
var hitdude = true;
} else {
var hitdude = false;
}
} else {
var hitdude = false;
}
}
i++;
}
virtx = curx + _root.g._x;
virty = cury + _root.g._y;
if ((!hitdude) && (!_root.starconnect)) {
if (_root.g.hitTest(virtx, virty, true) && (!_root.cover.hitTest(virtx, virty, true))) {
if (_root.debug) {
t = r.attachMovie("exxon", "test", cv);
t._x = curx;
t._y = cury;
}
curx = curx + Xvel;
cury = cury + Yvel;
cv++;
Xvel = Xvel * 0.99;
Yvel = Yvel + 0.7;
res[rescv][0] = res[rescv][0] + 1;
} else {
if (_root.debug) {
t = r.attachMovie("blackdot", "test", cv);
t._x = curx;
t._y = cury;
}
curx = curx + Xvel;
cury = cury + Yvel;
cv++;
Xvel = Xvel * 0.99;
Yvel = Yvel + 0.7;
}
}
f++;
}
rot = rot - 3;
rescv = rescv + 1;
}
r.cacheAsBitmap = true;
var min = 0;
i = 0;
while (i < res.length) {
if (res[i][0] == 0) {
if (res[i][1] > min) {
min = res[i][1];
var rotindex = i;
}
}
i++;
}
if (rotindex == undefined) {
var min = 0;
i = 0;
while (i < res.length) {
if (res[i][1] > min) {
min = res[i][1];
rotindex = i;
}
i++;
}
trace("next best is: " + rotindex);
}
who.thinking._visible = false;
return(rotindex);
}
function turnTimer() {
if (_root.testingtime) {
_root.turncv = _root.turncv - 1;
if (_root.masterturn == "good") {
_root.shownum0 = Math.floor(_root.turncv);
} else {
_root.shownum1 = Math.floor(_root.turncv);
}
if (_root.turncv == 0) {
chargesound.stop();
chargeloop.stop();
_root.sel.buildingup = false;
_root.sel.rdy = false;
_root.sel.aiming = false;
_root.sel.guts.gotoAndStop("rest");
_root.testingtime = false;
clearTel();
clearInst();
if (!_root.sel.drowned) {
wrongsound.start();
} else {
splooshsound.start();
}
getTurn(true);
_root.sel.guts.gotoAndStop("rest");
_root.testingtime = false;
}
}
}
_root.flybysound = new Sound(this);
_root.flybysound.attachSound("flyby");
_root.walkiesound = new Sound(this);
_root.walkiesound.attachSound("walkietalkie");
_root.errorsound = new Sound(this);
_root.errorsound.attachSound("error");
_root.fanfaresound = new Sound(this);
_root.fanfaresound.attachSound("fanfare");
_root.losesound = new Sound(this);
_root.losesound.attachSound("lose");
_root.switchsound = new Sound(this);
_root.switchsound.attachSound("bloop");
_root.selsound = new Sound(this);
_root.selsound.attachSound("bleep");
_root.airtotal = 0;
_root.projtype = 1;
lineweight = 10;
_root.debug = false;
initLvl(12307626, 16711680, cavern, _root.fgid, _root.bgid);
var keyListener = new Object();
keyListener.onKeyDown = function () {
var num = Key.getCode();
if (_root.readytoswitchweapons) {
if (num == 54) {
if ((sel.myweaps[5] > 0) || (sel.myweaps[5] == -1)) {
freshInst(3);
clearTel();
_root.projtype = 3;
_root.sel.guts.gotoAndStop("aiming");
_root.sel.guts.aimclip.freshMe();
}
}
if (num == 53) {
if ((sel.myweaps[4] > 0) || (sel.myweaps[4] == -1)) {
freshInst(5);
_root.sel.guts.gotoAndStop("walkie");
_root.sel.guts.walkie.freshMe();
_root.sel.aimer._visible = false;
panon = true;
t = _root.attachMovie("teletubby", "teletubby", 999);
t._x = 350;
t._y = 225;
t.cross._visible = false;
t.strike._visible = true;
t.strike.origscale = t.strike._xscale;
_root.airstrike = true;
}
}
if (num == 52) {
if ((sel.myweaps[3] > 0) || (sel.myweaps[3] == -1)) {
freshInst(4);
clearTel();
flashIt();
_root.projtype = 4;
sel.aimer._visible = false;
sel.bar._visible = false;
sel.pointer._visible = false;
_root.sel.guts.gotoAndStop("punchcharge");
_root.sel.guts.punchcharge.freshMe();
}
}
if (num == 50) {
if ((sel.myweaps[1] > 0) || (sel.myweaps[1] == -1)) {
freshInst(3);
clearTel();
_root.projtype = 0;
_root.sel.guts.gotoAndStop("aiming");
_root.sel.guts.aimclip.freshMe();
}
}
if (num == 49) {
if ((sel.myweaps[0] > 0) || (sel.myweaps[0] == -1)) {
freshInst(3);
clearTel();
_root.projtype = 1;
_root.sel.guts.gotoAndStop("aiming");
_root.sel.guts.aimclip.freshMe();
_root.sel.guts.aimclip.zook.gotoAndPlay(1);
}
}
if (num == 51) {
if ((sel.myweaps[2] > 0) || (sel.myweaps[2] == -1)) {
freshInst(5);
clearInterval(_root.teltimer);
_root.sel.guts.gotoAndStop("walkie");
_root.sel.guts.walkie.freshMe();
_root.sel.aimer._visible = false;
panon = true;
t = _root.attachMovie("teletubby", "teletubby", 999);
t._x = 350;
t._y = 225;
t.cross._visible = true;
t.strike._visible = false;
_root.teleportation = true;
}
}
if (_root.airstrike && (num == 32)) {
clearInst();
walkiesound.start();
flybysound.start();
d = 0;
while (d < team0.length) {
var w = eval ("_root.dudes.good" + d);
w.bar._visible = false;
w.pointer._visible = false;
d++;
}
d = 0;
while (d < team1.length) {
var w = eval ("_root.dudes.bad" + d);
w.bar._visible = false;
w.pointer._visible = false;
d++;
}
if (sel.myweaps[4] > 0) {
sel.myweaps[4] = sel.myweaps[4] - 1;
}
_root.sel.buildingup = false;
_root.sel.rdy = false;
_root.sel.aiming = false;
_root.waitforretreat = true;
_root.sel.guts.gotoAndStop("rest");
_root.testingtime = false;
_root.airtotal = 0;
i = 0;
while (i < 4) {
m = dudes.attachMovie("angry", "strike" + i, dudes.getNextHighestDepth());
_root.airtotal = _root.airtotal + 1;
if (teletubby.strike._xscale == teletubby.strike.origscale) {
m._x = ((350 - dudes._x) + (75 * i)) + 300;
m._y = -700 + (55 * i);
m.Xvel = -10;
} else {
m._x = ((350 - dudes._x) - (75 * i)) - 300;
m._y = -700 - (55 * i);
m.Xvel = 10;
}
m.Yvel = 0;
m.cv = 0;
m.ject = true;
m.airstrike = true;
m.onEnterFrame = function () {
powerBall(this, who);
};
i++;
}
clearTel();
}
if (_root.airstrike && (num == 37)) {
teletubby.strike._xscale = teletubby.strike.origscale;
}
if (_root.airstrike && (num == 39)) {
teletubby.strike._xscale = -teletubby.strike.origscale;
}
if (_root.teleportation && (num == 32)) {
clearInst();
flashIt();
sel.guts.gotoAndStop("materialize");
var who = _root.teletubby;
who.virtx = who._x;
who.virty = who._y;
if (sel.myweaps[2] > 0) {
sel.myweaps[2] = sel.myweaps[2] - 1;
}
if (_root.g.hitTest(who.virtx, who.virty, true) && (!_root.cover.hitTest(who.virtx, who.virty, true))) {
} else {
_root.sel._x = _root.teletubby._x - dudes._x;
_root.sel._y = _root.teletubby._y - dudes._y;
panon = false;
_root.teletubby._visible = false;
_root.teletimer = 0;
clearInterval(_root.teltimer);
_root.teltimer = setInterval(chkTel, 100);
}
}
}
};
Key.addListener(keyListener);
splooshsound = new Sound(this);
splooshsound.attachSound("sploosh");
chargesound = new Sound(this);
chargesound.attachSound("chargefix.wav");
chargeloop = new Sound(this);
chargeloop.attachSound("chargetoploop.wav");
splodesound = new Sound(this);
splodesound.attachSound("splosion1.wav");
throwsound = new Sound(this);
throwsound.attachSound("throw.wav");
powersound = new Sound(this);
powersound.attachSound("powerup");
tinksound = new Sound(this);
tinksound.attachSound("tink");
jumpsound = new Sound(this);
jumpsound.attachSound("varoop");
wrongsound = new Sound(this);
wrongsound.attachSound("wrong");
freshInst(0);
_root.onEnterFrame = function () {
if (!_root.waitforretreat) {
controls();
}
if (g._y < -120) {
g._y = -120;
}
if (g._y > 500) {
g._y = 500;
}
if (g._x > -120) {
g._x = -120;
}
if (g._x < -2120) {
g._x = -2120;
}
alignAll();
turnTimer();
};
Frame 6 (8 B)
stop();
Symbol 20 MovieClip [bigsplode] Frame 16 (54 B)
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 43 MovieClip [splode] Frame 26 (54 B)
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 76 MovieClip Frame 1 (103 B)
this.onEnterFrame = function () {
this._rotation = this._parent._parent._parent.aimer._rotation;
};
Instance of Symbol 75 MovieClip "powerthing" in Symbol 76 MovieClip Frame 1 (953 B)
onClipEvent (load) {
this._parent._parent._parent._parent.ready = true;
this._parent._parent._parent._parent.power = 0;
this.pow0._visible = false;
this.pow1._visible = false;
this.pow2._visible = false;
this.pow3._visible = false;
this.pow4._visible = false;
}
onClipEvent (enterFrame) {
if (this._parent._parent._parent._parent.power > 20) {
this.pow0._visible = true;
} else {
this.pow0._visible = false;
}
if (this._parent._parent._parent._parent.power > 40) {
this.pow1._visible = true;
} else {
this.pow1._visible = false;
}
if (this._parent._parent._parent._parent.power > 60) {
this.pow2._visible = true;
} else {
this.pow2._visible = false;
}
if (this._parent._parent._parent._parent.power > 80) {
this.pow3._visible = true;
} else {
this.pow3._visible = false;
}
if (this._parent._parent._parent._parent.power > 100) {
this.pow4._visible = true;
} else {
this.pow4._visible = false;
}
}
Symbol 82 MovieClip Frame 1 (24 B)
this.blastradius = 230;
Symbol 87 MovieClip [nuke] Frame 1 (33 B)
this.blastradius = 500;
stop();
Symbol 87 MovieClip [nuke] Frame 2 (8 B)
stop();
Symbol 92 MovieClip Frame 9 (8 B)
stop();
Symbol 93 MovieClip Frame 1 (988 B)
function freshMe() {
delete this.arm1.onEnterFrame;
delete this.arm0.onEnterFrame;
if (_root.projtype == 1) {
this.arm0._visible = false;
this.arm1.outline._visible = false;
this.arm1.col._visible = false;
this.zook._visible = true;
this.zook.onEnterFrame = function () {
this._rotation = this._parent._parent._parent.aimer._rotation;
};
} else {
this.arm0._visible = true;
this.arm1.outline._visible = true;
this.arm1.col._visible = true;
this.zook._visible = false;
this.arm0.onEnterFrame = function () {
this._rotation = this._parent._parent._parent.aimer._rotation;
};
if (_root.projtype == 0) {
this.arm0.weaps.w0._visible = true;
this.arm0.weaps.w1._visible = false;
}
if (_root.projtype == 3) {
this.arm0.weaps.w1._visible = true;
this.arm0.weaps.w0._visible = false;
}
}
this.arm1.onEnterFrame = function () {
this._rotation = this._parent._parent._parent.aimer._rotation;
};
}
freshMe();
Symbol 103 MovieClip Frame 1 (33 B)
this._parent._parent.rec = true;
Symbol 103 MovieClip Frame 21 (34 B)
this._parent.gotoAndStop("rest");
Symbol 121 MovieClip Frame 9 (51 B)
_root.testPunch(this._parent._parent, this.block);
Symbol 121 MovieClip Frame 25 (112 B)
this._parent._parent.punching = false;
this._parent._parent.aiming = false;
this._parent.gotoAndStop("rest");
Symbol 139 MovieClip Frame 21 (8 B)
stop();
Symbol 140 MovieClip Frame 1 (66 B)
function freshMe() {
this.inside.gotoAndPlay(1);
}
freshMe();
Symbol 148 MovieClip Frame 1 (59 B)
function freshMe() {
this.gotoAndPlay(1);
}
freshMe();
Symbol 148 MovieClip Frame 12 (8 B)
stop();
Symbol 153 MovieClip Frame 16 (34 B)
this._parent.gotoAndStop("rest");
Symbol 156 MovieClip Frame 1 (8 B)
stop();
Symbol 167 MovieClip Frame 10 (8 B)
stop();
Symbol 173 MovieClip [lam0] Frame 1 (50 B)
speed = 3;
jmpht = 5;
maxhp = 100;
hp = maxhp;
Symbol 189 MovieClip Frame 1 (988 B)
function freshMe() {
delete this.arm1.onEnterFrame;
delete this.arm0.onEnterFrame;
if (_root.projtype == 1) {
this.arm0._visible = false;
this.arm1.outline._visible = false;
this.arm1.col._visible = false;
this.zook._visible = true;
this.zook.onEnterFrame = function () {
this._rotation = this._parent._parent._parent.aimer._rotation;
};
} else {
this.arm0._visible = true;
this.arm1.outline._visible = true;
this.arm1.col._visible = true;
this.zook._visible = false;
this.arm0.onEnterFrame = function () {
this._rotation = this._parent._parent._parent.aimer._rotation;
};
if (_root.projtype == 0) {
this.arm0.weaps.w0._visible = true;
this.arm0.weaps.w1._visible = false;
}
if (_root.projtype == 3) {
this.arm0.weaps.w1._visible = true;
this.arm0.weaps.w0._visible = false;
}
}
this.arm1.onEnterFrame = function () {
this._rotation = this._parent._parent._parent.aimer._rotation;
};
}
freshMe();
Symbol 199 MovieClip Frame 1 (33 B)
this._parent._parent.rec = true;
Symbol 199 MovieClip Frame 21 (34 B)
this._parent.gotoAndStop("rest");
Symbol 209 MovieClip Frame 9 (51 B)
_root.testPunch(this._parent._parent, this.block);
Symbol 209 MovieClip Frame 25 (112 B)
this._parent._parent.punching = false;
this._parent._parent.aiming = false;
this._parent.gotoAndStop("rest");
Symbol 221 MovieClip Frame 21 (8 B)
stop();
Symbol 222 MovieClip Frame 1 (66 B)
function freshMe() {
this.inside.gotoAndPlay(1);
}
freshMe();
Symbol 228 MovieClip Frame 1 (59 B)
function freshMe() {
this.gotoAndPlay(1);
}
freshMe();
Symbol 228 MovieClip Frame 12 (8 B)
stop();
Symbol 234 MovieClip Frame 16 (34 B)
this._parent.gotoAndStop("rest");
Symbol 235 MovieClip Frame 1 (8 B)
stop();
Symbol 235 MovieClip Frame 2 (8 B)
stop();
Symbol 236 MovieClip [sold0] Frame 1 (50 B)
speed = 3;
jmpht = 5;
maxhp = 100;
hp = maxhp;
Symbol 238 MovieClip [angry] Frame 1 (52 B)
this.blastradius = 170;
this.cacheAsBitmap = true;
Symbol 241 MovieClip [powerball] Frame 1 (24 B)
this.blastradius = 170;
Symbol 248 MovieClip [cannonball] Frame 1 (33 B)
this.blastradius = 220;
stop();
Symbol 248 MovieClip [cannonball] Frame 2 (8 B)
stop();
Symbol 273 MovieClip Frame 1 (345 B)
this.slider.onPress = function () {
this._parent.onEnterFrame = function () {
_root.changeVol(this);
};
};
this.slider.onRelease = function () {
delete this._parent.onEnterFrame;
};
this.slider.onReleaseOutside = function () {
delete this._parent.onEnterFrame;
};
this.tracks.onPress = function () {
_root.switchTracks();
};
Symbol 282 MovieClip [levload] Frame 1 (122 B)
this.onPress = function () {
getURL ("http://www.newgrounds.com/audio/view.php?id=960989&sub=40883", "_blank");
};
Symbol 313 MovieClip [punchpoof] Frame 16 (54 B)
stop();
this.unloadMovie();
this.removeMovieClip();
Symbol 315 MovieClip [flashthing] Frame 3 (54 B)
stop();
this.removeMovieClip();
this.unloadMovie();
Symbol 370 Button (35 B)
on (release) {
_root.resetAll();
}
Symbol 375 MovieClip [gameover] Frame 7 (8 B)
stop();
Symbol 388 MovieClip [bg4] Frame 1 (27 B)
this.cacheAsBitmap = true;
Symbol 390 MovieClip [bg3] Frame 1 (27 B)
this.cacheAsBitmap = true;
Symbol 392 MovieClip [bg2] Frame 1 (27 B)
this.cacheAsBitmap = true;
Symbol 411 MovieClip Frame 1 (8 B)
stop();
Symbol 411 MovieClip Frame 30 (8 B)
stop();
Symbol 544 MovieClip Frame 111 (8 B)
stop();
Symbol 550 Button (65 B)
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 553 MovieClip Frame 1 (8 B)
stop();
Symbol 553 MovieClip Frame 20 (22 B)
_root.gotoAndStop(3);
Symbol 561 MovieClip [bg1] Frame 1 (27 B)
this.cacheAsBitmap = true;
Symbol 563 MovieClip [bg0] Frame 1 (27 B)
this.cacheAsBitmap = true;
Symbol 577 MovieClip Frame 1 (8 B)
stop();
Symbol 610 MovieClip Frame 22 (8 B)
stop();
Symbol 618 Button (65 B)
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Symbol 623 Button (104 B)
on (release) {
getURL ("http://www.newgrounds.com/audio/view.php?id=960989&sub=40883", "_blank");
}
Symbol 628 Button (63 B)
on (release) {
getURL ("http://www.bomtoons.com", "_blank");
}
Symbol 691 Button (148 B)
on (rollOver) {
_root.switchsound.start();
}
on (release) {
stopAllSounds();
_root.aion = true;
_root.selsound.start();
_root.gotoAndStop(4);
}
Symbol 702 Button (149 B)
on (rollOver) {
_root.switchsound.start();
}
on (release) {
stopAllSounds();
_root.aion = false;
_root.gotoAndStop(4);
_root.selsound.start();
}
Symbol 703 Button (128 B)
on (rollOver) {
_root.switchsound.start();
}
on (release) {
stopAllSounds();
_root.gotoAndStop(6);
_root.selsound.start();
}
Symbol 704 Button (164 B)
on (rollOver) {
_root.switchsound.start();
}
on (release) {
_root.selsound.start();
getURL ("http://www.newgrounds.com/collection/picoday2007.html", "_blank");
}
Symbol 705 MovieClip Frame 141 (151 B)
_root.switchsound = new Sound(this);
_root.switchsound.attachSound("bloop");
_root.selsound = new Sound(this);
_root.selsound.attachSound("bleep");
Symbol 705 MovieClip Frame 170 (8 B)
stop();
Symbol 705 MovieClip Frame 229 (8 B)
stop();
Symbol 755 MovieClip Frame 13 (17 B)
gotoAndPlay (9);
Symbol 756 MovieClip Frame 4 (8 B)
stop();
Symbol 757 Button (54 B)
on (release) {
setGlobals();
_root.gotoAndStop(5);
}
Symbol 760 Button (39 B)
on (release) {
_root.gotoAndStop(3);
}
Symbol 766 MovieClip Frame 1 (269 B)
this.danum = 40;
this.upp.onPress = function () {
if (this._parent.danum < 60) {
this._parent.danum = this._parent.danum + 1;
}
};
this.dwn.onPress = function () {
if (this._parent.danum > 20) {
this._parent.danum = this._parent.danum - 1;
}
};
Symbol 768 MovieClip Frame 1 (233 B)
function changeIt() {
if (this.danum == "NO") {
this.danum = "YES";
} else {
this.danum = "NO";
}
}
upp.onPress = function () {
this._parent.changeIt();
};
dwn.onPress = function () {
this._parent.changeIt();
};
Symbol 770 MovieClip Frame 1 (267 B)
this.danum = 3;
this.upp.onPress = function () {
if (this._parent.danum < 15) {
this._parent.danum = this._parent.danum + 1;
}
};
this.dwn.onPress = function () {
if (this._parent.danum > 1) {
this._parent.danum = this._parent.danum - 1;
}
};
Symbol 772 MovieClip Frame 1 (616 B)
function updateIt() {
i = 0;
while (i < tot) {
var hid = eval ("bg" + i);
hid._visible = false;
i++;
}
sho = eval ("bg" + this.num);
sho._visible = true;
}
this.tot = 5;
this.num = 0;
updateIt();
upp.onPress = function () {
if (this._parent.num < (this._parent.tot - 1)) {
this._parent.num = this._parent.num + 1;
} else {
this._parent.num = 0;
}
this._parent.updateIt();
};
dwn.onPress = function () {
if (this._parent.num > 0) {
this._parent.num = this._parent.num - 1;
} else {
this._parent.num = this._parent.tot - 1;
}
this._parent.updateIt();
};
Symbol 774 MovieClip Frame 1 (616 B)
function updateIt() {
i = 0;
while (i < tot) {
var hid = eval ("bg" + i);
hid._visible = false;
i++;
}
sho = eval ("bg" + this.num);
sho._visible = true;
}
this.tot = 5;
this.num = 0;
updateIt();
upp.onPress = function () {
if (this._parent.num < (this._parent.tot - 1)) {
this._parent.num = this._parent.num + 1;
} else {
this._parent.num = 0;
}
this._parent.updateIt();
};
dwn.onPress = function () {
if (this._parent.num > 0) {
this._parent.num = this._parent.num - 1;
} else {
this._parent.num = this._parent.tot - 1;
}
this._parent.updateIt();
};
Symbol 790 MovieClip Frame 1 (753 B)
this.upp.onPress = function () {
if (this._parent.danum == "inf") {
this._parent.danum = this._parent.botlim;
} else if (this._parent.danum < this._parent.toplim) {
this._parent.danum = this._parent.danum + 1;
} else if (this._parent.weap) {
this._parent.danum = "inf";
} else {
this._parent.danum = this._parent.botlim;
}
};
this.dwn.onPress = function () {
if ((this._parent.danum > this._parent.botlim) || (this._parent.danum == "inf")) {
if (this._parent.danum == "inf") {
this._parent.danum = this._parent.toplim;
} else {
this._parent.danum = this._parent.danum - 1;
}
} else if (this._parent.weap) {
this._parent.danum = "inf";
} else {
this._parent.danum = this._parent.toplim;
}
};
Instance of Symbol 790 MovieClip "pl" in Symbol 793 MovieClip Frame 1 (21 B)
/* no clip actions */
Instance of Symbol 790 MovieClip "w1" in Symbol 793 MovieClip Frame 1 (99 B)
onClipEvent (load) {
this.danum = "inf";
this.weap = true;
this.toplim = 10;
this.botlim = 0;
}
Instance of Symbol 790 MovieClip "w3" in Symbol 793 MovieClip Frame 1 (95 B)
onClipEvent (load) {
this.danum = 3;
this.weap = true;
this.toplim = 10;
this.botlim = 0;
}
Instance of Symbol 790 MovieClip "w5" in Symbol 793 MovieClip Frame 1 (95 B)
onClipEvent (load) {
this.danum = 0;
this.weap = true;
this.toplim = 10;
this.botlim = 0;
}
Instance of Symbol 790 MovieClip "w0" in Symbol 793 MovieClip Frame 1 (99 B)
onClipEvent (load) {
this.danum = "inf";
this.weap = true;
this.toplim = 10;
this.botlim = 0;
}
Instance of Symbol 790 MovieClip "w2" in Symbol 793 MovieClip Frame 1 (95 B)
onClipEvent (load) {
this.danum = 1;
this.weap = true;
this.toplim = 10;
this.botlim = 0;
}
Instance of Symbol 790 MovieClip "w4" in Symbol 793 MovieClip Frame 1 (95 B)
onClipEvent (load) {
this.danum = 1;
this.weap = true;
this.toplim = 10;
this.botlim = 0;
}
Symbol 810 Button (73 B)
on (release) {
_root.so.clear();
this.clearAll();
this.updateRank();
}
Symbol 819 MovieClip Frame 1 (4.67 KiB) ●
function updateRank() {
if (_root.so.data.onepwins >= 2) {
b0.checked._visible = true;
}
if (_root.so.data.twopwins >= 1) {
b1.checked._visible = true;
}
if ((_root.so.data.twopwins >= 1) && (_root.so.data.onepwins >= 2)) {
rankp._y = 100;
rank = "PRIVATE";
_root.so.data.folds[0] = 1;
}
if (_root.so.data.onepwins >= 5) {
b2.checked._visible = true;
}
if (_root.so.data.twopwins >= 2) {
b3.checked._visible = true;
}
if (_root.so.data.onepthreeonone) {
b4.checked._visible = true;
}
var _local2 = true;
i = 0;
while (i < _root.so.data.bgplays.length) {
if (_root.so.data.bgplays[i] == 0) {
_local2 = false;
}
i++;
}
if (_local2) {
b5.checked._visible = true;
}
if (((_local2 && (_root.so.data.onepthreeonone)) && (_root.so.data.twopwins >= 2)) && (_root.so.data.onepwins >= 5)) {
rank = "SARGEANT";
_root.so.data.folds[1] = 1;
rankp._y = 160;
}
if (_root.so.data.onepwins >= 10) {
b6.checked._visible = true;
}
if (_root.so.data.twopwins >= 5) {
b7.checked._visible = true;
}
if (_root.so.data.onepsixontwo) {
b8.checked._visible = true;
}
_local2 = true;
i = 0;
while (i < _root.so.data.fgplays.length) {
if (_root.so.data.fgplays[i] == 0) {
_local2 = false;
}
i++;
}
if (_local2) {
b9.checked._visible = true;
}
if (_root.so.data.onepart >= 1) {
b10.checked._visible = true;
}
if (_root.so.data.onepcav) {
b11.checked._visible = true;
}
if (((((_root.so.data.onepcav && (_root.so.data.onepart >= 1)) && (_local2)) && (_root.so.data.onepsixontwo)) && (_root.so.data.twopwins >= 5)) && (_root.so.data.onepwins >= 10)) {
rank = "LIEUTENANT";
_root.so.data.folds[2] = 1;
rankp._y = 215;
}
if (_root.so.data.onepwins >= 20) {
b12.checked._visible = true;
}
if (_root.so.data.twopwins >= 10) {
b13.checked._visible = true;
}
if (_root.so.data.onepsixonone >= 3) {
b14.checked._visible = true;
}
if (_root.so.data.onepart >= 5) {
b15.checked._visible = true;
}
if (_root.so.data.onepgrenades) {
b16.checked._visible = true;
}
if (_root.so.data.onepnoswitch > 2) {
b17.checked._visible = true;
}
if ((((((_root.so.data.onepwins >= 20) && (_root.so.data.twopwins >= 10)) && (_root.so.data.onepsixonone >= 3)) && (_root.so.data.onepnoswitch > 2)) && (_root.so.data.onepgrenades)) && (_root.so.data.onepart >= 5)) {
rank = "GENERAL";
_root.so.data.folds[3] = 1;
rankp._y = 275;
p0.locka._visible = false;
p1.locka._visible = false;
} else {
p0.locka._visible = true;
p1.locka._visible = true;
p0.locka.onPress = function () {
};
p1.locka.onPress = function () {
};
}
if (_root.so.data.onepwins >= 10) {
s0.guts._visible = true;
}
if (_root.so.data.onepwins >= 25) {
s1.guts._visible = true;
}
if (_root.so.data.onepwins >= 50) {
s2.guts._visible = true;
}
if (_root.so.data.onepwins >= 100) {
s3.guts._visible = true;
}
if (_root.so.data.onepwins >= 250) {
s4.guts._visible = true;
}
}
function clearAll() {
i = 0;
while (i < 18) {
var thing = eval ("b" + i);
thing.checked._visible = false;
i++;
}
i = 0;
while (i < 5) {
var thing = eval ("s" + i);
thing.guts._visible = false;
i++;
}
}
function setGlobals() {
_root.maxturn = turny.danum * 10;
_root.maxretreat = retty.danum * 10;
if (cav.danum == "YES") {
_root.cavern = true;
} else {
_root.cavern = false;
}
if (sw.danum == "YES") {
_root.abletoswitch = true;
} else {
_root.abletoswitch = false;
}
if (art.danum == "YES") {
_root.abletomove = false;
} else {
_root.abletomove = true;
}
_root.bgid = ba.num;
_root.fgid = fo.num;
_root.team0 = new Array();
i = 0;
while (i < parseInt(p0.pl.danum)) {
_root.team0[i] = "sold0";
i++;
}
_root.team1 = new Array();
i = 0;
while (i < parseInt(p1.pl.danum)) {
_root.team1[i] = "lam0";
i++;
}
_root.goodweaps = new Array();
i = 0;
while (i < 6) {
var thing = eval ("p0.w" + i);
if (thing.danum == "inf") {
_root.goodweaps[i] = -1;
} else {
_root.goodweaps[i] = parseInt(thing.danum);
}
i++;
}
_root.badweaps = new Array();
i = 0;
while (i < 6) {
var thing = eval ("p1.w" + i);
if (thing.danum == "inf") {
_root.badweaps[i] = -1;
} else {
_root.badweaps[i] = parseInt(thing.danum);
}
i++;
}
trace("goodweaps is: " + _root.goodweaps);
trace("badweaps is: " + _root.badweaps);
}
rank = "NONE";
clearAll();
updateRank();
Instance of Symbol 768 MovieClip "sw" in Symbol 819 MovieClip Frame 1 (43 B)
onClipEvent (load) {
this.danum = "YES";
}
Instance of Symbol 768 MovieClip "cav" in Symbol 819 MovieClip Frame 1 (42 B)
onClipEvent (load) {
this.danum = "NO";
}
Instance of Symbol 768 MovieClip "art" in Symbol 819 MovieClip Frame 1 (42 B)
onClipEvent (load) {
this.danum = "NO";
}
Instance of Symbol 793 MovieClip "p0" in Symbol 819 MovieClip Frame 1 (84 B)
onClipEvent (load) {
this.pl.danum = 3;
this.pl.toplim = 8;
this.pl.botlim = 1;
}
Instance of Symbol 793 MovieClip "p1" in Symbol 819 MovieClip Frame 1 (139 B)
onClipEvent (load) {
this.pl.danum = 4;
this.pl.toplim = 8;
if (_root.aion) {
this.pl.botlim = 3;
} else {
this.pl.botlim = 1;
}
}
Symbol 819 MovieClip Frame 26 (8 B)
stop();
Symbol 829 MovieClip Frame 1 (327 B)
danum = 1;
lef.onPress = function () {
if (this._parent.danum > 1) {
this._parent.danum = this._parent.danum - 1;
}
this._parent._parent.updateFolds();
};
rig.onPress = function () {
if (this._parent.danum < 4) {
this._parent.danum = this._parent.danum + 1;
}
this._parent._parent.updateFolds();
};
Symbol 864 MovieClip Frame 1 (8 B)
stop();
Symbol 864 MovieClip Frame 2 (8 B)
stop();
Instance of Symbol 846 MovieClip in Symbol 864 MovieClip Frame 2 (84 B)
on (release) {
getURL ("http://www.newgrounds.com/portal/view/310349", "_blank");
}
Instance of Symbol 851 MovieClip in Symbol 864 MovieClip Frame 2 (84 B)
on (release) {
getURL ("http://www.newgrounds.com/portal/view/310005", "_blank");
}
Instance of Symbol 855 MovieClip in Symbol 864 MovieClip Frame 2 (84 B)
on (release) {
getURL ("http://www.newgrounds.com/portal/view/310004", "_blank");
}
Instance of Symbol 859 MovieClip in Symbol 864 MovieClip Frame 2 (84 B)
on (release) {
getURL ("http://www.newgrounds.com/portal/view/310598", "_blank");
}
Instance of Symbol 863 MovieClip in Symbol 864 MovieClip Frame 2 (84 B)
on (release) {
getURL ("http://www.newgrounds.com/portal/view/310607", "_blank");
}
Symbol 878 Button (104 B)
on (release) {
getURL ("http://www.newgrounds.com/audio/view.php?id=960989&sub=40883", "_blank");
}
Symbol 881 Button (93 B)
on (release) {
getURL ("http://www.newgrounds.com/collection/picoday2007.html", "_blank");
}
Symbol 882 MovieClip Frame 1 (8 B)
stop();
Symbol 882 MovieClip Frame 2 (8 B)
stop();
Symbol 891 Button (66 B)
on (release) {
getURL ("http://www.mindchamber.net", "_blank");
}
Symbol 894 Button (88 B)
on (release) {
getURL ("http://www.newgrounds.com/lit/pico_concepts.html", "_blank");
}
Symbol 898 MovieClip Frame 1 (8 B)
stop();
Symbol 898 MovieClip Frame 2 (8 B)
stop();
Symbol 908 Button (63 B)
on (release) {
getURL ("http://www.bomtoons.com", "_blank");
}
Symbol 912 Button (84 B)
on (release) {
getURL ("http://www.newgrounds.com/portal/view/305181", "_blank");
}
Symbol 916 Button (84 B)
on (release) {
getURL ("http://www.newgrounds.com/portal/view/310247", "_blank");
}
Symbol 917 MovieClip Frame 1 (8 B)
stop();
Symbol 917 MovieClip Frame 2 (8 B)
stop();
Symbol 920 MovieClip Frame 1 (3.51 KiB) ●
function updateRank() {
if (_root.so.data.onepwins >= 2) {
b0.checked._visible = true;
}
if (_root.so.data.twopwins >= 1) {
b1.checked._visible = true;
}
if ((_root.so.data.twopwins >= 1) && (_root.so.data.onepwins >= 2)) {
rankp._y = 100;
rank = "PRIVATE";
_root.so.data.folds[0] = 1;
}
if (_root.so.data.onepwins >= 5) {
b2.checked._visible = true;
}
if (_root.so.data.twopwins >= 2) {
b3.checked._visible = true;
}
if (_root.so.data.onepthreeonone) {
b4.checked._visible = true;
}
var _local2 = true;
i = 0;
while (i < _root.so.data.bgplays.length) {
if (_root.so.data.bgplays[i] == 0) {
_local2 = false;
}
i++;
}
if (_local2) {
b5.checked._visible = true;
}
if (((_local2 && (_root.so.data.onepthreeonone)) && (_root.so.data.twopwins >= 2)) && (_root.so.data.onepwins >= 5)) {
rank = "SARGEANT";
_root.so.data.folds[1] = 1;
}
if (_root.so.data.onepwins >= 10) {
b6.checked._visible = true;
}
if (_root.so.data.twopwins >= 5) {
b7.checked._visible = true;
}
if (_root.so.data.onepsixontwo) {
b8.checked._visible = true;
}
_local2 = true;
i = 0;
while (i < _root.so.data.fgplays.length) {
if (_root.so.data.fgplays[i] == 0) {
_local2 = false;
}
i++;
}
if (_local2) {
b9.checked._visible = true;
}
if (_root.so.data.onepart >= 1) {
b10.checked._visible = true;
}
if (_root.so.data.onepcav) {
b11.checked._visible = true;
}
if (((((_root.so.data.onepcav && (_root.so.data.onepart >= 1)) && (_local2)) && (_root.so.data.onepsixontwo)) && (_root.so.data.twopwins >= 5)) && (_root.so.data.onepwins >= 10)) {
rank = "LIEUTENANT";
_root.so.data.folds[2] = 1;
}
if (_root.so.data.onepwins >= 20) {
b12.checked._visible = true;
}
if (_root.so.data.twopwins >= 10) {
b13.checked._visible = true;
}
if (_root.so.data.onepsixonone >= 3) {
b14.checked._visible = true;
}
if (_root.so.data.onepart >= 5) {
b15.checked._visible = true;
}
if (_root.so.data.onepgrenades) {
b16.checked._visible = true;
}
if (_root.so.data.onepnoswitch > 2) {
b17.checked._visible = true;
}
if ((((((_root.so.data.onepwins >= 20) && (_root.so.data.twopwins >= 10)) && (_root.so.data.onepsixonone >= 3)) && (_root.so.data.onepnoswitch > 2)) && (_root.so.data.onepgrenades)) && (_root.so.data.onepart >= 5)) {
rank = "GENERAL";
_root.so.data.folds[3] = 1;
}
if (_root.so.data.onepwins >= 10) {
s0.guts._visible = true;
}
if (_root.so.data.onepwins >= 25) {
s1.guts._visible = true;
}
if (_root.so.data.onepwins >= 50) {
s2.guts._visible = true;
}
if (_root.so.data.onepwins >= 100) {
s3.guts._visible = true;
}
if (_root.so.data.onepwins >= 250) {
s4.guts._visible = true;
}
}
function updateFolds() {
i = 0;
while (i < 4) {
var thing = eval ("f" + i);
thing._visible = false;
i++;
}
inst._visible = true;
var mynum = (this.coun.danum - 1);
var sho = eval ("f" + mynum);
sho._visible = true;
sho.gotoAndStop("closed");
sho.id = mynum;
if (_root.so.data.folds[mynum] > 0) {
lok._visible = false;
} else {
lok._visible = true;
}
sho.onPress = function () {
if (_root.so.data.folds[this.id] > 0) {
this.gotoAndStop("open");
inst._visible = false;
delete this.onPress;
}
};
}
updateFolds();
updateRank();
Symbol 920 MovieClip Frame 26 (8 B)
stop();