Frame 1
belugerin_mc._visible = false;
_urlStart = _url.indexOf("://") + 3;
_urlEnd = _url.indexOf("/", _urlStart);
domain = _url.substring(_urlStart, _urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
mainDimana2 = "global";
if (domain == "kongregate.com") {
mainDimana2 = "alien";
} else {
mainDimana2 = "global";
}
if (mainDimana2 == "global") {
adBox.gotoAndStop(1);
var CPMStarContentSpotID = "8274QAC8A5378";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
} else if (mainDimana2 == "alien") {
adBox.gotoAndStop(2);
}
function simpanData() {
Cookies = SharedObject.getLocal("CobraSquadData");
i = 1;
while (i <= simpanSemua.length) {
Cookies.data["xCobraData" + i] = eval (simpanSemua[i]);
i++;
}
i = 1;
while (i <= 50) {
Cookies.data["kotak" + i] = _root["kotak" + i]._currentframe;
Cookies.data["namaSquad" + i] = _root["namaSquad" + i];
Cookies.data["specialSquad" + i] = _root["specialSquad" + i];
Cookies.data["atributeValue" + i] = _root["atributeValue" + i];
Cookies.data["nomorSquad" + i] = _root["nomorSquad" + i];
Cookies.data["fotoSquad" + i] = _root["fotoSquad" + i];
Cookies.data["fotoWeapon" + i] = _root["fotoWeapon" + i];
Cookies.data["foto1Item" + i] = _root["foto1Item" + i];
Cookies.data["foto2Item" + i] = _root["foto2Item" + i];
Cookies.data["foto3Item" + i] = _root["foto3Item" + i];
Cookies.data["foto1Power" + i] = _root["foto1Power" + i];
Cookies.data["foto2Power" + i] = _root["foto2Power" + i];
Cookies.data["foto3Power" + i] = _root["foto3Power" + i];
Cookies.data["weaponSquad" + i] = _root["weaponSquad" + i];
Cookies.data["lifeSquad" + i] = _root["lifeSquad" + i];
Cookies.data["strengthSquad" + i] = _root["strengthSquad" + i];
Cookies.data["agilitySquad" + i] = _root["agilitySquad" + i];
Cookies.data["skillSquad" + i] = _root["skillSquad" + i];
Cookies.data["visionSquad" + i] = _root["visionSquad" + i];
Cookies.data["moraleSquad" + i] = _root["moraleSquad" + i];
i++;
}
i = 1;
while (i <= 48) {
Cookies.data["posPasukanX" + i] = _root["posPasukanX" + i];
Cookies.data["posPasukanY" + i] = _root["posPasukanY" + i];
i++;
}
i = 1;
while (i <= 48) {
Cookies.data["achievementsDapat" + i] = _root["achievementsDapat" + i];
i++;
}
Cookies.flush();
}
function loadData() {
Cookies = SharedObject.getLocal("CobraSquadData");
i = 1;
while (i <= simpanSemua.length) {
_root[simpanSemua[i]] = Cookies.data["xCobraData" + i];
i++;
}
i = 1;
while (i <= 50) {
_root["kotak" + i].gotoAndStop(Cookies.data["kotak" + i]);
_root["namaSquad" + i] = Cookies.data["namaSquad" + i];
_root["specialSquad" + i] = Cookies.data["specialSquad" + i];
_root["atributeValue" + i] = Cookies.data["atributeValue" + i];
_root["nomorSquad" + i] = Cookies.data["nomorSquad" + i];
_root["fotoSquad" + i] = Cookies.data["fotoSquad" + i];
_root["fotoWeapon" + i] = Cookies.data["fotoWeapon" + i];
_root["foto1Item" + i] = Cookies.data["foto1Item" + i];
_root["foto2Item" + i] = Cookies.data["foto2Item" + i];
_root["foto3Item" + i] = Cookies.data["foto3Item" + i];
_root["foto1Power" + i] = Cookies.data["foto1Power" + i];
_root["foto2Power" + i] = Cookies.data["foto2Power" + i];
_root["foto3Power" + i] = Cookies.data["foto3Power" + i];
_root["weaponSquad" + i] = Cookies.data["weaponSquad" + i];
_root["lifeSquad" + i] = Cookies.data["lifeSquad" + i];
_root["strengthSquad" + i] = Cookies.data["strengthSquad" + i];
_root["agilitySquad" + i] = Cookies.data["agilitySquad" + i];
_root["skillSquad" + i] = Cookies.data["skillSquad" + i];
_root["visionSquad" + i] = Cookies.data["visionSquad" + i];
_root["moraleSquad" + i] = Cookies.data["moraleSquad" + i];
i++;
}
i = 1;
while (i <= 48) {
_root["posPasukanX" + i] = Cookies.data["posPasukanX" + i];
_root["posPasukanY" + i] = Cookies.data["posPasukanY" + i];
i++;
}
i = 1;
while (i <= 48) {
_root["achievementsDapat" + i] = Cookies.data["achievementsDapat" + i];
i++;
}
Cookies.flush();
}
function initAwalData() {
winTheGame = 0;
i = 1;
while (i <= 50) {
_root["achievementsDapat" + i] = 0;
i++;
}
}
function initData() {
day = 1;
win = 0;
winKini = 1;
memberSquad = 2;
kiniMisi = 1;
money = 1000;
xmoney = "MONEY $" + money;
autoSave = "off";
totalKilled = 0;
memberKilled = 0;
adaSuara = true;
sudahTutorial1 = false;
sudahTutorial2 = false;
misiKini1 = false;
misiKini2 = false;
misiKini3 = false;
misiKini4 = false;
misiKini5 = false;
misiKini6 = false;
misiKini7 = false;
misiKini8 = false;
misiKini9 = false;
jumlahWeapon1 = 0;
jumlahWeapon2 = 0;
jumlahWeapon3 = 0;
jumlahWeapon4 = 0;
jumlahWeapon5 = 0;
jumlahWeapon6 = 0;
jumlahWeapon7 = 0;
jumlahItem1 = 0;
jumlahItem2 = 0;
jumlahItem3 = 0;
jumlahItem4 = 0;
jumlahItem5 = 0;
jumlahItem6 = 0;
jumlahItem7 = 0;
jumlahItem8 = 0;
jumlahPower1 = 0;
jumlahPower2 = 0;
jumlahPower3 = 0;
jumlahPower4 = 0;
jumlahPower5 = 0;
jumlahPower6 = 0;
jumlahPower7 = 0;
misiSelesai1 = 0;
misiSelesai2 = 0;
misiSelesai3 = 0;
misiSelesai4 = 0;
misiSelesai5 = 0;
misiSelesai6 = 0;
misiSelesai7 = 0;
misiSelesai8 = 0;
misiSelesai9 = 0;
misiSelesai10 = 0;
misiSub11 = 0;
misiSub12 = 0;
misiSub13 = 0;
misiSub14 = 0;
misiSub15 = 0;
misiSub21 = 0;
misiSub22 = 0;
misiSub23 = 0;
misiSub24 = 0;
misiSub25 = 0;
misiSub31 = 0;
misiSub32 = 0;
misiSub33 = 0;
misiSub34 = 0;
misiSub35 = 0;
misiSub41 = 0;
misiSub42 = 0;
misiSub43 = 0;
misiSub44 = 0;
misiSub45 = 0;
misiSub51 = 0;
misiSub52 = 0;
misiSub53 = 0;
misiSub54 = 0;
misiSub55 = 0;
misiSub61 = 0;
misiSub62 = 0;
misiSub63 = 0;
misiSub64 = 0;
misiSub65 = 0;
misiSub71 = 0;
misiSub72 = 0;
misiSub73 = 0;
misiSub74 = 0;
misiSub75 = 0;
misiSub81 = 0;
misiSub82 = 0;
misiSub83 = 0;
misiSub84 = 0;
misiSub85 = 0;
misiSub91 = 0;
misiSub92 = 0;
misiSub93 = 0;
misiSub94 = 0;
misiSub95 = 0;
i = 1;
while (i <= 50) {
_root["kotak" + i].gotoAndStop(20);
_root["namaSquad" + i] = "";
_root["specialSquad" + i] = "";
_root["atributeValue" + i] = "";
_root["nomorSquad" + i] = 0;
_root["fotoSquad" + i] = 20;
_root["fotoWeapon" + i] = 20;
_root["foto1Item" + i] = 20;
_root["foto2Item" + i] = 20;
_root["foto3Item" + i] = 20;
_root["foto1Power" + i] = 20;
_root["foto2Power" + i] = 20;
_root["foto3Power" + i] = 20;
_root["weaponSquad" + i] = "";
_root["lifeSquad" + i] = 100;
_root["strengthSquad" + i] = 0;
_root["agilitySquad" + i] = 0;
_root["skillSquad" + i] = 0;
_root["visionSquad" + i] = 0;
_root["moraleSquad" + i] = 50;
i++;
}
i = 21;
while (i <= 50) {
_root["kotak" + i].gotoAndStop(20);
_root["namaSquad" + i] = "Reinforcement";
_root["specialSquad" + i] = "";
_root["atributeValue" + i] = "";
_root["nomorSquad" + i] = "";
_root["fotoSquad" + i] = 20;
_root["fotoWeapon" + i] = 20;
_root["foto1Item" + i] = 20;
_root["foto2Item" + i] = 20;
_root["foto3Item" + i] = 20;
_root["foto1Power" + i] = 20;
_root["foto2Power" + i] = 20;
_root["foto3Power" + i] = 20;
_root["weaponSquad" + i] = "";
_root["lifeSquad" + i] = 100;
_root["strengthSquad" + i] = 40 + random(30);
_root["agilitySquad" + i] = 40 + random(30);
_root["skillSquad" + i] = 40 + random(30);
_root["visionSquad" + i] = 40 + random(30);
_root["moraleSquad" + i] = 50;
i++;
}
_root.namaSquad1 = "James Bone";
_root.specialSquad1 = "Handgun";
_root.nomorSquad1 = "007";
_root.fotoSquad1 = 1;
_root.fotoWeapon1 = 1;
_root.foto1Item1 = 1;
_root.foto2Item1 = 2;
_root.foto3Item1 = 3;
_root.foto1Power1 = 20;
_root.foto2Power1 = 20;
_root.foto3Power1 = 20;
_root.weaponSquad1 = "";
_root.lifeSquad1 = 100;
_root.strengthSquad1 = 90;
_root.agilitySquad1 = 95;
_root.skillSquad1 = 100;
_root.visionSquad1 = 95;
_root.moraleSquad1 = 75;
_root.atributeValue1 = ((_root.strengthSquad1 + _root.agilitySquad1) + _root.skillSquad1) + _root.visionSquad1;
_root.namaSquad2 = "John Mambo";
_root.specialSquad2 = "Rifle";
_root.nomorSquad2 = "0001";
_root.fotoSquad2 = 2;
_root.fotoWeapon2 = 2;
_root.foto1Item2 = 20;
_root.foto2Item2 = 20;
_root.foto3Item2 = 20;
_root.foto1Power2 = 20;
_root.foto2Power2 = 20;
_root.foto3Power2 = 20;
_root.weaponSquad2 = "";
_root.lifeSquad2 = 100;
_root.strengthSquad2 = 100;
_root.agilitySquad2 = 85;
_root.skillSquad2 = 95;
_root.visionSquad2 = 90;
_root.moraleSquad2 = 75;
_root.atributeValue2 = ((_root.strengthSquad2 + _root.agilitySquad2) + _root.skillSquad2) + _root.visionSquad2;
_root.namaSquad3 = "Kenny George";
_root.specialSquad3 = "Rifle";
_root.nomorSquad3 = "0002";
_root.fotoSquad3 = 2;
_root.fotoWeapon3 = 2;
_root.foto1Item3 = 1;
_root.foto2Item3 = 20;
_root.foto3Item3 = 20;
_root.foto1Power3 = 20;
_root.foto2Power3 = 20;
_root.foto3Power3 = 20;
_root.weaponSquad3 = "";
_root.lifeSquad3 = 100;
_root.strengthSquad3 = 80 + random(20);
_root.agilitySquad3 = 80 + random(20);
_root.skillSquad3 = 80 + random(20);
_root.visionSquad3 = 30 + random(30);
_root.moraleSquad3 = 50;
_root.atributeValue3 = ((_root.strengthSquad3 + _root.agilitySquad3) + _root.skillSquad3) + _root.visionSquad3;
i = 1;
while (i <= 48) {
_root["posPasukanX" + i] = -500;
_root["posPasukanY" + i] = -500;
i++;
}
killHandgun = 0;
killRifle = 0;
killSniper = 0;
killMortar = 0;
killGranade = 0;
killLauncher = 0;
killLaser = 0;
killTruk = 0;
killPanzer = 0;
killTank = 0;
killHelicopter = 0;
killJet = 0;
}
function cekMisi(indi, indi2) {
if ((indi == 1) && (kiniMisi == 1)) {
if (indi2 == 1) {
misiSub11 = true;
} else if (indi2 == 2) {
misiSub12 = true;
} else if (indi2 == 3) {
misiSub13 = true;
} else if (indi2 == 4) {
misiSub14 = true;
} else if (indi2 == 5) {
misiSub15 = true;
}
if (((((misiSub11 == true) && (misiSub12 == true)) && (misiSub13 == true)) && (misiSub14 == true)) && (misiSub15 == true)) {
misiSelesai1 = 1;
}
} else if ((indi == 2) && (kiniMisi == 2)) {
if (indi2 == 1) {
misiSub21 = true;
} else if (indi2 == 2) {
misiSub22 = true;
} else if (indi2 == 3) {
misiSub23 = true;
} else if (indi2 == 4) {
misiSub24 = true;
} else if (indi2 == 5) {
misiSub25 = true;
}
if (((((misiSub21 == true) && (misiSub22 == true)) && (misiSub23 == true)) && (misiSub24 == true)) && (misiSub25 == true)) {
misiSelesai2 = 1;
}
} else if ((indi == 3) && (kiniMisi == 3)) {
if (indi2 == 1) {
misiSub31 = true;
} else if (indi2 == 2) {
misiSub32 = true;
} else if (indi2 == 3) {
misiSub33 = true;
} else if (indi2 == 4) {
misiSub34 = true;
} else if (indi2 == 5) {
misiSub35 = true;
}
if (((((misiSub31 == true) && (misiSub32 == true)) && (misiSub33 == true)) && (misiSub34 == true)) && (misiSub35 == true)) {
misiSelesai3 = 1;
}
} else if ((indi == 4) && (kiniMisi == 4)) {
if (indi2 == 1) {
misiSub41 = true;
} else if (indi2 == 2) {
misiSub42 = true;
} else if (indi2 == 3) {
misiSub43 = true;
} else if (indi2 == 4) {
misiSub44 = true;
} else if (indi2 == 5) {
misiSub45 = true;
}
if (((((misiSub41 == true) && (misiSub42 == true)) && (misiSub43 == true)) && (misiSub44 == true)) && (misiSub45 == true)) {
misiSelesai4 = 1;
}
} else if ((indi == 5) && (kiniMisi == 5)) {
if (indi2 == 1) {
misiSub51 = true;
} else if (indi2 == 2) {
misiSub52 = true;
} else if (indi2 == 3) {
misiSub53 = true;
} else if (indi2 == 4) {
misiSub54 = true;
} else if (indi2 == 5) {
misiSub55 = true;
}
if (((((misiSub51 == true) && (misiSub52 == true)) && (misiSub53 == true)) && (misiSub54 == true)) && (misiSub55 == true)) {
misiSelesai5 = 1;
}
} else if ((indi == 6) && (kiniMisi == 6)) {
if (indi2 == 1) {
misiSub61 = true;
} else if (indi2 == 2) {
misiSub62 = true;
} else if (indi2 == 3) {
misiSub63 = true;
} else if (indi2 == 4) {
misiSub64 = true;
} else if (indi2 == 5) {
misiSub65 = true;
}
if (((((misiSub61 == true) && (misiSub62 == true)) && (misiSub63 == true)) && (misiSub64 == true)) && (misiSub65 == true)) {
misiSelesai6 = 1;
}
} else if ((indi == 7) && (kiniMisi == 7)) {
if (indi2 == 1) {
misiSub71 = true;
} else if (indi2 == 2) {
misiSub72 = true;
} else if (indi2 == 3) {
misiSub73 = true;
} else if (indi2 == 4) {
misiSub74 = true;
} else if (indi2 == 5) {
misiSub75 = true;
}
if (((((misiSub71 == true) && (misiSub72 == true)) && (misiSub73 == true)) && (misiSub74 == true)) && (misiSub75 == true)) {
misiSelesai7 = 1;
}
} else if ((indi == 8) && (kiniMisi == 8)) {
if (indi2 == 1) {
misiSub81 = true;
} else if (indi2 == 2) {
misiSub82 = true;
} else if (indi2 == 3) {
misiSub83 = true;
} else if (indi2 == 4) {
misiSub84 = true;
} else if (indi2 == 5) {
misiSub85 = true;
}
if (((((misiSub81 == true) && (misiSub82 == true)) && (misiSub83 == true)) && (misiSub84 == true)) && (misiSub85 == true)) {
misiSelesai8 = 1;
}
} else if ((indi == 9) && (kiniMisi == 9)) {
if (indi2 == 1) {
misiSub91 = true;
} else if (indi2 == 2) {
misiSub92 = true;
} else if (indi2 == 3) {
misiSub93 = true;
} else if (indi2 == 4) {
misiSub94 = true;
} else if (indi2 == 5) {
misiSub95 = true;
}
if (((((misiSub91 == true) && (misiSub92 == true)) && (misiSub93 == true)) && (misiSub94 == true)) && (misiSub95 == true)) {
misiSelesai9 = 1;
}
}
cekUpdateKini();
}
function resetSquad(indi) {
_root["fotoSquad" + indi] = 20;
_root["kotak" + indi].gotoAndStop(_root["fotoSquad" + indi]);
_root["namaSquad" + indi] = "";
_root["specialSquad" + indi] = "";
_root["atributeValue" + indi] = "";
_root["nomorSquad" + indi] = 0;
_root["fotoWeapon" + indi] = 20;
_root["foto1Item" + indi] = 20;
_root["foto2Item" + indi] = 20;
_root["foto3Item" + indi] = 20;
_root["foto1Power" + indi] = 20;
_root["foto2Power" + indi] = 20;
_root["foto3Power" + indi] = 20;
_root["weaponSquad" + indi] = "";
_root["lifeSquad" + indi] = 100;
_root["strengthSquad" + indi] = 0;
_root["agilitySquad" + indi] = 0;
_root["skillSquad" + indi] = 0;
_root["visionSquad" + indi] = 0;
_root["moraleSquad" + indi] = 50;
_root["kotak" + indi].latar_mc.gotoAndStop(1);
cekLainLain();
}
function backMusic() {
myMusic.stop();
myMusic = new Sound(zmusic);
myMusic.attachSound("backMusic");
myMusic.start(0, 1);
myMusic.setVolume(volume1);
myMusic.onSoundComplete = backMusic;
}
function backMati() {
zrand = random(5) + 1;
mySound = new Sound(zsound);
mySound.attachSound("backMati" + zrand);
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backGun() {
zrand = random(2) + 1;
mySound = new Sound(zsound);
mySound.attachSound("backGun" + zrand);
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backReload() {
zrand = random(2) + 1;
mySound = new Sound(zsound);
mySound.attachSound("backReload" + zrand);
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backRifle() {
zrand = random(2) + 1;
mySound = new Sound(zsound);
mySound.attachSound("backRifle" + zrand);
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backSniper() {
mySound = new Sound(zsound);
mySound.attachSound("backSniper");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backMortar() {
zrand = random(2) + 1;
mySound = new Sound(zsound);
mySound.attachSound("backMortar" + zrand);
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backGranade() {
mySound = new Sound(zsound);
mySound.attachSound("backGranade");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backLauncher() {
mySound = new Sound(zsound);
mySound.attachSound("backLauncher");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backLaser() {
mySound = new Sound(zsound);
mySound.attachSound("backLaser");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backLedak() {
zrand = random(3) + 1;
mySound2 = new Sound(zsound2);
mySound2.attachSound("backLedak" + zrand);
mySound2.start(0, 1);
mySound2.setVolume(volume3);
}
function backHeli() {
mySound = new Sound(zsound);
mySound.attachSound("backHeli");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backJet() {
mySound = new Sound(zsound);
mySound.attachSound("backJet");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backJet() {
mySound = new Sound(zsound);
mySound.attachSound("backJet");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backTank() {
mySound = new Sound(zsound);
mySound.attachSound("backTank");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backTruck() {
mySound = new Sound(zsound);
mySound.attachSound("backTruck");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
stop();
fscommand ("fullscreen", false);
fscommand ("allowscale", true);
fscommand ("showmenu", false);
this.onEnterFrame = function () {
persen = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
xpersen = ("Loading " + persen) + " %";
bar_mc.gotoAndStop(persen);
if (persen >= 100) {
gotoAndStop ("completed");
delete this.onEnterFrame;
}
};
simpanSemua = new Array("", "day", "win", "winKini", "memberSquad", "kiniMisi", "money", "xmoney", "totalKilled", "misiKini1", "misiKini2", "misiKini3", "misiKini4", "misiKini5", "misiKini6", "misiKini7", "misiKini8", "misiKini9", "jumlahWeapon1", "jumlahWeapon2", "jumlahWeapon3", "jumlahWeapon4", "jumlahWeapon5", "jumlahWeapon6", "jumlahWeapon7", "jumlahItem1", "jumlahItem2", "jumlahItem3", "jumlahItem4", "jumlahItem5", "jumlahItem6", "jumlahItem7", "jumlahItem8", "jumlahPower1", "jumlahPower2", "jumlahPower3", "jumlahPower4", "jumlahPower5", "jumlahPower6", "jumlahPower7", "misiSelesai1", "misiSelesai2", "misiSelesai3", "misiSelesai4", "misiSelesai5", "misiSelesai6", "misiSelesai7", "misiSelesai8", "misiSelesai9", "misiSub11", "misiSub12", "misiSub13", "misiSub14", "misiSub15", "misiSub21", "misiSub22", "misiSub23", "misiSub24", "misiSub25", "misiSub31", "misiSub32", "misiSub33", "misiSub34", "misiSub35", "misiSub41", "misiSub42", "misiSub43", "misiSub44", "misiSub45", "misiSub51", "misiSub52", "misiSub53", "misiSub54", "misiSub55", "misiSub61", "misiSub62", "misiSub63", "misiSub64", "misiSub65", "misiSub71", "misiSub72", "misiSub73", "misiSub74", "misiSub75", "misiSub81", "misiSub82", "misiSub83", "misiSub84", "misiSub85", "misiSub91", "misiSub92", "misiSub93", "misiSub94", "misiSub95", "killHandgun", "killRifle", "killSniper", "killMortar", "killGranade", "killLauncher", "killLaser", "killTruk", "killPanzer", "killTank", "killHelicopter", "killJet", "autoSave", "misiSelesai10", "memberKilled", "winTheGame", "adaSuara", "sudahTutorial1", "sudahTutorial2");
qualityGame = 1;
_quality = "HIGH";
loadData();
if (day == undefined) {
initAwalData();
initData();
}
music = attachMovie("indi", "zmusic", 4);
zsound = attachMovie("indi", "zsound", 5);
zsound2 = attachMovie("indi", "zsound2", 6);
volume1 = 100;
volume2 = 75;
volume3 = 250;
Frame 25
stop();
_urlStart = _url.indexOf("://") + 3;
_urlEnd = _url.indexOf("/", _urlStart);
domain = _url.substring(_urlStart, _urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
unloadMovie (adBox);
if (domain == "armorgames.com") {
play_btn.enabled = false;
gotoAndStop (41);
} else {
play_btn.enabled = false;
getURL ("http://www.thegames8.com/", "_self");
}
Frame 41
play();
Frame 270
backMenu();
gotoAndStop (271);
Frame 271
stop();
if (adaSuara == true) {
volume1 = 25;
myMusic.setVolume(volume1);
}
msgBox_mc._visible = false;
play_btn.onRelease = function () {
if (day == 1) {
backMusic();
initData();
gotoAndStop (272);
} else {
msgBox_mc._visible = true;
msgBox_mc.new_btn.onRelease = function () {
backMusic();
initData();
gotoAndStop (272);
};
msgBox_mc.continue_btn.onRelease = function () {
backMusic();
loadData();
gotoAndStop (273);
};
}
};
more_btn.onRelease = function () {
getURL ("http://www.thegames8.com/", "_blank");
};
facebook_btn.onRelease = function () {
getURL ("http://www.facebook.com/ArmorGames", "_blank");
};
Frame 272
function init() {
dalamLantai = 80;
dalamObyek = 4500;
dalamArea = 4650;
dalamBendera = 88;
dalamRange = 4750;
dalamDarah = 100;
bykTentaraAwal = 100;
bykTentara = 1000;
bykTentara2 = 2000;
dalamPeluru = 3000;
dalamBenteng = 4000;
dalamLedakan = 5000;
dalamBantuan = 11000;
dalamUI = 10000;
dalamPilihSquad = 14000;
dalamCobra = 15000;
dalamAmbil = 9000;
dalamWin = 16000;
dalamOption = 17000;
dalamNyawaBar = 8000;
dalamHeli = 8500;
kePasukan = 21;
moneyPlus = false;
bisaMove = true;
lamaMoneyPlus = 0;
munculMusuh = false;
sudahSelesai = false;
delayKeluarMusuh = 0;
maxKeluarMusuh = 10;
waveKini = 1;
if (kiniMisi == 1) {
waveMax = 2;
} else if (kiniMisi == 2) {
waveMax = 3;
} else if (kiniMisi == 3) {
waveMax = 4;
} else if (kiniMisi == 4) {
waveMax = 5;
} else if (kiniMisi == 5) {
waveMax = 6;
} else if (kiniMisi == 6) {
waveMax = 7;
} else if (kiniMisi == 7) {
waveMax = 8;
} else if (kiniMisi == 8) {
waveMax = 9;
} else if (kiniMisi == 9) {
waveMax = 10;
}
tingkatSulit = kiniMisi + 1;
arrayKeluar = new Array();
i = 1;
while (i <= waveMax) {
arrayKeluar[i] = (5 * i) * winKini;
i++;
}
keluarMusuh = arrayKeluar[waveKini];
if (keluarMusuh >= 50) {
keluarMusuh = 50;
}
adaPasukanKini = 0;
maxMusuh = keluarMusuh;
if (kiniMisi == 7) {
bendera = attachMovie("bendera_mc", "bendera_mc", dalamBendera);
bendera._x = 25;
bendera._y = 525;
} else if (kiniMisi == 9) {
bendera = attachMovie("bendera_mc", "bendera_mc", dalamBendera);
bendera._x = 400;
bendera._y = 300;
}
bendera.onRollOver = overBendera;
bendera.onRollOut = outBendera;
if ((kiniMisi == 7) || (kiniMisi == 9)) {
ambilBendera = true;
} else {
ambilBendera = false;
}
if (kiniMisi == 6) {
benteng = attachMovie("benteng_mc", "benteng_mc", dalamBenteng);
benteng._x = 400;
benteng._y = 300;
}
}
function overBendera() {
this.gotoAndStop(2);
}
function outBendera() {
this.gotoAndStop(1);
}
function buatPosisi() {
i = 1;
while (i <= 48) {
if (_root["posPasukanX" + i] != -500) {
if (_root["fotoWeapon" + i] != 20) {
_root["adaCobra" + i] = false;
buatTentaraJagoan(indi, _root["posPasukanX" + i], _root["posPasukanY" + i], i);
} else {
_root["adaCobra" + i] = true;
}
} else {
_root["adaCobra" + i] = true;
}
i++;
}
sortingPasukan();
}
function klikUseItems() {
myStr = new String(this);
pilihItems = Number(myStr.substr(myStr.length - 1, 1));
sudahPilih1 = 0;
sudahPilih2 = 0;
sudahPilih3 = 0;
sudahPilih4 = 0;
sudahPilih5 = 0;
sudahPilih6 = 0;
sudahPilih7 = 0;
sudahPilih8 = 0;
k = 1000;
while (k <= 1050) {
j = 1;
while (j <= 3) {
if ((_root["jagoan_mc" + k].nyawa > 0) && (_root["jagoan_mc" + k].nyawa != undefined)) {
indi = _root["jagoan_mc" + k].urutanTentara;
if (_root[(("foto" + j) + "Item") + indi] == pilihItems) {
if ((pilihItems == 1) && (sudahPilih1 == 0)) {
sudahPilih1 = 1;
_root[(("foto" + j) + "Item") + indi] = 20;
_root["jagoan_mc" + k].nyawa = _root["jagoan_mc" + k].nyawa + (_root["jagoan_mc" + k].nyawaMax / 2);
if (_root["jagoan_mc" + k].nyawa >= _root["jagoan_mc" + k].nyawaMax) {
_root["jagoan_mc" + k].nyawa = _root["jagoan_mc" + k].nyawaMax;
}
} else if ((pilihItems == 2) && (sudahPilih2 == 0)) {
sudahPilih2 = 1;
_root[(("foto" + j) + "Item") + indi] = 20;
_root["jagoan_mc" + k].range = _root["jagoan_mc" + k].range * 1.25;
_root["jagoan_mc" + k].rangeMin = _root["jagoan_mc" + k].range;
_root["jagoan_mc" + k].rangeMax = _root["jagoan_mc" + k].range * 3;
} else if ((pilihItems == 3) && (sudahPilih3 == 0)) {
sudahPilih3 = 1;
_root[(("foto" + j) + "Item") + indi] = 20;
_root["jagoan_mc" + k].defense = _root["jagoan_mc" + k].defense * 1.5;
} else if ((pilihItems == 4) && (sudahPilih4 == 0)) {
sudahPilih4 = 1;
_root[(("foto" + j) + "Item") + indi] = 20;
_root["jagoan_mc" + k].damage = _root["jagoan_mc" + k].damage * 1.5;
} else if ((pilihItems == 5) && (sudahPilih5 == 0)) {
sudahPilih5 = 1;
_root[(("foto" + j) + "Item") + indi] = 20;
_root["jagoan_mc" + k].nyawa = _root["jagoan_mc" + k].nyawaMax;
} else if ((pilihItems == 6) && (sudahPilih6 == 0)) {
sudahPilih6 = 1;
_root[(("foto" + j) + "Item") + indi] = 20;
_root["jagoan_mc" + k].range = _root["jagoan_mc" + k].range * 1.5;
_root["jagoan_mc" + k].rangeMin = _root["jagoan_mc" + k].range;
_root["jagoan_mc" + k].rangeMax = _root["jagoan_mc" + k].range * 3;
} else if ((pilihItems == 7) && (sudahPilih7 == 0)) {
sudahPilih7 = 1;
_root[(("foto" + j) + "Item") + indi] = 20;
_root["jagoan_mc" + k].defense = _root["jagoan_mc" + k].defense * 2.5;
} else if ((pilihItems == 8) && (sudahPilih8 == 0)) {
sudahPilih8 = 1;
_root[(("foto" + j) + "Item") + indi] = 20;
_root["jagoan_mc" + k].damage = _root["jagoan_mc" + k].damage * 2.5;
}
}
}
j++;
}
sudahPilih1 = 0;
sudahPilih2 = 0;
sudahPilih3 = 0;
sudahPilih4 = 0;
sudahPilih5 = 0;
sudahPilih6 = 0;
sudahPilih7 = 0;
sudahPilih8 = 0;
k++;
}
cekJumlahItems();
i = 1;
while (i <= 8) {
useAllItem["jumlah" + i] = _root["cekJumlahItems" + i];
i++;
}
}
function klikUsePowers() {
myStr = new String(this);
pilihPowers = Number(myStr.substr(myStr.length - 1, 1));
sudahPilih1 = 0;
sudahPilih2 = 0;
sudahPilih3 = 0;
sudahPilih4 = 0;
sudahPilih5 = 0;
sudahPilih6 = 0;
sudahPilih7 = 0;
sudahPilih8 = 0;
k = 1000;
while (k <= 1050) {
j = 1;
while (j <= 3) {
if ((_root["jagoan_mc" + k].nyawa > 0) && (_root["jagoan_mc" + k].nyawa != undefined)) {
indi = _root["jagoan_mc" + k].urutanTentara;
if (_root[(("foto" + j) + "Power") + indi] == pilihPowers) {
if ((pilihPowers == 1) && (sudahPilih1 == 0)) {
sudahPilih1 = 1;
_root[(("foto" + j) + "Power") + indi] = 20;
_root["jagoan_mc" + k].dobelBulet = true;
_root["jagoan_mc" + k].lamaDobel = 0;
} else if ((pilihPowers == 2) && (sudahPilih2 == 0)) {
sudahPilih2 = 1;
_root[(("foto" + j) + "Power") + indi] = 20;
_root["jagoan_mc" + k].crusher = true;
if (misiKini9 == false) {
_root["jagoan_mc" + k].defense = _root["jagoan_mc" + k].defense * 3;
}
_root["jagoan_mc" + k].lamaCrusher = 0;
} else if ((pilihPowers == 3) && (sudahPilih3 == 0)) {
sudahPilih3 = 1;
_root[(("foto" + j) + "Power") + indi] = 20;
_root["jagoan_mc" + k].overTake = true;
} else if ((pilihPowers == 4) && (sudahPilih4 == 0)) {
sudahPilih4 = 1;
_root[(("foto" + j) + "Power") + indi] = 20;
_root["jagoan_mc" + k].imune = true;
_root["jagoan_mc" + k].lamaImune = 0;
} else if ((pilihPowers == 5) && (sudahPilih5 == 0)) {
sudahPilih5 = 1;
_root[(("foto" + j) + "Power") + indi] = 20;
_root["jagoan_mc" + k].sharpLook = true;
_root["jagoan_mc" + k].lamaLook = 0;
} else if ((pilihPowers == 6) && (sudahPilih6 == 0)) {
sudahPilih6 = 1;
_root[(("foto" + j) + "Power") + indi] = 20;
_root["jagoan_mc" + k].invisible = true;
_root["jagoan_mc" + k].lamaInvis = 0;
} else if ((pilihPowers == 7) && (sudahPilih7 == 0)) {
sudahPilih7 = 1;
_root[(("foto" + j) + "Power") + indi] = 20;
moneyPlus = true;
lamaMoneyPlus = 0;
}
}
}
j++;
}
sudahPilih1 = 0;
sudahPilih2 = 0;
sudahPilih3 = 0;
sudahPilih4 = 0;
sudahPilih5 = 0;
sudahPilih6 = 0;
sudahPilih7 = 0;
sudahPilih8 = 0;
k++;
}
cekJumlahPowers();
i = 1;
while (i <= 8) {
useAllPower["jumlah" + i] = _root["cekJumlahPowers" + i];
i++;
}
}
function cekJumlahItems() {
i = 1;
while (i <= 8) {
_root["cekJumlahItems" + i] = 0;
i++;
}
k = 1000;
while (k <= 1050) {
j = 1;
while (j <= 3) {
if ((_root["jagoan_mc" + k].nyawa > 0) && (_root["jagoan_mc" + k].nyawa != undefined)) {
indi = _root["jagoan_mc" + k].urutanTentara;
_root["cekJumlahItems" + _root[(("foto" + j) + "Item") + indi]]++;
}
j++;
}
k++;
}
}
function cekJumlahPowers() {
i = 1;
while (i <= 8) {
_root["cekJumlahPowers" + i] = 0;
i++;
}
k = 1000;
while (k <= 1050) {
j = 1;
while (j <= 3) {
if ((_root["jagoan_mc" + k].nyawa > 0) && (_root["jagoan_mc" + k].nyawa != undefined)) {
indi = _root["jagoan_mc" + k].urutanTentara;
_root["cekJumlahPowers" + _root[(("foto" + j) + "Power") + indi]]++;
}
j++;
}
k++;
}
}
function overFoto() {
myStr = new String(this);
qindi = Number(myStr.substr(myStr.length - 1, 1));
useAllItem.msgBox_mc6._x = this._x + 75;
useAllItem.msgBox_mc6._y = this._y - 90;
useAllItem.msgBox_mc6._visible = true;
useAllItem.msgBox_mc6.gotoAndStop(qindi);
}
function outFoto() {
useAllItem.msgBox_mc6._visible = false;
}
function overFoto2() {
myStr = new String(this);
qindi = Number(myStr.substr(myStr.length - 1, 1));
useAllPower.msgBox_mc6._x = this._x + 75;
useAllPower.msgBox_mc6._y = this._y - 90;
useAllPower.msgBox_mc6._visible = true;
useAllPower.msgBox_mc6.gotoAndStop(qindi);
}
function outFoto2() {
useAllPower.msgBox_mc6._visible = false;
}
function buatUI() {
ui = attachMovie("ui_mc", "ui_mc", dalamUI);
ui._x = 0;
ui._y = 550;
ui.one1.gotoAndStop(1);
ui.one2.gotoAndStop(1);
sedangDragSquad = false;
ui.tutorial_mc._visible = false;
if (sudahTutorial1 == false) {
ui.squad_btn.enabled = false;
ui.start_btn.enabled = false;
ui.use_all.enabled = false;
ui.option_btn.enabled = false;
ui.bantuan_btn.enabled = false;
ui.tutorial_mc._visible = true;
ui.tutorial_mc.gotoAndStop(1);
ui.tutorial_mc.prev_btn.onRelease = function () {
if (ui.tutorial_mc._currentframe == 1) {
clearSemua();
gotoAndStop (271);
} else {
ui.tutorial_mc.gotoAndStop(ui.tutorial_mc._currentframe - 1);
}
};
ui.tutorial_mc.next_btn.onRelease = function () {
ui.tutorial_mc.gotoAndStop(ui.tutorial_mc._currentframe + 1);
if (ui.tutorial_mc._currentframe > 5) {
sudahTutorial1 = true;
ui.tutorial_mc._visible = false;
ui.squad_btn.enabled = true;
ui.start_btn.enabled = true;
ui.use_all.enabled = true;
ui.option_btn.enabled = true;
}
};
} else {
ui.squad_btn.enabled = true;
ui.start_btn.enabled = true;
ui.use_all.enabled = true;
ui.option_btn.enabled = true;
}
if (kiniMisi >= 2) {
ui.bantuan_btn.enabled = true;
ui.bantuan_btn._alpha = 100;
} else {
ui.bantuan_btn.enabled = false;
ui.bantuan_btn._alpha = 50;
}
ui.squad_btn.onRelease = function () {
removeMovieClip(tentara_mc);
sedangDragSquad = false;
removeMovieClip(ambilSquad);
buatCobra();
};
ui.start_btn.onRelease = function () {
if (sedangDragSquad == true) {
} else if (sedangDragSquad2 == true) {
} else if (jumlahCobra > 0) {
removeMovieClip(tentara_mc);
bisaMove = false;
munculMusuh = true;
this._alpha = 50;
this.enabled = false;
} else if (jumlahCobra <= 0) {
ui.one1.gotoAndPlay(2);
}
};
ui.use_all.onRelease = function () {
if (sedangDragSquad == true) {
} else if (sedangDragSquad2 == true) {
} else if (jumlahCobra > 0) {
useAll = attachMovie("useAll_mc", "option_mc", dalamOption);
useAll._x = 400;
useAll._y = 300;
useAll.allItem.onRelease = function () {
useAllItem = attachMovie("useAllItem", "option_mc", dalamOption);
useAllItem._x = 400;
useAllItem._y = 300;
useAllItem.msgBox_mc6._visible = false;
cekJumlahItems();
i = 1;
while (i <= 8) {
useAllItem["foto" + i].gotoAndStop(i);
useAllItem["foto" + i].onRollOver = overFoto;
useAllItem["foto" + i].onRollOut = outFoto;
useAllItem["cost" + i] = "COST $" + itemHarga[i];
useAllItem["jumlah" + i] = _root["cekJumlahItems" + i];
useAllItem["buy" + i]._visible = true;
useAllItem["sell" + i]._visible = true;
useAllItem["gembok" + i]._visible = false;
useAllItem["select" + i].onRelease = klikUseItems;
i++;
}
i = kiniMisi + 1;
while (i <= 8) {
useAllItem["buy" + i]._visible = false;
useAllItem["sell" + i]._visible = false;
useAllItem["gembok" + i]._visible = true;
useAllItem["cost" + i] = "";
i++;
}
useAllItem.close_btn.onRelease = function () {
removeMovieClip(option_mc);
};
useAllItem.close_btn2.onRelease = function () {
removeMovieClip(option_mc);
};
useAllItem.close_btn3.onRelease = function () {
removeMovieClip(option_mc);
};
useAllItem.close_btn4.onRelease = function () {
removeMovieClip(option_mc);
};
};
useAll.allPower.onRelease = function () {
useAllPower = attachMovie("useAllPower", "option_mc", dalamOption);
useAllPower._x = 400;
useAllPower._y = 300;
useAllPower.msgBox_mc6._visible = false;
cekJumlahPowers();
i = 1;
while (i <= 8) {
useAllPower["foto" + i].gotoAndStop(i);
useAllPower["foto" + i].onRollOver = overFoto2;
useAllPower["foto" + i].onRollOut = outFoto2;
useAllPower["cost" + i] = "COST $" + itemHarga[i];
useAllPower["jumlah" + i] = _root["cekJumlahPowers" + i];
useAllPower["buy" + i]._visible = true;
useAllPower["sell" + i]._visible = true;
useAllPower["gembok" + i]._visible = false;
useAllPower["select" + i].onRelease = klikUsePowers;
i++;
}
i = kiniMisi + 1;
while (i <= 8) {
useAllPower["buy" + i]._visible = false;
useAllPower["sell" + i]._visible = false;
useAllPower["gembok" + i]._visible = true;
useAllPower["cost" + i] = "";
i++;
}
useAllPower.close_btn.onRelease = function () {
removeMovieClip(option_mc);
};
useAllPower.close_btn2.onRelease = function () {
removeMovieClip(option_mc);
};
useAllPower.close_btn3.onRelease = function () {
removeMovieClip(option_mc);
};
useAllPower.close_btn4.onRelease = function () {
removeMovieClip(option_mc);
};
};
useAll.close_btn.onRelease = function () {
removeMovieClip(option_mc);
};
} else if (jumlahCobra <= 0) {
ui.one2.gotoAndPlay(2);
}
};
ui.bantuan_btn.onRelease = function () {
buatBantuan();
};
ui.option_btn.onRelease = function () {
option = attachMovie("option_mc", "option_mc", dalamOption);
option._x = 400;
option._y = 300;
option.abort_btn.onRelease = function () {
option_mc._visible = false;
sudahKalah();
};
option.load_btn.onRelease = function () {
clearSemua();
gotoAndStop (274);
};
option.quit_btn.onRelease = function () {
clearSemua();
gotoAndStop (271);
};
option.close_btn.onRelease = function () {
option_mc._visible = false;
};
};
}
function buatBantuan() {
bantuan = attachMovie("bantuan_mc", "bantuan_mc", dalamBantuan);
bantuan._x = 400;
bantuan._y = 300;
i = 1;
while (i <= 7) {
bantuan["gembok" + i]._visible = true;
i++;
}
if (kiniMisi <= 1) {
maxPasukan = 24;
} else if (kiniMisi <= 2) {
maxPasukan = 27;
} else if (kiniMisi <= 4) {
maxPasukan = 30;
} else if (kiniMisi <= 6) {
maxPasukan = 33;
} else {
maxPasukan = 36;
}
if (kePasukan < maxPasukan) {
i = 1;
while (i <= (kiniMisi - 1)) {
bantuan["foto" + i].gotoAndStop(i);
bantuan["gembok" + i]._visible = false;
bantuan["foto" + i].onRelease = klikBantuan;
i++;
}
}
bantuan.close_btn.onRelease = function () {
removeMovieClip(bantuan_mc);
};
}
function klikBantuan() {
myStr = new String(this);
indiSoldiers = Number(myStr.substr(myStr.length - 1, 1));
ambilSquad = attachMovie("jagoan_mc" + indiSoldiers, "tentara_mc", dalamAmbil);
ambilSquad2 = ambilSquad.attachMovie("jagoan_mc" + indiSoldiers, "tentara_mc2", 1);
ambilSquad3 = ambilSquad.attachMovie("jagoan_mc" + indiSoldiers, "tentara_mc3", 2);
ambilSquad._x = _root._xmouse;
ambilSquad._y = _root._ymouse;
ambilSquad2._x = -35;
ambilSquad2._y = 35;
ambilSquad3._x = -35;
ambilSquad3._y = -35;
ambilSquad._xscale = (ambilSquad._yscale = 60);
ambilSquad.jenis = nomorSquad;
sedangDragSquad = true;
ambilSquad.startDrag(true);
ambilSquad.onRelease = pasangSquad;
removeMovieClip(bantuan_mc);
}
function pasangSquad() {
sentuhan = false;
i = 1000;
while (i <= 1040) {
if (ambilSquad.indi.hitTest(_root["jagoan_mc" + i].indi) && (_root["jagoan_mc" + i]._currentframe != 4)) {
sentuhan = true;
}
i++;
}
if (sentuhan == false) {
if (_root._ymouse <= 500) {
removeMovieClip(tentara_mc);
buatHeli();
}
}
}
function buatHeli() {
sedangDragSquad = false;
ui.bantuan_btn.enabled = false;
ui.bantuan_btn._alpha = 50;
ambilHeli = attachMovie("heli_mc", "heli_mc", dalamHeli);
ambilHeli.posX = _root._xmouse;
ambilHeli.posY = _root._ymouse;
backHeli();
rand = random(4);
if (rand == 0) {
ambilHeli._x = random(800);
ambilHeli._y = -100;
ambilHeli.posXakhir = ambilHeli._x;
ambilHeli.posYakhir = ambilHeli._y + 1000;
} else if (rand == 1) {
ambilHeli._x = random(800);
ambilHeli._y = 700;
ambilHeli.posXakhir = ambilHeli._x;
ambilHeli.posYakhir = ambilHeli._y - 1000;
} else if (rand == 2) {
ambilHeli._x = -100;
ambilHeli._y = random(600);
ambilHeli.posXakhir = ambilHeli._x + 1000;
ambilHeli.posYakhir = ambilHeli._y;
} else if (rand == 3) {
ambilHeli._x = 900;
ambilHeli._y = random(600);
ambilHeli.posXakhir = ambilHeli._x - 1000;
ambilHeli.posYakhir = ambilHeli._y;
}
ambilHeli.aimX = ambilHeli.posX;
ambilHeli.aimY = ambilHeli.posY;
deltaX = ambilHeli._x - ambilHeli.aimX;
deltaY = ambilHeli._y - ambilHeli.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
ambilHeli.rotasiAwal = angle;
ambilHeli.speed = 10;
ambilHeli.onEnterFrame = enterHeli;
dalamHeli++;
if (dalamHeli >= 8600) {
dalamHeli = 8500;
}
}
function enterHeli() {
this.aimX = this.posX;
this.aimY = this.posY;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this._rotation = angle;
if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
} else {
ui.bantuan_btn.enabled = true;
ui.bantuan_btn._alpha = 100;
if (kePasukan < maxPasukan) {
_root["fotoWeapon" + kePasukan] = indiSoldiers;
_root["fotoSquad" + kePasukan] = indiSoldiers;
_root["specialSquad" + kePasukan] = namaWeapon[indiSoldiers];
buatTentaraJagoan(indi, this.posX, this.posY, kePasukan, "ada");
kePasukan++;
}
if (kePasukan < maxPasukan) {
_root["fotoWeapon" + kePasukan] = indiSoldiers;
_root["fotoSquad" + kePasukan] = indiSoldiers;
_root["specialSquad" + kePasukan] = namaWeapon[indiSoldiers];
buatTentaraJagoan(indi, this.posX - 25, this.posY + 25, kePasukan, "ada");
kePasukan++;
}
if (kePasukan < maxPasukan) {
_root["fotoWeapon" + kePasukan] = indiSoldiers;
_root["fotoSquad" + kePasukan] = indiSoldiers;
_root["specialSquad" + kePasukan] = namaWeapon[indiSoldiers];
buatTentaraJagoan(indi, this.posX - 25, this.posY - 25, kePasukan, "ada");
kePasukan++;
}
this.posX = this.posXakhir;
this.posY = this.posYakhir;
delete this.onEnterFrame;
this._rotation = (this.onEnterFrame = enterHeli2);
}
}
function enterHeli2() {
this._y = this._y - (this.speed * Math.cos(this.rotasiAwal * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(this.rotasiAwal * (Math.PI/180)));
if ((((this._x <= -300) && (this._x >= 1100)) && (this._y <= -300)) && (this._y >= 900)) {
removeMovieClip(this);
}
}
function buatCobra() {
cobra = attachMovie("cobra_mc", "cobra_mc", dalamCobra);
cobra._x = 400;
cobra._y = 275;
i = 1;
while (i <= 48) {
cobra["kotak" + i].gotoAndStop(_root["fotoSquad" + i]);
if (cobra["kotak" + i]._currentframe == 20) {
delete cobra["kotak" + i].onRelease;
} else if (_root["adaCobra" + i] == true) {
if (_root["fotoWeapon" + i] == 20) {
cobra["kotak" + i].latar_mc.gotoAndStop(2);
} else if (_root["fotoWeapon" + i] != _root["fotoSquad" + i]) {
cobra["kotak" + i].latar_mc.gotoAndStop(3);
cobra["kotak" + i].onRelease = klikCobraSquad;
cobra["kotak" + i].onRollOver = overCobraSquad3;
cobra["kotak" + i].onRollOut = outCobraSquad3;
} else {
cobra["kotak" + i].latar_mc.gotoAndStop(1);
cobra["kotak" + i].onRelease = klikCobraSquad;
cobra["kotak" + i].onRollOver = overCobraSquad3;
cobra["kotak" + i].onRollOut = outCobraSquad3;
}
} else {
cobra["kotak" + i].gotoAndStop(20);
}
i++;
}
cobra.close_btn.onRelease = function () {
removeMovieClip(cobra_mc);
sedangDragSquad = false;
removeMovieClip(ambilSquad);
};
cobra.onEnterFrame = enterCobra;
cobra.msgBox_mc._visible = false;
}
function overCobraSquad3() {
myStr = new String(this);
if (myStr.length == 23) {
xnomorSquad = Number(myStr.substr(myStr.length - 1, 1));
} else if (myStr.length == 24) {
xnomorSquad = Number(myStr.substr(myStr.length - 2, 2));
}
cobra.msgBox_mc._visible = true;
cobra.msgBox_mc.namaSquad = _root["namaSquad" + xnomorSquad];
cobra.msgBox_mc.nyawaSquad = ("Life " + _root["lifeSquad" + xnomorSquad]) + "/100";
cobra.msgBox_mc.specialSquad = _root["specialSquad" + xnomorSquad] + " Expert";
cobra.msgBox_mc.atributeValue = "Atribute Value " + _root["atributeValue" + xnomorSquad];
if (_root["fotoWeapon" + xnomorSquad] == 20) {
cobra.msgBox_mc.latar_mc.gotoAndStop(2);
cobra.msgBox_mc.weaponKini = "No Weapon";
} else if (_root["fotoWeapon" + xnomorSquad] != _root["fotoSquad" + xnomorSquad]) {
cobra.msgBox_mc.latar_mc.gotoAndStop(3);
cobra.msgBox_mc.weaponKini = "Use " + namaWeapon[_root["fotoWeapon" + xnomorSquad]];
} else {
cobra.msgBox_mc.latar_mc.gotoAndStop(1);
cobra.msgBox_mc.weaponKini = "Use " + namaWeapon[_root["fotoWeapon" + xnomorSquad]];
}
}
function outCobraSquad3() {
cobra.msgBox_mc._visible = false;
}
function enterCobra() {
if (_root._xmouse >= 500) {
this.msgBox_mc._x = _root._xmouse - 600;
this.msgBox_mc._y = _root._ymouse - 250;
} else {
this.msgBox_mc._x = _root._xmouse - 375;
this.msgBox_mc._y = _root._ymouse - 250;
}
}
function klikCobraSquad() {
myStr = new String(this);
if (myStr.length == 23) {
nomorSquad = Number(myStr.substr(myStr.length - 1, 1));
} else if (myStr.length == 24) {
nomorSquad = Number(myStr.substr(myStr.length - 2, 2));
}
buatArea(kiniMisi);
ambilSquad = attachMovie("jagoan_mc" + _root["fotoWeapon" + nomorSquad], "tentara_mc", dalamAmbil);
if (kiniMisi == 3) {
ambilSquad._rotation = 180;
} else {
ambilSquad._rotation = 0;
}
ambilSquad._x = _root._xmouse;
ambilSquad._y = _root._ymouse;
ambilSquad._xscale = (ambilSquad._yscale = 60);
ambilSquad.jenis = nomorSquad;
sedangDragSquad = true;
ambilSquad.startDrag(true);
removeMovieClip(cobra_mc);
}
function buatObyek(indi) {
obyek = attachMovie("obyek" + indi, "obyek_mc", dalamObyek);
obyek._x = 0;
obyek._y = 0;
lantai = attachMovie("lantai" + indi, "lantai_mc", dalamLantai);
lantai._x = 0;
lantai._y = 0;
}
function buatArea(indi) {
area = attachMovie("area" + indi, "area_mc", dalamArea);
area._x = 0;
area._y = 0;
area.indi1.onRelease = klikArea;
area.indi2.onRelease = klikArea;
area.indi3.onRelease = klikArea;
area.indi4.onRelease = klikArea;
area.indi5.onRelease = klikArea;
area.cancel_btn.onRelease = function () {
if (sedangDragSquad2 == true) {
stopDrag();
tentaraDrag._x = tentaraDrag.posAwalX;
tentaraDrag._y = tentaraDrag.posAwalY;
tentaraDrag.onEnterFrame = enterTentara;
tentaraDrag.onRollOver = overCobraSquad;
tentaraDrag.onReleaseOutside = outCobraSquad;
tentaraDrag.onRollOut = outCobraSquad;
tentaraDrag.onRelease = klikCobraSquad2;
}
sedangDragSquad = false;
sedangDragSquad2 = false;
removeMovieClip(ambilSquad);
removeMovieClip(area_mc);
};
}
function klikArea() {
if (sedangDragSquad == true) {
sentuhan = false;
i = 1000;
while (i <= 1040) {
if (ambilSquad.indi.hitTest(_root["jagoan_mc" + i].indi) && (_root["jagoan_mc" + i]._currentframe != 4)) {
sentuhan = true;
}
i++;
}
if (sentuhan == false) {
_root["adaCobra" + nomorSquad] = false;
buatTentaraJagoan(ambilSquad);
sortingPasukan();
removeMovieClip(area_mc);
removeMovieClip(ambilSquad);
sedangDragSquad = false;
buatCobra();
}
} else if (sedangDragSquad2 == true) {
sentuhan = false;
i = 1000;
while (i <= 1040) {
if (tentaraDrag != _root["jagoan_mc" + i]) {
if (tentaraDrag.indi.hitTest(_root["jagoan_mc" + i].indi) && (_root["jagoan_mc" + i]._currentframe != 4)) {
sentuhan = true;
}
}
i++;
}
if (sentuhan == false) {
stopDrag();
sedangDragSquad2 = false;
tentaraDrag.posAwalX = tentaraDrag._x;
tentaraDrag.posAwalY = tentaraDrag._y;
tentaraDrag.onEnterFrame = enterTentara;
tentaraDrag.onRollOver = overCobraSquad;
tentaraDrag.onRollOut = outCobraSquad;
tentaraDrag.onReleaseOutside = outCobraSquad;
tentaraDrag.onRelease = klikCobraSquad2;
removeMovieClip(area_mc);
}
}
}
function buatTentaraJagoan(indi, indi2, indi3, indi4, indi5) {
if (indi4 == undefined) {
jenisTentara = _root["fotoWeapon" + indi.jenis];
} else {
jenisTentara = _root["fotoWeapon" + indi4];
}
if (indi5 != undefined) {
tentara = attachMovie("jagoan_mc" + jenisTentara, "jagoan_mc" + (1000 + indi4), 1000 + indi4);
} else {
adaPasukanKini++;
tentara = attachMovie("jagoan_mc" + jenisTentara, "jagoan_mc" + bykTentara, bykTentara);
}
if (indi2 == undefined) {
tentara._x = indi._x;
tentara._y = indi._y;
} else {
tentara._x = indi2;
tentara._y = indi3;
}
if (kiniMisi == 3) {
tentara._rotation = 180;
} else {
tentara._rotation = 0;
}
tentara._xscale = (tentara._yscale = 60);
if (indi4 == undefined) {
tentara.keTentara = bykTentara;
tentara.urutanTentara = indi.jenis;
tentara.jenisTentara = jenisTentara;
cekAtributeJagoan(indi.jenis, tentara.jenisTentara);
} else {
tentara.keTentara = bykTentara;
tentara.urutanTentara = indi4;
tentara.jenisTentara = jenisTentara;
cekAtributeJagoan(indi4, tentara.jenisTentara);
}
if ((jenisTentara >= 3) && (jenisTentara <= 6)) {
tentara.jenisSenjata = "explosive";
} else {
tentara.jenisSenjata = "burst";
}
tentara.dobelBulet = false;
tentara.lamaDobel = 0;
tentara.crusher = false;
tentara.lamaCrusher = 0;
tentara.imune = false;
tentara.lamaImune = 0;
tentara.overTake = false;
tentara.sharpLook = false;
tentara.lamaLook = 0;
tentara.invisible = false;
tentara.lamaInvis = 0;
tentara.majuKedepan = false;
tentara.mundurKebelakang = false;
tentara.posAwalX = tentara._x;
tentara.posAwalY = tentara._y;
tentara.onEnterFrame = enterTentara;
tentara.onRollOver = overCobraSquad;
tentara.onRollOut = outCobraSquad;
tentara.onReleaseOutside = outCobraSquad;
tentara.onRelease = klikCobraSquad2;
if (indi5 == undefined) {
bykTentara++;
if (bykTentara >= 1050) {
bykTentara = 1000;
}
}
}
function pilihItem1() {
if (pilihSquad.fotoItem1._currentframe == 1) {
_root["foto1Item" + indi] = 20;
indi2.nyawa = indi2.nyawa + (indi2.nyawaMax / 2);
if (indi2.nyawa >= indi2.nyawaMax) {
indi2.nyawa = indi2.nyawaMax;
}
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem1._currentframe == 2) {
_root["foto1Item" + indi] = 20;
indi2.range = indi2.range * 1.25;
indi2.rangeMin = indi2.range;
indi2.rangeMax = indi2.range * 3;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem1._currentframe == 3) {
_root["foto1Item" + indi] = 20;
indi2.defense = indi2.defense * 1.5;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem1._currentframe == 4) {
_root["foto1Item" + indi] = 20;
indi2.damage = indi2.damage * 1.5;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem1._currentframe == 5) {
_root["foto1Item" + indi] = 20;
indi2.nyawa = indi2.nyawaMax;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem1._currentframe == 6) {
_root["foto1Item" + indi] = 20;
indi2.range = indi2.range * 1.5;
indi2.rangeMin = indi2.range;
indi2.rangeMax = indi2.range * 3;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem1._currentframe == 7) {
_root["foto1Item" + indi] = 20;
indi2.defense = indi2.defense * 2.5;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem1._currentframe == 8) {
_root["foto1Item" + indi] = 20;
indi2.damage = indi2.damage * 2.5;
klikCobraSquad2(indi2);
}
}
function pilihItem2() {
if (pilihSquad.fotoItem2._currentframe == 1) {
_root["foto2Item" + indi] = 20;
indi2.nyawa = indi2.nyawa + (indi2.nyawaMax / 2);
if (indi2.nyawa >= indi2.nyawaMax) {
indi2.nyawa = indi2.nyawaMax;
}
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem2._currentframe == 2) {
_root["foto2Item" + indi] = 20;
indi2.range = indi2.range * 1.25;
indi2.rangeMin = indi2.range;
indi2.rangeMax = indi2.range * 3;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem2._currentframe == 3) {
_root["foto2Item" + indi] = 20;
indi2.defense = indi2.defense * 1.5;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem2._currentframe == 4) {
_root["foto2Item" + indi] = 20;
indi2.damage = indi2.damage * 1.5;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem2._currentframe == 5) {
_root["foto2Item" + indi] = 20;
indi2.nyawa = indi2.nyawaMax;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem2._currentframe == 6) {
_root["foto2Item" + indi] = 20;
indi2.range = indi2.range * 1.5;
indi2.rangeMin = indi2.range;
indi2.rangeMax = indi2.range * 3;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem2._currentframe == 7) {
_root["foto2Item" + indi] = 20;
indi2.defense = indi2.defense * 2.5;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem2._currentframe == 8) {
_root["foto2Item" + indi] = 20;
indi2.damage = indi2.damage * 2.5;
klikCobraSquad2(indi2);
}
}
function pilihItem3() {
if (pilihSquad.fotoItem3._currentframe == 1) {
_root["foto3Item" + indi] = 20;
indi2.nyawa = indi2.nyawa + (indi2.nyawaMax / 2);
if (indi2.nyawa >= indi2.nyawaMax) {
indi2.nyawa = indi2.nyawaMax;
}
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem3._currentframe == 2) {
_root["foto3Item" + indi] = 20;
indi2.range = indi2.range * 1.25;
indi2.rangeMin = indi2.range;
indi2.rangeMax = indi2.range * 3;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem3._currentframe == 3) {
_root["foto3Item" + indi] = 20;
indi2.defense = indi2.defense * 1.5;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem3._currentframe == 4) {
_root["foto3Item" + indi] = 20;
indi2.damage = indi2.damage * 1.5;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem3._currentframe == 5) {
_root["foto3Item" + indi] = 20;
indi2.nyawa = indi2.nyawaMax;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem3._currentframe == 6) {
_root["foto3Item" + indi] = 20;
indi2.range = indi2.range * 1.5;
indi2.rangeMin = tentara.range;
indi2.rangeMax = tentara.range * 3;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem3._currentframe == 7) {
_root["foto3Item" + indi] = 20;
indi2.defense = indi2.defense * 2.5;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoItem3._currentframe == 8) {
_root["foto3Item" + indi] = 20;
indi2.damage = indi2.damage * 2.5;
klikCobraSquad2(indi2);
}
}
function pilihPower1() {
if (pilihSquad.fotoPower1._currentframe == 1) {
_root["foto1Power" + indi] = 20;
indi2.dobelBulet = true;
klikCobraSquad2(indi2);
indi2.lamaDobel = 0;
} else if (pilihSquad.fotoPower1._currentframe == 2) {
_root["foto1Power" + indi] = 20;
indi2.crusher = true;
if (misiKini9 == false) {
indi2.defense = indi2.defense * 3;
}
klikCobraSquad2(indi2);
indi2.lamaCrusher = 0;
} else if (pilihSquad.fotoPower1._currentframe == 3) {
_root["foto1Power" + indi] = 20;
indi2.overTake = true;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoPower1._currentframe == 4) {
_root["foto1Power" + indi] = 20;
indi2.imune = true;
klikCobraSquad2(indi2);
indi2.lamaImune = 0;
} else if (pilihSquad.fotoPower1._currentframe == 5) {
_root["foto1Power" + indi] = 20;
indi2.sharpLook = true;
klikCobraSquad2(indi2);
indi2.lamaLook = 0;
} else if (pilihSquad.fotoPower1._currentframe == 6) {
_root["foto1Power" + indi] = 20;
indi2.invisible = true;
klikCobraSquad2(indi2);
indi2.lamaInvis = 0;
} else if (pilihSquad.fotoPower1._currentframe == 7) {
_root["foto1Power" + indi] = 20;
moneyPlus = true;
klikCobraSquad2(indi2);
lamaMoneyPlus = 0;
}
}
function pilihPower2() {
if (pilihSquad.fotoPower2._currentframe == 1) {
_root["foto2Power" + indi] = 20;
indi2.dobelBulet = true;
klikCobraSquad2(indi2);
indi2.lamaDobel = 0;
} else if (pilihSquad.fotoPower2._currentframe == 2) {
_root["foto2Power" + indi] = 20;
indi2.crusher = true;
if (misiKini9 == false) {
indi2.defense = indi2.defense * 3;
}
klikCobraSquad2(indi2);
indi2.lamaCrusher = 0;
} else if (pilihSquad.fotoPower2._currentframe == 3) {
_root["foto2Power" + indi] = 20;
indi2.overTake = true;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoPower2._currentframe == 4) {
_root["foto2Power" + indi] = 20;
indi2.imune = true;
klikCobraSquad2(indi2);
indi2.lamaImune = 0;
} else if (pilihSquad.fotoPower2._currentframe == 5) {
_root["foto2Power" + indi] = 20;
indi2.sharpLook = true;
klikCobraSquad2(indi2);
indi2.lamaLook = 0;
} else if (pilihSquad.fotoPower2._currentframe == 6) {
_root["foto2Power" + indi] = 20;
indi2.invisible = true;
klikCobraSquad2(indi2);
indi2.lamaInvis = 0;
} else if (pilihSquad.fotoPower2._currentframe == 7) {
_root["foto2Power" + indi] = 20;
moneyPlus = true;
klikCobraSquad2(indi2);
lamaMoneyPlus = 0;
}
}
function pilihPower3() {
if (pilihSquad.fotoPower3._currentframe == 1) {
_root["foto3Power" + indi] = 20;
indi2.dobelBulet = true;
klikCobraSquad2(indi2);
indi2.lamaDobel = 0;
} else if (pilihSquad.fotoPower3._currentframe == 2) {
_root["foto3Power" + indi] = 20;
indi2.crusher = true;
if (misiKini9 == false) {
indi2.defense = indi2.defense * 3;
}
klikCobraSquad2(indi2);
indi2.lamaCrusher = 0;
} else if (pilihSquad.fotoPower3._currentframe == 3) {
_root["foto3Power" + indi] = 20;
indi2.overTake = true;
klikCobraSquad2(indi2);
} else if (pilihSquad.fotoPower3._currentframe == 4) {
_root["foto3Power" + indi] = 20;
indi2.imune = true;
klikCobraSquad2(indi2);
indi2.lamaImune = 0;
} else if (pilihSquad.fotoPower3._currentframe == 5) {
_root["foto3Power" + indi] = 20;
indi2.sharpLook = true;
klikCobraSquad2(indi2);
indi2.lamaLook = 0;
} else if (pilihSquad.fotoPower3._currentframe == 6) {
_root["foto3Power" + indi] = 20;
indi2.invisible = true;
klikCobraSquad2(indi2);
indi2.lamaInvis = 0;
} else if (pilihSquad.fotoPower3._currentframe == 7) {
_root["foto3Power" + indi] = 20;
moneyPlus = true;
klikCobraSquad2(indi2);
lamaMoneyPlus = 0;
}
}
function klikCobraSquad2(indix) {
if (sedangDragSquad == false) {
range._visible = false;
sedangDragSquad2 = false;
pilihSquad = attachMovie("pilihSquad_mc", "pilihSquad", dalamPilihSquad);
pilihSquad._x = 400;
pilihSquad._y = 300;
if (indix != undefined) {
indi = indix.urutanTentara;
indi2 = indix;
} else {
indi = this.urutanTentara;
indi2 = this;
}
tentaraDrag = indi2;
pilihSquad.namaSquad = _root["namaSquad" + indi];
pilihSquad.specialSquad = _root["specialSquad" + indi];
if (indi >= 21) {
pilihSquad.nomorSquad = "";
} else {
pilihSquad.nomorSquad = "CS " + _root["nomorSquad" + indi];
}
pilihSquad.fotoSquad.gotoAndStop(_root["fotoSquad" + indi]);
pilihSquad.fotoWeapon.gotoAndStop(_root["fotoWeapon" + indi]);
pilihSquad.fotoItem1.gotoAndStop(_root["foto1Item" + indi]);
pilihSquad.fotoItem2.gotoAndStop(_root["foto2Item" + indi]);
pilihSquad.fotoItem3.gotoAndStop(_root["foto3Item" + indi]);
pilihSquad.fotoPower1.gotoAndStop(_root["foto1Power" + indi]);
pilihSquad.fotoPower2.gotoAndStop(_root["foto2Power" + indi]);
pilihSquad.fotoPower3.gotoAndStop(_root["foto3Power" + indi]);
kaliTentara = new Array("", 5, 6.5, 4, 3.5, 3.5, 3, 3);
if (indix != undefined) {
pembagiLife = kaliTentara[indix.jenisTentara];
pilihSquad.lifeSquad.bar_mc._xscale = Math.ceil(indix.nyawa / pembagiLife);
} else {
pembagiLife = kaliTentara[this.jenisTentara];
pilihSquad.lifeSquad.bar_mc._xscale = Math.ceil(this.nyawa / pembagiLife);
}
pilihSquad.strengthSquad.bar_mc._xscale = _root["strengthSquad" + indi];
pilihSquad.agilitySquad.bar_mc._xscale = _root["agilitySquad" + indi];
if (_root["fotoWeapon" + indi] == _root["fotoSquad" + indi]) {
pilihSquad.skillSquad.bar_mc._xscale = _root["skillSquad" + indi];
} else {
pilihSquad.skillSquad.bar_mc._xscale = _root["skillSquad" + indi] * 0.5;
}
pilihSquad.visionSquad.bar_mc._xscale = _root["visionSquad" + indi];
pilihSquad.moraleSquad.bar_mc._xscale = _root["moraleSquad" + indi];
if (bisaMove == true) {
pilihSquad.reposition_btn._visible = true;
} else {
pilihSquad.reposition_btn._visible = false;
}
pilihSquad.reposition_btn.onRelease = function () {
sedangDragSquad2 = true;
startDrag (tentaraDrag, true);
delete tentaraDrag.onEnterFrame;
delete tentaraDrag.onRelease;
delete tentaraDrag.onRollOver;
delete tentaraDrag.onRollOut;
buatArea(kiniMisi);
removeMovieClip(pilihSquad);
};
pilihSquad.useall1.onRelease = function () {
pilihItem1();
pilihItem2();
pilihItem3();
};
pilihSquad.useall2.onRelease = function () {
pilihPower1();
pilihPower2();
pilihPower3();
};
pilihSquad.itemUse1.onRelease = function () {
pilihItem1();
};
pilihSquad.itemUse2.onRelease = function () {
pilihItem2();
};
pilihSquad.itemUse3.onRelease = function () {
pilihItem3();
};
pilihSquad.powerUse1.onRelease = function () {
pilihPower1();
};
pilihSquad.powerUse2.onRelease = function () {
pilihPower2();
};
pilihSquad.powerUse3.onRelease = function () {
pilihPower3();
};
if (indi >= 21) {
pilihSquad.prev_btn._visible = false;
pilihSquad.next_btn._visible = false;
} else {
pilihSquad.prev_btn._visible = true;
pilihSquad.next_btn._visible = true;
}
pilihSquad.prev_btn.onRelease = function () {
pilhanAnda = undefined;
i = indi2.keTentara - 1;
while (i >= 1) {
if ((_root["jagoan_mc" + i].nyawa > 0) && (_root["jagoan_mc" + i].nyawa != undefined)) {
pilhanAnda = i;
i = 1;
}
i--;
}
if (pilhanAnda != undefined) {
klikCobraSquad2(_root["jagoan_mc" + pilhanAnda]);
}
};
pilihSquad.next_btn.onRelease = function () {
pilhanAnda = undefined;
i = indi2.keTentara + 1;
while (i <= 1020) {
if ((_root["jagoan_mc" + i].nyawa > 0) && (_root["jagoan_mc" + i].nyawa != undefined)) {
pilhanAnda = i;
i = 1020;
}
i++;
}
if (pilhanAnda != undefined) {
klikCobraSquad2(_root["jagoan_mc" + pilhanAnda]);
}
};
pilihSquad.close_btn.onRelease = function () {
removeMovieClip(pilihSquad);
};
pilihSquad.close_btn2.onRelease = function () {
removeMovieClip(pilihSquad);
};
pilihSquad.close_btn3.onRelease = function () {
removeMovieClip(pilihSquad);
};
pilihSquad.close_btn4.onRelease = function () {
removeMovieClip(pilihSquad);
};
}
}
function sortingPasukan() {
masukPosX = new Array();
masukPosY = new Array();
masukPos = 0;
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].nyawa > 0) {
masukPosY[masukPos] = _root["jagoan_mc" + i]._y;
masukPos++;
}
i++;
}
masukPosY.sort();
depthAwal = 1000;
i = 0;
while (i <= masukPosY.length) {
j = 1000;
while (j <= 1040) {
if (_root["jagoan_mc" + j].nyawa > 0) {
if (_root["jagoan_mc" + j]._y == masukPosY[i]) {
_root["jagoan_mc" + j].swapDepths(depthAwal);
depthAwal++;
j = 1050;
}
}
j++;
}
i++;
}
}
function enterBarNyawa() {
this._x = _root._xmouse - 25;
this._y = _root._ymouse - 25;
if (this.xtarget.nyawa > 0) {
this.bar_mc._xscale = (this.xtarget.nyawa / this.xtarget.nyawaMax) * 100;
} else {
barNyawa._visible = false;
}
}
function overCobraSquad() {
range._width = this.range * 2;
range._height = this.range * 2;
range._visible = true;
range._x = this._x;
range._y = this._y;
if (this.nyawa > 0) {
barNyawa._visible = true;
barNyawa.xtarget = this;
} else {
barNyawa._visible = false;
}
}
function outCobraSquad() {
range._visible = false;
barNyawa._visible = false;
}
function cekAtributeJagoan(indi, indi2) {
kaliTentara = new Array("", 5, 6.5, 4, 3.5, 3.5, 3, 3);
if (_root["fotoWeapon" + indi] == _root["fotoSquad" + indi]) {
kurangSkill = 1;
} else {
kurangSkill = 0.5;
}
if (indi2 == 1) {
tentara.nyawa = _root["lifeSquad" + indi] * kaliTentara[indi2];
tentara.defense = _root["strengthSquad" + indi];
tentara.agility = _root["agilitySquad" + indi] * 1.5;
tentara.damage = (_root["skillSquad" + indi] * 1.25) * kurangSkill;
tentara.range = _root["visionSquad" + indi] * 3;
tentara.morale = _root["moraleSquad" + indi];
tentara.speed = 4;
} else if (indi2 == 2) {
tentara.nyawa = _root["lifeSquad" + indi] * kaliTentara[indi2];
tentara.defense = _root["strengthSquad" + indi];
tentara.agility = _root["agilitySquad" + indi];
tentara.damage = _root["skillSquad" + indi] * kurangSkill;
tentara.range = _root["visionSquad" + indi] * 2.75;
tentara.morale = _root["moraleSquad" + indi];
tentara.speed = 3.5;
} else if (indi2 == 3) {
tentara.nyawa = _root["lifeSquad" + indi] * kaliTentara[indi2];
tentara.defense = _root["strengthSquad" + indi];
tentara.agility = _root["agilitySquad" + indi];
tentara.damage = (_root["skillSquad" + indi] * 3) * kurangSkill;
tentara.range = _root["visionSquad" + indi] * 5;
tentara.morale = _root["moraleSquad" + indi];
tentara.speed = 3.5;
} else if (indi2 == 4) {
tentara.nyawa = _root["lifeSquad" + indi] * kaliTentara[indi2];
tentara.defense = _root["strengthSquad" + indi];
tentara.agility = _root["agilitySquad" + indi];
tentara.damage = (_root["skillSquad" + indi] * 3.5) * kurangSkill;
tentara.range = _root["visionSquad" + indi] * 3;
tentara.morale = _root["moraleSquad" + indi];
tentara.speed = 3;
} else if (indi2 == 5) {
tentara.nyawa = _root["lifeSquad" + indi] * kaliTentara[indi2];
tentara.defense = _root["strengthSquad" + indi];
tentara.agility = _root["agilitySquad" + indi];
tentara.damage = (_root["skillSquad" + indi] * 4) * kurangSkill;
tentara.range = _root["visionSquad" + indi] * 4;
tentara.morale = _root["moraleSquad" + indi];
tentara.speed = 3;
} else if (indi2 == 6) {
tentara.nyawa = _root["lifeSquad" + indi] * kaliTentara[indi2];
tentara.defense = _root["strengthSquad" + indi];
tentara.agility = _root["agilitySquad" + indi];
tentara.damage = (_root["skillSquad" + indi] * 5) * kurangSkill;
tentara.range = _root["visionSquad" + indi] * 4;
tentara.morale = _root["moraleSquad" + indi];
tentara.speed = 2.5;
} else if (indi2 == 7) {
tentara.nyawa = _root["lifeSquad" + indi] * kaliTentara[indi2];
tentara.defense = _root["strengthSquad" + indi];
tentara.agility = _root["agilitySquad" + indi];
tentara.damage = (_root["skillSquad" + indi] * 3.5) * kurangSkill;
tentara.range = _root["visionSquad" + indi] * 4.5;
tentara.morale = _root["moraleSquad" + indi];
tentara.speed = 3.5;
}
naikMorale = _root["moraleSquad" + indi] / 50;
tentara.defense = tentara.defense * naikMorale;
tentara.agility = tentara.agility * naikMorale;
tentara.damage = tentara.damage * naikMorale;
tentara.range = tentara.range * 0.75;
tentara.rangeMin = tentara.range;
tentara.rangeMax = tentara.range * 2;
tentara.nyawaMax = 100 * kaliTentara[indi2];
}
function enterTentara() {
if (this.nyawa <= 0) {
if (this._currentframe != 4) {
memberKilled++;
if (memberKilled >= 10) {
achievementsDapat34 = 1;
}
if (memberKilled >= 30) {
achievementsDapat35 = 1;
}
if (memberKilled >= 50) {
achievementsDapat36 = 1;
}
if (memberKilled >= 70) {
achievementsDapat37 = 1;
}
if (memberKilled >= 90) {
achievementsDapat38 = 1;
}
achievementsDapat2 = 1;
backMati();
if (this.urutanTentara <= 20) {
maximumCost = ((this.defense + this.agility) + this.damage) + this.range;
hargaSoldier = Math.ceil((maximumCost * (2 + this.jenisTentara)) / 2);
if (hargaSoldier != undefined) {
money = money + hargaSoldier;
}
adaPasukanKini--;
if (adaPasukanKini <= 0) {
sudahKalah();
}
}
this.gotoAndStop(4);
delete this.onEnterFrame;
delete this.onRollOver;
delete this.onRollOut;
if (this.urutanTentara >= 21) {
removeMovieClip(this);
}
}
} else {
this.adaSerang = false;
if (this.imune == true) {
if (kiniMisi >= 8) {
if (this.lamaImune >= 2000) {
this.lamaImune = 0;
this.imune = false;
} else if (bisaMove == false) {
this.lamaImune++;
}
} else if (this.lamaImune >= 500) {
this.lamaImune = 0;
this.imune = false;
} else if (bisaMove == false) {
this.lamaImune++;
}
}
if (this.invisible == true) {
if (kiniMisi >= 8) {
if (this.lamaInvis >= 2000) {
this.lamaInvis = 0;
this.invisible = false;
} else if (bisaMove == false) {
this.lamaInvis++;
}
this._alpha = 50;
} else {
if (this.lamaInvis >= 500) {
this.lamaInvis = 0;
this.invisible = false;
} else if (bisaMove == false) {
this.lamaInvis++;
}
this._alpha = 50;
}
} else {
this._alpha = 100;
}
if (this.sharpLook == true) {
if (kiniMisi >= 8) {
if (this.lamaLook >= 4000) {
this.lamaLook = 0;
this.sharpLook = false;
} else if (bisaMove == false) {
this.lamaLook++;
}
this.range = this.rangeMax;
} else {
if (this.lamaLook >= 1000) {
this.lamaLook = 0;
this.sharpLook = false;
} else if (bisaMove == false) {
this.lamaLook++;
}
this.range = this.rangeMax;
}
} else {
this.range = this.rangeMin;
}
if (this.crusher == true) {
if (bisaMove == false) {
if (this.lamaCrusher >= 2000) {
this.lamaCrusher = 0;
this.crusher = false;
} else if (bisaMove == false) {
this.lamaCrusher++;
}
this.adaSerang = true;
this.gotoAndStop(3);
this._rotation = this._rotation + 2;
}
} else {
if (this.overTake == true) {
this.majuKedepan = true;
if (this.xtarget.nyawa == undefined) {
i = 2000;
while (i <= 2055) {
if (_root["musuh_mc" + i].nyawa > 0) {
this.adaSerang = true;
this.arahDepan = this.xtarget;
i = 2100;
}
i++;
}
}
}
if (this.xtarget.nyawa == undefined) {
if ((this.majuKedepan == true) && (this.arahDepan != undefined)) {
this.aimX = this.arahDepan._x;
this.aimY = this.arahDepan._y;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this._rotation = angle;
if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
}
if ((this.arahDepan.nyawa == undefined) || (this.arahDepan.nyawa <= 0)) {
this.majuKedepan = false;
this.mundurKebelakang = true;
}
}
if (this.mundurKebelakang == true) {
this.aimX = this.posAwalX;
this.aimY = this.posAwalY;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this._rotation = angle;
if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
} else {
this._rotation = this._rotation + 180;
this.mundurKebelakang = false;
}
} else {
i = 2000;
while (i <= 2055) {
this.jarak = Math.sqrt(Math.pow(this._x - _root["musuh_mc" + i]._x, 2) + Math.pow(this._y - _root["musuh_mc" + i]._y, 2));
if (_root["musuh_mc" + i].nyawa > 0) {
if (this.jarak <= this.range) {
this.adaSerang = true;
this.gotoAndStop(3);
this.xtarget = _root["musuh_mc" + i];
this.aimX = _root["musuh_mc" + i]._x;
this.aimY = _root["musuh_mc" + i]._y;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this._rotation = angle;
i = 2100;
}
}
i++;
}
}
} else if (this.mundurKebelakang == true) {
this.aimX = this.posAwalX;
this.aimY = this.posAwalY;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this._rotation = angle;
if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
} else {
this._rotation = this._rotation + 180;
this.mundurKebelakang = false;
}
} else {
this.adaSerang = true;
this.gotoAndStop(3);
this.aimX = this.xtarget._x;
this.aimY = this.xtarget._y;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this._rotation = angle;
}
}
if (this.jenisSenjata != "explosive") {
if (this.adaSerang == false) {
this.gotoAndStop(1);
}
}
}
if (sudahSelesai == true) {
this.gotoAndStop(1);
delete this.onEnterFrame;
}
}
function seranganJagoan(indi) {
if (indi.dobelBulet == true) {
if (indi.lamaDobel >= 100) {
indi.lamaDobel = 0;
indi.dobelBulet = false;
} else {
indi.lamaDobel++;
}
if (indi.jenisTentara == 7) {
cekGunBiru(indi, "jagoan", 1.5);
} else {
cekGunPutih(indi, 1.5);
}
berkurangNyawa = indi.damage - indi.xtarget.defense;
if (berkurangNyawa <= 2) {
berkurangNyawa = 2;
}
if (berkurangNyawa == undefined) {
berkurangNyawa = 0;
}
randKena = random(indi.xtarget.agility);
if (randKena <= 40) {
if (indi.xtarget.antiTank == true) {
indi.xtarget.nyawa = indi.xtarget.nyawa - (berkurangNyawa * 0.01);
} else {
indi.xtarget.nyawa = indi.xtarget.nyawa - berkurangNyawa;
}
}
cekDarah(indi.xtarget);
if (indi.jenisTentara == 7) {
cekGunBiru(indi, "jagoan", 1.5);
} else {
cekGunPutih(indi, -1.5);
}
berkurangNyawa = indi.damage - indi.xtarget.defense;
if (berkurangNyawa <= 2) {
berkurangNyawa = 2;
}
if (berkurangNyawa == undefined) {
berkurangNyawa = 0;
}
randKena = random(indi.xtarget.agility);
if (randKena <= 40) {
if (indi.xtarget.antiTank == true) {
indi.xtarget.nyawa = indi.xtarget.nyawa - (berkurangNyawa * 0.01);
} else {
indi.xtarget.nyawa = indi.xtarget.nyawa - berkurangNyawa;
}
}
cekDarah(indi.xtarget);
} else {
if (indi.jenisTentara == 7) {
cekGunBiru(indi, "jagoan");
} else {
cekGunPutih(indi);
}
berkurangNyawa = indi.damage - indi.xtarget.defense;
if (berkurangNyawa <= 2) {
berkurangNyawa = 2;
}
if (berkurangNyawa == undefined) {
berkurangNyawa = 0;
}
randKena = random(indi.xtarget.agility);
if (randKena <= 40) {
if (indi.xtarget.antiTank == true) {
indi.xtarget.nyawa = indi.xtarget.nyawa - (berkurangNyawa * 0.01);
} else {
indi.xtarget.nyawa = indi.xtarget.nyawa - berkurangNyawa;
}
}
cekDarah(indi.xtarget);
}
}
function cekGunBiru(indi, indi2, indi3) {
if (indi.crusher == true) {
xjarak = indi.range;
} else {
xjarak = Math.sqrt(Math.pow(indi._x - indi.xtarget._x, 2) + Math.pow(indi._y - indi.xtarget._y, 2));
}
gunBiru = attachMovie("peluruLaser", "peluruGun" + dalamPeluru, dalamPeluru);
gunBiru._x = indi._x;
gunBiru._y = indi._y;
gunBiru._height = xjarak * 1.25;
if (indi3 != undefined) {
gunBiru._rotation = indi._rotation - indi3;
} else {
gunBiru._rotation = indi._rotation;
}
gunBiru.indi = indi;
gunBiru.indi2 = indi2;
gunBiru.onEnterFrame = enterGunBiru;
dalamPeluru++;
if (dalamPeluru >= 3500) {
dalamPeluru = 3000;
}
}
function enterGunBiru() {
if (this.indi2 == "jagoan") {
i = 2000;
while (i <= 2055) {
if (this.hitTest(_root["musuh_mc" + i])) {
berkurangNyawa = this.indi.damage - _root["musuh_mc" + i].defense;
if (berkurangNyawa <= 2) {
berkurangNyawa = 2;
}
if (berkurangNyawa == undefined) {
berkurangNyawa = 0;
}
randKena = random(_root["musuh_mc" + i].agility);
if (randKena <= 40) {
if (_root["musuh_mc" + i].antiTank == true) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (berkurangNyawa * 0.01);
} else {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - berkurangNyawa;
}
}
cekDarah(_root["musuh_mc" + i]);
}
i++;
}
} else if (this.indi2 == "musuh") {
i = 1000;
while (i <= 1050) {
if (this.hitTest(_root["jagoan_mc" + i])) {
berkurangNyawa = this.indi.damage - _root["jagoan_mc" + i].defense;
if (berkurangNyawa <= 2) {
berkurangNyawa = 2;
}
if (berkurangNyawa == undefined) {
berkurangNyawa = 0;
}
randKena = random(_root["jagoan_mc" + i].agility);
if (randKena <= 40) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - berkurangNyawa;
}
cekDarah(_root["jagoan_mc" + i]);
}
i++;
}
}
}
function cekGunPutih(indi, indi2) {
if (indi.crusher == true) {
xjarak = indi.range;
} else {
xjarak = Math.sqrt(Math.pow(indi._x - indi.xtarget._x, 2) + Math.pow(indi._y - indi.xtarget._y, 2));
}
gunPutih = attachMovie("peluruGun", "peluruGun" + dalamPeluru, dalamPeluru);
gunPutih._x = indi._x;
gunPutih._y = indi._y;
if (indi.crusher == true) {
gunPutih._height = xjarak;
} else {
gunPutih._height = xjarak - 25;
}
if (indi2 != undefined) {
gunPutih._rotation = indi._rotation - indi2;
} else {
gunPutih._rotation = indi._rotation;
}
if (indi.crusher == true) {
gunPutih.indi = indi;
gunPutih.onEnterFrame = enterGunPutih;
}
dalamPeluru++;
if (dalamPeluru >= 3500) {
dalamPeluru = 3000;
}
}
function enterGunPutih() {
i = 2000;
while (i <= 2055) {
if (this.hitTest(_root["musuh_mc" + i])) {
berkurangNyawa = (this.indi.damage * 2) - _root["musuh_mc" + i].defense;
if (berkurangNyawa <= 2) {
berkurangNyawa = 2;
}
if (berkurangNyawa == undefined) {
berkurangNyawa = 0;
}
randKena = random(_root["musuh_mc" + i].agility);
if (randKena <= 40) {
if (_root["musuh_mc" + i].antiTank == true) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (berkurangNyawa * 0.01);
} else {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - berkurangNyawa;
}
}
cekDarah(_root["musuh_mc" + i]);
}
i++;
}
}
function cekDarah(indi) {
darah = attachMovie("darah_mc", "darah_mc" + dalamDarah, dalamDarah);
darah._x = (indi._x - random(50)) + 25;
darah._y = (indi._y - random(50)) + 25;
darah._xscale = (darah._yscale = random(150) + 50);
darah._rotation = random(360);
dalamDarah++;
if (dalamDarah >= 200) {
dalamDarah = 100;
}
}
function seranganLedakMusuh(indi, indi2) {
if (indi2 != undefined) {
gunLedak = attachMovie("peluruExplode2", "peluruExplode" + dalamPeluru, dalamPeluru);
} else {
gunLedak = attachMovie("peluruExplode", "peluruExplode" + dalamPeluru, dalamPeluru);
}
gunLedak._x = indi._x;
gunLedak._y = indi._y;
gunLedak.xtarget = indi.xtarget;
gunLedak.indi = indi;
gunLedak._xscale = (gunLedak._yscale = 60);
gunLedak._rotation = indi.moncong._rotation;
if (indi.jenisTentara == 10) {
gunLedak.adaAsap = true;
gunLedak.asap = 0;
gunLedak.gotoAndStop(2);
gunLedak.speed = 1;
gunLedak.speedPlus = 0.2;
} else {
gunLedak.adaAsap = false;
gunLedak.gotoAndStop(1);
gunLedak.speed = 30;
gunLedak.speedPlus = 5;
}
gunLedak.posX = indi.xtarget._x;
gunLedak.posY = indi.xtarget._y;
gunLedak.onEnterFrame = enterGunLedak2;
dalamPeluru++;
if (dalamPeluru >= 3500) {
dalamPeluru = 3000;
}
}
function enterGunLedak2() {
this.aimX = this.posX;
this.aimY = this.posY;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
if (this.adaAsap == true) {
if (this.asap >= 5) {
this.asap = 0;
cekAsap(this);
} else {
this.asap++;
}
}
this.speed = this.speed + this.speedPlus;
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
} else {
adaLedakan2(this, this.indi);
removeMovieClip(this);
}
}
function adaLedakan2(indi, indi2) {
ledakan = attachMovie("ledakan1", "ledakan_mc" + dalamLedakan, dalamLedakan);
ledakan._x = indi._x;
ledakan._y = indi._y;
ledakan._xscale = (ledakan._yscale = 100);
ledakan.indi = indi2;
ledakan.onEnterFrame = enterLedakanMusuh;
dalamLedakan++;
if (dalamLedakan >= 5500) {
dalamLedakan = 5000;
}
}
function enterLedakanMusuh() {
if ((this._currentframe >= 5) && (this._currentframe <= 7)) {
i = 1000;
while (i <= 1040) {
if (this.hitTest(_root["jagoan_mc" + i])) {
berkurangNyawa = this.indi.damage - _root["jagoan_mc" + i].defense;
if (berkurangNyawa <= 2) {
berkurangNyawa = 2;
}
if (berkurangNyawa == undefined) {
berkurangNyawa = 0;
}
if (_root["jagoan_mc" + i].imune == false) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - berkurangNyawa;
cekDarah(_root["jagoan_mc" + i]);
}
if (_root["jagoan_mc" + i].nyawa <= 0) {
if (_root["jagoan_mc" + i]._visible == true) {
cekBadanHancur2(_root["jagoan_mc" + i]);
_root["jagoan_mc" + i]._visible = false;
}
}
}
i++;
}
}
}
function cekBadanHancur2(indi) {
j = 1;
while (j <= 6) {
randx = random(2);
if (randx == 0) {
badanHancur = attachMovie(("badan" + j) + "x", "darah_mc" + dalamDarah, dalamDarah);
badanHancur._x = indi._x;
badanHancur._y = indi._y;
badanHancur._xscale = (badanHancur._yscale = 20 + random(10));
badanHancur.speed = 7 + random(7);
badanHancur._rotation = random(360);
badanHancur.onEnterFrame = enterBadanHancur;
dalamDarah++;
if (dalamDarah >= 500) {
dalamDarah = 100;
}
}
j++;
}
}
function seranganLedakJagoan(indi) {
if (indi.dobelBulet == true) {
if (indi.lamaDobel >= 50) {
indi.lamaDobel = 0;
indi.dobelBulet = false;
} else {
indi.lamaDobel++;
}
bykPeluru = 2;
} else {
bykPeluru = 1;
}
i = 1;
while (i <= bykPeluru) {
gunLedak = attachMovie("peluruExplode", "peluruExplode" + dalamPeluru, dalamPeluru);
gunLedak._x = indi._x;
gunLedak._y = indi._y;
gunLedak.xtarget = indi.xtarget;
gunLedak.indi = indi;
gunLedak._xscale = (gunLedak._yscale = 60);
if (bykPeluru == 1) {
gunLedak._rotation = indi._rotation;
} else if (bykPeluru == 2) {
if (i == 1) {
gunLedak._rotation = indi._rotation - 5;
} else {
gunLedak._rotation = indi._rotation + 5;
}
}
if (indi.jenisTentara == 6) {
gunLedak.adaAsap = true;
gunLedak.asap = 0;
gunLedak.gotoAndStop(2);
gunLedak.speed = 1;
gunLedak.speedPlus = 0.2;
} else {
gunLedak.adaAsap = false;
gunLedak.gotoAndStop(1);
gunLedak.speed = 30;
gunLedak.speedPlus = 5;
}
gunLedak.posX = indi.xtarget._x;
gunLedak.posY = indi.xtarget._y;
gunLedak.onEnterFrame = enterGunLedak;
dalamPeluru++;
if (dalamPeluru >= 3500) {
dalamPeluru = 3000;
}
i++;
}
}
function enterGunLedak() {
this.aimX = this.posX;
this.aimY = this.posY;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
if (this.adaAsap == true) {
if (this.asap >= 5) {
this.asap = 0;
cekAsap(this);
} else {
this.asap++;
}
}
this.speed = this.speed + this.speedPlus;
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
} else {
adaLedakan(this, this.indi);
removeMovieClip(this);
}
}
function cekAsap(indi) {
asap = attachMovie("efekAsap", "efekAsap" + dalamPeluru, dalamPeluru);
asap._x = indi._x;
asap._y = indi._y;
dalamPeluru++;
if (dalamPeluru >= 3500) {
dalamPeluru = 3000;
}
}
function adaLedakan(indi, indi2) {
ledakan = attachMovie("ledakan1", "ledakan_mc" + dalamLedakan, dalamLedakan);
ledakan._x = indi._x;
ledakan._y = indi._y;
ledakan._xscale = (ledakan._yscale = 100);
ledakan.indi = indi2;
ledakan.onEnterFrame = enterLedakanJagoan;
dalamLedakan++;
if (dalamLedakan >= 5500) {
dalamLedakan = 5000;
}
}
function enterLedakanJagoan() {
if ((this._currentframe >= 5) && (this._currentframe <= 7)) {
i = 2000;
while (i <= 2055) {
if (this.hitTest(_root["musuh_mc" + i])) {
berkurangNyawa = this.indi.damage - _root["musuh_mc" + i].defense;
if (berkurangNyawa <= 2) {
berkurangNyawa = 2;
}
if (berkurangNyawa == undefined) {
berkurangNyawa = 0;
}
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - berkurangNyawa;
cekDarah(_root["musuh_mc" + i]);
if (_root["musuh_mc" + i].nyawa <= 0) {
if (_root["musuh_mc" + i]._visible == true) {
cekBadanHancur(_root["musuh_mc" + i]);
_root["musuh_mc" + i]._visible = false;
}
}
}
i++;
}
}
}
function cekBadanHancur(indi) {
j = 1;
while (j <= 6) {
randx = random(2);
if (randx == 0) {
badanHancur = attachMovie("badan" + j, "darah_mc" + dalamDarah, dalamDarah);
badanHancur._x = indi._x;
badanHancur._y = indi._y;
badanHancur._xscale = (badanHancur._yscale = 20 + random(10));
badanHancur.speed = 7 + random(7);
badanHancur._rotation = random(360);
badanHancur.onEnterFrame = enterBadanHancur;
dalamDarah++;
if (dalamDarah >= 500) {
dalamDarah = 100;
}
}
j++;
}
}
function enterBadanHancur() {
this._y = this._y - (this.speed * Math.cos(this._rotation * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(this._rotation * (Math.PI/180)));
this._rotation++;
this.speed = this.speed - 0.5;
if (this.speed <= 0) {
cekDarah(this);
delete this.onEnterFrame;
}
}
function buatTentaraMusuh() {
if (keluarMusuh > 0) {
keluarMusuh--;
i = random(10) + 1;
if (kiniMisi == 1) {
jenisMusuh = 1;
} else if (kiniMisi == 2) {
jenisMusuh = random(2) + 1;
} else if (kiniMisi == 3) {
jenisMusuh = random(3) + 1;
} else if (kiniMisi == 4) {
jenisMusuh = random(4) + 1;
} else if (kiniMisi == 5) {
jenisMusuh = random(5) + 1;
} else if (kiniMisi == 6) {
jenisMusuh = random(6) + 1;
} else if (kiniMisi == 7) {
jenisMusuh = random(9) + 1;
} else if (kiniMisi == 8) {
jenisMusuh = random(11) + 1;
} else if (kiniMisi == 9) {
jenisMusuh = random(12) + 1;
}
if (waveKini >= (waveMax - 1)) {
if (kiniMisi == 3) {
if (keluarMusuh == 0) {
jenisMusuh = 8;
}
} else if (kiniMisi == 4) {
if (keluarMusuh == 0) {
jenisMusuh = 9;
}
} else if (kiniMisi == 5) {
if (keluarMusuh == 0) {
jenisMusuh = 10;
}
} else if (kiniMisi == 6) {
if (keluarMusuh == 1) {
jenisMusuh = 9;
} else if (keluarMusuh == 0) {
jenisMusuh = 10;
}
} else if (kiniMisi == 7) {
if (keluarMusuh == 2) {
jenisMusuh = 8;
} else if (keluarMusuh == 1) {
jenisMusuh = 9;
} else if (keluarMusuh == 0) {
jenisMusuh = 10;
}
} else if (kiniMisi == 8) {
if (keluarMusuh == 2) {
jenisMusuh = 9;
} else if (keluarMusuh == 1) {
jenisMusuh = 10;
} else if (keluarMusuh == 0) {
jenisMusuh = 11;
}
} else if (kiniMisi == 9) {
if (keluarMusuh == 2) {
jenisMusuh = 10;
} else if (keluarMusuh == 1) {
jenisMusuh = 11;
} else if (keluarMusuh == 0) {
jenisMusuh = 12;
}
}
}
tentara2 = attachMovie("musuh_mc" + jenisMusuh, "musuh_mc" + bykTentara2, bykTentara2);
tentara2.terus = false;
if (jenisMusuh == 8) {
backTruck();
} else if (jenisMusuh == 9) {
backTank();
} else if (jenisMusuh == 10) {
backTank();
} else if (jenisMusuh == 11) {
backHeli();
} else if (jenisMusuh == 12) {
tentara2.terus = true;
backJet();
}
if ((jenisMusuh >= 8) && (jenisMusuh <= 10)) {
tentara2.adaMoncong = true;
} else {
tentara2.adaMoncong = false;
}
if ((jenisMusuh >= 9) && (jenisMusuh <= 12)) {
tentara2.antiTank = true;
} else {
tentara2.antiTank = false;
}
if (kiniMisi == 1) {
tentara2._x = (40 + ((i - 1) * 80)) + random(40);
tentara2._y = 0;
} else if (kiniMisi == 2) {
rand = random(4);
if (rand == 0) {
tentara2._x = (40 + ((i - 1) * 80)) + random(40);
tentara2._y = 0;
} else if (rand == 1) {
tentara2._x = (40 + ((i - 1) * 80)) + random(40);
tentara2._y = 535;
} else if (rand == 2) {
tentara2._x = 0;
tentara2._y = (40 + ((i - 1) * 60)) + random(40);
} else if (rand == 3) {
tentara2._x = 800;
tentara2._y = (40 + ((i - 1) * 60)) + random(40);
}
} else if (kiniMisi == 3) {
tentara2._x = (40 + ((i - 1) * 80)) + random(40);
tentara2._y = 535;
} else if (kiniMisi == 4) {
rand = random(2);
if (rand == 0) {
tentara2._x = random(40);
tentara2._y = 0;
} else {
tentara2._x = 750 + random(40);
tentara2._y = 535;
}
} else if (kiniMisi == 5) {
rand = random(3);
if (rand == 0) {
tentara2._x = 0;
tentara2._y = 0;
} else if (rand == 1) {
tentara2._x = 500 + random(50);
tentara2._y = 0;
} else if (rand == 2) {
tentara2._x = 0;
tentara2._y = 400 + random(50);
}
} else if (kiniMisi == 6) {
if (waveKini >= (waveMax / 2)) {
xrand = random(2);
} else {
xrand = 0;
}
if (xrand == 0) {
tentara2._x = (400 - random(30)) + 5;
tentara2._y = (300 - random(30)) + 5;
} else {
rand = random(4);
if (rand == 0) {
tentara2._x = 200 + random(300);
tentara2._y = 0;
} else if (rand == 1) {
tentara2._x = 200 + random(300);
tentara2._y = 535;
} else if (rand == 2) {
tentara2._x = 0;
tentara2._y = 200 + random(150);
} else if (rand == 3) {
tentara2._x = 800;
tentara2._y = 200 + random(150);
}
}
} else if (kiniMisi == 7) {
rand = random(3);
if (rand == 0) {
tentara2._x = 800;
tentara2._y = -random(10);
} else if (rand == 1) {
tentara2._x = 450 + random(50);
tentara2._y = 0;
} else {
tentara2._x = 800;
tentara2._y = 300 + random(50);
}
} else if (kiniMisi == 8) {
tentara2._x = (40 + ((i - 1) * 80)) + random(40);
tentara2._y = 0;
} else if (kiniMisi == 9) {
rand = random(4);
if (rand == 0) {
tentara2._x = (40 + ((i - 1) * 80)) + random(40);
tentara2._y = 0;
} else if (rand == 1) {
tentara2._x = (40 + ((i - 1) * 80)) + random(40);
tentara2._y = 535;
} else if (rand == 2) {
tentara2._x = 0;
tentara2._y = (40 + ((i - 1) * 60)) + random(40);
} else if (rand == 3) {
tentara2._x = 800;
tentara2._y = (40 + ((i - 1) * 60)) + random(40);
}
}
if ((jenisMusuh >= 9) && (jenisMusuh <= 10)) {
tentara2._xscale = (tentara2._yscale = 100);
} else if ((jenisMusuh >= 11) && (jenisMusuh <= 12)) {
tentara2._xscale = (tentara2._yscale = 100);
} else {
tentara2._xscale = (tentara2._yscale = 60);
}
cekAtributeMusuh(jenisMusuh);
if ((jenisMusuh >= 3) && (jenisMusuh <= 6)) {
tentara2.jenisSenjata = "explosive";
} else {
tentara2.jenisSenjata = "burst";
}
tentara2.keBendera = false;
if (ambilBendera == true) {
xrand = random(10);
if (xrand <= 4) {
tentara2.keBendera = true;
} else {
tentara2.keBendera = false;
}
} else {
tentara2.keBendera = false;
}
if (jenisMusuh >= 11) {
tentara2.keBendera = false;
}
tentara2.jenisTentara = jenisMusuh;
tentara2.sudahMati = false;
cekRandSerang(tentara2);
if (tentara2.adaMoncong == true) {
tentara2.xtarget = _root["jagoan_mc" + randTarget];
tentara2.aimX = tentara2.xtarget._x;
tentara2.aimY = tentara2.xtarget._y;
deltaX = tentara2._x - tentara2.aimX;
deltaY = tentara2._y - tentara2.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
tentara2.body._rotation = angle;
} else if (tentara2.terus == true) {
tentara2.xtarget = _root["jagoan_mc" + randTarget];
tentara2.aimX = tentara2.xtarget._x;
tentara2.aimY = tentara2.xtarget._y;
deltaX = tentara2._x - tentara2.aimX;
deltaY = tentara2._y - tentara2.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
tentara2.awalRotasi = angle;
}
tentara2.onEnterFrame = enterTentara2;
tentara2.onRollOver = overCobraSquad2;
tentara2.onReleaseOutside = outCobraSquad2;
tentara2.onRollOut = outCobraSquad2;
tentara2.xtarget = _root["jagoan_mc" + randTarget];
bykTentara2++;
if (bykTentara2 >= 2050) {
bykTentara2 = 2000;
}
}
}
function overCobraSquad2() {
range2.pilihRange = this;
range2._width = this.range * 2.1;
range2._height = this.range * 2.1;
if (this.nyawa > 0) {
barNyawa._visible = true;
barNyawa.xtarget = this;
} else {
barNyawa._visible = false;
}
}
function outCobraSquad2() {
range2.pilihRange = undefined;
barNyawa._visible = false;
}
function enterRange() {
if ((this.pilihRange == undefined) || (this.pilihRange.nyawa <= 0)) {
this._visible = false;
} else {
this._visible = true;
this._x = this.pilihRange._x;
this._y = this.pilihRange._y;
}
}
function cekAtributeMusuh(indi) {
tentara2.speed = 2;
kaliTentara = new Array("", 2.5, 3.5, 2, 2, 2, 1.5, 1.5, 10, 15, 20, 25, 30);
if (indi == 1) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + (random(30) * 1.5);
tentara2.damage = 30 + (random(30) * 1.25);
tentara2.range = (35 + random(35)) * 3;
tentara2.morale = 30 + random(30);
tentara2.speed = 2;
} else if (indi == 2) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 30 + random(30);
tentara2.range = (40 + random(40)) * 2.75;
tentara2.morale = 30 + random(30);
tentara2.speed = 2.5;
} else if (indi == 3) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 30 + (random(30) * 3);
tentara2.range = (60 + random(30)) * 4.5;
tentara2.morale = 30 + random(30);
tentara2.speed = 3;
} else if (indi == 4) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 30 + (random(30) * 3.5);
tentara2.range = (50 + random(40)) * 3;
tentara2.morale = 30 + random(30);
tentara2.speed = 1.75;
} else if (indi == 5) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 30 + (random(30) * 4);
tentara2.range = (50 + random(40)) * 4;
tentara2.morale = 30 + random(30);
tentara2.speed = 1.5;
} else if (indi == 6) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 30 + (random(30) * 5);
tentara2.range = (60 + random(30)) * 4;
tentara2.morale = 30 + random(30);
tentara2.speed = 1;
} else if (indi == 7) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 30 + (random(30) * 3.5);
tentara2.range = (40 + random(40)) * 4.5;
tentara2.morale = 30 + random(30);
tentara2.speed = 2.75;
} else if (indi == 8) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 50 + (random(30) * 3.5);
tentara2.range = (40 + random(40)) * 3.75;
tentara2.morale = 30 + random(30);
tentara2.speed = 2;
} else if (indi == 9) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 50 + (random(30) * 4);
tentara2.range = (40 + random(40)) * 3.75;
tentara2.morale = 30 + random(30);
tentara2.speed = 1.5;
} else if (indi == 10) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 50 + (random(30) * 4.5);
tentara2.range = (40 + random(40)) * 5;
tentara2.morale = 30 + random(30);
tentara2.speed = 1.25;
} else if (indi == 11) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 50 + (random(30) * 5);
tentara2.range = (40 + random(40)) * 4.5;
tentara2.morale = 30 + random(30);
tentara2.speed = 3.5;
} else if (indi == 12) {
tentara2.nyawa = ((30 + random(30)) * kaliTentara[indi]) * tingkatSulit;
tentara2.defense = 30 + random(30);
tentara2.agility = 30 + random(30);
tentara2.damage = 30 + (random(30) * 1.5);
tentara2.range = (40 + random(40)) * 8;
tentara2.morale = 30 + random(30);
tentara2.speed = 6.5;
}
randSpeed = random(10);
if (indi != 12) {
if (randSpeed <= 3) {
tentara2.speed = tentara2.speed * 1.5;
} else if (randSpeed >= 6) {
tentara2.speed = tentara2.speed * 0.5;
} else {
tentara2.speed = tentara2.speed * 1;
}
if (tentara2.keBendera == true) {
tentara2.speed = tentara2.speed * 0.5;
} else {
tentara2.speed = tentara2.speed * 0.75;
}
}
if (kiniMisi <= 3) {
tentara2.damage = tentara2.damage * 1.75;
tentara2.nyawa = tentara2.nyawa * 1.75;
} else if (kiniMisi <= 7) {
tentara2.damage = tentara2.damage * 1.5;
tentara2.nyawa = tentara2.nyawa * 1.5;
} else {
tentara2.damage = tentara2.damage * 1.25;
tentara2.nyawa = tentara2.nyawa * 1.25;
}
tentara2.nyawaMax = tentara2.nyawa;
if ((indi >= 8) && (indi <= 10)) {
tentara2.range = tentara2.range * 1.25;
} else if ((indi >= 11) && (indi <= 12)) {
tentara2.range = tentara2.range * 1;
} else {
tentara2.range = tentara2.range * 0.75;
}
}
function cekRandSerang(indi) {
jarakMusuh = new Array();
keJarakMusuh = 0;
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].nyawa > 0) {
indi.jarak = Math.sqrt(Math.pow(indi._x - _root["jagoan_mc" + i]._x, 2) + Math.pow(indi._y - _root["jagoan_mc" + i]._y, 2));
jarakMusuh[keJarakMusuh] = indi.jarak;
keJarakMusuh++;
}
i++;
}
jarakMusuh.sort();
if (kiniMisi == 4) {
keRand = 0;
} else if (keJarakMusuh == 1) {
keRand = 0;
} else {
keRand = random(2) + 1;
}
keRand = 0;
i = 1000;
while (i <= 1040) {
indi.jarak = Math.sqrt(Math.pow(indi._x - _root["jagoan_mc" + i]._x, 2) + Math.pow(indi._y - _root["jagoan_mc" + i]._y, 2));
if (indi.jarak == jarakMusuh[keRand]) {
randTarget = i;
i = 1050;
}
i++;
}
}
function enterTentara2() {
if (this.nyawa <= 0) {
if (this._currentframe != 4) {
achievementsDapat1 = 1;
if (this.jenisTentara <= 7) {
backMati();
}
if (bisaMove == false) {
if (this.jenisTentara != undefined) {
if (moneyPlus == true) {
money = money + (this.jenisTentara * 300);
} else {
money = money + (this.jenisTentara * 100);
}
}
}
cekMisi(1, 1);
if (this.sudahMati == false) {
totalKilled++;
if (this.jenisTentara == 1) {
killHandgun++;
} else if (this.jenisTentara == 2) {
killRifle++;
} else if (this.jenisTentara == 3) {
killSniper++;
} else if (this.jenisTentara == 4) {
killMortar++;
} else if (this.jenisTentara == 5) {
killGranade++;
} else if (this.jenisTentara == 6) {
killLauncher++;
} else if (this.jenisTentara == 7) {
killLaser++;
} else if (this.jenisTentara == 8) {
killTruk++;
} else if (this.jenisTentara == 9) {
killPanzer++;
} else if (this.jenisTentara == 10) {
killTank++;
} else if (this.jenisTentara == 11) {
killHelicopter++;
} else if (this.jenisTentara == 12) {
killJet++;
}
this.sudahMati = true;
maxMusuh--;
if (maxMusuh <= 0) {
sudahMenang();
}
}
this.gotoAndStop(4);
}
} else {
if (this.adaMoncong == true) {
this.aimX = this.xtarget._x;
this.aimY = this.xtarget._y;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this.moncong._rotation = angle;
this.jarak = Math.sqrt(Math.pow(this._x - this.aimX, 2) + Math.pow(this._y - this.aimY, 2));
if (this.xtarget.overTake == true) {
this.xtarget.majuKedepan = true;
this.xtarget.arahDepan = this;
}
if ((maxMusuh >= 1) && (maxMusuh <= 2)) {
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].mundurKebelakang == false) {
_root["jagoan_mc" + i].majuKedepan = true;
_root["jagoan_mc" + i].arahDepan = this;
}
i++;
}
}
if (this.jarak <= this.range) {
if (this.xtarget.range < this.range) {
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].mundurKebelakang == false) {
_root["jagoan_mc" + i].majuKedepan = true;
_root["jagoan_mc" + i].arahDepan = this;
}
i++;
}
}
this.gotoAndStop(3);
this.moncong._rotation = angle;
} else if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
this.gotoAndStop(2);
this.moncong._rotation = angle;
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
}
if (this.xtarget.nyawa <= 0) {
cekRandSerang(this);
this.xtarget = _root["jagoan_mc" + randTarget];
}
} else if (this.keBendera == false) {
if ((this.xtarget.invisible == true) && (this.terus == false)) {
this.aimX = this.xtarget._x;
this.aimY = this.xtarget._y;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this._rotation = angle;
this.jarak = Math.sqrt(Math.pow(this._x - this.aimX, 2) + Math.pow(this._y - this.aimY, 2));
if (this.jarak <= (this.range * 0.5)) {
cekRandSerang(this);
this.xtarget = _root["jagoan_mc" + randTarget];
if (this.xtarget.range < this.range) {
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].mundurKebelakang == false) {
_root["jagoan_mc" + i].majuKedepan = true;
_root["jagoan_mc" + i].arahDepan = this;
}
i++;
}
}
} else if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
this.gotoAndStop(2);
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
}
} else if (this.terus == true) {
this._rotation = this.awalRotasi;
this.jarak = Math.sqrt(Math.pow(this._x - this.aimX, 2) + Math.pow(this._y - this.aimY, 2));
if (this.xtarget.overTake == true) {
this.xtarget.majuKedepan = true;
this.xtarget.arahDepan = this;
}
if ((maxMusuh >= 1) && (maxMusuh <= 2)) {
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].mundurKebelakang == false) {
_root["jagoan_mc" + i].majuKedepan = true;
_root["jagoan_mc" + i].arahDepan = this;
}
i++;
}
}
this._y = this._y - (this.speed * Math.cos(this._rotation * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(this._rotation * (Math.PI/180)));
if (this.jarak <= this.range) {
if (this.xtarget.range < this.range) {
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].mundurKebelakang == false) {
_root["jagoan_mc" + i].majuKedepan = true;
_root["jagoan_mc" + i].arahDepan = this;
}
i++;
}
}
if (this.xtarget.invisible == false) {
this.gotoAndStop(3);
}
} else if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
this.gotoAndStop(2);
}
if ((((this._x <= -200) || (this._x >= 1000)) || (this._y <= -200)) || (this._y >= 800)) {
this.nyawa = 0;
}
} else {
this.aimX = this.xtarget._x;
this.aimY = this.xtarget._y;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this._rotation = angle;
this.jarak = Math.sqrt(Math.pow(this._x - this.aimX, 2) + Math.pow(this._y - this.aimY, 2));
if (this.xtarget.overTake == true) {
this.xtarget.majuKedepan = true;
this.xtarget.arahDepan = this;
}
if ((maxMusuh >= 1) && (maxMusuh <= 2)) {
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].mundurKebelakang == false) {
_root["jagoan_mc" + i].majuKedepan = true;
_root["jagoan_mc" + i].arahDepan = this;
}
i++;
}
}
if (this.jarak <= this.range) {
if (this.xtarget.range < this.range) {
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].mundurKebelakang == false) {
_root["jagoan_mc" + i].majuKedepan = true;
_root["jagoan_mc" + i].arahDepan = this;
}
i++;
}
}
this.gotoAndStop(3);
} else if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
this.gotoAndStop(2);
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
}
if (this.xtarget.nyawa <= 0) {
cekRandSerang(this);
this.xtarget = _root["jagoan_mc" + randTarget];
}
}
} else {
if (bendera_mc._x != undefined) {
this.aimX = bendera_mc._x;
this.aimY = bendera_mc._y;
deltaX = this._x - this.aimX;
deltaY = this._y - this.aimY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this.aimX2 = this.xtarget._x;
this.aimY2 = this.xtarget._y;
deltaX2 = this._x - this.aimX2;
deltaY2 = this._y - this.aimY2;
angle2 = (-Math.atan2(deltaX2, deltaY2)) / (Math.PI/180);
this._rotation = angle2;
this.jarak = Math.sqrt(Math.pow(this._x - this.aimX, 2) + Math.pow(this._y - this.aimY, 2));
if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > this.speed) {
this._y = this._y - (this.speed * Math.cos(angle * (Math.PI/180)));
this._x = this._x + (this.speed * Math.sin(angle * (Math.PI/180)));
} else {
sudahKalah();
}
}
this.jarak = Math.sqrt(Math.pow(this._x - this.aimX2, 2) + Math.pow(this._y - this.aimY2, 2));
if (this.xtarget.overTake == true) {
this.xtarget.majuKedepan = true;
this.xtarget.arahDepan = this;
}
if ((maxMusuh >= 1) && (maxMusuh <= 2)) {
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].mundurKebelakang == false) {
_root["jagoan_mc" + i].majuKedepan = true;
_root["jagoan_mc" + i].arahDepan = this;
}
i++;
}
}
if (this.jarak <= this.range) {
if (this.xtarget.range < this.range) {
i = 1000;
while (i <= 1040) {
if (_root["jagoan_mc" + i].mundurKebelakang == false) {
_root["jagoan_mc" + i].majuKedepan = true;
_root["jagoan_mc" + i].arahDepan = this;
}
i++;
}
}
if (this.xtarget.invisible == false) {
this.gotoAndStop(3);
}
} else if (Math.sqrt((deltaX2 * deltaX2) + (deltaY2 * deltaY2)) > this.speed) {
this.gotoAndStop(2);
}
if (this.xtarget.nyawa <= 0) {
cekRandSerang(this);
this.xtarget = _root["jagoan_mc" + randTarget];
}
}
if (sudahSelesai == true) {
this.gotoAndStop(1);
delete this.onEnterFrame;
}
}
}
function seranganMusuh(indi) {
if (indi.jenisTentara == 7) {
cekGunBiru(indi, "musuh");
} else {
cekGunPutih(indi);
}
berkurangNyawa = indi.damage - indi.xtarget.defense;
if (berkurangNyawa <= 2) {
berkurangNyawa = 2;
}
if (berkurangNyawa == undefined) {
berkurangNyawa = 0;
}
randKena = random(indi.xtarget.agility);
if (randKena <= 40) {
if (indi.xtarget.imune == false) {
indi.xtarget.nyawa = indi.xtarget.nyawa - berkurangNyawa;
cekDarah(indi.xtarget);
}
}
}
function clearSemua() {
clearInterval(idDelay1);
clearInterval(idDelay2);
i = 1000;
while (i <= 1040) {
removeMovieClip(_root["jagoan_mc" + i]);
i++;
}
i = 2000;
while (i <= 2055) {
removeMovieClip(_root["musuh_mc" + i]);
i++;
}
i = 100;
while (i <= 500) {
removeMovieClip(_root["darah_mc" + i]);
i++;
}
i = 3000;
while (i <= 3500) {
removeMovieClip(_root["peluruExplode" + i]);
i++;
}
i = 5000;
while (i <= 5500) {
removeMovieClip(_root["ledakan_mc" + i]);
i++;
}
removeMovieClip(range_mc);
removeMovieClip(ui_mc);
removeMovieClip(area_mc);
removeMovieClip(bendera_mc);
removeMovieClip(tentara_mc);
removeMovieClip(cobra_mc);
removeMovieClip(pilihSquad);
removeMovieClip(win_mc);
removeMovieClip(heli_mc);
removeMovieClip(bantuan_mc);
removeMovieClip(benteng_mc);
removeMovieClip(option_mc);
removeMovieClip(obyek_mc);
removeMovieClip(lantai_mc);
removeMovieClip(bar_mc);
}
function cekSisa() {
kaliTentara = new Array("", 5, 6.5, 4, 3.5, 3.5, 3, 3);
i = 1000;
while (i <= 1020) {
if (_root["jagoan_mc" + i].nyawa > 0) {
pembagiLife = kaliTentara[_root["jagoan_mc" + i].jenisTentara];
_root["lifeSquad" + _root["jagoan_mc" + i].urutanTentara] = Math.ceil(_root["jagoan_mc" + i].nyawa / pembagiLife);
}
i++;
}
i = 1;
while (i <= 48) {
_root["posPasukanX" + i] = -500;
_root["posPasukanY" + i] = -500;
i++;
}
j = 1000;
while (j <= 1020) {
if (_root["jagoan_mc" + j].nyawa > 0) {
_root["moraleSquad" + _root["jagoan_mc" + j].urutanTentara] = _root["moraleSquad" + _root["jagoan_mc" + j].urutanTentara] + 3;
if (_root["moraleSquad" + _root["jagoan_mc" + j].urutanTentara] >= 100) {
_root["moraleSquad" + _root["jagoan_mc" + j].urutanTentara] = 100;
}
_root["posPasukanX" + _root["jagoan_mc" + j].urutanTentara] = _root["jagoan_mc" + j].posAwalX;
_root["posPasukanY" + _root["jagoan_mc" + j].urutanTentara] = _root["jagoan_mc" + j].posAwalY;
}
j++;
}
j = 1000;
while (j <= 1020) {
delete _root["jagoan_mc" + j].onEnterFrame;
delete _root["jagoan_mc" + j].onRelease;
delete _root["jagoan_mc" + j].onRollOver;
if (_root["jagoan_mc" + j].nyawa <= 0) {
resetSquad(_root["jagoan_mc" + j].urutanTentara);
}
j++;
}
}
function sudahKalah() {
if (sudahSelesai == false) {
sudahSelesai = true;
idDelay1 = setInterval(sudahKalah2, 2000);
}
}
function sudahKalah2() {
clearInterval(idDelay1);
cekSisa();
cekTotalKill();
day++;
selesai = attachMovie("win_mc", "win_mc", dalamWin);
selesai._x = 400;
selesai._y = 300;
selesai.gotoAndStop(2);
selesai.continue_btn.onRelease = function () {
if (autoSave == "on") {
simpanData();
}
clearSemua();
gotoAndStop (273);
};
selesai.more_btn.onRelease = function () {
getURL ("http://www.thegames8.com/", "_blank");
};
}
function sudahMenang() {
if (waveKini == waveMax) {
if (sudahSelesai == false) {
sudahSelesai = true;
idDelay2 = setInterval(sudahMenang2, 2000);
}
} else {
waveKini++;
keluarMusuh = arrayKeluar[waveKini];
if (keluarMusuh >= 50) {
keluarMusuh = 50;
}
bykTentara2 = 2000;
j = 1000;
while (j <= 1040) {
_root["jagoan_mc" + j].xtarget = undefined;
j++;
}
maxMusuh = keluarMusuh;
munculMusuh = false;
ui.start_btn._alpha = 100;
ui.start_btn.enabled = true;
bisaMove = true;
}
}
function sudahMenang2() {
clearInterval(idDelay2);
cekSisa();
win++;
winKini++;
if (winKini >= 3) {
winKini = 1;
}
if (win >= 3) {
cekMisi(1, 5);
}
if (win >= 6) {
cekMisi(2, 5);
}
if (win >= 9) {
cekMisi(3, 5);
}
if (win >= 12) {
cekMisi(4, 5);
}
if (win >= 15) {
cekMisi(5, 5);
}
if (win >= 18) {
cekMisi(6, 5);
}
if (win >= 21) {
cekMisi(7, 5);
}
if (win >= 25) {
cekMisi(8, 5);
}
if (win >= 30) {
cekMisi(9, 5);
}
if (win >= 10) {
achievementsDapat15 = 1;
}
if (win >= 15) {
achievementsDapat16 = 1;
}
if (win >= 20) {
achievementsDapat17 = 1;
}
if (win >= 25) {
achievementsDapat18 = 1;
}
if (win >= 30) {
achievementsDapat19 = 1;
}
if (win >= 35) {
achievementsDapat20 = 1;
}
cekTotalKill();
day++;
selesai = attachMovie("win_mc", "win_mc", dalamWin);
selesai._x = 400;
selesai._y = 300;
selesai.gotoAndStop(1);
selesai.continue_btn.onRelease = function () {
if (autoSave == "on") {
simpanData();
}
clearSemua();
gotoAndStop (273);
};
selesai.more_btn.onRelease = function () {
getURL ("http://www.thegames8.com/", "_blank");
};
}
function cekTotalKill() {
if (totalKilled >= 200) {
cekMisi(2, 1);
}
if (totalKilled >= 400) {
cekMisi(3, 1);
}
if (totalKilled >= 600) {
cekMisi(4, 1);
}
if (totalKilled >= 800) {
cekMisi(5, 1);
}
if (totalKilled >= 1000) {
cekMisi(6, 1);
}
if (totalKilled >= 2000) {
cekMisi(7, 1);
}
if (totalKilled >= 3000) {
cekMisi(8, 1);
}
if (totalKilled >= 5000) {
cekMisi(9, 1);
}
if (totalKilled >= 250) {
achievementsDapat3 = 1;
}
if (totalKilled >= 500) {
achievementsDapat4 = 1;
}
if (totalKilled >= 750) {
achievementsDapat5 = 1;
}
if (totalKilled >= 1000) {
achievementsDapat6 = 1;
}
if (totalKilled >= 1500) {
achievementsDapat7 = 1;
}
if (totalKilled >= 2000) {
achievementsDapat8 = 1;
}
if (totalKilled >= 2500) {
achievementsDapat9 = 1;
}
if (totalKilled >= 3000) {
achievementsDapat10 = 1;
}
if (totalKilled >= 4000) {
achievementsDapat11 = 1;
}
if (totalKilled >= 5000) {
achievementsDapat12 = 1;
}
if (totalKilled >= 6000) {
achievementsDapat13 = 1;
}
if (totalKilled >= 7000) {
achievementsDapat14 = 1;
}
if (killMortar >= 10) {
cekMisi(4, 3);
}
if (killGranade >= 10) {
cekMisi(5, 4);
}
if (killLauncher >= 15) {
cekMisi(6, 4);
}
if (killLaser >= 20) {
cekMisi(7, 4);
}
if (killHelicopter >= 20) {
cekMisi(8, 4);
}
if (killJet >= 10) {
cekMisi(9, 3);
}
}
function cekSuara() {
if (adaSuara == true) {
ui_mc.sound_mc.gotoAndStop(1);
volume1 = 100;
volume2 = 75;
volume3 = 250;
} else if (adaSuara == false) {
ui_mc.sound_mc.gotoAndStop(2);
volume1 = 0;
volume2 = 0;
volume3 = 0;
}
}
stop();
if (adaSuara == true) {
volume1 = 100;
myMusic.setVolume(volume1);
}
namaWeapon = new Array("", "Handgun", "Rifle", "Sniper", "Mortar", "Grenade", "Rocket", "Laser");
if (kiniMisi <= 2) {
background_mc.gotoAndStop(1);
} else if (kiniMisi <= 4) {
background_mc.gotoAndStop(2);
} else if (kiniMisi <= 5) {
background_mc.gotoAndStop(3);
} else if (kiniMisi <= 7) {
background_mc.gotoAndStop(4);
} else if (kiniMisi <= 9) {
background_mc.gotoAndStop(5);
}
init();
buatObyek(kiniMisi);
resetPosSquad = false;
if ((misiKini1 == false) && (kiniMisi == 2)) {
misiKini1 = true;
resetPosSquad = true;
}
if ((misiKini2 == false) && (kiniMisi == 3)) {
misiKini2 = true;
resetPosSquad = true;
}
if ((misiKini3 == false) && (kiniMisi == 4)) {
misiKini3 = true;
resetPosSquad = true;
}
if ((misiKini4 == false) && (kiniMisi == 5)) {
misiKini4 = true;
resetPosSquad = true;
}
if ((misiKini5 == false) && (kiniMisi == 6)) {
misiKini5 = true;
resetPosSquad = true;
}
if ((misiKini6 == false) && (kiniMisi == 7)) {
misiKini6 = true;
resetPosSquad = true;
}
if ((misiKini7 == false) && (kiniMisi == 8)) {
misiKini7 = true;
resetPosSquad = true;
}
if ((misiKini8 == false) && (kiniMisi == 9)) {
misiKini8 = true;
resetPosSquad = true;
}
if (resetPosSquad == false) {
buatPosisi();
} else {
i = 1;
while (i <= 48) {
_root["adaCobra" + i] = true;
i++;
}
}
buatUI();
_root.onEnterFrame = function () {
if (bisaMove == false) {
if (moneyPlus == true) {
ui_mc.moneyPlus = "Money Plus Active";
if (lamaMoneyPlus >= 500) {
lamaMoneyPlus = 0;
moneyPlus = false;
} else {
lamaMoneyPlus++;
}
} else {
ui_mc.moneyPlus = "";
}
} else {
ui_mc.moneyPlus = "";
}
if (munculMusuh == true) {
delayKeluarMusuh++;
if (delayKeluarMusuh >= maxKeluarMusuh) {
delayKeluarMusuh = 0;
buatTentaraMusuh();
}
}
jumlahCobra = 0;
j = 1000;
while (j <= 1040) {
if (_root["jagoan_mc" + j].nyawa > 0) {
jumlahCobra++;
}
j++;
}
ui_mc.area = ("Area " + kiniMisi) + "/9";
ui_mc.enemyLeft = "Enemy Left " + maxMusuh;
ui_mc.cobraMoney = "Money " + money;
ui_mc.waveKe = (("Wave " + waveKini) + "/") + waveMax;
};
range = attachMovie("range_mc", "range_mc", dalamRange);
range._x = -500;
range._y = -500;
range._visible = false;
range2 = attachMovie("range_mc", "range_mc2", dalamRange + 1);
range2._x = -500;
range2._y = -500;
range2._visible = false;
range2.onEnterFrame = enterRange;
barNyawa = attachMovie("bar_mc3", "bar_mc", dalamNyawaBar);
barNyawa._x = -500;
barNyawa._y = -500;
barNyawa._visible = false;
barNyawa.onEnterFrame = enterBarNyawa;
ui_mc.sound_mc.onRelease = function () {
if (adaSuara == true) {
adaSuara = false;
this.gotoAndStop(2);
} else {
adaSuara = true;
this.gotoAndStop(1);
}
cekSuara();
myMusic.setVolume(volume1);
mySound.setVolume(volume2);
mySound2.setVolume(volume3);
};
Frame 273
function bisaTombol(indi) {
recruit_btn.enabled = indi;
weapon_btn.enabled = indi;
item_btn.enabled = indi;
power_btn.enabled = indi;
objective_btn.enabled = indi;
achievement_btn.enabled = indi;
statistic_btn.enabled = indi;
save_btn.enabled = indi;
autosave_mc.enabled = indi;
menu_btn.enabled = indi;
more_btn.enabled = indi;
continue_btn.enabled = indi;
i = 1;
while (i <= 20) {
_root["kotak" + i].enabled = indi;
i++;
}
}
function cekWeaponRecruit() {
weapon_mc._visible = true;
weapon_mc.gotoAndStop(3);
if (kiniMisi == 1) {
maxBisaRecruit = 1;
} else if (kiniMisi == 2) {
maxBisaRecruit = 2;
} else if (kiniMisi == 3) {
maxBisaRecruit = 3;
} else if (kiniMisi == 4) {
maxBisaRecruit = 4;
} else if (kiniMisi == 5) {
maxBisaRecruit = 5;
} else if (kiniMisi == 6) {
maxBisaRecruit = 6;
} else {
maxBisaRecruit = 7;
}
i = 1;
while (i <= 7) {
weapon_mc["select" + i]._visible = false;
weapon_mc["gembok" + i]._visible = true;
i++;
}
i = 1;
while (i <= maxBisaRecruit) {
weapon_mc["foto" + i].gotoAndStop(i);
weapon_mc["jumlah" + i] = _root["jumlahWeapon" + i];
weapon_mc["select" + i].onRelease = klikSelectRecruit;
weapon_mc["select" + i]._visible = true;
weapon_mc["gembok" + i]._visible = false;
i++;
}
weapon_mc.close_btn.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn2.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn3.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn4.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
}
function klikSelectRecruit() {
myStr = new String(this);
pilihRecruitWeapons = Number(myStr.substr(myStr.length - 1, 1));
weapon_mc._visible = false;
soldier_mc._visible = true;
cekRecruit(pilihRecruitWeapons);
}
function cekItem2() {
i = 1;
while (i <= 8) {
item_mc["foto" + i].gotoAndStop(i);
item_mc["jumlah" + i] = _root["jumlahItem" + i];
item_mc["select" + i].onRelease = klikSelectUse;
i++;
}
item_mc.close_btn.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn2.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn3.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn4.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
}
function klikSelectUse() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
i = 1;
while (i <= 20) {
j = 1;
while (j <= 3) {
if (_root["fotoSquad" + i] != 20) {
if (_root["jumlahItem" + indi] > 0) {
if (_root[(("foto" + j) + "Item") + i] == 20) {
_root[(("foto" + j) + "Item") + i] = indi;
_root["jumlahItem" + indi]--;
j = 3;
}
}
}
j++;
}
i++;
}
i = 1;
while (i <= 8) {
item_mc["foto" + i].gotoAndStop(i);
item_mc["jumlah" + i] = _root["jumlahItem" + i];
i++;
}
cekSquadAtribute(pilihKotak);
}
function cekItem3() {
i = 1;
while (i <= 8) {
_root["jumlahItemWithdraw" + i] = 0;
i++;
}
j = 1;
while (j <= 20) {
k = 1;
while (k <= 3) {
if (_root[(("foto" + k) + "Item") + j] != 20) {
_root["jumlahItemWithdraw" + _root[(("foto" + k) + "Item") + j]]++;
}
k++;
}
j++;
}
i = 1;
while (i <= 8) {
item_mc["foto" + i].gotoAndStop(i);
item_mc["jumlah" + i] = _root["jumlahItemWithdraw" + i];
item_mc["select" + i].onRelease = klikSelectUse2;
i++;
}
item_mc.close_btn.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn2.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn3.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn4.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
}
function klikSelectUse2() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
i = 1;
while (i <= 20) {
j = 1;
while (j <= 3) {
if (_root["fotoSquad" + i] != 20) {
if (_root[(("foto" + j) + "Item") + i] == indi) {
_root[(("foto" + j) + "Item") + i] = 20;
_root["jumlahItem" + indi]++;
}
}
j++;
}
i++;
}
i = 1;
while (i <= 8) {
_root["jumlahItemWithdraw" + i] = 0;
i++;
}
j = 1;
while (j <= 20) {
k = 1;
while (k <= 3) {
if (_root[(("foto" + k) + "Item") + j] != 20) {
_root["jumlahItemWithdraw" + _root[(("foto" + k) + "Item") + j]]++;
}
k++;
}
j++;
}
i = 1;
while (i <= 8) {
item_mc["foto" + i].gotoAndStop(i);
item_mc["jumlah" + i] = _root["jumlahItemWithdraw" + i];
i++;
}
cekSquadAtribute(pilihKotak);
}
function cekPower2() {
i = 1;
while (i <= 8) {
power_mc["foto" + i].gotoAndStop(i);
power_mc["jumlah" + i] = _root["jumlahPower" + i];
power_mc["select" + i].onRelease = klikPowerUse;
i++;
}
power_mc.close_btn.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn2.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn3.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn4.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
}
function klikPowerUse() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
i = 1;
while (i <= 20) {
j = 1;
while (j <= 3) {
if (_root["fotoSquad" + i] != 20) {
if (_root["jumlahPower" + indi] > 0) {
if (_root[(("foto" + j) + "Power") + i] == 20) {
_root[(("foto" + j) + "Power") + i] = indi;
_root["jumlahPower" + indi]--;
j = 3;
}
}
}
j++;
}
i++;
}
i = 1;
while (i <= 8) {
power_mc["foto" + i].gotoAndStop(i);
power_mc["jumlah" + i] = _root["jumlahPower" + i];
i++;
}
cekSquadAtribute(pilihKotak);
}
function cekPower3() {
i = 1;
while (i <= 8) {
_root["jumlahPowerWithdraw" + i] = 0;
i++;
}
j = 1;
while (j <= 20) {
k = 1;
while (k <= 3) {
if (_root[(("foto" + k) + "Power") + j] != 20) {
_root["jumlahPowerWithdraw" + _root[(("foto" + k) + "Power") + j]]++;
}
k++;
}
j++;
}
i = 1;
while (i <= 8) {
power_mc["foto" + i].gotoAndStop(i);
power_mc["jumlah" + i] = _root["jumlahPowerWithdraw" + i];
power_mc["select" + i].onRelease = klikPowerUse2;
i++;
}
power_mc.close_btn.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn2.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn3.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn4.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
}
function klikPowerUse2() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
i = 1;
while (i <= 20) {
j = 1;
while (j <= 3) {
if (_root["fotoSquad" + i] != 20) {
if (_root[(("foto" + j) + "Power") + i] == indi) {
_root[(("foto" + j) + "Power") + i] = 20;
_root["jumlahPower" + indi]++;
}
}
j++;
}
i++;
}
i = 1;
while (i <= 8) {
_root["jumlahPowerWithdraw" + i] = 0;
i++;
}
j = 1;
while (j <= 20) {
k = 1;
while (k <= 3) {
if (_root[(("foto" + k) + "Power") + j] != 20) {
_root["jumlahPowerWithdraw" + _root[(("foto" + k) + "Power") + j]]++;
}
k++;
}
j++;
}
i = 1;
while (i <= 8) {
power_mc["foto" + i].gotoAndStop(i);
power_mc["jumlah" + i] = _root["jumlahPowerWithdraw" + i];
i++;
}
cekSquadAtribute(pilihKotak);
}
function cekRecruit(pilihRecruitWeapons) {
namaAwal = new Array("Alex", "Brian", "Barry", "Cody", "Carl", "Daniel", "Ethan", "Erick", "Fray", "Greg", "Hill", "Ian", "James", "John", "Kenny", "Kevin", "Louis", "Martin", "Mitt", "Nolan", "Oracle", "Pitt", "Robert", "Steven", "Teddy", "Tom", "Victor", "William", "Will", "Zack");
nawaAkhir = new Array("Arnold", "Bold", "Biden", "Christ", "Dustin", "Dake", "Ernesto", "Fort", "Graham", "Harris", "Ireland", "Jol", "Jake", "King", "Lombard", "Law", "Mark", "Norris", "Obama", "Patty", "Rambo", "Rusty", "Ronald", "Snake", "Thomas", "Usher", "Void", "Wrack", "Xeno", "Yorke");
randNamaAwal1 = random(namaAwal.length);
randNamaAkhir1 = random(nawaAkhir.length);
soldier_mc.nama1 = (namaAwal[randNamaAwal1] + " ") + nawaAkhir[randNamaAkhir1];
randNamaAwal2 = random(namaAwal.length);
randNamaAkhir2 = random(nawaAkhir.length);
soldier_mc.nama2 = (namaAwal[randNamaAwal2] + " ") + nawaAkhir[randNamaAkhir2];
randNamaAwal3 = random(namaAwal.length);
randNamaAkhir3 = random(nawaAkhir.length);
soldier_mc.nama3 = (namaAwal[randNamaAwal3] + " ") + nawaAkhir[randNamaAkhir3];
if (pilihRecruitWeapons != undefined) {
randWeapon1 = pilihRecruitWeapons;
randWeapon2 = pilihRecruitWeapons;
randWeapon3 = pilihRecruitWeapons;
} else if (kiniMisi == 1) {
randWeapon1 = 1;
randWeapon2 = 1;
randWeapon3 = 1;
} else if (kiniMisi == 2) {
randWeapon1 = random(2) + 1;
randWeapon2 = random(2) + 1;
randWeapon3 = random(2) + 1;
} else if (kiniMisi == 3) {
randWeapon1 = random(3) + 1;
randWeapon2 = random(3) + 1;
randWeapon3 = random(3) + 1;
} else if (kiniMisi == 4) {
randWeapon1 = random(4) + 1;
randWeapon2 = random(4) + 1;
randWeapon3 = random(4) + 1;
} else if (kiniMisi == 5) {
randWeapon1 = random(5) + 1;
randWeapon2 = random(5) + 1;
randWeapon3 = random(5) + 1;
} else if (kiniMisi == 6) {
randWeapon1 = random(6) + 1;
randWeapon2 = random(6) + 1;
randWeapon3 = random(6) + 1;
} else if (kiniMisi == 7) {
randWeapon1 = random(7) + 1;
randWeapon2 = random(7) + 1;
randWeapon3 = random(7) + 1;
} else {
randWeapon1 = random(6) + 2;
randWeapon2 = random(6) + 2;
randWeapon3 = random(6) + 2;
}
soldier_mc.weapon1 = namaWeapon[randWeapon1];
soldier_mc.weapon2 = namaWeapon[randWeapon2];
soldier_mc.weapon3 = namaWeapon[randWeapon3];
soldier_mc.foto1.gotoAndStop(randWeapon1);
soldier_mc.foto2.gotoAndStop(randWeapon2);
soldier_mc.foto3.gotoAndStop(randWeapon3);
soldier_mc.strength1.bar_mc._xscale = random(41) + 60;
soldier_mc.strength2.bar_mc._xscale = random(41) + 60;
soldier_mc.strength3.bar_mc._xscale = random(41) + 60;
soldier_mc.agility1.bar_mc._xscale = random(41) + 60;
soldier_mc.agility2.bar_mc._xscale = random(41) + 60;
soldier_mc.agility3.bar_mc._xscale = random(41) + 60;
soldier_mc.skill1.bar_mc._xscale = random(41) + 60;
soldier_mc.skill2.bar_mc._xscale = random(41) + 60;
soldier_mc.skill3.bar_mc._xscale = random(41) + 60;
if ((randWeapon1 >= 3) && (randWeapon1 <= 6)) {
soldier_mc.vision1.bar_mc._xscale = random(26) + 76;
} else {
soldier_mc.vision1.bar_mc._xscale = random(41) + 60;
}
if ((randWeapon2 >= 3) && (randWeapon2 <= 6)) {
soldier_mc.vision2.bar_mc._xscale = random(26) + 76;
} else {
soldier_mc.vision2.bar_mc._xscale = random(41) + 60;
}
if ((randWeapon3 >= 3) && (randWeapon3 <= 6)) {
soldier_mc.vision3.bar_mc._xscale = random(26) + 76;
} else {
soldier_mc.vision3.bar_mc._xscale = random(41) + 60;
}
maximumCost1 = ((soldier_mc.strength1.bar_mc._xscale + soldier_mc.agility1.bar_mc._xscale) + soldier_mc.skill1.bar_mc._xscale) + soldier_mc.vision1.bar_mc._xscale;
maximumCost2 = ((soldier_mc.strength2.bar_mc._xscale + soldier_mc.agility2.bar_mc._xscale) + soldier_mc.skill2.bar_mc._xscale) + soldier_mc.vision2.bar_mc._xscale;
maximumCost3 = ((soldier_mc.strength3.bar_mc._xscale + soldier_mc.agility3.bar_mc._xscale) + soldier_mc.skill3.bar_mc._xscale) + soldier_mc.vision3.bar_mc._xscale;
hargaSoldier1 = Math.ceil(maximumCost1 * (2 + randWeapon1));
hargaSoldier2 = Math.ceil(maximumCost2 * (2 + randWeapon2));
hargaSoldier3 = Math.ceil(maximumCost3 * (2 + randWeapon3));
soldier_mc.cost1 = "COST $" + hargaSoldier1;
soldier_mc.cost2 = "COST $" + hargaSoldier2;
soldier_mc.cost3 = "COST $" + hargaSoldier3;
soldier_mc.recruit1.onRelease = klikSoldier;
soldier_mc.recruit2.onRelease = klikSoldier;
soldier_mc.recruit3.onRelease = klikSoldier;
}
function klikSoldier() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (money >= _root["hargaSoldier" + indi]) {
cekLainLain();
if (bykPasukanKini < 48) {
cekMisi(1, 2);
money = money - _root["hargaSoldier" + indi];
i = 1;
while (i <= 20) {
if (_root["kotak" + i]._currentframe == 20) {
memberSquad++;
if (memberSquad < 10) {
_root["nomorSquad" + i] = "000" + memberSquad;
} else if (memberSquad < 100) {
_root["nomorSquad" + i] = "00" + memberSquad;
} else if (memberSquad < 1000) {
_root["nomorSquad" + i] = "0" + memberSquad;
} else {
_root["nomorSquad" + i] = memberSquad;
}
_root["namaSquad" + i] = soldier_mc["nama" + indi];
_root["specialSquad" + i] = namaWeapon[_root["randWeapon" + indi]];
_root["atributeValue" + i] = _root["maximumCost" + indi];
_root["strengthSquad" + i] = soldier_mc["strength" + indi].bar_mc._xscale;
_root["agilitySquad" + i] = soldier_mc["agility" + indi].bar_mc._xscale;
_root["skillSquad" + i] = soldier_mc["skill" + indi].bar_mc._xscale;
_root["visionSquad" + i] = soldier_mc["vision" + indi].bar_mc._xscale;
_root["fotoSquad" + i] = _root["randWeapon" + indi];
_root["kotak" + i].gotoAndStop(_root["randWeapon" + indi]);
cekKlikKotak();
i = 50;
}
i++;
}
soldier_mc._visible = false;
bisaTombol(true);
}
cekLainLain();
}
}
function cekWeapon() {
weaponHarga = new Array("", 200, 250, 300, 350, 400, 450, 500);
i = 1;
while (i <= 7) {
weapon_mc["foto" + i].gotoAndStop(i);
weapon_mc["cost" + i] = "COST $" + weaponHarga[i];
weapon_mc["jumlah" + i] = _root["jumlahWeapon" + i];
weapon_mc["buy" + i]._visible = true;
weapon_mc["sell" + i]._visible = true;
weapon_mc["gembok" + i]._visible = false;
weapon_mc["buy" + i].onRelease = klikWeapon;
weapon_mc["sell" + i].onRelease = klikWeapon2;
i++;
}
i = kiniMisi + 1;
while (i <= 7) {
weapon_mc["buy" + i]._visible = false;
weapon_mc["sell" + i]._visible = false;
weapon_mc["gembok" + i]._visible = true;
weapon_mc["cost" + i] = "";
i++;
}
}
function klikWeapon() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (money >= weaponHarga[indi]) {
if (indi == 1) {
cekMisi(1, 3);
}
if (indi == 3) {
cekMisi(3, 4);
}
money = money - weaponHarga[indi];
_root["jumlahWeapon" + indi]++;
}
cekWeapon();
}
function klikWeapon2() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahWeapon" + indi] > 0) {
money = money + Math.ceil(weaponHarga[indi] / 2);
_root["jumlahWeapon" + indi]--;
}
cekWeapon();
}
function cekItem() {
itemHarga = new Array("", 100, 50, 50, 100, 250, 150, 150, 250);
item_mc.msgBox_mc6._visible = false;
i = 1;
while (i <= 8) {
item_mc["foto" + i].gotoAndStop(i);
item_mc["foto" + i].onRollOver = overFoto;
item_mc["foto" + i].onRollOut = outFoto;
item_mc["cost" + i] = "COST $" + itemHarga[i];
item_mc["jumlah" + i] = _root["jumlahItem" + i];
item_mc["buy" + i]._visible = true;
item_mc["sell" + i]._visible = true;
item_mc["gembok" + i]._visible = false;
item_mc["buy" + i].onRelease = klikItem;
item_mc["sell" + i].onRelease = klikItem2;
i++;
}
i = kiniMisi + 1;
while (i <= 8) {
item_mc["buy" + i]._visible = false;
item_mc["sell" + i]._visible = false;
item_mc["gembok" + i]._visible = true;
item_mc["cost" + i] = "";
i++;
}
}
function overFoto() {
myStr = new String(this);
qindi = Number(myStr.substr(myStr.length - 1, 1));
item_mc.msgBox_mc6._x = this._x + 75;
item_mc.msgBox_mc6._y = this._y - 90;
item_mc.msgBox_mc6._visible = true;
item_mc.msgBox_mc6.gotoAndStop(qindi);
}
function outFoto() {
item_mc.msgBox_mc6._visible = false;
}
function klikItem() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (money >= itemHarga[indi]) {
if (indi == 1) {
cekMisi(1, 4);
}
money = money - itemHarga[indi];
_root["jumlahItem" + indi]++;
}
cekItem();
}
function klikItem2() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahItem" + indi] > 0) {
money = money + Math.ceil(itemHarga[indi] / 2);
_root["jumlahItem" + indi]--;
}
cekItem();
}
function cekPower() {
powerHarga = new Array("", 500, 500, 750, 750, 1500, 1500, 2000);
power_mc.msgBox_mc6._visible = false;
i = 1;
while (i <= 7) {
power_mc["foto" + i].gotoAndStop(i);
power_mc["foto" + i].onRollOver = overFoto2;
power_mc["foto" + i].onRollOut = outFoto2;
power_mc["cost" + i] = "COST $" + powerHarga[i];
power_mc["jumlah" + i] = _root["jumlahPower" + i];
power_mc["buy" + i]._visible = true;
power_mc["sell" + i]._visible = true;
power_mc["gembok" + i]._visible = false;
power_mc["buy" + i].onRelease = klikPower;
power_mc["sell" + i].onRelease = klikPower2;
i++;
}
i = kiniMisi + 1;
while (i <= 7) {
power_mc["buy" + i]._visible = false;
power_mc["sell" + i]._visible = false;
power_mc["gembok" + i]._visible = true;
power_mc["cost" + i] = "";
i++;
}
}
function overFoto2() {
myStr = new String(this);
qindi = Number(myStr.substr(myStr.length - 1, 1));
power_mc.msgBox_mc6._x = this._x + 75;
power_mc.msgBox_mc6._y = this._y - 90;
power_mc.msgBox_mc6._visible = true;
power_mc.msgBox_mc6.gotoAndStop(qindi);
}
function outFoto2() {
power_mc.msgBox_mc6._visible = false;
}
function klikPower() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (money >= powerHarga[indi]) {
if (indi == 2) {
cekMisi(2, 4);
}
money = money - powerHarga[indi];
_root["jumlahPower" + indi]++;
}
cekPower();
}
function klikPower2() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahPower" + indi] > 0) {
money = money + Math.ceil(powerHarga[indi] / 2);
_root["jumlahPower" + indi]--;
}
cekPower();
}
function cekObjective() {
i = 1;
while (i <= 9) {
objective_mc["misi" + i]._alpha = 15;
i++;
}
i = 1;
while (i <= (kiniMisi - 1)) {
objective_mc["misi" + i]._alpha = 45;
i++;
}
objective_mc["misi" + kiniMisi]._alpha = 100;
i = 1;
while (i <= 5) {
j = 1;
while (j <= 9) {
objective_mc["misi" + j]["done" + i]._visible = false;
j++;
}
i++;
}
i = 1;
while (i <= 5) {
j = 1;
while (j <= kiniMisi) {
if (_root[("misiSub" + j) + i] == 0) {
objective_mc["misi" + j]["done" + i]._visible = false;
} else {
objective_mc["misi" + j]["done" + i]._visible = true;
}
j++;
}
i++;
}
}
function cekAchivement() {
}
function cekStatistic() {
}
function cekKlikKotak() {
i = 1;
while (i <= 20) {
if (_root["kotak" + i]._currentframe == 20) {
delete _root["kotak" + i].onRollOver;
delete _root["kotak" + i].onRollOut;
delete _root["kotak" + i].onRelease;
} else {
_root["kotak" + i].onRollOver = overKotak;
_root["kotak" + i].onRollOut = outKotak;
_root["kotak" + i].onRelease = klikKotak;
}
i++;
}
}
function overKotak() {
myStr = new String(this);
if (myStr.length == 14) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (this._currentframe == 20) {
msgBox_mc._visible = false;
} else {
msgBox_mc._visible = true;
msgBox_mc.namaSquad = _root["namaSquad" + indi];
msgBox_mc.specialSquad = _root["specialSquad" + indi] + " Expert";
msgBox_mc.nyawaSquad = ("Life " + _root["lifeSquad" + indi]) + "/100";
msgBox_mc.atributeValue = "Atribute Value " + _root["atributeValue" + indi];
if (_root["fotoWeapon" + indi] == 20) {
msgBox_mc.latar_mc.gotoAndStop(2);
msgBox_mc.weaponKini = "No Weapon";
} else if (_root["fotoWeapon" + indi] != _root["fotoSquad" + indi]) {
msgBox_mc.latar_mc.gotoAndStop(3);
msgBox_mc.weaponKini = "Use " + namaWeapon[_root["fotoWeapon" + indi]];
} else {
msgBox_mc.latar_mc.gotoAndStop(1);
msgBox_mc.weaponKini = "Use " + namaWeapon[_root["fotoWeapon" + indi]];
}
}
}
function outKotak() {
msgBox_mc._visible = false;
}
function klikKotak() {
msgBox_mc._visible = false;
bisaTombol(false);
squad_mc._visible = true;
pilihanSquad(this, "");
}
function pilihanSquad(xindi, xindi2) {
squad_mc.prev_btn.onRelease = function () {
pilhanAnda = pilihKotak;
i = pilihKotak - 1;
while (i >= 1) {
if (_root["kotak" + i]._currentframe != 20) {
pilhanAnda = i;
i = 1;
}
i--;
}
pilihanSquad(pilhanAnda, "ada");
};
squad_mc.next_btn.onRelease = function () {
pilhanAnda = pilihKotak;
i = pilihKotak + 1;
while (i <= 20) {
if (_root["kotak" + i]._currentframe != 20) {
pilhanAnda = i;
i = 20;
}
i++;
}
pilihanSquad(pilhanAnda, "ada");
};
if (xindi2 == "ada") {
pilihKotak = xindi;
} else {
myStr = new String(xindi);
if (myStr.length == 14) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
pilihKotak = indi;
}
cekSquadAtribute(pilihKotak);
squad_mc.weaponChange.onRelease = function () {
weapon_mc._visible = true;
weapon_mc.gotoAndStop(2);
i = 1;
while (i <= 7) {
weapon_mc["foto" + i].gotoAndStop(i);
weapon_mc["jumlah" + i] = _root["jumlahWeapon" + i];
weapon_mc["select" + i].onRelease = klikSelectWeapon;
i++;
}
weapon_mc.close_btn.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn2.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn3.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn4.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.unselect_btn.onRelease = function () {
bisaTombol(true);
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["fotoWeapon" + pilihKotak] != 20) {
_root["jumlahWeapon" + _root["fotoWeapon" + pilihKotak]]++;
_root["fotoWeapon" + pilihKotak] = 20;
}
weapon_mc._visible = false;
cekSquadAtribute(pilihKotak);
};
weapon_mc.buy_btn.onRelease = function () {
bisaTombol(false);
weapon_mc.gotoAndStop(1);
weapon_mc._visible = true;
cekWeapon();
weapon_mc.close_btn.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn2.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn3.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn4.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
};
};
squad_mc.itemChange1.onRelease = function () {
item_mc._visible = true;
item_mc.gotoAndStop(2);
i = 1;
while (i <= 8) {
item_mc["foto" + i].gotoAndStop(i);
item_mc["jumlah" + i] = _root["jumlahItem" + i];
item_mc["select" + i].onRelease = klikSelectItem1;
i++;
}
item_mc.close_btn.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn2.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn3.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn4.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.unselect_btn.onRelease = function () {
bisaTombol(true);
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["foto1Item" + pilihKotak] != 20) {
_root["jumlahItem" + _root["foto1Item" + pilihKotak]]++;
_root["foto1Item" + pilihKotak] = 20;
}
item_mc._visible = false;
cekSquadAtribute(pilihKotak);
};
item_mc.buy_btn.onRelease = function () {
bisaTombol(false);
item_mc.gotoAndStop(1);
item_mc._visible = true;
cekItem();
item_mc.use_btn.onRelease = function () {
item_mc.gotoAndStop(3);
cekItem2();
};
item_mc.unuse_btn.onRelease = function () {
item_mc.gotoAndStop(3);
cekItem3();
};
item_mc.close_btn.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn2.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn3.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn4.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
};
};
squad_mc.itemChange2.onRelease = function () {
item_mc._visible = true;
item_mc.gotoAndStop(2);
i = 1;
while (i <= 8) {
item_mc["foto" + i].gotoAndStop(i);
item_mc["jumlah" + i] = _root["jumlahItem" + i];
item_mc["select" + i].onRelease = klikSelectItem2;
i++;
}
item_mc.close_btn.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn2.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn3.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn4.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.unselect_btn.onRelease = function () {
bisaTombol(true);
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["foto2Item" + pilihKotak] != 20) {
_root["jumlahItem" + _root["foto2Item" + pilihKotak]]++;
_root["foto2Item" + pilihKotak] = 20;
}
item_mc._visible = false;
cekSquadAtribute(pilihKotak);
};
item_mc.buy_btn.onRelease = function () {
bisaTombol(false);
item_mc.gotoAndStop(1);
item_mc._visible = true;
cekItem();
item_mc.use_btn.onRelease = function () {
item_mc.gotoAndStop(3);
cekItem2();
};
item_mc.unuse_btn.onRelease = function () {
item_mc.gotoAndStop(3);
cekItem3();
};
item_mc.close_btn.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn2.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn3.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn4.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
};
};
squad_mc.itemChange3.onRelease = function () {
item_mc._visible = true;
item_mc.gotoAndStop(2);
i = 1;
while (i <= 8) {
item_mc["foto" + i].gotoAndStop(i);
item_mc["jumlah" + i] = _root["jumlahItem" + i];
item_mc["select" + i].onRelease = klikSelectItem3;
i++;
}
item_mc.close_btn.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn2.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn3.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn4.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.unselect_btn.onRelease = function () {
bisaTombol(true);
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["foto3Item" + pilihKotak] != 20) {
_root["jumlahItem" + _root["foto3Item" + pilihKotak]]++;
_root["foto3Item" + pilihKotak] = 20;
}
item_mc._visible = false;
cekSquadAtribute(pilihKotak);
};
item_mc.buy_btn.onRelease = function () {
bisaTombol(false);
item_mc.gotoAndStop(1);
item_mc._visible = true;
cekItem();
item_mc.use_btn.onRelease = function () {
item_mc.gotoAndStop(3);
cekItem2();
};
item_mc.unuse_btn.onRelease = function () {
item_mc.gotoAndStop(3);
cekItem3();
};
item_mc.close_btn.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn2.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn3.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn4.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
};
};
squad_mc.powerChange1.onRelease = function () {
power_mc._visible = true;
power_mc.gotoAndStop(2);
i = 1;
while (i <= 8) {
power_mc["foto" + i].gotoAndStop(i);
power_mc["jumlah" + i] = _root["jumlahPower" + i];
power_mc["select" + i].onRelease = klikSelectPower1;
i++;
}
power_mc.close_btn.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn2.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn3.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn4.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.unselect_btn.onRelease = function () {
bisaTombol(true);
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["foto1Power" + pilihKotak] != 20) {
_root["jumlahPower" + _root["foto1Power" + pilihKotak]]++;
_root["foto1Power" + pilihKotak] = 20;
}
power_mc._visible = false;
cekSquadAtribute(pilihKotak);
};
power_mc.buy_btn.onRelease = function () {
bisaTombol(false);
power_mc.gotoAndStop(1);
power_mc._visible = true;
cekPower();
power_mc.use_btn.onRelease = function () {
power_mc.gotoAndStop(3);
cekPower2();
};
power_mc.unuse_btn.onRelease = function () {
power_mc.gotoAndStop(3);
cekPower3();
};
power_mc.close_btn.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn2.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn3.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn4.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
};
};
squad_mc.powerChange2.onRelease = function () {
power_mc._visible = true;
power_mc.gotoAndStop(2);
i = 1;
while (i <= 8) {
power_mc["foto" + i].gotoAndStop(i);
power_mc["jumlah" + i] = _root["jumlahPower" + i];
power_mc["select" + i].onRelease = klikSelectPower2;
i++;
}
power_mc.close_btn.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn2.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn3.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn4.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.unselect_btn.onRelease = function () {
bisaTombol(true);
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["foto2Power" + pilihKotak] != 20) {
_root["jumlahPower" + _root["foto2Power" + pilihKotak]]++;
_root["foto2Power" + pilihKotak] = 20;
}
power_mc._visible = false;
cekSquadAtribute(pilihKotak);
};
power_mc.buy_btn.onRelease = function () {
bisaTombol(false);
power_mc.gotoAndStop(1);
power_mc._visible = true;
cekPower();
power_mc.use_btn.onRelease = function () {
power_mc.gotoAndStop(3);
cekPower2();
};
power_mc.unuse_btn.onRelease = function () {
power_mc.gotoAndStop(3);
cekPower3();
};
power_mc.close_btn.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn2.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn3.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn4.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
};
};
squad_mc.powerChange3.onRelease = function () {
power_mc._visible = true;
power_mc.gotoAndStop(2);
i = 1;
while (i <= 8) {
power_mc["foto" + i].gotoAndStop(i);
power_mc["jumlah" + i] = _root["jumlahPower" + i];
power_mc["select" + i].onRelease = klikSelectPower3;
i++;
}
power_mc.close_btn.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn2.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn3.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn4.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.unselect_btn.onRelease = function () {
bisaTombol(true);
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["foto3Power" + pilihKotak] != 20) {
_root["jumlahPower" + _root["foto3Power" + pilihKotak]]++;
_root["foto3Power" + pilihKotak] = 20;
}
power_mc._visible = false;
cekSquadAtribute(pilihKotak);
};
power_mc.buy_btn.onRelease = function () {
bisaTombol(false);
power_mc.gotoAndStop(1);
power_mc._visible = true;
cekPower();
power_mc.use_btn.onRelease = function () {
power_mc.gotoAndStop(3);
cekPower2();
};
power_mc.unuse_btn.onRelease = function () {
power_mc.gotoAndStop(3);
cekPower3();
};
power_mc.close_btn.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn2.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn3.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn4.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
};
};
squad_mc.fireSquad.onRelease = function () {
msgBox_mc3._visible = true;
msgBox_mc3.yes_btn.onRelease = function () {
resetSquad(pilihKotak);
cekKlikKotak();
bisaTombol(true);
squad_mc._visible = false;
msgBox_mc3._visible = false;
};
msgBox_mc3.no_btn.onRelease = function () {
msgBox_mc3._visible = false;
};
};
squad_mc.close_btn.onRelease = function () {
bisaTombol(true);
squad_mc._visible = false;
};
squad_mc.close_btn2.onRelease = function () {
bisaTombol(true);
squad_mc._visible = false;
};
squad_mc.close_btn3.onRelease = function () {
bisaTombol(true);
squad_mc._visible = false;
};
squad_mc.close_btn4.onRelease = function () {
bisaTombol(true);
squad_mc._visible = false;
};
}
function cekSquadAtribute(indi) {
squad_mc.namaSquad = _root["namaSquad" + indi];
squad_mc.specialSquad = _root["specialSquad" + indi];
squad_mc.nomorSquad = "CS " + _root["nomorSquad" + indi];
squad_mc.fotoSquad.gotoAndStop(_root["fotoSquad" + indi]);
squad_mc.fotoWeapon.gotoAndStop(_root["fotoWeapon" + indi]);
squad_mc.fotoItem1.gotoAndStop(_root["foto1Item" + indi]);
squad_mc.fotoItem2.gotoAndStop(_root["foto2Item" + indi]);
squad_mc.fotoItem3.gotoAndStop(_root["foto3Item" + indi]);
squad_mc.fotoPower1.gotoAndStop(_root["foto1Power" + indi]);
squad_mc.fotoPower2.gotoAndStop(_root["foto2Power" + indi]);
squad_mc.fotoPower3.gotoAndStop(_root["foto3Power" + indi]);
squad_mc.lifeSquad.bar_mc._xscale = _root["lifeSquad" + indi];
squad_mc.strengthSquad.bar_mc._xscale = _root["strengthSquad" + indi];
squad_mc.agilitySquad.bar_mc._xscale = _root["agilitySquad" + indi];
if (_root["fotoWeapon" + indi] == _root["fotoSquad" + indi]) {
squad_mc.skillSquad.bar_mc._xscale = _root["skillSquad" + indi];
} else {
squad_mc.skillSquad.bar_mc._xscale = _root["skillSquad" + indi] * 0.5;
}
squad_mc.visionSquad.bar_mc._xscale = _root["visionSquad" + indi];
squad_mc.moraleSquad.bar_mc._xscale = _root["moraleSquad" + indi];
}
function klikSelectWeapon() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahWeapon" + indi] > 0) {
if (_root["fotoWeapon" + pilihKotak] == 20) {
_root["fotoWeapon" + pilihKotak] = indi;
_root["jumlahWeapon" + indi]--;
} else {
_root["jumlahWeapon" + _root["fotoWeapon" + pilihKotak]]++;
_root["fotoWeapon" + pilihKotak] = indi;
_root["jumlahWeapon" + indi]--;
}
weapon_mc._visible = false;
}
cekSquadAtribute(pilihKotak);
}
function klikSelectItem1() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahItem" + indi] > 0) {
if (_root["foto1Item" + pilihKotak] == 20) {
_root["foto1Item" + pilihKotak] = indi;
_root["jumlahItem" + indi]--;
} else {
_root["jumlahItem" + _root["foto1Item" + pilihKotak]]++;
_root["foto1Item" + pilihKotak] = indi;
_root["jumlahItem" + indi]--;
}
item_mc._visible = false;
}
cekSquadAtribute(pilihKotak);
}
function klikSelectItem2() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahItem" + indi] > 0) {
if (_root["foto2Item" + pilihKotak] == 20) {
_root["foto2Item" + pilihKotak] = indi;
_root["jumlahItem" + indi]--;
} else {
_root["jumlahItem" + _root["foto2Item" + pilihKotak]]++;
_root["foto2Item" + pilihKotak] = indi;
_root["jumlahItem" + indi]--;
}
item_mc._visible = false;
}
cekSquadAtribute(pilihKotak);
}
function klikSelectItem3() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahItem" + indi] > 0) {
if (_root["foto3Item" + pilihKotak] == 20) {
_root["foto3Item" + pilihKotak] = indi;
_root["jumlahItem" + indi]--;
} else {
_root["jumlahItem" + _root["foto3Item" + pilihKotak]]++;
_root["foto3Item" + pilihKotak] = indi;
_root["jumlahItem" + indi]--;
}
item_mc._visible = false;
}
cekSquadAtribute(pilihKotak);
}
function klikSelectPower1() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahPower" + indi] > 0) {
if (_root["foto1Power" + pilihKotak] == 20) {
_root["foto1Power" + pilihKotak] = indi;
_root["jumlahPower" + indi]--;
} else {
_root["jumlahPower" + _root["foto1Power" + pilihKotak]]++;
_root["foto1Power" + pilihKotak] = indi;
_root["jumlahPower" + indi]--;
}
power_mc._visible = false;
}
cekSquadAtribute(pilihKotak);
}
function klikSelectPower2() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahPower" + indi] > 0) {
if (_root["foto2Power" + pilihKotak] == 20) {
_root["foto2Power" + pilihKotak] = indi;
_root["jumlahPower" + indi]--;
} else {
_root["jumlahPower" + _root["foto2Power" + pilihKotak]]++;
_root["foto2Power" + pilihKotak] = indi;
_root["jumlahPower" + indi]--;
}
power_mc._visible = false;
}
cekSquadAtribute(pilihKotak);
}
function klikSelectPower3() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (_root["jumlahPower" + indi] > 0) {
if (_root["foto3Power" + pilihKotak] == 20) {
_root["foto3Power" + pilihKotak] = indi;
_root["jumlahPower" + indi]--;
} else {
_root["jumlahPower" + _root["foto3Power" + pilihKotak]]++;
_root["foto3Power" + pilihKotak] = indi;
_root["jumlahPower" + indi]--;
}
power_mc._visible = false;
}
cekSquadAtribute(pilihKotak);
}
function cekUpdateKini() {
xkiniMisi = kiniMisi;
i = 1;
while (i <= 10) {
if ((_root["misiSelesai" + i] == 0) || (_root["misiSelesai" + i] == undefined)) {
kiniMisi = i;
i = 10;
}
i++;
}
if (kiniMisi >= 2) {
achievementsDapat25 = 1;
}
if (kiniMisi >= 3) {
achievementsDapat26 = 1;
}
if (kiniMisi >= 4) {
achievementsDapat27 = 1;
}
if (kiniMisi >= 5) {
achievementsDapat28 = 1;
}
if (kiniMisi >= 6) {
achievementsDapat29 = 1;
}
if (kiniMisi >= 7) {
achievementsDapat30 = 1;
}
if (kiniMisi >= 8) {
achievementsDapat31 = 1;
}
if (kiniMisi >= 9) {
achievementsDapat32 = 1;
}
if (kiniMisi >= 10) {
achievementsDapat33 = 1;
}
}
function cekLainLain() {
bykPasukanKini = 0;
bykRifle = 0;
bykSniper = 0;
i = 1;
while (i <= 20) {
if (_root["kotak" + i] != undefined) {
if (_root["kotak" + i]._currentframe != 20) {
bykPasukanKini++;
}
if (_root["kotak" + i]._currentframe == 2) {
bykRifle++;
}
if (_root["kotak" + i]._currentframe == 3) {
bykSniper++;
}
}
i++;
}
totalAtributes = 0;
i = 1;
while (i <= 20) {
if (_root["kotak" + i]._currentframe != 20) {
totalAtributes = totalAtributes + _root["atributeValue" + i];
}
i++;
}
if (totalAtributes >= 5500) {
cekMisi(6, 2);
}
if (totalAtributes >= 6000) {
cekMisi(7, 3);
}
if (totalAtributes >= 6500) {
cekMisi(8, 3);
}
if (totalAtributes >= 7000) {
cekMisi(9, 4);
}
if (_root.jumlahPower4 >= 5) {
cekMisi(4, 4);
}
if (bykPasukanKini >= 5) {
cekMisi(2, 2);
}
if (bykPasukanKini >= 15) {
cekMisi(5, 2);
}
if (bykPasukanKini >= 20) {
cekMisi(7, 2);
}
if (bykPasukanKini >= 5) {
achievementsDapat21 = 1;
}
if (bykPasukanKini >= 10) {
achievementsDapat22 = 1;
}
if (bykPasukanKini >= 15) {
achievementsDapat23 = 1;
}
if (bykPasukanKini >= 20) {
achievementsDapat24 = 1;
}
if (bykRifle >= 6) {
cekMisi(3, 3);
}
if (bykSniper >= 6) {
cekMisi(4, 2);
}
if (money >= 5000) {
cekMisi(2, 3);
}
if (money >= 7500) {
cekMisi(3, 2);
}
if (money >= 50000) {
cekMisi(5, 3);
}
if (money >= 100000) {
cekMisi(6, 3);
}
if (money >= 1000000) {
cekMisi(8, 2);
}
if (money >= 2000000) {
cekMisi(9, 2);
}
}
stop();
if (adaSuara == true) {
volume1 = 25;
myMusic.setVolume(volume1);
}
namaWeapon = new Array("", "Handgun", "Rifle", "Sniper", "Mortar", "Grenade", "Rocket", "Laser");
soldier_mc._visible = false;
weapon_mc._visible = false;
item_mc._visible = false;
power_mc._visible = false;
objective_mc._visible = false;
achivement_mc._visible = false;
save_mc._visible = false;
menu_mc._visible = false;
statistic_mc._visible = false;
msgBox_mc._visible = false;
msgBox_mc2._visible = false;
msgBox_mc3._visible = false;
msgBox_mc4._visible = false;
squad_mc._visible = false;
tutorial_mc2._visible = false;
if (sudahTutorial2 == false) {
tutorial_mc2._visible = true;
tutorial_mc2.prev_btn.onRelease = function () {
if (ui.tutorial_mc._currentframe == 1) {
} else {
tutorial_mc2.gotoAndStop(tutorial_mc2._currentframe - 1);
}
};
tutorial_mc2.next_btn.onRelease = function () {
tutorial_mc2.gotoAndStop(tutorial_mc2._currentframe + 1);
if (tutorial_mc2._currentframe > 5) {
sudahTutorial2 = true;
tutorial_mc2._visible = false;
bisaTombol(true);
}
};
bisaTombol(false);
} else {
bisaTombol(true);
}
i = 1;
while (i <= 20) {
_root["kotak" + i].gotoAndStop(_root["fotoSquad" + i]);
i++;
}
if (autoSave == "on") {
autosave_mc.gotoAndStop(1);
} else {
autosave_mc.gotoAndStop(2);
}
more_btn.onRelease = function () {
getURL ("http://www.thegames8.com/", "_blank");
};
autosave_mc.onRelease = function () {
if (autoSave == "on") {
autoSave = "off";
autosave_mc.gotoAndStop(2);
} else {
autoSave = "on";
autosave_mc.gotoAndStop(1);
}
};
recruit_btn.onRelease = function () {
zbykPasukanKini = 0;
i = 1;
while (i <= 20) {
if (_root["kotak" + i] != undefined) {
if (_root["kotak" + i]._currentframe != 20) {
zbykPasukanKini++;
}
}
i++;
}
if (zbykPasukanKini >= 20) {
msgBox_mc4._visible = true;
msgBox_mc4.oke_btn.onRelease = function () {
msgBox_mc4._visible = false;
};
} else {
bisaTombol(false);
pilihRecruitWeapons = 1;
if (kiniMisi == 1) {
soldier_mc._visible = true;
cekRecruit(pilihRecruitWeapons);
} else {
cekWeaponRecruit();
}
soldier_mc.search_btn.onRelease = function () {
cekRecruit(pilihRecruitWeapons);
};
soldier_mc.close_btn.onRelease = function () {
bisaTombol(true);
soldier_mc._visible = false;
};
soldier_mc.close_btn2.onRelease = function () {
bisaTombol(true);
soldier_mc._visible = false;
};
soldier_mc.close_btn3.onRelease = function () {
bisaTombol(true);
soldier_mc._visible = false;
};
soldier_mc.close_btn4.onRelease = function () {
bisaTombol(true);
soldier_mc._visible = false;
};
}
};
weapon_btn.onRelease = function () {
bisaTombol(false);
weapon_mc.gotoAndStop(1);
weapon_mc._visible = true;
cekWeapon();
weapon_mc.close_btn.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn2.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn3.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
weapon_mc.close_btn4.onRelease = function () {
bisaTombol(true);
weapon_mc._visible = false;
};
};
item_btn.onRelease = function () {
bisaTombol(false);
item_mc.gotoAndStop(1);
item_mc._visible = true;
cekItem();
item_mc.use_btn.onRelease = function () {
item_mc.gotoAndStop(3);
item_mc.selectItem = "SELECT ITEM TO DISTRIBUTE TO ALL SOLDIERS";
cekItem2();
};
item_mc.unuse_btn.onRelease = function () {
item_mc.gotoAndStop(3);
item_mc.selectItem = "SELECT ITEM TO WITHDRAW FROM ALL SOLDIERS";
cekItem3();
};
item_mc.close_btn.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn2.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn3.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
item_mc.close_btn4.onRelease = function () {
bisaTombol(true);
item_mc._visible = false;
};
};
power_btn.onRelease = function () {
bisaTombol(false);
power_mc.gotoAndStop(1);
power_mc._visible = true;
cekPower();
power_mc.use_btn.onRelease = function () {
power_mc.gotoAndStop(3);
power_mc.selectPower = "SELECT POWER TO DISTRIBUTE TO ALL SOLDIERS";
cekPower2();
};
power_mc.unuse_btn.onRelease = function () {
power_mc.gotoAndStop(3);
power_mc.selectPower = "SELECT POWER TO WITHDRAW FROM ALL SOLDIERS";
cekPower3();
};
power_mc.close_btn.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn2.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn3.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
power_mc.close_btn4.onRelease = function () {
bisaTombol(true);
power_mc._visible = false;
};
};
objective_btn.onRelease = function () {
cekLainLain();
bisaTombol(false);
objective_mc._visible = true;
cekObjective();
cekUpdateKini();
objective_mc.close_btn.onRelease = function () {
bisaTombol(true);
objective_mc._visible = false;
};
objective_mc.close_btn2.onRelease = function () {
bisaTombol(true);
objective_mc._visible = false;
};
objective_mc.close_btn3.onRelease = function () {
bisaTombol(true);
objective_mc._visible = false;
};
objective_mc.close_btn4.onRelease = function () {
bisaTombol(true);
objective_mc._visible = false;
};
};
achievement_btn.onRelease = function () {
bisaTombol(false);
achivement_mc._visible = true;
cekAchivement();
achivement_mc.close_btn.onRelease = function () {
bisaTombol(true);
achivement_mc._visible = false;
};
achivement_mc.close_btn2.onRelease = function () {
bisaTombol(true);
achivement_mc._visible = false;
};
achivement_mc.close_btn3.onRelease = function () {
bisaTombol(true);
achivement_mc._visible = false;
};
achivement_mc.close_btn4.onRelease = function () {
bisaTombol(true);
achivement_mc._visible = false;
};
namaAchievements = new Array();
namaAchievements[1] = "First Enemy Dead";
namaAchievements[2] = "Our First Dead";
namaAchievements[3] = "Kill 250 enemies";
namaAchievements[4] = "Kill 500 enemies";
namaAchievements[5] = "Kill 750 enemies";
namaAchievements[6] = "Kill 1000 enemies";
namaAchievements[7] = "Kill 1500 enemies";
namaAchievements[8] = "Kill 2000 enemies";
namaAchievements[9] = "Kill 2500 enemies";
namaAchievements[10] = "Kill 3000 enemies";
namaAchievements[11] = "Kill 4000 enemies";
namaAchievements[12] = "Kill 5000 enemies";
namaAchievements[13] = "Kill 6000 enemies";
namaAchievements[14] = "Kill 7000 enemies";
namaAchievements[15] = "Win 10 battles";
namaAchievements[16] = "Win 15 battles";
namaAchievements[17] = "Win 20 battles";
namaAchievements[18] = "Win 25 battles";
namaAchievements[19] = "Win 30 battles";
namaAchievements[20] = "Win 35 battles";
namaAchievements[21] = "Have 5 members";
namaAchievements[22] = "Have 10 members";
namaAchievements[23] = "Have 15 members";
namaAchievements[24] = "Have 20 members";
namaAchievements[25] = "Finish Mission #1";
namaAchievements[26] = "Finish Mission #2";
namaAchievements[27] = "Finish Mission #3";
namaAchievements[28] = "Finish Mission #4";
namaAchievements[29] = "Finish Mission #5";
namaAchievements[30] = "Finish Mission #6";
namaAchievements[31] = "Finish Mission #7";
namaAchievements[32] = "Finish Mission #8";
namaAchievements[33] = "Finish Mission #9";
namaAchievements[34] = "Kill 10 members";
namaAchievements[35] = "Kill 30 members";
namaAchievements[36] = "Kill 50 members";
namaAchievements[37] = "Kill 70 members";
namaAchievements[38] = "Kill 90 members";
namaAchievements[39] = "Have 50 weapons";
namaAchievements[40] = "Have 100 weapons";
namaAchievements[41] = "Have 200 weapons";
namaAchievements[42] = "Have 50 items";
namaAchievements[43] = "Have 100 items";
namaAchievements[44] = "Have 200 items";
namaAchievements[45] = "Have 25 powers";
namaAchievements[46] = "Have 50 powers";
namaAchievements[47] = "Have 100 powers";
namaAchievements[48] = "Win the game twice";
i = 1;
while (i <= 48) {
if (_root["achievementsDapat" + i] == 0) {
achivement_mc["achievements" + i] = i + ". Locked";
} else {
achivement_mc["achievements" + i] = (i + ". ") + namaAchievements[i];
}
i++;
}
};
statistic_btn.onRelease = function () {
bisaTombol(false);
statistic_mc._visible = true;
cekStatistic();
statistic_mc.close_btn.onRelease = function () {
bisaTombol(true);
statistic_mc._visible = false;
};
statistic_mc.close_btn2.onRelease = function () {
bisaTombol(true);
statistic_mc._visible = false;
};
statistic_mc.close_btn3.onRelease = function () {
bisaTombol(true);
statistic_mc._visible = false;
};
statistic_mc.close_btn4.onRelease = function () {
bisaTombol(true);
statistic_mc._visible = false;
};
};
save_btn.onRelease = function () {
simpanData();
save_mc._visible = true;
save_mc.close_btn.onRelease = function () {
save_mc._visible = false;
};
};
menu_btn.onRelease = function () {
menu_mc._visible = true;
menu_mc.load_btn.onRelease = function () {
gotoAndStop (274);
};
menu_mc.quit_btn.onRelease = function () {
gotoAndStop (271);
};
menu_mc.close_btn.onRelease = function () {
menu_mc._visible = false;
};
};
continue_btn.onRelease = function () {
adaSenjataGak = true;
i = 1;
while (i <= 20) {
if (_root["kotak" + i]._currentframe != 20) {
if (_root["fotoWeapon" + i] == 20) {
adaSenjataGak = false;
}
}
i++;
}
if (adaSenjataGak == false) {
msgBox_mc2._visible = true;
msgBox_mc2.yes_btn.onRelease = function () {
if (autoSave == "on") {
simpanData();
}
delete _root.onEnterFrame;
gotoAndStop (272);
};
msgBox_mc2.no_btn.onRelease = function () {
msgBox_mc2._visible = false;
};
} else {
if (autoSave == "on") {
simpanData();
}
delete _root.onEnterFrame;
if (kiniMisi == 10) {
gotoAndStop (304);
} else {
gotoAndStop (272);
}
}
};
cekKlikKotak();
msgBox_mc.onEnterFrame = function () {
this._x = _root._xmouse;
this._y = _root._ymouse + 25;
};
_root.onEnterFrame = function () {
misiDone = 0;
i = 1;
while (i <= 9) {
j = 1;
while (j <= 5) {
if (_root[("misiSub" + i) + j] == 1) {
misiDone++;
}
j++;
}
i++;
}
weaponStock = 0;
itemStock = 0;
powerStock = 0;
i = 1;
while (i <= 7) {
weaponStock = weaponStock + _root["jumlahWeapon" + i];
i++;
}
if (weaponStock >= 50) {
achievementsDapat39 = 1;
}
if (weaponStock >= 100) {
achievementsDapat40 = 1;
}
if (weaponStock >= 200) {
achievementsDapat41 = 1;
}
i = 1;
while (i <= 8) {
itemStock = itemStock + _root["jumlahItem" + i];
i++;
}
if (itemStock >= 50) {
achievementsDapat42 = 1;
}
if (itemStock >= 100) {
achievementsDapat43 = 1;
}
if (itemStock >= 200) {
achievementsDapat44 = 1;
}
i = 1;
while (i <= 7) {
powerStock = powerStock + _root["jumlahPower" + i];
i++;
}
if (powerStock >= 25) {
achievementsDapat45 = 1;
}
if (powerStock >= 50) {
achievementsDapat46 = 1;
}
if (powerStock >= 100) {
achievementsDapat47 = 1;
}
xmoney = "Money: $" + money;
xday = "Day: " + day;
xwin = "Battle Win: " + win;
xtotalSquad = "Squad Member: " + bykPasukanKini;
xkilled = "Enemy Killed: " + totalKilled;
xtotalAtributes = "Squad Atributes: " + totalAtributes;
xmisiDone = ("Mission Done: " + misiDone) + "/45";
xweapon = "Weapon Stock: " + weaponStock;
xitem = "Item Stock: " + itemStock;
xpowerup = "Power Up Stock: " + powerStock;
soldier_mc.xmoney = "Money $" + money;
weapon_mc.xmoney = "Money $" + money;
item_mc.xmoney = "Money $" + money;
power_mc.xmoney = "Money $" + money;
i = 1;
while (i <= 20) {
if (_root["kotak" + i]._currentframe != 20) {
if (_root["fotoWeapon" + i] == 20) {
_root["kotak" + i].latar_mc.gotoAndStop(2);
} else if (_root["fotoWeapon" + i] != _root["fotoSquad" + i]) {
_root["kotak" + i].latar_mc.gotoAndStop(3);
} else {
_root["kotak" + i].latar_mc.gotoAndStop(1);
}
}
i++;
}
};
cekUpdateKini();
cekLainLain();
Frame 274
if (adaSuara == true) {
volume1 = 25;
myMusic.setVolume(volume1);
}
play();
Frame 303
loadData();
gotoAndStop (273);
Frame 304
stop();
if (adaSuara == true) {
volume1 = 25;
myMusic.setVolume(volume1);
}
winTheGame++;
initData();
simpanData();
play_btn.onRelease = function () {
gotoAndStop (271);
};
more_btn.onRelease = function () {
getURL ("http://www.thegames8.com/", "_blank");
};
Symbol 27 MovieClip Frame 1
this.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Symbol 35 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 4
_root.seranganJagoan(_parent);
_root.backGun();
Symbol 94 MovieClip Frame 30
stop();
_root.cekSisaPasukan();
Symbol 95 MovieClip [jagoan_mc1] Frame 1
stop();
Symbol 118 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 2
play();
Symbol 146 MovieClip Frame 1
stop();
Symbol 162 MovieClip Frame 11
_root.seranganMusuh(_parent);
_root.backGun();
Symbol 177 MovieClip Frame 30
removeMovieClip(_parent);
Symbol 178 MovieClip [musuh_mc1] Frame 1
stop();
Symbol 198 MovieClip Frame 4
_root.seranganJagoan(_parent);
_root.backRifle();
Symbol 198 MovieClip Frame 10
_root.seranganJagoan(_parent);
Symbol 215 MovieClip Frame 30
stop();
_root.cekSisaPasukan();
Symbol 216 MovieClip [jagoan_mc2] Frame 1
stop();
Symbol 235 MovieClip Frame 16
_root.seranganJagoan(_parent);
_root.backSniper();
Symbol 235 MovieClip Frame 45
_root.backReload();
_parent.gotoAndStop(1);
Symbol 252 MovieClip Frame 30
stop();
_root.cekSisaPasukan();
Symbol 253 MovieClip [jagoan_mc3] Frame 1
stop();
Symbol 272 MovieClip Frame 10
_root.seranganLedakJagoan(_parent);
_root.backMortar();
Symbol 272 MovieClip Frame 100
_parent.gotoAndStop(1);
Symbol 289 MovieClip Frame 30
stop();
_root.cekSisaPasukan();
Symbol 290 MovieClip [jagoan_mc4] Frame 1
stop();
Symbol 313 MovieClip Frame 9
_root.seranganLedakJagoan(_parent);
_root.backGranade();
Symbol 313 MovieClip Frame 110
_parent.gotoAndStop(1);
Symbol 330 MovieClip Frame 30
stop();
_root.cekSisaPasukan();
Symbol 331 MovieClip [jagoan_mc5] Frame 1
stop();
Symbol 352 MovieClip Frame 11
_root.seranganLedakJagoan(_parent);
_root.backLauncher();
Symbol 352 MovieClip Frame 120
_parent.gotoAndStop(1);
Symbol 369 MovieClip Frame 30
stop();
_root.cekSisaPasukan();
Symbol 370 MovieClip [jagoan_mc6] Frame 1
stop();
Symbol 393 MovieClip Frame 5
_root.seranganJagoan(_parent);
_root.backLaser();
Symbol 393 MovieClip Frame 8
_root.seranganJagoan(_parent);
Symbol 393 MovieClip Frame 11
_root.seranganJagoan(_parent);
Symbol 393 MovieClip Frame 14
_root.seranganJagoan(_parent);
Symbol 393 MovieClip Frame 17
_root.seranganJagoan(_parent);
Symbol 410 MovieClip Frame 30
stop();
_root.cekSisaPasukan();
Symbol 411 MovieClip [jagoan_mc7] Frame 1
stop();
Symbol 424 MovieClip Frame 4
_root.seranganMusuh(_parent);
_root.backRifle();
Symbol 424 MovieClip Frame 10
_root.seranganMusuh(_parent);
Symbol 441 MovieClip Frame 30
removeMovieClip(_parent);
Symbol 442 MovieClip [musuh_mc2] Frame 1
stop();
Symbol 459 MovieClip Frame 16
_root.seranganMusuh(_parent);
_root.backSniper();
Symbol 459 MovieClip Frame 45
_root.backReload();
Symbol 476 MovieClip Frame 30
removeMovieClip(_parent);
Symbol 477 MovieClip [musuh_mc3] Frame 1
stop();
Symbol 496 MovieClip Frame 10
_root.seranganLedakMusuh(_parent);
_root.backMortar();
Symbol 513 MovieClip Frame 30
removeMovieClip(_parent);
Symbol 514 MovieClip [musuh_mc4] Frame 1
stop();
Symbol 529 MovieClip Frame 8
_root.seranganLedakMusuh(_parent);
_root.backGranade();
Symbol 546 MovieClip Frame 30
removeMovieClip(_parent);
Symbol 547 MovieClip [musuh_mc5] Frame 1
stop();
Symbol 570 MovieClip Frame 11
_root.seranganLedakMusuh(_parent);
_root.backLauncher();
Symbol 587 MovieClip Frame 30
removeMovieClip(_parent);
Symbol 588 MovieClip [musuh_mc6] Frame 1
stop();
Symbol 611 MovieClip Frame 4
_root.seranganMusuh(_parent);
_root.backLaser();
Symbol 611 MovieClip Frame 7
_root.seranganMusuh(_parent);
Symbol 611 MovieClip Frame 10
_root.seranganMusuh(_parent);
Symbol 611 MovieClip Frame 13
_root.seranganMusuh(_parent);
Symbol 611 MovieClip Frame 16
_root.seranganMusuh(_parent);
Symbol 628 MovieClip Frame 30
removeMovieClip(_parent);
Symbol 629 MovieClip [musuh_mc7] Frame 1
stop();
Symbol 644 MovieClip Frame 8
_root.seranganLedakMusuh(_parent, "moncong");
_root.backGranade();
Symbol 665 MovieClip Frame 1
_root.backLedak();
Symbol 665 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 666 MovieClip [musuh_mc8] Frame 1
stop();
Symbol 670 MovieClip [musuh_mc9] Frame 1
stop();
Symbol 687 MovieClip Frame 10
_root.seranganLedakMusuh(_parent, "moncong");
_root.backLauncher();
Symbol 688 MovieClip [musuh_mc10] Frame 1
stop();
Symbol 714 MovieClip Frame 4
_root.seranganMusuh(_parent);
_root.backRifle();
Symbol 714 MovieClip Frame 6
_root.seranganMusuh(_parent);
Symbol 714 MovieClip Frame 8
_root.seranganMusuh(_parent);
_root.backRifle();
Symbol 714 MovieClip Frame 10
_root.seranganMusuh(_parent);
Symbol 714 MovieClip Frame 12
_root.seranganMusuh(_parent);
_root.backRifle();
Symbol 714 MovieClip Frame 14
_root.seranganMusuh(_parent);
Symbol 737 MovieClip Frame 1
_root.backLedak();
Symbol 737 MovieClip Frame 28
removeMovieClip(_parent);
Symbol 738 MovieClip [musuh_mc11] Frame 1
stop();
Symbol 764 MovieClip Frame 1
_root.seranganMusuh(_parent);
_root.backRifle();
Symbol 764 MovieClip Frame 3
_root.seranganMusuh(_parent);
Symbol 764 MovieClip Frame 5
_root.seranganMusuh(_parent);
_root.backRifle();
Symbol 764 MovieClip Frame 7
_root.seranganMusuh(_parent);
Symbol 764 MovieClip Frame 9
_root.seranganMusuh(_parent);
_root.backRifle();
Symbol 764 MovieClip Frame 11
_root.seranganMusuh(_parent);
Symbol 764 MovieClip Frame 13
_root.seranganMusuh(_parent);
_root.backRifle();
Symbol 764 MovieClip Frame 15
_root.seranganMusuh(_parent);
Symbol 787 MovieClip Frame 30
removeMovieClip(_parent);
Symbol 788 MovieClip [musuh_mc12] Frame 1
stop();
Symbol 803 MovieClip [ledakan1] Frame 1
_root.backLedak();
Symbol 803 MovieClip [ledakan1] Frame 19
removeMovieClip(this);
Symbol 805 MovieClip [darah_mc] Frame 60
removeMovieClip(this);
Symbol 808 MovieClip [badan1] Frame 60
removeMovieClip(this);
Symbol 811 MovieClip [badan2] Frame 60
removeMovieClip(this);
Symbol 814 MovieClip [badan3] Frame 60
removeMovieClip(this);
Symbol 817 MovieClip [badan4] Frame 60
removeMovieClip(this);
Symbol 820 MovieClip [badan5] Frame 60
removeMovieClip(this);
Symbol 823 MovieClip [badan6] Frame 60
removeMovieClip(this);
Symbol 826 MovieClip [badan1x] Frame 60
removeMovieClip(this);
Symbol 829 MovieClip [badan2x] Frame 60
removeMovieClip(this);
Symbol 832 MovieClip [badan3x] Frame 60
removeMovieClip(this);
Symbol 835 MovieClip [badan4x] Frame 60
removeMovieClip(this);
Symbol 838 MovieClip [badan5x] Frame 60
removeMovieClip(this);
Symbol 841 MovieClip [badan6x] Frame 60
removeMovieClip(this);
Symbol 851 MovieClip [peluruExplode] Frame 1
stop();
Symbol 869 MovieClip Frame 1
stop();
Symbol 887 MovieClip Frame 1
stop();
Symbol 918 MovieClip Frame 1
stop();
Symbol 938 MovieClip Frame 1
stop();
Symbol 953 MovieClip [bendera_mc] Frame 1
stop();
Symbol 961 MovieClip [win_mc] Frame 1
stop();
Symbol 980 MovieClip [heli_mc] Frame 1
stop();
Symbol 986 MovieClip [peluruLaser] Frame 10
removeMovieClip(this);
Symbol 1071 MovieClip Frame 1
stop();
Symbol 1072 MovieClip [useAllItem] Frame 1
stop();
Symbol 1096 MovieClip Frame 1
stop();
Symbol 1097 MovieClip [useAllPower] Frame 1
stop();
Symbol 1099 MovieClip [peluruExplode2] Frame 1
stop();
Symbol 1106 MovieClip [efekAsap] Frame 1
play();
Symbol 1106 MovieClip [efekAsap] Frame 20
removeMovieClip(this);
Symbol 1108 MovieClip [peluruGun] Frame 3
removeMovieClip(this);
Symbol 1148 MovieClip Frame 1
this.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Symbol 1148 MovieClip Frame 225
stop();
Symbol 1181 MovieClip Frame 1
stop();
Symbol 1234 MovieClip Frame 1
stop();
Symbol 1350 MovieClip Frame 1
stop();
Symbol 1398 MovieClip Frame 1
stop();
Symbol 1437 MovieClip Frame 1
stop();
Symbol 1567 MovieClip Frame 1
stop();