Frame 1
var _mochiads_game_id = "50efeb62516d7ec9";
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("2c269e28", this, 10301, true);
__com_mochibot__("4ae5a7d5", this, 10301, true);
Instance of Symbol 506 MovieClip in Frame 1
/* no clip actions */
Frame 2
function Armada(trida, pocet, prichod) {
this.trida = trida;
this.pocet = pocet;
this.prichod = prichod;
}
function dalsiMise(osvobozovat) {
var _local2;
var _local4;
var _local3;
if (osvobozovat) {
if (_root.cisloMise > 10) {
if (_root.vysledekBoje > 0) {
_local3 = 4;
} else {
_local3 = -1;
}
_local2 = 1;
while (_local2 <= 3) {
if (_root["zajatec" + _local2]) {
_root[("hrdina" + _root["zajatec" + _local2]) + "stav"] = _local3;
trace("urcen osud hrdiny c." + _root["zajatec" + _local2]);
_root[(("emisar" + (_root.cisloMise - 10)) + "_") + _local2] = 0;
}
_root["zajatec" + _local2] = 0;
_local2++;
}
_root.cisloMise = _root.cisloMise - 10;
}
_local4 = false;
_local2 = 1;
while (_local2 <= 3) {
if (_root[("hrdina" + _root[(("emisar" + _root.cisloMise) + "_") + _local2]) + "stav"] == -2) {
_local4 = true;
_root["zajatec" + _local2] = _root[(("emisar" + _root.cisloMise) + "_") + _local2];
}
_local2++;
}
if (_local4) {
_root.cisloMise = _root.cisloMise + 10;
return(_root.cisloMise);
}
}
cisloMise++;
if (cisloMise > _root.bitvy[kapitola].length) {
cisloMise = 1;
kapitola++;
}
if (kapitola >= _root.bitvy.length) {
return(0);
}
return(kapitola);
}
function pocetJednotek(kap, mis, ofset) {
var _local3;
var _local2;
_local3 = 0;
_local2 = _root.bitvy[kap][mis - 1].oddily[ofset].pocet;
if (_local2 && (!_root.bitvy[kap][mis - 1].oddily[ofset].prichod)) {
_local3 = _local3 + _local2;
}
_local2 = _root.bitvy[kap][mis - 1].oddily[ofset + 1].pocet;
if (_local2 && (!_root.bitvy[kap][mis - 1].oddily[ofset + 1].prichod)) {
_local3 = _local3 + _local2;
}
_local2 = _root.bitvy[kap][mis - 1].oddily[ofset + 2].pocet;
if (_local2 && (!_root.bitvy[kap][mis - 1].oddily[ofset + 2].prichod)) {
_local3 = _local3 + _local2;
}
return(_local3);
}
function pocetNepratel(kap, mis) {
return(pocetJednotek(kap, mis, 0));
}
function pocetSpojencu(kap, mis) {
return(pocetJednotek(kap, mis, 3));
}
function pocetPosil(kap, mis) {
var _local2 = _root.bitvy[kap][mis - 1].oddily[6].pocet;
if (_local2) {
return(_local2);
}
return(0);
}
function osvobozuj(hrd1, hrd2) {
var _local2;
_local2 = _root["mapaBojiste" + bitvy[kapitola][cisloMise - 11].bojiste].hlavniTeren;
if (!_local2) {
_local2 = random(5) + 1;
}
mapaBojiste = _root["mapaBojiste" + _local2];
naverbujSkupinu("skretiOddil", 2 + random(3), _root.potvory, false);
if (!random(4)) {
POSILA2CAS = random(4) + 2;
naverbujSkupinu("skretiOddil", 1 + random(3), _root.potvory, true);
}
_root.hrdina1meziPostavama = 0;
_root.hrdina2meziPostavama = 0;
_root.hrdina3meziPostavama = 0;
var _local5;
if (hrd1) {
_root.postavy.push(_root.hrdinoveTypy[hrd1]);
_root.hrdina1meziPostavama = _root.postavy.length;
}
if (hrd2) {
_root.postavy.push(_root.hrdinoveTypy[hrd2]);
_root.hrdina2meziPostavama = _root.postavy.length;
}
defaultuj();
if (RAZENI1Y > 0) {
UTEK1 = 3;
} else if (RAZENI1Y < 0) {
UTEK1 = 1;
} else if (RAZENI1X > 0) {
UTEK1 = 2;
} else {
UTEK1 = 4;
}
}
function nastavOkolnostiMise(kap, mis, hrd1, hrd2, hrd3) {
var _local7;
var _local11;
var _local12;
var _local6;
var _local3;
var _local2;
if (!kap) {
kap = random(_root.bitvy.length - 1) + 1;
}
if (!mis) {
mis = random(_root.bitvy.kap.length) + 1;
}
POSILA1CAS = 0;
POSILA2CAS = 0;
_local6 = _root.bitvy[kap][mis - 1].bojiste;
if (!_local6) {
_local6 = random(6) + 1;
}
_root.mapaBojiste = _root["mapaBojiste" + _local6];
_local7 = _root.bitvy[kap][mis - 1].podminky;
_local2 = _root.bitvy[kap][mis - 1].oddily[0];
if (_local2.prichod) {
POSILA2CAS = _local2.prichod;
_local3 = true;
} else {
_local3 = false;
}
naverbujSkupinu(_local2.trida, _local2.pocet, _root.potvory, _local3);
_local2 = _root.bitvy[kap][mis - 1].oddily[1];
if (_local2.prichod) {
POSILA2CAS = _local2.prichod;
_local3 = true;
} else {
_local3 = false;
}
naverbujSkupinu(_local2.trida, _local2.pocet, _root.potvory, _local3);
_local2 = _root.bitvy[kap][mis - 1].oddily[2];
if (_local2.prichod) {
POSILA2CAS = _local2.prichod;
_local3 = true;
} else {
_local3 = false;
}
naverbujSkupinu(_local2.trida, _local2.pocet, _root.potvory, _local3);
_local2 = _root.bitvy[kap][mis - 1].oddily[3];
if (_local2.prichod) {
POSILA1CAS = _local2.prichod;
_local3 = true;
} else {
_local3 = false;
}
naverbujSkupinu(_local2.trida, _local2.pocet, _root.postavy, false);
_local2 = _root.bitvy[kap][mis - 1].oddily[4];
if (_local2.prichod) {
POSILA1CAS = _local2.prichod;
_local3 = true;
} else {
_local3 = false;
}
naverbujSkupinu(_local2.trida, _local2.pocet, _root.postavy, _local3);
_local2 = _root.bitvy[kap][mis - 1].oddily[5];
if (_local2.prichod) {
POSILA1CAS = _local2.prichod;
_local3 = true;
} else {
_local3 = false;
}
naverbujSkupinu(_local2.trida, _local2.pocet, _root.postavy, _local3);
_root.hrdina1meziPostavama = 0;
_root.hrdina2meziPostavama = 0;
_root.hrdina3meziPostavama = 0;
if (hrd1) {
_root.postavy.push(_root.hrdinoveTypy[hrd1]);
_root.hrdina1meziPostavama = _root.postavy.length;
_local2 = _root["oddil" + hrd1];
naverbujSkupinu(_local2.trida, _local2.pocet, _root.postavy, false);
}
if (hrd2) {
_root.postavy.push(_root.hrdinoveTypy[hrd2]);
_root.hrdina2meziPostavama = _root.postavy.length;
_local2 = _root["oddil" + hrd2];
naverbujSkupinu(_local2.trida, _local2.pocet, _root.postavy, false);
}
if (hrd3) {
_root.postavy.push(_root.hrdinoveTypy[hrd3]);
_root.hrdina3meziPostavama = _root.postavy.length;
_local2 = _root["oddil" + hrd3];
naverbujSkupinu(_local2.trida, _local2.pocet, _root.postavy, false);
}
defaultuj();
_local7 = _root["podminkyBoje" + _root.bitvy[kap][mis - 1].podminky];
nasadPodminky(_local7);
}
function nasadPodminky(p, h1, h2) {
if (h1) {
HRAC1 = h1;
} else {
HRAC1 = 1;
}
if (h2) {
HRAC2 = h2;
} else {
HRAC2 = 0;
}
if (p.DILKUX) {
DILKUX = p.DILKUX;
}
if (p.DILKUY) {
DILKUY = p.DILKUY;
}
if (p.HLAVNIHRDINA1) {
HLAVNIHRDINA1 = p.HLAVNIHRDINA1;
}
if (p.HLAVNIHRDINA2) {
HLAVNIHRDINA2 = p.HLAVNIHRDINA2;
}
if (p.VIP1) {
VIP1 = p.VIP1;
}
if (p.VIP2) {
VIP2 = p.VIP2;
}
if (p.POKLAD1) {
POKLAD1 = p.POKLAD1;
}
if (p.POKLAD2) {
POKLAD2 = p.POKLAD2;
}
if (p.POKLAD1X) {
POKLAD1X = p.POKLAD1X;
POKLAD1Y = p.POKLAD1Y;
}
if (p.POKLAD2X) {
POKLAD2X = p.POKLAD2X;
POKLAD2Y = p.POKLAD2Y;
}
if (p.UTEK1 != undefined) {
UTEK1 = p.UTEK1;
}
if (p.UTEK2 != undefined) {
UTEK2 = p.UTEK2;
}
if (p.MORALKA1) {
MORALKA1 = p.MORALKA1;
}
if (p.MORALKA2) {
MORALKA2 = p.MORALKA2;
}
if (p.RAZENI1X != undefined) {
RAZENI1X = p.RAZENI1X;
RAZENI1Y = p.RAZENI1Y;
}
if (p.RAZENI2X != undefined) {
RAZENI2X = p.RAZENI2X;
RAZENI2Y = p.RAZENI2Y;
}
if (p.POSILA1X != undefined) {
POSILA1X = p.POSILA1X;
POSILA1Y = p.POSILA1Y;
}
if (p.POSILA1CAS) {
POSILA1CAS = p.POSILA1CAS;
}
if (p.POSILA2X != undefined) {
POSILA2X = p.POSILA2X;
POSILA2Y = p.POSILA2Y;
}
if (p.POSILA2CAS) {
POSILA2CAS = p.POSILA2CAS;
}
if (p.poucka) {
poucka = p.poucka;
}
}
function defaultuj() {
var _local2;
var _local5;
var _local4;
var _local3;
_local5 = 0;
_local4 = 21;
_local3 = 0;
_local2 = 0;
while (_local2 < potvory.length) {
if (potvory[_local2] > 0) {
_local3++;
}
_local2++;
}
_local2 = 0;
while (_local2 < postavy.length) {
if (postavy[_local2] > 0) {
_local3++;
}
_local2++;
}
if (_local3 <= 8) {
_local4 = 9;
}
if (_local3 <= 4) {
_local4 = 7;
}
if (_local3 > 10) {
_local5 = 9;
}
if (_local3 > 14) {
_local5 = 11;
}
_root.DILKUX = (9 + (2 * random(2))) - (2 * random(2));
if (_root.DILKUX > _local4) {
_root.DILKUX = _local4;
}
if (_root.DILKUX < _local5) {
_root.DILKUX = _local5;
}
_root.DILKUY = 9;
_root.RAZENI1X = random(3) - 1;
_root.RAZENI2X = _root.RAZENI1X * -1;
_root.RAZENI1Y = (random(2) * 2) - 1;
_root.RAZENI2Y = _root.RAZENI1Y * -1;
_root.HRAC1 = 1;
_root.HRAC2 = 0;
_root.POKLAD1 = 0;
_root.POKLAD1X = 0;
_root.POKLAD1Y = 0;
_root.POKLAD2 = 0;
_root.POKLAD2X = 0;
_root.POKLAD2Y = 0;
_root.POSILA1X = _root.RAZENI1X;
_root.POSILA2X = _root.RAZENI2X;
_root.POSILA1Y = _root.RAZENI1Y;
_root.POSILA2Y = _root.RAZENI2Y;
_root.HLAVNIHRDINA1 = 0;
_root.HLAVNIHRDINA2 = 0;
_root.VIP1 = 0;
_root.VIP2 = 0;
_root.UTEK1 = random(6);
_root.UTEK2 = random(6);
_root.MORALKA1 = 0;
_root.MORALKA2 = 0;
_root.poucka = "";
}
function zacni() {
potvory = new Array();
postavy = new Array();
zraneni = new Array();
potvory0 = new Array();
postavy0 = new Array();
zraneni0 = new Array();
vysledek = new Array(10);
zkusenost = 0;
zkusenostTed = 0;
bonusStreh = 0;
bonusZivotu = 0;
var _local3;
_local3 = 1;
while (_local3 < 9) {
this["oddil" + _local3] = new Armada(0, 0, 0);
this["oddilSave" + _local3] = new Armada(0, 0, 0);
_local3++;
}
kapitola = 1;
cisloMise = 0;
vyhranoBitev = 0;
_root.hrdina1meziPostavama = 0;
_root.hrdina2meziPostavama = 0;
_root.hrdina3meziPostavama = 0;
hrdina1stav = 4;
hrdina2stav = 4;
hrdina3stav = 4;
hrdina4stav = 4;
hrdina5stav = 4;
hrdina6stav = 4;
hrdina7stav = 4;
hrdina8stav = 4;
}
function testujUpgrade() {
var _local2 = zkusenost;
odecti = 9;
var _local1;
_local1 = 1;
while (_local1 <= bonusStreh) {
_local2 = _local2 - odecti;
odecti = odecti + 2;
_local1++;
}
_local1 = 1;
while (_local1 <= bonusZivotu) {
_local2 = _local2 - odecti;
odecti = odecti + 2;
_local1 = _local1 + 2;
}
if (_local2 >= odecti) {
return(1);
}
return(0);
}
function uzdravSkupinu(strana, kolik) {
if (strana == 1) {
pole = _root.postavy;
} else {
pole = _root.potvory;
}
var _local4;
var _local2;
_local2 = pole.length - 1;
_local2 = 0;
while (_local2 < pole.length) {
zraneni[_local2] = zraneni[_local2] - kolik;
if (zraneni[_local2] < 0) {
zraneni[_local2] = 0;
}
_local2++;
}
}
function vyprazdniSkupinu(strana) {
var _local2;
var _local4;
var _local3;
if (strana == 2) {
_local3 = _root.potvory;
} else {
_local3 = _root.postavy;
}
_local4 = _local3.length;
if (!_local4) {
return(0);
}
_local2 = 0;
while (_local2 < _local4) {
_local3.pop();
_local2++;
}
}
function vyprazdniOddil(cislo) {
_root["oddil" + cislo] = 0;
}
function naplnOddil(cislo) {
_root["oddil" + cislo] = _root.bitvy[_root.kapitola][_root.cisloMise - 1].oddily[6];
}
function zobrazVysledek(vys) {
if (!vys) {
return(0);
}
var _local1 = "";
switch (vys) {
case -5 :
_local1 = "vymlacen";
break;
case -4 :
_local1 = "ukraden";
break;
case -3 :
_local1 = "zavrazden";
break;
case -2 :
_local1 = "zavrazden";
break;
case -1 :
_local1 = "utecen";
break;
case 1 :
_local1 = "utekl";
break;
case 2 :
_local1 = "zavrazdil";
break;
case 3 :
_local1 = "zavrazdil";
break;
case 4 :
_local1 = "ukradl";
break;
case 5 :
_local1 = "vymlatil";
break;
case 6 :
_local1 = "endOfTraining";
}
prohlas(_local1);
}
function prohlas(co) {
if (!co) {
_root.bojiste.ukazMenu(true);
hlaska._visible = false;
return(0);
}
_root.bojiste.ukazMenu(false);
hlaska._visible = true;
hlaska.gotoAndStop(co);
}
function cisloTridyOddilu(trida) {
cislo = 0;
x = 1;
while (x < skupinyPotvor.length) {
if (skupinyPotvor[x].id == trida) {
cislo = x;
break;
}
x++;
}
return(cislo);
}
function reprezentantTridy(kap, mis, typ) {
var _local3;
if (!mis) {
_local3 = _root.cisloTridyOddilu(_root["oddil" + kap].trida);
} else {
_local3 = _root.cisloTridyOddilu(_root.bitvy[kap][mis - 1].oddily[(typ * 3) - 3].trida);
}
var _local2 = _root.skupinyPotvor[_local3].leader;
if (!_local2) {
_local2 = _root.skupinyPotvor[_local3].clenove[0];
}
if (typ == 1) {
return((_root.typyPotvor[_local2].postava * 2) - 1);
}
return(_root.typyPotvor[_local2].postava * 2);
}
function naverbujSkupinu(typ, kolik, kam, zaloha) {
if ((!kolik) || (!kam)) {
return(0);
}
var _local3;
var _local2;
var _local14;
var _local4;
var _local6;
if (typ.length) {
_local3 = cisloTridyOddilu(typ);
} else {
_local3 = typ;
}
var _local7 = 0;
var _local12 = skupinyPotvor[_local3].leader;
if (_local12) {
if (zaloha) {
_local12 = _local12 * -1;
}
kam.push(_local12);
_root.zraneni.push(0);
_local7++;
if (_local7 >= kolik) {
return(_local7);
}
}
var _local8;
_local8 = 0;
_local2 = 0;
while (_local2 < skupinyPotvor[_local3].clenove.length) {
_local8 = _local8 + skupinyPotvor[_local3].clenove[_local2 + 1];
_local2 = _local2 + 2;
}
kandidat = 0;
while (_local7 < kolik) {
_local4 = 0;
_local6 = random(_local8);
_local2 = 0;
while (_local2 < skupinyPotvor[_local3].clenove.length) {
_local4 = _local4 + skupinyPotvor[_local3].clenove[_local2 + 1];
if (_local4 > _local6) {
kandidat = _local2 / 2;
break;
}
_local2 = _local2 + 2;
}
var _local5 = skupinyPotvor[_local3].clenove[kandidat * 2];
if (zaloha) {
_local5 = _local5 * -1;
}
kam.push(_local5);
_root.zraneni.push(0);
_local7++;
}
return(_local7);
}
function nastavTrening(potv) {
vyprazdniSkupinu(1);
vyprazdniSkupinu(2);
mapaBojiste = mapaBojiste3;
postavy.push(2);
naverbujSkupinu("skretiVojaci", potv, _root.potvory);
POSILA1CAS = 0;
POSILA2CAS = 0;
defaultuj();
nasadPodminky(podminkyBoje10);
gotoAndPlay ("game");
}
function naverbuj(typ, kolik, kam) {
var _local7;
var _local3;
var _local2;
_local3 = kolik;
while (_local3 > 0) {
if (typ == 0) {
_local2 = random(6) + 1;
} else if (typ == 1) {
if (!random(4)) {
_local2 = random(3) + 30;
} else {
_local2 = random(13) + 1;
}
} else if (typ == 2) {
if (random(2)) {
_local2 = 17;
} else if (!random(5)) {
_local2 = random(3) + 37;
} else {
_local2 = random(10) + 17;
}
} else {
_local2 = random(3) + 14;
}
if ((((_local2 == 21) || (_local2 == 22)) || (_local2 == 37)) || (_local2 == 26)) {
_local2 = 17;
}
kam.push(_local2);
_root.zraneni.push(0);
_local3--;
}
}
function rozdelOddily(naKolik, sila) {
var _local11;
var _local10;
var _local7;
var _local12;
var _local2;
var _local4;
var _local3;
druzina1.splice(0);
druzina2.splice(0);
druzina3.splice(0);
var _local6 = 1;
var _local5 = false;
_local7 = 0;
while (_local7 < HRDINU) {
vybrano[_local7] = 0;
_local7++;
}
while (_local6 <= naKolik) {
_local3 = 0;
while (_local3 < sila) {
_local4 = random(HRDINU) + 1;
_local2 = _local4;
while ((_root[("hrdina" + _local2) + "stav"] < 0) || (vybrano[_local2 - 1])) {
_local2++;
if (_local2 > HRDINU) {
_local2 = 1;
}
if (_local2 == _local4) {
_local5 = true;
break;
}
}
if (_local5) {
break;
}
_local3++;
_root["druzina" + _local6].push(_local2);
vybrano[_local2 - 1] = 1;
if (_root["oddil" + _local2].pocet > 1) {
_local3++;
}
}
if (_local5) {
break;
}
_local6++;
}
trace((((("druzina 1: " + _root.druzina1) + " druzina 2: ") + _root.druzina2) + " druzina 3: ") + _root.druzina3);
}
function survivalNovyKolo() {
var _local2;
var _local5;
var _local3;
var _local4 = kolo;
if (_local4 < 2) {
_local4 = 2;
}
if (_local4 > 9) {
_local4 = 9;
}
while (potvory.length) {
potvory.pop();
}
_root.poucka = "";
_root.HRAC1 = 1;
_root.HRAC2 = 0;
_root.HLAVNIHRDINA1 = 0;
_root.HLAVNIHRDINA2 = 0;
_root.VIP1 = 0;
_root.VIP2 = 0;
_root.DILKUX = 9;
_root.DILKUY = 9;
_root.UTEK1 = 0;
_root.UTEK2 = 5;
_root.RAZENI1X = 0;
_root.RAZENI1Y = 0;
_root.RAZENI2X = 2;
_root.RAZENI2Y = 0;
_local5 = random(100);
if (_local5 < 70) {
naverbuj(2, _local4 + random(3), _root.potvory);
} else if (_local5 < 85) {
naverbuj(3, _local4 + random(2), _root.potvory);
} else {
_local3 = random(2) + 1;
_local2 = 1;
while (_local2 <= _local3) {
_root.potvory.push(21);
_local2++;
}
_local3 = random(3);
_local2 = 1;
while (_local2 <= _local3) {
_root.potvory.push(random(_local4) + 14);
_local2++;
}
}
if (!kolo) {
kolo = 1;
} else {
kolo = kolo + 1;
}
trace("KOLO JE " + kolo);
gotoAndPlay ("game");
}
function nactiDruzinu() {
while (postavy.length) {
postavy.pop();
}
while (potvory.length) {
potvory.pop();
}
while (zraneni.length) {
zraneni.pop();
}
var _local1;
_local1 = 0;
while (_local1 < postavy0.length) {
postavy.push(postavy0[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < potvory0.length) {
potvory.push(potvory0[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < zraneni0.length) {
zraneni.push(zraneni0[_local1]);
_local1++;
}
}
function ulozDruzinu() {
while (postavy0.length) {
postavy0.pop();
}
while (potvory0.length) {
potvory0.pop();
}
while (zraneni0.length) {
zraneni0.pop();
}
var _local1;
if (HRAC1) {
_local1 = 0;
while (_local1 < postavy.length) {
postavy0.push(postavy[_local1]);
_local1++;
}
} else {
_local1 = 0;
while (_local1 < potvory.length) {
potvory0.push(potvory[_local1]);
_local1++;
}
}
_local1 = 0;
while (_local1 < zraneni0.length) {
zraneni.push(zraneni0[_local1]);
_local1++;
}
}
function ranenych() {
var _local2 = 0;
var _local1 = 0;
while (_local1 < zraneni.length) {
if (zraneni[_local1]) {
_local2++;
}
_local1++;
}
return(_local2);
}
function Zkusenosti(typ) {
this.typ = typ;
this.boj = 0;
this.sila = 0;
}
HRDINU = 8;
hrdinoveTypy = new Array(0, 6, 1, 2, 5, 3, 4, 36, 35);
typyPotvor = new Array({jmeno:"", boj:0, sila:0, rychlost:4, agrese:0}, {jmeno:"Amazon", boj:14, sila:14, rychlost:4, stit:4, slayer:7, zkusenost:3, postava:1, velikost:2, pohlavi:2, agrese:1}, {jmeno:"Swordsman", boj:17, sila:9, rychlost:4, teren1:2, zkusenost:3, postava:2, velikost:2, pohlavi:1, agrese:0}, {jmeno:"Dwarf", boj:11, sila:18, rychlost:4, lethality:1.3, stit:4, zkusenost:3, postava:3, velikost:1, pohlavi:1, agrese:2}, {jmeno:"Sorceress", boj:14, sila:11, rychlost:4, plody6:4, zkusenost:3, postava:4, velikost:2, pohlavi:2, burn:2, agrese:0}, {jmeno:"Spy", boj:15, sila:10, rychlost:5, sneak:4, zkusenost:3, postava:5, velikost:2, pohlavi:2, agrese:0}, {jmeno:"Knight", boj:14, sila:16, rychlost:3, leadership:1, stit:4, lethality:1.2, zkusenost:3, postava:6, velikost:2, pohlavi:1, agrese:1}, {jmeno:"Woman", boj:5, sila:7, rychlost:4, zkusenost:1, postava:40, velikost:1, pohlavi:2, lethality:0.4, agrese:0}, {jmeno:"Lord", boj:8, sila:12, rychlost:3, leadership:1, stit:4, zkusenost:2, postava:31, velikost:2, pohlavi:1, agrese:0}, {jmeno:"Dwarf berserker", boj:6, sila:16, lethality:1.2, rychlost:4, zkusenost:2, postava:16, velikost:1, pohlavi:1, agrese:3}, {jmeno:"Dwarf marksman", boj:4, sila:10, rychlost:4, zkusenost:1, postava:17, velikost:1, pohlavi:1, shoot:3, agrese:0}, {jmeno:"Pikeman", boj:8, sila:8, rychlost:4, daleko:1, stit:4, zkusenost:1, postava:18, velikost:2, pohlavi:1, agrese:0}, {jmeno:"Man-at-arms", boj:10, sila:12, stit:4, rychlost:4, zkusenost:2, postava:19, velikost:2, pohlavi:1, agrese:0}, {jmeno:"Monk", boj:5, sila:6, rychlost:4, zkusenost:1, postava:20, velikost:1, pohlavi:1, inflame:2, agrese:0}, {jmeno:"Grey wolf", boj:4, sila:8, rychlost:5, zkusenost:1, postava:9, velikost:1, pohlavi:3, agrese:-1}, {jmeno:"Black wolf", boj:5, sila:7, rychlost:5, zkusenost:1, postava:10, velikost:1, pohlavi:3, agrese:0}, {jmeno:"White wolf", boj:6, sila:12, rychlost:5, zkusenost:2, postava:11, velikost:1, pohlavi:3, agrese:2}, {jmeno:"Orc", boj:5, sila:8, rychlost:4, zkusenost:1, postava:12, velikost:1, pohlavi:1, lethality:0.5, agrese:0}, {jmeno:"Orc leader", boj:7, sila:13, stit:4, rychlost:4, zkusenost:2, postava:13, pohlavi:1, velikost:1, agrese:0}, {jmeno:"Orc shaman", boj:3, sila:5, rychlost:3, zkusenost:1, postava:14, pohlavi:1, velikost:1, lethality:0.5, inflame:2, agrese:0}, {jmeno:"Orc marksman", boj:4, sila:7, rychlost:4, zkusenost:1, postava:15, pohlavi:1, velikost:2, shoot:3, agrese:0}, {jmeno:"Troll", boj:6, sila:25, rychlost:4, zkusenost:3, postava:21, velikost:3, lethality:1.5, pohlavi:1, agrese:0}, {jmeno:"Dark lady", boj:16, sila:22, rychlost:4, plody6:4, zkusenost:4, postava:22, velikost:3, pohlavi:2, burn:2, agrese:4}, {jmeno:"Orc assassin", boj:7, sila:8, rychlost:5, zkusenost:2, postava:24, velikost:2, pohlavi:1, lethality:1.3, agrese:0}, {jmeno:"Vampire", boj:8, sila:8, rychlost:4, upir:1, zkusenost:2, postava:25, velikost:2, pohlavi:1, agrese:0}, {jmeno:"Vampire warrior", boj:8, sila:12, rychlost:4, upir:2, zkusenost:2, postava:26, velikost:2, pohlavi:1, agrese:0}, {jmeno:"Vampire lord", boj:12, sila:14, rychlost:5, upir:3, zkusenost:3, postava:27, velikost:2, pohlavi:1, lethality:1.2, agrese:0}, {jmeno:"Captain", boj:10, sila:12, stit:4, rychlost:4, zkusenost:2, postava:19, velikost:2, pohlavi:1, agrese:0}, {jmeno:"Man", boj:4, sila:8, rychlost:4, zkusenost:1, postava:28, velikost:2, pohlavi:1, lethality:0.5, agrese:0}, {jmeno:"Lady", boj:7, sila:6, rychlost:4, zkusenost:0, postava:23, velikost:1, pohlavi:2, lethality:0.5, inflame:2, agrese:0}, {jmeno:"Dryad", boj:8, sila:6, rychlost:5, swallow:2, plody5:4, lehkost:1, zkusenost:2, postava:32, velikost:2, pohlavi:2, agrese:0}, {jmeno:"Forest shadow", boj:6, sila:3, rychlost:5, lehkost:1, zkusenost:2, postava:33, velikost:1, pohlavi:4, agrese:0}, {jmeno:"Dryad mistress", boj:12, sila:7, rychlost:5, swallow:1, plody5:4, lehkost:1, zkusenost:3, postava:34, velikost:2, pohlavi:2, agrese:0}, {jmeno:"Pikewoman", boj:9, sila:7, rychlost:4, daleko:1, zkusenost:1, postava:29, velikost:1, pohlavi:2, agrese:0}, {jmeno:"Woman-at-arms", boj:9, sila:13, stit:4, rychlost:4, zkusenost:2, postava:30, velikost:2, pohlavi:2, agrese:0}, {jmeno:"Wizard", boj:12, sila:9, rychlost:3, blesk:2, zkusenost:3, postava:8, velikost:2, pohlavi:1, agrese:0}, {jmeno:"Marksman", boj:14, sila:9, rychlost:4, shoot:3, teren1:2, zkusenost:3, postava:7, velikost:2, pohlavi:1, agrese:0}, {jmeno:"Dark lord", boj:16, sila:25, rychlost:4, zkusenost:4, postava:35, velikost:3, lethality:1.5, pohlavi:1, agrese:5}, {jmeno:"Shadow", boj:9, sila:1, rychlost:6, lehkost:1, lethality:1.2, zkusenost:2, postava:36, velikost:1, pohlavi:4, agrese:0}, {jmeno:"Witch", boj:11, sila:10, rychlost:4, hold:2, plody6:4, zkusenost:3, postava:37, velikost:2, pohlavi:2, agrese:2}, {jmeno:"Dark shampion", boj:12, sila:20, rychlost:4, slayer:7, zkusenost:3, postava:0, velikost:3, pohlavi:1, agrese:2}, {jmeno:"Orc", boj:5, sila:8, rychlost:4, zkusenost:1, postava:39, velikost:1, pohlavi:1, agrese:0});
popisySkilu = new Array({id:"", jmeno:"", funkce:"", popis:""}, {id:"shoot", jmeno:"Firearms", funkce:1, popis:"Ability to inflict damage to any distance in the line of fire. Loaded in # steps"}, {id:"burn", jmeno:"Burn spell", funkce:1, popis:"Attacks a target on the ground (not in the water or mud) up to 3 squares far. Invoked in # steps."}, {id:"inflame", jmeno:"Inflame spell", funkce:1, popis:"Adds some shield points to a friendly unit up to 3 squares for one round. Invoked in # steps."}, {id:"hold", jmeno:"Hold spell", funkce:1, popis:"Instead of wounding, stuns an enemy unit on the ground up to 6 squares far. Invoked in # steps."}, {id:"swallow", jmeno:"Deadly plants spell", funkce:1, popis:"Makes grass grow wildly up to 6 squares far, swallowing small target, or even medium sized one. Invoked in # steps."}, {id:"blesk", jmeno:"Lightning spell", funkce:1, popis:"Strikes an enemy in the line of fire with double power. Invoked in # steps."}, {id:"lethality", jmeno:"Lethality", funkce:3, popis:"The unit's hit in the hand-to-hand combat has #% of its normal value."}, {id:"slayer", jmeno:"Slayer", funkce:1, popis:"Wounding an enemy onto life level # or lower may kill him instantly."}, {id:"sneak", jmeno:"Sneak", funkce:2, popis:"If the unit attacks while advancing, the opponent's counter-strike hit is decreased by #%."}, {id:"daleko", jmeno:"Static weapon", funkce:0, popis:"The unit cannot attack while advancing."}, {id:"leadership", jmeno:"Leadership", funkce:1, popis:"The shields of all friendly units are increased by #."}, {id:"upir", jmeno:"Blood sucker", funkce:1, popis:"After a succesfull attack, regains half of the life taken (max #)."}, {id:"lehkost", jmeno:"Light weight", funkce:0, popis:"The unit can freely move over the swamp surface without any penalty."}, {id:"stit", jmeno:"Shield", funkce:2, popis:"#% chance to block flying bullet or lightning."}, {id:"teren1", jmeno:"Street fighter", funkce:1, popis:"When standing on the pavement, gets +# bonus to the shield at the start of each round."}, {id:"plody5", jmeno:"Nature's cure", funkce:1, popis:"Stepping on the square with blue flowers (but not during the attack or retreat) heals # life."}, {id:"plody6", jmeno:"Earth cure", funkce:1, popis:"Stepping on the square with mushrooms (but not during the attack or retreat) heals # life."});
skupinyPotvor = new Array({id:"", jmeno:"", strana:0, leader:0, clenove:new Array()}, {id:"hrdinove", jmeno:"Heroes", strana:1, leader:0, clenove:new Array(1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 35, 1, 36, 1)}, {id:"skretiVojaci", jmeno:"Orc soldiers", strana:2, leader:17, clenove:new Array(17, 12, 41, 6, 19, 2, 18, 1, 15, 2, 20, 2, 23, 1)}, {id:"skretiOddil", jmeno:"Orc troop", strana:2, leader:0, clenove:new Array(17, 12, 41, 6, 19, 2, 15, 2, 20, 2, 18, 3, 23, 3, 39, 1)}, {id:"vlci", jmeno:"Wolves", strana:0, leader:0, clenove:new Array(14, 3, 15, 3, 16, 1)}, {id:"trollove", jmeno:"Trolls", strana:2, leader:21, clenove:new Array(21, 2, 14, 1, 15, 1)}, {id:"zbrojnyHouf", jmeno:"Human soldiers", strana:1, leader:0, clenove:new Array(11, 6, 33, 4, 12, 1, 34, 1)}, {id:"lidi", jmeno:"Humans", strana:1, leader:0, clenove:new Array(11, 8, 33, 6, 12, 1, 34, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 35, 1, 36, 1)}, {id:"skretiElita", jmeno:"Orc elite force", strana:2, leader:0, clenove:new Array(18, 1, 23, 1)}, {id:"vrazi", jmeno:"Orc assassins", strana:2, leader:0, clenove:new Array(23, 1)}, {id:"carodejnice", jmeno:"Witch party", strana:2, leader:39, clenove:new Array(39, 1, 17, 3, 41, 2, 19, 1, 15, 2)}, {id:"upiri", jmeno:"Vampires", strana:2, leader:0, clenove:new Array(24, 4, 25, 3, 38, 2)}, {id:"panUpiru", jmeno:"Vampire lord party", strana:2, leader:26, clenove:new Array(24, 4, 25, 3, 38, 2)}, {id:"skretiStrelci", jmeno:"Orc marksmen", strana:2, leader:20, clenove:new Array(20, 1)}, {id:"trpaslici", jmeno:"Dwarves", strana:1, leader:9, clenove:new Array(9, 2, 10, 2, 13, 1)}, {id:"trpasliciStrelci", jmeno:"Dwarf marksmen", strana:1, leader:10, clenove:new Array(10, 1)}, {id:"mnisi", jmeno:"Monk party", strana:1, leader:13, clenove:new Array(13, 1, 11, 1, 34, 1, 12, 1)}, {id:"dryady", jmeno:"Dryads", strana:1, leader:30, clenove:new Array(30, 1, 31, 1)}, {id:"dryadiPani", jmeno:"Dryad Mistress party", strana:1, leader:32, clenove:new Array(30, 10, 31, 10)}, {id:"temnaPani", jmeno:"Dark Lady party", strana:2, leader:22, clenove:new Array(17, 1, 41, 1, 19, 1, 18, 1)}, {id:"temnyPan", jmeno:"Dark Lord party", strana:2, leader:37, clenove:new Array(24, 4, 25, 3, 38, 2)}, {id:"rolnici", jmeno:"Peasants", strana:1, leader:28, clenove:new Array(28, 4, 7, 4)}, {id:"pan", jmeno:"Lord and his company", strana:1, leader:8, clenove:new Array(12, 4, 15, 1)}, {id:"straz", jmeno:"Guards", strana:1, leader:12, clenove:new Array(12, 4, 34, 4, 15, 1)});
mapaBojiste0 = {hlavniTeren:1, brehu:0, rek:0, objekty:new Array(10, 10, 0), plody:new Array(10, 10, 0)};
mapaBojiste1 = {hlavniTeren:1};
mapaBojiste2 = {hlavniTeren:2};
mapaBojiste3 = {hlavniTeren:3};
mapaBojiste4 = {hlavniTeren:4};
mapaBojiste5 = {hlavniTeren:5};
mapaBojiste6 = {hlavniTeren:4};
mapaBojiste7 = {hlavniTeren:4, rek:0, objekty:new Array(4, 4, 7, 1, 2, 17, 6, 6, 18, 3, 7, 17)};
mapaBojiste8 = {hlavniTeren:3, rek:0, objekty:new Array(5, 6, 3, 9, 2, 17, 6, 4, 18, 3, 7, 1)};
mapaBojiste9 = {hlavniTeren:1, brehu:0, rek:0};
mapaBojiste10 = {hlavniTeren:4, objekty:new Array()};
mapaBojiste11 = {hlavniTeren:3, rek:0, brehu:0, ostruvku:0, objekty:new Array()};
podminkyBoje1 = {};
podminkyBoje2 = {DILKUX:11, DILKUY:4, UTEK1:4, UTEK2:2, RAZENI1X:-1, RAZENI1Y:0, RAZENI2X:1, RAZENI2Y:0, POSILA2X:1, POSILA2Y:0};
podminkyBoje3 = {DILKUX:11, DILKUY:9, UTEK1:2, VIP1:1, RAZENI1X:-1, RAZENI1Y:0, RAZENI2X:1, RAZENI2Y:0};
podminkyBoje4 = {UTEK1:0, VIP1:1, RAZENI1X:0, RAZENI1Y:0, RAZENI2X:2, RAZENI2Y:0, MORALKA2:2};
podminkyBoje5 = {UTEK2:0, VIP2:1, RAZENI1X:0, RAZENI1Y:1, RAZENI2X:0, RAZENI2Y:-1};
podminkyBoje6 = {RAZENI1X:2, RAZENI1Y:0, RAZENI2X:0, RAZENI2Y:0};
podminkyBoje7 = {DILKUX:9, DILKUY:9, RAZENI1X:0, RAZENI1Y:1, RAZENI2X:0, RAZENI2Y:-1, POKLAD2:2, POKLAD2X:5, POKLAD2Y:1, UTEK1:3};
podminkyBoje8 = {DILKUX:11, DILKUY:5, RAZENI1X:-1, RAZENI1Y:0, RAZENI2X:1, RAZENI2Y:0, UTEK1:4, UTEK2:2};
podminkyBoje9 = {UTEK1:2, UTEK2:4};
podminkyBoje10 = {UTEK1:0, UTEK2:0};
bitvy = new Array(0, new Array({bojiste:3, podminky:1, mist:2, obtiznost:1, oddily:new Array({trida:"skretiVojaci", pocet:3}, 0, 0, {trida:"trpaslici", pocet:1}, 0, 0, 0)}, {bojiste:1, podminky:2, mist:2, obtiznost:1, oddily:new Array({trida:"skretiElita", pocet:1}, {trida:"skretiVojaci", pocet:5}, {trida:"skretiVojaci", pocet:2, prichod:2}, {trida:"trpaslici", pocet:3}, 0, 0, 0)}, {bojiste:7, podminky:1, mist:3, obtiznost:2, oddily:new Array({trida:"skretiVojaci", pocet:4}, 0, 0, {trida:"rolnici", pocet:1}, 0, 0, {trida:"zbrojnyHouf", pocet:3})}, {bojiste:2, podminky:9, mist:3, obtiznost:2, oddily:new Array({trida:"skretiVojaci", pocet:6}, 0, 0, {trida:"trpaslici", pocet:2}, 0, 0, {trida:"trpasliciStrelci", pocet:2})}, {bojiste:2, podminky:1, mist:3, obtiznost:2, oddily:new Array({trida:"vrazi", pocet:1}, {trida:"skretiVojaci", pocet:3}, 0, 0, 0, 0, 0)}), new Array({bojiste:4, podminky:3, mist:2, obtiznost:1, oddily:new Array({trida:"skretiVojaci", pocet:4}, 0, 0, 0, 0, 0, 0)}, {bojiste:4, podminky:1, mist:3, obtiznost:2, oddily:new Array({trida:"skretiVojaci", pocet:6}, {trida:"upiri", pocet:1}, {trida:"skretiVojaci", pocet:3, prichod:3}, {trida:"rolnici", pocet:4}, 0, 0, {trida:"zbrojnyHouf", pocet:4})}, {bojiste:4, podminky:1, mist:2, obtiznost:1, oddily:new Array({trida:"skretiElita", pocet:1}, {trida:"skretiVojaci", pocet:6}, 0, {trida:"dryady", pocet:2}, 0, 0, 0)}, {bojiste:4, podminky:4, mist:2, obtiznost:1, oddily:new Array({trida:"upiri", pocet:3}, {trida:"skretiVojaci", pocet:5}, {trida:"skretiVojaci", pocet:3, prichod:3}, {trida:"dryadiPani", pocet:3}, 0, 0, {trida:"dryady", pocet:1})}, {bojiste:4, podminky:1, mist:3, obtiznost:3, oddily:new Array({trida:"carodejnice", pocet:1}, {trida:"skretiVojaci", pocet:5}, 0, 0, 0, 0, 0)}), new Array({bojiste:3, podminky:1, mist:3, obtiznost:2, oddily:new Array({trida:"skretiElita", pocet:2}, {trida:"skretiVojaci", pocet:5}, 0, 0, 0, 0, 0)}, {bojiste:8, podminky:4, mist:1, obtiznost:1, oddily:new Array({trida:"vrazi", pocet:2}, {trida:"skretiVojaci", pocet:4}, 0, {trida:"pan", pocet:1}, {trida:"straz", pocet:2, prichod:3}, 0, {trida:"straz", pocet:2})}, {bojiste:9, podminky:5, mist:3, obtiznost:2, oddily:new Array({trida:"panUpiru", pocet:3}, {trida:"skretiElita", pocet:6, prichod:4}, {trida:"upiri", pocet:6, prichod:4}, 0, 0, 0, 0)}, {bojiste:10, podminky:6, mist:3, obtiznost:2, oddily:new Array({trida:"upiri", pocet:2}, {trida:"skretiVojaci", pocet:6}, 0, {trida:"zbrojnyHouf", pocet:3}, 0, 0, 0)}, {bojiste:4, podminky:1, mist:3, obtiznost:2, oddily:new Array({trida:"skretiElita", pocet:1}, {trida:"skretiVojaci", pocet:6}, {trida:"upiri", pocet:3}, {trida:"zbrojnyHouf", pocet:4}, 0, 0, {trida:"zbrojnyHouf", pocet:3})}), new Array({bojiste:7, podminky:1, mist:3, obtiznost:1, oddily:new Array({trida:"skretiElita", pocet:1}, {trida:"skretiVojaci", pocet:3}, 0, 0, 0, 0, 0)}, {bojiste:3, podminky:1, mist:3, obtiznost:3, oddily:new Array({trida:"skretiStrelci", pocet:4}, {trida:"skretiVojaci", pocet:3}, {trida:"skretiVojaci", pocet:4, prichod:4}, 0, 0, 0, 0)}, {bojiste:11, podminky:7, mist:3, obtiznost:2, oddily:new Array({trida:"carodejnice", pocet:1}, {trida:"skretiVojaci", pocet:5}, {trida:"skretiVojaci", pocet:6, prichod:5}, 0, 0, 0, 0)}, {bojiste:4, podminky:1, mist:3, obtiznost:2, oddily:new Array({trida:"skretiVojaci", pocet:5}, {trida:"skretiVojaci", pocet:4}, {trida:"trollove", pocet:1}, {trida:"trpasliciStrelci", pocet:4}, 0, 0, 0)}, {bojiste:2, podminky:8, mist:3, obtiznost:2, oddily:new Array({trida:"upiri", pocet:3}, {trida:"upiri", pocet:2}, 0, {trida:"trpasliciStrelci", pocet:2}, 0, 0, 0)}));
var x;
var y;
x = 0;
while (x < bitvy.length) {
y = 0;
while (y < bitvy[x].length) {
bitvy[x][y].mist = bitvy[x][y].obtiznost;
y++;
}
x++;
}
textyObtiznosti = new Array("very easy\n(no hero needed)", "easy\n(for one hero)", "normal\n(for two heroes)", "hard\n(for three heroes)", "very hard\n(for more heroes)");
textNeuspech = "You have lost too many battles. You failed to stop the invasion. The kingdom has been turned into an Orc colony.";
textZajatci = "Some heroes have been captured. You have to rescue them, if you don't want to let them tortured to death.\nThe same fate awaits those, who fall into the orcish hands during the rescue mission!";
textOsudZajatcu1 = "You have rescued the captives!";
textOsudZajatcu2 = "The captives will be tortured to death!";
nazevMise0 = "Kill all";
textMise0 = "Kill all the enemies.";
textMise1 = "The Orc army has been assembled, large as never before. Large enough to trample us all into the ground. They have now crossed the borders. The time has come to test our blades.\n";
nazevMise11 = "First encounter";
textMise11 = "3 enemy orcs are going to attack a friendly dwarf unit. But you are here to join him.";
nazevMise12 = "Underground passage";
textMise12 = "Won the 1st battle? Very well! To advance to next stage, YOU NEED TO SCORE MORE VICTORIES THAN DEFEATS.\n\nHere the Orc have discovered a secret underground passage. Help the dwarves to get rid of them.";
nazevMise13 = "Help for the shepherds";
textMise13 = "The Orc have butchered small herd of sheep. The shepherd ran away, but they have pursued him right to his hut. Will you help him?";
nazevMise14 = "Treasure";
textMise14 = "Dwarven treasure has been discovered by the Orc. Protect the treasure before their greedy green paws!\n\nYOU CAN SKIP ANY BATTLE by clicking X-'Resign the mission' in the upper right corner, if you don't dare it.";
nazevMise15 = "Secret message";
textMise15 = "Small orcish troop is running through the rocks with an important message. Ambush them and destroy them!";
textMise2 = "While the northern division of the Orc army was carving their way through the mountains, the second half of the invasion army pierced from the east into the frontier forest.\nIt's our duty to decrease their numbers and slow down their movement as much as possible, before they get inland.";
nazevMise21 = "Skirmish in the forest";
textMise21 = "You hit on an enemy outpost. Stand up to them or run to warn your fellows!";
nazevMise22 = "Rescue in the woods";
textMise22 = "People from the highlands run southwards before the enemy downrush, to the towns. Others look for shelter in the woods. But those places are far from being safe... Protect their lives, and what's more important, kill the orcs!";
nazevMise23 = "Sacred grove";
textMise23 = "They have attacked the sacred grove! In the name of gods, you must prevent them from violating this place!";
nazevMise24 = "Queen of the forest";
textMise24 = "Another enemy troop has pushed themselves to the very sanctuary of the forest queen. Your mission is to protect her life!";
nazevMise25 = "Guerrilla";
textMise25 = "You have tracked down a smaller group of orcs and vampires marshing through the woods, somewhat separated from the main body. A good opportunity to finish them all!";
textMise3 = "Fighting out their hard way through the frontier lands, the enemy has come inland. They are marshing to the big town of Tilium. All our forces must be concentrated here. We must force them to a long siege, which will either hang them up, or divide their army into two parts.";
nazevMise31 = "In front of the gates";
textMise31 = "First encounter near the town is about to start - a skirmish of two scouting units.";
nazevMise32 = "Murderers";
textMise32 = "There is a night before a battle. Orc assassins have infiltrated our camp to kill our army leader. Be near to save his life!\nThe enforcement comes soon, if you hold him alive long enough.";
nazevMise33 = "The revenge";
textMise33 = "A bloody slaughter followed, and we were defeated, fleeing behind the city walls. Anyway, it's time for revenge. Come to a temple near the town and kill the leader of the war party, which is hiding there. And be quick with it, before the guards come to kill you!";
nazevMise34 = "Ambush";
textMise34 = "Our scouts have located a route for an orcish supply unit. Destroy the armed crew and burn the supplies!";
nazevMise35 = "Stealthy landing";
textMise35 = "The general city onslaught is about to start any hour. Enemy troop has secretly disembarked on our river bank to relieve landing of other enemy troops.\nSmash them!";
textMise4 = "In the dawn, thousands of green bodies were lying dead under the half-ruined walls of Tilium. The Orc assault failed. They have even given up the siege! Instead, they are concentrating their whole force to the kingdom capital, Pyrah. Under the Pyrah walls the fate will be decided.";
nazevMise41 = "Against the pillagers";
textMise41 = "Reaching Pyrah country, the Orc have started flattening nearby villages. Which of the heroes will face them?";
nazevMise42 = "Catapults";
textMise42 = "The Orc have pitched their tents near the city and built catapults for destroying the city walls. Sneak in the camp, crush the crew of their largest mashine, and set the catapult aflame.";
nazevMise43 = "Statuette";
textMise43 = "They have a magical statuette in their main tent. It is their oracle. Steal it! And be quick with it!";
nazevMise44 = "Fortified island";
textMise44 = "There is a small fortified island near the city, where the Dwarves rain fire of their cannons. The enemy, showering now the island with their catapults, plans to attack that forward position. Be there to defend the island!";
nazevMise45 = "Volcano";
textMise45 = "The Orc have discovered our secret weakness. Suicide vampire commando is lurking under the ground to awaken a volcano. It would overwhelm part of the city with rocks and lava and wreak chaos. We must eliminate them before they do it. There are already some dwarves waiting.";
textMise5 = "The enemy didn't dare to assault the city. After several weeks of the siege, our reinforcements came from the north. Both our armies struck together. Great battle ensued, and thousands fell on both sides, before the Orc turned to flee, and were pursued and beaten down to their very nests.\nAfter this legendary victory, the lasting peace has settled through the kingdom.";
kecy1 = "";
kecy1zaver1 = "";
kecy1zaver2 = "";
kecy11 = "";
kecy12 = "";
zraneni = new Array();
druzina1 = new Array();
druzina2 = new Array();
druzina3 = new Array();
vybrano = new Array(HRDINU);
hrdinove = new Array();
rimskyCislice = new Array("", "I", "II", "III", "IV", "V");
typHrace = 5;
naStrane = 1;
mod = 1;
testovaniDeje = false;
testovaniBitvy = false;
udelatkoBarva = 1;
udelatkoMnozstvi = 1;
survivalKolo = 0;
napoveda = 1;
krev = 2;
diff = 1;
tutorial = 1;
amaz = 0;
if (amaz) {
typyPotvor[29].boj = typyPotvor[29].boj + 3;
typyPotvor[29].sila = typyPotvor[29].sila + 7;
var x = 1;
while (x < typyPotvor.length) {
if (typyPotvor[x].pohlavi == 2) {
typyPotvor[x].boj = typyPotvor[x].boj + 2;
typyPotvor[x].sila = typyPotvor[x].sila + 4;
} else if (typyPotvor[x].sila < 1) {
typyPotvor[x].sila = 1;
}
x++;
}
}
Instance of Symbol 790 MovieClip "hlaska" in Frame 2
onClipEvent (load) {
_visible = false;
}
Frame 3
function Zvuk() {
this.au1 = new Sound();
this.au1.attachSound("au1");
this.au2 = new Sound();
this.au2.attachSound("au2");
this.brink1 = new Sound();
this.brink1.attachSound("brink");
this.brink2 = new Sound();
this.brink2.attachSound("brink");
this.brink3 = new Sound();
this.brink3.attachSound("brink");
this.uder1 = new Sound();
this.uder1.attachSound("uder1");
this.uder2 = new Sound();
this.uder2.attachSound("uder1");
this.uder3 = new Sound();
this.uder3.attachSound("uder1");
this.uder4 = new Sound();
this.uder4.attachSound("uder1");
this.zasah1 = new Sound();
this.zasah1.attachSound("zasah1");
this.zasah2 = new Sound();
this.zasah2.attachSound("zasah1");
this.zasah3 = new Sound();
this.zasah3.attachSound("zasah1");
this.zasah4 = new Sound();
this.zasah4.attachSound("zasah1");
this.zab = new Sound();
this.zab.attachSound("zab");
this.chcip2 = new Sound();
this.chcip2.attachSound("chcip2");
this.chcip3 = new Sound();
this.chcip3.attachSound("chcip3");
this.signal1 = new Sound();
this.signal1.attachSound("bourebuben");
this.vystrel1 = new Sound();
this.vystrel1.attachSound("vystrel1");
this.deepthud = new Sound();
this.deepthud.attachSound("deepthud");
this.kouzlo1inflame = new Sound();
this.kouzlo1inflame.attachSound("kouzlo1");
this.kouzlo2burn = new Sound();
this.kouzlo2burn.attachSound("kouzlo2");
this.kouzlo1burn = new Sound();
this.kouzlo1burn.attachSound("kouzlo1");
this.prd = new Sound();
this.prd.attachSound("prd");
this.splouchnuti = new Sound();
this.splouchnuti.attachSound("splouchnuti");
this.bubliny = new Sound();
this.bubliny.attachSound("bubliny");
}
function hudboHraj(kolik) {
zvukPozadi.stop();
zvukPozadi.attachSound(hudby[kolik]);
typHudby = kolik;
var _local2 = 36000;
if (!ticho) {
zvukPozadi.start(0, _local2);
}
if (kolik == 2) {
zvukPozadi.setVolume(80);
} else {
zvukPozadi.setVolume(50);
}
}
zvuky = new Zvuk();
hudby = new Array("", "uvod", "scenar", "bitka", "vitez");
zvukPozadi = new Sound();
zvukPozadi.setVolume(50);
ticho = false;
typHudby = 0;
hlaska._visible = false;
Frame 6
Frame 7
hlaska.skryj();
stop();
Frame 8
DILKUX = 9;
DILKUY = 9;
HRAC1 = 1;
HRAC2 = 0;
HLAVNIHRDINA1 = 0;
HLAVNIHRDINA2 = 0;
VIP1 = 0;
VIP2 = 0;
POKLAD1 = 0;
POKLAD2 = 0;
POKLAD1X = 0;
POKLAD1Y = 0;
POKLAD2X = 0;
POKLAD2Y = 0;
UTEK1 = 4;
UTEK2 = 2;
MORALKA1 = 0;
MORALKA2 = 0;
RAZENI1X = -1;
RAZENI1Y = 1;
RAZENI2X = 1;
RAZENI2Y = -1;
POSILA1X = 0;
POSILA1Y = 0;
POSILA1CAS = 0;
POSILA2X = 0;
POSILA2Y = 0;
POSILA2CAS = 0;
vysledekBoje = 0;
zacni();
hlaska.zavri();
if (mod == 1) {
gotoAndPlay ("scenar");
}
Frame 9
Frame 10
stop();
Frame 12
Frame 67
Frame 68
zobrazVysledek(vysledekBoje);
stop();
Frame 70
stop();
Symbol 58 MovieClip [objektyKrajiny] Frame 1
stop();
Symbol 76 MovieClip Frame 1
stop();
Symbol 79 MovieClip Frame 1
stop();
Symbol 84 MovieClip [plody] Frame 1
function vysmahni() {
if (zari._currentframe == 1) {
zari.gotoAndStop(2);
this.hlavniTyp = 100;
} else {
this.removeMovieClip();
}
_root.zvuky.bubliny.start();
}
stop();
Symbol 87 MovieClip [cakanec] Frame 1
stop();
Symbol 92 MovieClip [poklad] Frame 1
stop();
Symbol 93 MovieClip [rozhozeny] Frame 1
stop();
Symbol 104 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 1
stop();
Symbol 110 MovieClip Frame 1
function nahod(rozhoz, zran) {
if (rozhoz > 0) {
streh.play();
streh.h2.textik.text = rozhoz;
streh.h1.textik.text = _parent.streh;
_parent.ukazSloupec(1);
}
if (zran > 0) {
zivotu.play();
zivotu.h2.textik.text = zran;
zivotu.h1.textik.text = _parent.zivotu;
_parent.ukazSloupec(2);
}
}
function zvyrazni(kolik) {
if (!kolik) {
_alpha = _parent._parent.viditelnostStitku;
} else {
_alpha = 100;
}
}
stop();
Symbol 118 MovieClip Frame 1
if (_parent._parent.naMape) {
stin._visible = true;
} else {
stin._visible = false;
}
stop();
Symbol 450 MovieClip Frame 1
stop();
Symbol 450 MovieClip Frame 21
p.gotoAndStop(2);
Symbol 450 MovieClip Frame 22
p.gotoAndStop(2);
Symbol 450 MovieClip Frame 43
if (_root.amaz) {
p._xscale = p._xscale * 1.2;
p._yscale = p._yscale * 1.2;
}
Symbol 450 MovieClip Frame 44
if (_root.amaz) {
p._xscale = p._xscale * 1.2;
p._yscale = p._yscale * 1.2;
}
Symbol 453 MovieClip Frame 1
_visible = false;
stop();
Symbol 461 MovieClip Frame 1
stop();
Symbol 462 MovieClip Frame 1
stop();
Symbol 462 MovieClip Frame 12
s = "";
Symbol 466 MovieClip Frame 1
stop();
Symbol 466 MovieClip Frame 3
stop();
Symbol 468 MovieClip Frame 1
stop();
Symbol 468 MovieClip Frame 7
hnat.play();
Symbol 468 MovieClip Frame 9
stop();
Symbol 470 MovieClip Frame 9
stop();
Symbol 471 MovieClip Frame 3
stop();
Symbol 477 MovieClip Frame 16
stop();
Symbol 478 MovieClip Frame 1
function zapal(kolik) {
var _local2;
var _local3 = 1;
while (_local3 <= kolik) {
_local2 = p0.duplicateMovieClip("p" + _local3, this.getNextHighestDepth());
_local2._visible = true;
_local2._x = (p0._x + random(20)) - random(20);
_local2._y = (p0._y + random(20)) - random(20);
_local2._xscale = p0._xscale * ((random(2) * 2) - 1);
_local2._yscale = (p0._yscale + random(20)) - random(20);
_local2.gotoAndPlay(random(_local3) + 1);
_local3++;
}
}
p0._visible = false;
Symbol 482 MovieClip Frame 1
stop();
Symbol 482 MovieClip Frame 19
stop();
Symbol 483 MovieClip Frame 1
function init(kolik) {
var _local3;
var _local2;
vlnovek = kolik;
_local2 = 1;
while (_local2 <= kolik) {
_local3 = v0.duplicateMovieClip("v" + _local2, this.getNextHighestDepth());
_local3._visible = true;
_local3._xscale = ((random(2) * 2) - 1) * 100;
_local3._x = v0._x + (((((_local2 % 2) * 2) - 1) * _local2) * 1.5);
_local2++;
}
odstartovano = true;
}
this.onEnterFrame = function () {
if (!odstartovano) {
return(0);
}
var _local2;
var _local3;
var _local4;
_local2 = random(vlnovek) + 1;
_local4 = _local2;
_local3 = this["v" + _local2];
while (_local3._currentframe > 1) {
_local2++;
if (_local2 > vlnovek) {
_local2 = 1;
}
if (_local2 == _local4) {
odstartovano = false;
break;
}
_local3 = this["v" + _local2];
}
if (_local3._currentframe < _local3._totalframes) {
_local3.play();
}
};
vlnovek = 0;
odstartovano = false;
v0._visible = false;
Symbol 490 MovieClip [figurka] Frame 1
function zobrazPenaltu(bonus) {
if (!bonus) {
stavy.bonusStr = "";
return(0);
}
if (bonus > 0) {
stavy.bonusStr = "+";
} else {
stavy.bonusStr = "";
}
stavy.bonusStr = stavy.bonusStr + bonus;
}
function nastav(typ, strana, smerX, smerY, obnoveni) {
var _local3;
var _local6;
this.typ = typ;
this.strana = strana;
if (strana > 1) {
_local3 = 11;
} else {
_local3 = 21;
}
stavy.zivotup.gotoAndStop(_local3);
zmenStav(1, maxStav(1, true));
if (obnoveni) {
zmenStav(2, maxStav(2, true));
}
p.podst.gotoAndStop(strana);
natocSe(smerX, smerY);
if (_parent.stavyZmiz) {
stavy._visible = false;
} else {
stavy._visible = true;
}
}
function neni() {
if (((zivotu <= 0) || (utekl)) || (mimo)) {
return(true);
}
return(false);
}
function rychlost() {
var _local2 = schopnost("rychlost");
if ((_local2 > this.zivotu) && (maxStav(2) > 5)) {
_local2 = this.zivotu;
}
if (_local2 < 2) {
_local2 = 2;
}
return(_local2);
}
function muzeStrilet() {
var _local1 = schopnost("shoot");
if (!_local1) {
return(0);
}
if (_local1 > kroku) {
return(-1);
}
return(_local1);
}
function muzeBlyskat() {
var _local1 = schopnost("blesk");
if (!_local1) {
return(0);
}
if (_local1 > kroku) {
return(-1);
}
return(_local1);
}
function muzeInflamovat() {
var _local1 = schopnost("inflame");
if (!_local1) {
return(0);
}
if (_local1 > kroku) {
return(-1);
}
return(_local1);
}
function muzeSpalit() {
var _local1 = schopnost("burn");
if (!_local1) {
return(0);
}
if (_local1 > kroku) {
return(-1);
}
return(_local1);
}
function muzeZnehybnit() {
var _local1 = schopnost("hold");
if (!_local1) {
return(0);
}
if (_local1 > kroku) {
return(-1);
}
return(_local1);
}
function muzePohltit() {
var _local1 = schopnost("swallow");
if (!_local1) {
return(0);
}
if (_local1 > kroku) {
return(-1);
}
return(_local1);
}
function nastavUzTahnul(jak) {
this.uzTahnul = jak;
}
function zvetsiStav(jakej, kolik, nula) {
var _local2;
var _local4;
if (jakej == 1) {
_local2 = "streh";
} else {
_local2 = "zivotu";
}
this[_local2 + ""] = Number(this[_local2 + ""]) + Number(kolik);
if (nula && (Number(this[_local2 + ""]) < 0)) {
this[_local2 + ""] = 0;
}
var _local3 = stavy[_local2 + ""].h1.textik.text;
stavy[_local2 + ""].h1.textik.text = this[_local2 + ""];
}
function zmenStav(jakej, kolik, nula) {
var _local2;
if (jakej == 1) {
_local2 = "streh";
} else {
_local2 = "zivotu";
}
this[_local2 + ""] = kolik;
if (nula && (this[_local2 + ""] < 0)) {
this[_local2 + ""] = 0;
}
stavy[_local2 + ""].h1.textik.text = kolik;
ukazSloupec(jakej);
}
function ukazSloupec(jakej) {
var _local3;
if (jakej == 1) {
_local3 = "streh";
} else {
_local3 = "zivotu";
}
var _local2;
var _local4;
if (jakej == 1) {
_local2 = 0;
} else if (strana == 1) {
_local2 = 20;
} else {
_local2 = 10;
}
_local4 = _local2 + (10 - ((this[_local3] / maxStav(jakej)) * 10));
if (_local4 == _local2) {
_local4 = _local2 + 1;
}
stavy[_local3 + "p"].gotoAndStop(_local4);
}
function natocSe(sX, sY) {
var _local1 = schopnost("postava");
if (sY < 0) {
p.gotoAndStop(_local1 * 2);
} else {
p.gotoAndStop((_local1 * 2) - 1);
}
if ((-1 * sX) == sY) {
p.p._xscale = 1 * Math.abs(p.p._xscale);
} else {
p.p._xscale = -1 * Math.abs(p.p._xscale);
}
}
function cakej(kolik) {
if (!_root.krev) {
return(0);
}
krev._visible = true;
krev.gotoAndPlay(2);
if (kolik < 6) {
return(1);
}
krev2._visible = true;
krev2.gotoAndPlay(2);
return(2);
}
function obnovStav(jakej) {
zmenStav(jakej, maxStav(jakej));
}
function maxStav(jakej, nepocitejTeren) {
var _local4;
if (jakej == 1) {
_local4 = schopnost("boj");
if (_root["HLAVNIHRDINA" + strana] == cislo) {
_local4 = _local4 + _root.bonusStreh;
}
if (!nepocitejTeren) {
_local4 = _local4 + _parent.krytNa(this.posX, this.posY, this);
if (_local4 < 0) {
_local4 = 0;
}
_local4 = _local4 + vetsiKrytPodleTerenu();
}
} else {
_local4 = schopnost("sila");
if (_root["HLAVNIHRDINA" + strana] == cislo) {
_local4 = _local4 + _root.bonusZivotu;
}
}
if (_parent["vudce" + strana]) {
_local4 = _local4 + _parent["vudce" + strana];
}
return(_local4);
}
function schopnost(jaka) {
var _local2;
_local2 = _root.typyPotvor[typ]["" + jaka];
if (!hrdina) {
return(_local2);
}
return(_local2);
}
function napor() {
gotoAndPlay ("utok");
cinnost = 3;
cinnost1 = 3;
kSouperi(4);
}
function utok() {
gotoAndPlay ("utok");
cinnost = 2;
cinnost1 = 2;
kSouperi();
}
function strelba() {
gotoAndPlay ("strelba");
cinnost = 4;
cinnost1 = 4;
kSouperi();
}
function kryt() {
gotoAndPlay ("kryt");
cinnost = -4;
cinnost1 = -4;
kSouperi();
}
function obrana() {
gotoAndPlay ("obrana");
cinnost = -3;
cinnost1 = -3;
kSouperi();
}
function inflamuj(koho) {
cinnost = 5;
cinnost1 = 5;
gotoAndPlay ("inflame");
koho.cinnost = -5;
koho.cinnost1 = -5;
koho.gotoAndPlay("inflameGet");
koho.zvetsiStav(1, random(10) + 1);
}
function spal(koho) {
cinnost = 6;
cinnost1 = 6;
gotoAndPlay ("spal");
koho.cinnost = -6;
koho.cinnost1 = -6;
koho.y0 = koho.p._y;
koho.gotoAndPlay("spalSe");
}
function blyskej(koho) {
cinnost = 9;
cinnost1 = 9;
gotoAndPlay ("blesk");
koho.cinnost = -9;
koho.cinnost1 = -9;
koho.y0 = koho.p._y;
koho.gotoAndPlay("bleskKryt");
}
function znehybni(koho) {
cinnost = 7;
cinnost1 = 7;
gotoAndPlay ("znehybni");
koho.cinnost = -7;
koho.cinnost1 = -7;
koho.gotoAndPlay("znehybniSe");
}
function pohlt(koho) {
cinnost = 8;
cinnost1 = 8;
gotoAndPlay ("pohlt");
koho.cinnost = -8;
koho.cinnost1 = -8;
koho.gotoAndPlay("pohltSe");
}
function vetsiKrytPodleTerenu() {
if (_root.typyPotvor[typ]["teren" + _parent.terenNa(posX, posY)]) {
return(2);
}
return(0);
}
function ponorSe(predchoziHloubka, nehlucne) {
var _local4 = _parent.hloubkaNa(this.posX, this.posY);
if ((_local4 > 0.5) || ((_local4 == 0.5) && (!schopnost("lehkost")))) {
_y = (_y + 20);
maskaVody._visible = true;
p.setMask(maskaVody);
} else {
p.setMask(null);
maskaVody._visible = false;
}
trace((("predchozi hloubka " + predchoziHloubka) + ", hloubka ted ") + _local4);
if (predchoziHloubka == undefined) {
return(1);
}
if (nehlucne) {
return(2);
}
if ((_local4 == 0.5) && (_local4 != predchoziHloubka)) {
_root.zvuky.prd.start();
} else if ((_local4 == 1) && (_local4 != predchoziHloubka)) {
_root.zvuky.splouchnuti.start();
}
return(2);
}
function testujPlody() {
var _local3 = _parent.plodNa(posX, posY);
if (((_local3._visible && (zivotu < maxStav(2))) && (_parent.typyPlodu[_local3.hlavniTyp].lecba || (_root.typyPotvor[typ]["plody" + _local3.hlavniTyp] > 0))) && (_parent.naTahu == strana)) {
_local3.vysmahni();
_parent.plody.plodu--;
cinnost = 5;
cinnost1 = 5;
gotoAndPlay ("lecbaZeme");
return(1);
}
}
function posun(sx, sy) {
gotoAndPlay ("posun");
zac = _x;
i = 0;
smerPohybuX = sx;
smerPohybuY = sy;
_parent.natocSe(this, sx, sy);
cinnost = 1;
cinnost1 = 1;
}
function zemri(typSmrti) {
if (((_root.mod == 1) && (_root.tutorial)) && (strana == 1)) {
obnovStav(2);
_parent.testujTut("wouldBeDead", 1000);
_parent.vysvetli("nic");
_parent.casNaUstup = 0;
return(0);
}
stavy._visible = false;
_parent.uvolni(this);
if ((!typSmrti) || (typSmrti == 1)) {
gotoAndPlay ("smrt");
} else {
gotoAndPlay("smrt" + typSmrti);
}
if (zivotu > 0) {
zivotu = -10;
}
var _local4;
if (strana == 1) {
_local4 = 2;
} else {
_local4 = 1;
}
if (_parent["zlodej" + _local4] == this.cislo) {
_parent["zlodej" + _local4] = 0;
_parent["poklad" + _local4]._visible = true;
_parent["poklad" + _local4]._x = _parent.pixelX(posX, posY);
_parent["poklad" + _local4]._y = _parent.pixelY(posX, posY);
_parent[("POKLAD" + _local4) + "X"] = posX;
_parent[("POKLAD" + _local4) + "Y"] = posY;
}
if (_parent["HRAC" + _local4]) {
if (!_parent["HRAC" + strana]) {
_root.skore = _root.skore + (10 * _root.typyPotvor[this.cislo].zkusenost);
}
if (souper.cislo == 1) {
_root.zkusenostTed = _root.zkusenostTed + _root.typyPotvor[this.cislo].zkusenost;
trace("zkusenost ted je " + _root.zkusenostTed);
trace("zkusenost clkem je " + _root.zkusenost);
}
}
}
function zdravotniStav() {
var _local1;
if (zivotu > 0) {
return(1);
}
if (zivotu > -4) {
return(0);
}
return(-1);
}
function zmiz() {
stavy._visible = false;
_parent.uvolni(this);
gotoAndPlay ("zmizeni");
}
function kSouperi(multip) {
if (souper.posX < this.posX) {
smerPohybuX = -1;
} else if (souper.posX > this.posX) {
smerPohybuX = 1;
} else {
smerPohybuX = 0;
}
if (souper.posY < this.posY) {
smerPohybuY = -1;
} else if (souper.posY > this.posY) {
smerPohybuY = 1;
} else {
smerPohybuY = 0;
}
if (multip) {
multi = multip;
} else {
multi = 1;
}
x0 = p._x;
y0 = p._y;
xp0 = podst._x;
yp0 = podst._y;
}
function pohlavi() {
return(schopnost("pohlavi"));
}
this.onEnterFrame = function () {
var _local5;
var _local4;
if (!cinnost) {
return(0);
}
if (!cinnost1) {
if (neni()) {
if (zivotu <= 0) {
zemri();
} else if (utekl) {
zmiz();
_parent.pokracuj();
}
if (_parent.naTahu == strana) {
_parent.pokracuj();
}
cinnost = 0;
if (strana == _parent.naTahu) {
_parent.dalsiFigurka(strana);
}
kroku = 0;
nastavUzTahnul();
_parent.casNaUstup = 0;
return(0);
}
if (((((cinnost == 2) || (cinnost == 3)) && (!chtelJitSmeremX)) && (!chtelJitSmeremY)) || ((cinnost == 1) && (chtelJitSmeremX || (chtelJitSmeremY)))) {
chtelJitSmeremX = 0;
chtelJitSmeremY = 0;
if (((_parent.tahnouci.kroku > 0) && (!_parent.napadeny.neni())) && (!_parent.napadeny.znehybnen)) {
var _local6 = _parent.napadeny;
retreat._visible = true;
retreat.gotoAndPlay(1);
_parent.casNaUstup = 30;
trace("CAS NA USTUP!");
_parent.tahnouci0 = this;
_parent.kdoTahne = this.cislo;
_parent.tahnouci = _local6;
_parent.tahnouci.kroku = 1;
}
}
if (cinnost >= 0) {
if (chtelJitSmeremX || (chtelJitSmeremY)) {
cinnost = 1;
smerPohybuX = chtelJitSmeremX;
smerPohybuY = chtelJitSmeremY;
_parent.proved(this, smerPohybuX, smerPohybuY, 1);
return(0);
}
_parent.pokracuj();
}
cinnost = 0;
_parent.ukazMoznosti();
if (kroku > 0) {
_parent.testujTutNaUtoky(this);
}
return(0);
}
if (!(cinnost === 1)) {
} else if (i < posunyX.length) {
if (smerPohybuX > 0) {
_x = (_x + posunyX[i]);
} else if (smerPohybuX < 0) {
_x = (_x - posunyX[i]);
}
if (smerPohybuY > 0) {
_y = (_y + posunyY[i]);
} else if (smerPohybuY < 0) {
_y = (_y - posunyY[i]);
}
i++;
} else {
_local5 = this.posX + (smerPohybuX / Math.abs(smerPohybuX));
_local4 = this.posY + (smerPohybuY / Math.abs(smerPohybuY));
var _local3 = _parent.krytNa(_local5, _local4, this);
var _local7 = _local3 - _parent.krytNa(posX, posY, this);
zobrazPenaltu(_local3);
if (streh != 0) {
zvetsiStav(1, _local7, true);
}
var _local8 = _parent.hloubkaNa(posX, posY);
_parent.presun(this, _local5, _local4);
_x = _parent.pixelX(this.posX, this.posY);
_y = _parent.pixelY(this.posX, this.posY);
ponorSe(_local8);
_parent.rozvrstvi();
cinnost1 = 0;
if (!chtelJitSmeremX) {
testujPlody();
}
}
};
posunyX = new Array(0, 3, 7, 10, 10, 10, 10, 10);
posunyY = new Array(0, 2, 4, 7, 7, 7, 7, 6);
obnovStav(1);
obnovStav(2);
if (_root.scenar._visible) {
stin._visible = true;
} else {
stin._visible = false;
}
var posunKrve = 0;
if (schopnost("velikost") < 2) {
posunKrve = 30;
} else if (schopnost("velikost") > 2) {
posunKrve = -20;
}
krev._y = krev._y + posunKrve;
krev2._y = krev2._y + posunKrve;
Instance of Symbol 112 MovieClip "maskaVody" in Symbol 490 MovieClip [figurka] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 490 MovieClip [figurka] Frame 2
stavy.zvyrazni(0);
stop();
Symbol 490 MovieClip [figurka] Frame 3
cinnost1 = 0;
Symbol 490 MovieClip [figurka] Frame 4
ustupuje = false;
Symbol 490 MovieClip [figurka] Frame 5
if ((!znehybnen) || (!zivotu)) {
prevFrame();
}
Symbol 490 MovieClip [figurka] Frame 6
h1.gotoAndStop(h1._totalframes);
h1.hnat.gotoAndStop(h1.hnat._totalframes);
h2.gotoAndStop(h2._totalframes);
h2.hnat.gotoAndStop(h2.hnat._totalframes);
h3.gotoAndStop(h3._totalframes);
h3.hnat.gotoAndStop(h3.hnat._totalframes);
h4.gotoAndStop(h4._totalframes);
h4.hnat.gotoAndStop(h4.hnat._totalframes);
stop();
Symbol 490 MovieClip [figurka] Frame 22
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 29
p._x = x0 - (6 * smerPohybuX);
p._y = y0 - (4 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 30
stavy.nahod(_parent.rozhozeniObrance, _parent.zraneniObrance);
if (_parent.deadlyAttack == 1) {
vyveska.gotoAndPlay(2);
vyveska.seznam.gotoAndStop(1);
zivotu = 0;
}
if (_parent.zraneniObrance > 0) {
cakej(_parent.zraneniObrance);
var x = Math.ceil(_parent.zraneniObrance / 4);
if (zivotu <= 0) {
x = x + 5;
_root.zvuky["zasah" + souper.pohlavi()].start();
_root.zvuky["chcip" + this.pohlavi()].start();
} else {
_root.zvuky["zasah" + souper.pohlavi()].start();
_root.zvuky["au" + this.pohlavi()].start();
}
while (x > 0) {
_parent.cakejNaPodlahu(posX, posY);
x--;
}
} else {
_root.zvuky["uder" + this.souper.pohlavi()].start();
}
Symbol 490 MovieClip [figurka] Frame 31
p._x = x0 - (4 * smerPohybuX);
p._y = y0 - (3 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 32
p._x = x0 - (2 * smerPohybuX);
p._y = y0 - (1 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 33
p._x = x0;
p._y = y0;
Symbol 490 MovieClip [figurka] Frame 34
if (zivotu <= 0) {
gotoAndPlay ("streh");
}
Symbol 490 MovieClip [figurka] Frame 43
p._x = x0 - (6 * smerPohybuX);
p._y = y0 - (4 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 45
Symbol 490 MovieClip [figurka] Frame 48
p._x = x0 + (12 * smerPohybuX);
p._y = y0 + (8 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 49
var maxi;
var leth;
var kolik;
maxi = maxStav(2);
leth = schopnost("upir");
if ((leth && (_parent.zraneniUtocnika > 1)) && (zivotu < maxi)) {
kolik = Math.min(maxi - zivotu, Math.min(Math.floor(_parent.zraneniUtocnika / 2), leth));
zvetsiStav(2, kolik);
if (kolik > 0) {
vyveska.gotoAndPlay(2);
vyveska.seznam.gotoAndStop(2);
}
}
Symbol 490 MovieClip [figurka] Frame 50
p._x = x0 + (8 * smerPohybuX);
p._y = y0 + (6 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 51
p._x = x0 + (4 * smerPohybuX);
p._y = y0 + (3 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 52
p._x = x0;
p._y = y0;
Symbol 490 MovieClip [figurka] Frame 53
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 54
p._x = x0 - ((6 * smerPohybuX) * multi);
p._y = y0 - ((4 * smerPohybuY) * multi);
Symbol 490 MovieClip [figurka] Frame 57
Symbol 490 MovieClip [figurka] Frame 59
p._x = x0 + ((12 * smerPohybuX) * multi);
p._y = y0 + ((8 * smerPohybuY) * multi);
Symbol 490 MovieClip [figurka] Frame 61
p._x = x0 + ((8 * smerPohybuX) * multi);
p._y = y0 + ((6 * smerPohybuY) * multi);
var maxi;
var leth;
var kolik;
maxi = maxStav(2);
leth = schopnost("upir");
if ((leth && (_parent.zraneniObrance > 1)) && (zivotu < maxi)) {
kolik = Math.min(maxi - zivotu, Math.min(Math.floor(_parent.zraneniObrance / 2), leth));
zvetsiStav(2, kolik);
if (kolik > 0) {
vyveska.gotoAndPlay(2);
vyveska.seznam.gotoAndStop(2);
}
}
Symbol 490 MovieClip [figurka] Frame 62
p._x = x0 + ((4 * smerPohybuX) * multi);
p._y = y0 + ((3 * smerPohybuY) * multi);
Symbol 490 MovieClip [figurka] Frame 63
p._x = x0;
p._y = y0;
Symbol 490 MovieClip [figurka] Frame 79
if (souper.zivotu > 0) {
multi = 1;
} else {
multi = 0;
}
p._x = x0 - ((6 * smerPohybuX) * multi);
p._y = y0 - ((4 * smerPohybuY) * multi);
Symbol 490 MovieClip [figurka] Frame 80
if (souper.zivotu > 0) {
stavy.nahod(_parent.rozhozeniUtocnika, _parent.zraneniUtocnika);
if (_parent.zraneniUtocnika > 0) {
cakej(_parent.zraneniUtocnika);
var x = Math.ceil(_parent.zraneniUtocnika / 4);
if (!zivotu) {
x = x + 5;
_root.zvuky["zasah" + souper.pohlavi()].start();
_root.zvuky["chcip" + this.pohlavi()].start();
} else {
_root.zvuky["zasah" + souper.pohlavi()].start();
_root.zvuky["au" + this.pohlavi()].start();
}
while (x > 0) {
_parent.cakejNaPodlahu(posX, posY);
x--;
}
} else {
_root.zvuky["uder" + this.souper.pohlavi()].start();
}
} else {
gotoAndPlay ("streh");
}
Symbol 490 MovieClip [figurka] Frame 81
p._x = x0 - ((4 * smerPohybuX) * multi);
p._y = y0 - ((3 * smerPohybuY) * multi);
Symbol 490 MovieClip [figurka] Frame 82
p._x = x0 - ((2 * smerPohybuX) * multi);
p._y = y0 - ((1 * smerPohybuY) * multi);
Symbol 490 MovieClip [figurka] Frame 83
p._x = x0;
p._y = y0;
Symbol 490 MovieClip [figurka] Frame 84
if (zivotu <= 0) {
gotoAndPlay ("streh");
}
Symbol 490 MovieClip [figurka] Frame 86
Symbol 490 MovieClip [figurka] Frame 87
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 88
Symbol 490 MovieClip [figurka] Frame 104
_root.zvuky.vystrel1.start();
p._x = x0 - ((12 * smerPohybuX) * multi);
p._y = y0 - ((8 * smerPohybuY) * multi);
Symbol 490 MovieClip [figurka] Frame 106
p._x = x0 - ((8 * smerPohybuX) * multi);
p._y = y0 - ((6 * smerPohybuY) * multi);
Symbol 490 MovieClip [figurka] Frame 107
p._x = x0 - ((4 * smerPohybuX) * multi);
p._y = y0 - ((3 * smerPohybuY) * multi);
Symbol 490 MovieClip [figurka] Frame 108
p._x = x0;
p._y = y0;
Symbol 490 MovieClip [figurka] Frame 126
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 147
stavy.nahod(_parent.rozhozeniObrance, _parent.zraneniObrance);
if (!_parent.rozhozeniObrance) {
vyveska.seznam.gotoAndStop(3);
vyveska.gotoAndPlay(2);
_root.zvuky.brink3.start();
}
if (_parent.zraneniObrance > 0) {
cakej(_parent.zraneniObrance);
var x = Math.ceil(_parent.zraneniObrance / 4);
if (!zivotu) {
x = x + 5;
_root.zvuky["zasah" + souper.pohlavi()].start();
_root.zvuky["chcip" + this.pohlavi()].start();
} else {
_root.zvuky["au" + this.pohlavi()].start();
}
while (x > 0) {
_parent.cakejNaPodlahu(posX, posY);
x--;
}
}
p._x = x0 - (12 * smerPohybuX);
p._y = y0 - (8 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 149
p._x = x0 - (8 * smerPohybuX);
p._y = y0 - (6 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 150
p._x = x0 - (4 * smerPohybuX);
p._y = y0 - (2 * smerPohybuY);
Symbol 490 MovieClip [figurka] Frame 151
p._x = x0;
p._y = y0;
Symbol 490 MovieClip [figurka] Frame 152
if (!zivotu) {
gotoAndPlay ("streh");
}
Symbol 490 MovieClip [figurka] Frame 163
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 164
_root.zvuky[("kouzlo" + this.pohlavi()) + "burn"].start();
Symbol 490 MovieClip [figurka] Frame 192
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 213
stavy.nahod(_parent.rozhozeniObrance, _parent.zraneniObrance);
if (!_parent.rozhozeniObrance) {
vyveska.seznam.gotoAndStop(3);
vyveska.gotoAndPlay(2);
_root.zvuky.brink3.start();
}
if (_parent.zraneniObrance > 0) {
cakej(_parent.zraneniObrance);
var x = Math.ceil(_parent.zraneniObrance / 4);
if (!zivotu) {
x = x + 5;
_root.zvuky["zasah" + souper.pohlavi()].start();
_root.zvuky["chcip" + this.pohlavi()].start();
} else {
_root.zvuky["au" + this.pohlavi()].start();
}
while (x > 0) {
_parent.cakejNaPodlahu(posX, posY);
x--;
}
}
Symbol 490 MovieClip [figurka] Frame 226
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 227
_root.zvuky[("kouzlo" + this.pohlavi()) + "inflame"].start();
Symbol 490 MovieClip [figurka] Frame 253
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 264
ohen.zapal(20);
Symbol 490 MovieClip [figurka] Frame 277
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 278
_root.zvuky[("kouzlo" + this.pohlavi()) + "burn"].start();
Symbol 490 MovieClip [figurka] Frame 296
Symbol 490 MovieClip [figurka] Frame 309
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 326
ohen.zapal(40);
p._y = y0 - 10;
Symbol 490 MovieClip [figurka] Frame 327
p._y = y0 - 20;
Symbol 490 MovieClip [figurka] Frame 328
stavy.nahod(_parent.rozhozeniObrance, _parent.zraneniObrance);
if (_parent.zraneniObrance > 0) {
cakej(_parent.zraneniObrance);
var x = Math.ceil(_parent.zraneniObrance / 4);
if (!zivotu) {
x = x + 5;
_root.zvuky["zasah" + souper.pohlavi()].start();
_root.zvuky["chcip" + this.pohlavi()].start();
} else {
_root.zvuky["au" + this.pohlavi()].start();
}
while (x > 0) {
_parent.cakejNaPodlahu(posX, posY);
x--;
}
}
p._y = y0 - 18;
Symbol 490 MovieClip [figurka] Frame 329
p._y = y0 - 14;
Symbol 490 MovieClip [figurka] Frame 330
p._y = y0 - 10;
Symbol 490 MovieClip [figurka] Frame 331
p._y = y0 - 0;
Symbol 490 MovieClip [figurka] Frame 332
if (!zivotu) {
gotoAndPlay ("streh");
}
Symbol 490 MovieClip [figurka] Frame 336
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 337
_root.zvuky[("kouzlo" + this.pohlavi()) + "burn"].start();
Symbol 490 MovieClip [figurka] Frame 378
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 390
_parent.zranObrance(this, true);
stavy.nahod(_parent.rozhozeniObrance, _parent.zraneniObrance);
Symbol 490 MovieClip [figurka] Frame 401
if (!_parent.zraneniObrance) {
gotoAndPlay ("streh");
souper.gotoAndPlay("streh");
} else {
znehybnen = 2;
}
Symbol 490 MovieClip [figurka] Frame 402
h1.play();
h2.play();
h3.play();
h4.play();
Symbol 490 MovieClip [figurka] Frame 412
cinnost1 = 0;
stop();
Symbol 490 MovieClip [figurka] Frame 413
_root.zvuky[("kouzlo" + this.pohlavi()) + "burn"].start();
Symbol 490 MovieClip [figurka] Frame 465
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 466
x0 = p._x;
y0 = p._y;
Symbol 490 MovieClip [figurka] Frame 477
vlnovky1.setMask(m1);
vlnovky1.init(20);
vlnovky2.setMask(m2);
vlnovky2.init(20);
Instance of Symbol 485 MovieClip "m1" in Symbol 490 MovieClip [figurka] Frame 477
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 485 MovieClip "m2" in Symbol 490 MovieClip [figurka] Frame 477
onClipEvent (load) {
_visible = false;
}
Symbol 490 MovieClip [figurka] Frame 481
_parent.zranObrance(this, true);
stavy.nahod(_parent.rozhozeniObrance, _parent.zraneniObrance);
Symbol 490 MovieClip [figurka] Frame 488
if ((_parent.zraneniObrance > 0) && ((Math.floor(_parent.zraneniObrance / 5) + 1) >= _root.typyPotvor[typ].velikost)) {
zivotu = -10;
multi = 1;
} else {
multi = 0;
}
Symbol 490 MovieClip [figurka] Frame 508
if (multi) {
p.setMask(maskaVody);
}
p._y = y0 + (10 * multi);
Symbol 490 MovieClip [figurka] Frame 509
p._y = y0 + (30 * multi);
Symbol 490 MovieClip [figurka] Frame 510
p._y = y0 + (60 * multi);
Symbol 490 MovieClip [figurka] Frame 511
p._y = y0 + (100 * multi);
Symbol 490 MovieClip [figurka] Frame 512
vlnovky1._visible = false;
vlnovky2._visible = false;
Symbol 490 MovieClip [figurka] Frame 513
vlnovky1.setMask(0);
vlnovky2.setMask(0);
m1.removeMovieClip();
m2.removeMovieClip();
Symbol 490 MovieClip [figurka] Frame 514
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 518
ohen.zapal(20);
var m = maxStav(2);
var zv = Math.min(3, maxStav(2) - zivotu);
zvetsiStav(2, zv);
Symbol 490 MovieClip [figurka] Frame 529
gotoAndPlay ("streh");
Symbol 490 MovieClip [figurka] Frame 530
Symbol 490 MovieClip [figurka] Frame 531
Symbol 490 MovieClip [figurka] Frame 541
_visible = false;
stop();
Symbol 490 MovieClip [figurka] Frame 542
p._visible = false;
stavy._visible = false;
_root.zvuky.zab.start();
Symbol 490 MovieClip [figurka] Frame 543
var pocet = Math.round(maxStav(2) / 5);
var x = 1;
while (x <= pocet) {
_parent.cakejNaPodlahu(posX, posY);
x++;
}
Symbol 490 MovieClip [figurka] Frame 556
_visible = false;
stop();
Symbol 490 MovieClip [figurka] Frame 557
_visible = false;
Symbol 490 MovieClip [figurka] Frame 558
stop();
Symbol 500 MovieClip Frame 1
stop();
Symbol 504 MovieClip Frame 1
function ukaz(cislo, strana) {
if (!cislo) {
typ = 0;
_visible = false;
return(0);
}
if (cislo == typ) {
return(0);
}
_visible = true;
_root.bojiste.infoinfo.gotoAndStop(1);
sch1._visible = false;
sch2._visible = false;
sch3._visible = false;
typ = cislo;
pocetSkilu = 0;
seznam = _root.typyPotvor[cislo];
p1.gotoAndStop((seznam.postava * 2) - 1);
p1.podst._visible = false;
jmeno = seznam.jmeno.toUpperCase();
shield = seznam.boj;
life = seznam.sila;
lifeKlip.gotoAndStop(strana);
speed = seznam.rychlost;
var _local2 = 0;
var _local3;
var _local7;
var _local6;
var _local5 = "";
while (_local2 < _root.popisySkilu.length) {
_local2++;
_local3 = seznam["" + _root.popisySkilu[_local2].id];
if (_local3) {
pocetSkilu++;
ukazSkil(_local2, pocetSkilu, _local3);
if (pocetSkilu == 3) {
break;
}
}
}
}
function schovej() {
_visible = false;
}
function ukazSkil(cislo, cisloPopisku, hodnota) {
var _local4 = this["sch" + cisloPopisku];
_local4._visible = true;
var _local6;
var _local10;
var _local5;
var _local9;
var _local7;
var _local3 = _root.popisySkilu[cislo];
_local4.nadpis = _local3.jmeno.toUpperCase();
if ((_local3.id == "lethality") && (hodnota < 1)) {
_local4.nadpis = "BLUNT WEAPON";
}
if (_local3.funkce) {
if (_local3.funkce == 1) {
_local5 = hodnota;
} else if (_local3.funkce == 2) {
_local5 = hodnota * 10;
} else {
_local5 = hodnota * 100;
}
_local7 = _local3.popis.indexOf("#");
_local10 = _local3.popis.substr(0, _local7);
_local9 = _local3.popis.substring(_local7 + 1);
_local6 = (_local10 + _local5) + _local9;
} else {
_local6 = _local3.popis;
}
_local4.popis = _local6;
}
_visible = false;
stop();
Symbol 513 MovieClip Frame 1
stop();
Symbol 514 MovieClip Frame 1
var l;
var t;
l = _root.getBytesLoaded();
t = _root.getBytesTotal();
if (!l) {
l = 0;
}
if (!t) {
t = 1;
}
if (l < t) {
pre.gotoAndStop(Math.round((l * 50) / t));
} else {
_parent.play();
}
Symbol 514 MovieClip Frame 2
gotoAndPlay (1);
Symbol 527 MovieClip Frame 1
stop();
Symbol 542 Button
on (release) {
getURL ("http://www.arcadetown.com/index.asp?gameid=squaresandblades2", "_blank");
}
Symbol 549 MovieClip Frame 54
stop();
_parent.play();
Symbol 550 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 2
stop();
Symbol 550 MovieClip Frame 3
stop();
_parent.play();
Symbol 551 Button
on (rollOver) {
gotoAndStop ("nad");
}
on (rollOut) {
gotoAndStop ("normalka");
}
on (release) {
getURL ("http://www.arcadetown.com/index.asp?gameid=squaresandblades2", "_blank");
}
Symbol 554 MovieClip Frame 6
stop();
Symbol 559 MovieClip Frame 1
stop();
Symbol 561 Button
on (rollOver) {
rucka.gotoAndStop(2);
}
on (rollOut) {
rucka.gotoAndStop(1);
}
on (press) {
this.startDrag();
rucka.gotoAndStop(3);
}
on (release) {
this.stopDrag();
rucka.gotoAndStop(2);
}
on (releaseOutside) {
this.stopDrag();
rucka.gotoAndStop(1);
}
Symbol 565 Button
on (release) {
skryj();
_root.scenar.play();
}
Symbol 569 Button
on (release) {
skryj();
_root.gotoAndPlay("menu");
}
Symbol 573 Button
on (release) {
posudCoDal();
}
Symbol 588 Button
on (release) {
zkusToZnovu();
}
Symbol 592 Button
on (release) {
posudOsud();
}
Symbol 595 Button
on (release) {
_root.zkusenost = _root.zkusenost + _root.zkusenostTed;
_root.zkusenostTed = 0;
pokracujVeScenari();
}
Symbol 600 Button
on (release) {
_root.naplnOddil(_root.pozustavsiHrdina);
posudOsud();
}
Symbol 601 Button
on (release) {
posudOsud();
}
Symbol 610 Button
on (release) {
_root.bonusZivotu = _root.bonusZivotu + 2;
_root.postavy[0].zivotu = _root.postavy[0].zivotu + 2;
pokracujVeScenari();
}
Symbol 611 Button
on (release) {
_root.bonusStreh++;
skryj();
pokracujVeScenari();
}
Symbol 616 Button
on (release) {
_root.scenar.play();
zavri();
}
Symbol 617 Button
on (release) {
_root.scenar.odpocivej();
_root.scenar.druzina.zobraz();
_root.scenar.play();
zavri();
}
Symbol 622 Button
on (release) {
skryj();
_root.bojiste.pokracuj();
}
Symbol 633 MovieClip Frame 1
stop();
Symbol 680 Button
on (release) {
if (!playerName.text.length) {
return(0);
}
skryj();
var strOut = (((((playerName.text + " (") + _root.survivalParty) + ")") + "|") + _root.skore);
var strOut2 = _root.EncrpytString(strOut);
getURL ("http://www.arcadetown.com/squaresandblades/hs.asp?" + strOut2, "_blank");
_root.gotoAndPlay("menu");
}
Symbol 687 Button
on (release) {
_root.bojiste.vysledekBoje = -5;
_root.vysledekBoje = -5;
posudCoDal();
}
Symbol 688 Button
on (release) {
skryj();
}
Symbol 693 Button
on (release) {
_root[("hrdina" + _root[("emisar" + _root.cisloMise) + "_1"]) + "stav"] = 4;
_root[("emisar" + _root.cisloMise) + "_1"] = 0;
_root[("hrdina" + _root[("emisar" + _root.cisloMise) + "_2"]) + "stav"] = 4;
_root[("emisar" + _root.cisloMise) + "_2"] = 0;
_root[("hrdina" + _root[("emisar" + _root.cisloMise) + "_3"]) + "stav"] = 4;
_root[("emisar" + _root.cisloMise) + "_3"] = 0;
_root.strategie.gotoAndPlay("predMisi");
skryj();
}
Symbol 696 Button
on (release) {
_root.gotoAndPlay("menu");
skryj();
}
Symbol 699 Button
on (release) {
pokracujVeScenari();
}
Symbol 702 Button
on (release) {
_root.strategie.doAkce();
skryj();
}
Symbol 708 Button
on (release) {
_root.strategie.play();
skryj();
}
Symbol 714 Button
on (release) {
if (_root.bitvy[_root.kapitola].length > _root.cisloMise) {
_root.cisloMise = _root.bitvy[_root.kapitola].length;
}
_root.strategie.gotoAndPlay("predMisi");
skryj();
}
Symbol 718 Button
on (release) {
potvor = 2;
nextFrame();
}
Symbol 719 Button
on (release) {
potvor = 4;
nextFrame();
}
Symbol 720 Button
on (release) {
_root.tutorial = 0;
_root.gotoAndPlay("predGame");
}
Symbol 726 Button
on (release) {
_root.krev = 0;
_parent.nastavTrening(potvor);
skryj();
}
Symbol 727 Button
on (release) {
_root.krev = 2;
_parent.nastavTrening(potvor);
skryj();
}
Symbol 731 Button
on (release) {
nextFrame();
}
Symbol 750 Button
on (release) {
skryj();
}
Symbol 762 Button
on (release) {
skryj();
}
Symbol 783 Button
on (release) {
_root.tutorial = 0;
_root.gotoAndPlay("predGame");
skryj();
}
Symbol 784 Button
on (release) {
_root.tutorial++;
_root.prohlas("taktikaHelp1");
}
Symbol 785 Button
on (release) {
_root.tutorial = 0;
_root.gotoAndPlay("menu");
skryj();
}
Symbol 790 MovieClip Frame 1
function posudCoDal() {
if ((!_root.mod) || (_root.tutorial)) {
skryj();
_root.gotoAndPlay("menu");
} else if (_root.mod == 1) {
if (_root.vysledekBoje < 0) {
var _local3;
if (_root.cisloMise > 10) {
_local3 = -10;
} else {
_local3 = 0;
}
x = 1;
while (x <= 2) {
h = _root[("hrdina" + x) + "meziPostavama"];
if (h && (!this["h" + h].neni())) {
_root.bojiste["h" + h].zivotu = _local3;
}
x++;
}
_root.bojiste.urciOsudHrdinu();
vyprazdniOddily();
gotoAndStop ("battleLost");
_root.vysledek[root.cisloMise] = _root.vysledekBoje;
} else {
if (_root.cisloMise <= 10) {
_root.vyhranoBitev++;
_root.vysledek[root.cisloMise] = 1;
_root.bojiste.urciOsudHrdinu();
vyprazdniOddily();
posilyReprez = _root.reprezentantTridy(_root.kapitola, _root.cisloMise, 3);
posilyPocet = _root.pocetPosil(_root.kapitola, _root.cisloMise);
if (posilyPocet) {
if (((_root[("hrdina" + _root[("emisar" + _root.cisloMise) + "_1"]) + "stav"] > 0) || (_root[("hrdina" + _root[("emisar" + _root.cisloMise) + "_2"]) + "stav"] > 0)) || (_root[("hrdina" + _root[("emisar" + _root.cisloMise) + "_3"]) + "stav"] > 0)) {
gotoAndStop ("posily");
} else {
gotoAndStop ("posilyVnivec");
}
} else {
posudOsud();
}
} else {
posudOsud();
}
trace("Vyhrano bitev " + _root.vyhranoBitev);
}
} else if (_root.mod == 2) {
gotoAndStop (1);
skryj();
if (_root.vysledekBoje < 0) {
if ((!_root.skore) || (_root.skore < 0)) {
_root.gotoAndPlay("menu");
} else {
_root.prohlas("highScore");
}
} else {
duplicateMovieClip (_root.bojiste.krev, _root.krev, _root.getNextHighestDepth());
_root.krev._visible = false;
if (_root.bojiste.tah < _root.potvory.length) {
_root.skore = _root.skore + (10 * (_root.potvory.length - _root.bojiste.tah));
}
_root.survivalNovyKolo();
}
}
}
function posudOsud() {
textik = _root.bojiste.hlaskaOosudu(_root.vysledekBoje);
if (textik.length) {
gotoAndStop ("osudHrdinu");
} else {
pokracujVeScenari();
}
}
function vyprazdniOddily() {
_root.pozustavsiHrdina = 0;
var _local3;
var _local2;
_local3 = 1;
while (_local3 <= 3) {
_local2 = _root[(("emisar" + _root.cisloMise) + "_") + _local3];
if (_local2) {
_root.vyprazdniOddil(_local2);
if ((!_root.pozustavsiHrdina) && (_root[("hrdina" + _local2) + "stav"] > 0)) {
_root.pozustavsiHrdina = _local2;
}
}
_local3++;
}
}
function zkusToZnovu() {
_root.nactiDruzinu();
_root.gotoAndPlay("scenar");
zavri();
}
function pokracujVeScenari() {
_root.ulozDruzinu();
_root.gotoAndPlay("scenar");
zavri();
}
function zavri() {
_root.bojiste.ukazMenu(true);
_visible = false;
}
function skryj() {
zavri();
}
stop();
Symbol 790 MovieClip Frame 5
if (_root.mod == 2) {
textik = ("- battle " + _root.kolo) + " won!";
} else {
textik = "";
}
Symbol 790 MovieClip Frame 16
fig.podst._visible = false;
fig.gotoAndStop(posilyReprez);
Symbol 790 MovieClip Frame 38
if (_root.mod == 2) {
textik = "Your score: " + _root.skore;
} else {
textik = "";
}
Symbol 790 MovieClip Frame 43
hrdText = new Array("nobody", "this hero", "these heroes", "these heroes", "so many heroes");
if (_root.cisloMise > 10) {
textik = "Are you sure you want to send the hero to the rescue mission instead of regular one?";
} else {
textik = "Ready to send ";
if ((pocet > 0) && (pocet2 > pocet)) {
textik = textik + "ONLY ";
}
textik = textik + (hrdText[pocet] + "\ninto the mission?");
}
play();
Symbol 790 MovieClip Frame 44
stop();
Symbol 790 MovieClip Frame 51
stavy.zivotup.gotoAndStop(21);
stavy.streh.h1.textik.text = _root.typyPotvor[2].boj + "";
stavy.zivotu.h1.textik.text = _root.typyPotvor[2].sila + "";
nextFrame();
Symbol 790 MovieClip Frame 52
Symbol 790 MovieClip Frame 69
Symbol 790 MovieClip Frame 70
Symbol 793 MovieClip Frame 1
stop();
Symbol 799 MovieClip Frame 1
function rozsvit(kolik) {
if (kolik >= 100) {
prikrov._alpha = 75;
} else if (kolik) {
prikrov._alpha = 50;
} else {
prikrov._alpha = 0;
}
sviti = kolik;
}
stop();
Symbol 800 MovieClip Frame 1
function sestavSe(nahodne) {
DILKUX = _parent.mapaBojiste.DILKUX;
if (!DILKUX) {
DILKUX = _parent.DILKUX;
}
DILKUY = _parent.mapaBojiste.DILKUY;
if (!DILKUY) {
DILKUY = _parent.DILKUY;
}
var _local7;
var _local8;
var _local14;
var _local5;
var _local4;
var _local6;
var _local9;
var _local3;
d0._y = 0;
_local6 = 1;
while (_local6 <= DILKUY) {
_local4 = 1;
while (_local4 <= DILKUX) {
_local7 = d0.duplicateMovieClip((("d" + _local4) + "_") + _local6, this.getNextHighestDepth());
_local7._x = d0._x + ((_local4 - 1) * _local7.plocha._width);
_local7._y = d0._y + ((_local6 - 1) * _local7.plocha._height);
_local7.teren = _parent.mapaBojiste.hlavniTeren;
_local7.objekt = 0;
_local7.plod = 0;
_local7.vec = 0;
_local4++;
}
_local6++;
}
d0._visible = false;
_local8 = 0;
_local14 = _parent.mapaBojiste.tereny;
if ((nahodne > 1) || ((!_local14) && (nahodne))) {
var _local11;
var _local10;
_local11 = random(2) * DILKUX;
_local10 = random(2) * DILKUY;
var _local12 = random(2);
var _local19;
var _local20;
var _local21;
if (_parent.mapaBojiste.brehu == undefined) {
_local19 = random(3);
} else {
_local19 = _parent.mapaBojiste.brehu;
}
if (_parent.mapaBojiste.rek == undefined) {
_local20 = random(2);
} else {
_local20 = _parent.mapaBojiste.rek;
}
_local21 = 0;
if (_parent.mapaBojiste.hlavniTeren == 5) {
_local21 = random(3);
}
var _local17 = _parent.sousedniTereny[((_parent.mapaBojiste.hlavniTeren * 4) - 4) + random(4)];
var _local16 = 4;
var _local18 = _parent.ricniTereny[((_parent.mapaBojiste.hlavniTeren * 4) - 4) + random(4)];
var _local15;
if (_parent.mapaBojiste.hlavniTeren != 1) {
_local15 = _parent.reky;
} else {
_local15 = _parent.koryta;
}
var _local13;
_local9 = 0;
while (_local9 < _local19) {
_local13 = random(_parent.brehy.length);
_local5 = _parent.brehy[_local13];
_local3 = 0;
while (_local3 < _local5.length) {
if (_local12) {
_local4 = _local5[_local3 + 1];
_local6 = _local5[_local3];
} else {
_local4 = _local5[_local3];
_local6 = _local5[_local3 + 1];
}
this[(("d" + _parent.otocenaSouradnice(_local4, _local11)) + "_") + _parent.otocenaSouradnice(_local6, _local10)].teren = _local17;
_local3 = _local3 + 2;
}
_local9++;
}
_local9 = 0;
while (_local9 < _local21) {
_local13 = random(_parent.ostruvky.length);
_local5 = _parent.ostruvky[_local13];
_local3 = 0;
while (_local3 < _local5.length) {
if (_local12) {
_local4 = _local5[_local3 + 1];
_local6 = _local5[_local3];
} else {
_local4 = _local5[_local3];
_local6 = _local5[_local3 + 1];
}
this[(("d" + _parent.otocenaSouradnice(_local4, _local11)) + "_") + _parent.otocenaSouradnice(_local6, _local10)].teren = _local16;
_local3 = _local3 + 2;
}
_local9++;
}
_local9 = 0;
while (_local9 < _local20) {
_local13 = random(_local15.length);
_local5 = _local15[_local13];
_local3 = 0;
while (_local3 < _local5.length) {
if (_local12) {
_local4 = _local5[_local3 + 1];
_local6 = _local5[_local3];
} else {
_local4 = _local5[_local3];
_local6 = _local5[_local3 + 1];
}
this[(("d" + _parent.otocenaSouradnice(_local4, _local11)) + "_") + _parent.otocenaSouradnice(_local6, _local10)].teren = _local18;
_local3 = _local3 + 2;
}
_local9++;
}
} else if (_local14) {
while (_local14.length >= ((_local8 * 3) + 3)) {
this[(("d" + _local14[_local8 * 3]) + "_") + _local14[(_local8 * 3) + 1]].teren = _local14[(_local8 * 3) + 2];
_local8++;
}
}
_local6 = 1;
while (_local6 <= DILKUY) {
_local4 = 1;
while (_local4 <= DILKUX) {
_local7 = this[(("d" + _local4) + "_") + _local6];
_local8 = (_local7.teren * 2) + 1;
if (_parent.jeCerna(_local4, _local6)) {
_local8++;
}
_local7.gotoAndStop(_local8);
_local4++;
}
_local6++;
}
}
function ukazNeco() {
var _local4 = 1;
while (_local4 <= DILKUY) {
var _local3 = 1;
while (_local3 <= DILKUX) {
this[(("d" + _local3) + "_") + _local4].barva = _parent.cesty[_local3 - 1][_local4 - 1];
_local3++;
}
_local4++;
}
}
function odkrejPrikrovy() {
var _local3 = 1;
while (_local3 <= DILKUY) {
var _local2 = 1;
while (_local2 <= DILKUX) {
this[(("d" + _local2) + "_") + _local3].rozsvit(0);
_local2++;
}
_local3++;
}
}
function zazelenej(x, y, stav) {
this[(("d" + x) + "_") + y].rozsvit(stav);
}
sestavSe(1);
stop();
Symbol 838 Button
on (rollOver) {
gotoAndStop ("2");
}
on (rollOut) {
gotoAndStop ("zacatek");
}
on (release) {
_root.naStrane = 1;
_root.mod = 1;
_parent.gotoAndPlay("volbaHrdiny");
}
Symbol 839 Button
on (rollOver) {
gotoAndStop ("3");
}
on (rollOut) {
gotoAndStop ("zacatek");
}
on (release) {
_root.mod = 0;
_parent.gotoAndPlay("random");
}
Symbol 840 Button
on (rollOver) {
gotoAndStop ("4");
}
on (rollOut) {
gotoAndStop ("zacatek");
}
on (release) {
_parent.gotoAndPlay("settings");
}
Symbol 841 Button
on (rollOver) {
gotoAndStop ("5");
}
on (rollOut) {
gotoAndStop ("zacatek");
}
on (release) {
_parent.gotoAndPlay("credits");
}
Symbol 842 Button
on (rollOver) {
gotoAndStop ("6");
}
on (rollOut) {
gotoAndStop ("zacatek");
}
on (release) {
getURL ("http://www.arcadetown.com/index.asp?gameid=squaresandblades2", "_blank");
}
Symbol 843 Button
on (rollOver) {
gotoAndStop ("7");
}
on (rollOut) {
gotoAndStop ("zacatek");
}
on (release) {
_parent.gotoAndPlay("survival");
}
Symbol 844 Button
on (rollOver) {
gotoAndStop ("8");
}
on (rollOut) {
gotoAndStop ("zacatek");
}
on (release) {
getURL ("http://www.arcadetown.com/free_content/index.asp?gameid=squaresandblades2", "_blank");
}
Symbol 845 Button
on (rollOver) {
gotoAndStop ("1");
}
on (rollOut) {
gotoAndStop ("zacatek");
}
on (release) {
getURL ("http://www.arcadetown.com/squaresandblades/game.asp?squaresandblades2", "_blank");
}
Symbol 854 MovieClip Frame 8
stop();
Symbol 860 MovieClip Frame 1
cyklus = random(4) + 4;
Symbol 860 MovieClip Frame 21
cyklus--;
if (cyklus >= 1) {
gotoAndPlay (2);
}
Symbol 872 MovieClip Frame 1
stop();
Symbol 873 Button
on (release) {
_root.typHrace = 1;
play();
}
Symbol 874 Button
on (release) {
_root.typHrace = 3;
play();
}
Symbol 875 Button
on (release) {
_root.typHrace = 2;
play();
}
Symbol 876 Button
on (release) {
_root.typHrace = 5;
play();
}
Symbol 877 Button
on (release) {
gotoAndPlay ("zacatek");
}
Symbol 881 Button
on (release) {
_root.mod = undefined;
gotoAndPlay ("zacatek");
}
Symbol 882 Button
on (release) {
nextFrame();
}
Symbol 886 Button
on (release) {
gotoAndStop ("movement");
}
Symbol 887 Button
on (release) {
gotoAndStop ("qualities");
}
Symbol 888 Button
on (release) {
gotoAndStop ("attack");
}
Symbol 889 Button
on (release) {
gotoAndStop ("strike");
}
Symbol 890 Button
on (release) {
gotoAndStop ("conclusion");
}
Symbol 891 Button
on (release) {
gotoAndStop ("advancing");
}
Symbol 907 MovieClip Frame 1
stop();
Symbol 955 MovieClip Frame 1
function jeCerna(x, y) {
return((((x >> 1) << 1) == x) == (((y >> 1) << 1) == y));
}
mapaBojiste = _root.mapaBojiste0;
DILKUX = 3;
DILKUY = 3;
_root.zacni();
Symbol 955 MovieClip Frame 3
fig1._visible = false;
dlazba.odkrejPrikrovy();
dlazba.zazelenej(2, 2, true);
nextFrame();
Symbol 955 MovieClip Frame 4
fig1.nastav(2, 1, -1, 1, true);
fig1._visible = true;
stop();
Symbol 955 MovieClip Frame 5
dlazba.zazelenej(1, 1, true);
dlazba.zazelenej(1, 3, true);
dlazba.zazelenej(3, 1, true);
dlazba.zazelenej(3, 3, true);
Symbol 955 MovieClip Frame 8
fig1.natocSe(1, 1);
fig2._visible = false;
dlazba.zazelenej(1, 1, false);
dlazba.zazelenej(1, 3, false);
dlazba.zazelenej(3, 1, false);
dlazba.zazelenej(3, 3, false);
dlazba.zazelenej(3, 2, true);
nextFrame();
Symbol 955 MovieClip Frame 9
fig2._visible = true;
fig2.nastav(17, 2, -1, 1, true);
dlazba.zazelenej(2, 2, false);
dlazba.zazelenej(3, 2, false);
Symbol 955 MovieClip Frame 17
fig2._visible = false;
nextFrame();
Symbol 955 MovieClip Frame 18
fig2._visible = true;
fig2.nastav(17, 2, 1, -1, true);
Symbol 955 MovieClip Frame 19
fig1.stavy.streh.h1.textik.text = 0;
Symbol 955 MovieClip Frame 21
fig1.stavy.streh.h1.textik.text = fig1.streh;
Symbol 955 MovieClip Frame 24
fig1._visible = false;
fig2._visible = false;
nextFrame();
Symbol 955 MovieClip Frame 25
fig1._visible = true;
fig1.nastav(1, 1, -1, 1, true);
fig2._visible = true;
fig2.nastav(18, 2, 1, 1, true);
Symbol 955 MovieClip Frame 27
fig1.stavy.streh.h1.textik.text = Number(fig1.streh - 6);
Symbol 955 MovieClip Frame 29
fig2.stavy.streh.h1.textik.text = 0;
fig2.stavy.zivotu.h1.textik.text = Number(fig2.zivotu - 1);
Symbol 955 MovieClip Frame 32
fig1.natocSe(1, -1);
Symbol 955 MovieClip Frame 37
fig1._visible = false;
fig2._visible = false;
nextFrame();
Symbol 955 MovieClip Frame 38
fig1._visible = true;
fig1.nastav(3, 1, -1, 1, true);
fig2._visible = true;
fig2.nastav(17, 2, 1, 1, true);
Symbol 955 MovieClip Frame 40
fig1.stavy.streh.h1.textik.text = Number(fig1.streh - 5);
fig2.stavy.streh.h1.textik.text = Number(fig2.streh - 5);
Symbol 955 MovieClip Frame 44
fig2._visible = false;
fig2.stavy._visible = false;
fig1._visible = false;
fig1.stavy._visible = false;
nextFrame();
Symbol 955 MovieClip Frame 45
fig2._visible = true;
fig2.nastav(6, 1, 1, 1, true);
fig2.stavy._visible = false;
fig1._visible = true;
fig1.nastav(24, 2, -1, 1, true);
fig1.stavy._visible = false;
Symbol 955 MovieClip Frame 47
Symbol 958 Button
on (release) {
if (_root.udelatkoBarva == 2) {
_root.udelatkoBarva = 1;
} else {
_root.udelatkoBarva = 2;
}
zobraz();
}
Symbol 959 Button
on (release) {
if (_root.udelatkoMnozstvi == 2) {
_root.udelatkoMnozstvi = 1;
} else {
_root.udelatkoMnozstvi = 2;
}
zobraz();
}
Symbol 962 MovieClip Frame 1
stop();
Symbol 965 MovieClip Frame 1
stop();
Symbol 966 MovieClip Frame 1
stop();
Symbol 967 MovieClip Frame 1
function zobraz() {
napisMnozstvi.gotoAndStop(_root.udelatkoMnozstvi);
f2._visible = _root.udelatkoMnozstvi - 1;
napisBarva.gotoAndStop(_root.udelatkoBarva);
f1.gotoAndStop(_root.udelatkoBarva);
f2.gotoAndStop(_root.udelatkoBarva);
}
zobraz();
stop();
Instance of Symbol 966 MovieClip "f2" in Symbol 967 MovieClip Frame 1
/* no clip actions */
Symbol 969 Button
on (release) {
_root.naverbujSkupinu("hrdinove", 2, _root.postavy);
_root.naverbujSkupinu("skretiOddil", random(7) + 5, _root.potvory);
_root.defaultuj();
_root.HRAC1 = 1;
_root.HRAC2 = 0;
_root.DILKUX = 11;
_root.DILKUY = 9;
_root.POKLAD2 = 1;
_root.POKLAD2X = 11;
_root.POKLAD2Y = 5;
_root.RAZENI1X = -1;
_root.RAZENI1Y = 0;
_root.RAZENI2X = 1;
_root.RAZENI2Y = -1;
_root.UTEK1 = 4;
_root.poucka = "thieves";
rozjedTo();
}
Symbol 970 Button
on (release) {
var x;
var pocet = (5 + random(7));
_root.potvory.push(18);
x = 1;
while (x <= pocet) {
_root.potvory.push(17);
x++;
}
_root.naverbujSkupinu("lidi", 2 + random(3), _root.postavy);
_root.defaultuj();
_root.VIP2 = 1;
_root.HRAC1 = 1;
_root.HRAC2 = 0;
_root.poucka = "killTheCaptain";
rozjedTo();
}
Symbol 971 Button
on (release) {
nasad(1, true, false);
_root.naverbujSkupinu("skretiOddil", random(6) + 7, _root.potvory);
_root.defaultuj();
_root.HLAVNIHRDINA1 = 1;
_root.HRAC1 = 1;
_root.HRAC2 = 0;
_root.poucka = "defendTheLord";
rozjedTo();
}
Symbol 972 Button
on (release) {
_root.postavy.push(29);
_root.naverbujSkupinu("hrdinove", random(2) + 1, _root.postavy);
_root.naverbujSkupinu("skretiOddil", random(3) + 5, _root.potvory);
_root.defaultuj();
_root.HRAC1 = 1;
_root.HRAC2 = 0;
_root.VIP1 = 1;
_root.DILKUX = 11;
_root.DILKUY = 9;
_root.RAZENI1X = -1;
_root.RAZENI1Y = 0;
_root.RAZENI2X = 1;
_root.RAZENI2Y = 0;
_root.UTEK1 = 2;
_root.UTEK2 = 2;
_root.poucka = "runWithTheLady";
rozjedTo(true);
}
Symbol 973 Button
on (release) {
_root.naverbujSkupinu("hrdinove", 1, _root.postavy);
_root.naverbujSkupinu("hrdinove", 1, _root.potvory);
_root.defaultuj();
rozjedTo();
}
Symbol 974 Button
on (rollOver) {
gotoAndStop (3);
}
on (rollOut) {
gotoAndStop (2);
}
on (release) {
_root.naverbujSkupinu("lidi", zakladPostav() + random(4), _root.postavy);
_root.naverbujSkupinu("skretiOddil", zakladPotvor() + random(5), _root.potvory);
_root.defaultuj();
rozjedTo(true);
}
Symbol 975 Button
on (rollOver) {
gotoAndStop (3);
}
on (rollOut) {
gotoAndStop (2);
}
on (release) {
_root.naverbujSkupinu("skretiOddil", zakladPotvor() + random(4), _root.postavy);
_root.naverbujSkupinu("skretiOddil", zakladPotvor() + random(5), _root.potvory);
_root.defaultuj();
rozjedTo(true);
}
Symbol 976 Button
on (rollOver) {
gotoAndStop (3);
}
on (rollOut) {
gotoAndStop (2);
}
on (release) {
_root.naverbujSkupinu("lidi", zakladPostav() + random(4), _root.postavy);
_root.naverbujSkupinu("lidi", zakladPostav() + random(4), _root.potvory);
_root.defaultuj();
rozjedTo(true);
}
Symbol 982 MovieClip Frame 1
function nasad(kolik, prvni, druhej, bezPoucky) {
var _local2;
var _local3;
if (prvni) {
_local3 = armady[kolik * 2];
_local2 = 0;
while (_local2 < _local3.length) {
if (!_local3[_local2]) {
_local2++;
}
_root.postavy.push(_local3[_local2]);
_local2++;
}
}
if (druhej) {
_local3 = armady[(kolik * 2) + 1];
_local2 = 0;
while (_local2 < _local3.length) {
if (!_local3[_local2]) {
_local2++;
}
_root.potvory.push(_local3[_local2]);
_local2++;
}
}
if (bezPoucky) {
_root.poucka = "";
} else {
_root.poucka = poucky[kolik];
}
}
function zakladPostav() {
if (_root.udelatkoMnozstvi > 1) {
return(3);
}
return(1);
}
function zakladPotvor() {
if (_root.udelatkoMnozstvi > 1) {
return(6);
}
return(3);
}
function rozjedTo(podleUdelatka) {
if (podleUdelatka) {
if (_root.udelatkoBarva == 1) {
_root.HRAC1 = 1;
_root.HRAC2 = 0;
} else {
_root.HRAC1 = 0;
_root.HRAC2 = 1;
}
}
_root.gotoAndPlay("game");
}
armady = new Array(new Array(), new Array(), new Array(0, 2, 12, 12, 12), new Array());
while (_root.postavy.length) {
_root.postavy.pop();
}
while (_root.potvory.length) {
_root.potvory.pop();
}
Symbol 982 MovieClip Frame 2
stop();
Symbol 984 Button
on (release) {
nextFrame();
}
Symbol 1000 MovieClip Frame 1
stop();
Symbol 1002 Button
on (release) {
if (_root.krev < 2) {
_root.krev++;
} else {
_root.krev = 0;
}
zobraz();
}
Symbol 1003 Button
on (release) {
_root.napoveda = !_root.napoveda;
zobraz();
}
Symbol 1004 Button
on (release) {
if (_root.ticho) {
_root.ticho = false;
} else {
_root.ticho = true;
}
_root.hudboHraj(_root.typHudby);
zobraz();
}
Symbol 1005 Button
on (release) {
if (_root.diff < 2) {
_root.diff = 2;
} else {
_root.diff = 1;
}
zobraz();
}
Symbol 1009 MovieClip Frame 1
stop();
Symbol 1013 MovieClip Frame 1
stop();
Symbol 1018 MovieClip Frame 1
stop();
Symbol 1021 MovieClip Frame 1
stop();
Symbol 1022 MovieClip Frame 1
function zobraz() {
krev.gotoAndStop(3 - _root.krev);
napoveda.gotoAndStop(2 - _root.napoveda);
hudba.gotoAndStop(Number(_root.ticho) + 1);
diff.gotoAndStop(_root.diff);
}
zobraz();
Symbol 1026 Button
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
on (release) {
getURL ("http://www.thunderbird.cz/", "_blank");
}
Symbol 1037 MovieClip Frame 1
ptak.stop();
ptak2.stop();
stop();
Symbol 1043 MovieClip Frame 1
DILKUX = 14;
DILKUY = 13;
_root.zacni();
_root.kapitola = 0;
_root.cisloMise = 0;
Symbol 1043 MovieClip Frame 2
dlazba.odkrejPrikrovy();
if (_root.typHudby != 1) {
_root.hudboHraj(1);
}
if (_root.mod == 0) {
gotoAndPlay ("random");
}
Symbol 1043 MovieClip Frame 5
stop();
Symbol 1043 MovieClip Frame 6
if (_root.tutorial) {
_root.prohlas("taktikaHelp1");
stop();
} else {
_root.gotoAndPlay("predGame");
}
Symbol 1043 MovieClip Frame 9
stop();
Symbol 1043 MovieClip Frame 10
postavy.gotoAndStop(1 + _root.typHrace);
_root.zvukPozadi.stop();
Symbol 1043 MovieClip Frame 29
stop();
_parent.gotoAndPlay("predGame");
Symbol 1043 MovieClip Frame 32
stop();
Symbol 1043 MovieClip Frame 36
stop();
Symbol 1043 MovieClip Frame 37
Symbol 1043 MovieClip Frame 40
surv.cacheAsBitmap = false;
stop();
Symbol 1043 MovieClip Frame 44
stop();
Symbol 1043 MovieClip Frame 48
stop();
Symbol 1045 MovieClip Frame 1
this.onMouseDown = function () {
this.klik = 1;
};
this.onMouseUp = function () {
this.klik = 0;
};
jak = 2;
stop();
Symbol 1045 MovieClip Frame 3
Symbol 1045 MovieClip Frame 9
if (this.klik) {
jak = 3;
}
_parent.cinnost.x = moznostX;
_parent.cinnost.y = moznostY;
_parent.proved(_parent.tahnouci, _parent.cinnost.x, _parent.cinnost.y, jak);
Symbol 1048 MovieClip Frame 1
function rozsvit(kolik) {
sviti = kolik;
if (sviti) {
_alpha = 100;
} else {
_alpha = 50;
}
}
stop();
Symbol 1049 Button
on (rollOver) {
gotoAndPlay ("on");
_parent.vysvetli("menu" + this.cislo);
}
on (rollOut) {
gotoAndPlay ("off");
_parent.vysvetli("");
}
on (release) {
_parent.menuAkce(this.cislo);
}
Symbol 1053 MovieClip Frame 2
stop();
Symbol 1053 MovieClip Frame 4
stop();
Symbol 1100 MovieClip Frame 1
stop();
Symbol 1100 MovieClip Frame 5
var s = sila;
if (!s) {
specif = "NO SPECIAL EFECT HERE";
} else {
specif = ("-" + s) + " to guard for both";
}
Symbol 1100 MovieClip Frame 32
if (k > 1) {
specif = ("( " + k) + " steps )";
} else {
specif = ("( " + k) + " step )";
}
Symbol 1100 MovieClip Frame 36
if (k > 1) {
specif = ("( " + k) + " steps )";
} else {
specif = ("( " + k) + " step )";
}
Symbol 1100 MovieClip Frame 41
if (k > 1) {
specif = ("( " + k) + " steps )";
} else {
specif = ("( " + k) + " step )";
}
Symbol 1100 MovieClip Frame 46
if (k > 1) {
specif = ("( " + k) + " steps )";
} else {
specif = ("( " + k) + " step )";
}
Symbol 1100 MovieClip Frame 51
if (k > 1) {
specif = ("( " + k) + " steps )";
} else {
specif = ("( " + k) + " step )";
}
Symbol 1100 MovieClip Frame 56
if (k > 1) {
specif = ("( " + k) + " steps )";
} else {
specif = ("( " + k) + " step )";
}
Symbol 1103 Button
on (release) {
getURL ("http://www.arcadetown.com/squaresandblades/game.asp?squaresandblades2", "_blank");
}
Symbol 1106 MovieClip Frame 1
stop();
Symbol 1111 MovieClip Frame 2
stop();
Symbol 1112 MovieClip Frame 8
stop();
Symbol 1113 MovieClip Frame 1
function prijmiPodminky() {
DILKUX = _root.DILKUX;
DILKUY = _root.DILKUY;
HRAC1 = _root.HRAC1;
HRAC2 = _root.HRAC2;
HLAVNIHRDINA1 = _root.HLAVNIHRDINA1;
HLAVNIHRDINA2 = _root.HLAVNIHRDINA2;
VIP1 = _root.VIP1;
VIP2 = _root.VIP2;
POKLAD1 = _root.POKLAD1;
POKLAD2 = _root.POKLAD2;
POKLAD1X = _root.POKLAD1X;
POKLAD1Y = _root.POKLAD1Y;
POKLAD2X = _root.POKLAD2X;
POKLAD2Y = _root.POKLAD2Y;
UTEK1 = _root.UTEK1;
UTEK2 = _root.UTEK2;
MORALKA1 = _root.MORALKA1;
MORALKA2 = _root.MORALKA2;
RAZENI1X = _root.RAZENI1X;
RAZENI1Y = _root.RAZENI1Y;
RAZENI2X = _root.RAZENI2X;
RAZENI2Y = _root.RAZENI2Y;
POSILA1X = _root.POSILA1X;
POSILA1Y = _root.POSILA1Y;
POSILA1CAS = _root.POSILA1CAS;
POSILA2X = _root.POSILA2X;
POSILA2Y = _root.POSILA2Y;
POSILA2CAS = _root.POSILA2CAS;
if (_root.kapitola == 1) {
switch (_root.cisloMise) {
case 1 :
poucka = "shield";
break;
case 2 :
poucka = "retreat";
break;
case 3 :
poucka = "terrain";
break;
case 4 :
poucka = "run";
break;
case 5 :
poucka = "wounds";
}
}
if (!poucka) {
poucka = _root.poucka;
}
}
function urciZraneni(strana) {
var _local6 = this["armada" + strana];
var _local4 = this["iniciala" + strana];
var _local5;
var _local3;
_local5 = _root.zraneni.length;
_local3 = 0;
while (_local3 < _local5) {
_root.zraneni.pop();
_local3++;
}
_local5 = _local6.length;
_local3 = 0;
while (_local3 < _local5) {
_local6.pop();
_local3++;
}
_local3 = 1;
while (_local3 <= _local5) {
if (this[_local4 + _local3].zivotu > 0) {
_local6.push(this[_local4 + _local3].typ);
_root.zraneni.push(this[_local4 + _local3].maxStav(2) - this[_local4 + _local3].zivotu);
}
_local3++;
}
}
function aplikujZraneni(strana) {
var _local3;
var _local8;
var _local4;
var _local5;
var _local6;
_local4 = this["armada" + strana];
_local5 = this["iniciala" + strana];
_local6 = _root.zraneni.length;
trace("aplikuju zraneni");
_local3 = 0;
while (_local3 < _local4.length) {
if (_root.zraneni[_local3]) {
this[_local5 + (_local3 + 1)].zvetsiStav(2, -1 * _root.zraneni[_local3]);
}
_local3++;
}
}
function Zalezitost2D() {
this.x = 0;
this.y = 0;
this.typ = 0;
}
function testujBytosti() {
vysvetleni = 0;
bytost = 0;
var _local2;
var _local4 = 1;
while (_local4 < 3) {
var _local3 = 1;
while (_local3 <= this["armada" + _local4].length) {
_local2 = this[this["iniciala" + _local4] + _local3];
if (((((naTahu == _local2.strana) && (_local2.cislo == kdoTahne)) && (!_local2.uzTahnul)) || (_local2.cinnost)) || ((_local2.posX == nadX) && (_local2.posY == nadY))) {
_local2.stavy.zvyrazni(1);
} else {
_local2.stavy.zvyrazni(0);
}
_local3++;
}
_local4++;
}
}
function pokracuj() {
pokracovat = true;
}
function stuj() {
pokracovat = false;
}
function ukazMoznosti(komu) {
var _local5 = komu;
if (!komu) {
_local5 = tahnouci;
}
var _local2;
var _local3;
var _local7;
var _local4;
var _local6 = 0;
_local3 = 1;
while (_local3 <= DILKUY) {
_local2 = 1;
while (_local2 <= DILKUX) {
dlazba[(("d" + _local2) + "_") + _local3].rozsvit(0);
_local2++;
}
_local3++;
}
if (!tahnouci.hrac) {
return(0);
}
if (komu == -1) {
return(0);
}
_local3 = 1;
while (_local3 <= DILKUY) {
_local2 = 1;
while (_local2 <= DILKUX) {
_local4 = lzeKontaktovat(_local5, _local2, _local3);
if (!_local4) {
_local4 = lzeAkcnit(_local5, _local2, _local3);
}
if (_local4) {
if (_local5 == tahnouci) {
dlazba[(("d" + _local2) + "_") + _local3].rozsvit(_local4);
}
if (_local4 != 3) {
_local6++;
}
} else if (_local5 == tahnouci) {
dlazba[(("d" + _local2) + "_") + _local3].rozsvit(0);
}
_local2++;
}
_local3++;
}
if (_local5 == tahnouci) {
_local7 = _local5.strana;
if ((_local5.posY == 1) && (this[("u" + _local7) + "_1"])) {
utek1.rozsvit(1);
} else {
utek1.rozsvit(0);
}
if ((_local5.posX == DILKUX) && (this[("u" + _local7) + "_2"])) {
utek2.rozsvit(1);
} else {
utek2.rozsvit(0);
}
if ((_local5.posY == DILKUY) && (this[("u" + _local7) + "_3"])) {
utek3.rozsvit(1);
} else {
utek3.rozsvit(0);
}
if ((_local5.posX == 1) && (this[("u" + _local7) + "_4"])) {
utek4.rozsvit(1);
} else {
utek4.rozsvit(0);
}
}
if (_local5 == tahnouci) {
ukazDleKurzoru();
}
dlazba[(("d" + _local5.posX) + "_") + _local5.posY].rozsvit(100);
if ((!_local6) && (casNaUstup > 1)) {
casNaUstup = 1;
}
return(_local6);
}
function vysvetli(kam) {
if (!kam) {
popisky._visible = false;
} else {
popisky._visible = true;
popisky.gotoAndStop(kam);
}
}
function ukazDleKurzoru() {
var _local5;
var _local9;
var _local7;
var _local4;
var _local6 = "";
_root.popisPostav._visible = false;
if (!pokracovat) {
return(0);
}
if ((!this["HRAC" + naTahu]) && (!casNaUstup)) {
return(0);
}
if (this["HRAC" + naTahu] && (casNaUstup)) {
return(0);
}
_local5 = 1;
while (_local5 < 5) {
if (this["utek" + _local5].sviti && (this["utek" + _local5].hitTest(_root._xmouse, _root._ymouse))) {
vysvetli("flee");
}
_local5++;
}
_local5 = poziceX(this._xmouse, this._ymouse);
_local9 = poziceY(this._xmouse, this._ymouse);
if (!naPlanu(_local5, _local9)) {
if ((casNaUstup > 0) && (tahnouci.strana != naTahu)) {
vysvetli("retreat");
} else {
vysvetli("");
}
return(0);
}
nadX = _local5;
nadY = _local9;
_local4 = figurkaNa(_local5, _local9);
if (_local4) {
infoinfo.gotoAndStop(_local4.strana + 1);
_root.popisPostav._visible = true;
_root.popisPostav._x = _root._xmouse;
_root.popisPostav._y = _root._ymouse;
_root.popisPostav.nazev = _local4.schopnost("jmeno");
var _local8 = _local4.rychlost();
var _local3 = 1;
while (_local3 <= 6) {
if (_local3 <= _local8) {
_root.popisPostav["stopa" + _local3]._visible = true;
if ((_local4.uzTahnul || ((_local4 == tahnouci) && (_local4.kroku < _local3))) || (_local4.strana != tahnouci.strana)) {
_root.popisPostav["stopa" + _local3]._alpha = 40;
} else {
_root.popisPostav["stopa" + _local3]._alpha = 100;
}
} else {
_root.popisPostav["stopa" + _local3]._visible = false;
}
_local3++;
}
} else {
_root.popisPostav._visible = false;
infoinfo.gotoAndStop(1);
}
if ((tah < 2) && (tahnouci.kroku == tahnouci.rychlost())) {
_local6 = "begin";
}
_local7 = dlazba[(("d" + nadX) + "_") + nadY];
if (_local7.sviti == 9) {
_local6 = "lightning";
popisky.k = tahnouci.muzeBlyskat();
} else if (_local7.sviti == 8) {
_local6 = "swallow";
popisky.k = tahnouci.muzePohltit();
} else if (_local7.sviti == 7) {
_local6 = "hold";
popisky.k = tahnouci.muzeZnehybnit();
} else if (_local7.sviti == 6) {
_local6 = "burn";
popisky.k = tahnouci.muzeSpalit();
} else if (_local7.sviti == 5) {
_local6 = "inflame";
popisky.k = tahnouci.muzeInflamovat();
} else if (_local7.sviti == 1) {
_local6 = "step";
} else if (_local7.sviti == 2) {
popisky.sila = cisloNaporu(tahnouci, _local4);
_local6 = "strike";
} else if (_local7.sviti == 3) {
_local6 = "readyToMove";
} else if (_local7.sviti == 4) {
_local6 = "shoot";
popisky.k = tahnouci.muzeStrilet();
} else if ((((_local4 && (_local4.strana == naTahu)) && _local4.zivotu) && (!_local4.uzTahnul)) && ((_local4 != tahnouci) || neniZvolenaFigurka)) {
if ((!neniZvolenaFigurka) && (tahnouci.kroku < tahnouci.rychlost())) {
_local6 = "moveBreak";
} else {
_local6 = "move";
}
} else if (((_local7.sviti == 0) && (tahnouci.strana == naTahu)) && (!neniZvolenaFigurka)) {
if (tahnouci.kroku < tahnouci.rychlost()) {
_local6 = "break";
} else {
_local6 = "unselect";
}
}
if ((casNaUstup > 0) && (tahnouci.strana != naTahu)) {
_local6 = "retreat";
}
vysvetli(_local6);
if (_local7.sviti || (_local4.strana == naTahu)) {
_root.popisPostav.gotoAndStop(_local6);
} else {
_root.popisPostav.gotoAndStop(1);
}
}
function klikNaDesku() {
var _local3;
var _local5;
var _local6;
var _local4;
if (!pokracovat) {
return(0);
}
if (_root.hlaska._visible) {
return(0);
}
if ((!this["HRAC" + naTahu]) && (!casNaUstup)) {
return(0);
}
if (this["HRAC" + naTahu] && (casNaUstup)) {
return(0);
}
if ((((!buton1.hitTest(_root._xmouse, _root._ymouse)) && (!buton2.hitTest(_root._xmouse, _root._ymouse))) && (!buton3.hitTest(_root._xmouse, _root._ymouse))) && (!buton4.hitTest(_root._xmouse, _root._ymouse))) {
_local3 = 1;
while (_local3 < 5) {
if (this["utek" + _local3].sviti && (this["utek" + _local3].hitTest(_root._xmouse, _root._ymouse))) {
cinnost.x = this["utek" + _local3].smerX;
cinnost.y = this["utek" + _local3].smerY;
proved(tahnouci, cinnost.x, cinnost.y, 1);
break;
}
_local3++;
}
}
_local3 = poziceX(this._xmouse, this._ymouse);
_local5 = poziceY(this._xmouse, this._ymouse);
if (!naPlanu(_local3, _local5)) {
return(0);
}
_local6 = figurkaNa(_local3, _local5);
_local4 = dlazba[(("d" + _local3) + "_") + _local5].sviti;
if (_local4 == 100) {
return(0);
}
if (_local4 != 5) {
if (((this["HRAC" + naTahu] && (_local6.strana == naTahu)) && (!_local6.uzTahnul)) && ((_local6 != tahnouci) || (neniZvolenaFigurka))) {
zmenTahnouciho(_local6);
neniZvolenaFigurka = false;
ukazMoznosti();
pokracuj();
return(1);
}
}
if (_local4) {
if (_local4 == 3) {
return(0);
}
if (_local4 == 1) {
cinnost.x = _local3 - tahnouci.posX;
cinnost.y = _local5 - tahnouci.posY;
proved(tahnouci, cinnost.x, cinnost.y, 1);
}
if (_local4 == 2) {
utokNeboNapor.moznostX = _local3 - tahnouci.posX;
utokNeboNapor.moznostY = _local5 - tahnouci.posY;
utokNeboNapor.gotoAndPlay(2);
} else if (_local4 == 4) {
cinnost.x = _local3 - tahnouci.posX;
cinnost.y = _local5 - tahnouci.posY;
proved(tahnouci, cinnost.x, cinnost.y, 4);
} else if (_local4 == 5) {
cinnost.x = _local3 - tahnouci.posX;
cinnost.y = _local5 - tahnouci.posY;
proved(tahnouci, cinnost.x, cinnost.y, 5);
} else if (_local4 == 6) {
cinnost.x = _local3 - tahnouci.posX;
cinnost.y = _local5 - tahnouci.posY;
proved(tahnouci, cinnost.x, cinnost.y, 6);
}
if (_local4 == 7) {
cinnost.x = _local3 - tahnouci.posX;
cinnost.y = _local5 - tahnouci.posY;
proved(tahnouci, cinnost.x, cinnost.y, 7);
}
if (_local4 == 8) {
cinnost.x = _local3 - tahnouci.posX;
cinnost.y = _local5 - tahnouci.posY;
proved(tahnouci, cinnost.x, cinnost.y, 8);
}
if (_local4 == 9) {
cinnost.x = _local3 - tahnouci.posX;
cinnost.y = _local5 - tahnouci.posY;
proved(tahnouci, cinnost.x, cinnost.y, 9);
}
stuj();
if (tahnouci.strana == naTahu) {
if (_local4 < 4) {
tahnouci.kroku = tahnouci.kroku - cenaTerenuNa(tahnouci.posX, tahnouci.posY, tahnouci);
} else {
tahnouci.kroku--;
}
}
} else {
tahnouci.stavy.zvyrazni(0);
neniZvolenaFigurka = true;
ukazMoznosti(-1);
}
}
function Tut() {
var _local3;
if (!_root.tutorial) {
_local3 = 0;
} else {
_local3 = _root.tutorial - 1;
}
this.barvy = _local3;
this.canAttack = _local3;
this.attacked = _local3;
this.refreshed = _local3;
this.enemyRefreshed = _local3;
this.wouldBeDead = _local3;
this.endOfTraining = _local3;
}
function testujTut(co, kolik) {
if (!_root.tutorial) {
return(0);
}
if (_root.mod != 1) {
return(0);
}
if (!kolik) {
kolik = 1;
}
if (tut["" + co] < kolik) {
_root.prohlas(co);
tut["" + co]++;
return(1);
}
return(0);
}
function testujTutNaUtoky(ci) {
if (((naTahu == 2) && (pocetKontaktu(ci.posX, ci.posY, 1))) && (ci.strana == 2)) {
testujTut("attacked");
} else if (((naTahu == 1) && (pocetKontaktu(ci.posX, ci.posY, 2))) && (ci.strana == 1)) {
testujTut("canAttack");
}
}
function nahodnejPlodDoMapy(x, y) {
var _local1;
var _local2;
_local1 = dlazba[(("d" + x) + "_") + y].teren;
_local2 = random(plodyPodlePodkladu[_local1].length);
return(plodyPodlePodkladu[_local1][_local2]);
}
function nahodnejObjektDoMapy(x, y) {
var _local1;
var _local2;
var _local3;
_local1 = dlazba[(("d" + x) + "_") + y].teren;
_local2 = random(objektyPodlePodkladu[_local1].length);
_local3 = polovic(objektyPodlePodkladu[_local1][_local2]);
if (typyObjektu[_local3].rozlehlost > 0) {
return(0);
}
return(objektyPodlePodkladu[_local1][_local2]);
}
function polovic(x) {
return(((x - 1) >> 1) + 1);
}
function otocenaSouradnice(x, konec) {
if (!konec) {
return(x);
}
return((konec + 1) - x);
}
function zmenTah() {
var _local3;
var _local5;
posledniStiskX = 0;
posledniStiskY = 0;
pauzaMeziFigurkama = 16;
neniZvolenaFigurka = false;
vudce1 = 0;
vudce2 = 0;
var _local4;
_local3 = 1;
while (_local3 <= _root.postavy.length) {
_local4 = this["h" + _local3].schopnost("leadership");
if (_local4 > vudce1) {
vudce1 = _local4;
}
_local3++;
}
_local3 = 1;
while (_local3 <= _root.potvory.length) {
_local4 = this["p" + _local3].schopnost("leadership");
if (_local4 > vudce2) {
vudce2 = _local4;
}
_local3++;
}
if (tah && (this[("POSILA" + naTahu) + "CAS"] == tah)) {
nasackuj(naTahu, this[("POSILA" + naTahu) + "X"], this[("POSILA" + naTahu) + "Y"], true);
rozvrstvi(1);
pauzaMeziFigurkama = pauzaMeziFigurkama + 10;
_root.zvuky.signal1.start();
}
if ((!naTahu) || (naTahu == 2)) {
tah++;
naTahu = 1;
neNaTahu = 2;
_local3 = 1;
for ( ; _local3 <= _root.postavy.length ; _local3++) {
if (this["h" + _local3].znehybnen > 0) {
this["h" + _local3].znehybnen--;
if (this["h" + _local3].znehybnen) {
this["h" + _local3].uzTahnul = true;
this["h" + _local3].kroku = 0;
this["h" + _local3].gotoAndStop("nehejbaSe");
continue;
}
this["h" + _local3].gotoAndPlay("streh");
}
this["h" + _local3].uzTahnul = false;
this["h" + _local3].bylNapor = 0;
this["h" + _local3].kroku = this["h" + _local3].rychlost();
this["h" + _local3].chtelJitSmeremX = 0;
this["h" + _local3].chtelJitSmeremY = 0;
if (this["h" + _local3].zivotu) {
trace(((((((((("***** x" + _local3) + ": ") + this["h" + _local3].posX) + " y") + _local3) + ": ") + this["h" + _local3].posY) + " utekl: ") + this["h" + _local3].utekl) + " *******");
}
}
if (!HRAC1) {
ukazMenu(false);
kdoTahne = 1;
zmenTahnouciho(this["h" + kdoTahne]);
jakDlouhoNetahnul = 0;
krokuKdyzNetahnul = tahnouci.kroku;
} else {
ukazMenu(true);
_local5 = prvniZivej(1, true);
zmenTahnouciho(_local5);
ukazMoznosti();
}
gotoAndStop ("hrac");
} else if (naTahu == 1) {
naTahu = 2;
neNaTahu = 1;
_local3 = 1;
for ( ; _local3 <= _root.potvory.length ; _local3++) {
if (this["p" + _local3].znehybnen > 0) {
this["p" + _local3].znehybnen--;
if (this["p" + _local3].znehybnen) {
this["p" + _local3].uzTahnul = true;
this["p" + _local3].kroku = 0;
continue;
}
this["h" + _local3].gotoAndPlay("streh");
}
this["p" + _local3].uzTahnul = false;
this["p" + _local3].bylNapor = 0;
this["p" + _local3].kroku = this["p" + _local3].rychlost();
}
if (!HRAC2) {
_local5 = prvniZivej(2, true);
zmenTahnouciho(_local5);
ukazMenu(false);
jakDlouhoNetahnul = 0;
krokuKdyzNetahnul = tahnouci.kroku;
} else {
ukazMenu(true);
_local5 = prvniZivej(2, true);
zmenTahnouciho(_local5);
ukazMoznosti();
}
gotoAndStop ("pocitac");
}
popisky.gotoAndStop("nic");
if (obnovVsem(naTahu, 1)) {
if (naTahu == 1) {
testujTut("refreshed");
} else {
testujTut("enemyRefreshed");
}
}
if (tahnouci.znehybnen > 0) {
tahnouci.kroku = 0;
} else if (tah == 1) {
tahnouci.kroku = Math.min(tahnouci.schopnost("rychlost"), tahnouci.zivotu);
} else {
tahnouci.kroku = tahnouci.rychlost();
}
}
function zmenTahnouciho(kdo) {
if (tahnouci && (tahnouci.kroku < tahnouci.rychlost())) {
tahnouci.nastavUzTahnul(true);
}
tahnouci.kroku = 0;
tahnouci = kdo;
kdoTahne = kdo.cislo;
if (!kdo.uzTahnul) {
kdo.kroku = kdo.rychlost();
}
}
function dalsiKrok() {
vysledekBoje = jeKonec();
if (vysledekBoje) {
if ((_root.HRAC1 == 0) && (_root.HRAC2 == 1)) {
vysledekBoje = vysledekBoje * -1;
}
if (_root.mod == 1) {
urciOsudHrdinu();
}
_parent.play();
_root.vysledekBoje = vysledekBoje;
_root.vysledek[_root.cisloMise] = vysledekBoje;
var _local6;
var _local5;
if (vysledekBoje < 0) {
_local6 = 2;
_local5 = 1;
} else {
_local6 = 1;
_local5 = 2;
}
_parent.vyprazdniSkupinu(_local5);
return(0);
}
if (pauzaMeziFigurkama > 0) {
pauzaMeziFigurkama--;
if (!casNaUstup) {
return(0);
}
}
if (!pokracovat) {
return(0);
}
if (_root.hlaska._visible) {
return(0);
}
testujInfo();
if (!tahnouci.hrac) {
if (tahnouci.kroku != byloKroku) {
byloKroku = tahnouci.kroku;
cekejNaZacykleni = 20;
} else {
cekejNaZacykleni--;
if (cekejNaZacykleni < 1) {
byloKroku = 200;
cekejNaZacykleni = 20;
tahnouci.nastavUzTahnul(true);
tahnouci.kroku = 0;
zmenTah();
}
}
}
if (!tahnouci.hrac) {
if (tahnouci.kroku == krokuKdyzNetahnul) {
jakDlouhoNetahnul++;
} else {
jakDlouhoNetahnul = 0;
krokuKdyzNetahnul = tahnouci.kroku;
}
if (jakDlouhoNetahnul > 250) {
zmenTah();
}
}
if (!tahnouci) {
zmenTah();
}
napor = 0;
if (((naTahu == 2) && (!casNaUstup)) || ((naTahu == 1) && (casNaUstup))) {
bytosti = _root.potvory;
k = "p";
kk = "h";
neNaTahu = 1;
} else {
bytosti = _root.postavy;
k = "h";
kk = "p";
neNaTahu = 2;
}
if (casNaUstup > 0) {
casNaUstup--;
if (casNaUstup < 1) {
tahnouci = tahnouci0;
kdoTahne = tahnouci0.cislo;
hledejCestu(tahnouci.posX, tahnouci.posY, tahnouci.posX, tahnouci.posY);
return(0);
}
}
if ((tahnouci.strana == naTahu) && (tahnouci.neni())) {
tahnouci.nastavUzTahnul(true);
tahnouci.kroku = 0;
dalsiFigurka(naTahu);
}
if ((tahnouci.strana == naTahu) && (tahnouci.kroku < 1)) {
tahnouci.uzTahnul = true;
tahnouci.kroku = 0;
tahnouci.bylNapor = 0;
if (!dalsiFigurka(naTahu)) {
if (this["HRAC" + naTahu] && (esteNetahli(naTahu))) {
neniZvolenaFigurka = true;
} else {
zmenTah();
}
ukazMoznosti();
return(0);
}
tahnouci = this[k + kdoTahne];
if (tahnouci.zivotu) {
tahnouci.kroku = tahnouci.rychlost();
ukazMoznosti();
} else {
tahnouci.kroku = 0;
return(0);
}
}
if (!tahnouci.hrac) {
vysvetli(0);
if (((tahnouci.kroku == tahnouci.rychlost()) || (!tahnouci.souper)) || (tahnouci.souper.neni())) {
hledejCestu(tahnouci.posX, tahnouci.posY, tahnouci.posX, tahnouci.posY);
if (tahnouci.strana == naTahu) {
tahnouci.souper = urciSoupere(tahnouci);
if (!tahnouci.souper) {
tahnouci.kroku--;
}
}
trace("Souper je " + tahnouci.souper.cislo);
trace((((((("Hledam cestu " + tahnouci.souper.posX) + " ") + tahnouci.souper.posY) + " do ") + tahnouci.posX) + " ") + tahnouci.posY);
}
dalkaKsouperi = hledejCestu(tahnouci.souper.posX, tahnouci.souper.posY, tahnouci.posX, tahnouci.posY);
if (dalkaKsouperi == -2) {
dalkaKsouperi = dalkaVzduchem(tahnouci.posX, tahnouci.posY, tahnouci.souper.posX, tahnouci.souper.posY);
}
urciKrok();
if (cinnost.typ) {
trace((((("posun x:" + cinnost.x) + " posun y:") + cinnost.y) + " typ: ") + cinnost.typ);
if (tahnouci.strana == naTahu) {
if (cinnost.typ < 4) {
tahnouci.kroku = tahnouci.kroku - cenaTerenuNa(tahnouci.posX, tahnouci.posY, tahnouci);
} else {
tahnouci.kroku--;
}
}
stuj();
proved(tahnouci, cinnost.x, cinnost.y, cinnost.typ);
} else if (tahnouci.strana == naTahu) {
tahnouci.stavy.zvyrazni(0);
tahnouci.kroku--;
if (!dalsiFigurka(naTahu)) {
zmenTah();
return(0);
}
} else {
casNaUstup = 0;
tahnouci = tahnouci.souper;
kdoTahne = tahnouci.cislo;
ukazMoznosti();
}
} else {
stisknutoX = 0;
stisknutoY = 0;
if (Key.isDown(32) && (_root.testovaniBitvy)) {
_root.zvuky.signal1.start();
var _local4 = 1;
while (_local4 <= _root.potvory.length) {
this["p" + _local4]._visible = false;
this["p" + _local4].zivotu = 0;
_local4++;
}
return(0);
}
if (tahnouci.strana != naTahu) {
if (Key.isDown(37)) {
stisknutoX = -1;
stisknutoY = -1;
}
if (Key.isDown(39)) {
stisknutoX = 1;
stisknutoY = 1;
}
if (Key.isDown(38)) {
stisknutoX = 1;
stisknutoY = -1;
}
if (Key.isDown(40)) {
stisknutoX = -1;
stisknutoY = 1;
}
}
if (!lzeJit(tahnouci, stisknutoX, stisknutoY)) {
stisknutoX = 0;
stisknutoY = 0;
}
posledniStiskX = stisknutoX;
posledniStiskY = stisknutoY;
cinnost.x = stisknutoX;
cinnost.y = stisknutoY;
if (cinnost.x || (cinnost.y)) {
if (tahnouci.strana == naTahu) {
tahnouci.kroku--;
} else {
tahnouci.ustupuje = true;
}
stuj();
proved(tahnouci, cinnost.x, cinnost.y);
}
}
}
function testujInfo() {
if (Key.isDown(73)) {
popisky._visible = false;
infoinfo.gotoAndStop(1);
var _local3 = figurkaNa(poziceX(this._xmouse, this._ymouse), poziceY(this._xmouse, this._ymouse));
if (_local3) {
_root.info.ukaz(_local3.typ, _local3.strana);
}
} else {
_root.info.typ = 0;
_root.info.schovej();
popisky._visible = true;
}
}
function dalsiFigurka(strana) {
casNaUstup = 0;
var _local3;
var _local4;
if (strana == 1) {
_local3 = "h";
_local4 = _root.postavy;
} else {
_local3 = "p";
_local4 = _root.potvory;
}
var _local5 = kdoTahne;
this[_local3 + kdoTahne].stavy.zvyrazni(0);
if (this["HRAC" + strana]) {
neniZvolenaFigurka = true;
return(0);
}
do {
kdoTahne--;
if (kdoTahne < 1) {
kdoTahne = _local4.length;
}
if (kdoTahne == _local5) {
trace("Zadna dalsi figujka nenalezena");
return(0);
}
} while ((this[_local3 + kdoTahne].uzTahnul || (this[_local3 + kdoTahne].kroku < 0.5)) || (this[_local3 + kdoTahne].neni()));
tahnouci = this[_local3 + kdoTahne];
trace("Prehozeno na figurku " + _local3);
return(_local3);
}
function urciKrok() {
if (!tahnouci.souper) {
cinnost.x = 0;
cinnost.y = 0;
cinnost.typ = 0;
tahnouci.cinnost = 0;
tahnouci.cinnost1 = 0;
return(0);
}
var _local3;
var _local4;
var _local1 = (vyhoda(tahnouci.souper) + random(8)) - random(5);
_local1 = _local1 + Math.round((pocetBojujicich(tahnouci.strana) - 1) / 1);
_local1 = _local1 + tahnouci.schopnost("agrese");
_local1 = _local1 + tahnouci.moralka;
if (!_local1) {
_local1 = 0;
}
if (_local1 >= 0) {
zmenaDalky(tahnouci.posX, tahnouci.posY, -1);
}
if (_local1 < -3) {
napor = -1;
}
if (_local1 < 0) {
zmenaDalky(tahnouci.posX, tahnouci.posY, 1);
}
trace("vyhoda " + _local1);
if ((((tahnouci.muzeSpalit() > 0) && (napor > -1)) && (hloubkaNa(tahnouci.souper.posX, tahnouci.souper.posY) < 0.5)) && (dalkaVzduchem(tahnouci.posX, tahnouci.posY, tahnouci.souper.posX, tahnouci.souper.posY) <= 3)) {
cinnost.x = tahnouci.souper.posX - tahnouci.posX;
cinnost.y = tahnouci.souper.posY - tahnouci.posY;
cinnost.typ = 6;
return(6);
}
if (((((tahnouci.muzeZnehybnit() > 0) && (napor > -1)) && ((!tahnouci.souper.znehybnen) > 0)) && (hloubkaNa(tahnouci.souper.posX, tahnouci.souper.posY) < 0.5)) && (dalkaVzduchem(tahnouci.posX, tahnouci.posY, tahnouci.souper.posX, tahnouci.souper.posY) <= 6)) {
cinnost.x = tahnouci.souper.posX - tahnouci.posX;
cinnost.y = tahnouci.souper.posY - tahnouci.posY;
cinnost.typ = 7;
return(7);
}
if ((((tahnouci.muzePohltit() > 0) && (napor > -1)) && (terenNa(tahnouci.souper.posX, tahnouci.souper.posY) == 4)) && (dalkaVzduchem(tahnouci.posX, tahnouci.posY, tahnouci.souper.posX, tahnouci.souper.posY) <= 6)) {
cinnost.x = tahnouci.souper.posX - tahnouci.posX;
cinnost.y = tahnouci.souper.posY - tahnouci.posY;
cinnost.typ = 8;
return(8);
}
if (((tahnouci.muzeStrilet() > 0) && (napor > -1)) && (caraStrely(tahnouci, tahnouci.souper.posX, tahnouci.souper.posY))) {
cinnost.x = tahnouci.souper.posX - tahnouci.posX;
cinnost.y = tahnouci.souper.posY - tahnouci.posY;
cinnost.typ = 4;
return(4);
}
if (((tahnouci.muzeBlyskat() > 0) && (napor > -1)) && (caraStrely(tahnouci, tahnouci.souper.posX, tahnouci.souper.posY))) {
cinnost.x = tahnouci.souper.posX - tahnouci.posX;
cinnost.y = tahnouci.souper.posY - tahnouci.posY;
cinnost.typ = 9;
return(9);
}
var _local2 = nejlepsiKamarad(tahnouci);
if (_local2) {
trace("mam kamarada");
}
if (((tahnouci.muzeInflamovat() > 0) && (napor > -1)) && (_local2)) {
trace("chci inflamovat");
cinnost.x = _local2.posX - tahnouci.posX;
cinnost.y = _local2.posY - tahnouci.posY;
cinnost.typ = 5;
return(5);
}
if (((((tahnouci.posX + cinnost.x) == tahnouci.souper.posX) && ((tahnouci.posY + cinnost.y) == tahnouci.souper.posY)) && (tahnouci.streh >= Math.floor(tahnouci.maxStav(1) / 2))) && (_local1 > 4)) {
cinnost.typ = 3;
} else if (!lzeJit(tahnouci, cinnost.x, cinnost.y)) {
cinnost.x = 0;
cinnost.y = 0;
cinnost.typ = 0;
tahnouci.kroku--;
return(0);
}
if (!cinnost.x) {
cinnost.x = 0;
}
if (!cinnost.y) {
cinnost.y = 0;
}
return(1);
}
function vyhoda(keKomu) {
var _local2;
var _local1;
var _local7;
var _local3;
_local2 = 0;
_local1 = 0;
var _local4 = 0;
var _local5 = Math.floor(tahnouci.maxStav(1) / 2);
if (tahnouci.streh >= _local5) {
_local4 = Math.min(_local5, keKomu.streh);
}
trace("dalkaKsouperi " + dalkaKsouperi);
if (tahnouci.strana == naTahu) {
_local3 = tahnouci.kroku + 1;
} else {
_local3 = 1;
}
if (_local3 >= dalkaKsouperi) {
_local2 = (((5 + _local3) + _local4) - keKomu.streh) + (tahnouci.zivotu / 4);
_local1 = ((5 + _local4) - tahnouci.streh) + (keKomu.zivotu / 4);
if (_local2 < 0) {
_local2 = 0;
}
if (_local1 < 0) {
_local1 = 0;
}
}
trace((((("Souper: " + keKomu) + " plus: ") + _local2) + " minus: ") + _local1);
if (dalkaKsouperi < 3) {
_local1 = _local1 + 3;
}
return(_local2 - _local1);
}
function StrukturaTahu(figurka, coX, coY, jak, vysledek1, vysledek2, vysledek3, hlaska) {
function vycisti() {
this.vysledek1 = 0;
this.vysledek2 = 0;
this.vysledek3 = 0;
this.hlaska = 0;
}
this.figurka = figurka;
this.coX = coX;
this.coY = coY;
this.jak = jak;
this.vysledek1 = vysledek1;
this.vysledek2 = vysledek2;
this.vysledek3 = vysledek3;
this.hlaska = hlaska;
}
function ulozPocatek() {
var _local1;
var _local3;
var _local4;
var _local2;
while (pocatecniStav.length) {
pocatecniStav.pop();
}
while (pocatecniStav.length) {
pocatecniZivoty1.pop();
}
while (pocatecniStav.length) {
pocatecniZivoty2.pop();
}
_local3 = 1;
while (_local3 <= DILKUY) {
_local1 = 1;
while (_local1 <= DILKUX) {
_local2 = figurkaNa(_local1, _local3);
if (_local2) {
_local4 = _local2.cislo;
if (_local2.strana != 1) {
_local4 = _local4 * -1;
}
pocatecniStav.push(_local1, _local3, _local4);
}
_local1++;
}
_local3++;
}
}
function proved(kdo, coX, coY, jak) {
var _local7;
var _local12;
var _local3;
if (jak == 10) {
pokracuj();
return(0);
}
ukazMoznosti(-1);
strukturaTahu.vycisti();
strukturaTahu.figurka = kdo.cislo;
if (kdo.strana != 1) {
strukturaTahu.figurka = strukturaTahu.figurka * -1;
}
strukturaTahu.jak = jak;
strukturaTahu.coX = cinnost.x;
strukturaTahu.coY = cinnost.y;
if (jak == 1) {
var _local8;
_local8 = barvaPole(kdo.posX, kdo.posY + cinnost.y);
_local7 = barvaPole(kdo.posX + cinnost.x, kdo.posY);
if ((!kdo.chtelJitSmeremX) && (naPlanu(kdo.posX + cinnost.x, kdo.posY + cinnost.y)((!cinnost.x) || (!cinnost.y)))) {
cinnost.typ = 0;
cinnost.x = 0;
cinnost.y = 0;
kdo.kroku--;
} else if ((((_local8 && (_local8 != kdo.strana)) && (!kdo.chtelJitSmeremX)) && (!kdo.chtelJitSmeremY)) && (tahnouci.strana == naTahu)) {
jak = 2;
cinnost.typ = 2;
kdo.chtelJitSmeremX = cinnost.x;
kdo.chtelJitSmeremY = cinnost.y;
coX = 0;
coY = cinnost.y;
} else if ((((_local7 && (_local7 != kdo.strana)) && (!kdo.chtelJitSmeremX)) && (!kdo.chtelJitSmeremY)) && (tahnouci.strana == naTahu)) {
jak = 2;
cinnost.typ = 2;
kdo.chtelJitSmeremX = cinnost.x;
kdo.chtelJitSmeremY = cinnost.y;
coX = cinnost.x;
coY = 0;
}
}
if (jak == 4) {
kdo.bylNapor = 0;
cilX = kdo.posX + coX;
cilY = kdo.posY + coY;
_local3 = figurkaNa(cilX, cilY);
_local3.souper = kdo;
kdo.souper = _local3;
var _local9 = _local3.schopnost("stit");
if ((!_local9) || (random(10) >= _local9)) {
zranObrance(_local3);
} else {
rozhozeniObrance = 0;
zraneniObrance = 0;
}
kdo.strelba();
natocSeSpravne(kdo);
_local3.kryt();
kdo.kroku = kdo.kroku - (kdo.schopnost("shoot") - 1);
kdo.zvetsiStav(1, -3);
if (kdo.streh < 0) {
kdo.zmenStav(1, 0);
}
return(4);
}
if (jak == 5) {
kdo.bylNapor = 0;
cilX = kdo.posX + coX;
cilY = kdo.posY + coY;
_local3 = figurkaNa(cilX, cilY);
kdo.inflamuj(_local3);
kdo.kroku = kdo.kroku - (kdo.schopnost("inflame") - 1);
kdo.zvetsiStav(1, -3);
if (kdo.streh < 0) {
kdo.zmenStav(1, 0);
}
return(5);
}
if (jak == 6) {
kdo.bylNapor = 0;
cilX = kdo.posX + coX;
cilY = kdo.posY + coY;
_local3 = figurkaNa(cilX, cilY);
_local3.souper = kdo;
kdo.souper = _local3;
zranObrance(_local3);
kdo.spal(_local3);
natocSeSpravne(kdo);
kdo.kroku = kdo.kroku - (kdo.schopnost("burn") - 1);
kdo.zvetsiStav(1, -2);
if (kdo.streh < 0) {
kdo.zmenStav(1, 0);
}
return(6);
}
if (jak == 7) {
kdo.bylNapor = 0;
cilX = kdo.posX + coX;
cilY = kdo.posY + coY;
_local3 = figurkaNa(cilX, cilY);
_local3.souper = kdo;
kdo.souper = _local3;
kdo.znehybni(_local3);
natocSeSpravne(kdo);
kdo.kroku = kdo.kroku - (kdo.schopnost("hold") - 1);
kdo.zvetsiStav(1, -2);
if (kdo.streh < 0) {
kdo.zmenStav(1, 0);
}
return(7);
}
if (jak == 8) {
kdo.bylNapor = 0;
cilX = kdo.posX + coX;
cilY = kdo.posY + coY;
_local3 = figurkaNa(cilX, cilY);
_local3.souper = kdo;
kdo.souper = _local3;
kdo.pohlt(_local3);
natocSeSpravne(kdo);
kdo.kroku = kdo.kroku - (kdo.schopnost("swallow") - 1);
kdo.zvetsiStav(1, -3);
if (kdo.streh < 0) {
kdo.zmenStav(1, 0);
}
return(8);
}
if (jak == 9) {
kdo.bylNapor = 0;
cilX = kdo.posX + coX;
cilY = kdo.posY + coY;
_local3 = figurkaNa(cilX, cilY);
_local3.souper = kdo;
kdo.souper = _local3;
var _local10 = _local3.streh;
var _local11 = _local3.zivotu;
var _local9 = _local3.schopnost("stit");
if ((!_local9) || (random(10) >= _local9)) {
zranObrance(_local3);
_local10 = _local10 - _local3.streh;
_local11 = _local11 - _local3.zivotu;
zranObrance(_local3);
zraneniObrance = zraneniObrance + _local11;
rozhozeniObrance = rozhozeniObrance + _local10;
} else {
rozhozeniObrance = 0;
zraneniObrance = 0;
}
kdo.blyskej(_local3);
natocSeSpravne(kdo);
kdo.kroku = kdo.kroku - (kdo.schopnost("blesk") - 1);
kdo.zvetsiStav(1, -5);
if (kdo.streh < 0) {
kdo.zmenStav(1, 0);
}
return(9);
}
if (jak == 3) {
napor = 1;
kdo.bylNapor = 1;
} else {
napor = 0;
kdo.bylNapor = 0;
}
cilX = kdo.posX + coX;
cilY = kdo.posY + coY;
_local3 = figurkaNa(cilX, cilY);
if (_local3 && (_local3.strana == neNaTahu)) {
napadeny = _local3;
_local3.bylNapor = 0;
_local3.souper = kdo;
kdo.souper = _local3;
if (napor > 0) {
_local7 = cisloNaporu(kdo, _local3);
kdo.streh = kdo.streh - _local7;
_local3.streh = _local3.streh - _local7;
kdo.stavy.streh.h1.textik.text = tahnouci.streh;
_local3.stavy.streh.h1.textik.text = _local3.streh;
}
zranObrance(_local3);
if (rozhozeniUtocnika > kdo.streh) {
zraneniUtocnika = rozhozeniUtocnika - kdo.streh;
leth = _local3.schopnost("lethality");
if (leth) {
zraneniUtocnika = Math.ceil(zraneniUtocnika * leth);
}
kdo.streh = 0;
kdo.zivotu = kdo.zivotu - zraneniUtocnika;
if (kdo.zivotu <= 0) {
}
} else {
zraneniUtocnika = 0;
kdo.streh = kdo.streh - rozhozeniUtocnika;
}
if ((napor > 0) && (_local7)) {
kdo.napor();
} else {
kdo.utok();
}
natocSeSpravne(kdo);
natocSeSpravne(_local3);
_local3.obrana();
} else if (((Math.abs(coX) + Math.abs(coY)) > 1) || (!naPlanu(kdo.posX + coX, kdo.posY + coY))) {
kdo.posun(coX, coY);
}
if (kdo.hrac) {
}
if (casNaUstup) {
casNaUstup = 0;
tahnouci = tahnouci0;
if (!_root["HRAC" + tahnouci.strana]) {
tahnouci.kroku++;
}
}
}
function zranObrance(s, jenStreh) {
var _local2;
rozhozeniObrance = rozhozeni(s, s.souper);
_local2 = s.souper.schopnost("daleko");
if (_local2 && (s.souper.chtelJitSmeremX)) {
rozhozeniObrance = 0;
}
if (rozhozeniObrance > s.streh) {
zraneniObrance = rozhozeniObrance - s.streh;
_local2 = s.souper.schopnost("lethality");
if (_local2) {
zraneniObrance = Math.ceil(zraneniObrance * _local2);
}
s.streh = 0;
} else {
zraneniObrance = 0;
s.streh = s.streh - rozhozeniObrance;
}
if (jenStreh) {
return(zraneniObrance);
}
if ((s.zivotu - zraneniObrance) > 0) {
rozhozeniUtocnika = rozhozeni(s.souper, s);
_local2 = s.souper.schopnost("sneak");
if (_local2 && (s.souper.chtelJitSmeremX)) {
rozhozeniUtocnika = rozhozeniUtocnika - Math.round((rozhozeniUtocnika / 10) * _local2);
}
s.zivotu = s.zivotu - zraneniObrance;
} else {
s.zivotu = s.zivotu - zraneniObrance;
rozhozeniUtocnika = 0;
}
_local2 = s.souper.schopnost("slayer");
if (((_local2 && (s.zivotu > 0)) && (zraneniObrance > 0)) && (random(_local2) >= s.zivotu)) {
deadlyAttack = 1;
} else {
deadlyAttack = 0;
}
}
function hledejCestu(x1, y1, x2, y2) {
nalezeno = 0;
while (frontaDalky.length) {
frontaDalky.pop();
}
var _local2 = 0;
while (_local2 < DILKUY) {
var _local1 = 0;
while (_local1 < DILKUX) {
cesty[_local1][_local2] = 10000;
_local1++;
}
_local2++;
}
var _local8 = 0;
if ((x1 == x2) && (y1 == y2)) {
_local8 = 1;
}
var _local3;
cesty[x1 - 1][y1 - 1] = 0;
if ((!_local8) && (jeCerna(x1, y1) != jeCerna(x2, y2))) {
if (naPlanu(x1 - 1, y1)) {
cesty[x1 - 2][y1 - 1] = 1;
frontaDalky.push(x1 - 1);
frontaDalky.push(y1);
}
if (naPlanu(x1, y1 - 1)) {
cesty[x1 - 1][y1 - 2] = 1;
frontaDalky.push(x1);
frontaDalky.push(y1 - 1);
}
if (naPlanu(x1, y1 + 1)) {
cesty[x1 - 1][y1] = 1;
frontaDalky.push(x1);
frontaDalky.push(y1 + 1);
}
if (naPlanu(x1 + 1, y1)) {
cesty[x1][y1 - 1] = 1;
frontaDalky.push(x1 + 1);
frontaDalky.push(y1);
}
} else {
frontaDalky.push(x1);
frontaDalky.push(y1);
}
while (frontaDalky.length) {
var _local1 = frontaDalky.shift();
_local2 = frontaDalky.shift();
if (((policka[_local1 - 1][_local2 - 1] != 0) && ((_local1 != x1) || (_local2 != y1))) && ((_local1 != x2) || (_local2 != y2))) {
continue;
}
if ((objektNa(_local1, _local2) && ((_local1 != x1) || (_local2 != y1))) && ((_local1 != x2) || (_local2 != y2))) {
continue;
}
_local3 = cesty[_local1 - 1][_local2 - 1];
if (((_local1 == x2) && (_local2 == y2)) && (!_local8)) {
nalezeno = 1;
continue;
}
_local3 = _local3 + cenaTerenuNa(_local1, _local2, policka[x2 - 1][y2 - 1]);
if (cesty[_local1 - 2][_local2 - 2] > _local3) {
frontaDalky.push(_local1 - 1);
frontaDalky.push(_local2 - 1);
cesty[_local1 - 2][_local2 - 2] = _local3;
}
if (cesty[_local1][_local2 - 2] > _local3) {
frontaDalky.push(_local1 + 1);
frontaDalky.push(_local2 - 1);
cesty[_local1][_local2 - 2] = _local3;
}
if (cesty[_local1 - 2][_local2] > _local3) {
frontaDalky.push(_local1 - 1);
frontaDalky.push(_local2 + 1);
cesty[_local1 - 2][_local2] = _local3;
}
if (cesty[_local1][_local2] > _local3) {
frontaDalky.push(_local1 + 1);
frontaDalky.push(_local2 + 1);
cesty[_local1][_local2] = _local3;
}
if (_local8) {
if (cesty[_local1 - 2][_local2 - 1] > _local3) {
cesty[_local1 - 2][_local2 - 1] = _local3;
}
if (cesty[_local1 - 1][_local2 - 2] > _local3) {
cesty[_local1 - 1][_local2 - 2] = _local3;
}
if (cesty[_local1 - 1][_local2] > _local3) {
cesty[_local1 - 1][_local2] = _local3;
}
if (cesty[_local1][_local2 - 1] > _local3) {
cesty[_local1][_local2 - 1] = _local3;
}
}
}
if (nalezeno) {
return(cesty[x2 - 1][y2 - 1]);
}
return(-2);
}
function nejsvobodnejsi(strana) {
var _local6 = this["armada" + strana];
var _local4 = this["iniciala" + strana];
var _local2;
var _local3;
var _local7;
var _local5 = 0;
_local2 = 1;
while (_local2 <= _local6.length) {
_local3 = ukazMoznosti(this[_local4 + _local2]);
if (_local3 > _local5) {
_local5 = _local3;
_local7 = this[_local4 + _local2];
}
_local2++;
}
return(_local7);
}
function nejlepsiSouper(koho) {
var _local8 = 0;
var _local7 = 10000;
var _local9;
var _local4;
var _local6;
if (koho.strana == 1) {
k = "p";
bytosti = _root.potvory;
_local9 = 2;
} else {
k = "h";
bytosti = _root.postavy;
_local9 = 1;
}
var _local3 = 1;
while (_local3 <= bytosti.length) {
if (this[k + _local3].neni()) {
} else {
_local4 = cesty[this[k + _local3].posX - 1][this[k + _local3].posY - 1];
if ((!_local4) || (_local4 > 1000)) {
_local4 = dalkaVzduchem(koho.posX, koho.posY, this[k + _local3].posX, this[k + _local3].posY) + 2;
}
_local6 = koho.muzeStrilet();
if ((((_local6 > 0) && (_local6 <= _local4)) && (caraStrely(koho, this[k + _local3].posX, this[k + _local3].posY))) && (!this[k + _local3].schopnost("stit"))) {
_local4 = _local6 - 1;
}
_local4 = _local4 + (this[k + _local3].streh / 6);
if (this[k + _local3].muzeStrilet()) {
_local4 = _local4 - random(3);
}
if (this[k + _local3].muzeInflamovat()) {
_local4 = _local4 - 1;
}
if (this[k + _local3].muzeSpalit()) {
_local4 = _local4 - 1;
}
if (this[k + _local3].schopnost("lethality") > 1) {
_local4 = _local4 - 1;
}
if (this[k + _local3].muzeZnehybnit()) {
_local4 = _local4 - 1;
}
if (this[k + _local3].muzePohltit()) {
_local4 = _local4 - 1;
}
if (this[k + _local3].muzeBlyskat()) {
_local4 = _local4 - 2;
}
if (this["zlodej" + koho.strana] == _local3) {
_local4 = _local4 - 3;
}
if (this["VIP" + _local9] == _local3) {
_local4 = _local4 - 2;
}
_local4 = _local4 + random(2);
_local4 = _local4 - random(2);
if (_local4 < _local7) {
_local8 = _local3;
_local7 = _local4;
}
}
_local3++;
}
trace("Souper je typu " + this[k + _local8].typ);
if (_local8) {
return(this[k + _local8]);
}
return(0);
}
function nejlepsiKamarad(koho) {
if (koho.muzeInflamovat() <= 0) {
return(0);
}
var _local9 = 0;
var _local8 = 0;
var _local7;
var _local6;
var _local4;
if (koho.strana == 2) {
k = "p";
bytosti = _root.potvory;
_local7 = 1;
} else {
k = "h";
bytosti = _root.postavy;
_local7 = 2;
}
var _local3 = 1;
while (_local3 <= bytosti.length) {
if (this[k + _local3].neni()) {
} else {
_local6 = dalkaVzduchem(koho.posX, koho.posY, this[k + _local3].posX, this[k + _local3].posY);
if ((!_local6) || (_local6 > 3)) {
} else {
_local4 = this[k + _local3].schopnost("boj") - this[k + _local3].streh;
if (_local4 < 0) {
_local4 = 0;
}
if (this["zlodej" + _local7] == _local3) {
_local4 = _local4 + 10;
}
_local4 = _local4 + (pocetKontaktu(this[k + _local3].posX, this[k + _local3].posY, _local7) * 15);
if (this["VIP" + koho.strana] == _local3) {
_local4 = _local4 + 20;
}
_local4 = _local4 + random(10);
_local4 = _local4 - random(10);
if (_local4 > _local8) {
_local9 = _local3;
_local8 = _local4;
}
}
}
_local3++;
}
if (_local9) {
return(this[k + _local9]);
}
return(0);
}
function nejblizsiSouperVzduchem(koho) {
var _local7 = 0;
var _local5 = 10000;
var _local4;
if (koho.strana == 1) {
k = "p";
bytosti = _root.potvory;
} else {
k = "h";
bytosti = _root.postavy;
}
var _local3 = 1;
while (_local3 <= bytosti.length) {
if (this[k + _local3].neni()) {
} else {
_local4 = dalkaVzduchem(koho.posX, koho.posY, this[k + _local3].posX, this[k + _local3].posY);
if (_local4 < _local5) {
_local7 = _local3;
_local5 = _local4;
}
}
_local3++;
}
return(this[k + _local7]);
}
function dalkaVzduchem(x1, y1, x2, y2) {
var _local1;
_local1 = Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2));
return(_local1);
}
function nahodnejSouper(koho) {
if (koho.strana == 1) {
k = "p";
bytosti = _root.potvory;
} else {
k = "h";
bytosti = _root.postavy;
}
var _local5 = random(bytosti.length) + 1;
var _local3 = _local5;
var _local4 = this[k + _local3];
while ((!_local4) || (!_local4.zivotu)) {
_local3++;
if (_local3 > bytosti.length) {
_local3 = 1;
}
if (_local3 == _local5) {
return(0);
}
_local4 = this[k + _local3];
}
return(_local4);
}
function urciSoupere(kdo) {
var _local1;
if (random(4)) {
_local1 = nejlepsiSouper(kdo);
} else {
_local1 = nahodnejSouper(kdo);
}
return(_local1);
}
function sousedi(x1, y1, x2, y2, rovne) {
if (!rovne) {
return((Math.abs(x1 - x2) == 1) && (Math.abs(y1 - y2) == 1));
}
return((Math.abs(x1 - x2) + Math.abs(y1 - y2)) == 1);
}
function zmenaDalky(x, y, smer) {
if (smer < 0) {
trace("Chci bliz.");
} else if (smer > 0) {
trace("Chci dal.");
}
var _local9;
var _local11;
var _local8;
var _local10;
var _local1;
var _local2;
cinnost.x = 0;
cinnost.y = 0;
cinnost.typ = 0;
if (!smer) {
smer = 0;
}
var _local7 = cesty[x - 1][y - 1];
if ((!_local7) || (_local7 > 1000)) {
cinnost.x = (-smer) * (tahnouci.souper.posX - tahnouci.posX);
cinnost.y = (-smer) * (tahnouci.souper.posY - tahnouci.posY);
if (cinnost.x) {
cinnost.x = cinnost.x / Math.abs(cinnost.x);
} else {
cinnost.x = (random(2) * 2) - 1;
}
if (cinnost.y) {
cinnost.y = cinnost.y / Math.abs(cinnost.y);
} else {
cinnost.y = (random(2) * 2) - 1;
}
cinnost.typ = 1;
return(0);
}
if (random(2)) {
_local9 = x - 1;
_local8 = x + 2;
dx = 1;
} else {
_local9 = x + 1;
_local8 = x - 2;
dx = -1;
}
if (random(2)) {
_local11 = y - 1;
_local10 = y + 2;
dy = 1;
} else {
_local11 = y + 1;
_local10 = y - 2;
dy = -1;
}
var _local5;
_local2 = _local11;
while (_local2 != _local10) {
_local1 = _local9;
while (_local1 != _local8) {
trace((((((((((("Dalka (" + x) + ",") + y) + ") ") + cesty[x - 1][y - 1]) + " vs. (") + _local1) + ",") + _local2) + ") ") + cesty[_local1 - 1][_local2 - 1]);
if (!naPlanu(_local1, _local2)) {
_local5 = -1;
} else {
_local5 = cesty[x - 1][y - 1] - cesty[_local1 - 1][_local2 - 1];
}
if (((((_local5 > 0) && (smer < 0)) || ((_local5 < 0) && (smer > 0))) && (Math.abs(_local5) < DILKUX)) && (lzeJit(tahnouci, _local1 - x, _local2 - y))) {
if ((_local7 < 2) || ((_local1 != x) && (_local2 != y))) {
cinnost.x = _local1 - x;
cinnost.y = _local2 - y;
if (cinnost.x && (cinnost.y)) {
cinnost.typ = 1;
} else if ((!cinnost.x) && (!cinnost.y)) {
cinnost.typ = 0;
} else {
cinnost.typ = 2;
}
trace((((((("Pro smer " + smer) + " je x: ") + cinnost.x) + " y: ") + cinnost.y) + " typ: ") + cinnost.typ);
return(1);
}
}
_local1 = _local1 + dx;
}
_local2 = _local2 + dy;
}
return(0);
}
function caraStrely(kdo, x2, y2) {
var _local18;
var _local17;
var _local1;
var _local27;
var _local7;
if (kdo == naKoho) {
return(0);
}
if ((Math.abs(kdo.posX - x2) <= 1) && (Math.abs(kdo.posY - y2) <= 1)) {
return(0);
}
var _local19 = kdo.schopnost("velikost");
var _local9 = figurkaNa(x2, y2).schopnost("velikost");
if (!_local9) {
_local9 = 0;
}
var _local11;
var _local10;
var _local4;
var _local8;
var _local21;
var _local24;
var _local15;
var _local13;
var _local23;
var _local22;
var _local14;
var _local12;
var _local3;
var _local6;
_local11 = x2 - kdo.posX;
_local10 = y2 - kdo.posY;
if (_local11) {
_local23 = _local11 / Math.abs(_local11);
} else {
_local23 = 0;
}
if (_local10) {
_local22 = _local10 / Math.abs(_local10);
} else {
_local22 = 0;
}
_local11 = Math.abs(_local11);
_local10 = Math.abs(_local10);
if (_local11 > _local10) {
_local21 = _local11;
_local24 = _local10;
_local15 = kdo.posX;
_local13 = kdo.posY;
_local14 = _local23;
_local12 = _local22;
} else {
_local24 = _local11;
_local21 = _local10;
_local13 = kdo.posX;
_local15 = kdo.posY;
_local12 = _local23;
_local14 = _local22;
}
var _local2;
var _local5 = 0;
var _local16 = _local24 / _local21;
trace(("Cara strely s pomerem " + _local16) + ":");
_local18 = kdo.posX;
_local17 = kdo.posY;
_local4 = 1;
while (_local4 < _local21) {
if (_local16) {
_local5 = _local5 + _local16;
}
if ((_local5 - Math.floor(_local5)) == 0.5) {
} else {
_local8 = Math.round(_local5);
if (_local11 > _local10) {
_local1 = _local15 + (_local14 * _local4);
yNovy = _local13 + (_local12 * _local8);
_local3 = figurkaNa(_local1, yNovy);
if (!_local3) {
_local6 = objektNa(_local1, yNovy);
}
} else {
_local1 = _local13 + (_local12 * _local8);
yNovy = _local15 + (_local14 * _local4);
_local3 = figurkaNa(_local1, yNovy);
if (!_local3) {
_local6 = objektNa(_local1, yNovy);
}
}
_local7 = objektMezi(_local18, _local17, _local1, yNovy);
if (_local7) {
_local2 = typyObjektu[_local7.hlavniTyp].velikost;
}
if (_local7 && ((_local2 >= _local19) || (_local2 >= _local9))) {
return(0);
}
_local18 = _local1;
_local17 = yNovy;
if (_local3) {
_local2 = _local3.schopnost("velikost");
} else {
_local2 = typyObjektu[_local6.hlavniTyp].velikost;
}
if ((_local3 || (_local6)) && ((_local2 >= _local19) || (_local2 >= _local9))) {
return(0);
}
}
_local4++;
}
return(_local21);
}
function objektMezi(x1, y1, x2, y2) {
if (abs(x2 - x1) != 1) {
return(0);
}
if (abs(y2 - y1) != 1) {
return(0);
}
return(objektNa(Math.min(x1, x2), Math.min(y1, y2)));
}
function pocetKontaktu(x, y, b) {
var _local1 = 0;
if (barvaPole(x - 1, y) == b) {
_local1++;
}
if (barvaPole(x + 1, y) == b) {
_local1++;
}
if (barvaPole(x, y - 1) == b) {
_local1++;
}
if (barvaPole(x, y + 1) == b) {
_local1++;
}
return(_local1);
}
function figurkaNa(x, y) {
return(policka[x - 1][y - 1]);
}
function terenNa(x, y) {
return(dlazba[(("d" + x) + "_") + y].teren);
}
function cenaTerenuNa(x, y, jakProKoho) {
if (jakProKoho.schopnost("lehkost") && (typyTerenu[terenNa(x, y)].hloubka == 0.5)) {
return(1);
}
return(typyTerenu[terenNa(x, y)].cena);
}
function krytNa(x, y, jakProKoho) {
var _local1;
var _local2;
_local2 = 0;
_local1 = typyTerenu[terenNa(x, y)].kryt;
if (jakProKoho.schopnost("lehkost") && (typyTerenu[terenNa(x, y)].hloubka == 0.5)) {
_local1 = 0;
}
if (_local1) {
_local2 = _local2 + _local1;
}
_local1 = typyPlodu[plodNa(x, y).hlavniTyp].kryt;
if (_local1) {
_local2 = _local2 + _local1;
}
return(_local2);
}
function plodNa(x, y) {
return(plody[(("p" + x) + "_") + y]);
}
function objektNa(x, y, jenTam) {
var _local2;
_local2 = this[(("objekt" + x) + "_") + y];
if (jenTam) {
if (_local2) {
return(_local2);
}
return(0);
}
if (_local2 && (typyObjektu[_local2.hlavniTyp].rozlehlost)) {
return(_local2);
}
_local2 = this[(("objekt" + (x - 1)) + "_") + y];
if (_local2 && (typyObjektu[_local2.hlavniTyp].rozlehlost > 1)) {
return(_local2);
}
_local2 = this[(("objekt" + x) + "_") + (y - 1)];
if (_local2 && (typyObjektu[_local2.hlavniTyp].rozlehlost > 3)) {
return(_local2);
}
_local2 = this[(("objekt" + (x - 1)) + "_") + (y - 1)];
if (_local2 && (typyObjektu[_local2.hlavniTyp].rozlehlost > 3)) {
return(_local2);
}
return(0);
}
function obsazeno(x, y) {
var _local1 = figurkaNa(x, y);
if (_local1) {
return(_local1);
}
_local1 = objektNa(x, y);
if (_local1) {
return(_local1);
}
return(0);
}
function hloubkaNa(x, y) {
return(typyTerenu[terenNa(x, y)].hloubka);
}
function prvniZivej(strana, obracene) {
var _local4 = 0;
var _local8 = this["armada" + strana];
var _local3 = this["iniciala" + strana];
var _local6;
var _local7;
var _local5;
if (!obracene) {
_local6 = 1;
_local7 = _local8.length + 1;
_local5 = 1;
} else {
_local6 = _local8.length;
_local7 = 0;
_local5 = -1;
}
var _local2 = _local6;
while (_local2 != _local7) {
if (!this[_local3 + _local2].neni()) {
if (this[_local3 + _local2].hrac) {
return(this[_local3 + _local2]);
}
if (!_local4) {
_local4 = this[_local3 + _local2];
}
}
_local2 = _local2 + _local5;
}
return(_local4);
}
function pocetBojujicich(strana) {
var _local4 = 0;
if (strana == 2) {
var _local3 = 1;
while (_local3 <= _root.potvory.length) {
if (!this["p" + _local3].neni()) {
_local4++;
}
_local3++;
}
} else {
var _local3 = 1;
while (_local3 <= _root.postavy.length) {
if (!this["h" + _local3].neni()) {
_local4++;
}
_local3++;
}
}
return(_local4);
}
function pocetPrezivsich(strana) {
var _local4 = 0;
if (strana == 2) {
var _local3 = 1;
while (_local3 <= _root.potvory.length) {
if (this["p" + _local3].zivotu) {
_local4++;
}
_local3++;
}
} else {
var _local3 = 1;
while (_local3 <= _root.postavy.length) {
if (this["h" + _local3].zivotu) {
_local4++;
}
_local3++;
}
}
return(_local4);
}
function rozhozeni(koho, odKoho) {
var _local1;
_local1 = ((random(10) + 1) + (random(10) + 1)) >> 1;
if (((_local1 == 10) && (odKoho)) && (odKoho.schopnost("critical"))) {
_local1 = _local1 + random(10);
}
return(_local1);
}
function cisloNaporu(kdo, naKoho) {
var _local2 = Math.floor(kdo.maxStav(1) / 2);
if (kdo.streh < _local2) {
return(0);
}
var _local1;
_local1 = _local2;
if (_local1 > naKoho.streh) {
_local1 = naKoho.streh;
}
return(_local1);
}
function jeUstup() {
return(0);
}
function naPlanu(x, y) {
if ((x < 1) || (x > DILKUX)) {
return(0);
}
if ((y < 1) || (y > DILKUY)) {
return(0);
}
return(1);
}
function povolenoPoleUteku(kdo, x, y) {
var _local2 = kdo.strana;
if ((x < 1) && (this[(("u" + _local2) + "_") + 4])) {
return(1);
}
if ((x > DILKUX) && (this[(("u" + _local2) + "_") + 2])) {
return(1);
}
if ((y < 1) && (this[(("u" + _local2) + "_") + 1])) {
return(1);
}
if ((y > DILKUY) && (this[(("u" + _local2) + "_") + 3])) {
return(1);
}
}
function lzeJit(kdo, kamX, kamY) {
if (objektNa(kdo.posX + kamX, kdo.posY + kamY)) {
return(0);
}
var _local2 = barvaPole(kdo.posX + kamX, kdo.posY + kamY);
if ((!naPlanu(kdo.posX + kamX, kdo.posY + kamY)) && ((napor > -1) || (!povolenoPoleUteku(kdo, kdo.posX + kamX, kdo.posY + kamY)))) {
return(0);
}
if (tahnouci.strana != naTahu) {
if (_local2) {
return(0);
}
}
if ((_local2 && (_local2 == kdo.strana)) && (kamX || (kamY))) {
return(0);
}
if (kdo.kroku < cenaTerenuNa(kdo.posX, kdo.posY, kdo)) {
return(0);
}
return(1);
}
function lzeKontaktovat(kdo, x2, y2) {
if (kdo.kroku < 0.5) {
return(0);
}
if (kdo.kroku < cenaTerenuNa(kdo.posX, kdo.posY, kdo)) {
return(0);
}
if (objektNa(x2, y2)) {
return(0);
}
if ((Math.abs(kdo.posX - x2) > 1) || (Math.abs(kdo.posY - y2) > 1)) {
return(0);
}
var _local5 = 0;
if (!naPlanu(kamX, kamY)) {
return(0);
}
var _local2 = barvaPole(x2, y2);
if (tahnouci.strana != naTahu) {
if (_local2) {
return(0);
}
}
if (_local2) {
_local5++;
}
if ((x2 == kdo.posX) && (y2 == kdo.posY)) {
return(3);
}
if (kdo.strana == _local2) {
return(0);
}
if (((x2 == kdo.posX) || (y2 == kdo.posY)) && ((!_local2) || (kdo.strana == _local2))) {
return(0);
}
return(_local5 + 1);
}
function lzeAkcnit(kdo, x2, y2) {
var _local2 = barvaPole(x2, y2);
if ((((kdo.muzeStrilet() > 0) && (_local2)) && (kdo.strana != _local2)) && (caraStrely(kdo, x2, y2))) {
return(4);
}
if ((((kdo.muzeInflamovat() > 0) && (_local2)) && (kdo.strana == _local2)) && (dalkaVzduchem(kdo.posX, kdo.posY, x2, y2) <= 3)) {
return(5);
}
if (((((kdo.muzeSpalit() > 0) && (_local2)) && (kdo.strana != _local2)) && (dalkaVzduchem(kdo.posX, kdo.posY, x2, y2) <= 3)) && (hloubkaNa(x2, y2) < 0.5)) {
return(6);
}
if ((((((kdo.muzeZnehybnit() > 0) && (_local2)) && (kdo.strana != _local2)) && (dalkaVzduchem(kdo.posX, kdo.posY, x2, y2) <= 6)) && (!figurkaNa(x2, y2).znehybnen)) && (hloubkaNa(x2, y2) < 0.5)) {
return(7);
}
if (((((kdo.muzePohltit() > 0) && (_local2)) && (kdo.strana != _local2)) && (dalkaVzduchem(kdo.posX, kdo.posY, x2, y2) <= 6)) && (terenNa(x2, y2) == 4)) {
return(8);
}
if ((((kdo.muzeBlyskat() > 0) && (_local2)) && (kdo.strana != _local2)) && (caraStrely(kdo, x2, y2))) {
return(9);
}
return(0);
}
function natocSe(kdo, sX, sY) {
var _local2 = kdo.schopnost("postava");
if (sY < 0) {
kdo.p.gotoAndStop(_local2 * 2);
} else {
kdo.p.gotoAndStop((_local2 * 2) - 1);
}
if ((-1 * sX) == sY) {
kdo.p.p._xscale = 1 * Math.abs(kdo.p.p._xscale);
} else {
kdo.p.p._xscale = -1 * Math.abs(kdo.p.p._xscale);
}
}
function natocSeSpravne(kdo, x2, y2) {
var _local1;
var _local3;
var _local2;
if (x2) {
_local1 = 1;
} else {
_local1 = kdo.souper;
}
if (!_local1) {
_local1 = nejblizsiSouper(kdo);
}
if (!_local1) {
trace("Nelze nalezt nejblizsiho nepritele");
}
if (!x2) {
_local3 = _local1.posX - kdo.posX;
_local2 = _local1.posY - kdo.posY;
} else {
_local3 = x2 - kdo.posX;
_local2 = y2 - kdo.posY;
}
if (!_local3) {
_local3 = 1;
} else {
_local3 = _local3 / Math.abs(_local3);
}
if (!_local2) {
_local2 = 1;
} else {
_local2 = _local2 / Math.abs(_local2);
}
if (_local1) {
natocSe(kdo, _local3, _local2);
}
}
function nasackuj(kdo, smerX, smerY, posila) {
var _local14 = this["armada" + kdo];
var _local15 = this["iniciala" + kdo];
var _local2;
var _local21;
var _local7;
var _local6 = 1;
var _local13 = Math.ceil(DILKUX / 2);
var _local12 = Math.ceil(DILKUY / 2);
var _local11;
var _local10;
var _local4;
var _local3;
var _local9;
var _local8;
var _local5 = 0;
if (smerX > 1) {
smerX = 0;
smerY = 1;
_local21 = 4;
} else if ((!smerX) && (!smerY)) {
_local21 = 3;
} else if (smerX && (smerY)) {
_local21 = 2;
} else {
_local21 = 1;
}
if (_local21 < 4) {
_local7 = lihnuti[_local21];
} else {
_local7 = lihnuti[1];
}
_local11 = _local13 + (smerX * (_local13 - 1));
_local10 = _local12 + (smerY * (_local12 - 1));
if (kdo == 2) {
if (smerY) {
_local11--;
if (!naPlanu(_local11, _local10)) {
_local11 = _local11 + 2;
}
} else {
_local10--;
if (!naPlanu(_local11, _local10)) {
_local10 = _local10 + 2;
}
}
}
_local2 = this[_local15 + _local6];
if (!posila) {
obsad(_local2, _local11, _local10);
_local2._x = pixelX(_local11, _local10);
_local2._y = pixelY(_local11, _local10);
trace((((((("Nasadil jsem hrace " + kdo) + " figurka ") + _local6) + " na ") + _local11) + " ") + _local10);
} else {
_local2.ponorSe(0, false);
}
_local6++;
var _local19;
if ((!smerY) && (smerX)) {
_local19 = true;
} else {
_local19 = false;
}
if (!smerX) {
smerX = 1;
}
if (!smerY) {
smerY = -1;
}
while ((_local6 <= _local14.length) && (_local5 < _local7.length)) {
_local2 = this[_local15 + _local6];
if ((_local2.mimo && (!posila)) || ((!_local2.mimo) && (posila))) {
_local6++;
continue;
}
if (_local19) {
_local9 = _local5 + 1;
_local8 = _local5;
} else {
_local9 = _local5;
_local8 = _local5 + 1;
}
_local4 = _local11 - (smerX * _local7[_local9]);
_local3 = _local10 - (smerY * _local7[_local8]);
trace((("Zkousim nasadit na " + _local4) + " ") + _local3);
if (naPlanu(_local4, _local3) && (!obsazeno(_local4, _local3))) {
_local2._visible = true;
_local2.mimo = false;
obsad(_local2, _local4, _local3);
_local2._x = pixelX(_local4, _local3);
_local2._y = pixelY(_local4, _local3);
_local6++;
}
_local5 = _local5 + 2;
}
if (_local21 == 4) {
var _local20 = Math.ceil(_local14.length / 2);
_local5 = _local14.length;
while (_local5 > _local20) {
_local2 = this[_local15 + _local5];
_local4 = _local13 + (_local13 - _local2.posX);
_local3 = _local12 + (_local12 - _local2.posY);
if (naPlanu(_local4, _local3) && (barvaPole(_local4, _local3) != _local2.strana)) {
presun(_local2, _local4, _local3);
_local2._x = pixelX(_local4, _local3);
_local2._y = pixelY(_local4, _local3);
}
_local5--;
}
}
return(_local6 - 1);
}
function pridejPlody(nahodnost) {
var _local3;
var _local4;
var _local6;
var _local1;
var _local2;
var _local7;
_local3 = 0;
_local4 = mapaBojiste.plody;
if (_local4) {
while (_local4.length >= ((_local3 * 3) + 3)) {
novyPlod(_local4[_local3 * 3], _local4[(_local3 * 3) + 1], _local4[(_local3 * 3) + 2]);
_local3++;
}
return(2);
}
if (nahodnost) {
_local2 = 1;
while (_local2 <= DILKUY) {
_local1 = 1;
while (_local1 <= DILKUX) {
if (!random(nahodnost)) {
novyPlod(_local1, _local2, nahodnejPlodDoMapy(_local1, _local2));
}
_local1++;
}
_local2++;
}
return(1);
}
}
function pridejObjekty(nahodnost) {
if (!objektu) {
objektu = 0;
}
var _local1;
var _local2;
var _local4;
_local1 = 0;
_local2 = mapaBojiste.objekty;
if (_local2) {
while (_local2.length >= ((_local1 * 3) + 3)) {
novyObjekt(_local2[_local1 * 3], _local2[(_local1 * 3) + 1], _local2[(_local1 * 3) + 2]);
_local1++;
}
return(2);
}
if (nahodnost) {
y = 1;
while (y < DILKUY) {
x = 1;
while (x < DILKUX) {
if (!random(nahodnost)) {
novyObjekt(x, y, nahodnejObjektDoMapy(x, y));
}
x++;
}
y++;
}
return(1);
}
}
function stvorPoklady() {
var _local5;
var _local4;
var _local2;
var _local3;
_local2 = 1;
while (_local2 <= 2) {
if (this["POKLAD" + _local2]) {
_local3 = this.attachMovie("poklad", "poklad" + _local2, this.getNextHighestDepth());
_local3.gotoAndStop(this["POKLAD" + _local2]);
_local3._x = pixelX(this[("POKLAD" + _local2) + "X"], this[("POKLAD" + _local2) + "Y"]);
_local3._y = pixelY(this[("POKLAD" + _local2) + "X"], this[("POKLAD" + _local2) + "Y"]);
}
_local2++;
}
}
function stvorPostavy() {
var _local3;
var _local8;
var _local7 = _root.postavy.length;
var _local4 = 0;
while (_local4 < _local7) {
_local3 = this.attachMovie("figurka", "h" + (_local4 + 1), this.getNextHighestDepth(), {_xscale:80, _yscale:80});
_local3.typ = _root.postavy[_local4];
_local3.strana = 1;
_local3.streh = 1;
_local3.zivotu = 1;
_local3.stavy.zivotup.gotoAndStop(21);
_local3.cislo = _local4 + 1;
_local3.hrac = HRAC1;
_local3.moralka = MORALKA1;
if ((_root.VIP1 == _local3.cislo) || (_root.HLAVNIHRDINA1 == _local3.cislo)) {
_local3.moralka = _local3.moralka - 2;
}
_local3.p.podst.gotoAndStop(_local3.strana);
if (_local3.typ < 0) {
_local3.mimo = true;
_local3.typ = -_local3.typ;
_local3._visible = false;
trace("posila typu " + _local3.typ);
trace("prijde v " + _root.POSILA1CAS);
}
_local4++;
}
}
function stvorPotvory() {
var _local3;
var _local9;
var _local8 = _root.potvory.length;
var _local4 = 0;
while (_local4 < _local8) {
_local3 = this.attachMovie("figurka", "p" + (_local4 + 1), this.getNextHighestDepth(), {smerPohledu:1, _xscale:80, _yscale:80});
_local3.typ = _root.potvory[_local4];
_local3.strana = 2;
_local3.streh = 1;
_local3.zivotu = 1;
_local3.stavy.zivotup.gotoAndStop(11);
_local3.cislo = _local4 + 1;
_local3.hrac = HRAC2;
_local3.moralka = MORALKA2;
if ((_root.VIP2 == _local3.cislo) || (_root.HLAVNIHRDINA2 == _local3.cislo)) {
_local3.moralka = _local3.moralka - 2;
}
_local3.p.podst.gotoAndStop(_local3.strana);
if (_local3.typ < 0) {
_local3.mimo = true;
_local3.typ = -_local3.typ;
_local3._visible = false;
}
_local4++;
}
}
function jeCerna(x, y) {
return((((x >> 1) << 1) == x) == (((y >> 1) << 1) == y));
}
function pixelX(x, y) {
return((dlazba._x + dlazba.d0._x) + (dlazba.d0.plocha._width * (x - 0.5)));
}
function pixelY(x, y) {
return((dlazba._y + dlazba.d0._y) + (dlazba.d0.plocha._height * (y - 0.5)));
}
function poziceX(x, y) {
var _local1;
_local1 = Math.ceil((x - dlazba._x) / dlazba.d0.plocha._width);
if ((_local1 > DILKUX) || (_local1 < 1)) {
_local1 = 0;
}
return(_local1);
}
function poziceY(x, y) {
var _local1;
_local1 = Math.ceil((y - dlazba._y) / dlazba.d0.plocha._height);
if ((_local1 > DILKUY) || (_local1 < 1)) {
_local1 = 0;
}
return(_local1);
}
function esteNetahli(strana) {
var _local2;
var _local3;
var _local5 = 0;
_local2 = 1;
while (_local2 <= this["armada" + strana].length) {
_local3 = this[this["iniciala" + strana] + _local2];
if ((!_local3.neni()) && (!_local3.uzTahnul)) {
_local5++;
}
_local2++;
}
return(_local5);
}
function jeKonec() {
if (HLAVNIHRDINA1 && (this["h" + HLAVNIHRDINA1].zivotu <= 0)) {
return(-2);
}
if (HLAVNIHRDINA2 && (this["p" + HLAVNIHRDINA2].zivotu <= 0)) {
return(2);
}
if (VIP1 && (this["h" + VIP1].zivotu <= 0)) {
return(-3);
}
if (VIP2 && (this["p" + VIP2].zivotu <= 0)) {
return(3);
}
if (VIP1 && (this["h" + VIP1].utekl)) {
return(1);
}
if (VIP2 && (this["p" + VIP2].utekl)) {
return(-1);
}
if ((POKLAD1 && (this["p" + zlodej1].utekl)) && ((!HLAVNIHRDINA2) || (this["p" + HLAVNIHRDINA2].utekl))) {
return(-4);
}
if ((POKLAD2 && (this["h" + zlodej2].utekl)) && ((!HLAVNIHRDINA1) || (this["h" + HLAVNIHRDINA1].utekl))) {
return(4);
}
var _local3 = 0;
var _local4 = 0;
x = 0;
while (x < _root.postavy.length) {
if (!this["h" + (x + 1)].neni()) {
_local3++;
}
x++;
}
x = 0;
while (x < _root.potvory.length) {
if (!this["p" + (x + 1)].neni()) {
_local4++;
}
x++;
}
if (_local3 && (_local4)) {
return(0);
}
if (!_local3) {
if ((!_root.tutorial) || (_root.mod != 1)) {
return(-5);
}
return(0);
}
var _local5 = 5;
if ((_root.mod == 1) && (_root.tutorial)) {
_local5++;
}
if (!pocetPrezivsich(neNaTahu)) {
return(_local5);
}
return(_local5);
}
function hlaskaOosudu(vysledek) {
var _local2;
var _local3;
_local3 = "";
_local2 = 0;
while (_local2 < hrdinoveMrtvi.length) {
_local3 = _local3 + (("The " + _root.typyPotvor[_root.hrdinoveTypy[hrdinoveMrtvi[_local2]]].jmeno) + " died.\n");
_local2++;
}
_local2 = 0;
while (_local2 < hrdinoveZajati.length) {
_local3 = _local3 + (("The " + _root.typyPotvor[_root.hrdinoveTypy[hrdinoveZajati[_local2]]].jmeno) + " has been captured.\n");
_local2++;
}
_local2 = 0;
while (_local2 < hrdinoveObzivli.length) {
_local3 = _local3 + (("The " + _root.typyPotvor[_root.hrdinoveTypy[hrdinoveObzivli[_local2]]].jmeno) + " will recover.\n");
_local2++;
}
if ((vysledek > 0) && ((_root.zajatec1 || (_root.zajatec2)) || (_root.zajatec3))) {
_local3 = _local3 + _root.textOsudZajatcu1;
}
if ((vysledek < 0) && ((_root.zajatec1 || (_root.zajatec2)) || (_root.zajatec3))) {
_local3 = _local3 + _root.textOsudZajatcu2;
}
return(_local3);
}
function urciOsudHrdinu() {
if ((_root.mod != 1) || (!_parent.HRAC1)) {
return(0);
}
var _local6;
var _local4;
var _local8;
var _local7;
while (hrdinoveMrtvi.length) {
hrdinoveMrtvi.pop();
}
while (hrdinoveZajati.length) {
hrdinoveZajati.pop();
}
while (hrdinoveObzivli.length) {
hrdinoveObzivli.pop();
}
if (((vysledekBoje != -2) && (vysledekBoje != -3)) && (vysledekBoje != -5)) {
_local7 = 1;
} else if (_root.skupinyPotvor[_root.cisloTridyOddilu(_root.bitvy[_root.kapitola][_root.cisloMise - 1].oddily[0].trida)].strana == 0) {
_local7 = -1;
} else if (_root.cisloMise > 10) {
_local7 = -1;
} else {
_local7 = -2;
}
_local6 = 1;
while (_local6 <= _root.postavy.length) {
_local4 = 0;
_local8 = this["h" + _local6];
if (_local8.zivotu > 0) {
} else {
if (_root.hrdina1meziPostavama == _local6) {
_local4 = 1;
} else if (_root.hrdina2meziPostavama == _local6) {
_local4 = 2;
} else if (_root.hrdina3meziPostavama == _local6) {
_local4 = 3;
}
if (_local4) {
trace(((("hrdina " + _local4) + " ma ") + _local8.zivotu) + " zivotu");
var _local5;
if (_root.cisloMise > 10) {
_local5 = 0;
} else {
_local5 = _root.cisloMise;
}
if (_local8.zdravotniStav() < 0) {
_root[("hrdina" + _root[(("emisar" + _local5) + "_") + _local4]) + "stav"] = -1;
hrdinoveMrtvi.push(_root[(("emisar" + _local5) + "_") + _local4]);
} else if (_local7 != 1) {
trace("zalezi tedy na osudu");
_root[("hrdina" + _root[(("emisar" + _local5) + "_") + _local4]) + "stav"] = _local7;
if (_local7 == -2) {
hrdinoveZajati.push(_root[(("emisar" + _local5) + "_") + _local4]);
} else if (_local7 == -1) {
hrdinoveMrtvi.push(_root[(("emisar" + _local5) + "_") + _local4]);
}
} else {
hrdinoveObzivli.push(_root[(("emisar" + _local5) + "_") + _local4]);
}
}
}
_local6++;
}
}
function urciVysledek() {
}
function rozvrstvi(typNatoceni) {
var _local2;
var _local3;
var _local8;
var _local6;
var _local5;
var _local7 = 1;
while (_local7 <= DILKUY) {
var _local4 = 1;
while (_local4 <= DILKUX) {
_local2 = figurkaNa(_local4, _local7);
if (_local2) {
if (_local2.strana == 1) {
_local8 = 2;
} else {
_local8 = 1;
}
_local3 = this.createEmptyMovieClip("novejKlip", this.getNextHighestDepth());
_local2.swapDepths(_local3);
if (typNatoceni == 2) {
natocSeSpravne(_local2);
} else if (typNatoceni == 1) {
_local6 = Math.ceil(DILKUX / 2);
_local5 = Math.ceil(DILKUY / 2);
if ((!this[("RAZENI" + _local2.strana) + "X"]) && (!this[("RAZENI" + _local2.strana) + "Y"])) {
_local6 = _local6 * -1;
_local5 = _local5 * -1;
}
natocSeSpravne(_local2, _local6 + (_local6 - _local2.posX), _local5 + (_local5 - _local2.posY));
}
_local3.removeMovieClip();
}
_local4++;
}
_local4 = 1;
while (_local4 <= DILKUX) {
_local2 = objektNa(_local4, _local7, true);
if (_local2) {
_local3 = this.createEmptyMovieClip("novejKlip", this.getNextHighestDepth());
_local2.swapDepths(_local3);
_local3.removeMovieClip();
}
_local4++;
}
_local7++;
}
}
function obnovVsem(strana, vlastnost) {
var _local3;
var _local6;
var _local9;
var _local4;
var _local5;
_local4 = 0;
if (strana == 2) {
_local6 = "p";
_local5 = _root.potvory;
} else {
_local6 = "h";
_local5 = _root.postavy;
}
x = 1;
while (x <= _local5.length) {
_local3 = this[_local6 + x];
sch1 = _local3.streh;
_local3.obnovStav(vlastnost);
if ((!_local3.neni()) && (_local3.streh > sch1)) {
_local4++;
}
x++;
}
return(_local4);
}
function init(dimX, dimY) {
policka = new Array(dimX);
var _local3 = 0;
while (_local3 < dimX) {
this["rady" + _local3] = new Array(dimY);
policka[_local3] = this["rady" + _local3];
_local3++;
}
_local3 = 1;
while (_local3 <= dimX) {
y = 1;
while (y <= dimY) {
obsadPole(_local3, y, 0);
y++;
}
_local3++;
}
if (_root.krev.kapek) {
_root.krev.duplicateMovieClip("_root.bojiste.krev", this.getNextHighestDepth());
krev._visible = true;
} else {
this.createEmptyMovieClip("krev", this.getNextHighestDepth());
}
krev._x = dlazba._x;
krev._y = dlazba._y;
krev.kapek = 0;
this.createEmptyMovieClip("plody", this.getNextHighestDepth());
plody._x = dlazba._x;
plody._y = dlazba._y;
plody.plodu = 0;
}
function cakejNaPodlahu(x, y) {
var _local4;
var _local7;
if (_root.krev == 1) {
return(0);
}
var _local9 = ((pixelX(x, y) - dlazba._x) + random(60)) - random(60);
var _local8 = ((pixelY(x, y) - dlazba._y) + random(40)) - random(40);
if (!naPlanu(poziceX(_local9, _local8), poziceY(_local9, _local8))) {
return(0);
}
krev.kapek++;
if (_root.krev > 1) {
_local4 = krev.attachMovie("cakanec", "k" + krev.kapek, krev.getNextHighestDepth());
} else {
_local4 = krev.attachMovie("rozhozeny", "k" + krev.kapek, krev.getNextHighestDepth());
}
if (_root.krev > 1) {
_local7 = random(200) + 10;
} else {
_local7 = random(100) + 60;
}
_local4._yscale = _local7;
_local4._xscale = _local7;
if (_root.krev > 1) {
_local4._xscale = _local4._xscale + random(50);
}
if (random(2)) {
_local4._xscale = _local4._xscale * -1;
}
_local4._x = _local9;
_local4._y = _local8;
_local4.gotoAndStop(random(3) + 1);
var _local3;
var _local2;
_local3 = x - 1;
while (_local3 <= (x + 1)) {
_local2 = y - 1;
while (_local2 <= (y + 1)) {
if ((hloubkaNa(_local3, _local2) > 0.5) && (_root.bojiste.dlazba[(("d" + _local3) + "_") + _local2].hitTest(_local4))) {
_local4.removeMovieClip();
krev.kapek--;
}
_local2++;
}
_local3++;
}
}
function novyPlod(x, y, typ) {
plod = plody.attachMovie("plody", (("p" + x) + "_") + y, plody.getNextHighestDepth());
plod.typ = typ;
plod.hlavniTyp = polovic(typ);
plod._x = pixelX(x, y) - plody._x;
plod._y = pixelY(x, y) - plody._y;
plod.gotoAndStop(plod.typ);
plody.plodu++;
}
function novyObjekt(x, y, typ) {
objekt = this.attachMovie("objektyKrajiny", (("objekt" + x) + "_") + y, this.getNextHighestDepth());
objekt.typ = typ;
objekt.hlavniTyp = polovic(typ);
objekt._x = pixelX(x, y);
objekt._y = pixelY(x, y);
objekt.gotoAndStop(objekt.typ);
objekt._rotation = (((random(2) * 2) - 1) * random(3)) * typyObjektu[objekt.hlavniTyp].krivost;
objektu++;
}
function barvaPole(x, y) {
return(policka[x - 1][y - 1].strana);
}
function obsadPole(x, y, kym) {
policka[x - 1][y - 1] = kym;
}
function uvolniPole(x, y) {
policka[x - 1][y - 1] = 0;
}
function obsad(kdo, x, y) {
kdo.posX = x;
kdo.posY = y;
obsadPole(x, y, kdo);
}
function uvolni(kdo) {
uvolniPole(kdo.posX, kdo.posY);
}
function presun(kdo, x, y) {
uvolni(kdo);
if (naPlanu(x, y)) {
obsad(kdo, x, y);
} else {
kdo.utekl = true;
kdo.nastavUzTahnul(true);
kdo.kroku = 0;
kdo.chtelJitSmeremX = 0;
kdo.chtelJitSmeremY = 0;
kdo._visible = false;
}
var _local4;
if (kdo.strana == 1) {
_local4 = 2;
} else {
_local4 = 1;
}
if (((this[("POKLAD" + _local4) + "X"] == kdo.posX) && (this[("POKLAD" + _local4) + "Y"] == kdo.posY)) && (!this["zlodej" + _local4])) {
this["zlodej" + _local4] = kdo.cislo;
this["poklad" + _local4]._visible = false;
zvetsiMoralku(_local4, 5);
_root.zvuky.signal1.start();
}
}
function zvetsiMoralku(strana, kolik) {
var _local3 = this["armada" + strana];
var _local4 = this["iniciala" + strana];
var _local2 = 1;
while (_local2 <= _local3.length) {
this[_local4 + _local2].moralka = this[_local4 + _local2].moralka + kolik;
_local2++;
}
}
function stvorUteky() {
var _local6;
var _local2;
var _local4;
var _local5;
var _local3;
_local4 = 1;
while (_local4 <= 2) {
if (this["UTEK" + _local4] == 5) {
_local3 = 1;
} else {
_local3 = 0;
}
_local5 = 1;
while (_local5 <= 4) {
if (this["UTEK" + _local4] == _local5) {
this[(("u" + _local4) + "_") + _local5] = 1;
} else {
this[(("u" + _local4) + "_") + _local5] = _local3;
}
_local5++;
}
_local4++;
}
_local4 = 1;
while (_local4 <= 2) {
_local6 = this["UTEK" + _local4];
if ((_local6 == 5) || (_local6 == 1)) {
_local2 = cestaKuteku0.duplicateMovieClip("utek1", this.getNextHighestDepth());
_local2._yscale = -75;
_local2.p._width = (DILKUX * dlazba.d0.plocha._width) + 2;
_local2._x = dlazba._x;
_local2._y = dlazba._y;
_local2._alpha = 50;
_local2.v._x = Math.round(_local2.p._width / 4);
_local3 = 0;
_local2.smerX = 0;
_local2.smerY = -1;
if (this.u1_1) {
_local3 = _local3 + 1;
}
if (this.u2_1) {
_local3 = _local3 + 2;
}
_local2.v.gotoAndStop(_local3);
}
if ((_local6 == 5) || (_local6 == 2)) {
_local2 = cestaKuteku0.duplicateMovieClip("utek2", this.getNextHighestDepth());
_local2._rotation = 270;
_local2.p._width = (DILKUY * dlazba.d0.plocha._height) + 2;
_local2._x = dlazba._x + (DILKUX * dlazba.d0.plocha._width);
_local2._y = dlazba._y + (DILKUY * dlazba.d0.plocha._height);
_local2._alpha = 50;
_local2.v._x = Math.round(_local2.p._width / 4);
_local3 = 0;
_local2.smerX = 1;
_local2.smerY = 0;
if (this.u1_2) {
_local3 = _local3 + 1;
}
if (this.u2_2) {
_local3 = _local3 + 2;
}
_local2.v.gotoAndStop(_local3);
}
if ((_local6 == 5) || (_local6 == 3)) {
_local2 = cestaKuteku0.duplicateMovieClip("utek3", this.getNextHighestDepth());
_local2._yscale = 75;
_local2.p._width = (DILKUX * dlazba.d0.plocha._width) + 2;
_local2._x = dlazba._x;
_local2._y = dlazba._y + (DILKUY * dlazba.d0.plocha._height);
_local2._alpha = 50;
_local2.v._x = Math.round(_local2.p._width / 4);
_local2.v._y = _local2.v._y + 15;
_local3 = 0;
_local2.smerX = 0;
_local2.smerY = 1;
if (this.u1_3) {
_local3 = _local3 + 1;
}
if (this.u2_3) {
_local3 = _local3 + 2;
}
_local2.v.gotoAndStop(_local3);
}
if ((_local6 == 5) || (_local6 == 4)) {
_local2 = cestaKuteku0.duplicateMovieClip("utek4", this.getNextHighestDepth());
_local2._rotation = 90;
_local2.p._width = (DILKUY * dlazba.d0.plocha._height) + 2;
_local2._x = dlazba._x;
_local2._y = dlazba._y;
_local2._alpha = 50;
_local2.v._x = Math.round(_local2.p._width / 4);
_local3 = 0;
_local2.smerX = -1;
_local2.smerY = 0;
if (this.u1_4) {
_local3 = _local3 + 1;
}
if (this.u2_4) {
_local3 = _local3 + 2;
}
_local2.v.gotoAndStop(_local3);
}
_local4++;
}
cestaKuteku0._visible = false;
}
function centruj() {
dlazba._x = (400 - _x) - Math.floor(dlazba._width / 2);
dlazba._y = (310 - _y) - Math.floor(dlazba._height / 2);
umistiMenu();
popisky._x = 400 - _x;
}
function stvorMenu() {
var _local2;
buton0._visible = false;
_local2 = buton0.duplicateMovieClip("buton1", this.getNextHighestDepth());
_local2.cislo = 1;
_local2.napis = "QUIT";
_local2 = buton0.duplicateMovieClip("buton2", this.getNextHighestDepth());
_local2.cislo = 2;
_local2.napis = "BANNERS";
_local2 = buton0.duplicateMovieClip("buton3", this.getNextHighestDepth());
_local2.cislo = 3;
_local2.napis = "MUSIC";
_local2 = buton0.duplicateMovieClip("buton4", this.getNextHighestDepth());
_local2.cislo = 4;
_local2.napis = "END TURN";
}
function umistiMenu() {
var _local3;
var _local2;
buton1._x = (dlazba._x + (DILKUX * dlazba.d0.plocha._width)) - buton1._width;
buton1._y = (dlazba._y + (DILKUY * dlazba.d0.plocha._height)) + 11;
_local2 = 2;
while (_local2 < 5) {
_local3 = this["buton" + _local2];
_local3._x = (this["buton" + (_local2 - 1)]._x - _local3._width) - 1;
_local3._y = (dlazba._y + (DILKUY * dlazba.d0.plocha._height)) + 11;
_local2++;
}
buton1.napis = "QUIT";
buton2.napis = "BANNERS";
buton3.napis = "MUSIC";
buton4.napis = "END TURN";
}
function ukazMenu(videt) {
var _local2 = 4;
while (_local2 < 5) {
if (videt) {
this["buton" + _local2]._visible = true;
} else {
this["buton" + _local2]._visible = false;
}
_local2++;
}
}
function menuAkce(kolik) {
var _local4;
var _local3;
if (_root.hlaska._visible) {
return(0);
}
switch (kolik) {
case 1 :
_root.prohlas("quit");
break;
case 2 :
if (!viditelnostStitku) {
viditelnostStitku = 60;
} else {
viditelnostStitku = 0;
}
break;
case 3 :
if (!_root.ticho) {
_root.ticho = true;
} else {
_root.ticho = false;
}
_root.hudboHraj("bitka");
break;
case 4 :
tahnouci.uzTahnul = true;
tahnouci.bylNapor = 0;
zmenTah();
}
}
DILKUX = 9;
DILKUY = 9;
viditelnostStitku = 0;
DILEKSIRKA = 60;
DILEKVYSKA = 40;
HRAC1 = 1;
HRAC2 = 0;
HLAVNIHRDINA1 = 0;
HLAVNIHRDINA2 = 0;
VIP1 = 0;
VIP2 = 0;
POKLAD1 = 0;
POKLAD2 = 1;
POKLAD1X = 0;
POKLAD1Y = 0;
POKLAD2X = 9;
POKLAD2Y = 1;
zlodej1 = 0;
zlodej2 = 0;
UTEK1 = 4;
UTEK2 = 2;
MORALKA1 = 0;
MORALKA2 = 0;
RAZENI1X = -1;
RAZENI1Y = 1;
RAZENI2X = 1;
RAZENI2Y = -1;
vysledekBoje = 0;
armada1 = _root.postavy;
armada2 = _root.potvory;
iniciala1 = "h";
iniciala2 = "p";
this.onEnterFrame = function () {
if (_currentframe < 3) {
return(0);
}
testujBytosti();
if (!vysledekBoje) {
dalsiKrok();
}
};
this.onMouseMove = function () {
ukazDleKurzoru();
};
this.onMouseDown = function () {
if (!myska) {
klikNaDesku();
}
myska = true;
};
this.onMouseUp = function () {
myska = false;
};
tut = new Tut();
typyTerenu = new Array({jmeno:"", cena:1, hloubka:0}, {jmeno:"Dlazba", cena:1, hloubka:0}, {jmeno:"Rock", cena:1, hloubka:0}, {jmeno:"Soil", cena:1, hloubka:0}, {jmeno:"Grass", cena:1, hloubka:0}, {jmeno:"Swamp", cena:2, kryt:-4, hloubka:0.5}, {jmeno:"Water", cena:2, kryt:-3, hloubka:1});
typyPlodu = new Array({jmeno:""}, {jmeno:"Rocks", kryt:-1}, {jmeno:"Sticks", kryt:-1}, {jmeno:"Bones", kryt:-2}, {jmeno:"Pink flowers"}, {jmeno:"Blue flower"}, {jmeno:"Mushrooms"}, {jmeno:"Magical apple", lecba:3}, {jmeno:"Shell"}, {jmeno:""});
typyObjektu = new Array({jmeno:"", velikost:0, rozlehlost:0}, {jmeno:"Dead tree", velikost:2, rozlehlost:0, krivost:2}, {jmeno:"Canvas tent", velikost:2, rozlehlost:2}, {jmeno:"Hide tent", velikost:2, rozlehlost:2}, {jmeno:"Hut", velikost:2, rozlehlost:2}, {jmeno:"Rock", velikost:2, rozlehlost:0, krivost:1}, {jmeno:"Stone", velikost:1, rozlehlost:0, krivost:1}, {jmeno:"Stones", velikost:1, rozlehlost:1}, {jmeno:"Pillar", velikost:2, rozlehlost:0, krivost:1}, {jmeno:"Bush", velikost:1, rozlehlost:0, krivost:1});
objektyPodlePodkladu = new Array(new Array(0), new Array(15, 16), new Array(7, 8, 9, 10, 9, 10, 11, 12, 11, 12, 11, 12), new Array(1, 2, 3, 4, 5, 6, 7, 8, 17, 18), new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 17, 18, 17, 18, 17, 18), new Array(1, 2, 1, 2, 1, 2, 15, 16, 17, 18, 17, 18, 17, 18), new Array(1, 2, 9, 10, 11, 12));
plodyPodlePodkladu = new Array(new Array(0), new Array(1, 2, 3, 4, 5, 6, 14, 14), new Array(1, 2, 3, 4, 5, 6, 13, 13, 15, 16, 1, 2, 1, 2), new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 15, 16, 3, 4), new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 15, 16, 7, 8, 7, 8, 11, 12, 3, 4, 7, 8), new Array(7, 8, 7, 8, 9, 10, 11, 12), new Array(7, 8, 7, 8, 9, 10));
reky = new Array(new Array(1, 3, 1, 4, 2, 3, 2, 4, 3, 3, 3, 4, 4, 3, 4, 4, 4, 5, 5, 4, 5, 5, 6, 4, 6, 5, 7, 4, 7, 5, 8, 4, 8, 5, 9, 4, 9, 5, 10, 4, 11, 4, 12, 14, 13, 4, 14, 4), new Array(1, 6, 2, 6, 3, 6, 4, 4, 4, 5, 4, 6, 5, 4, 6, 3, 6, 4, 7, 3, 8, 3, 9, 3, 10, 2, 10, 3, 11, 2, 12, 2, 13, 2), new Array(1, 6, 2, 6, 3, 4, 3, 5, 3, 6, 4, 4, 5, 3, 5, 4, 6, 1, 6, 2, 6, 3));
brehy = new Array(new Array(1, 1, 1, 2, 1, 3, 2, 1, 2, 2, 2, 3, 3, 1, 3, 2, 4, 1, 4, 2, 5, 1, 5, 2, 6, 1, 6, 7, 1, 7, 2, 7, 3, 8, 1, 8, 2, 8, 3, 9, 1, 9, 2, 9, 3, 10, 1, 10, 2, 11, 1, 11, 2, 12, 1, 13, 1), new Array(1, 1, 1, 2, 2, 1, 2, 2, 3, 1, 3, 2, 3, 3, 4, 1, 4, 2, 4, 3, 5, 1, 5, 2, 5, 3, 6, 1, 6, 2, 6, 3, 7, 1, 7, 2, 8, 1, 9, 1), new Array(1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 2, 1, 2, 2, 2, 3, 2, 4, 3, 1, 3, 2, 3, 2, 4, 1, 4, 2, 4, 3, 5, 1, 5, 2, 6, 1));
ostruvky = new Array(new Array(2, 6, 2, 7, 3, 5, 3, 6, 3, 7, 4, 5, 4, 6, 4, 7, 4, 8, 5, 6, 5, 7, 5, 8), new Array(6, 2, 6, 3, 6, 4, 7, 2, 7, 3), new Array(3, 4, 3, 5, 3, 6, 4, 3, 4, 4, 4, 5, 4, 65, 3, 5, 4));
koryta = new Array(new Array(1, 5, 2, 5, 3, 5, 4, 5, 5, 1, 5, 2, 5, 3, 5, 4, 5, 5), new Array(1, 4, 1, 5, 2, 4, 2, 5, 3, 4, 3, 5, 4, 4, 4, 5, 5, 4, 5, 5, 6, 4, 6, 5, 7, 4, 7, 5, 8, 4, 8, 5, 9, 4, 9, 5, 10, 4, 10, 5, 11, 4, 11, 5, 12, 4, 12, 5, 13, 4, 13, 5, 14, 4, 14, 5), new Array(1, 4, 1, 5, 2, 4, 2, 5, 3, 4, 3, 5, 4, 4, 4, 5, 5, 1, 5, 2, 5, 3, 5, 4, 5, 5, 6, 1, 6, 2, 6, 3, 6, 4, 6, 5));
sousedniTereny = new Array(1, 1, 3, 1, 2, 2, 3, 6, 4, 2, 4, 6, 5, 3, 3, 6, 4, 2, 4, 4, 2, 3, 4, 4);
ricniTereny = new Array(1, 1, 5, 6, 6, 6, 6, 6, 3, 2, 2, 6, 3, 3, 6, 6, 4, 4, 3, 2, 6, 6, 6, 6);
mapaBojiste = _root.mapaBojiste;
if (!mapaBojiste) {
mapaBojiste = _root["mapaBojiste" + (random(6) + 1)];
}
cinnost = new Zalezitost2D();
strukturaTahu = new StrukturaTahu(0, 0, 0, 0, 0, 0, 0, 0);
replayPole = new Array();
replayIndex = 0;
pocatecniStav = new Array();
pocatecniZivoty1 = new Array();
pocatecniZivoty2 = new Array();
cesty = new Array(DILKUX);
var x = 0;
while (x < DILKUX) {
this["rady" + x] = new Array(DILKUY);
cesty[x] = this["rady" + x];
x++;
}
frontaDalky = new Array();
lihnuti = new Array(new Array(), new Array(2, 0, -2, 0, 4, 0, -4, 0, 6, 0, -6, 0, 1, 1, -1, 1, 3, 1, -3, 1, 5, 1, -5, 1, 0, 2, -2, 2, 2, 2, -4, 2, 4, 2, -6, 2, 6, 2, 1, 3, -1, 3, 3, 3, -3, 3, 5, 3, -5, 3, 2, 4, -2, 4, 4, 4, -4, 4, 6, 4, -6, 4, 1, 5, -1, 5, 3, 5, -3, 5, 5, 5, -5, 5), new Array(2, 0, -1, 1, 1, 1, 0, 2, 2, 2, 3, 1, 1, 3, -1, 3, 4, 0, 0, 4, 3, 3, 4, 2, 2, 4, 5, 1, 1, 5, 6, 0, 0, 6, -1, 5), new Array(1, 1, -1, 1, -1, -1, 1, -1, 2, 0, 0, 2, -2, 0, 0, -2));
hrdinoveMrtvi = new Array();
hrdinoveZajati = new Array();
hrdinoveObzivli = new Array();
bylUrcenVysledek = false;
prijmiPodminky();
stvorMenu();
Symbol 1113 MovieClip Frame 2
centruj();
init(DILKUX, DILKUY);
stvorUteky();
pridejPlody(10);
pridejObjekty(20);
stvorPoklady();
stvorPotvory();
stvorPostavy();
gotoAndStop (3);
Symbol 1113 MovieClip Frame 3
nasackuj(1, RAZENI1X, RAZENI1Y);
nasackuj(2, RAZENI2X, RAZENI2Y);
var i;
i = 1;
while (i <= _root.postavy.length) {
this["h" + i].ponorSe(undefined);
i++;
}
i = 1;
while (i <= _root.potvory.length) {
this["p" + i].ponorSe(0, true);
i++;
}
zkusenostTed = 0;
naTahu = 0;
kdoTahne = 0;
kroku = 0;
if ((!HRAC1) && (HRAC2)) {
naTahu = 1;
}
tah = 0;
casNaUstup = false;
zmenTah();
rozvrstvi(1);
pokracuj();
ukazMoznosti();
vysvetli(0);
if (poucka.length && (_root.napoveda)) {
stuj();
_root.prohlas(poucka);
}
_root.hudboHraj(3);
testujTut("barvy");
pokracuj();
stop();
Symbol 1113 MovieClip Frame 4
hlaskaTahu.napis.gotoAndStop(2);
Symbol 1113 MovieClip Frame 6
hlaskaTahu.napis.gotoAndStop(1);
Symbol 1126 MovieClip Frame 1
stop();
Symbol 1134 MovieClip Frame 1
stop();
Symbol 1134 MovieClip Frame 6
stop();
Symbol 1172 MovieClip Frame 1
var _mochiads_game_id = "50efeb62516d7ec9";
stop();
Symbol 1172 MovieClip Frame 5
if (_root.typHudby != 4) {
_root.hudboHraj(4);
}
Symbol 1173 MovieClip Frame 1
stop();
Symbol 1173 MovieClip Frame 7
stop();
Symbol 1178 MovieClip Frame 1
stop();
Symbol 1179 MovieClip Frame 1
stop();
Symbol 1179 MovieClip Frame 8
zdr = random(24) + 1;
Symbol 1179 MovieClip Frame 10
if (zdr) {
zdr--;
prevFrame();
play();
}
Symbol 1179 MovieClip Frame 19
stop();
Symbol 1179 MovieClip Frame 26
stop();
Symbol 1182 MovieClip Frame 1
function zabublej(kolik) {
if (kolik) {
bublina._visible = true;
bublina.b.gotoAndStop(kolik);
bublina.gotoAndPlay("on");
} else if (bublina._visible) {
bublina.gotoAndPlay("off");
}
}
bublina._visible = false;
stop();
Symbol 1182 MovieClip Frame 8
f.gotoAndStop(fig._currentframe);
f.podst._visible = false;
Symbol 1182 MovieClip Frame 15
gotoAndStop (2);
Symbol 1182 MovieClip Frame 22
gotoAndStop (1);
Symbol 1183 MovieClip Frame 1
function zobraz() {
var _local4;
_visible = true;
_local4 = 1;
while (_local4 <= _root.HRDINU) {
this["hrdinaf" + _local4].typ = _parent.typHrdiny(_local4);
this["hrdinaf" + _local4].fig.gotoAndStop((_root.typyPotvor[_parent.typHrdiny(_local4)].postava * 2) - 1);
this["hrdinaf" + _local4].gotoAndStop(5 - _root[("hrdina" + _local4) + "stav"]);
this["hrdinaf" + _local4].cislo = _local4;
this["hrdinaf" + _local4].fig.podst._visible = false;
if (_root["oddil" + _local4].pocet) {
this["hrdinaf" + _local4].symbolDruziny._visible = true;
this["hrdinaf" + _local4].druzinaReprez = _root.reprezentantTridy(_local4);
this["hrdinaf" + _local4].symbolDruziny.podst._visible = false;
this["hrdinaf" + _local4].symbolDruziny.gotoAndStop(this["hrdinaf" + _local4].druzinaReprez);
this["hrdinaf" + _local4].druzinaPocet = _root["oddil" + _local4].pocet;
} else {
this["hrdinaf" + _local4].symbolDruziny._visible = false;
}
_local4++;
}
this["hrdinaf" + _parent.nad].gotoAndStop("zari");
}
this.onMouseMove = function () {
};
stop();
Symbol 1195 MovieClip Frame 1
stop();
Symbol 1197 MovieClip Frame 1
stop();
Symbol 1205 MovieClip Frame 1
stop();
Symbol 1205 MovieClip Frame 2
krev.gotoAndStop(1);
Symbol 1205 MovieClip Frame 3
krev.gotoAndStop(2);
Symbol 1205 MovieClip Frame 4
krev.gotoAndStop(3);
Symbol 1206 MovieClip Frame 1
stop();
Symbol 1206 MovieClip Frame 15
stop();
Symbol 1207 MovieClip Frame 1
function zobrazDruziny() {
var _local3;
var _local4;
var _local5;
_local3 = 1;
while (_local3 <= 3) {
if (_root.cisloMise > 10) {
_local5 = 0;
} else {
_local5 = _root.cisloMise;
}
_local4 = _root[(("emisar" + _local5) + "_") + _local3];
if (_root["oddil" + _local4].pocet) {
this["symbolDruziny1_" + _local3]._visible = true;
this["hrdinaf1_" + _local3].druzinaReprez = _root.reprezentantTridy(_local4, 0, 3);
this["symbolDruziny1_" + _local3].podst._visible = false;
this["symbolDruziny1_" + _local3].fig.gotoAndStop(this["hrdinaf1_" + _local3].druzinaReprez);
this["symbolDruziny1_" + _local3].pocet = _root["oddil" + _local4].pocet;
} else {
this["symbolDruziny1_" + _local3]._visible = false;
}
_local3++;
}
}
stop();
Symbol 1208 Button
on (rollOver) {
_parent.nad = true;
}
on (rollOut) {
_parent.nad = false;
}
on (release) {
_root.hlaska.pocet = _parent._parent.obsazenych;
_root.hlaska.pocet2 = _parent._parent["mist" + _root.cisloMise];
_root.prohlas("doMise");
}
Symbol 1210 Button
on (rollOver) {
_parent.nad = true;
}
on (rollOut) {
_parent.nad = false;
}
on (release) {
_parent._parent.aktualniDruzina++;
if ((_parent._parent.aktualniDruzina > 3) || (!_root["druzina" + _parent._parent.aktualniDruzina].length)) {
_parent._parent.aktualniDruzina = 1;
}
_parent._parent.narviDruzinu(_parent._parent.aktualniDruzina);
_parent._parent.zobraz();
_root.zvuky.uder1.start();
_parent.gotoAndPlay(2);
}
Symbol 1213 MovieClip Frame 1
stop();
Symbol 1214 MovieClip Frame 1
function skryj() {
_visible = false;
}
function ukaz() {
_visible = true;
gotoAndStop (10);
go.gotoAndStop(cislo);
}
function zobraz() {
if ((!_root.pocetSpojencu(_root.kapitola, _root.cisloMise)) && (!_parent.obsazenych)) {
skryj();
} else if (!_visible) {
ukaz();
}
}
stop();
Symbol 1214 MovieClip Frame 8
stop();
Symbol 1216 Button
on (rollOver) {
_parent.nad = 1;
gotoAndStop (2);
}
on (rollOut) {
_parent.nad = 0;
gotoAndStop (1);
}
on (release) {
_root.prohlas("abortMission");
}
Symbol 1217 Button
on (rollOver) {
_parent.nad = 2;
gotoAndStop (3);
}
on (rollOut) {
_parent.nad = 0;
gotoAndStop (1);
}
on (release) {
_root.prohlas("toMainMenu");
}
Symbol 1222 MovieClip Frame 1
stop();
Symbol 1223 Button
on (rollOver) {
nad = 3;
}
on (rollOut) {
nad = 0;
}
Symbol 1224 MovieClip Frame 1
onEnterFrame = function () {
if (!nad) {
prevFrame();
} else {
nextFrame();
}
};
Symbol 1231 MovieClip Frame 6
stop();
Symbol 1240 MovieClip Frame 129
stop();
Symbol 1241 Button
on (release) {
_parent.gotoAndPlay("novaMise");
}
Symbol 1243 Button
on (release) {
_parent.konecKampane(_parent.vitezstvi);
}
Symbol 1245 Button
on (release) {
_parent.loaduj();
_root.kapitola--;
_parent.gotoAndPlay("predMisi");
}
Symbol 1247 MovieClip Frame 1
stop();
Symbol 1248 MovieClip Frame 1
function init() {
aktualniDruzina = 1;
_root.dalsiMise(true);
kapitola = _root.kapitola;
if (kapitola >= _root.bitvy.length) {
return(0);
}
cisloMise = _root.cisloMise;
if (cisloMise == 1) {
obnovKapitolu();
}
pocetMisi = _root.bitvy[kapitola].length;
var _local6 = _root.bitvy[kapitola][cisloMise - 1].mist;
if (!_local6) {
_local6 = 1;
}
_root.rozdelOddily(3, _local6);
var _local3;
var _local4;
var _local5;
mist0 = 1;
_root.emisar0_1 = 0;
_root.emisar0_2 = 0;
_local3 = 1;
while (_local3 <= pocetMisi) {
this["mist" + _local3] = _root.bitvy[kapitola][_local3 - 1].mist;
_local4 = 1;
while (_local4 <= _root.bitvy[kapitola].length) {
if (cisloMise == 1) {
_root[(("emisar" + _local3) + "_") + _local4] = 0;
} else if (_root[("hrdina" + _root[(("emisar" + _local3) + "_") + _local4]) + "stav"] < 1) {
_root[(("emisar" + _local3) + "_") + _local4] = -1;
}
_local4++;
}
_local3++;
}
if (cisloMise == 1) {
_local3 = 1;
while (_local3 <= _root.HRDINU) {
_local5 = _root[("hrdina" + _local3) + "stav"];
if (_local5 > 0) {
_root[("hrdina" + _local3) + "stav"] = 4;
}
_local3++;
}
if (podminkaPostupu()) {
_local3 = 1;
while (_local3 <= _root.HRDINU) {
_root[("hrdinaSave" + _local3) + "stav"] = _root[("hrdina" + _local3) + "stav"];
_root["oddilSave" + _local3] = _root["oddil" + _local3];
_local3++;
}
}
}
obsazenych = 0;
return(1);
}
function klik() {
}
function podminkaPostupu() {
if (_root.diff < 2) {
return(vyhranoBitev > (_root.bitvy[_root.kapitola - 1].length / 2));
}
return(vyhranoBitev > (_root.bitvy[_root.kapitola - 1].length - 2));
}
function obnovKapitolu() {
var _local2;
_root.typMapy = _root.kapitola;
vyhranoBitev = _root.vyhranoBitev;
_root.vyhranoBitev = 0;
_local2 = 1;
while (_local2 <= _root.bitvy[_root.kapitola].length) {
_root.vysledek[_local2] = 0;
_local2++;
}
_local2 = 1;
while (_local2 <= 3) {
_root["zajatec" + _local2] = 0;
_local2++;
}
}
function loaduj() {
x = 1;
while (x <= _root.HRDINU) {
if (_root[("hrdinaSave" + x) + "stav"] != undefined) {
_root[("hrdina" + x) + "stav"] = _root[("hrdinaSave" + x) + "stav"];
} else {
_root[("hrdina" + x) + "stav"] = 4;
}
if (_root["oddilSave" + x] != undefined) {
_root["oddil" + x] = _root["oddilSave" + x];
} else {
_root["oddil" + x] = 0;
}
x++;
}
_root.cisloMise = 0;
_root.vyhranoBitev = 0;
vyhranoBitev = 0;
}
function vysvetli(koho) {
var _local3;
hrdFigurky.zobraz();
_root.info.ukaz(typHrdiny(koho), 1);
druzina.zobraz(koho);
instrukce.gotoAndStop(hrdFigurky["hrdinaf" + koho].typ);
}
function viditelnychNepratel(kap, mis) {
var _local3 = 0;
var _local2;
_local2 = _root.bitvy[kap][mis].oddily;
_local3 = _local3 + _local2[0].pocet;
if (!_local2[1].prichod) {
_local3 = _local3 + _local2[1].pocet;
}
if (!_local2[2].prichod) {
_local3 = _local3 + _local2[2].pocet;
}
}
function prvniVolnyMisto() {
var _local4;
if (cisloMise > 10) {
_local4 = 0;
} else {
_local4 = cisloMise;
}
var _local3;
var _local5;
_local5 = 0;
_local3 = 1;
while (_local3 <= this["mist" + _local4]) {
if (!_root[(("emisar" + _local4) + "_") + _local3]) {
_local5 = _local3;
break;
}
_local3++;
}
return(_local5);
}
function narviDruzinu(kolik) {
var _local2;
var _local4;
if (cisloMise > 10) {
_local4 = 0;
} else {
_local4 = cisloMise;
}
_root[(("emisar" + _local4) + "_") + 1] = 0;
_root[(("emisar" + _local4) + "_") + 2] = 0;
_root[(("emisar" + _local4) + "_") + 3] = 0;
_local2 = 0;
while (_local2 < _root["druzina" + kolik].length) {
_root[(("emisar" + _local4) + "_") + (_local2 + 1)] = _root["druzina" + kolik][_local2];
_local2++;
}
obsazenych = _root["druzina" + kolik].length;
}
function zobraz() {
var _local2;
var _local3;
butonPrijmi.zobraz();
butonPrijmi2.zobraz();
postupy.gotoAndStop(typPostupu);
_local2 = 1;
while (_local2 <= pocetMisi) {
postupy["mise" + _local2].gotoAndStop(1);
_local2++;
}
postupy["mise" + cisloMise].gotoAndStop(2);
if (kapitola) {
svitek._visible = true;
} else {
svitek._visible = false;
}
postupy.potvoraf1.gotoAndStop("aktivni");
postupy.potvoraf1.fig.gotoAndStop(reprezentant(cisloMise, 2));
postupy.potvoraf1.fig.podst.gotoAndStop(2);
postupy.potvoraf1.pocet = _root.pocetNepratel(_root.kapitola, cisloMise);
postupy.potvoraf1.naMape = true;
var _local4;
_local4 = _root["mapaBojiste" + _root.bitvy[_root.kapitola][cisloMise - 1].bojiste].hlavniTeren;
if (_local4) {
postupy.teren1.gotoAndStop(_local4);
postupy.teren1._visible = true;
} else {
postupy.teren1._visible = false;
}
_local4 = _root.pocetSpojencu(_root.kapitola, cisloMise);
if (!_local4) {
postupy.spojenecf1._visible = false;
} else {
postupy.spojenecf1._visible = true;
postupy.spojenecf1.fig.gotoAndStop(reprezentant(cisloMise, 1));
postupy.spojenecf1.pocet = _local4;
postupy.spojenecf1.naMape = true;
}
if (cisloMise <= 10) {
x = 1;
while (x <= 3) {
postupy["hrdinaf1_" + x].naMape = true;
if (x > obsazenych) {
postupy["hrdinaf1_" + x]._visible = false;
postupy["symbolDruziny1_" + x]._visible = false;
} else {
postupy["hrdinaf1_" + x]._visible = true;
_local3 = _root["druzina" + aktualniDruzina][x - 1];
postupy["hrdinaf1_" + x].krizek.gotoAndStop("zari");
if (_local3 > 0) {
postupy["hrdinaf1_" + x].gotoAndStop("vCili");
postupy["hrdinaf1_" + x].fig.gotoAndStop(_root.typyPotvor[typHrdiny(_root[(("emisar" + cisloMise) + "_") + x])].postava * 2);
} else {
postupy["hrdinaf1_" + x]._visible = false;
postupy["symbolDruziny1_" + x]._visible = false;
}
postupy.zobrazDruziny();
}
x++;
}
}
hrdFigurky.zobraz();
rescue._visible = false;
if (_root.cisloMise <= 10) {
nazevMise = _root[("nazevMise" + _root.kapitola) + _root.cisloMise];
textMise = _root[("textMise" + _root.kapitola) + _root.cisloMise];
cislaMisi = (("Stage " + _root.rimskyCislice[_root.kapitola]) + "\nBattle ") + _root.cisloMise;
if (_root.cisloMise == 1) {
vyhranoText = "";
prohranoText = "";
} else {
vyhranoText = "Won: " + _root.vyhranoBitev;
prohranoText = "Lost: " + ((_root.cisloMise - 1) - _root.vyhranoBitev);
}
} else {
rescue._visible = true;
nazevMise = "Captured!";
textMise = _root.textZajatci;
textObtiznosti = "";
cislaMisi = "";
zobrazZajatce(true);
}
if (!textMise.length) {
nazevMise = _root.nazevMise0;
textMise = _root.textMise0;
}
}
function zobrazZajatce(zobrazovat) {
var _local5;
var _local6;
var _local3;
this.postupy.potvoraf1._visible = zobrazovat;
this.postupy.hrdinaf1_1._visible = zobrazovat;
this.postupy.hrdinaf1_2._visible = zobrazovat;
this.postupy.teren1._visible = zobrazovat;
if (!zobrazovat) {
return(0);
}
_local6 = _root.cisloMise - 10;
_local5 = _root["mapaBojiste" + _root.bitvy[_root.kapitola][_local6 - 1].bojiste].hlavniTeren;
if (_local5) {
postupy.teren1.gotoAndStop(_local5);
postupy.teren1._visible = true;
} else {
postupy.teren1._visible = false;
}
postupy.potvoraf1.gotoAndStop("aktivni");
postupy.potvoraf1.fig.gotoAndStop((_root.typyPotvor[17].postava * 2) - 1);
postupy.potvoraf1.pocet = "";
postupy.potvoraf1.naMape = true;
_local3 = 1;
while (_local3 <= 3) {
postupy["hrdinaf1_" + _local3].naMape = true;
e = _root["emisar0_" + _local3];
postupy["hrdinaf1_" + _local3].krizek._visible = false;
if (e > 0) {
postupy["hrdinaf1_" + _local3].gotoAndStop("vCili");
postupy["hrdinaf1_" + _local3].fig.gotoAndStop(_root.typyPotvor[typHrdiny(_root["emisar0_" + _local3])].postava * 2);
}
_local3++;
}
postupy.zobrazDruziny();
}
function typHrdiny(ind) {
return(_root.hrdinoveTypy[ind]);
}
function reprezentant(mise, strana) {
var _local4 = (2 - strana) * 3;
var _local3 = _root.cisloTridyOddilu(_root.bitvy[kapitola][mise - 1].oddily[_local4].trida);
var _local2 = _root.skupinyPotvor[_local3].leader;
if (!_local2) {
_local2 = _root.skupinyPotvor[_local3].clenove[0];
}
return((_root.typyPotvor[_local2].postava * 2) - (strana - 1));
}
function konecKampane(vysledek) {
_root.gotoAndPlay("menu");
}
function doAkce() {
var _local3;
var _local4;
if (cisloMise > 10) {
_local4 = 0;
} else {
_local4 = cisloMise;
}
_local3 = 1;
while (_local3 <= 3) {
this["hrd" + _local3] = _root["druzina" + aktualniDruzina][_local3 - 1];
_local3++;
}
_root.vyprazdniSkupinu(1);
_root.vyprazdniSkupinu(2);
if (cisloMise <= 10) {
_root.nastavOkolnostiMise(kapitola, cisloMise, hrd1, hrd2, hrd3);
} else {
_root.osvobozuj(hrd1, hrd2);
}
_root.gotoAndPlay("game");
}
function volnychHrdinu() {
var _local2;
var _local3 = 0;
_local2 = 1;
while (_local2 <= _root.HRDINU) {
if (_root[("hrdina" + _local2) + "stav"] == 4) {
_local3++;
}
_local2++;
}
return(_local3);
}
this.onMouseMove = function () {
if (_root.kapitola >= _root.bitvy.length) {
return(0);
}
var _local3;
var _local4;
if (butonPrijmi.hitTest(_root._xmouse, _root._ymouse) || (_root.hlaska._visible)) {
return(0);
}
nad = 0;
_local3 = 1;
while (_local3 <= _root.HRDINU) {
_local4 = hrdFigurky["hrdinaf" + _local3];
if (_root[("hrdina" + _local3) + "stav"] != 4) {
} else if (_local4.hitTest(_root._xmouse, _root._ymouse, true)) {
if ((!nad) || (_local4.getDepth() > hrdFigurky["hrdinaf" + nad].getDepth())) {
nad = _local4.cislo;
}
}
_local3++;
}
var _local5;
if (cisloMise > 10) {
_local5 = 0;
} else {
_local5 = cisloMise;
}
_local3 = 0;
while (_local3 <= this["mist" + _local5]) {
_local4 = postupy["hrdinaf1_" + _local3];
if (_local4.hitTest(_root._xmouse, _root._ymouse, false)) {
if ((!nad) || (_local4.getDepth() > postupy["hrdinaf1_" + nad].getDepth())) {
nad = _root[(("emisar" + _local5) + "_") + _local3];
}
}
_local3++;
}
vysvetli(nad);
};
this.onMouseDown = function () {
if (!myska) {
klik();
}
myska = true;
};
this.onMouseUp = function () {
myska = false;
};
gox0 = -3;
goy0 = 362;
gox1 = 122;
goy1 = 242;
gox2 = 253;
goy2 = 357;
gox3 = 383;
goy3 = 240;
gox4 = 511;
goy4 = 343;
gox5 = 634;
goy5 = 242;
if (((_root.typHudby != 2) && (_root.typHudby != 4)) && (vitezstvi != 2)) {
_root.hudboHraj(2);
}
if (!init()) {
vyhranoBitev = _root.vyhranoBitev;
gotoAndPlay ("zaverKapitoly");
}
if ((_root.cisloMise == 1) && (vitezstvi != -1)) {
gotoAndPlay ("zaverKapitoly");
}
Symbol 1248 MovieClip Frame 2
shrnuti.gotoAndStop(7);
shrnuti.obsah.gotoAndStop(_root.kapitola);
Symbol 1248 MovieClip Frame 3
Symbol 1248 MovieClip Frame 6
narviDruzinu(aktualniDruzina);
zobraz();
if (_root.cisloMise == 1) {
obnovKapitolu();
}
hrdFigurky._visible = false;
if (((_root.cisloMise == 1) && (_root.kapitola == 1)) && (_root.diff > 1)) {
_root.prohlas("strategieHelp2");
}
if (!volnychHrdinu()) {
_root.prohlas("noHero");
}
Instance of Symbol 1214 MovieClip "butonPrijmi" in Symbol 1248 MovieClip Frame 6
onClipEvent (load) {
cislo = 1;
_visible = false;
}
Instance of Symbol 1214 MovieClip "butonPrijmi2" in Symbol 1248 MovieClip Frame 6
onClipEvent (load) {
cislo = 2;
_visible = false;
}
Symbol 1248 MovieClip Frame 7
butonPrijmi.zobraz();
butonPrijmi2.zobraz();
postupy.zobrazDruziny();
Symbol 1248 MovieClip Frame 8
hrdFigurky.zobraz();
Symbol 1248 MovieClip Frame 11
if (_root.hlaska._visible) {
stop();
}
Symbol 1248 MovieClip Frame 15
if ((_root.cisloMise == 1) && (_root.kapitola == 1)) {
napoveda._visible = true;
} else {
napoveda._visible = false;
}
Symbol 1248 MovieClip Frame 17
stop();
Symbol 1248 MovieClip Frame 18
if ((_root.kapitola == 1) || (podminkaPostupu())) {
shrnuti.obsah.gotoAndStop(_root.kapitola);
} else {
shrnuti.obsah.gotoAndStop(6);
}
Symbol 1248 MovieClip Frame 23
vitezstvi = 0;
if (_root.kapitola != 1) {
if (podminkaPostupu()) {
vitezstvi = 1;
if (_root.kapitola >= _root.bitvy.length) {
vitezstvi++;
}
} else {
vitezstvi = -1;
}
}
if (vitezstvi == 2) {
textMise = _root["textMise" + _root.kapitola];
nazevMise = "Final victory";
if (_root.typHudby != 4) {
_root.hudboHraj(4);
}
butonPokracuj.gotoAndStop(2);
} else if (vitezstvi == 1) {
textMise = _root["textMise" + _root.kapitola];
if (_root.kapitola == 1) {
nazevMise = "Stage I started";
} else {
nazevMise = ("Stage " + _root.rimskyCislice[_root.kapitola - 1]) + " completed";
}
} else if (vitezstvi == 0) {
textMise = _root["textMise" + _root.kapitola];
if (_root.kapitola == 1) {
nazevMise = "Stage I";
} else {
nazevMise = ("Stage " + _root.rimskyCislice[_root.kapitola - 1]) + " completed";
}
} else if (vitezstvi == -1) {
nazevMise = "Final defeat";
textMise = _root.textNeuspech;
}
if (_root.kapitola == 1) {
podnazevMise = "";
} else {
podnazevMise = ((vyhranoBitev + " out of ") + _root.bitvy[_root.kapitola - 1].length) + " missions won!";
}
shrnuti.play();
Symbol 1248 MovieClip Frame 30
if (vitezstvi == -1) {
butonPokracuj.gotoAndStop(3);
} else if (vitezstvi == 2) {
butonPokracuj.gotoAndStop(2);
}
Symbol 1248 MovieClip Frame 31
stop();