Frame 1
loadedBytes = _root.getBytesLoaded();
totalBytes = _root.getBytesTotal();
if (_framesloaded >= _totalframes) {
gotoAndPlay (3);
} else {
percentageOutput = int((loadedBytes / totalBytes) * 100);
_root.loading_screen.loaderBar._xscale = percentageOutput;
_root.dude_head.gotoAndStop(Math.ceil(percentageOutput));
gotoAndPlay (1);
}
Frame 2
gotoAndPlay (1);
Frame 3
_root.gameStartTime = getTimer();
Instance of Symbol 87 MovieClip in Frame 3
onClipEvent (load) {
stopAllSounds();
}
Frame 4
stop();
Instance of Symbol 572 MovieClip in Frame 4
onClipEvent (enterFrame) {
if (getTimer() > (_root.gameStartTime + 6000)) {
_root.gotoAndStop("game");
this.unloadMovie();
} else {
gotoAndStop(Math.floor((((getTimer() - _root.gameStartTime) * 15) / 1000) % 190) +2);
}
}
Frame 5
function saveData() {
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() {
var _local1 = _root;
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;
_local1.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;
_local1.end_text = "New high score! 2nd Place";
} else if (score > place_score_3) {
place_score_3 = score;
place_name_3 = player_name;
_local1.end_text = "New high score! 3rd Place";
} else if (score > 1000) {
_local1.end_text = "Nice shooting.";
} else if (score > 700) {
_local1.end_text = "Not bad. Keep Practicing";
} else if (score > 400) {
_local1.end_text = "Ouch... better luck next time.";
} else {
_local1.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() {
var _local1 = _root;
game_ended = false;
_local1.level_ticker = 0;
_local1.fps_ticks = 0;
_local1.fps_total = 0;
_local1.avg_fps = 0;
_local1.max_fps = 0;
_local1.min_fps = 9999;
_local1.stepper.resetStepperVars();
_local1.hero._visible = true;
_local1.hero._alpha = 100;
_local1.hero.hp = 100;
_local1.hero.vx = 0;
_local1.hero.vy = 0;
_local1.score = 0;
_local1.level = 1;
_local1.ammo_grenades = 15;
_local1.ammo_arrows = 25;
_local1.ammo_bullets = 500;
_local1.ammo_rockets = 10;
_local1.ammo_prox_mines = 20;
_local1.ammo_shells = 20;
_local1.ammo_rpg = 8;
_local1.hero._x = (_local1.g_width / 2) - 20;
_local1.hero._y = _local1.g_ground / 2;
_local1.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() {
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() {
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() {
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() {
help_screen.unloadMovie();
}
function playHitEnemySound() {
playSound(hurtsounds[random(3)]);
}
function addRandomGoodie(x, y) {
var _local1 = _root;
bonus = powerups[random(powerups.length)];
if (bonus == "gas_can") {
obs = _local1.addObj(bonus, _local1.obstruct_layer, _local1.getNextObstructionLevel());
obs._x = x;
obs._y = y;
} else {
obs = _local1.addObj(bonus, _local1.powerup_layer, _local1.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() {
var _local1 = _root;
playSound("swoosh.wav");
ammo_arrows--;
shot_speed = 8;
rads = (_local1.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 = _local1.addObj("hero_arrow", _local1.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 = _local1.hero.sight._rotation;
}
function shootRPG() {
var _local1 = _root;
playSound("tat1.wav");
ammo_rpg--;
shot_speed = 8;
rads = (_local1.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 = _local1.addObj("rpg", _local1.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 = _local1.hero.sight._rotation;
}
function placeDebrisArrow(x, y, rot) {
var _local1 = _root;
temp = _local1.addObj("arrow_debris", _local1.debris_layer, _local1.getNextDebrisLevel());
temp._x = x;
temp._y = y;
temp._rotation = rot;
}
function placeDebrisType(x, y, rot, dtype) {
var _local1 = _root;
temp = _local1.addObj(dtype, _local1.debris_layer, _local1.getNextDebrisLevel());
temp._x = x;
temp._y = y;
temp._rotation = rot;
}
function removeEnemy(ene) {
var _local1 = ene;
tempArray = new Array();
for (i in enemies) {
nextEn = enemies[i];
if (_local1 != nextEn) {
tempArray.push(nextEn);
}
}
_local1.unloadMovie();
enemies = tempArray;
}
function removeMine(mi) {
var _local1 = mi;
tempArray = new Array();
for (i in mines) {
nextObj = mines[i];
if (_local1 != nextObj) {
tempArray.push(nextObj);
}
}
_local1.unloadMovie();
mines = tempArray;
}
function removeObstruction(obs) {
var _local1 = obs;
tempArray = new Array();
for (i in obstructions) {
nextObs = obstructions[i];
if (_local1 != nextObs) {
tempArray.push(nextObs);
}
}
_local1.unloadMovie();
obstructions = tempArray;
}
function shootHeroProjectile() {
var _local1 = _root;
playSound("tat2.wav");
ammo_bullets--;
_local1.hero.recoil = 5;
shot_speed = 8;
variation = (random(Math.floor(_local1.gun_wild * 100)) - random(Math.floor(_local1.gun_wild * 100))) / 300;
rads = ((_local1.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 = _local1.addObj("hero_bullet", _local1.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 = _local1.hero.sight._rotation;
}
function shootHeroUzi() {
var _local1 = _root;
playSound("tat2.wav");
ammo_bullets--;
_local1.hero.recoil = 5;
shot_speed = 6;
variation = (random(Math.floor(_local1.gun_wild * 100)) - random(Math.floor(_local1.gun_wild * 100))) / 300;
rads = ((_local1.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 = _local1.addObj("hero_bullet", _local1.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 = _local1.hero.sight._rotation;
}
function shootHeroShotgun() {
var _local1 = _root;
playSound("tat2.wav");
ammo_shells--;
_local1.hero.recoil = 5;
shot_speed = 8;
deg = -2;
while (deg <= 2) {
rads = ((_local1.hero.sight._rotation + (deg * 2)) * Math.PI) / 180;
xfactor = Math.cos(rads);
yfactor = Math.sin(rads);
lvx = shot_speed * xfactor;
lvy = shot_speed * yfactor;
lvl = getNextProjectileLevel();
proj = _local1.addObj("hero_bullet", _local1.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 = _local1.hero.sight._rotation;
deg++;
}
}
function shrapnelExplosion(x, y, amt) {
var _local1 = _root;
var _local2 = amt;
var _local3 = y;
ndx = 0;
while (ndx < _local2) {
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 = _local1.addObj("hero_shrap", _local1.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = x;
proj._y = _local3;
proj._rotation = rot;
ndx++;
}
}
function shootHeroRocket() {
var _local1 = _root;
playSound("shoot_rocket.wav");
rocket_smoke = 105;
rocket_flame = 130;
ammo_rockets--;
targ_ene = null;
targ_acq = false;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitTest(_xmouse, _ymouse, 0)) {
targ_ene = _local1.enemies[i];
targ_acq = true;
break;
}
}
_local1.hero.sight.rifle_invert._x = _local1.hero.sight.rifle_invert._x - 5;
_local1.hero.sight.rifle._x = _local1.hero.sight.rifle._x - 5;
shot_speed = 6;
rads = (_local1.hero.sight._rotation * Math.PI) / 180;
lvx = shot_speed * Math.cos(rads);
lvy = shot_speed * Math.sin(rads);
lvl = getNextRocketLevel();
proj = _local1.addObj("missile", _local1.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 = _local1.hero.sight._rotation;
proj.target_enemy = targ_ene;
proj.target_acquired = targ_acq;
}
function shootGrenade() {
var _local1 = _root;
ammo_grenades--;
shot_speed = 4;
variation = 0;
rads = ((_local1.hero.sight._rotation + variation) * Math.PI) / 180;
lvx = shot_speed * Math.cos(rads);
lvy = shot_speed * Math.sin(rads);
lvl = getNextProjectileLevel();
proj = _local1.addObj("hero_grenade", _local1.projectile_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = ((hero._x + hero.sight._x) + lvx) + _local1.hero.vx;
proj._y = ((hero._y + hero.sight._y) + lvy) + _local1.hero.vy;
}
function shootProximityMine() {
var _local1 = _root;
ammo_prox_mines--;
shot_speed = 2;
variation = 0;
rads = ((_local1.hero.sight._rotation + variation) * Math.PI) / 180;
lvx = shot_speed * Math.cos(rads);
lvy = shot_speed * Math.sin(rads);
lvl = getNextMineLevel();
proj = _local1.addObj("proximity_mine", _local1.mine_layer, lvl);
proj.vx = lvx;
proj.vy = lvy;
proj._x = ((hero._x + hero.sight._x) + lvx) + _local1.hero.vx;
proj._y = ((hero._y + hero.sight._y) + lvy) + _local1.hero.vy;
mines.push(proj);
}
function placeBlood(x, y) {
var _local1 = _root;
if (_local1.age >= 17) {
playSound("blood_splat.wav");
lvl = getNextCraterLevel();
temp = _local1.addObj("crater2", _local1.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) {
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) {
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++) > 30) {
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) {
var _local1 = _root;
var _local2 = amt;
var _local3 = dtype;
i = 0;
while (i < _local2) {
lvl = getNextDebrisLevel();
temp = _local1.addObj(_local3, _local1.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) {
var _local1 = _root;
var _local2 = radius;
var _local3 = y;
playSound("bomb_hit.wav");
lvl = getNextCraterLevel();
temp = _local1.addObj("crater1", _local1.ground.crater_layer, lvl);
temp._x = x;
temp._y = _local3;
temp._rotation = random(360);
lvl = getNextDebrisLevel();
temp = _local1.addObj("explosion", _local1.debris_layer, lvl);
temp._x = x;
temp._y = _local3;
temp._xscale = (temp._yscale = _local2);
deb = Math.ceil(_local2 / 40);
i = 0;
while (i < deb) {
lvl = getNextDebrisLevel();
temp = _local1.addObj(dtype, _local1.debris_layer, lvl);
temp._x = x;
temp._y = _local3;
temp.vx = (random(100) - random(100)) / 50;
temp.vy = ((-random(100)) / 50) - 2;
i++;
}
for (i in _local1.enemies) {
ene = enemies[i];
dx = ene._x - x;
dy = (ene._y - 20) - _local3;
dist = getDist(x, _local3, ene._x, ene._y - 25);
if (dist < _local2) {
ene.deathCode = "exploded";
impact = Math.ceil((dmg * (_local2 - dist)) / _local2);
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 _local1.obstructions) {
obs = obstructions[i];
dist = getDist(x, _local3, obs._x, obs._y);
if (dist < _local2) {
obs.leaking = obs.leaking + (random(10) / 10);
obs.deathCode = "exploded";
obs.explosion_dist = -dx;
}
}
for (i in _local1.mines) {
obs = mines[i];
dist = getDist(x, _local3, obs._x, obs._y);
if (dist < _local2) {
obs.leaking = obs.leaking + (2 + (random(10) / 10));
obs.deathCode = "exploded";
}
}
dx = _local1.hero._x - x;
dy = (_local1.hero._y - 20) - _local3;
dist = getDist(x, _local3, _local1.hero._x, _local1.hero._y - 20);
if (dist < _local2) {
_local1.hero._y = _local1.hero._y - 2;
impact = Math.ceil((dmg * (_local2 - dist)) / _local2);
fly = impact;
if (impact > 15) {
fly = 15;
}
_local1.hero.vx = (((-dx) / dist) * fly) * 0.33;
_local1.hero.vy = (((-dy) / dist) * fly) * 0.33;
_local1.addBloodExplosion(_local1.hero._x, _local1.hero._y - 20);
_local1.hero.takeDamage(impact);
}
}
function addExplosion(x, y, radius, dmg) {
var _local1 = _root;
var _local2 = radius;
var _local3 = y;
playSound("bomb_hit.wav");
lvl = getNextCraterLevel();
temp = _local1.addObj("crater1", _local1.ground.crater_layer, lvl);
temp._x = x;
temp._y = _local3;
temp._rotation = random(360);
lvl = getNextDebrisLevel();
temp = _local1.addObj("explosion", _local1.debris_layer, lvl);
temp._x = x;
temp._y = _local3;
temp._xscale = (temp._yscale = _local2);
deb = Math.ceil(_local2 / 40);
i = 0;
while (i < deb) {
lvl = getNextDebrisLevel();
temp = _local1.addObj("debris1", _local1.debris_layer, lvl);
temp._x = x;
temp._y = _local3;
temp.vx = (random(100) - random(100)) / 50;
temp.vy = ((-random(100)) / 50) - 2;
i++;
}
for (i in _local1.enemies) {
ene = enemies[i];
dx = ene._x - x;
dy = (ene._y - 20) - _local3;
dist = getDist(x, _local3, ene._x, ene._y - 25);
if (dist < _local2) {
ene.deathCode = "exploded";
impact = Math.ceil((dmg * (_local2 - dist)) / _local2);
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 _local1.obstructions) {
obs = obstructions[i];
dist = getDist(x, _local3, obs._x, obs._y);
if (dist < _local2) {
obs.leaking = obs.leaking + (random(10) / 10);
obs.deathCode = "exploded";
obs.explosion_dist = -dx;
}
}
for (i in _local1.mines) {
obs = mines[i];
dist = getDist(x, _local3, obs._x, obs._y);
if (dist < _local2) {
obs.leaking = obs.leaking + (2 + (random(10) / 10));
obs.deathCode = "exploded";
}
}
dx = _local1.hero._x - x;
dy = (_local1.hero._y - 20) - _local3;
dist = getDist(x, _local3, _local1.hero._x, _local1.hero._y - 20);
if (dist < _local2) {
_local1.hero._y = _local1.hero._y - 2;
impact = Math.ceil((dmg * (_local2 - dist)) / _local2);
fly = impact;
if (impact > 15) {
fly = 15;
}
_local1.hero.vx = (((-dx) / dist) * fly) * 0.33;
_local1.hero.vy = (((-dy) / dist) * fly) * 0.33;
_local1.addBloodExplosion(_local1.hero._x, _local1.hero._y - 20);
_local1.hero.takeDamage(impact);
}
}
function addBloodExplosion(x, y) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
if (_local1.age >= 17) {
placeBlood(_local3, _local2 + 20);
c = 0;
while (c < 10) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.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 = _local3;
blood._y = _local2;
blood.vx = (dx / dist) * power;
blood.vy = (dy / dist) * power;
blood._xscale = (blood._yscale = 200 + random(200));
c++;
}
}
}
function addBloodExplosionAmt(x, y, amt) {
var _local1 = _root;
var _local2 = amt;
var _local3 = y;
if (_local1.age >= 17) {
c = 0;
while (c < _local2) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.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 = _local3;
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) {
var _local1 = xpos;
if (_local1 < s_half) {
if (_local1 < s_quart) {
return(1);
}
return(2);
}
if (_local1 < (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() {
var _local1 = _root;
temp = addObj("obs_aircond", _local1.obsfg_layer, 1);
temp._x = ac_1._x;
temp._y = ac_1._y;
temp = addObj("obs_aircond", _local1.obsfg_layer, 2);
temp._x = ac_2._x;
temp._y = ac_2._y;
temp = addObj("obs_aircond", _local1.obsfg_layer, 3);
temp._x = ac_3._x;
temp._y = ac_3._y;
temp = addObj("obs_aircond", _local1.obsfg_layer, 4);
temp._x = ac_4._x;
temp._y = ac_4._y;
temp = addObj("obs_aircond", _local1.obsfg_layer, 5);
temp._x = ac_5._x;
temp._y = ac_5._y;
temp = addObj("obs_aircond", _local1.obsfg_layer, 6);
temp._x = ac_6._x;
temp._y = ac_6._y;
}
function cleanUp() {
var _local1 = _root;
i = 1;
while (i <= 30) {
addObj("cleaner", _local1.debris_layer, i);
i++;
}
i = 1;
while (i <= 7) {
addObj("cleaner", _local1.flame_layer, i);
i++;
}
i = 1;
while (i <= 15) {
addObj("cleaner", _local1.projectile_layer, i);
i++;
}
i = 1;
while (i <= 20) {
addObj("cleaner", _local1.enemy_bullet_layer, i);
i++;
}
}
function playMusic() {
if (g_playMusic) {
musicPlayTime = musicPlayTime - _root.elapsed;
if (musicPlayTime < 0) {
musicPlayTime = 80000 /* 0x013880 */;
g_song.attachSound("music.mp3");
g_song.start(0, 1);
}
}
}
function stopMusic() {
g_song.stop("music.mp3");
musicPlayTime = 0;
g_playMusic = false;
}
function changeMusic() {
var _local1 = _root;
_local1.g_playMusic = !_local1.g_playMusic;
if (!_local1.g_playMusic) {
g_musicText = "off";
_local1.stopMusic();
} else {
g_musicText = "on";
}
}
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) {
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 {
_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;
openHelp();
openNamer();
}
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");
g_soundOn = true;
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_playMusic = true;
musicPlayTime = 0;
g_song = new Sound();
g_musicText = "on";
g_soundText = "on";
Instance of Symbol 556 MovieClip [helm_fly] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 64 MovieClip in Frame 5
onClipEvent (enterFrame) {
frame = 1;
if (_root.hero.hp < 0) {
frame = 100;
} else {
frame = (100 - _root.hero.hp) + 1;
}
gotoAndStop(frame +2);
}
Instance of Symbol 603 MovieClip in Frame 5
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 487 MovieClip [game_over_screen] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 523 MovieClip [help_screen] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 119 MovieClip [namer_screen] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 176 MovieClip [top_scores] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 462 MovieClip [enemy_tank] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 245 MovieClip [blood_stump] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 411 MovieClip [enemy_bullet] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 540 MovieClip [missile] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 529 MovieClip [hero_grenade] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 438 MovieClip [enemy_rocket] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 464 MovieClip [enemy1] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 528 MovieClip [hero_bullet] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 142 MovieClip [proximity_mine] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 433 MovieClip [enemy_drop] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 449 MovieClip [enemy_sniper] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 437 MovieClip [enemy_drop_sniper] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 451 MovieClip [enemy_sniper_death] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 270 MovieClip [blood_stump_fem] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 145 MovieClip [rpg] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 551 MovieClip [enemy_drop_rocket] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 545 MovieClip [enemy_rocket_shooter] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 549 MovieClip [enemy_drop_rpg] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 553 MovieClip [enemy_rpg_shooter] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 554 MovieClip [enemy_rpg] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 622 MovieClip [enemy2] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 661 MovieClip "stepper" in Frame 5
onClipEvent (load) {
function switchGameModes() {
var _local1 = _root;
if (_local1.gameType == "progressive") {
_local1.gameType = "all";
cur_mode = all_mode;
} else {
_local1.gameType = "progressive";
cur_mode = progressive_mode;
}
}
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;
endDelay = 0;
}
function addEnemyTank() {
var _local1 = _root;
if (random(2) == 0) {
_local1.placeEnemy("enemy_tank", -20, 320, 0.5, 0);
} else {
_local1.placeEnemy("enemy_tank", _local1.g_width + 20, 330, -0.5, 0);
}
}
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;
endDelay = 0;
level01 = new Array("enemy1");
level02 = new Array("enemy1", "enemy_drop");
level03 = new Array("enemy1", "enemy_drop", "enemy_drop_sniper");
level04 = new Array("enemy1", "enemy_drop", "enemy_drop_sniper", "enemy_drop_rocket");
level05 = new Array("enemy1", "enemy_drop", "enemy_drop_sniper", "enemy_drop_rocket", "enemy_drop_rpg");
level06 = new Array("enemy1", "enemy_drop", "enemy_drop_sniper", "enemy_drop_rocket", "enemy_drop_rpg", "enemy2");
level07 = new Array("enemy1", "enemy_drop", "enemy_drop_sniper", "enemy_drop_rocket", "enemy_drop_rpg", "enemy2", "enemy_chopper");
level08 = new Array("enemy1", "enemy_drop", "enemy_drop_sniper", "enemy_drop_rocket", "enemy_drop_rpg", "enemy2", "enemy_chopper", "enemy_a10");
level09 = new Array("enemy1", "enemy_drop", "enemy_drop_sniper", "enemy_drop_rocket", "enemy_drop_rpg", "enemy2", "enemy_chopper", "enemy_a10", "enemy_bomber");
level10 = new Array("enemy1", "enemy_drop", "enemy_drop_sniper", "enemy_drop_rocket", "enemy_drop_rpg", "enemy2", "enemy_chopper", "enemy_a10", "enemy_bomber", "enemy_tank");
game_levels = new Array(level01, level02, level03, level04, level05, level06, level07, level08, level09, level10, level10, level10, level10, level10);
progressive_mode = game_levels;
all_mode = new Array(new Array("enemy1", "enemy_drop", "enemy_drop_sniper", "enemy_drop_rocket", "enemy_drop_rpg", "enemy2", "enemy_chopper", "enemy_a10", "enemy_bomber", "enemy_tank"));
cur_mode = progressive_mode;
timeToNextDrop = 0;
resetStepperVars();
}
onClipEvent (enterFrame) {
ctime = getTimer();
_root.elapsed = ctime - _root.prev_time;
_root.time_count = _root.time_count + _root.elapsed;
_root.prev_time = ctime;
_root.frame_count++;
if (_root.time_count > 333) {
_root.time_count = 0;
_root.fps = _root.frame_count * 3;
_root.frame_count = 0;
}
_root.playMusic();
if (((!_root.paused) && (_root.enemy_count < _root.max_enemies_on_screen)) && ((timeToNextDrop--) <= 0)) {
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_rocket") {
if (random(2) == 0) {
_root.placeEnemy("enemy_drop_rocket", _root.tower_left._x, -10, 0, 0);
} else {
_root.placeEnemy("enemy_drop_rocket", _root.tower_right._x, -10, 0, 0);
}
timeToNextDrop = random(100) + 50;
} else if (ene_type == "enemy_drop_rpg") {
_root.placeEnemy("enemy_drop_rpg", ((_root.g_width / 2) + random(300)) - random(300), -10, 0, 0);
timeToNextDrop = random(200) + 25;
} 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_tank") {
addEnemyTank();
timeToNextDrop = random(200) + 25;
} else if (ene_type == "enemy2") {
if (random(2) == 0) {
_root.placeEnemy("enemy2", -20, _root.g_ground - 50, 0, 0);
} else {
_root.placeEnemy("enemy2", _root.g_width + 20, _root.g_ground - 50, 0, 0);
}
timeToNextDrop = random(100) + 50;
} 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 >= 7) {
_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++) > 300)) {
endDelay = 0;
_root.game_ended = true;
_root.endGame();
}
_root.enemy_count = _root.enemies.length;
_root.mine_count = _root.mines.length;
updateAfterEvent();
}
Instance of Symbol 431 MovieClip [enemy_chopper] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 378 MovieClip [chopper_dead] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 408 MovieClip [enemy_bomber] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 342 MovieClip [bomber_dead] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 397 MovieClip [enemy_a10] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 180 MovieClip [a10_dead] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 416 MovieClip [enemy_car] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 419 MovieClip [enemy_car_dead] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Instance of Symbol 669 MovieClip "cross_hair" in Frame 5
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}
Instance of Symbol 144 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 688 MovieClip in Frame 5
onClipEvent (load) {
_root.paused = true;
_x = (_root.g_width / 2);
_y = (_root.g_ground / 2);
}
Instance of Symbol 166 MovieClip [tank_shell] in Frame 5
onClipEvent (load) {
this.unloadMovie();
}
Symbol 10 Button
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
Instance of Symbol 17 MovieClip in Symbol 19 MovieClip Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
Symbol 64 MovieClip Frame 1
stop();
Symbol 95 Button
on (release) {
_root.closeNamer();
_root.paused = false;
}
Symbol 119 MovieClip [namer_screen] Frame 1
_root.opt_text = "";
Instance of Symbol 102 MovieClip in Symbol 119 MovieClip [namer_screen] Frame 1
on (release) {
_root.changeSound();
}
on (rollOver) {
_root.opt_text = "Toggle sound effects on/off";
}
on (rollOut) {
_root.opt_text = "";
}
Instance of Symbol 106 MovieClip in Symbol 119 MovieClip [namer_screen] Frame 1
on (release) {
_root.changeMusic();
}
on (rollOver) {
_root.opt_text = "Toggle looping music on/off";
}
on (rollOut) {
_root.opt_text = "";
}
Instance of Symbol 112 MovieClip in Symbol 119 MovieClip [namer_screen] Frame 1
on (rollOver) {
_root.opt_text = "Progressive: different amounts and types of enemies for each level.\n\nAll Mode: every enemy has an equal chance of being loaded.\n\nIn both modes, the difficulty increases as the levels increase.";
}
on (rollOut) {
_root.opt_text = "";
}
on (release) {
_root.stepper.switchGameModes();
}
Instance of Symbol 118 MovieClip in Symbol 119 MovieClip [namer_screen] Frame 1
on (release) {
getURL ("http://www.marcustyr.com", "_blank");
}
onClipEvent (load) {
_alpha = 0;
}
Symbol 125 MovieClip [napalm_flame] Frame 1
function scan() {
var _local1 = _root;
closeEnemies = new Array();
for (ndx in _local1.enemies) {
dx = _local1.enemies[ndx]._x - _x;
dy = _local1.enemies[ndx]._y - _y;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dist < 200) {
closeEnemies.push(_local1.enemies[ndx]);
}
}
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
dist = Math.sqrt((dx * dx) + (dy * dy));
checkHero = dist < 200;
}
function step() {
var _local1 = _root;
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(_local1.hero._x, _local1.hero._y, 0))) {
_local1.hero.takeDamage(5);
}
}
if ((timeToScan++) > 50) {
timeToScan = 0;
scan();
}
}
closeEnemies = new Array();
scan();
checkHero = false;
timeToCheck = 100;
Instance of Symbol 122 MovieClip in Symbol 125 MovieClip [napalm_flame] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 125 MovieClip [napalm_flame] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 135 MovieClip Frame 1
stop();
Symbol 136 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 135 MovieClip "can_animation" in Symbol 136 MovieClip [obs_aircond] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 139 MovieClip [parachute_fade] Frame 20
this.unloadMovie();
Symbol 142 MovieClip [proximity_mine] Frame 1
function step() {
var _local1 = _root;
if (placed) {
vx = 0;
vy = 0;
hp = hp - leaking;
if (hp <= 0) {
_local1.addExplosion(_x, _y, range, dmg);
_local1.removeMine(this);
}
if ((timeToScan++) > 50) {
timeToScan = 0;
scan();
}
} else {
if (vx > 0) {
_rotation = (_rotation + 3);
} else {
_rotation = (_rotation - 3);
}
vy = vy + _local1.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() {
var _local1 = _root;
for (i in _local1.enemies) {
ene = _local1.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 testHitEnemies() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitTest(_x, _y, 0)) {
_local1.enemies[i].takeDamage(dmg);
_local1.addSpark("spark", _x, _y, 3);
_local1.playHitEnemySound();
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
placed = false;
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_local1.ground.ground_body.hitTest(_x, _y, 1))) {
placed = true;
} else {
do {
if ((in _local1.obstructions) == null) {
break;
}
i = in _local1.obstructions;
placed = _local1.obstructions[i].hitTest(_x, _y, 0);
} while (!placed);
do {
} while (_local1 != null);
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
hp = 25;
timeToScan = 0;
leaking = 0;
placed = false;
range = 50;
detection_range = 20;
dmg = 100;
Instance of Symbol 141 MovieClip in Symbol 142 MovieClip [proximity_mine] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 145 MovieClip [rpg] Frame 1
function setVelocity(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() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
ene = _local1.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
_local1.addExplosion(_x, _y, range, dmg);
_local1.playHitEnemySound();
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
if (_local1.ground.ground_body.hitTest(_x, _y, 1)) {
_local1.addExplosion(_x, _y, range, dmg);
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 1)) {
_local1.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_local1.addExplosion(_x, _y, range, dmg);
_local2.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 = 100;
dmg = 60;
ground_spot = _root.bullet_ground - 20;
Instance of Symbol 144 MovieClip in Symbol 145 MovieClip [rpg] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 148 MovieClip Frame 20
this.unloadMovie();
Symbol 150 MovieClip Frame 7
this.unloadMovie();
Symbol 154 MovieClip Frame 7
this.unloadMovie();
Symbol 158 MovieClip [shrap_bomb] Frame 1
function step() {
var _local1 = _root;
vy = vy + _local1.gravity;
_x = (_x + vx);
_y = (_y + vy);
if ((timeToExpload--) <= 0) {
_local1.shrapnelExplosion(_x, _y, 10);
_local1.playSound("ice_shatter.wav");
this.unloadMovie();
}
}
timeToExpload = 30;
Instance of Symbol 157 MovieClip in Symbol 158 MovieClip [shrap_bomb] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 161 MovieClip Frame 24
this.unloadMovie();
Instance of Symbol 161 MovieClip in Symbol 162 MovieClip [smoke] Frame 1
onClipEvent (load) {
_rotation = random(360);
rate = (random(100) - 50) / 10;
}
onClipEvent (enterFrame) {
_rotation = (_rotation + rate);
}
Symbol 165 MovieClip [tank_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 164 MovieClip in Symbol 165 MovieClip [tank_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 166 MovieClip [tank_shell] Frame 1
function setVelocity(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() {
var _local1 = _root;
if (_local1.hero.hitbox.hitTest(_x, _y, 0)) {
_local1.addExplosion(_x, _y, range, dmg);
_local1.playHitEnemySound();
this.unloadMovie();
}
}
function testHitStruct() {
var _local1 = _root;
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
if (hitstruct) {
_local1.addExplosion(_x, _y, range, dmg);
_local1.playHitEnemySound();
this.unloadMovie();
}
}
function testHitEnemies() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
ene = _local1.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
_local1.addExplosion(_x, _y, range, dmg);
_local1.playHitEnemySound();
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
if (_local1.ground.ground_body.hitTest(_x, _y, 1)) {
_local1.addExplosion(_x, _y, range, dmg);
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 1)) {
_local1.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_local1.addExplosion(_x, _y, range, dmg);
_local2.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 144 MovieClip in Symbol 166 MovieClip [tank_shell] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 175 Button
on (release) {
_root.closeTopScores();
}
Symbol 180 MovieClip [a10_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 179 MovieClip in Symbol 180 MovieClip [a10_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 185 MovieClip [ammo_arrow] Frame 1
function step() {
var _local1 = _root;
var _local2 = this;
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_local1.addGrenadeExplosion(_x, _y);
_local1.removeObstruction(_local2);
} else if (_alpha <= 0) {
_local1.removeObstruction(_local2);
} else if (hitTest(_local1.hero._x, _local1.hero._y, 0)) {
_local1.ammo_arrows = _local1.ammo_arrows + 20;
_local1.removeObstruction(_local2);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 184 MovieClip in Symbol 185 MovieClip [ammo_arrow] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 190 MovieClip [ammo_grenade] Frame 1
function step() {
var _local1 = _root;
var _local2 = this;
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_local1.addGrenadeExplosion(_x, _y);
_local1.removeObstruction(_local2);
} else if (_alpha <= 0) {
_local1.removeObstruction(_local2);
} else if (hitTest(_local1.hero._x, _local1.hero._y, 0)) {
_local1.ammo_grenades = _local1.ammo_grenades + 10;
_local1.removeObstruction(_local2);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 189 MovieClip in Symbol 190 MovieClip [ammo_grenade] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 195 MovieClip [ammo_gun] Frame 1
function step() {
var _local1 = _root;
var _local2 = this;
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_local1.addGrenadeExplosion(_x, _y);
_local1.removeObstruction(_local2);
} else if (_alpha <= 0) {
_local1.removeObstruction(_local2);
} else if (hitTest(_local1.hero._x, _local1.hero._y, 0)) {
_local1.ammo_bullets = _local1.ammo_bullets + 400;
_local1.removeObstruction(_local2);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 194 MovieClip in Symbol 195 MovieClip [ammo_gun] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 198 MovieClip [ammo_health] Frame 1
function step() {
var _local1 = _root;
var _local2 = this;
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_local1.addGrenadeExplosion(_x, _y);
_local1.removeObstruction(_local2);
} else if (_alpha <= 0) {
_local1.removeObstruction(_local2);
} else if (hitTest(_local1.hero._x, _local1.hero._y, 0)) {
_local1.hero.hp = _local1.hero.hp + 10;
if (_local1.hero.hp > 100) {
_local1.hero.hp = 100;
}
_local1.removeObstruction(_local2);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 197 MovieClip in Symbol 198 MovieClip [ammo_health] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 201 MovieClip [ammo_prox_mine] Frame 1
function step() {
var _local1 = _root;
var _local2 = this;
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_local1.addGrenadeExplosion(_x, _y);
_local1.removeObstruction(_local2);
} else if (_alpha <= 0) {
_local1.removeObstruction(_local2);
} else if (hitTest(_local1.hero._x, _local1.hero._y, 0)) {
_local1.ammo_prox_mines = _local1.ammo_prox_mines + 10;
_local1.removeObstruction(_local2);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 200 MovieClip in Symbol 201 MovieClip [ammo_prox_mine] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 206 MovieClip [ammo_rocket] Frame 1
function step() {
var _local1 = _root;
var _local2 = this;
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_local1.addGrenadeExplosion(_x, _y);
_local1.removeObstruction(_local2);
} else if (_alpha <= 0) {
_local1.removeObstruction(_local2);
} else if (hitTest(_local1.hero._x, _local1.hero._y, 0)) {
_local1.ammo_rockets = _local1.ammo_rockets + 10;
_local1.removeObstruction(_local2);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 205 MovieClip in Symbol 206 MovieClip [ammo_rocket] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Symbol 208 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Symbol 208 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Symbol 208 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Symbol 208 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Symbol 208 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Symbol 208 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Symbol 208 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 144 MovieClip in Symbol 208 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 209 MovieClip [ammo_rpg_crate] Frame 1
function step() {
var _local1 = _root;
var _local2 = this;
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_local1.addGrenadeExplosion(_x, _y);
_local1.removeObstruction(_local2);
} else if (_alpha <= 0) {
_local1.removeObstruction(_local2);
} else if (hitTest(_local1.hero._x, _local1.hero._y, 0)) {
_local1.ammo_rpg = _local1.ammo_rpg + 8;
_local1.removeObstruction(_local2);
}
}
function takeDamage(amt, _x, _y, vx, vy) {
hp = hp - amt;
}
_root.obstructions.push(this);
hp = 20;
Instance of Symbol 208 MovieClip in Symbol 209 MovieClip [ammo_rpg_crate] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 214 MovieClip [ammo_shotgun] Frame 1
function step() {
var _local1 = _root;
var _local2 = this;
if ((count++) > 1000) {
_alpha = (_alpha - 5);
}
if (hp <= 0) {
_local1.addGrenadeExplosion(_x, _y);
_local1.removeObstruction(_local2);
} else if (_alpha <= 0) {
_local1.removeObstruction(_local2);
} else if (hitTest(_local1.hero._x, _local1.hero._y, 0)) {
_local1.ammo_shells = _local1.ammo_shells + 10;
_local1.removeObstruction(_local2);
}
}
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_shotgun] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 235 MovieClip [anim_dead_body] Frame 1
stop();
Symbol 235 MovieClip [anim_dead_body] Frame 75
stop();
Symbol 238 MovieClip [arrow_debris] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 237 MovieClip in Symbol 238 MovieClip [arrow_debris] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 241 MovieClip [blood_drop] Frame 1
function step() {
var _local1 = _root;
vy = vy + mygrav;
_x = (_x + vx);
_y = (_y + vy);
if (_local1.ground.ground_body.hitTest(_x, _y, 1)) {
lvl = _local1.getNextBloodLevel();
temp = _local1.addObj("blood_splat", _local1.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 240 MovieClip in Symbol 241 MovieClip [blood_drop] Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 244 MovieClip [blood_splat] Frame 1
function step() {
if ((count++) > 500) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 243 MovieClip in Symbol 244 MovieClip [blood_splat] Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 245 MovieClip [blood_stump] Frame 1
function step() {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + mygrav;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if ((((_x < -10) || (_x > xmax)) || (_y > ymax)) || ((timer--) < 0)) {
this.unloadMovie();
}
testHitObstructions();
}
function testHitEnemies() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitTest(_x, _y, 0)) {
_local1.enemies[i].takeDamage(dmg);
_local1.addSpark("spark", _x, _y, 3);
_local1.playHitEnemySound();
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
if (_local1.ground.ground_body.hitTest(_x, _y + 2, 1)) {
if (Math.abs(vy) > 4) {
_local1.placeBlood(_x, _y);
}
_local1.placeDeadBody("body_dieing", _x, _y, vx);
this.unloadMovie();
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 500;
rot_rate = random(3) + 3;
timeToSplat = 10;
blood_count = 0;
if (vx < 0) {
_xscale = -100;
}
testHitObstructions();
mygrav = _root.gravity;
Instance of Symbol 235 MovieClip [anim_dead_body] "body" in Symbol 245 MovieClip [blood_stump] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 269 MovieClip Frame 1
stop();
Symbol 269 MovieClip Frame 70
gotoAndPlay (10);
Symbol 270 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() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitTest(_x, _y, 0)) {
_local1.enemies[i].takeDamage(dmg);
_local1.addSpark("spark", _x, _y, 3);
_local1.playHitEnemySound();
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 0)) {
if (Math.abs(vy) > 4) {
_local1.placeBlood(_x, _y);
}
_local1.placeDeadBody("enemy_sniper_death", _x, _y, vx);
_local2.unloadMovie();
}
}
if (_local1.ground.ground_body.hitTest(_x, _y + 2, 1)) {
if (Math.abs(vy) > 4) {
_local1.placeBlood(_x, _y);
}
_local1.placeDeadBody("enemy_sniper_death", _x, _y, vx);
_local2.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 269 MovieClip in Symbol 270 MovieClip [blood_stump_fem] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 274 MovieClip in Symbol 275 MovieClip Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
Symbol 276 MovieClip Frame 65
stop();
Symbol 277 MovieClip [body_dieing] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 276 MovieClip in Symbol 277 MovieClip [body_dieing] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 337 MovieClip Frame 1
stop();
alpha_change = 0.5;
rate = 0.5;
gravity = -0.5;
bounceHeight = 200;
friction = 0.3;
Instance of Symbol 282 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 284 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 286 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 288 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 290 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 292 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 294 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 296 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 298 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 300 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 302 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 304 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 306 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 308 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 310 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
if (_alpha < 1) {
_parent.unloadMovie();
}
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > _parent.bounceHeight) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 312 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 314 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 316 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > _parent.bounceHeight) {
vy = vy * (-_parent.friction);
vx = vx * (-_parent.friction);
}
}
Instance of Symbol 318 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 320 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 322 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 326 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 328 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 330 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 332 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 334 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Instance of Symbol 336 MovieClip in Symbol 337 MovieClip Frame 1
onClipEvent (load) {
vx = ((_x * _parent.rate) * random(100)) / 100;
vy = ((_y * _parent.rate) * random(100)) / 100;
rotRate = random(10) - 5;
}
onClipEvent (enterFrame) {
_x = (_x + vx);
_y = (_y + vy);
_alpha = (_alpha - _parent.alpha_change);
_rotation = (_rotation + rotRate);
vy = vy - _parent.gravity;
if (_y > (_parent.bounceHeight + random(50))) {
vy = vy * (-_parent.friction);
vx = vx * _parent.friction;
}
}
Symbol 338 MovieClip Frame 65
stop();
Symbol 339 MovieClip [body_dieing2] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 338 MovieClip in Symbol 339 MovieClip [body_dieing2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 342 MovieClip [bomber_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 341 MovieClip in Symbol 342 MovieClip [bomber_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 365 MovieClip [breaking_glass] Frame 1
function takeDamage(amt, xpar, ypar, vx, vy) {
var _local1 = ypar;
var _local2 = xpar;
var _local3 = _root;
xpos = _local2 - _x;
ypos = _local1 - _y;
for (ndx in pieces) {
piece = pieces[ndx];
if (piece.hitTest(_local2, _local1, 0)) {
_local3.playSound("ice_shatter.wav");
_local3.addDebrisExplosionType(_local2, _local1, 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);
Instance of Symbol 367 MovieClip in Symbol 368 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 369 MovieClip [bullet_hole] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 368 MovieClip in Symbol 369 MovieClip [bullet_hole] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 372 MovieClip [bullet_hole2] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 371 MovieClip in Symbol 372 MovieClip [bullet_hole2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 375 MovieClip [bullet_water_splash] Frame 1
function step() {
_alpha = (_alpha - 3);
if (_alpha <= 0) {
this.unloadMovie();
}
}
Instance of Symbol 374 MovieClip in Symbol 375 MovieClip [bullet_water_splash] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 378 MovieClip [chopper_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 377 MovieClip in Symbol 378 MovieClip [chopper_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 382 MovieClip [crater1] Frame 1
function step() {
if ((count++) > 200) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 381 MovieClip in Symbol 382 MovieClip [crater1] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 385 MovieClip [crater2] Frame 1
function step() {
if ((count++) > 500) {
_alpha = (_alpha-1);
if (_alpha <= 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 384 MovieClip in Symbol 385 MovieClip [crater2] Frame 1
onClipEvent (load) {
if (_root.age < 17) {
this.unloadMovie();
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 386 MovieClip [debris_flame] Frame 1
function setVelocity(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() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
ene = _local1.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
if (ene.etype == "troop") {
_local1.enemies[i].takeDamage(1000, _x, _y, vx, vy);
_local1.playHitEnemySound();
} else {
_local2.unloadMovie();
}
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
if (_local1.ground.ground_body.hitTest(_x, _y, 1)) {
temp = _local1.addObj("napalm_flame", _local1.flame_layer, _local1.getNextFlameLevel());
temp._x = _x;
temp._y = _y;
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 1)) {
_local1.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_local2.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 121 MovieClip in Symbol 386 MovieClip [debris_flame] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 389 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() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitTest(_x, _y, 0)) {
_local1.enemies[i].takeDamage(dmg);
_local1.addSpark("spark", _x, _y, 3);
_local1.playHitEnemySound();
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
for (i in _local1.obstructions) {
top = _local1.obstructions[i].hitTest(_x, _y - 1, 1);
bottom = _local1.obstructions[i].hitTest(_x, _y + 1, 1);
left = _local1.obstructions[i].hitTest(_x - 1, _y, 1);
right = _local1.obstructions[i].hitTest(_x + 1, _y, 1);
b_right = _local1.obstructions[i].hitTest(_x + 0.7071, _y + 0.7071, 1);
b_left = _local1.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 388 MovieClip in Symbol 389 MovieClip [debris1] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 390 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() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitTest(_x, _y, 0)) {
_local1.enemies[i].takeDamage(dmg);
_local1.addSpark("spark", _x, _y, 3);
_local1.playHitEnemySound();
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
for (i in _local1.obstructions) {
top = _local1.obstructions[i].hitTest(_x, _y - 1, 1);
bottom = _local1.obstructions[i].hitTest(_x, _y + 1, 1);
left = _local1.obstructions[i].hitTest(_x - 1, _y, 1);
right = _local1.obstructions[i].hitTest(_x + 1, _y, 1);
b_right = _local1.obstructions[i].hitTest(_x + 0.7071, _y + 0.7071, 1);
b_left = _local1.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 388 MovieClip in Symbol 390 MovieClip [debris2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 395 MovieClip in Symbol 396 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 397 MovieClip [enemy_a10] Frame 1
function step() {
var _local1 = _root;
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;
_local1.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 _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _local1.ground.ground_body.hitTest(_x, _y + 2, 1) || (hitstruct);
if (bottom) {
_local1.addExplosion(_x, _y, 50, 200);
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("a10_dead", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_local1.removeEnemy(this);
}
}
if ((_x > xmax) || (_x < -60)) {
_local1.removeEnemy(this);
}
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function takeDamage(dmg, x, y, vx, vy) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
dmg_amt = dmg;
spark_amt = random(2);
if ((!exploded) && (weakspot.hitTest(_local3, _local2, 0))) {
_local1.addExplosion(_local3, _local2, 15, 5);
exploded = true;
dmg_amt = dmg_amt + 1000;
spark_amt = spark_amt + random(2);
}
_local1.playSound("ching1.wav");
hp = hp - dmg_amt;
c = 0;
while (c < spark_amt) {
blood = _local1.addObj("debris2", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local3 - _x;
ynew = _local2 - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _local1.addObj("bullet_hole2", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function dropBomb() {
var _local1 = _root;
_local1.playSound("firecat3.wav");
temp = _local1.addObj("enemy_bomb_drop_napalm", _local1.bomb_layer, _local1.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 124 MovieClip "hitbox" in Symbol 397 MovieClip [enemy_a10] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 397 MovieClip [enemy_a10] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 392 MovieClip in Symbol 397 MovieClip [enemy_a10] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 400 MovieClip [enemy_bomb_drop] Frame 1
function step() {
var _local1 = _root;
vy = vy + mygrav;
_x = (_x + vx);
_y = (_y + vy);
if (vx > 0) {
_rotation = (_rotation + 0.3);
} else {
_rotation = (_rotation - 0.3);
}
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (((hitstruct || (hp <= 0)) || (_local1.ground.ground_body.hitTest(_x, _y, 1))) || (_y > _local1.g_ground)) {
_local1.addExplosion(_x, _y, 110, 50);
_local1.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";
mygrav = _root.gravity / 5;
if (vx < 0) {
_xscale = -100;
}
Instance of Symbol 399 MovieClip in Symbol 400 MovieClip [enemy_bomb_drop] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 400 MovieClip [enemy_bomb_drop] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 403 MovieClip [enemy_bomb_drop_napalm] Frame 1
function step() {
var _local1 = _root;
vy = vy + mygrav;
_x = (_x + vx);
_y = (_y + vy);
_rotation = (_rotation + rotFactor);
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (((hitstruct || (hp <= 0)) || (_local1.ground.ground_body.hitTest(_x, _y, 1))) || (_y > _local1.g_ground)) {
_local1.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;
mygrav = _root.gravity / 5;
if (vx < 0) {
_xscale = -100;
}
if (vx > 0) {
rotFactor = 0.3;
} else {
rotFactor = -0.3;
}
Instance of Symbol 402 MovieClip in Symbol 403 MovieClip [enemy_bomb_drop_napalm] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 408 MovieClip [enemy_bomber] Frame 1
function step() {
var _local1 = _root;
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
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;
_local1.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 _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _local1.ground.ground_body.hitTest(_x, _y + 2, 1) || (hitstruct);
if (bottom) {
_local1.addExplosion(_x, _y, 50, 200);
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("bomber_dead", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_local1.removeEnemy(this);
}
}
if ((_x > xmax) || (_x < -60)) {
_local1.removeEnemy(this);
}
}
function getNextBulletHoleLevel() {
if ((b_level++) > 8) {
b_level = 1;
}
return(b_level);
}
function takeDamage(dmg, x, y, vx, vy) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
dmg_amt = dmg;
spark_amt = random(2);
if (weakspot.hitTest(_local3, _local2, 0)) {
dmg_amt = dmg_amt + 10;
spark_amt = spark_amt + random(2);
}
_local1.playSound("ching1.wav");
hp = hp - dmg_amt;
c = 0;
while (c < spark_amt) {
blood = _local1.addObj("debris2", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local3 - _x;
ynew = _local2 - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _local1.addObj("bullet_hole", bullet_hole_layer, getNextBulletHoleLevel());
temp._x = xnew;
temp._y = ynew;
}
function dropBomb() {
var _local1 = _root;
_local1.playSound("firecat3.wav");
temp = _local1.addObj("enemy_bomb_drop", _local1.bomb_layer, _local1.getNextBombLevel());
temp._x = _x;
temp._y = _y + 5;
temp.vx = vx;
_local1.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;
b_level = 1;
Instance of Symbol 406 MovieClip "bomber_anim" in Symbol 408 MovieClip [enemy_bomber] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 408 MovieClip [enemy_bomber] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 408 MovieClip [enemy_bomber] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 411 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() {
var _local1 = _root;
if (_local1.hero.hitbox.hitTest(_x, _y, 0)) {
_local1.hero.takeDamage(3);
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.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() {
var _local1 = _root;
var _local2 = this;
if (_local1.ground.ground_body.hitTest(_x, _y, 1)) {
_local1.playSound("bomb.wav");
temp = _local1.addObj("bullet_hole", _local1.ground.blood_layer, _local1.getNextBloodLevel());
temp._x = _x;
temp._y = _y;
temp = _local1.addObj("bullet_water_splash", _local1.debris_layer, _local1.getNextDebrisLevel());
temp._x = _x;
temp._y = _y;
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 0)) {
_local1.obstructions[i].takeDamage(3);
_local1.addSpark("spark_dust", _x, _y, 3);
_local1.playSound("bomb.wav");
_local2.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
Instance of Symbol 410 MovieClip in Symbol 411 MovieClip [enemy_bullet] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 414 MovieClip Frame 1
stop();
Symbol 416 MovieClip [enemy_car] Frame 1
function step() {
var _local1 = _root;
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) {
_local1.removeEnemy(this);
}
hp = hp - leaking;
if (hp < 0) {
_local1.increaseScore(10, _x, _y);
_local1.addExplosion(_x, _y, 20, 20);
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("enemy_car_dead", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_local1.removeEnemy(this);
}
}
function takeDamage(dmg, x, y, vx, vy) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
if (leaking <= 0) {
if (weakspot.hitTest(_local3, _local2, 0)) {
_local1.increaseScore(10, _x, _y);
leaking = 0.05;
_local1.addExplosion(_local3, _local2, 5, 5);
}
}
hp = hp - dmg;
_local1.playSound("ching1.wav");
spark_amt = random(2);
c = 0;
while (c < spark_amt) {
blood = _local1.addObj("debris2", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local3 - _x;
ynew = _local2 - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _local1.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() {
var _local1 = _root;
_local1.playSound("tat3.wav");
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 2.5 * (1 + (_local1.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
_local1.playSound("shoot_rocket4.wav");
rocket = _local1.addObj("enemy_rocket", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_local1.level * 0.01));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _local1.hero._x - _x;
dy = _local1.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 414 MovieClip "car_anim" in Symbol 416 MovieClip [enemy_car] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 416 MovieClip [enemy_car] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 416 MovieClip [enemy_car] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 419 MovieClip [enemy_car_dead] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 418 MovieClip in Symbol 419 MovieClip [enemy_car_dead] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 421 MovieClip in Symbol 422 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 61);
}
Symbol 431 MovieClip [enemy_chopper] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
if ((move_count++) > 100) {
move_count = 0;
if (_local1.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;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
bottom = _local1.ground.ground_body.hitTest(_x, _y, 1) || (hitstruct);
}
hp = hp - leaking;
if (bottom) {
_local1.increaseScore(10, _x, _y);
_local1.addExplosion(_x, _y, 50, 200);
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("chopper_dead", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
if (shots >= (1 + clip_size)) {
shots = 0;
timeToShoot = (400 + random(300)) - (_local1.level * 5);
if (timeToShootRocket < 300) {
timeToShootRocket = 300;
}
} else {
shots++;
timeToShoot = 5;
}
shoot();
}
if (((timeToShootRocket--) <= 0) && (Math.abs(_local1.hero._x - _x) > 200)) {
if (rocket_shots >= 1) {
rocket_shots = 0;
timeToShootRocket = (800 + random(400)) - (_local1.level * 5);
if (timeToShootRocket < 500) {
timeToShootRocket = 500;
}
} else {
rocket_shots++;
timeToShootRocket = 10;
}
shootRocket();
}
}
function takeDamage(dmg, x, y, vx, vy) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
if (leaking <= 0) {
if (weakspot.hitTest(_local3, _local2, 0)) {
_local1.increaseScore(10, _x, _y);
leaking = 0.05;
_local1.addExplosion(_local3, _local2, 15, 5);
}
}
hp = hp - dmg;
_local1.playSound("ching1.wav");
spark_amt = random(2);
c = 0;
while (c < spark_amt) {
blood = _local1.addObj("debris2", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local3 - _x;
ynew = _local2 - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _local1.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() {
var _local1 = _root;
_local1.playSound("tat3.wav");
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 2.5 * (1 + (_local1.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
_local1.playSound("shoot_rocket4.wav");
rocket = _local1.addObj("enemy_rocket", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_local1.level * 0.01));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _local1.hero._x - _x;
dy = _local1.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 429 MovieClip "chopper_anim" in Symbol 431 MovieClip [enemy_chopper] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 431 MovieClip [enemy_chopper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 431 MovieClip [enemy_chopper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 432 MovieClip Frame 1
stop();
Symbol 432 MovieClip Frame 70
gotoAndPlay (10);
Symbol 433 MovieClip [enemy_drop] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
vx = vx + ((random(100) - 50) / 2000);
_y = (_y + (1.5 + extra_fall));
_x = (_x + vx);
bottom = _local1.ground.ground_body.hitTest(_x, _y, 1);
if (bottom) {
chute = _local1.addObj("parachute_fade", _local1.debris_layer, _local1.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
dx = _local1.hero._x - _x;
dir = Math.abs(dx) / dx;
_local1.placeEnemy("enemy1", _x, _y, 0.5 * dir, vy);
_local1.removeEnemy(this);
}
if (hp <= 0) {
_local1.increaseScore(10, _x, _y);
chute = _local1.addObj("parachute_fade", _local1.debris_layer, _local1.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
if (explosion_impact > 12) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
_local1.addBloodyStump(_x, _y, vx, 0);
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
timeToShoot = 200 + random(100);
}
}
function shoot() {
var _local1 = _root;
_local1.playSound("tat3.wav");
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 2;
wild_factor = 4;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 100;
lvy = -2 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
_local1.increaseScore(20, _x, _y);
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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;
Instance of Symbol 124 MovieClip "hitbox" in Symbol 433 MovieClip [enemy_drop] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 432 MovieClip in Symbol 433 MovieClip [enemy_drop] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 433 MovieClip [enemy_drop] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 436 MovieClip Frame 1
stop();
Symbol 436 MovieClip Frame 70
gotoAndPlay (10);
Symbol 437 MovieClip [enemy_drop_sniper] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
vx = vx + ((random(100) - 50) / 2000);
_y = (_y + (2 + extra_fall));
_x = (_x + vx);
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _local1.ground.ground_body.hitTest(_x, _y, 1);
if (bottom || (hitstruct)) {
chute = _local1.addObj("parachute_fade", _local1.debris_layer, _local1.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
dx = _local1.hero._x - _x;
dir = Math.abs(dx) / dx;
_local1.placeEnemy("enemy_sniper", _x, _y, 0, 0);
_local1.removeEnemy(this);
}
if (hp <= 0) {
_local1.increaseScore(10, _x, _y);
chute = _local1.addObj("parachute_fade", _local1.debris_layer, _local1.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
if (explosion_impact > 12) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
_local1.addFemBloodyStump(_x, _y, vx, 0);
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
timeToShoot = 200 + random(100);
}
}
function shoot() {
var _local1 = _root;
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 2;
wild_factor = 4;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 100;
lvy = -2 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
_local1.increaseScore(20, _x, _y);
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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;
if (extra_fall > 4) {
extra_fall = 4;
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 437 MovieClip [enemy_drop_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 436 MovieClip in Symbol 437 MovieClip [enemy_drop_sniper] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 437 MovieClip [enemy_drop_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 438 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() {
var _local1 = _root;
var _local2 = this;
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_local1.ground.ground_body.hitTest(_x, _y, 1))) {
_local1.addExplosion(_x, _y, radius, dmg);
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 1)) {
_local1.addExplosion(_x, _y, radius, dmg);
_local2.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;
Instance of Symbol 204 MovieClip "rocket" in Symbol 438 MovieClip [enemy_rocket] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 443 MovieClip Frame 1
stop();
Symbol 443 MovieClip Frame 70
gotoAndPlay (10);
Instance of Symbol 446 MovieClip "sniper_flame" in Symbol 447 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha > 0) {
_alpha = (_alpha - 30);
}
}
Symbol 449 MovieClip [enemy_sniper] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToAim++) > 10) {
timeToAim = 0;
dx = -((_local1.hero._x - _x) - 2.6);
dy = -((_local1.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") {
_local1.increaseScore(5, _x, _y);
if (explosion_impact > 12) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump_fem", _local1.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") {
_local1.increaseScore(15, _x, _y);
_alpha = 0;
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("enemy_sniper_death", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
if (vx > 0) {
temp._xscale = -100;
}
} else {
_local1.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump_fem", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= 0) {
shot_count = 1;
timeToShoot = (300 + random(200)) - (_local1.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
if ((timeToNade--) <= 0) {
dist = Math.abs(_local1.hero._x - _x);
if ((dist < 300) && (dist > 100)) {
throwNade();
}
timeToNade = 600 + random(600);
}
}
function shoot() {
var _local1 = _root;
sniper_gun.sniper_flame._alpha = 100;
_local1.playSound("sniper_rifle.wav");
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_local1.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 2;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 130;
lvy = -3 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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;
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
Instance of Symbol 448 MovieClip "head" in Symbol 449 MovieClip [enemy_sniper] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 449 MovieClip [enemy_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 449 MovieClip [enemy_sniper] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 450 MovieClip Frame 54
stop();
Symbol 451 MovieClip [enemy_sniper_death] Frame 1
function step() {
if ((count++) > 100) {
_alpha = (_alpha - 2);
if (_alpha < 0) {
this.unloadMovie();
}
}
}
Instance of Symbol 450 MovieClip in Symbol 451 MovieClip [enemy_sniper_death] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 452 MovieClip [enemy_sniper_office] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToAim++) > 15) {
timeToAim = 0;
dx = -((_local1.hero._x - _x) - 2.6);
dy = -((_local1.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") {
_local1.increaseScore(5, _x, _y);
if (explosion_impact > 12) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump_fem", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y - 5;
temp.vx = explosion_dx;
temp.vy = explosion_dy;
temp._rotation = random(360);
}
} else {
_local1.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump_fem", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= 2) {
shot_count = 1;
timeToShoot = (300 + random(200)) - (_local1.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
}
function shoot() {
var _local1 = _root;
sniper_gun.sniper_flame._alpha = 100;
_local1.playSound("sniper_rifle.wav");
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_local1.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 2;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 130;
lvy = -3 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 448 MovieClip "head" in Symbol 452 MovieClip [enemy_sniper_office] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 452 MovieClip [enemy_sniper_office] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 452 MovieClip [enemy_sniper_office] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 460 MovieClip Frame 1
stop();
Symbol 462 MovieClip [enemy_tank] Frame 1
function step() {
var _local1 = _root;
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));
}
if (hp < 0) {
_local1.increaseScore(10, _x, _y);
_local1.addExplosion(_x, _y, 20, 20);
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("tank_dead", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp._xscale = _xscale;
_local1.removeEnemy(this);
}
if ((timeToShoot--) < 0) {
if (Math.abs(_x - _local1.hero._x) > 200) {
shoot();
}
timeToShoot = 400;
}
}
function takeDamage(dmg, x, y, vx, vy) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
hp = hp - dmg;
_local1.playSound("ching1.wav");
spark_amt = random(2);
c = 0;
while (c < spark_amt) {
blood = _local1.addObj("debris2", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local3 - _x;
ynew = _local2 - _y;
if (_xscale < 0) {
xnew = xnew * -1;
}
temp = _local1.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() {
var _local1 = _root;
_local1.playSound("bomb_hit.wav");
dx = _local1.hero._x - _x;
dy = (_local1.hero._y - 10) - (_y - 20);
g = _local1.gravity * 2;
if (dx < 0) {
lvx = -5;
} else {
lvx = 5;
}
t = (_local1.hero._x - _x) / (lvx - _local1.hero.vx);
lvy = (dy - (((0.5 * g) * t) * t)) / t;
proj = _local1.addObj("tank_shell", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - 20;
}
function shootRocket() {
var _local1 = _root;
_local1.playSound("shoot_rocket4.wav");
rocket = _local1.addObj("enemy_rocket", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_local1.level * 0.01));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 1.5;
dx = _local1.hero._x - _x;
dy = _local1.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 460 MovieClip "car_anim" in Symbol 462 MovieClip [enemy_tank] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 462 MovieClip [enemy_tank] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 462 MovieClip [enemy_tank] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 463 MovieClip Frame 1
stop();
Symbol 463 MovieClip Frame 70
gotoAndPlay (10);
Symbol 463 MovieClip Frame 142
gotoAndPlay ("shooting");
Symbol 464 MovieClip [enemy1] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToCheckDirection++) > 100) {
timeToCheckDirection = 0;
dx = _x - _local1.hero._x;
if (dx > 0) {
vx = -speed;
} else {
vx = speed;
}
}
bottom = _local1.ground.ground_body.hitTest(_x, _y, 1);
grounded = _local1.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 + _local1.gravity;
_x = (_x + vx);
_y = (_y + vy);
body.gotoAndStop(count + mode);
} else {
shooting = (shootCount++) < 10;
}
if (((_x < -40) || (_x > xmax)) || (_y > ymax)) {
_local1.removeEnemy(this);
}
if (hp <= 0) {
if (deathCode == "exploded") {
_local1.increaseScore(5, _x, _y);
if (explosion_impact > 25) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y - 5;
temp.vx = explosion_dx * 0.8;
temp.vy = explosion_dy * 0.8;
temp._rotation = random(360);
}
} else if (deathCode == "head_shot") {
_local1.increaseScore(15, _x, _y);
_alpha = 0;
_local1.placeDeadBody("body_dieing2", _x, _y, vx);
} else {
_local1.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= clip_size) {
shot_count = 0;
timeToShoot = (200 + random(100)) - (_local1.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
if ((timeToNade--) <= 0) {
dist = Math.abs(_local1.hero._x - _x);
if ((dist < 300) && (dist > 100)) {
throwNade();
}
timeToNade = 600 + random(600);
}
}
function shoot() {
var _local1 = _root;
_local1.playSound("tat3.wav");
shootCount = 1;
shooting = true;
body.gotoAndPlay("shooting");
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 2 * (1 + (_local1.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 4;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 120;
lvy = -3 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = 10 + 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;
clip_size = Math.floor(_root.level / 6);
if (clip_size > 5) {
clip_size = 5;
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 464 MovieClip [enemy1] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 463 MovieClip "body" in Symbol 464 MovieClip [enemy1] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 464 MovieClip [enemy1] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 467 MovieClip [explosion] Frame 10
this.unloadMovie();
Symbol 477 Button
on (release) {
_root.closeGameOver();
_root.restartGame();
}
Symbol 491 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 490 MovieClip "can_animation" in Symbol 491 MovieClip [gas_can] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 494 MovieClip [glass_fade_loader] Frame 1
function step() {
_alpha = (_alpha + 5);
if (_alpha > 100) {
this.unloadMovie();
}
}
_alpha = 0;
Instance of Symbol 493 MovieClip in Symbol 494 MovieClip [glass_fade_loader] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 497 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 496 MovieClip in Symbol 497 MovieClip [glass_shard] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 502 Button
on (release) {
_root.closeHelp();
}
Symbol 505 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 508 Button
on (release) {
_root.help_text = "There are several types of enemies... Hint: every enemy has a weak spot.";
}
Symbol 510 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 512 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 515 Button
on (release) {
_root.help_text = "Single Click will shoot an rocket propelled grenade (RPG) that explodes on contact. Don't shoot at your feet!";
}
Symbol 517 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. The UZI uses the same bullets, but has a faster output rate but sacrifices bullet speed.";
}
Symbol 519 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 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";
}
Symbol 523 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 = _root.help_text;
Instance of Symbol 522 MovieClip "sponsor_link" in Symbol 523 MovieClip [help_screen] Frame 1
on (release) {
getURL ("http://www.lostvectors.com/", "_blank");
}
Symbol 524 MovieClip [hero_arrow] Frame 1
function setVelocity(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() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
ene = _local1.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
if (ene.etype == "troop") {
_local1.enemies[i].takeDamage(1000, _x, _y, vx, vy);
_local1.playHitEnemySound();
} else {
_local2.unloadMovie();
}
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
if (_y > _local1.bullet_ground) {
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 1)) {
_local1.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_local1.placeDebrisArrow(_x, _y, _rotation);
_local2.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 183 MovieClip in Symbol 524 MovieClip [hero_arrow] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 525 MovieClip [hero_arrow_bomb] Frame 1
function setVelocity(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() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitbox.hitTest(_x, _y, 0)) {
_local1.enemies[i].takeDamage(3, _x, _y, vx, vy);
_local1.addSpark("spark", _x, _y, 3);
_local1.playHitEnemySound();
_local1.addExplosion(_x, _y, range, dmg);
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
if (_local1.ground.ground_body.hitTest(_x, _y, 1)) {
_local1.addExplosion(_x, _y, range, dmg);
_local1.placeDebrisArrow(_x, _y, _rotation);
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 1)) {
_local1.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_local1.addExplosion(_x, _y, range, dmg);
_local1.placeDebrisArrow(_x, _y, _rotation);
_local2.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
range = 40;
dmg = 10;
Instance of Symbol 183 MovieClip in Symbol 525 MovieClip [hero_arrow_bomb] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 528 MovieClip [hero_bullet] Frame 1
function step() {
_y = (_y + vy);
_x = (_x + vx);
if ((timeAlive++) > 150) {
this.unloadMovie();
}
testHitEnemies();
testHitObstructions();
}
function testHitEnemies() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitbox.hitTest(_x, _y, 0)) {
_local1.enemies[i].takeDamage(3, _x, _y, vx, vy);
_local1.addSpark("spark", _x, _y, 3);
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
if (_local1.ground.ground_body.hitTest(_x, _y, 1)) {
_local1.playSound("bomb.wav");
temp = _local1.addObj("bullet_hole", _local1.ground.blood_layer, _local1.getNextBloodLevel());
temp._x = _x;
temp._y = _y;
temp = _local1.addObj("bullet_water_splash", _local1.debris_layer, _local1.getNextDebrisLevel());
temp._x = _x;
temp._y = _y;
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 0)) {
_local1.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_local1.addSpark("spark_dust", _x, _y, 3);
_local1.playSound("bomb.wav");
_local2.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
Instance of Symbol 527 MovieClip in Symbol 528 MovieClip [hero_bullet] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 529 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, 80, 60);
this.unloadMovie();
}
}
function testHitEnemies() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitTest(_x, _y, 0)) {
_local1.enemies[i].takeDamage(dmg);
_local1.addSpark("spark", _x, _y, 3);
_local1.playHitEnemySound();
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
if (_y > max_obs_elevation) {
bottom = _local1.ground.ground_body.hitTest(_x, _y + 1, 1);
left = _local1.ground.ground_body.hitTest(_x - 1, _y, 1);
right = _local1.ground.ground_body.hitTest(_x + 1, _y, 1);
if (bottom) {
bounceCount++;
_x = xprev;
_y = yprev;
vy = vy * -0.3;
vx = vx * 0.3;
} else if (left || (right)) {
bounceCount++;
_x = xprev;
_y = yprev;
vx = vx * -0.3;
}
}
if (_y > max_obs_elevation) {
for (i in _local1.obstructions) {
bottom = _local1.obstructions[i].hitTest(_x, _y, 0);
if (bottom) {
_x = xprev;
_y = yprev;
vy = vy * -0.3;
vx = vx * -0.3;
}
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
timer = 150;
max_obs_elevation = 220;
bounceCount = 0;
Instance of Symbol 188 MovieClip in Symbol 529 MovieClip [hero_grenade] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 532 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() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitTest(_x, _y, 0)) {
_local1.addExplosionType(_x, _y, range, dmg, "debris_flame");
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
bottom = _y > ground_spot;
if (bottom) {
_local1.addExplosionType(_x, _y, range, dmg, "debris_flame");
_local2.unloadMovie();
} else {
for (i in _local1.obstructions) {
bottom = _local1.obstructions[i].hitTest(_x, _y, 0);
if (bottom) {
_local1.addExplosionType(_x, _y, range, dmg, "debris_flame");
_local2.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 531 MovieClip in Symbol 532 MovieClip [hero_molotov] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 535 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() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitbox.hitTest(_x, _y, 0)) {
_local1.enemies[i].takeDamage(3, _x, _y, vx, vy);
_local1.addSpark("spark", _x, _y, 3);
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
if (_local1.ground.ground_body.hitTest(_x, _y, 1)) {
if (!splashed) {
_local1.playSound("bomb.wav");
temp = _local1.addObj("bullet_hole", _local1.ground.blood_layer, _local1.getNextBloodLevel());
temp._x = _x;
temp._y = _y;
}
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 0)) {
_local1.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_local1.addSpark("spark_dust", _x, _y, 3);
_local1.playSound("bomb.wav");
_local2.unloadMovie();
}
}
}
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
splashed = false;
Instance of Symbol 534 MovieClip in Symbol 535 MovieClip [hero_shrap] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 539 MovieClip [level_display] Frame 1
function step() {
_alpha = (_alpha - 10);
if (_alpha < 0) {
this.unloadMovie();
}
}
_alpha = 1000;
Instance of Symbol 538 MovieClip in Symbol 539 MovieClip [level_display] Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 540 MovieClip [missile] Frame 1
function getTarget() {
var _local1 = _root;
minDist = 99999 /* 0x01869F */;
for (i in _local1.enemies) {
temp_distx = _local1.enemies[i].xpos - _x;
temp_disty = _local1.enemies[i].ypos - _y;
temp_dist = Math.sqrt((temp_distx * temp_distx) + (temp_disty * temp_disty));
if ((temp_dist < minDist) && (_local1.enemies[i].ypos > 0)) {
distx = temp_distx;
disty = temp_disty;
dist = temp_dist;
minDist = temp_dist;
target_enemy = _local1.enemies[i];
target_enemy.locked_on = true;
}
}
_local1.testball.targ = target_enemy;
target_acquired = true;
}
function step() {
var _local1 = _root;
placeSmoke();
dx = _local1._xmouse - _x;
dy = _local1._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;
}
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) {
_local1.addSpark("spark", _x, _y, 10);
_local1.addExplosion(_x, _y, radius, dmg);
this.unloadMovie();
}
}
function testHitEnemies() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
if (_local1.enemies[i].hitTest(_x, _y, 1)) {
_local1.addExplosion(_x, _y, radius, dmg);
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_local1.ground.ground_body.hitTest(_x, _y, 1))) {
_local1.addExplosion(_x, _y, radius, dmg);
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 1)) {
_local1.addExplosion(_x, _y, radius, dmg);
_local2.unloadMovie();
}
}
}
function testBlastRadius() {
var _local1 = _root;
hitCount = 0;
temp = _local1.addObj("blast_animation", _local1.debris_layer, _local1.getNextDebrisLvl);
temp._x = _x;
temp._y = _y;
temp._xscale = (temp._yscale = 50);
_local1.playSound("bomb.wav");
for (ndx in _local1.enemies) {
distx = _local1.enemies[ndx].xpos - _x;
disty = _local1.enemies[ndx].ypos - _y;
range = Math.sqrt((distx * distx) + (disty * disty));
if (range < g_missile_blast_range) {
_local1.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() {
var _local1 = _root;
minDist = 99999 /* 0x01869F */;
ndx = 0;
while ((ndx < _local1.enemies.length) && (!blownUp)) {
if ((blownUp = _local1.enemies[ndx].hitTest(_x, _y, 1))) {
}
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;
xmark = _x;
ymark = _y;
timeToMark = 9999;
nextTarget = 5;
Instance of Symbol 204 MovieClip "rocket" in Symbol 540 MovieClip [missile] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 541 MovieClip [enemy_rocket2] Frame 1
function step() {
_x = (_x + vx);
_y = (_y + vy);
placeSmoke();
if ((((_x < xmin) || (_x > xmax)) || (_y < ymin)) || (_y > ymax)) {
this.unloadMovie();
}
if ((delayCount++) > 20) {
testHitObstructions();
}
testHitHero();
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_local1.ground.ground_body.hitTest(_x, _y, 1))) {
_local1.addExplosion(_x, _y, radius, dmg);
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 1)) {
_local1.addExplosion(_x, _y, radius, dmg);
_local2.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;
delayCount = 0;
Instance of Symbol 204 MovieClip "rocket" in Symbol 541 MovieClip [enemy_rocket2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 545 MovieClip [enemy_rocket_shooter] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToAim++) > 10) {
timeToAim = 0;
dx = -((_local1.hero._x - _x) - 2.6);
dy = -((_local1.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") {
_local1.increaseScore(5, _x, _y);
if (explosion_impact > 12) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump_fem", _local1.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") {
_local1.increaseScore(15, _x, _y);
_alpha = 0;
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("enemy_sniper_death", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
if (vx > 0) {
temp._xscale = -100;
}
} else {
_local1.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump_fem", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= 0) {
shot_count = 1;
timeToShoot = (300 + random(200)) - (_local1.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
if ((timeToNade--) <= 0) {
dist = Math.abs(_local1.hero._x - _x);
if ((dist < 300) && (dist > 100)) {
throwNade();
}
timeToNade = 600 + random(600);
}
}
function shoot() {
var _local1 = _root;
sniper_gun.sniper_flame._alpha = 100;
_local1.playSound("shoot_rocket4.wav");
bullet = _local1.addObj("enemy_rocket2", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 3.5 * (1 + (_local1.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 2;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 130;
lvy = -3 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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;
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
Instance of Symbol 448 MovieClip "head" in Symbol 545 MovieClip [enemy_rocket_shooter] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 545 MovieClip [enemy_rocket_shooter] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 545 MovieClip [enemy_rocket_shooter] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 548 MovieClip Frame 1
stop();
Symbol 548 MovieClip Frame 70
gotoAndPlay (10);
Symbol 549 MovieClip [enemy_drop_rpg] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
vx = vx + ((random(100) - 50) / 2000);
_y = (_y + (2 + extra_fall));
_x = (_x + vx);
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _local1.ground.ground_body.hitTest(_x, _y, 1);
if (bottom || (hitstruct)) {
chute = _local1.addObj("parachute_fade", _local1.debris_layer, _local1.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
dx = _local1.hero._x - _x;
dir = Math.abs(dx) / dx;
_local1.placeEnemy("enemy_rpg_shooter", _x, _y, 0, 0);
_local1.removeEnemy(this);
}
if (hp <= 0) {
_local1.increaseScore(10, _x, _y);
chute = _local1.addObj("parachute_fade", _local1.debris_layer, _local1.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
if (explosion_impact > 12) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
_local1.addFemBloodyStump(_x, _y, vx, 0);
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
timeToShoot = 200 + random(100);
}
}
function shoot() {
var _local1 = _root;
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 2;
wild_factor = 4;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 100;
lvy = -2 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
_local1.increaseScore(20, _x, _y);
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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;
if (extra_fall > 4) {
extra_fall = 4;
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 549 MovieClip [enemy_drop_rpg] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 548 MovieClip in Symbol 549 MovieClip [enemy_drop_rpg] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 549 MovieClip [enemy_drop_rpg] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 550 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 70
gotoAndPlay (10);
Symbol 551 MovieClip [enemy_drop_rocket] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
vx = vx + ((random(100) - 50) / 2000);
_y = (_y + (2 + extra_fall));
_x = (_x + vx);
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
bottom = _local1.ground.ground_body.hitTest(_x, _y, 1);
if (bottom || (hitstruct)) {
chute = _local1.addObj("parachute_fade", _local1.debris_layer, _local1.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
dx = _local1.hero._x - _x;
dir = Math.abs(dx) / dx;
_local1.placeEnemy("enemy_rocket_shooter", _x, _y, 0, 0);
_local1.removeEnemy(this);
}
if (hp <= 0) {
_local1.increaseScore(10, _x, _y);
chute = _local1.addObj("parachute_fade", _local1.debris_layer, _local1.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 32.3;
if (explosion_impact > 12) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
_local1.addFemBloodyStump(_x, _y, vx, 0);
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
timeToShoot = 200 + random(100);
}
}
function shoot() {
var _local1 = _root;
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 2;
wild_factor = 4;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 100;
lvy = -2 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
_local1.increaseScore(20, _x, _y);
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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;
if (extra_fall > 4) {
extra_fall = 4;
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 551 MovieClip [enemy_drop_rocket] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 550 MovieClip in Symbol 551 MovieClip [enemy_drop_rocket] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 551 MovieClip [enemy_drop_rocket] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 553 MovieClip [enemy_rpg_shooter] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
if (vx < 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToAim++) > 10) {
timeToAim = 0;
dx = -((_local1.hero._x - _x) - 2.6);
dy = -((_local1.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") {
_local1.increaseScore(5, _x, _y);
if (explosion_impact > 12) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump_fem", _local1.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") {
_local1.increaseScore(15, _x, _y);
_alpha = 0;
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("enemy_sniper_death", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
if (vx > 0) {
temp._xscale = -100;
}
} else {
_local1.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump_fem", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= 0) {
shot_count = 1;
timeToShoot = (300 + random(200)) - (_local1.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 10;
}
}
if ((timeToNade--) <= 0) {
dist = Math.abs(_local1.hero._x - _x);
if ((dist < 300) && (dist > 100)) {
throwNade();
}
timeToNade = 600 + random(600);
}
}
function shoot() {
var _local1 = _root;
_local1.playSound("bomb_hit.wav");
dx = _local1.hero._x - _x;
dy = (_local1.hero._y - 10) - (_y - 20);
g = _local1.gravity * 2;
if (dx < 0) {
lvx = -5;
} else {
lvx = 5;
}
t = (_local1.hero._x - _x) / (lvx - _local1.hero.vx);
lvy = (dy - (((0.5 * g) * t) * t)) / t;
proj = _local1.addObj("enemy_rpg", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
proj.vx = lvx;
proj.vy = lvy;
proj._x = _x;
proj._y = _y - 20;
}
function throwNade() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 130;
lvy = -3 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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;
xmax = _root.g_width + 10;
ymax = _root.g_ground + 10;
Instance of Symbol 448 MovieClip "head" in Symbol 553 MovieClip [enemy_rpg_shooter] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 553 MovieClip [enemy_rpg_shooter] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 553 MovieClip [enemy_rpg_shooter] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 554 MovieClip [enemy_rpg] Frame 1
function setVelocity(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() {
var _local1 = _root;
if (_local1.hero.hitbox.hitTest(_x, _y, 0)) {
_local1.addExplosion(_x, _y, range, dmg);
_local1.playHitEnemySound();
this.unloadMovie();
}
}
function testHitStruct() {
var _local1 = _root;
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 1)) {
hitstruct = true;
break;
}
}
if (hitstruct) {
_local1.addExplosion(_x, _y, range, dmg);
_local1.playHitEnemySound();
this.unloadMovie();
}
}
function testHitEnemies() {
var _local1 = _root;
var _local2 = this;
for (i in _local1.enemies) {
ene = _local1.enemies[i];
if (ene.hitbox.hitTest(_x, _y, 0)) {
_local1.addExplosion(_x, _y, range, dmg);
_local1.playHitEnemySound();
_local2.unloadMovie();
}
}
}
function testHitObstructions() {
var _local1 = _root;
var _local2 = this;
if (_local1.ground.ground_body.hitTest(_x, _y, 1)) {
_local1.addExplosion(_x, _y, range, dmg);
_local2.unloadMovie();
}
for (i in _local1.obstructions) {
if (_local1.obstructions[i].hitTest(_x, _y, 1)) {
_local1.obstructions[i].takeDamage(3, _x, _y, vx, vy);
_local1.addExplosion(_x, _y, range, dmg);
_local2.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 = 20;
dmg = 20;
ground_spot = _root.bullet_ground - 20;
Instance of Symbol 144 MovieClip in Symbol 554 MovieClip [enemy_rpg] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 556 MovieClip [helm_fly] Frame 1
function step() {
if (bounceCount < 3) {
if (vx > 0) {
_rotation = (_rotation + rot_rate);
} else {
_rotation = (_rotation - rot_rate);
}
vy = vy + mygrav;
xprev = _x;
yprev = _y;
_y = (_y + vy);
_x = (_x + vx);
if (timer < 50) {
_alpha = (_alpha - 5);
}
if ((timer--) < 0) {
this.unloadMovie();
}
testHitObstructions();
}
}
function testHitObstructions() {
if (_root.ground.ground_body.hitTest(_x, _y, 1)) {
bounceCount++;
_x = xprev;
_y = yprev;
vy = vy * -0.5;
vx = vx * 0.5;
rot_rate = rot_rate * 0.5;
}
}
timer = 1000;
rot_rate = 6;
mygrav = _root.gravity * 2;
bounceCount = 0;
Instance of Symbol 555 MovieClip in Symbol 556 MovieClip [helm_fly] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 16 MovieClip in Symbol 557 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = _root.bow._rotation;
}
Symbol 568 MovieClip Frame 1
function step() {
_alpha = (_alpha - 3);
if (_alpha <= 0) {
this.unloadMovie();
}
}
Instance of Symbol 374 MovieClip in Symbol 568 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 569 MovieClip Frame 100
this.unloadMovie();
Instance of Symbol 561 MovieClip in Symbol 572 MovieClip Frame 1
onClipEvent (load) {
vx = 0;
gx = 0.2;
bounces = 0;
_alpha = 0;
}
onClipEvent (enterFrame) {
if (bounces < 5) {
if (_alpha < 100) {
_alpha = (_alpha + 2);
}
if (_x > 130) {
_x = 130;
bounces++;
vx = vx * -0.5;
}
vx = vx + gx;
_x = (_x + vx);
}
}
Instance of Symbol 571 MovieClip in Symbol 572 MovieClip Frame 124
onClipEvent (load) {
vx = 0;
gx = -0.2;
bounces = 0;
_alpha = 0;
}
onClipEvent (enterFrame) {
if (bounces < 5) {
if (_alpha < 100) {
_alpha = (_alpha + 2);
}
if (_x < 162) {
_x = 162;
bounces++;
vx = vx * -0.5;
}
vx = vx + gx;
_x = (_x + vx);
}
}
Symbol 583 MovieClip Frame 1
function step() {
var _local1 = _root;
hitladder = ladder.hitTest(_local1.hero._x, _local1.hero._y, 0);
if (Key.isDown(_local1.KEY_W)) {
if (hitladder) {
_local1.hero.vx = 0;
_local1.hero.vy = 0;
_local1.hero._y = _local1.hero._y - 1;
}
} else if (Key.isDown(_local1.KEY_S)) {
if (hitladder) {
_local1.hero.vx = 0;
_local1.hero.vy = 0;
_local1.hero._y = _local1.hero._y + 1;
}
}
}
Instance of Symbol 580 MovieClip "mark_b" in Symbol 583 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Instance of Symbol 582 MovieClip in Symbol 583 MovieClip Frame 1
onClipEvent (load) {
_root.structures.push(this);
}
Instance of Symbol 124 MovieClip "ladder" in Symbol 583 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 591 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 595 MovieClip Frame 1
function step() {
var _local1 = _root;
if (timeToWait > 0) {
timeToWait--;
} else {
_y = (_y + 1);
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 0)) {
hitstruct = true;
break;
}
}
if (hitstruct || (_local1.ground.ground_body.hitTest(_x, _y, 1))) {
_local1.addRandomGoodie(_x, _y);
chute = _local1.addObj("parachute_fade", _local1.debris_layer, _local1.getNextDebrisLevel());
chute._x = _x;
chute._y = _y - 23.8;
timeToWait = random(500) + 1000;
_y = -20;
_x = (random(_local1.g_width - 30) + 15);
}
}
}
timeToWait = 0;
ground_spot = _root.bullet_ground - 20;
Instance of Symbol 594 MovieClip in Symbol 595 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Symbol 608 MovieClip Frame 1
function step() {
if (_root.paused) {
pause_text = "unpause";
} else {
pause_text = "pause";
}
}
pause_text = "pause";
Instance of Symbol 606 MovieClip in Symbol 608 MovieClip Frame 1
onClipEvent (enterFrame) {
_parent.step();
}
Symbol 609 Button
on (release) {
if (!_root.game_ended) {
_root.paused = !_root.paused;
}
}
on (keyPress "p") {
if (!_root.game_ended) {
_root.paused = !_root.paused;
}
}
Symbol 610 Button
on (release) {
if (!_root.game_ended) {
_root.openNamer();
}
}
Symbol 611 Button
on (release) {
_root.openHelp();
}
Symbol 612 Button
on (release) {
if (!_root.game_ended) {
_root.showTopScores();
}
}
Symbol 621 MovieClip Frame 1
stop();
Symbol 621 MovieClip Frame 70
gotoAndPlay (10);
Symbol 621 MovieClip Frame 142
gotoAndPlay ("shooting");
Symbol 622 MovieClip [enemy2] Frame 1
function step() {
var _local1 = _root;
xpos = _x;
ypos = _y;
if (vx > 0) {
_xscale = -100;
} else {
_xscale = 100;
}
if ((timeToCheckDirection++) > 100) {
timeToCheckDirection = 0;
dx = _x - _local1.hero._x;
if (dx > 0) {
vx = -speed;
} else {
vx = speed;
}
}
bottom = _local1.ground.ground_body.hitTest(_x, _y, 1);
grounded = _local1.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 + 0.5;
if (count > 60) {
count = 0;
}
vy = vy + _local1.gravity;
_x = (_x + vx);
_y = (_y + vy);
body.gotoAndStop(Math.floor(count + mode));
} else {
shooting = (shootCount++) < 10;
}
if (((_x < -40) || (_x > xmax)) || (_y > ymax)) {
_local1.removeEnemy(this);
}
if (hp <= 0) {
if (deathCode == "exploded") {
_local1.increaseScore(5, _x, _y);
if (explosion_impact > 25) {
_local1.addBloodExplosion(_x, _y - 20);
} else {
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y - 5;
temp.vx = explosion_dx * 0.8;
temp.vy = explosion_dy * 0.8;
temp._rotation = random(360);
if (helmutHp > 0) {
throwHelm(_x, _y - _height);
}
}
} else if (deathCode == "head_shot") {
_local1.increaseScore(15, _x, _y);
_alpha = 0;
_local1.placeDeadBody("body_dieing2", _x, _y, vx);
} else {
_local1.increaseScore(10, _x, _y);
_alpha = 0;
lvl = _local1.getNextDebrisLevel();
temp = _local1.addObj("blood_stump", _local1.debris_layer, lvl);
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
if (helmutHp > 0) {
throwHelm(_x, _y - _height);
}
}
_local1.removeEnemy(this);
}
if ((timeToShoot--) <= 0) {
shoot();
if ((shot_count++) >= clip_size) {
shot_count = 0;
timeToShoot = (200 + random(100)) - (_local1.level * 5);
if (timeToShoot < 100) {
timeToShoot = 100;
}
} else {
timeToShoot = 5;
}
}
}
function throwHelm(x, y) {
var _local1 = _root;
body.my_helm.unloadMovie();
deb = _local1.addObj("helm_fly", _local1.debris_layer, _local1.getNextDebrisLevel());
deb._x = x;
deb._y = y;
deb.vx = (vx / 5) + ((random(10) - random(10)) / 10);
deb.vy = -3;
}
function shoot() {
var _local1 = _root;
_local1.playSound("tat3.wav");
shootCount = 1;
shooting = true;
body.gotoAndPlay("shooting");
bullet = _local1.addObj("enemy_bullet", _local1.enemy_bullet_layer, _local1.getNextEnemyBulletLevel());
shot_speed = 2 * (1 + (_local1.level * 0.02));
if (shot_speed > 8) {
shot_speed = 8;
}
wild_factor = 4;
dx = _local1.hero._x - _x;
dy = _local1.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() {
var _local1 = _root;
dx = _local1.hero._x - _x;
dy = _local1.hero._y - _y;
lvx = dx / 120;
lvy = -3 + (dy / 100);
lvl = _local1.getNextEnemyBulletLevel();
proj = _local1.addObj("hero_grenade", _local1.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) {
var _local1 = _root;
var _local2 = y;
var _local3 = x;
_local1.playHitEnemySound();
if (weakspot.hitTest(_local3, _local2, 0)) {
if (helmutHp > 0) {
helmutHp--;
_local1.playSound("ching1.wav");
if (helmutHp <= 0) {
throwHelm(_local3, _local2);
}
} else {
deathCode = "head_shot";
hp = 0;
c = 0;
while (c < 3) {
blood = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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 = _local1.addObj("blood_drop", _local1.debris_layer, _local1.getNextDebrisLevel());
blood._x = _local3;
blood._y = _local2;
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();
helmutHp = 3;
hp = 15 + Math.floor(_root.level * 0.5);
speed = 0.3;
mode = 71;
count = random(100);
animFactor = 0.01;
helmAlpha = random(2) * 100;
timeToCheckDirection = 0;
half_height = _height / 2;
explosion_dist = 0;
timeToShoot = 300 + random(300);
timeToNade = 400 + random(600);
shot_count = 0;
xpos = 0;
ypos = 0;
shootCount = 0;
shooting = false;
xmax = _root.g_width + 40;
ymax = _root.g_ground + 40;
clip_size = 2 + Math.floor(_root.level / 3);
if (clip_size > 6) {
clip_size = 6;
}
Instance of Symbol 124 MovieClip "hitbox" in Symbol 622 MovieClip [enemy2] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 124 MovieClip "weakspot" in Symbol 622 MovieClip [enemy2] Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 621 MovieClip "body" in Symbol 622 MovieClip [enemy2] Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 446 MovieClip "f2" in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Instance of Symbol 446 MovieClip "f3" in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Instance of Symbol 446 MovieClip "f1" in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Instance of Symbol 446 MovieClip "f2" in Symbol 633 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Instance of Symbol 446 MovieClip "f2" in Symbol 633 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Instance of Symbol 446 MovieClip "f2" in Symbol 633 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Instance of Symbol 446 MovieClip "f2" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Instance of Symbol 446 MovieClip "f2" in Symbol 637 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Instance of Symbol 630 MovieClip in Symbol 638 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "gun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 633 MovieClip in Symbol 638 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "shotgun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 635 MovieClip in Symbol 638 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rpg") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 637 MovieClip in Symbol 638 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "uzi") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 441 MovieClip in Symbol 638 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode != "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 640 MovieClip in Symbol 641 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Instance of Symbol 446 MovieClip "f2" in Symbol 641 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
_alpha = _root.hero.flareAlpha;
}
Symbol 649 MovieClip Frame 10
stop();
Instance of Symbol 641 MovieClip "launcher2" in Symbol 651 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 441 MovieClip in Symbol 651 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 650 MovieClip in Symbol 651 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "bow") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 635 MovieClip in Symbol 652 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rpg") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 630 MovieClip in Symbol 652 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "gun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 637 MovieClip in Symbol 652 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "uzi") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 633 MovieClip in Symbol 652 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "shotgun") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 641 MovieClip "launcher" in Symbol 652 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 650 MovieClip in Symbol 652 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "bow") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 441 MovieClip in Symbol 652 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode != "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 441 MovieClip in Symbol 652 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.shooting_mode == "rocket") {
_alpha = 100;
} else {
_alpha = 0;
}
}
Instance of Symbol 651 MovieClip "rifle_invert" in Symbol 654 MovieClip Frame 1
onClipEvent (load) {
orig_x = _x;
_alpha = 0;
}
onClipEvent (enterFrame) {
_x = (orig_x - _root.hero.kickAmt);
}
Instance of Symbol 653 MovieClip "rifle" in Symbol 654 MovieClip Frame 1
onClipEvent (load) {
orig_x = _x;
_alpha = 0;
}
onClipEvent (enterFrame) {
_x = (orig_x - _root.hero.kickAmt);
}
Symbol 655 MovieClip Frame 1
stop();
Instance of Symbol 623 MovieClip in Symbol 655 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 624 MovieClip in Symbol 655 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 654 MovieClip in Symbol 655 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 654 MovieClip in Symbol 655 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 624 MovieClip in Symbol 655 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 624 MovieClip in Symbol 655 MovieClip Frame 3
onClipEvent (enterFrame) {
gotoAndStop (23);
}
Instance of Symbol 624 MovieClip in Symbol 655 MovieClip Frame 4
onClipEvent (enterFrame) {
gotoAndStop (23);
}
Instance of Symbol 623 MovieClip in Symbol 655 MovieClip Frame 5
onClipEvent (load) {
yorig = _y;
}
onClipEvent (enterFrame) {
_y = (yorig + _root.hero.crouch_factor);
}
Instance of Symbol 624 MovieClip in Symbol 655 MovieClip Frame 5
onClipEvent (load) {
frame = 76;
gotoAndStop(frame);
}
onClipEvent (enterFrame) {
count = _parent._parent.crouch_count;
gotoAndStop(frame + count);
}
Instance of Symbol 654 MovieClip in Symbol 655 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 624 MovieClip in Symbol 655 MovieClip Frame 6
onClipEvent (load) {
frame = 76;
gotoAndStop(frame);
}
onClipEvent (enterFrame) {
count = _parent._parent.crouch_count;
gotoAndStop(frame + count);
}
Instance of Symbol 624 MovieClip in Symbol 655 MovieClip Frame 7
onClipEvent (load) {
frame = 76;
gotoAndStop(frame);
}
onClipEvent (enterFrame) {
count = _parent._parent.crouch_count;
gotoAndStop(frame + count);
}
Symbol 658 MovieClip Frame 1
function step() {
var _local1 = _root;
if (_visible) {
if (flareAlpha > 0) {
flareAlpha = flareAlpha - 30;
}
if (kickAmt > 0.01) {
kickAmt = kickAmt * 0.75;
}
right_foot = _local1.ground.ground_body.hitTest(_x + 6, _y, 1);
left_foot = _local1.ground.ground_body.hitTest(_x - 6, _y, 1);
right_hand = _local1.ground.ground_body.hitTest(_x + 6, _y - 8, 1);
left_hand = _local1.ground.ground_body.hitTest(_x - 6, _y - 8, 1);
bottom = _local1.ground.ground_body.hitTest(_x, _y, 1);
hitstruct = false;
for (ndx in _local1.structures) {
if (_local1.structures[ndx].hitTest(_x, _y, 1)) {
struct_on = _local1.structures[ndx];
hitstruct = true;
break;
}
}
bottom = bottom || (hitstruct);
if (!grounded) {
grounded = _local1.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 > (_local1.g_width - half_width)) {
_x = (_local1.g_width - half_width);
}
if (_y < half_height) {
_y = half_height;
} else if (_y > (_local1.g_ground - half_height)) {
_y = (_local1.g_ground - half_height);
}
if (!crouching) {
if (Key.isDown(_local1.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(_local1.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(_local1.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(_local1.KEY_SPACEBAR) && (jump_count < 1)) && (space_released)) && (!crouching)) {
jump_count++;
space_released = false;
grounded = false;
vy = -2;
}
if (!Key.isDown(_local1.KEY_SPACEBAR)) {
space_released = true;
holdcount = 0;
} else {
holdcount++;
wants_to_crouch = false;
}
if ((Key.isDown(_local1.KEY_A) || (Key.isDown(_local1.KEY_D))) || (Key.isDown(_local1.KEY_W))) {
wants_to_crouch = false;
}
xprev = _x;
yprev = _y;
vy = vy + gravity;
animate();
_x = (_x + vx);
_y = (_y + vy);
checkFiring();
}
}
function checkFiring() {
var _local1 = _root;
if (_local1.shooting_mode == "gun") {
if (timeToShoot > 0) {
timeToShoot--;
}
} else if (_local1.shooting_mode == "rocket") {
if (timeToShootRocket > 0) {
timeToShootRocket--;
}
} else if (_local1.shooting_mode == "rpg") {
if (timeToShootRPG > 0) {
timeToShootRPG--;
}
} else if (_local1.shooting_mode == "shotgun") {
if (timeToShootShotgun > 0) {
timeToShootShotgun--;
}
} else if (_local1.shooting_mode == "uzi") {
if (timeToShootUzi > 0) {
timeToShootUzi--;
}
} else if (_local1.shooting_mode == "bow") {
if (timeToShootBow > 0) {
timeToShootBow--;
}
}
if (timeToThrow > 0) {
timeToThrow--;
}
if (_local1.firing) {
if ((_local1.shooting_mode == "gun") && (_local1.ammo_bullets > 0)) {
if (timeToShoot <= 0) {
_local1.shootHeroProjectile();
flareAlpha = 100;
kickAmt = 10;
_local1.aim_rate = 0;
if (_local1.gun_wild < max_spread) {
_local1.gun_wild = _local1.gun_wild + 4;
}
timeToShoot = 7;
}
} else if ((_local1.shooting_mode == "uzi") && (_local1.ammo_bullets > 0)) {
if (timeToShootUzi <= 0) {
_local1.shootHeroUzi();
flareAlpha = 100;
kickAmt = 5;
_local1.aim_rate = 0;
if (_local1.gun_wild < max_spread) {
_local1.gun_wild = _local1.gun_wild + 10;
}
timeToShootUzi = 3;
}
} else if ((_local1.shooting_mode == "rocket") && (_local1.ammo_rockets > 0)) {
if (timeToShootRocket <= 0) {
_local1.shootHeroRocket();
timeToShootRocket = 100;
flareAlpha = 100;
kickAmt = 12;
}
} else if ((_local1.shooting_mode == "shotgun") && (_local1.ammo_shells > 0)) {
if (timeToShootShotgun <= 0) {
_local1.shootHeroShotgun();
timeToShootShotgun = 50;
flareAlpha = 100;
kickAmt = 11;
}
} else if ((_local1.shooting_mode == "rpg") && (_local1.ammo_rpg > 0)) {
if (timeToShootRPG <= 0) {
_local1.shootRPG();
timeToShootRPG = 35;
flareAlpha = 100;
kickAmt = 8;
}
} else if ((_local1.shooting_mode == "bow") && (_local1.ammo_arrows > 0)) {
if (timeToShootBow <= 0) {
_local1.shootArrow();
timeToShootBow = 20;
}
}
}
if (_local1.gun_wild > aim_error) {
if (_local1.aim_rate > 0) {
_local1.aim_rate = 0;
}
_local1.aim_rate = _local1.aim_rate - 0.05;
} else {
if (_local1.aim_rate < 0) {
_local1.aim_rate = 0;
}
_local1.aim_rate = _local1.aim_rate + 0.05;
}
_local1.gun_wild = _local1.gun_wild + _local1.aim_rate;
if ((Key.isDown(_local1.KEY_E) && (timeToThrow <= 0)) && (_local1.ammo_grenades > 0)) {
timeToThrow = 60;
_local1.shootGrenade();
}
if ((Key.isDown(_local1.KEY_R) && (timeToThrow <= 0)) && (_local1.ammo_prox_mines > 0)) {
timeToThrow = 60;
_local1.shootProximityMine();
}
}
function takeDamage(dmg) {
var _local1 = _root;
if (_visible) {
_local1.playHitEnemySound();
hp = hp - dmg;
if (hp <= 0) {
hp = 0;
temp = _local1.addObj("blood_stump", _local1.debris_layer, _local1.getNextDebrisLevel());
temp._x = _x;
temp._y = _y;
temp.vx = vx;
temp.vy = vy;
_visible = false;
}
}
}
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;
flareAlpha = 0;
kickAmt = 0;
Instance of Symbol 655 MovieClip "body" in Symbol 658 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.paused) {
_parent.step();
}
}
Instance of Symbol 656 MovieClip "sight" in Symbol 658 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 657 MovieClip "hitbox" in Symbol 658 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
yorig = _y;
h_orig = _height;
}
onClipEvent (enterFrame) {
_height = (h_orig - _parent.crouch_factor);
}
Instance of Symbol 663 MovieClip in Symbol 664 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = _root.gun_wild;
}
Instance of Symbol 663 MovieClip in Symbol 664 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = (-_root.gun_wild);
}
Instance of Symbol 663 MovieClip in Symbol 664 MovieClip Frame 1
onClipEvent (enterFrame) {
_y = _root.gun_wild;
}
Instance of Symbol 663 MovieClip in Symbol 664 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = (-_root.gun_wild);
}
Instance of Symbol 666 MovieClip "ch_shotgun" in Symbol 669 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 668 MovieClip "ch_rocket" in Symbol 669 MovieClip Frame 1
onClipEvent (load) {
_alpha = 0;
}
Symbol 682 Button
on (release) {
_root.age = 18;
if (!_root.first_time_playing) {
_root.paused = false;
}
this.unloadMovie();
}
Symbol 683 Button
on (release) {
_root.age = 1;
if (!_root.first_time_playing) {
_root.paused = false;
}
this.unloadMovie();
}
Instance of Symbol 17 MovieClip in Symbol 688 MovieClip Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
Instance of Symbol 118 MovieClip in Symbol 688 MovieClip Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
onClipEvent (load) {
_alpha = 0;
}
Instance of Symbol 118 MovieClip in Symbol 688 MovieClip Frame 1
on (release) {
getURL ("http://www.lostvectors.com", "_self");
}
onClipEvent (load) {
_alpha = 0;
}