Frame 3
stop();
_global.setMoney = function () {
var _local3 = "moneyInd";
var _local2 = _root.money;
_root[_local3].d8.gotoAndStop(((_local2 > 9999999) ? (Math.floor(_local2 / 10000000) + 1) : 11));
_root[_local3].d7.gotoAndStop(((_local2 > 999999) ? ((Math.floor(_local2 / 1000000) % 10) + 1) : 11));
_root[_local3].d6.gotoAndStop(((_local2 > 99999) ? ((Math.floor(_local2 / 100000) % 10) + 1) : 11));
_root[_local3].d5.gotoAndStop(((_local2 > 9999) ? ((Math.floor(_local2 / 10000) % 10) + 1) : 11));
_root[_local3].d4.gotoAndStop(((_local2 > 999) ? ((Math.floor(_local2 / 1000) % 10) + 1) : 11));
_root[_local3].d3.gotoAndStop(((_local2 > 99) ? ((Math.floor(_local2 / 100) % 10) + 1) : 11));
_root[_local3].d2.gotoAndStop(((_local2 > 9) ? ((Math.floor(_local2 / 10) % 10) + 1) : 11));
_root[_local3].d1.gotoAndStop((_local2 % 10) + 1);
if (_root.selecting > -1) {
_root.menus.upgrade._visible = (_root.money >= _root.towerAr[_root.selecting].getNextPrice()) && (_root.towerAr[_root.selecting].canUpgrade());
}
};
_global.setWave = function () {
var _local3 = "waveInd";
var _local2 = _root.wave;
_root[_local3].d4.gotoAndStop(((_local2 > 999) ? ((Math.floor(_local2 / 1000) % 10) + 1) : 11));
_root[_local3].d3.gotoAndStop(((_local2 > 99) ? ((Math.floor(_local2 / 100) % 10) + 1) : 11));
_root[_local3].d2.gotoAndStop(((_local2 > 9) ? ((Math.floor(_local2 / 10) % 10) + 1) : 11));
_root[_local3].d1.gotoAndStop((_local2 % 10) + 1);
};
_global.setHP = function () {
var _local3 = "hpInd";
var _local2 = _root.hp;
_root[_local3].d2.gotoAndStop(((_local2 > 9) ? ((Math.floor(_local2 / 10) % 10) + 1) : 11));
_root[_local3].d1.gotoAndStop((_local2 % 10) + 1);
};
_global.setMonster = function (n) {
_root.waveInd.mname.gotoAndStop(n);
};
_global.setIcons = function () {
_root.menus.c1.gotoAndStop(((_root.money < 10) ? 2 : 1));
_root.menus.c2.gotoAndStop(((_root.money < 10) ? 2 : 1));
_root.menus.c3.gotoAndStop(((_root.money < 10) ? 2 : 1));
_root.menus.c4.gotoAndStop(((_root.money < 40) ? 2 : 1));
_root.menus.c5.gotoAndStop(((_root.money < 2000) ? 2 : 1));
};
_global.grid = function (n) {
if (_root.towers.tguide._xscale == 200) {
return(10 * Math.floor((n + 5) / 10));
}
return((10 * Math.floor((n + 5) / 10)) - 5);
};
Instance of Symbol 79 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_root.nextFrame();
}
}
Frame 5
stop();
_root.createEmptyMovieClip("towers", 2000);
_root.createEmptyMovieClip("enemies", 1000);
_root.createEmptyMovieClip("bullets", 3000);
_root.createEmptyMovieClip("lasers", 4000);
_root.towers.attachMovie("tguide", "tguide", 1);
_root.towers.tguide._x = 10000;
_root.towers.tguide._y = 10000;
_root.towers.attachMovie("tmarker", "tmarker", 2);
_root.towers.tmarker._x = 10000;
_root.towers.tmarker._y = 10000;
_root.towers.attachMovie("trange", "trange", 3);
_root.towers.trange._x = 10000;
_root.towers.trange._y = 10000;
_root.money = 60;
_root.wave = 0;
_root.hp = 10;
_root.enemyAr = new Array();
_root.towerAr = new Array();
_root.bulletAr = new Array();
_root.defHp = 5;
_root.defMoney = 1;
_root.defSpd = 3;
_root.enemyNum = 0;
_root.bulletNum = 0;
_root.selecting = -1;
_root.gene = new Gene();
_root.cheated = false;
setMoney();
setWave();
setHP();
setMonster("\u306A\u3057");
_root.nextTime = 900;
_root.maxTime = _root.nextTime;
_root.putCancel._visible = false;
Instance of Symbol 151 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (Key.isDown("Z".charCodeAt(0))) {
_root.money = _root.money + 500;
_root.cheated = true;
setMoney();
setIcons();
}
if (Key.isDown("X".charCodeAt(0))) {
_root.cheated = true;
_root.wave++;
_root.defMoney = (_root.defMoney * 0.02) + (_root.wave * 1.3);
_root.defHp = (_root.defHp * 1.08) + (_root.wave * 20);
setWave();
}
if (Key.isDown("V".charCodeAt(0)) && (_root.hp < 99)) {
_root.cheated = true;
_root.hp++;
setHP();
}
if (_root.cheated && (_root.gauge.gauge._currentframe == 1)) {
_root.gauge.gauge.gotoAndStop(2);
}
if (_root.cheated && (_root.bgs._currentframe == 1)) {
_root.bgs.gotoAndStop(2);
}
_root.lasers.clear();
ctrl = (Key.isDown(17) ? 3 : 1);
_root.bullets._visible = (_root.lasers._visible = !Key.isDown(17));
while (ctrl > 0) {
if (_root.nextTime > 0) {
_root.nextTime--;
}
_root.gauge.gauge._xscale = (_root.nextTime / _root.maxTime) * 100;
if (((_root.nextTime == 0) || ((_root.enemyAr.length == 0) && (Key.isDown(32)))) || (Key.isDown("C".charCodeAt(0)) && (_root.nextTime < 894))) {
_root.nextTime = _root.maxTime;
_root.wave++;
_root.defMoney = (_root.defMoney * 0.02) + (_root.wave * 1.3);
_root.defHp = (_root.defHp * 1.08) + (_root.wave * 20);
interest = 0;
i = 0;
while (i < _root.towerAr.length) {
if (_root.towerAr[i].getTowerNum() == Tower.thunder) {
interest = interest + 0.02;
}
i++;
}
_root.money = _root.money + Math.min(1000, Math.floor(_root.money * interest));
setMoney();
trace((("EnemyHP : " + Math.floor(_root.defHp)) + ", Money : ") + Math.floor(_root.defMoney));
setWave();
setMonster(_root.gene.getMonster(_root.wave));
i = 0;
while (i < 8) {
newnam = "enemy_" + _root.enemyNum;
_root.enemyNum++;
_root.enemies.attachMovie("enemy", newnam, _root.enemies.getNextHighestDepth());
nx = 45;
ny = -10 - (i * 24);
_root.enemies[newnam]._x = nx;
_root.enemies[newnam]._y = ny;
_root.enemies[newnam]._rotation = (Math.atan2(Map.dest[0].ay, Map.dest[0].ax) * 180) / Math.PI;
_root.enemyAr.push(new Enemy(newnam, nx, ny, _root.defSpd, _root.wave, Math.floor(_root.defMoney), Math.floor(_root.defHp)));
i++;
}
if (_root.undo && (_root.towerAr[_root.towerAr.length - 1].getTowerNum() == Tower.thunder)) {
_root.undo = false;
if (_root.putCancel._currentframe == 2) {
_root.putCancel.gotoAndStop(1);
_root.putCancel._visible = false;
}
}
}
i = 0;
while (i < _root.enemyAr.length) {
var tmp = _root.enemyAr[i];
var tmp2 = tmp.getNam();
if (tmp.adv()) {
_root.enemies[tmp2].removeMovieClip();
_root.hp--;
setHP();
_root.gene.addGene(_root.gene.getMonster(_root.enemyAr[i].getLevel()), _root.enemyAr[i].getLevel());
_root.way.shizumori.gotoAndStop(1);
if (_root.hp > 7) {
_root.way.shizumori.gotoAndStop("\u3042\u3048\u304E\uFF11");
} else {
_root.way.shizumori.gotoAndStop("\u3042\u3048\u304E\uFF12");
}
_root.enemyAr.splice(i, 1);
if (_root.hp < 1) {
_root.gotoAndStop("\u30B2\u30FC\u30E0\u30AA\u30FC\u30D0\u30FC");
}
} else {
var tmp3 = tmp.getPos();
_root.enemies[tmp2]._x = tmp3.px;
_root.enemies[tmp2]._y = tmp3.py;
_root.enemies[tmp2]._rotation = tmp3.ang;
i++;
}
}
if (_root.picking) {
_root.towers.tguide._x = (tx = grid(_root._xmouse));
_root.towers.tguide._y = (ty = grid(_root._ymouse));
_root.canput = true;
i = 0;
while ((i < _root.towerAr.length) && (_root.canput)) {
_root.canput = _root.canput && (!_root.towerAr[i].isCollision(tx, ty, _root.towers.tguide._xscale * 0.15));
i++;
}
_root.canput = _root.canput && (!Map.isCollision(tx, ty, _root.towers.tguide._xscale * 0.15));
_root.towers.tguide.gotoAndStop((_root.canput ? 1 : 2));
} else {
_root.canput = false;
}
i = 0;
while (i < _root.towerAr.length) {
_root.towerAr[i].shoot();
i++;
}
i = 0;
while (i < _root.bulletAr.length) {
switch (_root.bulletAr[i].adv()) {
case 0 :
var tmp = _root.bulletAr[i];
if (!tmp.isDummy()) {
var tmp2 = tmp.getNam();
var tmp3 = tmp.getPos();
_root.bullets[tmp2]._x = tmp3.px;
_root.bullets[tmp2]._y = tmp3.py;
_root.bullets[tmp2]._rotation = tmp3.ang;
}
i++;
break;
case 1 :
j = 0;
while (j < _root.enemyAr.length) {
if (((ttgt = _root.enemyAr[j])).getNam() == _root.bulletAr[i].getTgt()) {
break;
}
j++;
}
if (ttgt.damage(_root.bulletAr[i].getDamage())) {
_root.enemies[ttgt.getNam()].removeMovieClip();
_root.money = _root.money + _root.enemyAr[j].getMoney();
setMoney();
if (!_root.picking) {
setIcons();
}
_root.enemyAr.splice(j, 1);
} else {
ttgt.speedReduce(_root.bulletAr[i].getReduce(), _root.bulletAr[i].getReduceCap());
_root.enemies[ttgt.getNam()].body._alpha = ttgt.getPersentage() * 100;
}
if (!_root.bulletAr[i].isDummy()) {
_root.bullets[_root.bulletAr.splice(i, 1)[0].getNam()].removeMovieClip();
} else {
_root.bulletAr.splice(i++, 1);
}
break;
case 2 :
if (!_root.bulletAr[i].isDummy()) {
_root.bullets[_root.bulletAr.splice(i, 1)[0].getNam()].removeMovieClip();
} else {
_root.bulletAr.splice(i++, 1);
}
}
}
ctrl--;
}
if (_root.undo && (_root.towerAr[_root.towerAr.length - 1].isUsed())) {
_root.undo = false;
_root.putCancel.gotoAndStop(1);
_root.putCancel._visible = false;
}
}
Instance of Symbol 154 MovieClip in Frame 5
onClipEvent (enterFrame) {
nd = new Date().getTime();
fps.text = Math.floor(10000 / (nd - ld)) / 10;
ld = nd;
}
Frame 7
res.text = ("\u6700\u7D42\u30EC\u30D9\u30EB : " + _root.wave) + "\n\n";
res.text = res.text + (("\u907A\u4F1D\u5B50\u914D\u5206\n\u3000\u9759\u68EE\u3055\u3093 : " + (Math.round((_root.gene.getAmount("\u9759\u68EE\u3055\u3093") / _root.gene.getSum()) * 1000) / 10)) + "%\n");
i = 0;
while (i < _root.gene.getMonsterLength()) {
mn = _root.gene.getMonsterName(i);
if (_root.gene.getAmount(mn) > 0) {
res.text = res.text + (((("\u3000" + mn) + " : ") + (Math.round((_root.gene.getAmount(mn) / _root.gene.getSum()) * 1000) / 10)) + "%\n");
}
i++;
}
_root.towers.removeMovieClip();
_root.bullets.removeMovieClip();
_root.enemies.removeMovieClip();
_root.lasers.removeMovieClip();
_root.towerAr = new Array();
_root.bulletAr = new Array();
_root.enemyAr = new Array();
_root.picking = false;
_root.selecting = -1;
Symbol 4 Button
on (press) {
if (!_root.picking) {
_root.selecting = num;
nowstat = _root.towerAr[num].getStat();
_root.towers.tmarker._x = _x;
_root.towers.tmarker._y = _y;
_root.towers.tmarker._xscale = (_root.towers.tmarker._yscale = ((_root.towerAr[num].getTowerNum() == Tower.thunder) ? 200 : 100));
_root.towers.tmarker.swapDepths(_root.towers.getNextHighestDepth());
_root.towers.trange._x = _x;
_root.towers.trange._y = _y;
_root.towers.trange.swapDepths(_root.towers.getNextHighestDepth());
_root.towers.trange._xscale = (_root.towers.trange._yscale = nowstat.range);
_root.menus.gotoAndStop(2);
_root.menus.icon.gotoAndStop(_root.towerAr[num].getTowerNum() + 1);
_root.menus.nowlv.gotoAndStop(_root.towerAr[num].getTowerLv() + 1);
_root.menus.nowdmg.text = nowstat.dmg;
_root.menus.nowrange.text = nowstat.range;
_root.menus.nowshot.text = nowstat.shot;
if (_root.towerAr[num].canUpgrade()) {
_root.menus.nextlv.gotoAndStop(_root.towerAr[num].getTowerLv() + 2);
nextstat = _root.towerAr[num].getNextStat();
_root.menus.nextdmg.text = nextstat.dmg;
_root.menus.nextrange.text = nextstat.range;
_root.menus.nextshot.text = nextstat.shot;
_root.menus.cost.text = _root.towerAr[num].getNextPrice();
_root.menus.upgrade._visible = _root.money >= _root.towerAr[num].getNextPrice();
} else {
_root.menus.nextlv.gotoAndStop(12);
_root.menus.nextdmg.text = "-";
_root.menus.nextrange.text = "-";
_root.menus.nextshot.text = "-";
_root.menus.cost.text = "-";
_root.menus.upgrade._visible = false;
}
}
}
Symbol 11 MovieClip Frame 25
gotoAndPlay (1);
Symbol 22 MovieClip Frame 1
this._x = (Math.random() * 25) - 12.5;
this._y = (Math.random() * 25) - 12.5;
r = Math.random() * 3;
if (r < 1) {
gotoAndPlay ("medium");
} else if (r < 2) {
gotoAndPlay ("short");
}
Symbol 22 MovieClip Frame 11
gotoAndPlay ("long");
Symbol 22 MovieClip Frame 18
gotoAndPlay ("long");
Symbol 22 MovieClip Frame 23
gotoAndPlay ("long");
Symbol 32 MovieClip Frame 1
this._x = (Math.random() * 25) - 12.5;
this._y = (Math.random() * 25) - 12.5;
r = Math.random() * 3;
if (r < 1) {
gotoAndPlay ("medium");
} else if (r < 2) {
gotoAndPlay ("short");
}
Symbol 32 MovieClip Frame 11
gotoAndPlay ("long");
Symbol 32 MovieClip Frame 18
gotoAndPlay ("long");
Symbol 32 MovieClip Frame 23
gotoAndPlay ("long");
Symbol 35 Button
on (press) {
if (!_root.picking) {
_root.selecting = num;
nowstat = _root.towerAr[num].getStat();
_root.towers.tmarker._x = _x;
_root.towers.tmarker._y = _y;
_root.towers.tmarker.swapDepths(_root.towers.getNextHighestDepth());
_root.towers.tmarker._xscale = (_root.towers.tmarker._yscale = (((_root.towerAr[num].getTowerNum() == Tower.thunder) || (_root.towerAr[num].getTowerNum() == Tower.flower)) ? 200 : 100));
_root.towers.trange._x = _x;
_root.towers.trange._y = _y;
_root.towers.trange.swapDepths(_root.towers.getNextHighestDepth());
_root.towers.trange._xscale = (_root.towers.trange._yscale = nowstat.range);
_root.menus.gotoAndStop(2);
_root.menus.icon.gotoAndStop(_root.towerAr[num].getTowerNum() + 1);
_root.menus.nowlv.gotoAndStop(_root.towerAr[num].getTowerLv() + 1);
_root.menus.nowdmg.text = nowstat.dmg;
_root.menus.nowrange.text = nowstat.range;
_root.menus.nowshot.text = nowstat.shot;
if (_root.towerAr[num].canUpgrade()) {
_root.menus.nextlv.gotoAndStop(_root.towerAr[num].getTowerLv() + 2);
nextstat = _root.towerAr[num].getNextStat();
_root.menus.nextdmg.text = nextstat.dmg;
_root.menus.nextrange.text = nextstat.range;
_root.menus.nextshot.text = nextstat.shot;
_root.menus.cost.text = _root.towerAr[num].getNextPrice();
_root.menus.upgrade._visible = _root.money >= _root.towerAr[num].getNextPrice();
} else {
_root.menus.nextlv.gotoAndStop(12);
_root.menus.nextdmg.text = "-";
_root.menus.nextrange.text = "-";
_root.menus.nextshot.text = "-";
_root.menus.cost.text = "-";
_root.menus.upgrade._visible = false;
}
}
}
Symbol 38 MovieClip Frame 53
gotoAndPlay (1);
Instance of Symbol 11 MovieClip in Symbol 41 MovieClip [tower] Frame 8
onClipEvent (load) {
gotoAndPlay (1);
}
Instance of Symbol 11 MovieClip in Symbol 41 MovieClip [tower] Frame 8
onClipEvent (load) {
gotoAndPlay (13);
}
Instance of Symbol 11 MovieClip in Symbol 41 MovieClip [tower] Frame 9
onClipEvent (load) {
gotoAndPlay (9);
}
Instance of Symbol 11 MovieClip in Symbol 41 MovieClip [tower] Frame 9
onClipEvent (load) {
gotoAndPlay (17);
}
Symbol 41 MovieClip [tower] Frame 30
stop();
Symbol 44 MovieClip [tguide] Frame 1
stop();
Symbol 50 MovieClip [bullet] Frame 1
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 275 MovieClip [__Packages.Tower] Frame 0
class Tower
{
var nam, tn, tl, px, py, wt, tgt, used, scale;
function Tower (tnam, ttn, ttl, tpx, tpy) {
nam = tnam;
tn = ttn;
tl = ttl;
px = tpx;
py = tpy;
wt = 0;
tgt = "";
used = false;
scale = (((tn == thunder) || (tn == flower)) ? 60 : 30);
}
function getTowerStat(lv) {
switch (tn) {
case fire :
var _local4 = Math.pow((8 * Math.pow(90, rangemod)) / 3, 1 / curve) / 10;
var _local3 = 88 + (lv * 2);
return({dmg:Math.floor((Math.pow(_local4 * getCumPrice(lv), curve) * 3) / Math.pow(_local3, rangemod)), range:_local3, shot:3, reduce:0, reducecap:1, spd:20});
case wood :
_local4 = Math.pow((10 * Math.pow(160, rangemod)) / 7, 1 / curve) / 10;
_local3 = 155 + (15 * lv);
return({dmg:Math.floor((Math.pow(_local4 * getCumPrice(lv), curve) * 7) / Math.pow(_local3, rangemod)), range:_local3, shot:7, reduce:0, reducecap:1, spd:15});
case water :
_local4 = Math.pow((8 * Math.pow(130, rangemod)) / 10, 1 / curve) / 10;
_local3 = 125 + (5 * lv);
return({dmg:Math.floor((Math.pow(_local4 * getCumPrice(lv), curve) * 10) / Math.pow(_local3, rangemod)), range:_local3, shot:10, reduce:0.04 * lv, reducecap:1 - (lv * 0.07), spd:13});
case thunder :
return({dmg:0, range:0, shot:0, reduce:0, reducecap:1, spd:16});
case flower :
var _local7 = ((lv == 1) ? 2000 : (((lv == 2) ? 7000 : (((lv == 3) ? 20000 : 0)))));
_local3 = 50 + (50 * lv);
return({dmg:_local7, range:_local3, shot:1, reduce:0, reducecap:1, spd:20});
}
return({dmg:0, range:0, shot:Infinity, reduce:0});
}
function getStat() {
return(getTowerStat(tl));
}
function getNextStat() {
return(getTowerStat(tl + 1));
}
function getPrice() {
return(getTowerPrice(tl));
}
function getNextPrice() {
return(getTowerPrice(tl + 1));
}
function canUpgrade() {
return(canUpgradeAt(tl));
}
function canUpgradeAt(lv) {
switch (tn) {
case fire :
case water :
case wood :
return(lv < 9);
case thunder :
return(false);
case flower :
return(lv < 3);
}
return(false);
}
function getTowerPrice(lv) {
switch (tn) {
case fire :
case water :
case wood :
return(Math.pow(2, lv - 1) * 10);
case thunder :
return(40);
case flower :
return(((lv == 1) ? 2000 : (((lv == 2) ? 5000 : (((lv == 3) ? 15000 : 0))))));
}
return(0);
}
function getCumPrice(lv) {
switch (tn) {
case fire :
case water :
case wood :
return((Math.pow(2, lv) - 1) * 10);
case thunder :
return(40);
case flower :
return(((lv == 1) ? 2000 : (((lv == 2) ? 7000 : (((lv == 3) ? 22000 : 0))))));
}
return(0);
}
function getPos() {
return({px:px, py:py});
}
function isCollision(ex, ey, w) {
return((((ex > ((px - w) - (scale / 2))) && (ex < ((px + (scale / 2)) + w))) && (ey > ((py - (scale / 2)) - w))) && (ey < ((py + (scale / 2)) + w)));
}
function getNam() {
return(nam);
}
function shoot() {
if (tn == thunder) {
return(false);
}
wt = Math.max(0, wt - 1);
var _local5 = false;
var _local8 = getStat();
var _local9;
var _local6;
var _local3 = 0;
while ((_local3 < _root.enemyAr.length) && (!_local5)) {
_local9 = _root.enemyAr[_local3];
_local5 = _local9.getNam() == tgt;
_local6 = _local3;
_local3++;
}
if ((!_local5) || ((Math.pow(px - _local9.px, 2) + Math.pow(py - _local9.py, 2)) >= (_local8.range * _local8.range))) {
var _local7 = _local8.range * _local8.range;
tgt = "";
_local3 = 0;
while (_local3 < _root.enemyAr.length) {
var _local4 = Math.pow(px - _root.enemyAr[_local3].px, 2) + Math.pow(py - _root.enemyAr[_local3].py, 2);
if (_local7 > _local4) {
_local7 = _local4;
tgt = _root.enemyAr[_local3].getNam();
_local6 = _local3;
}
_local3++;
}
}
if ((tgt != "") && (wt == 0)) {
wt = _local8.shot;
if (tn == flower) {
_root.lasers.lineStyle(3 * tl, 16777215, 50, "normal", "none");
_root.lasers.moveTo(px, py - 10);
_root.lasers.lineTo(_root.enemyAr[_local6].px, _root.enemyAr[_local6].py);
_root.bulletAr.push(new Bullet("", 0, 0, _local8.dmg, 4000, 0, 1, tgt));
} else {
var _local10 = "bullet_" + (_root.bulletNum++);
_root.bullets.attachMovie("bullet", _local10, _root.bullets.getNextHighestDepth());
_root.bullets[_local10]._x = px;
_root.bullets[_local10]._y = py;
_root.bullets[_local10].gotoAndStop(tn + 1);
_root.bulletAr.push(new Bullet(_local10, px, py, _local8.dmg, _local8.spd, _local8.reduce, _local8.reducecap, tgt));
}
used = true;
} else if ((tn == flower) && ((Math.pow(558 - px, 2) + Math.pow((377 - py) + 10, 2)) < (_local8.range * _local8.range))) {
_root.lasers.lineStyle(3 * tl, 16777215, 50, "normal", "none");
_root.lasers.moveTo(px, py - 10);
var _local11 = Math.random() * 3;
var _local12 = (Math.random() * 2) * Math.PI;
_root.lasers.lineTo(558 + (_local11 * Math.cos(_local12)), 377 + (_local11 * Math.sin(_local12)));
_root.gene.addGene("\u8349\u592A\u3055\u3093", (tn * 1) / 30);
if (!_root.aegi) {
_root.way.shizumori.gotoAndStop("\u3075\u3064\u3046\uFF13");
}
}
return(false);
}
function getTowerNum() {
return(tn);
}
function getTowerLv() {
return(tl);
}
function upgrade() {
tl++;
}
function isUsed() {
return(used);
}
static var fire = 0;
static var water = 1;
static var wood = 2;
static var thunder = 3;
static var flower = 4;
static var curve = 1.3;
static var rangemod = 1.3;
}
Symbol 276 MovieClip [__Packages.Bullet] Frame 0
class Bullet
{
var nam, px, py, dmg, spd, red, redc, tgt, dummy, ang;
function Bullet (tnam, tpx, tpy, tdmg, tspd, tred, tredc, ttgt) {
nam = tnam;
px = tpx;
py = tpy;
dmg = tdmg;
spd = tspd;
red = tred;
redc = tredc;
tgt = ttgt;
dummy = tnam.length == 0;
}
function adv() {
var _local4 = false;
var _local5;
var _local3 = 0;
while ((_local3 < _root.enemyAr.length) && (!_local4)) {
_local5 = _root.enemyAr[_local3];
_local4 = _local5.getNam() == tgt;
_local3++;
}
if (!_local4) {
return(2);
}
var _local9 = _local5.px;
var _local8 = _local5.py;
var _local6 = Math.min(spd, Math.sqrt(Math.pow(px - _local9, 2) + Math.pow(py - _local8, 2)));
var _local7 = Math.atan2(_local8 - py, _local9 - px);
px = px + (_local6 * Math.cos(_local7));
py = py + (_local6 * Math.sin(_local7));
ang = (_local7 * 180) / Math.PI;
return(((_local6 < spd) ? 1 : 0));
}
function getDamage() {
return(dmg);
}
function getPos() {
return({px:px, py:py, ang:ang});
}
function getNam() {
return(nam);
}
function getTgt() {
return(tgt);
}
function getReduce() {
return(red);
}
function getReduceCap() {
return(redc);
}
function isDummy() {
return(dummy);
}
}
Symbol 277 MovieClip [__Packages.Gene] Frame 0
class Gene
{
var genes, sum;
function Gene () {
genes = new Object();
sum = 100;
genes["\u9759\u68EE\u3055\u3093"] = 100;
}
function addGene(str, n) {
if (genes[str] == undefined) {
genes[str] = n;
} else {
genes[str] = genes[str] + n;
}
sum = sum + n;
}
function getMonster(n) {
if (n < 13) {
return(monster[(n - 1) % 6]);
}
if (n < 29) {
return(monster[(n - 13) % 8]);
}
return(monster[(n - 29) % 10]);
}
function getMonsterName(n) {
return(monster[n]);
}
function getMonsterLength() {
return(monster.length);
}
function getSum() {
return(sum);
}
function getAmount(s) {
if (genes[s] == undefined) {
return(0);
}
return(genes[s]);
}
var monster = ["\u30B3\u30DC\u30EB\u30C9", "\u30B4\u30D6\u30EA\u30F3", "\u30AA\u30FC\u30AF", "\u30D0\u30B0\u30D9\u30A2", "\u30AA\u30FC\u30AC", "\u30C8\u30ED\u30FC\u30EB", "\u30AD\u30DE\u30A4\u30E9", "\u30EF\u30FC\u30A6\u30EB\u30D5", "\u30A6\u30FC\u30BA", "\u30C9\u30E9\u30B4\u30F3", "\u8349\u592A\u3055\u3093"];
}
Symbol 278 MovieClip [__Packages.Map] Frame 0
class Map
{
function Map () {
}
static function isCollision(bx, by, bw) {
return((((((((((((bx < bw) || (bx > (570 - bw))) || (by < bw)) || (by > (420 - bw))) || (((((bx + bw) > 30) && ((bx - bw) < (30 + w))) && ((by + bw) > 0)) && ((by - bw) < 390))) || (((((bx + bw) > 30) && ((bx - bw) < 210)) && ((by + bw) > (390 - w))) && ((by - bw) < 390))) || (((((bx + bw) > (210 - w)) && ((bx - bw) < 210)) && ((by + bw) > 30)) && ((by - bw) < 390))) || (((((bx + bw) > (210 - w)) && ((bx - bw) < 540)) && ((by + bw) > 30)) && ((by - bw) < (30 + w)))) || (((((bx + bw) > (540 - w)) && ((bx - bw) < 540)) && ((by + bw) > 30)) && ((by - bw) < 210))) || (((((bx + bw) > 300) && ((bx - bw) < 540)) && ((by + bw) > (210 - w))) && ((by - bw) < 210))) || (((((bx + bw) > 300) && ((bx - bw) < (300 + w))) && ((by + bw) > (210 - w))) && ((by - bw) < 390))) || (((((bx + bw) > 300) && ((bx - bw) < 555)) && ((by + bw) > (390 - w))) && ((by - bw) < 390)));
}
static var w = 30;
static var dest = [{px:30 + (w / 2), py:390 - (w / 2), ax:0, ay:1}, {px:210 - (w / 2), py:390 - (w / 2), ax:1, ay:0}, {px:210 - (w / 2), py:30 + (w / 2), ax:0, ay:-1}, {px:540 - (w / 2), py:30 + (w / 2), ax:1, ay:0}, {px:540 - (w / 2), py:210 - (w / 2), ax:0, ay:1}, {px:300 + (w / 2), py:210 - (w / 2), ax:-1, ay:0}, {px:300 + (w / 2), py:390 - (w / 2), ax:0, ay:1}, {px:555, py:390 - (w / 2), ax:1, ay:0}];
}
Symbol 279 MovieClip [__Packages.Enemy] Frame 0
class Enemy
{
var nam, px, py, ax, ay, spd, spdmod, spdmodmin, lv, mn, hp, maxHp, dx, dy, ang, phase;
function Enemy (tnam, tpx, tpy, tspd, tlv, tmn, thp) {
nam = tnam;
px = tpx;
py = tpy;
ax = Map.dest[0].ax;
ay = Map.dest[0].ay;
spd = tspd;
spdmod = 1;
spdmodmin = 1;
lv = tlv;
mn = tmn;
hp = thp;
maxHp = thp;
dx = Map.dest[0].px;
dy = Map.dest[0].py;
ang = (Math.atan2(ay, ax) * 180) / Math.PI;
phase = 0;
}
function adv() {
var _local2 = Math.min(spd * spdmod, Math.sqrt(Math.pow(dx - px, 2) + Math.pow(dy - py, 2)));
var _local3 = false;
px = px + (_local2 * ax);
py = py + (_local2 * ay);
if (_local2 < (spd * spdmod)) {
phase++;
px = Map.dest[phase - 1].px;
py = Map.dest[phase - 1].py;
if (phase >= Map.dest.length) {
_local3 = true;
} else {
dx = Map.dest[phase].px;
dy = Map.dest[phase].py;
ax = Map.dest[phase].ax;
ay = Map.dest[phase].ay;
ang = (Math.atan2(ay, ax) * 180) / Math.PI;
}
}
spdmod = Math.min(1, spdmod + 0.002);
return(_local3);
}
function damage(n) {
hp = hp - n;
return(hp <= 0);
}
function getPersentage() {
return(hp / maxHp);
}
function speedReduce(n, m) {
spdmodmin = Math.min(spdmodmin, m);
spdmod = Math.max(spdmod - n, spdmodmin);
}
function getPos() {
return({px:px, py:py, ang:ang});
}
function getNam() {
return(nam);
}
function getMoney() {
return(mn);
}
function getLevel() {
return(lv);
}
}
Symbol 83 Button
on (press) {
_root.nextFrame();
}
Symbol 86 Button
on (press) {
_root.gotoAndStop("\u30D8\u30EB\u30D7");
}
Symbol 92 MovieClip Frame 1
_root.way.shizumori._x = 582;
_root.way.shizumori._y = 269;
_root.clitx = 561;
_root.clity = 367;
_root.aegi = false;
Symbol 97 MovieClip Frame 1
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
_root.aegi = true;
Symbol 97 MovieClip Frame 3
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 97 MovieClip Frame 5
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 97 MovieClip Frame 7
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 97 MovieClip Frame 9
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 97 MovieClip Frame 20
if (_root.hp > 8) {
_parent.gotoAndStop("\u3075\u3064\u3046\uFF11");
} else if (_root.hp > 4) {
_parent.gotoAndStop("\u3075\u3064\u3046\uFF12");
} else {
_parent.gotoAndStop("\u3075\u3064\u3046\uFF13");
}
Symbol 98 MovieClip Frame 1
_root.way.shizumori._x = 582;
_root.way.shizumori._y = 269;
_root.clitx = 561;
_root.clity = 367;
_root.aegi = false;
Symbol 101 MovieClip Frame 1
r = 2;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
_root.aegi = false;
Symbol 101 MovieClip Frame 3
_root.way.shizumori._x = 582;
_root.way.shizumori._y = 269;
_root.clitx = 561;
_root.clity = 367;
Symbol 106 MovieClip Frame 1
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
_root.aegi = true;
Symbol 106 MovieClip Frame 2
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 106 MovieClip Frame 3
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 106 MovieClip Frame 4
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 106 MovieClip Frame 5
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 106 MovieClip Frame 6
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 106 MovieClip Frame 7
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 106 MovieClip Frame 8
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 106 MovieClip Frame 9
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 106 MovieClip Frame 10
r = Math.random() * 3;
a = (Math.random() * 2) * Math.PI;
_root.way.shizumori._x = 582 + (r * Math.cos(a));
_root.way.shizumori._y = 269 + (r * Math.sin(a));
_root.clitx = 561 + (r * Math.cos(a));
_root.clity = 367 + (r * Math.sin(a));
Symbol 106 MovieClip Frame 11
_root.way.shizumori._x = 582;
_root.way.shizumori._y = 269;
_root.clitx = 561;
_root.clity = 367;
Symbol 106 MovieClip Frame 20
if (_root.hp > 8) {
_parent.gotoAndStop("\u3075\u3064\u3046\uFF11");
} else if (_root.hp > 4) {
_parent.gotoAndStop("\u3075\u3064\u3046\uFF12");
} else {
_parent.gotoAndStop("\u3075\u3064\u3046\uFF13");
}
Symbol 107 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 1
stop();
Symbol 142 MovieClip Frame 1
stop();
Symbol 159 Button
on (press) {
if (!_root.picking) {
_root.picking = true;
_root.towerName = Tower.fire;
_root.towers.tguide.swapDepths(_root.towers.getNextHighestDepth());
_root.towers.tguide._xscale = (_root.towers.tguide._yscale = 100);
_root.putCancel._visible = true;
_root.putCancel.gotoAndStop(1);
_root.canput = false;
_root.oMD = {onMouseDown:function () {
var _local3 = grid(_root._xmouse);
var _local2 = grid(_root._ymouse);
canput2 = _root.canput;
i = 0;
while ((i < _root.towerAr.length) && (canput2)) {
canput2 = canput2 && (!_root.towerAr[i].isCollision(_local3, _local2, 15));
i++;
}
canput2 = canput2 && (!Map.isCollision(_local3, _local2, 15));
if (canput2) {
newnam = "tower_" + _root.towerAr.length;
ax = grid(_root._xmouse);
ay = grid(_root._ymouse);
_root.towers.attachMovie("tower", newnam, Math.floor((ay * 1000) + ax));
_root.towers[newnam]._x = ax;
_root.towers[newnam]._y = ay;
_root.towers[newnam].num = _root.towerAr.length;
_root.towers[newnam].gotoAndStop("fire_1");
_root.towerAr.push(new Tower(newnam, _root.towerName, 1, ax, ay));
_root.money = _root.money - new Tower("dummy", _root.towerName, 1, 0, 0).getPrice();
setIcons();
setMoney();
if ((!Key.isDown(16)) || (_root.money < new Tower("dummy", _root.towerName, 1, 0, 0).getPrice())) {
_root.picking = false;
_root.towers.tguide._x = 10000;
_root.towers.tguide._y = 10000;
_root.menus.gotoAndStop("\u30E6\u30CB\u30C3\u30C8\u30E1\u30CB\u30E5\u30FC");
_root.putCancel.gotoAndStop(2);
_root.undo = true;
Mouse.removeListener(_root.oMD);
}
}
}};
Mouse.addListener(_root.oMD);
_root.undo = false;
_parent.gotoAndStop("\u30B9\u30C6\u30FC\u30BF\u30B9");
}
}
Symbol 161 MovieClip Frame 1
stop();
Symbol 164 Button
on (press) {
if (!_root.picking) {
_root.picking = true;
_root.towerName = Tower.water;
_root.towers.tguide.swapDepths(_root.towers.getNextHighestDepth());
_root.towers.tguide._xscale = (_root.towers.tguide._yscale = 100);
_root.putCancel._visible = true;
_root.putCancel.gotoAndStop(1);
_root.canput = false;
_root.oMD = {onMouseDown:function () {
var _local3 = grid(_root._xmouse);
var _local2 = grid(_root._ymouse);
canput2 = _root.canput;
i = 0;
while ((i < _root.towerAr.length) && (canput2)) {
canput2 = canput2 && (!_root.towerAr[i].isCollision(_local3, _local2, 15));
i++;
}
canput2 = canput2 && (!Map.isCollision(_local3, _local2, 15));
if (canput2) {
newnam = "tower_" + _root.towerAr.length;
ax = grid(_root._xmouse);
ay = grid(_root._ymouse);
_root.towers.attachMovie("tower", newnam, Math.floor((ay * 1000) + ax));
_root.towers[newnam]._x = ax;
_root.towers[newnam]._y = ay;
_root.towers[newnam].num = _root.towerAr.length;
_root.towers[newnam].gotoAndStop("water_1");
_root.towerAr.push(new Tower(newnam, _root.towerName, 1, ax, ay));
_root.money = _root.money - new Tower("dummy", _root.towerName, 1, 0, 0).getPrice();
setIcons();
setMoney();
if ((!Key.isDown(16)) || (_root.money < new Tower("dummy", _root.towerName, 1, 0, 0).getPrice())) {
_root.picking = false;
_root.towers.tguide._x = 10000;
_root.towers.tguide._y = 10000;
_root.menus.gotoAndStop("\u30E6\u30CB\u30C3\u30C8\u30E1\u30CB\u30E5\u30FC");
_root.putCancel.gotoAndStop(2);
_root.undo = true;
Mouse.removeListener(_root.oMD);
}
}
}};
Mouse.addListener(_root.oMD);
_root.undo = false;
_parent.gotoAndStop("\u30B9\u30C6\u30FC\u30BF\u30B9");
}
}
Symbol 166 MovieClip Frame 1
stop();
Symbol 169 Button
on (press) {
if (!_root.picking) {
_root.picking = true;
_root.towerName = Tower.wood;
_root.towers.tguide.swapDepths(_root.towers.getNextHighestDepth());
_root.towers.tguide._xscale = (_root.towers.tguide._yscale = 100);
_root.putCancel._visible = true;
_root.putCancel.gotoAndStop(1);
_root.canput = false;
_root.oMD = {onMouseDown:function () {
var _local3 = grid(_root._xmouse);
var _local2 = grid(_root._ymouse);
canput2 = _root.canput;
i = 0;
while ((i < _root.towerAr.length) && (canput2)) {
canput2 = canput2 && (!_root.towerAr[i].isCollision(_local3, _local2, 15));
i++;
}
canput2 = canput2 && (!Map.isCollision(_local3, _local2, 15));
if (canput2) {
newnam = "tower_" + _root.towerAr.length;
ax = grid(_root._xmouse);
ay = grid(_root._ymouse);
_root.towers.attachMovie("tower", newnam, Math.floor((ay * 1000) + ax));
_root.towers[newnam]._x = ax;
_root.towers[newnam]._y = ay;
_root.towers[newnam].num = _root.towerAr.length;
_root.towers[newnam].gotoAndStop("wood_1");
_root.towerAr.push(new Tower(newnam, _root.towerName, 1, ax, ay));
_root.money = _root.money - new Tower("dummy", _root.towerName, 1, 0, 0).getPrice();
setIcons();
setMoney();
if ((!Key.isDown(16)) || (_root.money < new Tower("dummy", _root.towerName, 1, 0, 0).getPrice())) {
_root.picking = false;
_root.towers.tguide._x = 10000;
_root.towers.tguide._y = 10000;
_root.menus.gotoAndStop("\u30E6\u30CB\u30C3\u30C8\u30E1\u30CB\u30E5\u30FC");
_root.putCancel.gotoAndStop(2);
_root.undo = true;
Mouse.removeListener(_root.oMD);
}
}
}};
Mouse.addListener(_root.oMD);
_root.undo = false;
_parent.gotoAndStop("\u30B9\u30C6\u30FC\u30BF\u30B9");
}
}
Symbol 171 MovieClip Frame 1
stop();
Symbol 174 Button
on (press) {
if (!_root.picking) {
_root.picking = true;
_root.towerName = Tower.thunder;
_root.towers.tguide.swapDepths(_root.towers.getNextHighestDepth());
_root.towers.tguide._xscale = (_root.towers.tguide._yscale = 200);
_root.putCancel._visible = true;
_root.putCancel.gotoAndStop(1);
_root.canput = false;
_root.oMD = {onMouseDown:function () {
var _local3 = grid(_root._xmouse);
var _local2 = grid(_root._ymouse);
canput2 = _root.canput;
i = 0;
while ((i < _root.towerAr.length) && (canput2)) {
canput2 = canput2 && (!_root.towerAr[i].isCollision(_local3, _local2, 30));
i++;
}
canput2 = canput2 && (!Map.isCollision(_local3, _local2, 30));
if (canput2) {
newnam = "tower_" + _root.towerAr.length;
ax = grid(_root._xmouse);
ay = grid(_root._ymouse);
_root.towers.attachMovie("tower", newnam, Math.floor((ay * 1000) + ax));
_root.towers[newnam]._x = ax;
_root.towers[newnam]._y = ay;
_root.towers[newnam].num = _root.towerAr.length;
_root.towers[newnam].gotoAndStop("thunder_1");
_root.towerAr.push(new Tower(newnam, _root.towerName, 1, ax, ay));
_root.money = _root.money - new Tower("dummy", _root.towerName, 1, 0, 0).getPrice();
setIcons();
setMoney();
if ((!Key.isDown(16)) || (_root.money < new Tower("dummy", _root.towerName, 1, 0, 0).getPrice())) {
_root.picking = false;
_root.towers.tguide._x = 10000;
_root.towers.tguide._y = 10000;
_root.menus.gotoAndStop("\u30E6\u30CB\u30C3\u30C8\u30E1\u30CB\u30E5\u30FC");
_root.putCancel.gotoAndStop(2);
_root.undo = true;
Mouse.removeListener(_root.oMD);
}
}
}};
Mouse.addListener(_root.oMD);
_root.undo = false;
_parent.gotoAndStop("\u30B9\u30C6\u30FC\u30BF\u30B9");
}
}
Symbol 176 MovieClip Frame 1
stop();
Symbol 179 Button
on (press) {
if (!_root.picking) {
_root.picking = true;
_root.towerName = Tower.flower;
_root.towers.tguide.swapDepths(_root.towers.getNextHighestDepth());
_root.towers.tguide._xscale = (_root.towers.tguide._yscale = 200);
_root.putCancel._visible = true;
_root.putCancel.gotoAndStop(1);
_root.canput = false;
_root.oMD = {onMouseDown:function () {
var _local3 = grid(_root._xmouse);
var _local2 = grid(_root._ymouse);
canput2 = _root.canput;
i = 0;
while ((i < _root.towerAr.length) && (canput2)) {
canput2 = canput2 && (!_root.towerAr[i].isCollision(_local3, _local2, 30));
i++;
}
canput2 = canput2 && (!Map.isCollision(_local3, _local2, 30));
if (canput2) {
newnam = "tower_" + _root.towerAr.length;
ax = grid(_root._xmouse);
ay = grid(_root._ymouse);
_root.towers.attachMovie("tower", newnam, Math.floor((ay * 1000) + ax));
_root.towers[newnam]._x = ax;
_root.towers[newnam]._y = ay;
_root.towers[newnam].num = _root.towerAr.length;
_root.towers[newnam].gotoAndStop("flower_1");
_root.towerAr.push(new Tower(newnam, _root.towerName, 1, ax, ay));
_root.money = _root.money - new Tower("dummy", _root.towerName, 1, 0, 0).getPrice();
setIcons();
setMoney();
if ((!Key.isDown(16)) || (_root.money < new Tower("dummy", _root.towerName, 1, 0, 0).getPrice())) {
_root.picking = false;
_root.towers.tguide._x = 10000;
_root.towers.tguide._y = 10000;
_root.menus.gotoAndStop("\u30E6\u30CB\u30C3\u30C8\u30E1\u30CB\u30E5\u30FC");
_root.putCancel.gotoAndStop(2);
_root.undo = true;
Mouse.removeListener(_root.oMD);
}
}
}};
Mouse.addListener(_root.oMD);
_root.undo = false;
_parent.gotoAndStop("\u30B9\u30C6\u30FC\u30BF\u30B9");
}
}
Symbol 181 MovieClip Frame 1
stop();
Symbol 203 MovieClip Frame 1
stop();
Symbol 222 Button
on (press) {
_root.money = _root.money - _root.towerAr[_root.selecting].getNextPrice();
_root.towerAr[_root.selecting].upgrade();
_root.towers[_root.towerAr[_root.selecting].getNam()].nextFrame();
setMoney();
_root.undo = false;
_root.putCancel.gotoAndStop(1);
_root.putCancel._visible = false;
if (_root.towerAr[_root.selecting].canUpgrade() && (_root.money >= _root.towerAr[_root.selecting].getNextPrice())) {
nowlv.gotoAndStop(_root.towerAr[_root.selecting].getTowerLv() + 1);
nowstat = _root.towerAr[_root.selecting].getStat();
_root.menus.nowdmg.text = nowstat.dmg;
_root.menus.nowrange.text = nowstat.range;
_root.menus.nowshot.text = nowstat.shot;
_root.menus.nextlv.gotoAndStop(_root.towerAr[_root.selecting].getTowerLv() + 2);
_root.towers.trange._xscale = (_root.towers.trange._yscale = nowstat.range);
nextstat = _root.towerAr[_root.selecting].getNextStat();
_root.menus.nextdmg.text = nextstat.dmg;
_root.menus.nextrange.text = nextstat.range;
_root.menus.nextshot.text = nextstat.shot;
_root.menus.cost.text = _root.towerAr[_root.selecting].getNextPrice();
} else {
_root.towers.tmarker._x = 10000;
_root.towers.tmarker._y = 10000;
_root.towers.trange._x = 10000;
_root.towers.trange._y = 10000;
_root.selecting = -1;
prevFrame();
}
}
Symbol 226 Button
on (press) {
_root.towers.tmarker._x = 10000;
_root.towers.tmarker._y = 10000;
_root.towers.trange._x = 10000;
_root.towers.trange._y = 10000;
_root.selecting = -1;
prevFrame();
setIcons();
}
Symbol 235 MovieClip Frame 1
stop();
setIcons();
Symbol 235 MovieClip Frame 3
icon.gotoAndStop(_root.towerName + 1);
tw = new Tower("dummy", _root.towerName, 1, 0, 0);
tws = tw.getStat();
nowdmg.text = tws.dmg;
nowrange.text = tws.range;
nowshot.text = tws.shot;
cost.text = tw.getPrice();
Symbol 238 Button
on (rollOver) {
if (_root.picking) {
_root.picking = false;
_root.towers.tguide._x = 10000;
_root.towers.tguide._y = 10000;
_root.towers.tguide._xscale = (_root.towers.tguide._yscale = 100);
setIcons();
_root.menus.gotoAndStop("\u30E6\u30CB\u30C3\u30C8\u30E1\u30CB\u30E5\u30FC");
Mouse.removeListener(_root.oMD);
_root.undo = false;
_visible = false;
}
}
Symbol 242 Button
on (press) {
if (_root.undo) {
_root.undo = false;
tt = _root.towerAr.pop();
_root.money = _root.money + tt.getPrice();
setMoney();
_root.menus.gotoAndStop("\u30E6\u30CB\u30C3\u30C8\u30E1\u30CB\u30E5\u30FC");
_root.selecting = -1;
_root.towers.tmarker._x = 10000;
_root.towers.tmarker._y = 10000;
_root.towers[tt.getNam()].removeMovieClip();
_visible = false;
gotoAndStop (1);
}
}
Symbol 243 MovieClip Frame 1
stop();
Symbol 257 Button
on (press) {
_root.gotoAndStop("\u30BF\u30A4\u30C8\u30EB");
}
Symbol 274 MovieClip Frame 40
stop();