Frame 1
function simpanData() {
Cookies = SharedObject.getLocal("xbattleGearUndergroundGame");
i = 1;
while (i <= simpanSemua.length) {
Cookies.data["battleGearUnderData" + i] = eval (simpanSemua[i]);
i++;
}
i = 1;
while (i <= 43) {
Cookies.data["slotUnlok" + i] = slotUnlok[i];
i++;
}
i = 1;
while (i <= 30) {
Cookies.data["slot" + i] = slot[i];
i++;
}
i = 1;
while (i <= 43) {
Cookies.data["levelSpeed" + i] = levelSpeed[i];
Cookies.data["levelRange" + i] = levelRange[i];
Cookies.data["levelLive" + i] = levelLive[i];
Cookies.data["levelDamage" + i] = levelDamage[i];
i++;
}
i = 1;
while (i <= 15) {
Cookies.data["levelSkill" + i] = levelSkill[i];
i++;
}
if (tingkatSulit == undefined) {
tingkatSulit = 2;
}
Cookies.flush();
}
function loadData() {
Cookies = SharedObject.getLocal("xbattleGearUndergroundGame");
i = 1;
while (i <= simpanSemua.length) {
_root[simpanSemua[i]] = Cookies.data["battleGearUnderData" + i];
i++;
}
i = 1;
while (i <= 43) {
slotUnlok[i] = Cookies.data["slotUnlok" + i];
i++;
}
i = 1;
while (i <= 30) {
slot[i] = Cookies.data["slot" + i];
i++;
}
i = 1;
while (i <= 43) {
levelSpeed[i] = Cookies.data["levelSpeed" + i];
levelRange[i] = Cookies.data["levelRange" + i];
levelLive[i] = Cookies.data["levelLive" + i];
levelDamage[i] = Cookies.data["levelDamage" + i];
i++;
}
i = 1;
while (i <= 15) {
levelSkill[i] = Cookies.data["levelSkill" + i];
i++;
}
if (tingkatSulit == undefined) {
tingkatSulit = 2;
}
Cookies.flush();
}
function initData() {
daftarNama = new Array("", "Gun", "Rifle", "Grenade", "Mortar", "Machine Gun", "Heavy Machine Gun", "Bazzoka", "Missile Launcher", "Rocket Launcher", "Troops Truck", "Gun Truck", "Heavy Truck", "Gun Stug", "Heavy Stug", "Launcher Tank", "Cannon Tank", "Heavy Tank", "Helicopter", "Gun Helicopter", "Air Craft", "Gun Air Craft", "Missile Air Craft", "Bomber Air Craft", "Bomber Air Plane", "Bomber Jet", "Rifle Tower", "Grenade Tower", "Sniper Tower", "Machine Gun Tower", "Bazzoka Tower", "Rocket Launcher Tower", "Rifle Turret", "Cannon Turret", "Rocket Turret", "Heavy Cannon Turret", "Heavy Rocket Turret", "Missile Shark", "Desert Thunder", "Heavy Arm", "Deadly Strike", "Super Soldier", "Super Tank", "Super Helicopter");
daftarSpell = new Array("", "Attack the Wall", "Multiple Spawn", "Horde Of War", "On Fire", "Mighty Heroes", "Bullet Proof", "Knight Power", "King's Raid");
penjelasanSpell = new Array("", "Allowing unit to attack the barrier wall", "Spawn in four rows at once", "Spawn four units at once in one line", "Increases damage and life", "Increases speed and range", "Makes unit bullet proof", "Jumping higher and incraeses all atributes", "Destroy every enemy units in one row");
daftarExp2 = new Array("", 0, 50, 100, 150, 200, 250, 300, 350);
daftarLevel2 = new Array("", 1, 5, 9, 13, 18, 23, 28, 33);
daftarSpeed = new Array("", 4.5, 3.5, 3, 3, 4, 4.5, 3, 2.5, 2, 5.5, 5, 4.5, 3.5, 3.5, 2.5, 2, 1.5, 3.5, 4, 9, 11, 10, 4, 6, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 3.5, 2.5);
daftarRange = new Array("", 350, 375, 400, 550, 650, 350, 600, 650, 700, 450, 500, 550, 400, 450, 650, 700, 750, 500, 650, 800, 850, 900, 50, 75, 950, 500, 550, 850, 650, 750, 800, 600, 700, 800, 850, 900, 0, 0, 0, 0, 750, 850, 0);
daftarLive = new Array("", 150, 200, 100, 125, 350, 450, 250, 350, 450, 600, 850, 1100, 1500, 1750, 2500, 3500, 4500, 1000, 1500, 2500, 3000, 3500, 4500, 5500, 6500, 750, 1000, 1250, 1500, 1750, 2000, 2500, 3000, 3500, 5000, 6500, 0, 0, 0, 0, 5000, 7500, 6000);
daftarDamage = new Array("", 30, 45, 75, 100, 200, 75, 500, 750, 1000, 45, 65, 75, 75, 100, 400, 500, 600, 150, 300, 40, 60, 80, 1000, 1500, 400, 45, 250, 75, 125, 450, 600, 50, 350, 450, 500, 600, 350, 700, 1050, 1400, 750, 1000, 0);
daftarHarga = new Array("", 100, 150, 200, 250, 300, 350, 400, 450, 500, 300, 450, 600, 750, 900, 1150, 1300, 1450, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000, 150, 200, 300, 350, 450, 500, 300, 450, 600, 750, 900, 500, 750, 1000, 1250, 2500, 3500, 4500);
daftarExp = new Array("", 0, 7, 10, 15, 20, 25, 30, 45, 60, 0, 35, 40, 50, 55, 75, 90, 120, 0, 150, 100, 125, 150, 175, 200, 250, 0, 100, 150, 200, 250, 300, 350, 100, 150, 200, 250, 300, 100, 150, 200, 250, 300, 350);
daftarLevel = new Array("", 1, 1, 2, 4, 7, 10, 13, 16, 19, 5, 8, 11, 14, 17, 20, 23, 26, 12, 15, 18, 21, 24, 27, 30, 33, 1, 4, 7, 10, 13, 16, 11, 15, 20, 25, 30, 23, 25, 27, 29, 30, 33, 36);
i = 1;
while (i <= 50) {
daftarExp[i] = daftarExp[i] * 2;
i++;
}
}
function initPertama() {
kotaSudahMenang1 = false;
kotaSudahMenang2 = false;
kotaSudahMenang3 = false;
kotaSudahMenang4 = false;
kotaSudahMenang5 = false;
kotaSudahMenang6 = false;
kotaSudahMenang7 = false;
kotaSudahMenang8 = false;
kotaSudahMenang9 = false;
kotaSudahMenang10 = false;
kotaSudahMenang11 = false;
kotaSudahMenang12 = false;
kotaSudahMenang13 = false;
kotaSudahMenang14 = false;
kotaSudahMenang15 = false;
kotaSudahMenang16 = false;
kotaSudahMenang17 = false;
kotaSudahMenang18 = false;
kotaSudahMenang19 = false;
kotaSudahMenang20 = false;
kotaSudahMenang21 = false;
kotaSudahMenang22 = false;
kotaSudahMenang23 = false;
kotaSudahMenang24 = false;
kotaSudahMenang25 = false;
kotaSudahMenang26 = false;
kotaSudahMenang27 = false;
kotaSudahMenang28 = false;
kotaSudahMenang29 = false;
kotaSudahMenang30 = false;
kotaSudahMenang31 = false;
kotaSudahMenang32 = false;
kotaSudahMenang33 = false;
kotaSudahMenang34 = false;
kotaSudahMenang35 = false;
kotaSudahMenang36 = false;
kotaSudahMenang37 = false;
kotaSudahMenang38 = false;
kotaSudahMenang39 = false;
kotaSudahMenang40 = false;
zmedals1 = false;
zmedals2 = false;
zmedals3 = false;
zmedals4 = false;
zmedals5 = false;
zmedals6 = false;
zmedals7 = false;
zmedals8 = false;
zmedals9 = false;
zmedals10 = false;
zmedals11 = false;
zmedals12 = false;
zmedals13 = false;
zmedals14 = false;
}
function initAwalan() {
levelKe = 1;
pilhanLevel = 1;
pilihJalur = 0;
zpilihJalur = pilihJalur;
tipeJenis = 1;
banyakJenis = 7;
bykJumlah = 43;
xexp = 0;
money1 = 3000;
nyawaGame = 10;
bisaUnit1 = false;
bisaUnit2 = false;
bisaUnit3 = false;
bisaUnit4 = false;
bisaUnit5 = false;
bisaUnit6 = false;
bisaUnit7 = false;
bisaUnit8 = false;
bisaUnit9 = false;
bisaUnit10 = false;
bisaUnit11 = false;
bisaUnit12 = false;
bisaUnit13 = false;
bisaUnit14 = false;
bisaUnit15 = false;
bisaUnit16 = false;
bisaUnit17 = false;
bisaUnit18 = false;
bisaUnit19 = false;
bisaUnit20 = false;
bisaUnit21 = false;
bisaUnit22 = false;
bisaUnit23 = false;
bisaUnit24 = false;
bisaUnit25 = false;
bisaUnit26 = false;
bisaUnit27 = false;
bisaUnit28 = false;
bisaUnit29 = false;
bisaUnit30 = false;
bisaUnit31 = false;
bisaUnit32 = false;
bisaUnit33 = false;
bisaUnit34 = false;
bisaUnit35 = false;
bisaUnit36 = false;
bisaUnit37 = false;
bisaUnit38 = false;
bisaUnit39 = false;
bisaUnit40 = false;
bisaUnit41 = false;
bisaUnit42 = false;
bisaUnit43 = false;
bisaSupported1 = true;
bisaSupported2 = false;
bisaSupported3 = false;
bisaSupported4 = false;
bisaSupported5 = false;
bisaSupported6 = false;
bisaSupported7 = false;
bisaSupported8 = false;
adaEfekKah = true;
tipeSulitCampaign = 2;
jenisCampaign = 1;
jenisMorale = "offence";
jenisAppear = "random";
tipeGameLife = "Limited";
menangTerus1 = 0;
menangTerus2 = 0;
menangTerus3 = 0;
infantry1 = 0;
artillery1 = 0;
airforce1 = 0;
navy1 = 0;
buildings1 = 0;
totWin1 = 0;
totLose1 = 0;
infantry2 = 0;
artillery2 = 0;
airforce2 = 0;
navy2 = 0;
buildings2 = 0;
totWin2 = 0;
totLose2 = 0;
menangSingle = 0;
menangSingle2 = 0;
menangSingle3 = 0;
campaignWin1 = 0;
campaignWin2 = 0;
campaignWin3 = 0;
perfectSemua = 0;
tutorialWar = false;
tutorialSetup = false;
slotUnlok = new Array();
i = 1;
while (i <= bykJumlah) {
slotUnlok[i] = 0;
i++;
}
slotUnlok[1] = 1;
slotUnlok[2] = 1;
slotUnlok[26] = 1;
slot = new Array();
i = 1;
while (i <= 30) {
slot[i] = 90;
i++;
}
slot[1] = 1;
slot[2] = 2;
slot[3] = 26;
levelSpeed = new Array();
levelRange = new Array();
levelLive = new Array();
levelDamage = new Array();
i = 1;
while (i <= bykJumlah) {
levelSpeed[i] = 1;
levelRange[i] = 1;
levelLive[i] = 1;
levelDamage[i] = 1;
i++;
}
levelSkill = new Array();
i = 1;
while (i <= 15) {
levelSkill[i] = 1;
i++;
}
bykPasukan1 = 20 + (1 * (levelSkill[1] - 1));
baseJagoan = 10 * (2500 + (5000 * (levelSkill[2] - 1)));
tingkatSulit = 2;
}
function backMusic() {
myMusic.stop();
myMusic = new Sound(musicy);
myMusic.attachSound("backMusic");
myMusic.start(0, 1);
myMusic.setVolume(volum1);
myMusic.onSoundComplete = function () {
backMusic();
};
}
function backMain() {
myMusic.stop();
myMusic = new Sound(musicy);
myMusic.attachSound("backMain");
myMusic.start(0, 1);
myMusic.setVolume(volum1);
myMusic.onSoundComplete = function () {
backMain();
};
}
function backWin() {
myMusic.stop();
myMusic = new Sound(musicy);
myMusic.attachSound("backWin");
myMusic.start(0, 1);
myMusic.setVolume(volum1);
}
function backLose() {
myMusic.stop();
myMusic = new Sound(musicy);
myMusic.attachSound("backLose");
myMusic.start(0, 1);
myMusic.setVolume(volum1);
}
function sound1() {
rand = random(3);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound1");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound3() {
rand = random(2);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound3");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound4() {
rand = random(3);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound4");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound5() {
rand = random(2);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound5");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound6() {
rand = random(2);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound6");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound7() {
rand = random(2);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound7");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound8() {
rand = random(2);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound8");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound9() {
rand = random(2);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound9");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound15() {
rand = random(2);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound15");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound16() {
rand = random(2);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound16");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function sound17() {
rand = random(2);
if (rand == 0) {
mySound = new Sound(soundy);
mySound.attachSound("sound17");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function backMati() {
xrand = random(4) + 1;
mySound = new Sound(soundy);
mySound.attachSound("backMati" + xrand);
mySound.start(0, 1);
mySound.setVolume(volum2);
}
function backLedak() {
xrand = random(4) + 1;
mySound = new Sound(soundy);
mySound.attachSound("backLedak" + xrand);
mySound.start(0, 1);
mySound.setVolume(volum2);
}
function backHeli() {
mySound = new Sound(soundy);
mySound.attachSound("backHeli");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
function backHeli() {
mySound = new Sound(soundy);
mySound.attachSound("backHeli");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
function backJatuh() {
xrand = random(2) + 1;
mySound = new Sound(soundy);
mySound.attachSound("backJatuh" + xrand);
mySound.start(0, 1);
mySound.setVolume(volum2);
}
function backCopter() {
mySound = new Sound(soundy);
mySound.attachSound("backCopter");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
function backJatuhCopter() {
mySound = new Sound(soundy);
mySound.attachSound("backJatuhCopter");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
function backAir() {
mySound = new Sound(soundy);
mySound.attachSound("backAir");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
function backBoat() {
rand = random(3);
if (rand >= 1) {
mySound = new Sound(soundy);
mySound.attachSound("backBoat");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
}
function boatHancur() {
mySound = new Sound(soundy);
mySound.attachSound("boatHancur");
mySound.start(0, 1);
mySound.setVolume(volum2);
}
function backWater() {
xrand = random(4) + 1;
mySound = new Sound(soundy);
mySound.attachSound("backAir" + xrand);
mySound.start(0, 1);
mySound.setVolume(volum2);
}
stop();
fscommand ("fullscreen", false);
fscommand ("allowscale", true);
fscommand ("showmenu", false);
Stage.showMenu = false;
this.onEnterFrame = function () {
persen = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
xpersen = persen + " %";
bar_mc.gotoAndStop(persen);
if (persen >= 100) {
gotoAndStop ("completed");
delete this.onEnterFrame;
}
};
simpanSemua = new Array("", "levelKe", "pilhanLevel", "pilihJalur", "zpilihJalur", "tipeJenis", "banyakJenis", "bykJumlah", "xexp", "money1", "nyawaGame", "bisaUnit1", "bisaUnit2", "bisaUnit3", "bisaUnit4", "bisaUnit5", "bisaUnit6", "bisaUnit7", "bisaUnit8", "bisaUnit9", "bisaUnit10", "bisaUnit11", "bisaUnit12", "bisaUnit13", "bisaUnit14", "bisaUnit15", "bisaUnit16", "bisaUnit17", "bisaUnit18", "bisaUnit19", "bisaUnit20", "bisaUnit21", "bisaUnit22", "bisaUnit23", "bisaUnit24", "bisaUnit25", "bisaUnit26", "bisaUnit27", "bisaUnit28", "bisaUnit29", "bisaUnit30", "bisaUnit31", "bisaUnit32", "bisaUnit33", "bisaUnit34", "bisaUnit35", "bisaUnit36", "bisaUnit37", "bisaUnit38", "bisaUnit39", "bisaUnit40", "bisaUnit41", "bisaUnit42", "bisaUnit43", "bisaSupported1", "bisaSupported2", "bisaSupported3", "bisaSupported4", "bisaSupported5", "bisaSupported6", "bisaSupported7", "bisaSupported8", "tipeSulitCampaign", "jenisCampaign", "jenisMorale", "jenisAppear", "tipeGameLife", "menangTerus1", "menangTerus2", "menangTerus3", "infantry1", "artillery1", "airforce1", "navy1", "buildings1", "totWin1", "totLose1", "infantry2", "artillery2", "airforce2", "navy2", "buildings2", "totWin2", "totLose2", "menangSingle", "menangSingle2", "menangSingle3", "campaignWin1", "campaignWin2", "campaignWin3", "perfectSemua", "tutorialWar", "tutorialSetup", "bykPasukan1", "baseJagoan", "kotaSudahMenang1", "kotaSudahMenang2", "kotaSudahMenang3", "kotaSudahMenang4", "kotaSudahMenang5", "kotaSudahMenang6", "kotaSudahMenang7", "kotaSudahMenang8", "kotaSudahMenang9", "kotaSudahMenang10", "kotaSudahMenang11", "kotaSudahMenang12", "kotaSudahMenang13", "kotaSudahMenang14", "kotaSudahMenang15", "kotaSudahMenang16", "kotaSudahMenang17", "kotaSudahMenang18", "kotaSudahMenang19", "kotaSudahMenang20", "kotaSudahMenang21", "kotaSudahMenang22", "kotaSudahMenang23", "kotaSudahMenang24", "kotaSudahMenang25", "kotaSudahMenang26", "kotaSudahMenang27", "kotaSudahMenang28", "kotaSudahMenang29", "kotaSudahMenang30", "kotaSudahMenang31", "kotaSudahMenang32", "kotaSudahMenang33", "kotaSudahMenang34", "kotaSudahMenang35", "kotaSudahMenang36", "kotaSudahMenang37", "kotaSudahMenang38", "kotaSudahMenang39", "kotaSudahMenang40", "adaEfekKah", "zmedals1", "zmedals2", "zmedals3", "zmedals4", "zmedals5", "zmedals6", "zmedals7", "zmedals8", "zmedals9", "zmedals10", "zmedals11", "zmedals12", "zmedals13", "zmedals14", "tingkatSulit");
qualityGame = 1;
_quality = "HIGH";
adaSuara = true;
initAwalan();
loadData();
if (levelKe == undefined) {
initPertama();
initAwalan();
}
soundy = attachMovie("windi", "soundy", 4);
musicy = attachMovie("windi", "musicy", 5);
soundy._x = -200;
soundy._y = -200;
musicy._x = -200;
musicy._y = -200;
volum1 = 75;
volum2 = 25;
perfectSemua = 0;
qualityGame = 1;
tipeSulitSingle = 1;
zpilihanMap = 1;
_quality = "HIGH";
Frame 20
stop();
gotoAndStop (31);
Frame 31
stop();
Frame 32
gotoAndStop (33);
Frame 33
play();
Frame 212
stop();
backMusic();
gotoAndStop (213);
Frame 213
function overBesi() {
infoBox = attachMovie("info_box", "info_box", dalamInfo);
infoBox.cacheAsBitmap = true;
infoBox._x = background_mc._x + this._x;
infoBox._y = (background_mc._y + this._y) - 100;
infoBox.judul = "Barrier Wall";
infoBox.isi = "Impassable except by Aircraft, can be destroyed by supported skill.";
}
function overBatu() {
infoBox = attachMovie("info_box", "info_box", dalamInfo);
infoBox.cacheAsBitmap = true;
infoBox._x = background_mc._x + this._x;
infoBox._y = (background_mc._y + this._y) - 100;
infoBox.judul = "Small Hill";
infoBox.isi = "Units will stop here until gather minimum of 5 units.";
}
function overRapuh() {
infoBox = attachMovie("info_box", "info_box", dalamInfo);
infoBox.cacheAsBitmap = true;
infoBox._x = (background_mc._x + this._x) + 185;
infoBox._y = (background_mc._y + this._y) - 100;
infoBox.judul = "Soft Ground";
infoBox.isi = "Can be destroyed if trampled by units, especially heavy units.";
}
function overKendaraan() {
infoBox = attachMovie("info_box", "info_box", dalamInfo);
infoBox.cacheAsBitmap = true;
infoBox._x = background_mc._x + this._x;
infoBox._y = (background_mc._y + this._y) - 100;
infoBox.judul = "Abandoned Unit";
infoBox.isi = "Can be able to control if any infantry unit hit it.";
}
function outOfTheBox() {
removeMovieClip(infoBox);
}
function cekLevelGame4() {
if (levelKe == 30) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
_root["startBuatMusuhSupport" + i] = 0;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 250;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
bykTowerMusuh = 3;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
bykTowerJagoan = 3;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 4;
banyakBesi = 1;
posBesi1 = 2;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 4;
posKendaraan1 = 4;
posKendaraan2 = 3;
posKendaraan3 = 2;
posKendaraan4 = 1;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 31) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 8;
posKendaraan1 = 4;
posKendaraan2 = 3;
posKendaraan3 = 2;
posKendaraan4 = 1;
posKendaraan5 = 4;
posKendaraan6 = 3;
posKendaraan7 = 2;
posKendaraan8 = 1;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 32) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 2000;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
background_mc.rapuh2.pos = 3;
background_mc.rapuh2.nyawa = 2000;
background_mc.rapuh2.maxNyawa = background_mc.rapuh2.nyawa;
background_mc.rapuh2.onEnterFrame = enterRapuh;
background_mc.rapuh3.pos = 2;
background_mc.rapuh3.nyawa = 2000;
background_mc.rapuh3.maxNyawa = background_mc.rapuh3.nyawa;
background_mc.rapuh3.onEnterFrame = enterRapuh;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 3;
posBesi4 = 4;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 2;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 33) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 2000;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
background_mc.rapuh2.pos = 3;
background_mc.rapuh2.nyawa = 2000;
background_mc.rapuh2.maxNyawa = background_mc.rapuh2.nyawa;
background_mc.rapuh2.onEnterFrame = enterRapuh;
background_mc.rapuh3.pos = 2;
background_mc.rapuh3.nyawa = 2000;
background_mc.rapuh3.maxNyawa = background_mc.rapuh3.nyawa;
background_mc.rapuh3.onEnterFrame = enterRapuh;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 3;
posBesi4 = 4;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 2;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 34) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 2000;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
background_mc.rapuh2.pos = 3;
background_mc.rapuh2.nyawa = 2000;
background_mc.rapuh2.maxNyawa = background_mc.rapuh2.nyawa;
background_mc.rapuh2.onEnterFrame = enterRapuh;
background_mc.rapuh3.pos = 2;
background_mc.rapuh3.nyawa = 2000;
background_mc.rapuh3.maxNyawa = background_mc.rapuh3.nyawa;
background_mc.rapuh3.onEnterFrame = enterRapuh;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 3;
posBesi4 = 4;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 2;
posKendaraan1 = 2;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 35) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
bykTowerMusuh = 0;
bykTowerJagoan = 0;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 36) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
bykTowerMusuh = 0;
bykTowerJagoan = 0;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 37) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 0;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 2;
posBesi4 = 3;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 38) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
bykTowerMusuh = 8;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
posTowerMusuh5 = 1;
posTowerMusuh6 = 2;
posTowerMusuh7 = 3;
posTowerMusuh8 = 4;
bykTowerJagoan = 0;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 39) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 2000;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 0;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 40) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 2000;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
background_mc.rapuh2.pos = 3;
background_mc.rapuh2.nyawa = 2000;
background_mc.rapuh2.maxNyawa = background_mc.rapuh2.nyawa;
background_mc.rapuh2.onEnterFrame = enterRapuh;
background_mc.rapuh3.pos = 2;
background_mc.rapuh3.nyawa = 2000;
background_mc.rapuh3.maxNyawa = background_mc.rapuh3.nyawa;
background_mc.rapuh3.onEnterFrame = enterRapuh;
bykTowerMusuh = 7;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
posTowerMusuh5 = 1;
posTowerMusuh6 = 2;
posTowerMusuh7 = 3;
bykTowerJagoan = 0;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 3;
posBesi4 = 4;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 2;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
}
}
function cekLevelGame3() {
if (levelKe == 20) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
_root["startBuatMusuhSupport" + i] = 0;
i++;
}
bykPasukan2 = 40;
money2 = 6500;
baseMusuh = 25000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.batu5.isiJagoan = 0;
background_mc.batu5.isiMusuh = 0;
background_mc.batu6.isiJagoan = 0;
background_mc.batu6.isiMusuh = 0;
background_mc.batu7.isiJagoan = 0;
background_mc.batu7.isiMusuh = 0;
background_mc.batu8.isiJagoan = 0;
background_mc.batu8.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 21) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 6500;
baseMusuh = 25000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 3;
background_mc.rel3.pos = 4;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 22) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 6500;
baseMusuh = 25000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 3;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 4;
background_mc.rel5.pos = 4;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 2;
posBesi1 = 2;
posBesi2 = 2;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 23) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 6500;
baseMusuh = 25000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 2;
posBesi1 = 1;
posBesi2 = 1;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 24) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 6500;
baseMusuh = 25000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 2000;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
background_mc.rapuh2.pos = 3;
background_mc.rapuh2.nyawa = 2000;
background_mc.rapuh2.maxNyawa = background_mc.rapuh2.nyawa;
background_mc.rapuh2.onEnterFrame = enterRapuh;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 1;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 2;
posBesi1 = 3;
posBesi2 = 1;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 2;
posKendaraan1 = 1;
posKendaraan2 = 2;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 25) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 250;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
bykTowerMusuh = 3;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
bykTowerJagoan = 3;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
banyakBesi = 4;
posBesi1 = 3;
posBesi2 = 2;
posBesi3 = 1;
posBesi4 = 2;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 2;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 26) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
bykTowerMusuh = 0;
bykTowerJagoan = 5;
posTowerJagoan1 = 1;
posTowerJagoan2 = 1;
posTowerJagoan3 = 2;
posTowerJagoan4 = 2;
posTowerJagoan5 = 3;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 2;
posBesi4 = 3;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 27) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
bykTowerMusuh = 2;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
bykTowerJagoan = 0;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 2;
posBesi4 = 3;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 28) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 29) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 40;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
bykTowerMusuh = 0;
bykTowerJagoan = 0;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
posKendaraan1 = 4;
posKendaraan2 = 4;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
}
}
function cekLevelGame2() {
if (levelKe == 10) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
_root["startBuatMusuhSupport" + i] = 0;
i++;
}
bykPasukan2 = 25;
money2 = 3000;
baseMusuh = 7500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rapuh1.pos = 3;
background_mc.rapuh1.nyawa = 500;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
bykTowerMusuh = 3;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
bykTowerJagoan = 3;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 1;
posBesi4 = 2;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 11) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 125 + (i * 5);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 25;
money2 = 3000;
baseMusuh = 7500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rapuh1.pos = 2;
background_mc.rapuh1.nyawa = 1000;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
bykTowerMusuh = 3;
posTowerMusuh1 = 1;
posTowerMusuh2 = 1;
posTowerMusuh3 = 1;
bykTowerJagoan = 3;
posTowerJagoan1 = 1;
posTowerJagoan2 = 1;
posTowerJagoan3 = 1;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 12) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 125 + (i * 5);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 25;
money2 = 3500;
baseMusuh = 10000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rapuh1.pos = 2;
background_mc.rapuh1.nyawa = 1000;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
background_mc.rapuh2.pos = 3;
background_mc.rapuh2.nyawa = 1000;
background_mc.rapuh2.maxNyawa = background_mc.rapuh2.nyawa;
background_mc.rapuh2.onEnterFrame = enterRapuh;
bykTowerMusuh = 3;
posTowerMusuh1 = 1;
posTowerMusuh2 = 1;
posTowerMusuh3 = 1;
bykTowerJagoan = 3;
posTowerJagoan1 = 1;
posTowerJagoan2 = 1;
posTowerJagoan3 = 1;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 13) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 125 + (i * 5);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 25;
money2 = 4000;
baseMusuh = 10000;
maxBuatMusuhTower = 250;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 3;
background_mc.rel3.pos = 4;
bykTowerMusuh = 6;
posTowerMusuh1 = 3;
posTowerMusuh2 = 3;
posTowerMusuh3 = 3;
posTowerMusuh4 = 1;
posTowerMusuh5 = 1;
posTowerMusuh6 = 1;
bykTowerJagoan = 6;
posTowerJagoan1 = 3;
posTowerJagoan2 = 3;
posTowerJagoan3 = 3;
posTowerJagoan4 = 1;
posTowerJagoan5 = 1;
posTowerJagoan6 = 1;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 14) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 30;
money2 = 4500;
baseMusuh = 12500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 3;
background_mc.rel3.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 250;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 2;
posBesi1 = 1;
posBesi2 = 3;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 15) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 30;
money2 = 5000;
baseMusuh = 15000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 250;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 4;
posBesi1 = 3;
posBesi2 = 2;
posBesi3 = 1;
posBesi4 = 2;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 16) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 35;
money2 = 5000;
baseMusuh = 15000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 3;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 4;
background_mc.rel5.pos = 4;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 1;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 2;
posBesi1 = 1;
posBesi2 = 2;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 17) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 35;
money2 = 5500;
baseMusuh = 20000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 3;
background_mc.rel3.pos = 4;
background_mc.rel4.pos = 4;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 4;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 3;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 3;
posBesi4 = 3;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 18) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 35;
money2 = 5500;
baseMusuh = 20000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 50;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
background_mc.rapuh2.pos = 4;
background_mc.rapuh2.nyawa = 50;
background_mc.rapuh2.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh2.onEnterFrame = enterRapuh;
background_mc.rapuh3.pos = 3;
background_mc.rapuh3.nyawa = 50;
background_mc.rapuh3.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh3.onEnterFrame = enterRapuh;
background_mc.rapuh4.pos = 3;
background_mc.rapuh4.nyawa = 50;
background_mc.rapuh4.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh4.onEnterFrame = enterRapuh;
background_mc.rapuh5.pos = 2;
background_mc.rapuh5.nyawa = 50;
background_mc.rapuh5.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh5.onEnterFrame = enterRapuh;
background_mc.rapuh6.pos = 2;
background_mc.rapuh6.nyawa = 50;
background_mc.rapuh6.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh6.onEnterFrame = enterRapuh;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 1;
posTowerMusuh3 = 1;
posTowerMusuh4 = 1;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 1;
posTowerJagoan3 = 1;
posTowerJagoan4 = 1;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 19) {
i = 1;
while (i <= 2) {
_root["bisaUnitMusuh" + i] = true;
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 35;
money2 = 6000;
baseMusuh = 25000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 3;
background_mc.rel5.pos = 4;
background_mc.rel6.pos = 4;
background_mc.rapuh1.pos = 4;
background_mc.rapuh1.nyawa = 5000;
background_mc.rapuh1.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh1.onEnterFrame = enterRapuh;
background_mc.rapuh2.pos = 4;
background_mc.rapuh2.nyawa = 5000;
background_mc.rapuh2.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh2.onEnterFrame = enterRapuh;
background_mc.rapuh3.pos = 3;
background_mc.rapuh3.nyawa = 5000;
background_mc.rapuh3.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh3.onEnterFrame = enterRapuh;
background_mc.rapuh4.pos = 3;
background_mc.rapuh4.nyawa = 5000;
background_mc.rapuh4.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh4.onEnterFrame = enterRapuh;
background_mc.rapuh5.pos = 2;
background_mc.rapuh5.nyawa = 5000;
background_mc.rapuh5.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh5.onEnterFrame = enterRapuh;
background_mc.rapuh6.pos = 2;
background_mc.rapuh6.nyawa = 5000;
background_mc.rapuh6.maxNyawa = background_mc.rapuh1.nyawa;
background_mc.rapuh6.onEnterFrame = enterRapuh;
bykTowerMusuh = 4;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
posTowerMusuh4 = 4;
bykTowerJagoan = 4;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
posTowerJagoan4 = 4;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 3;
posBesi4 = 1;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
bykKendaraan = 0;
i = 1;
while (i <= bykKendaraan) {
background_mc["kendaraan" + i].posisiKini = _root["posKendaraan" + i];
background_mc["kendaraan" + i].nyawa = 1500;
background_mc["kendaraan" + i].onEnterFrame = enterKendaraan;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
}
}
function cekLevelGame() {
if (levelKe == 1) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 200 + (i * 5);
_root["startBuatMusuh" + i] = false;
_root["startBuatMusuhSupport" + i] = 0;
i++;
}
bykPasukan2 = 20;
money2 = 2000;
baseMusuh = 2500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
bykTowerMusuh = 1;
posTowerMusuh1 = 2;
bykTowerJagoan = 1;
posTowerJagoan1 = 2;
banyakBesi = 2;
posBesi1 = 1;
posBesi2 = 1;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 2) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 175 + (i * 5);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 20;
money2 = 2000;
baseMusuh = 2500;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
bykTowerMusuh = 1;
posTowerMusuh1 = 2;
bykTowerJagoan = 1;
posTowerJagoan1 = 2;
banyakBesi = 2;
posBesi1 = 1;
posBesi2 = 1;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 10;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 3) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 20;
money2 = 2000;
baseMusuh = 5000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
bykTowerMusuh = 2;
posTowerMusuh1 = 2;
posTowerMusuh2 = 2;
bykTowerJagoan = 2;
posTowerJagoan1 = 2;
posTowerJagoan2 = 2;
banyakBesi = 1;
posBesi1 = 1;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 4) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 25 + (i * 5);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 20;
money2 = 2000;
baseMusuh = 5000;
maxBuatMusuhTower = 500;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 2;
bykTowerMusuh = 2;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
bykTowerJagoan = 2;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
banyakBesi = 3;
posBesi1 = 1;
posBesi2 = 1;
posBesi3 = 1;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 5) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 0 + (i * 5);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 25;
money2 = 2500;
baseMusuh = 5000;
maxBuatMusuhTower = 200;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 2;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 2;
bykTowerMusuh = 3;
posTowerMusuh1 = 1;
posTowerMusuh2 = 1;
posTowerMusuh3 = 1;
bykTowerJagoan = 3;
posTowerJagoan1 = 1;
posTowerJagoan2 = 1;
posTowerJagoan3 = 2;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 6) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 0 + (i * 5);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 25;
money2 = 2500;
baseMusuh = 5000;
maxBuatMusuhTower = 200;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 3;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 3;
background_mc.rel4.pos = 2;
background_mc.rel5.pos = 3;
bykTowerMusuh = 3;
posTowerMusuh1 = 1;
posTowerMusuh2 = 2;
posTowerMusuh3 = 3;
bykTowerJagoan = 3;
posTowerJagoan1 = 1;
posTowerJagoan2 = 2;
posTowerJagoan3 = 3;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 2;
posBesi4 = 1;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 7) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 0 + (i * 5);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 25;
money2 = 2500;
baseMusuh = 5000;
maxBuatMusuhTower = 200;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 3;
background_mc.rel2.pos = 2;
background_mc.rel3.pos = 2;
bykTowerMusuh = 3;
posTowerMusuh1 = 3;
posTowerMusuh2 = 3;
posTowerMusuh3 = 3;
bykTowerJagoan = 3;
posTowerJagoan1 = 3;
posTowerJagoan2 = 3;
posTowerJagoan3 = 3;
banyakBesi = 4;
posBesi1 = 1;
posBesi2 = 2;
posBesi3 = 2;
posBesi4 = 1;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 8) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 0 + (i * 5);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 25;
money2 = 2500;
baseMusuh = 5000;
maxBuatMusuhTower = 200;
maxBuatMusuhStrike = 1000;
background_mc.rel0.pos = 1;
background_mc.rel1.pos = 3;
background_mc.rel2.pos = 3;
background_mc.rel3.pos = 2;
background_mc.rel4.pos = 2;
bykTowerMusuh = 3;
posTowerMusuh1 = 1;
posTowerMusuh2 = 1;
posTowerMusuh3 = 1;
bykTowerJagoan = 3;
posTowerJagoan1 = 1;
posTowerJagoan2 = 1;
posTowerJagoan3 = 1;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
} else if (levelKe == 9) {
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = 50 + (i * 2);
_root["maxBuatMusuh" + i] = 150 + (i * 2);
_root["startBuatMusuh" + i] = false;
i++;
}
bykPasukan2 = 25;
money2 = 3000;
baseMusuh = 7500;
maxBuatMusuhTower = 200;
maxBuatMusuhStrike = 1000;
background_mc.batu1.isiJagoan = 0;
background_mc.batu1.isiMusuh = 0;
background_mc.batu2.isiJagoan = 0;
background_mc.batu2.isiMusuh = 0;
background_mc.batu3.isiJagoan = 0;
background_mc.batu3.isiMusuh = 0;
background_mc.batu4.isiJagoan = 0;
background_mc.batu4.isiMusuh = 0;
background_mc.rel0.pos = 1;
bykTowerMusuh = 3;
posTowerMusuh1 = 1;
posTowerMusuh2 = 1;
posTowerMusuh3 = 1;
bykTowerJagoan = 3;
posTowerJagoan1 = 1;
posTowerJagoan2 = 1;
posTowerJagoan3 = 1;
banyakBesi = 0;
i = 1;
while (i <= banyakBesi) {
background_mc["besi" + i].posisiKini = _root["posBesi" + i];
background_mc["besi" + i].nyawa = 100;
background_mc["besi" + i].tahanBesi = true;
background_mc["besi" + i].maxNyawa = background_mc["besi" + i].nyawa;
background_mc["besi" + i].tipeUnit = "lain";
background_mc["besi" + i].onEnterFrame = enterBesi;
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
jenisPasukanMusuh = jenisPasukanTower[pilihanTowerMusuh];
buatMusuhTower(i, jenisPasukanMusuh);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
jenisPasukan = jenisPasukanTower[pilihanTowerJagoan];
buatJagoanTower(i, jenisPasukan);
i++;
}
maxBaseMusuh = baseMusuh;
}
}
stop();
removeMovieClip(menu_mc);
msgBox_mc3._visible = false;
difficulty_mc._visible = false;
campaign_btn.onRelease = function () {
loadData();
if ((pilhanLevel > 1) && (pilhanLevel != undefined)) {
msgBox_mc3._visible = true;
msgBox_mc3.judul = "Start New Game";
if (levelKe == 0) {
msgBox_mc3.isi = "Continue last previous game? Press yes to continue. Press No to start a new game.";
} else {
msgBox_mc3.isi = ("Continue last previous game? Press yes to continue from level " + levelKe) + ". Press No to start a new game.";
}
msgBox_mc3.yes_btn.onRelease = function () {
initData();
gotoAndStop (215);
};
msgBox_mc3.no_btn.onRelease = function () {
difficulty_mc._visible = true;
difficulty_mc.easy_btn.onRelease = function () {
initData();
initAwalan();
tingkatSulit = 1;
gotoAndStop (215);
};
difficulty_mc.normal_btn.onRelease = function () {
initData();
initAwalan();
tingkatSulit = 2;
gotoAndStop (215);
};
difficulty_mc.hard_btn.onRelease = function () {
initData();
initAwalan();
tingkatSulit = 3;
gotoAndStop (215);
};
difficulty_mc.close_btn.onRelease = function () {
difficulty_mc._visible = false;
};
};
} else {
difficulty_mc._visible = true;
difficulty_mc.easy_btn.onRelease = function () {
initData();
initAwalan();
tingkatSulit = 1;
gotoAndStop (215);
};
difficulty_mc.normal_btn.onRelease = function () {
initData();
initAwalan();
tingkatSulit = 2;
gotoAndStop (215);
};
difficulty_mc.hard_btn.onRelease = function () {
initData();
initAwalan();
tingkatSulit = 3;
gotoAndStop (215);
};
difficulty_mc.close_btn.onRelease = function () {
difficulty_mc._visible = false;
};
}
};
option_btn.onRelease = function () {
menu = attachMovie("menu_mc", "menu_mc", dalamMenu);
menu._x = 400;
menu._y = 300;
menu.gotoAndStop(3);
menu.surrender_btn._visible = false;
menu.quit_btn._visible = false;
menu.back_btn.onRelease = function () {
removeMovieClip(menu_mc);
};
};
credits_btn.onRelease = function () {
gotoAndStop (214);
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
like_btn.onRelease = function () {
getURL ("http://www.facebook.com/ArmorGames", "_blank");
};
battle_btn1.onRelease = function () {
getURL ("http://armorgames.com/play/2961/battle-gear", "_blank");
};
battle_btn2.onRelease = function () {
getURL ("http://armorgames.com/play/15898/battle-gear-2", "_blank");
};
Frame 214
stop();
removeMovieClip(menu_mc);
back_btn.onRelease = function () {
gotoAndStop (213);
};
Frame 215
function initMap() {
msgBox_mc._visible = false;
msgBox_mc2._visible = false;
msgBox_mc3._visible = false;
jalur1 = new Array("", 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 29, 33, 37);
jalur2 = new Array("", 1, 2, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 26, 30, 34, 38);
jalur3 = new Array("", 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 27, 31, 35, 39);
jalur4 = new Array("", 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 40);
i = 1;
while (i <= 40) {
if (_root["kotaSudahMenang" + i] == true) {
_root["kota" + i].bintang_mc.gotoAndStop(1);
} else {
_root["kota" + i].bintang_mc.gotoAndStop(2);
}
delete _root["kota" + i].onRelease;
_root["kota" + i].gotoAndStop(1);
_root["kota" + i].onRollOver = function () {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
xindi = myStr.substr(myStr.length - 1, 1);
} else {
xindi = myStr.substr(myStr.length - 2, 2);
}
msgBox_mc2._visible = true;
if (xindi <= 33) {
msgBox_mc2.gotoAndStop(1);
msgBox_mc2._x = this._x + 100;
msgBox_mc2._y = this._y;
} else {
msgBox_mc2.gotoAndStop(2);
msgBox_mc2._x = this._x - 100;
msgBox_mc2._y = this._y;
}
msgBox_mc2.isi = "Game Level: Area " + xindi;
};
_root["kota" + i].onRollOut = function () {
msgBox_mc2._visible = false;
};
_root["kota" + i].msgBox_mc2._visible = false;
i++;
}
if (pilihJalur == 0) {
i = 1;
while (i <= (pilhanLevel - 1)) {
_root["kota" + i].gotoAndStop(2);
i++;
}
if (pilhanLevel == 5) {
_root.kota5.gotoAndStop(4);
_root.kota6.gotoAndStop(4);
_root.kota5.onRelease = function () {
zpilihJalur = 1;
_root.kota5.gotoAndStop(3);
_root.kota6.gotoAndStop(4);
adaPilihan = true;
initMap2();
};
_root.kota6.onRelease = function () {
zpilihJalur = 3;
_root.kota5.gotoAndStop(4);
_root.kota6.gotoAndStop(3);
adaPilihan = true;
initMap2();
};
} else {
_root["kota" + pilhanLevel].gotoAndStop(3);
}
} else if (pilihJalur == 1) {
i = 1;
while (i <= (pilhanLevel - 1)) {
_root["kota" + jalur1[i]].gotoAndStop(2);
i++;
}
if (pilhanLevel == 15) {
_root.kota25.gotoAndStop(4);
_root.kota26.gotoAndStop(4);
_root.kota25.onRelease = function () {
zpilihJalur = 1;
_root.kota25.gotoAndStop(3);
_root.kota26.gotoAndStop(4);
adaPilihan = true;
initMap2();
};
_root.kota26.onRelease = function () {
zpilihJalur = 2;
_root.kota25.gotoAndStop(4);
_root.kota26.gotoAndStop(3);
adaPilihan = true;
initMap2();
};
} else {
_root["kota" + jalur1[pilhanLevel]].gotoAndStop(3);
}
} else if (pilihJalur == 2) {
i = 1;
while (i <= (pilhanLevel - 1)) {
_root["kota" + jalur2[i]].gotoAndStop(2);
i++;
}
_root["kota" + jalur2[pilhanLevel]].gotoAndStop(3);
} else if (pilihJalur == 3) {
i = 1;
while (i <= (pilhanLevel - 1)) {
_root["kota" + jalur3[i]].gotoAndStop(2);
i++;
}
if (pilhanLevel == 15) {
_root.kota27.gotoAndStop(4);
_root.kota28.gotoAndStop(4);
_root.kota27.onRelease = function () {
zpilihJalur = 3;
_root.kota27.gotoAndStop(3);
_root.kota28.gotoAndStop(4);
adaPilihan = true;
initMap2();
};
_root.kota28.onRelease = function () {
zpilihJalur = 4;
_root.kota27.gotoAndStop(4);
_root.kota28.gotoAndStop(3);
adaPilihan = true;
initMap2();
};
} else {
_root["kota" + jalur3[pilhanLevel]].gotoAndStop(3);
}
} else if (pilihJalur == 4) {
i = 1;
while (i <= (pilhanLevel - 1)) {
_root["kota" + jalur4[i]].gotoAndStop(2);
i++;
}
_root["kota" + jalur4[pilhanLevel]].gotoAndStop(3);
}
}
function initMap2() {
levelKe = 0;
i = 1;
while (i <= 40) {
if (_root["kota" + i]._currentframe == 3) {
levelKe = i;
i = 40;
}
i++;
}
if (levelKe == 0) {
xpilih = "PLEASE SELECT AREA TO PLAY";
} else {
xpilih = "GAME LEVEL SELECTED: AREA " + levelKe;
}
simpanData();
}
stop();
removeMovieClip(menu_mc);
adaPilihan = false;
zpilihJalur = pilihJalur;
bykPasukan1 = 20 + (1 * (levelSkill[1] - 1));
baseJagoan = 2 * (2500 + (5000 * (levelSkill[2] - 1)));
if (tingkatSulit == 1) {
xtingkatSulit = "DIFFICULTY: EASY";
} else if (tingkatSulit == 2) {
xtingkatSulit = "DIFFICULTY: NORMAL";
} else if (tingkatSulit == 3) {
xtingkatSulit = "DIFFICULTY: HARD";
}
initMap();
initMap2();
adaBanyakKotaMenang = 0;
i = 1;
while (i <= 40) {
if (_root["kotaSudahMenang" + i] == true) {
adaBanyakKotaMenang++;
}
i++;
}
if (adaBanyakKotaMenang >= 5) {
zmedals7 = true;
}
if (adaBanyakKotaMenang >= 10) {
zmedals8 = true;
}
if (adaBanyakKotaMenang >= 15) {
zmedals9 = true;
}
if (adaBanyakKotaMenang >= 20) {
zmedals10 = true;
}
if (adaBanyakKotaMenang >= 25) {
zmedals11 = true;
}
if (adaBanyakKotaMenang >= 30) {
zmedals12 = true;
}
if (adaBanyakKotaMenang >= 35) {
zmedals13 = true;
}
if (adaBanyakKotaMenang >= 40) {
zmedals14 = true;
}
preview_btn.onRelease = function () {
levelKe = 0;
i = 1;
while (i <= 40) {
if (_root["kota" + i]._currentframe == 3) {
levelKe = i;
i = 40;
}
i++;
}
if (levelKe != 0) {
gotoAndStop (219);
} else {
msgBox_mc._visible = true;
msgBox_mc.judul = "Select Area";
msgBox_mc.isi = "Please select one of area to play, click the blinking red shield.";
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
}
};
continue_btn.onRelease = function () {
levelKe = 0;
i = 1;
while (i <= 40) {
if (_root["kota" + i]._currentframe == 3) {
levelKe = i;
i = 40;
}
i++;
}
if (levelKe != 0) {
if (adaPilihan == true) {
msgBox_mc3._visible = true;
msgBox_mc3.judul = "Select This Path";
msgBox_mc3.isi = ("Are you sure to select area " + levelKe) + " and following the paths? It can't be changed unless start a new game.";
msgBox_mc3.yes_btn.onRelease = function () {
pilihJalur = zpilihJalur;
simpanData();
gotoAndStop (220);
};
msgBox_mc3.no_btn.onRelease = function () {
msgBox_mc3._visible = false;
};
} else {
pilihJalur = zpilihJalur;
simpanData();
if (levelKe == 1) {
gotoAndStop (217);
} else {
gotoAndStop (220);
}
}
} else {
msgBox_mc._visible = true;
msgBox_mc.judul = "Select Area";
msgBox_mc.isi = "Please select one of area to play, click the blinking red shield.";
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
}
};
menu_btn.onRelease = function () {
menu = attachMovie("menu_mc", "menu_mc", dalamMenu);
menu._x = 400;
menu._y = 300;
menu.gotoAndStop(2);
menu.surrender_btn._visible = false;
menu.quit_btn._visible = true;
menu.quit_btn.onRelease = function () {
clearSemua();
gotoAndStop (213);
};
menu.back_btn.onRelease = function () {
removeMovieClip(menu_mc);
};
};
medal_btn.onRelease = function () {
gotoAndStop (216);
};
Frame 216
function overBox() {
myStr = new String(this);
if (myStr.length == 16) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
infoBox = attachMovie("info_box6", "info_box", 1000);
infoBox._x = this._x;
infoBox._y = this._y - 100;
if (infoBox._x <= 150) {
infoBox._x = 150;
}
if (infoBox._x >= 650) {
infoBox._x = 650;
}
if (infoBox._y <= 75) {
infoBox._y = 75;
}
if (this._currentframe == 1) {
infoBox.gotoAndStop(1);
infoBox.isi = judulAchieve[indi] + " (Locked)";
} else {
infoBox.gotoAndStop(2);
infoBox.isi = "Award for: " + judulAchieve[indi];
}
}
function outBox() {
removeMovieClip(infoBox);
}
stop();
close_btn.onRelease = function () {
gotoAndStop (215);
};
judulAchieve = new Array("", "Kill more than 100 troops in 1 level.", "Gain more than 1000 exp in 1 level.", "Filled 30 slots in unit setup.", "Buy all supported skills", "Collected 30000 money.", "Max upgrade all powered skill.", "Complete 5 levels", "Complete 10 levels", "Complete 15 levels", "Complete 20 levels", "Complete 25 levels", "Complete 30 levels", "Complete 35 levels", "Complete 40 levels");
i = 1;
while (i <= 14) {
if (_root["zmedals" + i] == true) {
_root["xmedals" + i].gotoAndStop(2);
_root["xmedals" + i]._alpha = 100;
} else {
_root["xmedals" + i].gotoAndStop(1);
_root["xmedals" + i]._alpha = 75;
}
_root["xmedals" + i].onRollOver = overBox;
_root["xmedals" + i].onRollOut = outBox;
i++;
}
Frame 217
function tutorialWarSelesai() {
tutorialWar = true;
sedangPause = false;
removeMovieClip(tutorial_mc);
removeMovieClip(ui_mc);
buatUI();
}
function buatMinimap() {
i = 1;
while (i <= bykTowerMusuh) {
titikMerah_mc = attachMovie("titikMerah_mc", "titikMerah_mc" + i, 93001 + i);
titikMerah_mc._x = -250;
titikMerah_mc._y = -250;
titikMerah_mc._alpha = 60;
i++;
}
i = 2000;
while (i <= 2030) {
titikMerah_mc = attachMovie("titikMerah_mc", "titikMerah_mc" + i, 93001 + i);
titikMerah_mc._x = -250;
titikMerah_mc._y = -250;
titikMerah_mc._alpha = 60;
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
titikHijau_mc = attachMovie("titikHijau_mc", "titikHijau_mc" + i, 90001 + i);
titikHijau_mc._x = -250;
titikHijau_mc._y = -250;
titikHijau_mc._alpha = 60;
i++;
}
i = 1000;
while (i <= 1030) {
titikHijau_mc = attachMovie("titikHijau_mc", "titikHijau_mc" + i, 90001 + i);
titikHijau_mc._x = -250;
titikHijau_mc._y = -250;
titikHijau_mc._alpha = 60;
i++;
}
radar_mc = attachMovie("radar_mc", "radar_mc", 90001);
radar_mc._x = 266;
radar_mc._y = 140;
radar_mc._alpha = 50;
minimap_mc = attachMovie("minimap_mc", "minimap_mc", 90000);
minimap_mc._x = 266;
minimap_mc._y = 140;
minimap_mc._alpha = 50;
minimap_mc.onRelease = klikMinimap;
minimap_mc.onEnterFrame = enterMinimap;
i = 1;
while (i <= 8) {
background_mc["besi" + i].onRollOver = overBesi;
background_mc["besi" + i].onRollOut = outOfTheBox;
i++;
}
i = 1;
while (i <= 8) {
background_mc["batu" + i].onRollOver = overBatu;
background_mc["batu" + i].onRollOut = outOfTheBox;
i++;
}
i = 1;
while (i <= 8) {
background_mc["rapuh" + i].onRollOver = overRapuh;
background_mc["rapuh" + i].onRollOut = outOfTheBox;
i++;
}
i = 1;
while (i <= 8) {
background_mc["kendaraan" + i].onRollOver = overKendaraan;
background_mc["kendaraan" + i].onRollOut = outOfTheBox;
i++;
}
}
function klikMinimap() {
if ((tutorialWar == false) && (tutorial_mc._currentframe != 6)) {
xscalaX = (((_root._xmouse - 33) - this._x) * 3200) / 266;
if (xscalaX <= 0) {
xscalaX = 0;
} else if (xscalaX >= 2400) {
xscalaX = 2400;
}
moveCastle2(xscalaX);
} else if (tutorialWar == true) {
xscalaX = (((_root._xmouse - 33) - this._x) * 3200) / 266;
if (xscalaX <= 0) {
xscalaX = 0;
} else if (xscalaX >= 2400) {
xscalaX = 2400;
}
moveCastle2(xscalaX);
}
}
function moveCastle2(indi) {
if (background_mc._x < 0) {
geserBerapa = background_mc._x + indi;
background_mc._x = background_mc._x - geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x - geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x - geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x - geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX - geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
} else if (background_mc._x > -2400) {
geserBerapa = (-indi) - background_mc._x;
background_mc._x = background_mc._x + geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x + geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x + geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x + geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX + geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
}
}
function enterMinimap() {
xscalaX = ((-background_mc._x) * 266) / 3200;
xscalaY = (background_mc._y * 50) / 600;
radar_mc._x = this._x + xscalaX;
radar_mc._y = this._y + xscalaY;
i = 1;
while (i <= bykTowerMusuh) {
if (background_mc["towerMusuh" + i].nyawa > 0) {
scalaX = (background_mc["towerMusuh" + i]._x * 266) / 3200;
scalaY = (background_mc["towerMusuh" + i]._y * 50) / 600;
_root["titikMerah_mc" + i]._x = this._x + scalaX;
_root["titikMerah_mc" + i]._y = this._y + scalaY;
} else {
_root["titikMerah_mc" + i]._x = -250;
_root["titikMerah_mc" + i]._y = -250;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i].nyawa > 0) {
scalaX = ((_root["musuh_mc" + i]._x - background_mc._x) * 266) / 3200;
scalaY = ((_root["musuh_mc" + i]._y - background_mc._y) * 50) / 600;
_root["titikMerah_mc" + i]._x = this._x + scalaX;
_root["titikMerah_mc" + i]._y = this._y + scalaY;
} else {
_root["titikMerah_mc" + i]._x = -250;
_root["titikMerah_mc" + i]._y = -250;
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if (background_mc["towerJagoan" + i].nyawa > 0) {
scalaX = (background_mc["towerJagoan" + i]._x * 266) / 3200;
scalaY = (background_mc["towerJagoan" + i]._y * 50) / 600;
_root["titikHijau_mc" + i]._x = this._x + scalaX;
_root["titikHijau_mc" + i]._y = this._y + scalaY;
} else {
_root["titikHijau_mc" + i]._x = -250;
_root["titikHijau_mc" + i]._y = -250;
}
i++;
}
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i].nyawa > 0) {
scalaX = ((_root["jagoan_mc" + i]._x - background_mc._x) * 266) / 3200;
scalaY = ((_root["jagoan_mc" + i]._y - background_mc._y) * 50) / 600;
_root["titikHijau_mc" + i]._x = this._x + scalaX;
_root["titikHijau_mc" + i]._y = this._y + scalaY;
} else {
_root["titikHijau_mc" + i]._x = -250;
_root["titikHijau_mc" + i]._y = -250;
}
i++;
}
}
function init() {
xpengalianSemuaMusuhNyawa = new Array();
xpengalianSemuaMusuhDamage = new Array();
xpengalianSemuaMusuhRange = new Array();
xpengalianSemuaMusuhSpeed = new Array();
xpengalianSemuaMusuhNyawa[levelKe] = 0.5 + (levelKe / 25);
xpengalianSemuaMusuhDamage[levelKe] = 0.5 + (levelKe / 25);
xpengalianSemuaMusuhRange[levelKe] = 1 + (levelKe / 100);
xpengalianSemuaMusuhSpeed[levelKe] = 1 + (levelKe / 100);
wpengalianSemuaMusuhNyawa = xpengalianSemuaMusuhNyawa[levelKe];
wpengalianSemuaMusuhDamage = xpengalianSemuaMusuhDamage[levelKe];
wpengalianSemuaMusuhRange = xpengalianSemuaMusuhRange[levelKe];
wpengalianSemuaMusuhSpeed = xpengalianSemuaMusuhSpeed[levelKe];
if ((((((((((levelKe == 1) || (levelKe == 2)) || (levelKe == 3)) || (levelKe == 4)) || (levelKe == 5)) || (levelKe == 6)) || (levelKe == 7)) || (levelKe == 8)) || (levelKe == 9)) || (levelKe == 10)) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 0.8;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 0.8;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 0.8;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 0.8;
}
if (levelKe >= 36) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 1.3;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 1.3;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 1.3;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 1.3;
} else if (levelKe >= 32) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 1.2;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 1.2;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 1.2;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 1.2;
} else if (levelKe >= 28) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 1.1;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 1.1;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 1.1;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 1.1;
} else if (levelKe >= 24) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 1;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 1;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 1;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 1;
} else if (levelKe >= 20) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 0.95;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 0.95;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 0.95;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 0.95;
} else if (levelKe >= 16) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 0.9;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 0.9;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 0.9;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 0.9;
} else if (levelKe >= 11) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 0.8;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 0.8;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 0.8;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 0.8;
}
if (tingkatSulit == 1) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 0.75;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 0.75;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 0.75;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 0.75;
} else if (tingkatSulit == 2) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 1;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 1;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 1;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 1;
} else if (tingkatSulit == 3) {
wpengalianSemuaMusuhNyawa = wpengalianSemuaMusuhNyawa * 1.5;
wpengalianSemuaMusuhDamage = wpengalianSemuaMusuhDamage * 1.5;
wpengalianSemuaMusuhRange = wpengalianSemuaMusuhRange * 1.5;
wpengalianSemuaMusuhSpeed = wpengalianSemuaMusuhSpeed * 1.5;
}
speedGame = 15;
dalamBackground = 50;
dalamTanda = 60;
dalamJagoan = 1000;
dalamEfek = 55000;
dalamEfek2 = 51000;
dalamEfek4 = 200;
dalamEfek3 = 1;
pilihSupportMusuh = 0;
dalamPeluru = 52000;
dalamUI = 100000 /* 0x0186A0 */;
dalamMenu = 105000 /* 0x019A28 */;
dalamInfo = 110000 /* 0x01ADB0 */;
dalamGo = 200000 /* 0x030D40 */;
dalamSelesai = 300000 /* 0x0493E0 */;
sedangDrag = false;
jalanKanan = false;
jalanKiri = false;
sudahSelesai = false;
sedangPause = false;
cekSurrender = false;
siapaMenang = "";
banyakJagoan = 0;
banyakMusuh = 0;
pembagimoney2 = 10;
pembagimoney1 = 10;
unitMati1 = 0;
unitMati2 = 0;
buildingMati1 = 0;
buildingMati2 = 0;
delayBuatMusuhTower = 0;
delayBuatMusuhStrike = 0;
maxBaseJagoan = baseJagoan;
minMusuhTentara = 1;
maxMusuhTentara = 25;
minMusuhTower = 26;
maxMusuhTower = 36;
minMusuhStrike = 37;
maxMusuhStrike = 40;
awalUnit = 1;
akhirUnit = 9;
batasBawahUnit = 0;
uangAwal = money1;
jenisPasukanTower = new Array("", 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 14);
xdaftarHarga = new Array();
i = 1;
while (i <= 43) {
if (i <= 9) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[7]);
} else if (i <= 17) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[8]);
} else if (i <= 25) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[9]);
} else if (i <= 31) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[11]);
} else if (i <= 36) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[11]);
} else if (i <= 40) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[13]);
} else if (i <= 43) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[13]);
}
i++;
}
i = 1;
while (i <= 43) {
_root["bisaUnit" + i] = false;
_root["bisaUnitMusuh" + i] = false;
i++;
}
i = 1;
while (i <= 30) {
_root["bisaUnit" + slot[i]] = true;
i++;
}
pilihanTowerJagoan = 1;
pilihanTowerMusuh = 1;
}
function buatBackground() {
background_mc = attachMovie("background" + levelKe, "background_mc", dalamBackground);
background_mc.cacheAsBitmap = true;
background_mc._x = 0;
background_mc._y = 0;
i = 1;
while (i <= 8) {
_root["bisaSupportMusuh" + i] = false;
i++;
}
i = 2;
while (i <= 8) {
if (levelKe >= daftarLevel2[i]) {
_root["bisaSupportMusuh" + i] = true;
_root["kiniSupportMusuh" + i] = 500;
_root["maxSupportMusuh" + i] = 500;
}
i++;
}
i = 1;
while (i <= 43) {
if (daftarLevel[i] == 1) {
if (levelKe >= daftarLevel[i]) {
_root["bisaUnitMusuh" + i] = true;
}
} else if (levelKe >= daftarLevel[i]) {
_root["bisaUnitMusuh" + i] = true;
}
i++;
}
i = 26;
while (i <= 36) {
if (daftarLevel[i] == 1) {
if (levelKe >= daftarLevel[i]) {
pilihanTowerJagoan = i - 25;
pilihanTowerMusuh = i - 25;
}
} else if (levelKe >= daftarLevel[i]) {
pilihanTowerJagoan = i - 25;
pilihanTowerMusuh = i - 25;
}
i++;
}
if (levelKe <= 9) {
cekLevelGame();
} else if (levelKe <= 19) {
cekLevelGame2();
} else if (levelKe <= 29) {
cekLevelGame3();
} else {
cekLevelGame4();
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
if (levelKe <= 5) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 1;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1;
} else if (levelKe <= 10) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.9;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1.2;
} else if (levelKe <= 15) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.8;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1.4;
} else if (levelKe <= 20) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.7;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1.6;
} else if (levelKe <= 25) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.6;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1.8;
} else if (levelKe <= 30) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.5;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 2;
} else if (levelKe <= 35) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.4;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 2.2;
} else {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.2;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 2.4;
}
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = Math.ceil(_root["kiniBuatMusuh" + i]);
_root["maxBuatMusuh" + i] = Math.ceil(_root["maxBuatMusuh" + i]);
i++;
}
bykPasukan2 = bykPasukan2 * 0.75;
if (bykPasukan2 >= 30) {
bykPasukan2 = 30;
}
bykPasukan2 = Math.ceil(bykPasukan2);
money2 = 1800 + (levelKe * 200);
if (levelKe <= 5) {
money2 = money2 * 0.5;
} else if (levelKe <= 10) {
money2 = money2 * 1;
} else if (levelKe <= 15) {
money2 = money2 * 1.5;
} else if (levelKe <= 20) {
money2 = money2 * 2;
} else if (levelKe <= 25) {
money2 = money2 * 2.5;
} else if (levelKe <= 30) {
money2 = money2 * 3;
} else if (levelKe <= 35) {
money2 = money2 * 3.5;
} else {
money2 = money2 * 4;
}
money2 = Math.ceil(money2);
maxBuatMusuhTower = maxBuatMusuhTower * 3;
maxBuatMusuhStrike = maxBuatMusuhStrike * 3;
if (levelKe >= 37) {
baseMusuh = 126250 /* 0x01ED2A */;
} else {
baseMusuh = 2500 + ((levelKe - 1) * 4000);
}
if (levelKe <= 5) {
baseMusuh = baseMusuh * 0.5;
} else if (levelKe <= 10) {
baseMusuh = baseMusuh * 1;
} else if (levelKe <= 15) {
baseMusuh = baseMusuh * 1.5;
} else if (levelKe <= 20) {
baseMusuh = baseMusuh * 2;
} else if (levelKe <= 25) {
baseMusuh = baseMusuh * 2.5;
} else if (levelKe <= 30) {
baseMusuh = baseMusuh * 3;
} else if (levelKe <= 35) {
baseMusuh = baseMusuh * 3.5;
} else {
baseMusuh = baseMusuh * 4;
}
baseMusuh = Math.ceil(baseMusuh);
maxBaseMusuh = baseMusuh;
}
function buatTanda() {
i = 1;
while (i <= 4) {
tanda_mc = attachMovie("tanda_mc", "tanda_mc" + i, dalamTanda + i);
tanda_mc.cacheAsBitmap = true;
tanda_mc._x = 0;
tanda_mc._y = 495 - (100 * (i - 1));
tanda_mc._visible = false;
i++;
}
}
function buatMusuhTower(i, jenisPasukanMusuh) {
banyakMusuh++;
background_mc["towerMusuh" + i].gotoAndStop(1);
background_mc["towerMusuh" + i].gotoAndStop(jenisPasukanMusuh);
background_mc["towerMusuh" + i].troop.gotoAndStop(1);
background_mc["towerMusuh" + i].troop.anim.stop();
background_mc["towerMusuh" + i].tipeUnit = "tower_musuh";
background_mc["towerMusuh" + i].jenis = jenisPasukanMusuh;
background_mc["towerMusuh" + i].tiarap = false;
if (jenisPasukanMusuh == 2) {
background_mc["towerMusuh" + i].nyawa = 750;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 45;
background_mc["towerMusuh" + i].range = 500;
} else if (jenisPasukanMusuh == 3) {
background_mc["towerMusuh" + i].nyawa = 1000;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 250;
background_mc["towerMusuh" + i].range = 550;
} else if (jenisPasukanMusuh == 5) {
background_mc["towerMusuh" + i].nyawa = 1250;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 75;
background_mc["towerMusuh" + i].range = 850;
} else if (jenisPasukanMusuh == 6) {
background_mc["towerMusuh" + i].nyawa = 1500;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 125;
background_mc["towerMusuh" + i].range = 650;
background_mc["towerMusuh" + i].tiarap = true;
} else if (jenisPasukanMusuh == 8) {
background_mc["towerMusuh" + i].nyawa = 1750;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 450;
background_mc["towerMusuh" + i].range = 750;
} else if (jenisPasukanMusuh == 9) {
background_mc["towerMusuh" + i].nyawa = 2000;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 600;
background_mc["towerMusuh" + i].range = 800;
} else if (jenisPasukanMusuh == 10) {
background_mc["towerMusuh" + i].nyawa = 2500;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 50;
background_mc["towerMusuh" + i].range = 600;
} else if (jenisPasukanMusuh == 11) {
background_mc["towerMusuh" + i].nyawa = 3000;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 350;
background_mc["towerMusuh" + i].range = 700;
} else if (jenisPasukanMusuh == 12) {
background_mc["towerMusuh" + i].nyawa = 3500;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 450;
background_mc["towerMusuh" + i].range = 800;
} else if (jenisPasukanMusuh == 13) {
background_mc["towerMusuh" + i].nyawa = 5000;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 500;
background_mc["towerMusuh" + i].range = 850;
} else if (jenisPasukanMusuh == 14) {
background_mc["towerMusuh" + i].nyawa = 6500;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 600;
background_mc["towerMusuh" + i].range = 900;
}
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa * wpengalianSemuaMusuhNyawa;
background_mc["towerMusuh" + i].speed = background_mc["towerMusuh" + i].speed * wpengalianSemuaMusuhSpeed;
background_mc["towerMusuh" + i].damage = background_mc["towerMusuh" + i].damage * wpengalianSemuaMusuhDamage;
background_mc["towerMusuh" + i].range = background_mc["towerMusuh" + i].range * wpengalianSemuaMusuhRange;
if (jenisPasukanMusuh >= 10) {
background_mc["towerMusuh" + i].tahanBesi = true;
} else {
background_mc["towerMusuh" + i].tahanBesi = false;
}
background_mc["towerMusuh" + i].maxNyawa = background_mc["towerMusuh" + i].nyawa;
background_mc["towerMusuh" + i].serangBase = false;
background_mc["towerMusuh" + i].posisiKini = _root["posTowerMusuh" + i];
background_mc["towerMusuh" + i].onEnterFrame = enterTower;
}
function buatJagoanTower(i, jenisPasukan, indi3) {
banyakJagoan++;
background_mc["towerJagoan" + i].gotoAndStop(1);
background_mc["towerJagoan" + i].gotoAndStop(jenisPasukan);
background_mc["towerJagoan" + i].troop.gotoAndStop(1);
background_mc["towerJagoan" + i].tanda_mc._visible = false;
background_mc["towerJagoan" + i].troop.anim.stop();
background_mc["towerJagoan" + i].tipeUnit = "tower_jagoan";
background_mc["towerJagoan" + i].jenis = jenisPasukan;
background_mc["towerJagoan" + i].tiarap = false;
if (jenisPasukan == 2) {
background_mc["towerJagoan" + i].nyawa = 750;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 45;
background_mc["towerJagoan" + i].range = 500;
} else if (jenisPasukan == 3) {
background_mc["towerJagoan" + i].nyawa = 1000;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 250;
background_mc["towerJagoan" + i].range = 550;
} else if (jenisPasukan == 5) {
background_mc["towerJagoan" + i].nyawa = 1250;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 75;
background_mc["towerJagoan" + i].range = 850;
} else if (jenisPasukan == 6) {
background_mc["towerJagoan" + i].nyawa = 1500;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 125;
background_mc["towerJagoan" + i].range = 650;
background_mc["towerJagoan" + i].tiarap = true;
} else if (jenisPasukan == 8) {
background_mc["towerJagoan" + i].nyawa = 1750;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 450;
background_mc["towerJagoan" + i].range = 750;
} else if (jenisPasukan == 9) {
background_mc["towerJagoan" + i].nyawa = 2000;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 600;
background_mc["towerJagoan" + i].range = 800;
} else if (jenisPasukan == 10) {
background_mc["towerJagoan" + i].nyawa = 2500;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 50;
background_mc["towerJagoan" + i].range = 600;
} else if (jenisPasukan == 11) {
background_mc["towerJagoan" + i].nyawa = 3000;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 350;
background_mc["towerJagoan" + i].range = 700;
} else if (jenisPasukan == 12) {
background_mc["towerJagoan" + i].nyawa = 3500;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 450;
background_mc["towerJagoan" + i].range = 800;
} else if (jenisPasukan == 13) {
background_mc["towerJagoan" + i].nyawa = 5000;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 500;
background_mc["towerJagoan" + i].range = 850;
} else if (jenisPasukan == 14) {
background_mc["towerJagoan" + i].nyawa = 6500;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 600;
background_mc["towerJagoan" + i].range = 900;
}
if (jenisPasukan >= 10) {
background_mc["towerJagoan" + i].tahanBesi = true;
} else {
background_mc["towerJagoan" + i].tahanBesi = false;
}
background_mc["towerJagoan" + i].maxNyawa = background_mc["towerJagoan" + i].nyawa;
background_mc["towerJagoan" + i].serangBase = false;
background_mc["towerJagoan" + i].posisiKini = _root["posTowerJagoan" + i];
background_mc["towerJagoan" + i].onEnterFrame = enterTower2;
randKeluar = _root["posTowerJagoan" + i];
background_mc["towerJagoan" + i].moneyLebih = false;
background_mc["towerJagoan" + i].serangBesi = false;
if (ui_mc["frame" + indi3].supported._visible == true) {
ui_mc["frame" + indi3].sedangSupported = false;
ui_mc["frame" + indi3].supported._visible = false;
if (ui_mc["frame" + indi3].supported._currentframe == 1) {
background_mc["towerJagoan" + i].serangBesi = true;
} else if (ui_mc["frame" + indi3].supported._currentframe == 2) {
xdaftarHarga[indi3] = xdaftarHarga[indi3] * 0.25;
xdaftarHarga[indi3] = Math.ceil(xdaftarHarga[indi3]);
buatJagoan(1, jenisPasukan);
buatJagoan(2, jenisPasukan);
buatJagoan(3, jenisPasukan);
buatJagoan(4, jenisPasukan);
} else if (ui_mc["frame" + indi3].supported._currentframe == 3) {
xdaftarHarga[indi3] = xdaftarHarga[indi3] * 0.25;
xdaftarHarga[indi3] = Math.ceil(xdaftarHarga[indi3]);
buatJagoan(randKeluar, jenisPasukan, undefined, 0);
buatJagoan(randKeluar, jenisPasukan, undefined, -25);
buatJagoan(randKeluar, jenisPasukan, undefined, -50);
buatJagoan(randKeluar, jenisPasukan, undefined, -75);
} else if (ui_mc["frame" + indi3].supported._currentframe == 4) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa * 4;
background_mc["towerJagoan" + i].damage = background_mc["towerJagoan" + i].damage * 4;
} else if (ui_mc["frame" + indi3].supported._currentframe == 5) {
background_mc["towerJagoan" + i].speed = background_mc["towerJagoan" + i].speed * 2;
background_mc["towerJagoan" + i].range = background_mc["towerJagoan" + i].range * 2;
} else if (ui_mc["frame" + indi3].supported._currentframe == 6) {
background_mc["towerJagoan" + i].tahanBesi = true;
} else if (ui_mc["frame" + indi3].supported._currentframe == 7) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa * 4;
background_mc["towerJagoan" + i].damage = background_mc["towerJagoan" + i].damage * 4;
background_mc["towerJagoan" + i].speed = background_mc["towerJagoan" + i].speed * 2;
background_mc["towerJagoan" + i].range = background_mc["towerJagoan" + i].range * 2;
background_mc["towerJagoan" + i].speedNaik = background_mc["towerJagoan" + i].speedNaik * 2;
} else if (ui_mc["frame" + indi3].supported._currentframe == 8) {
cekHancurSemua("jagoan", background_mc["towerJagoan" + i].posisiKini);
}
background_mc["towerJagoan" + i].maxNyawa = background_mc["towerJagoan" + i].nyawa;
}
}
function enterRapuh() {
if (sedangPause == false) {
if (this.nyawa < 0) {
this.gotoAndStop(2);
} else {
this.bar_mc.bar._xscale = (this.nyawa / this.maxNyawa) * 100;
this.gotoAndStop(1);
}
}
}
function enterKendaraan() {
if (sedangPause == false) {
if (this.nyawa > 0) {
this.bar_mc.bar._xscale = (this.nyawa / this.maxNyawa) * 100;
} else if (this._currentframe != 3) {
this.gotoAndStop(3);
}
}
}
function enterBesi() {
if (sedangPause == false) {
if (this.nyawa > 0) {
this.bar_mc.bar._xscale = (this.nyawa / this.maxNyawa) * 100;
this.gotoAndStop(1);
} else if (this._currentframe != 2) {
cekGesek(this, "", "debu", "besar");
this.gotoAndStop(2);
}
}
}
function enterTower() {
if (sedangPause == false) {
if (siapaMenang == "jagoan") {
if (this.nyawa > 0) {
if (this.troop.bar_mc._visible == true) {
this.troop.bar_mc._visible = false;
if (this.jenis >= 10) {
buatMusuh2(this, 1);
} else {
this.troop._visible = false;
buatMusuh2(this, this.jenis);
}
this.nyawa = 0;
}
} else {
this.troop.bar_mc._visible = false;
if (this.troop._currentframe != 3) {
money2 = money2 + daftarHarga[this.jenis];
this.troop.gotoAndStop(3);
}
}
} else {
this.troop.bar_mc.bar._xscale = (this.nyawa / this.maxNyawa) * 100;
if (this.nyawa <= 0) {
this.troop.bar_mc._visible = false;
if (this.troop._currentframe != 3) {
if (this.tahanBesi == true) {
backLedak();
} else {
backLedak();
}
buildingMati2++;
banyakMusuh--;
money2 = money2 + daftarHarga[this.jenis];
this.troop.gotoAndStop(3);
}
} else {
if ((((this._x + background_mc._x) < this.xtarget._x) || (this.xtarget.nyawa <= 0)) || (this.posisiKini != this.xtarget.posisiKini)) {
this.xtarget = undefined;
}
if (this.xtarget == undefined) {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if ((this._x + background_mc._x) > _root["jagoan_mc" + i]._x) {
if (this.posisiKini == _root["jagoan_mc" + i].posisiKini) {
this.xjarak = Math.sqrt(Math.pow((this._x + background_mc._x) - _root["jagoan_mc" + i]._x, 2) + Math.pow((this._y + background_mc._y) - _root["jagoan_mc" + i]._y, 2));
if (this.xjarak <= this.range) {
this.xtarget = _root["jagoan_mc" + i];
}
}
}
}
i++;
}
}
if (this.xtarget != undefined) {
if ((this.xtarget.tipeUnit == "tower_musuh") || (this.xtarget.tipeUnit == "lain")) {
this.xjarak = Math.sqrt(Math.pow(((this.xtarget._x + background_mc._x) - this._x) + background_mc._x, 2) + Math.pow(((this.xtarget._y + background_mc._y) - this._y) + background_mc._y, 2));
} else {
this.xjarak = Math.sqrt(Math.pow((this._x + background_mc._x) - this.xtarget._x, 2) + Math.pow((this._y + background_mc._y) - this.xtarget._y, 2));
}
if (this.xjarak <= this.range) {
this.adaMusuh = true;
} else {
this.adaMusuh = false;
}
}
if (this.xtarget != undefined) {
if (this.adaMusuh == true) {
this.troop.gotoAndStop(2);
} else {
this.troop.gotoAndStop(4);
}
} else {
this.troop.gotoAndStop(4);
}
}
}
}
}
function buatMusuh2(indi, indi2, indi3) {
xdalamMusuh = 0;
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x == undefined) {
xdalamMusuh = i;
}
i++;
}
if (banyakMusuh < bykPasukan2) {
if (xdalamMusuh != 0) {
banyakMusuh++;
jenisMusuh = indi2;
if ((jenisMusuh >= 18) && (jenisMusuh <= 25)) {
musuh = attachMovie("xtroops" + jenisMusuh, "musuh_mc" + xdalamMusuh, xdalamMusuh + 52500);
} else {
musuh = attachMovie("xtroops" + jenisMusuh, "musuh_mc" + xdalamMusuh, xdalamMusuh);
}
musuh.cacheAsBitmap = true;
if (indi3 != undefined) {
musuh._x = indi._x + indi3;
musuh._y = indi._y - 30;
} else {
musuh._x = background_mc._x + indi._x;
musuh._y = background_mc._y + indi._y;
}
if (((jenisMusuh == 15) || (jenisMusuh == 16)) || (jenisMusuh == 17)) {
musuh._y = musuh._y + 5;
}
musuh.posisiKini = indi.posisiKini;
musuh.jenis = jenisMusuh;
musuh.tiarap = false;
musuh.berhenti = false;
musuh.sedangHitBatu = false;
if (((jenisMusuh == 2) || (jenisMusuh == 4)) || (jenisMusuh == 6)) {
musuh.tiarap = true;
} else if ((((((((jenisMusuh == 10) || (jenisMusuh == 11)) || (jenisMusuh == 12)) || (jenisMusuh == 13)) || (jenisMusuh == 14)) || (jenisMusuh == 15)) || (jenisMusuh == 16)) || (jenisMusuh == 17)) {
musuh.berhenti = true;
}
if ((((((((jenisMusuh == 13) || (jenisMusuh == 14)) || (jenisMusuh == 15)) || (jenisMusuh == 16)) || (jenisMusuh == 17)) || (jenisMusuh == 23)) || (jenisMusuh == 24)) || (jenisMusuh == 25)) {
musuh.tahanBesi = true;
} else {
musuh.tahanBesi = false;
}
if (jenisMusuh >= 10) {
musuh.besar = true;
} else {
musuh.besar = false;
}
if ((jenisMusuh >= 18) && (jenisMusuh <= 25)) {
musuh.terbang = true;
musuh._y = musuh._y - 25;
musuh._xscale = (musuh._yscale = 45);
} else {
musuh.terbang = false;
musuh._xscale = (musuh._yscale = 70);
}
musuh.awalScale = musuh._xscale;
musuh.orang = false;
musuh.kendaraan = false;
if (jenisMusuh <= 9) {
musuh.orang = true;
} else if (jenisMusuh <= 17) {
musuh.kendaraan = true;
}
if ((jenisMusuh >= 20) && (jenisMusuh <= 25)) {
musuh.lanjut = true;
} else {
musuh.lanjut = false;
}
if ((jenisMusuh >= 23) && (jenisMusuh <= 24)) {
musuh.bomber = true;
musuh._y = musuh._y - 10;
} else {
musuh.bomber = false;
}
musuh.serangBesi = false;
musuh.sudahBerhenti = false;
musuh.tipeUnit = "musuh";
cekAtributeMusuh(jenisMusuh);
if (indi3 != undefined) {
musuh.range = musuh.range + Math.abs(indi3);
}
musuh.speedTurun = 1;
musuh.speedNaik = 15;
musuh.serangBase = false;
musuh.loncat = false;
musuh.sudahMati = false;
musuh.onEnterFrame = enterMusuh;
zi = 1000;
while (zi <= 1030) {
if ((_root["jagoan_mc" + zi]._x != undefined) && (_root["jagoan_mc" + zi].nyawa > 0)) {
cekTarget(_root["jagoan_mc" + zi]);
}
zi++;
}
}
}
}
function enterTower2() {
if (sedangPause == false) {
if (siapaMenang == "musuh") {
if (this.nyawa > 0) {
if (this.troop.bar_mc._visible == true) {
this.troop.bar_mc._visible = false;
if (this.jenis >= 10) {
buatJagoan2(this, 1);
} else {
this.troop._visible = false;
buatJagoan2(this, this.jenis);
}
this.nyawa = 0;
}
} else {
this.troop.bar_mc._visible = false;
if (this.troop._currentframe != 3) {
money2 = money2 + daftarHarga[this.jenis];
this.troop.gotoAndStop(3);
}
}
} else {
this.troop.bar_mc.bar._xscale = (this.nyawa / this.maxNyawa) * 100;
if (this.nyawa <= 0) {
this.troop.bar_mc._visible = false;
if (this.troop._currentframe != 3) {
if (this.tahanBesi == true) {
backLedak();
} else {
backMati();
}
buildingMati1++;
banyakJagoan--;
if (this.moneyLebih == true) {
money1 = money1 + (xdaftarHarga[this.jenis] * 2);
} else {
money1 = money1 + xdaftarHarga[this.jenis];
}
this.troop.gotoAndStop(3);
}
} else {
if ((((this._x + background_mc._x) > this.xtarget._x) || (this.xtarget.nyawa <= 0)) || (this.posisiKini != this.xtarget.posisiKini)) {
this.xtarget = undefined;
}
if (this.xtarget == undefined) {
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if ((this._x + background_mc._x) < _root["musuh_mc" + i]._x) {
if (this.posisiKini == _root["musuh_mc" + i].posisiKini) {
this.xjarak = Math.sqrt(Math.pow((this._x + background_mc._x) - _root["musuh_mc" + i]._x, 2) + Math.pow((this._y + background_mc._y) - _root["musuh_mc" + i]._y, 2));
if (this.xjarak <= this.range) {
this.xtarget = _root["musuh_mc" + i];
}
}
}
}
i++;
}
}
if (this.xtarget != undefined) {
if ((this.xtarget.tipeUnit == "tower_musuh") || (this.xtarget.tipeUnit == "lain")) {
this.xjarak = Math.sqrt(Math.pow(((this.xtarget._x + background_mc._x) - this._x) + background_mc._x, 2) + Math.pow(((this.xtarget._y + background_mc._y) - this._y) + background_mc._y, 2));
} else {
this.xjarak = Math.sqrt(Math.pow((this._x + background_mc._x) - this.xtarget._x, 2) + Math.pow((this._y + background_mc._y) - this.xtarget._y, 2));
}
if (this.xjarak <= this.range) {
this.adaMusuh = true;
} else {
this.adaMusuh = false;
}
}
if (this.xtarget != undefined) {
if (this.adaMusuh == true) {
this.troop.gotoAndStop(2);
} else {
this.troop.gotoAndStop(4);
}
} else {
this.troop.gotoAndStop(4);
}
}
}
}
}
function buatTentaraJagoan(indi) {
if (sudahSelesai == false) {
randBuat = 13 + random(5);
buatJagoan2(indi, randBuat, 0);
}
}
function buatJagoan2(indi, indi2, indi3, indi4, indi5) {
xdalamJagoan = 0;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x == undefined) {
xdalamJagoan = i;
}
i++;
}
if (banyakJagoan < bykPasukan1) {
if (xdalamJagoan != 0) {
jenisJagoan = indi2;
if (indi4 == "kendaraan2") {
money1 = money1 + xdaftarHarga[indi5];
}
bisaTambahJagoan2 = false;
if ((indi4 == "kendaraan") || (indi4 == "kendaraan2")) {
if (money1 >= xdaftarHarga[jenisJagoan]) {
money1 = money1 - xdaftarHarga[jenisJagoan];
bisaTambahJagoan2 = true;
}
} else {
bisaTambahJagoan2 = true;
}
if (bisaTambahJagoan2 == true) {
if ((jenisJagoan == 18) || (jenisJagoan == 19)) {
backHeli();
} else if (((jenisJagoan == 20) || (jenisJagoan == 21)) || (jenisJagoan == 22)) {
backCopter();
} else if (((jenisJagoan == 23) || (jenisJagoan == 24)) || (jenisJagoan == 25)) {
backAir();
}
banyakJagoan++;
randKeluar = indi;
if ((jenisJagoan >= 18) && (jenisJagoan <= 25)) {
jagoan = attachMovie("troops" + jenisJagoan, "jagoan_mc" + xdalamJagoan, xdalamJagoan + 52500);
} else if (jenisJagoan == 43) {
jagoan = attachMovie("troops" + jenisJagoan, "jagoan_mc" + xdalamJagoan, xdalamJagoan + 52500);
} else {
jagoan = attachMovie("troops" + jenisJagoan, "jagoan_mc" + xdalamJagoan, xdalamJagoan);
}
jagoan.cacheAsBitmap = true;
if (indi3 != undefined) {
jagoan._x = indi._x + indi3;
jagoan._y = indi._y - 30;
} else {
jagoan._x = background_mc._x + indi._x;
jagoan._y = background_mc._y + indi._y;
}
if (((jenisJagoan == 15) || (jenisJagoan == 16)) || (jenisJagoan == 17)) {
jagoan._y = jagoan._y + 5;
}
jagoan.posisiKini = indi.posisiKini;
jagoan.jenis = jenisJagoan;
jagoan.tiarap = false;
jagoan.berhenti = false;
jagoan.sedangHitBatu = false;
if (((jenisJagoan == 2) || (jenisJagoan == 4)) || (jenisJagoan == 6)) {
jagoan.tiarap = true;
} else if (((((((((jenisJagoan == 10) || (jenisJagoan == 11)) || (jenisJagoan == 12)) || (jenisJagoan == 13)) || (jenisJagoan == 14)) || (jenisJagoan == 15)) || (jenisJagoan == 16)) || (jenisJagoan == 17)) || (jenisJagoan == 42)) {
jagoan.berhenti = true;
}
if (((((((((jenisJagoan == 13) || (jenisJagoan == 14)) || (jenisJagoan == 15)) || (jenisJagoan == 16)) || (jenisJagoan == 17)) || (jenisJagoan == 23)) || (jenisJagoan == 24)) || (jenisJagoan == 25)) || (jenisJagoan == 42)) {
jagoan.tahanBesi = true;
} else {
jagoan.tahanBesi = false;
}
if (jenisJagoan >= 10) {
jagoan.besar = true;
} else {
jagoan.besar = false;
}
if ((jenisJagoan >= 18) && (jenisJagoan <= 25)) {
jagoan.terbang = true;
jagoan._y = jagoan._y - 25;
jagoan._xscale = (jagoan._yscale = 45);
} else {
jagoan.terbang = false;
jagoan._xscale = (jagoan._yscale = 70);
}
jagoan.awalScale = jagoan._xscale;
jagoan.orang = false;
jagoan.kendaraan = false;
if (jenisJagoan <= 9) {
jagoan.orang = true;
} else if ((jenisJagoan <= 17) || (jenisJagoan == 42)) {
jagoan.kendaraan = true;
}
if ((jenisJagoan >= 20) && (jenisJagoan <= 25)) {
jagoan.lanjut = true;
} else {
jagoan.lanjut = false;
}
if ((jenisJagoan >= 23) && (jenisJagoan <= 24)) {
jagoan.bomber = true;
jagoan._y = jagoan._y - 10;
} else {
jagoan.bomber = false;
}
jagoan.serangBesi = false;
jagoan.sudahBerhenti = false;
jagoan.tipeUnit = "jagoan";
cekAtributeJagoan(jenisJagoan);
if (indi3 != undefined) {
jagoan.range = jagoan.range + Math.abs(indi3);
}
if (indi4 != undefined) {
if (indi4.superSoldier == true) {
jagoan.nyawa = jagoan.nyawa + indi4.nyawa;
jagoan.damage = jagoan.damage + indi4.damage;
jagoan.speed = jagoan.speed + indi4.speed;
jagoan.maxNyawa = jagoan.nyawa;
}
}
jagoan.speedTurun = 1;
jagoan.speedNaik = 15;
jagoan.serangBase = false;
jagoan.loncat = false;
jagoan.sudahMati = false;
cekTarget(jagoan);
jagoan.onEnterFrame = enterJagoan;
zi = 2000;
while (zi <= 2030) {
if ((_root["musuh_mc" + zi]._x != undefined) && (_root["musuh_mc" + zi].nyawa > 0)) {
cekTarget2(_root["musuh_mc" + zi]);
}
zi++;
}
} else {
ui_mc.info_mc.gotoAndPlay(2);
ui_mc.info_mc.informasi = "Can't create any unit, not enough funds";
}
}
} else {
ui_mc.info_mc.gotoAndPlay(2);
ui_mc.info_mc.informasi = "Can't create any unit, maximum number of unit reached";
}
}
function buatUI() {
ui_mc = attachMovie("ui_mc", "ui_mc", dalamUI);
ui_mc.cacheAsBitmap = true;
ui_mc._x = 0;
ui_mc._y = 0;
pilihTipe = 1;
i = 1;
while (i <= 50) {
ui_mc["frame" + i].sedangSupported = false;
i++;
}
i = 1;
while (i <= 8) {
ui_mc["supported" + i].gotoAndStop(i);
ui_mc["supported" + i].jeda_mc.gotoAndStop(1);
if (_root["bisaSupported" + i] == true) {
ui_mc["supported" + i].gembok_mc._visible = false;
ui_mc["supported" + i].onRelease = klikSupported;
ui_mc["supported" + i].onRollOver = overFrame2;
ui_mc["supported" + i].onRollOut = outFrame2;
} else {
ui_mc["supported" + i].gembok_mc._visible = true;
delete ui_mc["supported" + i].onRelease;
}
i++;
}
cekTipe();
ui_mc.menu_btn.onRelease = function () {
cekPause(true);
};
ui_mc.more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
}
function cekPause(indi) {
if (indi == true) {
sedangPause = true;
ui_mc._visible = false;
minimap_mc._visible = false;
menu = attachMovie("menu_mc", "menu_mc", dalamMenu);
menu._x = 400;
menu._y = 300;
menu.gotoAndStop(1);
menu.surrender_btn._visible = true;
menu.quit_btn._visible = true;
menu.back_btn.onRelease = function () {
cekPause(false);
};
menu.surrender_btn.onRelease = function () {
cekPause(false);
cekSurrender = true;
baseJagoan = 0;
background_mc.benteng1.bentengx.gotoAndStop(2);
siapaMenang = "musuh";
cekKalah();
};
menu.quit_btn.onRelease = function () {
clearSemua();
backMusic();
gotoAndStop (213);
};
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i].anim.stop();
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i].anim.stop();
}
i++;
}
i = 1;
while (i <= 43) {
if (ui_mc["frame" + i]._currentframe > 1) {
ui_mc["frame" + i].stop();
}
i++;
}
} else if (indi == false) {
sedangPause = false;
ui_mc._visible = true;
minimap_mc._visible = true;
removeMovieClip(menu_mc);
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i].anim.play();
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i].anim.play();
}
i++;
}
i = 1;
while (i <= 43) {
if (ui_mc["frame" + i]._currentframe > 1) {
ui_mc["frame" + i].play();
}
i++;
}
}
}
function klikLanjutSupported() {
adaActionSupported = false;
i = 43;
while (i >= 1) {
if (this.hitTest(ui_mc["frame" + i].tanda_mc)) {
if (ui_mc["frame" + i]._visible == true) {
if (ui_mc["gembok" + i]._visible == false) {
ui_mc["frame" + i].sedangSupported = true;
ui_mc["frame" + i].supported._visible = true;
ui_mc["frame" + i].supported.gotoAndStop(this._currentframe);
if ((this._currentframe == 2) || (this._currentframe == 3)) {
}
adaActionSupported = true;
i = 1;
}
}
}
i--;
}
if (adaActionSupported == true) {
ui_mc["supported" + this._currentframe].jeda_mc.gotoAndPlay(2);
}
removeMovieClip(supported_mc);
stopDrag();
i = 1;
while (i <= 50) {
ui_mc["frame" + i].tanda_mc._visible = false;
i++;
}
}
function klikSupported() {
supported_mc = attachMovie("supported_mc", "supported_mc", dalamGo);
supported_mc.cacheAsBitmap = true;
supported_mc.gotoAndStop(this._currentframe);
supported_mc._xscale = (supported_mc._yscale = 75);
supported_mc._x = _root._xmouse;
supported_mc._y = _root._ymouse;
supported_mc.onRelease = klikLanjutSupported;
startDrag (supported_mc);
i = 1;
while (i <= 43) {
if (ui_mc["frame" + i]._visible == true) {
if (ui_mc["gembok" + i]._visible == false) {
ui_mc["frame" + i].tanda_mc._visible = true;
}
}
i++;
}
}
function cekTipe() {
i = 1;
while (i <= 50) {
ui_mc["gembok" + i]._visible = false;
ui_mc["frame" + i]._visible = false;
ui_mc["frame" + i].tanda_mc._visible = false;
ui_mc["frame" + i].supported._visible = false;
ui_mc["harga" + i] = "";
i++;
}
i = 1;
while (i <= 43) {
if (ui_mc["frame" + i].sedangSupported == true) {
ui_mc["frame" + i].supported._visible = true;
} else {
ui_mc["frame" + i].supported._visible = false;
}
i++;
}
if (pilihTipe == 1) {
awalUnit = 1;
akhirUnit = 9;
batasBawahUnit = 0;
} else if (pilihTipe == 2) {
awalUnit = 10;
akhirUnit = 17;
batasBawahUnit = 9;
} else if (pilihTipe == 3) {
awalUnit = 18;
akhirUnit = 25;
batasBawahUnit = 17;
} else if (pilihTipe == 4) {
awalUnit = 26;
akhirUnit = 31;
batasBawahUnit = 25;
} else if (pilihTipe == 5) {
awalUnit = 32;
akhirUnit = 36;
batasBawahUnit = 31;
} else if (pilihTipe == 6) {
awalUnit = 37;
akhirUnit = 40;
batasBawahUnit = 36;
} else if (pilihTipe == 7) {
awalUnit = 41;
akhirUnit = 43;
batasBawahUnit = 40;
}
i = awalUnit;
while (i <= akhirUnit) {
ui_mc["frame" + i]._visible = true;
if (_root["bisaUnit" + i] == true) {
ui_mc["gembok" + i]._visible = false;
ui_mc["harga" + (i - batasBawahUnit)] = xdaftarHarga[i];
ui_mc["frame" + i].onRelease = klikUnit;
ui_mc["frame" + i].onRollOver = overFrame;
ui_mc["frame" + i].onRollOut = outFrame;
ui_mc["frame" + i].onEnterFrame = enterFrameUnit;
} else {
ui_mc["gembok" + i]._visible = true;
ui_mc["harga" + i] = "";
delete ui_mc["frame" + i].onRelease;
delete ui_mc["frame" + i].onEnterFrame;
}
i++;
}
i = 1;
while (i <= 9) {
ui_mc["tipe" + i].gotoAndStop(1);
ui_mc["tipe" + i].onRelease = klikTipe;
i++;
}
ui_mc["tipe" + pilihTipe].gotoAndStop(2);
}
function overFrame() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
zpilihJenis = myStr.substr(myStr.length - 1, 1);
} else {
zpilihJenis = myStr.substr(myStr.length - 2, 2);
}
this._alpha = 50;
infoBox = attachMovie("info_box", "info_box", dalamInfo);
infoBox.cacheAsBitmap = true;
infoBox._alpha = 100;
infoBox._x = this._x + 50;
infoBox._y = this._y + 100;
infoBox.judul = daftarNama[zpilihJenis];
cekLevelKe(zpilihJenis);
liveNaik = Math.ceil(levelKe1 * daftarLive[zpilihJenis]);
rangeNaik = Math.ceil(levelKe2 * daftarRange[zpilihJenis]);
speedNaik = Math.ceil(levelKe3 * daftarSpeed[zpilihJenis]);
damageNaik = Math.ceil(levelKe4 * daftarDamage[zpilihJenis]);
if ((zpilihJenis >= 26) && (zpilihJenis <= 36)) {
infoBox.isi = "Place it on the red sign. Press CTRL and click anywhere to cancel.";
} else if ((zpilihJenis >= 37) && (zpilihJenis <= 40)) {
infoBox.isi = "Click it on the target. Press CTRL and click anywhere to cancel.";
} else {
infoBox.isi = (((((("Life: " + liveNaik) + ", Range: ") + rangeNaik) + ", Speed: ") + speedNaik) + ",\nDamage: ") + damageNaik;
}
}
function outFrame() {
this._alpha = 100;
removeMovieClip(infoBox);
}
function overFrame2() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
zpilihJenis = myStr.substr(myStr.length - 1, 1);
} else {
zpilihJenis = myStr.substr(myStr.length - 2, 2);
}
this._alpha = 50;
infoBox = attachMovie("info_box", "info_box", dalamInfo);
infoBox.cacheAsBitmap = true;
infoBox._alpha = 100;
infoBox._x = this._x - 50;
infoBox._y = this._y + 100;
infoBox.judul = daftarSpell[zpilihJenis];
infoBox.isi = penjelasanSpell[zpilihJenis] + ". Place to units on the left";
}
function outFrame2() {
this._alpha = 100;
removeMovieClip(infoBox);
}
function cekLevelKe(indi) {
if (levelLive[indi] == 1) {
levelKe1 = 1;
} else if (levelLive[indi] == 2) {
levelKe1 = 1.2;
} else if (levelLive[indi] == 3) {
levelKe1 = 1.4;
}
if (levelRange[indi] == 1) {
levelKe2 = 1;
} else if (levelRange[indi] == 2) {
levelKe2 = 1.1;
} else if (levelRange[indi] == 3) {
levelKe2 = 1.2;
}
if (levelSpeed[indi] == 1) {
levelKe3 = 1;
} else if (levelSpeed[indi] == 2) {
levelKe3 = 1.2;
} else if (levelSpeed[indi] == 3) {
levelKe3 = 1.4;
}
if (levelDamage[indi] == 1) {
levelKe4 = 1;
} else if (levelDamage[indi] == 2) {
levelKe4 = 1.1;
} else if (levelDamage[indi] == 3) {
levelKe4 = 1.2;
}
}
function klikTipe() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
pilihTipe = indi;
cekTipe();
}
function enterFrameUnit() {
if (sedangPause == false) {
if (this._currentframe == 1) {
this.enabled = true;
} else {
this.enabled = false;
}
}
}
function cekComplete(indi) {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
xindi = Number(myStr.substr(myStr.length - 1, 1));
} else {
xindi = Number(myStr.substr(myStr.length - 2, 2));
}
indi.sudahJadi = false;
indi.klik_mc._visible = false;
}
function klikUnit(zindi) {
if (zindi != undefined) {
myStr = new String(zindi);
} else {
myStr = new String(this);
}
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
xindi = myStr.substr(myStr.length - 1, 1);
} else {
xindi = myStr.substr(myStr.length - 2, 2);
}
if (sedangDrag == false) {
if (money1 >= xdaftarHarga[xindi]) {
xjenisJagoan = xindi;
if (xjenisJagoan == 41) {
munculJagoan3();
} else if ((xjenisJagoan >= 37) && (xjenisJagoan <= 40)) {
target_mc = attachMovie("target_mc", "target_mc", dalamGo);
target_mc.cacheAsBitmap = true;
target_mc._x = _root._xmouse;
target_mc._y = _root._ymouse;
target_mc._xscale = (target_mc._yscale = 200);
target_mc.jenis = xjenisJagoan;
sedangDrag = true;
startDrag (target_mc);
} else if ((xjenisJagoan >= 26) && (xjenisJagoan <= 36)) {
go_mc = attachMovie("go_mc", "go_mc", dalamGo);
go_mc.cacheAsBitmap = true;
go_mc._x = _root._xmouse;
go_mc._y = _root._ymouse;
sedangDrag = true;
startDrag (go_mc);
munculTower();
} else if ((xjenisJagoan >= 23) && (xjenisJagoan <= 24)) {
munculJagoan2();
} else {
go_mc = attachMovie("go_mc", "go_mc", dalamGo);
go_mc.cacheAsBitmap = true;
go_mc._x = _root._xmouse;
go_mc._y = _root._ymouse;
go_mc.onEnterFrame = enterGo;
sedangDrag = true;
startDrag (go_mc);
}
} else {
ui_mc.info_mc.gotoAndPlay(2);
ui_mc.info_mc.informasi = "Can't create any unit, not enough funds";
}
} else {
sedangDrag = false;
removeMovieClip(go_mc);
stopDrag();
i = 1;
while (i <= 4) {
_root["tanda_mc" + i]._visible = false;
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
delete background_mc["towerJagoan" + i].onRelease;
background_mc["towerJagoan" + i].tanda_mc._visible = false;
i++;
}
i = 1;
while (i <= 50) {
ui_mc["frame" + i].tanda_mc._visible = false;
i++;
}
}
}
function cekMisilStrike(indi, posX, posY, indi2) {
bykMisil = 0;
if (indi == 37) {
bykMisil = 4;
} else if (indi == 38) {
bykMisil = 5;
} else if (indi == 39) {
bykMisil = 6;
} else if (indi == 40) {
bykMisil = 7;
}
ui_mc["frame" + indi].gotoAndPlay(2);
i = 1;
while (i <= bykMisil) {
misil_mc = attachMovie("misil" + (indi - 36), "peluru_mc" + dalamPeluru, dalamPeluru);
misil_mc.cacheAsBitmap = true;
misil_mc._x = (posX - 150) - random(i * 250);
misil_mc._y = (posY - random(250)) - (i * 500);
misil_mc._xscale = (chara._yscale = 60);
misil_mc.damage = 350 * (indi - 36);
misil_mc.speed = 40;
misil_mc.xtargetX = (posX + random(25)) - 50;
misil_mc.xtargetY = (posY - random(30)) + 15;
misil_mc.bawah = misil_mc.xtargetY;
x1 = misil_mc._x - misil_mc.xtargetX;
y1 = misil_mc._y - misil_mc.xtargetY;
sudut = 57.29578 * Math.atan(y1 / x1);
if (((sudut >= -90) && (sudut <= 90)) && (x1 >= 0)) {
misil_mc._rotation = sudut + 180;
} else {
misil_mc._rotation = sudut;
}
misil_mc.serangSiapa = indi2;
misil_mc.onEnterFrame = enterMisil2;
dalamPeluru++;
if (dalamPeluru >= 52100) {
dalamPeluru = 52000;
}
i++;
}
}
function enterMisil2() {
if (sedangPause == false) {
this._x = this._x + speedGame;
this.xtargetX = this.xtargetX + speedGame;
this.aimX = this.xtargetX;
this.aimY = this.xtargetY;
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) {
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 {
if (this._currentframe == 1) {
this.gotoAndStop(2);
cekEfek(this, "granat", this.bawah);
cekEfekBomb(this);
if (this.serangSiapa == "musuh") {
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerMusuh" + i])) {
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa - this.damage;
}
}
i++;
}
} else if (this.serangSiapa == "jagoan") {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerJagoan" + i])) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa - this.damage;
}
}
i++;
}
}
}
removeMovieClip(this);
}
}
}
function munculTower() {
i = 1;
while (i <= bykTowerJagoan) {
background_mc["towerJagoan" + i].tanda_mc._visible = true;
background_mc["towerJagoan" + i].onRelease = klikTowerJagoan;
i++;
}
}
function klikTowerJagoan() {
ui_mc["frame" + xjenisJagoan].gotoAndPlay(2);
money1 = money1 - xdaftarHarga[xjenisJagoan];
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
indi1 = background_mc["towerJagoan" + indi];
indi2 = background_mc["towerJagoan" + indi].jenis;
indi3 = background_mc["towerJagoan" + indi]._currentframe;
if (background_mc["towerJagoan" + indi].troop._currentframe != 3) {
banyakJagoan--;
buatJagoanTower(indi, jenisPasukanTower[[xjenisJagoan - 25]], xjenisJagoan);
if (indi3 <= 9) {
buatJagoan2(indi1, indi2);
}
} else {
buatJagoanTower(indi, jenisPasukanTower[[xjenisJagoan - 25]], xjenisJagoan);
}
sedangDrag = false;
removeMovieClip(go_mc);
stopDrag();
i = 1;
while (i <= bykTowerJagoan) {
delete background_mc["towerJagoan" + i].onRelease;
background_mc["towerJagoan" + i].tanda_mc._visible = false;
i++;
}
}
function enterGo() {
if (sedangPause == false) {
i = 1;
while (i <= 4) {
_root["tanda_mc" + i]._visible = false;
i++;
}
i = 1;
while (i <= 4) {
if (this.hitTest(_root["tanda_mc" + i])) {
_root["tanda_mc" + i]._visible = true;
_root["tanda_mc" + i].onRelease = munculJagoan;
i = 4;
}
i++;
}
}
}
function munculJagoan() {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
buatJagoan(indi, xjenisJagoan);
sedangDrag = false;
removeMovieClip(go_mc);
stopDrag();
i = 1;
while (i <= 4) {
_root["tanda_mc" + i]._visible = false;
i++;
}
}
function munculJagoan2() {
ui_mc["frame" + xjenisJagoan].gotoAndPlay(2);
buatJagoan(4, xjenisJagoan);
sedangDrag = false;
removeMovieClip(go_mc);
stopDrag();
i = 1;
while (i <= 4) {
_root["tanda_mc" + i]._visible = false;
i++;
}
}
function munculJagoan3() {
ui_mc["frame" + xjenisJagoan].gotoAndPlay(2);
money1 = money1 - xdaftarHarga[xjenisJagoan];
z = 4;
while (z >= 1) {
buatJagoan(z, xjenisJagoan, "special");
z--;
}
sedangDrag = false;
removeMovieClip(go_mc);
stopDrag();
i = 1;
while (i <= 4) {
_root["tanda_mc" + i]._visible = false;
i++;
}
}
function buatJagoan(indi, indi2, indi3, indi4) {
xdalamJagoan = 0;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x == undefined) {
xdalamJagoan = i;
i = 1030;
}
i++;
}
if (banyakJagoan < bykPasukan1) {
if (xdalamJagoan != 0) {
jenisJagoan = indi2;
bisaTambahJagoan = false;
if (indi3 != "special") {
if (money1 >= xdaftarHarga[jenisJagoan]) {
money1 = money1 - xdaftarHarga[jenisJagoan];
bisaTambahJagoan = true;
}
} else {
bisaTambahJagoan = true;
}
if (bisaTambahJagoan == true) {
if ((jenisJagoan == 18) || (jenisJagoan == 19)) {
backHeli();
} else if (((jenisJagoan == 20) || (jenisJagoan == 21)) || (jenisJagoan == 22)) {
backCopter();
} else if (((jenisJagoan == 23) || (jenisJagoan == 24)) || (jenisJagoan == 25)) {
backAir();
}
banyakJagoan++;
ui_mc["frame" + jenisJagoan].gotoAndPlay(2);
randKeluar = indi;
if ((jenisJagoan >= 18) && (jenisJagoan <= 25)) {
jagoan = attachMovie("troops" + jenisJagoan, "jagoan_mc" + xdalamJagoan, xdalamJagoan + 52500);
} else if (jenisJagoan == 43) {
jagoan = attachMovie("troops" + jenisJagoan, "jagoan_mc" + xdalamJagoan, xdalamJagoan + 52500);
} else {
jagoan = attachMovie("troops" + jenisJagoan, "jagoan_mc" + xdalamJagoan, xdalamJagoan);
}
jagoan.cacheAsBitmap = true;
jagoan._x = background_mc._x;
if (indi4 != undefined) {
jagoan._x = jagoan._x + indi4;
}
if (randKeluar == 1) {
jagoan._y = 550;
} else if (randKeluar == 2) {
jagoan._y = 450;
} else if (randKeluar == 3) {
jagoan._y = 350;
} else if (randKeluar == 4) {
jagoan._y = 250;
}
if (((jenisJagoan == 15) || (jenisJagoan == 16)) || (jenisJagoan == 17)) {
jagoan._y = jagoan._y + 5;
}
jagoan.posisiKini = randKeluar;
jagoan.jenis = jenisJagoan;
jagoan.tiarap = false;
jagoan.berhenti = false;
jagoan.sedangHitBatu = false;
if (((jenisJagoan == 2) || (jenisJagoan == 4)) || (jenisJagoan == 6)) {
jagoan.tiarap = true;
} else if (((((((((jenisJagoan == 10) || (jenisJagoan == 11)) || (jenisJagoan == 12)) || (jenisJagoan == 13)) || (jenisJagoan == 14)) || (jenisJagoan == 15)) || (jenisJagoan == 16)) || (jenisJagoan == 17)) || (jenisJagoan == 42)) {
jagoan.berhenti = true;
}
if ((((((((((jenisJagoan == 13) || (jenisJagoan == 14)) || (jenisJagoan == 15)) || (jenisJagoan == 16)) || (jenisJagoan == 17)) || (jenisJagoan == 23)) || (jenisJagoan == 24)) || (jenisJagoan == 25)) || (jenisJagoan == 42)) || (jenisJagoan == 43)) {
jagoan.tahanBesi = true;
} else {
jagoan.tahanBesi = false;
}
if (jenisJagoan >= 10) {
jagoan.besar = true;
} else {
jagoan.besar = false;
}
if ((jenisJagoan >= 18) && (jenisJagoan <= 25)) {
jagoan.terbang = true;
jagoan._y = jagoan._y - 25;
jagoan._xscale = (jagoan._yscale = 45);
} else if (jenisJagoan == 43) {
jagoan.terbang = true;
jagoan._y = jagoan._y - 25;
jagoan._xscale = (jagoan._yscale = 100);
} else {
jagoan.terbang = false;
jagoan._xscale = (jagoan._yscale = 70);
}
jagoan.awalScale = jagoan._xscale;
jagoan.orang = false;
jagoan.kendaraan = false;
if (jenisJagoan <= 9) {
jagoan.orang = true;
} else if ((jenisJagoan <= 17) || (jenisJagoan == 42)) {
jagoan.kendaraan = true;
}
if ((jenisJagoan >= 20) && (jenisJagoan <= 25)) {
jagoan.lanjut = true;
} else {
jagoan.lanjut = false;
}
if ((jenisJagoan >= 23) && (jenisJagoan <= 24)) {
jagoan.bomber = true;
jagoan._y = jagoan._y - 10;
} else {
jagoan.bomber = false;
}
if (jenisJagoan == 41) {
randAtas = random(100);
jagoan._x = jagoan._x + (300 + random(200));
jagoan._y = jagoan._y - (450 - randAtas);
jagoan.melayang = true;
jagoan.sudahMendarat = false;
jagoan.batasMelayang = jagoan._y + (400 - randAtas);
jagoan.speedMelayang = 2;
jagoan.orang = true;
jagoan.besar = false;
jagoan.superSoldier = true;
} else {
jagoan.melayang = false;
jagoan.superSoldier = false;
}
jagoan.sudahBerhenti = false;
jagoan.tipeUnit = "jagoan";
cekAtributeJagoan(jenisJagoan);
jagoan.speedTurun = 1;
jagoan.speedNaik = 15;
jagoan.serangBase = false;
jagoan.loncat = false;
jagoan.sudahMati = false;
cekTarget(jagoan);
jagoan.onEnterFrame = enterJagoan;
zi = 2000;
while (zi <= 2030) {
if ((_root["musuh_mc" + zi]._x != undefined) && (_root["musuh_mc" + zi].nyawa > 0)) {
cekTarget2(_root["musuh_mc" + zi]);
}
zi++;
}
jagoan.moneyLebih = false;
jagoan.serangBesi = false;
if (ui_mc["frame" + jenisJagoan].supported._visible == true) {
ui_mc["frame" + jenisJagoan].sedangSupported = false;
ui_mc["frame" + jenisJagoan].supported._visible = false;
if (ui_mc["frame" + jenisJagoan].supported._currentframe == 1) {
jagoan.serangBesi = true;
cekTarget(jagoan);
} else if (ui_mc["frame" + jenisJagoan].supported._currentframe == 2) {
if (randKeluar == 1) {
buatJagoan(2, jenisJagoan);
buatJagoan(3, jenisJagoan);
buatJagoan(4, jenisJagoan);
} else if (randKeluar == 2) {
buatJagoan(1, jenisJagoan);
buatJagoan(3, jenisJagoan);
buatJagoan(4, jenisJagoan);
} else if (randKeluar == 3) {
buatJagoan(1, jenisJagoan);
buatJagoan(2, jenisJagoan);
buatJagoan(4, jenisJagoan);
} else if (randKeluar == 4) {
buatJagoan(1, jenisJagoan);
buatJagoan(2, jenisJagoan);
buatJagoan(3, jenisJagoan);
}
} else if (ui_mc["frame" + jenisJagoan].supported._currentframe == 3) {
buatJagoan(randKeluar, jenisJagoan, undefined, -25);
buatJagoan(randKeluar, jenisJagoan, undefined, -50);
buatJagoan(randKeluar, jenisJagoan, undefined, -75);
} else if (ui_mc["frame" + jenisJagoan].supported._currentframe == 4) {
jagoan.nyawa = jagoan.nyawa * 4;
jagoan.damage = jagoan.damage * 4;
} else if (ui_mc["frame" + jenisJagoan].supported._currentframe == 5) {
jagoan.speed = jagoan.speed * 2;
jagoan.range = jagoan.range * 2;
} else if (ui_mc["frame" + jenisJagoan].supported._currentframe == 6) {
jagoan.tahanBesi = true;
} else if (ui_mc["frame" + jenisJagoan].supported._currentframe == 7) {
jagoan.nyawa = jagoan.nyawa * 4;
jagoan.damage = jagoan.damage * 4;
jagoan.speed = jagoan.speed * 2;
jagoan.range = jagoan.range * 2;
jagoan.speedNaik = jagoan.speedNaik * 2;
} else if (ui_mc["frame" + jenisJagoan].supported._currentframe == 8) {
cekHancurSemua("jagoan", jagoan.posisiKini);
}
jagoan.maxNyawa = jagoan.nyawa;
}
} else {
ui_mc.info_mc.gotoAndPlay(2);
ui_mc.info_mc.informasi = "Can't create any unit, not enough funds";
}
}
} else {
ui_mc.info_mc.gotoAndPlay(2);
ui_mc.info_mc.informasi = "Can't create any unit, maximum number of unit reached";
}
}
function cekHancurSemua(indi, indi2) {
if (indi == "jagoan") {
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (_root["musuh_mc" + i].posisiKini == indi2) {
cekEfek(_root["musuh_mc" + i], "granat");
cekEfek(_root["musuh_mc" + i], "misil");
cekEfekLedak(_root["musuh_mc" + i], 1);
cekEfekBomb(_root["musuh_mc" + i]);
_root["musuh_mc" + i].nyawa = 0;
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (background_mc["towerMusuh" + i].posisiKini == indi2) {
background_mc["towerMusuh" + i].nyawa = 0;
}
}
i++;
}
} else if (indi == "musuh") {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (_root["jagoan_mc" + i].posisiKini == indi2) {
cekEfek(_root["jagoan_mc" + i], "granat");
cekEfek(_root["jagoan_mc" + i], "misil");
cekEfekLedak(_root["jagoan_mc" + i], 1);
cekEfekBomb(_root["jagoan_mc" + i]);
_root["jagoan_mc" + i].nyawa = 0;
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (background_mc["towerJagoan" + i].posisiKini == indi2) {
background_mc["towerJagoan" + i].nyawa = 0;
}
}
i++;
}
}
}
function cekAtributeJagoan(indi) {
if (indi == 1) {
jagoan.nyawa = 150;
jagoan.damage = 30;
jagoan.speed = 4.5;
jagoan.range = 350;
} else if (indi == 2) {
jagoan.nyawa = 200;
jagoan.damage = 45;
jagoan.speed = 3.5;
jagoan.range = 375;
} else if (indi == 3) {
jagoan.nyawa = 100;
jagoan.damage = 75;
jagoan.speed = 3;
jagoan.range = 400;
} else if (indi == 4) {
jagoan.nyawa = 125;
jagoan.damage = 100;
jagoan.speed = 3;
jagoan.range = 550;
} else if (indi == 5) {
jagoan.nyawa = 350;
jagoan.damage = 200;
jagoan.speed = 4;
jagoan.range = 650;
} else if (indi == 6) {
jagoan.nyawa = 450;
jagoan.damage = 75;
jagoan.speed = 4.5;
jagoan.range = 350;
} else if (indi == 7) {
jagoan.nyawa = 250;
jagoan.damage = 500;
jagoan.speed = 3;
jagoan.range = 600;
} else if (indi == 8) {
jagoan.nyawa = 350;
jagoan.damage = 750;
jagoan.speed = 2.5;
jagoan.range = 650;
} else if (indi == 9) {
jagoan.nyawa = 450;
jagoan.damage = 1000;
jagoan.speed = 2;
jagoan.range = 700;
} else if (indi == 10) {
jagoan.nyawa = 600;
jagoan.damage = 45;
jagoan.speed = 5.5;
jagoan.range = 450;
} else if (indi == 11) {
jagoan.nyawa = 850;
jagoan.damage = 65;
jagoan.speed = 5;
jagoan.range = 500;
} else if (indi == 12) {
jagoan.nyawa = 1100;
jagoan.damage = 75;
jagoan.speed = 4.5;
jagoan.range = 550;
} else if (indi == 13) {
jagoan.nyawa = 1500;
jagoan.damage = 75;
jagoan.speed = 3.5;
jagoan.range = 400;
} else if (indi == 14) {
jagoan.nyawa = 1750;
jagoan.damage = 100;
jagoan.speed = 3.5;
jagoan.range = 450;
} else if (indi == 15) {
jagoan.nyawa = 2500;
jagoan.damage = 400;
jagoan.speed = 2.5;
jagoan.range = 650;
} else if (indi == 16) {
jagoan.nyawa = 3500;
jagoan.damage = 500;
jagoan.speed = 2;
jagoan.range = 700;
} else if (indi == 17) {
jagoan.nyawa = 4500;
jagoan.damage = 600;
jagoan.speed = 1.5;
jagoan.range = 750;
} else if (indi == 18) {
jagoan.nyawa = 1000;
jagoan.damage = 150;
jagoan.speed = 3.5;
jagoan.range = 500;
} else if (indi == 19) {
jagoan.nyawa = 1500;
jagoan.damage = 300;
jagoan.speed = 4;
jagoan.range = 650;
} else if (indi == 20) {
jagoan.nyawa = 2500;
jagoan.damage = 40;
jagoan.speed = 9;
jagoan.range = 800;
} else if (indi == 21) {
jagoan.nyawa = 3000;
jagoan.damage = 60;
jagoan.speed = 11;
jagoan.range = 850;
} else if (indi == 22) {
jagoan.nyawa = 3500;
jagoan.damage = 80;
jagoan.speed = 10;
jagoan.range = 900;
} else if (indi == 23) {
jagoan.nyawa = 4500;
jagoan.damage = 1000;
jagoan.speed = 4;
jagoan.range = 50;
} else if (indi == 24) {
jagoan.nyawa = 5500;
jagoan.damage = 1500;
jagoan.speed = 6;
jagoan.range = 75;
} else if (indi == 25) {
jagoan.nyawa = 6500;
jagoan.damage = 400;
jagoan.speed = 10;
jagoan.range = 950;
} else if (indi == 41) {
jagoan.nyawa = 10000;
jagoan.damage = 750;
jagoan.speed = 8;
jagoan.range = 750;
} else if (indi == 42) {
jagoan.nyawa = 15000;
jagoan.damage = 1000;
jagoan.speed = 3.5;
jagoan.range = 850;
} else if (indi == 43) {
jagoan.nyawa = 12000;
jagoan.damage = 0;
jagoan.speed = 2.5;
jagoan.range = -100;
}
if (levelLive[indi] == 1) {
xlevelKe = 1;
} else if (levelLive[indi] == 2) {
xlevelKe = 1.2;
} else if (levelLive[indi] == 3) {
xlevelKe = 1.4;
}
jagoan.nyawa = jagoan.nyawa * xlevelKe;
if (levelRange[pilihKotak] == 1) {
xlevelKe = 1;
} else if (levelRange[pilihKotak] == 2) {
xlevelKe = 1.1;
} else if (levelRange[pilihKotak] == 3) {
xlevelKe = 1.2;
}
jagoan.range = jagoan.range * xlevelKe;
if (levelSpeed[pilihKotak] == 1) {
xlevelKe = 1;
} else if (levelSpeed[pilihKotak] == 2) {
xlevelKe = 1.2;
} else if (levelSpeed[pilihKotak] == 3) {
xlevelKe = 1.4;
}
jagoan.speed = jagoan.speed * xlevelKe;
if (levelDamage[pilihKotak] == 1) {
xlevelKe = 1;
} else if (levelDamage[pilihKotak] == 2) {
xlevelKe = 1.1;
} else if (levelDamage[pilihKotak] == 3) {
xlevelKe = 1.2;
}
jagoan.damage = jagoan.damage * xlevelKe;
jagoan.speed = jagoan.speed + (1.5 * (levelSkill[3] - 1));
jagoan.range = jagoan.range + (100 * (levelSkill[4] - 1));
jagoan.damage = jagoan.damage + (25 * (levelSkill[5] - 1));
jagoan.nyawa = jagoan.nyawa + (100 * (levelSkill[5] - 1));
if (jagoan.terbang == true) {
jagoan.speed = jagoan.speed * 0.5;
}
jagoan.speedY = 0;
if (jagoan.bomber == false) {
jagoan.batasBawah = jagoan._y + 25;
jagoan.batasAtas = jagoan._y - 25;
jagoan.speedY2 = 0.25;
} else {
jagoan.batasBawah = jagoan._y + 5;
jagoan.batasAtas = jagoan._y - 5;
jagoan.speedY2 = 0.1;
}
jagoan.range = jagoan.range + random(50);
jagoan.berkurangNyawa = false;
jagoan.maxNyawa = jagoan.nyawa;
}
function enterJagoan() {
if (sedangPause == false) {
this._x = this._x + speedGame;
this.bar_mc.bar._xscale = (this.nyawa / this.maxNyawa) * 100;
if (this.berkurangNyawa == true) {
this.nyawa = this.nyawa - (this.maxNyawa / 100);
}
if (this.nyawa <= 0) {
if (this.terbang == false) {
cekInteraksi(this, "jagoan");
}
this.bar_mc._visible = false;
if (this.tiarap == true) {
if ((this._currentframe >= 5) && (this._currentframe <= 7)) {
this.gotoAndStop(7);
} else if ((this._currentframe >= 1) && (this._currentframe <= 3)) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(3);
}
} else if (this._currentframe != 3) {
if (this.besar == true) {
cekPecah(this);
}
this.gotoAndStop(3);
}
if (this.sudahMati == false) {
if (this.terbang == true) {
if (this.lanjut == true) {
backJatuhCopter();
} else {
backJatuh();
}
} else if (this.besar == true) {
backLedak();
} else {
backMati();
}
this.sudahMati = true;
if (this.moneyLebih == true) {
money1 = money1 + (xdaftarHarga[this.jenis] * 2);
} else {
money1 = money1 + xdaftarHarga[this.jenis];
}
banyakJagoan--;
unitMati1++;
}
if (this.terbang == true) {
if (this.anim._currentframe == 1) {
this.sudahJatuh = true;
if ((this.zindi.hitTest(background_mc.rapuh1.indi) && (this._y >= background_mc.rapuh1._y)) && (this.posisiKini > background_mc.rapuh1.pos)) {
this._y = background_mc.rapuh1._y;
} else if ((this.zindi.hitTest(background_mc.rapuh2.indi) && (this._y >= background_mc.rapuh2._y)) && (this.posisiKini > background_mc.rapuh2.pos)) {
this._y = background_mc.rapuh2._y;
} else if ((this.zindi.hitTest(background_mc.rapuh3.indi) && (this._y >= background_mc.rapuh3._y)) && (this.posisiKini > background_mc.rapuh3.pos)) {
this._y = background_mc.rapuh3._y;
} else if ((this.zindi.hitTest(background_mc.rapuh4.indi) && (this._y >= background_mc.rapuh4._y)) && (this.posisiKini > background_mc.rapuh4.pos)) {
this._y = background_mc.rapuh4._y;
} else if ((this.zindi.hitTest(background_mc.rapuh5.indi) && (this._y >= background_mc.rapuh5._y)) && (this.posisiKini > background_mc.rapuh5.pos)) {
this._y = background_mc.rapuh5._y;
} else if ((this.zindi.hitTest(background_mc.rapuh6.indi) && (this._y >= background_mc.rapuh6._y)) && (this.posisiKini > background_mc.rapuh6.pos)) {
this._y = background_mc.rapuh6._y;
} else if ((this.zindi.hitTest(background_mc.rel6.indi) && (this._y >= background_mc.rel6._y)) && (this.posisiKini > background_mc.rel6.pos)) {
this._y = background_mc.rel6._y;
} else if ((this.zindi.hitTest(background_mc.rel5.indi) && (this._y >= background_mc.rel5._y)) && (this.posisiKini > background_mc.rel5.pos)) {
this._y = background_mc.rel5._y;
} else if ((this.zindi.hitTest(background_mc.rel4.indi) && (this._y >= background_mc.rel4._y)) && (this.posisiKini > background_mc.rel4.pos)) {
this._y = background_mc.rel4._y;
} else if ((this.zindi.hitTest(background_mc.rel3.indi) && (this._y >= background_mc.rel3._y)) && (this.posisiKini > background_mc.rel3.pos)) {
this._y = background_mc.rel3._y;
} else if ((this.zindi.hitTest(background_mc.rel2.indi) && (this._y >= background_mc.rel2._y)) && (this.posisiKini > background_mc.rel2.pos)) {
this._y = background_mc.rel2._y;
} else if ((this.zindi.hitTest(background_mc.rel1.indi) && (this._y >= background_mc.rel1._y)) && (this.posisiKini > background_mc.rel1.pos)) {
this._y = background_mc.rel1._y;
} else if ((this.zindi.hitTest(background_mc.rel0.indi) && (this._y >= background_mc.rel0._y)) && (this.posisiKini > background_mc.rel0.pos)) {
this._y = background_mc.rel0._y;
} else {
this.sudahJatuh = false;
}
if (this.sudahJatuh == false) {
this.anim.gotoAndStop(1);
if (this.lanjut == true) {
this._x = this._x + this.speed;
} else {
this._x = this._x + (this.speed / 3);
}
this._y = this._y + this.speedY;
this.speedY = this.speedY + 0.25;
} else if (this.anim._currentframe == 1) {
this.anim.gotoAndPlay(2);
cekPecah(this);
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (this.damage * 10);
cekEfekLedak(_root["musuh_mc" + i], 1);
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerMusuh" + i])) {
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa - (this.damage * 10);
cekEfekLedak(background_mc["towerMusuh" + i], 2);
}
}
i++;
}
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - (this.damage * 10);
cekEfekLedak(_root["jagoan_mc" + i], 1);
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerJagoan" + i])) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa - (this.damage * 10);
cekEfekLedak(background_mc["towerJagoan" + i], 2);
}
}
i++;
}
}
}
}
} else if (this.melayang == true) {
this.gotoAndStop(9);
if (this._y >= this.batasMelayang) {
this.sudahSampai = false;
if (this.zindi.hitTest(background_mc.rapuh1.indi)) {
this.sudahSampai = true;
this._y = background_mc.rapuh1._y;
} else if (this.zindi.hitTest(background_mc.rapuh2.indi)) {
this.sudahSampai = true;
this._y = background_mc.rapuh2._y;
} else if (this.zindi.hitTest(background_mc.rapuh3.indi)) {
this.sudahSampai = true;
this._y = background_mc.rapuh3._y;
} else if (this.zindi.hitTest(background_mc.rapuh4.indi)) {
this.sudahSampai = true;
this._y = background_mc.rapuh4._y;
} else if (this.zindi.hitTest(background_mc.rapuh5.indi)) {
this.sudahSampai = true;
this._y = background_mc.rapuh5._y;
} else if (this.zindi.hitTest(background_mc.rapuh6.indi)) {
this.sudahSampai = true;
this._y = background_mc.rapuh6._y;
} else if (this.zindi.hitTest(background_mc.rel6.indi)) {
this.sudahSampai = true;
this._y = background_mc.rel6._y;
} else if (this.zindi.hitTest(background_mc.rel5.indi)) {
this.sudahSampai = true;
this._y = background_mc.rel5._y;
} else if (this.zindi.hitTest(background_mc.rel4.indi)) {
this.sudahSampai = true;
this._y = background_mc.rel4._y;
} else if (this.zindi.hitTest(background_mc.rel3.indi)) {
this.sudahSampai = true;
this._y = background_mc.rel3._y;
} else if (this.zindi.hitTest(background_mc.rel2.indi)) {
this.sudahSampai = true;
this._y = background_mc.rel2._y;
} else if (this.zindi.hitTest(background_mc.rel1.indi)) {
this.sudahSampai = true;
this._y = background_mc.rel1._y;
} else if (this.zindi.hitTest(background_mc.rel0.indi)) {
this.sudahSampai = true;
this._y = background_mc.rel0._y;
}
if (this.sudahSampai == true) {
if (this.sudahMendarat == false) {
this.sudahMendarat = true;
this.anim.gotoAndPlay("mendarat");
}
}
}
if (this.sudahMendarat == false) {
this._y = this._y + this.speedMelayang;
}
} else {
if (this.terbang == false) {
cekInteraksi(this, "jagoan");
}
if (this.sudahBerhenti == true) {
this.gotoAndStop(8);
} else if ((siapaMenang == "musuh") && (this.orang == true)) {
this._xscale = -this.awalScale;
this.gotoAndStop(1);
if (this.sudahBerhenti == false) {
this._x = this._x - (this.speed * 2);
}
} else if ((siapaMenang == "musuh") && (this.kendaraan == true)) {
if (this.sudahBerhenti == false) {
this.sudahBerhenti = true;
keluarKarakter(this, "jagoan");
}
} else if ((siapaMenang == "musuh") && (this.terbang == true)) {
keluarKarakter(this, "jagoan");
this.nyawa = 0;
} else {
if (this.lanjut == true) {
this._x = this._x + this.speed;
this._y = this._y + this.speedY2;
if (this._y > this.batasBawah) {
this._y = this.batasBawah;
this.speedY2 = -this.speedY2;
} else if (this._y < this.batasAtas) {
this._y = this.batasAtas;
this.speedY2 = -this.speedY2;
}
}
if (this.serangBase == true) {
this.xtarget = background_mc.benteng2;
if (background_mc.benteng2.bentengx._currentframe == 1) {
if (this.tiarap == true) {
this.gotoAndStop(5);
} else {
this.gotoAndStop(2);
}
} else if (background_mc.benteng2.bentengx._currentframe == 2) {
if (this.tiarap == true) {
this.gotoAndStop(6);
this.anim.stop();
} else {
this.gotoAndStop(4);
}
}
} else {
if ((this.xtarget.tipeUnit == "tower_musuh") || (this.xtarget.tipeUnit == "lain")) {
if (this.bomber == false) {
if (((this._x > (this.xtarget._x + background_mc._x)) || (this.xtarget.nyawa <= 0)) || (this.posisiKini != this.xtarget.posisiKini)) {
this.xtarget = undefined;
}
} else if ((this._x > (this.xtarget._x + background_mc._x)) || (this.xtarget.nyawa <= 0)) {
this.xtarget = undefined;
}
} else if (this.bomber == false) {
if (((this._x > this.xtarget._x) || (this.xtarget.nyawa <= 0)) || (this.posisiKini != this.xtarget.posisiKini)) {
this.xtarget = undefined;
}
} else if ((this._x > (this.xtarget._x + background_mc._x)) || (this.xtarget.nyawa <= 0)) {
this.xtarget = undefined;
}
if (((this.xtarget == undefined) || (this.xtarget._x == undefined)) || (this.xtarget.nyawa <= 0)) {
if (banyakMusuh > 0) {
cekTarget(this);
}
}
if (this.xtarget != undefined) {
if ((this.xtarget.tipeUnit == "tower_musuh") || (this.xtarget.tipeUnit == "lain")) {
if (this.bomber == true) {
this.xjarak = Math.abs((this.xtarget._x + background_mc._x) - this._x);
} else {
this.xjarak = Math.sqrt(Math.pow((this.xtarget._x + background_mc._x) - this._x, 2) + Math.pow((this.xtarget._y + background_mc._y) - this._y, 2));
}
} else if (this.bomber == true) {
this.xjarak = Math.abs(this._x - this.xtarget._x);
} else {
this.xjarak = Math.sqrt(Math.pow(this._x - this.xtarget._x, 2) + Math.pow(this._y - this.xtarget._y, 2));
}
if (this.xjarak <= this.range) {
this.adaMusuh = true;
} else {
this.adaMusuh = false;
}
} else {
this.adaMusuh = false;
}
if (this.adaMusuh == true) {
if (this.tiarap == true) {
this.gotoAndStop(5);
} else {
this.gotoAndStop(2);
}
} else {
if (this.tiarap == true) {
if (this._currentframe == 5) {
this.gotoAndStop(6);
}
} else {
this.gotoAndStop(1);
}
if (this.sedangHitBatu == false) {
if (this._currentframe == 1) {
if (this.lanjut == false) {
this._x = this._x + this.speed;
}
}
} else {
this.gotoAndStop(4);
}
}
}
}
}
if (this.lanjut == true) {
if (this._x >= (background_mc._x + 3600)) {
this._x = background_mc._x - 400;
}
}
if (this._x >= ((background_mc._x + background_mc.benteng2._x) - this.range)) {
if (this._x > (background_mc._x + background_mc.benteng2._x)) {
this.serangBase = false;
} else {
this.serangBase = true;
}
} else {
this.serangBase = false;
}
if (this._y >= 700) {
removeMovieClip(this);
}
}
}
function cekTarget(indi) {
masukTarget = new Array();
keTarget = 0;
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (indi._x < _root["musuh_mc" + i]._x) {
if (indi.bomber == true) {
xjarak = Math.abs(indi._x - _root["musuh_mc" + i]._x);
masukTarget[keTarget] = xjarak;
keTarget++;
} else if (indi.posisiKini == _root["musuh_mc" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow(indi._x - _root["musuh_mc" + i]._x, 2) + Math.pow(indi._y - _root["musuh_mc" + i]._y, 2));
masukTarget[keTarget] = xjarak;
keTarget++;
}
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if ((background_mc["towerMusuh" + i]._x + background_mc._x) > indi._x) {
if (indi.bomber == true) {
xjarak = Math.abs((background_mc["towerMusuh" + i]._x + background_mc._x) - indi._x);
masukTarget[keTarget] = xjarak;
keTarget++;
} else if (indi.posisiKini == background_mc["towerMusuh" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow((background_mc["towerMusuh" + i]._x + background_mc._x) - indi._x, 2) + Math.pow((background_mc["towerMusuh" + i]._y + background_mc._y) - indi._y, 2));
masukTarget[keTarget] = xjarak;
keTarget++;
}
}
}
i++;
}
if (indi.serangBesi == true) {
i = 1;
while (i <= banyakBesi) {
if ((background_mc["besi" + i]._x != undefined) && (background_mc["besi" + i].nyawa > 0)) {
if ((background_mc["besi" + i]._x + background_mc._x) > indi._x) {
if (indi.bomber == true) {
xjarak = Math.abs((background_mc["besi" + i]._x + background_mc._x) - indi._x);
masukTarget[keTarget] = xjarak;
keTarget++;
} else if (indi.posisiKini == background_mc["besi" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow((background_mc["besi" + i]._x + background_mc._x) - indi._x, 2) + Math.pow((background_mc["besi" + i]._y + background_mc._y) - indi._y, 2));
masukTarget[keTarget] = xjarak;
keTarget++;
}
}
}
i++;
}
}
if (keTarget > 0) {
serangKemana = 0;
masukTarget.sort(Array.NUMERIC);
keAmbil = masukTarget[0];
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (indi._x < _root["musuh_mc" + i]._x) {
if (indi.bomber == true) {
xjarak = Math.abs(indi._x - _root["musuh_mc" + i]._x);
if (xjarak == keAmbil) {
ambilLawan = "musuh";
serangKemana = i;
}
} else if (indi.posisiKini == _root["musuh_mc" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow(indi._x - _root["musuh_mc" + i]._x, 2) + Math.pow(indi._y - _root["musuh_mc" + i]._y, 2));
if (xjarak == keAmbil) {
ambilLawan = "musuh";
serangKemana = i;
}
}
}
}
i++;
}
if (serangKemana == 0) {
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if ((background_mc["towerMusuh" + i]._x + background_mc._x) > indi._x) {
if (indi.bomber == true) {
xjarak = Math.abs((background_mc["towerMusuh" + i]._x + background_mc._x) - indi._x);
if (xjarak == keAmbil) {
ambilLawan = "tower";
serangKemana = i;
}
} else if (indi.posisiKini == background_mc["towerMusuh" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow((background_mc["towerMusuh" + i]._x + background_mc._x) - indi._x, 2) + Math.pow((background_mc["towerMusuh" + i]._y + background_mc._y) - indi._y, 2));
if (xjarak == keAmbil) {
ambilLawan = "tower";
serangKemana = i;
}
}
}
}
i++;
}
}
if (indi.serangBesi == true) {
if (serangKemana == 0) {
i = 1;
while (i <= banyakBesi) {
if ((background_mc["besi" + i]._x != undefined) && (background_mc["besi" + i].nyawa > 0)) {
if ((background_mc["besi" + i]._x + background_mc._x) > indi._x) {
if (indi.bomber == true) {
xjarak = Math.abs((background_mc["besi" + i]._x + background_mc._x) - indi._x);
if (xjarak == keAmbil) {
ambilLawan = "besi";
serangKemana = i;
}
} else if (indi.posisiKini == background_mc["besi" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow((background_mc["besi" + i]._x + background_mc._x) - indi._x, 2) + Math.pow((background_mc["besi" + i]._y + background_mc._y) - indi._y, 2));
if (xjarak == keAmbil) {
ambilLawan = "besi";
serangKemana = i;
}
}
}
}
i++;
}
}
}
} else {
serangKemana = 0;
}
if (serangKemana != 0) {
if (ambilLawan == "musuh") {
indi.xtarget = _root["musuh_mc" + serangKemana];
} else if (ambilLawan == "tower") {
indi.xtarget = background_mc["towerMusuh" + serangKemana];
} else if (ambilLawan == "besi") {
indi.xtarget = background_mc["besi" + serangKemana];
}
}
}
function buatKendaraan(indi, indi2) {
if (indi2 == 2) {
if (indi.indi2 == "jagoan") {
buatJagoan2(indi, 22, undefined, indi.indi3);
} else if (indi.indi2 == "musuh") {
buatMusuh2(indi, 22, undefined, indi.indi3);
}
} else if (indi.indi2 == "jagoan") {
buatJagoan2(indi, 19, undefined, indi.indi3);
} else if (indi.indi2 == "musuh") {
buatMusuh2(indi, 19, undefined, indi.indi3);
}
indi.nyawa = 0;
indi._alpha = 0;
}
function cekInteraksi(indi, indi2) {
if ((indi._x >= background_mc) && (indi._x <= (background_mc + 3200))) {
if (indi.nyawa > 0) {
if (indi.orang == true) {
if (indi.hitTest(background_mc.kendaraan1.zindi) && (background_mc.kendaraan1._currentframe == 1)) {
background_mc.kendaraan1.indi2 = indi2;
background_mc.kendaraan1.indi3 = indi;
background_mc.kendaraan1.gotoAndStop(10);
indi.nyawa = 0;
indi._alpha = 0;
} else if (indi.hitTest(background_mc.kendaraan2.zindi) && (background_mc.kendaraan2._currentframe == 1)) {
background_mc.kendaraan2.indi2 = indi2;
background_mc.kendaraan2.indi3 = indi;
background_mc.kendaraan2.gotoAndStop(10);
indi.nyawa = 0;
indi._alpha = 0;
} else if (indi.hitTest(background_mc.kendaraan3.zindi) && (background_mc.kendaraan3._currentframe == 1)) {
background_mc.kendaraan3.indi2 = indi2;
background_mc.kendaraan3.indi3 = indi;
background_mc.kendaraan3.gotoAndStop(10);
indi.nyawa = 0;
indi._alpha = 0;
} else if (indi.hitTest(background_mc.kendaraan4.zindi) && (background_mc.kendaraan4._currentframe == 1)) {
background_mc.kendaraan4.indi2 = indi2;
background_mc.kendaraan4.indi3 = indi;
background_mc.kendaraan4.gotoAndStop(10);
indi.nyawa = 0;
indi._alpha = 0;
}
}
}
if (indi.loncat == true) {
indi._y = indi._y - indi.speedNaik;
indi.speedNaik--;
if ((indi.speedNaik < 0) && (indi.zindi.hitTest(background_mc.rel6.indi))) {
indi.loncat = false;
} else if ((indi.speedNaik < 0) && (indi.zindi.hitTest(background_mc.rel5.indi))) {
indi.loncat = false;
} else if ((indi.speedNaik < 0) && (indi.zindi.hitTest(background_mc.rel4.indi))) {
indi.loncat = false;
} else if ((indi.speedNaik < 0) && (indi.zindi.hitTest(background_mc.rel3.indi))) {
indi.loncat = false;
} else if ((indi.speedNaik < 0) && (indi.zindi.hitTest(background_mc.rel2.indi))) {
indi.loncat = false;
} else if ((indi.speedNaik < 0) && (indi.zindi.hitTest(background_mc.rel1.indi))) {
indi.loncat = false;
} else if ((indi.speedNaik < 0) && indi.zindi.hitTest(background_mc.rel0.indi)) {
indi.loncat = false;
}
if (indi.loncat == false) {
cekAdaGesek(indi, indi2);
}
} else {
indi.speedNaik = 15;
if (indi.zindi.hitTest(background_mc.rapuh1.indi)) {
if (indi.orang == false) {
background_mc.rapuh1.nyawa = background_mc.rapuh1.nyawa - 5;
} else {
background_mc.rapuh1.nyawa = background_mc.rapuh1.nyawa - 1;
}
if (indi.speedTurun != 1) {
cekGesek(indi, indi2, "debu");
}
indi.posisiKini = background_mc.rapuh1.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rapuh1._y + 5;
} else {
indi._y = background_mc.rapuh1._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rapuh2.indi)) {
if (indi.orang == false) {
background_mc.rapuh2.nyawa = background_mc.rapuh2.nyawa - 5;
} else {
background_mc.rapuh2.nyawa = background_mc.rapuh2.nyawa - 1;
}
if (indi.speedTurun != 1) {
cekGesek(indi, indi2, "debu");
}
indi.posisiKini = background_mc.rapuh2.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rapuh2._y + 5;
} else {
indi._y = background_mc.rapuh2._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rapuh3.indi)) {
if (indi.orang == false) {
background_mc.rapuh3.nyawa = background_mc.rapuh3.nyawa - 5;
} else {
background_mc.rapuh3.nyawa = background_mc.rapuh3.nyawa - 1;
}
if (indi.speedTurun != 1) {
cekGesek(indi, indi2, "debu");
}
indi.posisiKini = background_mc.rapuh3.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rapuh3._y + 5;
} else {
indi._y = background_mc.rapuh3._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rapuh4.indi)) {
if (indi.orang == false) {
background_mc.rapuh4.nyawa = background_mc.rapuh4.nyawa - 5;
} else {
background_mc.rapuh4.nyawa = background_mc.rapuh4.nyawa - 1;
}
if (indi.speedTurun != 1) {
cekGesek(indi, indi2, "debu");
}
indi.posisiKini = background_mc.rapuh4.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rapuh4._y + 5;
} else {
indi._y = background_mc.rapuh4._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rapuh5.indi)) {
if (indi.orang == false) {
background_mc.rapuh5.nyawa = background_mc.rapuh5.nyawa - 5;
} else {
background_mc.rapuh5.nyawa = background_mc.rapuh5.nyawa - 1;
}
if (indi.speedTurun != 1) {
cekGesek(indi, indi2, "debu");
}
indi.posisiKini = background_mc.rapuh5.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rapuh5._y + 5;
} else {
indi._y = background_mc.rapuh5._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rapuh6.indi)) {
if (indi.orang == false) {
background_mc.rapuh6.nyawa = background_mc.rapuh6.nyawa - 5;
} else {
background_mc.rapuh6.nyawa = background_mc.rapuh6.nyawa - 1;
}
if (indi.speedTurun != 1) {
cekGesek(indi, indi2, "debu");
}
indi.posisiKini = background_mc.rapuh6.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rapuh6._y + 5;
} else {
indi._y = background_mc.rapuh6._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rel6.indi)) {
if (indi.speedTurun != 1) {
cekAdaGesek(indi, indi2);
}
indi.posisiKini = background_mc.rel6.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rel6._y + 5;
} else {
indi._y = background_mc.rel6._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rel5.indi)) {
if (indi.speedTurun != 1) {
cekAdaGesek(indi, indi2);
}
indi.posisiKini = background_mc.rel5.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rel5._y + 5;
} else {
indi._y = background_mc.rel5._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rel4.indi)) {
if (indi.speedTurun != 1) {
cekAdaGesek(indi, indi2);
}
indi.posisiKini = background_mc.rel4.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rel4._y + 5;
} else {
indi._y = background_mc.rel4._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rel3.indi)) {
if (indi.speedTurun != 1) {
cekAdaGesek(indi, indi2);
}
indi.posisiKini = background_mc.rel3.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rel3._y + 5;
} else {
indi._y = background_mc.rel3._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rel2.indi)) {
if (indi.speedTurun != 1) {
cekAdaGesek(indi, indi2);
}
indi.posisiKini = background_mc.rel2.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rel2._y + 5;
} else {
indi._y = background_mc.rel2._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rel1.indi)) {
if (indi.speedTurun != 1) {
cekAdaGesek(indi, indi2);
}
indi.posisiKini = background_mc.rel1.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rel1._y + 5;
} else {
indi._y = background_mc.rel1._y;
}
indi.speedTurun = 1;
} else if (indi.zindi.hitTest(background_mc.rel0.indi)) {
if (indi.speedTurun != 1) {
cekAdaGesek(indi, indi2);
}
indi.posisiKini = background_mc.rel0.pos;
if (((indi.jenis == 15) || (indi.jenis == 16)) || (indi.jenis == 17)) {
indi._y = background_mc.rel0._y + 5;
} else {
indi._y = background_mc.rel0._y;
}
indi.speedTurun = 1;
} else {
if (indi.speedTurun == 1) {
if (indi.loncat == true) {
if (indi2 == "jagoan") {
cekTarget(indi);
} else if (indi2 == "musuh") {
cekTarget2(indi);
}
if (serangKemana != 0) {
indi.xtarget.xtarget = indi;
}
}
}
indi._y = indi._y + indi.speedTurun;
indi.speedTurun = indi.speedTurun + 0.5;
}
indi.xloncat = false;
if (indi.zindi.hitTest(background_mc.besi1.indi)) {
indi.xloncat = true;
} else if (indi.zindi.hitTest(background_mc.besi2.indi)) {
indi.xloncat = true;
} else if (indi.zindi.hitTest(background_mc.besi3.indi)) {
indi.xloncat = true;
} else if (indi.zindi.hitTest(background_mc.besi4.indi)) {
indi.xloncat = true;
} else if (indi.zindi.hitTest(background_mc.besi5.indi)) {
indi.xloncat = true;
}
if (indi.zindi.hitTest(background_mc.batu1.indi) && (background_mc.batu1._currentframe == 1)) {
if (indi.sedangHitBatu == false) {
indi.sedangHitBatu = true;
if (indi2 == "jagoan") {
background_mc.batu1.isiJagoan++;
if (background_mc.batu1.isiJagoan >= 5) {
background_mc.batu1.isiJagoan = 0;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (_root["jagoan_mc" + i].sedangHitBatu == true) {
_root["jagoan_mc" + i].sedangHitBatu = false;
_root["jagoan_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu1.gotoAndPlay(2);
}
} else if (indi2 == "musuh") {
background_mc.batu1.isiMusuh++;
if (background_mc.batu1.isiMusuh >= 5) {
background_mc.batu1.isiMusuh = 0;
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (_root["musuh_mc" + i].sedangHitBatu == true) {
_root["musuh_mc" + i].sedangHitBatu = false;
_root["musuh_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu1.gotoAndPlay(2);
}
}
}
} else if (indi.zindi.hitTest(background_mc.batu2.indi) && (background_mc.batu2._currentframe == 1)) {
if (indi.sedangHitBatu == false) {
indi.sedangHitBatu = true;
if (indi2 == "jagoan") {
background_mc.batu2.isiJagoan++;
if (background_mc.batu2.isiJagoan >= 5) {
background_mc.batu2.isiJagoan = 0;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (_root["jagoan_mc" + i].sedangHitBatu == true) {
_root["jagoan_mc" + i].sedangHitBatu = false;
_root["jagoan_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu2.gotoAndPlay(2);
}
} else if (indi2 == "musuh") {
background_mc.batu2.isiMusuh++;
if (background_mc.batu2.isiMusuh >= 5) {
background_mc.batu2.isiMusuh = 0;
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (_root["musuh_mc" + i].sedangHitBatu == true) {
_root["musuh_mc" + i].sedangHitBatu = false;
_root["musuh_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu2.gotoAndPlay(2);
}
}
}
} else if (indi.zindi.hitTest(background_mc.batu3.indi) && (background_mc.batu3._currentframe == 1)) {
if (indi.sedangHitBatu == false) {
indi.sedangHitBatu = true;
if (indi2 == "jagoan") {
background_mc.batu3.isiJagoan++;
if (background_mc.batu3.isiJagoan >= 5) {
background_mc.batu3.isiJagoan = 0;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (_root["jagoan_mc" + i].sedangHitBatu == true) {
_root["jagoan_mc" + i].sedangHitBatu = false;
_root["jagoan_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu3.gotoAndPlay(2);
}
} else if (indi2 == "musuh") {
background_mc.batu3.isiMusuh++;
if (background_mc.batu3.isiMusuh >= 5) {
background_mc.batu3.isiMusuh = 0;
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (_root["musuh_mc" + i].sedangHitBatu == true) {
_root["musuh_mc" + i].sedangHitBatu = false;
_root["musuh_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu3.gotoAndPlay(2);
}
}
}
} else if (indi.zindi.hitTest(background_mc.batu4.indi) && (background_mc.batu4._currentframe == 1)) {
if (indi.sedangHitBatu == false) {
indi.sedangHitBatu = true;
if (indi2 == "jagoan") {
background_mc.batu4.isiJagoan++;
if (background_mc.batu4.isiJagoan >= 5) {
background_mc.batu4.isiJagoan = 0;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (_root["jagoan_mc" + i].sedangHitBatu == true) {
_root["jagoan_mc" + i].sedangHitBatu = false;
_root["jagoan_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu4.gotoAndPlay(2);
}
} else if (indi2 == "musuh") {
background_mc.batu4.isiMusuh++;
if (background_mc.batu4.isiMusuh >= 5) {
background_mc.batu4.isiMusuh = 0;
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (_root["musuh_mc" + i].sedangHitBatu == true) {
_root["musuh_mc" + i].sedangHitBatu = false;
_root["musuh_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu4.gotoAndPlay(2);
}
}
}
} else if (indi.zindi.hitTest(background_mc.batu5.indi) && (background_mc.batu5._currentframe == 1)) {
if (indi.sedangHitBatu == false) {
indi.sedangHitBatu = true;
if (indi2 == "jagoan") {
background_mc.batu5.isiJagoan++;
if (background_mc.batu5.isiJagoan >= 5) {
background_mc.batu5.isiJagoan = 0;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (_root["jagoan_mc" + i].sedangHitBatu == true) {
_root["jagoan_mc" + i].sedangHitBatu = false;
_root["jagoan_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu5.gotoAndPlay(2);
}
} else if (indi2 == "musuh") {
background_mc.batu5.isiMusuh++;
if (background_mc.batu5.isiMusuh >= 5) {
background_mc.batu5.isiMusuh = 0;
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (_root["musuh_mc" + i].sedangHitBatu == true) {
_root["musuh_mc" + i].sedangHitBatu = false;
_root["musuh_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu5.gotoAndPlay(2);
}
}
}
} else if (indi.zindi.hitTest(background_mc.batu6.indi) && (background_mc.batu6._currentframe == 1)) {
if (indi.sedangHitBatu == false) {
indi.sedangHitBatu = true;
if (indi2 == "jagoan") {
background_mc.batu6.isiJagoan++;
if (background_mc.batu6.isiJagoan >= 5) {
background_mc.batu6.isiJagoan = 0;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (_root["jagoan_mc" + i].sedangHitBatu == true) {
_root["jagoan_mc" + i].sedangHitBatu = false;
_root["jagoan_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu6.gotoAndPlay(2);
}
} else if (indi2 == "musuh") {
background_mc.batu6.isiMusuh++;
if (background_mc.batu6.isiMusuh >= 5) {
background_mc.batu6.isiMusuh = 0;
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (_root["musuh_mc" + i].sedangHitBatu == true) {
_root["musuh_mc" + i].sedangHitBatu = false;
_root["musuh_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu6.gotoAndPlay(2);
}
}
}
} else if (indi.zindi.hitTest(background_mc.batu7.indi) && (background_mc.batu7._currentframe == 1)) {
if (indi.sedangHitBatu == false) {
indi.sedangHitBatu = true;
if (indi2 == "jagoan") {
background_mc.batu7.isiJagoan++;
if (background_mc.batu7.isiJagoan >= 5) {
background_mc.batu7.isiJagoan = 0;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (_root["jagoan_mc" + i].sedangHitBatu == true) {
_root["jagoan_mc" + i].sedangHitBatu = false;
_root["jagoan_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu7.gotoAndPlay(2);
}
} else if (indi2 == "musuh") {
background_mc.batu7.isiMusuh++;
if (background_mc.batu7.isiMusuh >= 5) {
background_mc.batu7.isiMusuh = 0;
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (_root["musuh_mc" + i].sedangHitBatu == true) {
_root["musuh_mc" + i].sedangHitBatu = false;
_root["musuh_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu7.gotoAndPlay(2);
}
}
}
} else if (indi.zindi.hitTest(background_mc.batu8.indi) && (background_mc.batu8._currentframe == 1)) {
if (indi.sedangHitBatu == false) {
indi.sedangHitBatu = true;
if (indi2 == "jagoan") {
background_mc.batu8.isiJagoan++;
if (background_mc.batu8.isiJagoan >= 5) {
background_mc.batu8.isiJagoan = 0;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (_root["jagoan_mc" + i].sedangHitBatu == true) {
_root["jagoan_mc" + i].sedangHitBatu = false;
_root["jagoan_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu8.gotoAndPlay(2);
}
} else if (indi2 == "musuh") {
background_mc.batu8.isiMusuh++;
if (background_mc.batu8.isiMusuh >= 5) {
background_mc.batu8.isiMusuh = 0;
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (_root["musuh_mc" + i].sedangHitBatu == true) {
_root["musuh_mc" + i].sedangHitBatu = false;
_root["musuh_mc" + i].gotoAndStop(1);
}
}
i++;
}
background_mc.batu8.gotoAndPlay(2);
}
}
}
}
if (indi.berhenti == true) {
if (indi.xloncat == true) {
if (indi.sudahBerhenti == false) {
indi.sudahBerhenti = true;
keluarKarakter(indi, indi2);
}
}
} else if (indi.xloncat == true) {
indi.loncat = true;
if (indi2 == "jagoan") {
cekTarget(indi);
} else if (indi2 == "musuh") {
cekTarget2(indi);
}
if (serangKemana != 0) {
indi.xtarget.xtarget = indi;
}
} else {
indi.loncat = false;
}
}
}
}
function keluarKarakter(indi, indi2) {
indi.berkurangNyawa = true;
if (indi2 == "jagoan") {
if (indi.jenis == 10) {
buatJagoan2(indi, 1, 20, "kendaraan2", indi.jenis);
buatJagoan2(indi, 2, -20, "kendaraan", indi.jenis);
buatJagoan2(indi, 2, -40, "kendaraan", indi.jenis);
buatJagoan2(indi, 2, -60, "kendaraan", indi.jenis);
} else if (indi.jenis == 11) {
buatJagoan2(indi, 1, 20, "kendaraan2", indi.jenis);
buatJagoan2(indi, 6, -45, "kendaraan", indi.jenis);
buatJagoan2(indi, 6, -60, "kendaraan", indi.jenis);
} else if (indi.jenis == 12) {
buatJagoan2(indi, 1, 20, "kendaraan2", indi.jenis);
buatJagoan2(indi, 4, -20, "kendaraan", indi.jenis);
buatJagoan2(indi, 4, -40, "kendaraan", indi.jenis);
buatJagoan2(indi, 6, -60, "kendaraan", indi.jenis);
} else if (indi.jenis == 13) {
buatJagoan2(indi, 7, 10, "kendaraan2", indi.jenis);
buatJagoan2(indi, 8, -10, "kendaraan", indi.jenis);
} else if (indi.jenis == 14) {
buatJagoan2(indi, 7, 10, "kendaraan2", indi.jenis);
buatJagoan2(indi, 8, -10, "kendaraan", indi.jenis);
buatJagoan2(indi, 6, -40, "kendaraan", indi.jenis);
buatJagoan2(indi, 6, -60, "kendaraan", indi.jenis);
} else if (indi.jenis == 15) {
buatJagoan2(indi, 7, 10, "kendaraan2", indi.jenis);
buatJagoan2(indi, 8, 0, "kendaraan", indi.jenis);
buatJagoan2(indi, 8, -20, "kendaraan", indi.jenis);
buatJagoan2(indi, 8, -40, "kendaraan", indi.jenis);
buatJagoan2(indi, 8, -60, "kendaraan", indi.jenis);
} else if (indi.jenis == 16) {
buatJagoan2(indi, 8, 10, "kendaraan2", indi.jenis);
buatJagoan2(indi, 8, 0, "kendaraan", indi.jenis);
buatJagoan2(indi, 8, -20, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, -40, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, -60, "kendaraan", indi.jenis);
} else if (indi.jenis == 17) {
buatJagoan2(indi, 5, 30, "kendaraan2", indi.jenis);
buatJagoan2(indi, 6, 20, "kendaraan", indi.jenis);
buatJagoan2(indi, 8, 0, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, -20, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, -40, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, -60, "kendaraan", indi.jenis);
} else if (indi.jenis == 18) {
buatJagoan2(indi, 1, 0, "kendaraan2", indi.jenis);
buatJagoan2(indi, 2, -10, "kendaraan", indi.jenis);
buatJagoan2(indi, 2, 10, "kendaraan", indi.jenis);
} else if (indi.jenis == 19) {
buatJagoan2(indi, 1, -10, "kendaraan2", indi.jenis);
buatJagoan2(indi, 1, 10, "kendaraan", indi.jenis);
} else if (indi.jenis == 20) {
buatJagoan2(indi, 1, 0, "kendaraan2", indi.jenis);
} else if (indi.jenis == 21) {
buatJagoan2(indi, 1, 0, "kendaraan2", indi.jenis);
} else if (indi.jenis == 22) {
buatJagoan2(indi, 1, 0, "kendaraan2", indi.jenis);
} else if (indi.jenis == 23) {
buatJagoan2(indi, 1, 0, "kendaraan2", indi.jenis);
buatJagoan2(indi, 3, -10, "kendaraan", indi.jenis);
buatJagoan2(indi, 4, 10, "kendaraan", indi.jenis);
} else if (indi.jenis == 24) {
buatJagoan2(indi, 1, 0, "kendaraan2", indi.jenis);
buatJagoan2(indi, 3, -10, "kendaraan", indi.jenis);
buatJagoan2(indi, 4, 10, "kendaraan", indi.jenis);
} else if (indi.jenis == 25) {
buatJagoan2(indi, 1, 0, "kendaraan2", indi.jenis);
} else if (indi.jenis == 42) {
buatJagoan2(indi, 9, 60, "kendaraan2", indi.jenis);
buatJagoan2(indi, 9, 40, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, 20, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, 0, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, -20, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, -40, "kendaraan", indi.jenis);
buatJagoan2(indi, 9, -60, "kendaraan", indi.jenis);
} else {
buatJagoan2(indi, 1, 0, "kendaraan2", indi.jenis);
}
} else if (indi2 == "musuh") {
if (indi.jenis == 10) {
buatMusuh2(indi, 1, -20);
buatMusuh2(indi, 2, 20);
buatMusuh2(indi, 2, 40);
buatMusuh2(indi, 2, 60);
} else if (indi.jenis == 11) {
buatMusuh2(indi, 1, -20);
buatMusuh2(indi, 6, 45);
buatMusuh2(indi, 6, 60);
} else if (indi.jenis == 12) {
buatMusuh2(indi, 1, -20);
buatMusuh2(indi, 4, 20);
buatMusuh2(indi, 4, 40);
buatMusuh2(indi, 6, 60);
} else if (indi.jenis == 13) {
buatMusuh2(indi, 7, -10);
buatMusuh2(indi, 8, 10);
} else if (indi.jenis == 14) {
buatMusuh2(indi, 7, -10);
buatMusuh2(indi, 8, 10);
buatMusuh2(indi, 6, 40);
buatMusuh2(indi, 6, 60);
} else if (indi.jenis == 15) {
buatMusuh2(indi, 7, -10);
buatMusuh2(indi, 8, 0);
buatMusuh2(indi, 8, 20);
buatMusuh2(indi, 8, 40);
buatMusuh2(indi, 8, 60);
} else if (indi.jenis == 16) {
buatMusuh2(indi, 8, 10);
buatMusuh2(indi, 8, 0);
buatMusuh2(indi, 8, -20);
buatMusuh2(indi, 9, -40);
buatMusuh2(indi, 9, -60);
} else if (indi.jenis == 17) {
buatMusuh2(indi, 5, -30);
buatMusuh2(indi, 6, -20);
buatMusuh2(indi, 8, 0);
buatMusuh2(indi, 9, 20);
buatMusuh2(indi, 9, 40);
buatMusuh2(indi, 9, 60);
} else if (indi.jenis == 18) {
buatMusuh2(indi, 1, 0);
buatMusuh2(indi, 2, -10);
buatMusuh2(indi, 2, 10);
} else if (indi.jenis == 19) {
buatMusuh2(indi, 1, -10);
buatMusuh2(indi, 1, 10);
} else if (indi.jenis == 20) {
buatMusuh2(indi, 1, 0);
} else if (indi.jenis == 21) {
buatMusuh2(indi, 1, 0);
} else if (indi.jenis == 22) {
buatMusuh2(indi, 1, 0);
} else if (indi.jenis == 23) {
buatMusuh2(indi, 1, 0);
buatMusuh2(indi, 3, -10);
buatMusuh2(indi, 4, 10);
} else if (indi.jenis == 24) {
buatMusuh2(indi, 1, 0);
buatMusuh2(indi, 3, -10);
buatMusuh2(indi, 4, 10);
} else if (indi.jenis == 25) {
buatMusuh2(indi, 1, 0);
} else if (indi.jenis == 42) {
buatMusuh2(indi, 9, 60);
buatMusuh2(indi, 9, 40);
buatMusuh2(indi, 9, 20);
buatMusuh2(indi, 9, 0);
buatMusuh2(indi, 9, -20);
buatMusuh2(indi, 9, -40);
buatMusuh2(indi, 9, -60);
} else {
buatMusuh2(indi, 1, 0);
}
}
}
function cekAdaGesek(indi, indi2) {
if (indi.besar == true) {
cekGesek(indi, indi2);
} else {
cekGesek(indi, indi2, "debu");
}
}
function buatMusuh(indi, indi2, indi3, indi4) {
xdalamMusuh = 0;
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x == undefined) {
xdalamMusuh = i;
i = 2030;
}
i++;
}
if (banyakMusuh < bykPasukan2) {
if (xdalamMusuh != 0) {
jenisMusuh = indi;
xmasukTarget = new Array();
xmasukTarget2 = new Array();
i = 0;
while (i <= 4) {
xmasukTarget[i] = 0;
xmasukTarget2[i] = 0;
i++;
}
masukSearch = false;
urgentSearch = false;
adaSearch = false;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa >= 0)) {
if (_root["jagoan_mc" + i].posisiKini != undefined) {
if (_root["jagoan_mc" + i].serangBase == true) {
xmasukTarget[_root["jagoan_mc" + i].posisiKini] = xmasukTarget[_root["jagoan_mc" + i].posisiKini] + 30;
urgentSearch = true;
adaSearch = true;
} else {
xmasukTarget[_root["jagoan_mc" + i].posisiKini] = xmasukTarget[_root["jagoan_mc" + i].posisiKini] + 1;
adaSearch = true;
}
masukSearch = true;
}
}
i++;
}
if (masukSearch == true) {
i = 0;
while (i <= 4) {
xmasukTarget2[i] = xmasukTarget[i];
i++;
}
xmasukTarget.sort(Array.NUMERIC);
pilihanTargetMusuh = 0;
i = 0;
while (i <= 4) {
if (xmasukTarget2[i] == xmasukTarget[4]) {
pilihanTargetMusuh = i;
}
i++;
}
if (pilihanTargetMusuh != 0) {
randKeluar = pilihanTargetMusuh;
}
}
if (adaSearch == false) {
randKeluar = random(4) + 1;
}
if (urgentSearch == false) {
qrand = random(100);
if (qrand <= 30) {
randKeluar = random(4) + 1;
}
}
if ((jenisMusuh >= 23) && (jenisMusuh <= 24)) {
randKeluar = 4;
}
if (indi3 != undefined) {
randKeluar = indi3;
}
banyakMusuh++;
if ((jenisMusuh >= 18) && (jenisMusuh <= 25)) {
musuh = attachMovie("xtroops" + jenisMusuh, "musuh_mc" + xdalamMusuh, xdalamMusuh + 52500);
} else {
musuh = attachMovie("xtroops" + jenisMusuh, "musuh_mc" + xdalamMusuh, xdalamMusuh);
}
musuh.cacheAsBitmap = true;
if (indi4 != undefined) {
musuh._x = (background_mc._x + 3200) + indi4;
} else {
musuh._x = background_mc._x + 3200;
}
if (randKeluar == 1) {
musuh._y = 550;
} else if (randKeluar == 2) {
musuh._y = 450;
} else if (randKeluar == 3) {
musuh._y = 350;
} else if (randKeluar == 4) {
musuh._y = 250;
}
if (((jenisMusuh == 15) || (jenisMusuh == 16)) || (jenisMusuh == 17)) {
musuh._y = musuh._y + 5;
}
musuh.posisiKini = randKeluar;
musuh.jenis = jenisMusuh;
musuh.tiarap = false;
musuh.berhenti = false;
musuh.sedangHitBatu = false;
if (((jenisMusuh == 2) || (jenisMusuh == 4)) || (jenisMusuh == 6)) {
musuh.tiarap = true;
} else if ((((((((jenisMusuh == 10) || (jenisMusuh == 11)) || (jenisMusuh == 12)) || (jenisMusuh == 13)) || (jenisMusuh == 14)) || (jenisMusuh == 15)) || (jenisMusuh == 16)) || (jenisMusuh == 17)) {
musuh.berhenti = true;
}
if ((((((((jenisMusuh == 13) || (jenisMusuh == 14)) || (jenisMusuh == 15)) || (jenisMusuh == 16)) || (jenisMusuh == 17)) || (jenisMusuh == 23)) || (jenisMusuh == 24)) || (jenisMusuh == 25)) {
musuh.tahanBesi = true;
} else {
musuh.tahanBesi = false;
}
if (jenisMusuh >= 10) {
musuh.besar = true;
} else {
musuh.besar = false;
}
if ((jenisMusuh >= 18) && (jenisMusuh <= 25)) {
musuh.terbang = true;
musuh._y = musuh._y - 25;
musuh._xscale = (musuh._yscale = 45);
} else {
musuh._xscale = (musuh._yscale = 70);
musuh.terbang = false;
}
musuh.awalScale = musuh._xscale;
musuh.orang = false;
musuh.kendaraan = false;
if (jenisMusuh <= 9) {
musuh.orang = true;
} else if (jenisMusuh <= 17) {
musuh.kendaraan = true;
}
if ((jenisMusuh >= 20) && (jenisMusuh <= 25)) {
musuh.lanjut = true;
} else {
musuh.lanjut = false;
}
if ((jenisMusuh >= 23) && (jenisMusuh <= 24)) {
musuh.bomber = true;
musuh._y = musuh._y - 10;
} else {
musuh.bomber = false;
}
musuh.serangBesi = false;
musuh.sudahBerhenti = false;
musuh.tipeUnit = "musuh";
cekAtributeMusuh(jenisMusuh);
musuh.speedTurun = 1;
musuh.speedNaik = 15;
musuh.serangBase = false;
musuh.loncat = false;
musuh.sudahMati = false;
cekTarget2(musuh);
musuh.onEnterFrame = enterMusuh;
zi = 1000;
while (zi <= 1030) {
if ((_root["jagoan_mc" + zi]._x != undefined) && (_root["jagoan_mc" + zi].nyawa > 0)) {
cekTarget(_root["jagoan_mc" + zi]);
}
zi++;
}
musuh.moneyLebih = false;
musuh.serangBesi = false;
if (indi2 == 1) {
musuh.serangBesi = true;
cekTarget2(musuh);
} else if (indi2 == 2) {
if (randKeluar == 1) {
buatMusuh(jenisMusuh, "", 2);
buatMusuh(jenisMusuh, "", 3);
buatMusuh(jenisMusuh, "", 4);
} else if (randKeluar == 2) {
buatMusuh(jenisMusuh, "", 1);
buatMusuh(jenisMusuh, "", 3);
buatMusuh(jenisMusuh, "", 4);
} else if (randKeluar == 3) {
buatMusuh(jenisMusuh, "", 1);
buatMusuh(jenisMusuh, "", 2);
buatMusuh(jenisMusuh, "", 4);
} else if (randKeluar == 4) {
buatMusuh(jenisMusuh, "", 1);
buatMusuh(jenisMusuh, "", 2);
buatMusuh(jenisMusuh, "", 3);
}
} else if (indi2 == 3) {
buatMusuh(jenisMusuh, "", randKeluar, -25);
buatMusuh(jenisMusuh, "", randKeluar, -50);
buatMusuh(jenisMusuh, "", randKeluar, -75);
} else if (indi2 == 4) {
musuh.nyawa = musuh.nyawa * 4;
musuh.damage = musuh.damage * 4;
} else if (indi2 == 5) {
musuh.speed = musuh.speed * 2;
musuh.range = musuh.range * 2;
} else if (indi2 == 6) {
musuh.tahanBesi = true;
} else if (indi2 == 7) {
musuh.nyawa = musuh.nyawa * 4;
musuh.damage = musuh.damage * 4;
musuh.speed = musuh.speed * 2;
musuh.range = musuh.range * 2;
musuh.speedNaik = musuh.speedNaik * 2;
} else if (indi2 == 8) {
cekHancurSemua("musuh", musuh.posisiKini);
}
musuh.maxNyawa = musuh.nyawa;
}
}
}
function cekAtributeMusuh(indi) {
if (indi == 1) {
musuh.nyawa = 150;
musuh.damage = 30;
musuh.speed = 4.5;
musuh.range = 350;
} else if (indi == 2) {
musuh.nyawa = 200;
musuh.damage = 45;
musuh.speed = 3.5;
musuh.range = 375;
} else if (indi == 3) {
musuh.nyawa = 100;
musuh.damage = 75;
musuh.speed = 3;
musuh.range = 400;
} else if (indi == 4) {
musuh.nyawa = 125;
musuh.damage = 100;
musuh.speed = 3;
musuh.range = 550;
} else if (indi == 5) {
musuh.nyawa = 350;
musuh.damage = 200;
musuh.speed = 4;
musuh.range = 650;
} else if (indi == 6) {
musuh.nyawa = 450;
musuh.damage = 75;
musuh.speed = 4.5;
musuh.range = 350;
} else if (indi == 7) {
musuh.nyawa = 250;
musuh.damage = 500;
musuh.speed = 3;
musuh.range = 600;
} else if (indi == 8) {
musuh.nyawa = 350;
musuh.damage = 750;
musuh.speed = 2.5;
musuh.range = 650;
} else if (indi == 9) {
musuh.nyawa = 450;
musuh.damage = 1000;
musuh.speed = 2;
musuh.range = 700;
} else if (indi == 10) {
musuh.nyawa = 600;
musuh.damage = 50;
musuh.speed = 5.5;
musuh.range = 450;
} else if (indi == 11) {
musuh.nyawa = 850;
musuh.damage = 75;
musuh.speed = 5;
musuh.range = 500;
} else if (indi == 12) {
musuh.nyawa = 1100;
musuh.damage = 100;
musuh.speed = 4.5;
musuh.range = 550;
} else if (indi == 13) {
musuh.nyawa = 1500;
musuh.damage = 75;
musuh.speed = 3.5;
musuh.range = 400;
} else if (indi == 14) {
musuh.nyawa = 1750;
musuh.damage = 100;
musuh.speed = 3.5;
musuh.range = 450;
} else if (indi == 15) {
musuh.nyawa = 2500;
musuh.damage = 400;
musuh.speed = 2.5;
musuh.range = 650;
} else if (indi == 16) {
musuh.nyawa = 3000;
musuh.damage = 500;
musuh.speed = 2;
musuh.range = 700;
} else if (indi == 17) {
musuh.nyawa = 4500;
musuh.damage = 600;
musuh.speed = 1.5;
musuh.range = 750;
} else if (indi == 18) {
musuh.nyawa = 1000;
musuh.damage = 150;
musuh.speed = 3.5;
musuh.range = 500;
} else if (indi == 19) {
musuh.nyawa = 1500;
musuh.damage = 300;
musuh.speed = 4;
musuh.range = 650;
} else if (indi == 20) {
musuh.nyawa = 2500;
musuh.damage = 40;
musuh.speed = 9;
musuh.range = 800;
} else if (indi == 21) {
musuh.nyawa = 3000;
musuh.damage = 60;
musuh.speed = 11;
musuh.range = 850;
} else if (indi == 22) {
musuh.nyawa = 3500;
musuh.damage = 80;
musuh.speed = 10;
musuh.range = 900;
} else if (indi == 23) {
musuh.nyawa = 4500;
musuh.damage = 1000;
musuh.speed = 4;
musuh.range = 50;
} else if (indi == 24) {
musuh.nyawa = 5500;
musuh.damage = 1500;
musuh.speed = 6;
musuh.range = 75;
} else if (indi == 25) {
musuh.nyawa = 6500;
musuh.damage = 400;
musuh.speed = 10;
musuh.range = 950;
}
if (musuh.terbang == true) {
musuh.speed = musuh.speed * 0.5;
}
musuh.speedY = 0;
if (musuh.bomber == false) {
musuh.batasBawah = musuh._y + 25;
musuh.batasAtas = musuh._y - 25;
musuh.speedY2 = 0.25;
} else {
musuh.batasBawah = musuh._y + 5;
musuh.batasAtas = musuh._y - 5;
musuh.speedY2 = 0.1;
}
musuh.nyawa = musuh.nyawa * wpengalianSemuaMusuhNyawa;
musuh.damage = musuh.damage * wpengalianSemuaMusuhDamage;
musuh.speed = musuh.speed * wpengalianSemuaMusuhSpeed;
musuh.range = musuh.range * wpengalianSemuaMusuhRange;
musuh.range = musuh.range + random(50);
musuh.berkurangNyawa = false;
musuh.maxNyawa = musuh.nyawa;
}
function enterMusuh() {
if (sedangPause == false) {
this.bar_mc.bar._xscale = (this.nyawa / this.maxNyawa) * 100;
this._x = this._x + speedGame;
if (this.berkurangNyawa == true) {
this.nyawa = this.nyawa - (this.maxNyawa / 100);
}
if (this.nyawa <= 0) {
if (this.terbang == false) {
cekInteraksi(this, "musuh");
}
this.bar_mc._visible = false;
if (this.tiarap == true) {
if ((this._currentframe >= 5) && (this._currentframe <= 7)) {
this.gotoAndStop(7);
} else if ((this._currentframe >= 1) && (this._currentframe <= 3)) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(3);
}
} else if (this._currentframe != 3) {
if (this.besar == true) {
cekPecah(this);
}
this.gotoAndStop(3);
}
if (this.sudahMati == false) {
if (this.terbang == true) {
if (this.lanjut == true) {
backJatuhCopter();
} else {
backJatuh();
}
} else if (this.besar == true) {
backLedak();
} else {
backMati();
}
this.sudahMati = true;
money2 = money2 + daftarHarga[this.jenis];
banyakMusuh--;
unitMati2++;
}
if (this.terbang == true) {
if (this.anim._currentframe == 1) {
this.sudahJatuh = true;
if ((this.zindi.hitTest(background_mc.rapuh1.indi) && (this._y >= background_mc.rapuh1._y)) && (this.posisiKini > background_mc.rapuh1.pos)) {
this._y = background_mc.rapuh1._y;
} else if ((this.zindi.hitTest(background_mc.rapuh2.indi) && (this._y >= background_mc.rapuh2._y)) && (this.posisiKini > background_mc.rapuh2.pos)) {
this._y = background_mc.rapuh2._y;
} else if ((this.zindi.hitTest(background_mc.rapuh3.indi) && (this._y >= background_mc.rapuh3._y)) && (this.posisiKini > background_mc.rapuh3.pos)) {
this._y = background_mc.rapuh3._y;
} else if ((this.zindi.hitTest(background_mc.rapuh4.indi) && (this._y >= background_mc.rapuh4._y)) && (this.posisiKini > background_mc.rapuh4.pos)) {
this._y = background_mc.rapuh4._y;
} else if ((this.zindi.hitTest(background_mc.rapuh5.indi) && (this._y >= background_mc.rapuh5._y)) && (this.posisiKini > background_mc.rapuh5.pos)) {
this._y = background_mc.rapuh6._y;
} else if ((this.zindi.hitTest(background_mc.rapuh6.indi) && (this._y >= background_mc.rapuh6._y)) && (this.posisiKini > background_mc.rapuh6.pos)) {
this._y = background_mc.rapuh6._y;
} else if ((this.zindi.hitTest(background_mc.rel6.indi) && (this._y >= background_mc.rel6._y)) && (this.posisiKini > background_mc.rel6.pos)) {
this._y = background_mc.rel6._y;
} else if ((this.zindi.hitTest(background_mc.rel5.indi) && (this._y >= background_mc.rel5._y)) && (this.posisiKini > background_mc.rel5.pos)) {
this._y = background_mc.rel5._y;
} else if ((this.zindi.hitTest(background_mc.rel4.indi) && (this._y >= background_mc.rel4._y)) && (this.posisiKini > background_mc.rel4.pos)) {
this._y = background_mc.rel4._y;
} else if ((this.zindi.hitTest(background_mc.rel3.indi) && (this._y >= background_mc.rel3._y)) && (this.posisiKini > background_mc.rel3.pos)) {
this._y = background_mc.rel3._y;
} else if ((this.zindi.hitTest(background_mc.rel2.indi) && (this._y >= background_mc.rel2._y)) && (this.posisiKini > background_mc.rel2.pos)) {
this._y = background_mc.rel2._y;
} else if ((this.zindi.hitTest(background_mc.rel1.indi) && (this._y >= background_mc.rel1._y)) && (this.posisiKini > background_mc.rel1.pos)) {
this._y = background_mc.rel1._y;
} else if ((this.zindi.hitTest(background_mc.rel0.indi) && (this._y >= background_mc.rel0._y)) && (this.posisiKini > background_mc.rel0.pos)) {
this._y = background_mc.rel0._y;
} else {
this.sudahJatuh = false;
}
if (this.sudahJatuh == false) {
this.anim.gotoAndStop(1);
if (this.lanjut == true) {
this._x = this._x - this.speed;
} else {
this._x = this._x - (this.speed / 3);
}
this._y = this._y + this.speedY;
this.speedY = this.speedY + 0.25;
} else if (this.anim._currentframe == 1) {
this.anim.gotoAndPlay(2);
cekPecah(this);
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (this.damage * 10);
cekEfekLedak(_root["musuh_mc" + i], 1);
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerMusuh" + i])) {
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa - (this.damage * 10);
cekEfekLedak(background_mc["towerMusuh" + i], 2);
}
}
i++;
}
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - (this.damage * 10);
cekEfekLedak(_root["jagoan_mc" + i], 1);
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerJagoan" + i])) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa - (this.damage * 10);
cekEfekLedak(background_mc["towerJagoan" + i], 2);
}
}
i++;
}
}
}
}
} else {
if (this.terbang == false) {
cekInteraksi(this, "musuh");
}
if (this.sudahBerhenti == true) {
this.gotoAndStop(8);
} else if ((siapaMenang == "jagoan") && (this.orang == true)) {
this._xscale = -this.awalScale;
this.gotoAndStop(1);
this._x = this._x + (this.speed * 2);
} else if ((siapaMenang == "jagoan") && (this.kendaraan == true)) {
if (this.sudahBerhenti == false) {
this.sudahBerhenti = true;
keluarKarakter(this, "musuh");
}
} else if ((siapaMenang == "jagoan") && (this.terbang == true)) {
keluarKarakter(this, "musuh");
this.nyawa = 0;
} else {
if (this.lanjut == true) {
this._x = this._x - this.speed;
this._y = this._y + this.speedY2;
if (this._y > this.batasBawah) {
this._y = this.batasBawah;
this.speedY2 = -this.speedY2;
} else if (this._y < this.batasAtas) {
this._y = this.batasAtas;
this.speedY2 = -this.speedY2;
}
}
if (this.serangBase == true) {
this.xtarget = background_mc.benteng1;
if (background_mc.benteng1.bentengx._currentframe == 1) {
if (this.tiarap == true) {
this.gotoAndStop(5);
} else {
this.gotoAndStop(2);
}
} else if (background_mc.benteng1.bentengx._currentframe == 2) {
if (this.tiarap == true) {
this.gotoAndStop(6);
this.anim.stop();
} else {
this.gotoAndStop(4);
}
}
} else {
if ((this.xtarget.tipeUnit == "tower_jagoan") || (this.xtarget.tipeUnit == "lain")) {
if (this.bomber == false) {
if (((this._x < (this.xtarget._x + background_mc._x)) || (this.xtarget.nyawa <= 0)) || (this.posisiKini != this.xtarget.posisiKini)) {
this.xtarget = undefined;
}
} else if ((this._x < (this.xtarget._x + background_mc._x)) || (this.xtarget.nyawa <= 0)) {
this.xtarget = undefined;
}
} else if (this.bomber == false) {
if (((this._x < this.xtarget._x) || (this.xtarget.nyawa <= 0)) || (this.posisiKini != this.xtarget.posisiKini)) {
this.xtarget = undefined;
}
} else if ((this._x < this.xtarget._x) || (this.xtarget.nyawa <= 0)) {
this.xtarget = undefined;
}
if (((this.xtarget == undefined) || (this.xtarget._x == undefined)) || (this.xtarget.nyawa <= 0)) {
if (banyakJagoan > 0) {
cekTarget2(this);
}
}
if (this.xtarget != undefined) {
if (this.bomber == true) {
if ((this.xtarget.tipeUnit == "tower_jagoan") || (this.xtarget.tipeUnit == "lain")) {
this.xjarak = Math.abs((this.xtarget._x + background_mc._x) - this._x);
} else {
this.xjarak = Math.abs(this._x - this.xtarget._x);
}
} else if ((this.xtarget.tipeUnit == "tower_jagoan") || (this.xtarget.tipeUnit == "lain")) {
this.xjarak = Math.sqrt(Math.pow((this.xtarget._x + background_mc._x) - this._x, 2) + Math.pow((this.xtarget._y + background_mc._y) - this._y, 2));
} else {
this.xjarak = Math.sqrt(Math.pow(this._x - this.xtarget._x, 2) + Math.pow(this._y - this.xtarget._y, 2));
}
if (this.xjarak <= this.range) {
this.adaMusuh = true;
} else {
this.adaMusuh = false;
}
} else {
this.adaMusuh = false;
}
if (this.adaMusuh == true) {
if (this.tiarap == true) {
this.gotoAndStop(5);
} else {
this.gotoAndStop(2);
}
} else {
if (this.tiarap == true) {
if (this._currentframe == 5) {
this.gotoAndStop(6);
}
} else {
this.gotoAndStop(1);
}
if (this.sedangHitBatu == false) {
if (this._currentframe == 1) {
if (this.lanjut == false) {
this._x = this._x - this.speed;
}
}
} else {
this.gotoAndStop(4);
}
}
}
}
}
if (this.lanjut == true) {
if (this._x <= (background_mc._x - 400)) {
this._x = background_mc._x + 3600;
}
}
if (this._x <= ((background_mc._x + background_mc.benteng1._x) + this.range)) {
if (this._x < (background_mc._x + background_mc.benteng1._x)) {
this.serangBase = false;
} else {
this.serangBase = true;
}
} else {
this.serangBase = false;
}
if (this._y >= 700) {
removeMovieClip(this);
}
}
}
function cekTarget2(indi) {
masukTarget = new Array();
keTarget = 0;
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (indi._x > _root["jagoan_mc" + i]._x) {
if (indi.bomber == true) {
xjarak = Math.abs(indi._x - _root["jagoan_mc" + i]._x);
masukTarget[keTarget] = xjarak;
keTarget++;
} else if (indi.posisiKini == _root["jagoan_mc" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow(indi._x - _root["jagoan_mc" + i]._x, 2) + Math.pow(indi._y - _root["jagoan_mc" + i]._y, 2));
masukTarget[keTarget] = xjarak;
keTarget++;
}
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if ((background_mc["towerJagoan" + i]._x + background_mc._x) < indi._x) {
if (indi.bomber == true) {
xjarak = Math.abs((background_mc["towerJagoan" + i]._x + background_mc._x) - indi._x);
masukTarget[keTarget] = xjarak;
keTarget++;
} else if (indi.posisiKini == background_mc["towerJagoan" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow((background_mc["towerJagoan" + i]._x + background_mc._x) - indi._x, 2) + Math.pow((background_mc["towerJagoan" + i]._y + background_mc._y) - indi._y, 2));
masukTarget[keTarget] = xjarak;
keTarget++;
}
}
}
i++;
}
if (indi.serangBesi == true) {
i = 1;
while (i <= banyakBesi) {
if ((background_mc["besi" + i]._x != undefined) && (background_mc["besi" + i].nyawa > 0)) {
if ((background_mc["besi" + i]._x + background_mc._x) < indi._x) {
if (indi.bomber == true) {
xjarak = Math.abs((background_mc["besi" + i]._x + background_mc._x) - indi._x);
masukTarget[keTarget] = xjarak;
keTarget++;
} else if (indi.posisiKini == background_mc["besi" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow((background_mc["besi" + i]._x + background_mc._x) - indi._x, 2) + Math.pow((background_mc["besi" + i]._y + background_mc._y) - indi._y, 2));
masukTarget[keTarget] = xjarak;
keTarget++;
}
}
}
i++;
}
}
if (keTarget > 0) {
serangKemana = 0;
masukTarget.sort(Array.NUMERIC);
keAmbil = masukTarget[0];
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (indi._x > _root["jagoan_mc" + i]._x) {
if (indi.bomber == true) {
xjarak = Math.abs(indi._x - _root["jagoan_mc" + i]._x);
if (xjarak == keAmbil) {
ambilLawan = "musuh";
serangKemana = i;
}
} else if (indi.posisiKini == _root["jagoan_mc" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow(indi._x - _root["jagoan_mc" + i]._x, 2) + Math.pow(indi._y - _root["jagoan_mc" + i]._y, 2));
if (xjarak == keAmbil) {
ambilLawan = "musuh";
serangKemana = i;
}
}
}
}
i++;
}
if (serangKemana == 0) {
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if ((background_mc["towerJagoan" + i]._x + background_mc._x) < indi._x) {
if (indi.bomber == true) {
xjarak = Math.abs((background_mc["towerJagoan" + i]._x + background_mc._x) - indi._x);
if (xjarak == keAmbil) {
ambilLawan = "tower";
serangKemana = i;
}
} else if (indi.posisiKini == background_mc["towerJagoan" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow((background_mc["towerJagoan" + i]._x + background_mc._x) - indi._x, 2) + Math.pow((background_mc["towerJagoan" + i]._y + background_mc._y) - indi._y, 2));
if (xjarak == keAmbil) {
ambilLawan = "tower";
serangKemana = i;
}
}
}
}
i++;
}
}
if (indi.serangBesi == true) {
if (serangKemana == 0) {
i = 1;
while (i <= banyakBesi) {
if ((background_mc["besi" + i]._x != undefined) && (background_mc["besi" + i].nyawa > 0)) {
if ((background_mc["besi" + i]._x + background_mc._x) < indi._x) {
if (indi.bomber == true) {
xjarak = Math.abs((background_mc["besi" + i]._x + background_mc._x) - indi._x);
if (xjarak == keAmbil) {
ambilLawan = "besi";
serangKemana = i;
}
} else if (indi.posisiKini == background_mc["besi" + i].posisiKini) {
xjarak = Math.sqrt(Math.pow((background_mc["besi" + i]._x + background_mc._x) - indi._x, 2) + Math.pow((background_mc["besi" + i]._y + background_mc._y) - indi._y, 2));
if (xjarak == keAmbil) {
ambilLawan = "besi";
serangKemana = i;
}
}
}
}
i++;
}
}
}
} else {
serangKemana = 0;
}
if (serangKemana != 0) {
if (ambilLawan == "musuh") {
indi.xtarget = _root["jagoan_mc" + serangKemana];
} else if (ambilLawan == "tower") {
indi.xtarget = background_mc["towerJagoan" + serangKemana];
} else if (ambilLawan == "besi") {
indi.xtarget = background_mc["besi" + serangKemana];
}
}
}
function cekKena(indi, indi2, indi3, indi4) {
if (indi.serangBase == true) {
if (indi4 == 1) {
cekEfekPeluru(indi, 2, indi2, indi3);
} else if (indi4 == 4) {
cekGranat(indi, "base", "mortar", indi2, indi3);
} else if (indi4 == 7) {
cekMisil(indi, "base", "", indi2, indi3);
} else if (indi4 == 9) {
cekMisil(indi, "base", "misil2", indi2, indi3);
} else if (((indi.jenis <= 2) || (indi.jenis == 5)) || (indi.jenis == 6)) {
if (indi.tipeUnit == "jagoan") {
if (levelKe >= 29) {
baseMusuh = baseMusuh - (indi.damage / 2);
} else {
baseMusuh = baseMusuh - indi.damage;
}
minimap_mc.base2.gotoAndStop(2);
baseMusuh = Math.ceil(baseMusuh);
} else if (indi.tipeUnit == "musuh") {
if (levelKe >= 29) {
baseJagoan = baseJagoan - (indi.damage / 2);
} else {
baseJagoan = baseJagoan - indi.damage;
}
minimap_mc.base1.gotoAndStop(2);
baseJagoan = Math.ceil(baseJagoan);
}
cekEfekPeluru(indi, 2);
} else if ((((((((((((indi.jenis == 10) || (indi.jenis == 11)) || (indi.jenis == 12)) || (indi.jenis == 13)) || (indi.jenis == 14)) || (indi.jenis == 17)) || (indi.jenis == 18)) || (indi.jenis == 19)) || (indi.jenis == 20)) || (indi.jenis == 21)) || (indi.jenis == 22)) || (indi.jenis == 42)) {
cekEfekPeluru(indi, 2, indi2, indi3);
if (indi.tipeUnit == "jagoan") {
if (levelKe >= 29) {
baseMusuh = baseMusuh - (indi.damage / 2);
} else {
baseMusuh = baseMusuh - indi.damage;
}
minimap_mc.base2.gotoAndStop(2);
baseMusuh = Math.ceil(baseMusuh);
} else if (indi.tipeUnit == "musuh") {
if (levelKe >= 29) {
baseJagoan = baseJagoan - (indi.damage / 2);
} else {
baseJagoan = baseJagoan - indi.damage;
}
minimap_mc.base1.gotoAndStop(2);
baseJagoan = Math.ceil(baseJagoan);
}
} else if (indi.jenis == 3) {
cekGranat(indi, "base", "granat");
} else if (indi.jenis == 4) {
cekGranat(indi, "base", "mortar");
} else if (indi.jenis <= 8) {
cekMisil(indi, "base");
} else if (indi.jenis == 9) {
cekMisil(indi, "base", "misil2");
} else if ((indi.jenis == 23) || (indi.jenis == 24)) {
cekBomb(indi, "base");
}
} else {
if (indi4 == 4) {
cekGranat(indi, "", "mortar", indi2, indi3);
} else if (indi4 == 7) {
cekMisil(indi, "", "", indi2, indi3);
} else if (indi4 == 9) {
cekMisil(indi, "", "misil2", indi2, indi3);
} else if (((indi.jenis <= 2) || (indi.jenis == 5)) || (indi.jenis == 6)) {
if (indi.xtarget.tahanBesi == true) {
indi.xtarget.nyawa = indi.xtarget.nyawa - Math.ceil(indi.damage / 20);
} else if (indi.xtarget.tiarap == true) {
indi.xtarget.nyawa = indi.xtarget.nyawa - Math.ceil(indi.damage / 1.25);
} else {
indi.xtarget.nyawa = indi.xtarget.nyawa - indi.damage;
}
cekEfekPeluru(indi, 1);
} else if ((((((((((((indi.jenis == 10) || (indi.jenis == 11)) || (indi.jenis == 12)) || (indi.jenis == 13)) || (indi.jenis == 14)) || (indi.jenis == 17)) || (indi.jenis == 18)) || (indi.jenis == 19)) || (indi.jenis == 20)) || (indi.jenis == 21)) || (indi.jenis == 22)) || (indi.jenis == 42)) {
if (indi.xtarget.tahanBesi == true) {
indi.xtarget.nyawa = indi.xtarget.nyawa - Math.ceil(indi.damage / 20);
} else if (indi.xtarget.tiarap == true) {
indi.xtarget.nyawa = indi.xtarget.nyawa - Math.ceil(indi.damage / 1.25);
} else {
indi.xtarget.nyawa = indi.xtarget.nyawa - indi.damage;
}
cekEfekPeluru(indi, 1, indi2, indi3);
} else if (indi.jenis == 3) {
cekGranat(indi, "", "granat");
} else if (indi.jenis == 4) {
cekGranat(indi, "", "mortar");
} else if (indi.jenis <= 8) {
cekMisil(indi, "");
} else if (indi.jenis == 9) {
cekMisil(indi, "", "misil2");
} else if ((indi.jenis == 23) || (indi.jenis == 24)) {
cekBomb(indi);
}
if (((indi.xtarget.tipeUnit == "tower_jagoan") || (indi.xtarget.tipeUnit == "tower_musuh")) || (indi.xtarget.tipeUnit == "lain")) {
wjarak = Math.abs((indi.xtarget._x + background_mc._x) - indi._x);
} else {
wjarak = Math.abs(indi.xtarget._x - indi._x);
}
if (wjarak <= indi.xtarget.range) {
indi.xtarget.xtarget = indi;
}
}
}
function cekBomb(indi, indi2) {
bomb = attachMovie("bomb_mc", "peluru_mc" + dalamPeluru, dalamPeluru);
bomb.cacheAsBitmap = true;
bomb._x = indi._x;
bomb._y = indi._y;
bomb._xscale = (bomb._yscale = 75);
bomb.indi = indi;
if (indi.xtarget._y != undefined) {
if (((indi.xtarget.tipeUnit == "tower_jagoan") || (indi.xtarget.tipeUnit == "tower_musuh")) || (indi.xtarget.tipeUnit == "lain")) {
bomb.batasBawah = indi.xtarget._y + 10;
} else {
bomb.batasBawah = indi.xtarget._y;
}
} else {
bomb.batasBawah = indi._y + 200;
}
if (((indi.xtarget.tipeUnit == "tower_jagoan") || (indi.xtarget.tipeUnit == "tower_musuh")) || (indi.xtarget.tipeUnit == "lain")) {
bomb.bawah2 = bomb.batasBawah + 10;
} else {
bomb.bawah2 = bomb.batasBawah;
}
bomb.tipeUnit = indi.tipeUnit;
bomb.speed = 0;
if (indi2 == "base") {
bomb.serangBase = true;
} else {
bomb.serangBase = false;
}
if (bomb.tipeUnit == "jagoan") {
bomb._xscale = bomb._xscale;
} else if (bomb.tipeUnit == "musuh") {
bomb._xscale = -bomb._xscale;
}
bomb.damage = indi.damage;
bomb.onEnterFrame = enterBomb;
dalamPeluru++;
if (dalamPeluru >= 52100) {
dalamPeluru = 52000;
}
}
function enterBomb() {
if (sedangPause == false) {
this._x = this._x + speedGame;
this._y = this._y + this.speed;
this.speed = this.speed + 0.5;
if (this.tipeUnit == "jagoan") {
this._x = this._x + 0.5;
this._rotation = this._rotation + (this.speed / 5);
if (this._y >= this.batasBawah) {
this.cekMeledak = true;
}
} else if (this.tipeUnit == "musuh") {
this._x = this._x - 0.5;
this._rotation = this._rotation - (this.speed / 5);
if (this._y >= this.batasBawah) {
this.cekMeledak = true;
}
}
if (this.serangBase == false) {
if (this.cekMeledak == true) {
if (this._currentframe == 1) {
this.gotoAndStop(2);
cekEfekBomb(this);
cekEfek(this, "misil", this.bawah2, "");
if (this.tipeUnit == "jagoan") {
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerMusuh" + i])) {
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa - this.damage;
}
}
i++;
}
} else if (this.tipeUnit == "musuh") {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerJagoan" + i])) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa - this.damage;
}
}
i++;
}
}
}
}
} else if (this.cekMeledak == true) {
if (this._currentframe == 1) {
this.gotoAndStop(2);
cekEfekBomb(this);
cekEfek(this, "misil", this.bawah2, "");
if (this.tipeUnit == "jagoan") {
if (levelKe >= 29) {
baseMusuh = baseMusuh - (this.damage / 2);
} else {
baseMusuh = baseMusuh - this.damage;
}
minimap_mc.base2.gotoAndStop(2);
baseMusuh = Math.ceil(baseMusuh);
} else if (this.tipeUnit == "musuh") {
if (levelKe >= 29) {
baseJagoan = baseJagoan - (this.damage / 2);
} else {
baseJagoan = baseJagoan - this.damage;
}
minimap_mc.base1.gotoAndStop(2);
baseJagoan = Math.ceil(baseJagoan);
}
}
if (this.tipeUnit == "jagoan") {
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerMusuh" + i])) {
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa - this.damage;
}
}
i++;
}
} else if (this.tipeUnit == "musuh") {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerJagoan" + i])) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa - this.damage;
}
}
i++;
}
}
}
}
}
function cekMisil(indi, indi2, indi3, indi4, indi5) {
if (indi3 == "misil2") {
mortir = attachMovie("mortir_mc2", "peluru_mc" + dalamPeluru, dalamPeluru);
} else {
mortir = attachMovie("mortir_mc", "peluru_mc" + dalamPeluru, dalamPeluru);
}
mortir.cacheAsBitmap = true;
if (indi.tipeUnit == "tower_jagoan") {
mortir._x = (background_mc._x + indi._x) + 20;
} else if (indi.tipeUnit == "tower_musuh") {
mortir._x = (background_mc._x + indi._x) - 25;
} else if (indi.tipeUnit == "jagoan") {
mortir._x = indi._x + 10;
} else if (indi.tipeUnit == "musuh") {
mortir._x = indi._x - 15;
}
if (indi3 == "misil2") {
mortir._y = indi._y - 30;
} else if (indi.tipeUnit == "jagoan") {
mortir._y = indi._y - 35;
} else if (indi.tipeUnit == "musuh") {
mortir._y = indi._y - 35;
} else if (indi.tipeUnit == "tower_jagoan") {
mortir._y = indi._y - 45;
} else if (indi.tipeUnit == "tower_musuh") {
mortir._y = indi._y - 45;
}
if (indi4 != undefined) {
if (indi.tipeUnit == "tower_jagoan") {
mortir._x = (indi._x + background_mc._x) + indi4;
mortir._y = (indi._y + background_mc._y) + indi5;
} else if (indi.tipeUnit == "tower_musuh") {
mortir._x = (indi._x + background_mc._x) + indi4;
mortir._y = (indi._y + background_mc._y) + indi5;
} else {
mortir._x = indi._x + indi4;
mortir._y = indi._y + indi5;
}
mortir.damage = indi.damage * 3;
} else {
mortir.damage = indi.damage;
}
if (indi3 == "misil2") {
mortir._xscale = 50;
mortir._yscale = 50;
} else {
mortir._xscale = 35;
mortir._yscale = 35;
}
if ((indi.tipeUnit == "musuh") || (indi.tipeUnit == "tower_musuh")) {
mortir._xscale = -mortir._xscale;
}
mortir.indi = indi;
mortir.indi3 = indi3;
mortir.tipeUnit = indi.tipeUnit;
mortir.range = indi.range;
if ((((indi.xtarget.tipeUnit == "tower_jagoan") || (indi.xtarget.tipeUnit == "tower_musuh")) || (indi.xtarget.tipeUnit == "lain")) || (indi2 == "base")) {
wjarak = Math.abs((indi.xtarget._x + background_mc._x) - indi._x);
mortir.bawah2 = indi._y + 10;
} else {
wjarak = Math.abs(indi.xtarget._x - indi._x);
if ((indi.tipeUnit == "tower_jagoan") || (indi.tipeUnit == "tower_musuh")) {
mortir.bawah = indi._y + 10;
} else {
mortir.bawah2 = indi._y;
}
}
if ((indi.tipeUnit == "jagoan") || (indi.tipeUnit == "tower_jagoan")) {
if (indi3 == "misil2") {
mortir.speedX = 40;
} else {
mortir.speedX = 35;
}
if (indi.tipeUnit == "tower_jagoan") {
if (indi4 != undefined) {
mortir.bawah = ((indi._x + background_mc._x) + indi.range) - 50;
} else {
mortir.bawah = ((indi._x + background_mc._x) + indi.range) + 50;
}
} else if (indi4 != undefined) {
mortir.bawah = (indi._x + indi.range) - 50;
} else {
mortir.bawah = (indi._x + indi.range) + 50;
}
} else if ((indi.tipeUnit == "musuh") || (indi.tipeUnit == "tower_musuh")) {
if (indi3 == "misil2") {
mortir.speedX = -40;
} else {
mortir.speedX = -35;
}
if (indi.tipeUnit == "tower_jagoan") {
if (indi4 != undefined) {
mortir.bawah = ((indi._x + background_mc._x) - indi.range) + 50;
} else {
mortir.bawah = ((indi._x + background_mc._x) - indi.range) - 50;
}
} else if (indi4 != undefined) {
mortir.bawah = (indi._x - indi.range) + 50;
} else {
mortir.bawah = (indi._x - indi.range) - 50;
}
}
if (indi2 == "base") {
mortir.serangBase = true;
if (indi.tipeUnit == "jagoan") {
mortir.bawah = (indi.xtarget._x + background_mc._x) + 50;
} else if (indi.tipeUnit == "musuh") {
mortir.bawah = (indi.xtarget._x + background_mc._x) - 50;
}
} else {
mortir.serangBase = false;
}
mortir.cekMeledak = false;
mortir.onEnterFrame = enterMisil;
dalamPeluru++;
if (dalamPeluru >= 52100) {
dalamPeluru = 52000;
}
}
function enterMisil() {
if (sedangPause == false) {
this._x = this._x + speedGame;
this.bawah = this.bawah + speedGame;
this._x = this._x + this.speedX;
if (this.tipeUnit == "jagoan") {
this.speedX = this.speedX + 2;
if (this._x >= this.bawah) {
this.cekMeledak = true;
}
} else if (this.tipeUnit == "musuh") {
this.speedX--;
if (this._x <= this.bawah) {
this.cekMeledak = true;
}
}
if (this.serangBase == false) {
if (this.hitTest(this.indi.xtarget)) {
this.cekMeledak = true;
if (this.indi.xtarget.tipeUnit == "lain") {
this.indi.xtarget.nyawa = this.indi.xtarget.nyawa - this.damage;
}
}
if (this.cekMeledak == true) {
if (this._currentframe == 1) {
this.gotoAndStop(2);
cekEfek(this, "misil", this.bawah2, this.indi3);
if ((this.tipeUnit == "jagoan") || (this.tipeUnit == "tower_jagoan")) {
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerMusuh" + i])) {
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa - this.damage;
}
}
i++;
}
} else if ((this.tipeUnit == "musuh") || (this.tipeUnit == "tower_musuh")) {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerJagoan" + i])) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa - this.damage;
}
}
i++;
}
}
}
}
} else if (this.cekMeledak == true) {
if (this._currentframe == 1) {
this.gotoAndStop(2);
cekEfek(this, "misil", this.bawah2, this.indi3);
if (this.tipeUnit == "jagoan") {
if (levelKe >= 29) {
baseMusuh = baseMusuh - (this.damage / 2);
} else {
baseMusuh = baseMusuh - this.damage;
}
minimap_mc.base2.gotoAndStop(2);
baseMusuh = Math.ceil(baseMusuh);
} else if (this.tipeUnit == "musuh") {
if (levelKe >= 29) {
baseJagoan = baseJagoan - (this.damage / 2);
} else {
baseJagoan = baseJagoan - this.damage;
}
minimap_mc.base1.gotoAndStop(2);
baseJagoan = Math.ceil(baseJagoan);
}
}
if ((this.tipeUnit == "jagoan") || (this.tipeUnit == "tower_jagoan")) {
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerMusuh" + i])) {
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa - this.damage;
}
}
i++;
}
} else if ((this.tipeUnit == "musuh") || (this.tipeUnit == "tower_musuh")) {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerJagoan" + i])) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa - this.damage;
}
}
i++;
}
}
}
}
}
function cekGranat(indi, indi2, indi3, indi4, indi5) {
if (indi3 == "mortar") {
granat = attachMovie("mortar_mc", "peluru_mc" + dalamPeluru, dalamPeluru);
} else {
granat = attachMovie("granat_mc", "peluru_mc" + dalamPeluru, dalamPeluru);
}
granat.cacheAsBitmap = true;
if (indi3 == "mortar") {
if (indi.tipeUnit == "tower_jagoan") {
granat._x = (background_mc._x + indi._x) + 20;
} else if (indi.tipeUnit == "tower_musuh") {
granat._x = (background_mc._x + indi._x) - 20;
} else if (indi.tipeUnit == "jagoan") {
granat._x = indi._x + 10;
} else if (indi.tipeUnit == "musuh") {
granat._x = indi._x - 10;
}
granat._y = indi._y - 40;
granat.turun = 1;
} else if (indi3 == "granat") {
if ((indi.tipeUnit == "tower_jagoan") || (indi.tipeUnit == "tower_musuh")) {
granat._x = background_mc._x + indi._x;
} else {
granat._x = indi._x;
}
granat._y = indi._y - 50;
granat.turun = 1.5;
}
if (indi4 != undefined) {
granat._x = indi._x + indi4;
granat._y = indi._y + indi5;
granat.damage = indi.damage * 3;
} else {
granat.damage = indi.damage;
}
granat._xscale = 35;
granat._yscale = 35;
granat.indi = indi;
if ((((indi.xtarget.tipeUnit == "tower_jagoan") || (indi.xtarget.tipeUnit == "tower_musuh")) || (indi.xtarget.tipeUnit == "lain")) || (indi2 == "base")) {
wjarak = Math.abs((indi.xtarget._x + background_mc._x) - indi._x);
granat.bawah = indi._y + 10;
} else {
wjarak = Math.abs(indi.xtarget._x - indi._x);
if ((indi.tipeUnit == "tower_jagoan") || (indi.tipeUnit == "tower_musuh")) {
granat.bawah = indi._y + 10;
} else {
granat.bawah = indi._y;
}
}
if (indi3 == "mortar") {
if (wjarak >= 500) {
penurunan = 0;
} else if (wjarak >= 400) {
penurunan = 3;
} else if (wjarak >= 300) {
penurunan = 6;
} else if (wjarak >= 200) {
penurunan = 8;
} else if (wjarak >= 100) {
penurunan = 10;
} else if (wjarak >= 50) {
penurunan = 12;
} else {
penurunan = 14;
}
} else if (indi3 == "granat") {
if (wjarak >= 350) {
xpenurunan = 0;
granat.turun = granat.turun + 0;
} else if (wjarak >= 250) {
xpenurunan = 1.5;
granat.turun = granat.turun + 0.5;
} else if (wjarak >= 150) {
xpenurunan = 3;
granat.turun = granat.turun + 1;
} else if (wjarak >= 50) {
xpenurunan = 4.5;
granat.turun = granat.turun + 1.5;
} else if (wjarak >= 25) {
xpenurunan = 6;
granat.turun = granat.turun + 2;
} else {
xpenurunan = 7.5;
granat.turun = granat.turun + 2.5;
}
}
if ((indi.tipeUnit == "jagoan") || (indi.tipeUnit == "tower_jagoan")) {
if (indi3 == "mortar") {
granat.speedX = (random(2) + 15) - penurunan;
granat.speedY = random(2) + 16;
granat.tipeUnit = "jagoan";
} else if (indi3 == "granat") {
granat.speedX = (random(2) + 23) - xpenurunan;
granat.speedY = (random(2) + 9) - xpenurunan;
granat.tipeUnit = "jagoan";
}
} else if ((indi.tipeUnit == "musuh") || (indi.tipeUnit == "tower_musuh")) {
if (indi3 == "mortar") {
granat.speedX = ((-random(2)) - 15) + penurunan;
granat.speedY = random(2) + 16;
granat.tipeUnit = "musuh";
} else if (indi3 == "granat") {
granat.speedX = ((-random(2)) - 23) + xpenurunan;
granat.speedY = (random(2) + 9) - xpenurunan;
granat.tipeUnit = "musuh";
}
}
if (indi.jenis == 15) {
granat.speedX = granat.speedX * 1.25;
}
if (indi2 == "base") {
granat.speedX = granat.speedX * 1.25;
granat.bawah = indi._y - 50;
granat.serangBase = true;
} else {
granat.serangBase = false;
}
granat.cekMeledak = false;
granat.onEnterFrame = enterGranat;
dalamPeluru++;
if (dalamPeluru >= 52100) {
dalamPeluru = 52000;
}
}
function enterGranat() {
if (sedangPause == false) {
this._x = this._x + speedGame;
this._x = this._x + this.speedX;
this._y = this._y - this.speedY;
this.speedY = this.speedY - this.turun;
this._rotation = this._rotation + this.speedY;
if (this._y >= this.bawah) {
if (this.speedY <= 0) {
this._y = this.bawah;
this.cekMeledak = true;
}
}
if (this.serangBase == false) {
if (this.hitTest(this.indi.xtarget)) {
this.cekMeledak = true;
if (this.indi.xtarget.tipeUnit == "lain") {
this.indi.xtarget.nyawa = this.indi.xtarget.nyawa - this.damage;
}
}
if (this.cekMeledak == true) {
if (this._currentframe == 1) {
this.gotoAndStop(2);
cekEfek(this, "granat", this.bawah);
if ((this.tipeUnit == "jagoan") || (this.tipeUnit == "tower_jagoan")) {
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerMusuh" + i])) {
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa - this.damage;
}
}
i++;
}
} else if ((this.tipeUnit == "musuh") || (this.tipeUnit == "tower_musuh")) {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerJagoan" + i])) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa - this.damage;
}
}
i++;
}
}
}
}
} else if (this.cekMeledak == true) {
if (this._currentframe == 1) {
this.gotoAndStop(2);
cekEfek(this, "granat", this.bawah);
if (this.tipeUnit == "jagoan") {
if (levelKe >= 29) {
baseMusuh = baseMusuh - (this.damage / 2);
} else {
baseMusuh = baseMusuh - this.damage;
}
minimap_mc.base2.gotoAndStop(2);
baseMusuh = Math.ceil(baseMusuh);
} else if (this.tipeUnit == "musuh") {
if (levelKe >= 29) {
baseJagoan = baseJagoan - (this.damage / 2);
} else {
baseJagoan = baseJagoan - this.damage;
}
minimap_mc.base1.gotoAndStop(2);
baseJagoan = Math.ceil(baseJagoan);
}
}
if ((this.tipeUnit == "jagoan") || (this.tipeUnit == "tower_jagoan")) {
i = 2000;
while (i <= 2030) {
if ((_root["musuh_mc" + i]._x != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerMusuh) {
if ((background_mc["towerMusuh" + i]._x != undefined) && (background_mc["towerMusuh" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerMusuh" + i])) {
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa - this.damage;
}
}
i++;
}
} else if ((this.tipeUnit == "musuh") || (this.tipeUnit == "tower_musuh")) {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
if (this.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - this.damage;
}
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
if (this.hitTest(background_mc["towerJagoan" + i])) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa - this.damage;
}
}
i++;
}
}
}
}
}
function cekEfek(indi, indi2, indi3, indi4) {
if (adaEfekKah == true) {
backLedak();
if (indi2 == "granat") {
efek_mc = attachMovie("efek2", "efek_mc" + dalamEfek, dalamEfek);
efek_mc.cacheAsBitmap = true;
efek_mc._x = indi._x;
efek_mc._y = indi._y;
efek_mc.onEnterFrame = enterEfekGranat;
dalamEfek++;
if (dalamEfek >= 55200) {
dalamEfek = 55000;
}
efek_mc = attachMovie("retak_mc", "efek_mc" + dalamEfek4, dalamEfek4);
efek_mc.cacheAsBitmap = true;
efek_mc._x = (indi._x + random(20)) - 10;
efek_mc._y = indi3;
efek_mc.onEnterFrame = enterEfekGranat;
dalamEfek4++;
if (dalamEfek4 >= 250) {
dalamEfek4 = 200;
}
} else if (indi2 == "misil") {
efek_mc = attachMovie("efek4", "efek_mc" + dalamEfek, dalamEfek);
efek_mc.cacheAsBitmap = true;
efek_mc._x = indi._x;
efek_mc._y = indi._y;
if (indi4 == "misil2") {
efek_mc._xscale = 200;
efek_mc._yscale = 200;
}
efek_mc.onEnterFrame = enterEfekGranat;
dalamEfek++;
if (dalamEfek >= 55200) {
dalamEfek = 55000;
}
efek_mc = attachMovie("retak_mc", "efek_mc" + dalamEfek4, dalamEfek4);
efek_mc.cacheAsBitmap = true;
efek_mc._x = (indi._x + random(20)) - 10;
efek_mc._y = indi3;
efek_mc.onEnterFrame = enterEfekGranat;
dalamEfek4++;
if (dalamEfek4 >= 250) {
dalamEfek4 = 200;
}
}
}
}
function cekEfekLedak(indi, indi2) {
if (adaEfekKah == true) {
backLedak();
if (indi2 == 1) {
efek_mc2 = attachMovie("efek6", "efek_mc" + dalamEfek2, dalamEfek2);
efek_mc2.cacheAsBitmap = true;
efek_mc2._x = indi._x;
efek_mc2._y = indi._y - 10;
efek_mc2._xscale = (efek_mc2._yscale = 150);
efek_mc2.indi4 = indi4;
efek_mc2.onEnterFrame = enterEfekGranat;
dalamEfek2++;
if (dalamEfek2 >= 55200) {
dalamEfek2 = 55000;
}
} else if (indi2 == 2) {
efek_mc2 = attachMovie("efek6", "efek_mc" + dalamEfek2, dalamEfek2);
efek_mc2.cacheAsBitmap = true;
efek_mc2._x = indi._x + background_mc._x;
efek_mc2._y = (indi._y + background_mc._y) - 20;
efek_mc2._xscale = (efek_mc2._yscale = 150);
efek_mc2.indi4 = indi4;
efek_mc2.onEnterFrame = enterEfekGranat;
dalamEfek2++;
if (dalamEfek2 >= 55200) {
dalamEfek2 = 55000;
}
}
}
}
function cekEfekBomb(indi) {
if (adaEfekKah == true) {
backLedak();
efek_mc2 = attachMovie("efek1", "efek_mc" + dalamEfek2, dalamEfek2);
efek_mc2.cacheAsBitmap = true;
efek_mc2._x = indi._x;
efek_mc2._y = indi._y - 10;
efek_mc2._xscale = (efek_mc2._yscale = 150);
efek_mc2.indi4 = indi4;
efek_mc2.onEnterFrame = enterEfekGranat;
dalamEfek2++;
if (dalamEfek2 >= 55200) {
dalamEfek2 = 55000;
}
}
}
function cekEfek2(indi, indi2, indi3, indi4, indi5) {
if (adaEfekKah == true) {
if (indi == "gun") {
if (indi5 == "base") {
efek_mc2 = attachMovie("efekGun", "efek_mc" + dalamEfek4, dalamEfek4);
efek_mc2.cacheAsBitmap = true;
efek_mc2._x = indi2;
efek_mc2._y = indi3;
efek_mc2._rotation = random(360);
efek_mc2.indi4 = indi4;
efek_mc2.onEnterFrame = enterEfekGun2;
dalamEfek4++;
if (dalamEfek4 >= 250) {
dalamEfek4 = 200;
}
} else {
efek_mc2 = indi4.attachMovie("efekGun", "efek_mc" + dalamEfek3, dalamEfek3);
efek_mc2.cacheAsBitmap = true;
jedaX = indi2 - indi4._x;
jedaY = indi3 - indi4._y;
efek_mc2._x = jedaX;
efek_mc2._y = jedaY - 15;
efek_mc2._rotation = random(360);
efek_mc2.indi4 = indi4;
efek_mc2.onEnterFrame = enterEfekGun;
dalamEfek3++;
if (dalamEfek3 >= 50) {
dalamEfek3 = 1;
}
}
} else if (indi == "darah") {
efek_mc2 = attachMovie("efekDarah", "efek_mc" + dalamEfek2, dalamEfek2);
efek_mc2.cacheAsBitmap = true;
efek_mc2._x = indi2;
efek_mc2._y = indi3;
efek_mc2._rotation = random(360);
efek_mc2.onEnterFrame = enterEfekGranat;
dalamEfek2++;
if (dalamEfek2 >= 51200) {
dalamEfek2 = 51000;
}
}
}
}
function enterEfekGun() {
if (sedangPause == false) {
if (this.indi4.nyawa <= 0) {
removeMovieClip(this);
}
}
}
function enterEfekGun2() {
if (sedangPause == false) {
this._x = this._x + speedGame;
if (this.indi4.bentengx._currentframe == 2) {
removeMovieClip(this);
} else if (this.indi4._currentframe == 2) {
removeMovieClip(this);
}
}
}
function enterEfekGranat() {
if (sedangPause == false) {
this._x = this._x + speedGame;
}
}
function cekEfekPeluru(indi, indi2, indi3, indi4) {
if (adaEfekKah == true) {
efek_mc = _root.createEmptyMovieClip("efek_mc" + dalamEfek, dalamEfek);
efek_mc.cacheAsBitmap = true;
if (indi4 != undefined) {
if (indi.tipeUnit == "tower_jagoan") {
efek_mc.lineStyle(1, 65280, 50);
efek_mc.moveTo((indi._x + background_mc._x) + indi3, (indi._y + background_mc._y) + indi4);
} else if (indi.tipeUnit == "tower_musuh") {
efek_mc.lineStyle(1, 16711680, 50);
efek_mc.moveTo((indi._x + background_mc._x) + indi3, (indi._y + background_mc._y) + indi4);
} else if (indi.tipeUnit == "jagoan") {
efek_mc.lineStyle(1, 65280, 50);
efek_mc.moveTo(indi._x + indi3, indi._y + indi4);
} else if (indi.tipeUnit == "musuh") {
efek_mc.lineStyle(1, 16711680, 50);
efek_mc.moveTo(indi._x + indi3, indi._y + indi4);
}
} else if (indi.tipeUnit == "tower_musuh") {
if (indi.tiarap == true) {
efek_mc.lineStyle(1, 16711680, 50);
efek_mc.moveTo((indi._x + background_mc._x) - 45, (indi._y + background_mc._y) - 12);
} else {
efek_mc.lineStyle(1, 16711680, 50);
efek_mc.moveTo((indi._x + background_mc._x) - 30, (indi._y + background_mc._y) - 50);
}
} else if (indi.tipeUnit == "tower_jagoan") {
if (indi.tiarap == true) {
efek_mc.lineStyle(1, 65280, 50);
efek_mc.moveTo((indi._x + background_mc._x) + 45, (indi._y + background_mc._y) - 12);
} else {
efek_mc.lineStyle(1, 65280, 50);
efek_mc.moveTo((indi._x + background_mc._x) + 30, (indi._y + background_mc._y) - 50);
}
} else if (indi.tipeUnit == "jagoan") {
if (indi.tiarap == true) {
efek_mc.lineStyle(1, 65280, 50);
efek_mc.moveTo(indi._x + 50, indi._y - 10);
} else {
efek_mc.lineStyle(1, 65280, 50);
efek_mc.moveTo(indi._x + 30, indi._y - 43);
}
} else if (indi.tipeUnit == "musuh") {
if (indi.tiarap == true) {
efek_mc.lineStyle(1, 16711680, 50);
efek_mc.moveTo(indi._x - 45, indi._y - 5);
} else {
efek_mc.lineStyle(1, 16711680, 50);
efek_mc.moveTo(indi._x - 30, indi._y - 43);
}
}
randEfek = random(10) - 5;
randX = random(100) - 50;
randX2 = random(70) - 35;
if (indi2 == 1) {
if (indi.xtarget.tipeUnit == "tower_musuh") {
efek_mc.lineTo(background_mc._x + indi.xtarget._x, ((indi.xtarget._y + background_mc._y) - 30) + randEfek);
if (indi.xtarget._currentframe <= 9) {
cekEfek2("darah", background_mc._x + indi.xtarget._x, ((indi.xtarget._y + background_mc._y) - 30) + randEfek);
} else {
cekEfek2("gun", background_mc._x + indi.xtarget._x, ((indi._y + background_mc._y) - 30) + randEfek, indi.xtarget, "base");
}
} else if (indi.xtarget.tipeUnit == "tower_jagoan") {
efek_mc.lineTo(background_mc._x + indi.xtarget._x, ((indi.xtarget._y + background_mc._y) - 30) + randEfek);
if (indi.xtarget._currentframe <= 9) {
cekEfek2("darah", background_mc._x + indi.xtarget._x, ((indi.xtarget._y + background_mc._y) - 30) + randEfek);
} else {
cekEfek2("gun", background_mc._x + indi.xtarget._x, ((indi._y + background_mc._y) - 30) + randEfek, indi.xtarget, "base");
}
} else if (indi.xtarget.tipeUnit == "lain") {
efek_mc.lineTo((background_mc._x + indi.xtarget._x) + randX2, ((indi._y + background_mc._y) - 20) + randEfek);
cekEfek2("gun", (background_mc._x + indi.xtarget._x) + randX2, ((indi._y + background_mc._y) - 20) + randEfek, indi.xtarget, "base");
} else if (indi.xtarget.besar == true) {
efek_mc.lineTo(indi.xtarget._x + randX, (indi.xtarget._y - 40) + randEfek);
cekEfek2("gun", indi.xtarget._x + randX, (indi.xtarget._y - 40) + randEfek, indi.xtarget);
} else if (indi.xtarget._x != undefined) {
if (indi.xtarget.tiarap == true) {
efek_mc.lineTo(indi.xtarget._x, indi.xtarget._y);
cekEfek2("darah", indi.xtarget._x, indi.xtarget._y);
} else {
efek_mc.lineTo(indi.xtarget._x, (indi.xtarget._y - 30) + randEfek);
cekEfek2("darah", indi.xtarget._x, (indi.xtarget._y - 30) + randEfek);
}
}
} else if (indi2 == 2) {
if (indi.tipeUnit == "jagoan") {
if (indi.terbang == true) {
efek_mc.lineTo(((background_mc._x + indi.xtarget._x) + 140) + randX, ((indi._y + background_mc._y) + 0) + randEfek);
cekEfek2("gun", ((background_mc._x + indi.xtarget._x) + 140) + randX, ((indi._y + background_mc._y) + 0) + randEfek, indi.xtarget, "base");
} else {
efek_mc.lineTo(((background_mc._x + indi.xtarget._x) + 140) + randX, ((indi._y + background_mc._y) - 30) + randEfek);
cekEfek2("gun", ((background_mc._x + indi.xtarget._x) + 140) + randX, ((indi._y + background_mc._y) - 30) + randEfek, indi.xtarget, "base");
}
} else if (indi.tipeUnit == "musuh") {
if (indi.terbang == true) {
efek_mc.lineTo(((background_mc._x + indi.xtarget._x) - 140) + randX, ((indi._y + background_mc._y) - 0) + randEfek);
cekEfek2("gun", ((background_mc._x + indi.xtarget._x) - 140) + randX, ((indi._y + background_mc._y) - 0) + randEfek, indi.xtarget, "base");
} else {
efek_mc.lineTo(((background_mc._x + indi.xtarget._x) - 140) + randX, ((indi._y + background_mc._y) - 30) + randEfek);
cekEfek2("gun", ((background_mc._x + indi.xtarget._x) - 140) + randX, ((indi._y + background_mc._y) - 30) + randEfek, indi.xtarget, "base");
}
}
}
efek_mc.onEnterFrame = enterEfek;
dalamEfek++;
if (dalamEfek >= 55200) {
dalamEfek = 55000;
}
}
}
function enterEfek() {
if (sedangPause == false) {
this._x = this._x + speedGame;
this._alpha = this._alpha - 25;
if (this._alpha <= 0) {
removeMovieClip(this);
}
}
}
function cekPecah(indi) {
if (adaEfekKah == true) {
if (indi.jenis == 15) {
randBanyak = random(3) + 7;
} else if ((indi.jenis >= 13) && (indi.jenis <= 14)) {
randBanyak = random(3) + 6;
} else {
randBanyak = random(3) + 5;
}
w = 1;
while (w <= randBanyak) {
randPecah = random(5) + 1;
efek_mc = attachMovie("pecah" + randPecah, "efek_mc" + dalamEfek, dalamEfek);
efek_mc.cacheAsBitmap = true;
efek_mc._x = (indi._x + random(100)) - 50;
efek_mc._y = indi._y - 50;
efek_mc.turun = 1;
efek_mc.xdelay = random(45) + 45;
efek_mc.jatuh = false;
if (indi.terbang == true) {
efek_mc.bawah = indi._y + 10;
} else {
efek_mc.bawah = indi._y - 7.5;
}
efek_mc.speedX = random(10) - 5;
efek_mc.speedY = random(10) + 5;
efek_mc.onEnterFrame = enterPecah;
dalamEfek++;
if (dalamEfek >= 55200) {
dalamEfek = 55000;
}
w++;
}
}
}
function enterPecah() {
if (sedangPause == false) {
this._x = this._x + speedGame;
if (this.jatuh == false) {
this.play();
this._x = this._x - this.speedX;
this._y = this._y - this.speedY;
this.speedY = this.speedY - this.turun;
this._rotation = this._rotation + this.speedY;
} else {
this._rotation = 0;
this.gotoAndStop(1);
this.xdelay--;
if (this.xdelay <= 0) {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
removeMovieClip(this);
}
}
}
this.sudahJatuh = true;
if (this.hitTest(background_mc.rapuh1.indi) && (this._y >= background_mc.rapuh1._y)) {
this._y = background_mc.rapuh1._y;
} else if (this.hitTest(background_mc.rapuh2.indi) && (this._y >= background_mc.rapuh2._y)) {
this._y = background_mc.rapuh2._y;
} else if (this.hitTest(background_mc.rapuh3.indi) && (this._y >= background_mc.rapuh3._y)) {
this._y = background_mc.rapuh3._y;
} else if (this.hitTest(background_mc.rapuh4.indi) && (this._y >= background_mc.rapuh4._y)) {
this._y = background_mc.rapuh4._y;
} else if (this.hitTest(background_mc.rapuh5.indi) && (this._y >= background_mc.rapuh5._y)) {
this._y = background_mc.rapuh5._y;
} else if (this.hitTest(background_mc.rapuh6.indi) && (this._y >= background_mc.rapuh6._y)) {
this._y = background_mc.rapuh6._y;
} else if (this.hitTest(background_mc.rel6.indi) && (this._y >= background_mc.rel6._y)) {
this._y = background_mc.rel6._y;
} else if (this.hitTest(background_mc.rel5.indi) && (this._y >= background_mc.rel5._y)) {
this._y = background_mc.rel5._y;
} else if (this.hitTest(background_mc.rel4.indi) && (this._y >= background_mc.rel4._y)) {
this._y = background_mc.rel4._y;
} else if (this.hitTest(background_mc.rel3.indi) && (this._y >= background_mc.rel3._y)) {
this._y = background_mc.rel3._y;
} else if (this.hitTest(background_mc.rel2.indi) && (this._y >= background_mc.rel2._y)) {
this._y = background_mc.rel2._y;
} else if (this.hitTest(background_mc.rel1.indi) && (this._y >= background_mc.rel1._y)) {
this._y = background_mc.rel1._y;
} else if (this.hitTest(background_mc.rel0.indi) && (this._y >= background_mc.rel0._y)) {
this._y = background_mc.rel0._y;
} else {
this.sudahJatuh = false;
}
if (this._y >= this.bawah) {
if (this.sudahJatuh == true) {
if (this.speedY <= 0) {
if (this.jatuh == false) {
this.jatuh = true;
this.stop();
}
}
}
}
}
}
function cekGesek(indi, indi2, indi3, indi4) {
if (adaEfekKah == true) {
if (indi3 == "debu") {
efek_mc2 = attachMovie("efekDebu", "efek_mc" + dalamEfek, dalamEfek);
} else {
efek_mc2 = attachMovie("efekGesek", "efek_mc" + dalamEfek, dalamEfek);
}
efek_mc2.cacheAsBitmap = true;
if (indi4 != undefined) {
efek_mc2._x = background_mc._x + indi._x;
efek_mc2._y = (background_mc._y + indi._y) + 25;
} else {
efek_mc2._x = indi._x;
efek_mc2._y = indi._y;
}
if (indi3 == "debu") {
efek_mc2._xscale = 35;
efek_mc2._yscale = 35;
efek_mc2._y = efek_mc2._y - 2.5;
} else if (indi2 == "jagoan") {
efek_mc2._xscale = 100;
} else if (indi2 == "musuh") {
efek_mc2._xscale = -100;
}
if (indi4 != undefined) {
efek_mc2._xscale = 150;
efek_mc2._yscale = 150;
}
efek_mc2.onEnterFrame = enterEfekGranat;
dalamEfek++;
if (dalamEfek >= 55200) {
dalamEfek = 55000;
}
if (indi3 != "debu") {
randBanyak = random(2) + 3;
w = 1;
while (w <= randBanyak) {
randPecah = random(5) + 1;
efek_mc = attachMovie("pecah" + randPecah, "efek_mc" + dalamEfek, dalamEfek);
efek_mc.cacheAsBitmap = true;
efek_mc._x = (indi._x + random(100)) - 50;
efek_mc._y = indi._y - 50;
efek_mc.turun = 1;
efek_mc.xdelay = random(45) + 45;
efek_mc.jatuh = false;
efek_mc.bawah = indi._y - 7.5;
efek_mc.speedX = random(10) - 5;
efek_mc.speedY = random(10) + 5;
efek_mc.onEnterFrame = enterPecah;
dalamEfek++;
if (dalamEfek >= 55200) {
dalamEfek = 55000;
}
w++;
}
}
}
}
function moveCastle(indi) {
if ((sedangPause == false) || (tutorialWar == false)) {
if (indi == 0) {
if (background_mc._x < 0) {
geserBerapa = background_mc._x;
background_mc._x = background_mc._x - geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x - geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x - geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x - geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX - geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
}
} else if (indi == 2) {
if (background_mc._x > -2400) {
geserBerapa = -2400 - background_mc._x;
background_mc._x = background_mc._x + geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x + geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x + geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x + geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX + geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
}
} else if (indi == 3) {
if (background_mc._x < 0) {
geserBerapa = background_mc._x + 1200;
background_mc._x = background_mc._x - geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x - geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x - geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x - geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX - geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
} else if (background_mc._x > -2400) {
geserBerapa = -1200 - background_mc._x;
background_mc._x = background_mc._x + geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x + geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x + geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x + geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX + geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
}
}
}
}
function clearSemua() {
clearInterval(idLanjut);
removeListener(myListener);
delete myListener.onKeyUp;
delete myListener.onKeyDown;
delete _root.onEnterFrame;
delete _root.onMouseDown;
removeMovieClip(selesai_mc);
removeMovieClip(background_mc);
removeMovieClip(ui_mc);
removeMovieClip(target_mc);
removeMovieClip(go_mc);
removeMovieClip(menu_mc);
removeMovieClip(tutorial_mc);
removeMovieClip(radar_mc);
removeMovieClip(minimap_mc);
removeMovieClip(menu_mc);
removeMovieClip(info_box);
i = 1;
while (i <= bykTowerMusuh) {
removeMovieClip(_root["titikMerah_mc" + i]);
i++;
}
i = 2000;
while (i <= 2030) {
removeMovieClip(_root["titikMerah_mc" + i]);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
removeMovieClip(_root["titikHijau_mc" + i]);
i++;
}
i = 1000;
while (i <= 1030) {
removeMovieClip(_root["titikHijau_mc" + i]);
i++;
}
i = 1;
while (i <= 4) {
removeMovieClip(_root["tanda_mc" + i]);
i++;
}
i = 1000;
while (i <= 1030) {
removeMovieClip(_root["jagoan_mc" + i]);
i++;
}
i = 2000;
while (i <= 2030) {
removeMovieClip(_root["musuh_mc" + i]);
i++;
}
i = 52000;
while (i <= 52100) {
removeMovieClip(_root["peluru_mc" + i]);
i++;
}
i = 55000;
while (i <= 55200) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
i = 51000;
while (i <= 51200) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
i = 200;
while (i <= 250) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
}
function cekKalah() {
if (sudahSelesai == false) {
sudahSelesai = true;
kondisiSelesai = "kalah";
buatSelesai("kalah");
}
}
function cekMenang() {
if (sudahSelesai == false) {
sudahSelesai = true;
kondisiSelesai = "menang";
buatSelesai("menang");
}
}
function buatSelesai(indi) {
if (cekSurrender == true) {
xinfo = "Mission aborted!";
} else if (indi == "kalah") {
xinfo = "Your base destroyed, mission failed!";
} else if (indi == "menang") {
xinfo = "Enemy base destroyed, mission accomplished!";
}
selesai_mc = attachMovie("selesai_mc", "selesai_mc", dalamSelesai);
selesai_mc.cacheAsBitmap = true;
selesai_mc._x = 400;
selesai_mc._y = 300;
selesai_mc.info_mc.gotoAndPlay(2);
selesai_mc.info_mc.informasi = xinfo;
idLanjut = setInterval(cekLanjutGame, 8000);
}
function cekLanjutGame() {
backWin();
clearInterval(idLanjut);
clearInterval(idDelay1);
selisihx = 5 * (unitMati2 - unitMati1);
selisihx = Math.ceil(selisihx);
if (selisihx <= 5) {
selisihx = 5;
}
persenx = Math.ceil((baseJagoan / maxBaseJagoan) * 100);
tambahMoney = 0;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
if (_root["jagoan_mc" + i].nyawa > 0) {
tambahMoney = tambahMoney + daftarHarga[_root["jagoan_mc" + i].jenis];
}
}
i++;
}
wunit1 = unitMati1;
wbuildings1 = buildingMati1;
wunit2 = unitMati2;
wbuildings2 = buildingMati2;
wbase = baseJagoan;
if (kondisiSelesai == "menang") {
wmoney = Math.ceil((tambahMoney * 1) + (levelKe * 50)) + (100 * (levelSkill[14] - 1));
wexp = Math.ceil(((selisihx + persenx) * levelKe) * 1) + (250 * (levelSkill[15] - 1));
} else {
wmoney = Math.ceil((tambahMoney * 1) + (levelKe * 25)) + (50 * (levelSkill[14] - 1));
wexp = Math.ceil(((selisihx + persenx) * levelKe) * 0.5) + (250 * (levelSkill[15] - 1));
}
wmoney = wmoney + selisihx;
wexp = wexp + selisihx;
wmoney = wmoney * 0.8;
wexp = wexp * 7.5;
wmoney = Math.ceil(wmoney);
wexp = Math.ceil(wexp);
tidakDapat = false;
if (kondisiSelesai == "kalah") {
if ((cekSurrender == true) || (unitMati1 <= 10)) {
tidakDapat = true;
wmoney = 0;
wexp = 0;
}
}
if (tidakDapat == true) {
money1 = uangAwal;
xexp = xexp + wexp;
} else {
money1 = money1 + wmoney;
xexp = xexp + wexp;
}
clearSemua();
if (kondisiSelesai == "menang") {
_root["kotaSudahMenang" + levelKe] = true;
pilhanLevel++;
if (pilhanLevel >= 19) {
backWin();
gotoAndStop (224);
} else {
backWin();
gotoAndStop (222);
}
} else {
backLose();
gotoAndStop (223);
}
}
stop();
removeMovieClip(menu_mc);
backMain();
init();
buatUI();
buatBackground();
buatTanda();
buatMinimap();
if (tutorialWar == false) {
sedangPause = true;
tutorial = attachMovie("tutorial_mc", "tutorial_mc", 310000);
tutorial._x = 400;
tutorial._y = 270;
i = 1;
while (i <= 43) {
ui_mc["frame" + i].enabled = false;
i++;
}
i = 1;
while (i <= 8) {
ui_mc["tipe" + i].enabled = false;
i++;
}
i = 1;
while (i <= 8) {
ui_mc["supported" + i].enabled = false;
i++;
}
ui_mc.menu_btn.enabled = false;
tutorial.next_btn.onRelease = function () {
if (tutorial_mc._currentframe < 9) {
tutorial_mc.gotoAndStop(tutorial_mc._currentframe + 1);
if (tutorial_mc._currentframe == 6) {
moveCastle(0);
}
} else {
tutorialWarSelesai();
}
};
} else {
tutorialWarSelesai();
}
_root.onEnterFrame = function () {
money1 = Math.ceil(money1);
money2 = Math.ceil(money2);
if (money1 <= 0) {
money1 = 0;
}
if (money2 <= 0) {
money2 = 0;
}
baseJagoan = Math.ceil(baseJagoan);
baseMusuh = Math.ceil(baseMusuh);
if (baseJagoan <= 0) {
baseJagoan = 0;
minimap_mc.base1._visible = false;
} else {
minimap_mc.base1._visible = true;
}
if (baseMusuh <= 0) {
baseMusuh = 0;
minimap_mc.base2._visible = false;
} else {
minimap_mc.base2._visible = true;
}
ui_mc.xlevel = "Level: " + levelKe;
if (tingkatSulit == 1) {
ui_mc.xtingkatSulit = "Easy";
} else if (tingkatSulit == 2) {
ui_mc.xtingkatSulit = "Normal";
} else if (tingkatSulit == 3) {
ui_mc.xtingkatSulit = "Hard";
}
ui_mc.money1 = "Fund: " + money1;
ui_mc.money2 = "Fund: " + money2;
ui_mc.base1 = "Base: " + baseJagoan;
ui_mc.base2 = "Base: " + baseMusuh;
ui_mc.unit1 = (("Unit: " + banyakJagoan) + "/") + bykPasukan1;
ui_mc.unit2 = (("Unit: " + banyakMusuh) + "/") + bykPasukan2;
background_mc.benteng1.bar_mc.bar._xscale = (baseJagoan / maxBaseJagoan) * 100;
background_mc.benteng2.bar_mc.bar._xscale = (baseMusuh / maxBaseMusuh) * 100;
if ((tutorialWar == false) && (tutorial_mc._currentframe != 6)) {
if ((jalanKiri == true) && (background_mc._x <= -15)) {
speedGame = 15;
} else if ((jalanKanan == true) && (background_mc._x > -2400)) {
speedGame = -15;
} else if ((_root._xmouse <= 30) && (background_mc._x <= -15)) {
speedGame = 15;
} else if ((_root._xmouse >= 770) && (background_mc._x > -2400)) {
speedGame = -15;
} else {
speedGame = 0;
}
background_mc._x = background_mc._x + speedGame;
}
if (sedangPause == false) {
if ((jalanKiri == true) && (background_mc._x <= -15)) {
speedGame = 15;
} else if ((jalanKanan == true) && (background_mc._x > -2400)) {
speedGame = -15;
} else if ((_root._xmouse <= 30) && (background_mc._x <= -15)) {
speedGame = 15;
} else if ((_root._xmouse >= 770) && (background_mc._x > -2400)) {
speedGame = -15;
} else {
speedGame = 0;
}
background_mc._x = background_mc._x + speedGame;
if (sudahSelesai == false) {
if (maxMusuhTower != 0) {
if (delayBuatMusuhTower >= maxBuatMusuhTower) {
wi = maxMusuhTower;
while (wi >= minMusuhTower) {
if (_root["bisaUnitMusuh" + wi] == true) {
if (money2 >= daftarHarga[wi]) {
xpilihPasukan = wi;
zzi = 1;
while (zzi <= bykTowerMusuh) {
if (money2 >= daftarHarga[xpilihPasukan]) {
if (background_mc["towerMusuh" + zzi]._currentframe <= jenisPasukanTower[xpilihPasukan - 25]) {
money2 = money2 - daftarHarga[xpilihPasukan];
jenisPasukanMusuh = jenisPasukanTower[xpilihPasukan - 25];
indi1 = background_mc["towerMusuh" + zzi];
indi2 = background_mc["towerMusuh" + zzi].jenis;
indi3 = background_mc["towerMusuh" + zzi]._currentframe;
if (background_mc["towerMusuh" + zzi].troop._currentframe != 3) {
banyakMusuh--;
buatMusuhTower(zzi, jenisPasukanMusuh);
if (indi3 <= 9) {
buatMusuh2(indi1, indi2);
}
} else {
buatMusuhTower(zzi, jenisPasukanMusuh);
}
delayBuatMusuhTower = 0;
wi = minMusuhTower;
}
}
zzi++;
}
}
}
wi--;
}
} else {
delayBuatMusuhTower++;
}
}
if (maxMusuhStrike != 0) {
if (delayBuatMusuhStrike >= maxBuatMusuhStrike) {
wi = maxMusuhStrike;
while (wi >= minMusuhStrike) {
if (_root["bisaUnitMusuh" + wi] == true) {
if (money2 >= daftarHarga[wi]) {
adaStrike = false;
masukTarget = new Array();
keTarget = 0;
i = 1;
while (i <= bykTowerJagoan) {
if ((background_mc["towerJagoan" + i]._x != undefined) && (background_mc["towerJagoan" + i].nyawa > 0)) {
masukTarget[keTarget] = i;
keTarget++;
adaStrike = true;
}
i++;
}
if (keTarget > 0) {
randAmbil = random(keTarget);
keAmbil = masukTarget[randAmbil];
cekMisilStrike(wi, background_mc._x + background_mc["towerJagoan" + keAmbil]._x, background_mc._y + background_mc["towerJagoan" + keAmbil]._y, "jagoan");
}
if (adaStrike == false) {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i]._x != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
masukTarget[keTarget] = i;
keTarget++;
adaStrike = true;
}
i++;
}
if (keTarget > 0) {
randAmbil = random(keTarget);
keAmbil = masukTarget[randAmbil];
cekMisilStrike(wi, _root["jagoan_mc" + keAmbil]._x + 150, _root["jagoan_mc" + keAmbil]._y, "jagoan");
}
}
if (adaStrike == true) {
money2 = money2 - daftarHarga[wi];
delayBuatMusuhStrike = 0;
}
}
}
wi--;
}
} else {
delayBuatMusuhStrike++;
}
}
i = 2;
while (i <= 8) {
if (_root["bisaSupportMusuh" + i] == true) {
if (_root["kiniSupportMusuh" + i] >= _root["maxSupportMusuh" + i]) {
pilihSupportMusuh = i;
i = 8;
} else {
_root["kiniSupportMusuh" + i]++;
}
}
i++;
}
wi = maxMusuhTentara;
while (wi >= minMusuhTentara) {
if (_root["bisaUnitMusuh" + wi] == true) {
if (_root["startBuatMusuh" + wi] == false) {
if (money2 >= daftarHarga[wi]) {
money2 = money2 - daftarHarga[wi];
_root["startBuatMusuhSupport" + wi] = pilihSupportMusuh;
_root["startBuatMusuh" + wi] = true;
pilihSupportMusuh = 0;
}
}
if (_root["startBuatMusuh" + wi] == true) {
if (_root["kiniBuatMusuh" + wi] >= _root["maxBuatMusuh" + wi]) {
_root["kiniBuatMusuh" + wi] = 0;
_root["startBuatMusuh" + wi] = false;
if (_root["startBuatMusuhSupport" + wi] == 0) {
buatMusuh(wi);
_root["startBuatMusuhSupport" + wi] = 0;
} else {
buatMusuh(wi, _root["startBuatMusuhSupport" + wi]);
_root["kiniSupportMusuh" + _root["startBuatMusuhSupport" + wi]] = 0;
_root["startBuatMusuhSupport" + wi] = 0;
}
} else {
_root["kiniBuatMusuh" + wi]++;
}
}
}
wi--;
}
if (baseJagoan <= 0) {
baseJagoan = 0;
background_mc.benteng1.bentengx.gotoAndStop(2);
siapaMenang = "musuh";
cekKalah();
} else if (baseMusuh <= 0) {
baseMusuh = 0;
background_mc.benteng2.bentengx.gotoAndStop(2);
siapaMenang = "jagoan";
cekMenang();
}
i = 1;
while (i <= 8) {
if (ui_mc["supported" + i].jeda_mc._currentframe == 1) {
ui_mc["supported" + i].enabled = true;
} else {
ui_mc["supported" + i].enabled = false;
}
i++;
}
}
if (tekanCtrl == true) {
sedangDrag = false;
removeMovieClip(go_mc);
removeMovieClip(supported_mc);
i = 1;
while (i <= 4) {
_root["tanda_mc" + i]._visible = false;
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
delete background_mc["towerJagoan" + i].onRelease;
background_mc["towerJagoan" + i].tanda_mc._visible = false;
i++;
}
stopDrag();
i = 1;
while (i <= 50) {
ui_mc["frame" + i].tanda_mc._visible = false;
i++;
}
}
}
};
_root.onMouseDown = function () {
if (_root._ymouse >= 140) {
if (sedangDrag == true) {
if (target_mc._x != undefined) {
cekMisilStrike(target_mc.jenis, _root._xmouse, _root._ymouse, "musuh");
sedangDrag = false;
removeMovieClip(go_mc);
removeMovieClip(target_mc);
stopDrag();
i = 1;
while (i <= bykTowerJagoan) {
delete background_mc["towerJagoan" + i].onRelease;
background_mc["towerJagoan" + i].tanda_mc._visible = false;
i++;
}
i = 1;
while (i <= 50) {
ui_mc["frame" + i].tanda_mc._visible = false;
i++;
}
if (ui_mc["frame" + target_mc.jenis].supported._visible == true) {
ui_mc["frame" + target_mc.jenis].sedangSupported = false;
}
}
}
} else {
sedangDrag = false;
removeMovieClip(go_mc);
removeMovieClip(target_mc);
stopDrag();
i = 1;
while (i <= bykTowerJagoan) {
delete background_mc["towerJagoan" + i].onRelease;
background_mc["towerJagoan" + i].tanda_mc._visible = false;
i++;
}
i = 1;
while (i <= 50) {
ui_mc["frame" + i].tanda_mc._visible = false;
i++;
}
}
};
myListener = new Object();
myListener.onKeyDown = function () {
if (Key.getCode() == 90) {
if ((tutorialWar == false) && (tutorial_mc._currentframe != 6)) {
moveCastle(0);
} else if (tutorialWar == true) {
moveCastle(0);
}
}
if (Key.getCode() == 67) {
if ((tutorialWar == false) && (tutorial_mc._currentframe != 6)) {
moveCastle(2);
} else if (tutorialWar == true) {
moveCastle(2);
}
}
if (Key.getCode() == 88) {
if ((tutorialWar == false) && (tutorial_mc._currentframe != 6)) {
moveCastle(3);
} else if (tutorialWar == true) {
moveCastle(3);
}
}
if (Key.getCode() == 49) {
sedangTekan = true;
if (((ui_mc["frame" + awalUnit].enabled == true) && (ui_mc["frame" + awalUnit]._visible == true)) && (ui_mc["gembok" + awalUnit]._visible == false)) {
klikUnit(ui_mc["frame" + awalUnit]);
}
}
if (Key.getCode() == 50) {
sedangTekan = true;
if (((ui_mc["frame" + (awalUnit + 1)].enabled == true) && (ui_mc["frame" + (awalUnit + 1)]._visible == true)) && (ui_mc["gembok" + (awalUnit + 1)]._visible == false)) {
klikUnit(ui_mc["frame" + (awalUnit + 1)]);
}
}
if (Key.getCode() == 51) {
sedangTekan = true;
if (((ui_mc["frame" + (awalUnit + 2)].enabled == true) && (ui_mc["frame" + (awalUnit + 2)]._visible == true)) && (ui_mc["gembok" + (awalUnit + 2)]._visible == false)) {
klikUnit(ui_mc["frame" + (awalUnit + 2)]);
}
}
if (Key.getCode() == 52) {
sedangTekan = true;
if (((ui_mc["frame" + (awalUnit + 3)].enabled == true) && (ui_mc["frame" + (awalUnit + 3)]._visible == true)) && (ui_mc["gembok" + (awalUnit + 3)]._visible == false)) {
klikUnit(ui_mc["frame" + (awalUnit + 3)]);
}
}
if (Key.getCode() == 53) {
sedangTekan = true;
if (((ui_mc["frame" + (awalUnit + 4)].enabled == true) && (ui_mc["frame" + (awalUnit + 4)]._visible == true)) && (ui_mc["gembok" + (awalUnit + 4)]._visible == false)) {
klikUnit(ui_mc["frame" + (awalUnit + 4)]);
}
}
if (Key.getCode() == 54) {
sedangTekan = true;
if (((ui_mc["frame" + (awalUnit + 5)].enabled == true) && (ui_mc["frame" + (awalUnit + 5)]._visible == true)) && (ui_mc["gembok" + (awalUnit + 5)]._visible == false)) {
klikUnit(ui_mc["frame" + (awalUnit + 5)]);
}
}
if (Key.getCode() == 55) {
sedangTekan = true;
if (((ui_mc["frame" + (awalUnit + 6)].enabled == true) && (ui_mc["frame" + (awalUnit + 6)]._visible == true)) && (ui_mc["gembok" + (awalUnit + 6)]._visible == false)) {
klikUnit(ui_mc["frame" + (awalUnit + 6)]);
}
}
if (Key.getCode() == 56) {
sedangTekan = true;
if (((ui_mc["frame" + (awalUnit + 7)].enabled == true) && (ui_mc["frame" + (awalUnit + 7)]._visible == true)) && (ui_mc["gembok" + (awalUnit + 7)]._visible == false)) {
klikUnit(ui_mc["frame" + (awalUnit + 7)]);
}
}
if (Key.getCode() == 57) {
sedangTekan = true;
if (((ui_mc["frame" + (awalUnit + 8)].enabled == true) && (ui_mc["frame" + (awalUnit + 8)]._visible == true)) && (ui_mc["gembok" + (awalUnit + 8)]._visible == false)) {
klikUnit(ui_mc["frame" + (awalUnit + 8)]);
}
}
if (Key.getCode() == 81) {
sedangTekan = true;
if (ui_mc.tipe1.enabled == true) {
pilihTipe = 1;
cekTipe();
}
}
if (Key.getCode() == 87) {
sedangTekan = true;
if (ui_mc.tipe2.enabled == true) {
pilihTipe = 2;
cekTipe();
}
}
if (Key.getCode() == 69) {
sedangTekan = true;
if (ui_mc.tipe3.enabled == true) {
pilihTipe = 3;
cekTipe();
}
}
if (Key.getCode() == 82) {
sedangTekan = true;
if (ui_mc.tipe4.enabled == true) {
pilihTipe = 4;
cekTipe();
}
}
if (Key.getCode() == 84) {
sedangTekan = true;
if (ui_mc.tipe5.enabled == true) {
pilihTipe = 5;
cekTipe();
}
}
if (Key.getCode() == 89) {
sedangTekan = true;
if (ui_mc.tipe6.enabled == true) {
pilihTipe = 6;
cekTipe();
}
}
if (Key.getCode() == 85) {
sedangTekan = true;
if (ui_mc.tipe7.enabled == true) {
pilihTipe = 7;
cekTipe();
}
}
if (Key.getCode() == 80) {
if (tutorialWar == true) {
sedangTekan = true;
cekPause();
}
}
if (Key.getCode() == 17) {
sedangTekan = true;
tekanCtrl = true;
}
if (Key.getCode() == 32) {
sedangTekan = true;
tekanSpaceBar = true;
}
if ((Key.getCode() == 87) || (Key.getCode() == 38)) {
sedangTekan = true;
panahAtas = true;
kePanah--;
if (kePanah < 1) {
kePanah = 4;
}
}
if ((Key.getCode() == 83) || (Key.getCode() == 40)) {
sedangTekan = true;
panahBawah = true;
kePanah++;
if (kePanah > 4) {
kePanah = 1;
}
}
if ((Key.getCode() == 39) || (Key.getCode() == 68)) {
sedangTekan = true;
jalanKanan = true;
}
if ((Key.getCode() == 37) || (Key.getCode() == 65)) {
sedangTekan = true;
jalanKiri = true;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 49) {
sedangTekan = false;
}
if (Key.getCode() == 50) {
sedangTekan = false;
}
if (Key.getCode() == 51) {
sedangTekan = false;
}
if (Key.getCode() == 52) {
sedangTekan = false;
}
if (Key.getCode() == 53) {
sedangTekan = false;
}
if (Key.getCode() == 54) {
sedangTekan = false;
}
if (Key.getCode() == 55) {
sedangTekan = false;
}
if (Key.getCode() == 56) {
sedangTekan = false;
}
if (Key.getCode() == 57) {
sedangTekan = false;
}
if (Key.getCode() == 80) {
sedangTekan = false;
}
if (Key.getCode() == 17) {
sedangTekan = false;
tekanCtrl = false;
}
if (Key.getCode() == 32) {
sedangTekan = false;
tekanSpaceBar = false;
}
if ((Key.getCode() == 87) || (Key.getCode() == 38)) {
sedangTekan = false;
panahAtas = false;
}
if ((Key.getCode() == 83) || (Key.getCode() == 40)) {
sedangTekan = false;
panahBawah = false;
}
if ((Key.getCode() == 39) || (Key.getCode() == 68)) {
sedangTekan = false;
jalanKanan = false;
}
if ((Key.getCode() == 37) || (Key.getCode() == 65)) {
sedangTekan = false;
jalanKiri = false;
}
};
Key.addListener(myListener);
Frame 219
function buatMinimap() {
i = 1;
while (i <= bykTowerMusuh) {
titikMerah_mc = attachMovie("titikMerah_mc", "titikMerah_mc" + i, 93001 + i);
titikMerah_mc._x = -250;
titikMerah_mc._y = -250;
titikMerah_mc._alpha = 60;
i++;
}
i = 2000;
while (i <= 2030) {
titikMerah_mc = attachMovie("titikMerah_mc", "titikMerah_mc" + i, 93001 + i);
titikMerah_mc._x = -250;
titikMerah_mc._y = -250;
titikMerah_mc._alpha = 60;
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
titikHijau_mc = attachMovie("titikHijau_mc", "titikHijau_mc" + i, 90001 + i);
titikHijau_mc._x = -250;
titikHijau_mc._y = -250;
titikHijau_mc._alpha = 60;
i++;
}
i = 1000;
while (i <= 1030) {
titikHijau_mc = attachMovie("titikHijau_mc", "titikHijau_mc" + i, 90001 + i);
titikHijau_mc._x = -250;
titikHijau_mc._y = -250;
titikHijau_mc._alpha = 60;
i++;
}
radar_mc = attachMovie("radar_mc", "radar_mc", 90001);
radar_mc._x = 266;
radar_mc._y = 140;
radar_mc._alpha = 50;
minimap_mc = attachMovie("minimap_mc", "minimap_mc", 90000);
minimap_mc._x = 266;
minimap_mc._y = 140;
minimap_mc._alpha = 50;
minimap_mc.onRelease = klikMinimap;
minimap_mc.onEnterFrame = enterMinimap;
i = 1;
while (i <= 8) {
background_mc["besi" + i].onRollOver = overBesi;
background_mc["besi" + i].onRollOut = outOfTheBox;
i++;
}
i = 1;
while (i <= 8) {
background_mc["batu" + i].onRollOver = overBatu;
background_mc["batu" + i].onRollOut = outOfTheBox;
i++;
}
i = 1;
while (i <= 8) {
background_mc["rapuh" + i].onRollOver = overRapuh;
background_mc["rapuh" + i].onRollOut = outOfTheBox;
i++;
}
i = 1;
while (i <= 8) {
background_mc["kendaraan" + i].onRollOver = overKendaraan;
background_mc["kendaraan" + i].onRollOut = outOfTheBox;
i++;
}
}
function klikMinimap() {
xscalaX = (((_root._xmouse - 33) - this._x) * 3200) / 266;
if (xscalaX <= 0) {
xscalaX = 0;
} else if (xscalaX >= 2400) {
xscalaX = 2400;
}
moveCastle2(xscalaX);
}
function moveCastle2(indi) {
if (background_mc._x < 0) {
geserBerapa = background_mc._x + indi;
background_mc._x = background_mc._x - geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x - geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x - geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x - geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX - geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
} else if (background_mc._x > -2400) {
geserBerapa = (-indi) - background_mc._x;
background_mc._x = background_mc._x + geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x + geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x + geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x + geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX + geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
}
}
function enterMinimap() {
xscalaX = ((-background_mc._x) * 266) / 3200;
xscalaY = (background_mc._y * 50) / 600;
radar_mc._x = this._x + xscalaX;
radar_mc._y = this._y + xscalaY;
i = 1;
while (i <= bykTowerMusuh) {
if (background_mc["towerMusuh" + i].nyawa > 0) {
scalaX = (background_mc["towerMusuh" + i]._x * 266) / 3200;
scalaY = (background_mc["towerMusuh" + i]._y * 50) / 600;
_root["titikMerah_mc" + i]._x = this._x + scalaX;
_root["titikMerah_mc" + i]._y = this._y + scalaY;
} else {
_root["titikMerah_mc" + i]._x = -250;
_root["titikMerah_mc" + i]._y = -250;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i].nyawa > 0) {
scalaX = ((_root["musuh_mc" + i]._x - background_mc._x) * 266) / 3200;
scalaY = ((_root["musuh_mc" + i]._y - background_mc._y) * 50) / 600;
_root["titikMerah_mc" + i]._x = this._x + scalaX;
_root["titikMerah_mc" + i]._y = this._y + scalaY;
} else {
_root["titikMerah_mc" + i]._x = -250;
_root["titikMerah_mc" + i]._y = -250;
}
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
if (background_mc["towerJagoan" + i].nyawa > 0) {
scalaX = (background_mc["towerJagoan" + i]._x * 266) / 3200;
scalaY = (background_mc["towerJagoan" + i]._y * 50) / 600;
_root["titikHijau_mc" + i]._x = this._x + scalaX;
_root["titikHijau_mc" + i]._y = this._y + scalaY;
} else {
_root["titikHijau_mc" + i]._x = -250;
_root["titikHijau_mc" + i]._y = -250;
}
i++;
}
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i].nyawa > 0) {
scalaX = ((_root["jagoan_mc" + i]._x - background_mc._x) * 266) / 3200;
scalaY = ((_root["jagoan_mc" + i]._y - background_mc._y) * 50) / 600;
_root["titikHijau_mc" + i]._x = this._x + scalaX;
_root["titikHijau_mc" + i]._y = this._y + scalaY;
} else {
_root["titikHijau_mc" + i]._x = -250;
_root["titikHijau_mc" + i]._y = -250;
}
i++;
}
}
function init() {
pengalianSemuaMusuh = 1;
speedGame = 15;
dalamBackground = 50;
dalamTanda = 60;
dalamJagoan = 1000;
dalamEfek = 55000;
dalamEfek2 = 51000;
dalamEfek4 = 200;
dalamEfek3 = 1;
dalamPeluru = 52000;
dalamUI = 100000 /* 0x0186A0 */;
dalamInfo = 110000 /* 0x01ADB0 */;
dalamGo = 200000 /* 0x030D40 */;
dalamSelesai = 300000 /* 0x0493E0 */;
adaEfekKah = true;
sedangDrag = false;
jalanKanan = false;
jalanKiri = false;
sudahSelesai = false;
cekSurrender = false;
siapaMenang = "";
banyakJagoan = 0;
banyakMusuh = 0;
pembagimoney2 = 2;
pembagimoney1 = 2;
unitMati1 = 0;
unitMati2 = 0;
buildingMati1 = 0;
buildingMati2 = 0;
delayBuatMusuhTower = 0;
delayBuatMusuhStrike = 0;
maxBaseJagoan = baseJagoan;
minMusuhTentara = 1;
maxMusuhTentara = 25;
minMusuhTower = 26;
maxMusuhTower = 36;
minMusuhStrike = 37;
maxMusuhStrike = 40;
uangAwal = money1;
jenisPasukanTower = new Array("", 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 14);
xdaftarHarga = new Array();
i = 1;
while (i <= 43) {
if (i <= 9) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[7]);
} else if (i <= 17) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[8]);
} else if (i <= 25) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[9]);
} else if (i <= 31) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[11]);
} else if (i <= 36) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[11]);
} else if (i <= 40) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[13]);
} else if (i <= 43) {
xdaftarHarga[i] = Math.ceil(daftarHarga[i] / levelSkill[13]);
}
i++;
}
i = 1;
while (i <= 43) {
_root["bisaUnit" + i] = false;
_root["bisaUnitMusuh" + i] = false;
i++;
}
i = 1;
while (i <= 30) {
_root["bisaUnit" + slot[i]] = true;
i++;
}
pilihanTowerJagoan = 1;
pilihanTowerMusuh = 1;
}
function buatMusuhTower(i, jenisPasukanMusuh) {
banyakMusuh++;
background_mc["towerMusuh" + i].gotoAndStop(1);
background_mc["towerMusuh" + i].gotoAndStop(jenisPasukanMusuh);
background_mc["towerMusuh" + i].troop.gotoAndStop(1);
background_mc["towerMusuh" + i].troop.anim.stop();
background_mc["towerMusuh" + i].tipeUnit = "tower_musuh";
background_mc["towerMusuh" + i].jenis = jenisPasukanMusuh;
background_mc["towerMusuh" + i].tiarap = false;
if (jenisPasukanMusuh == 2) {
background_mc["towerMusuh" + i].nyawa = 750;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 45;
background_mc["towerMusuh" + i].range = 500;
} else if (jenisPasukanMusuh == 3) {
background_mc["towerMusuh" + i].nyawa = 1000;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 250;
background_mc["towerMusuh" + i].range = 550;
} else if (jenisPasukanMusuh == 5) {
background_mc["towerMusuh" + i].nyawa = 1250;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 75;
background_mc["towerMusuh" + i].range = 850;
} else if (jenisPasukanMusuh == 6) {
background_mc["towerMusuh" + i].nyawa = 1500;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 125;
background_mc["towerMusuh" + i].range = 650;
background_mc["towerMusuh" + i].tiarap = true;
} else if (jenisPasukanMusuh == 8) {
background_mc["towerMusuh" + i].nyawa = 1750;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 450;
background_mc["towerMusuh" + i].range = 750;
} else if (jenisPasukanMusuh == 9) {
background_mc["towerMusuh" + i].nyawa = 2000;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 600;
background_mc["towerMusuh" + i].range = 800;
} else if (jenisPasukanMusuh == 10) {
background_mc["towerMusuh" + i].nyawa = 2500;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 50;
background_mc["towerMusuh" + i].range = 600;
} else if (jenisPasukanMusuh == 11) {
background_mc["towerMusuh" + i].nyawa = 3000;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 350;
background_mc["towerMusuh" + i].range = 700;
} else if (jenisPasukanMusuh == 12) {
background_mc["towerMusuh" + i].nyawa = 3500;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 450;
background_mc["towerMusuh" + i].range = 800;
} else if (jenisPasukanMusuh == 13) {
background_mc["towerMusuh" + i].nyawa = 5000;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 500;
background_mc["towerMusuh" + i].range = 850;
} else if (jenisPasukanMusuh == 14) {
background_mc["towerMusuh" + i].nyawa = 6500;
background_mc["towerMusuh" + i].speed = 0;
background_mc["towerMusuh" + i].damage = 600;
background_mc["towerMusuh" + i].range = 900;
}
background_mc["towerMusuh" + i].nyawa = background_mc["towerMusuh" + i].nyawa * pengalianSemuaMusuh;
background_mc["towerMusuh" + i].damage = background_mc["towerMusuh" + i].damage * pengalianSemuaMusuh;
if (jenisPasukanMusuh >= 10) {
background_mc["towerMusuh" + i].tahanBesi = true;
} else {
background_mc["towerMusuh" + i].tahanBesi = false;
}
background_mc["towerMusuh" + i].maxNyawa = background_mc["towerMusuh" + i].nyawa;
background_mc["towerMusuh" + i].serangBase = false;
background_mc["towerMusuh" + i].posisiKini = _root["posTowerMusuh" + i];
background_mc["towerMusuh" + i].onEnterFrame = enterTower;
}
function buatJagoanTower(i, jenisPasukan, indi3) {
banyakJagoan++;
background_mc["towerJagoan" + i].gotoAndStop(1);
background_mc["towerJagoan" + i].gotoAndStop(jenisPasukan);
background_mc["towerJagoan" + i].troop.gotoAndStop(1);
background_mc["towerJagoan" + i].tanda_mc._visible = false;
background_mc["towerJagoan" + i].troop.anim.stop();
background_mc["towerJagoan" + i].tipeUnit = "tower_jagoan";
background_mc["towerJagoan" + i].jenis = jenisPasukan;
background_mc["towerJagoan" + i].tiarap = false;
if (jenisPasukan == 2) {
background_mc["towerJagoan" + i].nyawa = 750;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 45;
background_mc["towerJagoan" + i].range = 500;
} else if (jenisPasukan == 3) {
background_mc["towerJagoan" + i].nyawa = 1000;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 250;
background_mc["towerJagoan" + i].range = 550;
} else if (jenisPasukan == 5) {
background_mc["towerJagoan" + i].nyawa = 1250;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 75;
background_mc["towerJagoan" + i].range = 850;
} else if (jenisPasukan == 6) {
background_mc["towerJagoan" + i].nyawa = 1500;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 125;
background_mc["towerJagoan" + i].range = 650;
background_mc["towerJagoan" + i].tiarap = true;
} else if (jenisPasukan == 8) {
background_mc["towerJagoan" + i].nyawa = 1750;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 450;
background_mc["towerJagoan" + i].range = 750;
} else if (jenisPasukan == 9) {
background_mc["towerJagoan" + i].nyawa = 2000;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 600;
background_mc["towerJagoan" + i].range = 800;
} else if (jenisPasukan == 10) {
background_mc["towerJagoan" + i].nyawa = 2500;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 50;
background_mc["towerJagoan" + i].range = 600;
} else if (jenisPasukan == 11) {
background_mc["towerJagoan" + i].nyawa = 3000;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 350;
background_mc["towerJagoan" + i].range = 700;
} else if (jenisPasukan == 12) {
background_mc["towerJagoan" + i].nyawa = 3500;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 450;
background_mc["towerJagoan" + i].range = 800;
} else if (jenisPasukan == 13) {
background_mc["towerJagoan" + i].nyawa = 5000;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 500;
background_mc["towerJagoan" + i].range = 850;
} else if (jenisPasukan == 14) {
background_mc["towerJagoan" + i].nyawa = 6500;
background_mc["towerJagoan" + i].speed = 0;
background_mc["towerJagoan" + i].damage = 600;
background_mc["towerJagoan" + i].range = 900;
}
if (jenisPasukan >= 10) {
background_mc["towerJagoan" + i].tahanBesi = true;
} else {
background_mc["towerJagoan" + i].tahanBesi = false;
}
background_mc["towerJagoan" + i].maxNyawa = background_mc["towerJagoan" + i].nyawa;
background_mc["towerJagoan" + i].serangBase = false;
background_mc["towerJagoan" + i].posisiKini = _root["posTowerJagoan" + i];
background_mc["towerJagoan" + i].onEnterFrame = enterTower2;
randKeluar = _root["posTowerJagoan" + i];
background_mc["towerJagoan" + i].moneyLebih = false;
background_mc["towerJagoan" + i].serangBesi = false;
if (ui_mc["frame" + indi3].supported._visible == true) {
ui_mc["frame" + indi3].sedangSupported = false;
ui_mc["frame" + indi3].supported._visible = false;
if (ui_mc["frame" + indi3].supported._currentframe == 1) {
background_mc["towerJagoan" + i].serangBesi = true;
} else if (ui_mc["frame" + indi3].supported._currentframe == 2) {
xdaftarHarga[indi3] = xdaftarHarga[indi3] * 0.25;
xdaftarHarga[indi3] = Math.ceil(xdaftarHarga[indi3]);
buatJagoan(1, jenisPasukan);
buatJagoan(2, jenisPasukan);
buatJagoan(3, jenisPasukan);
buatJagoan(4, jenisPasukan);
} else if (ui_mc["frame" + indi3].supported._currentframe == 3) {
xdaftarHarga[indi3] = xdaftarHarga[indi3] * 0.25;
xdaftarHarga[indi3] = Math.ceil(xdaftarHarga[indi3]);
buatJagoan(randKeluar, jenisPasukan, undefined, 0);
buatJagoan(randKeluar, jenisPasukan, undefined, -25);
buatJagoan(randKeluar, jenisPasukan, undefined, -50);
buatJagoan(randKeluar, jenisPasukan, undefined, -75);
} else if (ui_mc["frame" + indi3].supported._currentframe == 4) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa * 4;
background_mc["towerJagoan" + i].damage = background_mc["towerJagoan" + i].damage * 4;
} else if (ui_mc["frame" + indi3].supported._currentframe == 5) {
background_mc["towerJagoan" + i].speed = background_mc["towerJagoan" + i].speed * 2;
background_mc["towerJagoan" + i].range = background_mc["towerJagoan" + i].range * 2;
} else if (ui_mc["frame" + indi3].supported._currentframe == 6) {
background_mc["towerJagoan" + i].tahanBesi = true;
} else if (ui_mc["frame" + indi3].supported._currentframe == 7) {
background_mc["towerJagoan" + i].nyawa = background_mc["towerJagoan" + i].nyawa * 4;
background_mc["towerJagoan" + i].damage = background_mc["towerJagoan" + i].damage * 4;
background_mc["towerJagoan" + i].speed = background_mc["towerJagoan" + i].speed * 2;
background_mc["towerJagoan" + i].range = background_mc["towerJagoan" + i].range * 2;
background_mc["towerJagoan" + i].speedNaik = background_mc["towerJagoan" + i].speedNaik * 2;
} else if (ui_mc["frame" + indi3].supported._currentframe == 8) {
background_mc["towerJagoan" + i].moneyLebih = true;
}
background_mc["towerJagoan" + i].maxNyawa = background_mc["towerJagoan" + i].nyawa;
}
}
function buatBackground() {
background_mc = attachMovie("background" + levelKe, "background_mc", dalamBackground);
background_mc.cacheAsBitmap = true;
background_mc._x = 0;
background_mc._y = 0;
i = 1;
while (i <= 8) {
_root["bisaSupportMusuh" + i] = false;
i++;
}
i = 2;
while (i <= 8) {
if (levelKe >= daftarLevel2[i]) {
_root["bisaSupportMusuh" + i] = true;
_root["kiniSupportMusuh" + i] = 500;
_root["maxSupportMusuh" + i] = 500;
}
i++;
}
i = 1;
while (i <= 43) {
if (daftarLevel[i] == 1) {
if (levelKe >= daftarLevel[i]) {
_root["bisaUnitMusuh" + i] = true;
}
} else if (levelKe >= daftarLevel[i]) {
_root["bisaUnitMusuh" + i] = true;
}
i++;
}
i = 26;
while (i <= 36) {
if (daftarLevel[i] == 1) {
if (levelKe >= daftarLevel[i]) {
pilihanTowerJagoan = i - 25;
pilihanTowerMusuh = i - 25;
}
} else if (levelKe >= daftarLevel[i]) {
pilihanTowerJagoan = i - 25;
pilihanTowerMusuh = i - 25;
}
i++;
}
if (levelKe <= 9) {
cekLevelGame();
} else if (levelKe <= 19) {
cekLevelGame2();
} else if (levelKe <= 29) {
cekLevelGame3();
} else {
cekLevelGame4();
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
if (levelKe <= 5) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 1;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1;
} else if (levelKe <= 10) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.9;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1.2;
} else if (levelKe <= 15) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.8;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1.4;
} else if (levelKe <= 20) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.7;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1.6;
} else if (levelKe <= 25) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.6;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 1.8;
} else if (levelKe <= 30) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.5;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 2;
} else if (levelKe <= 35) {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.4;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 2.2;
} else {
_root["kiniBuatMusuh" + i] = _root["kiniBuatMusuh" + i] * 0.2;
_root["maxBuatMusuh" + i] = _root["maxBuatMusuh" + i] * 2.4;
}
i++;
}
i = minMusuhTentara;
while (i <= maxMusuhTentara) {
_root["kiniBuatMusuh" + i] = Math.ceil(_root["kiniBuatMusuh" + i]);
_root["maxBuatMusuh" + i] = Math.ceil(_root["maxBuatMusuh" + i]);
i++;
}
if (bykPasukan2 >= 30) {
bykPasukan2 = 30;
}
money2 = 1800 + (levelKe * 200);
money2 = Math.ceil(money2);
maxBuatMusuhTower = maxBuatMusuhTower * 3;
maxBuatMusuhStrike = maxBuatMusuhStrike * 3;
if (levelKe == 40) {
baseMusuh = 122500 /* 0x01DE84 */;
} else {
baseMusuh = 2500 + ((levelKe - 1) * 3000);
}
baseMusuh = baseMusuh * 2;
maxBaseMusuh = baseMusuh;
}
function buatUI() {
ui_mc = attachMovie("ui_mc", "ui_mc", dalamUI);
ui_mc.gotoAndStop(2);
ui_mc.cacheAsBitmap = true;
ui_mc._x = 0;
ui_mc._y = 0;
pilihTipe = 1;
i = 1;
while (i <= 50) {
ui_mc["frame" + i].sedangSupported = false;
i++;
}
i = 1;
while (i <= 8) {
ui_mc["supported" + i].gotoAndStop(i);
ui_mc["supported" + i].jeda_mc.gotoAndStop(1);
if (_root["bisaSupported" + i] == true) {
ui_mc["supported" + i].gembok_mc._visible = false;
ui_mc["supported" + i].onRelease = klikSupported;
ui_mc["supported" + i].onRollOver = overFrame2;
ui_mc["supported" + i].onRollOut = outFrame2;
} else {
ui_mc["supported" + i].gembok_mc._visible = true;
delete ui_mc["supported" + i].onRelease;
}
i++;
}
ui_mc.xpilih = "GAME LEVEL PREVIEW: AREA " + levelKe;
ui_mc.close_btn.onRelease = function () {
clearSemua();
gotoAndStop (215);
};
}
function moveCastle(indi) {
if (indi == 0) {
if (background_mc._x < 0) {
geserBerapa = background_mc._x;
background_mc._x = background_mc._x - geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x - geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x - geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x - geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX - geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
}
} else if (indi == 2) {
if (background_mc._x > -2400) {
geserBerapa = -2400 - background_mc._x;
background_mc._x = background_mc._x + geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x + geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x + geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x + geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX + geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
}
} else if (indi == 3) {
if (background_mc._x < 0) {
geserBerapa = background_mc._x + 1200;
background_mc._x = background_mc._x - geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x - geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x - geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x - geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX - geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x - geserBerapa;
}
i++;
}
} else if (background_mc._x > -2400) {
geserBerapa = -1200 - background_mc._x;
background_mc._x = background_mc._x + geserBerapa;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
_root["jagoan_mc" + i]._x = _root["jagoan_mc" + i]._x + geserBerapa;
}
i++;
}
i = 2000;
while (i <= 2030) {
if (_root["musuh_mc" + i]._x != undefined) {
_root["musuh_mc" + i]._x = _root["musuh_mc" + i]._x + geserBerapa;
}
i++;
}
i = 52000;
while (i <= 52100) {
if (_root["peluru_mc" + i]._x != undefined) {
_root["peluru_mc" + i]._x = _root["peluru_mc" + i]._x + geserBerapa;
_root["peluru_mc" + i].xtargetX = _root["peluru_mc" + i].xtargetX + geserBerapa;
}
i++;
}
i = 55000;
while (i <= 55200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 51000;
while (i <= 51200) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
i = 200;
while (i <= 250) {
if (_root["efek_mc" + i]._x != undefined) {
_root["efek_mc" + i]._x = _root["efek_mc" + i]._x + geserBerapa;
}
i++;
}
}
}
}
function clearSemua() {
clearInterval(idLanjut);
removeListener(myListener);
delete myListener.onKeyUp;
delete myListener.onKeyDown;
delete _root.onEnterFrame;
delete _root.onMouseDown;
removeMovieClip(selesai_mc);
removeMovieClip(background_mc);
removeMovieClip(ui_mc);
removeMovieClip(target_mc);
removeMovieClip(go_mc);
removeMovieClip(menu_mc);
removeMovieClip(tutorial_mc);
removeMovieClip(radar_mc);
removeMovieClip(minimap_mc);
removeMovieClip(menu_mc);
removeMovieClip(info_box);
i = 1;
while (i <= bykTowerMusuh) {
removeMovieClip(_root["titikMerah_mc" + i]);
i++;
}
i = 2000;
while (i <= 2020) {
removeMovieClip(_root["titikMerah_mc" + i]);
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
removeMovieClip(_root["titikHijau_mc" + i]);
i++;
}
i = 1000;
while (i <= 1020) {
removeMovieClip(_root["titikHijau_mc" + i]);
i++;
}
i = 1;
while (i <= 4) {
removeMovieClip(_root["tanda_mc" + i]);
i++;
}
i = 1000;
while (i <= 1020) {
removeMovieClip(_root["jagoan_mc" + i]);
i++;
}
i = 2000;
while (i <= 2020) {
removeMovieClip(_root["musuh_mc" + i]);
i++;
}
i = 52000;
while (i <= 52100) {
removeMovieClip(_root["peluru_mc" + i]);
i++;
}
i = 55000;
while (i <= 55200) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
i = 51000;
while (i <= 51200) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
i = 200;
while (i <= 250) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
}
stop();
removeMovieClip(menu_mc);
init();
buatUI();
buatBackground();
buatTanda();
buatMinimap();
_root.onEnterFrame = function () {
if ((jalanKiri == true) && (background_mc._x <= -15)) {
speedGame = 15;
} else if ((jalanKanan == true) && (background_mc._x > -2400)) {
speedGame = -15;
} else if ((_root._xmouse <= 30) && (background_mc._x <= -15)) {
speedGame = 15;
} else if ((_root._xmouse >= 770) && (background_mc._x > -2400)) {
speedGame = -15;
} else {
speedGame = 0;
}
background_mc._x = background_mc._x + speedGame;
money1 = Math.ceil(money1);
money2 = Math.ceil(money2);
if (money1 <= 0) {
money1 = 0;
}
if (money2 <= 0) {
money2 = 0;
}
baseJagoan = Math.ceil(baseJagoan);
baseMusuh = Math.ceil(baseMusuh);
if (baseJagoan <= 0) {
baseJagoan = 0;
}
if (baseMusuh <= 0) {
baseMusuh = 0;
}
ui_mc.xlevel = "Level: " + levelKe;
ui_mc.money1 = "Fund: " + money1;
ui_mc.money2 = "Fund: " + money2;
ui_mc.base1 = "Base: " + baseJagoan;
ui_mc.base2 = "Base: " + baseMusuh;
ui_mc.unit1 = (("Unit: " + banyakJagoan) + "/") + bykPasukan1;
ui_mc.unit2 = (("Unit: " + banyakMusuh) + "/") + bykPasukan2;
background_mc.benteng1.bar_mc.bar._xscale = (baseJagoan / maxBaseJagoan) * 100;
background_mc.benteng2.bar_mc.bar._xscale = (baseMusuh / maxBaseMusuh) * 100;
if (tekanCtrl == true) {
sedangDrag = false;
removeMovieClip(go_mc);
removeMovieClip(supported_mc);
i = 1;
while (i <= 4) {
_root["tanda_mc" + i]._visible = false;
i++;
}
i = 1;
while (i <= bykTowerJagoan) {
delete background_mc["towerJagoan" + i].onRelease;
background_mc["towerJagoan" + i].tanda_mc._visible = false;
i++;
}
stopDrag();
i = 1;
while (i <= 50) {
ui_mc["frame" + i].tanda_mc._visible = false;
i++;
}
}
};
myListener = new Object();
myListener.onKeyDown = function () {
if ((Key.getCode() == 90) || (Key.getCode() == 89)) {
moveCastle(0);
}
if (Key.getCode() == 67) {
moveCastle(2);
}
if (Key.getCode() == 88) {
moveCastle(3);
}
if (Key.getCode() == 49) {
sedangTekan = true;
if (ui_mc.tipe1.enabled == true) {
pilihTipe = 1;
cekTipe();
}
}
if (Key.getCode() == 50) {
sedangTekan = true;
if (ui_mc.tipe2.enabled == true) {
pilihTipe = 2;
cekTipe();
}
}
if (Key.getCode() == 51) {
sedangTekan = true;
if (ui_mc.tipe3.enabled == true) {
pilihTipe = 3;
cekTipe();
}
}
if (Key.getCode() == 52) {
sedangTekan = true;
if (ui_mc.tipe4.enabled == true) {
pilihTipe = 4;
cekTipe();
}
}
if (Key.getCode() == 53) {
sedangTekan = true;
if (ui_mc.tipe5.enabled == true) {
pilihTipe = 5;
cekTipe();
}
}
if (Key.getCode() == 54) {
sedangTekan = true;
if (ui_mc.tipe6.enabled == true) {
pilihTipe = 6;
cekTipe();
}
}
if (Key.getCode() == 55) {
sedangTekan = true;
if (ui_mc.tipe7.enabled == true) {
pilihTipe = 7;
cekTipe();
}
}
if (Key.getCode() == 80) {
if (tutorialWar == true) {
sedangTekan = true;
cekPause();
}
}
if (Key.getCode() == 17) {
sedangTekan = true;
tekanCtrl = true;
}
if (Key.getCode() == 32) {
sedangTekan = true;
tekanSpaceBar = true;
}
if ((Key.getCode() == 87) || (Key.getCode() == 38)) {
sedangTekan = true;
panahAtas = true;
kePanah--;
if (kePanah < 1) {
kePanah = 4;
}
}
if ((Key.getCode() == 83) || (Key.getCode() == 40)) {
sedangTekan = true;
panahBawah = true;
kePanah++;
if (kePanah > 4) {
kePanah = 1;
}
}
if ((Key.getCode() == 39) || (Key.getCode() == 68)) {
sedangTekan = true;
jalanKanan = true;
}
if ((Key.getCode() == 37) || (Key.getCode() == 65)) {
sedangTekan = true;
jalanKiri = true;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 49) {
sedangTekan = false;
}
if (Key.getCode() == 50) {
sedangTekan = false;
}
if (Key.getCode() == 51) {
sedangTekan = false;
}
if (Key.getCode() == 52) {
sedangTekan = false;
}
if (Key.getCode() == 53) {
sedangTekan = false;
}
if (Key.getCode() == 54) {
sedangTekan = false;
}
if (Key.getCode() == 55) {
sedangTekan = false;
}
if (Key.getCode() == 56) {
sedangTekan = false;
}
if (Key.getCode() == 57) {
sedangTekan = false;
}
if (Key.getCode() == 80) {
sedangTekan = false;
}
if (Key.getCode() == 17) {
sedangTekan = false;
tekanCtrl = false;
}
if (Key.getCode() == 32) {
sedangTekan = false;
tekanSpaceBar = false;
}
if ((Key.getCode() == 87) || (Key.getCode() == 38)) {
sedangTekan = false;
panahAtas = false;
}
if ((Key.getCode() == 83) || (Key.getCode() == 40)) {
sedangTekan = false;
panahBawah = false;
}
if ((Key.getCode() == 39) || (Key.getCode() == 68)) {
sedangTekan = false;
jalanKanan = false;
}
if ((Key.getCode() == 37) || (Key.getCode() == 65)) {
sedangTekan = false;
jalanKiri = false;
}
};
Key.addListener(myListener);
Frame 220
function klikSupported() {
if (this.gembok_mc._visible == true) {
if (xexp >= daftarExp2[this._currentframe]) {
if (levelKe >= daftarLevel2[this._currentframe]) {
xexp = xexp - daftarExp2[this._currentframe];
_root["bisaSupported" + this._currentframe] = true;
this.gembok_mc._visible = false;
} else {
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Buy";
msgBox_mc.isi = "Not enough Game Level, should be buy on level " + daftarLevel2[this._currentframe];
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
}
} else {
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Buy";
msgBox_mc.isi = "Not enough Exp Point, sell other unit to gain more exp.";
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
}
} else {
cekBisaKlikSemua(false);
msgBox_mc2._visible = true;
msgBox_mc2.judul = "Selling Unit";
msgBox_mc2.isi = "Are you sure want to sell this unit?";
indix = this;
msgBox_mc2.yes_btn.onRelease = function () {
xexp = xexp + Math.ceil(daftarExp2[indix._currentframe] / 1);
_root["bisaSupported" + indix._currentframe] = false;
indix.gembok_mc._visible = true;
cekBisaKlikSemua(true);
msgBox_mc2._visible = false;
};
msgBox_mc2.no_btn.onRelease = function () {
cekBisaKlikSemua(true);
msgBox_mc2._visible = false;
};
}
adaBanyakSlotSupported = 0;
qi = 1;
while (qi <= 8) {
if (_root["suporrted" + qi].gembok_mc._visible == false) {
adaBanyakSlotSupported++;
}
qi++;
}
if (adaBanyakSlotSupported >= 8) {
zmedals4 = true;
}
}
function overSupported() {
zpilihJenis = this._currentframe;
infoBox = attachMovie("info_box2", "info_box", 1000);
infoBox._x = this._x;
infoBox._y = this._y - 100;
infoBox.judul = daftarSpell[zpilihJenis];
if (_root["bisaSupported" + zpilihJenis] == false) {
infoBox.isi = ((((penjelasanSpell[zpilihJenis] + "\n\nNeed ") + daftarExp2[zpilihJenis]) + " exp and level ") + daftarLevel2[zpilihJenis]) + " to buy";
} else {
infoBox.isi = ((penjelasanSpell[zpilihJenis] + "\n\nClick here to sell, +") + Math.ceil(daftarExp2[zpilihJenis] / 1)) + " exp";
}
}
function outSupported() {
removeMovieClip(infoBox);
}
function tutorialSetupSelesai() {
removeMovieClip(tutorial_mc2);
i = 1;
while (i <= 9) {
_root["tipe" + i].enabled = true;
_root["frame" + i].enabled = true;
i++;
}
i = 1;
while (i <= 8) {
_root["suporrted" + i].enabled = true;
i++;
}
i = 1;
while (i <= 30) {
if (_root["kotak" + i]._currentframe != 90) {
_root["kotak" + i].enabled = true;
}
i++;
}
skill_btn.enabled = true;
statistic_btn.enabled = true;
achievements_btn.enabled = true;
medals_btn.enabled = true;
menu_btn.enabled = true;
continue_btn.enabled = true;
defense_btn.enabled = true;
offence_btn.enabled = true;
random_btn.enabled = true;
manual_btn.enabled = true;
map_btn.enabled = true;
cekBisa();
}
function cekBisa() {
i = 1;
while (i <= 8) {
_root["suporrted" + i].gotoAndStop(i);
if (_root["bisaSupported" + i] == false) {
_root["suporrted" + i].gembok_mc._visible = true;
_root["suporrted" + i].onRelease = klikSupported;
_root["suporrted" + i].onRollOver = overSupported;
_root["suporrted" + i].onRollOut = (_root["suporrted" + i].onReleaseOutside = outSupported);
} else {
_root["suporrted" + i].gembok_mc._visible = false;
_root["suporrted" + i].onRelease = klikSupported;
_root["suporrted" + i].onRollOver = overSupported;
_root["suporrted" + i].onRollOut = (_root["suporrted" + i].onReleaseOutside = outSupported);
}
i++;
}
adaBanyakSlotSupported = 0;
i = 1;
while (i <= 8) {
if (_root["suporrted" + i].gembok_mc._visible == false) {
adaBanyakSlotSupported++;
}
i++;
}
if (adaBanyakSlotSupported >= 8) {
zmedals4 = true;
}
i = 1;
while (i <= 9) {
_root["tipe" + i].onRelease = klikTipe;
_root["tipe" + i].onRollOver = overTipe;
_root["tipe" + i].onRollOut = outTipe;
_root["tipe" + i].onReleaseOutside = outTipe;
_root["tipe" + i].enabled = true;
_root["tipe" + i].gotoAndStop(1);
_root["frame" + i]._visible = false;
i++;
}
_root["tipe" + pilihJenis].gotoAndStop(3);
_root["tipe" + pilihJenis].enabled = false;
if (pilihJenis == 1) {
i = 1;
while (i <= 9) {
_root["frame" + i]._visible = true;
_root["frame" + i].gotoAndStop(i);
if (slotUnlok[i] == 0) {
_root["frame" + i].gembok_mc._visible = true;
} else {
_root["frame" + i].gembok_mc._visible = false;
}
_root["frame" + i].onRelease = klikFrame;
_root["frame" + i].onRollOver = overFrame;
_root["frame" + i].onRollOut = outFrame;
_root["frame" + i].onReleaseOutside = outFrame;
i++;
}
} else if (pilihJenis == 2) {
i = 10;
while (i <= 17) {
_root["frame" + (i - 9)]._visible = true;
_root["frame" + (i - 9)].gotoAndStop(i);
if (slotUnlok[i] == 0) {
_root["frame" + (i - 9)].gembok_mc._visible = true;
} else {
_root["frame" + (i - 9)].gembok_mc._visible = false;
}
_root["frame" + (i - 9)].onRelease = klikFrame;
_root["frame" + (i - 9)].onRollOver = overFrame;
_root["frame" + (i - 9)].onRollOut = outFrame;
_root["frame" + (i - 9)].onReleaseOutside = outFrame;
i++;
}
} else if (pilihJenis == 3) {
i = 18;
while (i <= 25) {
_root["frame" + (i - 17)]._visible = true;
_root["frame" + (i - 17)].gotoAndStop(i);
if (slotUnlok[i] == 0) {
_root["frame" + (i - 17)].gembok_mc._visible = true;
} else {
_root["frame" + (i - 17)].gembok_mc._visible = false;
}
_root["frame" + (i - 17)].onRelease = klikFrame;
_root["frame" + (i - 17)].onRollOver = overFrame;
_root["frame" + (i - 17)].onRollOut = outFrame;
_root["frame" + (i - 17)].onReleaseOutside = outFrame;
i++;
}
} else if (pilihJenis == 4) {
i = 26;
while (i <= 31) {
_root["frame" + (i - 25)]._visible = true;
_root["frame" + (i - 25)].gotoAndStop(i);
if (slotUnlok[i] == 0) {
_root["frame" + (i - 25)].gembok_mc._visible = true;
} else {
_root["frame" + (i - 25)].gembok_mc._visible = false;
}
_root["frame" + (i - 25)].onRelease = klikFrame;
_root["frame" + (i - 25)].onRollOver = overFrame;
_root["frame" + (i - 25)].onRollOut = outFrame;
_root["frame" + (i - 25)].onReleaseOutside = outFrame;
i++;
}
} else if (pilihJenis == 5) {
i = 32;
while (i <= 36) {
_root["frame" + (i - 31)]._visible = true;
_root["frame" + (i - 31)].gotoAndStop(i);
if (slotUnlok[i] == 0) {
_root["frame" + (i - 31)].gembok_mc._visible = true;
} else {
_root["frame" + (i - 31)].gembok_mc._visible = false;
}
_root["frame" + (i - 31)].onRelease = klikFrame;
_root["frame" + (i - 31)].onRollOver = overFrame;
_root["frame" + (i - 31)].onRollOut = outFrame;
_root["frame" + (i - 31)].onReleaseOutside = outFrame;
i++;
}
} else if (pilihJenis == 6) {
i = 37;
while (i <= 40) {
_root["frame" + (i - 36)]._visible = true;
_root["frame" + (i - 36)].gotoAndStop(i);
if (slotUnlok[i] == 0) {
_root["frame" + (i - 36)].gembok_mc._visible = true;
} else {
_root["frame" + (i - 36)].gembok_mc._visible = false;
}
_root["frame" + (i - 36)].onRelease = klikFrame;
_root["frame" + (i - 36)].onRollOver = overFrame;
_root["frame" + (i - 36)].onRollOut = outFrame;
_root["frame" + (i - 36)].onReleaseOutside = outFrame;
i++;
}
} else if (pilihJenis == 7) {
i = 41;
while (i <= 43) {
_root["frame" + (i - 40)]._visible = true;
_root["frame" + (i - 40)].gotoAndStop(i);
if (slotUnlok[i] == 0) {
_root["frame" + (i - 40)].gembok_mc._visible = true;
} else {
_root["frame" + (i - 40)].gembok_mc._visible = false;
}
_root["frame" + (i - 40)].onRelease = klikFrame;
_root["frame" + (i - 40)].onRollOver = overFrame;
_root["frame" + (i - 40)].onRollOut = outFrame;
_root["frame" + (i - 40)].onReleaseOutside = outFrame;
i++;
}
}
i = 1;
while (i <= 30) {
if (_root["kotak" + i]._currentframe == 90) {
_root["kotak" + i].enabled = false;
} else {
_root["kotak" + i].enabled = true;
}
i++;
}
}
function klikFrame() {
removeMovieClip(infoBox);
if (this.gembok_mc._visible == true) {
if (xexp >= daftarExp[this._currentframe]) {
if (levelKe >= daftarLevel[this._currentframe]) {
adaSlotGak = false;
j = 1;
while (j <= 30) {
if (_root["kotak" + j]._currentframe == 90) {
adaSlotGak = true;
xexp = xexp - daftarExp[this._currentframe];
slotUnlok[this._currentframe] = 1;
this.gembok_mc._visible = false;
_root["kotak" + j].gotoAndStop(this._currentframe);
slot[j] = this._currentframe;
cekUnlok();
j = 31;
}
j++;
}
if (adaSlotGak == false) {
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Buy";
msgBox_mc.isi = "Slots are full, you must sell other unit first before buy this unit.";
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
}
} else {
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Buy";
msgBox_mc.isi = "Not enough Game Level, should be buy on level " + daftarLevel[this._currentframe];
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
}
} else {
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Buy";
msgBox_mc.isi = "Not enough Exp Point, sell other unit to gain more exp.";
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
}
} else {
cekBisaKlikSemua(false);
msgBox_mc2._visible = true;
msgBox_mc2.judul = "Selling Unit";
msgBox_mc2.isi = "Are you sure want to sell this unit?";
indix = this;
msgBox_mc2.yes_btn.onRelease = function () {
j = 1;
while (j <= 30) {
if (_root["kotak" + j]._currentframe == indix._currentframe) {
xexp = xexp + Math.ceil(daftarExp[indix._currentframe] / 4);
slotUnlok[indix._currentframe] = 1;
indix.gembok_mc._visible = true;
_root["kotak" + j].gotoAndStop(90);
levelLive[j] = 1;
levelRange[j] = 1;
levelSpeed[j] = 1;
levelDamage[j] = 1;
slot[j] = 90;
cekUnlok();
j = 31;
cekBisaKlikSemua(true);
msgBox_mc2._visible = false;
}
j++;
}
};
msgBox_mc2.no_btn.onRelease = function () {
cekBisaKlikSemua(true);
msgBox_mc2._visible = false;
};
}
}
function cekUnlok() {
i = 1;
while (i <= bykJumlah) {
slotUnlok[i] = 0;
i++;
}
j = 1;
while (j <= 30) {
if (_root["kotak" + j]._currentframe != 90) {
slotUnlok[_root["kotak" + j]._currentframe] = 1;
}
j++;
}
i = 1;
while (i <= 30) {
if (_root["kotak" + i]._currentframe == 90) {
_root["kotak" + i].enabled = false;
} else {
_root["kotak" + i].enabled = true;
}
i++;
}
adaBanyakSlotKotak = 0;
i = 1;
while (i <= 30) {
if (_root["kotak" + i]._currentframe != 90) {
adaBanyakSlotKotak++;
}
i++;
}
if (adaBanyakSlotKotak >= 30) {
zmedals3 = true;
}
}
function klikTipe() {
myStr = new String(this);
pilihJenis = Number(myStr.substr(myStr.length - 1, 1));
cekBisa();
}
function overTipe() {
this.gotoAndStop(2);
}
function outTipe() {
this.gotoAndStop(1);
}
function klikUpgrade() {
myStr = new String(this);
indiX = Number(myStr.substr(myStr.length - 1, 1));
if (xexp >= bykExp) {
xexp = xexp - bykExp;
if (indiX == 1) {
levelLive[pilihKotak]++;
} else if (indiX == 2) {
levelRange[pilihKotak]++;
} else if (indiX == 3) {
levelSpeed[pilihKotak]++;
} else if (indiX == 4) {
levelDamage[pilihKotak]++;
}
cekUpgrade();
}
removeMovieClip(infoBox4);
}
function overUpgrade() {
myStr = new String(this);
indiX = Number(myStr.substr(myStr.length - 1, 1));
infoBox4 = attachMovie("info_box3", "info_box4", 1000);
infoBox4._x = this._x + 400;
infoBox4._y = this._y + 175;
infoBox4.judul = namaUpgrade[indiX];
if ((pilihKotak >= 38) && (pilihKotak <= 42)) {
bykExp = (pilihKotak - 35) * nilaiUpgrade[indiX];
} else if ((pilihKotak >= 31) && (pilihKotak <= 37)) {
bykExp = (pilihKotak - 27) * nilaiUpgrade[indiX];
} else {
bykExp = pilihKotak * nilaiUpgrade[indiX];
}
if (indiX == 1) {
if (levelLive[pilihKotak] == 1) {
xlevelKe = 1.2;
} else if (levelLive[pilihKotak] == 2) {
xlevelKe = 1.4;
}
upTo = Math.ceil(xlevelKe * daftarLive[pilihKotak]);
} else if (indiX == 2) {
if (levelRange[pilihKotak] == 1) {
xlevelKe = 1.1;
} else if (levelRange[pilihKotak] == 2) {
xlevelKe = 1.2;
}
upTo = Math.ceil(xlevelKe * daftarRange[pilihKotak]);
} else if (indiX == 3) {
if (levelSpeed[pilihKotak] == 1) {
xlevelKe = 1.2;
} else if (levelSpeed[pilihKotak] == 2) {
xlevelKe = 1.4;
}
upTo = xlevelKe * daftarSpeed[pilihKotak];
} else if (indiX == 4) {
if (levelDamage[pilihKotak] == 1) {
xlevelKe = 1.1;
} else if (levelDamage[pilihKotak] == 2) {
xlevelKe = 1.2;
}
upTo = Math.ceil(xlevelKe * daftarDamage[pilihKotak]);
}
infoBox4.isi = ((("Need " + bykExp) + " exp for upgrade.\nUp to ") + upTo) + " pts";
}
function outUpgrade() {
removeMovieClip(infoBox4);
}
function cekBisaKlikSemua(indi) {
i = 1;
while (i <= 30) {
if (_root["kotak" + i]._currentframe != 90) {
_root["kotak" + i].enabled = indi;
}
i++;
}
i = 1;
while (i <= 9) {
_root["tipe" + i].enabled = indi;
i++;
}
i = 1;
while (i <= 9) {
_root["frame" + i].enabled = indi;
i++;
}
}
function klikKotak() {
pilihKotak = this._currentframe;
upgrade._visible = true;
cekUpgrade();
upgrade.judul = daftarNama[zpilihJenis];
upgrade.gambar.gotoAndStop(zpilihJenis);
cekBisaKlikSemua(false);
upgrade.close_btn.onRelease = function () {
cekBisaKlikSemua(true);
upgrade._visible = false;
};
removeMovieClip(infoBox3);
}
function cekUpgrade() {
i = 1;
while (i <= 4) {
upgrade["upgrade" + i].onRelease = klikUpgrade;
upgrade["upgrade" + i].onRollOver = overUpgrade;
upgrade["upgrade" + i].onRollOut = outUpgrade;
upgrade["upgrade" + i].onReleaseOutside = outUpgrade;
if (i == 1) {
if (levelLive[pilihKotak] == 1) {
xlevelKe = 1;
} else if (levelLive[pilihKotak] == 2) {
xlevelKe = 1.2;
} else if (levelLive[pilihKotak] == 3) {
xlevelKe = 1.4;
}
upgrade.nilai1 = Math.ceil(xlevelKe * daftarLive[pilihKotak]);
upgrade.level1 = "Level " + levelLive[pilihKotak];
if ((levelLive[pilihKotak] >= 3) || (daftarLive[pilihKotak] == 0)) {
upgrade["upgrade" + i].enabled = false;
upgrade["upgrade" + i]._alpha = 50;
} else {
upgrade["upgrade" + i].enabled = true;
upgrade["upgrade" + i]._alpha = 100;
}
} else if (i == 2) {
if (levelRange[pilihKotak] == 1) {
xlevelKe = 1;
} else if (levelRange[pilihKotak] == 2) {
xlevelKe = 1.1;
} else if (levelRange[pilihKotak] == 3) {
xlevelKe = 1.2;
}
upgrade.nilai2 = Math.ceil(xlevelKe * daftarRange[pilihKotak]);
upgrade.level2 = "Level " + levelRange[pilihKotak];
if ((levelRange[pilihKotak] >= 3) || (daftarRange[pilihKotak] == 0)) {
upgrade["upgrade" + i].enabled = false;
upgrade["upgrade" + i]._alpha = 50;
} else {
upgrade["upgrade" + i].enabled = true;
upgrade["upgrade" + i]._alpha = 100;
}
} else if (i == 3) {
if (levelSpeed[pilihKotak] == 1) {
xlevelKe = 1;
} else if (levelSpeed[pilihKotak] == 2) {
xlevelKe = 1.2;
} else if (levelSpeed[pilihKotak] == 3) {
xlevelKe = 1.4;
}
upgrade.nilai3 = xlevelKe * daftarSpeed[pilihKotak];
upgrade.level3 = "Level " + levelSpeed[pilihKotak];
if ((levelSpeed[pilihKotak] >= 3) || (daftarSpeed[pilihKotak] == 0)) {
upgrade["upgrade" + i].enabled = false;
upgrade["upgrade" + i]._alpha = 50;
} else {
upgrade["upgrade" + i].enabled = true;
upgrade["upgrade" + i]._alpha = 100;
}
} else if (i == 4) {
if (levelDamage[pilihKotak] == 1) {
xlevelKe = 1;
} else if (levelDamage[pilihKotak] == 2) {
xlevelKe = 1.1;
} else if (levelDamage[pilihKotak] == 3) {
xlevelKe = 1.2;
}
upgrade.nilai4 = Math.ceil(xlevelKe * daftarDamage[pilihKotak]);
upgrade.level4 = "Level " + levelDamage[pilihKotak];
if ((levelDamage[pilihKotak] >= 3) || (daftarDamage[pilihKotak] == 0)) {
upgrade["upgrade" + i].enabled = false;
upgrade["upgrade" + i]._alpha = 50;
} else {
upgrade["upgrade" + i].enabled = true;
upgrade["upgrade" + i]._alpha = 100;
}
}
namaUpgrade = new Array("", "Life Upgrade", "Range Upgrade", "Speed Upgrade", "Damage Upgrade");
nilaiUpgrade = new Array("", 4, 3, 2, 5);
i++;
}
}
function overKotak() {
if (this._currentframe != 90) {
myStr2 = new String(this);
if (myStr2.length == 14) {
zpilihJenis2 = Number(myStr2.substr(myStr2.length - 1, 1));
} else {
zpilihJenis2 = Number(myStr2.substr(myStr2.length - 2, 2));
}
zpilihJenis = this._currentframe;
infoBox3 = attachMovie("info_box3", "info_box", 1000);
if (((zpilihJenis2 == 1) || (zpilihJenis2 == 11)) || (zpilihJenis2 == 21)) {
infoBox3._x = this._x + 50;
infoBox3._y = this._y - 75;
} else {
infoBox3._x = this._x;
infoBox3._y = this._y - 75;
}
infoBox3.judul = daftarNama[zpilihJenis];
if (((((levelLive[zpilihJenis] >= 3) || (daftarLive[zpilihJenis] == 0)) && ((levelRange[zpilihJenis] >= 3) || (daftarRange[zpilihJenis] == 0))) && ((levelSpeed[zpilihJenis] >= 3) || (daftarSpeed[zpilihJenis] == 0))) && ((levelDamage[zpilihJenis] >= 3) || (daftarDamage[zpilihJenis] == 0))) {
infoBox3.gotoAndStop(2);
infoBox3.isi = "This unit is full upgrades.";
} else {
infoBox3.gotoAndStop(1);
if ((pilihKotak >= 31) && (pilihKotak <= 42)) {
infoBox3.isi = "Click Here for Upgrade life, range and damage.";
} else {
infoBox3.isi = "Click Here for Upgrade life, range, speed and damage.";
}
}
} else {
removeMovieClip(infoBox3);
}
}
function outKotak() {
removeMovieClip(infoBox3);
}
function overFrame() {
zpilihJenis = this._currentframe;
infoBox = attachMovie("info_box2", "info_box", 1000);
infoBox._x = this._x;
infoBox._y = this._y + 100;
infoBox.judul = daftarNama[zpilihJenis];
if (zpilihJenis <= 9) {
hargaKe = Math.ceil(daftarHarga[zpilihJenis] / levelSkill[7]);
} else if (zpilihJenis <= 17) {
hargaKe = Math.ceil(daftarHarga[zpilihJenis] / levelSkill[8]);
} else if (zpilihJenis <= 25) {
hargaKe = Math.ceil(daftarHarga[zpilihJenis] / levelSkill[9]);
} else if (zpilihJenis <= 31) {
hargaKe = Math.ceil(daftarHarga[zpilihJenis] / levelSkill[11]);
} else if (zpilihJenis <= 36) {
hargaKe = Math.ceil(daftarHarga[zpilihJenis] / levelSkill[11]);
} else if (zpilihJenis <= 40) {
hargaKe = Math.ceil(daftarHarga[zpilihJenis] / levelSkill[13]);
} else if (zpilihJenis <= 43) {
hargaKe = Math.ceil(daftarHarga[zpilihJenis] / levelSkill[13]);
}
if (slotUnlok[zpilihJenis] == 0) {
infoBox.isi = ((((((((((((("Life: " + daftarLive[zpilihJenis]) + ", Range: ") + daftarRange[zpilihJenis]) + ", Speed: ") + daftarSpeed[zpilihJenis]) + ", Damage: ") + daftarDamage[zpilihJenis]) + ", Price: ") + hargaKe) + "\n\nNeed ") + daftarExp[zpilihJenis]) + " exp and level ") + daftarLevel[zpilihJenis]) + " to buy";
} else {
infoBox.isi = ((((((((((("Life: " + daftarLive[zpilihJenis]) + ", Range: ") + daftarRange[zpilihJenis]) + ", Speed: ") + daftarSpeed[zpilihJenis]) + ", Damage: ") + daftarDamage[zpilihJenis]) + ", Price: ") + hargaKe) + "\n\nClick here to sell, +") + Math.ceil(daftarExp[zpilihJenis] / 4)) + " exp";
}
}
function outFrame() {
removeMovieClip(infoBox);
}
function bisaSemua() {
bisaInfan = 0;
i = 1;
while (i <= 9) {
if (slotUnlok[i] == 1) {
bisaInfan++;
}
i++;
}
if (bisaInfan >= 9) {
_root.medals10 = 1;
}
bisaArti = 0;
i = 10;
while (i <= 17) {
if (slotUnlok[i] == 1) {
bisaArti++;
}
i++;
}
if (bisaArti >= 8) {
_root.medals11 = 1;
}
bisaAir = 0;
i = 18;
while (i <= 25) {
if (slotUnlok[i] == 1) {
bisaAir++;
}
i++;
}
if (bisaAir >= 8) {
_root.medals12 = 1;
}
bisaNavy = 0;
i = 26;
while (i <= 30) {
if (slotUnlok[i] == 1) {
bisaNavy++;
}
i++;
}
if (bisaNavy >= 5) {
_root.medals13 = 1;
}
bisaSemuaChara1 = 0;
bisaSemuaChara2 = 0;
bisaSemuaChara3 = 0;
i = 1;
while (i <= 30) {
if (slotUnlok[i] == 1) {
if ((((levelLive[i] >= 1) && (levelRange[i] >= 1)) && (levelSpeed[i] >= 1)) && (levelDamage[i] >= 1)) {
bisaSemuaChara1++;
}
if ((((levelLive[i] >= 2) && (levelRange[i] >= 2)) && (levelSpeed[i] >= 2)) && (levelDamage[i] >= 2)) {
bisaSemuaChara2++;
}
if ((((levelLive[i] >= 3) && (levelRange[i] >= 3)) && (levelSpeed[i] >= 3)) && (levelDamage[i] >= 3)) {
bisaSemuaChara3++;
}
}
i++;
}
if (bisaSemuaChara3 >= 30) {
_root.medals14 = 1;
_root.medals15 = 1;
_root.medals16 = 1;
} else if (bisaSemuaChara2 >= 30) {
_root.medals14 = 1;
_root.medals15 = 1;
} else if (bisaSemuaChara1 >= 30) {
_root.medals14 = 1;
}
}
stop();
removeMovieClip(menu_mc);
bgData = "maen";
musik.stop();
upgrade._visible = false;
msgBox_mc._visible = false;
msgBox_mc2._visible = false;
menu_mc2._visible = false;
xlevelx = levelKe;
bykPasukan1 = 20 + (1 * (levelSkill[1] - 1));
baseJagoan = 2 * (2500 + (5000 * (levelSkill[2] - 1)));
if (tipeGameLife == "Unlimited") {
znyawaGame = "Unlimited";
} else {
znyawaGame = nyawaGame;
}
if (jenisMorale == "offence") {
defense_btn.gotoAndStop(1);
offence_btn.gotoAndStop(2);
} else if (jenisMorale == "defense") {
defense_btn.gotoAndStop(2);
offence_btn.gotoAndStop(1);
}
if (jenisAppear == "random") {
random_btn.gotoAndStop(2);
manual_btn.gotoAndStop(1);
} else if (jenisAppear == "manual") {
random_btn.gotoAndStop(1);
manual_btn.gotoAndStop(2);
}
defense_btn.onRelease = function () {
jenisMorale = "defense";
defense_btn.gotoAndStop(2);
offence_btn.gotoAndStop(1);
};
offence_btn.onRelease = function () {
jenisMorale = "offence";
defense_btn.gotoAndStop(1);
offence_btn.gotoAndStop(2);
};
random_btn.onRelease = function () {
jenisAppear = "random";
random_btn.gotoAndStop(2);
manual_btn.gotoAndStop(1);
};
manual_btn.onRelease = function () {
jenisAppear = "manual";
random_btn.gotoAndStop(1);
manual_btn.gotoAndStop(2);
};
defense_btn.onRollOver = function () {
infoBox = attachMovie("info_box2", "info_box", 1000);
infoBox._x = this._x - 50;
infoBox._y = this._y - 75;
infoBox.judul = "Defense Morale";
infoBox.isi = "Forms a massive wall of troops but deploys after at least 12 units are in the center of the battlefield.";
};
offence_btn.onRollOver = function () {
infoBox = attachMovie("info_box2", "info_box", 1000);
infoBox._x = this._x - 50;
infoBox._y = this._y - 75;
infoBox.judul = "Offense Morale";
infoBox.isi = "Troops will attack aggressively.";
};
random_btn.onRollOver = function () {
infoBox = attachMovie("info_box2", "info_box", 1000);
infoBox._x = this._x - 50;
infoBox._y = this._y - 75;
infoBox.judul = "Random Appear";
infoBox.isi = "No formation is made, troops will appear in random locations.";
};
manual_btn.onRollOver = function () {
infoBox = attachMovie("info_box2", "info_box", 1000);
infoBox._x = this._x - 50;
infoBox._y = this._y - 75;
infoBox.judul = "Manual Appear";
infoBox.isi = "Troops will deploy in an arrow sign formation. Control by clicking (W, S) or (UP, DOWN) key.";
};
defense_btn.onRollOut = (defense_btn.onReleaseOutside = function () {
removeMovieClip(infoBox);
});
offence_btn.onRollOut = (offence_btn.onReleaseOutside = function () {
removeMovieClip(infoBox);
});
random_btn.onRollOut = (random_btn.onReleaseOutside = function () {
removeMovieClip(infoBox);
});
manual_btn.onRollOut = (manual_btn.onReleaseOutside = function () {
removeMovieClip(infoBox);
});
if (xexp >= 10000) {
_root.medals23 = 1;
_root.medals24 = 1;
_root.medals25 = 1;
_root.medals26 = 1;
} else if (xexp >= 7500) {
_root.medals23 = 1;
_root.medals24 = 1;
_root.medals25 = 1;
} else if (xexp >= 5000) {
_root.medals23 = 1;
_root.medals24 = 1;
} else if (xexp >= 2500) {
_root.medals23 = 1;
}
if (money1 >= 1000000) {
_root.medals27 = 1;
_root.medals28 = 1;
_root.medals29 = 1;
_root.medals30 = 1;
} else if (money1 >= 750000) {
_root.medals27 = 1;
_root.medals28 = 1;
_root.medals29 = 1;
} else if (money1 >= 500000) {
_root.medals27 = 1;
_root.medals28 = 1;
} else if (money1 >= 250000) {
_root.medals27 = 1;
}
if (money1 >= 30000) {
zmedals5 = true;
}
continue_btn.onRelease = function () {
removeMovieClip(tutorial);
cekUnlok();
adaIsi = 0;
adaInfan = 0;
adaNavy = 0;
adaAir = 0;
j = 1;
while (j <= 30) {
if (_root["kotak" + j]._currentframe != 90) {
adaIsi++;
}
if ((_root["kotak" + j]._currentframe >= 1) && (_root["kotak" + j]._currentframe <= 9)) {
adaInfan++;
}
if ((_root["kotak" + j]._currentframe >= 18) && (_root["kotak" + j]._currentframe <= 25)) {
adaAir++;
}
if ((_root["kotak" + j]._currentframe >= 26) && (_root["kotak" + j]._currentframe <= 30)) {
adaNavy++;
}
j++;
}
if (adaIsi > 0) {
if ((adaNavy == 0) && (jenisPerang == "laut")) {
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Continue";
msgBox_mc.isi = "You must place at least one type of navy troops on the slot. We are in the sea battle.";
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
} else if ((adaAir == 0) && (jenisPerang == "udara")) {
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Continue";
msgBox_mc.isi = "You must place at least one type of air force troops on the slot. We are in the air battle.";
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
} else if ((adaInfan == 0) && (jenisPerang == "darat")) {
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Continue";
msgBox_mc.isi = "You must place at least one type of infantry troops on the slot. We are in the land battle.";
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
} else {
if (adaIsi >= 30) {
_root.medals20 = 1;
_root.medals21 = 1;
_root.medals22 = 1;
} else if (adaIsi >= 20) {
_root.medals20 = 1;
_root.medals21 = 1;
} else if (adaIsi >= 10) {
_root.medals20 = 1;
}
removeMovieClip(infoBox);
simpanData();
gotoAndStop (221);
}
} else {
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Continue";
msgBox_mc.isi = "You must place at least one type of troops or buildings on the slot.";
msgBox_mc.no_btn.onRelease = function () {
msgBox_mc._visible = false;
};
}
};
skill_btn.onRelease = function () {
dariMana = "setup";
removeMovieClip(infoBox);
gotoAndStop (220);
};
statistic_btn.onRelease = function () {
dariMana = "setup";
removeMovieClip(infoBox);
gotoAndStop (220);
};
achievements_btn.onRelease = function () {
bisaSemua();
dariMana = "setup";
removeMovieClip(infoBox);
gotoAndStop (220);
};
medals_btn.onRelease = function () {
bisaSemua();
dariMana = "setup";
removeMovieClip(infoBox);
gotoAndStop (220);
};
map_btn.onRelease = function () {
removeMovieClip(infoBox);
gotoAndStop (215);
};
i = 1;
while (i <= 30) {
_root["kotak" + i].gembok_mc._visible = false;
_root["kotak" + i].gotoAndStop(slot[i]);
_root["kotak" + i].onRelease = klikKotak;
_root["kotak" + i].onRollOver = overKotak;
_root["kotak" + i].onRollOut = (_root["kotak" + i].onReleaseOutside = outKotak);
i++;
}
pilihJenis = 1;
cekBisa();
if (tutorialSetup == false) {
i = 1;
while (i <= 8) {
_root["suporrted" + i].enabled = false;
i++;
}
i = 1;
while (i <= 9) {
_root["tipe" + i].enabled = false;
_root["frame" + i].enabled = false;
i++;
}
i = 1;
while (i <= 30) {
if (_root["kotak" + i].gembok_mc._visible == false) {
_root["kotak" + i].enabled = false;
}
i++;
}
skill_btn.enabled = false;
statistic_btn.enabled = false;
achievements_btn.enabled = false;
medals_btn.enabled = false;
menu_btn.enabled = false;
continue_btn.enabled = false;
defense_btn.enabled = false;
offence_btn.enabled = false;
random_btn.enabled = false;
manual_btn.enabled = false;
map_btn.enabled = false;
tutorial = attachMovie("tutorial_mc2", "tutorial_mc2", 310000);
tutorial._x = 400;
tutorial._y = 240;
tutorial.next_btn.onRelease = function () {
if (tutorial_mc2._currentframe < 9) {
tutorial_mc2.gotoAndStop(tutorial_mc2._currentframe + 1);
} else {
tutorialSetupSelesai();
tutorialSetup = true;
_root.medals2 = 1;
}
};
} else {
tutorialSetupSelesai();
}
bisaSemua();
menu_btn.onRelease = function () {
menu = attachMovie("menu_mc", "menu_mc", dalamMenu);
menu._x = 400;
menu._y = 300;
menu.gotoAndStop(2);
menu.surrender_btn._visible = false;
menu.quit_btn._visible = true;
menu.quit_btn.onRelease = function () {
clearSemua();
gotoAndStop (213);
};
menu.back_btn.onRelease = function () {
removeMovieClip(menu_mc);
};
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
like_btn.onRelease = function () {
getURL ("http://www.facebook.com/ArmorGames", "_blank");
};
Frame 221
function cekSemuaLevel() {
i = 1;
while (i <= 15) {
_root["kotak" + i].onRelease = klikKotak;
_root["kotak" + i].onRollOver = overKotak;
_root["kotak" + i].onRollOut = outKotak;
_root["kotak" + i].onReleaseOutside = outKotak;
_root["xlevel" + i] = "Skill Level " + levelSkill[i];
if (levelSkill[i] >= skillMaxLevel[i]) {
_root["kotak" + i]._alpha = 50;
} else {
_root["kotak" + i]._alpha = 100;
}
i++;
}
zbanyakPoweredSkill = 0;
i = 1;
while (i <= 15) {
if (levelSkill[i] >= skillMaxLevel[i]) {
zbanyakPoweredSkill++;
}
i++;
}
if (zbanyakPoweredSkill >= 13) {
zmedals6 = true;
}
}
function klikKotak() {
cekKlikSkill(true);
removeMovieClip(infoBox);
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 ((xexp >= (skillExp[indi] * levelSkill[indi])) && (levelKe >= skillLevel[indi])) {
if (levelSkill[indi] < skillMaxLevel[indi]) {
xexp = xexp - (skillExp[indi] * levelSkill[indi]);
levelSkill[indi]++;
cekSemuaLevel();
} else {
cekKlikSkill(false);
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Upgrade";
msgBox_mc.isi = "It's full powered skill level.";
msgBox_mc.no_btn.onRelease = function () {
cekKlikSkill(true);
msgBox_mc._visible = false;
};
}
} else {
cekKlikSkill(false);
msgBox_mc._visible = true;
msgBox_mc.judul = "Can't Upgrade";
msgBox_mc.isi = "Not enough exp point or game level.";
msgBox_mc.no_btn.onRelease = function () {
cekKlikSkill(true);
msgBox_mc._visible = false;
};
}
}
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));
}
infoBox = attachMovie("info_box2", "info_box", 1000);
infoBox._x = this._x;
infoBox._y = this._y - 100;
if (indi <= 5) {
infoBox._y = this._y + 125;
}
infoBox.judul = skillJudul[indi];
if (levelSkill[indi] >= skillMaxLevel[indi]) {
infoBox.isi = ((skillIsi[indi] + "\nFull powered skill\nMaximum upgrade: ") + skillMaxLevel[indi]) + " levels";
infoBox.gotoAndStop(2);
} else {
infoBox.isi = ((((((((skillIsi[indi] + "\nNeed ") + (skillExp[indi] * levelSkill[indi])) + " exp and game level ") + skillLevel[indi]) + " to upgrade\nMax level: ") + skillMaxLevel[indi]) + "\nMaximum upgrade: ") + skillMaxLevel) + " levels";
infoBox.gotoAndStop(1);
}
}
function outKotak() {
removeMovieClip(infoBox);
}
function cekKlikSkill(indi) {
i = 1;
while (i <= 15) {
_root["kotak" + i].enabled = indi;
i++;
}
}
stop();
removeMovieClip(menu_mc);
xlevelx = levelKe;
cekKlikSkill(true);
msgBox_mc._visible = false;
back_btn.onRelease = function () {
levelSkilled1 = 0;
levelSkilled2 = 0;
levelSkilled3 = 0;
i = 1;
while (i <= 15) {
if (levelSkill[i] >= skillMaxLevel[i]) {
levelSkilled3++;
}
if (levelSkill[i] >= 3) {
levelSkilled2++;
}
if (levelSkill[i] >= 2) {
levelSkilled1++;
}
i++;
}
if (levelSkilled3 >= 15) {
_root.medals33 = 1;
_root.medals32 = 1;
_root.medals31 = 1;
} else if (levelSkilled2 >= 15) {
_root.medals32 = 1;
_root.medals31 = 1;
} else if (levelSkilled1 >= 15) {
_root.medals31 = 1;
}
removeMovieClip(infoBox);
gotoAndStop (220);
};
continue_btn.onRelease = function () {
bykPasukan1 = 20 + (1 * (levelSkill[1] - 1));
baseJagoan = 2 * (2500 + (5000 * (levelSkill[2] - 1)));
removeMovieClip(infoBox);
simpanData();
gotoAndStop (217);
};
skillJudul = new Array("", "Unit Boost", "Base Boost", "Speed Boost", "Range Boost", "Damage Boost", "Life Boost", "Low Cost Infantry", "Low Cost Artillery", "Low Cost Air Force", "Low Cost Navy", "Low Cost Turret and Tower", "Low Cost Base Guard", "Low Cost Strike and Special", "Increase Money", "Increase Exp");
skillIsi = new Array("", "Increase Total Unit", "Increase Base Life", "Increase All Unit's Speed", "Increase All Unit's Range", "Increase All Unit's Damage", "Increase All Unit's Life", "Decrease All Infantry Unit's cost", "Decrease All Artillery Unit's cost", "Decrease All Air Force Unit's cost", "Decrease All Navy Unit's cost", "Decrease All Building's cost", "Decrease All Base Guard's cost", "Decrease All Strike's cost", "Increase Money Gained", "Increase Exp Gained");
setMenang = false;
if ((campaignWin1 == 1) && (jenisCampaign == 1)) {
setMenang = true;
} else if ((campaignWin2 == 1) && (jenisCampaign == 2)) {
setMenang = true;
} else if ((campaignWin3 == 1) && (jenisCampaign == 3)) {
setMenang = true;
}
if (setMenang == false) {
skillExp = new Array("", 50, 75, 500, 1000, 1500, 2000, 500, 1000, 1500, 2000, 2500, 1000, 3500, 1500, 2500);
} else if (_root.medals43 == 1) {
skillExp = new Array("", 50, 75, 500, 1000, 1500, 2000, 500, 1000, 1500, 2000, 2500, 1000, 3500, 250, 500);
} else {
skillExp = new Array("", 50, 75, 500, 1000, 1500, 2000, 500, 1000, 1500, 2000, 2500, 1000, 3500, 500, 1000);
}
skillExp = new Array("", 50, 75, 500, 1000, 1500, 2000, 500, 1000, 1500, 2000, 2500, 1000, 3500, 1500, 2500);
skillLevel = new Array("", 1, 2, 8, 9, 10, 11, 10, 11, 12, 13, 14, 15, 16, 5, 11);
skillMaxLevel = new Array("", 11, 51, 3, 3, 16, 16, 4, 4, 4, 4, 4, 4, 4, 11, 5);
cekSemuaLevel();
menu_btn.onRelease = function () {
menu = attachMovie("menu_mc", "menu_mc", dalamMenu);
menu._x = 400;
menu._y = 300;
menu.gotoAndStop(2);
menu.surrender_btn._visible = false;
menu.quit_btn._visible = true;
menu.quit_btn.onRelease = function () {
clearSemua();
gotoAndStop (213);
};
menu.back_btn.onRelease = function () {
removeMovieClip(menu_mc);
};
};
Frame 222
stop();
xunit1 = wunit1;
xbuildings1 = wbuildings1;
xunit2 = wunit2;
xbuildings2 = wbuildings2;
xbase = wbase;
xmoney = wmoney;
xxexp = wexp;
if (xunit2 >= 100) {
zmedals1 = true;
}
if (xxexp >= 1000) {
zmedals2 = true;
}
if (money1 >= 30000) {
zmedals5 = true;
}
continue_btn.onRelease = function () {
backMusic();
simpanData();
gotoAndStop (215);
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
like_btn.onRelease = function () {
getURL ("http://www.facebook.com/ArmorGames", "_blank");
};
Frame 223
stop();
xunit1 = wunit1;
xbuildings1 = wbuildings1;
xunit2 = wunit2;
xbuildings2 = wbuildings2;
xbase = wbase;
xmoney = wmoney;
xxexp = wexp;
if (xunit2 >= 100) {
zmedals1 = true;
}
if (xxexp >= 1000) {
zmedals2 = true;
}
if (money1 >= 30000) {
zmedals5 = true;
}
continue_btn.onRelease = function () {
backMusic();
simpanData();
gotoAndStop (215);
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
like_btn.onRelease = function () {
getURL ("http://www.facebook.com/ArmorGames", "_blank");
};
Frame 224
stop();
levelKe = 1;
pilhanLevel = 1;
continue_btn.onRelease = function () {
backMusic();
simpanData();
gotoAndStop (213);
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
like_btn.onRelease = function () {
getURL ("http://www.facebook.com/ArmorGames", "_blank");
};
Symbol 17 MovieClip Frame 1
this.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Symbol 66 MovieClip Frame 27
_root.cekKena(_parent._parent);
_root.sound4();
Symbol 75 MovieClip Frame 15
stop();
Symbol 87 MovieClip Frame 15
stop();
Symbol 89 MovieClip Frame 60
stop();
removeMovieClip(_parent);
Symbol 106 MovieClip Frame 25
_root.cekKena(_parent);
_root.sound4();
Symbol 106 MovieClip Frame 45
gotoAndPlay (20);
Symbol 111 MovieClip Frame 16
stop();
_parent.gotoAndStop(1);
Symbol 113 MovieClip Frame 90
stop();
removeMovieClip(_parent);
Symbol 133 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 20
_root.cekKena(_parent._parent);
_root.sound3();
Symbol 152 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 27
_root.cekKena(_parent._parent);
_root.sound5();
Symbol 180 MovieClip Frame 25
_root.cekKena(_parent);
_root.sound5();
Symbol 180 MovieClip Frame 45
gotoAndPlay (20);
Symbol 183 MovieClip Frame 20
stop();
_parent.gotoAndStop(1);
Symbol 185 MovieClip Frame 90
stop();
removeMovieClip(_parent);
Symbol 186 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 25
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 206 MovieClip Frame 34
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 206 MovieClip Frame 43
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 206 MovieClip Frame 52
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 206 MovieClip Frame 61
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 210 MovieClip Frame 20
stop();
_parent.gotoAndStop(1);
Symbol 212 MovieClip Frame 90
stop();
removeMovieClip(_parent);
Symbol 213 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 5
stop();
Symbol 241 MovieClip Frame 22
_root.cekKena(_parent._parent, 9);
_root.sound8();
Symbol 242 MovieClip Frame 1
stop();
Symbol 255 MovieClip Frame 20
_root.cekKena(_parent._parent);
_root.sound9();
Symbol 256 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 16
_root.cekKena(_parent._parent, 60, -10, 1);
_root.sound5();
Symbol 271 MovieClip Frame 18
_root.cekKena(_parent._parent, 60, -10, 1);
_root.sound5();
Symbol 271 MovieClip Frame 20
_root.cekKena(_parent._parent, 60, -10, 1);
_root.sound5();
Symbol 342 MovieClip Frame 40
stop();
Symbol 343 MovieClip Frame 60
stop();
removeMovieClip(_parent);
Symbol 344 MovieClip Frame 1
stop();
Symbol 349 MovieClip Frame 5
stop();
Symbol 350 MovieClip Frame 5
stop();
Symbol 351 MovieClip Frame 15
_root.cekKena(_parent._parent, 55, -10, 7);
_root.sound5();
Symbol 352 MovieClip Frame 60
stop();
removeMovieClip(_parent);
Symbol 353 MovieClip [btroops10] Frame 1
stop();
Symbol 357 MovieClip Frame 5
stop();
Symbol 358 MovieClip Frame 15
_root.cekKena(_parent._parent, 55, -10, 9);
_root.sound5();
Symbol 359 MovieClip Frame 60
stop();
removeMovieClip(_parent);
Symbol 360 MovieClip [btroops11] Frame 1
stop();
Symbol 371 MovieClip Frame 10
_root.cekKena(_parent._parent, 60, -40, 7);
_root.sound5();
Symbol 372 MovieClip Frame 60
stop();
removeMovieClip(_parent);
Symbol 373 MovieClip [btroops14] Frame 1
stop();
Symbol 384 MovieClip Frame 7
_root.cekKena(_parent._parent, 60, -45, 9);
_root.sound5();
Symbol 385 MovieClip Frame 60
stop();
removeMovieClip(_parent);
Symbol 386 MovieClip [btroops15] Frame 1
stop();
Symbol 387 MovieClip Frame 1
stop();
Symbol 411 MovieClip Frame 27
_root.cekKena(_parent._parent);
_root.sound4();
Symbol 423 MovieClip Frame 60
stop();
removeMovieClip(_parent);
Symbol 444 MovieClip Frame 28
_root.cekKena(_parent);
_root.sound4();
Symbol 444 MovieClip Frame 40
gotoAndPlay (20);
Symbol 445 MovieClip Frame 25
stop();
_parent.gotoAndStop(1);
Symbol 447 MovieClip Frame 90
stop();
removeMovieClip(_parent);
Symbol 456 MovieClip Frame 1
stop();
Symbol 474 MovieClip Frame 20
_root.cekKena(_parent._parent);
_root.sound3();
Symbol 476 MovieClip Frame 1
stop();
Symbol 496 MovieClip Frame 27
_root.cekKena(_parent._parent);
_root.sound5();
Symbol 496 MovieClip Frame 29
_root.cekKena(_parent._parent);
_root.sound5();
Symbol 496 MovieClip Frame 31
_root.cekKena(_parent._parent);
_root.sound5();
Symbol 505 MovieClip Frame 25
_root.cekKena(_parent);
_root.sound5();
Symbol 505 MovieClip Frame 40
gotoAndPlay (20);
Symbol 506 MovieClip Frame 25
stop();
_parent.gotoAndStop(1);
Symbol 508 MovieClip Frame 90
stop();
removeMovieClip(_parent);
Symbol 509 MovieClip Frame 1
stop();
Symbol 524 MovieClip Frame 25
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 524 MovieClip Frame 34
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 524 MovieClip Frame 43
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 524 MovieClip Frame 52
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 524 MovieClip Frame 61
_root.cekKena(_parent._parent);
_root.sound6();
Symbol 526 MovieClip Frame 20
stop();
_parent.gotoAndStop(1);
Symbol 528 MovieClip Frame 90
stop();
removeMovieClip(_parent);
Symbol 529 MovieClip Frame 1
stop();
Symbol 548 MovieClip Frame 22
_root.cekKena(_parent._parent, 8);
_root.sound9();
Symbol 550 MovieClip Frame 1
stop();
Symbol 564 MovieClip Frame 20
_root.cekKena(_parent._parent);
_root.sound9();
Symbol 566 MovieClip Frame 1
stop();
Symbol 567 MovieClip Frame 16
_root.cekKena(_parent._parent, -60, -10, 1);
_root.sound5();
Symbol 567 MovieClip Frame 18
_root.cekKena(_parent._parent, -60, -10, 1);
_root.sound5();
Symbol 567 MovieClip Frame 20
_root.cekKena(_parent._parent, -60, -10, 1);
_root.sound5();
Symbol 568 MovieClip [btroops9] Frame 1
stop();
Symbol 569 MovieClip Frame 15
_root.cekKena(_parent._parent, -95, -10, 7);
_root.sound5();
Symbol 570 MovieClip Frame 1
stop();
Symbol 571 MovieClip Frame 15
_root.cekKena(_parent._parent, -95, -10, 9);
_root.sound5();
Symbol 572 MovieClip Frame 1
stop();
Symbol 573 MovieClip Frame 10
_root.cekKena(_parent._parent, -60, -40, 7);
_root.sound5();
Symbol 574 MovieClip Frame 1
stop();
Symbol 575 MovieClip Frame 7
_root.cekKena(_parent._parent, -60, -45, 9);
_root.sound5();
Symbol 576 MovieClip Frame 1
stop();
Symbol 577 MovieClip [tower4] Frame 1
stop();
Symbol 585 MovieClip Frame 10
stop();
Symbol 606 MovieClip Frame 45
stop();
Symbol 608 MovieClip Frame 1
stop();
Symbol 613 MovieClip Frame 40
stop();
Symbol 614 MovieClip Frame 1
stop();
Symbol 614 MovieClip Frame 2
stop();
_root.backLedak();
_root.backLedak();
Symbol 623 MovieClip Frame 1
stop();
Symbol 625 MovieClip Frame 1
stop();
Symbol 627 MovieClip [rel_mc5] Frame 1
stop();
Symbol 629 MovieClip [rel_mc2] Frame 1
stop();
Symbol 632 MovieClip Frame 40
stop();
Symbol 633 MovieClip Frame 1
stop();
Symbol 633 MovieClip Frame 2
_root.backLedak();
Symbol 635 MovieClip Frame 1
stop();
Symbol 638 MovieClip Frame 1
stop();
Symbol 638 MovieClip Frame 2
play();
Symbol 638 MovieClip Frame 40
gotoAndStop (1);
Symbol 656 MovieClip Frame 29
_root.cekKena(_parent);
_root.sound1();
Symbol 657 MovieClip Frame 60
removeMovieClip(_parent);
Symbol 658 MovieClip [troops1] Frame 1
stop();
Symbol 659 MovieClip Frame 27
_root.cekKena(_parent);
_root.sound4();
Symbol 660 MovieClip [troops2] Frame 1
stop();
Symbol 661 MovieClip Frame 20
_root.cekKena(_parent);
_root.sound3();
Symbol 662 MovieClip [troops3] Frame 1
stop();
Symbol 700 MovieClip Frame 31
_root.cekKena(_parent);
_root.sound8();
Symbol 700 MovieClip Frame 60
gotoAndPlay (25);
Symbol 702 MovieClip Frame 15
stop();
_parent.gotoAndStop(1);
Symbol 703 MovieClip [troops4] Frame 1
stop();
Symbol 704 MovieClip Frame 27
_root.cekKena(_parent);
_root.sound5();
Symbol 705 MovieClip [troops5] Frame 1
stop();
Symbol 706 MovieClip Frame 25
_root.cekKena(_parent);
_root.sound6();
Symbol 706 MovieClip Frame 34
_root.cekKena(_parent);
_root.sound6();
Symbol 706 MovieClip Frame 43
_root.cekKena(_parent);
_root.sound6();
Symbol 706 MovieClip Frame 52
_root.cekKena(_parent);
_root.sound6();
Symbol 706 MovieClip Frame 61
_root.cekKena(_parent);
_root.sound6();
Symbol 706 MovieClip Frame 65
gotoAndPlay (20);
Symbol 707 MovieClip [troops6] Frame 1
stop();
Symbol 721 MovieClip Frame 22
_root.cekKena(_parent, 7);
_root.sound7();
Symbol 722 MovieClip [troops7] Frame 1
stop();
Symbol 723 MovieClip Frame 22
_root.cekKena(_parent, 9);
_root.sound8();
Symbol 724 MovieClip [troops8] Frame 1
stop();
Symbol 725 MovieClip Frame 20
_root.cekKena(_parent);
_root.sound9();
Symbol 726 MovieClip [troops9] Frame 1
stop();
Symbol 743 MovieClip Frame 27
_root.cekKena(_parent._parent, -60, -75);
_root.sound4();
Symbol 744 MovieClip Frame 27
_root.cekKena(_parent._parent, -45, -75);
_root.sound4();
Symbol 745 MovieClip Frame 27
_root.cekKena(_parent._parent, 0, -75);
_root.sound4();
Symbol 748 MovieClip Frame 5
_root.cekKena(_parent._parent, 60, -50);
_root.sound1();
Symbol 991 MovieClip [api_mc] Frame 130
removeMovieClip(this);
Symbol 994 MovieClip Frame 60
removeMovieClip(_parent);
Symbol 997 MovieClip [troops10] Frame 1
stop();
Symbol 1018 MovieClip Frame 5
_root.cekKena(_parent._parent, 40, -50);
_root.sound1();
Symbol 1023 MovieClip Frame 3
_root.cekKena(_parent, -40, -65);
_root.sound4();
Symbol 1023 MovieClip Frame 7
_root.cekKena(_parent, -40, -65);
_root.sound4();
Symbol 1023 MovieClip Frame 11
_root.cekKena(_parent, -40, -65);
_root.sound4();
Symbol 1027 MovieClip Frame 60
removeMovieClip(_parent);
Symbol 1031 MovieClip [troops11] Frame 1
stop();
Symbol 1045 MovieClip Frame 5
_root.cekKena(_parent, -40, -70);
_root.sound4();
Symbol 1045 MovieClip Frame 13
_root.cekKena(_parent, -40, -70);
_root.sound4();
Symbol 1045 MovieClip Frame 21
_root.cekKena(_parent, -40, -70);
_root.sound4();
Symbol 1045 MovieClip Frame 30
_root.cekKena(_parent, -10, -70, 4);
_root.sound16();
Symbol 1045 MovieClip Frame 35
_root.cekKena(_parent, -10, -70, 4);
_root.sound16();
Symbol 1047 MovieClip Frame 60
removeMovieClip(_parent);
Symbol 1050 MovieClip [troops12] Frame 1
stop();
Symbol 1066 MovieClip Frame 5
_root.cekKena(_parent, 30, -60);
_root.sound4();
Symbol 1066 MovieClip Frame 8
_root.cekKena(_parent, 30, -60);
_root.sound4();
Symbol 1066 MovieClip Frame 11
_root.cekKena(_parent, 30, -60);
_root.sound4();
Symbol 1070 MovieClip Frame 5
_root.cekKena(_parent);
Symbol 1070 MovieClip Frame 85
removeMovieClip(_parent);
Symbol 1072 MovieClip [troops13] Frame 1
stop();
Symbol 1081 MovieClip Frame 10
_root.cekKena(_parent, 45, -55);
_root.sound4();
Symbol 1081 MovieClip Frame 13
_root.cekKena(_parent, 45, -55);
_root.sound4();
Symbol 1081 MovieClip Frame 16
_root.cekKena(_parent, 45, -55);
_root.sound4();
Symbol 1081 MovieClip Frame 27
_root.cekKena(_parent, 15, -78);
_root.sound5();
Symbol 1081 MovieClip Frame 29
_root.cekKena(_parent, 15, -78);
_root.sound5();
Symbol 1081 MovieClip Frame 31
_root.cekKena(_parent, 15, -78);
_root.sound5();
Symbol 1086 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1089 MovieClip [troops14] Frame 1
stop();
Symbol 1119 MovieClip Frame 15
_root.cekKena(_parent, 0, -120, 4);
_root.cekKena(_parent, 60, -83, 7);
_root.sound16();
Symbol 1125 MovieClip Frame 75
removeMovieClip(_parent);
Symbol 1127 MovieClip [troops15] Frame 1
stop();
Symbol 1146 MovieClip Frame 15
_root.cekKena(_parent, 150, -75, 9);
_root.cekKena(_parent, 150, -75, 9);
_root.cekKena(_parent, 150, -75, 9);
_root.sound15();
Symbol 1150 MovieClip Frame 65
removeMovieClip(_parent);
Symbol 1152 MovieClip [troops16] Frame 1
stop();
Symbol 1185 MovieClip Frame 10
_root.cekKena(_parent, 30, -90);
_root.sound4();
Symbol 1185 MovieClip Frame 18
_root.cekKena(_parent, 30, -90);
_root.sound4();
Symbol 1185 MovieClip Frame 26
_root.cekKena(_parent, 30, -90);
_root.sound4();
Symbol 1185 MovieClip Frame 40
_root.cekKena(_parent, 140, -65, 9);
_root.sound16();
Symbol 1193 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1195 MovieClip [troops17] Frame 1
stop();
Symbol 1212 MovieClip Frame 1
_root.backHeli();
Symbol 1215 MovieClip Frame 16
_root.cekKena(_parent._parent, 20, -12);
_root.sound5();
Symbol 1215 MovieClip Frame 18
_root.cekKena(_parent._parent, 20, -12);
_root.sound5();
Symbol 1216 MovieClip Frame 16
_root.cekKena(_parent._parent, 10, -12);
_root.sound5();
Symbol 1216 MovieClip Frame 18
_root.cekKena(_parent._parent, 10, -12);
_root.sound5();
Symbol 1219 MovieClip Frame 120
removeMovieClip(this);
Symbol 1224 MovieClip Frame 1
_root.backJatuh();
Symbol 1224 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1225 MovieClip [troops18] Frame 1
stop();
Symbol 1239 MovieClip Frame 1
_root.backHeli();
Symbol 1240 MovieClip Frame 5
_root.cekKena(_parent, 30, -10);
_root.sound4();
Symbol 1240 MovieClip Frame 11
_root.cekKena(_parent, 30, -10);
_root.sound4();
Symbol 1240 MovieClip Frame 16
_root.cekKena(_parent, 30, -10);
_root.sound4();
Symbol 1240 MovieClip Frame 25
_root.cekKena(_parent, 0, -12, 7);
_root.sound16();
Symbol 1245 MovieClip Frame 1
_root.backJatuh();
Symbol 1245 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1246 MovieClip [troops19] Frame 1
stop();
Symbol 1253 MovieClip Frame 1
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 4
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 10
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 14
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 20
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 24
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 30
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 34
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 40
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 44
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 50
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1253 MovieClip Frame 54
_root.cekKena(_parent, 20, -15);
_root.cekKena(_parent, 20, 10);
_root.cekKena(_parent, -10, -30);
_root.sound6();
Symbol 1258 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1258 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1260 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1260 MovieClip Frame 120
stop();
removeMovieClip(_parent);
Symbol 1261 MovieClip [troops20] Frame 1
stop();
Symbol 1265 MovieClip Frame 1
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 2
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 3
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 5
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 6
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 7
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 9
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 10
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 11
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 13
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 14
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 15
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 17
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 18
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 19
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 21
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 22
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 23
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 25
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 26
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 27
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 29
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 30
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 31
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 33
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 34
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 35
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 37
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 38
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1265 MovieClip Frame 39
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1271 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1271 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1274 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1274 MovieClip Frame 110
stop();
removeMovieClip(_parent);
Symbol 1275 MovieClip [troops21] Frame 1
stop();
Symbol 1279 MovieClip Frame 1
_root.cekKena(_parent, 0, 0, 9);
_root.sound9();
Symbol 1279 MovieClip Frame 6
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 9
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 11
_root.cekKena(_parent, 0, 0, 9);
_root.sound9();
Symbol 1279 MovieClip Frame 14
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 16
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 19
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 21
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 24
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 26
_root.cekKena(_parent, 0, 0, 9);
_root.sound9();
Symbol 1279 MovieClip Frame 31
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 33
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 35
_root.cekKena(_parent, 0, 0, 9);
_root.sound9();
Symbol 1279 MovieClip Frame 38
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 40
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 43
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 45
_root.cekKena(_parent, 0, 0, 9);
_root.sound9();
Symbol 1279 MovieClip Frame 48
_root.cekKena(_parent, 0, 0);
_root.cekKena(_parent, 10, -10);
_root.sound6();
Symbol 1279 MovieClip Frame 50
_root.cekKena(_parent, 10, 0);
_root.cekKena(_parent, 20, -10);
_root.sound6();
Symbol 1285 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1285 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1287 MovieClip [troops22] Frame 1
stop();
Symbol 1291 MovieClip Frame 5
_root.cekKena(_parent);
_root.sound3();
Symbol 1297 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1297 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1299 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1299 MovieClip Frame 115
stop();
removeMovieClip(_parent);
Symbol 1300 MovieClip [troops23] Frame 1
stop();
Symbol 1304 MovieClip Frame 5
_root.cekKena(_parent);
_root.sound3();
Symbol 1310 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1312 MovieClip Frame 110
stop();
removeMovieClip(_parent);
Symbol 1313 MovieClip [troops24] Frame 1
stop();
Symbol 1317 MovieClip Frame 4
_root.cekKena(_parent, -10, -10, 9);
_root.sound3();
Symbol 1317 MovieClip Frame 8
_root.cekKena(_parent, -10, -10, 9);
_root.sound3();
Symbol 1317 MovieClip Frame 12
_root.cekKena(_parent, -10, -10, 9);
_root.sound3();
Symbol 1323 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1325 MovieClip [troops25] Frame 1
stop();
Symbol 1342 MovieClip Frame 29
_root.cekKena(_parent);
_root.sound1();
Symbol 1343 MovieClip Frame 60
stop();
removeMovieClip(_parent);
Symbol 1345 MovieClip [xtroops1] Frame 1
stop();
Symbol 1346 MovieClip Frame 27
_root.cekKena(_parent);
_root.sound4();
Symbol 1347 MovieClip [xtroops2] Frame 1
stop();
Symbol 1348 MovieClip Frame 20
_root.cekKena(_parent);
_root.sound3();
Symbol 1349 MovieClip [xtroops3] Frame 1
stop();
Symbol 1377 MovieClip Frame 31
_root.cekKena(_parent);
_root.sound8();
Symbol 1377 MovieClip Frame 60
gotoAndPlay (25);
Symbol 1380 MovieClip Frame 15
stop();
_parent.gotoAndStop(1);
Symbol 1381 MovieClip [xtroops4] Frame 1
stop();
Symbol 1382 MovieClip Frame 27
_root.cekKena(_parent);
_root.sound5();
Symbol 1382 MovieClip Frame 29
_root.cekKena(_parent);
_root.sound5();
Symbol 1382 MovieClip Frame 31
_root.cekKena(_parent);
_root.sound5();
Symbol 1383 MovieClip [xtroops5] Frame 1
stop();
Symbol 1384 MovieClip Frame 25
_root.cekKena(_parent);
_root.sound6();
Symbol 1384 MovieClip Frame 34
_root.cekKena(_parent);
_root.sound6();
Symbol 1384 MovieClip Frame 43
_root.cekKena(_parent);
_root.sound6();
Symbol 1384 MovieClip Frame 52
_root.cekKena(_parent);
_root.sound6();
Symbol 1384 MovieClip Frame 61
_root.cekKena(_parent);
_root.sound6();
Symbol 1384 MovieClip Frame 65
gotoAndPlay (20);
Symbol 1385 MovieClip [xtroops6] Frame 1
stop();
Symbol 1400 MovieClip Frame 22
_root.cekKena(_parent, 7);
_root.sound8();
Symbol 1402 MovieClip [xtroops7] Frame 1
stop();
Symbol 1403 MovieClip Frame 22
_root.cekKena(_parent, 8);
_root.sound9();
Symbol 1404 MovieClip [xtroops8] Frame 1
stop();
Symbol 1405 MovieClip Frame 20
_root.cekKena(_parent);
_root.sound9();
Symbol 1406 MovieClip [xtroops9] Frame 1
stop();
Symbol 1409 MovieClip Frame 27
_root.cekKena(_parent._parent, 30, -75);
_root.sound4();
Symbol 1410 MovieClip Frame 27
_root.cekKena(_parent._parent, 15, -75);
_root.sound4();
Symbol 1411 MovieClip Frame 27
_root.cekKena(_parent._parent, 0, -75);
_root.sound4();
Symbol 1414 MovieClip Frame 5
_root.cekKena(_parent._parent, -60, -50);
_root.sound1();
Symbol 1415 MovieClip Frame 30
_root.cekKena(_parent, 1);
Symbol 1417 MovieClip Frame 60
removeMovieClip(_parent);
Symbol 1420 MovieClip [xtroops10] Frame 1
stop();
Symbol 1426 MovieClip Frame 5
_root.cekKena(_parent._parent, -40, -50);
_root.sound1();
Symbol 1430 MovieClip Frame 3
_root.cekKena(_parent, -40, -65);
_root.sound4();
Symbol 1430 MovieClip Frame 7
_root.cekKena(_parent, -40, -65);
_root.sound4();
Symbol 1430 MovieClip Frame 11
_root.cekKena(_parent, -40, -65);
_root.sound4();
Symbol 1431 MovieClip Frame 60
removeMovieClip(_parent);
Symbol 1434 MovieClip [xtroops11] Frame 1
stop();
Symbol 1442 MovieClip Frame 3
_root.cekKena(_parent, 40, -70);
_root.sound4();
Symbol 1442 MovieClip Frame 11
_root.cekKena(_parent, 40, -70);
_root.sound4();
Symbol 1442 MovieClip Frame 19
_root.cekKena(_parent, 40, -70);
_root.sound4();
Symbol 1442 MovieClip Frame 28
_root.cekKena(_parent, 10, -70, 4);
_root.sound16();
Symbol 1442 MovieClip Frame 33
_root.cekKena(_parent, 10, -70, 4);
_root.sound16();
Symbol 1443 MovieClip Frame 60
removeMovieClip(_parent);
Symbol 1446 MovieClip [xtroops12] Frame 1
stop();
Symbol 1447 MovieClip Frame 5
_root.cekKena(_parent, -30, -60);
_root.sound4();
Symbol 1447 MovieClip Frame 8
_root.cekKena(_parent, -30, -60);
_root.sound4();
Symbol 1447 MovieClip Frame 11
_root.cekKena(_parent, -30, -60);
_root.sound4();
Symbol 1449 MovieClip [xtroops13] Frame 1
stop();
Symbol 1453 MovieClip Frame 10
_root.cekKena(_parent, -45, -55);
_root.sound4();
Symbol 1453 MovieClip Frame 13
_root.cekKena(_parent, -45, -55);
_root.sound4();
Symbol 1453 MovieClip Frame 16
_root.cekKena(_parent, -45, -55);
_root.sound4();
Symbol 1453 MovieClip Frame 25
_root.cekKena(_parent, -15, -78);
_root.sound5();
Symbol 1453 MovieClip Frame 27
_root.cekKena(_parent, -15, -78);
_root.sound5();
Symbol 1453 MovieClip Frame 29
_root.cekKena(_parent, -15, -78);
_root.sound5();
Symbol 1454 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1457 MovieClip [xtroops14] Frame 1
stop();
Symbol 1458 MovieClip Frame 15
_root.cekKena(_parent, 0, -120, 4);
_root.cekKena(_parent, -60, -83, 7);
_root.sound16();
Symbol 1460 MovieClip [xtroops15] Frame 1
stop();
Symbol 1461 MovieClip Frame 15
_root.cekKena(_parent, -150, -75, 9);
_root.cekKena(_parent, -150, -75, 9);
_root.cekKena(_parent, -150, -75, 9);
_root.sound15();
Symbol 1464 MovieClip [xtroops16] Frame 1
stop();
Symbol 1467 MovieClip Frame 10
_root.cekKena(_parent, -30, -90);
_root.sound16();
Symbol 1467 MovieClip Frame 18
_root.cekKena(_parent, -30, -90);
_root.sound16();
Symbol 1467 MovieClip Frame 26
_root.cekKena(_parent, -30, -90);
_root.sound16();
Symbol 1467 MovieClip Frame 40
_root.cekKena(_parent, -140, -65, 9);
_root.sound16();
Symbol 1468 MovieClip Frame 80
removeMovieClip(_parent);
Symbol 1471 MovieClip [xtroops17] Frame 1
stop();
Symbol 1473 MovieClip Frame 1
_root.backHeli();
Symbol 1478 MovieClip Frame 18
_root.cekKena(_parent._parent, -70, -12);
_root.sound5();
Symbol 1478 MovieClip Frame 20
_root.cekKena(_parent._parent, -70, -12);
_root.sound5();
Symbol 1479 MovieClip Frame 18
_root.cekKena(_parent._parent, -60, -12);
_root.sound5();
Symbol 1479 MovieClip Frame 20
_root.cekKena(_parent._parent, -60, -12);
_root.sound5();
Symbol 1481 MovieClip [xtroops18] Frame 1
stop();
Symbol 1482 MovieClip Frame 5
_root.cekKena(_parent, -30, -10);
_root.sound4();
Symbol 1482 MovieClip Frame 11
_root.cekKena(_parent, -30, -10);
_root.sound4();
Symbol 1482 MovieClip Frame 16
_root.cekKena(_parent, -30, -10);
_root.sound4();
Symbol 1482 MovieClip Frame 25
_root.cekKena(_parent, 0, -12, 7);
_root.sound16();
Symbol 1483 MovieClip [xtroops19] Frame 1
stop();
Symbol 1484 MovieClip Frame 1
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 4
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 10
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 14
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 20
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 24
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 30
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 34
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 40
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 44
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 50
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1484 MovieClip Frame 54
_root.cekKena(_parent, -90, -15);
_root.cekKena(_parent, -90, 10);
_root.cekKena(_parent, -60, -30);
_root.sound6();
Symbol 1486 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1486 MovieClip Frame 120
stop();
removeMovieClip(_parent);
Symbol 1487 MovieClip [xtroops20] Frame 1
stop();
Symbol 1488 MovieClip Frame 1
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 2
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 3
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 5
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 6
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 7
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 9
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 10
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 11
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 13
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 14
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 15
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 17
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 18
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 19
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 21
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 22
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 23
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 25
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 26
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 27
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 29
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 30
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 31
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 33
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 34
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 35
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 37
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 38
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1488 MovieClip Frame 39
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1491 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1491 MovieClip Frame 110
stop();
removeMovieClip(_parent);
Symbol 1492 MovieClip [xtroops21] Frame 1
stop();
Symbol 1493 MovieClip Frame 1
_root.cekKena(_parent, -60, 0, 9);
_root.sound9();
Symbol 1493 MovieClip Frame 6
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 9
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 11
_root.cekKena(_parent, -60, 0, 9);
_root.sound9();
Symbol 1493 MovieClip Frame 14
_root.cekKena(_parent, -60, 0, 9);
_root.sound9();
Symbol 1493 MovieClip Frame 16
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 19
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 21
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 24
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 26
_root.cekKena(_parent, -60, 0, 9);
_root.sound9();
Symbol 1493 MovieClip Frame 31
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 33
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 35
_root.cekKena(_parent, -60, 0, 9);
_root.sound9();
Symbol 1493 MovieClip Frame 38
_root.cekKena(_parent, -60, 0, 9);
_root.sound9();
Symbol 1493 MovieClip Frame 40
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 43
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1493 MovieClip Frame 45
_root.cekKena(_parent, -60, 0, 9);
_root.sound9();
Symbol 1493 MovieClip Frame 48
_root.cekKena(_parent, -60, 0, 9);
_root.sound9();
Symbol 1493 MovieClip Frame 50
_root.cekKena(_parent, -60, 0);
_root.cekKena(_parent, -70, -10);
_root.sound6();
Symbol 1495 MovieClip [xtroops22] Frame 1
stop();
Symbol 1497 MovieClip Frame 1
_root.backJatuhCopter();
Symbol 1497 MovieClip Frame 115
stop();
removeMovieClip(_parent);
Symbol 1498 MovieClip [xtroops23] Frame 1
stop();
Symbol 1500 MovieClip Frame 110
stop();
removeMovieClip(_parent);
Symbol 1501 MovieClip [xtroops24] Frame 1
stop();
Symbol 1502 MovieClip [xtroops25] Frame 1
stop();
Symbol 1528 MovieClip Frame 1
stop();
Symbol 1532 MovieClip Frame 1
stop();
Symbol 1536 MovieClip Frame 1
stop();
Symbol 1540 MovieClip Frame 1
stop();
Symbol 1544 MovieClip Frame 1
stop();
Symbol 1548 MovieClip Frame 1
stop();
Symbol 1552 MovieClip Frame 1
stop();
Symbol 1557 MovieClip Frame 1
stop();
Symbol 1557 MovieClip Frame 2
play();
Symbol 1577 MovieClip Frame 1
stop();
Symbol 1612 MovieClip [supported_mc] Frame 1
stop();
Symbol 1614 MovieClip Frame 1
stop();
Symbol 1614 MovieClip Frame 300
_root.cekComplete(this);
Symbol 1616 MovieClip Frame 1
stop();
Symbol 1616 MovieClip Frame 240
_root.cekComplete(this);
Symbol 1618 MovieClip Frame 1
stop();
Symbol 1618 MovieClip Frame 180
_root.cekComplete(this);
Symbol 1620 MovieClip Frame 1
stop();
Symbol 1620 MovieClip Frame 180
_root.cekComplete(this);
Symbol 1622 MovieClip Frame 1
stop();
Symbol 1622 MovieClip Frame 150
_root.cekComplete(this);
Symbol 1624 MovieClip Frame 1
stop();
Symbol 1624 MovieClip Frame 150
_root.cekComplete(this);
Symbol 1626 MovieClip Frame 1
stop();
Symbol 1626 MovieClip Frame 135
_root.cekComplete(this);
Symbol 1630 MovieClip Frame 1
stop();
Symbol 1630 MovieClip Frame 120
_root.cekComplete(this);
if (this.sudahJadi == true) {
this.stop();
} else {
this.play();
}
Symbol 1632 MovieClip Frame 1
stop();
Symbol 1632 MovieClip Frame 120
_root.cekComplete(this);
if (this.sudahJadi == true) {
this.stop();
} else {
this.play();
}
Symbol 1635 MovieClip Frame 1
stop();
Symbol 1635 MovieClip Frame 600
_root.cekComplete(this);
Symbol 1636 MovieClip Frame 1
stop();
Symbol 1636 MovieClip Frame 480
_root.cekComplete(this);
Symbol 1637 MovieClip Frame 1
stop();
Symbol 1637 MovieClip Frame 360
_root.cekComplete(this);
Symbol 1639 MovieClip Frame 1
stop();
Symbol 1639 MovieClip Frame 300
_root.cekComplete(this);
Symbol 1641 MovieClip Frame 1
stop();
Symbol 1641 MovieClip Frame 240
_root.cekComplete(this);
Symbol 1644 MovieClip Frame 1
stop();
Symbol 1644 MovieClip Frame 240
_root.cekComplete(this);
Symbol 1647 MovieClip Frame 1
stop();
Symbol 1647 MovieClip Frame 240
_root.cekComplete(this);
Symbol 1649 MovieClip Frame 1
stop();
Symbol 1649 MovieClip Frame 180
_root.cekComplete(this);
if (this.sudahJadi == true) {
this.stop();
} else {
this.play();
}
Symbol 1651 MovieClip Frame 1
stop();
Symbol 1651 MovieClip Frame 600
_root.cekComplete(this);
Symbol 1652 MovieClip Frame 1
stop();
Symbol 1652 MovieClip Frame 540
_root.cekComplete(this);
Symbol 1654 MovieClip Frame 1
stop();
Symbol 1654 MovieClip Frame 500
_root.cekComplete(this);
Symbol 1656 MovieClip Frame 1
stop();
Symbol 1656 MovieClip Frame 400
_root.cekComplete(this);
Symbol 1658 MovieClip Frame 1
stop();
Symbol 1658 MovieClip Frame 360
_root.cekComplete(this);
Symbol 1660 MovieClip Frame 1
stop();
Symbol 1660 MovieClip Frame 480
_root.cekComplete(this);
Symbol 1662 MovieClip Frame 1
stop();
Symbol 1662 MovieClip Frame 360
_root.cekComplete(this);
Symbol 1663 MovieClip Frame 1
stop();
Symbol 1663 MovieClip Frame 720
_root.cekComplete(this);
Symbol 1665 MovieClip Frame 1
stop();
Symbol 1667 MovieClip Frame 1
stop();
Symbol 1669 MovieClip Frame 1
stop();
Symbol 1671 MovieClip Frame 1
stop();
Symbol 1673 MovieClip Frame 1
stop();
Symbol 1675 MovieClip Frame 1
stop();
Symbol 1677 MovieClip Frame 1
stop();
Symbol 1679 MovieClip Frame 1
stop();
Symbol 1681 MovieClip Frame 1
stop();
Symbol 1682 MovieClip Frame 1
stop();
Symbol 1683 MovieClip Frame 1
stop();
Symbol 1686 MovieClip Frame 1
stop();
Symbol 1689 MovieClip Frame 1
stop();
Symbol 1692 MovieClip Frame 1
stop();
Symbol 1695 MovieClip Frame 1
stop();
Symbol 1698 MovieClip Frame 1
stop();
Symbol 1698 MovieClip Frame 1200
_root.cekComplete(this);
Symbol 1704 MovieClip Frame 1
stop();
Symbol 1704 MovieClip Frame 1000
_root.cekComplete(this);
Symbol 1711 MovieClip Frame 1
stop();
Symbol 1711 MovieClip Frame 800
_root.cekComplete(this);
Symbol 1719 MovieClip Frame 1
stop();
Symbol 1719 MovieClip Frame 2
play();
Symbol 1725 MovieClip [ui_mc] Frame 1
stop();
Symbol 1735 MovieClip [granat_mc] Frame 1
stop();
Symbol 1735 MovieClip [granat_mc] Frame 2
play();
Symbol 1735 MovieClip [granat_mc] Frame 3
stop();
removeMovieClip(this);
Symbol 1816 MovieClip Frame 45
stop();
Symbol 1887 MovieClip Frame 40
removeMovieClip(_parent);
Symbol 1889 MovieClip Frame 45
removeMovieClip(_parent);
Symbol 1966 MovieClip Frame 45
stop();
Symbol 1968 MovieClip Frame 45
removeMovieClip(_parent);
Symbol 1970 MovieClip Frame 45
removeMovieClip(_parent);
Symbol 1992 MovieClip Frame 40
removeMovieClip(_parent);
Symbol 2013 MovieClip Frame 42
stop();
Symbol 2018 MovieClip [retak_mc] Frame 250
stop();
removeMovieClip(this);
Symbol 2020 MovieClip Frame 21
stop();
Symbol 2023 MovieClip [mortir_mc] Frame 1
stop();
Symbol 2023 MovieClip [mortir_mc] Frame 2
stop();
Symbol 2023 MovieClip [mortir_mc] Frame 3
stop();
removeMovieClip(this);
Symbol 2025 MovieClip [mortir_mc2] Frame 1
stop();
Symbol 2025 MovieClip [mortir_mc2] Frame 2
stop();
Symbol 2025 MovieClip [mortir_mc2] Frame 3
stop();
removeMovieClip(this);
Symbol 2029 MovieClip [efekGun] Frame 1
stop();
Symbol 2030 MovieClip [efekDarah] Frame 15
removeMovieClip(this);
Symbol 2064 MovieClip [efekGesek] Frame 7
stop();
Symbol 2079 MovieClip [efekDebu] Frame 15
stop();
removeMovieClip(this);
Symbol 2082 MovieClip [bomb_mc] Frame 1
stop();
Symbol 2082 MovieClip [bomb_mc] Frame 2
play();
Symbol 2082 MovieClip [bomb_mc] Frame 3
stop();
removeMovieClip(this);
Symbol 2084 MovieClip [mortar_mc] Frame 1
stop();
Symbol 2084 MovieClip [mortar_mc] Frame 2
play();
Symbol 2084 MovieClip [mortar_mc] Frame 3
stop();
removeMovieClip(this);
Symbol 2085 MovieClip Frame 21
stop();
Symbol 2087 MovieClip [misil1] Frame 1
stop();
Symbol 2087 MovieClip [misil1] Frame 2
stop();
Symbol 2089 MovieClip [misil2] Frame 1
stop();
Symbol 2089 MovieClip [misil2] Frame 2
stop();
Symbol 2091 MovieClip [misil3] Frame 1
stop();
Symbol 2091 MovieClip [misil3] Frame 2
stop();
Symbol 2093 MovieClip [misil4] Frame 1
stop();
Symbol 2093 MovieClip [misil4] Frame 2
stop();
Symbol 2125 MovieClip Frame 27
_root.cekKena(_parent);
_root.sound5();
Symbol 2125 MovieClip Frame 29
_root.cekKena(_parent);
_root.sound5();
Symbol 2125 MovieClip Frame 31
_root.cekKena(_parent);
_root.sound5();
Symbol 2133 MovieClip Frame 13
stop();
Symbol 2147 MovieClip Frame 15
stop();
Symbol 2149 MovieClip Frame 60
stop();
removeMovieClip(_parent);
Symbol 2168 MovieClip Frame 1
_root.sound3();
_parent.speedMelayang = 8;
Symbol 2168 MovieClip Frame 30
_root.sound3();
_parent.speedMelayang = 2;
Symbol 2168 MovieClip Frame 34
stop();
Symbol 2168 MovieClip Frame 61
play();
Symbol 2168 MovieClip Frame 90
_parent.melayang = false;
_parent.gotoAndStop(1);
Symbol 2169 MovieClip [troops41] Frame 1
stop();
Symbol 2186 MovieClip Frame 5
_root.cekKena(_parent, 100, -90, 1);
_root.sound6();
Symbol 2186 MovieClip Frame 9
_root.cekKena(_parent, 100, -90, 1);
_root.sound6();
Symbol 2186 MovieClip Frame 13
_root.cekKena(_parent, 100, -90, 1);
_root.sound6();
Symbol 2186 MovieClip Frame 17
_root.cekKena(_parent, 100, -90, 1);
_root.sound6();
Symbol 2186 MovieClip Frame 21
_root.cekKena(_parent, 100, -90, 1);
_root.sound6();
Symbol 2186 MovieClip Frame 30
_root.cekKena(_parent, 100, -90, 9);
_root.sound17();
Symbol 2187 MovieClip Frame 40
stop();
Symbol 2193 MovieClip Frame 30
_root.cekKena(_parent, 9);
_root.cekKena(_parent, 9);
_root.sound17();
Symbol 2193 MovieClip Frame 75
stop();
removeMovieClip(_parent);
Symbol 2194 MovieClip [troops42] Frame 1
stop();
Symbol 2210 MovieClip Frame 15
_root.buatTentaraJagoan(_parent);
_root.sound6();
Symbol 2213 MovieClip Frame 120
removeMovieClip(this);
Symbol 2217 MovieClip Frame 80
stop();
removeMovieClip(_parent);
Symbol 2218 MovieClip [troops43] Frame 1
stop();
Symbol 2229 MovieClip [info_box2] Frame 1
stop();
Symbol 2235 MovieClip [info_box3] Frame 1
stop();
Symbol 2243 MovieClip Frame 1
play();
Symbol 2243 MovieClip Frame 200
stop();
Symbol 2246 MovieClip Frame 1
stop();
Symbol 2254 MovieClip [rel_mc4] Frame 1
stop();
Symbol 2270 MovieClip [rel_mc3] Frame 1
stop();
Symbol 2274 MovieClip Frame 1
_root.backJatuh();
Symbol 2274 MovieClip Frame 81
stop();
removeMovieClip(_parent);
Symbol 2275 MovieClip Frame 16
stop();
_root.buatKendaraan(_parent);
Symbol 2276 MovieClip Frame 1
stop();
Symbol 2285 MovieClip Frame 1
stop();
Symbol 2290 MovieClip Frame 16
stop();
_root.buatKendaraan(_parent, 2);
Symbol 2291 MovieClip Frame 1
stop();
Symbol 2297 MovieClip Frame 1
stop();
Symbol 2311 MovieClip Frame 1
stop();
Symbol 2314 MovieClip Frame 1
stop();
Symbol 2331 MovieClip Frame 1
stop();
Symbol 2337 MovieClip Frame 1
stop();
Symbol 2338 MovieClip [menu_mc] Frame 1
function cekSpeedQuality() {
i = 1;
while (i <= 3) {
this["speed" + i].angka = i;
this["quality" + i].angka = i;
this["speed" + i].gotoAndStop(1);
this["quality" + i].gotoAndStop(1);
this["speed" + i].onRelease = klikSpeed;
this["quality" + i].onRelease = klikQuality;
this["speed" + i].onRollOver = function () {
over();
};
this["quality" + i].onRollOver = function () {
over();
};
i++;
}
this["speed" + _root.speedGame].gotoAndStop(2);
this["quality" + _root.qualityGame].gotoAndStop(2);
}
function klikSpeed() {
klik();
indi = new String(this);
_root.speedGame = Number(indi.substr(indi.length - 1, 1));
cekSpeedQuality();
}
function klikQuality() {
klik();
indi = new String(this);
_root.qualityGame = Number(indi.substr(indi.length - 1, 1));
if (_root.qualityGame == 1) {
_quality = "HIGH";
} else if (_root.qualityGame == 2) {
_quality = "MEDIUM";
} else if (_root.qualityGame == 3) {
_quality = "LOW";
}
cekSpeedQuality();
}
stop();
bar1_mc.bar_mc._x = Math.ceil((_root.volum1 / 0.434782608695652) - 115);
bar1_mc.bar_mc.onEnterFrame = function () {
_root.volum1 = int(0.434782608695652 * (this._x + 115));
_root.myMusic.setVolume(_root.volum1);
bar1_mc.persen1 = _root.volum1 + " %";
};
bar1_mc.indi_mc.onPress = function () {
klik();
startDrag (bar1_mc.bar_mc, true, -115, 0, 115, 0);
};
bar1_mc.indi_mc.onRelease = (bar1_mc.indi_mc.onReleaseOutside = function () {
over();
stopDrag();
});
bar2_mc.bar_mc._x = Math.ceil((_root.volum2 / 0.434782608695652) - 115);
bar2_mc.bar_mc.onEnterFrame = function () {
_root.volum2 = int(0.434782608695652 * (this._x + 115));
_root.volum3 = int(0.434782608695652 * (this._x + 115));
_root.mySound.setVolume(_root.volum2);
_root.mySound2.setVolume(_root.volum3);
bar2_mc.persen2 = _root.volum2 + " %";
};
bar2_mc.indi_mc.onPress = function () {
klik();
startDrag (bar2_mc.bar_mc, true, -115, 0, 115, 0);
};
bar2_mc.indi_mc.onRelease = (bar2_mc.indi_mc.onReleaseOutside = function () {
over();
stopDrag();
});
cekSpeedQuality();
if (_root.adaEfekKah == true) {
effect_mc.gotoAndStop(1);
} else {
effect_mc.gotoAndStop(2);
}
effect_mc.onRelease = function () {
if (_root.adaEfekKah == true) {
_root.adaEfekKah = false;
} else {
_root.adaEfekKah = true;
}
if (_root.adaEfekKah == true) {
effect_mc.gotoAndStop(1);
} else {
effect_mc.gotoAndStop(2);
}
};
Symbol 2338 MovieClip [menu_mc] Frame 2
function cekSpeedQuality() {
i = 1;
while (i <= 3) {
this["speed" + i].angka = i;
this["quality" + i].angka = i;
this["speed" + i].gotoAndStop(1);
this["quality" + i].gotoAndStop(1);
this["speed" + i].onRelease = klikSpeed;
this["quality" + i].onRelease = klikQuality;
this["speed" + i].onRollOver = function () {
over();
};
this["quality" + i].onRollOver = function () {
over();
};
i++;
}
this["speed" + _root.speedGame].gotoAndStop(2);
this["quality" + _root.qualityGame].gotoAndStop(2);
}
function klikSpeed() {
klik();
indi = new String(this);
_root.speedGame = Number(indi.substr(indi.length - 1, 1));
cekSpeedQuality();
}
function klikQuality() {
klik();
indi = new String(this);
_root.qualityGame = Number(indi.substr(indi.length - 1, 1));
if (_root.qualityGame == 1) {
_quality = "HIGH";
} else if (_root.qualityGame == 2) {
_quality = "MEDIUM";
} else if (_root.qualityGame == 3) {
_quality = "LOW";
}
cekSpeedQuality();
}
stop();
bar1_mc.bar_mc._x = Math.ceil((_root.volum1 / 0.434782608695652) - 115);
bar1_mc.bar_mc.onEnterFrame = function () {
_root.volum1 = int(0.434782608695652 * (this._x + 115));
_root.myMusic.setVolume(_root.volum1);
bar1_mc.persen1 = _root.volum1 + " %";
};
bar1_mc.indi_mc.onPress = function () {
klik();
startDrag (bar1_mc.bar_mc, true, -115, 0, 115, 0);
};
bar1_mc.indi_mc.onRelease = (bar1_mc.indi_mc.onReleaseOutside = function () {
over();
stopDrag();
});
bar2_mc.bar_mc._x = Math.ceil((_root.volum2 / 0.434782608695652) - 115);
bar2_mc.bar_mc.onEnterFrame = function () {
_root.volum2 = int(0.434782608695652 * (this._x + 115));
_root.volum3 = int(0.434782608695652 * (this._x + 115));
_root.mySound.setVolume(_root.volum2);
_root.mySound2.setVolume(_root.volum3);
bar2_mc.persen2 = _root.volum2 + " %";
};
bar2_mc.indi_mc.onPress = function () {
klik();
startDrag (bar2_mc.bar_mc, true, -115, 0, 115, 0);
};
bar2_mc.indi_mc.onRelease = (bar2_mc.indi_mc.onReleaseOutside = function () {
over();
stopDrag();
});
cekSpeedQuality();
if (_root.adaEfekKah == true) {
effect_mc.gotoAndStop(1);
} else {
effect_mc.gotoAndStop(2);
}
effect_mc.onRelease = function () {
if (_root.adaEfekKah == true) {
_root.adaEfekKah = false;
} else {
_root.adaEfekKah = true;
}
if (_root.adaEfekKah == true) {
effect_mc.gotoAndStop(1);
} else {
effect_mc.gotoAndStop(2);
}
};
Symbol 2338 MovieClip [menu_mc] Frame 3
function cekSpeedQuality() {
i = 1;
while (i <= 3) {
this["speed" + i].angka = i;
this["quality" + i].angka = i;
this["speed" + i].gotoAndStop(1);
this["quality" + i].gotoAndStop(1);
this["speed" + i].onRelease = klikSpeed;
this["quality" + i].onRelease = klikQuality;
this["speed" + i].onRollOver = function () {
over();
};
this["quality" + i].onRollOver = function () {
over();
};
i++;
}
this["speed" + _root.speedGame].gotoAndStop(2);
this["quality" + _root.qualityGame].gotoAndStop(2);
}
function klikSpeed() {
klik();
indi = new String(this);
_root.speedGame = Number(indi.substr(indi.length - 1, 1));
cekSpeedQuality();
}
function klikQuality() {
klik();
indi = new String(this);
_root.qualityGame = Number(indi.substr(indi.length - 1, 1));
if (_root.qualityGame == 1) {
_quality = "HIGH";
} else if (_root.qualityGame == 2) {
_quality = "MEDIUM";
} else if (_root.qualityGame == 3) {
_quality = "LOW";
}
cekSpeedQuality();
}
stop();
bar1_mc.bar_mc._x = Math.ceil((_root.volum1 / 0.434782608695652) - 115);
bar1_mc.bar_mc.onEnterFrame = function () {
_root.volum1 = int(0.434782608695652 * (this._x + 115));
_root.myMusic.setVolume(_root.volum1);
bar1_mc.persen1 = _root.volum1 + " %";
};
bar1_mc.indi_mc.onPress = function () {
klik();
startDrag (bar1_mc.bar_mc, true, -115, 0, 115, 0);
};
bar1_mc.indi_mc.onRelease = (bar1_mc.indi_mc.onReleaseOutside = function () {
over();
stopDrag();
});
bar2_mc.bar_mc._x = Math.ceil((_root.volum2 / 0.434782608695652) - 115);
bar2_mc.bar_mc.onEnterFrame = function () {
_root.volum2 = int(0.434782608695652 * (this._x + 115));
_root.volum3 = int(0.434782608695652 * (this._x + 115));
_root.mySound.setVolume(_root.volum2);
_root.mySound2.setVolume(_root.volum3);
bar2_mc.persen2 = _root.volum2 + " %";
};
bar2_mc.indi_mc.onPress = function () {
klik();
startDrag (bar2_mc.bar_mc, true, -115, 0, 115, 0);
};
bar2_mc.indi_mc.onRelease = (bar2_mc.indi_mc.onReleaseOutside = function () {
over();
stopDrag();
});
cekSpeedQuality();
if (_root.adaEfekKah == true) {
effect_mc.gotoAndStop(1);
} else {
effect_mc.gotoAndStop(2);
}
effect_mc.onRelease = function () {
if (_root.adaEfekKah == true) {
_root.adaEfekKah = false;
} else {
_root.adaEfekKah = true;
}
if (_root.adaEfekKah == true) {
effect_mc.gotoAndStop(1);
} else {
effect_mc.gotoAndStop(2);
}
};
Symbol 2366 MovieClip [tutorial_mc] Frame 1
stop();
Symbol 2381 MovieClip [tutorial_mc2] Frame 1
stop();
Symbol 2383 MovieClip Frame 10
stop();
_parent.gotoAndStop(1);
Symbol 2384 MovieClip Frame 1
stop();
Symbol 2394 MovieClip [info_box6] Frame 1
stop();
Symbol 2445 MovieClip Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 2445 MovieClip Frame 225
_root.nextFrame();
Symbol 2446 MovieClip Frame 1
this.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Symbol 2452 MovieClip Frame 1
this.onRelease = function () {
getURL ("http://www.belugerinstudios.com", "_blank");
};
Symbol 2477 MovieClip Frame 1
this.onRelease = function () {
};
Symbol 2528 MovieClip Frame 1
this.onRelease = function () {
getURL ("http://www.belugerinstudios.com/", "_blank");
};
Symbol 2542 MovieClip Frame 1
stop();
Symbol 2544 MovieClip Frame 1
stop();
Symbol 2572 MovieClip Frame 1
stop();
Symbol 2576 MovieClip Frame 1
stop();
Symbol 2580 MovieClip Frame 1
stop();
Symbol 2584 MovieClip Frame 1
stop();
Symbol 2589 MovieClip Frame 1
stop();
Symbol 2593 MovieClip Frame 1
stop();
Symbol 2597 MovieClip Frame 1
stop();
Symbol 2601 MovieClip Frame 1
stop();
Symbol 2605 MovieClip Frame 1
stop();
Symbol 2609 MovieClip Frame 1
stop();
Symbol 2613 MovieClip Frame 1
stop();
Symbol 2617 MovieClip Frame 1
stop();
Symbol 2621 MovieClip Frame 1
stop();
Symbol 2625 MovieClip Frame 1
stop();
Symbol 2649 MovieClip Frame 1
stop();
Symbol 2649 MovieClip Frame 120
_root.cekComplete(this);
if (this.sudahJadi == true) {
this.stop();
} else {
this.play();
}
Symbol 2650 MovieClip Frame 1
stop();
Symbol 2650 MovieClip Frame 120
_root.cekComplete(this);
if (this.sudahJadi == true) {
this.stop();
} else {
this.play();
}
Symbol 2651 MovieClip Frame 1
stop();
Symbol 2651 MovieClip Frame 135
_root.cekComplete(this);
Symbol 2653 MovieClip Frame 1
stop();
Symbol 2653 MovieClip Frame 150
_root.cekComplete(this);
Symbol 2654 MovieClip Frame 1
stop();
Symbol 2654 MovieClip Frame 150
_root.cekComplete(this);
Symbol 2655 MovieClip Frame 1
stop();
Symbol 2655 MovieClip Frame 180
_root.cekComplete(this);
Symbol 2656 MovieClip Frame 1
stop();
Symbol 2656 MovieClip Frame 180
_root.cekComplete(this);
Symbol 2657 MovieClip Frame 1
stop();
Symbol 2657 MovieClip Frame 240
_root.cekComplete(this);
Symbol 2658 MovieClip Frame 1
stop();
Symbol 2658 MovieClip Frame 300
_root.cekComplete(this);
Symbol 2660 MovieClip Frame 1
stop();
Symbol 2660 MovieClip Frame 180
_root.cekComplete(this);
if (this.sudahJadi == true) {
this.stop();
} else {
this.play();
}
Symbol 2661 MovieClip Frame 1
stop();
Symbol 2661 MovieClip Frame 240
_root.cekComplete(this);
Symbol 2662 MovieClip Frame 1
stop();
Symbol 2662 MovieClip Frame 240
_root.cekComplete(this);
Symbol 2663 MovieClip Frame 1
stop();
Symbol 2663 MovieClip Frame 240
_root.cekComplete(this);
Symbol 2664 MovieClip Frame 1
stop();
Symbol 2664 MovieClip Frame 300
_root.cekComplete(this);
Symbol 2670 MovieClip Frame 1
stop();
Symbol 2670 MovieClip Frame 360
_root.cekComplete(this);
Symbol 2677 MovieClip Frame 1
stop();
Symbol 2677 MovieClip Frame 480
_root.cekComplete(this);
Symbol 2683 MovieClip Frame 1
stop();
Symbol 2683 MovieClip Frame 600
_root.cekComplete(this);
Symbol 2684 MovieClip Frame 1
stop();
Symbol 2684 MovieClip Frame 360
_root.cekComplete(this);
Symbol 2685 MovieClip Frame 1
stop();
Symbol 2685 MovieClip Frame 480
_root.cekComplete(this);
Symbol 2686 MovieClip Frame 1
stop();
Symbol 2686 MovieClip Frame 360
_root.cekComplete(this);
Symbol 2687 MovieClip Frame 1
stop();
Symbol 2687 MovieClip Frame 400
_root.cekComplete(this);
Symbol 2688 MovieClip Frame 1
stop();
Symbol 2688 MovieClip Frame 500
_root.cekComplete(this);
Symbol 2689 MovieClip Frame 1
stop();
Symbol 2689 MovieClip Frame 540
_root.cekComplete(this);
Symbol 2690 MovieClip Frame 1
stop();
Symbol 2690 MovieClip Frame 600
_root.cekComplete(this);
Symbol 2691 MovieClip Frame 1
stop();
Symbol 2691 MovieClip Frame 720
_root.cekComplete(this);
Symbol 2692 MovieClip Frame 1
stop();
Symbol 2692 MovieClip Frame 250
_root.cekComplete(this);
stop();
Symbol 2693 MovieClip Frame 1
stop();
Symbol 2693 MovieClip Frame 250
_root.cekComplete(this);
stop();
Symbol 2694 MovieClip Frame 1
stop();
Symbol 2694 MovieClip Frame 250
_root.cekComplete(this);
stop();
Symbol 2695 MovieClip Frame 1
stop();
Symbol 2695 MovieClip Frame 275
_root.cekComplete(this);
stop();
Symbol 2696 MovieClip Frame 1
stop();
Symbol 2696 MovieClip Frame 275
_root.cekComplete(this);
stop();
Symbol 2697 MovieClip Frame 1
stop();
Symbol 2697 MovieClip Frame 275
_root.cekComplete(this);
stop();
Symbol 2698 MovieClip Frame 1
stop();
Symbol 2698 MovieClip Frame 200
_root.cekComplete(this);
stop();
Symbol 2699 MovieClip Frame 1
stop();
Symbol 2699 MovieClip Frame 250
_root.cekComplete(this);
stop();
Symbol 2700 MovieClip Frame 1
stop();
Symbol 2700 MovieClip Frame 300
_root.cekComplete(this);
stop();
Symbol 2701 MovieClip Frame 1
stop();
Symbol 2701 MovieClip Frame 360
_root.cekComplete(this);
stop();
Symbol 2702 MovieClip Frame 1
stop();
Symbol 2702 MovieClip Frame 400
_root.cekComplete(this);
stop();
Symbol 2703 MovieClip Frame 1
stop();
Symbol 2703 MovieClip Frame 300
_root.cekComplete(this);
stop();
Symbol 2704 MovieClip Frame 1
stop();
Symbol 2704 MovieClip Frame 400
_root.cekComplete(this);
stop();
Symbol 2705 MovieClip Frame 1
stop();
Symbol 2705 MovieClip Frame 500
_root.cekComplete(this);
stop();
Symbol 2706 MovieClip Frame 1
stop();
Symbol 2706 MovieClip Frame 600
_root.cekComplete(this);
stop();
Symbol 2708 MovieClip Frame 1
stop();
Symbol 2708 MovieClip Frame 800
_root.cekComplete(this);
Symbol 2709 MovieClip Frame 1
stop();
Symbol 2709 MovieClip Frame 1000
_root.cekComplete(this);
Symbol 2710 MovieClip Frame 1
stop();
Symbol 2710 MovieClip Frame 1200
_root.cekComplete(this);
Symbol 2711 MovieClip Frame 1
stop();
Symbol 2714 MovieClip Frame 1
stop();
Symbol 2715 MovieClip Frame 1
stop();
Symbol 2716 MovieClip Frame 1
stop();
Symbol 2717 MovieClip Frame 1
stop();
Symbol 2718 MovieClip Frame 1
stop();
Symbol 2719 MovieClip Frame 1
stop();
Symbol 2720 MovieClip Frame 1
stop();
Symbol 2743 MovieClip Frame 1
stop();
Symbol 2744 MovieClip Frame 1
stop();
Symbol 2745 MovieClip Frame 1
stop();
Symbol 2746 MovieClip Frame 1
stop();
Symbol 2747 MovieClip Frame 1
stop();
Symbol 2748 MovieClip Frame 1
stop();
Symbol 2749 MovieClip Frame 1
stop();
Symbol 2750 MovieClip Frame 1
stop();
Symbol 2751 MovieClip Frame 1
stop();
Symbol 2752 MovieClip Frame 1
stop();
Symbol 2753 MovieClip Frame 1
stop();
Symbol 2754 MovieClip Frame 1
stop();
Symbol 2758 MovieClip Frame 1
stop();
Symbol 2761 MovieClip Frame 1
stop();
Symbol 2764 MovieClip Frame 1
stop();
Symbol 2767 MovieClip Frame 1
stop();
Symbol 2774 MovieClip Frame 1
stop();
Symbol 2777 MovieClip Frame 1
stop();
Symbol 2780 MovieClip Frame 1
stop();
Symbol 2783 MovieClip Frame 1
stop();
Symbol 2790 MovieClip Frame 1
stop();
Symbol 2793 MovieClip Frame 1
stop();
Symbol 2796 MovieClip Frame 1
stop();
Symbol 2799 MovieClip Frame 1
stop();
Symbol 2802 MovieClip Frame 1
stop();