Frame 1
stop();
var CPMStarContentSpotID = "515QB593555F";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
var Width = 800;
var Height = 400;
var LVL = 0;
var Player = new player();
var FrameRate = new Number(30);
var SoundManager = new soundManager();
var Resources = new resources();
var Save = SharedObject.getLocal("hSave");
if (Save.data.Played != undefined) {
Player.loadGame(Save);
}
_root.onEnterFrame = function () {
loadingBar.mask._xscale = loadingBar.mask._xscale - 0.4;
if (loadingBar.mask._xscale <= 0) {
delete this.onEnterFrame;
gotoAndStop ("SPONSOR");
}
};
Frame 5
stop();
adPic.onPress = function () {
adPic.getURL("http://www.minijuegos.com", "_blank", "GET");
};
Frame 10
stop();
SoundManager.musicStart(2);
if (Player.bestLvl < 1) {
cont._visible = false;
}
var menuListener = new Object();
menuListener.onMouseDown = function () {
if (nouv.hitTest(_xmouse, _ymouse)) {
SoundManager.menu_clic.start();
Player.reinitStory();
LVL = 0;
Mouse.removeListener(menuListener);
gotoAndStop ("RTC");
} else if (cont.hitTest(_xmouse, _ymouse) && (Player.bestLvl > 0)) {
LVL = Player.bestLvl;
SoundManager.menu_clic.start();
Mouse.removeListener(menuListener);
gotoAndStop ("POSTGAME");
} else if (surv.hitTest(_xmouse, _ymouse)) {
SoundManager.menu_clic.start();
Mouse.removeListener(menuListener);
gotoAndStop ("SURVIVAL");
} else if (duel.hitTest(_xmouse, _ymouse)) {
SoundManager.menu_clic.start();
Mouse.removeListener(menuListener);
gotoAndStop ("DUEL");
} else if (ach.hitTest(_xmouse, _ymouse)) {
SoundManager.menu_clic.start();
RMENU.gotoAndStop("ACH");
} else if (opt.hitTest(_xmouse, _ymouse)) {
SoundManager.menu_clic.start();
RMENU.gotoAndStop("OPT");
} else if (more.hitTest(_xmouse, _ymouse)) {
SoundManager.menu_clic.start();
more.getURL("http://www.minijuegos.com", "_blank", "GET");
}
};
Mouse.addListener(menuListener);
Frame 17
stop();
var menuListener = new Object();
menuListener.onMouseDown = function () {
if (trois.hitTest(_xmouse, _ymouse)) {
LVL = 3;
Mouse.removeListener(menuListener);
gotoAndStop ("GAME");
} else if (un.hitTest(_xmouse, _ymouse)) {
LVL = 1;
Mouse.removeListener(menuListener);
gotoAndStop ("GAME");
}
};
Mouse.addListener(menuListener);
Frame 26
stop();
_root.SoundManager.music.stop();
var ready = false;
if (LVL == 0) {
var texte = Resources.startTxt;
} else {
var texte = Resources.endingTxt;
}
var count = 0;
var rythm = 2;
_root.onEnterFrame = function () {
if ((count % rythm) == 0) {
dyn.text = dyn.text + texte.charAt(count / rythm);
}
count++;
if (count > ((texte.length * rythm) + 60)) {
ready = true;
}
if (Key.isDown(32)) {
ready = true;
}
if (ready == true) {
delete this.onEnterFrame;
if (LVL == 0) {
_root.gotoAndPlay("GAME");
} else {
_root.gotoAndStop("MAIN");
}
}
};
Frame 42
stop();
Player.reinitStory();
_root.onEnterFrame = function () {
if (Key.isDown(32)) {
delete this.onEnterFrame;
gotoAndPlay ("MAIN");
}
};
Frame 48
stop();
_root.onEnterFrame = function () {
if (Key.isDown(32)) {
delete this.onEnterFrame;
gotoAndPlay ("MAIN");
}
};
Frame 53
stop();
resultTxt.text = "You survived \n";
resultTxt.text = resultTxt.text + Math.round(Player.lastSurvTime / FrameRate);
resultTxt.text = resultTxt.text + " seconds.";
if (Player.bestSurvTime != 0) {
resultTxt.text = resultTxt.text + newline;
resultTxt.text = resultTxt.text + "Your best score was \n";
resultTxt.text = resultTxt.text + Math.round(Player.bestSurvTime / FrameRate);
resultTxt.text = resultTxt.text + " seconds.";
}
Player.setSurvTime();
Player.saveGame(Save);
_root.onEnterFrame = function () {
if (Key.isDown(32)) {
delete this.onEnterFrame;
gotoAndPlay ("MAIN");
}
};
Frame 60
stop();
_root.onEnterFrame = function () {
if (Key.isDown(32)) {
delete this.onEnterFrame;
gotoAndPlay ("DUEL");
}
};
Frame 65
stop();
var Colorizer = new colorizer();
Player.lastLvl = LVL;
Player.calculate();
Player.saveGame(Save);
normal.nameTxt.text = "Hector";
viper.nameTxt.text = "Viper Man";
stone.nameTxt.text = "Stone Man";
lava.nameTxt.text = "Lava Man";
lightspeed.nameTxt.text = "LightSpeed";
fantom.nameTxt.text = "Fantom";
ulti.nameTxt.text = "Ulti Man";
Colorizer.colorize(viper.pic.pic, "VIPER MAN");
Colorizer.colorize(stone.pic.pic, "STONE MAN");
Colorizer.colorize(lava.pic.pic, "LAVA MAN");
Colorizer.colorize(lightspeed.pic.pic, "LIGHTSPEED MAN");
Colorizer.colorize(fantom.pic.pic, "FANTOM MAN");
Colorizer.colorize(ulti.pic.pic, "ULTI MAN");
if (Player.bestLvl < 5) {
ulti._visible = false;
}
if (Player.bestLvl < 4) {
fantom._visible = false;
}
if (Player.bestLvl < 3) {
lava._visible = false;
lightspeed._visible = false;
}
if (Player.bestLvl < 2) {
stone._visible = false;
viper._visible = false;
}
normal.onPress = function () {
Player.selectedHero = "NORMAL MAN";
Player.saveGame(Save);
};
viper.onPress = function () {
Player.selectedHero = "VIPER MAN";
Player.saveGame(Save);
};
stone.onPress = function () {
Player.selectedHero = "STONE MAN";
Player.saveGame(Save);
};
lightspeed.onPress = function () {
Player.selectedHero = "LIGHTSPEED MAN";
Player.saveGame(Save);
};
lava.onPress = function () {
Player.selectedHero = "LAVA MAN";
Player.saveGame(Save);
};
fantom.onPress = function () {
Player.selectedHero = "FANTOM MAN";
Player.saveGame(Save);
};
ulti.onPress = function () {
Player.selectedHero = "ULTI MAN";
Player.saveGame(Save);
};
_root.onEnterFrame = function () {
selectedTxt.text = Player.selectedHero;
if (Key.isDown(32)) {
delete this.onEnterFrame;
gotoAndPlay ("GAME");
}
};
Frame 69
play();
Frame 70
stop();
var Game = new game(LVL, Player);
var currTime = 0;
var prevTime = 0;
var interval;
var FPS = 30;
_root.onEnterFrame = function () {
currTime = getTimer();
fps.swapDepths(50000);
fps.fps.text = Math.round(1000 / (currTime - prevTime)).toString();
prevTime = currTime;
Game.process(Player);
};
var Listener = new Object();
Listener.onMouseDown = function () {
Game.clic(_xmouse, _ymouse, Player);
};
Listener.onMouseMove = function () {
Game.mouve(_xmouse, _ymouse);
};
Mouse.addListener(Listener);
Frame 78
stop();
var Game = new game(100, Player);
var currTime = 0;
var prevTime = 0;
var interval;
var FPS = 30;
_root.onEnterFrame = function () {
currTime = getTimer();
fps.swapDepths(50000);
fps.fps.text = Math.round(1000 / (currTime - prevTime)).toString();
prevTime = currTime;
Game.process(Player);
};
var Listener = new Object();
Listener.onMouseDown = function () {
Game.clic(_xmouse, _ymouse, Player);
};
Listener.onMouseMove = function () {
Game.mouve(_xmouse, _ymouse);
};
Mouse.addListener(Listener);
Frame 85
stop();
var Game = new game(99, Player);
var currTime = 0;
var prevTime = 0;
var interval;
var FPS = 30;
_root.onEnterFrame = function () {
currTime = getTimer();
fps.swapDepths(50000);
fps.fps.text = Math.round(1000 / (currTime - prevTime)).toString();
prevTime = currTime;
Game.process(Player);
};
var Listener = new Object();
Listener.onMouseDown = function () {
Game.clic(_xmouse, _ymouse, Player);
};
Listener.onMouseMove = function () {
Game.mouve(_xmouse, _ymouse);
};
Mouse.addListener(Listener);
Symbol 35 MovieClip [Vomit] Frame 1
stop();
Symbol 35 MovieClip [Vomit] Frame 2
stop();
Symbol 35 MovieClip [Vomit] Frame 3
stop();
Symbol 35 MovieClip [Vomit] Frame 4
stop();
Symbol 35 MovieClip [Vomit] Frame 10
stop();
Symbol 91 MovieClip [Bullet] Frame 1
stop();
Symbol 107 MovieClip Frame 1
_root.SoundManager.nmi_footStep1.start();
Symbol 107 MovieClip Frame 20
_root.SoundManager.nmi_footStep2.start();
Symbol 107 MovieClip Frame 40
gotoAndPlay ("walk");
Symbol 107 MovieClip Frame 71
stop();
Symbol 107 MovieClip Frame 80
stop();
Symbol 107 MovieClip Frame 81
stop();
Symbol 107 MovieClip Frame 90
stop();
Symbol 123 MovieClip Frame 32
gotoAndPlay ("walk");
Symbol 123 MovieClip Frame 60
stop();
Symbol 123 MovieClip Frame 81
stop();
Symbol 123 MovieClip Frame 83
stop();
Symbol 135 MovieClip Frame 14
gotoAndPlay ("walk");
Symbol 135 MovieClip Frame 30
stop();
Symbol 135 MovieClip Frame 40
stop();
Symbol 143 MovieClip Frame 24
gotoAndPlay ("walk");
Symbol 143 MovieClip Frame 60
stop();
Symbol 143 MovieClip Frame 61
stop();
Symbol 151 MovieClip Frame 30
gotoAndPlay ("walk");
Symbol 151 MovieClip Frame 60
stop();
Symbol 151 MovieClip Frame 90
stop();
Symbol 167 MovieClip Frame 1
stop();
Symbol 167 MovieClip Frame 41
gotoAndPlay ("walk");
Symbol 167 MovieClip Frame 49
gotoAndPlay ("walk");
Symbol 167 MovieClip Frame 61
stop();
Symbol 167 MovieClip Frame 81
stop();
Symbol 167 MovieClip Frame 100
stop();
Symbol 167 MovieClip Frame 105
stop();
Symbol 189 MovieClip [Bris] Frame 7
stop();
Symbol 214 MovieClip Frame 20
gotoAndPlay ("walk");
Symbol 214 MovieClip Frame 40
stop();
Symbol 214 MovieClip Frame 41
stop();
Symbol 241 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 18
gotoAndPlay ("static");
Symbol 241 MovieClip Frame 27
_root.SoundManager.hero_footStep1.start();
Symbol 241 MovieClip Frame 41
_root.SoundManager.hero_footStep2.start();
Symbol 241 MovieClip Frame 49
gotoAndPlay ("walk");
Symbol 241 MovieClip Frame 61
stop();
Symbol 241 MovieClip Frame 81
stop();
Symbol 241 MovieClip Frame 90
stop();
Symbol 241 MovieClip Frame 100
stop();
Symbol 241 MovieClip Frame 105
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 262 MovieClip Frame 49
gotoAndPlay ("walk");
Symbol 262 MovieClip Frame 61
stop();
Symbol 262 MovieClip Frame 81
stop();
Symbol 262 MovieClip Frame 89
stop();
Symbol 262 MovieClip Frame 100
stop();
Symbol 276 MovieClip [RTC_01] Frame 40
Symbol 276 MovieClip [RTC_01] Frame 136
_root.ready = true;
Symbol 299 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
musVol.indic._x = (_root.SoundManager.vol_music / 100) * 90;
sfxVol.indic._x = (_root.SoundManager.vol_sfx / 100) * 90;
};
musVol.Larrow.onPress = function () {
_root.SoundManager.setVolumeMusic(-5);
};
musVol.Rarrow.onPress = function () {
_root.SoundManager.setVolumeMusic(5);
};
sfxVol.Rarrow.onPress = function () {
_root.SoundManager.setVolumeSfx(5);
};
sfxVol.Larrow.onPress = function () {
_root.SoundManager.setVolumeSfx(-5);
};
Symbol 305 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
Symbol 305 MovieClip Frame 2
stop();
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 308 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
Symbol 308 MovieClip Frame 2
stop();
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 309 MovieClip [PauseMenu] Frame 1
stop();
back.onPress = function () {
if (_root.Game != undefined) {
_root.Game.unPause();
}
};
quit.onPress = function () {
if (_root.Game != undefined) {
_root.Game.quitGame();
}
};
Symbol 317 MovieClip [DUEL_Intro] Frame 1
_root.Game.setPause();
Symbol 317 MovieClip [DUEL_Intro] Frame 94
_root.Game.unPause();
this.removeMovieClip();
Symbol 321 MovieClip [FADER] Frame 121
stop();
Symbol 325 MovieClip [helpText] Frame 240
stop();
Symbol 329 MovieClip [Alert] Frame 41
stop();
Symbol 335 MovieClip [ADBANNER_s] Frame 1
pic.onPress = function () {
pic.getURL("http://www.minijuegos.com", "_blank", "GET");
};
Symbol 341 MovieClip [ADBANNER] Frame 1
pic.onPress = function () {
pic.getURL("http://www.minijuegos.com", "_blank", "GET");
};
Symbol 501 MovieClip [__Packages.resources] Frame 0
class resources
{
var startTxt, endingTxt;
function resources () {
startTxt = "My name is Hector.\n ";
startTxt = startTxt + "I am a super hero.\n";
startTxt = startTxt + "Although I think my power is worth nothing. \n";
startTxt = startTxt + "Being a Hero seemed cool at first.\n";
startTxt = startTxt + "I learned how to help society from an old-school Hero called Charon.\n";
startTxt = startTxt + "'It is our mission to create a new, better world', he used to say.\n";
startTxt = startTxt + "But people don't want to change at all, and make the same mistakes \n over and over again.\n\n";
startTxt = startTxt + "I just wanted to live in peace, without responsibilities.\n\n";
startTxt = startTxt + "I finally hid in a small village.\n ";
startTxt = startTxt + "I think people here know about me, but they don't care.\n\n";
startTxt = startTxt + "That's why I love this place.\n\n";
startTxt = startTxt + "I heard that the country was attacked by \n monsters that came about from nowhere.\n";
startTxt = startTxt + "But why should I care? I know that there are other Heroes out there \n ";
startTxt = startTxt + "And they love this kind of stuff - kill monsters and everything.\n\n";
startTxt = startTxt + "I belong here.\n";
startTxt = startTxt + "But sometimes I dream of the big city.\n";
startTxt = startTxt + "Sometimes I dream of Charon ...\n";
endingTxt = "So that's it.\n\n";
endingTxt = endingTxt + "After Charon died, monsters strangely disappeared..\n";
endingTxt = endingTxt + "They came out of his mind, don't ask me how.\n";
endingTxt = endingTxt + "It was certainly a new Super Power that he had invented.\n\n";
endingTxt = endingTxt + "Many people died here. Everywhere.\n\n";
endingTxt = endingTxt + "Nobody wants to hear about heroes now.\n\n";
endingTxt = endingTxt + "Other heroes have been killed by Charon, anyway.\n";
endingTxt = endingTxt + "I guess I am the last...\n\n";
endingTxt = endingTxt + "Anyway, it's over now.\n\n";
endingTxt = endingTxt + "That was my story.\n";
endingTxt = endingTxt + "My name is Hector.\n";
endingTxt = endingTxt + "I am an average guy.";
}
}
Symbol 502 MovieClip [__Packages.soundManager] Frame 0
class soundManager
{
var master_music, master_sfx, vol_music, vol_sfx, music, hero_footStep1, hero_footStep2, hero_decoll, hero_land, hero_spit, hero_splash, hero_say, nmi_footStep1, nmi_footStep2, nmi_Assault, nmi_Hit, nmi_Shoot, nmi_Bomb, boss_say, villager_say1, villager_say2, villager_say3, menu_clic;
function soundManager () {
master_music = _root.createEmptyMovieClip("MASTERMUS", 52000);
master_sfx = _root.createEmptyMovieClip("MASTERSFX", 52001);
vol_music = 35;
vol_sfx = 100;
music = new Sound(master_music);
hero_footStep1 = new Sound(master_sfx);
hero_footStep2 = new Sound(master_sfx);
hero_footStep1.attachSound("Footstep_01.wav");
hero_footStep2.attachSound("Footstep_02.wav");
hero_decoll = new Sound(master_sfx);
hero_decoll.attachSound("Decollage.wav");
hero_land = new Sound(master_sfx);
hero_land.attachSound("Land.wav");
hero_spit = new Sound(master_sfx);
hero_spit.attachSound("Spit.wav");
hero_splash = new Sound(master_sfx);
hero_splash.attachSound("Splash");
hero_say = new Sound(master_sfx);
hero_say.attachSound("say");
nmi_footStep1 = new Sound(master_sfx);
nmi_footStep1.attachSound("FootStep1.wav");
nmi_footStep2 = new Sound(master_sfx);
nmi_footStep2.attachSound("FootStep1.wav");
nmi_Assault = new Sound(master_sfx);
nmi_Assault.attachSound("Assault");
nmi_Hit = new Sound(master_sfx);
nmi_Hit.attachSound("Hit");
nmi_Shoot = new Sound(master_sfx);
nmi_Shoot.attachSound("Shoot");
nmi_Bomb = new Sound(master_sfx);
nmi_Bomb.attachSound("Bomb");
boss_say = new Sound(master_sfx);
boss_say.attachSound("bossay");
villager_say1 = new Sound(master_sfx);
villager_say1.attachSound("say1");
villager_say2 = new Sound(master_sfx);
villager_say2.attachSound("say2");
villager_say3 = new Sound(master_sfx);
villager_say3.attachSound("say3");
menu_clic = new Sound(master_sfx);
menu_clic.attachSound("clic");
}
function musicStart(ID) {
if (music != null) {
music.stop();
}
switch (ID) {
case 1 :
music.attachSound("Loop1");
break;
case 2 :
music.attachSound("Loop2");
break;
case 3 :
music.attachSound("Loop3");
break;
case 4 :
music.attachSound("Loop4");
}
music.start(0, 99);
}
function setVolumeMusic(vol) {
vol_music = vol_music + vol;
vol_music = Math.max(0, vol_music);
vol_music = Math.min(100, vol_music);
music.setVolume(vol_music);
}
function setVolumeSfx(vol) {
vol_sfx = vol_sfx + vol;
vol_sfx = Math.max(0, vol_sfx);
vol_sfx = Math.min(100, vol_sfx);
hero_footStep1.setVolume(vol_sfx);
}
}
Symbol 503 MovieClip [__Packages.player] Frame 0
class player
{
var selectedHero, lastLvl, bestLvl, gameWon, duelWon, damageTaken, spits, killed, walkAmount, flyAmount, damageTaken_total, spits_total, killed_total, walkAmount_total, flyAmount_total, walkAmount_m, flyAmount_m, lastSurvTime, bestSurvTime;
function player () {
selectedHero = "NORMAL MAN";
lastLvl = 0;
bestLvl = 0;
gameWon = 0;
duelWon = 0;
damageTaken = 0;
spits = 0;
killed = 0;
walkAmount = 0;
flyAmount = 0;
damageTaken_total = 0;
spits_total = 0;
killed_total = 0;
walkAmount_total = 0;
flyAmount_total = 0;
walkAmount_m = 0;
flyAmount_m = 0;
lastSurvTime = 0;
bestSurvTime = 0;
}
function initLvl() {
flyAmount = 0;
walkAmount = 0;
spits = 0;
damageTaken = 0;
killed = 0;
}
function calculate() {
flyAmount_total = flyAmount_total + flyAmount;
walkAmount_total = walkAmount_total + walkAmount;
spits_total = spits_total + spits;
damageTaken_total = damageTaken_total + damageTaken;
killed_total = killed_total + killed;
if (lastLvl >= bestLvl) {
bestLvl = lastLvl;
}
flyAmount_m = Math.round(flyAmount_total / 10);
walkAmount_m = Math.round(walkAmount_total / 10);
}
function setSurvTime() {
if (lastSurvTime > bestSurvTime) {
bestSurvTime = lastSurvTime;
}
}
function loadGame(Save) {
if (Save.data.lastLvl != undefined) {
lastLvl = Save.data.lastLvl;
}
if (Save.data.bestLvl != undefined) {
bestLvl = Save.data.bestLvl;
}
if (Save.data.gameWon != undefined) {
gameWon = Save.data.gameWon;
}
if (Save.data.duelWon != undefined) {
duelWon = Save.data.duelWon;
}
if (Save.data.damageTaken != undefined) {
damageTaken_total = Save.data.damageTaken;
}
if (Save.data.spits != undefined) {
spits_total = Save.data.spits;
}
if (Save.data.killed != undefined) {
killed_total = Save.data.killed;
}
if (Save.data.walkAmount != undefined) {
walkAmount_total = Save.data.walkAmount;
}
if (Save.data.flyAmount != undefined) {
flyAmount_total = Save.data.flyAmount;
}
if (Save.data.selectedHero != undefined) {
selectedHero = Save.data.selectedHero;
}
if (Save.data.bestSurvTime != undefined) {
bestSurvTime = Save.data.bestSurvTime;
}
if (Save.data.bestSurvTime != undefined) {
lastSurvTime = Save.data.bestSurvTime;
}
}
function saveGame(Save) {
Save.data.Played = 1;
Save.data.lastLvl = lastLvl;
Save.data.bestLvl = bestLvl;
Save.data.gameWon = gameWon;
Save.data.duelWon = duelWon;
Save.data.damageTaken = damageTaken_total;
Save.data.spits = spits_total;
Save.data.killed = killed_total;
Save.data.walkAmount = walkAmount_total;
Save.data.flyAmount = flyAmount_total;
Save.data.selectedHero = selectedHero;
Save.data.bestSurvTime = bestSurvTime;
Save.flush();
}
function reinitStory() {
lastLvl = 1;
damageTaken = 0;
spits = 0;
killed = 0;
walkAmount = 0;
flyAmount = 0;
selectedHero = "NORMAL MAN";
}
function getRanName() {
switch (Math.round(Math.random() * 6)) {
case 0 :
return("NORMAL MAN");
case 1 :
return("VIPER MAN");
case 2 :
return("STONE MAN");
case 3 :
return("LAVA MAN");
case 4 :
return("LIGHTSPEED MAN");
case 5 :
return("FANTOM MAN");
case 6 :
return("ULTI MAN");
}
}
function getName() {
switch ((duelWon + 1) % 7) {
case 1 :
return("NORMAL MAN");
case 2 :
return("VIPER MAN");
case 3 :
return("STONE MAN");
case 4 :
return("LAVA MAN");
case 5 :
return("LIGHTSPEED MAN");
case 6 :
return("FANTOM MAN");
case 0 :
return("ULTI MAN");
}
}
}
Symbol 504 MovieClip [__Packages.colorizer] Frame 0
class colorizer
{
var colour;
function colorizer () {
colour = new flash.geom.ColorTransform();
}
function colorize(Pic, Type) {
colour = Pic.transform.colorTransform;
switch (Type) {
case "NORMAL MAN" :
break;
case "VIPER MAN" :
colour.greenMultiplier = 0.5;
colour.redMultiplier = 0.5;
colour.blueMultiplier = 0.5;
colour.greenOffset = 50;
colour.redOffset = -50;
colour.blueOffset = -50;
break;
case "STONE MAN" :
colour.greenMultiplier = 0.5;
colour.redMultiplier = 0.5;
colour.blueMultiplier = 0.5;
colour.redOffset = 20;
break;
case "LAVA MAN" :
colour.greenMultiplier = 0.5;
colour.redMultiplier = 0.6;
colour.blueMultiplier = 0.5;
colour.redOffset = 80;
colour.greenOffset = -50;
colour.blueOffset = -50;
break;
case "LIGHTSPEED MAN" :
colour.greenMultiplier = 1.5;
colour.redMultiplier = 1.5;
colour.blueMultiplier = 0;
colour.greenOffset = 50;
colour.blueOffset = -100;
break;
case "ULTI MAN" :
colour.greenMultiplier = 0.2;
colour.redMultiplier = 0.2;
colour.blueMultiplier = 0.2;
break;
case "FANTOM MAN" :
}
Pic.transform.colorTransform = colour;
}
}
Symbol 505 MovieClip [__Packages.game] Frame 0
class game
{
var ad, alertRoll, pausing, blocked, fading, stackedState, waitStateCount, FX, Level, lastLevel, Scene, Bg, Hero, ScrollManager, Villagers, Death, Boss, Scenario, Enemies, Challenger, IA, duelLvl;
function game (LVL, Player) {
ad = _root.attachMovie("ADBANNER_s", "adpic", 12756, {_xscale:75, _yscale:75, _x:Stage.width - 126, _y:Stage.height - 30, _alpha:60});
alertRoll = 0;
pausing = false;
blocked = false;
fading = false;
stackedState = "";
waitStateCount = 0;
if ((LVL != 99) && (LVL != 100)) {
Player.lastLvl = LVL;
}
Player.initLvl();
switch (LVL) {
case 0 :
_root.attachMovie("skip", "SkipTXT", 80000, {_x:_root.Width / 2, _y:_root.Height - 20});
case 1 :
FX = new fparticles("fx_one", false);
break;
case 2 :
FX = new fparticles("fx_two", false);
break;
case 3 :
FX = new fparticles("fx_three", false);
break;
case 4 :
FX = new fparticles("fx_four", false);
break;
case 5 :
case 99 :
FX = new fparticles("fx_five", false);
break;
case 6 :
FX = new fparticles("fx_six", true);
}
Level = LVL;
lastLevel = 7;
Scene = _root.createEmptyMovieClip("Scene", 0);
if (Level == 100) {
Bg = new bg(Scene, Math.round(Math.random() * 6), false);
} else {
Bg = new bg(Scene, LVL, true);
}
Hero = new hero(Scene, Bg, Player, false, (Level != 99) && (Level != 100));
ScrollManager = new scrollManager(Scene, Bg, Hero);
Villagers = new villagerManager();
Death = false;
if ((Level == 6) || (Level == 0)) {
Boss = new boss(Scene, Bg, Level == 6);
Scenario = new scenario(LVL, Enemies, Villagers, Scene, Bg);
} else if (Level == 100) {
Challenger = new hero(Scene, Bg, Player, true, false);
IA = new ia(Player.duelWon + 1, Challenger, Hero);
} else {
Enemies = new enemyManager();
Scenario = new scenario(LVL, Enemies, Villagers, Scene, Bg);
}
if (Level == 0) {
Hero.Vomit.damages = 2;
}
switch (Level) {
case 0 :
case 2 :
case 4 :
_root.SoundManager.musicStart(1);
break;
case 1 :
case 3 :
_root.SoundManager.musicStart(3);
break;
case 5 :
case 6 :
case 99 :
case 100 :
_root.SoundManager.musicStart(4);
}
duelLvl = Player.duelWon + 1;
if (Level == 100) {
_root.attachMovie("DUEL_Intro", "INTRO", 16500, {_x:_root.Width / 2, _y:_root.Height / 2});
_root.INTRO.intro.level.text = "Level " + duelLvl;
}
}
function process(Player) {
if (fading == true) {
waitStateCount++;
if (waitStateCount == 60) {
toState();
}
} else if ((Death == false) && (pausing == false)) {
FX.process(Scene, Bg);
if (blocked == false) {
if ((Key.isDown(37) || (Key.isDown(65))) || (Key.isDown(81))) {
Hero.Left(Player);
}
if (Key.isDown(39) || (Key.isDown(68))) {
Hero.Right(Player);
}
if ((Key.isDown(38) || (Key.isDown(87))) || (Key.isDown(90))) {
Hero.Up();
}
if (Key.isDown(32)) {
Hero.shoot(true, 0, 0, Player);
}
if ((((((((Key.isDown(38) == false) && (Key.isDown(37) == false)) && (Key.isDown(39) == false)) && (Key.isDown(65) == false)) && (Key.isDown(81) == false)) && (Key.isDown(68) == false)) && (Key.isDown(87) == false)) && (Key.isDown(90) == false)) {
Hero.toStatic();
}
}
if (Key.isDown(27)) {
Pause();
}
if (Key.isDown(75) && (Level == 0)) {
Scenario.ended = true;
}
Hero.process(Scene, Bg, Enemies, this, Villagers, Boss, Player, Challenger);
ScrollManager.process(Scene, Bg, Hero);
Villagers.process(Scene, Bg, Hero);
Bg.process(this);
if ((Level == 6) || (Level == 0)) {
Boss.process(Scene, Bg, Hero, this, blocked);
Scenario.process(Scene, Enemies, Hero, Boss, Villagers);
if ((Boss.isDead() == true) || (Scenario.ended == true)) {
winGame(Level == 6);
}
} else if (Level == 100) {
IA.process(Challenger, Hero, Player);
Challenger.process(Scene, Bg, Enemies, this, Villagers, Boss, Player, Hero);
} else {
Enemies.process(Scene, Bg, Hero, Player);
Scenario.process(Scene, Enemies, Hero, Boss, Villagers);
if ((Scenario.ended == true) && (Enemies.areDead() == true)) {
winGame(false);
}
}
}
}
function waitState(State) {
Hero.Stop();
Enemies.Stop();
Boss.Stop();
Villagers.Stop();
fading = true;
_root.attachMovie("FADER", "Fade", 90000);
stackedState = State;
}
function toState() {
remove();
_root.gotoAndStop(stackedState);
}
function death() {
if (Level != 99) {
waitState("DEATH");
} else {
waitState("ENDSURV");
}
}
function quitGame() {
waitState("MAIN");
}
function winGame(end) {
if (Level == 100) {
_root.Player.duelWon = _root.Player.duelWon + 1;
_root.Player.saveGame(_root.Save);
waitState("ENDDUEL");
} else if (Level != 99) {
if (end == true) {
_root.Player.gameWon = 1;
waitState("RTC");
} else {
if (Level == 0) {
_root.Player.lastLvl = 1;
_root.Player.bestLvl = 1;
_root.Player.saveGame(_root.Save);
}
_root.LVL = Level + 1;
if (_root.LVL == 7) {
_root.LVL = 1;
}
if (Level == 0) {
waitState("GAME");
} else {
waitState("POSTGAME");
}
}
} else {
waitState("ENDSURV");
}
}
function remove() {
for (var _local2 in _root) {
if ((((typeof(_root[_local2]) == "movieclip") && (_root[_local2]._name != "Fade")) && (_root[_local2]._name != "MASTERMUS")) && (_root[_local2]._name != "MASTERSFX")) {
_root[_local2].removeMovieClip();
}
}
delete _root.onEnterFrame;
}
function clic(X, Y, Player) {
if (blocked == false) {
Hero.shoot(false, X - ScrollManager.decal, Y, Player);
}
}
function mouve(X, Y) {
if (blocked == false) {
Hero.actuTarg(X, Y);
}
}
function Pause() {
if (pausing == false) {
pausing = true;
_root.attachMovie("PauseMenu", "PMenu", 20000);
}
}
function setPause() {
if (pausing == false) {
pausing = true;
}
}
function unPause() {
if (pausing == true) {
pausing = false;
if (_root.PMenu != undefined) {
_root.PMenu.removeMovieClip();
}
}
}
function block() {
if (blocked == false) {
blocked = true;
}
}
function unblock() {
if (blocked == true) {
blocked = false;
}
}
function addHelp() {
_root.attachMovie("helpText", "HLP", 5465, {_x:_root.Width / 2, _y:45});
}
function setAlert(Pic) {
if (Pic._x < (-ScrollManager.decal)) {
_root.attachMovie("Alert", "Alert" + alertRoll, 5800 + alertRoll, {_x:10, _y:Pic._y});
alertRoll++;
if (alertRoll > 40) {
alertRoll = 0;
}
return(true);
}
if (Pic._x > ((-ScrollManager.decal) + _root.Width)) {
_root.attachMovie("Alert", "Alert" + alertRoll, 5800 + alertRoll, {_x:_root.Width - 10, _y:Pic._y});
alertRoll++;
if (alertRoll > 40) {
alertRoll = 0;
}
return(true);
}
}
}
Symbol 506 MovieClip [__Packages.hero] Frame 0
class hero
{
var currTargX, currTargY, saving, zMod, iaControl, mapLength, pic, mouthPic, shadowPic, colour, Name, speed_max, speed_land, speed, energy_max, vomit_time, vomit_cooldown, vomit_dispersion, vomit_power, vomit_flow, vomit_refTime, dir, facingR, speed_jump, weight, jump_height, delay, hurtTime, damages, Vomit, tookDamages, reloadBar, energyBar, energy, energy_regen, energy_flyCons, energy_spitCons, pos_indic, isFlying, landingTol, landingTol_death, currH, dead, currAnim, puking, sayDelay, Bulle;
function hero (Scene, BG, Player, IA, save) {
currTargX = 0;
currTargY = 0;
saving = save;
if (IA == true) {
zMod = -4;
} else {
zMod = 0;
}
iaControl = IA;
mapLength = BG.mapLength;
pic = Scene.attachMovie("Hero", "hero" + zMod, 1000 + zMod);
mouthPic = pic.Rmouth;
shadowPic = Scene.attachMovie("ombre", "hOmbre" + zMod, 999 + zMod);
if (BG.Village.pic != null) {
pic._x = BG.Village.pic._x;
} else {
pic._x = Math.round(Scene._width / 2);
}
if (IA == true) {
pic._x = pic._x + 100;
}
pic._y = BG.getColl(pic);
shadowPic._x = pic._x;
shadowPic._y = pic._y;
colour = new flash.geom.ColorTransform();
colour = pic.transform.colorTransform;
if ((IA == false) && (save == true)) {
Name = Player.selectedHero;
} else if (IA == true) {
Name = Player.getName();
} else {
Name = "NORMAL MAN";
}
speed_max = 15;
switch (Name) {
case "NORMAL MAN" :
speed_land = 1;
speed = 0.5;
energy_max = 300;
vomit_time = 60;
vomit_cooldown = 90;
vomit_dispersion = 2.5;
vomit_power = 10;
vomit_flow = 150;
break;
case "VIPER MAN" :
colour.greenMultiplier = 0.5;
colour.redMultiplier = 0.5;
colour.blueMultiplier = 0.5;
colour.greenOffset = 50;
colour.redOffset = -50;
colour.blueOffset = -50;
speed_land = 1;
speed = 0.5;
energy_max = 350;
vomit_time = 50;
vomit_cooldown = 90;
vomit_dispersion = 3.5;
vomit_power = 9;
vomit_flow = 300;
break;
case "STONE MAN" :
colour.greenMultiplier = 0.5;
colour.redMultiplier = 0.5;
colour.blueMultiplier = 0.5;
colour.redOffset = 20;
speed_land = 0.5;
speed = 0.3;
energy_max = 500;
vomit_time = 40;
vomit_cooldown = 60;
vomit_dispersion = 2;
vomit_power = 12;
vomit_flow = 75;
break;
case "LAVA MAN" :
colour.greenMultiplier = 0.5;
colour.redMultiplier = 0.6;
colour.blueMultiplier = 0.5;
colour.redOffset = 80;
colour.greenOffset = -50;
colour.blueOffset = -50;
speed_land = 1;
speed = 0.8;
energy_max = 300;
vomit_time = 20;
vomit_cooldown = 30;
vomit_dispersion = 1.5;
vomit_power = 14;
vomit_flow = 75;
break;
case "LIGHTSPEED MAN" :
colour.greenMultiplier = 1.5;
colour.redMultiplier = 1.5;
colour.blueMultiplier = 0;
colour.greenOffset = 50;
colour.blueOffset = -100;
speed_land = 3;
speed = 0.5;
energy_max = 250;
vomit_time = 10;
vomit_cooldown = 15;
vomit_dispersion = 1;
vomit_power = 10;
vomit_flow = 60;
break;
case "ULTI MAN" :
colour.greenMultiplier = 0.2;
colour.redMultiplier = 0.2;
colour.blueMultiplier = 0.2;
speed_land = 2;
speed = 0.8;
energy_max = 500;
vomit_time = 20;
vomit_cooldown = 30;
vomit_dispersion = 1.3;
vomit_power = 16;
vomit_flow = 150;
break;
case "FANTOM MAN" :
pic._alpha = 40;
speed_land = 1;
speed = 0.5;
energy_max = 350;
vomit_time = 30;
vomit_cooldown = 60;
vomit_dispersion = 2.5;
vomit_power = 10;
vomit_flow = 150;
}
pic.pic.transform.colorTransform = colour;
vomit_refTime = vomit_cooldown - vomit_time;
dir = new flash.geom.Point(0, 0);
facingR = true;
speed_jump = 5;
weight = 0.2;
jump_height = 10;
delay = 0;
hurtTime = 0;
damages = 30;
Vomit = new sparticles(vomit_time, vomit_dispersion, vomit_power, vomit_flow, Name, IA, damages);
tookDamages = 0;
reloadBar = _root.attachMovie("barreV", "BarreV", 5001 + zMod, {_xscale:150, _yscale:150, _x:-20, _y:50});
reloadBar.txt.text = "Ready";
if (iaControl == true) {
energyBar = _root.attachMovie("MBarre", "barPic", 5000 + zMod, {_xscale:150, _yscale:150});
energyBar._x = Stage.width;
} else {
energyBar = _root.attachMovie("Barre", "barPic", 5000 + zMod, {_xscale:150, _yscale:150});
energyBar._x = 0;
}
energyBar._y = 20;
energy = energy_max;
energy_regen = 0;
energy_flyCons = 0;
energy_spitCons = 0;
pos_indic = Scene.attachMovie("pos_ind", "PosPic", 4999 + zMod);
pos_indic._y = 10;
pos_indic.dist.text = "";
isFlying = false;
landingTol = 12;
landingTol_death = 18;
currH = 0;
dead = false;
currAnim = "static";
puking = false;
sayDelay = 0;
if (IA == true) {
faceRight(false);
}
}
function process(Scene, BG, Enemies, Game, Villagers, Boss, Player, ADV) {
currH = BG.getColl(pic);
if (sayDelay > 0) {
sayDelay--;
if (sayDelay == 0) {
stopSaying();
}
}
if (tookDamages > 0) {
if (saving == true) {
Player.damageTaken = Player.damageTaken + tookDamages;
}
tookDamages = 0;
}
if (hurtTime > 0) {
hurtTime--;
}
if (dead == true) {
if (iaControl == true) {
Game.winGame();
} else {
Game.death();
}
} else if ((isFlying == true) && (dead == false)) {
if (currH < pic._y) {
_root.SoundManager.hero_land.start();
isFlying = false;
dir.y = 0;
dir.x = 0;
if (Math.abs(dir.y) > landingTol) {
hurt(Math.round((Math.abs(dir.y) - landingTol) * 10));
}
} else if (dead == false) {
dir.y = dir.y + weight;
}
} else if ((isFlying == false) && (dead == false)) {
pic._y = currH;
}
if ((isFlying == true) && (dead == false)) {
if ((pic._x > mapLength) || (pic._x < 0)) {
bounce();
}
pic._y = pic._y + dir.y;
pic._x = pic._x + dir.x;
if (saving == true) {
Player.flyAmount = Player.flyAmount + Math.abs(dir.x);
}
}
if (pic._y < 0) {
pos_indic.dist.text = Math.round((-pic._y) / 10).toString() + "m";
pos_indic._alpha = 90;
} else {
pos_indic.dist.text = "";
pos_indic._alpha = 0;
}
pos_indic._x = pic._x;
Vomit.process(Scene, pic._x + mouthPic._x, pic._y + mouthPic._y, BG, Enemies, Villagers, Boss, ADV);
if (delay > 0) {
delay--;
} else {
reloadBar.txt.text = "Ready";
}
if (delay == vomit_time) {
puking = false;
Vomit.deactivate();
}
if (delay < vomit_refTime) {
reloadBar.mask._xscale = 100 - ((delay * 100) / vomit_refTime);
} else {
reloadBar.mask._xscale = 0;
}
if (isFlying == true) {
energy = energy - energy_flyCons;
}
energy = energy + energy_regen;
energy = Math.min(energy, energy_max);
energy = Math.max(energy, 0);
energyBar.mask._xscale = (energy / energy_max) * 100;
energyBar.txt.text = (("HP: " + Math.round(energy).toString()) + " / ") + Math.round(energy_max).toString();
shadowPic._x = pic._x;
shadowPic._y = currH;
if (Bulle != undefined) {
Bulle._x = pic._x;
Bulle._y = pic._y;
}
}
function Up() {
if (isFlying) {
if (pic._y > 0) {
dir.y = dir.y - speed;
dir.y = Math.min(dir.y, speed_max);
}
} else {
pic._y = pic._y - jump_height;
dir.y = dir.y - speed_jump;
isFlying = true;
if (puking == true) {
anim("pukeAir");
} else {
anim("fly");
}
_root.SoundManager.hero_decoll.start();
}
}
function Right(Player) {
if (puking == false) {
faceRight(true);
}
if (isFlying == true) {
dir.x = dir.x + speed;
dir.x = Math.min(dir.x, speed_max);
} else if (pic._x < (mapLength - speed_land)) {
pic._x = pic._x + speed_land;
if (puking == true) {
anim("pukeAir");
} else {
anim("walk");
}
if (saving == true) {
Player.walkAmount = Player.walkAmount + speed_land;
}
}
}
function Left(Player) {
if (puking == false) {
faceRight(false);
}
if (isFlying == true) {
dir.x = dir.x - speed;
dir.x = Math.min(dir.x, speed_max);
} else if (pic._x > speed_land) {
pic._x = pic._x - speed_land;
if (puking == true) {
anim("pukeAir");
} else {
anim("walk");
}
if (saving == true) {
Player.walkAmount = Player.walkAmount + speed_land;
}
}
}
function toStatic() {
if (isFlying == true) {
anim("fly");
} else {
anim("static");
}
}
function bounce() {
dir.x = (-dir.x) / 2;
pic._x = pic._x + dir.x;
dir.y = dir.y / 2;
pic._x = Math.max(0, pic._x);
pic._x = Math.min(mapLength, pic._x);
}
function anim(id, prior) {
if (((currAnim != id) && (((puking == false) || (id == "puke")) || (id == "pukeAir"))) && (dead == false)) {
currAnim = id;
pic.pic.gotoAndPlay(id);
pic.head.gotoAndPlay(id);
return(true);
}
}
function faceRight(right) {
if ((right == true) && (facingR == false)) {
facingR = true;
mouthPic = pic.Rmouth;
pic._xscale = -pic._xscale;
} else if ((right == false) && (facingR == true)) {
(facingR = false);
(mouthPic = pic.Lmouth);
pic._xscale = -pic._xscale;
}
}
function shoot(Default, X, Y, Player) {
if ((delay == 0) && (energy > 0)) {
if (saving == true) {
Player.spits = Player.spits + 1;
}
reloadBar.txt.text = "Reloading";
if (isFlying == true) {
anim("pukeAir");
} else {
anim("puke");
}
_root.SoundManager.hero_spit.start();
puking = true;
if (Default == false) {
currTargX = X - pic._x;
currTargY = Y - pic._y;
if (X < pic._x) {
faceRight(false);
} else {
faceRight(true);
}
} else {
if (facingR == true) {
currTargX = 100;
} else {
currTargX = -100;
}
currTargY = -100;
}
Vomit.activate(pic._x + mouthPic._x, pic._y + mouthPic._y, currTargX, currTargY, isFlying);
delay = vomit_cooldown;
energy = energy - energy_spitCons;
}
}
function actuTarg(X, Y) {
if (puking == true) {
Vomit.actuTarg(X - pic._x, Y - pic._y);
}
}
function die() {
if (isFlying == true) {
anim("airDeath");
} else {
anim("death");
}
dead = true;
}
function hurt(damages) {
if (hurtTime == 0) {
tookDamages = tookDamages + damages;
energy = energy - damages;
if (energy <= 0) {
die();
}
hurtTime = 30;
}
}
function say(phrase, size) {
if (Bulle != undefined) {
Bulle._visible = true;
}
Bulle = _root.Game.Scene.attachMovie("Bulle", "heroBulle", 40000, {_xscale:size, _yscale:size});
Bulle.phrase.multiline = true;
_root.SoundManager.hero_say.start();
Bulle.phrase._xscale = size;
Bulle.phrase._yscale = size;
Bulle.phrase.text = phrase;
Bulle.phrase._height = Bulle._height;
Bulle.phrase._width = Bulle._width;
sayDelay = 90;
}
function stopSaying() {
if (Bulle != undefined) {
Bulle._visible = false;
}
}
function Stop() {
pic.pic.stop();
}
}
Symbol 507 MovieClip [__Packages.sparticles] Frame 0
class sparticles
{
var nature, or_IA, dir, pos, count, active, particles, maxAmount, timeActive, quantity, dispersion, spower, pow_modif, tmpId, damages;
function sparticles (time, disp, pow, flow, Nature, IAControl, Dam) {
nature = Nature;
or_IA = IAControl;
dir = new flash.geom.Point();
pos = new flash.geom.Point();
count = 0;
active = false;
particles = new Array();
maxAmount = 500;
timeActive = time;
quantity = flow;
dispersion = disp;
spower = pow;
pow_modif = spower;
tmpId = 0;
damages = Dam;
}
function process(Scene, currX, currY, BG, Enemies, Villagers, Boss, ADV) {
pos.x = currX;
pos.y = currY;
if (active == true) {
create(Scene, true);
var _local3 = 0;
while (_local3 < Math.round(quantity / timeActive)) {
create(Scene, false);
_local3++;
}
}
var _local2 = 0;
while (_local2 < particles.length) {
particles[_local2].process(BG, Enemies, Villagers, Boss, ADV);
_local2++;
}
}
function actuTarg(X, Y) {
dir.x = X;
dir.y = Y;
}
function create(Scene, Killer) {
tmpId = getFreeId(count);
particles[tmpId] = new particle(Scene, or_IA, tmpId, pos.x, pos.y, dir.x, dir.y, Killer, dispersion, pow_modif, nature, damages);
if (count == tmpId) {
count++;
}
if (count > maxAmount) {
count = 0;
}
}
function getFreeId(ccount) {
var _local2 = 0;
while (_local2 < count) {
if (particles[_local2].isRemovable() == true) {
return(_local2);
}
_local2++;
}
return(ccount);
}
function activate(posX, posY, Xdir, Ydir, Fly) {
destroy();
particles = new Array();
active = true;
dir.x = Xdir;
dir.y = Ydir;
pos.x = posX;
pos.y = posY;
if (Fly == true) {
pow_modif = spower;
} else {
pow_modif = spower * 2;
}
}
function deactivate() {
var _local2 = 0;
while (_local2 < particles.length) {
particles[_local2].disappear();
_local2++;
}
active = false;
}
function destroy() {
var _local2 = 0;
while (_local2 < particles.length) {
particles[_local2].setDead();
_local2++;
}
}
}
Symbol 508 MovieClip [__Packages.bg] Frame 0
class bg
{
var pic, bPic, points, Village, line, mapLength, mapColl, segStart, segEnd, maxHeight;
function bg (Scene, LVL, Story) {
switch (LVL) {
case 0 :
pic = Scene.attachMovie("Level_0", "BG", -12000);
bPic = _root.attachMovie("Level_0B", "BBG", -12001);
points = new Array();
points.push(new flash.geom.Point(0, 315));
points.push(new flash.geom.Point(800, 310));
break;
case 1 :
pic = Scene.attachMovie("Level_1", "BG", -12000);
bPic = _root.attachMovie("Level_1B", "BBG", -12001);
points = new Array();
points.push(new flash.geom.Point(0, 320));
points.push(new flash.geom.Point(540, 340));
points.push(new flash.geom.Point(1024, 320));
break;
case 2 :
pic = Scene.attachMovie("Level_2", "BG", -12000);
bPic = _root.attachMovie("Level_2B", "BBG", -12001);
points = new Array();
points.push(new flash.geom.Point(0, 395));
points.push(new flash.geom.Point(80, 380));
points.push(new flash.geom.Point(175, 395));
points.push(new flash.geom.Point(320, 355));
points.push(new flash.geom.Point(330, 355));
points.push(new flash.geom.Point(595, 240));
points.push(new flash.geom.Point(790, 210));
points.push(new flash.geom.Point(990, 155));
points.push(new flash.geom.Point(1024, 155));
break;
case 3 :
pic = Scene.attachMovie("Level_3", "BG", -12000);
bPic = _root.attachMovie("Level_3B", "BBG", -12001);
points = new Array();
points.push(new flash.geom.Point(0, 240));
points.push(new flash.geom.Point(250, 215));
points.push(new flash.geom.Point(535, 200));
points.push(new flash.geom.Point(700, 195));
points.push(new flash.geom.Point(810, 200));
points.push(new flash.geom.Point(1070, 165));
points.push(new flash.geom.Point(1200, 180));
break;
case 4 :
pic = Scene.attachMovie("Level_4", "BG", -12000);
bPic = _root.attachMovie("Level_4B", "BBG", -12001);
points = new Array();
points.push(new flash.geom.Point(0, 305));
points.push(new flash.geom.Point(270, 275));
points.push(new flash.geom.Point(555, 355));
points.push(new flash.geom.Point(805, 350));
points.push(new flash.geom.Point(1024, 260));
points.push(new flash.geom.Point(1070, 255));
points.push(new flash.geom.Point(1200, 295));
break;
case 5 :
case 99 :
pic = Scene.attachMovie("Level_5", "BG", -12000);
bPic = _root.attachMovie("Level_5B", "BBG", -12001);
points = new Array();
points.push(new flash.geom.Point(0, 135));
points.push(new flash.geom.Point(200, 250));
points.push(new flash.geom.Point(545, 355));
points.push(new flash.geom.Point(655, 360));
points.push(new flash.geom.Point(855, 340));
points.push(new flash.geom.Point(1024, 335));
break;
case 6 :
case 100 :
pic = Scene.attachMovie("Level_6", "BG", -12000);
bPic = _root.attachMovie("Level_6B", "BBG", -12001);
points = new Array();
points.push(new flash.geom.Point(0, 330));
points.push(new flash.geom.Point(230, 315));
points.push(new flash.geom.Point(350, 310));
points.push(new flash.geom.Point(520, 325));
points.push(new flash.geom.Point(675, 330));
points.push(new flash.geom.Point(800, 325));
}
if (Story == true) {
Village = new village(pic.Village, LVL);
}
line = pic.createEmptyMovieClip("Line", 2000);
line.lineStyle(1, 0, 100);
mapLength = pic._width;
mapColl = new Array();
segStart = new flash.geom.Point();
segEnd = new flash.geom.Point();
maxHeight = 500;
initColl();
}
function process(Game) {
Village.process(Game);
}
function Draw() {
line.moveTo(points[0].x, points[0].y);
var _local2 = 0;
while (_local2 < points.length) {
line.lineTo(points[_local2].x, points[_local2].y);
_local2++;
}
}
function initColl() {
var _local3 = 0;
while (_local3 < mapLength) {
var _local2 = 0;
while (_local2 < points.length) {
if ((_local3 >= points[_local2].x) && (_local3 < points[_local2 + 1].x)) {
segStart = points[_local2];
segEnd = points[_local2 + 1];
}
_local2++;
}
mapColl[_local3] = segStart.y + (((segEnd.y - segStart.y) / (segEnd.x - segStart.x)) * (_local3 - segStart.x));
if (mapColl[_local3] < maxHeight) {
maxHeight = mapColl[_local3];
}
_local3++;
}
}
function getColl(Pic) {
return(mapColl[Math.round(Pic._x)]);
}
}
Symbol 509 MovieClip [__Packages.village] Frame 0
class village
{
var pic, hpMax, hp;
function village (Pic, LVL) {
pic = Pic;
pic.attachMovie("VillageHP", "VHP", 10000);
pic.VHP._xscale = 10000 / pic._xscale;
if (LVL == 3) {
hpMax = 2500;
} else {
hpMax = 1000;
}
hp = hpMax;
pic.VHP.HP.text = (hp.toString() + " / ") + hpMax.toString();
pic._alpha = 50;
}
function process(Game) {
if (hp == 0) {
Game.death();
}
}
function getHit(str) {
hp = hp - str;
if (hp < 0) {
hp = 0;
}
pic.VHP.HP.text = (hp.toString() + " / ") + hpMax.toString();
pic.VHP.mask._xscale = (hp * 100) / hpMax;
}
}
Symbol 510 MovieClip [__Packages.enemyManager] Frame 0
class enemyManager
{
var enemies, ecount, spawns, scount, tmpId, tmpClip, tmpSClip;
function enemyManager () {
enemies = new Array();
ecount = 0;
spawns = new Array();
scount = 0;
tmpId = 0;
}
function process(Scene, BG, Hero, Player) {
var _local2 = 0;
while (_local2 < ecount) {
enemies[_local2].process(Scene, BG, Hero, Player);
_local2++;
}
}
function addPoint(X, Y) {
spawns[scount] = new flash.geom.Point(X, Y);
scount++;
}
function addEnemy(id, Scene, point) {
tmpId = getFreeId(ecount);
tmpClip = Scene.attachMovie(id, "nmi" + tmpId, 1001 + tmpId, {_x:-50, _y:0, _alpha:0});
tmpSClip = Scene.attachMovie("ombre", "nmiOmbre" + tmpId, -1001 - tmpId, {_x:-50, _y:0, _alpha:0});
enemies[tmpId] = new enemy(id, tmpClip, tmpSClip, pickPoint(point), tmpId);
if (ecount == tmpId) {
ecount++;
}
}
function getFreeId(count) {
var _local2 = 0;
while (_local2 < ecount) {
if (enemies[_local2].isRemovable() == true) {
return(_local2);
}
_local2++;
}
return(count);
}
function pickPoint(id) {
if (id >= 0) {
return(spawns[id]);
}
return(spawns[Math.round((scount - 1) * Math.random())]);
}
function getHit(coll) {
var _local2 = 0;
while (_local2 < ecount) {
if (coll.hitTest(enemies[_local2].pic.coll) && (enemies[_local2].dead == false)) {
enemies[_local2].hurt();
return(true);
}
_local2++;
}
return(false);
}
function areDead() {
var _local2 = 0;
while (_local2 < ecount) {
if (enemies[_local2].isRemovable() == false) {
return(false);
}
_local2++;
}
return(true);
}
function Stop() {
var _local2 = 0;
while (_local2 < ecount) {
enemies[_local2].pic.pic.stop();
_local2++;
}
}
}
Symbol 511 MovieClip [__Packages.enemy] Frame 0
class enemy
{
var randomFactor, id, pic, shadowPic, pos, zid, dead, statDead, alpha, currAnim, cooldown, cooldown_shoot, waiting_melee, waiting_shoot, waiting_assault, hurtTime, facingR, bullets, wait, speed, speed_shoot, strength, HP, delay_melee, delay_shoot, cooldown_melee, shoot_weight, colour;
function enemy (Type, Pic, SPic, Pos, id) {
randomFactor = 50 + (Math.round(Math.random() * 60) - 30);
this.id = Type;
pic = Pic;
shadowPic = SPic;
pic._visible = false;
shadowPic._visible = false;
pos = Pos;
zid = id;
dead = false;
statDead = false;
alpha = 100;
currAnim = "idle";
cooldown = 0;
cooldown_shoot = 0;
waiting_melee = false;
waiting_shoot = false;
waiting_assault = false;
hurtTime = 0;
facingR = true;
bullets = new bulletManager(this.id);
wait = Math.round(Math.random() * 60);
switch (this.id) {
case "Grunt" :
speed = 1;
speed_shoot = 0;
strength = 20;
HP = 1;
delay_melee = 10;
delay_shoot = 99;
cooldown_melee = 20;
shoot_weight = 0;
break;
case "Hunter" :
speed = 1.2;
speed_shoot = 10;
strength = 30;
HP = 1;
delay_melee = 10;
delay_shoot = 10;
cooldown_melee = 20;
shoot_weight = 0.1;
break;
case "Bomber" :
speed = 1;
strength = 30;
HP = 1;
delay_melee = 99;
delay_shoot = 0;
cooldown_melee = 20;
shoot_weight = 1;
speed_shoot = 2;
break;
case "Flyer" :
speed = 3;
speed_shoot = 10;
strength = 30;
HP = 1;
delay_melee = 10;
delay_shoot = 10;
cooldown_melee = 20;
shoot_weight = 0.1;
break;
case "Mastoc" :
speed = 0.4;
speed_shoot = 0;
strength = 100;
HP = 3;
delay_melee = 20;
delay_shoot = 99;
cooldown_melee = 40;
shoot_weight = 0;
}
colour = new flash.geom.ColorTransform();
colour = pic.pic.transform.colorTransform;
colour.redMultiplier = Math.random();
colour.blueMultiplier = Math.random();
colour.greenMultiplier = Math.random();
pic.pic.transform.colorTransform = colour;
}
function init() {
pic._x = pos.x;
pic._y = pos.y;
shadowPic._x = pic._x;
shadowPic._y = pic._y;
pic._alpha = 100;
pic._visible = true;
shadowPic._alpha = 100;
shadowPic._visible = true;
}
function process(Scene, BG, Hero, Player) {
bullets.process(Hero, BG.Village);
if ((((wait == 0) && (dead == false)) && (cooldown == 0)) && (hurtTime == 0)) {
if (pic.coll.hitTest(Hero.pic.coll)) {
melee();
} else {
switch (id) {
case "Grunt" :
case "Mastoc" :
behav_attackVillage(BG);
break;
case "Hunter" :
if ((getDistance(Hero.pic) < 200) && (Hero.isFlying == true)) {
behav_attackHero(Scene, BG, Hero);
} else {
behav_attackVillage(BG);
}
break;
case "Bomber" :
behav_bombVillage(Scene, BG);
break;
case "Flyer" :
if (getDistance(Hero.pic) < 100) {
behav_attackHero(Scene, BG, Hero);
} else {
behav_chaseHero(BG, Hero);
}
}
}
shadowPic._x = pic._x;
shadowPic._y = BG.getColl(pic);
} else if (wait > 0) {
if (wait == 1) {
init();
}
wait--;
} else if (dead == true) {
if (statDead == false) {
if (Hero.saving == true) {
Player.killed = Player.killed + 1;
}
statDead = true;
}
if (alpha > 0) {
if (id == "Bomber") {
pic._x = pic._x + speed;
pic._y++;
}
alpha = alpha - 2;
pic._alpha = alpha;
shadowPic._alpha = alpha;
} else {
pic.removeMovieClip();
}
} else if (cooldown > 0) {
cooldown--;
if (cooldown == 1) {
anim("walk");
} else if ((waiting_melee == true) && (cooldown == delay_melee)) {
activeMelee(Hero);
} else if ((waiting_shoot == true) && (cooldown == delay_shoot)) {
} else if ((waiting_assault == true) && (cooldown == delay_melee)) {
activeAssault(BG.Village);
}
} else if (hurtTime > 0) {
hurtTime--;
}
}
function behav_attackVillage(BG) {
if (pic.hitTest(BG.pic.Village)) {
assault();
} else {
walkTo(BG, BG.pic.Village._x);
}
}
function behav_bombVillage(Scene, BG) {
flyAbove(BG, BG.maxHeight - randomFactor);
if (Math.abs(pic._x - BG.Village.pic._x) < 80) {
bomb(Scene, BG.Village);
}
}
function behav_attackHero(Scene, BG, Hero) {
attack(Scene, Hero);
}
function behav_chaseHero(BG, Hero) {
flyTo(BG, BG.maxHeight - 20, Hero.pic._x);
}
function walkTo(BG, tX) {
anim("walk");
if (pic._x < tX) {
pic._x = pic._x + speed;
faceRight(true);
} else {
pic._x = pic._x - speed;
faceRight(false);
}
pic._y = BG.getColl(pic);
}
function flyTo(BG, h, tX) {
anim("walk");
if (Math.abs(pic._x - tX) < speed) {
pic._x = tX;
} else if (pic._x < tX) {
pic._x = pic._x + speed;
faceRight(true);
} else {
pic._x = pic._x - speed;
faceRight(false);
}
if (Math.abs(pic._y - h) < speed) {
pic._y = h;
} else if (pic._y < h) {
pic._y = pic._y + speed;
} else {
pic._y = pic._y - speed;
}
}
function flyAbove(BG, h) {
if (Math.abs(pic._y - h) < speed) {
pic._y = h;
} else if (pic._y < h) {
pic._y = pic._y + speed;
} else {
pic._y = pic._y - speed;
}
pic._x = pic._x + speed;
faceRight(true);
if (pic._x > (BG.mapLength + pic._width)) {
die();
}
}
function assault() {
anim("melee");
cooldown = cooldown_melee;
waiting_assault = true;
}
function attack(Scene, Hero) {
if (cooldown_shoot == 0) {
anim("melee");
_root.SoundManager.nmi_Shoot.start();
bullets.addBullet(Scene, speed_shoot, strength, shoot_weight, pic._x, pic._y, Hero.pic._x, Hero.pic._y, zid);
cooldown_shoot = 20;
} else {
cooldown_shoot--;
}
}
function bomb(Scene, Village) {
if (cooldown_shoot == 0) {
_root.SoundManager.nmi_Bomb.start();
bullets.addBullet(Scene, speed_shoot, strength, shoot_weight, pic._x, pic._y, Village.pic._x, Village.pic._y, zid);
cooldown_shoot = 30;
} else {
cooldown_shoot--;
}
}
function melee() {
anim("melee");
cooldown = cooldown_melee;
waiting_melee = true;
}
function activeMelee(Hero) {
if (pic.coll.hitTest(Hero.pic.coll)) {
Hero.hurt(strength);
pic.attachMovie("Bris", "bris", 15000);
_root.SoundManager.nmi_Hit.start();
}
if (facingR == true) {
pic.bris._x = pic.Rhit._x;
pic.bris._y = pic.Rhit._y;
} else {
pic.bris._x = pic.Rhit._x;
pic.bris._y = pic.Rhit._y;
}
waiting_melee = false;
}
function activeAssault(Village) {
Village.getHit(strength);
pic.attachMovie("Bris", "bris", 15000);
_root.Game.setAlert(pic);
_root.SoundManager.nmi_Assault.start();
if (facingR == true) {
pic.bris._x = pic.Rhit._x;
pic.bris._y = pic.Rhit._y;
} else {
pic.bris._x = pic.Rhit._x;
pic.bris._y = pic.Rhit._y;
}
waiting_assault = false;
}
function faceRight(right) {
if ((right == true) && (facingR == false)) {
facingR = true;
pic._xscale = -pic._xscale;
} else if ((right == false) && (facingR == true)) {
(facingR = false);
(pic._xscale = -pic._xscale);
}
}
function anim(id) {
if (currAnim != id) {
currAnim = id;
pic.pic.gotoAndPlay(id);
}
}
function hurt() {
if (hurtTime == 0) {
HP--;
if (HP == 0) {
die();
} else {
hurtTime = 40;
anim("dead");
}
}
}
function die() {
if (dead == false) {
dead = true;
anim("dead");
bullets.remove();
}
}
function isRemovable() {
return((dead == true) && (alpha <= 0));
}
function getDistance(Pic) {
return(Math.sqrt(Math.pow(pic._x - Pic._x, 2) + Math.pow(pic._y - Pic._y, 2)));
}
}
Symbol 512 MovieClip [__Packages.bulletManager] Frame 0
class bulletManager
{
var bullets, count, colour, Source, redM, greenM, blueM, redO, greenO, blueO, tmpId, tmpClip;
function bulletManager (Type) {
bullets = new Array();
count = 0;
colour = new flash.geom.ColorTransform();
Source = Type;
switch (Type) {
case "Flyer" :
redM = 0.8;
greenM = 0.2;
blueM = 0.2;
redO = 50;
greenO = 0;
blueO = 0;
break;
case "Bomber" :
redM = 0.9;
greenM = 0.9;
blueM = 1;
blueO = 50;
redO = 0;
greenO = 0;
break;
case "Hunter" :
redM = 0.2;
greenM = 0.8;
blueM = 0.2;
greenO = 30;
blueO = 0;
redO = 0;
break;
case "Boss" :
redM = 1;
greenM = 1;
blueM = 1;
greenO = 0;
blueO = 0;
redO = 0;
}
}
function process(Hero, Village) {
if (count > 0) {
var _local2 = 0;
while (_local2 < count) {
bullets[_local2].process(Hero, Village);
_local2++;
}
}
}
function addBullet(Scene, Speed, Dam, Weight, orX, orY, dirX, dirY, ID) {
tmpId = getFreeId(count);
tmpClip = Scene.attachMovie("Bullet", "bullet" + tmpId, (3051 + (ID * 100)) + tmpId, {_x:-50, _y:0});
colour = tmpClip.transform.colorTransform;
colour.redMultiplier = redM;
colour.greenMultiplier = greenM;
colour.blueMultiplier = blueM;
colour.redOffset = redO;
colour.blueOffset = blueO;
colour.greenOffset = greenO;
tmpClip.transform.colorTransform = colour;
bullets[tmpId] = new bullet(tmpClip, Source, Speed, Dam, Weight, orX, orY, dirX, dirY);
if (count == tmpId) {
count++;
}
}
function getFreeId(count) {
var _local2 = 0;
while (_local2 < this.count) {
if (bullets[_local2].isRemovable() == true) {
return(_local2);
}
_local2++;
}
return(count);
}
function remove() {
var _local2 = 0;
while (_local2 < count) {
bullets[_local2].remove();
_local2++;
}
}
}
Symbol 513 MovieClip [__Packages.bullet] Frame 0
class bullet
{
var pic, Source, speed, damage, weight, lifeTime, timer, dead, dir, breaking;
function bullet (Pic, Type, Speed, Dam, Weight, posX, posY, dirX, dirY) {
pic = Pic;
pic._x = posX;
pic._y = posY;
Source = Type;
speed = Speed;
damage = Dam;
weight = Weight;
lifeTime = 90;
timer = 0;
dead = false;
dir = new flash.geom.Point(dirX - posX, dirY - posY);
dir.normalize(speed);
breaking = 0;
}
function process(Hero, Village) {
if ((dead == false) && (breaking == 0)) {
dir.y = dir.y + weight;
pic._x = pic._x + dir.x;
pic._y = pic._y + dir.y;
timer++;
if (timer >= lifeTime) {
breaking = 8;
pic.gotoAndPlay("break");
}
if (pic.hitTest(Hero.pic.coll)) {
Hero.hurt(damage);
breaking = 8;
pic.gotoAndPlay("break");
} else if ((Source == "Bomber") && (pic.hitTest(Village.pic))) {
Village.getHit(damage);
breaking = 8;
pic.gotoAndPlay("break");
}
} else if (breaking == 1) {
pic.removeMovieClip();
dead = true;
}
if (breaking > 0) {
breaking--;
}
}
function isRemovable() {
return(dead);
}
function remove() {
pic._visible = false;
pic.removeMovieClip();
}
}
Symbol 514 MovieClip [__Packages.villagerManager] Frame 0
class villagerManager
{
var Villagers, vcount, tmpId, tmpClip, tmpSClip;
function villagerManager () {
Villagers = new Array();
vcount = 0;
tmpId = 0;
}
function process(Scene, BG, Hero) {
var _local2 = 0;
while (_local2 < vcount) {
Villagers[_local2].process(Scene, BG, Hero);
_local2++;
}
}
function addVillager(Scene, BG, posX) {
tmpId = getFreeId(vcount);
tmpClip = Scene.attachMovie("Villager", "villager" + tmpId, 3001 + tmpId, {_x:posX, _y:0});
tmpSClip = Scene.attachMovie("ombre", "villagerOmbre" + tmpId, -3001 - tmpId, {_x:posX, _y:0});
tmpClip._y = BG.getColl(tmpClip);
Villagers[tmpId] = new villager(tmpClip, tmpSClip, tmpId);
if (vcount == tmpId) {
vcount++;
}
}
function getFreeId(count) {
var _local2 = 0;
while (_local2 < vcount) {
if (Villagers[_local2].isRemovable() == true) {
return(_local2);
}
_local2++;
}
return(count);
}
function getHit(coll) {
var _local2 = 0;
while (_local2 < vcount) {
if (coll.hitTest(Villagers[_local2].pic) && (Villagers[_local2].dead == false)) {
Villagers[_local2].die();
return(true);
}
_local2++;
}
return(false);
}
function areDead() {
var _local2 = 0;
while (_local2 < vcount) {
if (Villagers[_local2].isRemovable() == false) {
return(false);
}
_local2++;
}
return(true);
}
function Stop() {
var _local2 = 0;
while (_local2 < vcount) {
Villagers[_local2].pic.pic.stop();
_local2++;
}
}
}
Symbol 515 MovieClip [__Packages.villager] Frame 0
class villager
{
var pic, shadowPic, id, speed, dead, alpha, currAnim, sayDelay, colour, Bulle;
function villager (Pic, SPic, ID) {
pic = Pic;
shadowPic = SPic;
id = ID;
speed = 1;
pic._alpha = 100;
dead = false;
alpha = 100;
currAnim = "walk";
sayDelay = 0;
colour = new flash.geom.ColorTransform();
colour = pic.transform.colorTransform;
switch (id) {
case 0 :
colour.redMultiplier = 1;
colour.blueMultiplier = 1;
colour.greenMultiplier = 1;
break;
case 1 :
colour.redMultiplier = 0.8;
colour.blueMultiplier = 0.8;
colour.greenMultiplier = 1;
break;
case 2 :
colour.redMultiplier = 0.8;
colour.blueMultiplier = 1;
colour.greenMultiplier = 0.8;
}
pic.transform.colorTransform = colour;
}
function process(Scene, BG, Hero) {
if (sayDelay > 0) {
sayDelay--;
if (sayDelay == 0) {
stopSaying();
}
}
if (dead == false) {
behav_walk(BG);
} else if (dead == true) {
if (alpha > 0) {
alpha = alpha - 2;
pic._alpha = alpha;
} else {
pic.removeMovieClip();
}
}
shadowPic._x = pic._x;
shadowPic._y = pic._y;
if (Bulle != undefined) {
Bulle._x = pic._x;
Bulle._y = pic._y;
}
}
function behav_walk(BG) {
pic._x = pic._x + speed;
pic._y = BG.getColl(pic);
}
function walkTo(BG, tX) {
if (pic._x < tX) {
pic._x = pic._x + speed;
} else {
pic._x = pic._x - speed;
}
pic._y = BG.getColl(pic);
}
function anim(id) {
if (currAnim != id) {
currAnim = id;
pic.pic.gotoAndPlay(id);
}
}
function die() {
if (dead == false) {
dead = true;
anim("dead");
}
}
function isRemovable() {
return((dead == true) && (alpha <= 0));
}
function getDistance(Pic) {
return(Math.sqrt(Math.pow(pic._x - Pic._x, 2) + Math.pow(pic._y - Pic._y, 2)));
}
function say(phrase, size) {
if (Bulle != undefined) {
Bulle._visible = true;
}
Bulle = _root.Game.Scene.attachMovie("Bulle", "villagerBulle" + id, 40050 + id, {_xscale:size, _yscale:size});
Bulle.phrase.multiline = true;
switch (id) {
case 0 :
_root.SoundManager.villager_say1.start();
break;
case 1 :
_root.SoundManager.villager_say2.start();
break;
case 2 :
_root.SoundManager.villager_say3.start();
}
Bulle.phrase.text = phrase;
sayDelay = 90;
}
function stopSaying() {
if (Bulle != undefined) {
Bulle._visible = false;
}
}
}
Symbol 516 MovieClip [__Packages.boss] Frame 0
class boss
{
var sayDelay, mapLength, pic, shadowPic, dir, facingR, speed_land, speed, speed_jump, weight, jump_height, delay, energyBar, energy_max, energy, energy_regen, energy_flyCons, isFlying, landingTol, landingTol_death, currH, hurtTime, dead, currAnim, bullets, cooldown_shoot, speed_shoot, strength, reload, Bulle;
function boss (Scene, BG, isBoss) {
sayDelay = 0;
mapLength = BG.mapLength;
pic = Scene.attachMovie("Boss", "boss", 998);
shadowPic = Scene.attachMovie("ombre", "bOmbre", 997);
pic._x = 100;
pic._y = BG.getColl(pic);
shadowPic._x = pic._x;
shadowPic._y = pic._y;
dir = new flash.geom.Point(0, 0);
facingR = true;
speed_land = 1;
speed = 0.2;
speed_jump = 5;
weight = 0.2;
jump_height = 10;
delay = 0;
energyBar = _root.attachMovie("MBarre", "barPic2", 4998);
energyBar._x = Stage.width;
energyBar._y = 20;
energy_max = 300;
energy = energy_max;
energy_regen = 0;
energy_flyCons = 0;
isFlying = true;
landingTol = 12;
landingTol_death = 18;
currH = 0;
hurtTime = 0;
dead = false;
currAnim = "static";
bullets = new bulletManager("Boss");
cooldown_shoot = 0;
speed_shoot = 10;
if (isBoss == true) {
strength = 30;
reload = 10;
} else {
strength = 2;
reload = 60;
}
}
function process(Scene, BG, Hero, Game, blocked) {
if (blocked == false) {
IA(Hero, Scene);
}
if (sayDelay > 0) {
sayDelay--;
if (sayDelay == 0) {
stopSaying();
}
}
bullets.process(Hero, BG.Village);
if (hurtTime > 0) {
hurtTime--;
}
currH = BG.getColl(pic);
if (dead == true) {
Game.winGame();
} else if ((isFlying == true) && (dead == false)) {
if (currH < pic._y) {
if (dir.y > landingTol) {
if ((energy <= 0) && (dir.y > landingTol_death)) {
die();
} else {
dir.y = -dir.y;
dir.x = -dir.x;
}
} else {
isFlying = false;
dir.y = 0;
dir.x = 0;
}
} else if (dead == false) {
dir.y = dir.y + weight;
}
} else if ((isFlying == false) && (dead == false)) {
pic._y = currH;
}
if ((isFlying == true) && (dead == false)) {
if ((pic._x > mapLength) || (pic._x < 0)) {
bounce();
}
pic._y = pic._y + dir.y;
pic._x = pic._x + dir.x;
}
if (Bulle != undefined) {
Bulle._x = pic._x;
Bulle._x = Math.max(Bulle._x, Bulle._width / 2);
Bulle._y = pic._y;
}
if (delay > 0) {
delay--;
}
if (isFlying == true) {
energy = energy - energy_flyCons;
}
energy = energy + energy_regen;
energy = Math.min(energy, energy_max);
energy = Math.max(energy, 0);
energyBar.mask._xscale = (energy / energy_max) * 100;
energyBar.txt.text = (Math.round(energy).toString() + " / ") + Math.round(energy_max).toString();
shadowPic._x = pic._x;
shadowPic._y = currH;
}
function IA(Hero, Scene) {
if (getDistance(Hero.pic) > 300) {
if (Hero.pic._x > pic._x) {
Right();
} else {
Left();
}
if (Hero.pic._y < pic._y) {
Up();
}
} else if (getDistance(Hero.pic) > 150) {
Shoot(Scene, Hero);
} else {
if (Hero.pic._x < pic._x) {
Right();
} else {
Left();
}
Up();
}
}
function Up() {
if (isFlying) {
if (energy > 0) {
dir.y = dir.y - speed;
}
} else {
pic._y = pic._y - jump_height;
dir.y = dir.y - speed_jump;
isFlying = true;
anim("fly");
}
}
function Right() {
faceRight(true);
if (isFlying == true) {
dir.x = dir.x + speed;
} else if (pic._x < (mapLength - speed_land)) {
pic._x = pic._x + speed_land;
anim("walk");
}
}
function Left() {
faceRight(false);
if (isFlying == true) {
dir.x = dir.x - speed;
} else if (pic._x > speed_land) {
pic._x = pic._x - speed_land;
anim("walk");
}
}
function toStatic() {
if (isFlying == true) {
anim("fly");
} else {
anim("static");
}
}
function bounce() {
dir.x = (-dir.x) / 2;
pic._x = pic._x + dir.x;
dir.y = dir.y / 2;
pic._x = Math.max(0, pic._x);
pic._x = Math.min(mapLength, pic._x);
}
function Shoot(Scene, Hero) {
if (cooldown_shoot == 0) {
anim("shoot");
_root.SoundManager.nmi_Shoot.start();
if (Hero.pic._x < pic._x) {
faceRight(false);
} else {
faceRight(true);
}
bullets.addBullet(Scene, speed_shoot, strength, 0, pic._x, pic._y, Hero.pic._x, Hero.pic._y, 6000);
cooldown_shoot = reload;
} else {
cooldown_shoot--;
}
}
function getHit(Pic, dam) {
if (pic.hitTest(Pic)) {
if (hurtTime == 0) {
hurtTime = 30;
energy = energy - dam;
if (energy <= 0) {
die();
}
return(true);
}
}
return(false);
}
function anim(id, prior) {
if ((currAnim != id) && (dead == false)) {
currAnim = id;
pic.pic.gotoAndPlay(id);
pic.head.gotoAndPlay(id);
return(true);
}
}
function faceRight(right) {
if ((right == true) && (facingR == false)) {
facingR = true;
pic._xscale = -pic._xscale;
} else if ((right == false) && (facingR == true)) {
(facingR = false);
(pic._xscale = -pic._xscale);
}
}
function shoot(X, Y) {
}
function die() {
if (isFlying == true) {
anim("airDeath");
} else {
anim("death");
}
dead = true;
}
function hurt(damages) {
energy = energy - damages;
if (energy <= 0) {
die();
}
}
function getDistance(Pic) {
return(Math.sqrt(Math.pow(pic._x - Pic._x, 2) + Math.pow(pic._y - Pic._y, 2)));
}
function isDead() {
return(dead);
}
function say(phrase, size) {
if (Bulle != undefined) {
Bulle._visible = true;
}
Bulle = _root.Game.Scene.attachMovie("Bulle", "bossBulle", 40001, {_x:pic._x, _y:pic._y, _xscale:size, _yscale:size});
_root.SoundManager.boss_say.start();
Bulle.phrase.multiline = true;
Bulle.phrase._xscale = size;
Bulle.phrase._yscale = size;
Bulle.phrase.text = phrase;
Bulle.phrase._height = Bulle._height;
Bulle.phrase._width = Bulle._width;
sayDelay = 90;
}
function stopSaying() {
if (Bulle != undefined) {
Bulle._visible = false;
}
}
function Stop() {
pic.pic.stop();
}
}
Symbol 517 MovieClip [__Packages.particle] Frame 0
class particle
{
var pic, delay, colour, dispersion, power, damage, killer, dir, bounce_loss, fadeSpd, alpha, disappearing, processed, landed, dead, randomFactorA, randomFactorB;
function particle (Scene, IAO, id, posX, posY, dirX, dirY, Killer, Dispersion, Pow, nature, Dam) {
if (IAO == true) {
pic = Scene.attachMovie("Vomit", "partn" + id, id + 26000);
} else {
pic = Scene.attachMovie("Vomit", "part" + id, id + 13000);
}
delay = -1;
pic._rotation = 180 * Math.random();
colour = new flash.geom.ColorTransform();
colour = pic.transform.colorTransform;
switch (nature) {
case "NORMAL MAN" :
colour.redMultiplier = 0.8;
colour.blueMultiplier = 0.3;
colour.greenMultiplier = 0.3;
colour.redOffset = 80;
break;
case "VIPER MAN" :
colour.redMultiplier = 0.1;
colour.blueMultiplier = 0.1;
colour.greenMultiplier = 0.1;
colour.greenOffset = 50;
break;
case "STONE MAN" :
colour.redMultiplier = 0.1;
colour.blueMultiplier = 0.1;
colour.greenMultiplier = 0.1;
colour.redOffset = 20;
break;
case "LAVA MAN" :
colour.redMultiplier = 0.7;
colour.blueMultiplier = 0.3;
colour.greenMultiplier = 0.3;
colour.redOffset = 50;
break;
case "LIGHTSPEED MAN" :
colour.redMultiplier = 1;
colour.blueMultiplier = 0;
colour.greenMultiplier = 1;
colour.greenOffset = 0;
colour.blueOffset = -100;
break;
case "FANTOM MAN" :
break;
case "ULTI MAN" :
colour.redMultiplier = 0;
colour.blueMultiplier = 0;
colour.greenMultiplier = 0;
}
pic.transform.colorTransform = colour;
dispersion = Dispersion;
power = Pow;
damage = Dam;
pic._x = posX;
pic._y = posY;
killer = Killer;
dir = new flash.geom.Point(dirX, dirY);
bounce_loss = 2;
fadeSpd = 10;
alpha = 100;
disappearing = false;
processed = true;
landed = false;
dead = false;
randomFactorA = Math.random();
randomFactorB = Math.random();
if ((randomFactorA + randomFactorB) > 1) {
pic.gotoAndStop("alt");
}
dir.x = dir.x + ((dispersion * randomFactorA) - (dispersion * 2));
dir.y = dir.y + ((dispersion * randomFactorB) - (dispersion * 2));
power = power + ((dispersion * Math.random()) - (dispersion * 2));
dir.normalize(power);
}
function process(BG, Enemies, Villagers, Boss, ADV) {
if (delay > 0) {
delay--;
} else if (delay == 0) {
setDead();
}
if (dead == false) {
if (pic._y > BG.getColl(pic)) {
dir.y = (-dir.y) / bounce_loss;
dir.x = dir.x / bounce_loss;
destroy();
processed = false;
} else {
dir.y++;
}
pic._x = pic._x + dir.x;
pic._y = pic._y + dir.y;
if ((processed == true) && (killer == true)) {
if ((ADV.pic != undefined) && (ADV.pic.hitTest(pic))) {
ADV.hurt(damage);
destroy();
_root.SoundManager.hero_splash.start();
} else if (Enemies.getHit(pic)) {
_root.SoundManager.hero_splash.start();
destroy();
} else if (Boss.getHit(pic, damage)) {
_root.SoundManager.hero_splash.start();
destroy();
}
}
}
}
function destroy() {
pic.gotoAndPlay("break");
delay = 10;
dead = true;
}
function setDead() {
pic._visible = false;
pic.removeMovieClip();
dead = true;
}
function isRemovable() {
return(dead && (delay == 0));
}
}
Symbol 518 MovieClip [__Packages.scrollManager] Frame 0
class scrollManager
{
var decal, maxSpeed, speed, margin;
function scrollManager (Scene, Bg, Hero) {
decal = 0;
maxSpeed = 13;
speed = maxSpeed;
margin = 200;
if (Hero.pic._x > ((Stage.width - margin) + decal)) {
decal = -(Hero.pic._x + Stage.width);
if (decal < (Stage.width - Bg.pic._width)) {
decal = Stage.width - Bg.pic._width;
}
Scene._x = decal;
}
}
function process(Scene, Bg, Hero) {
if (Hero.isFlying == true) {
speed = Math.abs(Hero.dir.x);
} else {
speed = Hero.speed_land;
}
speed = Math.min(maxSpeed, speed);
if ((Hero.pic._x > ((Stage.width - margin) - decal)) && (Scene._x > (Stage.width - Bg.pic._width))) {
decal = decal - speed;
}
if ((Hero.pic._x < (margin - decal)) && (Scene._x < 0)) {
decal = decal + speed;
}
decal = Math.min(decal, 0);
decal = Math.max(decal, Stage.width - Bg.pic._width);
Scene._x = decal;
}
}
Symbol 519 MovieClip [__Packages.scenario] Frame 0
class scenario
{
var level, prog, ended, pastSec, pastMin, endTime, timeLine;
function scenario (Level, Enemies, Villagers, Scene, BG) {
level = Level;
prog = 0;
ended = false;
pastSec = 0;
pastMin = 0;
switch (level) {
case 0 :
break;
case 1 :
endTime = 1950;
Enemies.addPoint(0, 320);
Enemies.addPoint(1024, 320);
Villagers.addVillager(Scene, BG, 400);
Villagers.addVillager(Scene, BG, 460);
Villagers.addVillager(Scene, BG, 370);
break;
case 2 :
endTime = 3450;
Enemies.addPoint(0, 395);
Enemies.addPoint(1024, 155);
Villagers.addVillager(Scene, BG, 400);
Villagers.addVillager(Scene, BG, 460);
Villagers.addVillager(Scene, BG, 370);
break;
case 3 :
endTime = 4500;
Enemies.addPoint(0, 240);
Enemies.addPoint(1200, 180);
Villagers.addVillager(Scene, BG, 400);
Villagers.addVillager(Scene, BG, 460);
Villagers.addVillager(Scene, BG, 370);
break;
case 4 :
endTime = 4500;
Enemies.addPoint(0, 305);
Enemies.addPoint(1200, 285);
Villagers.addVillager(Scene, BG, 400);
Villagers.addVillager(Scene, BG, 460);
Villagers.addVillager(Scene, BG, 295);
break;
case 5 :
endTime = 4500;
Enemies.addPoint(0, 135);
Enemies.addPoint(512, -10);
break;
case 99 :
Enemies.addPoint(0, 135);
Enemies.addPoint(512, -10);
timeLine = _root.attachMovie("Timer", "TIMER", 4994, {_x:Stage.width / 2, _y:20, _xscale:100, _yscale:100});
break;
case 6 :
}
if (endTime != undefined) {
timeLine = _root.attachMovie("TimeBarre", "TimeBAR", 4994, {_x:(Stage.width / 2) - 75, _y:15, _xscale:100, _yscale:100});
}
}
function process(Scene, Enemies, Hero, Boss, Villagers) {
prog++;
if (endTime != undefined) {
timeLine.mask._xscale = 100 - ((prog * 100) / endTime);
}
if (level == 99) {
if ((prog != 0) && ((prog % _root.FrameRate) == 0)) {
pastSec++;
}
if (pastSec > 60) {
pastMin++;
pastSec = pastSec - 60;
}
timeLine.txt.text = (pastMin + ":") + pastSec;
}
switch (level) {
case 0 :
lvl0(Scene, Boss, Hero);
break;
case 1 :
lvl1(Scene, Enemies, Hero, Villagers);
break;
case 2 :
lvl2(Scene, Enemies, Hero, Villagers);
break;
case 3 :
lvl3(Scene, Enemies, Hero, Villagers);
break;
case 4 :
lvl4(Scene, Enemies, Hero, Villagers);
break;
case 5 :
lvl5(Scene, Enemies, Hero);
break;
case 6 :
lvl6(Scene, Boss, Hero);
break;
case 99 :
lvlSur(Scene, Enemies);
}
}
function lvlSur(Scene, Enemies) {
_root.Player.lastSurvTime = prog;
if ((prog > 150) && (prog < 1050)) {
if (!((prog % 30) === 10)) {
} else {
Enemies.addEnemy("Grunt", Scene, 0);
}
if (!((prog % 90) === 10)) {
} else {
Enemies.addEnemy("Flyer", Scene, 1);
}
if (!((prog % 300) === 150)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
} else if ((prog > 1200) && (prog < 2100)) {
switch (prog % 90) {
case 10 :
Enemies.addEnemy("Flyer", Scene, 1);
break;
case 40 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 300) === 150)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
} else if ((prog > 2250) && (prog < 3150)) {
switch (prog % 90) {
case 10 :
Enemies.addEnemy("Grunt", Scene, 0);
break;
case 40 :
Enemies.addEnemy("Flyer", Scene, 1);
break;
case 60 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 240) === 150)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
} else if ((prog > 3300) && (prog < 3450)) {
if (!((prog % 30) === 10)) {
} else {
Enemies.addEnemy("Grunt", Scene, 0);
}
switch (prog % 60) {
case 30 :
Enemies.addEnemy("Hunter", Scene, 0);
break;
case 60 :
Enemies.addEnemy("Flyer", Scene, 1);
}
if (!((prog % 150) === 30)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
} else {
switch (prog % 60) {
case 15 :
Enemies.addEnemy("Grunt", Scene, 0);
break;
case 30 :
Enemies.addEnemy("Hunter", Scene, 0);
break;
case 50 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 90) === 45)) {
} else {
Enemies.addEnemy("Flyer", Scene, 1);
}
if (!((prog % 150) === 75)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
}
}
function lvl0(Scene, Boss, Hero) {
if (Boss.energy == Boss.energy_max) {
switch (prog) {
case 5 :
_root.Game.block();
case 20 :
Boss.say("Remember me?", 100);
break;
case 100 :
Boss.say("I'm your old\n master,young man.", 100);
break;
case 180 :
Boss.say("It appears that\nyou dream again.", 100);
break;
case 270 :
Boss.say("Come on, try to\n use your power.", 100);
break;
case 350 :
Boss.say("Aim at me, \n and spit.", 100);
_root.Game.addHelp();
_root.Game.unblock();
break;
case 600 :
Boss.say("Move !\n Go up and fly !", 100);
}
} else if (Boss.energy > 290) {
if (prog < 10000) {
Boss.say("Good.", 100);
prog = 10000;
} else if (prog == 10200) {
Boss.say("Let's fight \n for a while");
}
} else if (prog < 20000) {
Boss.say("Fine. Now \n wake up.");
prog = 20000;
} else if (prog == 20120) {
ended = true;
}
}
function lvl6(Scene, Boss, Hero) {
if (prog < 1000) {
switch (prog) {
case 5 :
_root.Game.block();
case 20 :
Boss.say("Hello, Hector.", 100);
break;
case 100 :
Boss.say("We finally meet\n again.", 100);
break;
case 130 :
Hero.say("You...", 100);
break;
case 190 :
Hero.say("So you were\n behind this mess ?", 100);
break;
case 220 :
Boss.say("Of course !\n Who else could ?", 100);
break;
case 280 :
Boss.say("It is my mission...", 100);
break;
case 320 :
Boss.say("...to create \na new world.", 100);
break;
case 340 :
Hero.say("They say that.", 100);
break;
case 400 :
Hero.say("I don't want \n to fight...", 100);
break;
case 460 :
Hero.say("I'm sick\n of the", 100);
break;
case 500 :
Hero.say("whole superhero\n thing.", 100);
break;
case 560 :
Boss.say("You can't escape\n your destiny.", 100);
break;
case 620 :
Boss.say("Fight me !", 100);
_root.Game.unblock();
}
} else {
if (Boss.energy < 100) {
prog = 80000 /* 0x013880 */;
}
if (Hero.energy < 100) {
prog = 120000 /* 0x01D4C0 */;
}
if (prog == 80010) {
Boss.say("You are strong.", 100);
}
if (prog == 80100) {
Hero.say("I wish not \nto be.", 100);
}
if (prog == 120010) {
Boss.say("Die !", 100);
}
}
}
function lvl5(Scene, Enemies, Hero) {
if (prog < 4500) {
switch (prog) {
case 30 :
Hero.say("Alone at last.", 100);
break;
case 120 :
Hero.say("I guess they\n managed to escape.", 100);
break;
case 200 :
Hero.say("I kinda \n miss them.", 100);
}
if ((prog > 150) && (prog < 1050)) {
if (!((prog % 30) === 10)) {
} else {
Enemies.addEnemy("Grunt", Scene, 0);
}
if (!((prog % 90) === 10)) {
} else {
Enemies.addEnemy("Flyer", Scene, 1);
}
if (!((prog % 300) === 150)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
} else if ((prog > 1200) && (prog < 2100)) {
switch (prog % 90) {
case 10 :
Enemies.addEnemy("Flyer", Scene, 1);
break;
case 40 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 300) === 150)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
} else if ((prog > 2250) && (prog < 3150)) {
switch (prog % 90) {
case 10 :
Enemies.addEnemy("Grunt", Scene, 0);
break;
case 40 :
Enemies.addEnemy("Flyer", Scene, 1);
break;
case 60 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 240) === 150)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
} else if ((prog > 3300) && (prog < 3450)) {
if (!((prog % 30) === 10)) {
} else {
Enemies.addEnemy("Grunt", Scene, 0);
}
switch (prog % 60) {
case 30 :
Enemies.addEnemy("Hunter", Scene, 0);
break;
case 60 :
Enemies.addEnemy("Flyer", Scene, 1);
}
if (!((prog % 150) === 30)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
} else if ((prog > 3600) && (prog < 4500)) {
switch (prog % 60) {
case 15 :
Enemies.addEnemy("Grunt", Scene, 0);
break;
case 30 :
Enemies.addEnemy("Hunter", Scene, 0);
break;
case 50 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 90) === 45)) {
} else {
Enemies.addEnemy("Flyer", Scene, 1);
}
if (!((prog % 150) === 75)) {
} else {
Enemies.addEnemy("Mastoc", Scene, 0);
}
}
} else {
ended = true;
}
}
function lvl4(Scene, Enemies, Hero, Villagers) {
if (prog < 4500) {
switch (prog) {
case 40 :
Villagers.Villagers[0].say("Do not \nabandon us!", 100);
break;
case 120 :
Villagers.Villagers[1].say("We want to \nlive !", 100);
break;
case 150 :
Villagers.Villagers[2].say("I don't.", 80);
break;
case 180 :
Hero.say("Is this going\n to end ?", 100);
}
if ((prog > 150) && (prog < 1050)) {
switch (prog % 90) {
case 10 :
Enemies.addEnemy("Grunt", Scene, 0);
Enemies.addEnemy("Grunt", Scene, 1);
break;
case 40 :
Enemies.addEnemy("Flyer", Scene, 1);
}
} else if ((prog > 1200) && (prog < 2100)) {
switch (prog % 80) {
case 10 :
Enemies.addEnemy("Hunter", Scene, -1);
break;
case 40 :
Enemies.addEnemy("Bomber", Scene, 0);
}
} else if ((prog > 2250) && (prog < 3150)) {
switch (prog % 80) {
case 10 :
Enemies.addEnemy("Grunt", Scene, -1);
break;
case 40 :
Enemies.addEnemy("Flyer", Scene, 1);
break;
case 60 :
Enemies.addEnemy("Bomber", Scene, 0);
}
} else if ((prog > 3300) && (prog < 3450)) {
if (!((prog % 40) === 10)) {
} else {
Enemies.addEnemy("Hunter", Scene, -1);
}
} else if ((prog > 3600) && (prog < 4500)) {
switch (prog % 90) {
case 10 :
Enemies.addEnemy("Grunt", Scene, -1);
break;
case 40 :
Enemies.addEnemy("Bomber", Scene, 0);
break;
case 60 :
Enemies.addEnemy("Flyer", Scene, -1);
break;
case 80 :
Enemies.addEnemy("Hunter", Scene, -1);
}
}
} else {
ended = true;
}
}
function lvl3(Scene, Enemies, Hero, Villagers) {
if (prog < 4500) {
switch (prog) {
case 40 :
Villagers.Villagers[0].say("They try to\n break the bridge!", 100);
break;
case 120 :
Villagers.Villagers[1].say("They want to\n isolate us !", 100);
break;
case 150 :
Villagers.Villagers[2].say("We already are,\n anyway.", 80);
break;
case 180 :
Hero.say("Get the hell\n out of here !", 100);
}
if ((prog > 150) && (prog < 1050)) {
if (!((prog % 180) === 10)) {
} else {
Enemies.addEnemy("Grunt", Scene, -1);
}
if (!((prog % 180) === 60)) {
} else {
Enemies.addEnemy("Flyer", Scene, 0);
}
} else if ((prog > 1200) && (prog < 2100)) {
switch (prog % 160) {
case 10 :
Enemies.addEnemy("Grunt", Scene, -1);
break;
case 40 :
Enemies.addEnemy("Flyer", Scene, -1);
}
} else if ((prog > 2250) && (prog < 3150)) {
switch (prog % 150) {
case 10 :
Enemies.addEnemy("Grunt", Scene, -1);
break;
case 40 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 150) === 30)) {
} else {
Enemies.addEnemy("Flyer", Scene, -1);
}
} else if ((prog > 3300) && (prog < 3450)) {
if (!((prog % 40) === 10)) {
} else {
Enemies.addEnemy("Flyer", Scene, -1);
}
} else if ((prog > 3600) && (prog < 4500)) {
switch (prog % 90) {
case 10 :
Enemies.addEnemy("Grunt", Scene, -1);
break;
case 40 :
Enemies.addEnemy("Bomber", Scene, 0);
break;
case 60 :
Enemies.addEnemy("Flyer", Scene, -1);
}
}
} else {
ended = true;
}
}
function lvl2(Scene, Enemies, Hero, Villagers) {
if (prog < 3450) {
switch (prog) {
case 40 :
Villagers.Villagers[0].say("There are more\n of them !", 100);
break;
case 120 :
Villagers.Villagers[1].say("Please help us!", 100);
break;
case 150 :
Villagers.Villagers[2].say("I'm sure he\n won't.", 80);
break;
case 180 :
Hero.say("Can't I stay\n alone for a while ?", 100);
}
if ((prog > 150) && (prog < 1050)) {
if (!((prog % 90) === 10)) {
} else {
Enemies.addEnemy("Grunt", Scene, 0);
}
if (!((prog % 150) === 75)) {
} else {
Enemies.addEnemy("Flyer", Scene, -1);
}
} else if ((prog > 1200) && (prog < 2100)) {
switch (prog % 120) {
case 10 :
Enemies.addEnemy("Grunt", Scene, 0);
break;
case 40 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 150) === 75)) {
} else {
Enemies.addEnemy("Flyer", Scene, -1);
}
} else if ((prog > 2250) && (prog < 3150)) {
switch (prog % 90) {
case 10 :
Enemies.addEnemy("Grunt", Scene, -1);
break;
case 40 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 150) === 75)) {
} else {
Enemies.addEnemy("Flyer", Scene, -1);
}
} else if ((prog > 3300) && (prog < 3450)) {
switch (prog % 60) {
case 10 :
Enemies.addEnemy("Grunt", Scene, -1);
break;
case 40 :
Enemies.addEnemy("Bomber", Scene, 0);
}
if (!((prog % 150) === 75)) {
} else {
Enemies.addEnemy("Flyer", Scene, -1);
}
}
} else {
ended = true;
}
}
function lvl1(Scene, Enemies, Hero, Villagers) {
if (prog < 1950) {
switch (prog) {
case 40 :
Villagers.Villagers[0].say("Monsters are\n coming to town !", 100);
break;
case 120 :
Villagers.Villagers[1].say("Please use your\n superpowers !", 100);
break;
case 150 :
Villagers.Villagers[2].say("I'm sure he\n won't.", 80);
break;
case 180 :
Hero.say("Damn.", 100);
_root.Game.addHelp();
}
if ((prog > 150) && (prog < 750)) {
if (!((prog % 120) === 10)) {
} else {
Enemies.addEnemy("Grunt", Scene, 0);
}
if (!((prog % 300) === 50)) {
} else {
Enemies.addEnemy("Flyer", Scene, 0);
}
} else if ((prog > 800) && (prog < 1400)) {
if (!((prog % 90) === 10)) {
} else {
Enemies.addEnemy("Grunt", Scene, -1);
}
if (!((prog % 300) === 50)) {
} else {
Enemies.addEnemy("Flyer", Scene, 0);
}
} else if ((prog > 1450) && (prog < 1950)) {
if (!((prog % 60) === 10)) {
} else {
Enemies.addEnemy("Grunt", Scene, -1);
}
if (!((prog % 150) === 50)) {
} else {
Enemies.addEnemy("Flyer", Scene, 0);
}
}
} else {
ended = true;
}
}
}
Symbol 520 MovieClip [__Packages.ia] Frame 0
class ia
{
var diff;
function ia (Diff, Chall, Hero) {
diff = 0;
var _local2 = Diff;
while (_local2 > 0) {
diff++;
_local2 = _local2 - 7;
}
diff--;
Chall.energy_max = Chall.energy_max + (diff * 100);
Chall.energy = Chall.energy + (diff * 100);
Chall.Vomit.damages = Chall.Vomit.damages + (diff * 10);
}
function process(Chall, Hero, Player) {
if (getDistance(Chall.pic, Hero.pic) > 100) {
if (Hero.pic._x > Chall.pic._x) {
Chall.Right(Player);
} else {
Chall.Left(Player);
}
if ((Hero.pic._y < Chall.pic._y) && (Chall.pic._y > 0)) {
Chall.Up(Player);
}
} else {
Chall.shoot(false, Hero.pic._x, Hero.pic._y, Player);
}
}
function getDistance(PicA, PicB) {
return(Math.sqrt(Math.pow(PicA._x - PicB._x, 2) + Math.pow(PicA._y - PicB._y, 2)));
}
}
Symbol 521 MovieClip [__Packages.fparticles] Frame 0
class fparticles
{
var count, particles, tmpId, maxAmount, fx, frequency, falling, tmpClip;
function fparticles (FX, Falling) {
count = 0;
particles = new Array();
tmpId = 0;
maxAmount = 30;
fx = FX;
frequency = 10;
falling = Falling;
}
function process(Scene, BG) {
if (Math.round(Math.random() * frequency) == frequency) {
addParticle(Scene, BG);
}
if (count > 0) {
var _local2 = 0;
while (_local2 < particles.length) {
particles[_local2].process();
_local2++;
}
}
}
function addParticle(Scene, BG) {
tmpId = getFreeId(count);
tmpClip = Scene.attachMovie(fx, "ffx" + tmpId, 20000 + tmpId);
particles[tmpId] = new fparticle(tmpClip, BG, falling);
if (count == tmpId) {
count++;
}
if (count > maxAmount) {
count = 0;
}
}
function getFreeId(ccount) {
var _local2 = 0;
while (_local2 < count) {
if (particles[_local2].isRemovable() == true) {
return(_local2);
}
_local2++;
}
return(ccount);
}
}
Symbol 522 MovieClip [__Packages.fparticle] Frame 0
class fparticle
{
var pic, phase, falling, posX, posY, progX, progY, speed, amplitude, alpha;
function fparticle (Pic, BG, Fall) {
pic = Pic;
phase = Math.random();
falling = Fall;
pic._xscale = phase * 100;
pic._yscale = phase * 100;
pic._alpha = 100 - (phase * 100);
pic._x = Math.random() * BG.pic._width;
pic._y = Math.random() * BG.pic._height;
posX = pic._x;
posY = pic._y;
progX = 0;
progY = 0;
speed = 0.2;
amplitude = 1;
alpha = 0;
}
function process() {
if (alpha < 100) {
alpha = alpha + 10;
}
progX = progX + speed;
progY = Math.sin(progX) * amplitude;
if (falling == true) {
pic._y = posY + progX;
} else {
pic._y = posY - progX;
}
pic._x = posX + progY;
}
function isRemovable() {
return((pic._y < 0) || (pic._y > 400));
}
}
Symbol 431 MovieClip Frame 119
stop();
_root.gotoAndPlay("MAIN");
Symbol 451 MovieClip Frame 1
stop();
Symbol 451 MovieClip Frame 5
stop();
Symbol 452 MovieClip Frame 1
stop();
var Achs = new Array();
Achs[0] = ach1;
Achs[1] = ach2;
Achs[2] = ach3;
Achs[3] = ach4;
Achs[4] = ach5;
Achs[5] = ach6;
Achs[6] = ach7;
Achs[7] = ach8;
Achs[8] = ach9;
Achs[9] = ach10;
Achs[10] = ach11;
Achs[11] = ach12;
Achs[12] = ach13;
Achs[13] = ach14;
var i = 0;
while (i < 14) {
Achs[i].ach.text = "Achievement " + (i + 1);
i++;
}
Achs[0].expl.text = "Spit !";
Achs[1].expl.text = "Take damages";
Achs[2].expl.text = "Spit more !";
Achs[3].expl.text = "Walk...";
Achs[4].expl.text = "...or fly";
Achs[5].expl.text = "Be efficient.";
Achs[6].expl.text = "Finish Story Level 1";
Achs[7].expl.text = "Finish Story Level 2";
Achs[8].expl.text = "Finish Story Level 3";
Achs[9].expl.text = "Finish Story Level 4";
Achs[10].expl.text = "Finish Story Level 5";
Achs[11].expl.text = "Finish Story Mode";
Achs[12].expl.text = "60s in Survival";
Achs[13].expl.text = "Finish 7 levels in Duel";
if (_root.Player.spits_total > 40) {
Achs[0].gotoAndStop("unlock");
Achs[0].ach.text = "Spit Man";
}
if (_root.Player.damageTaken_total > 150) {
Achs[1].gotoAndStop("unlock");
Achs[1].ach.text = "I've seen worse";
}
if (_root.Player.spits_total > 100) {
Achs[2].gotoAndStop("unlock");
Achs[2].ach.text = "Vomitor";
}
if (_root.Player.walkAmount_total > 1000) {
Achs[3].gotoAndStop("unlock");
Achs[3].ach.text = "Walk the line";
}
if (_root.Player.flyAmount_total > 60000) {
Achs[4].gotoAndStop("unlock");
Achs[4].ach.text = "It's an airplane !";
}
if ((_root.Player.killed_total > 250) && (_root.Player.spits_total < 150)) {
Achs[5].gotoAndStop("unlock");
Achs[5].ach.text = "Play moderatly";
}
if (_root.Player.bestLvl > 1) {
Achs[6].gotoAndStop("unlock");
Achs[6].ach.text = "Starting block";
}
if (_root.Player.bestLvl > 2) {
Achs[7].gotoAndStop("unlock");
Achs[7].ach.text = "Easy one";
}
if (_root.Player.bestLvl > 3) {
Achs[8].gotoAndStop("unlock");
Achs[8].ach.text = "Bridge defender";
}
if (_root.Player.bestLvl > 4) {
Achs[9].gotoAndStop("unlock");
Achs[9].ach.text = "The Horde is coming";
}
if (_root.Player.bestLvl > 5) {
Achs[10].gotoAndStop("unlock");
Achs[10].ach.text = "One Step Closer";
}
if (_root.Player.gameWon == 1) {
Achs[11].gotoAndStop("unlock");
Achs[11].ach.text = "What's next ?";
}
if (_root.Player.bestSurvTime > 1800) {
Achs[12].gotoAndStop("unlock");
Achs[12].ach.text = "1-minute Defender";
}
if (_root.Player.duelWon > 7) {
Achs[13].gotoAndStop("unlock");
Achs[13].ach.text = "Last Hero Standing";
}
Symbol 453 MovieClip Frame 1
stop();
Symbol 453 MovieClip Frame 10
stop();
Symbol 458 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
Symbol 458 MovieClip Frame 2
stop();
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 461 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
Symbol 461 MovieClip Frame 2
stop();
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 464 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
Symbol 464 MovieClip Frame 2
stop();
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 467 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
Symbol 467 MovieClip Frame 2
stop();
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 470 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
Symbol 470 MovieClip Frame 2
stop();
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 473 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
Symbol 473 MovieClip Frame 2
stop();
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 476 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
Symbol 476 MovieClip Frame 2
stop();
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 498 MovieClip Frame 1
stop();
Symbol 498 MovieClip Frame 2
stop();