Frame 1
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;
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);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&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__("16ac5f3c", this, 10301, true);
stop();
myad.loadMovie("http://www.zupagames.com/betas/myadpreloader.swf");
var pctLoaded = 0;
this.onEnterFrame = function () {
pctLoaded = Math.round((this.getBytesLoaded() / this.getBytesTotal()) * 100);
miloader._xscale = pctLoaded;
loadperc.text = pctLoaded + "%";
if (pctLoaded >= 100) {
gotoAndStop (2);
}
};
Frame 2
stop();
var mygame = "";
var newgroundssteel = new Sound();
newgroundssteel.attachSound("newgroundssteel");
newgroundssteel.stop();
newgroundssteel.start(0, 1000);
_root.gotoright._visible = false;
_root.gotoleft._visible = false;
Frame 5
function createbsamurai(tlevel, lado) {
switch (lado) {
case 1 :
var _local4 = -1;
var _local8 = 5;
var _local5 = random(70) + 300;
var _local10 = 1;
var _local9 = 1200;
break;
case 2 :
_local4 = 1;
_local8 = 1;
_local5 = random(70) + 100;
_local10 = -1;
_local9 = -800;
}
var _local7 = random(200) + _local9;
var _local6 = random(100) + 250;
_root.bss = _root.bss + 1;
var _local13 = attachMovie("bsamurai", "bsamurai" + _root.bss, this.getNextHighestDepth(), {_x:_local7, _y:_local6});
_root["bsamurai" + _root.bss]._xscale = 100 * _local4;
_root["bsamurai" + _root.bss].cuad = _local8;
_root["bsamurai" + _root.bss].cuadmax = _root["cuadmax" + _root["bsamurai" + _root.bss].cuad];
_root["bsamurai" + _root.bss].cuadmin = _root["cuadmin" + _root["bsamurai" + _root.bss].cuad];
_root["bcuad" + _root["bsamurai" + _root.bss].cuad] = _root["bcuad" + _root["bsamurai" + _root.bss].cuad] + (_root["bsamurai" + _root.bss]._name + "x");
z = tlevel + 1;
while (z < 6) {
_root["bsamurai" + _root.bss]["nivel" + z]._visible = false;
z++;
}
_root["bsamurai" + _root.bss].ohp = _root.bsupohp[tlevel];
_root["bsamurai" + _root.bss].hp = _root.bsupohp[tlevel];
_root["bsamurai" + _root.bss].armor = _root.bsuparmor[tlevel];
_root["bsamurai" + _root.bss].agility = _root.bsupagility[tlevel];
_root["bsamurai" + _root.bss].strength = _root.bsupstrength[tlevel];
_root["bsamurai" + _root.bss].score = _root.bsupscore[tlevel];
_root["bsamurai" + _root.bss].speed = 3;
_root["bsamurai" + _root.bss].myscale = 100;
_root["bsamurai" + _root.bss].alive = 1;
_root["bsamurai" + _root.bss].aratack = 0;
_root["bsamurai" + _root.bss].myenemy = "";
_root["bsamurai" + _root.bss].tipo = "bsamurai";
_root["bsamurai" + _root.bss].aratacker = "";
_root["bsamurai" + _root.bss].desx = _local5;
_root["bsamurai" + _root.bss].desy = 350;
_root["bsamurai" + _root.bss].gotoAndPlay(14);
_root["bsamurai" + _root.bss].enemy = 0;
_root["bsamurai" + _root.bss].ydir = 1;
_root["bsamurai" + _root.bss].xdir = _local4;
_root["bsamurai" + _root.bss].sinx = _local10;
_root["bsamurai" + _root.bss].cosy = 0;
_root["bsamurai" + _root.bss].alto = 0;
_root["bsamurai" + _root.bss].fight = 0;
}
function createbcaballo(tlevel, lado) {
switch (lado) {
case 1 :
var _local4 = -1;
var _local8 = 5;
var _local5 = random(70) + 300;
var _local10 = 1;
var _local9 = 1200;
break;
case 2 :
_local4 = 1;
_local8 = 0;
_local5 = random(70) + 100;
_local10 = -1;
_local9 = -800;
}
var _local7 = random(200) + _local9;
var _local6 = random(100) + 250;
_root.bhss = _root.bhss + 1;
var _local13 = attachMovie("bcaballo", "bcaballo" + _root.bhss, this.getNextHighestDepth(), {_x:_local7, _y:_local6});
_root["bcaballo" + _root.bhss]._xscale = 100 * _local4;
_root["bcaballo" + _root.bhss].cuad = _local8;
_root["bcaballo" + _root.bhss].cuadmax = _root["cuadmax" + _root["bcaballo" + _root.bhss].cuad];
_root["bcaballo" + _root.bhss].cuadmin = _root["cuadmin" + _root["bcaballo" + _root.bhss].cuad];
_root["bcuad" + _root["bcaballo" + _root.bhss].cuad] = _root["bcuad" + _root["bcaballo" + _root.bhss].cuad] + (_root["bcaballo" + _root.bhss]._name + "x");
z = tlevel + 1;
while (z < 6) {
_root["bcaballo" + _root.bhss]["nivel" + z]._visible = false;
z++;
}
_root["bcaballo" + _root.bhss].ohp = _root.bhsupohp[tlevel];
_root["bcaballo" + _root.bhss].hp = _root.bhsupohp[tlevel];
_root["bcaballo" + _root.bhss].armor = _root.bhsuparmor[tlevel];
_root["bcaballo" + _root.bhss].agility = _root.bhsupagility[tlevel];
_root["bcaballo" + _root.bhss].strength = _root.bhsupstrength[tlevel];
_root["bcaballo" + _root.bhss].score = _root.bhsupscore[tlevel];
_root["bcaballo" + _root.bhss].speed = 4;
_root["bcaballo" + _root.bhss].myscale = 100;
_root["bcaballo" + _root.bhss].alive = 1;
_root["bcaballo" + _root.bhss].aratack = 0;
_root["bcaballo" + _root.bhss].myenemy = "";
_root["bcaballo" + _root.bhss].aratacker = "";
_root["bcaballo" + _root.bhss].tipo = "bhsamurai";
_root["bcaballo" + _root.bhss].desx = _local5;
_root["bcaballo" + _root.bhss].desy = 350;
_root["bcaballo" + _root.bhss].gotoAndPlay(14);
_root["bcaballo" + _root.bhss].enemy = 0;
_root["bcaballo" + _root.bhss].ydir = 1;
_root["bcaballo" + _root.bhss].xdir = _local4;
_root["bcaballo" + _root.bhss].sinx = _local10;
_root["bcaballo" + _root.bhss].cosy = 0;
_root["bcaballo" + _root.bhss].alto = 0;
_root["bcaballo" + _root.bhss].fight = 0;
}
function createbspearman(tlevel, lado) {
switch (lado) {
case 1 :
var _local4 = -1;
var _local8 = 5;
var _local5 = random(70) + 300;
var _local10 = 1;
var _local9 = 1200;
break;
case 2 :
_local4 = 1;
_local8 = 0;
_local5 = random(70) + 100;
_local10 = -1;
_local9 = -800;
}
var _local7 = random(200) + _local9;
var _local6 = random(100) + 250;
_root.bsps = _root.bsps + 1;
var _local13 = attachMovie("bspearman", "bspearman" + _root.bsps, this.getNextHighestDepth(), {_x:_local7, _y:_local6});
_root["bspearman" + _root.bsps]._xscale = 100 * _local4;
_root["bspearman" + _root.bsps].cuad = _local8;
_root["bspearman" + _root.bsps].cuadmax = _root["cuadmax" + _root["bspearman" + _root.bsps].cuad];
_root["bspearman" + _root.bsps].cuadmin = _root["cuadmin" + _root["bspearman" + _root.bsps].cuad];
_root["bcuad" + _root["bspearman" + _root.bsps].cuad] = _root["bcuad" + _root["bspearman" + _root.bsps].cuad] + (_root["bspearman" + _root.bsps]._name + "x");
z = tlevel + 1;
while (z < 6) {
_root["bspearman" + _root.bsps]["nivel" + z]._visible = false;
z++;
}
_root["bspearman" + _root.bsps].ohp = _root.bspupohp[tlevel];
_root["bspearman" + _root.bsps].hp = _root.bspupohp[tlevel];
_root["bspearman" + _root.bsps].armor = _root.bspuparmor[tlevel];
_root["bspearman" + _root.bsps].agility = _root.bspupagility[tlevel];
_root["bspearman" + _root.bsps].strength = _root.bspupstrength[tlevel];
_root["bspearman" + _root.bsps].score = _root.bspupscore[tlevel];
_root["bspearman" + _root.bsps].speed = 3;
_root["bspearman" + _root.bsps].myscale = 100;
_root["bspearman" + _root.bsps].alive = 1;
_root["bspearman" + _root.bsps].aratack = 0;
_root["bspearman" + _root.bsps].myenemy = "";
_root["bspearman" + _root.bsps].aratacker = "";
_root["bspearman" + _root.bsps].tipo = "bspearman";
_root["bspearman" + _root.bsps].desx = _local5;
_root["bspearman" + _root.bsps].desy = 350;
_root["bspearman" + _root.bsps].gotoAndPlay(1);
_root["bspearman" + _root.bsps].enemy = 0;
_root["bspearman" + _root.bsps].ydir = 1;
_root["bspearman" + _root.bsps].xdir = _local4;
_root["bspearman" + _root.bsps].sinx = _local10;
_root["bspearman" + _root.bsps].cosy = 0;
_root["bspearman" + _root.bsps].alto = 0;
_root["bspearman" + _root.bsps].fight = 0;
}
function createbcaballofire(tlevel, lado) {
switch (lado) {
case 1 :
var _local4 = -1;
var _local8 = 5;
var _local5 = random(70) + 300;
var _local10 = 1;
var _local9 = 1200;
break;
case 2 :
_local4 = 1;
_local8 = 0;
_local5 = random(70) + 100;
_local10 = -1;
_local9 = -800;
}
var _local7 = random(200) + _local9;
var _local6 = random(100) + 250;
_root.bcf = _root.bcf + 1;
var _local11 = attachMovie("bcaballofire", "bcfire" + _root.bcf, this.getNextHighestDepth(), {_x:_local7, _y:_local6});
_root["bcfire" + _root.bcf]._xscale = 100 * _local4;
_root["bcfire" + _root.bcf].cuad = _local8;
_root["bcfire" + _root.bcf].cuadmax = _root["cuadmax" + _root["bcfire" + _root.bcf].cuad];
_root["bcfire" + _root.bcf].cuadmin = _root["cuadmin" + _root["bcfire" + _root.bcf].cuad];
_root["bcuad" + _root["bcfire" + _root.bcf].cuad] = _root["bcuad" + _root["bcfire" + _root.bcf].cuad] + (_root["bcfire" + _root.bcf]._name + "x");
z = tlevel + 1;
while (z < 6) {
_root["bcfire" + _root.bcf]["nivel" + z]._visible = false;
z++;
}
_root["bcfire" + _root.bcf].ohp = _root.bhsupohp[tlevel];
_root["bcfire" + _root.bcf].hp = _root.bhsupohp[tlevel];
_root["bcfire" + _root.bcf].armor = _root.bhsuparmor[tlevel];
_root["bcfire" + _root.bcf].agility = _root.bhsupagility[tlevel];
_root["bcfire" + _root.bcf].strength = _root.bhsupstrength[tlevel];
_root["bcfire" + _root.bcf].score = _root.bhsupscore[tlevel];
_root["bcfire" + _root.bcf].speed = 4;
_root["bcfire" + _root.bcf].myscale = 100;
_root["bcfire" + _root.bcf].alive = 1;
_root["bcfire" + _root.bcf].aratack = 0;
_root["bcfire" + _root.bcf].myenemy = "";
_root["bcfire" + _root.bcf].tipo = "bcaballofire";
_root["bcfire" + _root.bcf].myfire = 0;
_root["bcfire" + _root.bcf].mytower = "";
_root["bcfire" + _root.bcf].desx = _local5;
_root["bcfire" + _root.bcf].desy = 350;
_root["bcfire" + _root.bcf].gotoAndPlay(1);
_root["bcfire" + _root.bcf].enemy = 0;
_root["bcfire" + _root.bcf].ydir = 1;
_root["bcfire" + _root.bcf].xdir = _local4;
_root["bcfire" + _root.bcf].sinx = _local10;
_root["bcfire" + _root.bcf].cosy = 0;
_root["bcfire" + _root.bcf].alto = 0;
_root["bcfire" + _root.bcf].fight = 0;
}
function createbarcher(tlevel, lado) {
switch (lado) {
case 1 :
var _local4 = -1;
var _local8 = 5;
var _local5 = random(70) + 300;
var _local10 = 1;
var _local9 = 1200;
break;
case 2 :
_local4 = 1;
_local8 = 0;
_local5 = random(70) + 100;
_local10 = -1;
_local9 = -800;
}
var _local7 = random(200) + _local9;
var _local6 = random(100) + 250;
_root.bac = _root.bac + 1;
var _local13 = attachMovie("barcher", "barcher" + _root.bac, this.getNextHighestDepth(), {_x:_local7, _y:_local6});
_root["barcher" + _root.bac]._xscale = 100 * _local4;
_root["barcher" + _root.bac].cuad = _local8;
_root["barcher" + _root.bac].cuadmax = _root["cuadmax" + _root["barcher" + _root.bac].cuad];
_root["barcher" + _root.bac].cuadmin = _root["cuadmin" + _root["barcher" + _root.bac].cuad];
_root["bcuad" + _root["barcher" + _root.bac].cuad] = _root["bcuad" + _root["barcher" + _root.bac].cuad] + (_root["barcher" + _root.bac]._name + "x");
z = tlevel + 1;
while (z < 6) {
_root["barcher" + _root.bac]["nivel" + z]._visible = false;
z++;
}
_root["barcher" + _root.bac].ohp = _root.barupohp[tlevel];
_root["barcher" + _root.bac].hp = _root.barupohp[tlevel];
_root["barcher" + _root.bac].armor = _root.baruparmor[tlevel];
_root["barcher" + _root.bac].agility = _root.barupagility[tlevel];
_root["barcher" + _root.bac].strength = _root.barupstrength[tlevel];
_root["barcher" + _root.bac].score = _root.barupscore[tlevel];
_root["barcher" + _root.bac].speed = 3;
_root["barcher" + _root.bac].myscale = 100;
_root["barcher" + _root.bac].alive = 1;
_root["barcher" + _root.bac].aratack = 0;
_root["barcher" + _root.bac].estaronda = 0;
_root["barcher" + _root.bac].myenemy = "";
_root["barcher" + _root.bac].tipo = "barcher";
_root["barcher" + _root.bac].desx = _local5;
_root["barcher" + _root.bac].desy = 350;
_root["barcher" + _root.bac].gotoAndPlay(25);
_root["barcher" + _root.bac].enemy = 0;
_root["barcher" + _root.bac].ydir = 1;
_root["barcher" + _root.bac].xdir = _local4;
_root["barcher" + _root.bac].sinx = _local10;
_root["barcher" + _root.bac].mydir = -1;
_root["barcher" + _root.bac].cosy = 0;
_root["barcher" + _root.bac].alto = 0;
_root["barcher" + _root.bac].fight = 0;
}
function createsamurai() {
_root.sn = _root.sn + 1;
proximoy = 20000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
var _local6 = _root.attachMovie("samurai", "samurai" + _root.sn, proximoy, {_x:random(550) + 80, _y:random(175) + 175});
_root["samurai" + _root.sn].armor = _root.basicarmor;
_root["samurai" + _root.sn].agility = _root.sagility;
_root["samurai" + _root.sn].strength = _root.sstrength;
_root["samurai" + _root.sn].myenemy = "";
_root["samurai" + _root.sn].tipo = "samurai";
_root["samurai" + _root.sn].alive = 1;
_root["samurai" + _root.sn].cuad = 3;
_root["samurai" + _root.sn].aratacker = "";
_root["samurai" + _root.sn].enemy = 0;
_root["samurai" + _root.sn].ohp = 10;
_root["samurai" + _root.sn].hp = 10;
_root["samurai" + _root.sn].rank = 1;
_root["samurai" + _root.sn].esteup = 0;
_root["samurai" + _root.sn].upgrading = 0;
_root["samurai" + _root.sn].nivel1._visible = true;
_root["samurai" + _root.sn].nivel2._visible = false;
_root["samurai" + _root.sn].nivel3._visible = false;
_root["samurai" + _root.sn].nivel4._visible = false;
_root["samurai" + _root.sn].nivel5._visible = false;
_root["samurai" + _root.sn].cuadmax = _root["cuadmax" + _root["samurai" + _root.sn].cuad];
_root["samurai" + _root.sn].cuadmin = _root["cuadmin" + _root["samurai" + _root.sn].cuad];
_root["scuad" + _root["samurai" + _root.sn].cuad] = _root["scuad" + _root["samurai" + _root.sn].cuad] + (_root["samurai" + _root.sn]._name + "x");
_root["samurai" + _root.sn].infirmary = 0;
_root["samurai" + _root.sn].eninfirmary = 0;
_root["samurai" + _root.sn].potential = "";
_root["samurai" + _root.sn].escapemio = 0;
_root["samurai" + _root.sn].aratack = 0;
_root["samurai" + _root.sn].samuraicuadro._visible = false;
_root.lossamurais.push("samurai" + _root.sn);
_root["samurai" + _root.sn].speed = 3;
_root["samurai" + _root.sn].myscale = 100;
_root["samurai" + _root.sn].desx = _root["samurai" + _root.sn]._x;
_root["samurai" + _root.sn].desy = _root["samurai" + _root.sn]._y;
_root["samurai" + _root.sn].gotoAndPlay(73);
_root[("samurai" + _root.sn) + "maxarray"] = new Array();
_root[("samurai" + _root.sn) + "minarray"] = new Array();
_local6.onLoad = function () {
this.desx = _root["samurai" + _root.sn]._x;
this.desy = _root["samurai" + _root.sn]._y;
};
_local6.onEnterFrame = function () {
if (this.upgrading == 1) {
this.esteup = this.esteup + 1;
if ((this.esteup == 48) and (this.alive == 1)) {
this.rank = this.rank + 1;
this.strength = this.strength + _root.supstrength[this.rank];
this.ohp = this.ohp + _root.supohp[this.rank];
this.hp = this.ohp;
this.myhealth._xscale = 100;
this.agility = this.agility + _root.supagility[this.rank];
this.armor = this.armor + _root.suparmor[this.rank];
this["nivel" + this.rank]._visible = true;
this.upgrading = 0;
this.esteup = 0;
}
}
};
_local6.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
this.gotoAndPlay(14);
if (_root.select.length > 0) {
var _local3 = 0;
var _local4 = 0;
for (var _local5 in _root.select) {
_local3 = _local3 + _root[_root.select[_local5]]._x;
_local4 = _local4 + _root[_root.select[_local5]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local3 / _root.select.length;
_root.promedioy = _local4 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "samuraipanel";
_root.samuraipanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
function createhorsesamurai() {
_root.hsn = _root.hsn + 1;
proximoy = 20000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
var _local6 = _root.attachMovie("caballo", "caballo" + _root.hsn, proximoy, {_x:random(550) + 80, _y:random(175) + 175});
_root["caballo" + _root.hsn]._yscale = 100;
_root["caballo" + _root.hsn].armor = _root.basicarmor;
_root["caballo" + _root.hsn].agility = _root.sagility;
_root["caballo" + _root.hsn].strength = _root.hsstrength;
_root["caballo" + _root.hsn].myenemy = "";
_root["caballo" + _root.hsn].tipo = "hsamurai";
_root["caballo" + _root.hsn].alive = 1;
_root["caballo" + _root.hsn].enemy = 0;
_root["caballo" + _root.hsn].aratacker = "";
_root["caballo" + _root.hsn].cuad = 3;
_root["caballo" + _root.hsn].ohp = 10;
_root["caballo" + _root.hsn].hp = 10;
_root["caballo" + _root.hsn].rank = 1;
_root["caballo" + _root.hsn].aratack = 1;
_root["caballo" + _root.hsn].potential = "";
_root["caballo" + _root.hsn].esteup = 0;
_root["caballo" + _root.hsn].upgrading = 0;
_root["caballo" + _root.hsn].nivel1._visible = true;
_root["caballo" + _root.hsn].nivel2._visible = false;
_root["caballo" + _root.hsn].nivel3._visible = false;
_root["caballo" + _root.hsn].nivel4._visible = false;
_root["caballo" + _root.hsn].nivel5._visible = false;
_root["caballo" + _root.hsn].cuadmax = _root["cuadmax" + _root["caballo" + _root.hsn].cuad];
_root["caballo" + _root.hsn].cuadmin = _root["cuadmin" + _root["caballo" + _root.hsn].cuad];
_root["scuad" + _root["caballo" + _root.hsn].cuad] = _root["scuad" + _root["caballo" + _root.hsn].cuad] + (_root["caballo" + _root.hsn]._name + "x");
_root["caballo" + _root.hsn].infirmary = 0;
_root["caballo" + _root.hsn].eninfirmary = 0;
_root["caballo" + _root.hsn].escapemio = 0;
_root["caballo" + _root.hsn].samuraicuadro._visible = false;
_root.lossamurais.push("caballo" + _root.hsn);
_root["caballo" + _root.hsn].speed = 4;
_root["caballo" + _root.hsn].myscale = 100;
_root["caballo" + _root.hsn].desx = _root["caballo" + _root.hsn]._x;
_root["caballo" + _root.hsn].desy = _root["caballo" + _root.hsn]._y;
_root["caballo" + _root.hsn].gotoAndPlay(37);
_local6.onLoad = function () {
this.desx = _root["caballo" + _root.hsn]._x;
this.desy = _root["caballo" + _root.hsn]._y;
};
_local6.onEnterFrame = function () {
if (this.upgrading == 1) {
this.esteup = this.esteup + 1;
if ((this.esteup == 48) and (this.alive == 1)) {
this.rank = this.rank + 1;
this.strength = this.strength + _root.hsupstrength[this.rank];
this.ohp = this.ohp + _root.hsupohp[this.rank];
this.hp = this.ohp;
this.myhealth._xscale = 100;
this.agility = this.agility + _root.hsupagility[this.rank];
this.armor = this.armor + _root.hsuparmor[this.rank];
this["nivel" + this.rank]._visible = true;
this.upgrading = 0;
this.esteup = 0;
}
}
};
_local6.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
this.gotoAndPlay(14);
if (_root.select.length > 0) {
var _local3 = 0;
var _local4 = 0;
for (var _local5 in _root.select) {
_local3 = _local3 + _root[_root.select[_local5]]._x;
_local4 = _local4 + _root[_root.select[_local5]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local3 / _root.select.length;
_root.promedioy = _local4 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "caballopanel";
_root.caballopanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
function createspearman() {
_root.spn = _root.spn + 1;
proximoy = 20000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
var _local6 = _root.attachMovie("spearman", "spearman" + _root.spn, proximoy, {_x:random(550) + 80, _y:random(175) + 175});
_root["spearman" + _root.spn].armor = _root.basicarmor;
_root["spearman" + _root.spn].agility = _root.sagility;
_root["spearman" + _root.spn].strength = _root.spstrength;
_root["spearman" + _root.spn].myenemy = "";
_root["spearman" + _root.spn].tipo = "spearman";
_root["spearman" + _root.spn].alive = 1;
_root["spearman" + _root.spn].enemy = 0;
_root["spearman" + _root.spn].cuad = 3;
_root["spearman" + _root.spn].aratacker = "";
_root["spearman" + _root.spn].ohp = 10;
_root["spearman" + _root.spn].hp = 10;
_root["spearman" + _root.spn].rank = 1;
_root["spearman" + _root.spn].esteup = 0;
_root["spearman" + _root.spn].upgrading = 0;
_root["spearman" + _root.spn].nivel1._visible = true;
_root["spearman" + _root.spn].nivel2._visible = false;
_root["spearman" + _root.spn].nivel3._visible = false;
_root["spearman" + _root.spn].nivel4._visible = false;
_root["spearman" + _root.spn].nivel5._visible = false;
_root["spearman" + _root.spn].cuadmax = _root["cuadmax" + _root["spearman" + _root.spn].cuad];
_root["spearman" + _root.spn].cuadmin = _root["cuadmin" + _root["spearman" + _root.spn].cuad];
_root["scuad" + _root["spearman" + _root.spn].cuad] = _root["scuad" + _root["spearman" + _root.spn].cuad] + (_root["spearman" + _root.spn]._name + "x");
_root["spearman" + _root.spn].infirmary = 0;
_root["spearman" + _root.spn].eninfirmary = 0;
_root["spearman" + _root.spn].escapemio = 0;
_root["spearman" + _root.spn].potential = "";
_root["spearman" + _root.spn].aratack = 0;
_root["spearman" + _root.spn].samuraicuadro._visible = false;
_root.lossamurais.push("spearman" + _root.spn);
_root["spearman" + _root.spn].speed = 3;
_root["spearman" + _root.spn].myscale = 100;
_root["spearman" + _root.spn].desx = _root["spearman" + _root.spn]._x;
_root["spearman" + _root.spn].desy = _root["spearman" + _root.spn]._y;
_root["spearman" + _root.spn].gotoAndPlay(46);
_root[("spearman" + _root.spn) + "maxarray"] = new Array();
_root[("spearman" + _root.spn) + "minarray"] = new Array();
_local6.onLoad = function () {
this.desx = _root["spearman" + _root.spn]._x;
this.desy = _root["spearman" + _root.spn]._y;
};
_local6.onEnterFrame = function () {
if (this.upgrading == 1) {
this.esteup = this.esteup + 1;
if ((this.esteup == 48) and (this.alive == 1)) {
this.rank = this.rank + 1;
this.strength = this.strength + _root.spupstrength[this.rank];
this.ohp = this.ohp + _root.spupohp[this.rank];
this.hp = this.ohp;
this.myhealth._xscale = 100;
this.agility = this.agility + _root.spupagility[this.rank];
this.armor = this.armor + _root.spuparmor[this.rank];
this["nivel" + this.rank]._visible = true;
this.upgrading = 0;
this.esteup = 0;
}
}
};
_local6.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
this.gotoAndPlay(1);
if (_root.select.length > 0) {
var _local3 = 0;
var _local4 = 0;
for (var _local5 in _root.select) {
_local3 = _local3 + _root[_root.select[_local5]]._x;
_local4 = _local4 + _root[_root.select[_local5]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local3 / _root.select.length;
_root.promedioy = _local4 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "spearmanpanel";
_root.spearmanpanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
function createvillager() {
_root.vn = _root.vn + 1;
proximoy = 20000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
var _local6 = _root.attachMovie("villager", "villager" + _root.vn, proximoy, {_x:random(550) + 80, _y:random(175) + 175});
_root["villager" + _root.vn].myenemy = "";
_root["villager" + _root.vn].alive = 1;
_root["villager" + _root.vn].cuad = 3;
_root["villager" + _root.vn].ohp = 10;
_root["villager" + _root.vn].hp = 10;
_root["villager" + _root.vn].rank = 1;
_root["villager" + _root.vn].cuadmax = _root["cuadmax" + _root["villager" + _root.vn].cuad];
_root["villager" + _root.vn].cuadmin = _root["cuadmin" + _root["villager" + _root.vn].cuad];
_root["scuad" + _root["villager" + _root.vn].cuad] = _root["scuad" + _root["villager" + _root.vn].cuad] + (_root["villager" + _root.vn]._name + "x");
_root["villager" + _root.vn].infirmary = 0;
_root["villager" + _root.vn].eninfirmary = 0;
_root["villager" + _root.vn].escapemio = 0;
_root["villager" + _root.vn].samuraicuadro._visible = false;
_root.lossamurais.push("villager" + _root.vn);
_root["villager" + _root.vn].speed = 2;
_root["villager" + _root.vn].tipo = "villager";
_root["villager" + _root.vn].myfire = "";
_root["villager" + _root.vn].mytower = "";
_root["villager" + _root.vn].building = 0;
_root["villager" + _root.vn].aratack = 0;
_root["villager" + _root.vn].buildseq = -1;
_root["villager" + _root.vn].myscale = 100;
_root["villager" + _root.vn].desx = _root["villager" + _root.vn]._x;
_root["villager" + _root.vn].desy = _root["villager" + _root.vn]._y;
_root["villager" + _root.vn].gotoAndPlay(55);
_root[("villager" + _root.vn) + "maxarray"] = new Array();
_root[("villager" + _root.vn) + "minarray"] = new Array();
_local6.onLoad = function () {
this.desx = _root["villager" + _root.vn]._x;
this.desy = _root["villager" + _root.vn]._y;
};
_local6.onEnterFrame = function () {
};
_local6.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
this.gotoAndPlay(24);
if (_root.select.length > 0) {
var _local3 = 0;
var _local4 = 0;
for (var _local5 in _root.select) {
_local3 = _local3 + _root[_root.select[_local5]]._x;
_local4 = _local4 + _root[_root.select[_local5]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local3 / _root.select.length;
_root.promedioy = _local4 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "villagerpanel";
_root.villagerpanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
function createarcher() {
_root.arn = _root.arn + 1;
proximoy = 20000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
var _local7 = _root.attachMovie("archer", "archer" + _root.arn, proximoy, {_x:random(550) + 80, _y:random(175) + 175});
_root["archer" + _root.arn]._xscale = 100;
_root["archer" + _root.arn].armor = _root.basicarmor;
_root["archer" + _root.arn].agility = _root.sagility;
_root["archer" + _root.arn].strength = _root.arstrength;
_root["archer" + _root.arn].myenemy = "";
_root["archer" + _root.arn].tipo = "archer";
_root["archer" + _root.arn].enemy = 0;
_root["archer" + _root.arn].alive = 1;
_root["archer" + _root.arn].cuad = 3;
_root["archer" + _root.arn].estaronda = 0;
_root["archer" + _root.arn].goingup = 0;
_root["archer" + _root.arn].ohp = 10;
_root["archer" + _root.arn].hp = 10;
_root["archer" + _root.arn].rank = 1;
_root["archer" + _root.arn].step = 0;
_root["archer" + _root.arn].esteup = 0;
_root["archer" + _root.arn].intower = 0;
_root["archer" + _root.arn].upgrading = 0;
_root["archer" + _root.arn].nivel1._visible = true;
_root["archer" + _root.arn].nivel2._visible = false;
_root["archer" + _root.arn].nivel3._visible = false;
_root["archer" + _root.arn].nivel4._visible = false;
_root["archer" + _root.arn].nivel5._visible = false;
_root["archer" + _root.arn].cuadmax = _root["cuadmax" + _root["archer" + _root.arn].cuad];
_root["archer" + _root.arn].cuadmin = _root["cuadmin" + _root["archer" + _root.arn].cuad];
_root["scuad" + _root["archer" + _root.arn].cuad] = _root["scuad" + _root["archer" + _root.arn].cuad] + (_root["archer" + _root.arn]._name + "x");
_root["archer" + _root.arn].infirmary = 0;
_root["archer" + _root.arn].eninfirmary = 0;
_root["archer" + _root.arn].escapemio = 0;
_root["archer" + _root.arn].aratack = 0;
_root["archer" + _root.arn].mytower = "";
_root["archer" + _root.arn].samuraicuadro._visible = false;
_root.lossamurais.push("archer" + _root.arn);
_root["archer" + _root.arn].speed = 3;
_root["archer" + _root.arn].myscale = 100;
_root["archer" + _root.arn].desx = _root["archer" + _root.arn]._x;
_root["archer" + _root.arn].desy = _root["archer" + _root.arn]._y;
_root["archer" + _root.arn].gotoAndPlay(73);
_root[("archer" + _root.arn) + "maxarray"] = new Array();
_root[("archer" + _root.arn) + "minarray"] = new Array();
_local7.onLoad = function () {
this.desx = _root["archer" + _root.arn]._x;
this.desy = _root["archer" + _root.arn]._y;
};
_local7.onEnterFrame = function () {
if (this.upgrading == 1) {
this.esteup = this.esteup + 1;
if ((this.esteup == 48) and (this.alive == 1)) {
this.rank = this.rank + 1;
this.strength = this.strength + _root.arupstrength[this.rank];
this.ohp = this.ohp + _root.arupohp[this.rank];
this.hp = this.ohp;
this.myhealth._xscale = 100;
this.agility = this.agility + _root.arupagility[this.rank];
this.armor = this.armor + _root.aruparmor[this.rank];
this["nivel" + this.rank]._visible = true;
this.upgrading = 0;
this.esteup = 0;
}
}
};
_local7.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
this.goingup = 0;
if (this.intower == 0) {
var _local3 = -1;
while (_local3++ , _local3 < _root.towern) {
if (_root["tower" + _local3].hitTest(_root._xmouse, _root._ymouse, true)) {
if (((_root["tower" + _local3]._currentframe > 11) and (_root["tower" + _local3]._currentframe < 24)) and (_root["tower" + _local3].myarcher == "")) {
this.mytower = _root["tower" + _local3]._name;
this.goingup = 1;
_root["tower" + _local3].myarcher = this._name;
}
}
}
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
if (this.intower == 1) {
_root[this.mytower].myarcher = "";
this.mytower = "";
this._x = this._x + -25;
this._y = this._y + 15;
this.gotoAndPlay(75);
} else {
this.gotoAndPlay(25);
}
if (_root.select.length > 0) {
var _local4 = 0;
var _local5 = 0;
for (var _local6 in _root.select) {
_local4 = _local4 + _root[_root.select[_local6]]._x;
_local5 = _local5 + _root[_root.select[_local6]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local4 / _root.select.length;
_root.promedioy = _local5 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.mytower != "") {
this.desx = _root[this.mytower]._x + 105;
this.desy = _root[this.mytower]._y + 50;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "archerpanel";
_root.archerpanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
var sn = 0;
var arn = 0;
var spn = 0;
var hsn = 0;
var vn = 0;
var bss = 0;
var bsps = 0;
var bhss = 0;
var bac = 0;
var bsps = 0;
var bcf = 0;
var arrown = 0;
var towern = 0;
var pausa = 0;
var score = 0;
var musicapau = 0;
var atnivel = 0;
var sendcount = 0;
var thissend = 0;
var gameover = 0;
var gold = 1000;
var creaque = new Array();
var select = new Array();
var lossamurais = new Array();
var promediox = 0;
var promedioy = 0;
var calidad = "h";
var goldstep = 0;
var goldspeed = 1;
var grupo = "no";
var selecarea = "";
var basicarmor = 1;
var sstrength = 2;
var spstrength = 2;
var hsstrength = 2;
var arstrength = 1;
var sagility = 5;
var cuadmin0 = -2000;
var cuadmin1 = -550;
var cuadmin2 = -150;
var cuadmin3 = 0;
var cuadmin4 = 600;
var cuadmin5 = 850;
var cuadmin6 = 1150;
var cuadmax0 = -550;
var cuadmax1 = -150;
var cuadmax2 = 0;
var cuadmax3 = 600;
var cuadmax4 = 850;
var cuadmax5 = 1150;
var cuadmax6 = 2150;
var blood2 = 0;
i = 1;
while (i < 6) {
_root["scuad" + i] = "";
_root["bcuad" + i] = "";
i++;
}
switch (mygame) {
case "easy" :
var atcco = new Array(360, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600);
var sendsamurai = new Array(3, 3, 3, 2, 2, 1, 2, 3, 2, 3, 3, 4, 3, 3, 4, 5, 4, 4, 6, 6, 5, 6, 7, 7, 6, 8, 8, 3, 10, 12, 10, 9, 6, 10, 6);
var sendsamuraihard = new Array(1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
var elfin = 51;
var elplus = 3;
var clados = 1;
var harddivider = 4;
break;
case "medium" :
var atcco = new Array(360, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600);
var sendsamurai = new Array(3, 3, 3, 2, 2, 1, 2, 3, 2, 3, 3, 4, 3, 3, 4, 5, 4, 4, 6, 6, 5, 6, 7, 7, 6, 8, 8, 3, 10, 12, 10, 9, 6, 10, 6);
var sendsamuraihard = new Array(1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
var elfin = 51;
var elplus = 3;
var clados = 2;
var harddivider = 3;
break;
case "hard" :
var atcco = new Array(360, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480);
var sendsamurai = new Array(3, 3, 3, 2, 2, 1, 2, 3, 2, 3, 3, 4, 3, 3, 4, 5, 4, 4, 6, 6, 5, 6, 7, 7, 6, 8, 8, 3, 10, 12, 10, 9, 6, 10, 6);
var sendsamuraihard = new Array(1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
var elfin = 51;
var elplus = 3;
var clados = 2;
var harddivider = 3;
break;
case "mayhem" :
var atcco = new Array(1080, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480);
var sendsamurai = new Array(3, 3, 3, 2, 2, 1, 2, 3, 2, 3, 3, 4, 3, 3, 4, 5, 4, 4, 6, 6, 5, 6, 7, 7, 6, 8, 8, 3, 10, 12, 10, 9, 6, 10, 6);
var sendsamuraihard = new Array(5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
var elfin = 11;
var elplus = 20;
var clados = 2;
var harddivider = 3;
_root.gold = 10000;
var gm = 0;
while (gm <= 6) {
createsamurai();
createarcher();
createhorsesamurai();
createspearman();
gm++;
}
createvillager();
createvillager();
createvillager();
}
var spanelshow = "";
var elpanel = "castlepanel";
var flecha = new Sound();
flecha.attachSound("flecha");
flecha.setVolume(80);
var horse3a = new Sound();
horse3a.attachSound("horse3a");
var horse3 = new Sound();
horse3.attachSound("horse3");
var sword1 = new Sound();
sword1.attachSound("sword1");
sword1.setVolume(75);
var sword2 = new Sound();
sword2.attachSound("sword2");
sword2.setVolume(75);
var sword3 = new Sound();
sword3.attachSound("sword3");
var hai1 = new Sound();
hai1.attachSound("hai4");
var arg = new Sound();
arg.attachSound("arg");
var martillo = new Sound();
martillo.attachSound("martillo");
var towerfall = new Sound();
towerfall.attachSound("towerfall");
var towerfall2 = new Sound();
towerfall2.attachSound("towerfall2");
var castlefall = new Sound();
castlefall.attachSound("castlefall");
var bluefire = new Sound();
bluefire.attachSound("bluefire");
newgroundssteel.stop();
bluefire.start(2, 1000);
var infirmarylevel = 1;
var infirmaryupgrading = 0;
var infirmaryplus = [0, 0, 1, 1];
var infirmarycost = [0, 0, 500, 1000];
var tabernlevel = 1;
var tabernupgrading = 0;
var tabernplus = [0, 0, 1, 3];
var taberncost = [0, 0, 1000, 2000];
var tbesteup = 0;
var armorlevel = 1;
var armorupgrading = 0;
var armorplus = [0, 0, 1, 1, 1, 2];
var armorcost = [0, 0, 250, 700, 1200, 1700];
var aresteup = 0;
var weaponslevel = 1;
var weaponsupgrading = 0;
var weaponsplus = [0, 0, 2, 2, 2, 6];
var weaponscost = [0, 0, 500, 1000, 1500, 2500];
var weesteup = 0;
var supstrength = [0, 0, 2, 2, 2, 5];
var supohp = [0, 0, 10, 10, 10, 30];
var supagility = [0, 0, 1, 1, 1, 1.5];
var suparmor = [0, 0, 1, 1, 1, 3];
var supcost = [0, 50, 100, 150, 200, 300];
var hsupstrength = [0, 0, 3, 3, 3, 6];
var hsupohp = [0, 0, 15, 15, 15, 30];
var hsupagility = [0, 0, 1, 1, 1, 1.5];
var hsuparmor = [0, 0, 1, 1, 1, 3];
var hsupcost = [0, 70, 150, 300, 450, 700];
var spupstrength = [0, 0, 2, 2, 2, 5];
var spupohp = [0, 0, 10, 10, 10, 30];
var spupagility = [0, 0, 1, 1, 1, 1.5];
var spuparmor = [0, 0, 1, 1, 1, 3];
var spupcost = [0, 50, 100, 150, 200, 300];
var arupstrength = [0, 0, 1, 1, 1, 4];
var arupohp = [0, 0, 10, 10, 10, 30];
var arupagility = [0, 0, 1, 1, 1, 1.5];
var aruparmor = [0, 0, 1, 1, 1, 3];
var arupcost = [0, 50, 100, 150, 200, 300];
var bsupstrength = [0, 2, 4, 6, 8, 13];
var bsupohp = [0, 10, 20, 30, 40, 70];
var bsupagility = [0, 5, 6, 7, 8, 9.5];
var bsuparmor = [0, 1, 2, 3, 4, 7];
var bsupscore = [0, 30, 80, 180, 330, 530];
var bhsupstrength = [0, 3, 6, 9, 12, 18];
var bhsupohp = [0, 15, 30, 45, 60, 90];
var bhsupagility = [0, 5, 6, 7, 8, 9.5];
var bhsuparmor = [0, 1, 2, 3, 4, 7];
var bhsupscore = [0, 50, 120, 270, 370, 820];
var bspupstrength = [0, 2, 4, 6, 8, 13];
var bspupohp = [0, 10, 20, 30, 40, 70];
var bspupagility = [0, 5, 6, 7, 8, 9.5];
var bspuparmor = [0, 1, 2, 3, 4, 7];
var bspupscore = [0, 30, 80, 180, 330, 530];
var barupstrength = [0, 1, 2, 3, 4, 8];
var barupohp = [0, 10, 20, 30, 40, 70];
var barupagility = [0, 5, 6, 7, 8, 9.5];
var baruparmor = [0, 1, 2, 3, 4, 7];
var barupscore = [0, 30, 80, 180, 330, 530];
_root.inesteup = 0;
_root.castillo.fire = 0;
_root.castillo.ronda = 0;
_root.castillo.hp = 1000;
_root.castlepanel.creating = 0;
_root.castlepanel.esteup = 0;
_root.castlepanel.createwhat = "";
_root.castlepanel.creatorbar._visible = false;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if ((Key.getCode() == 37) or (Key.getCode() == 65)) {
if (_root._x < 510) {
_root._x = _root._x + 10;
_root.castlepanel._x = _root.castlepanel._x + -10;
_root.infirmarypanel._x = _root.infirmarypanel._x + -10;
_root.samuraipanel._x = _root.samuraipanel._x + -10;
_root.normalpanel._x = _root.normalpanel._x + -10;
_root.caballopanel._x = _root.caballopanel._x + -10;
_root.spearmanpanel._x = _root.spearmanpanel._x + -10;
_root.villagerpanel._x = _root.villagerpanel._x + -10;
_root.archerpanel._x = _root.archerpanel._x + -10;
_root.tabernpanel._x = _root.tabernpanel._x + -10;
_root.blacksmithpanel._x = _root.blacksmithpanel._x + -10;
_root.gotoright._x = _root.gotoright._x + -10;
_root.gotoleft._x = _root.gotoleft._x + -10;
_root.mimenu._x = _root.mimenu._x + -10;
_root.yesno._x = _root.yesno._x + -10;
}
}
if ((Key.getCode() == 39) or (Key.getCode() == 83)) {
if (_root._x > -320) {
_root._x = _root._x + -10;
_root.castlepanel._x = _root.castlepanel._x + 10;
_root.infirmarypanel._x = _root.infirmarypanel._x + 10;
_root.samuraipanel._x = _root.samuraipanel._x + 10;
_root.normalpanel._x = _root.normalpanel._x + 10;
_root.caballopanel._x = _root.caballopanel._x + 10;
_root.spearmanpanel._x = _root.spearmanpanel._x + 10;
_root.villagerpanel._x = _root.villagerpanel._x + 10;
_root.archerpanel._x = _root.archerpanel._x + 10;
_root.tabernpanel._x = _root.tabernpanel._x + 10;
_root.blacksmithpanel._x = _root.blacksmithpanel._x + 10;
_root.gotoright._x = _root.gotoright._x + 10;
_root.gotoleft._x = _root.gotoleft._x + 10;
_root.mimenu._x = _root.mimenu._x + 10;
_root.yesno._x = _root.yesno._x + 10;
}
}
if (Key.getCode() == 81) {
switch (calidad) {
case "h" :
_quality = "MEDIUM";
calidad = "m";
break;
case "m" :
_quality = "HIGH";
calidad = "h";
}
}
};
Key.addListener(keyListener);
this.onEnterFrame = function () {
if (_root.pausa == 0) {
_root.goldstep = _root.goldstep + 1;
if (_root.goldstep == 24) {
_root.gold = _root.gold + (10 * _root.goldspeed);
_root.goldstep = 0;
}
sendcount = sendcount + 1;
if ((sendcount >= atcco[atnivel]) and (_root.gameover == 0)) {
if (atnivel >= elfin) {
var _local3 = 0;
var _local4 = 0;
i = 0;
while (i < (_root.bss + 1)) {
if (_root["bsamurai" + i].alive == 1) {
_local3 = _local3 + 1;
}
i++;
}
i = 0;
while (i < (_root.bhss + 1)) {
if (_root["bcaballo" + i].alive == 1) {
_local3 = _local3 + 1;
}
i++;
}
i = 0;
while (i < (_root.bsps + 1)) {
if (_root["bspearman" + i].alive == 1) {
_local3 = _local3 + 1;
}
i++;
}
i = 0;
while (i < (_root.bac + 1)) {
if (_root["barcher" + i].alive == 1) {
_local3 = _local3 + 1;
}
i++;
}
i = 0;
while (i < (_root.bcf + 1)) {
if (_root["bcfire" + i].alive == 1) {
_local3 = _local3 + 1;
_local4 = _local4 + 1;
}
i++;
}
if ((_local3 == 0) or ((_local3 < 5) and (_local4 == 0))) {
gotoAndStop (11);
}
} else {
thissend = 0;
var _local6 = attachMovie("gotoright", "gotoright", this.getNextHighestDepth(), {_x:_root.castlepanel._x + 550, _y:75});
_root.gotoright.stepo = 0;
_local6.onEnterFrame = function () {
this.stepo = this.stepo + 1;
if (this.stepo >= 150) {
this.removeMovieClip();
}
};
if (clados == 2) {
var _local5 = attachMovie("gotoleft", "gotoleft", this.getNextHighestDepth(), {_x:_root.castlepanel._x + 25, _y:75});
_root.gotoleft.stepo = 0;
_local5.onEnterFrame = function () {
this.stepo = this.stepo + 1;
if (this.stepo >= 150) {
this.removeMovieClip();
}
};
}
while (thissend < (Math.round(atnivel / harddivider) + elplus)) {
if ((random(2) < 1) and (thissend < (Math.round(atnivel / harddivider) + elplus))) {
createbsamurai(random(sendsamuraihard[atnivel]) + 1, random(clados) + 1);
thissend = thissend + 1;
}
if ((random(2) < 1) and (thissend < (Math.round(atnivel / harddivider) + elplus))) {
createbcaballo(random(sendsamuraihard[atnivel]) + 1, random(clados) + 1);
thissend = thissend + 1;
}
if ((random(2) < 1) and (thissend < (Math.round(atnivel / harddivider) + elplus))) {
createbspearman(random(sendsamuraihard[atnivel]) + 1, random(clados) + 1);
thissend = thissend + 1;
}
if ((random(2) < 1) and (thissend < (Math.round(atnivel / harddivider) + elplus))) {
createbarcher(random(sendsamuraihard[atnivel]) + 1, random(clados) + 1);
thissend = thissend + 1;
}
if ((random(2) < 1) and (thissend < (Math.round(atnivel / harddivider) + elplus))) {
createbcaballofire(random(sendsamuraihard[atnivel]) + 1, random(clados) + 1);
thissend = thissend + 1;
}
}
sendcount = 0;
atnivel = atnivel + 1;
}
}
}
};
this.onMouseDown = function () {
var _local3 = attachMovie("selectionm", "seleccion", this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse});
_root.seleccion._alpha = 50;
_root.selecarea = "yes";
};
this.onMouseMove = function () {
if (_root.selecarea == "yes") {
_root.seleccion._xscale = -100 * (_root.seleccion._x - _xmouse);
_root.seleccion._yscale = -100 * (_root.seleccion._y - _ymouse);
}
};
this.onMouseUp = function () {
for (var _local2 in _root.lossamurais) {
if (_root[_root.lossamurais[_local2]].alive == 1) {
if ((_root.seleccion._x < _xmouse) and (_root.seleccion._y < _ymouse)) {
if (((_root[_root.lossamurais[_local2]]._x > _root.seleccion._x) and (_root[_root.lossamurais[_local2]]._x < _xmouse)) and ((_root[_root.lossamurais[_local2]]._y > _root.seleccion._y) and (_root[_root.lossamurais[_local2]]._y < _ymouse))) {
_root[_root.lossamurais[_local2]].samuraicuadro._visible = true;
_root.select.push(_root[_root.lossamurais[_local2]]._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
}
}
if ((_root.seleccion._x > _xmouse) and (_root.seleccion._y < _ymouse)) {
if (((_root[_root.lossamurais[_local2]]._x < _root.seleccion._x) and (_root[_root.lossamurais[_local2]]._x > _xmouse)) and ((_root[_root.lossamurais[_local2]]._y > _root.seleccion._y) and (_root[_root.lossamurais[_local2]]._y < _ymouse))) {
_root[_root.lossamurais[_local2]].samuraicuadro._visible = true;
_root.select.push(_root[_root.lossamurais[_local2]]._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
}
}
if ((_root.seleccion._x < _xmouse) and (_root.seleccion._y > _ymouse)) {
if (((_root[_root.lossamurais[_local2]]._x > _root.seleccion._x) and (_root[_root.lossamurais[_local2]]._x < _xmouse)) and ((_root[_root.lossamurais[_local2]]._y < _root.seleccion._y) and (_root[_root.lossamurais[_local2]]._y > _ymouse))) {
_root[_root.lossamurais[_local2]].samuraicuadro._visible = true;
_root.select.push(_root[_root.lossamurais[_local2]]._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
}
}
if ((_root.seleccion._x > _xmouse) and (_root.seleccion._y > _ymouse)) {
if (((_root[_root.lossamurais[_local2]]._x < _root.seleccion._x) and (_root[_root.lossamurais[_local2]]._x > _xmouse)) and ((_root[_root.lossamurais[_local2]]._y < _root.seleccion._y) and (_root[_root.lossamurais[_local2]]._y > _ymouse))) {
_root[_root.lossamurais[_local2]].samuraicuadro._visible = true;
_root.select.push(_root[_root.lossamurais[_local2]]._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
}
}
}
}
_root.selecarea = "no";
_root.seleccion.removeMovieClip();
};
_root.castillo.onEnterFrame = function () {
if (_root.pausa == 0) {
if (this._currentframe < 21) {
if (this.fire > 0) {
this.ronda = this.ronda + 1;
}
if (this.ronda == 48) {
this.nextFrame();
this.hp = this.hp + -1;
this.ronda = 0;
this.fire = this.fire + 1;
}
}
}
};
i = 0;
while (i < 1) {
i++;
}
Frame 10
stop();
_root._x = 0;
sendcount = 0;
Key.removeListener(keyListener);
_root.gotoright._visible = false;
_root.gotoleft._visible = false;
_root.myscore.text = _root.myscore2.text;
bluefire.stop();
newgroundssteel.start(0, 1000);
i = 0;
while (i < (_root.arrown + 1)) {
_root["arrow" + i].swapDepths(23);
_root["arrow" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.sn + 1)) {
_root["samurai" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.hsn + 1)) {
_root["caballo" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.spn + 1)) {
_root["spearman" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.arn + 1)) {
_root["archer" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.vn + 1)) {
_root["villager" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bss + 1)) {
_root["bsamurai" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bhss + 1)) {
_root["bcaballo" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bsps + 1)) {
_root["bspearman" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bac + 1)) {
_root["barcher" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bcf + 1)) {
_root["bcfire" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.blood2 + 1)) {
_root["bloodspill" + i].swapDepths(23);
_root["bloodspill" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.blood2 + 1)) {
_root["caballosolo" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.towern + 1)) {
_root["tower" + i].swapDepths(23);
_root["tower" + i].removeMovieClip();
i++;
}
Frame 11
stop();
_root._x = 0;
sendcount = 0;
Key.removeListener(keyListener);
_root.gotoright._visible = false;
_root.gotoleft._visible = false;
_root.myscore.text = _root.myscore2.text;
bluefire.stop();
newgroundssteel.start(0, 1000);
i = 0;
while (i < (_root.arrown + 1)) {
_root["arrow" + i].swapDepths(23);
_root["arrow" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.sn + 1)) {
_root["samurai" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.hsn + 1)) {
_root["caballo" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.spn + 1)) {
_root["spearman" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.arn + 1)) {
_root["archer" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.vn + 1)) {
_root["villager" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bss + 1)) {
_root["bsamurai" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bhss + 1)) {
_root["bcaballo" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bsps + 1)) {
_root["bspearman" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bac + 1)) {
_root["barcher" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bcf + 1)) {
_root["bcfire" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.blood2 + 1)) {
_root["bloodspill" + i].swapDepths(23);
_root["bloodspill" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.blood2 + 1)) {
_root["caballosolo" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.towern + 1)) {
_root["tower" + i].swapDepths(23);
_root["tower" + i].removeMovieClip();
i++;
}
Frame 12
this.onEnterFrame = function () {
this.stop();
};
Frame 13
this.onEnterFrame = function () {
this.stop();
};
Frame 14
this.onEnterFrame = function () {
this.stop();
};
Symbol 32 MovieClip [nogold] Frame 75
this.removeMovieClip();
Symbol 179 MovieClip [archer] Frame 1
if (this._x < _root[this.myenemy]._x) {
this._xscale = 100;
this.xdir = 1;
} else {
this._xscale = -100;
this.xdir = -1;
}
Symbol 179 MovieClip [archer] Frame 15
_root.flecha.start();
this.estaronda = this.estaronda + 1;
if (this.estaronda == 20) {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
var thisarrow = _root.attachMovie("arrow", "arrow" + _root.arrown, _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
_root["arrow" + _root.arrown].strength = this.strength;
_root["arrow" + _root.arrown].agility = this.agility;
_root["arrow" + _root.arrown].myenemy = this.myenemy;
_root["arrow" + _root.arrown].dueno = this._name;
_root["arrow" + _root.arrown].activo = 1;
_root["arrow" + _root.arrown].speed = 10;
_root["arrow" + _root.arrown].desx = _root[this.myenemy]._x;
_root["arrow" + _root.arrown].desy = _root[this.myenemy]._y;
this.alto = 0;
_root["arrow" + _root.arrown].distot = Math.sqrt(((_root["arrow" + _root.arrown]._y - _root["arrow" + _root.arrown].desy) * (_root["arrow" + _root.arrown]._y - _root["arrow" + _root.arrown].desy)) + ((_root["arrow" + _root.arrown]._x - _root["arrow" + _root.arrown].desx) * (_root["arrow" + _root.arrown]._x - _root["arrow" + _root.arrown].desx)));
_root["arrow" + _root.arrown].sinx = (_root["arrow" + _root.arrown]._x - _root["arrow" + _root.arrown].desx) / _root["arrow" + _root.arrown].distot;
_root["arrow" + _root.arrown].cosy = (_root["arrow" + _root.arrown]._y - _root["arrow" + _root.arrown].desy) / _root["arrow" + _root.arrown].distot;
if (_root["arrow" + _root.arrown].desx > _root["arrow" + _root.arrown]._x) {
_root["arrow" + _root.arrown].xdir = 1;
_root["arrow" + _root.arrown]._xscale = 100;
} else {
_root["arrow" + _root.arrown].xdir = -1;
_root["arrow" + _root.arrown]._xscale = -100;
}
if (_root["arrow" + _root.arrown].desy > this._y) {
_root["arrow" + _root.arrown].ydir = 1;
} else {
_root["arrow" + _root.arrown].ydir = -1;
}
_root["arrow" + _root.arrown]._rotation = (((-_root["arrow" + _root.arrown].xdir) * _root["arrow" + _root.arrown].cosy) * 180) / Math.PI;
thisarrow.onEnterFrame = function () {
if (_root.pausa == 0) {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
this._x = this._x + ((-this.speed) * this.sinx);
this._y = this._y + ((-this.speed) * this.cosy);
} else {
if (this.activo == 1) {
this.swapDepths(-6000 - _root.arrown);
}
this.activo = 0;
}
if (this.hitTest(_root[this.myenemy]) and (this.activo == 1)) {
if (Math.abs(this._x - _root[this.myenemy]._x) < 15) {
_root[this.myenemy].hp = _root[this.myenemy].hp + (-this.strength);
_root[this.myenemy].aratack = 1;
_root[this.myenemy].aratacker = this.dueno;
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].fatality = 1;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
this.removeMovieClip();
}
}
}
};
_root.arrown = _root.arrown + 1;
if (this.myenemy == "") {
gotoAndPlay (73);
}
if (_root[this.myenemy].alive != 1) {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
if (this.alive == 0) {
gotoAndPlay (36);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (36);
}
Symbol 179 MovieClip [archer] Frame 24
gotoAndPlay (1);
Symbol 179 MovieClip [archer] Frame 25
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 179 MovieClip [archer] Frame 26
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 179 MovieClip [archer] Frame 27
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 179 MovieClip [archer] Frame 28
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 179 MovieClip [archer] Frame 29
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 179 MovieClip [archer] Frame 30
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 179 MovieClip [archer] Frame 31
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 179 MovieClip [archer] Frame 32
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 179 MovieClip [archer] Frame 33
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 179 MovieClip [archer] Frame 34
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + ([this._name] + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + (this._name + "x");
}
var cuadrante = _root["bcuad" + this.cuad].split("x");
for (var i in cuadrante) {
if (Math.abs(this._y - _root[cuadrante[i]]._y) < 20) {
if (this.hitTest(_root[cuadrante[i]]) and (_root[cuadrante[i]].alive == 1)) {
this.myenemy = _root[cuadrante[i]]._name;
this.desx = this._x;
this.desy = this._y;
if (_root[cuadrante[i]].myenemy == "") {
_root[cuadrante[i]].myenemy = this._name;
_root[cuadrante[i]].desx = _root[cuadrante[i]]._x;
_root[cuadrante[i]].desy = _root[cuadrante[i]]._y;
_root[cuadrante[i]].gotoAndPlay(1);
}
if (_root[cuadrante[i]]._x < this._x) {
this._xscale = -100;
_root[cuadrante[i]]._xscale = _root[cuadrante[i]].myscale;
} else {
this._xscale = 100;
_root[cuadrante[i]]._xscale = -_root[cuadrante[i]].myscale;
}
this.gotoAndPlay(1);
this.estaronda = 0;
}
}
}
if (this.myenemy == "") {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (25);
} else {
if (this.hitTest(_root.borderinfirmary) and (this.infirmary == 1)) {
this.eninfirmary = 1;
this._y = -100;
}
this.desx = this._x;
this.desy = this._y;
if (this.mytower != "") {
this._x = _root[this.mytower]._x + 105;
this._y = _root[this.mytower]._y + 50;
}
gotoAndPlay (73);
this.enemy = 0;
}
}
if (this.alive == 0) {
gotoAndPlay (36);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (36);
}
Symbol 179 MovieClip [archer] Frame 35
gotoAndPlay (25);
Symbol 179 MovieClip [archer] Frame 36
if (this.intower == 1) {
this._y = this._y + 2;
}
_root.arg.start();
Symbol 179 MovieClip [archer] Frame 37
if (this.intower == 1) {
this._y = this._y + 3;
}
Symbol 179 MovieClip [archer] Frame 38
if (this.intower == 1) {
this._y = this._y + 2;
}
Symbol 179 MovieClip [archer] Frame 39
if (this.intower == 1) {
this._y = this._y + 3;
}
Symbol 179 MovieClip [archer] Frame 40
if (this.intower == 1) {
this._y = this._y + 2;
}
Symbol 179 MovieClip [archer] Frame 41
if (this.intower == 1) {
this._y = this._y + 3;
}
Symbol 179 MovieClip [archer] Frame 42
if (this.intower == 1) {
this._y = this._y + 2;
}
Symbol 179 MovieClip [archer] Frame 43
if (this.intower == 1) {
this._y = this._y + 3;
}
Symbol 179 MovieClip [archer] Frame 44
if (this.intower == 1) {
this._y = this._y + 3;
}
Symbol 179 MovieClip [archer] Frame 45
if (this.intower == 1) {
this._y = this._y + 3;
}
Symbol 179 MovieClip [archer] Frame 46
if (this.intower == 1) {
this._y = this._y + 3;
}
Symbol 179 MovieClip [archer] Frame 47
if (this.intower == 1) {
this._y = this._y + 3;
}
Symbol 179 MovieClip [archer] Frame 48
if (this.intower == 1) {
this._y = this._y + 3;
_root[this.mytower].myarcher = "";
}
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
this.samuraicuadro._visible = false;
this.myhealth._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
if ((_root.elpanel == "archerpanel") and (_root.spanelshow == this._name)) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "castlepanel";
_root.castlepanel._y = 400;
}
Symbol 179 MovieClip [archer] Frame 72
gotoAndPlay (49);
Symbol 179 MovieClip [archer] Frame 73
var dissam = new Array();
var counter = 0;
var estemid = 0;
if (this.eninfirmary == 0) {
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + this.cuad].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 350) {
this.myenemy = _root[cuadrante[counter]]._name;
if (this._x < _root[cuadrante[counter]]._x) {
this._xscale = 100;
this.xdir = 1;
}
if (this._x > _root[cuadrante[counter]]._x) {
this._xscale = -100;
this.xdir = -1;
}
this.gotoAndPlay(1);
this.enemy = 1;
this.estaronda = 0;
}
}
counter = counter + 1;
}
if (this.enemy == 0) {
counter = 0;
estemid = this.cuad - 1;
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + estemid].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 550) {
this.myenemy = _root[cuadrante[counter]]._name;
if (this._x < _root[cuadrante[counter]]._x) {
this._xscale = 100;
this.xdir = 1;
}
if (this._x > _root[cuadrante[counter]]._x) {
this._xscale = -100;
this.xdir = -1;
}
this.gotoAndPlay(1);
this.enemy = 1;
this.estaronda = 0;
}
}
counter = counter + 1;
}
}
if (this.enemy == 0) {
counter = 0;
estemid = this.cuad + 1;
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + estemid].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 550) {
this.myenemy = _root[cuadrante[counter]]._name;
if (this._x < _root[cuadrante[counter]]._x) {
this._xscale = 100;
this.xdir = 1;
}
if (this._x > _root[cuadrante[counter]]._x) {
this._xscale = -100;
this.xdir = -1;
}
this.gotoAndPlay(1);
this.enemy = 1;
this.estaronda = 0;
}
}
counter = counter + 1;
}
}
}
if ((this.enemy == 0) and (this.aratack == 1)) {
this.aratack = 0;
var myrnddir = random(2);
if (myrnddir < 1) {
this.desy = this._y - 50;
if (this.desy < 200) {
this.desy = 200;
}
} else {
this.desy = this._y + 50;
if (this.desy > 375) {
this.desy = 375;
}
}
this.desx = this._x + (50 * this.xdir);
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (14);
}
if (this.alive == 0) {
gotoAndPlay (36);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (36);
}
if (this.eninfirmary == 1) {
this.hp = this.hp + (_root.infirmarylevel / 20);
if (this.hp >= this.ohp) {
this.myhealth._xscale = 100;
this.eninfirmary = 0;
this.infirmary = 0;
this._y = 175;
if (this.hp > this.ohp) {
this.hp = this.ohp;
}
}
}
if (this.mytower != "") {
if ((this.hitTest(_root[this.mytower]) and (this._y > _root[this.mytower]._y)) and (_root[this.mytower].myarcher == this._name)) {
this.goingup = 1;
gotoAndPlay (75);
var proximoy = (_root[this.mytower].getDepth() + 3);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
this.swapDepths(proximoy);
} else if (this.intower == 0) {
this.mytower = "";
}
}
Symbol 179 MovieClip [archer] Frame 74
gotoAndPlay (73);
Symbol 179 MovieClip [archer] Frame 75
if (this.goingup == 1) {
this._y = this._y + -1;
if (this._y < (_root[this.mytower]._y - 20)) {
this.intower = 1;
this.strength = this.strength + 2;
this.agility = this.agility + 2;
this.enemy = 0;
this.myenemy = "";
this._x = _root[this.mytower]._x + 134;
this._y = _root[this.mytower]._y - 30;
_root[this.mytower].myarcher = this._name;
gotoAndPlay (73);
}
} else {
this._y = this._y + 1;
this.step = this.step + 1;
if (this.step >= 10) {
_root[this.mytower].myarcher = "";
this.mytower = "";
this.intower = 0;
this.strength = this.strength + -2;
this.agility = this.agility + -2;
this.step = 0;
gotoAndPlay (25);
}
}
Symbol 179 MovieClip [archer] Frame 76
if (this.goingup == 1) {
this._y = this._y + -1;
} else {
this._y = this._y + 1;
}
Symbol 179 MovieClip [archer] Frame 77
if (this.goingup == 1) {
this._y = this._y + -1;
} else {
this._y = this._y + 1;
}
Symbol 179 MovieClip [archer] Frame 78
if (this.goingup == 1) {
this._y = this._y + -1;
} else {
this._y = this._y + 1;
}
Symbol 179 MovieClip [archer] Frame 79
if (this.goingup == 1) {
this._y = this._y + -1;
} else {
this._y = this._y + 1;
}
Symbol 179 MovieClip [archer] Frame 80
if (this.goingup == 1) {
this._y = this._y + -1;
} else {
this._y = this._y + 1;
}
Symbol 179 MovieClip [archer] Frame 81
if (this.goingup == 1) {
this._y = this._y + -1;
} else {
this._y = this._y + 1;
}
gotoAndPlay (75);
Symbol 291 MovieClip [barcher] Frame 1
if (this._x < _root[this.myenemy]._x) {
this._xscale = 100;
this.xdir = 1;
} else {
this._xscale = -100;
this.xdir = -1;
}
Symbol 291 MovieClip [barcher] Frame 15
if (_root[this.myenemy].eninfirmary == 1) {
this.myenemy = "";
gotoAndPlay (73);
} else {
this.estaronda = this.estaronda + 1;
if (this.estaronda == 20) {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
_root.flecha.start();
var thisarrow = _root.attachMovie("arrow", "arrow" + _root.arrown, _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
_root["arrow" + _root.arrown].strength = this.strength;
_root["arrow" + _root.arrown].agility = this.agility;
_root["arrow" + _root.arrown].myenemy = this.myenemy;
_root["arrow" + _root.arrown].dueno = this._name;
_root["arrow" + _root.arrown].activo = 1;
_root["arrow" + _root.arrown].speed = 10;
_root["arrow" + _root.arrown].desx = _root[this.myenemy]._x;
_root["arrow" + _root.arrown].desy = _root[this.myenemy]._y;
this.alto = 0;
_root["arrow" + _root.arrown].distot = Math.sqrt(((_root["arrow" + _root.arrown]._y - _root["arrow" + _root.arrown].desy) * (_root["arrow" + _root.arrown]._y - _root["arrow" + _root.arrown].desy)) + ((_root["arrow" + _root.arrown]._x - _root["arrow" + _root.arrown].desx) * (_root["arrow" + _root.arrown]._x - _root["arrow" + _root.arrown].desx)));
_root["arrow" + _root.arrown].sinx = (_root["arrow" + _root.arrown]._x - _root["arrow" + _root.arrown].desx) / _root["arrow" + _root.arrown].distot;
_root["arrow" + _root.arrown].cosy = (_root["arrow" + _root.arrown]._y - _root["arrow" + _root.arrown].desy) / _root["arrow" + _root.arrown].distot;
if (_root["arrow" + _root.arrown].desx > _root["arrow" + _root.arrown]._x) {
_root["arrow" + _root.arrown].xdir = 1;
_root["arrow" + _root.arrown]._xscale = 100;
} else {
_root["arrow" + _root.arrown].xdir = -1;
_root["arrow" + _root.arrown]._xscale = -100;
}
if (_root["arrow" + _root.arrown].desy > this._y) {
_root["arrow" + _root.arrown].ydir = 1;
} else {
_root["arrow" + _root.arrown].ydir = -1;
}
_root["arrow" + _root.arrown]._rotation = (((-_root["arrow" + _root.arrown].xdir) * _root["arrow" + _root.arrown].cosy) * 180) / Math.PI;
thisarrow.onEnterFrame = function () {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
this._x = this._x + ((-this.speed) * this.sinx);
this._y = this._y + ((-this.speed) * this.cosy);
} else {
if (this.activo == 1) {
this.swapDepths(-6000 - _root.arrown);
}
this.activo = 0;
}
if (this.hitTest(_root[this.myenemy]) and (this.activo == 1)) {
if (Math.abs(this._x - _root[this.myenemy]._x) < 15) {
_root[this.myenemy].hp = _root[this.myenemy].hp + (-this.strength);
_root[this.myenemy].aratack = 1;
_root[this.myenemy].aratacker = this.dueno;
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].fatality = 1;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
this.removeMovieClip();
}
}
};
_root.arrown = _root.arrown + 1;
}
if (this.myenemy == "") {
gotoAndPlay (73);
}
if (_root[this.myenemy].alive != 1) {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
if (this.alive == 0) {
gotoAndPlay (36);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (36);
}
Symbol 291 MovieClip [barcher] Frame 24
gotoAndPlay (1);
Symbol 291 MovieClip [barcher] Frame 25
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 291 MovieClip [barcher] Frame 26
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 291 MovieClip [barcher] Frame 27
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 291 MovieClip [barcher] Frame 28
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 291 MovieClip [barcher] Frame 29
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 291 MovieClip [barcher] Frame 30
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 291 MovieClip [barcher] Frame 31
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 291 MovieClip [barcher] Frame 32
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 291 MovieClip [barcher] Frame 33
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 291 MovieClip [barcher] Frame 34
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + ([this._name] + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + (this._name + "x");
}
var cuadrante = _root["scuad" + this.cuad].split("x");
for (var i in cuadrante) {
if (Math.abs(this._y - _root[cuadrante[i]]._y) < 10) {
if (this.hitTest(_root[cuadrante[i]]) and (_root[cuadrante[i]].alive == 1)) {
this.myenemy = _root[cuadrante[i]]._name;
this.desx = this._x;
this.desy = this._y;
if (_root[cuadrante[i]].myenemy == "") {
_root[cuadrante[i]].myenemy = this._name;
_root[cuadrante[i]].desx = _root[cuadrante[i]]._x;
_root[cuadrante[i]].desy = _root[cuadrante[i]]._y;
_root[cuadrante[i]].gotoAndPlay(1);
}
if (_root[cuadrante[i]]._x < this._x) {
this._xscale = -100;
_root[cuadrante[i]]._xscale = _root[cuadrante[i]].myscale;
} else {
this._xscale = 100;
_root[cuadrante[i]]._xscale = -_root[cuadrante[i]].myscale;
}
this.gotoAndPlay(1);
this.estaronda = 0;
}
}
}
if (this.myenemy == "") {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 20) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (25);
} else {
this.desx = this._x;
this.desy = this._y;
gotoAndPlay (73);
this.enemy = 0;
}
}
if (this.alive == 0) {
gotoAndPlay (36);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (36);
}
Symbol 291 MovieClip [barcher] Frame 35
gotoAndPlay (25);
Symbol 291 MovieClip [barcher] Frame 36
_root.arg.start();
Symbol 291 MovieClip [barcher] Frame 48
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
_root.score = _root.score + this.score;
this.myhealth._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
Symbol 291 MovieClip [barcher] Frame 72
gotoAndPlay (49);
Symbol 291 MovieClip [barcher] Frame 73
var dissam = new Array();
var counter = 0;
while (this.enemy == 0) {
var cuadrante = _root["scuad" + this.cuad].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].eninfirmary == 0) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 450) {
this.myenemy = _root[cuadrante[counter]]._name;
if (this._x < _root[cuadrante[counter]]._x) {
this._xscale = 100;
this.xdir = 1;
}
if (this._x > _root[cuadrante[counter]]._x) {
this._xscale = -100;
this.xdir = -1;
}
this.gotoAndPlay(1);
this.enemy = 1;
this.estaronda = 0;
}
}
}
counter = counter + 1;
}
if (this.enemy == 0) {
var myrnddir = random(2);
if (this._x < -100) {
this.mydir = 1;
}
if (this._x > 800) {
this.mydir = -1;
}
if (myrnddir < 1) {
this.desy = this._y - 50;
if (this.desy < 200) {
this.desy = 200;
}
} else {
this.desy = this._y + 50;
if (this.desy > 375) {
this.desy = 375;
}
}
this.desx = this._x + (50 * this.mydir);
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (25);
}
if (this.alive == 0) {
gotoAndPlay (36);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (36);
}
Symbol 291 MovieClip [barcher] Frame 74
gotoAndPlay (73);
Symbol 371 MovieClip [bcaballo] Frame 13
_root.sword2.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if (_root[this.myenemy].tipo == "samurai") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if (_root[this.myenemy].tipo == "archer") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (37);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].fatality = 1;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (37);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (23);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
gotoAndPlay (1);
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (37);
}
}
Symbol 371 MovieClip [bcaballo] Frame 14
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 371 MovieClip [bcaballo] Frame 15
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 371 MovieClip [bcaballo] Frame 16
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 371 MovieClip [bcaballo] Frame 17
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 371 MovieClip [bcaballo] Frame 18
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 371 MovieClip [bcaballo] Frame 19
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 371 MovieClip [bcaballo] Frame 20
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 371 MovieClip [bcaballo] Frame 21
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 371 MovieClip [bcaballo] Frame 22
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + ([this._name] + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + (this._name + "x");
}
var cuadrante = _root["scuad" + this.cuad].split("x");
for (var i in cuadrante) {
if (_root[cuadrante[i]].intower != 1) {
if ((Math.abs(this._y - _root[cuadrante[i]]._y) < 20) and (Math.abs(this._x - _root[cuadrante[i]]._x) < 20)) {
if (this.hitTest(_root[cuadrante[i]]) and (_root[cuadrante[i]].alive == 1)) {
this.myenemy = _root[cuadrante[i]]._name;
this.desx = this._x;
this.desy = this._y;
if (_root[cuadrante[i]].myenemy == "") {
_root[cuadrante[i]].myenemy = this._name;
_root[cuadrante[i]].desx = _root[cuadrante[i]]._x;
_root[cuadrante[i]].desy = _root[cuadrante[i]]._y;
_root[cuadrante[i]].gotoAndPlay(1);
}
if (_root[cuadrante[i]]._x < this._x) {
this._xscale = -100;
_root[cuadrante[i]]._xscale = _root[cuadrante[i]].myscale;
} else {
this._xscale = 100;
_root[cuadrante[i]]._xscale = -_root[cuadrante[i]].myscale;
}
this.gotoAndPlay(1);
}
}
}
}
if (this.myenemy == "") {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (14);
} else {
this.desx = this._x;
this.desy = this._y;
gotoAndPlay (37);
this.enemy = 0;
}
}
if (this.alive == 0) {
gotoAndPlay (23);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
Symbol 371 MovieClip [bcaballo] Frame 23
_root.arg.start();
Symbol 371 MovieClip [bcaballo] Frame 36
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
proximoyb = xc + 1;
while (_root.getInstanceAtDepth(proximoyb) != undefined) {
proximoyb = proximoyb + 1;
}
_root.score = _root.score + this.score;
this.samuraicuadro._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 20});
_root.attachMovie("caballosolo", "caballosolo" + _root.blood2, proximoyb, {_x:this._x, _y:this._y});
_root["caballosolo" + _root.blood2]._xscale = 100 * this.xdir;
_root["caballosolo" + _root.blood2].xdir = this.xdir * 4;
_root.blood2 = _root.blood2 + 1;
Symbol 371 MovieClip [bcaballo] Frame 37
var dissam = new Array();
var counter = 0;
while (this.enemy == 0) {
var cuadrante = _root["scuad" + this.cuad].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].eninfirmary == 0) {
if (_root[cuadrante[counter]].intower != 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 150) {
this.desx = _root[cuadrante[counter]]._x;
this.desy = _root[cuadrante[counter]]._y;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.enemy = 1;
if (_root[cuadrante[counter]].tipo == "villager") {
_root[cuadrante[counter]].myenemy = this._name;
}
}
}
}
}
counter = counter + 1;
}
if (this.aratack == 1) {
this.aratack = 0;
if (_root[this.aratacker].intower == 0) {
this.desy = _root[this.aratacker]._y;
this.desx = _root[this.aratacker]._x;
} else {
var myrnddir = random(2);
if (myrnddir < 1) {
this.desy = this._y - 50;
if (this.desy < 200) {
this.desy = 200;
}
} else {
this.desy = this._y + 50;
if (this.desy > 375) {
this.desy = 375;
}
}
this.desx = this._x + (50 * this.xdir);
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (14);
}
if (this._x > 1100) {
this.desx = 700;
this.desy = 250;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
this.xdir = -1;
this._xscale = -100;
this.gotoAndPlay(14);
}
if (this._x < -500) {
this.desx = -200;
this.desy = 250;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
this.xdir = -1;
this._xscale = -100;
this.gotoAndPlay(14);
}
if ((this.enemy == 1) and (this.myenemy == "")) {
gotoAndPlay (14);
}
if (this.alive == 0) {
gotoAndPlay (23);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
Symbol 371 MovieClip [bcaballo] Frame 38
gotoAndPlay (37);
Symbol 448 MovieClip [bcaballofire] Frame 13
_root.sword2.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (38);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].fatality = 1;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (38);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (24);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (24);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
gotoAndPlay (1);
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (38);
}
}
Symbol 448 MovieClip [bcaballofire] Frame 14
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 448 MovieClip [bcaballofire] Frame 15
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 448 MovieClip [bcaballofire] Frame 16
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 448 MovieClip [bcaballofire] Frame 17
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 448 MovieClip [bcaballofire] Frame 18
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 448 MovieClip [bcaballofire] Frame 19
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 448 MovieClip [bcaballofire] Frame 20
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 448 MovieClip [bcaballofire] Frame 21
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 448 MovieClip [bcaballofire] Frame 22
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 448 MovieClip [bcaballofire] Frame 23
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + ([this._name] + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + (this._name + "x");
}
var cuadrante = _root["scuad" + this.cuad].split("x");
for (var i in cuadrante) {
if (_root[cuadrante[i]].intower != 1) {
if (Math.abs(this._y - _root[cuadrante[i]]._y) < 10) {
if (this.hitTest(_root[cuadrante[i]]) and (_root[cuadrante[i]].alive == 1)) {
this.myenemy = _root[cuadrante[i]]._name;
this.desx = this._x;
this.desy = this._y;
if (_root[cuadrante[i]].myenemy == "") {
_root[cuadrante[i]].myenemy = this._name;
_root[cuadrante[i]].desx = _root[cuadrante[i]]._x;
_root[cuadrante[i]].desy = _root[cuadrante[i]]._y;
_root[cuadrante[i]].gotoAndPlay(1);
}
if (_root[cuadrante[i]]._x < this._x) {
this._xscale = -100;
_root[cuadrante[i]]._xscale = _root[cuadrante[i]].myscale;
} else {
this._xscale = 100;
_root[cuadrante[i]]._xscale = -_root[cuadrante[i]].myscale;
}
this.gotoAndPlay(1);
}
}
}
}
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (14);
} else {
if (this.hitTest(_root[this.mytower])) {
gotoAndPlay (40);
} else {
gotoAndPlay (38);
this.enemy = 0;
}
this.desx = this._x;
this.desy = this._y;
}
if (this.alive == 0) {
gotoAndPlay (24);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (24);
}
Symbol 448 MovieClip [bcaballofire] Frame 24
_root.arg.start();
Symbol 448 MovieClip [bcaballofire] Frame 37
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
proximoyb = xc + 1;
while (_root.getInstanceAtDepth(proximoyb) != undefined) {
proximoyb = proximoyb + 1;
}
_root.score = _root.score + this.score;
this.samuraicuadro._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 20});
_root.attachMovie("caballosolo", "caballosolo" + _root.blood2, proximoyb, {_x:this._x, _y:this._y});
_root["caballosolo" + _root.blood2]._xscale = 100 * this.xdir;
_root["caballosolo" + _root.blood2].xdir = this.xdir * 4;
_root.blood2 = _root.blood2 + 1;
Symbol 448 MovieClip [bcaballofire] Frame 38
var dissam = new Array();
var counter = 0;
while (this.enemy == 0) {
if (random(4) < 1) {
if ((_root["tower" + counter].fire == 0) and (_root["tower" + counter].constructed == 1)) {
this.desx = _root["tower" + counter]._x + 115;
this.desy = _root["tower" + counter]._y + 35;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.enemy = 1;
this.mytower = _root["tower" + counter]._name;
}
}
if (counter >= _root.towern) {
break;
}
counter = counter + 1;
}
if (this.aratack == 1) {
this.aratack = 0;
if (_root[this.aratacker].intower == 0) {
this.desy = _root[this.aratacker]._y;
this.desx = _root[this.aratacker]._x;
} else {
var myrnddir = random(2);
if (myrnddir < 1) {
this.desy = this._y - 50;
if (this.desy < 200) {
this.desy = 200;
}
} else {
this.desy = this._y + 50;
if (this.desy > 375) {
this.desy = 375;
}
}
this.desx = this._x + (50 * this.xdir);
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (14);
}
if ((this.enemy == 0) and (_root.castillo.fire == 0)) {
this.enemy = 1;
this.desx = 225;
this.desy = 155;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.enemy = 1;
this.mytower = _root.castillo._name;
}
if (this._x > 1100) {
this.desx = 700;
this.desy = 250;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
this.xdir = -1;
this._xscale = -100;
this.gotoAndPlay(14);
}
if (this._x < -500) {
this.desx = -200;
this.desy = 250;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
this.xdir = -1;
this._xscale = -100;
this.gotoAndPlay(14);
}
if (this.enemy == 1) {
gotoAndPlay (14);
}
if (this.alive == 0) {
gotoAndPlay (24);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (24);
}
if (this.myenemy != "") {
gotoAndPlay (1);
}
Symbol 448 MovieClip [bcaballofire] Frame 39
gotoAndPlay (38);
Symbol 448 MovieClip [bcaballofire] Frame 40
this.myfire = this.myfire + 1;
if (this.myenemy != "") {
this.myfire = 0;
gotoAndPlay (1);
}
if (this.myfire == 75) {
if (this.mytower != "castillo") {
_root[this.mytower].fire = 10;
_root[this.mytower].gotoAndPlay(13);
} else {
_root[this.mytower].fire = 1;
_root[this.mytower].gotoAndPlay(2);
}
this.myfire = 0;
this.enemy = 0;
this.mytower = 0;
gotoAndPlay (38);
}
if (this.alive == 0) {
gotoAndPlay (24);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (24);
}
Symbol 448 MovieClip [bcaballofire] Frame 41
gotoAndPlay (40);
Symbol 593 MovieClip [bsamurai] Frame 13
_root.sword1.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if (_root[this.myenemy].tipo == "spearman") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].fatality = 1;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
f = random(3);
switch (f) {
case 0 :
gotoAndPlay (1);
break;
case 1 :
gotoAndPlay (24);
break;
case 2 :
gotoAndPlay (36);
}
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
}
Symbol 593 MovieClip [bsamurai] Frame 14
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 593 MovieClip [bsamurai] Frame 15
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 593 MovieClip [bsamurai] Frame 16
if (this.myenemy == "") {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (17);
} else {
this.desx = this._x;
this.desy = this._y;
this.enemy = 0;
gotoAndPlay (73);
}
}
Symbol 593 MovieClip [bsamurai] Frame 17
var cuadrante = _root["scuad" + this.cuad].split("x");
for (var i in cuadrante) {
if (_root[cuadrante[i]].intower != 1) {
if (Math.abs(this._y - _root[cuadrante[i]]._y) < 10) {
if (this.hitTest(_root[cuadrante[i]]) and (_root[cuadrante[i]].alive == 1)) {
this.myenemy = _root[cuadrante[i]]._name;
this.desx = this._x;
this.desy = this._y;
if (_root[cuadrante[i]].myenemy == "") {
_root[cuadrante[i]].myenemy = this._name;
_root[cuadrante[i]].desx = _root[cuadrante[i]]._x;
_root[cuadrante[i]].desy = _root[cuadrante[i]]._y;
_root[cuadrante[i]].gotoAndPlay(1);
}
if (_root[cuadrante[i]]._x < this._x) {
this._xscale = -100;
_root[cuadrante[i]]._xscale = _root[cuadrante[i]].myscale;
} else {
this._xscale = 100;
_root[cuadrante[i]]._xscale = -_root[cuadrante[i]].myscale;
}
this.gotoAndPlay(1);
}
}
}
}
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 593 MovieClip [bsamurai] Frame 18
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + (this._name + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + ([this._name] + "x");
}
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 593 MovieClip [bsamurai] Frame 19
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 593 MovieClip [bsamurai] Frame 20
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 593 MovieClip [bsamurai] Frame 21
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 593 MovieClip [bsamurai] Frame 22
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 593 MovieClip [bsamurai] Frame 23
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (14);
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
Symbol 593 MovieClip [bsamurai] Frame 35
_root.sword2.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if (_root[this.myenemy].tipo == "spearman") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].fatality = 1;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
f = random(3);
switch (f) {
case 0 :
gotoAndPlay (1);
break;
case 1 :
gotoAndPlay (24);
break;
case 2 :
gotoAndPlay (36);
}
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
}
Symbol 593 MovieClip [bsamurai] Frame 46
_root.sword2.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if (_root[this.myenemy].tipo == "spearman") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].fatality = 1;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
f = random(3);
switch (f) {
case 0 :
gotoAndPlay (1);
break;
case 1 :
gotoAndPlay (24);
break;
case 2 :
gotoAndPlay (36);
}
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
}
Symbol 593 MovieClip [bsamurai] Frame 47
_root.arg.start();
Symbol 593 MovieClip [bsamurai] Frame 61
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
_root.score = _root.score + (2 * this.score);
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
Symbol 593 MovieClip [bsamurai] Frame 62
_root.arg.start();
Symbol 593 MovieClip [bsamurai] Frame 72
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
_root.score = _root.score + this.score;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
Symbol 593 MovieClip [bsamurai] Frame 73
var dissam = new Array();
var counter = 0;
while (this.enemy == 0) {
var cuadrante = _root["scuad" + this.cuad].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].eninfirmary == 0) {
if (_root[cuadrante[counter]].intower != 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 150) {
this.desx = _root[cuadrante[counter]]._x;
this.desy = _root[cuadrante[counter]]._y;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.enemy = 1;
if (_root[cuadrante[counter]].tipo == "villager") {
_root[cuadrante[counter]].myenemy = this._name;
}
}
}
}
}
counter = counter + 1;
}
if (this.aratack == 1) {
this.aratack = 0;
if (_root[this.aratacker].intower == 0) {
this.desy = _root[this.aratacker]._y;
this.desx = _root[this.aratacker]._x;
} else {
var myrnddir = random(2);
if (myrnddir < 1) {
this.desy = this._y - 50;
if (this.desy < 200) {
this.desy = 200;
}
} else {
this.desy = this._y + 50;
if (this.desy > 375) {
this.desy = 375;
}
}
this.desx = this._x + (50 * this.xdir);
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (14);
}
if (this._x > 1100) {
this.desx = 700;
this.desy = 250;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
this.xdir = -1;
this._xscale = -100;
this.gotoAndPlay(14);
}
if (this._x < -500) {
this.desx = -200;
this.desy = 250;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
this.xdir = -1;
this._xscale = -100;
this.gotoAndPlay(14);
}
if ((this.enemy == 1) and (this.myenemy == "")) {
gotoAndPlay (14);
}
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
Symbol 593 MovieClip [bsamurai] Frame 88
gotoAndPlay (73);
Symbol 684 MovieClip [bspearman] Frame 1
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 684 MovieClip [bspearman] Frame 2
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 684 MovieClip [bspearman] Frame 3
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 684 MovieClip [bspearman] Frame 4
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 684 MovieClip [bspearman] Frame 5
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 684 MovieClip [bspearman] Frame 6
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 684 MovieClip [bspearman] Frame 7
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 684 MovieClip [bspearman] Frame 8
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 684 MovieClip [bspearman] Frame 9
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 684 MovieClip [bspearman] Frame 10
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + ([this._name] + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["bcuad" + this.cuad] = _root["bcuad" + this.cuad] + (this._name + "x");
}
var cuadrante = _root["scuad" + this.cuad].split("x");
for (var i in cuadrante) {
if (_root[cuadrante[i]].intower != 1) {
if (Math.abs(this._y - _root[cuadrante[i]]._y) < 10) {
if (this.hitTest(_root[cuadrante[i]]) and (_root[cuadrante[i]].alive == 1)) {
this.myenemy = _root[cuadrante[i]]._name;
this.desx = this._x;
this.desy = this._y;
if (_root[cuadrante[i]].myenemy == "") {
_root[cuadrante[i]].myenemy = this._name;
_root[cuadrante[i]].desx = _root[cuadrante[i]]._x;
_root[cuadrante[i]].desy = _root[cuadrante[i]]._y;
_root[cuadrante[i]].gotoAndPlay(11);
}
if (_root[cuadrante[i]]._x < this._x) {
this._xscale = -100;
_root[cuadrante[i]]._xscale = _root[cuadrante[i]].myscale;
} else {
this._xscale = 100;
_root[cuadrante[i]]._xscale = -_root[cuadrante[i]].myscale;
}
this.gotoAndPlay(11);
}
}
}
}
if (this.myenemy == "") {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (1);
} else {
if (this.hitTest(_root.borderinfirmary) and (this.infirmary == 1)) {
this.eninfirmary = 1;
this._y = -100;
}
this.desx = this._x;
this.desy = this._y;
gotoAndPlay (46);
this.enemy = 0;
}
}
if (this.alive == 0) {
gotoAndPlay (38);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
Symbol 684 MovieClip [bspearman] Frame 22
_root.sword2.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if (_root[this.myenemy].tipo == "hsamurai") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (46);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].fatality = 1;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (46);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (38);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
gotoAndPlay (11);
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (46);
}
}
Symbol 684 MovieClip [bspearman] Frame 23
_root.arg.start();
Symbol 684 MovieClip [bspearman] Frame 37
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
_root.score = _root.score + (2 * this.score);
this.samuraicuadro._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
Symbol 684 MovieClip [bspearman] Frame 38
_root.arg.start();
Symbol 684 MovieClip [bspearman] Frame 45
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
_root.score = _root.score + this.score;
this.samuraicuadro._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["bcuad" + this.cuad].split(rp);
_root["bcuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
Symbol 684 MovieClip [bspearman] Frame 46
var dissam = new Array();
var counter = 0;
while (this.enemy == 0) {
var cuadrante = _root["scuad" + this.cuad].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].eninfirmary == 0) {
if (_root[cuadrante[counter]].intower != 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 150) {
this.desx = _root[cuadrante[counter]]._x;
this.desy = _root[cuadrante[counter]]._y;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(1);
this.enemy = 1;
if (_root[cuadrante[counter]].tipo == "villager") {
_root[cuadrante[counter]].myenemy = this._name;
}
}
}
}
}
counter = counter + 1;
}
if (this.aratack == 1) {
this.aratack = 0;
if (_root[this.aratacker].intower == 0) {
this.desy = _root[this.aratacker]._y;
this.desx = _root[this.aratacker]._x;
} else {
var myrnddir = random(2);
if (myrnddir < 1) {
this.desy = this._y - 50;
if (this.desy < 200) {
this.desy = 200;
}
} else {
this.desy = this._y + 50;
if (this.desy > 375) {
this.desy = 375;
}
}
this.desx = this._x + (50 * this.xdir);
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (1);
}
if (this._x > 1100) {
this.desx = 700;
this.desy = 250;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
this.xdir = -1;
this._xscale = -100;
this.gotoAndPlay(14);
}
if (this._x < -500) {
this.desx = -200;
this.desy = 250;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
this.xdir = -1;
this._xscale = -100;
this.gotoAndPlay(14);
}
if ((this.enemy == 1) and (this.myenemy == "")) {
gotoAndPlay (1);
}
if (this.alive == 0) {
gotoAndPlay (38);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
Symbol 684 MovieClip [bspearman] Frame 47
gotoAndPlay (46);
Symbol 751 MovieClip [caballo] Frame 13
_root.sword2.start();
if (random(11) < this.agility) {
_root[this.myenemy].hp = _root[this.myenemy].hp + (-this.strength);
if (_root[this.myenemy].tipo == "bsamurai") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if (_root[this.myenemy].tipo == "barcher") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (37);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (37);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (23);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
gotoAndPlay (1);
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (37);
}
}
Symbol 751 MovieClip [caballo] Frame 14
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 751 MovieClip [caballo] Frame 15
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 751 MovieClip [caballo] Frame 16
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 751 MovieClip [caballo] Frame 17
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 751 MovieClip [caballo] Frame 18
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 751 MovieClip [caballo] Frame 19
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 751 MovieClip [caballo] Frame 20
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 751 MovieClip [caballo] Frame 21
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 360) {
_y = 360;
}
if (_y <= 170) {
_y = 170;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 751 MovieClip [caballo] Frame 22
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + ([this._name] + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + (this._name + "x");
}
var cuadrante = _root["bcuad" + this.cuad].split("x");
for (var i in cuadrante) {
if ((Math.abs(this._y - _root[cuadrante[i]]._y) < 20) and (Math.abs(this._x - _root[cuadrante[i]]._x) < 20)) {
if (this.hitTest(_root[cuadrante[i]]) and (_root[cuadrante[i]].alive == 1)) {
this.myenemy = _root[cuadrante[i]]._name;
this.desx = this._x;
this.desy = this._y;
this.potential = "";
if (_root[cuadrante[i]].myenemy == "") {
_root[cuadrante[i]].myenemy = this._name;
_root[cuadrante[i]].desx = _root[cuadrante[i]]._x;
_root[cuadrante[i]].desy = _root[cuadrante[i]]._y;
_root[cuadrante[i]].gotoAndPlay(1);
}
if (_root[cuadrante[i]]._x < this._x) {
this._xscale = -100;
_root[cuadrante[i]]._xscale = _root[cuadrante[i]].myscale;
} else {
this._xscale = 100;
_root[cuadrante[i]]._xscale = -_root[cuadrante[i]].myscale;
}
this.gotoAndPlay(1);
}
}
}
if (this.myenemy == "") {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (14);
} else {
if (this.hitTest(_root.borderinfirmary) and (this.infirmary == 1)) {
this.eninfirmary = 1;
this._y = -100;
}
if ((this.potential != "") and (_root[this.potential].alive == 1)) {
this.desx = _root[this.potential]._x;
this.desy = _root[this.potential]._y;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
} else {
this.desx = this._x;
this.desy = this._y;
gotoAndPlay (37);
this.enemy = 0;
}
}
}
if (this.alive == 0) {
gotoAndPlay (23);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
Symbol 751 MovieClip [caballo] Frame 23
_root.arg.start();
Symbol 751 MovieClip [caballo] Frame 36
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
proximoyb = xc + 1;
while (_root.getInstanceAtDepth(proximoyb) != undefined) {
proximoyb = proximoyb + 1;
}
this.samuraicuadro._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 20});
_root.attachMovie("caballosolo", "caballosolo" + _root.blood2, proximoyb, {_x:this._x, _y:this._y});
_root["caballosolo" + _root.blood2]._xscale = 100 * this.xdir;
_root["caballosolo" + _root.blood2]._yscale = 100;
_root["caballosolo" + _root.blood2].xdir = this.xdir * 4;
_root.blood2 = _root.blood2 + 1;
if ((_root.elpanel == "caballopanel") and (_root.spanelshow == this._name)) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "castlepanel";
_root.castlepanel._y = 400;
}
Symbol 751 MovieClip [caballo] Frame 37
var dissam = new Array();
var counter = 0;
var estemid = 0;
if (this.eninfirmary == 0) {
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + this.cuad].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].alive == 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 150) {
if (this._x < _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == -1) {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + this._x;
} else {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + _root[cuadrante[counter]]._x;
}
}
if (this._x > _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == 1) {
this.desx = ((this._x - _root[cuadrante[counter]]._x) / 2) + _root[cuadrante[counter]]._x;
} else {
this.desx = _root[cuadrante[counter]]._x - ((this._x - _root[cuadrante[counter]]._x) / 2);
}
}
this.desy = _root[cuadrante[counter]]._y;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.enemy = 1;
this.potential = _root[cuadrante[counter]]._name;
}
}
}
counter = counter + 1;
}
if (this.enemy == 0) {
counter = 0;
estemid = this.cuad + 1;
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + estemid].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].alive == 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 450) {
if (this._x < _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == -1) {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + this._x;
} else {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + _root[cuadrante[counter]]._x;
}
}
if (this._x > _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == 1) {
this.desx = ((this._x - _root[cuadrante[counter]]._x) / 2) + _root[cuadrante[counter]]._x;
} else {
this.desx = _root[cuadrante[counter]]._x - ((this._x - _root[cuadrante[counter]]._x) / 2);
}
}
this.desy = _root[cuadrante[counter]].desy;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.enemy = 1;
this.potential = _root[cuadrante[counter]]._name;
}
}
}
counter = counter + 1;
}
}
if (this.enemy == 0) {
counter = 0;
estemid = this.cuad - 1;
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + estemid].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].alive == 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 450) {
if (this._x < _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == -1) {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + this._x;
} else {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + _root[cuadrante[counter]]._x;
}
}
if (this._x > _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == 1) {
this.desx = ((this._x - _root[cuadrante[counter]]._x) / 2) + _root[cuadrante[counter]]._x;
} else {
this.desx = _root[cuadrante[counter]]._x - ((this._x - _root[cuadrante[counter]]._x) / 2);
}
}
this.desy = _root[cuadrante[counter]].desy;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.enemy = 1;
this.potential = _root[cuadrante[counter]]._name;
}
}
}
counter = counter + 1;
}
}
}
if ((this.enemy == 0) and (this.aratack == 1)) {
this.aratack = 0;
var myrnddir = random(2);
this.desx = _root[this.aratacker]._x;
this.desy = _root[this.aratacker]._y;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (14);
}
if ((this.enemy == 1) and (this.myenemy == "")) {
gotoAndPlay (14);
}
if (this.alive == 0) {
gotoAndPlay (23);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
if (this.eninfirmary == 1) {
this.hp = this.hp + (_root.infirmarylevel / 20);
if (this.hp >= this.ohp) {
this.myhealth._xscale = 100;
this.eninfirmary = 0;
this.infirmary = 0;
this._y = 175;
if (this.hp > this.ohp) {
this.hp = this.ohp;
}
}
}
Symbol 751 MovieClip [caballo] Frame 38
gotoAndPlay (37);
Symbol 754 MovieClip [caballosolo] Frame 1
if ((this._x < -600) or (this._x > 1300)) {
this.removeMovieClip();
}
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 2
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 3
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 4
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 5
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 6
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 7
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 8
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 9
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 10
this._x = this._x + this.xdir;
Symbol 754 MovieClip [caballosolo] Frame 11
this._x = this._x + this.xdir;
Symbol 889 MovieClip [samurai] Frame 1
Symbol 889 MovieClip [samurai] Frame 13
_root.sword1.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if (_root[this.myenemy].tipo == "bspearman") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
f = random(3);
switch (f) {
case 0 :
gotoAndPlay (1);
break;
case 1 :
gotoAndPlay (24);
break;
case 2 :
gotoAndPlay (36);
}
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
}
Symbol 889 MovieClip [samurai] Frame 14
with (this) {
prevx = _x;
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 889 MovieClip [samurai] Frame 15
with (this) {
prevx = _x;
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 889 MovieClip [samurai] Frame 16
with (this) {
prevx = _x;
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 889 MovieClip [samurai] Frame 17
with (this) {
prevx = _x;
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 889 MovieClip [samurai] Frame 18
with (this) {
prevx = _x;
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 889 MovieClip [samurai] Frame 19
with (this) {
prevx = _x;
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 889 MovieClip [samurai] Frame 20
with (this) {
prevx = _x;
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 889 MovieClip [samurai] Frame 21
with (this) {
prevx = _x;
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 889 MovieClip [samurai] Frame 22
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 889 MovieClip [samurai] Frame 23
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + ([this._name] + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + (this._name + "x");
}
var cuadrante = _root["bcuad" + this.cuad].split("x");
for (var i in cuadrante) {
if (Math.abs(this._y - _root[cuadrante[i]]._y) < 20) {
if (this.hitTest(_root[cuadrante[i]]) and (_root[cuadrante[i]].alive == 1)) {
this.myenemy = _root[cuadrante[i]]._name;
this.desx = this._x;
this.desy = this._y;
this.potential = "";
if (_root[cuadrante[i]].myenemy == "") {
_root[cuadrante[i]].myenemy = this._name;
_root[cuadrante[i]].desx = _root[cuadrante[i]]._x;
_root[cuadrante[i]].desy = _root[cuadrante[i]]._y;
_root[cuadrante[i]].gotoAndPlay(1);
}
if (_root[cuadrante[i]]._x < this._x) {
this._xscale = -100;
_root[cuadrante[i]]._xscale = _root[cuadrante[i]].myscale;
} else {
this._xscale = 100;
_root[cuadrante[i]]._xscale = -_root[cuadrante[i]].myscale;
}
this.gotoAndPlay(1);
}
}
}
if (this.myenemy == "") {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (14);
} else {
if (this.hitTest(_root.borderinfirmary) and (this.infirmary == 1)) {
this.eninfirmary = 1;
this._y = -100;
}
if ((this.potential != "") and (_root[this.potential].alive == 1)) {
this.desx = _root[this.potential]._x;
this.desy = _root[this.potential]._y;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
} else {
this.desx = this._x;
this.desy = this._y;
gotoAndPlay (73);
this.enemy = 0;
}
}
}
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
Symbol 889 MovieClip [samurai] Frame 35
_root.sword2.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if (_root[this.myenemy].tipo == "bspearman") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
f = random(3);
switch (f) {
case 0 :
gotoAndPlay (1);
break;
case 1 :
gotoAndPlay (24);
break;
case 2 :
gotoAndPlay (36);
}
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
}
Symbol 889 MovieClip [samurai] Frame 46
_root.sword2.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-2 * this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if (_root[this.myenemy].tipo == "bspearman") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].fatality = 1;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (73);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
f = random(3);
switch (f) {
case 0 :
gotoAndPlay (1);
break;
case 1 :
gotoAndPlay (24);
break;
case 2 :
gotoAndPlay (36);
}
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (73);
}
}
Symbol 889 MovieClip [samurai] Frame 47
_root.arg.start();
Symbol 889 MovieClip [samurai] Frame 61
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
this.samuraicuadro._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
if ((_root.elpanel == "samuraipanel") and (_root.spanelshow == this._name)) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "castlepanel";
_root.castlepanel._y = 400;
}
Symbol 889 MovieClip [samurai] Frame 62
_root.arg.start();
Symbol 889 MovieClip [samurai] Frame 72
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
this.samuraicuadro._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
if ((_root.elpanel == "samuraipanel") and (_root.spanelshow == this._name)) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "castlepanel";
_root.castlepanel._y = 400;
}
Symbol 889 MovieClip [samurai] Frame 73
var dissam = new Array();
var counter = 0;
var estemid = 0;
if (this.eninfirmary == 0) {
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + this.cuad].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].alive == 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 150) {
if (this._x < _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == -1) {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + this._x;
} else {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + _root[cuadrante[counter]]._x;
}
}
if (this._x > _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == 1) {
this.desx = ((this._x - _root[cuadrante[counter]]._x) / 2) + _root[cuadrante[counter]]._x;
} else {
this.desx = _root[cuadrante[counter]]._x - ((this._x - _root[cuadrante[counter]]._x) / 2);
}
}
this.desy = _root[cuadrante[counter]]._y;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.enemy = 1;
this.potential = _root[cuadrante[counter]]._name;
}
}
}
counter = counter + 1;
}
if (this.enemy == 0) {
counter = 0;
estemid = this.cuad + 1;
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + estemid].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].alive == 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 450) {
if (this._x < _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == -1) {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + this._x;
} else {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + _root[cuadrante[counter]]._x;
}
}
if (this._x > _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == 1) {
this.desx = ((this._x - _root[cuadrante[counter]]._x) / 2) + _root[cuadrante[counter]]._x;
} else {
this.desx = _root[cuadrante[counter]]._x - ((this._x - _root[cuadrante[counter]]._x) / 2);
}
}
this.desy = _root[cuadrante[counter]].desy;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.potential = _root[cuadrante[counter]]._name;
this.enemy = 1;
}
}
}
counter = counter + 1;
}
}
if (this.enemy == 0) {
counter = 0;
estemid = this.cuad - 1;
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + estemid].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].alive == 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 450) {
if (this._x < _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == -1) {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + this._x;
} else {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + _root[cuadrante[counter]]._x;
}
}
if (this._x > _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == 1) {
this.desx = ((this._x - _root[cuadrante[counter]]._x) / 2) + _root[cuadrante[counter]]._x;
} else {
this.desx = _root[cuadrante[counter]]._x - ((this._x - _root[cuadrante[counter]]._x) / 2);
}
}
this.desy = _root[cuadrante[counter]].desy;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
this.potential = _root[cuadrante[counter]]._name;
this.enemy = 1;
}
}
}
counter = counter + 1;
}
}
}
if ((this.enemy == 0) and (this.aratack == 1)) {
this.aratack = 0;
var myrnddir = random(2);
this.desx = _root[this.aratacker]._x;
this.desy = _root[this.aratacker]._y;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (14);
}
if ((this.enemy == 1) and (this.myenemy == "")) {
gotoAndPlay (14);
}
if (this.alive == 0) {
gotoAndPlay (62);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (47);
}
if (this.eninfirmary == 1) {
this.hp = this.hp + (_root.infirmarylevel / 2);
if (this.hp >= this.ohp) {
this.myhealth._xscale = 100;
this.eninfirmary = 0;
this.infirmary = 0;
this._y = 175;
if (this.hp > this.ohp) {
this.hp = this.ohp;
}
}
}
Symbol 889 MovieClip [samurai] Frame 88
gotoAndPlay (73);
Symbol 980 MovieClip [spearman] Frame 1
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 980 MovieClip [spearman] Frame 2
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 980 MovieClip [spearman] Frame 3
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 980 MovieClip [spearman] Frame 4
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 980 MovieClip [spearman] Frame 5
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 980 MovieClip [spearman] Frame 6
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 980 MovieClip [spearman] Frame 7
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 980 MovieClip [spearman] Frame 8
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 980 MovieClip [spearman] Frame 9
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 980 MovieClip [spearman] Frame 10
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + ([this._name] + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + (this._name + "x");
}
var cuadrante = _root["bcuad" + this.cuad].split("x");
for (var i in cuadrante) {
if (Math.abs(this._y - _root[cuadrante[i]]._y) < 20) {
if (this.hitTest(_root[cuadrante[i]]) and (_root[cuadrante[i]].alive == 1)) {
this.myenemy = _root[cuadrante[i]]._name;
this.desx = this._x;
this.desy = this._y;
this.potential = "";
if (_root[cuadrante[i]].myenemy == "") {
_root[cuadrante[i]].myenemy = this._name;
_root[cuadrante[i]].desx = _root[cuadrante[i]]._x;
_root[cuadrante[i]].desy = _root[cuadrante[i]]._y;
_root[cuadrante[i]].gotoAndPlay(11);
}
if (_root[cuadrante[i]]._x < this._x) {
this._xscale = -100;
_root[cuadrante[i]]._xscale = _root[cuadrante[i]].myscale;
} else {
this._xscale = 100;
_root[cuadrante[i]]._xscale = -_root[cuadrante[i]].myscale;
}
this.gotoAndPlay(11);
}
}
}
if (this.myenemy == "") {
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (1);
} else {
if (this.hitTest(_root.borderinfirmary) and (this.infirmary == 1)) {
this.eninfirmary = 1;
this._y = -100;
}
if ((this.potential != "") and (_root[this.potential].alive == 1)) {
this.desx = _root[this.potential]._x;
this.desy = _root[this.potential]._y;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(14);
} else {
this.desx = this._x;
this.desy = this._y;
gotoAndPlay (46);
this.enemy = 0;
}
}
}
if (this.alive == 0) {
gotoAndPlay (38);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
Symbol 980 MovieClip [spearman] Frame 22
_root.sword2.start();
if (random(11) < this.agility) {
if (_root[this.myenemy].armor < this.strength) {
_root[this.myenemy].hp = _root[this.myenemy].hp + ((-this.strength) + _root[this.myenemy].armor);
} else {
_root[this.myenemy].hp = _root[this.myenemy].hp + -1;
}
if (_root[this.myenemy].tipo == "bhsamurai") {
_root[this.myenemy].hp = _root[this.myenemy].hp + -2;
}
if ((_root[this.myenemy].hp < 1) and (_root[this.myenemy].hp > -15)) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (46);
}
}
if (_root[this.myenemy].hp <= -15) {
_root[this.myenemy].alive = 0;
_root[this.myenemy].myhealth._visible = false;
this.myenemy = "";
this.enemy = 0;
if (this.alive == 1) {
gotoAndPlay (46);
}
}
_root[this.myenemy].myhealth._xscale = (_root[this.myenemy].hp / _root[this.myenemy].ohp) * 100;
}
if (this.alive == 0) {
gotoAndPlay (38);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
if (this.alive == 1) {
if (this.hitTest(_root[this.myenemy]) and (_root[this.myenemy].alive == 1)) {
gotoAndPlay (11);
} else {
this.myenemy = "";
this.enemy = 0;
gotoAndPlay (46);
}
}
Symbol 980 MovieClip [spearman] Frame 23
_root.arg.start();
Symbol 980 MovieClip [spearman] Frame 37
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
this.samuraicuadro._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
if ((_root.elpanel == "spearmanpanel") and (_root.spanelshow == this._name)) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "castlepanel";
_root.castlepanel._y = 400;
}
Symbol 980 MovieClip [spearman] Frame 38
_root.arg.start();
Symbol 980 MovieClip [spearman] Frame 45
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
this.samuraicuadro._visible = false;
this.nivel1._visible = false;
this.nivel2._visible = false;
this.nivel3._visible = false;
this.nivel4._visible = false;
this.nivel5._visible = false;
rp = this._name + "x";
temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y + 7});
_root.blood2 = _root.blood2 + 1;
if ((_root.elpanel == "spearmanpanel") and (_root.spanelshow == this._name)) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "castlepanel";
_root.castlepanel._y = 400;
}
Symbol 980 MovieClip [spearman] Frame 46
var dissam = new Array();
var counter = 0;
var estemid = 0;
if (this.eninfirmary == 0) {
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + this.cuad].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].alive == 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 150) {
if (this._x < _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == -1) {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + this._x;
} else {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + _root[cuadrante[counter]]._x;
}
}
if (this._x > _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == 1) {
this.desx = ((this._x - _root[cuadrante[counter]]._x) / 2) + _root[cuadrante[counter]]._x;
} else {
this.desx = _root[cuadrante[counter]]._x - ((this._x - _root[cuadrante[counter]]._x) / 2);
}
}
this.desy = _root[cuadrante[counter]]._y;
this.alto = 0;
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(1);
this.enemy = 1;
this.potential = _root[cuadrante[counter]]._name;
}
}
}
counter = counter + 1;
}
if (this.enemy == 0) {
counter = 0;
estemid = this.cuad + 1;
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + estemid].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].alive == 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 450) {
if (this._x < _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == -1) {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + this._x;
} else {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + _root[cuadrante[counter]]._x;
}
}
if (this._x > _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == 1) {
this.desx = ((this._x - _root[cuadrante[counter]]._x) / 2) + _root[cuadrante[counter]]._x;
} else {
this.desx = _root[cuadrante[counter]]._x - ((this._x - _root[cuadrante[counter]]._x) / 2);
}
}
this.desy = _root[cuadrante[counter]].desy;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(1);
this.enemy = 1;
this.potential = _root[cuadrante[counter]]._name;
}
}
}
counter = counter + 1;
}
}
if (this.enemy == 0) {
counter = 0;
estemid = this.cuad - 1;
while (this.enemy == 0) {
var cuadrante = _root["bcuad" + estemid].split("x");
if (counter >= cuadrante.length) {
break;
}
if (random(4) < 1) {
if (_root[cuadrante[counter]].alive == 1) {
if (Math.abs(this._x - _root[cuadrante[counter]]._x) < 450) {
if (this._x < _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == -1) {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + this._x;
} else {
this.desx = ((_root[cuadrante[counter]]._x - this._x) / 2) + _root[cuadrante[counter]]._x;
}
}
if (this._x > _root[cuadrante[counter]]._x) {
if (_root[cuadrante[counter]].xdir == 1) {
this.desx = ((this._x - _root[cuadrante[counter]]._x) / 2) + _root[cuadrante[counter]]._x;
} else {
this.desx = _root[cuadrante[counter]]._x - ((this._x - _root[cuadrante[counter]]._x) / 2);
}
}
this.desy = _root[cuadrante[counter]].desy;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.gotoAndPlay(1);
this.potential = _root[cuadrante[counter]]._name;
this.enemy = 1;
}
}
}
counter = counter + 1;
}
}
}
if ((this.enemy == 0) and (this.aratack == 1)) {
this.aratack = 0;
var myrnddir = random(2);
this.desx = _root[this.aratacker]._x;
this.desy = _root[this.aratacker]._y;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (1);
}
if ((this.enemy == 1) and (this.myenemy == "")) {
gotoAndPlay (1);
}
if (this.alive == 0) {
gotoAndPlay (38);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (23);
}
if (this.eninfirmary == 1) {
this.hp = this.hp + (_root.infirmarylevel / 20);
if (this.hp >= this.ohp) {
this.myhealth._xscale = 100;
this.eninfirmary = 0;
this.infirmary = 0;
this._y = 175;
if (this.hp > this.ohp) {
this.hp = this.ohp;
}
}
}
Symbol 980 MovieClip [spearman] Frame 47
gotoAndPlay (46);
Symbol 1038 MovieClip [tower] Frame 1
stop();
Symbol 1038 MovieClip [tower] Frame 2
stop();
Symbol 1038 MovieClip [tower] Frame 3
stop();
Symbol 1038 MovieClip [tower] Frame 4
stop();
Symbol 1038 MovieClip [tower] Frame 5
stop();
Symbol 1038 MovieClip [tower] Frame 6
stop();
Symbol 1038 MovieClip [tower] Frame 7
stop();
Symbol 1038 MovieClip [tower] Frame 8
stop();
Symbol 1038 MovieClip [tower] Frame 9
stop();
Symbol 1038 MovieClip [tower] Frame 10
stop();
Symbol 1038 MovieClip [tower] Frame 11
stop();
if (this.contructed == 1) {
nextFrame();
}
Symbol 1038 MovieClip [tower] Frame 12
stop();
this.constructed = 1;
this.myhealth._visible = true;
Symbol 1038 MovieClip [tower] Frame 13
stop();
this.myhealth._xscale = 95;
Symbol 1038 MovieClip [tower] Frame 14
stop();
this.myhealth._xscale = 90;
Symbol 1038 MovieClip [tower] Frame 15
stop();
this.myhealth._xscale = 80;
Symbol 1038 MovieClip [tower] Frame 16
stop();
this.myhealth._xscale = 70;
Symbol 1038 MovieClip [tower] Frame 17
stop();
this.myhealth._xscale = 60;
Symbol 1038 MovieClip [tower] Frame 18
stop();
this.myhealth._xscale = 50;
Symbol 1038 MovieClip [tower] Frame 19
stop();
this.myhealth._xscale = 40;
Symbol 1038 MovieClip [tower] Frame 20
stop();
this.myhealth._xscale = 30;
Symbol 1038 MovieClip [tower] Frame 21
stop();
this.myhealth._xscale = 20;
Symbol 1038 MovieClip [tower] Frame 22
stop();
this.myhealth._xscale = 10;
Symbol 1038 MovieClip [tower] Frame 23
stop();
this.myhealth._xscale = 5;
Symbol 1038 MovieClip [tower] Frame 24
play();
_root.towerfall.start();
this.myhealth._visible = false;
this.destroyed = 1;
_root[this.myarcher].alive = 0;
_root[this.myarcher]._y = _root[this.myarcher]._y + 5;
Symbol 1038 MovieClip [tower] Frame 26
_root[this.myarcher]._y = _root[this.myarcher]._y + 5;
Symbol 1038 MovieClip [tower] Frame 28
_root[this.myarcher]._y = _root[this.myarcher]._y + 5;
Symbol 1038 MovieClip [tower] Frame 30
_root[this.myarcher]._y = _root[this.myarcher]._y + 5;
Symbol 1038 MovieClip [tower] Frame 32
_root[this.myarcher]._y = _root[this.myarcher]._y + 5;
Symbol 1038 MovieClip [tower] Frame 34
_root[this.myarcher]._y = _root[this.myarcher]._y + 5;
Symbol 1038 MovieClip [tower] Frame 36
_root[this.myarcher]._y = _root[this.myarcher]._y + 5;
Symbol 1038 MovieClip [tower] Frame 38
if (this.destroyed == 1) {
gotoAndPlay (38);
}
Symbol 1038 MovieClip [tower] Frame 39
stop();
Symbol 1151 MovieClip [villager] Frame 1
if (this.myenemy != "") {
this.desx = this._x + (100 * _root[this.myenemy].xdir);
if (this._y < _root[this.myenemy]._y) {
this.desy = 340;
} else {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
this.myfire = "";
gotoAndPlay (24);
if (_root[this.myenemy].alive == 0) {
this.myenemy = "";
}
if (_root[this.myenemy].enemy == 0) {
this.myenemy = "";
}
}
Symbol 1151 MovieClip [villager] Frame 23
if (this.myfire != "castillo") {
if ((_root[this.myfire].destroyed != 1) and (_root[this.myfire]._currentframe > 12)) {
_root[this.myfire].fire = _root[this.myfire].fire + -1;
_root[this.myfire].prevFrame();
}
if (_root[this.myfire]._currentframe == 12) {
_root[this.myfire].fire = 0;
this.myfire = "";
gotoAndPlay (55);
} else {
gotoAndPlay (1);
}
} else {
if ((_root[this.myfire].destroyed != 1) and (_root[this.myfire]._currentframe > 1)) {
_root[this.myfire].fire = _root[this.myfire].fire + -1;
_root[this.myfire].prevFrame();
}
if (_root[this.myfire]._currentframe == 1) {
_root[this.myfire].fire = 0;
this.myfire = "";
gotoAndPlay (55);
} else {
gotoAndPlay (1);
}
}
Symbol 1151 MovieClip [villager] Frame 24
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 1151 MovieClip [villager] Frame 25
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 1151 MovieClip [villager] Frame 26
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 1151 MovieClip [villager] Frame 27
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 1151 MovieClip [villager] Frame 28
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 1151 MovieClip [villager] Frame 29
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 1151 MovieClip [villager] Frame 30
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 1151 MovieClip [villager] Frame 31
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 1151 MovieClip [villager] Frame 32
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
Symbol 1151 MovieClip [villager] Frame 33
if (this._x < this.cuadmin) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + -1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + ([this._name] + "x");
}
if (this._x > this.cuadmax) {
var rp = (this._name + "x");
var temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
this.cuad = this.cuad + 1;
this.cuadmin = _root["cuadmin" + this.cuad];
this.cuadmax = _root["cuadmax" + this.cuad];
_root["scuad" + this.cuad] = _root["scuad" + this.cuad] + (this._name + "x");
}
if ((((this.xdir == 1) and (this.desx > this._x)) or ((this.xdir == -1) and (this.desx < this._x))) and (((this.ydir == 1) and (this.desy > this._y)) or ((this.ydir == -1) and (this.desy < this._y)))) {
with (this) {
_x = _x + ((-speed) * sinx);
_y = _y + ((-speed) * cosy);
if (_y >= 370) {
_y = 370;
}
if (_y <= 175) {
_y = 175;
}
var proximoy = (Math.round(_y + 25) * 100);
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + 1;
}
}
this.swapDepths(proximoy);
gotoAndPlay (24);
} else {
if (this.hitTest(_root.borderinfirmary) and (this.infirmary == 1)) {
this.eninfirmary = 1;
this._y = -100;
}
this.desx = this._x;
this.desy = this._y;
gotoAndPlay (55);
if (this.hitTest(_root[this.myfire])) {
if (this._y > _root[this.myfire]._y) {
if ((this._x < (_root[this.myfire]._x + 90)) and (this.myfire != "castillo")) {
this._xscale = -100;
} else {
this._xscale = 100;
}
if ((this._x < _root[this.myfire]._x) and (this.myfire == "castillo")) {
this._xscale = 100;
} else {
this._xscale = -100;
}
gotoAndPlay (1);
}
}
this.enemy = 0;
}
if (this.alive == 0) {
gotoAndPlay (34);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (34);
}
Symbol 1151 MovieClip [villager] Frame 34
_root.arg.start();
Symbol 1151 MovieClip [villager] Frame 44
stop();
xc = this.getDepth();
proximoy = xc - 10000;
while (_root.getInstanceAtDepth(proximoy) != undefined) {
proximoy = proximoy + -1;
}
this.swapDepths(proximoy);
thislevel = proximoy - 1;
while (_root.getInstanceAtDepth(thislevel) != undefined) {
thislevel = thislevel + -1;
}
this.samuraicuadro._visible = false;
rp = this._name + "x";
temparray = _root["scuad" + this.cuad].split(rp);
_root["scuad" + this.cuad] = temparray.join("");
_root.attachMovie("blood2", "bloodspill" + _root.blood2, thislevel, {_x:this._x, _y:this._y - 3});
_root.blood2 = _root.blood2 + 1;
if ((_root.elpanel == "villagerpanel") and (_root.spanelshow == this._name)) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "castlepanel";
_root.castlepanel._y = 400;
}
Symbol 1151 MovieClip [villager] Frame 45
_root.martillo.start();
if (this.myenemy != "") {
this.building = 0;
this.mytower = "";
this.buildseq = 0;
_root.villagerpanel.btnupgrade.gotoAndStop(1);
this.desx = this._x + (100 * _root[this.myenemy].xdir);
if (this._y < _root[this.myenemy]._y) {
this.desy = 340;
} else {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
this.myfire = "";
gotoAndPlay (24);
if (_root[this.myenemy].alive == 0) {
this.myenemy = "";
}
if (_root[this.myenemy].enemy == 0) {
this.myenemy = "";
}
}
Symbol 1151 MovieClip [villager] Frame 54
this.buildseq = this.buildseq + 1;
if (this.buildseq == 1) {
if (_root[this.mytower]._currentframe < 12) {
_root[this.mytower].nextFrame();
}
if (_root[this.mytower]._currentframe == 12) {
this.building = 0;
this.mytower = "";
this.buildseq = 0;
_root.villagerpanel.btnupgrade.gotoAndStop(1);
gotoAndPlay (55);
} else {
gotoAndPlay (45);
}
}
if (this.buildseq == 2) {
this.buildseq = 0;
}
Symbol 1151 MovieClip [villager] Frame 55
if (this.eninfirmary == 1) {
this.hp = this.hp + (_root.infirmarylevel / 20);
if (this.hp >= this.ohp) {
this.myhealth._xscale = 100;
this.eninfirmary = 0;
this.infirmary = 0;
this._y = 175;
if (this.hp > this.ohp) {
this.hp = this.ohp;
}
}
}
if (this.eninfirmary != 1) {
if (this.building == 1) {
xc = this.getDepth();
if (_root.getInstanceAtDepth(xc + 10) == undefined) {
this.building = 0;
if (this.xdir == -1) {
myx = this._x - 150;
} else {
myx = this._x - 77;
}
if (this._y > 350) {
myplusy = 20;
} else {
myplusy = 0;
}
var thistower = _root.attachMovie("tower", "tower" + _root.towern, xc + 10, {_x:myx, _y:(this._y - 35) - myplusy});
_root["tower" + _root.towern].ronda = 0;
_root["tower" + _root.towern].fire = 0;
_root["tower" + _root.towern].myfire = 0;
_root["tower" + _root.towern].destroyed = 0;
_root["tower" + _root.towern].hp = 0;
_root["tower" + _root.towern].myarcher = "";
_root["tower" + _root.towern].constructed = 0;
_root["tower" + _root.towern].myhealth._visible = false;
thistower.onEnterFrame = function () {
if (_root.pausa == 0) {
if (this._currentframe < 24) {
if (this.fire > 0) {
this.ronda = this.ronda + 1;
}
if (this.ronda == 75) {
this.nextFrame();
this.hp = this.hp + -1;
this.ronda = 0;
}
}
}
};
this.mytower = _root["tower" + _root.towern]._name;
_root.towern = _root.towern + 1;
gotoAndPlay (45);
}
}
i = 0;
while (i < _root.towern) {
if (this.hitTest(_root["tower" + i])) {
if (_root["tower" + i]._currentframe < 12) {
if (this._y > _root["tower" + i]._y) {
this.mytower = "tower" + i;
gotoAndPlay (45);
}
}
if ((_root["tower" + i]._currentframe > 12) and (_root["tower" + i]._currentframe < 23)) {
if (this._y > _root["tower" + i]._y) {
this.myfire = "tower" + i;
gotoAndPlay (1);
}
}
}
i++;
}
if (this.myenemy != "") {
this.desx = this._x + (100 * _root[this.myenemy].xdir);
if (this._y < _root[this.myenemy]._y) {
this.desy = 340;
} else {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
this.myfire = "";
gotoAndPlay (24);
if (_root[this.myenemy].alive == 0) {
this.myenemy = "";
}
if (_root[this.myenemy].enemy == 0) {
this.myenemy = "";
}
}
if (this.aratack == 1) {
this.aratack = 0;
var myrnddir = random(2);
if (myrnddir < 1) {
this.desy = this._y - 50;
if (this.desy < 200) {
this.desy = 200;
}
} else {
this.desy = this._y + 50;
if (this.desy > 375) {
this.desy = 375;
}
}
this.desx = this._x + (50 * this.xdir);
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
gotoAndPlay (24);
}
if (this.myenemy == "") {
var countf = 0;
if (this.myfire == "") {
if (_root.castillo.fire > 0) {
this.desx = 175;
this.desy = 175;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.enemy = 1;
this.myfire = _root.castillo._name;
this.gotoAndPlay(24);
}
}
while (this.myfire == "") {
if ((_root["tower" + countf].fire > 0) and (_root["tower" + countf].destroyed == 0)) {
this.desx = _root["tower" + countf]._x + 110;
this.desy = _root["tower" + countf]._y + 50;
this.alto = 0;
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
this.enemy = 1;
this.myfire = _root["tower" + countf]._name;
this.gotoAndPlay(24);
}
if (countf == _root.towern) {
break;
}
countf = countf + 1;
}
}
if (this.alive == 0) {
gotoAndPlay (34);
}
if (this.fatality == 1) {
this.alive = 0;
gotoAndPlay (34);
}
}
if (_root[this.myfire].destroyed == 1) {
this.myfire = "";
}
Symbol 1151 MovieClip [villager] Frame 56
gotoAndPlay (55);
Symbol 1184 MovieClip [blood2] Frame 16
stop();
Symbol 1186 MovieClip Frame 1
stop();
Symbol 1188 MovieClip Frame 1
stop();
Symbol 1196 Button
on (press) {
gotoAndStop (12);
}
Symbol 1198 Button
on (press) {
var midireccion = this._url;
var gid = "2446";
getURL ("http://www.zupagames.com/in.php", "_blank", "POST");
}
Symbol 1201 Button
on (press) {
_root.mygame = "easy";
gotoAndStop (5);
}
Symbol 1205 Button
on (press) {
_root.mygame = "hard";
gotoAndStop (5);
}
Symbol 1209 Button
on (press) {
_root.mygame = "medium";
gotoAndStop (5);
}
Symbol 1213 Button
on (press) {
_root.mygame = "mayhem";
gotoAndStop (5);
}
Symbol 1245 Button
on (press) {
if (_root.pausa == 0) {
if (_root[_root.spanelshow].upgrading != 1) {
if ((_root.gold - this.cost.text) > 0) {
_root[_root.spanelshow].upgrading = 1;
_root.gold = _root.gold + (-this.cost.text);
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
}
Symbol 1260 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.pausa == 0) {
this.slevel.text = _root[_root.spanelshow].rank;
this.shp.text = _root[_root.spanelshow].hp;
this.smaxhp.text = _root[_root.spanelshow].ohp;
this.sattact.text = _root[_root.spanelshow].strength;
this.sarmor.text = _root[_root.spanelshow].armor;
this.cost.text = _root.arupcost[_root[_root.spanelshow].rank];
this.narmort.text = "+ " + _root.aruparmor[_root[_root.spanelshow].rank + 1];
this.nmaxhpt.text = "+ " + _root.arupohp[_root[_root.spanelshow].rank + 1];
this.nattackt.text = "+ " + _root.arupstrength[_root[_root.spanelshow].rank + 1];
if (_root[_root.spanelshow].upgrading == 1) {
this.upgrading._visible = true;
this.upgrading._xscale = (_root[_root.spanelshow].esteup / 48) * 100;
} else {
this.upgrading._visible = false;
}
if (_root[_root.spanelshow].rank == 5) {
this.cost._visible = false;
this.btnupgrade._visible = false;
this.costtxt._visible = false;
this.goldtxt._visible = false;
this.narmort._visible = false;
this.nmaxhpt._visible = false;
this.nattackt._visible = false;
this.narmor._visible = false;
this.nmaxhp._visible = false;
this.nattack._visible = false;
this.nlevel._visible = false;
} else {
this.cost._visible = true;
this.btnupgrade._visible = true;
this.costtxt._visible = true;
this.goldtxt._visible = true;
this.narmort._visible = true;
this.nmaxhpt._visible = true;
this.nattackt._visible = true;
this.narmor._visible = true;
this.nmaxhp._visible = true;
this.nattack._visible = true;
this.nlevel._visible = true;
}
}
};
Symbol 1281 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.pausa == 0) {
this.slevel.text = _root[_root.spanelshow].rank;
this.shp.text = _root[_root.spanelshow].hp;
this.smaxhp.text = _root[_root.spanelshow].ohp;
this.sattact.text = _root[_root.spanelshow].strength;
this.sarmor.text = _root[_root.spanelshow].armor;
this.cost.text = _root.supcost[_root[_root.spanelshow].rank];
this.narmort.text = "+ " + _root.suparmor[_root[_root.spanelshow].rank + 1];
this.nmaxhpt.text = "+ " + _root.supohp[_root[_root.spanelshow].rank + 1];
this.nattackt.text = "+ " + _root.supstrength[_root[_root.spanelshow].rank + 1];
if (_root[_root.spanelshow].upgrading == 1) {
this.upgrading._visible = true;
this.upgrading._xscale = (_root[_root.spanelshow].esteup / 48) * 100;
} else {
this.upgrading._visible = false;
}
if (_root[_root.spanelshow].rank == 5) {
this.cost._visible = false;
this.btnupgrade._visible = false;
this.costtxt._visible = false;
this.goldtxt._visible = false;
this.narmort._visible = false;
this.nmaxhpt._visible = false;
this.nattackt._visible = false;
this.narmor._visible = false;
this.nmaxhp._visible = false;
this.nattack._visible = false;
this.nlevel._visible = false;
} else {
this.cost._visible = true;
this.btnupgrade._visible = true;
this.costtxt._visible = true;
this.goldtxt._visible = true;
this.narmort._visible = true;
this.nmaxhpt._visible = true;
this.nattackt._visible = true;
this.narmor._visible = true;
this.nmaxhp._visible = true;
this.nattack._visible = true;
this.nlevel._visible = true;
}
}
};
Symbol 1290 Button
on (press) {
if (_root.pausa == 0) {
if (_root[_root.spanelshow].upgrading != 1) {
if ((_root.gold - this.cost.text) > 0) {
_root[_root.spanelshow].upgrading = 1;
_root.gold = _root.gold + (-this.cost.text);
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
}
Symbol 1302 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.pausa == 0) {
this.slevel.text = _root[_root.spanelshow].rank;
this.shp.text = _root[_root.spanelshow].hp;
this.smaxhp.text = _root[_root.spanelshow].ohp;
this.sattact.text = _root[_root.spanelshow].strength;
this.sarmor.text = _root[_root.spanelshow].armor;
this.cost.text = _root.supcost[_root[_root.spanelshow].rank];
this.narmort.text = "+ " + _root.suparmor[_root[_root.spanelshow].rank + 1];
this.nmaxhpt.text = "+ " + _root.supohp[_root[_root.spanelshow].rank + 1];
this.nattackt.text = "+ " + _root.supstrength[_root[_root.spanelshow].rank + 1];
if (_root[_root.spanelshow].upgrading == 1) {
this.upgrading._visible = true;
this.upgrading._xscale = (_root[_root.spanelshow].esteup / 48) * 100;
} else {
this.upgrading._visible = false;
}
if (_root[_root.spanelshow].rank == 5) {
this.cost._visible = false;
this.btnupgrade._visible = false;
this.costtxt._visible = false;
this.goldtxt._visible = false;
this.narmort._visible = false;
this.nmaxhpt._visible = false;
this.nattackt._visible = false;
this.narmor._visible = false;
this.nmaxhp._visible = false;
this.nattack._visible = false;
this.nlevel._visible = false;
} else {
this.cost._visible = true;
this.btnupgrade._visible = true;
this.costtxt._visible = true;
this.goldtxt._visible = true;
this.narmort._visible = true;
this.nmaxhpt._visible = true;
this.nattackt._visible = true;
this.narmor._visible = true;
this.nmaxhp._visible = true;
this.nattack._visible = true;
this.nlevel._visible = true;
}
}
};
Symbol 1310 Button
on (press) {
if (_root.pausa == 0) {
if (_root[_root.spanelshow].upgrading != 1) {
if ((_root.gold - this.cost.text) > 0) {
_root[_root.spanelshow].upgrading = 1;
_root.gold = _root.gold + (-this.cost.text);
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
}
Symbol 1322 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.pausa == 0) {
this.slevel.text = _root[_root.spanelshow].rank;
this.shp.text = _root[_root.spanelshow].hp;
this.smaxhp.text = _root[_root.spanelshow].ohp;
this.sattact.text = _root[_root.spanelshow].strength;
this.sarmor.text = _root[_root.spanelshow].armor;
this.cost.text = _root.spupcost[_root[_root.spanelshow].rank];
this.narmort.text = "+ " + _root.spuparmor[_root[_root.spanelshow].rank + 1];
this.nmaxhpt.text = "+ " + _root.spupohp[_root[_root.spanelshow].rank + 1];
this.nattackt.text = "+ " + _root.spupstrength[_root[_root.spanelshow].rank + 1];
if (_root[_root.spanelshow].upgrading == 1) {
this.upgrading._visible = true;
this.upgrading._xscale = (_root[_root.spanelshow].esteup / 48) * 100;
} else {
this.upgrading._visible = false;
}
if (_root[_root.spanelshow].rank == 5) {
this.cost._visible = false;
this.btnupgrade._visible = false;
this.costtxt._visible = false;
this.goldtxt._visible = false;
this.narmort._visible = false;
this.nmaxhpt._visible = false;
this.nattackt._visible = false;
this.narmor._visible = false;
this.nmaxhp._visible = false;
this.nattack._visible = false;
this.nlevel._visible = false;
} else {
this.cost._visible = true;
this.btnupgrade._visible = true;
this.costtxt._visible = true;
this.goldtxt._visible = true;
this.narmort._visible = true;
this.nmaxhpt._visible = true;
this.nattackt._visible = true;
this.narmor._visible = true;
this.nmaxhp._visible = true;
this.nattack._visible = true;
this.nlevel._visible = true;
}
}
};
Symbol 1327 Button
on (press) {
_root.yesno.swapDepths(_root.getNextHighestDepth());
_root.yesno._y = 250;
}
Symbol 1329 Button
on (press) {
if (_root.musicapau == 0) {
_root.musicapau = 1;
_root.bluefire.stop();
_root.mimenu.musicon.text = "Music Off";
} else {
_root.musicapau = 0;
_root.bluefire.start(2, 1000);
_root.mimenu.musicon.text = "Music On";
}
}
Symbol 1331 Button
on (press) {
_root.pausa = 0;
_root.normalpanel.pusatexto.text = "Pause";
_root.castlepanel.play();
_root.infirmarypanel.play();
_root.samuraipanel.play();
_root.normalpanel.play();
_root.caballopanel.play();
_root.spearmanpanel.play();
_root.villagerpanel.play();
_root.archerpanel.play();
_root.tabernpanel.play();
_root.blacksmithpanel.play();
i = 0;
while (i < (_root.arrown + 1)) {
_root["arrow" + i].play();
i++;
}
i = 0;
while (i < (_root.sn + 1)) {
if (_root["samurai" + i].alive == 1) {
_root["samurai" + i].play();
}
i++;
}
i = 0;
while (i < (_root.hsn + 1)) {
if (_root["caballo" + i].alive == 1) {
_root["caballo" + i].play();
}
i++;
}
i = 0;
while (i < (_root.spn + 1)) {
if (_root["spearman" + i].alive == 1) {
_root["spearman" + i].play();
}
i++;
}
i = 0;
while (i < (_root.arn + 1)) {
if (_root["archer" + i].alive == 1) {
_root["archer" + i].play();
}
i++;
}
i = 0;
while (i < (_root.vn + 1)) {
if (_root["villager" + i].alive == 1) {
_root["villager" + i].play();
}
i++;
}
i = 0;
while (i < (_root.bss + 1)) {
if (_root["bsamurai" + i].alive == 1) {
_root["bsamurai" + i].play();
}
i++;
}
i = 0;
while (i < (_root.bhss + 1)) {
if (_root["bcaballo" + i].alive == 1) {
_root["bcaballo" + i].play();
}
i++;
}
i = 0;
while (i < (_root.bsps + 1)) {
if (_root["bspearman" + i].alive == 1) {
_root["bspearman" + i].play();
}
i++;
}
i = 0;
while (i < (_root.bac + 1)) {
if (_root["barcher" + i].alive == 1) {
_root["barcher" + i].play();
}
i++;
}
i = 0;
while (i < (_root.bcf + 1)) {
if (_root["bcfire" + i].alive == 1) {
_root["bcfire" + i].play();
}
i++;
}
i = 0;
while (i < (_root.blood2 + 1)) {
_root["caballosolo" + i].play();
i++;
}
_root.mimenu._y = 800;
}
Symbol 1336 Button
on (press) {
if (_root.pausa == 0) {
if (_root.infirmaryupgrading != 1) {
if ((_root.gold - this.cost.text) > 0) {
_root.infirmaryupgrading = 1;
_root.gold = _root.gold + (-this.cost.text);
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
}
Symbol 1344 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.pausa == 0) {
if (_root.infirmaryupgrading == 1) {
_root.inesteup = _root.inesteup + 1;
if (_root.inesteup == 120) {
_root.infirmarylevel = _root.infirmarylevel + 1;
_root.infirmaryupgrading = 0;
_root.inesteup = 0;
}
}
this.slevel.text = _root.infirmarylevel;
this.rspeed.text = _root.infirmaryplus[_root.infirmarylevel + 1];
this.cost.text = _root.infirmarycost[_root.infirmarylevel + 1];
if (_root.infirmaryupgrading == 1) {
this.upgrading._visible = true;
this.upgrading._xscale = (_root.inesteup / 120) * 100;
} else {
this.upgrading._visible = false;
}
if (_root.infirmarylevel == 3) {
this.cost._visible = false;
this.btnupgrade._visible = false;
this.costtxt._visible = false;
this.goldtxt._visible = false;
this.rspeed._visible = false;
this.recsp._visible = false;
this.nlevel._visible = false;
} else {
this.cost._visible = true;
this.btnupgrade._visible = true;
this.costtxt._visible = true;
this.goldtxt._visible = true;
this.rspeed._visible = true;
this.recsp._visible = true;
this.nlevel._visible = true;
}
}
};
Symbol 1348 Button
on (press) {
if (_root.pausa == 0) {
if (_root.armorupgrading != 1) {
if ((_root.gold - this.cost.text) > 0) {
_root.armorupgrading = 1;
_root.gold = _root.gold + (-this.cost.text);
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
}
Symbol 1357 Button
on (press) {
if (_root.pausa == 0) {
if (_root.weaponsupgrading != 1) {
if ((_root.gold - this.cost2.text) > 0) {
_root.weaponsupgrading = 1;
_root.gold = _root.gold + (-this.cost2.text);
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
}
Symbol 1365 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.pausa == 0) {
if (_root.armorupgrading == 1) {
_root.aresteup = _root.aresteup + 1;
if (_root.aresteup == 120) {
_root.basicarmor = _root.basicarmor + _root.armorplus[_root.armorlevel + 1];
i = 0;
while (i < (_root.sn + 1)) {
_root["samurai" + i].armor = _root["samurai" + i].armor + _root.armorplus[_root.armorlevel + 1];
i++;
}
i = 0;
while (i < (_root.hsn + 1)) {
_root["hsamurai" + i].armor = _root["hsamurai" + i].armor + _root.armorplus[_root.armorlevel + 1];
i++;
}
i = 0;
while (i < (_root.spn + 1)) {
_root["spearman" + i].armor = _root["spearman" + i].armor + _root.armorplus[_root.armorlevel + 1];
i++;
}
i = 0;
while (i < (_root.arn + 1)) {
_root["archer" + i].armor = _root["archer" + i].armor + _root.armorplus[_root.armorlevel + 1];
i++;
}
i = 0;
while (i < (_root.vn + 1)) {
_root["villager" + i].armor = _root["villager" + i].armor + _root.armorplus[_root.armorlevel + 1];
i++;
}
_root.armorlevel = _root.armorlevel + 1;
_root.armorupgrading = 0;
_root.aresteup = 0;
}
}
if (_root.weaponsupgrading == 1) {
_root.weesteup = _root.weesteup + 1;
if (_root.weesteup == 120) {
_root.sstrength = _root.sstrength + _root.weaponsplus[_root.weaponslevel + 1];
_root.spstrength = _root.spstrength + _root.weaponsplus[_root.weaponslevel + 1];
_root.hsstrength = _root.hsstrength + _root.weaponsplus[_root.weaponslevel + 1];
_root.arstrength = _root.arstrength + _root.weaponsplus[_root.weaponslevel + 1];
i = 0;
while (i < (_root.sn + 1)) {
_root["samurai" + i].strength = _root["samurai" + i].strength + _root.weaponsplus[_root.weaponslevel + 1];
i++;
}
i = 0;
while (i < (_root.hsn + 1)) {
_root["hsamurai" + i].strength = _root["hsamurai" + i].strength + _root.weaponsplus[_root.weaponslevel + 1];
i++;
}
i = 0;
while (i < (_root.spn + 1)) {
_root["spearman" + i].strength = _root["spearman" + i].strength + _root.weaponsplus[_root.weaponslevel + 1];
i++;
}
i = 0;
while (i < (_root.arn + 1)) {
_root["archer" + i].strength = _root["archer" + i].strength + _root.weaponsplus[_root.weaponslevel + 1];
i++;
}
i = 0;
while (i < (_root.vn + 1)) {
_root["villager" + i].strength = _root["villager" + i].strength + _root.weaponsplus[_root.weaponslevel + 1];
i++;
}
_root.weaponslevel = _root.weaponslevel + 1;
_root.weaponsupgrading = 0;
_root.weesteup = 0;
}
}
this.slevel.text = _root.armorlevel;
this.rspeed.text = _root.armorplus[_root.armorlevel + 1];
this.cost.text = _root.armorcost[_root.armorlevel + 1];
this.slevel2.text = _root.weaponslevel;
this.rspeed2.text = _root.weaponsplus[_root.weaponslevel + 1];
this.cost2.text = _root.weaponscost[_root.weaponslevel + 1];
if (_root.armorupgrading == 1) {
this.upgrading._visible = true;
this.upgrading._xscale = (_root.aresteup / 120) * 100;
} else {
this.upgrading._visible = false;
}
if (_root.weaponsupgrading == 1) {
this.upgrading2._visible = true;
this.upgrading2._xscale = (_root.weesteup / 120) * 100;
} else {
this.upgrading2._visible = false;
}
if (_root.armorlevel == 5) {
this.cost._visible = false;
this.btnupgrade._visible = false;
this.costtxt._visible = false;
this.goldtxt._visible = false;
this.rspeed._visible = false;
this.recsp._visible = false;
this.nlevel._visible = false;
} else {
this.cost._visible = true;
this.btnupgrade._visible = true;
this.costtxt._visible = true;
this.goldtxt._visible = true;
this.rspeed._visible = true;
this.recsp._visible = true;
this.nlevel._visible = true;
}
if (_root.weaponslevel == 5) {
this.cost2._visible = false;
this.btnupgrade2._visible = false;
this.costtxt2._visible = false;
this.goldtxt2._visible = false;
this.rspeed2._visible = false;
this.recsp2._visible = false;
this.nlevel2._visible = false;
} else {
this.cost2._visible = true;
this.btnupgrade2._visible = true;
this.costtxt2._visible = true;
this.goldtxt2._visible = true;
this.rspeed2._visible = true;
this.recsp2._visible = true;
this.nlevel2._visible = true;
}
}
};
Symbol 1370 Button
on (rollOver) {
if (_root.castlepanel.creating != 1) {
infotexto = "Speed: 2\t\tCost: 10 gold\rHP: 10\rUsed to build towers, extinguish fires, and repair buildings.";
_root.castlepanel.titleinfo.text = "Villager";
_root.castlepanel.castleinfo.text = infotexto;
}
}
on (rollOut) {
if (_root.castlepanel.creating != 1) {
_root.castlepanel.castleinfo.text = "";
_root.castlepanel.titleinfo.text = "";
}
}
on (release) {
if (_root.pausa == 0) {
if ((_root.gold - 10) > 0) {
_root.gold = _root.gold + -10;
n = 0;
while (n <= 7) {
_root.castlepanel["miicono" + n].removeMovieClip();
n++;
}
_root.creaque.push("Villager");
var fg = 0;
m = 0;
while (m <= 7) {
fg = fg + 25;
tot = 210 + fg;
switch (_root.creaque[m]) {
case "Samurai" :
_root.castlepanel.attachMovie("samuraig2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Horse Samurai" :
_root.castlepanel.attachMovie("caballog2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:12});
_root.castlepanel["miicono" + m]._xscale = 12;
_root.castlepanel["miicono" + m]._yscale = 12;
break;
case "Spearman" :
_root.castlepanel.attachMovie("spearmang2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Archer" :
_root.castlepanel.attachMovie("archerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:23});
_root.castlepanel["miicono" + m]._xscale = 8.5;
_root.castlepanel["miicono" + m]._yscale = 8.5;
break;
case "Villager" :
_root.castlepanel.attachMovie("villagerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
}
m++;
}
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
Symbol 1373 Button
on (rollOver) {
if (_root.castlepanel.creating != 1) {
infotexto = "Attack: 2\t\tCost: 20 gold\rSpeed: 1\t\tHP: 10\rArmor: 1\rAdvantage over Horse Samurai\rDisadvantage against Samurai";
_root.castlepanel.titleinfo.text = "Spearman ";
_root.castlepanel.castleinfo.text = infotexto;
}
}
on (rollOut) {
if (_root.castlepanel.creating != 1) {
_root.castlepanel.castleinfo.text = "";
_root.castlepanel.titleinfo.text = "";
}
}
on (release) {
if (_root.pausa == 0) {
if ((_root.gold - 20) > 0) {
_root.gold = _root.gold + -20;
n = 0;
while (n <= 7) {
_root.castlepanel["miicono" + n].removeMovieClip();
n++;
}
_root.creaque.push("Spearman");
var fg = 0;
m = 0;
while (m <= 7) {
fg = fg + 25;
tot = 210 + fg;
switch (_root.creaque[m]) {
case "Samurai" :
_root.castlepanel.attachMovie("samuraig2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Horse Samurai" :
_root.castlepanel.attachMovie("caballog2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:12});
_root.castlepanel["miicono" + m]._xscale = 12;
_root.castlepanel["miicono" + m]._yscale = 12;
break;
case "Spearman" :
_root.castlepanel.attachMovie("spearmang2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Archer" :
_root.castlepanel.attachMovie("archerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:23});
_root.castlepanel["miicono" + m]._xscale = 8.5;
_root.castlepanel["miicono" + m]._yscale = 8.5;
break;
case "Villager" :
_root.castlepanel.attachMovie("villagerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
}
m++;
}
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
Symbol 1376 Button
on (rollOver) {
if (_root.castlepanel.creating != 1) {
infotexto = "Attack: 2\t\tCost: 30 gold\rSpeed: 3\t\tHP: 10\rArmor: 1\rAdvantage over Spearman\rDisadvantage against Horse Samurai";
_root.castlepanel.titleinfo.text = "Samurai";
_root.castlepanel.castleinfo.text = infotexto;
}
}
on (rollOut) {
if (_root.castlepanel.creating != 1) {
_root.castlepanel.castleinfo.text = "";
_root.castlepanel.titleinfo.text = "";
}
}
on (release) {
if (_root.pausa == 0) {
if ((_root.gold - 30) > 0) {
_root.gold = _root.gold + -30;
n = 0;
while (n <= 7) {
_root.castlepanel["miicono" + n].removeMovieClip();
n++;
}
_root.creaque.push("Samurai");
var fg = 0;
m = 0;
while (m <= 7) {
fg = fg + 25;
tot = 210 + fg;
switch (_root.creaque[m]) {
case "Samurai" :
_root.castlepanel.attachMovie("samuraig2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Horse Samurai" :
_root.castlepanel.attachMovie("caballog2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:12});
_root.castlepanel["miicono" + m]._xscale = 12;
_root.castlepanel["miicono" + m]._yscale = 12;
break;
case "Spearman" :
_root.castlepanel.attachMovie("spearmang2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Archer" :
_root.castlepanel.attachMovie("archerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:23});
_root.castlepanel["miicono" + m]._xscale = 8.5;
_root.castlepanel["miicono" + m]._yscale = 8.5;
break;
case "Villager" :
_root.castlepanel.attachMovie("villagerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
}
m++;
}
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
Symbol 1384 Button
on (rollOver) {
if (_root.castlepanel.creating != 1) {
infotexto = "Attack: 3\t\tCost: 50 gold\rSpeed: 4\t\tHP: 10\rArmor: 1\rAdvantage over all foot units except Spearman";
_root.castlepanel.titleinfo.text = "Horse Samurai";
_root.castlepanel.castleinfo.text = infotexto;
}
}
on (rollOut) {
if (_root.castlepanel.creating != 1) {
_root.castlepanel.castleinfo.text = "";
_root.castlepanel.titleinfo.text = "";
}
}
on (release) {
if (_root.pausa == 0) {
if ((_root.gold - 50) > 0) {
_root.gold = _root.gold + -50;
n = 0;
while (n <= 7) {
_root.castlepanel["miicono" + n].removeMovieClip();
n++;
}
_root.creaque.push("Horse Samurai");
var fg = 0;
m = 0;
while (m <= 7) {
fg = fg + 25;
tot = 210 + fg;
switch (_root.creaque[m]) {
case "Samurai" :
_root.castlepanel.attachMovie("samuraig2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Horse Samurai" :
_root.castlepanel.attachMovie("caballog2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:12});
_root.castlepanel["miicono" + m]._xscale = 12;
_root.castlepanel["miicono" + m]._yscale = 12;
break;
case "Spearman" :
_root.castlepanel.attachMovie("spearmang2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Archer" :
_root.castlepanel.attachMovie("archerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:23});
_root.castlepanel["miicono" + m]._xscale = 8.5;
_root.castlepanel["miicono" + m]._yscale = 8.5;
break;
case "Villager" :
_root.castlepanel.attachMovie("villagerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
}
m++;
}
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
Symbol 1387 Button
on (rollOver) {
if (_root.castlepanel.creating != 1) {
infotexto = "Attack: 1\t\tCost: 20 gold\rSpeed: 3\t\tHP: 10\rArmor: 1\rUnit with long range attact. On top of towers their power increases.";
_root.castlepanel.titleinfo.text = "Archer";
_root.castlepanel.castleinfo.text = infotexto;
}
}
on (rollOut) {
if (_root.castlepanel.creating != 1) {
_root.castlepanel.castleinfo.text = "";
_root.castlepanel.titleinfo.text = "";
}
}
on (release) {
if (_root.pausa == 0) {
if ((_root.gold - 20) > 0) {
_root.gold = _root.gold + -20;
n = 0;
while (n <= 7) {
_root.castlepanel["miicono" + n].removeMovieClip();
n++;
}
_root.creaque.push("Archer");
var fg = 0;
m = 0;
while (m <= 7) {
fg = fg + 25;
tot = 210 + fg;
switch (_root.creaque[m]) {
case "Samurai" :
_root.castlepanel.attachMovie("samuraig2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Horse Samurai" :
_root.castlepanel.attachMovie("caballog2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:12});
_root.castlepanel["miicono" + m]._xscale = 12;
_root.castlepanel["miicono" + m]._yscale = 12;
break;
case "Spearman" :
_root.castlepanel.attachMovie("spearmang2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Archer" :
_root.castlepanel.attachMovie("archerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:23});
_root.castlepanel["miicono" + m]._xscale = 8.5;
_root.castlepanel["miicono" + m]._yscale = 8.5;
break;
case "Villager" :
_root.castlepanel.attachMovie("villagerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
}
m++;
}
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
Symbol 1390 MovieClip Frame 1
function createsamurai() {
_root.sn = _root.sn + 1;
var _local3 = 20000;
while (_root.getInstanceAtDepth(_local3) != undefined) {
_local3 = _local3 + 1;
}
var _local7 = _root.attachMovie("samurai", "samurai" + _root.sn, _local3, {_x:random(100) + 150, _y:200});
_root["samurai" + _root.sn].armor = _root.basicarmor;
_root["samurai" + _root.sn].agility = _root.sagility;
_root["samurai" + _root.sn].strength = _root.sstrength;
_root["samurai" + _root.sn].myenemy = "";
_root["samurai" + _root.sn].tipo = "samurai";
_root["samurai" + _root.sn].alive = 1;
_root["samurai" + _root.sn].cuad = 3;
_root["samurai" + _root.sn].aratacker = "";
_root["samurai" + _root.sn].enemy = 0;
_root["samurai" + _root.sn].ohp = 10;
_root["samurai" + _root.sn].hp = 10;
_root["samurai" + _root.sn].rank = 1;
_root["samurai" + _root.sn].esteup = 0;
_root["samurai" + _root.sn].upgrading = 0;
_root["samurai" + _root.sn].nivel1._visible = true;
_root["samurai" + _root.sn].nivel2._visible = false;
_root["samurai" + _root.sn].nivel3._visible = false;
_root["samurai" + _root.sn].nivel4._visible = false;
_root["samurai" + _root.sn].nivel5._visible = false;
_root["samurai" + _root.sn].cuadmax = _root["cuadmax" + _root["samurai" + _root.sn].cuad];
_root["samurai" + _root.sn].cuadmin = _root["cuadmin" + _root["samurai" + _root.sn].cuad];
_root["scuad" + _root["samurai" + _root.sn].cuad] = _root["scuad" + _root["samurai" + _root.sn].cuad] + (_root["samurai" + _root.sn]._name + "x");
_root["samurai" + _root.sn].infirmary = 0;
_root["samurai" + _root.sn].eninfirmary = 0;
_root["samurai" + _root.sn].potential = "";
_root["samurai" + _root.sn].escapemio = 0;
_root["samurai" + _root.sn].aratack = 0;
_root["samurai" + _root.sn].samuraicuadro._visible = false;
_root.lossamurais.push("samurai" + _root.sn);
_root["samurai" + _root.sn].speed = 3;
_root["samurai" + _root.sn].myscale = 100;
_root["samurai" + _root.sn].desx = _root["samurai" + _root.sn]._x;
_root["samurai" + _root.sn].desy = _root["samurai" + _root.sn]._y;
_root["samurai" + _root.sn].gotoAndPlay(73);
_root[("samurai" + _root.sn) + "maxarray"] = new Array();
_root[("samurai" + _root.sn) + "minarray"] = new Array();
_local7.onLoad = function () {
this.desx = _root["samurai" + _root.sn]._x;
this.desy = _root["samurai" + _root.sn]._y;
};
_local7.onEnterFrame = function () {
if (this.upgrading == 1) {
this.esteup = this.esteup + 1;
if ((this.esteup == 48) and (this.alive == 1)) {
this.rank = this.rank + 1;
this.strength = this.strength + _root.supstrength[this.rank];
this.ohp = this.ohp + _root.supohp[this.rank];
this.hp = this.ohp;
this.myhealth._xscale = 100;
this.agility = this.agility + _root.supagility[this.rank];
this.armor = this.armor + _root.suparmor[this.rank];
this["nivel" + this.rank]._visible = true;
this.upgrading = 0;
this.esteup = 0;
}
}
};
_local7.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
this.gotoAndPlay(14);
if (_root.select.length > 0) {
var _local3 = 0;
var _local4 = 0;
for (var _local5 in _root.select) {
_local3 = _local3 + _root[_root.select[_local5]]._x;
_local4 = _local4 + _root[_root.select[_local5]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local3 / _root.select.length;
_root.promedioy = _local4 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "samuraipanel";
_root.samuraipanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
function createhorsesamurai() {
_root.hsn = _root.hsn + 1;
var _local3 = 20000;
while (_root.getInstanceAtDepth(_local3) != undefined) {
_local3 = _local3 + 1;
}
var _local7 = _root.attachMovie("caballo", "caballo" + _root.hsn, _local3, {_x:random(100) + 150, _y:200});
_root["caballo" + _root.hsn]._yscale = 100;
_root["caballo" + _root.hsn].armor = _root.basicarmor;
_root["caballo" + _root.hsn].agility = _root.sagility;
_root["caballo" + _root.hsn].strength = _root.hsstrength;
_root["caballo" + _root.hsn].myenemy = "";
_root["caballo" + _root.hsn].tipo = "hsamurai";
_root["caballo" + _root.hsn].alive = 1;
_root["caballo" + _root.hsn].enemy = 0;
_root["caballo" + _root.hsn].aratacker = "";
_root["caballo" + _root.hsn].cuad = 3;
_root["caballo" + _root.hsn].ohp = 10;
_root["caballo" + _root.hsn].hp = 10;
_root["caballo" + _root.hsn].rank = 1;
_root["caballo" + _root.hsn].aratack = 1;
_root["caballo" + _root.hsn].potential = "";
_root["caballo" + _root.hsn].esteup = 0;
_root["caballo" + _root.hsn].upgrading = 0;
_root["caballo" + _root.hsn].nivel1._visible = true;
_root["caballo" + _root.hsn].nivel2._visible = false;
_root["caballo" + _root.hsn].nivel3._visible = false;
_root["caballo" + _root.hsn].nivel4._visible = false;
_root["caballo" + _root.hsn].nivel5._visible = false;
_root["caballo" + _root.hsn].cuadmax = _root["cuadmax" + _root["caballo" + _root.hsn].cuad];
_root["caballo" + _root.hsn].cuadmin = _root["cuadmin" + _root["caballo" + _root.hsn].cuad];
_root["scuad" + _root["caballo" + _root.hsn].cuad] = _root["scuad" + _root["caballo" + _root.hsn].cuad] + (_root["caballo" + _root.hsn]._name + "x");
_root["caballo" + _root.hsn].infirmary = 0;
_root["caballo" + _root.hsn].eninfirmary = 0;
_root["caballo" + _root.hsn].escapemio = 0;
_root["caballo" + _root.hsn].samuraicuadro._visible = false;
_root.lossamurais.push("caballo" + _root.hsn);
_root["caballo" + _root.hsn].speed = 4;
_root["caballo" + _root.hsn].myscale = 100;
_root["caballo" + _root.hsn].desx = _root["caballo" + _root.hsn]._x;
_root["caballo" + _root.hsn].desy = _root["caballo" + _root.hsn]._y;
_root["caballo" + _root.hsn].gotoAndPlay(37);
_local7.onLoad = function () {
this.desx = _root["caballo" + _root.hsn]._x;
this.desy = _root["caballo" + _root.hsn]._y;
};
_local7.onEnterFrame = function () {
if (this.upgrading == 1) {
this.esteup = this.esteup + 1;
if ((this.esteup == 48) and (this.alive == 1)) {
this.rank = this.rank + 1;
this.strength = this.strength + _root.hsupstrength[this.rank];
this.ohp = this.ohp + _root.hsupohp[this.rank];
this.hp = this.ohp;
this.myhealth._xscale = 100;
this.agility = this.agility + _root.hsupagility[this.rank];
this.armor = this.armor + _root.hsuparmor[this.rank];
this["nivel" + this.rank]._visible = true;
this.upgrading = 0;
this.esteup = 0;
}
}
};
_local7.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
this.gotoAndPlay(14);
if (_root.select.length > 0) {
var _local3 = 0;
var _local4 = 0;
for (var _local5 in _root.select) {
_local3 = _local3 + _root[_root.select[_local5]]._x;
_local4 = _local4 + _root[_root.select[_local5]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local3 / _root.select.length;
_root.promedioy = _local4 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "caballopanel";
_root.caballopanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
function createspearman() {
_root.spn = _root.spn + 1;
var _local3 = 20000;
while (_root.getInstanceAtDepth(_local3) != undefined) {
_local3 = _local3 + 1;
}
var _local7 = _root.attachMovie("spearman", "spearman" + _root.spn, _local3, {_x:random(100) + 150, _y:200});
_root["spearman" + _root.spn].armor = _root.basicarmor;
_root["spearman" + _root.spn].agility = _root.sagility;
_root["spearman" + _root.spn].strength = _root.spstrength;
_root["spearman" + _root.spn].myenemy = "";
_root["spearman" + _root.spn].tipo = "spearman";
_root["spearman" + _root.spn].alive = 1;
_root["spearman" + _root.spn].enemy = 0;
_root["spearman" + _root.spn].cuad = 3;
_root["spearman" + _root.spn].aratacker = "";
_root["spearman" + _root.spn].ohp = 10;
_root["spearman" + _root.spn].hp = 10;
_root["spearman" + _root.spn].rank = 1;
_root["spearman" + _root.spn].esteup = 0;
_root["spearman" + _root.spn].upgrading = 0;
_root["spearman" + _root.spn].nivel1._visible = true;
_root["spearman" + _root.spn].nivel2._visible = false;
_root["spearman" + _root.spn].nivel3._visible = false;
_root["spearman" + _root.spn].nivel4._visible = false;
_root["spearman" + _root.spn].nivel5._visible = false;
_root["spearman" + _root.spn].cuadmax = _root["cuadmax" + _root["spearman" + _root.spn].cuad];
_root["spearman" + _root.spn].cuadmin = _root["cuadmin" + _root["spearman" + _root.spn].cuad];
_root["scuad" + _root["spearman" + _root.spn].cuad] = _root["scuad" + _root["spearman" + _root.spn].cuad] + (_root["spearman" + _root.spn]._name + "x");
_root["spearman" + _root.spn].infirmary = 0;
_root["spearman" + _root.spn].eninfirmary = 0;
_root["spearman" + _root.spn].escapemio = 0;
_root["spearman" + _root.spn].potential = "";
_root["spearman" + _root.spn].aratack = 0;
_root["spearman" + _root.spn].samuraicuadro._visible = false;
_root.lossamurais.push("spearman" + _root.spn);
_root["spearman" + _root.spn].speed = 3;
_root["spearman" + _root.spn].myscale = 100;
_root["spearman" + _root.spn].desx = _root["spearman" + _root.spn]._x;
_root["spearman" + _root.spn].desy = _root["spearman" + _root.spn]._y;
_root["spearman" + _root.spn].gotoAndPlay(46);
_root[("spearman" + _root.spn) + "maxarray"] = new Array();
_root[("spearman" + _root.spn) + "minarray"] = new Array();
_local7.onLoad = function () {
this.desx = _root["spearman" + _root.spn]._x;
this.desy = _root["spearman" + _root.spn]._y;
};
_local7.onEnterFrame = function () {
if (this.upgrading == 1) {
this.esteup = this.esteup + 1;
if ((this.esteup == 48) and (this.alive == 1)) {
this.rank = this.rank + 1;
this.strength = this.strength + _root.spupstrength[this.rank];
this.ohp = this.ohp + _root.spupohp[this.rank];
this.hp = this.ohp;
this.myhealth._xscale = 100;
this.agility = this.agility + _root.spupagility[this.rank];
this.armor = this.armor + _root.spuparmor[this.rank];
this["nivel" + this.rank]._visible = true;
this.upgrading = 0;
this.esteup = 0;
}
}
};
_local7.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
this.gotoAndPlay(1);
if (_root.select.length > 0) {
var _local3 = 0;
var _local4 = 0;
for (var _local5 in _root.select) {
_local3 = _local3 + _root[_root.select[_local5]]._x;
_local4 = _local4 + _root[_root.select[_local5]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local3 / _root.select.length;
_root.promedioy = _local4 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "spearmanpanel";
_root.spearmanpanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
function createvillager() {
_root.vn = _root.vn + 1;
var _local3 = 20000;
while (_root.getInstanceAtDepth(_local3) != undefined) {
_local3 = _local3 + 1;
}
var _local7 = _root.attachMovie("villager", "villager" + _root.vn, _local3, {_x:random(100) + 150, _y:200});
_root["villager" + _root.vn].myenemy = "";
_root["villager" + _root.vn].alive = 1;
_root["villager" + _root.vn].cuad = 3;
_root["villager" + _root.vn].ohp = 10;
_root["villager" + _root.vn].hp = 10;
_root["villager" + _root.vn].rank = 1;
_root["villager" + _root.vn].cuadmax = _root["cuadmax" + _root["villager" + _root.vn].cuad];
_root["villager" + _root.vn].cuadmin = _root["cuadmin" + _root["villager" + _root.vn].cuad];
_root["scuad" + _root["villager" + _root.vn].cuad] = _root["scuad" + _root["villager" + _root.vn].cuad] + (_root["villager" + _root.vn]._name + "x");
_root["villager" + _root.vn].infirmary = 0;
_root["villager" + _root.vn].eninfirmary = 0;
_root["villager" + _root.vn].escapemio = 0;
_root["villager" + _root.vn].samuraicuadro._visible = false;
_root.lossamurais.push("villager" + _root.vn);
_root["villager" + _root.vn].speed = 2;
_root["villager" + _root.vn].tipo = "villager";
_root["villager" + _root.vn].myfire = "";
_root["villager" + _root.vn].mytower = "";
_root["villager" + _root.vn].building = 0;
_root["villager" + _root.vn].aratack = 0;
_root["villager" + _root.vn].buildseq = -1;
_root["villager" + _root.vn].myscale = 100;
_root["villager" + _root.vn].desx = _root["villager" + _root.vn]._x;
_root["villager" + _root.vn].desy = _root["villager" + _root.vn]._y;
_root["villager" + _root.vn].gotoAndPlay(55);
_root[("villager" + _root.vn) + "maxarray"] = new Array();
_root[("villager" + _root.vn) + "minarray"] = new Array();
_local7.onLoad = function () {
this.desx = _root["villager" + _root.vn]._x;
this.desy = _root["villager" + _root.vn]._y;
};
_local7.onEnterFrame = function () {
};
_local7.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
this.gotoAndPlay(24);
if (_root.select.length > 0) {
var _local3 = 0;
var _local4 = 0;
for (var _local5 in _root.select) {
_local3 = _local3 + _root[_root.select[_local5]]._x;
_local4 = _local4 + _root[_root.select[_local5]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local3 / _root.select.length;
_root.promedioy = _local4 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "villagerpanel";
_root.villagerpanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
function createarcher() {
_root.arn = _root.arn + 1;
var _local4 = 20000;
while (_root.getInstanceAtDepth(_local4) != undefined) {
_local4 = _local4 + 1;
}
var _local8 = _root.attachMovie("archer", "archer" + _root.arn, _local4, {_x:random(100) + 150, _y:200});
_root["archer" + _root.arn]._xscale = 100;
_root["archer" + _root.arn].armor = _root.basicarmor;
_root["archer" + _root.arn].agility = _root.sagility;
_root["archer" + _root.arn].strength = _root.arstrength;
_root["archer" + _root.arn].myenemy = "";
_root["archer" + _root.arn].tipo = "archer";
_root["archer" + _root.arn].enemy = 0;
_root["archer" + _root.arn].alive = 1;
_root["archer" + _root.arn].cuad = 3;
_root["archer" + _root.arn].estaronda = 0;
_root["archer" + _root.arn].goingup = 0;
_root["archer" + _root.arn].ohp = 10;
_root["archer" + _root.arn].hp = 10;
_root["archer" + _root.arn].rank = 1;
_root["archer" + _root.arn].step = 0;
_root["archer" + _root.arn].esteup = 0;
_root["archer" + _root.arn].intower = 0;
_root["archer" + _root.arn].upgrading = 0;
_root["archer" + _root.arn].nivel1._visible = true;
_root["archer" + _root.arn].nivel2._visible = false;
_root["archer" + _root.arn].nivel3._visible = false;
_root["archer" + _root.arn].nivel4._visible = false;
_root["archer" + _root.arn].nivel5._visible = false;
_root["archer" + _root.arn].cuadmax = _root["cuadmax" + _root["archer" + _root.arn].cuad];
_root["archer" + _root.arn].cuadmin = _root["cuadmin" + _root["archer" + _root.arn].cuad];
_root["scuad" + _root["archer" + _root.arn].cuad] = _root["scuad" + _root["archer" + _root.arn].cuad] + (_root["archer" + _root.arn]._name + "x");
_root["archer" + _root.arn].infirmary = 0;
_root["archer" + _root.arn].eninfirmary = 0;
_root["archer" + _root.arn].escapemio = 0;
_root["archer" + _root.arn].aratack = 0;
_root["archer" + _root.arn].mytower = "";
_root["archer" + _root.arn].samuraicuadro._visible = false;
_root.lossamurais.push("archer" + _root.arn);
_root["archer" + _root.arn].speed = 3;
_root["archer" + _root.arn].myscale = 100;
_root["archer" + _root.arn].desx = _root["archer" + _root.arn]._x;
_root["archer" + _root.arn].desy = _root["archer" + _root.arn]._y;
_root["archer" + _root.arn].gotoAndPlay(73);
_root[("archer" + _root.arn) + "maxarray"] = new Array();
_root[("archer" + _root.arn) + "minarray"] = new Array();
_local8.onLoad = function () {
this.desx = _root["archer" + _root.arn]._x;
this.desy = _root["archer" + _root.arn]._y;
};
_local8.onEnterFrame = function () {
if (this.upgrading == 1) {
this.esteup = this.esteup + 1;
if ((this.esteup == 48) and (this.alive == 1)) {
this.rank = this.rank + 1;
this.strength = this.strength + _root.arupstrength[this.rank];
this.ohp = this.ohp + _root.arupohp[this.rank];
this.hp = this.ohp;
this.myhealth._xscale = 100;
this.agility = this.agility + _root.arupagility[this.rank];
this.armor = this.armor + _root.aruparmor[this.rank];
this["nivel" + this.rank]._visible = true;
this.upgrading = 0;
this.esteup = 0;
}
}
};
_local8.onMouseUp = function () {
if ((this.alive == 1) and (_root.pausa == 0)) {
if (((this.samuraicuadro._visible == true) and (!Key.isDown(16))) and (_root._ymouse < 400)) {
if (_root.borderinfirmary.hitTest(_root._xmouse, _root._ymouse, true)) {
this.infirmary = 1;
}
if (random(3) < 1) {
_root.hai1.start();
}
this.goingup = 0;
if (this.intower == 0) {
var _local3 = -1;
while (_local3++ , _local3 < _root.towern) {
if (_root["tower" + _local3].hitTest(_root._xmouse, _root._ymouse, true)) {
if (((_root["tower" + _local3]._currentframe > 11) and (_root["tower" + _local3]._currentframe < 24)) and (_root["tower" + _local3].myarcher == "")) {
this.mytower = _root["tower" + _local3]._name;
this.goingup = 1;
_root["tower" + _local3].myarcher = this._name;
}
}
}
}
if (this.myenemy != "") {
this.escapemio = 1;
this.myenemy = "";
}
if (this.intower == 1) {
_root[this.mytower].myarcher = "";
this.mytower = "";
this._x = this._x + -25;
this._y = this._y + 15;
this.gotoAndPlay(75);
} else {
this.gotoAndPlay(25);
}
if (_root.select.length > 0) {
var _local4 = 0;
var _local5 = 0;
for (var _local6 in _root.select) {
_local4 = _local4 + _root[_root.select[_local6]]._x;
_local5 = _local5 + _root[_root.select[_local6]]._y;
}
if (_root.grupo == "si") {
_root.promediox = _local4 / _root.select.length;
_root.promedioy = _local5 / _root.select.length;
_root.grupo = "no";
}
this.desx = _root._xmouse - (_root.promediox - this._x);
this.desy = _root._ymouse - (_root.promedioy - this._y);
} else {
this.desx = _root._xmouse;
this.desy = _root._ymouse;
}
if (this.mytower != "") {
this.desx = _root[this.mytower]._x + 105;
this.desy = _root[this.mytower]._y + 50;
}
if (this.desy < 175) {
this.desy = 175;
}
this.distot = Math.sqrt(((this._y - this.desy) * (this._y - this.desy)) + ((this._x - this.desx) * (this._x - this.desx)));
this.sinx = (this._x - this.desx) / this.distot;
this.cosy = (this._y - this.desy) / this.distot;
if (this.desx > this._x) {
this.xdir = 1;
this._xscale = 100;
} else {
this.xdir = -1;
this._xscale = -100;
}
if (this.desy > this._y) {
this.ydir = 1;
} else {
this.ydir = -1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.samuraicuadro._visible = true;
_root[_root.elpanel]._y = 600;
_root.elpanel = "archerpanel";
_root.archerpanel._y = 400;
_root.spanelshow = this._name;
_root.select.push(this._name);
if (_root.select.length > 0) {
_root.grupo = "si";
}
} else if (!Key.isDown(16)) {
this.samuraicuadro._visible = false;
m = 0;
while (m < _root.select.length) {
_root.select.splice(m, 1);
m++;
}
}
}
};
}
this.onEnterFrame = function () {
if (_root.pausa == 0) {
if (this.creating == 1) {
this.esteup = this.esteup + 1;
if (this.esteup == 120) {
n = 0;
while (n <= 7) {
_root.castlepanel["miicono" + n].removeMovieClip();
n++;
}
_root.creaque.splice(0, 1);
var _local3 = 0;
m = 0;
while (m <= 7) {
_local3 = _local3 + 25;
tot = 210 + _local3;
switch (_root.creaque[m]) {
case "Samurai" :
_root.castlepanel.attachMovie("samuraig2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Horse Samurai" :
_root.castlepanel.attachMovie("caballog2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:12});
_root.castlepanel["miicono" + m]._xscale = 12;
_root.castlepanel["miicono" + m]._yscale = 12;
break;
case "Spearman" :
_root.castlepanel.attachMovie("spearmang2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
break;
case "Archer" :
_root.castlepanel.attachMovie("archerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:23});
_root.castlepanel["miicono" + m]._xscale = 8.5;
_root.castlepanel["miicono" + m]._yscale = 8.5;
break;
case "Villager" :
_root.castlepanel.attachMovie("villagerg2", "miicono" + m, _root.castlepanel.getNextHighestDepth(), {_x:tot, _y:20});
_root.castlepanel["miicono" + m]._xscale = 7.5;
_root.castlepanel["miicono" + m]._yscale = 7.5;
}
m++;
}
switch (this.createwhat) {
case "Samurai" :
createsamurai();
break;
case "Archer" :
createarcher();
break;
case "Horse Samurai" :
createhorsesamurai();
break;
case "Spearman" :
createspearman();
break;
case "Villager" :
createvillager();
}
this.creating = 0;
this.esteup = 0;
}
}
if (this.creating == 1) {
this.creatorbar._visible = true;
this.creatortext.text = "Creating " + this.createwhat;
this.creatorbar._xscale = (this.esteup / 120) * 100;
} else {
this.creatortext.text = "";
this.creatorbar._visible = false;
this.cpcback._visible = false;
if (_root.creaque.length > 0) {
this.cpcback._visible = true;
this.creating = 1;
this.createwhat = _root.creaque[0];
_root.castlepanel.castleinfo.text = "";
_root.castlepanel.titleinfo.text = "";
}
}
}
};
Symbol 1393 Button
on (press) {
if (_root.pausa == 0) {
if (_root.tabernupgrading != 1) {
if ((_root.gold - this.cost.text) > 0) {
_root.tabernupgrading = 1;
_root.gold = _root.gold + (-this.cost.text);
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
}
}
}
Symbol 1401 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.pausa == 0) {
if (_root.tabernupgrading == 1) {
_root.tbesteup = _root.tbesteup + 1;
if (_root.tbesteup == 120) {
_root.goldspeed = _root.goldspeed + _root.tabernplus[_root.tabernlevel + 1];
_root.tabernlevel = _root.tabernlevel + 1;
_root.tabernupgrading = 0;
_root.tbesteup = 0;
}
}
this.slevel.text = _root.tabernlevel;
this.rspeed.text = _root.tabernplus[_root.tabernlevel + 1];
this.cost.text = _root.taberncost[_root.tabernlevel + 1];
if (_root.tabernupgrading == 1) {
this.upgrading._visible = true;
this.upgrading._xscale = (_root.tbesteup / 120) * 100;
} else {
this.upgrading._visible = false;
}
if (_root.tabernlevel == 3) {
this.cost._visible = false;
this.btnupgrade._visible = false;
this.costtxt._visible = false;
this.goldtxt._visible = false;
this.rspeed._visible = false;
this.recsp._visible = false;
this.nlevel._visible = false;
} else {
this.cost._visible = true;
this.btnupgrade._visible = true;
this.costtxt._visible = true;
this.goldtxt._visible = true;
this.rspeed._visible = true;
this.recsp._visible = true;
this.nlevel._visible = true;
}
}
};
Symbol 1408 MovieClip Frame 1
stop();
Symbol 1408 MovieClip Frame 2
stop();
Symbol 1413 MovieClip Frame 1
this.onEnterFrame = function () {
this.slevel.text = _root[_root.spanelshow].rank;
this.shp.text = _root[_root.spanelshow].hp;
this.smaxhp.text = _root[_root.spanelshow].ohp;
};
Instance of Symbol 1408 MovieClip "btnupgrade" in Symbol 1413 MovieClip Frame 1
onClipEvent (mouseDown) {
if (_root.pausa == 0) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root[_root.spanelshow].building != 1) {
if ((_root.gold - _root.villagerpanel.cost.text) > 0) {
_root[_root.spanelshow].building = 1;
_root.gold = _root.gold + (-_root.villagerpanel.cost.text);
this.gotoAndStop(2);
} else {
var thisnogold = _root.attachMovie("nogold", "nogold", _root.getNextHighestDepth(), {_x:330, _y:450});
thisnogold.onEnterFrame = function () {
this._alpha = this._alpha + -0.5;
};
}
} else {
this.gotoAndStop(1);
_root[_root.spanelshow].building = 0;
}
}
}
}
Symbol 1422 Button
on (press) {
_root.sendcount = _root.atcco[_root.atnivel] - 1;
}
Symbol 1423 Button
on (press) {
i = 0;
while (i < (_root.arrown + 1)) {
if (_root["arrow" + i].activo == 0) {
_root["arrow" + i].swapDepths(23);
_root["arrow" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.sn + 1)) {
if (_root["samurai" + i].alive == 0) {
_root["samurai" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.hsn + 1)) {
if (_root["caballo" + i].alive == 0) {
_root["caballo" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.spn + 1)) {
if (_root["spearman" + i].alive == 0) {
_root["spearman" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.arn + 1)) {
if (_root["archer" + i].alive == 0) {
_root["archer" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.vn + 1)) {
if (_root["villager" + i].alive == 0) {
_root["villager" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.bss + 1)) {
if (_root["bsamurai" + i].alive == 0) {
_root["bsamurai" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.bhss + 1)) {
if (_root["bcaballo" + i].alive == 0) {
_root["bcaballo" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.bsps + 1)) {
if (_root["bspearman" + i].alive == 0) {
_root["bspearman" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.bac + 1)) {
if (_root["barcher" + i].alive == 0) {
_root["barcher" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.bcf + 1)) {
if (_root["bcfire" + i].alive == 0) {
_root["bcfire" + i].removeMovieClip();
}
i++;
}
i = 0;
while (i < (_root.blood2 + 1)) {
_root["bloodspill" + i].swapDepths(23);
_root["bloodspill" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.towern + 1)) {
if (_root["tower" + i].destroyed == 1) {
_root["tower" + i].swapDepths(23);
_root["tower" + i].removeMovieClip();
}
i++;
}
}
Symbol 1427 Button
on (press) {
var midireccion = this._url;
var gid = "2446";
getURL ("http://www.zupagames.com/in.php", "_blank", "POST");
}
Symbol 1429 Button
on (press) {
if (_root.pausa == 0) {
_root.mimenu.swapDepths(_root.getNextHighestDepth());
_root.mimenu._y = 200;
_root.pausa = 1;
_root.castlepanel.stop();
_root.infirmarypanel.stop();
_root.samuraipanel.stop();
_root.normalpanel.stop();
_root.castlepanel.stop();
_root.caballopanel.stop();
_root.spearmanpanel.stop();
_root.villagerpanel.stop();
_root.archerpanel.stop();
_root.tabernpanel.stop();
_root.blacksmithpanel.stop();
i = 0;
while (i < (_root.arrown + 1)) {
_root["arrow" + i].stop();
i++;
}
i = 0;
while (i < (_root.sn + 1)) {
_root["samurai" + i].stop();
i++;
}
i = 0;
while (i < (_root.hsn + 1)) {
_root["caballo" + i].stop();
i++;
}
i = 0;
while (i < (_root.spn + 1)) {
_root["spearman" + i].stop();
i++;
}
i = 0;
while (i < (_root.arn + 1)) {
_root["archer" + i].stop();
i++;
}
i = 0;
while (i < (_root.vn + 1)) {
_root["villager" + i].stop();
i++;
}
i = 0;
while (i < (_root.bss + 1)) {
_root["bsamurai" + i].stop();
i++;
}
i = 0;
while (i < (_root.bhss + 1)) {
_root["bcaballo" + i].stop();
i++;
}
i = 0;
while (i < (_root.bsps + 1)) {
_root["bspearman" + i].stop();
i++;
}
i = 0;
while (i < (_root.bac + 1)) {
_root["barcher" + i].stop();
i++;
}
i = 0;
while (i < (_root.bcf + 1)) {
_root["bcfire" + i].stop();
i++;
}
i = 0;
while (i < (_root.blood2 + 1)) {
_root["caballosolo" + i].stop();
i++;
}
}
}
Symbol 1436 Button
on (press) {
_root.mimenu._y = 800;
_root.yesno._y = 800;
_root._x = 0;
_root.gotoright._visible = false;
_root.gotoleft._visible = false;
_root.bluefire.stop();
i = 0;
while (i < (_root.arrown + 1)) {
_root["arrow" + i].swapDepths(23);
_root["arrow" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.sn + 1)) {
_root["samurai" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.hsn + 1)) {
_root["caballo" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.spn + 1)) {
_root["spearman" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.arn + 1)) {
_root["archer" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.vn + 1)) {
_root["villager" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bss + 1)) {
_root["bsamurai" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bhss + 1)) {
_root["bcaballo" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bsps + 1)) {
_root["bspearman" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bac + 1)) {
_root["barcher" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.bcf + 1)) {
_root["bcfire" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.blood2 + 1)) {
_root["bloodspill" + i].swapDepths(23);
_root["bloodspill" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.blood2 + 1)) {
_root["caballosolo" + i].removeMovieClip();
i++;
}
i = 0;
while (i < (_root.towern + 1)) {
_root["tower" + i].swapDepths(23);
_root["tower" + i].removeMovieClip();
i++;
}
_root.gotoAndPlay(2);
}
Symbol 1437 Button
on (press) {
_root.yesno._y = 800;
}
Symbol 1448 Button
on (press) {
if (_root.select.length == 0) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "infirmarypanel";
_root.infirmarypanel._y = 400;
}
}
Symbol 1466 MovieClip Frame 1
stop();
Symbol 1466 MovieClip Frame 2
stop();
this.myhealth._xscale = 95;
Symbol 1466 MovieClip Frame 3
stop();
this.myhealth._xscale = 90;
Symbol 1466 MovieClip Frame 4
stop();
this.myhealth._xscale = 85;
Symbol 1466 MovieClip Frame 5
stop();
this.myhealth._xscale = 80;
Symbol 1466 MovieClip Frame 6
stop();
this.myhealth._xscale = 75;
Symbol 1466 MovieClip Frame 7
stop();
this.myhealth._xscale = 70;
Symbol 1466 MovieClip Frame 8
stop();
this.myhealth._xscale = 65;
Symbol 1466 MovieClip Frame 9
stop();
this.myhealth._xscale = 60;
Symbol 1466 MovieClip Frame 10
stop();
this.myhealth._xscale = 55;
Symbol 1466 MovieClip Frame 11
stop();
this.myhealth._xscale = 50;
Symbol 1466 MovieClip Frame 12
stop();
this.myhealth._xscale = 45;
Symbol 1466 MovieClip Frame 13
stop();
this.myhealth._xscale = 40;
Symbol 1466 MovieClip Frame 14
stop();
this.myhealth._xscale = 35;
Symbol 1466 MovieClip Frame 15
stop();
this.myhealth._xscale = 30;
Symbol 1466 MovieClip Frame 16
stop();
this.myhealth._xscale = 25;
Symbol 1466 MovieClip Frame 17
stop();
this.myhealth._xscale = 20;
Symbol 1466 MovieClip Frame 18
stop();
this.myhealth._xscale = 15;
Symbol 1466 MovieClip Frame 19
stop();
this.myhealth._xscale = 10;
Symbol 1466 MovieClip Frame 20
stop();
this.myhealth._xscale = 5;
Symbol 1466 MovieClip Frame 21
play();
this.destroyed = 1;
_root.castlefall.start();
Symbol 1466 MovieClip Frame 22
Symbol 1466 MovieClip Frame 23
Symbol 1466 MovieClip Frame 24
Symbol 1466 MovieClip Frame 25
Symbol 1466 MovieClip Frame 26
Symbol 1466 MovieClip Frame 27
Symbol 1466 MovieClip Frame 28
Symbol 1466 MovieClip Frame 29
Symbol 1466 MovieClip Frame 30
Symbol 1466 MovieClip Frame 31
Symbol 1466 MovieClip Frame 95
stop();
_root.gameover = 1;
_root.gotoAndStop(10);
Symbol 1472 Button
on (press) {
if (_root.select.length == 0) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "tabernpanel";
_root.tabernpanel._y = 400;
}
}
Symbol 1478 Button
on (press) {
if (_root.select.length == 0) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "castlepanel";
_root.castlepanel._y = 400;
}
}
Symbol 1492 Button
on (press) {
if (_root.select.length == 0) {
_root[_root.elpanel]._y = 600;
_root.elpanel = "blacksmithpanel";
_root.blacksmithpanel._y = 400;
}
}
Symbol 1495 Button
on (release) {
_root.gameover = 0;
_root.gotoAndStop(5);
}
Symbol 1497 Button
on (release) {
newgroundssteel.stop();
_root.gotoAndPlay(2);
}
Symbol 1508 Button
on (press) {
var midireccion = this._url;
var score1b1 = String(_root.score);
var score2 = String(_root.atnivel);
var score3 = String(_root.mygame);
var uname = _root.minombre.text;
var gid = "2446";
var puntaje = "1";
getURL ("http://www.zupagames.com/scores/samuraidefense/", "_blank", "POST");
_root.gotoAndPlay(2);
}
Symbol 1512 Button
on (press) {
_root.createbarcher(1, 2);
}
Symbol 1513 Button
on (press) {
_root.createbcaballofire(1, 1);
}
Symbol 1514 Button
on (press) {
_root.castlepanel.createarcher();
}
Symbol 1518 Button
on (press) {
_root.castlepanel.createvillager();
}
Symbol 1520 Button
on (release) {
_root.gotoAndPlay(2);
}
Symbol 1527 Button
on (press) {
var midireccion = this._url;
newgroundssteel.stop();
var score1b1 = String(_root.score);
var score2 = String(_root.atnivel);
var score3 = String(_root.mygame);
var uname = _root.minombre.text;
var gid = "2446";
var puntaje = "1";
getURL ("http://www.zupagames.com/scores/samuraidefense/", "_blank", "POST");
_root.gotoAndPlay(2);
}
Symbol 1539 Button
on (release) {
_root.gotoAndStop(13);
}
Symbol 1543 Button
on (release) {
_root.gotoAndStop(14);
}
Symbol 1552 Button
on (release) {
_root.gotoAndStop(12);
}
Symbol 1554 Button
on (release) {
_root.gotoAndStop(13);
}