Frame 2
function saveData() {
trace("Saving Data");
myLocalSO.data.place_score_1 = place_score_1;
myLocalSO.data.place_score_2 = place_score_2;
myLocalSO.data.place_score_3 = place_score_3;
myLocalSO.data.place_name_1 = place_name_1;
myLocalSO.data.place_name_2 = place_name_2;
myLocalSO.data.place_name_3 = place_name_3;
myLocalSO.data.player_name = player_name;
myLocalSO.data.highScoreColor = highScoreColor;
}
function increaseScore(amt, x, y) {
_root.g_lvl_kills++;
_root.score = _root.score + amt;
}
function gameOver() {
return(_root.hero.hp <= 0);
}
function endGame() {
_root.paused = true;
updatedTopScores();
openGameOver();
}
function updatedTopScores() {
if (score > place_score_1) {
place_score_3 = place_score_2;
place_score_2 = place_score_1;
place_score_1 = score;
place_name_3 = place_name_2;
place_name_2 = place_name_1;
place_name_1 = player_name;
_root.end_text = "New high score! 1st Place";
} else if (score > place_score_2) {
place_score_3 = place_score_2;
place_score_2 = score;
place_name_3 = place_name_2;
place_name_2 = player_name;
_root.end_text = "New high score! 2nd Place";
} else if (score > place_score_3) {
place_score_3 = score;
place_name_3 = player_name;
_root.end_text = "New high score! 3rd Place";
} else if (score > 1000) {
_root.end_text = "Nice shooting.";
} else if (score > 700) {
_root.end_text = "Not bad. Keep Practicing";
} else if (score > 400) {
_root.end_text = "Ouch... better luck next time.";
} else {
_root.end_text = "Noob Tip: use mouse-left click to fire :P";
}
saveData();
}
function restartGame() {
cleanGameboard();
resetGame();
}
function cleanGameboard() {
for (i in mines) {
mines[i].unloadMovie();
}
mines = new Array();
for (i in enemies) {
enemies[i].unloadMovie();
}
enemies = new Array();
cleanUp();
}
function resetGame() {
game_ended = false;
_root.level_ticker = 0;
_root.fps_ticks = 0;
_root.fps_total = 0;
_root.avg_fps = 0;
_root.max_fps = 0;
_root.min_fps = 9999;
_root.stepper.resetStepperVars();
_root.hero._alpha = 100;
_root.hero.hp = 100;
_root.hero.vx = 0;
_root.hero.vy = 0;
_root.score = 0;
_root.level = 1;
_root.ammo_grenades = 15;
_root.ammo_arrows = 25;
_root.ammo_bullets = 500;
_root.ammo_rockets = 10;
_root.ammo_prox_mines = 20;
_root.ammo_shells = 20;
_root.ammo_rpg = 8;
_root.hero._x = (_root.g_width / 2) - 20;
_root.hero._y = _root.g_ground / 2;
resetObs();
_root.paused = false;
}
function showTopScores() {
paused = true;
temp = _root.upgrade_layer.attachMovie("top_scores", "top_scores_" + SCORES, SCORES);
temp._x = g_width / 2;
temp._y = g_ground / 2;
top_scores_screen = temp;
}
function showLevelDisplay() {
temp = _root.upgrade_layer.attachMovie("level_display", "level_display_" + LEVEL_DISPLAY, LEVEL_DISPLAY);
temp._x = g_width / 2;
temp._y = g_ground / 2;
}
function closeTopScores() {
top_scores_screen.unloadMovie();
}
function openNamer() {
trace("opening namer");
paused = true;
temp = _root.upgrade_layer.attachMovie("namer_screen", "namer" + NAMER, NAMER);
temp._x = g_width / 2;
temp._y = g_ground * 0.75;
namer_screen = temp;
}
function closeNamer() {
namer_screen.unloadMovie();
}
function openGameOver() {
trace("opening gameOver screen");
temp = _root.upgrade_layer.attachMovie("game_over_screen", "game_over_screen" + GAMEOVER_NUM, GAMEOVER_NUM);
temp._x = g_width / 2;
temp._y = g_ground / 2;
game_over_screen = temp;
}
function closeGameOver() {
game_over_screen.unloadMovie();
}
function openHelp() {
trace("opening help");
paused = true;
temp = _root.upgrade_layer.attachMovie("help_screen", "help_screen" + HELP_NUM, HELP_NUM);
temp._x = g_width / 2;
temp._y = g_ground / 2;
help_screen = temp;
}
function closeHelp() {
trace("closing help");
help_screen.unloadMovie();
}
function playHitEnemySound() {
playSound(hurtsounds[random(3)]);
}
function addRandomGoodie(x, y) {
bonus = powerups[random(powerups.length)];
if (bonus == "gas_can") {
obs = _root.addObj(bonus, _root.obstruct_layer, _root.getNextObstructionLevel());
obs._x = x;
obs._y = y;
} else {
obs = _root.addObj(bonus, _root.powerup_layer, _root.getNextPowerUpLevel());
obs._x = x;
obs._y = y;
}
}
function playSound(filename) {
if (g_soundOn) {
mysound = new Sound();
mysound.attachSound(filename);
mysound.start(0, 1);
}
}
function shootArrow() {
playSound("swoosh.wav");
ammo_arrows--;
shot_speed = 8;
rads = (_root.hero.sight._rotation * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_arrow", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = (hero._x + hero.sight._x) + (xfactor * 20);
proj._y = (hero._y + hero.sight._y) + (yfactor * 20);
proj._rotation = _root.hero.sight._rotation;
}
function shootRPG() {
playSound("tat1.wav");
ammo_rpg--;
shot_speed = 8;
rads = (_root.hero.sight._rotation * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _root.addObj("rpg", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = (hero._x + hero.sight._x) + (xfactor * 20);
proj._y = (hero._y + hero.sight._y) + (yfactor * 20);
proj._rotation = _root.hero.sight._rotation;
}
function placeDebrisArrow(x, y, rot) {
temp = _root.addObj("arrow_debris", _root.debris_layer, _root.getNextDebrisLevel());
temp._x = x;
temp._y = y;
temp._rotation = rot;
}
function placeDebrisType(x, y, rot, dtype) {
temp = _root.addObj(dtype, _root.debris_layer, _root.getNextDebrisLevel());
temp._x = x;
temp._y = y;
temp._rotation = rot;
}
function removeEnemy(ene) {
tempArray = new Array();
for (i in enemies) {
nextEn = enemies[i];
if (ene != nextEn) {
tempArray.push(nextEn);
}
}
ene.unloadMovie();
enemies = tempArray;
}
function removeMine(mi) {
tempArray = new Array();
for (i in mines) {
nextObj = mines[i];
if (mi != nextObj) {
tempArray.push(nextObj);
}
}
mi.unloadMovie();
mines = tempArray;
}
function removeObstruction(obs) {
tempArray = new Array();
for (i in obstructions) {
nextObs = obstructions[i];
if (obs != nextObs) {
tempArray.push(nextObs);
}
}
obs.unloadMovie();
obstructions = tempArray;
}
function shootHeroProjectile() {
playSound("tat2.wav");
ammo_bullets--;
_root.hero.recoil = 5;
shot_speed = 8;
variation = (random(Math.floor(_root.gun_wild * 100)) - random(Math.floor(_root.gun_wild * 100))) / 300;
rads = ((_root.hero.sight._rotation + variation) * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_bullet", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = (hero._x + hero.sight._x) + (xfactor * 20);
proj._y = (hero._y + hero.sight._y) + (yfactor * 20);
proj._rotation = _root.hero.sight._rotation;
}
function shootHeroUzi() {
playSound("tat2.wav");
ammo_bullets--;
_root.hero.recoil = 5;
shot_speed = 6;
variation = (random(Math.floor(_root.gun_wild * 100)) - random(Math.floor(_root.gun_wild * 100))) / 300;
rads = ((_root.hero.sight._rotation + variation) * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_bullet", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = (hero._x + hero.sight._x) + (xfactor * 20);
proj._y = (hero._y + hero.sight._y) + (yfactor * 20);
proj._rotation = _root.hero.sight._rotation;
}
function shootHeroShotgun() {
playSound("tat2.wav");
ammo_shells--;
_root.hero.recoil = 5;
shot_speed = 8;
deg = -2;
while (deg <= 2) {
rads = ((_root.hero.sight._rotation + (deg * 4)) * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_bullet", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = (hero._x + hero.sight._x) + (xfactor * 20);
proj._y = (hero._y + hero.sight._y) + (yfactor * 20);
proj._rotation = _root.hero.sight._rotation;
deg++;
}
}
function shrapnelExplosion(x, y, amt) {
ndx = 0;
while (ndx < amt) {
shot_speed = ((random(100) / 100) * 8) + 4;
rot = (90 + random(80)) - 40;
rads = (rot * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_shrap", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = x;
proj._y = y;
proj._rotation = rot;
ndx++;
}
}
function shootHeroRocket() {
playSound("shoot_rocket.wav");
rocket_smoke = 105;
rocket_flame = 130;
ammo_rockets--;
targ_ene = null;
targ_acq = false;
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_xmouse, _ymouse, 0)) {
targ_ene = _root.enemies[i];
targ_acq = true;
break;
}
}
_root.hero.sight.rifle_invert._x = _root.hero.sight.rifle_invert._x - 5;
_root.hero.sight.rifle._x = _root.hero.sight.rifle._x - 5;
shot_speed = 6;
rads = (_root.hero.sight._rotation * Math.PI) / 180;
lvx = shot_speed * Math.cos(rads);
lvy = shot_speed * Math.sin(rads);
lvl = getNextRocketLevel();
proj = _root.addObj("missile", _root.rocket_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = (hero._x + hero.sight._x) + (lvx * 1);
proj._y = (hero._y + hero.sight._y) + (lvy * 1);
proj._rotation = _root.hero.sight._rotation;
proj.target_enemy = targ_ene;
proj.target_acquired = targ_acq;
}
function shootGrenade() {
ammo_grenades--;
shot_speed = 4;
variation = 0;
rads = ((_root.hero.sight._rotation + variation) * Math.PI) / 180;
lvx = shot_speed * Math.cos(rads);
lvy = shot_speed * Math.sin(rads);
lvl = getNextProjectileLevel();
proj = _root.addObj("hero_molotov", _root.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = ((hero._x + hero.sight._x) + lvx) + _root.hero.vx;
proj._y = ((hero._y + hero.sight._y) + lvy) + _root.hero.vy;
}
function shootProximityMine() {
ammo_prox_mines--;
shot_speed = 2;
variation = 0;
rads = ((_root.hero.sight._rotation + variation) * Math.PI) / 180;
lvx = shot_speed * Math.cos(rads);
lvy = shot_speed * Math.sin(rads);
lvl = getNextMineLevel();
proj = _root.addObj("proximity_mine", _root.mine_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = ((hero._x + hero.sight._x) + lvx) + _root.hero.vx;
proj._y = ((hero._y + hero.sight._y) + lvy) + _root.hero.vy;
mines.push(proj);
}
function placeBlood(x, y) {
if (_root.age >= 17) {
playSound("blood_splat.wav");
lvl = getNextCraterLevel();
temp = _root.addObj("crater2", _root.ground.crater_layer, lvl);
temp._x = x;
temp._y = y;
temp._rotation = random(360);
}
}
function placeDeadBody(btype, x, y, vx) {
lvl = getNextDebrisLevel();
temp = _root.addObj(btype, _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
if (vx > 0) {
temp._xscale = -100;
}
}
function placeEnemy(etype, x, y, vx, vy) {
trace("Placing enemy specific location!!!!!!!");
lvl = getNextEnemyLevel();
temp = _root.addObj(etype, _root.enemy_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = vx;
temp.vy = vy;
registerEnemy(temp);
return(temp);
}
function placeOfficeEnemy(etype, x, y, vx, vy) {
trace("Placing enemy at office");
lvl = getNextBGEnemyLevel();
temp = _root.addObj(etype, _root.enemybg_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = vx;
temp.vy = vy;
registerEnemy(temp);
return(temp);
}
function placeEnemyFG(etype, x, y, vx, vy) {
lvl = getNextEnemyFGLevel();
temp = _root.addObj(etype, _root.enemyfg_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = vx;
temp.vy = vy;
registerEnemy(temp);
return(temp);
}
function registerEnemy(ene) {
enemies.push(ene);
_root.enemy_count = _root.enemies.length;
}
function getNextBGEnemyLevel() {
if ((enemybg_lvl++) > 20) {
enemybg_lvl = 1;
}
return(enemybg_lvl);
}
function getNextEnemyFGLevel() {
if ((enemyfg_lvl++) > 20) {
enemyfg_lvl = 1;
}
return(enemyfg_lvl);
}
function getNextMineLevel() {
if ((mine_lvl++) > 10) {
mine_lvl = 1;
}
return(mine_lvl);
}
function getNextRocketLevel() {
if ((rocket_lvl++) > 6) {
rocket_lvl = 1;
}
return(rocket_lvl);
}
function getNextProjectileLevel() {
if ((proj_lvl++) > 15) {
proj_lvl = 1;
}
return(proj_lvl);
}
function getNextPowerUpLevel() {
if ((powerup_lvl++) > 5) {
powerup_lvl = 1;
}
return(powerup_lvl);
}
function getNextObstructionLevel() {
if ((obs_lvl++) > 10) {
obs_lvl = 1;
}
return(obs_lvl);
}
function getNextDebrisLevel() {
if ((debris_lvl++) > 15) {
debris_lvl = 1;
}
return(debris_lvl);
}
function getNextBombLevel() {
if ((bomb_lvl++) > 10) {
bomb_lvl = 1;
}
return(bomb_lvl);
}
function getNextBloodLevel() {
if ((b_drop_lvl++) > 10) {
b_drop_lvl = 1;
}
return(b_drop_lvl);
}
function getNextSmokeLevel() {
if ((smoke_lvl++) > 40) {
smoke_lvl = 1;
}
return(smoke_lvl);
}
function getNextCraterLevel() {
if ((crater_lvl++) > 6) {
crater_lvl = 1;
}
return(crater_lvl);
}
function getNextEnemyLevel() {
if ((enemy_lvl++) > 20) {
enemy_lvl = 1;
}
return(enemy_lvl);
}
function getNextFlameLevel() {
if ((flame_lvl++) > 7) {
flame_lvl = 1;
}
return(flame_lvl);
}
function getNextEnemyBulletLevel() {
if ((enemy_bullet_lvl++) > 20) {
enemy_bullet_lvl = 1;
}
return(enemy_bullet_lvl);
}
function placeSmoke(x, y) {
lvl = getNextSmokeLevel();
temp = _root.addObj("smoke", _root.smoke_layer, lvl);
temp._x = x;
temp._y = y;
}
function addGrenadeExplosion(x, y) {
dmg = 10;
radius = 60;
addExplosion(x, y, radius, dmg);
}
function getDist(x1, y1, x2, y2) {
dx = x1 - x2;
dy = y1 - y2;
return(Math.sqrt((dx * dx) + (dy * dy)));
}
function addDebrisExplosionType(x, y, amt, dtype) {
i = 0;
while (i < amt) {
lvl = getNextDebrisLevel();
temp = _root.addObj(dtype, _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = (random(100) - random(100)) / 50;
temp.vy = (random(100) - random(100)) / 50;
i++;
}
}
function addExplosionType(x, y, radius, dmg, dtype) {
playSound("bomb_hit.wav");
lvl = getNextCraterLevel();
temp = _root.addObj("crater1", _root.ground.crater_layer, lvl);
temp._x = x;
temp._y = y;
temp._rotation = random(360);
lvl = getNextDebrisLevel();
temp = _root.addObj("explosion", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp._xscale = (temp._yscale = radius);
deb = Math.ceil(radius / 40);
i = 0;
while (i < deb) {
lvl = getNextDebrisLevel();
temp = _root.addObj(dtype, _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = (random(100) - random(100)) / 50;
temp.vy = ((-random(100)) / 50) - 2;
i++;
}
for (i in _root.enemies) {
ene = enemies[i];
dx = ene._x - x;
dy = (ene._y - 20) - y;
dist = getDist(x, y, ene._x, ene._y - 25);
if (dist < radius) {
ene.deathCode = "exploded";
impact = Math.ceil((dmg * (radius - dist)) / radius);
ene.explosion_impact = impact;
ene.explosion_dx = (((-dx) / dist) * impact) * 0.4;
ene.explosion_dy = (((-dy) / dist) * impact) * 0.4;
ene.takeDamage(impact, ene._x, ene._y, vx, vy);
}
}
for (i in _root.obstructions) {
obs = obstructions[i];
dist = getDist(x, y, obs._x, obs._y);
if (dist < radius) {
obs.leaking = obs.leaking + (random(10) / 10);
obs.deathCode = "exploded";
obs.explosion_dist = -dx;
}
}
for (i in _root.mines) {
obs = mines[i];
dist = getDist(x, y, obs._x, obs._y);
if (dist < radius) {
obs.leaking = obs.leaking + (2 + (random(10) / 10));
obs.deathCode = "exploded";
}
}
dx = _root.hero._x - x;
dy = (_root.hero._y - 20) - y;
dist = getDist(x, y, _root.hero._x, _root.hero._y - 20);
if (dist < radius) {
_root.hero._y = _root.hero._y - 2;
impact = Math.ceil((dmg * (radius - dist)) / radius);
fly = impact;
if (impact > 15) {
fly = 15;
}
_root.hero.vx = (((-dx) / dist) * fly) * 0.33;
_root.hero.vy = (((-dy) / dist) * fly) * 0.33;
_root.addBloodExplosion(_root.hero._x, _root.hero._y - 20);
_root.hero.takeDamage(impact);
}
}
function addExplosion(x, y, radius, dmg) {
playSound("bomb_hit.wav");
lvl = getNextCraterLevel();
temp = _root.addObj("crater1", _root.ground.crater_layer, lvl);
temp._x = x;
temp._y = y;
temp._rotation = random(360);
lvl = getNextDebrisLevel();
temp = _root.addObj("explosion", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp._xscale = (temp._yscale = radius);
deb = Math.ceil(radius / 40);
i = 0;
while (i < deb) {
lvl = getNextDebrisLevel();
temp = _root.addObj("debris1", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = (random(100) - random(100)) / 50;
temp.vy = ((-random(100)) / 50) - 2;
i++;
}
for (i in _root.enemies) {
ene = enemies[i];
dx = ene._x - x;
dy = (ene._y - 20) - y;
dist = getDist(x, y, ene._x, ene._y - 25);
if (dist < radius) {
ene.deathCode = "exploded";
impact = Math.ceil((dmg * (radius - dist)) / radius);
ene.explosion_impact = impact;
ene.explosion_dx = (((-dx) / dist) * impact) * 0.4;
ene.explosion_dy = (((-dy) / dist) * impact) * 0.4;
ene.takeDamage(impact, ene._x, ene._y, vx, vy);
}
}
for (i in _root.obstructions) {
obs = obstructions[i];
dist = getDist(x, y, obs._x, obs._y);
if (dist < radius) {
obs.leaking = obs.leaking + (random(10) / 10);
obs.deathCode = "exploded";
obs.explosion_dist = -dx;
}
}
for (i in _root.mines) {
obs = mines[i];
dist = getDist(x, y, obs._x, obs._y);
if (dist < radius) {
obs.leaking = obs.leaking + (2 + (random(10) / 10));
obs.deathCode = "exploded";
}
}
dx = _root.hero._x - x;
dy = (_root.hero._y - 20) - y;
dist = getDist(x, y, _root.hero._x, _root.hero._y - 20);
if (dist < radius) {
_root.hero._y = _root.hero._y - 2;
impact = Math.ceil((dmg * (radius - dist)) / radius);
fly = impact;
if (impact > 15) {
fly = 15;
}
_root.hero.vx = (((-dx) / dist) * fly) * 0.33;
_root.hero.vy = (((-dy) / dist) * fly) * 0.33;
_root.addBloodExplosion(_root.hero._x, _root.hero._y - 20);
_root.hero.takeDamage(impact);
}
}
function addBloodExplosion(x, y) {
if (_root.age >= 17) {
placeBlood(x, y + 20);
c = 0;
while (c < 10) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
dx = (random(10) - random(10)) + 1;
dy = (random(10) - random(10)) + 1;
dist = Math.sqrt((dx * dx) + (dy * dy));
power = (random(150) + 25) / 50;
blood._x = x;
blood._y = y;
blood.vx = (dx / dist) * power;
blood.vy = (dy / dist) * power;
blood._xscale = (blood._yscale = 200 + random(200));
c++;
}
}
}
function addBloodExplosionAmt(x, y, amt) {
if (_root.age >= 17) {
c = 0;
while (c < amt) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
dx = (random(10) - random(10)) + 1;
dy = (random(10) - random(10)) + 1;
dist = Math.sqrt((dx * dx) + (dy * dy));
power = (random(150) + 25) / 50;
blood._x = x;
blood._y = y;
blood.vx = (dx / dist) * power;
blood.vy = (dy / dist) * power;
blood._xscale = (blood._yscale = 200 + random(200));
c++;
}
}
}
function addBloodyStump(x, y, vx, vy) {
lvl = getNextDebrisLevel();
temp = _root.addObj("blood_stump", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = vx;
temp.vy = vy;
}
function addFemBloodyStump(x, y, vx, vy) {
lvl = getNextDebrisLevel();
temp = _root.addObj("blood_stump_fem", _root.debris_layer, lvl);
temp._x = x;
temp._y = y;
temp.vx = vx;
temp.vy = vy;
}
function addObj(obj, layer, lvl) {
temp = layer.attachMovie(obj, (obj + "_id_") + lvl, lvl);
return(temp);
}
function addSplash(x, y) {
lvl = getNextDebrisLevel();
playSound("splash2.wav");
splash = addObj("bullet_water_splash", _root.debris_layer, lvl);
splash._x = x;
splash._y = y;
}
function inSameSection(xpos) {
code = getSectionCode(xpos);
return(_root.heroSectionCode == code);
}
function getSectionCode(xpos) {
if (xpos < s_half) {
if (xpos < s_quart) {
return(1);
}
return(2);
}
if (xpos < (s_half + s_quart)) {
return(3);
}
return(4);
}
function getDistToNextPart(xpos, vx) {
amt = xpos % s_quart;
if (vx > 0) {
return(s_quart - amt);
}
return(amt);
}
function resetObs() {
temp = addObj("obs_aircond", _root.obsfg_layer, 1);
temp._x = ac_1._x;
temp._y = ac_1._y;
temp = addObj("obs_aircond", _root.obsfg_layer, 2);
temp._x = ac_2._x;
temp._y = ac_2._y;
temp = addObj("obs_aircond", _root.obsfg_layer, 3);
temp._x = ac_3._x;
temp._y = ac_3._y;
temp = addObj("obs_aircond", _root.obsfg_layer, 4);
temp._x = ac_4._x;
temp._y = ac_4._y;
temp = addObj("obs_aircond", _root.obsfg_layer, 5);
temp._x = ac_5._x;
temp._y = ac_5._y;
temp = addObj("obs_aircond", _root.obsfg_layer, 6);
temp._x = ac_6._x;
temp._y = ac_6._y;
}
function cleanUp() {
i = 1;
while (i <= 20) {
addObj("cleaner", _root.debris_layer, i);
i++;
}
i = 1;
while (i <= 7) {
addObj("cleaner", _root.flame_layer, i);
i++;
}
i = 1;
while (i <= 15) {
addObj("cleaner", _root.projectile_layer, i);
i++;
}
}
function changeSound() {
g_soundOn = !g_soundOn;
if (g_soundOn) {
g_soundText = "on";
} else {
g_soundText = "off";
}
}
stop();
KEY_W = 87;
KEY_E = 69;
KEY_Q = 81;
KEY_A = 65;
KEY_S = 83;
KEY_D = 68;
KEY_X = 67;
KEY_C = 88;
KEY_J = 74;
KEY_K = 75;
KEY_L = 76;
KEY_U = 85;
KEY_UP = 38;
KEY_RIGHT = 39;
KEY_DOWN = 40;
KEY_LEFT = 37;
KEY_R = 82;
_root.demo_shot = 0;
KEY_SPACEBAR = 32;
KEY_LEFTCONTROL = 17;
g_width = 728;
g_ground = 400;
bullet_ground = 360;
paused = false;
_root.age = 2;
_root.gameType = "progressive";
end_text = "Nice shooting!";
LEVEL_DISPLAY = 7;
HELP_NUM = 6;
SCORES = 4;
NAMER = 5;
GAMEOVER_NUM = 3;
UG_LAYER = 1;
top_scores_screen = null;
help_screen = null;
namer_screen = null;
game_over_screen1 = null;
_root.place_score_1 = 300;
_root.place_score_2 = 200;
_root.place_score_3 = 100;
_root.place_name_1 = "Jax";
_root.place_name_2 = "Matrox";
_root.place_name_3 = "Razor";
_root.player_name = "noob";
myLocalSO = sharedobject.getLocal("gm02");
if (myLocalSO.data.place_score_1 != null) {
trace("Shared Object Data Found... loading data");
place_score_1 = myLocalSO.data.highScore;
_root.place_score_1 = myLocalSO.data.place_score_1;
_root.place_score_2 = myLocalSO.data.place_score_2;
_root.place_score_3 = myLocalSO.data.place_score_3;
_root.place_name_1 = myLocalSO.data.place_name_1;
_root.place_name_2 = myLocalSO.data.place_name_2;
_root.place_name_3 = myLocalSO.data.place_name_3;
_root.player_name = myLocalSO.data.player_name;
paused = false;
} else {
trace("no object found... loading default data");
_root.first_time_playing = true;
_root.place_score_1 = 300;
_root.place_score_2 = 200;
_root.place_score_3 = 100;
_root.place_name_1 = "Jax";
_root.place_name_2 = "Matrox";
_root.place_name_3 = "Razor";
_root.player_name = "noob";
_root.paused = true;
openNamer();
openHelp();
}
g_lvl_kills = 0;
ammo_grenades = 15;
ammo_arrows = 25;
ammo_bullets = 500;
ammo_rockets = 10;
ammo_prox_mines = 20;
ammo_shells = 20;
ammo_rpg = 8;
score = 0;
level = 1;
game_ended = false;
resetGame();
gravity = 0.07;
gun_wild = 0;
aim_rate = 0;
shooting_mode = "gun";
obstructions = new Array();
structures = new Array();
mines = new Array();
max_enemies_on_screen = 4;
enemy_count = 0;
rocket_smoke = 0;
rocket_flame = 0;
last_throw = false;
enemies = new Array();
someListener = new Object();
someListener.onMouseDown = function () {
_root.firing = true;
};
Mouse.addListener(someListener);
someListener2 = new Object();
someListener2.onMouseUp = function () {
_root.firing = false;
};
Mouse.addListener(someListener2);
powerups = new Array("ammo_health", "gas_can", "ammo_gun", "ammo_grenade", "ammo_rocket", "ammo_shotgun", "ammo_rpg_crate", "ammo_prox_mine");
hurtsounds = new Array("oreh.wav", "uh.wav", "oof.wav");
enemybg_lvl = 1;
enemyfg_lvl = 1;
mine_lvl = 1;
rocket_lvl = 1;
proj_lvl = 1;
powerup_lvl = 1;
obs_lvl = 1;
debris_lvl = 1;
bomb_lvl = 1;
b_drop_lvl = 1;
smoke_lvl = 1;
crater_lvl = 1;
enemy_lvl = 1;
flame_lvl = 1;
enemy_bullet_lvl = 1;
s_half = 364;
s_quart = 182;
_root.heroSectionCode = 1;
g_soundOn = true;
g_soundText = "on";
Instance of Symbol 405 MovieClip in Frame 2
/* no clip actions */
Instance of Symbol 407 MovieClip in Frame 2
/* no clip actions */
Instance of Symbol 428 MovieClip in Frame 2
onClipEvent (load) {
}
Instance of Symbol 440 MovieClip "tower_left" in Frame 2
onClipEvent (load) {
}
Instance of Symbol 449 MovieClip in Frame 2
onClipEvent (load) {
}
Instance of Symbol 450 MovieClip "tower_right" in Frame 2
onClipEvent (load) {
}
Instance of Symbol 452 MovieClip in Frame 2
onClipEvent (load) {
_root.structures.push(this);
_alpha = 0;
}
Instance of Symbol 452 MovieClip in Frame 2
onClipEvent (load) {
_root.structures.push(this);
_alpha = 0;
}
Instance of Symbol 452 MovieClip in Frame 2
onClipEvent (load) {
_root.structures.push(this);
_alpha = 0;
}
Instance of Symbol 452 MovieClip in Frame 2
onClipEvent (load) {
_root.structures.push(this);
_alpha = 0;
}
Instance of Symbol 452 MovieClip in Frame 2
onClipEvent (load) {
_root.structures.push(this);
_alpha = 0;
}
Instance of Symbol 452 MovieClip in Frame 2
onClipEvent (load) {
_root.structures.push(this);
_alpha = 0;
}
Instance of Symbol 518 MovieClip in Frame 2
onClipEvent (enterFrame) {
frame = 1;
if (_root.hero.hp < 0) {
frame = 100;
} else {
frame = (100 - _root.hero.hp) + 1;
}
gotoAndStop(frame);
}
Instance of Symbol 571 MovieClip in Frame 2
onClipEvent (load) {
midx = _root.g_width / 2;
midy = _root.g_ground / 2;
}
onClipEvent (enterFrame) {
if (_root.paused) {
_x = midx;
_y = midy;
} else {
_x = -999;
}
}
Instance of Symbol 402 MovieClip [game_over_screen] in Frame 2
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 384 MovieClip [help_screen] in Frame 2
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 354 MovieClip [namer_screen] in Frame 2
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 349 MovieClip [top_scores] in Frame 2
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 335 MovieClip [bullet_water_splash] in Frame 2
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 593 MovieClip in Frame 2
on (release) {
_root.changeSound();
}
Instance of Symbol 122 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 596 MovieClip "stepper" in Frame 2
onClipEvent (load) {
function getNextEnemy() {
lvl = (_root.level - 1) % cur_mode.length;
game_set = cur_mode[lvl];
return(game_set[random(game_set.length)]);
}
function resetStepperVars() {
timeToNextEnemy = 100 + random(100);
timeToNextBomber = 200 + random(100);
timeToNextChopper = 300 + random(100);
timeToNextSniper = 400 + random(100);
wave_count = 0;
bomber_wave_count = 0;
chopper_wave_count = 0;
sniper_wave_count = 0;
timeToNextDrop = 0;
}
function addGlassEnemy() {
count = 0;
found = false;
ndx = random(windows.length);
do {
nextWindow = windows[ndx];
found = nextWindow.enemyDead;
ndx++;
} while ((!found) && ((count++) < 8));
if (found) {
nextWindow.addGlass();
ene = _root.placeOfficeEnemy("enemy_sniper_office", nextWindow._x, nextWindow._y + 10, 0, 0);
ene.myWindow = nextWindow;
}
}
function addEnemyCar() {
_root.placeEnemyFG("enemy_car", -20, 330, 1.5, 0);
}
function addEnemyTank() {
if (random(2) == 0) {
_root.placeEnemy("enemy_tank", -20, 330, 0.5, 0);
} else {
_root.placeEnemy("enemy_tank", _root.g_width + 20, 330, -0.5, 0);
}
}
function switchGameModes() {
if (_root.gameType == "progressive") {
_root.gameType = "all";
cur_mode = all_mode;
} else {
_root.gameType = "progressive";
cur_mode = progressive_mode;
}
}
timeToNextEnemy = 0;
timeToNextBomber = 0;
timeToNextChopper = 0;
timeToNextSniper = 0;
sniper_wave_count = 0;
wave_count = 0;
bomber_wave_count = 0;
chopper_wave_count = 0;
timeForGlassEnemy = 9999;
level01 = new Array("enemy1");
level02 = new Array();
i = 0;
while (i < 80) {
level02.push("enemy1");
i++;
}
i = 0;
while (i < 10) {
level02.push("enemy_drop");
i++;
}
i = 0;
while (i < 8) {
level02.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level02.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level02.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level02.push("enemy_a10");
i++;
}
i = 0;
while (i < 10) {
level02.push("enemy_sniper_office");
i++;
}
level03 = new Array();
i = 0;
while (i < 70) {
level03.push("enemy1");
i++;
}
i = 0;
while (i < 20) {
level03.push("enemy_drop");
i++;
}
i = 0;
while (i < 8) {
level03.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level03.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level03.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level03.push("enemy_a10");
i++;
}
level04 = new Array();
i = 0;
while (i < 60) {
level04.push("enemy1");
i++;
}
i = 0;
while (i < 30) {
level04.push("enemy_drop");
i++;
}
i = 0;
while (i < 20) {
level04.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 10) {
level04.push("enemy_chopper");
i++;
}
i = 0;
while (i < 5) {
level04.push("enemy_bomber");
i++;
}
i = 0;
while (i < 3) {
level04.push("enemy_a10");
i++;
}
level05 = new Array();
i = 0;
while (i < 6) {
level05.push("enemy1");
i++;
}
i = 0;
while (i < 6) {
level05.push("enemy_drop");
i++;
}
i = 0;
while (i < 3) {
level05.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 2) {
level05.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level05.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level05.push("enemy_a10");
i++;
}
level06 = new Array();
i = 0;
while (i < 3) {
level06.push("enemy1");
i++;
}
i = 0;
while (i < 10) {
level06.push("enemy_drop");
i++;
}
i = 0;
while (i < 5) {
level06.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 2) {
level06.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level06.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level06.push("enemy_a10");
i++;
}
level07 = new Array();
i = 0;
while (i < 2) {
level07.push("enemy1");
i++;
}
i = 0;
while (i < 10) {
level07.push("enemy_drop");
i++;
}
i = 0;
while (i < 10) {
level07.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 5) {
level07.push("enemy_chopper");
i++;
}
i = 0;
while (i < 3) {
level07.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level07.push("enemy_a10");
i++;
}
level08 = new Array();
i = 0;
while (i < 1) {
level08.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level08.push("enemy_drop");
i++;
}
i = 0;
while (i < 1) {
level08.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 5) {
level08.push("enemy_chopper");
i++;
}
i = 0;
while (i < 2) {
level08.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level08.push("enemy_a10");
i++;
}
level09 = new Array();
i = 0;
while (i < 1) {
level09.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level09.push("enemy_drop");
i++;
}
i = 0;
while (i < 1) {
level09.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 6) {
level09.push("enemy_chopper");
i++;
}
i = 0;
while (i < 3) {
level09.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level09.push("enemy_a10");
i++;
}
level10 = new Array();
i = 0;
while (i < 1) {
level10.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level10.push("enemy_drop");
i++;
}
i = 0;
while (i < 1) {
level10.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 6) {
level10.push("enemy_chopper");
i++;
}
i = 0;
while (i < 5) {
level10.push("enemy_bomber");
i++;
}
i = 0;
while (i < 3) {
level10.push("enemy_a10");
i++;
}
level11 = new Array();
i = 0;
while (i < 1) {
level11.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level11.push("enemy_drop");
i++;
}
i = 0;
while (i < 1) {
level11.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level11.push("enemy_chopper");
i++;
}
i = 0;
while (i < 5) {
level11.push("enemy_bomber");
i++;
}
i = 0;
while (i < 4) {
level11.push("enemy_a10");
i++;
}
level12 = new Array();
i = 0;
while (i < 0) {
level12.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level12.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level12.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 0) {
level12.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level12.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level12.push("enemy_a10");
i++;
}
level13 = new Array();
i = 0;
while (i < 0) {
level13.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level13.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level13.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level13.push("enemy_chopper");
i++;
}
i = 0;
while (i < 0) {
level13.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level13.push("enemy_a10");
i++;
}
level14 = new Array();
i = 0;
while (i < 1) {
level14.push("enemy1");
i++;
}
i = 0;
while (i < 1) {
level14.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level14.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 0) {
level14.push("enemy_chopper");
i++;
}
i = 0;
while (i < 0) {
level14.push("enemy_bomber");
i++;
}
level15 = new Array();
i = 0;
while (i < 0) {
level15.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level15.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level15.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level15.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level15.push("enemy_bomber");
i++;
}
i = 0;
while (i < 1) {
level15.push("enemy_a10");
i++;
}
level16 = new Array();
i = 0;
while (i < 1) {
level16.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level16.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level16.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 0) {
level16.push("enemy_chopper");
i++;
}
i = 0;
while (i < 0) {
level16.push("enemy_bomber");
i++;
}
level17 = new Array();
i = 0;
while (i < 1) {
level17.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level17.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level17.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 1) {
level17.push("enemy_chopper");
i++;
}
i = 0;
while (i < 0) {
level17.push("enemy_bomber");
i++;
}
level18 = new Array();
i = 0;
while (i < 1) {
level18.push("enemy1");
i++;
}
i = 0;
while (i < 0) {
level18.push("enemy_drop");
i++;
}
i = 0;
while (i < 0) {
level18.push("enemy_drop_sniper");
i++;
}
i = 0;
while (i < 0) {
level18.push("enemy_chopper");
i++;
}
i = 0;
while (i < 1) {
level18.push("enemy_bomber");
i++;
}
game_levels = new Array(level01, level02, level03, level04, level05, level06, level07, level08, level09, level10, level11, level12, level13, level14, level15, level16, level17, level18);
progressive_mode = game_levels;
all_mode = new Array(new Array("enemy_a10", "enemy_sniper_office", "enemy_drop", "enemy1", "enemy_bomber", "enemy_car", "enemy_chopper", "enemy_tank"));
cur_mode = progressive_mode;
timeToNextDrop = 0;
resetStepperVars();
windows = new Array(_root.w1, _root.w2, _root.w3, _root.w4, _root.w5, _root.w6, _root.w7, _root.w8);
}
onClipEvent (enterFrame) {
_root.elapsed = getTimer() - _root.prev_time;
_root.time_count = _root.time_count + _root.elapsed;
_root.prev_time = getTimer();
_root.frame_count++;
if (_root.time_count > 333) {
_root.time_count = 0;
_root.fps = _root.frame_count * 3;
_root.frame_count = 0;
}
if ((((timeToNextDrop--) <= 0) && (!_root.paused)) && (_root.enemy_count < _root.max_enemies_on_screen)) {
ene_type = getNextEnemy();
if (ene_type == "enemy_bomber") {
if (random(2) == 0) {
_root.placeEnemy("enemy_bomber", -44, random(100) + 20, 1 + (_root.level * 0.02), 0);
} else {
_root.placeEnemy("enemy_bomber", _root.g_width + 44, random(100) + 20, -1 - (_root.level * 0.02), 0);
}
timeToNextDrop = random(200) + 200;
} else if (ene_type == "enemy_chopper") {
if (random(2) == 0) {
ene = _root.placeEnemy("enemy_chopper", -20, -10, 0, 0);
ene._xscale = -100;
} else {
ene = _root.placeEnemy("enemy_chopper", _root.g_width + 20, -10, 0, 0);
ene._xscale = 100;
}
timeToNextDrop = random(200) + 100;
} else if (ene_type == "enemy_a10") {
if (random(2) == 0) {
_root.placeEnemy("enemy_a10", -44, random(100) + 20, 1.75, 0.1);
} else {
_root.placeEnemy("enemy_a10", _root.g_width + 44, random(100) + 20, -1.75, 0.1);
}
timeToNextDrop = random(200) + 200;
} else if (ene_type == "enemy_drop_sniper") {
if (random(2) == 0) {
_root.placeEnemy("enemy_drop_sniper", _root.tower_left._x, -10, 0, 0);
} else {
_root.placeEnemy("enemy_drop_sniper", _root.tower_right._x, -10, 0, 0);
}
timeToNextDrop = random(100) + 50;
} else if (ene_type == "enemy_drop") {
_root.placeEnemy("enemy_drop", ((_root.g_width / 2) + random(300)) - random(300), -10, 0, 0);
timeToNextDrop = random(200) + 25;
} else if (ene_type == "enemy_sniper_office") {
addGlassEnemy();
timeToNextDrop = random(200) + 25;
} else if (ene_type == "enemy_car") {
addEnemyCar();
timeToNextDrop = random(200) + 25;
} else if (ene_type == "enemy_tank") {
addEnemyTank();
timeToNextDrop = random(200) + 25;
} else {
if (random(2) == 0) {
_root.placeEnemy("enemy1", -20, _root.g_ground - 50, 0, 0);
} else {
_root.placeEnemy("enemy1", _root.g_width + 20, _root.g_ground - 50, 0, 0);
}
timeToNextDrop = random(100) + 50;
}
}
if (_root.g_lvl_kills >= 20) {
_root.g_lvl_kills = 0;
_root.level++;
_root.showLevelDisplay();
}
if ((_root.fps_ticker++) > 50) {
if (_root.fps < _root.min_fps) {
_root.min_fps = _root.fps;
}
if (_root.fps > _root.max_fps) {
_root.max_fps = _root.fps;
}
_root.fps_ticks++;
_root.fps_total = _root.fps_total + _root.fps;
_root.avg_fps = _root.fps_total / _root.fps_ticks;
}
if ((_root.gameOver() && (!_root.game_ended)) && ((endDelay++) > 100)) {
_root.game_ended = true;
_root.endGame();
}
_root.enemy_count = _root.enemies.length;
_root.mine_count = _root.mines.length;
updateAfterEvent();
}
Instance of Symbol 332 MovieClip [enemy_bomb_drop] in Frame 2
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 605 MovieClip "cross_hair" in Frame 2
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}
Instance of Symbol 217 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 607 MovieClip in Frame 2
/* no clip actions */
Instance of Symbol 639 MovieClip in Frame 2
onClipEvent (load) {
_root.paused = true;
_x = (_root.g_width / 2);
_y = (_root.g_ground / 2);
}
Symbol 28 MovieClip [enemy_bomb_drop_napalm] Frame 1
function step() {
vy = vy + (_root.gravity / 5);
_x = (_x + vx);
_y = (_y + vy);
xpos = _x;
ypos = _y;
_rotation = (_rotation + rotFactor);
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
_root.removeEnemy(this);
}
if ((_y > 200) || (hp <= 0)) {
hitstruct = false;
if ((_y > 200) && (_y < 260)) {
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
}
if ((hitstruct || (hp <= 0)) || (_y > ground_spot)) {
_root.addExplosionType(_x, _y, 110, 1, "debris_flame");
this.unloadMovie();
}
}
}
function takeDamage(amt, x, y, vx, vy) {
hp = hp - amt;
}
hp = 1;
xpos = _x;
ypos = _y;
xmax = _root.g_width + 100;
ymax = _root.g_ground + 50;
xmin = -100;
ymin = -10;
ground_spot = _root.bullet_ground - 40;
if (vx < 0) {
_xscale = -100;
}
if (vx > 0) {
rotFactor = 0.3;
} else {
rotFactor = -0.3;
}
Instance of Symbol 27 MovieClip in Symbol 28 MovieClip [enemy_bomb_drop_napalm] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 31 MovieClip Frame 7
this.unloadMovie();
Symbol 34 MovieClip Frame 20
this.unloadMovie();
Symbol 36 MovieClip [enemy_rocket] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
placeSmoke();
if ((((_x < xmin) || (_x > xmax)) || (_y < ymin)) || (_y > ymax)) {
this.unloadMovie();
}
testHitObstructions();
testHitHero();
}
function testHitObstructions() {
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_y > ground_spot)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
}
function testHitHero() {
if (_root.hero.hitbox.hitTest(_x, _y, 0)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment", "segment_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
xmax = _root.g_width + 20;
xmin = -20;
ymax = _root.g_ground + 20;
ymin = -20;
radius = 40;
dmg = 30;
xmark = _x;
ymark = _y;
timeToMark = 0;
ground_spot = _root.bullet_ground - 20;
Instance of Symbol 24 MovieClip "rocket" in Symbol 36 MovieClip [enemy_rocket] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 37 MovieClip [missile] Frame 1
function getTarget() {
minDist = 99999 /* 0x01869F */;
for (i in _root.enemies) {
temp_distx = _root.enemies[i].xpos - _x;
temp_disty = _root.enemies[i].ypos - _y;
temp_dist = Math.sqrt((temp_distx * temp_distx) + (temp_disty * temp_disty));
if ((temp_dist < minDist) && (_root.enemies[i].ypos > 0)) {
distx = temp_distx;
disty = temp_disty;
dist = temp_dist;
minDist = temp_dist;
target_enemy = _root.enemies[i];
target_enemy.locked_on = true;
}
}
_root.testball.targ = target_enemy;
target_acquired = true;
}
function step() {
placeSmoke();
dx = _root._xmouse - _x;
dy = _root._ymouse - _y;
dist = Math.sqrt((dx * dx) + (dy * dy));
vx = vx + ((g_missile_turn_rate * dx) / dist);
vy = vy + ((g_missile_turn_rate * dy) / dist);
normDist = Math.sqrt((vx * vx) + (vy * vy));
vx = (g_missile_speed * vx) / normDist;
vy = (g_missile_speed * vy) / normDist;
if (!flying) {
flying = true;
rocket.flame._alpha = 100;
}
prevDist = newDist;
newDist = dist;
if ((prevDist < newDist) && (!change_course)) {
change_course = true;
pass_count = 20;
} else if ((prevDist > newDist) && (change_course)) {
change_course = false;
}
trace("Pass count: " + pass_count);
radians = Math.atan(vy / vx);
if (vx == 0) {
radians = radians + Math.PI;
}
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
xprev = _x;
yprev = _y;
_x = (_x + vx);
_y = (_y + vy);
xcur = _x;
ycur = _y;
target_acquired = target_enemy.hp > 0;
testHitEnemies();
testHitObstructions();
if ((fuel--) < 0) {
_root.addSpark("spark", _x, _y, 10);
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 1)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (hitstruct || (_y > ground_spot)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
}
function testBlastRadius() {
hitCount = 0;
temp = _root.addObj("blast_animation", _root.debris_layer, _root.getNextDebrisLvl);
temp._x = _x;
temp._y = _y;
temp._xscale = (temp._yscale = 50);
_root.playSound("bomb.wav");
for (ndx in _root.enemies) {
distx = _root.enemies[ndx].xpos - _x;
disty = _root.enemies[ndx].ypos - _y;
range = Math.sqrt((distx * distx) + (disty * disty));
trace("Distance: " + range);
if (range < g_missile_blast_range) {
_root.enemies[ndx].takeDamage(g_missile_damage);
if ((hitCount++) > 2) {
break;
}
}
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment", "segment_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
function scan() {
minDist = 99999 /* 0x01869F */;
ndx = 0;
while ((ndx < _root.enemies.length) && (!blownUp)) {
if ((blownUp = _root.enemies[ndx].hitTest(_x, _y, 1))) {
trace("Boom");
}
ndx++;
}
}
fy = 40;
scan_time = 5;
blownUp = false;
flying = false;
adjustmentTime = 20;
g_missile_turn_rate = 0.6;
g_missile_speed = 6;
g_missile_blast_range = 50;
g_missile_damage = 200;
fuel = 600;
prevDist = 9999;
newDist = 9999;
dist = 0;
change_course = false;
pass_count = 0;
radius = 50;
dmg = 45;
ground_spot = _root.bullet_ground - 20;
xmark = _x;
ymark = _y;
timeToMark = 9999;
nextTarget = 5;
Instance of Symbol 24 MovieClip "rocket" in Symbol 37 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 40 MovieClip [hero_arrow_bomb] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting x and y: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
vy = vy + (_root.gravity * 2);
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitbox.hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
_root.addExplosion(_x, _y, range, dmg);
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
_root.addExplosion(_x, _y, range, dmg);
_root.placeDebrisArrow(_x, _y, _rotation);
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.addExplosion(_x, _y, range, dmg);
_root.placeDebrisArrow(_x, _y, _rotation);
this.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
range = 40;
dmg = 10;
Instance of Symbol 39 MovieClip in Symbol 40 MovieClip [hero_arrow_bomb] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 43 MovieClip [debris_flame] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting x and y: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
vy = vy + (_root.gravity * 2);
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
ene = _root.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
if (ene.etype == "troop") {
_root.enemies[i].takeDamage(1000, _x, _y, vx, vy);
_root.playHitEnemySound();
} else {
this.unloadMovie();
}
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
temp = _root.addObj("napalm_flame", _root.flame_layer, _root.getNextFlameLevel());
temp._x = _x;
temp._y = _y;
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
this.unloadMovie();
}
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment_arrow", "segment_arrow_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
xmax = _root.g_width + 10;
ymax = 340;
range = 40;
dmg = 10;
Instance of Symbol 42 MovieClip in Symbol 43 MovieClip [debris_flame] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 44 MovieClip [hero_arrow] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting x and y: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
vy = vy + (_root.gravity * 2);
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
placeSmoke();
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
ene = _root.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
if (ene.etype == "troop") {
_root.enemies[i].takeDamage(1000, _x, _y, vx, vy);
_root.playHitEnemySound();
} else {
this.unloadMovie();
}
}
}
}
function testHitObstructions() {
if (_y > _root.bullet_ground) {
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.placeDebrisArrow(_x, _y, _rotation);
this.unloadMovie();
}
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment_arrow", "segment_arrow_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
range = 40;
dmg = 10;
Instance of Symbol 39 MovieClip in Symbol 44 MovieClip [hero_arrow] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 53 MovieClip Frame 1
stop();
Instance of Symbol 58 MovieClip in Symbol 59 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 60 MovieClip [enemy_tank] Frame 1
function step() {
xpos = _x;
ypos = _y;
frame = 60 - hp;
if (frame < 1) {
frame = 1;
}
frame = Math.floor(frame);
car_anim.gotoAndStop(frame);
if (!reached) {
_x = (_x + vx);
reached = ((vx < 0) && (_x < xspot)) || ((vx > 0) && (_x > xspot));
}
hp = hp - leaking;
if (hp < 0) {
_root.increaseScore(10, _x, _y);
_root.addExplosion(_x, _y, 20, 20);
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("tank_dead", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_root.removeEnemy(this);
}
if ((timeToShoot--) < 0) {
if (Math.abs(_x - _root.hero._x) > 200) {
shoot();
}
timeToShoot = 400;
}
}
function takeDamage(dmg, x, y, vx, vy) {
if (leaking <= 0) {
if (weakspot.hitTest(x, y, 0)) {
_root.increaseScore(10, _x, _y);
leaking = 0.05;
_root.addExplosion(x, y, 5, 5);
}
}
trace("Taking Damage!!!!!!!!!!!!!!!!!!");
trace("Damage: " + dmg);
hp = hp - dmg;
_root.playSound("ching1.wav");
spark_amt = random(2);
c = 0;
while (c < spark_amt) {
blood = _root.addObj("debris2", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 50 + random(100));
c++;
}
xnew = x - _x;
ynew = y - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _root.addObj("bullet_hole2", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function shoot() {
_root.playSound("bomb_hit.wav");
dx = _root.hero._x - _x;
dy = (_root.hero._y - 10) - (_y - 20);
g = _root.gravity * 2;
if (dx < 0) {
lvx = -5;
} else {
lvx = 5;
}
t = (_root.hero._x - _x) / (lvx - _root.hero.vx);
lvy = (dy - (((0.5 * g) * t) * t)) / t;
proj = _root.addObj("tank_shell", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - 20;
}
function shootRocket() {
_root.playSound("shoot_rocket4.wav");
rocket = _root.addObj("enemy_rocket", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_root.level * 0.01));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
rocket.vy = Math.sin(radians) * shot_speed;
rocket.vx = Math.cos(radians) * shot_speed;
rocket._x = _x;
rocket._y = _y;
rocket._rotation = (radians * 180) / Math.PI;
}
target_elev = 50 + random(200);
hp = 60;
leaking = 0;
lift = -0.06;
shots = 0;
rocket_shots = 0;
timeToShoot = 400;
timeToShootRocket = 600;
xpos = 0;
ypos = 0;
reached = false;
xspot = random(100) + 50;
etype = "car";
clip_size = Math.floor(_root.level * 0.2);
if (clip_size > 5) {
clip_size = 5;
}
if (vx < 0) {
_xscale = -100;
xspot = (_root.g_width - 50) - random(50);
} else {
_xscale = 100;
xspot = 50 + random(50);
}
b_level = 1;
Instance of Symbol 53 MovieClip "car_anim" in Symbol 60 MovieClip [enemy_tank] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "hitbox" in Symbol 60 MovieClip [enemy_tank] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 60 MovieClip [enemy_tank] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 63 MovieClip Frame 1
stop();
Symbol 65 MovieClip [enemy_car] Frame 1
function step() {
xpos = _x;
ypos = _y;
frame = 20 - hp;
if (frame < 1) {
frame = 1;
}
frame = Math.floor(frame);
car_anim.gotoAndStop(frame);
_x = (_x + vx);
if (_x > 760) {
_root.removeEnemy(this);
}
hp = hp - leaking;
if (hp < 0) {
_root.increaseScore(10, _x, _y);
_root.addExplosion(_x, _y, 20, 20);
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("enemy_car_dead", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_root.removeEnemy(this);
}
}
function takeDamage(dmg, x, y, vx, vy) {
if (leaking <= 0) {
if (weakspot.hitTest(x, y, 0)) {
_root.increaseScore(10, _x, _y);
leaking = 0.05;
_root.addExplosion(x, y, 5, 5);
}
}
trace("Taking Damage!!!!!!!!!!!!!!!!!!");
trace("Damage: " + dmg);
hp = hp - dmg;
_root.playSound("ching1.wav");
spark_amt = random(2);
c = 0;
while (c < spark_amt) {
blood = _root.addObj("debris2", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 50 + random(100));
c++;
}
xnew = x - _x;
ynew = y - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _root.addObj("bullet_hole2", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function shoot() {
_root.playSound("tat3.wav");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 2.5 * (1 + (_root.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x;
bullet._y = _y;
bullet._rotation = (radians * 180) / Math.PI;
}
function shootRocket() {
_root.playSound("shoot_rocket4.wav");
rocket = _root.addObj("enemy_rocket", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_root.level * 0.01));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
rocket.vy = Math.sin(radians) * shot_speed;
rocket.vx = Math.cos(radians) * shot_speed;
rocket._x = _x;
rocket._y = _y;
rocket._rotation = (radians * 180) / Math.PI;
}
target_elev = 50 + random(200);
hp = 20;
leaking = 0;
lift = -0.06;
shots = 0;
rocket_shots = 0;
timeToShoot = 400;
timeToShootRocket = 600;
xpos = 0;
ypos = 0;
etype = "car";
clip_size = Math.floor(_root.level * 0.2);
if (clip_size > 5) {
clip_size = 5;
}
b_level = 1;
Instance of Symbol 63 MovieClip "car_anim" in Symbol 65 MovieClip [enemy_car] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "hitbox" in Symbol 65 MovieClip [enemy_car] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 65 MovieClip [enemy_car] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 67 MovieClip in Symbol 68 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 61);
}
Symbol 77 MovieClip [enemy_chopper] Frame 1
function step() {
xpos = _x;
ypos = _y;
if ((move_count++) > 100) {
move_count = 0;
if (_root.hero._x < _x) {
vx = -0.25;
} else {
vx = 0.25;
}
}
vy = vy + mygrav;
frame = 20 - hp;
if (frame < 1) {
frame = 1;
}
frame = Math.floor(frame);
chopper_anim.gotoAndStop(frame);
if (_y > target_elev) {
ydelt = lift;
} else {
ydelt = 0;
}
if (vy < -0.5) {
ydelt = -lift;
}
if (vy > 0.5) {
ydelt = lift;
}
vy = vy + ydelt;
_x = (_x + vx);
_y = (_y + vy);
if (hp < 5) {
lift = -0.02;
hitstruct = false;
if ((_y > 200) && (_y < 260)) {
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y, 1) || (hitstruct);
}
hp = hp - leaking;
if (bottom) {
_root.increaseScore(10, _x, _y);
_root.addExplosion(_x, _y, 60, 30);
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("chopper_dead", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
if (shots >= (1 + clip_size)) {
shots = 0;
timeToShoot = (400 + random(300)) - (_root.level * 5);
if (timeToShootRocket < 300) {
timeToShootRocket = 300;
}
} else {
shots++;
timeToShoot = 5;
}
shoot();
}
if (((timeToShootRocket--) <= 0) && (Math.abs(_root.hero._x - _x) > 200)) {
if (rocket_shots >= 1) {
rocket_shots = 0;
timeToShootRocket = (800 + random(400)) - (_root.level * 5);
if (timeToShootRocket < 500) {
timeToShootRocket = 500;
}
} else {
rocket_shots++;
timeToShootRocket = 10;
}
shootRocket();
}
}
function takeDamage(dmg, x, y, vx, vy) {
if (leaking <= 0) {
if (weakspot.hitTest(x, y, 0)) {
_root.increaseScore(10, _x, _y);
leaking = 0.05;
_root.addExplosion(x, y, 15, 5);
}
}
trace("Taking Damage!!!!!!!!!!!!!!!!!!");
trace("Damage: " + dmg);
hp = hp - dmg;
_root.playSound("ching1.wav");
spark_amt = random(2);
c = 0;
while (c < spark_amt) {
blood = _root.addObj("debris2", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 50 + random(100));
c++;
}
xnew = x - _x;
ynew = y - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _root.addObj("bullet_hole2", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function shoot() {
_root.playSound("tat3.wav");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 2.5 * (1 + (_root.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x;
bullet._y = _y;
bullet._rotation = (radians * 180) / Math.PI;
}
function shootRocket() {
_root.playSound("shoot_rocket4.wav");
rocket = _root.addObj("enemy_rocket", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_root.level * 0.01));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
rocket.vy = Math.sin(radians) * shot_speed;
rocket.vx = Math.cos(radians) * shot_speed;
rocket._x = _x;
rocket._y = _y;
rocket._rotation = (radians * 180) / Math.PI;
}
target_elev = 50 + random(200);
hp = 20;
leaking = 0;
lift = -0.06;
shots = 0;
rocket_shots = 0;
timeToShoot = 400;
timeToShootRocket = 600;
mygrav = 0.05;
xpos = 0;
ypos = 0;
etype = "chopper";
clip_size = Math.floor(_root.level * 0.2);
if (clip_size > 5) {
clip_size = 5;
}
b_level = 1;
Instance of Symbol 75 MovieClip "chopper_anim" in Symbol 77 MovieClip [enemy_chopper] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "hitbox" in Symbol 77 MovieClip [enemy_chopper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 77 MovieClip [enemy_chopper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 103 MovieClip in Symbol 104 MovieClip Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
Symbol 105 MovieClip Frame 65
stop();
Symbol 106 MovieClip [body_dieing] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 105 MovieClip in Symbol 106 MovieClip [body_dieing] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 109 MovieClip Frame 24
this.unloadMovie();
Instance of Symbol 109 MovieClip in Symbol 110 MovieClip [smoke] Frame 1
onClipEvent (load) {
_rotation = random(360);
rate = (random(100) - 50) / 10;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + rate);
}
Symbol 113 MovieClip Frame 1
stop();
Symbol 113 MovieClip Frame 70
gotoAndPlay (10);
Symbol 113 MovieClip Frame 142
gotoAndPlay (135);
Symbol 114 MovieClip [enemy1] Frame 1
function step() {
xpos = _x;
ypos = _y;
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToCheckDirection++) > 100) {
timeToCheckDirection = 0;
dx = _x - _root.hero._x;
if (dx > 0) {
vx = -speed;
} else {
vx = speed;
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y, 1);
grounded = _root.ground.ground_body.hitTest(_x, _y + 2, 1);
if (bottom) {
if (delta > 0) {
delta = 0;
}
delta = delta - 0.1;
vy = delta;
} else if (delta < 0) {
delta = 0;
vy = 0;
}
if (!shooting) {
count = count + 1;
if (count > 60) {
count = 0;
}
vy = vy + _root.gravity;
_x = (_x + vx);
_y = (_y + vy);
body.gotoAndStop(count + mode);
} else {
shooting = (shootCount++) < 10;
}
if (((_x < -40) || (_x > xmax)) || (_y > ymax)) {
_root.removeEnemy(this);
}
if (hp <= 0) {
if (deathCode == "exploded") {
_root.increaseScore(5, _x, _y);
if (explosion_impact > 25) {
_root.addBloodExplosion(_x, _y - 20);
} else {
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y - 5;
temp.vx = explosion_dx;
temp.vy = explosion_dy;
temp._rotation = random(360);
}
} else if (deathCode == "head_shot") {
_root.increaseScore(15, _x, _y);
_alpha = 0;
_root.addBloodExplosionAmt(_x, _y - 20, 5);
_root.placeDeadBody("body_dieing2", _x, _y, vx);
} else {
_root.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= clip_size) {
shot_count = 0;
timeToShoot = (200 + random(100)) - (_root.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
if ((timeToNade--) <= 0) {
dist = Math.abs(_root.hero._x - _x);
if ((dist < 300) && (dist > 100)) {
throwNade();
}
timeToNade = 600 + random(600);
}
}
function shoot() {
_root.playSound("tat3.wav");
shootCount = 1;
shooting = true;
body.gotoAndPlay("shooting");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 2 * (1 + (_root.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 4;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x;
bullet._y = _y - half_height;
bullet._rotation = (radians * 180) / Math.PI;
}
function throwNade() {
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
lvx = dx / 120;
lvy = -3 + (dy / 100);
lvl = _root.getNextEnemyBulletLevel();
proj = _root.addObj("hero_grenade", _root.enemy_bullet_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - half_height;
}
function takeDamage(dmg, x, y, vx, vy) {
_root.playHitEnemySound();
if (weakspot.hitTest(x, y, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
} else {
hp = hp - dmg;
c = 0;
while (c < 1) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
}
}
stop();
mode = 71;
count = random(100);
animFactor = 0.1;
speed = _root.g_enSpeed;
helmAlpha = random(2) * 100;
hp = 5 + Math.floor(_root.level * 0.25);
timeToCheckDirection = 0;
half_height = _height / 2;
explosion_dist = 0;
timeToShoot = 300 + random(300);
timeToNade = 400 + random(600);
shot_count = 0;
speed = 0.5;
xpos = 0;
ypos = 0;
shootCount = 0;
shooting = false;
xmax = _root.g_width + 40;
ymax = _root.g_ground + 40;
etype = "troop";
clip_size = Math.floor(_root.level / 6);
if (clip_size > 5) {
clip_size = 5;
}
Instance of Symbol 55 MovieClip "hitbox" in Symbol 114 MovieClip [enemy1] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 113 MovieClip "body" in Symbol 114 MovieClip [enemy1] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 114 MovieClip [enemy1] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 117 MovieClip [hero_shrap] Frame 1
function step() {
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((_y > 345) && (!splashed)) {
splashed = true;
_alpha = 0;
_root.addSplash(_x, _y);
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitbox.hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark", _x, _y, 3);
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
if (!splashed) {
_root.playSound("bomb.wav");
temp = _root.addObj("bullet_hole", _root.ground.blood_layer, _root.getNextBloodLevel());
temp._x = _x;
temp._y = _y;
}
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 0)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark_dust", _x, _y, 3);
_root.playSound("bomb.wav");
this.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
splashed = false;
Instance of Symbol 116 MovieClip in Symbol 117 MovieClip [hero_shrap] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 120 MovieClip [hero_bullet] Frame 1
function step() {
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitbox.hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark", _x, _y, 3);
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_y > _root.bullet_ground) {
_root.playSound("bomb.wav");
temp = _root.addObj("bullet_hole", _root.ground.blood_layer, _root.getNextBloodLevel());
temp._x = _x;
temp._y = _y;
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark_dust", _x, _y, 3);
this.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
splashed = false;
Instance of Symbol 119 MovieClip in Symbol 120 MovieClip [hero_bullet] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 123 MovieClip [hero_molotov] Frame 1
function step() {
_rotation = (_rotation + rot);
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitObstructions();
testHitEnemies();
timeToTest = 5;
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.addExplosionType(_x, _y, range, dmg, "debris_flame");
this.unloadMovie();
}
}
}
function testHitObstructions() {
bottom = _y > ground_spot;
if (bottom) {
_root.addExplosionType(_x, _y, range, dmg, "debris_flame");
this.unloadMovie();
} else {
for (i in _root.obstructions) {
bottom = _root.obstructions[i].hitTest(_x, _y, 0);
if (bottom) {
_root.addExplosionType(_x, _y, range, dmg, "debris_flame");
this.unloadMovie();
}
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 150;
bounceCount = 0;
ground_spot = _root.bullet_ground - 40;
range = 50;
dmg = 10;
rot = 10;
if (vx > 0) {
rot = 10;
_xscale = 100;
} else {
rot = -10;
_xscale = -100;
}
Instance of Symbol 122 MovieClip in Symbol 123 MovieClip [hero_molotov] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 126 MovieClip [hero_grenade] Frame 1
function step() {
if (bounceCount < 3) {
if (vx > 0) {
_rotation = (_rotation + 3);
} else {
_rotation = (_rotation - 3);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((timeToTest--) <= 0) {
testHitObstructions();
timeToTest = 5;
}
}
if ((timer--) < 0) {
_root.addExplosion(_x, _y, 60, 20);
this.unloadMovie();
}
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
bottom = _y > ground_spot;
if (bottom) {
bounceCount++;
_x = xprev;
_y = yprev;
vy = vy * -0.3;
vx = vx * 0.3;
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 150;
bounceCount = 0;
ground_spot = _root.bullet_ground - 30;
Instance of Symbol 125 MovieClip in Symbol 126 MovieClip [hero_grenade] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 129 MovieClip [explosion] Frame 10
this.unloadMovie();
Symbol 132 MovieClip [debris2] Frame 1
function step() {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if (timer < 15) {
_alpha = (_alpha - 5);
}
if ((timer--) < 0) {
this.unloadMovie();
}
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
for (i in _root.obstructions) {
top = _root.obstructions[i].hitTest(_x, _y - 1, 1);
bottom = _root.obstructions[i].hitTest(_x, _y + 1, 1);
left = _root.obstructions[i].hitTest(_x - 1, _y, 1);
right = _root.obstructions[i].hitTest(_x + 1, _y, 1);
b_right = _root.obstructions[i].hitTest(_x + 0.7071, _y + 0.7071, 1);
b_left = _root.obstructions[i].hitTest(_x - 0.7071, _y + 0.7071, 1);
if (top || (bottom)) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * 0.5;
rot_rate = rot_rate * 0.5;
} else if (bottom && (b_right || (b_left))) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
} else if (b_right || (b_left)) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
} else if (left || (right)) {
_x = xprev;
_y = yprev;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 50 + random(20);
rot_rate = 6;
timeToSmoke = 10;
Instance of Symbol 131 MovieClip in Symbol 132 MovieClip [debris2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 133 MovieClip [debris1] Frame 1
function step() {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if (timer < 20) {
_alpha = (_alpha - 5);
}
if ((timer--) < 0) {
this.unloadMovie();
}
if ((timeToSmoke--) < 0) {
timeToSmoke = 1;
if ((smoke_count++) < 10) {
_root.placeSmoke(_x, _y);
}
}
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
for (i in _root.obstructions) {
top = _root.obstructions[i].hitTest(_x, _y - 1, 1);
bottom = _root.obstructions[i].hitTest(_x, _y + 1, 1);
left = _root.obstructions[i].hitTest(_x - 1, _y, 1);
right = _root.obstructions[i].hitTest(_x + 1, _y, 1);
b_right = _root.obstructions[i].hitTest(_x + 0.7071, _y + 0.7071, 1);
b_left = _root.obstructions[i].hitTest(_x - 0.7071, _y + 0.7071, 1);
if (top || (bottom)) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * 0.5;
rot_rate = rot_rate * 0.5;
} else if (bottom && (b_right || (b_left))) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
} else if (b_right || (b_left)) {
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
} else if (left || (right)) {
_x = xprev;
_y = yprev;
vx = vx * -0.5;
rot_rate = rot_rate * 0.5;
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 50 + random(20);
rot_rate = 6;
timeToSmoke = 0;
Instance of Symbol 131 MovieClip in Symbol 133 MovieClip [debris1] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 136 MovieClip [blood_splat] Frame 1
function step() {
if ((count++) > 500) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 135 MovieClip in Symbol 136 MovieClip [blood_splat] Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 139 MovieClip [blood_drop] Frame 1
function step() {
vy = vy + mygrav;
_x = (_x + vx);
_y = (_y + vy);
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
lvl = _root.getNextBloodLevel();
temp = _root.addObj("blood_splat", _root.ground.blood_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._rotation = random(360);
temp._xscale = (temp._yscale = _xscale);
this.unloadMovie();
} else if (((_x > xmax) || (_x < -10)) || (_y > ymax)) {
this.unloadMovie();
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
mygrav = _root.gravity * 2;
Instance of Symbol 138 MovieClip in Symbol 139 MovieClip [blood_drop] Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 164 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 70
gotoAndPlay (10);
Symbol 165 MovieClip [blood_stump_fem] Frame 1
function step() {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((timer--) < 0) {
this.unloadMovie();
}
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
if (Math.abs(vy) > 4) {
_root.placeBlood(_x, _y);
}
_root.placeDeadBody("enemy_sniper_death", _x, _y, vx);
this.unloadMovie();
}
}
if (_root.ground.ground_body.hitTest(_x, _y + 2, 1)) {
if (Math.abs(vy) > 4) {
_root.placeBlood(_x, _y);
}
_root.placeDeadBody("enemy_sniper_death", _x, _y, vx);
this.unloadMovie();
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 500 + random(50);
rot_rate = random(3) + 3;
timeToSplat = 10;
blood_count = 0;
if (vx < 0) {
_xscale = -100;
}
testHitObstructions();
Instance of Symbol 164 MovieClip in Symbol 165 MovieClip [blood_stump_fem] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 166 MovieClip [anim_dead_body] Frame 1
stop();
Symbol 166 MovieClip [anim_dead_body] Frame 75
stop();
Symbol 167 MovieClip [blood_stump] Frame 1
function step() {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
if ((timer--) < 0) {
this.unloadMovie();
}
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
if (_root.enemies[i].hitTest(_x, _y, 0)) {
_root.enemies[i].takeDamage(dmg);
_root.addSpark("spark", _x, _y, 3);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y + 2, 1)) {
if (Math.abs(vy) > 4) {
_root.placeBlood(_x, _y);
}
_root.placeDeadBody("body_dieing", _x, _y, vx);
this.unloadMovie();
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 500 + random(50);
rot_rate = random(3) + 3;
timeToSplat = 10;
blood_count = 0;
if (vx < 0) {
_xscale = -100;
}
testHitObstructions();
Instance of Symbol 166 MovieClip [anim_dead_body] "body" in Symbol 167 MovieClip [blood_stump] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 170 MovieClip [crater2] Frame 1
function step() {
if ((count++) > 500) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 169 MovieClip in Symbol 170 MovieClip [crater2] Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 173 MovieClip [crater1] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 172 MovieClip in Symbol 173 MovieClip [crater1] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 70
gotoAndPlay (10);
Symbol 179 MovieClip [enemy_drop_sniper] Frame 1
function step() {
xpos = _x;
ypos = _y;
vx = vx + ((random(100) - 50) / 2000);
_y = (_y + (2 + extra_fall));
_x = (_x + vx);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y, 1);
if (bottom || (hitstruct)) {
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
dx = _root.hero._x - _x;
dir = Math.abs(dx) / dx;
_root.placeEnemy("enemy_sniper", _x, _y, 0, 0);
_root.removeEnemy(this);
}
if (hp <= 0) {
_root.increaseScore(10, _x, _y);
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
if (explosion_impact > 12) {
_root.addBloodExplosion(_x, _y - 20);
} else {
_root.addFemBloodyStump(_x, _y, vx, 0);
}
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
timeToShoot = 200 + random(100);
}
}
function shoot() {
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 2;
wild_factor = 4;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 1000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x;
bullet._y = _y - half_height;
bullet._rotation = (radians * 180) / Math.PI;
}
function throwNade() {
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
lvx = dx / 100;
lvy = -2 + (dy / 100);
lvl = _root.getNextEnemyBulletLevel();
proj = _root.addObj("hero_grenade", _root.enemy_bullet_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - half_height;
}
function takeDamage(dmg, x, y, vx, vy) {
_root.playHitEnemySound();
if (weakspot.hitTest(x, y, 0)) {
_root.increaseScore(20, _x, _y);
hp = 0;
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
} else {
hp = hp - dmg;
c = 0;
while (c < 1) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
}
}
hp = 5;
xpos = 0;
ypos = 0;
timeToShoot = 50;
half_height = _height / 2;
extra_fall = _root.level * 0.1;
etype = "troop";
Instance of Symbol 55 MovieClip "hitbox" in Symbol 179 MovieClip [enemy_drop_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 178 MovieClip in Symbol 179 MovieClip [enemy_drop_sniper] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 179 MovieClip [enemy_drop_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 180 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 70
gotoAndPlay (10);
Symbol 181 MovieClip [enemy_drop] Frame 1
function step() {
xpos = _x;
ypos = _y;
vx = vx + ((random(100) - 50) / 2000);
_y = (_y + (1.5 + extra_fall));
_x = (_x + vx);
bottom = _root.ground.ground_body.hitTest(_x, _y, 1);
if (bottom) {
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
dx = _root.hero._x - _x;
dir = Math.abs(dx) / dx;
_root.placeEnemy("enemy1", _x, _y, 0.5 * dir, vy);
_root.removeEnemy(this);
}
if (hp <= 0) {
_root.increaseScore(10, _x, _y);
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
if (explosion_impact > 12) {
_root.addBloodExplosion(_x, _y - 20);
} else {
_root.addBloodyStump(_x, _y, vx, 0);
}
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
timeToShoot = 200 + random(100);
}
}
function shoot() {
_root.playSound("tat3.wav");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 2;
wild_factor = 4;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 1000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x;
bullet._y = _y - half_height;
bullet._rotation = (radians * 180) / Math.PI;
}
function throwNade() {
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
lvx = dx / 100;
lvy = -2 + (dy / 100);
lvl = _root.getNextEnemyBulletLevel();
proj = _root.addObj("hero_grenade", _root.enemy_bullet_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - half_height;
}
function takeDamage(dmg, x, y, vx, vy) {
_root.playHitEnemySound();
if (weakspot.hitTest(x, y, 0)) {
_root.increaseScore(20, _x, _y);
hp = 0;
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
} else {
hp = hp - dmg;
c = 0;
while (c < 1) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
}
}
hp = 5;
xpos = 0;
ypos = 0;
timeToShoot = 50;
half_height = _height / 2;
extra_fall = _root.level * 0.1;
etype = "troop";
Instance of Symbol 55 MovieClip "hitbox" in Symbol 181 MovieClip [enemy_drop] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 180 MovieClip in Symbol 181 MovieClip [enemy_drop] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 181 MovieClip [enemy_drop] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 182 MovieClip [parachute_fade] Frame 20
this.unloadMovie();
Symbol 186 MovieClip [gas_can] Frame 1
function step() {
frame = maxhp - hp;
if (frame < 1) {
frame = 1;
}
frame = Math.floor(frame);
can_animation.gotoAndStop(frame);
if (hp <= 0) {
_root.addExplosionType(_x, _y, 100, 50, "debris_flame");
_root.removeObstruction(this);
}
hp = hp - leaking;
}
function takeDamage(amt, x, y, vx, vy) {
_root.playSound("ching1.wav");
hp = hp - amt;
}
hp = 5;
maxhp = 5;
placed = false;
_root.obstructions.push(this);
Instance of Symbol 185 MovieClip "can_animation" in Symbol 186 MovieClip [gas_can] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 189 MovieClip [enemy_bullet] Frame 1
function step() {
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitHero();
testHitObstructions();
}
function testHitHero() {
if (_root.hero.hitbox.hitTest(_x, _y, 0)) {
_root.hero.takeDamage(3);
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = _x;
blood._y = _y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
this.unloadMovie();
}
}
function testHitObstructions() {
if (_y > _root.bullet_ground) {
_root.playSound("bomb.wav");
temp = _root.addObj("bullet_hole", _root.ground.blood_layer, _root.getNextBloodLevel());
temp._x = _x;
temp._y = _y;
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.addSpark("spark_dust", _x, _y, 3);
this.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
Instance of Symbol 188 MovieClip in Symbol 189 MovieClip [enemy_bullet] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 193 MovieClip [enemy_a10] Frame 1
function step() {
xpos = _x;
ypos = _y;
if (hp > 0) {
bomber_anim.gotoAndStop(101 - Math.floor((100 * hp) / maxhp));
_x = (_x + vx);
_y = (_y + vy);
if (((timeToBomb--) <= 0) && (ammo > 0)) {
ammo--;
timeToBomb = 50;
dropBomb();
}
} else {
if (!scored_kill) {
scored_kill = true;
_root.increaseScore(10, _x, _y);
}
if (vx > 0) {
_rotation = (_rotation + 0.1);
} else {
_rotation = (_rotation - 0.1);
}
vy = vy + half_grav;
_x = (_x + vx);
_y = (_y + vy);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y + 2, 1) || (hitstruct);
if (bottom) {
_root.addExplosion(_x, _y, 70, 40);
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("a10_dead", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_root.removeEnemy(this);
}
}
if ((_x > xmax) || (_x < -60)) {
_root.removeEnemy(this);
}
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function takeDamage(dmg, x, y, vx, vy) {
dmg_amt = dmg;
spark_amt = random(2);
if ((!exploded) && (weakspot.hitTest(x, y, 0))) {
_root.addExplosion(x, y, 15, 5);
exploded = true;
dmg_amt = dmg_amt + 1000;
spark_amt = spark_amt + random(2);
}
_root.playSound("ching1.wav");
hp = hp - dmg_amt;
c = 0;
while (c < spark_amt) {
blood = _root.addObj("debris2", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 50 + random(100));
c++;
}
xnew = x - _x;
ynew = y - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _root.addObj("bullet_hole2", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function dropBomb() {
_root.playSound("firecat3.wav");
temp = _root.addObj("enemy_bomb_drop_napalm", _root.bomb_layer, _root.getNextBombLevel());
temp._x = _x;
temp._y = _y + 5;
temp.vx = vx / 5;
}
maxhp = 40;
hp = 40;
xmax = _root.g_width + 60;
ymax = _root.g_ground + 60;
xpos = 0;
ypos = 0;
timeToBomb = 75;
half_grav = _root.gravity / 2;
ammo = Math.ceil(_root.level * 0.2);
etype = "plane";
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
b_level = 1;
exploded = false;
Instance of Symbol 55 MovieClip "hitbox" in Symbol 193 MovieClip [enemy_a10] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 193 MovieClip [enemy_a10] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 191 MovieClip in Symbol 193 MovieClip [enemy_a10] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 200 MovieClip [enemy_bomber] Frame 1
function step() {
xpos = _x;
ypos = _y;
if (hp > 0) {
bomber_anim.gotoAndStop(101 - Math.floor((100 * hp) / maxhp));
_x = (_x + vx);
_y = (_y + vy);
if (((timeToBomb--) <= 0) && (ammo > 0)) {
timeToBomb = 120;
dropBomb();
}
} else {
if (!scored_kill) {
scored_kill = true;
_root.increaseScore(10, _x, _y);
}
if (vx > 0) {
_rotation = (_rotation + 0.1);
} else {
_rotation = (_rotation - 0.1);
}
vy = vy + half_grav;
_x = (_x + vx);
_y = (_y + vy);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _root.ground.ground_body.hitTest(_x, _y + 2, 1) || (hitstruct);
if (bottom) {
_root.addExplosion(_x, _y, 70, 40);
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("bomber_dead", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_root.removeEnemy(this);
}
}
if ((_x > xmax) || (_x < -60)) {
_root.removeEnemy(this);
}
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function takeDamage(dmg, x, y, vx, vy) {
dmg_amt = dmg;
spark_amt = random(2);
if (weakspot.hitTest(x, y, 0)) {
dmg_amt = dmg_amt + 10;
spark_amt = spark_amt + random(2);
}
trace("Taking Damage!!!!!!!!!!!!!!!!!!");
trace("Damage: " + dmg);
_root.playSound("ching1.wav");
hp = hp - dmg_amt;
c = 0;
while (c < spark_amt) {
blood = _root.addObj("debris2", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 50 + random(100));
c++;
}
xnew = x - _x;
ynew = y - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _root.addObj("bullet_hole2", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function dropBomb() {
_root.playSound("firecat3.wav");
temp = _root.addObj("enemy_bomb_drop", _root.bomb_layer, _root.getNextBombLevel());
temp._x = _x;
temp._y = _y + 5;
temp.vx = vx;
_root.enemies.push(temp);
}
maxhp = 100;
hp = 100;
xmax = _root.g_width + 60;
ymax = _root.g_ground + 60;
xpos = 0;
ypos = 0;
timeToBomb = 100;
half_grav = _root.gravity / 2;
ammo = 3;
etype = "plane";
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
b_level = 1;
Instance of Symbol 198 MovieClip "bomber_anim" in Symbol 200 MovieClip [enemy_bomber] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "hitbox" in Symbol 200 MovieClip [enemy_bomber] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 200 MovieClip [enemy_bomber] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 203 MovieClip [arrow_debris] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 202 MovieClip in Symbol 203 MovieClip [arrow_debris] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 208 MovieClip [ammo_prox_mine] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_prox_mines = _root.ammo_prox_mines + 10;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 207 MovieClip in Symbol 208 MovieClip [ammo_prox_mine] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 122 MovieClip in Symbol 210 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 122 MovieClip in Symbol 210 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 122 MovieClip in Symbol 210 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 211 MovieClip [ammo_grenade] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_grenades = _root.ammo_grenades + 10;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 210 MovieClip in Symbol 211 MovieClip [ammo_grenade] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 214 MovieClip [ammo_health] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.hero.hp = _root.hero.hp + 10;
if (_root.hero.hp > 100) {
_root.hero.hp = 100;
}
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 213 MovieClip in Symbol 214 MovieClip [ammo_health] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Symbol 218 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Symbol 218 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Symbol 218 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Symbol 218 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Symbol 218 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Symbol 218 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Symbol 218 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 217 MovieClip in Symbol 218 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 219 MovieClip [ammo_rpg_crate] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_rpg = _root.ammo_rpg + 8;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 218 MovieClip in Symbol 219 MovieClip [ammo_rpg_crate] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 222 MovieClip [ammo_arrow] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_arrows = _root.ammo_arrows + 20;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 221 MovieClip in Symbol 222 MovieClip [ammo_arrow] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 227 MovieClip [ammo_gun] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_bullets = _root.ammo_bullets + 400;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 226 MovieClip in Symbol 227 MovieClip [ammo_gun] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 232 MovieClip [ammo_shotgun] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_shells = _root.ammo_shells + 10;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 231 MovieClip in Symbol 232 MovieClip [ammo_shotgun] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 235 MovieClip [ammo_rocket] Frame 1
function step() {
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_root.addGrenadeExplosion(_x, _y);
_root.removeObstruction(this);
} else if (_alpha <= 0) {
_root.removeObstruction(this);
} else if (hitTest(_root.hero._x, _root.hero._y, 0)) {
_root.ammo_rockets = _root.ammo_rockets + 10;
_root.removeObstruction(this);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 234 MovieClip in Symbol 235 MovieClip [ammo_rocket] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 238 MovieClip [bullet_hole2] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 237 MovieClip in Symbol 238 MovieClip [bullet_hole2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 240 MovieClip in Symbol 241 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 242 MovieClip [bullet_hole] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 241 MovieClip in Symbol 242 MovieClip [bullet_hole] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 246 MovieClip Frame 65
stop();
Symbol 247 MovieClip [body_dieing2] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 246 MovieClip in Symbol 247 MovieClip [body_dieing2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 250 MovieClip [chopper_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 249 MovieClip in Symbol 250 MovieClip [chopper_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 254 MovieClip [a10_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 253 MovieClip in Symbol 254 MovieClip [a10_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 257 MovieClip [bomber_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 256 MovieClip in Symbol 257 MovieClip [bomber_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 258 MovieClip [proximity_mine] Frame 1
function step() {
if (placed) {
vx = 0;
vy = 0;
hp = hp - leaking;
if (hp <= 0) {
_root.playSound("tat1.wav");
shrap_bomb = _root.addObj("shrap_bomb", _root.debris_layer, _root.getNextDebrisLevel());
shrap_bomb._x = _x;
shrap_bomb._y = _y;
shrap_bomb.vy = -3;
hp = 10;
leaking = 0;
timeToScan = -100;
if ((chargeCount++) >= 2) {
_root.removeMine(this);
}
}
if ((timeToScan++) > 50) {
timeToScan = 0;
scan();
}
} else {
if (vx > 0) {
_rotation = (_rotation + 3);
} else {
_rotation = (_rotation - 3);
}
vy = vy + _root.gravity;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_y < -10) || (_x < -10)) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitObstructions();
}
}
function scan() {
trace("Scanning");
for (i in _root.enemies) {
ene = _root.enemies[i];
dx = ene._x - _x;
dy = ene._y - _y;
if ((Math.abs(dx) < detection_range) && (Math.abs(dy) < detection_range)) {
leaking = 1;
break;
}
}
}
function testHitObstructions() {
placed = false;
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_y > (_root.bullet_ground - 20))) {
placed = true;
} else {
do {
if ((in _root.obstructions) == null) {
break;
}
i = in _root.obstructions;
placed = _root.obstructions[i].hitTest(_x, _y, 0);
} while (!placed);
do {
} while (() != null);
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
hp = 10;
timeToScan = 0;
leaking = 0;
placed = false;
range = 50;
detection_range = 20;
dmg = 100;
chargeCount = 0;
Instance of Symbol 206 MovieClip in Symbol 258 MovieClip [proximity_mine] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 264 MovieClip Frame 1
stop();
Symbol 264 MovieClip Frame 70
gotoAndPlay (10);
Instance of Symbol 267 MovieClip "sniper_flame" in Symbol 268 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (_alpha - 30);
}
}
Symbol 270 MovieClip [enemy_sniper_office] Frame 1
function step() {
xpos = _x;
ypos = _y;
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToAim++) > 15) {
timeToAim = 0;
dx = -((_root.hero._x - _x) - 2.6);
dy = -((_root.hero._y - _y) - 11.8);
radians = Math.atan(dy / dx);
if (dx > 0) {
vx = -speed;
shoot_angle = ((-radians) * 180) / Math.PI;
} else {
vx = speed;
shoot_angle = (radians * 180) / Math.PI;
}
sniper_gun._rotation = shoot_angle;
head._rotation = shoot_angle;
left_arm._rotation = shoot_angle;
}
if (hp <= 0) {
myWindow.enemyDead = true;
if (deathCode == "exploded") {
_root.increaseScore(5, _x, _y);
if (explosion_impact > 12) {
_root.addBloodExplosion(_x, _y - 20);
} else {
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump_fem", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y - 5;
temp.vx = explosion_dx;
temp.vy = explosion_dy;
temp._rotation = random(360);
}
} else {
_root.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump_fem", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= 2) {
shot_count = 1;
timeToShoot = (300 + random(200)) - (_root.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
}
function shoot() {
sniper_gun.sniper_flame._alpha = 100;
_root.playSound("sniper_rifle.wav");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_root.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 2;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x + bullet.vx;
bullet._y = (_y - half_height) + bullet.vy;
bullet._rotation = (radians * 180) / Math.PI;
}
function throwNade() {
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
lvx = dx / 130;
lvy = -3 + (dy / 100);
lvl = _root.getNextEnemyBulletLevel();
proj = _root.addObj("hero_grenade", _root.enemy_bullet_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - half_height;
}
function takeDamage(dmg, x, y, vx, vy) {
_root.playHitEnemySound();
if (weakspot.hitTest(x, y, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
} else {
hp = hp - dmg;
c = 0;
while (c < 1) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
}
}
hp = 5 + Math.floor(_root.level * 0.25);
half_height = _height / 2;
timeToNade = 600 + random(600);
timeToShoot = 100;
shot_count = 0;
speed = 0.5;
xpos = 0;
ypos = 0;
shootCount = 0;
etype = "troop";
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
Instance of Symbol 269 MovieClip "head" in Symbol 270 MovieClip [enemy_sniper_office] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "hitbox" in Symbol 270 MovieClip [enemy_sniper_office] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 270 MovieClip [enemy_sniper_office] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 271 MovieClip [enemy_sniper] Frame 1
function step() {
xpos = _x;
ypos = _y;
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToAim++) > 15) {
timeToAim = 0;
dx = -((_root.hero._x - _x) - 2.6);
dy = -((_root.hero._y - _y) - 11.8);
radians = Math.atan(dy / dx);
if (dx > 0) {
vx = -speed;
shoot_angle = ((-radians) * 180) / Math.PI;
} else {
vx = speed;
shoot_angle = (radians * 180) / Math.PI;
}
sniper_gun._rotation = shoot_angle;
head._rotation = shoot_angle;
left_arm._rotation = shoot_angle;
}
if (hp <= 0) {
if (deathCode == "exploded") {
_root.increaseScore(5, _x, _y);
if (explosion_impact > 12) {
_root.addBloodExplosion(_x, _y - 20);
} else {
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump_fem", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y - 5;
temp.vx = explosion_dx;
temp.vy = explosion_dy;
temp._rotation = random(360);
}
} else if (deathCode == "head_shot") {
_root.increaseScore(15, _x, _y);
_alpha = 0;
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("enemy_sniper_death", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
if (vx > 0) {
temp._xscale = -100;
}
} else {
_root.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _root.getNextDebrisLevel();
temp = _root.addObj("blood_stump_fem", _root.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_root.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= 0) {
shot_count = 1;
timeToShoot = (300 + random(200)) - (_root.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
if ((timeToNade--) <= 0) {
dist = Math.abs(_root.hero._x - _x);
if ((dist < 300) && (dist > 100)) {
throwNade();
}
timeToNade = 600 + random(600);
}
}
function shoot() {
sniper_gun.sniper_flame._alpha = 100;
_root.playSound("sniper_rifle.wav");
bullet = _root.addObj("enemy_bullet", _root.enemy_bullet_layer, _root.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_root.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 2;
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
variation = (random(Math.floor(wild_factor * 100)) - random(Math.floor(wild_factor * 100))) / 2000;
radians = Math.atan(dy / dx) + variation;
if (dx < 0) {
radians = radians + Math.PI;
}
bullet.vy = Math.sin(radians) * shot_speed;
bullet.vx = Math.cos(radians) * shot_speed;
bullet._x = _x + bullet.vx;
bullet._y = (_y - half_height) + bullet.vy;
bullet._rotation = (radians * 180) / Math.PI;
}
function throwNade() {
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
lvx = dx / 130;
lvy = -3 + (dy / 100);
lvl = _root.getNextEnemyBulletLevel();
proj = _root.addObj("hero_grenade", _root.enemy_bullet_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - half_height;
}
function takeDamage(dmg, x, y, vx, vy) {
_root.playHitEnemySound();
if (weakspot.hitTest(x, y, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
} else {
hp = hp - dmg;
c = 0;
while (c < 1) {
blood = _root.addObj("blood_drop", _root.debris_layer, _root.getNextDebrisLevel());
blood._x = x;
blood._y = y;
blood.vx = (vx / 3) + ((random(10) - random(10)) / 10);
blood.vy = (vy / 3) + ((random(10) - random(10)) / 10);
blood._xscale = (blood._yscale = 100 + random(200));
c++;
}
}
}
hp = 5 + Math.floor(_root.level * 0.25);
half_height = _height / 2;
timeToNade = 600 + random(600);
timeToShoot = 100;
shot_count = 0;
speed = 0.5;
xpos = 0;
ypos = 0;
shootCount = 0;
etype = "troop";
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
Instance of Symbol 269 MovieClip "head" in Symbol 271 MovieClip [enemy_sniper] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "hitbox" in Symbol 271 MovieClip [enemy_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 55 MovieClip "weakspot" in Symbol 271 MovieClip [enemy_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 272 MovieClip Frame 54
stop();
Symbol 273 MovieClip [enemy_sniper_death] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 272 MovieClip in Symbol 273 MovieClip [enemy_sniper_death] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 276 MovieClip [shrap_bomb] Frame 1
function step() {
vy = vy + _root.gravity;
_x = (_x + vx);
_y = (_y + vy);
if ((timeToExpload--) <= 0) {
_root.shrapnelExplosion(_x, _y, 10);
_root.playSound("ice_shatter.wav");
this.unloadMovie();
}
}
timeToExpload = 30;
Instance of Symbol 275 MovieClip in Symbol 276 MovieClip [shrap_bomb] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 278 MovieClip [napalm_flame] Frame 1
function scan() {
closeEnemies = new Array();
for (ndx in _root.enemies) {
dx = _root.enemies[ndx]._x - _x;
dy = _root.enemies[ndx]._y - _y;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dist < 200) {
closeEnemies.push(_root.enemies[ndx]);
}
}
dx = _root.hero._x - _x;
dy = _root.hero._y - _y;
dist = Math.sqrt((dx * dx) + (dy * dy));
checkHero = dist < 200;
}
function step() {
if ((count++) > 600) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
if ((timeToCheck++) > 20) {
timeToCheck = 0;
for (ndx in closeEnemies) {
cene = closeEnemies[ndx];
if (hitbox.hitTest(cene._x, cene._y, 0)) {
cene.takeDamage(3, _x, _y, 0, 0);
}
}
if (checkHero && (hitbox.hitTest(_root.hero._x, _root.hero._y, 0))) {
_root.hero.takeDamage(5);
}
}
if ((timeToScan++) > 50) {
timeToScan = 0;
scan();
}
}
closeEnemies = new Array();
scan();
checkHero = false;
timeToCheck = 100;
Instance of Symbol 277 MovieClip in Symbol 278 MovieClip [napalm_flame] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "hitbox" in Symbol 278 MovieClip [napalm_flame] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 297 MovieClip [breaking_glass] Frame 1
function takeDamage(amt, xpar, ypar, vx, vy) {
xpos = xpar - _x;
ypos = ypar - _y;
for (ndx in pieces) {
piece = pieces[ndx];
if (piece.hitTest(xpar, ypar, 0)) {
_root.playSound("ice_shatter.wav");
_root.addDebrisExplosionType(xpar, ypar, 2, "glass_shard");
piece.unloadMovie();
hp--;
if (hp <= 0) {
window_loader.allBroke = true;
}
break;
}
}
}
pieces = new Array();
pieces.push(p1);
pieces.push(p2);
pieces.push(p3);
pieces.push(p4);
pieces.push(p5);
pieces.push(p6);
pieces.push(p7);
pieces.push(p8);
pieces.push(p9);
hp = 9;
_root.obstructions.push(this);
Symbol 300 MovieClip [glass_fade_loader] Frame 1
function step() {
_alpha = (_alpha + 5);
if (_alpha > 100) {
this.unloadMovie();
}
}
_alpha = 0;
Instance of Symbol 299 MovieClip in Symbol 300 MovieClip [glass_fade_loader] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 303 MovieClip [glass_shard] Frame 1
function step() {
if (!hitGround) {
vy = vy + _root.gravity;
_y = (_y + vy);
_x = (_x + vx);
_rotation = (_rotation + 2);
} else {
_x = (_x + vx);
vx = vx * 0.95;
}
if (_y > 340) {
_y = 340;
vy = 0;
hitGround = true;
}
if ((timer++) > 200) {
_alpha = (_alpha - 5);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
hitGround = false;
Instance of Symbol 302 MovieClip in Symbol 303 MovieClip [glass_shard] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 307 MovieClip [enemy_car_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 306 MovieClip in Symbol 307 MovieClip [enemy_car_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 317 MovieClip Frame 1
stop();
Symbol 318 MovieClip [obs_aircond] Frame 1
function step() {
frame = maxhp - hp;
if (frame < 1) {
frame = 1;
}
frame = Math.floor(frame);
can_animation.gotoAndStop(frame);
if (hp <= 0) {
_root.addExplosionType(_x, _y, 100, 50, "debris_flame");
_root.removeObstruction(this);
}
hp = hp - leaking;
}
function takeDamage(amt, x, y, vx, vy) {
_root.playSound("ching1.wav");
hp = hp - amt;
}
hp = 20;
maxhp = 20;
placed = false;
_root.obstructions.push(this);
Instance of Symbol 317 MovieClip "can_animation" in Symbol 318 MovieClip [obs_aircond] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 319 MovieClip [tank_shell] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting x and y: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
vy = vy + (_root.gravity * 2);
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
placeSmoke();
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitObstructions();
testHitHero();
}
function testHitHero() {
if (_root.hero.hitbox.hitTest(_x, _y, 0)) {
_root.addExplosion(_x, _y, range, dmg);
_root.playHitEnemySound();
this.unloadMovie();
}
}
function testHitStruct() {
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
if (hitstruct) {
_root.addExplosion(_x, _y, range, dmg);
_root.playHitEnemySound();
this.unloadMovie();
}
}
function testHitEnemies() {
for (i in _root.enemies) {
ene = _root.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
_root.addExplosion(_x, _y, range, dmg);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_y > ground_spot) {
_root.addExplosion(_x, _y, range, dmg);
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.addExplosion(_x, _y, range, dmg);
this.unloadMovie();
}
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment_tank_shell", "segment_tank_shell_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
range = 50;
dmg = 100;
ground_spot = _root.bullet_ground - 20;
Instance of Symbol 217 MovieClip in Symbol 319 MovieClip [tank_shell] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 320 MovieClip [rpg] Frame 1
function setVelocity(xdelta, ydelta) {
trace((("setting x and y: " + xdelta) + " ") + ydelta);
vx = xdelta;
vy = ydelta;
}
function step() {
vy = vy + (_root.gravity * 2);
_y = (_y + vy);
_x = (_x + vx);
radians = Math.atan(vy / vx);
if (vx > 0) {
_rotation = ((radians * 180) / 3.14159);
} else {
_rotation = (((radians * 180) / 3.14159) + 180);
}
placeSmoke();
if (((_x < -10) || (_x > xmax)) || (_y > ymax)) {
this.unloadMovie();
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
for (i in _root.enemies) {
ene = _root.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
_root.addExplosion(_x, _y, range, dmg);
_root.playHitEnemySound();
this.unloadMovie();
}
}
}
function testHitObstructions() {
if (_y > ground_spot) {
_root.addExplosion(_x, _y, range, dmg);
this.unloadMovie();
}
for (i in _root.obstructions) {
if (_root.obstructions[i].hitTest(_x, _y, 1)) {
_root.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_root.addExplosion(_x, _y, range, dmg);
this.unloadMovie();
}
}
}
function placeSmoke() {
lvl = _root.getNextSmokeLevel();
temp = _root.smoke_layer.attachMovie("segment_arrow", "segment_arrow_id_" + lvl, lvl);
temp._x = _x;
temp._y = _y;
temp._width = Math.sqrt((vx * vx) + (vy * vy));
temp._rotation = _rotation;
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
range = 50;
dmg = 100;
ground_spot = _root.bullet_ground - 20;
Instance of Symbol 217 MovieClip in Symbol 320 MovieClip [rpg] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 324 MovieClip [tank_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 323 MovieClip in Symbol 324 MovieClip [tank_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 329 MovieClip [level_display] Frame 1
function step() {
_alpha = (_alpha - 10);
if (_alpha < 0) {
this.unloadMovie();
}
}
_alpha = 1000;
Instance of Symbol 328 MovieClip in Symbol 329 MovieClip [level_display] Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 332 MovieClip [enemy_bomb_drop] Frame 1
function step() {
vy = vy + (_root.gravity / 5);
_x = (_x + vx);
_y = (_y + vy);
xpos = _x;
ypos = _y;
_rotation = (_rotation + rotFactor);
if (((_x < xmin) || (_x > xmax)) || (_y > ymax)) {
_root.removeEnemy(this);
}
if ((_y > 200) || (hp <= 0)) {
hitstruct = false;
if ((_y > 200) && (_y < 260)) {
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
}
if ((hitstruct || (hp <= 0)) || (_y > (_root.bullet_ground - 10))) {
_root.addExplosion(_x, _y, 110, 50);
_root.removeEnemy(this);
}
}
}
function takeDamage(amt, x, y, vx, vy) {
hp = hp - amt;
}
hp = 1;
xpos = _x;
ypos = _y;
xmax = _root.g_width + 100;
ymax = _root.g_ground + 50;
xmin = -100;
ymin = -10;
etype = "bomb";
if (vx < 0) {
_xscale = -100;
}
if (vx > 0) {
rotFactor = 0.3;
} else {
rotFactor = -0.3;
}
Instance of Symbol 331 MovieClip in Symbol 332 MovieClip [enemy_bomb_drop] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 55 MovieClip "hitbox" in Symbol 332 MovieClip [enemy_bomb_drop] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 335 MovieClip [bullet_water_splash] Frame 1
function step() {
_alpha = (_alpha - 3);
if (_alpha <= 0) {
this.unloadMovie();
}
}
Instance of Symbol 334 MovieClip in Symbol 335 MovieClip [bullet_water_splash] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 348 Button
on (release) {
_root.closeTopScores();
}
Symbol 353 Button
on (release) {
_root.closeNamer();
_root.paused = false;
}
Symbol 356 Button
on (release) {
_root.closeHelp();
}
Symbol 360 Button
on (release) {
_root.help_text = "Stay alive as long as possible.\nDestroy the enemies to earn points.\nGather the crates to get ammo and health.\nAvoid explosions and enemy bullets.";
}
Symbol 363 Button
on (release) {
_root.help_text = "There are three types of enemies... Soldiers, bombers, and helicopters. Hint: every enemy has a weak spot.";
}
Symbol 365 Button
on (release) {
_root.help_text = "Tap Left CTRL to crouch; while crouched your aiming with the gun is a lot better and you are a smaller target. If you start to move while crouched your guy stands up. You can stand on tower platforms but the platform floors do not block enemy fire. Falling aircraft cause explosions that do hurt you. EVERY explosion hurts you.";
}
Symbol 367 Button
on (release) {
_root.help_text = "Rockets are fired by clicking the left mouse button. Rockets will follow your mouse cursor to the best of their ability. Sharp turns may cause them to collide with other objects.";
}
Symbol 370 Button
on (release) {
_root.help_text = "Single Click will release the cross bow which releases a piercing bolt that can pass through enemy soldiers instantly killing them.";
}
Symbol 372 Button
on (release) {
_root.help_text = "The gun is a fully automatic rifle that does not need to reload via clips (lucky you) but can run out of ammo. The longer you fire the more wild your shots get. If you are crouched you can aim better. Notice your cross-hair icon change shape as you fire. The further the red-lines are from the center-mouse-possition the wilder your gun aiming is.";
}
Symbol 374 Button
on (release) {
_root.help_text = "Controls:\n";
_root.help_text = _root.help_text + "A (hold): Move Left\n";
_root.help_text = _root.help_text + "D (hold): Move Right\n";
_root.help_text = _root.help_text + "W (hold): Climb Up ladder\n";
_root.help_text = _root.help_text + "S (hold): Climb Down ladder\n";
_root.help_text = _root.help_text + "E: Throw Grenade\n";
_root.help_text = _root.help_text + "R: Throw Proximity Mine\n";
_root.help_text = _root.help_text + "SPACE BAR: Jump (Double tap to double jump)\n";
_root.help_text = _root.help_text + "Left CTRL: (Tap once) Crouch (provides better aiming but you cannot move while crouched)\n";
_root.help_text = _root.help_text + "#1-3 Change Firing Modes (Gun, Bow, Rocket)\n";
}
Symbol 384 MovieClip [help_screen] Frame 1
_root.help_text = "Controls:\n";
_root.help_text = _root.help_text + "A (hold): Move Left\n";
_root.help_text = _root.help_text + "D (hold): Move Right\n";
_root.help_text = _root.help_text + "W (hold): Climb Up ladder\n";
_root.help_text = _root.help_text + "S (hold): Climb Down ladder\n";
_root.help_text = _root.help_text + "E: Throw Molotov Coctail\n";
_root.help_text = _root.help_text + "R: Throw Shrapnel Proximity Mine\n";
_root.help_text = _root.help_text + "SPACE BAR: Jump (Double tap to double jump)\n";
_root.help_text = _root.help_text + "Left CTRL: (Tap once) Crouch (provides better aiming but you cannot move while crouched)\n";
_root.help_text = _root.help_text + "#1-5 Change Firing Modes (Gun, RPG, Rocket, Shotgun, Uzi)\n";
_root.default_help_text = "Controls:\n";
_root.default_help_text = _root.default_help_text + "A (hold): Move Left\n";
_root.default_help_text = _root.default_help_text + "D (hold): Move Right\n";
_root.default_help_text = _root.default_help_text + "W (hold): Climb Up ladder\n";
_root.default_help_text = _root.default_help_text + "S (hold): Climb Down ladder\n";
_root.default_help_text = _root.default_help_text + "E: Throw Molotov Coctail\n";
_root.default_help_text = _root.default_help_text + "R: Throw Shrapnel Proximity Mine\n";
_root.default_help_text = _root.default_help_text + "SPACE BAR: Jump (Double tap to double jump)\n";
_root.default_help_text = _root.default_help_text + "Left CTRL: (Tap once) Crouch (provides better aiming but you cannot move while crouched)\n";
_root.default_help_text = _root.default_help_text + "#1-5 Change Firing Modes (Gun, RPG, Rocket, Shotgun, Uzi)\n";
Instance of Symbol 378 MovieClip "sponsor_link" in Symbol 384 MovieClip [help_screen] Frame 1
on (release) {
getURL ("http://www.ugotgames.com/", "_blank");
}
Instance of Symbol 383 MovieClip in Symbol 384 MovieClip [help_screen] Frame 1
on (rollOver) {
_root.help_text = "\"Progressive\" mode is where different levels have different amounts of specific types of enemies. \"All\" mode has every enemy with an equal chance of being loaded. Click the button to change the mode. The mode that is viewable is the one that is active.";
}
on (rollOut) {
_root.help_text = _root.default_help_text;
}
on (release) {
_root.stepper.switchGameModes();
}
Symbol 393 Button
on (release) {
_root.closeGameOver();
_root.restartGame();
}
Symbol 440 MovieClip Frame 1
function step() {
hitladder = ladder.hitTest(_root.hero._x, _root.hero._y, 0);
if (Key.isDown(_root.KEY_W)) {
if (hitladder) {
_root.hero.vx = 0;
_root.hero.vy = 0;
_root.hero._y = _root.hero._y - 1;
}
} else if (Key.isDown(_root.KEY_S)) {
if (hitladder) {
_root.hero.vx = 0;
_root.hero.vy = 0;
_root.hero._y = _root.hero._y + 1;
}
}
}
Instance of Symbol 55 MovieClip "ladder" in Symbol 440 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 450 MovieClip Frame 1
function step() {
hitladder = ladder.hitTest(_root.hero._x, _root.hero._y, 0);
if (Key.isDown(_root.KEY_W)) {
if (hitladder) {
_root.hero.vx = 0;
_root.hero.vy = 0;
_root.hero._y = _root.hero._y - 1;
}
} else if (Key.isDown(_root.KEY_S)) {
if (hitladder) {
_root.hero.vx = 0;
_root.hero.vy = 0;
_root.hero._y = _root.hero._y + 1;
}
}
}
Instance of Symbol 55 MovieClip "ladder" in Symbol 450 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 451 MovieClip Frame 1
function addGlass() {
glassTimer = 0;
myWindow = _root.addObj("breaking_glass", this, 3);
myWindow.window_loader = this;
allBroke = false;
enemyDead = false;
}
function addGlassFade() {
_root.addObj("glass_fade_loader", this, 2);
}
function addStillGlass() {
_root.addObj("glass_still", this, 3);
}
function step() {
if (enemyDead) {
glassTimer++;
if (glassTimer == 200) {
trace("Adding New Glass");
addStillGlass();
} else if (glassTimer == 180) {
addGlassFade();
}
}
}
myWindow = null;
allBroke = false;
glassTimer = 0;
enemyDead = true;
addStillGlass();
Instance of Symbol 59 MovieClip "window1" in Symbol 451 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 452 MovieClip in Symbol 467 MovieClip Frame 1
onClipEvent (load) {
_root.structures.push(this);
_alpha = 0;
}
Instance of Symbol 467 MovieClip in Symbol 468 MovieClip Frame 1
onClipEvent (load) {
vy = 0.25;
}
onClipEvent (enterFrame) {
if (!_root.paused) {
if ((timeToWait--) < 0) {
if (_y > 70) {
timeToWait = 1000;
vy = vy * -1;
_y = 70;
} else if (_y < -20) {
timeToWait = 1000;
vy = vy * -1;
_y = -20;
}
_y = (_y + vy);
}
}
}
Symbol 518 MovieClip Frame 1
stop();
Instance of Symbol 525 MovieClip in Symbol 532 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "gun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 527 MovieClip in Symbol 532 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "shotgun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 529 MovieClip in Symbol 532 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rpg") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 531 MovieClip in Symbol 532 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "uzi") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 262 MovieClip in Symbol 532 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((_root.shooting_mode == "gun") || (_root.shooting_mode == "bow")) {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 534 MovieClip in Symbol 536 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_root.rocket_smoke > -10) {
_root.rocket_smoke = _root.rocket_smoke - 5;
_alpha = _root.rocket_smoke;
}
}
Instance of Symbol 267 MovieClip in Symbol 536 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_root.rocket_flame > -10) {
_root.rocket_flame = _root.rocket_flame - 10;
_alpha = _root.rocket_flame;
}
}
Symbol 544 MovieClip Frame 10
stop();
Instance of Symbol 545 MovieClip in Symbol 546 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "bow") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 536 MovieClip "launcher2" in Symbol 547 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 262 MovieClip in Symbol 547 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 529 MovieClip in Symbol 548 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rpg") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 525 MovieClip in Symbol 548 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "gun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 531 MovieClip in Symbol 548 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "uzi") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 527 MovieClip in Symbol 548 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "shotgun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 262 MovieClip in Symbol 548 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((_root.shooting_mode == "gun") || (_root.shooting_mode == "bow")) {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 536 MovieClip "launcher" in Symbol 548 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 262 MovieClip in Symbol 548 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 545 MovieClip in Symbol 549 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "bow") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 267 MovieClip "f2" in Symbol 551 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (_alpha - 30);
}
}
Instance of Symbol 267 MovieClip "f3" in Symbol 551 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (_alpha - 30);
}
}
Instance of Symbol 267 MovieClip "f1" in Symbol 551 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (_alpha - 30);
}
}
Instance of Symbol 547 MovieClip "rifle_invert" in Symbol 551 MovieClip Frame 1
onClipEvent (load) {
orig_x = _x;
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_x < orig_x) {
_x = (_x + ((orig_x - _x) / 2));
}
}
Instance of Symbol 550 MovieClip "rifle" in Symbol 551 MovieClip Frame 1
onClipEvent (load) {
orig_x = _x;
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_x < orig_x) {
_x = (_x + ((orig_x - _x) / 2));
}
}
Symbol 552 MovieClip Frame 1
stop();
Instance of Symbol 473 MovieClip in Symbol 552 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 519 MovieClip in Symbol 552 MovieClip Frame 1
onClipEvent (load) {
count = 1;
stopped = false;
gotoAndStop (75);
}
onClipEvent (enterFrame) {
pvx = Math.abs(_parent._parent.vx);
if (pvx > 0.5) {
stopped = false;
count = count + pvx;
if (count >= 60) {
count = 1;
}
gotoAndStop(Math.floor(count));
} else if (!stopped) {
if (count < 70) {
count = 75;
}
if (count <= 75) {
count = count + 0.2;
gotoAndStop(Math.floor(count));
} else {
stopped = true;
}
}
}
Instance of Symbol 551 MovieClip in Symbol 552 MovieClip Frame 1
onClipEvent (load) {
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
dx = -((_root._xmouse - _root.hero._x) + 3.5);
dy = -(((_root._ymouse - _root.hero._y) + 15.8) - _root.hero.crouch_factor);
_root.hero.mdx = dx;
_root.hero.mdy = dy;
radians = Math.atan(dy / dx);
if (_root.hero.mdx > 0) {
rifle._alpha = 0;
rifle_invert._alpha = 100;
} else {
rifle._alpha = 100;
rifle_invert._alpha = 0;
}
_rotation = _root.hero.sight._rotation;
}
Instance of Symbol 551 MovieClip in Symbol 552 MovieClip Frame 2
onClipEvent (load) {
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
dx = -((_root._xmouse - _root.hero._x) + 3.5);
dy = -(((_root._ymouse - _root.hero._y) + 15.8) - _root.hero.crouch_factor);
_root.hero.mdx = dx;
_root.hero.mdy = dy;
radians = Math.atan(dy / dx);
if (_root.hero.mdx > 0) {
rifle._alpha = 0;
rifle_invert._alpha = 100;
} else {
rifle._alpha = 100;
rifle_invert._alpha = 0;
}
_rotation = _root.hero.sight._rotation;
}
Instance of Symbol 519 MovieClip in Symbol 552 MovieClip Frame 2
onClipEvent (load) {
count = 1;
stopped = false;
gotoAndStop (75);
}
onClipEvent (enterFrame) {
pvx = Math.abs(_parent._parent.vx);
if (pvx > 0.5) {
stopped = false;
count = count + pvx;
if (count >= 60) {
count = 1;
}
gotoAndStop(Math.floor(count));
} else if (!stopped) {
if (count < 70) {
count = 75;
}
if (count <= 75) {
count = count + 0.2;
gotoAndStop(Math.floor(count));
} else {
stopped = true;
}
}
}
Instance of Symbol 519 MovieClip in Symbol 552 MovieClip Frame 3
onClipEvent (enterFrame) {
gotoAndStop (23);
}
Instance of Symbol 519 MovieClip in Symbol 552 MovieClip Frame 4
onClipEvent (enterFrame) {
gotoAndStop (23);
}
Instance of Symbol 473 MovieClip in Symbol 552 MovieClip Frame 5
onClipEvent (load) {
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
}
Instance of Symbol 519 MovieClip in Symbol 552 MovieClip Frame 5
onClipEvent (load) {
frame = 76;
gotoAndStop(frame);
}
onClipEvent (enterFrame) {
count = _parent._parent.crouch_count;
gotoAndStop(frame + count);
}
Instance of Symbol 551 MovieClip in Symbol 552 MovieClip Frame 6
onClipEvent (load) {
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
dx = -((_root._xmouse - _root.hero._x) + 3.5);
dy = -(((_root._ymouse - _root.hero._y) + 15.8) - _root.hero.crouch_factor);
_root.hero.mdx = dx;
_root.hero.mdy = dy;
radians = Math.atan(dy / dx);
if (_root.hero.mdx > 0) {
rifle._alpha = 0;
rifle_invert._alpha = 100;
} else {
rifle._alpha = 100;
rifle_invert._alpha = 0;
}
_rotation = _root.hero.sight._rotation;
}
Instance of Symbol 519 MovieClip in Symbol 552 MovieClip Frame 6
onClipEvent (load) {
frame = 76;
gotoAndStop(frame);
}
onClipEvent (enterFrame) {
count = _parent._parent.crouch_count;
gotoAndStop(frame + count);
}
Instance of Symbol 519 MovieClip in Symbol 552 MovieClip Frame 7
onClipEvent (load) {
frame = 76;
gotoAndStop(frame);
}
onClipEvent (enterFrame) {
count = _parent._parent.crouch_count;
trace("Count: " + count);
gotoAndStop(frame + count);
}
Symbol 555 MovieClip Frame 1
function step() {
right_foot = _root.ground.ground_body.hitTest(_x + 6, _y, 1);
left_foot = _root.ground.ground_body.hitTest(_x - 6, _y, 1);
right_hand = _root.ground.ground_body.hitTest(_x + 6, _y - 8, 1);
left_hand = _root.ground.ground_body.hitTest(_x - 6, _y - 8, 1);
bottom = _root.ground.ground_body.hitTest(_x, _y, 1);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 1)) {
struct_on = _root.structures[ndx];
hitstruct = true;
break;
}
}
bottom = bottom || (hitstruct);
if (!grounded) {
grounded = _root.ground.hitTest(_x, _y + 5, 1) || (struct_on.hitTest(_x, _y + 5, 1));
}
if (grounded) {
jump_count = 0;
} else if (jump_count < 1) {
jump_count++;
}
if (right_hand) {
if (vx > 0) {
vx = 0;
}
vx = vx - 0.1;
} else if (left_hand) {
if (vx < 0) {
vx = 0;
}
vx = vx + 0.1;
}
if (bottom) {
if (vy > 3) {
crouch_count = 20;
crouching = true;
}
if (delta > 0) {
delta = 0;
}
delta = delta - 0.04;
vy = delta;
vx = vx * 0.85;
} else if (delta < 0) {
delta = 0;
}
if (_x < half_width) {
_x = half_width;
} else if (_x > (_root.g_width - half_width)) {
_x = (_root.g_width - half_width);
}
if (_y < half_height) {
_y = half_height;
} else if (_y > (_root.g_ground - half_height)) {
_y = (_root.g_ground - half_height);
}
if (!crouching) {
if (Key.isDown(_root.KEY_D) && (!right_hand)) {
body_dir = 1;
if (vx < 1.5) {
vx = vx + 0.2;
}
aim_error = 8;
max_spread = 20;
} else if (Key.isDown(_root.KEY_A) && (!left_hand)) {
body_dir = -1;
if (vx > -1.5) {
vx = vx - 0.2;
}
aim_error = 8;
max_spread = 20;
} else {
if ((vx < 0.01) && (vx > -0.01)) {
vx = 0;
} else {
vx = vx * 0.99;
}
if (grounded) {
aim_error = 5;
max_spread = 15;
} else {
aim_error = 15;
max_spread = 25;
}
}
} else {
max_spread = 5;
aim_error = 0;
}
if ((!wants_to_crouch) && (Key.isDown(_root.KEY_LEFTCONTROL))) {
wants_to_crouch = true;
}
if (wants_to_crouch && (grounded)) {
if ((vx > -0.01) && (vx < 0.01)) {
if (vx < 0) {
body_dir = -1;
} else if (vx > 0) {
body_dir = 1;
}
vx = 0;
crouching = true;
if (crouch_count < 20) {
crouch_count = crouch_count + 2;
}
} else {
vx = vx * 0.85;
}
} else if (crouch_count >= 1) {
crouch_count = crouch_count - 2;
} else {
crouching = false;
}
crouch_factor = crouch_count * 0.3;
if (((Key.isDown(_root.KEY_SPACEBAR) && (jump_count < 1)) && (space_released)) && (!crouching)) {
jump_count++;
space_released = false;
grounded = false;
vy = -2;
}
if (!Key.isDown(_root.KEY_SPACEBAR)) {
space_released = true;
holdcount = 0;
} else {
holdcount++;
wants_to_crouch = false;
}
if ((Key.isDown(_root.KEY_A) || (Key.isDown(_root.KEY_D))) || (Key.isDown(_root.KEY_W))) {
wants_to_crouch = false;
}
xprev = _x;
yprev = _y;
vy = vy + gravity;
animate();
_x = (_x + vx);
_y = (_y + vy);
checkFiring();
}
function checkFiring() {
if (_root.shooting_mode == "gun") {
if (timeToShoot > 0) {
timeToShoot--;
}
} else if (_root.shooting_mode == "rocket") {
if (timeToShootRocket > 0) {
timeToShootRocket--;
}
} else if (_root.shooting_mode == "rpg") {
if (timeToShootRPG > 0) {
timeToShootRPG--;
}
} else if (_root.shooting_mode == "shotgun") {
if (timeToShootShotgun > 0) {
timeToShootShotgun--;
}
} else if (_root.shooting_mode == "uzi") {
if (timeToShootUzi > 0) {
timeToShootUzi--;
}
} else if (_root.shooting_mode == "bow") {
if (timeToShootBow > 0) {
timeToShootBow--;
}
}
if (timeToThrow > 0) {
timeToThrow--;
}
if (_root.firing) {
if ((_root.shooting_mode == "gun") && (_root.ammo_bullets > 0)) {
if (timeToShoot <= 0) {
_root.shootHeroProjectile();
sight.f1._alpha = 100;
sight.f2._alpha = 100;
sight.f3._alpha = 100;
_root.aim_rate = 0;
if (_root.gun_wild < max_spread) {
_root.gun_wild = _root.gun_wild + 4;
}
timeToShoot = 7;
}
} else if ((_root.shooting_mode == "uzi") && (_root.ammo_bullets > 0)) {
if (timeToShootUzi <= 0) {
_root.shootHeroUzi();
sight.f1._alpha = 100;
sight.f2._alpha = 100;
sight.f3._alpha = 100;
_root.aim_rate = 0;
if (_root.gun_wild < max_spread) {
_root.gun_wild = _root.gun_wild + 10;
}
timeToShootUzi = 3;
}
} else if ((_root.shooting_mode == "rocket") && (_root.ammo_rockets > 0)) {
if (timeToShootRocket <= 0) {
_root.shootHeroRocket();
timeToShootRocket = 100;
}
} else if ((_root.shooting_mode == "shotgun") && (_root.ammo_shells > 0)) {
if (timeToShootShotgun <= 0) {
_root.shootHeroShotgun();
timeToShootShotgun = 50;
}
} else if ((_root.shooting_mode == "rpg") && (_root.ammo_rpg > 0)) {
if (timeToShootRPG <= 0) {
_root.shootRPG();
timeToShootRPG = 35;
}
} else if ((_root.shooting_mode == "bow") && (_root.ammo_arrows > 0)) {
if (timeToShootBow <= 0) {
_root.shootArrow();
timeToShootBow = 20;
}
}
}
if (_root.gun_wild > aim_error) {
if (_root.aim_rate > 0) {
_root.aim_rate = 0;
}
_root.aim_rate = _root.aim_rate - 0.05;
} else {
if (_root.aim_rate < 0) {
_root.aim_rate = 0;
}
_root.aim_rate = _root.aim_rate + 0.05;
}
_root.gun_wild = _root.gun_wild + _root.aim_rate;
if ((Key.isDown(_root.KEY_E) && (timeToThrow <= 0)) && (_root.ammo_grenades > 0)) {
timeToThrow = 60;
_root.shootGrenade();
}
if ((Key.isDown(_root.KEY_R) && (timeToThrow <= 0)) && (_root.ammo_prox_mines > 0)) {
timeToThrow = 60;
_root.shootProximityMine();
}
}
function takeDamage(dmg) {
_root.playHitEnemySound();
hp = hp - dmg;
}
function animate() {
if ((body_dir > 0) && (crouching)) {
body.gotoAndStop("crouch_right");
} else if ((body_dir < 0) && (crouching)) {
body.gotoAndStop("crouch_left");
} else if ((body_dir > 0) && (grounded)) {
body.gotoAndStop("run_right");
} else if ((body_dir < 0) && (grounded)) {
body.gotoAndStop("run_left");
} else if ((body_dir > 0) && (!grounded)) {
body.gotoAndStop("fly_right");
} else if ((body_dir < 0) && (!grounded)) {
body.gotoAndStop("fly_left");
}
}
delta = 0;
half_width = 5;
half_height = 13;
gravity = 0.08;
grounded = false;
vx = 0;
space_released = true;
holding = false;
xprev = 0;
yprev = 0;
holdcount = 0;
crouch_count = 1;
crouching = false;
body_dir = 1;
crouch_factor = 0;
timeToThrow = 10;
timeToShoot = 10;
timeToShootRocket = 10;
timeToShootBow = 10;
timeToShootRPG = 10;
timeToShootShotgun = 10;
timeToShootUzi = 10;
jump_count = 0;
aim_error = 0;
struct_on = null;
wants_to_crouch = false;
Instance of Symbol 552 MovieClip "body" in Symbol 555 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 553 MovieClip "sight" in Symbol 555 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
dx = -((_root._xmouse - _root.hero._x) + 3.5);
dy = -(((_root._ymouse - _root.hero._y) + 15.8) - _root.hero.crouch_factor);
_root.hero.mdx = dx;
_root.hero.mdy = dy;
radians = Math.atan(dy / dx);
if (dx > 0) {
_rotation = (((radians * 180) / Math.PI) + 180);
} else {
_rotation = ((radians * 180) / Math.PI);
}
}
Instance of Symbol 554 MovieClip "hitbox" in Symbol 555 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
yorig = _y;
h_orig = _height;
}
onClipEvent (enterFrame) {
_height = (h_orig - _parent.crouch_factor);
}
Symbol 559 Button
on (keyPress "1") {
_root.shooting_mode = "gun";
_root.cross_hair.ch_gun._alpha = 100;
_root.cross_hair.ch_rocket._alpha = 0;
_root.cross_hair.ch_shotgun._alpha = 0;
}
on (keyPress "2") {
_root.shooting_mode = "rpg";
_root.cross_hair.ch_gun._alpha = 0;
_root.cross_hair.ch_rocket._alpha = 100;
_root.cross_hair.ch_shotgun._alpha = 0;
}
on (keyPress "3") {
_root.shooting_mode = "rocket";
_root.cross_hair.ch_gun._alpha = 0;
_root.cross_hair.ch_rocket._alpha = 100;
_root.cross_hair.ch_shotgun._alpha = 0;
}
on (keyPress "4") {
_root.shooting_mode = "shotgun";
_root.cross_hair.ch_gun._alpha = 0;
_root.cross_hair.ch_rocket._alpha = 0;
_root.cross_hair.ch_shotgun._alpha = 100;
}
on (keyPress "5") {
_root.shooting_mode = "uzi";
_root.cross_hair.ch_gun._alpha = 100;
_root.cross_hair.ch_rocket._alpha = 0;
_root.cross_hair.ch_shotgun._alpha = 0;
}
on (keyPress "p") {
if (!_root.game_ended) {
_root.paused = !_root.paused;
}
}
Symbol 563 MovieClip Frame 1
function step() {
if (timeToWait > 0) {
timeToWait--;
} else {
_y = (_y + 1);
hitstruct = false;
for (ndx in _root.structures) {
if (_root.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_y > ground_spot)) {
_root.addRandomGoodie(_x, _y);
chute = _root.addObj("parachute_fade", _root.debris_layer, _root.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 23.8;
timeToWait = random(500) + 1000;
_y = -20;
_x = (random(_root.g_width - 30) + 15);
}
}
}
timeToWait = 0;
ground_spot = _root.bullet_ground - 20;
Instance of Symbol 562 MovieClip in Symbol 563 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 576 MovieClip Frame 1
function step() {
if (_root.paused) {
pause_text = "unpause";
} else {
pause_text = "pause";
}
}
pause_text = "pause";
Instance of Symbol 574 MovieClip in Symbol 576 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 577 Button
on (release) {
if (!_root.game_ended) {
_root.paused = !_root.paused;
}
}
on (keyPress "p") {
if (!_root.game_ended) {
_root.paused = !_root.paused;
}
}
Symbol 578 Button
on (release) {
if (!_root.game_ended) {
_root.openNamer();
}
}
Symbol 579 Button
on (release) {
_root.openHelp();
}
Symbol 580 Button
on (release) {
if (!_root.game_ended) {
_root.showTopScores();
}
}
Instance of Symbol 599 MovieClip in Symbol 600 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = _root.gun_wild;
}
Instance of Symbol 599 MovieClip in Symbol 600 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = (-_root.gun_wild);
}
Instance of Symbol 599 MovieClip in Symbol 600 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = _root.gun_wild;
}
Instance of Symbol 599 MovieClip in Symbol 600 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = (-_root.gun_wild);
}
Instance of Symbol 602 MovieClip "ch_shotgun" in Symbol 605 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 604 MovieClip "ch_rocket" in Symbol 605 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 615 Button
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
Instance of Symbol 621 MovieClip in Symbol 622 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = _root.bow._rotation;
}
Symbol 623 Button
on (press) {
startDrag (this);
_root.holding_string = true;
}
on (releaseOutside) {
stopDrag();
if (!_root.paused) {
_root.holding_string = false;
if (_root.ammo_arrows > 0) {
_root.shootArrow();
}
}
}
on (release) {
stopDrag();
if (!_root.paused) {
_root.holding_string = false;
if (_root.ammo_arrows > 0) {
_root.shootArrow();
}
}
}
Instance of Symbol 624 MovieClip "string" in Symbol 625 MovieClip Frame 1
onClipEvent (load) {
time = 0;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (!_root.holding) {
time = time + _root.elapsed;
}
if ((time > _root.g_bow_cooldown) && (!_root.holding)) {
_x = _root.bow._x;
_y = _root.bow._y;
_root.holding = true;
time = 0;
_alpha = 100;
}
}
}
Symbol 626 Button
on (release) {
_root.age = 18;
if (!_root.first_time_playing) {
_root.paused = false;
}
this.unloadMovie();
}
Symbol 627 Button
on (release) {
_root.age = 1;
if (!_root.first_time_playing) {
_root.paused = false;
}
this.unloadMovie();
}
Symbol 638 Button
on (release) {
getURL ("http://www.ugotgames.com", "_self");
}
Instance of Symbol 625 MovieClip in Symbol 639 MovieClip Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
Instance of Symbol 635 MovieClip in Symbol 639 MovieClip Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
onClipEvent (load) {
_alpha = 0;
}