Frame 1
function checkSO() {
mySO = SharedObject.getLocal("test");
if (!mySO.flush(1)) {
System.showSettings(1);
}
}
_root.isTesting = false;
sites = ["farm.stickpage.com", "www.stickpage.com"];
checkSO();
stop();
Frame 2
function save_campaign() {
var _local2 = SharedObject.getLocal("stickwar_save");
_local2.data.data = _root.campaignData;
trace((("SAVE: " + _local2.data.data.getLevel()) + " ") + _root.campaignData.getLevel());
_local2.flush();
}
function load_campaign() {
var _local2 = SharedObject.getLocal("stickwar_save");
_root.campaignData = _local2.data.data;
}
Frame 9
gotoAndPlay ("stickIntro");
Frame 23
if (introMovie._currentframe == introMovie._totalframes) {
gotoAndPlay ("mainMenu");
}
Frame 24
gotoAndPlay ("intro2");
Frame 25
domain_parts = _url.split("://");
real_domain = domain_parts[1].split("/");
domain = real_domain[0];
trace(domain);
if ((((domain != "74.52.169.210") && (domain != "www.maxgames.com")) && (domain != "www.stickpage.com")) && (domain != "farm.stickpage.com")) {
}
_root.campaignData = new Campaign();
_root.soundManager = new SoundManager();
_root.soundManager.playBackgroundMusic("Entering_the_Stronghold");
Instance of Symbol 2237 MovieClip "menu" in Frame 25
onClipEvent (load) {
var newColour;
newColour = new Color(this);
newColour.setTint(0, 0, 0, 100);
var tintAmount = 100;
var goto = undefined;
}
onClipEvent (enterFrame) {
if (goto == undefined) {
if (tintAmount > 0) {
tintAmount = tintAmount - ((110 - tintAmount) / 5);
} else {
tintAmount = 0;
}
if (tintAmount < 0) {
tintAmount = 0;
}
newColour.setTint(0, 0, 0, tintAmount);
} else {
if (tintAmount < 100) {
tintAmount = tintAmount + ((110 - tintAmount) / 5);
} else {
_root.gotoAndPlay(goto);
}
newColour.setTint(0, 0, 0, tintAmount);
}
}
Frame 33
Color.prototype.setTint = function (r, g, b, amount) {
var _local4 = 100 - amount;
var _local2 = new Object();
_local2.ra = (_local2.ga = (_local2.ba = _local4));
var _local3 = amount / 100;
_local2.rb = r * _local3;
_local2.gb = g * _local3;
_local2.bb = b * _local3;
this.setTransform(_local2);
};
Frame 34
Frame 41
stop();
Frame 42
_root.createEmptyMovieClip("canvas", 1);
blueTechnology = new TechnologyManager();
redTechnology = new TechnologyManager();
ai = new AiScenario();
var game = new Game(1, canvas, 600, 400, 1, 0, redTechnology, blueTechnology, ai);
gotoAndPlay ("game");
Instance of Symbol 2239 MovieClip in Frame 42
onClipEvent (load) {
c = 0;
_visible = true;
this.swapDepths(99999);
}
onClipEvent (enterFrame) {
if (((c++) % 2) == 0) {
time = getTimer();
} else {
fps.text = Math.round(1000 / (getTimer() - time));
}
}
Frame 52
_root.game.update();
Instance of Symbol 2240 MovieClip in Frame 52
onClipEvent (mouseDown) {
_root.game.setMouseDown(true);
}
onClipEvent (mouseUp) {
_root.game.setMouseDown(false);
}
Frame 53
gotoAndPlay ("game");
Frame 63
var hasPlayed = false;
var level = _root.campaignData.getLevel();
level--;
_root.menu.path.gotoAndStop("level_" + level);
_root.soundManager.stopBackgroundMusic();
_root.soundManager.playSoundCentre("marching");
if (tintAmount) {
_root.menu.path.nextFrame();
}
var newColour;
newColour = new Color(menu);
men.push(man);
newColour.setTint(0, 0, 0, 100);
var tintAmount = 100;
var goto = undefined;
Frame 64
if ((tintAmount == 0) && (level >= 0)) {
_root.menu.path.play();
}
Frame 65
if (((tintAmount == 0) && (!hasPlayed)) && (level >= 0)) {
_root.menu.path.play();
hasPlayed = true;
}
if (goto == undefined) {
if (tintAmount > 0) {
tintAmount = tintAmount - ((110 - tintAmount) / 5);
} else {
tintAmount = 0;
}
if (tintAmount < 0) {
tintAmount = 0;
}
newColour.setTint(0, 0, 0, tintAmount);
} else {
if (tintAmount < 100) {
tintAmount = tintAmount + ((110 - tintAmount) / 5);
} else if (goto == "loadLevel") {
_root.campaignData.loadLevel();
_root.gotoAndPlay("game");
}
newColour.setTint(0, 0, 0, tintAmount);
}
Frame 66
gotoAndPlay ("campaign2");
Frame 72
gotoAndPlay ("campaign2");
Frame 73
function getDxTime(num) {
if (num < (savedGameTime / 10)) {
return(num);
}
return(savedGameTime / 10);
}
function getDxGold(num) {
if (num < (savedGameGold / 10)) {
return(num);
}
return(savedGameGold / 10);
}
var newColour;
newColour = new Color(menu);
newColour.setTint(0, 0, 0, 100);
var tintAmount = 100;
var goto = undefined;
soundManager.stopBackgroundMusic();
if (game != undefined) {
var num = (1 + int(Math.random() * 3));
_root.savedGameTime = game.getGameTime() / 1000;
_root.savedGameGold = game.getSquad1().getTeamsGold();
_root.time = game.getGameTime() / 1000;
_root.gold = game.getSquad1().getTeamsGold();
var seconds = Math.round(game.getGameTime() / 1000);
var minutes = Math.floor(seconds / 60);
seconds = seconds - (minutes * 60);
menu.summary.timeDisplay.text = ((("Level completed in " + minutes) + "m and ") + seconds) + "s";
if (_root.campaignData.getLevel() == 12) {
seconds = Math.round(_root.campaignData.getTotalTime() / 1000);
minutes = Math.floor(seconds / 60);
seconds = seconds - (minutes * 60);
menu.summary.timeDisplay.text = "";
}
if (game.squad1.getCastleHealth() != 0) {
campaignData.setLevelTime(game.getGameTime() / 1000);
campaignData.levelUp();
removeMovieClip(game.screen);
removeMovieClip(game.HUD);
game = undefined;
var level = _root.campaignData.getLevel();
_root.menu.display.gotoAndStop(level * 2);
_root.soundManager.playSoundCentre("victorysound" + num);
} else {
menu.summary.timeDisplay.text = "";
var num = (1 + int(Math.random() * 0));
_root.soundManager.playSoundCentre("failmission1");
removeMovieClip(game.screen);
removeMovieClip(game.HUD);
game = undefined;
_root.menu.display.gotoAndStop((level * 2) + 1);
}
}
Frame 74
if (goto == undefined) {
if (tintAmount > 0) {
tintAmount = tintAmount - ((110 - tintAmount) / 5);
} else {
tintAmount = 0;
}
if (tintAmount < 0) {
tintAmount = 0;
}
newColour.setTint(0, 0, 0, tintAmount);
} else {
if (tintAmount < 100) {
tintAmount = tintAmount + ((110 - tintAmount) / 5);
} else {
_root.gotoAndPlay(goto);
}
newColour.setTint(0, 0, 0, tintAmount);
}
Frame 75
gotoAndPlay ("postLevelCampaign2");
Frame 84
gotoAndPlay ("postLevelCampaign");
Frame 85
function tryToBuy(cost, item, level) {
cost = cost / 100;
if (campaignData.getGold() < cost) {
_root.soundManager.playSoundCentre("arrowHitDirt");
return(undefined);
}
campaignData.technology[item](level);
_root.soundManager.playSoundCentre("swordHit1");
campaignData.setGold(campaignData.getGold() - cost);
_root.menu.gotoAndPlay("reloadshop");
}
_root.campaignData.getTotalTime();
defaultDescription = "Click on boxes to select upgrades";
defaultHeading = "Select upgrades";
menu.gold.text = campaignData.getGold();
var newColour;
newColour = new Color(menu);
newColour.setTint(0, 0, 0, 100);
var tintAmount = 100;
var goto = undefined;
Frame 86
if (goto == undefined) {
if (tintAmount > 0) {
tintAmount = tintAmount - ((110 - tintAmount) / 5);
} else {
tintAmount = 0;
}
if (tintAmount < 0) {
tintAmount = 0;
}
newColour.setTint(0, 0, 0, tintAmount);
} else {
if (tintAmount < 100) {
tintAmount = tintAmount + ((110 - tintAmount) / 5);
} else {
_root.gotoAndPlay(goto);
}
newColour.setTint(0, 0, 0, tintAmount);
}
Frame 87
gotoAndPlay ("shop2");
Frame 95
gotoAndPlay ("shop");
Frame 96
var newColour;
newColour = new Color(menu);
newColour.setTint(0, 0, 0, 100);
var tintAmount = 100;
var goto = undefined;
Frame 97
if (goto == undefined) {
if (tintAmount > 0) {
tintAmount = tintAmount - ((110 - tintAmount) / 5);
} else {
tintAmount = 0;
}
if (tintAmount < 0) {
tintAmount = 0;
}
newColour.setTint(0, 0, 0, tintAmount);
} else {
if (tintAmount < 100) {
tintAmount = tintAmount + ((110 - tintAmount) / 5);
} else {
_root.gotoAndPlay(goto);
}
newColour.setTint(0, 0, 0, tintAmount);
}
Frame 98
gotoAndPlay ("difficulty2");
Frame 115
domain_parts = _url.split("://");
real_domain = domain_parts[1].split("/");
domain = real_domain[0];
domainText.text = "Domain is: " + domain;
Frame 124
var newColour;
newColour = new Color(menu);
newColour.setTint(0, 0, 0, 100);
var tintAmount = 100;
var goto = undefined;
_root.soundManager.playBackgroundMusic("Entering_the_Stronghold");
Frame 125
if (goto == undefined) {
if (tintAmount > 0) {
tintAmount = tintAmount - ((110 - tintAmount) / 5);
} else {
tintAmount = 0;
}
if (tintAmount < 0) {
tintAmount = 0;
}
newColour.setTint(0, 0, 0, tintAmount);
} else {
if (tintAmount < 100) {
tintAmount = tintAmount + ((110 - tintAmount) / 5);
} else {
_root.gotoAndPlay(goto);
}
newColour.setTint(0, 0, 0, tintAmount);
}
Frame 126
gotoAndPlay ("credits2");
Symbol 82 MovieClip [footsteps] Frame 50
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 2
stop();
Symbol 98 MovieClip Frame 3
stop();
Symbol 98 MovieClip Frame 4
stop();
Symbol 98 MovieClip Frame 5
stop();
Symbol 98 MovieClip Frame 6
stop();
Symbol 98 MovieClip Frame 7
stop();
Symbol 98 MovieClip Frame 8
stop();
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 2
stop();
Symbol 101 MovieClip Frame 3
stop();
Symbol 101 MovieClip Frame 4
stop();
Symbol 109 MovieClip Frame 1
stop();
Instance of Symbol 98 MovieClip in Symbol 109 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Instance of Symbol 101 MovieClip in Symbol 109 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.bag);
}
Instance of Symbol 98 MovieClip in Symbol 135 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Instance of Symbol 101 MovieClip in Symbol 135 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.bag);
}
Instance of Symbol 98 MovieClip in Symbol 165 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Instance of Symbol 101 MovieClip in Symbol 165 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.bag);
}
Instance of Symbol 98 MovieClip in Symbol 199 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Instance of Symbol 101 MovieClip in Symbol 199 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.bag);
}
Symbol 199 MovieClip Frame 100
stop();
Symbol 200 MovieClip [miner] Frame 1
stop();
Instance of Symbol 109 MovieClip in Symbol 200 MovieClip [miner] Frame 1
onClipEvent (load) {
time = int(Math.random() * 10000);
lastBreath = getTimer();
}
onClipEvent (enterFrame) {
if ((_currentframe == 1) && ((getTimer() - lastBreath) > time)) {
play();
lastBreath = getTimer();
}
}
Instance of Symbol 113 MovieClip "bar" in Symbol 200 MovieClip [miner] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 200 MovieClip [miner] Frame 2
stop();
Symbol 200 MovieClip [miner] Frame 3
stop();
Symbol 200 MovieClip [miner] Frame 4
stop();
Symbol 209 MovieClip [BrdrShdw] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "shadowColor");
Symbol 211 MovieClip [BrdrFace] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "buttonColor");
Symbol 214 MovieClip [BrdrBlk] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "borderColor");
Symbol 216 MovieClip [BrdrHilght] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "highlightColor");
Symbol 219 MovieClip [Defaults] Frame 1
#initclip 1
Object.registerClass("Defaults", mx.skins.halo.Defaults);
#endinitclip
Symbol 220 MovieClip [UIObjectExtensions] Frame 1
#initclip 2
Object.registerClass("UIObjectExtensions", mx.core.ext.UIObjectExtensions);
#endinitclip
Symbol 221 MovieClip [UIObject] Frame 1
#initclip 3
Object.registerClass("UIObject", mx.core.UIObject);
#endinitclip
stop();
Symbol 224 Button
on (keyPress "<Tab>") {
this.tabHandler();
}
Symbol 225 MovieClip Frame 1
#initclip 4
Object.registerClass("FocusManager", mx.managers.FocusManager);
if (_root.focusManager == undefined) {
_root.createClassObject(mx.managers.FocusManager, "focusManager", mx.managers.DepthManager.highestDepth--);
}
#endinitclip
Symbol 226 MovieClip [FocusRect] Frame 1
#initclip 5
Object.registerClass("FocusRect", mx.skins.halo.FocusRect);
#endinitclip
Symbol 227 MovieClip [FocusManager] Frame 1
#initclip 6
Object.registerClass("FocusManager", mx.managers.FocusManager);
#endinitclip
stop();
Symbol 228 MovieClip [UIComponentExtensions] Frame 1
#initclip 7
Object.registerClass("UIComponentExtensions", mx.core.ext.UIComponentExtensions);
#endinitclip
Symbol 229 MovieClip [UIComponent] Frame 1
#initclip 8
Object.registerClass("UIComponent", mx.core.UIComponent);
#endinitclip
stop();
Symbol 230 MovieClip [SimpleButton] Frame 1
#initclip 9
Object.registerClass("SimpleButton", mx.controls.SimpleButton);
#endinitclip
stop();
Symbol 231 MovieClip [Border] Frame 1
#initclip 10
Object.registerClass("Border", mx.skins.Border);
#endinitclip
stop();
Symbol 232 MovieClip [RectBorder] Frame 1
#initclip 11
mx.skins.SkinElement.registerElement(mx.skins.RectBorder.symbolName, Object(mx.skins.RectBorder));
Object.registerClass("RectBorder", mx.skins.halo.RectBorder);
#endinitclip
stop();
Symbol 233 MovieClip [ButtonSkin] Frame 1
#initclip 12
Object.registerClass("ButtonSkin", mx.skins.halo.ButtonSkin);
#endinitclip
Symbol 234 MovieClip [Button] Frame 1
#initclip 13
Object.registerClass("Button", mx.controls.Button);
#endinitclip
stop();
Instance of Symbol 230 MovieClip [SimpleButton] in Symbol 234 MovieClip [Button] Frame 2
//component parameters
onClipEvent (initialize) {
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 239 MovieClip [RadioThemeColor1] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 243 MovieClip [RadioThemeColor2] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 249 MovieClip [RadioButtonAssets] Frame 1
#initclip 14
mx.controls.RadioButton.prototype.adjustFocusRect = function () {
var _local4 = this._parent.focus_mc;
var _local2 = this.iconName;
var _local3 = this.getStyle("themeColor");
if (_local3 == undefined) {
_local3 = 8453965 /* 0x80FF4D */;
}
var _local5 = _local2._width + 4;
var _local6 = _local2._height + 4;
_local4.setSize(_local5, _local6, 8, 100, _local3);
var _local8 = _local2._x;
var _local7 = _local2._y;
_local4.move((this.x - 2) + _local8, (this.y + _local7) - 2);
};
#endinitclip
Symbol 250 MovieClip [RadioButton] Frame 1
#initclip 15
Object.registerClass("RadioButton", mx.controls.RadioButton);
#endinitclip
stop();
Instance of Symbol 234 MovieClip [Button] "foo" in Symbol 250 MovieClip [RadioButton] Frame 2
//component parameters
onClipEvent (initialize) {
icon = "";
label = "Button";
labelPlacement = "right";
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 281 MovieClip Frame 1
stop();
Symbol 281 MovieClip Frame 2
stop();
Symbol 281 MovieClip Frame 3
stop();
Symbol 281 MovieClip Frame 4
stop();
Symbol 281 MovieClip Frame 5
stop();
Symbol 281 MovieClip Frame 6
stop();
Symbol 282 MovieClip Frame 1
stop();
Instance of Symbol 281 MovieClip in Symbol 282 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent._parent.weapon);
}
Symbol 293 MovieClip Frame 1
stop();
Symbol 293 MovieClip Frame 2
stop();
Symbol 293 MovieClip Frame 3
stop();
Symbol 293 MovieClip Frame 4
stop();
Symbol 293 MovieClip Frame 5
stop();
Symbol 293 MovieClip Frame 6
stop();
Symbol 293 MovieClip Frame 7
stop();
Symbol 293 MovieClip Frame 8
stop();
Symbol 294 MovieClip Frame 1
stop();
Instance of Symbol 293 MovieClip in Symbol 294 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent._parent.helmet);
}
Symbol 302 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 2
stop();
Symbol 302 MovieClip Frame 3
stop();
Symbol 302 MovieClip Frame 4
stop();
Symbol 302 MovieClip Frame 5
stop();
Symbol 302 MovieClip Frame 6
stop();
Symbol 302 MovieClip Frame 7
stop();
Symbol 305 MovieClip Frame 1
stop();
Instance of Symbol 302 MovieClip in Symbol 305 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent._parent.shield);
}
Symbol 305 MovieClip Frame 2
stop();
Symbol 305 MovieClip Frame 3
stop();
Symbol 305 MovieClip Frame 4
stop();
Symbol 310 MovieClip Frame 1
stop();
Symbol 326 MovieClip Frame 63
stop();
Symbol 500 MovieClip Frame 70
stop();
Symbol 559 MovieClip Frame 51
stop();
Symbol 582 MovieClip [cursor] Frame 10
stop();
Symbol 584 MovieClip [spartan] Frame 1
stop();
Instance of Symbol 310 MovieClip in Symbol 584 MovieClip [spartan] Frame 1
onClipEvent (load) {
time = int(Math.random() * 10000);
lastBreath = getTimer();
}
onClipEvent (enterFrame) {
if ((_currentframe == 1) && ((getTimer() - lastBreath) > time)) {
play();
lastBreath = getTimer();
}
}
Symbol 584 MovieClip [spartan] Frame 2
stop();
Symbol 584 MovieClip [spartan] Frame 3
stop();
Symbol 584 MovieClip [spartan] Frame 4
stop();
Symbol 584 MovieClip [spartan] Frame 5
stop();
Symbol 584 MovieClip [spartan] Frame 6
stop();
Symbol 584 MovieClip [spartan] Frame 7
stop();
Symbol 584 MovieClip [spartan] Frame 8
stop();
Symbol 584 MovieClip [spartan] Frame 9
stop();
Symbol 584 MovieClip [spartan] Frame 10
stop();
Instance of Symbol 310 MovieClip in Symbol 584 MovieClip [spartan] Frame 10
onClipEvent (load) {
time = int(Math.random() * 10000);
lastBreath = getTimer();
}
onClipEvent (enterFrame) {
if ((_currentframe == 1) && ((getTimer() - lastBreath) > time)) {
play();
lastBreath = getTimer();
}
}
Symbol 595 MovieClip Frame 8
stop();
Symbol 597 Button
on (release) {
_root.gotoAndPlay(3);
}
Symbol 601 MovieClip Frame 1
var amountLoaded = (_root.getBytesLoaded() / _root.getBytesTotal());
bar.barFill._xscale = amountLoaded * 100;
bar._visible = true;
Instance of Symbol 584 MovieClip [spartan] in Symbol 601 MovieClip Frame 1
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
}
Instance of Symbol 113 MovieClip "bar" in Symbol 601 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 200 MovieClip [miner] "miner" in Symbol 601 MovieClip Frame 1
onClipEvent (load) {
weapon = "pickaxe";
bar._visible = false;
gotoAndStop (3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 601 MovieClip Frame 1
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
}
Symbol 601 MovieClip Frame 2
if (_root.getBytesLoaded() != _root.getBytesTotal()) {
gotoAndPlay (1);
}
Symbol 601 MovieClip Frame 56
stop();
Symbol 608 MovieClip [tips2] Frame 1
stop();
Symbol 622 MovieClip [tips1] Frame 1
stop();
Instance of Symbol 605 MovieClip in Symbol 622 MovieClip [tips1] Frame 1
on (release) {
_root.game.enemyAi.messageState = 12;
}
Symbol 622 MovieClip [tips1] Frame 2
stop();
Symbol 622 MovieClip [tips1] Frame 7
stop();
Symbol 630 MovieClip Frame 1
stop();
Symbol 630 MovieClip Frame 2
stop();
Symbol 630 MovieClip Frame 3
stop();
Symbol 630 MovieClip Frame 4
stop();
Symbol 630 MovieClip Frame 5
stop();
Symbol 641 MovieClip Frame 1
stop();
Instance of Symbol 630 MovieClip in Symbol 641 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Instance of Symbol 630 MovieClip in Symbol 647 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Symbol 647 MovieClip Frame 42
stop();
Instance of Symbol 630 MovieClip in Symbol 688 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Symbol 688 MovieClip Frame 33
stop();
Instance of Symbol 630 MovieClip in Symbol 695 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Instance of Symbol 630 MovieClip in Symbol 705 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Symbol 705 MovieClip Frame 14
stop();
Instance of Symbol 630 MovieClip in Symbol 787 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Symbol 787 MovieClip Frame 100
stop();
Symbol 859 MovieClip Frame 23
gotoAndPlay (1);
Symbol 860 MovieClip Frame 1
stop();
Symbol 860 MovieClip Frame 2
stop();
Symbol 860 MovieClip Frame 3
stop();
Symbol 860 MovieClip Frame 4
stop();
Symbol 861 MovieClip Frame 1
Instance of Symbol 630 MovieClip in Symbol 861 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Symbol 861 MovieClip Frame 68
stop();
Instance of Symbol 630 MovieClip in Symbol 879 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Instance of Symbol 630 MovieClip in Symbol 923 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Symbol 923 MovieClip Frame 61
stop();
Instance of Symbol 630 MovieClip in Symbol 947 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Symbol 947 MovieClip Frame 50
stop();
Symbol 948 MovieClip [swordMan] Frame 1
stop();
Instance of Symbol 641 MovieClip in Symbol 948 MovieClip [swordMan] Frame 1
onClipEvent (load) {
time = int(Math.random() * 10000);
lastBreath = getTimer();
}
onClipEvent (enterFrame) {
if ((_currentframe == 1) && ((getTimer() - lastBreath) > time)) {
play();
lastBreath = getTimer();
}
}
Symbol 948 MovieClip [swordMan] Frame 2
stop();
Symbol 948 MovieClip [swordMan] Frame 3
stop();
Symbol 948 MovieClip [swordMan] Frame 4
stop();
Symbol 948 MovieClip [swordMan] Frame 5
stop();
Symbol 948 MovieClip [swordMan] Frame 6
stop();
Symbol 948 MovieClip [swordMan] Frame 7
stop();
Symbol 948 MovieClip [swordMan] Frame 8
stop();
Symbol 948 MovieClip [swordMan] Frame 11
stop();
Symbol 966 MovieClip Frame 1
stop();
Instance of Symbol 98 MovieClip in Symbol 966 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Symbol 1181 MovieClip Frame 1
stop();
Symbol 1181 MovieClip Frame 430
stop();
Symbol 1182 MovieClip [statues] Frame 1
stop();
Symbol 1182 MovieClip [statues] Frame 2
stop();
Symbol 1182 MovieClip [statues] Frame 3
stop();
Symbol 1182 MovieClip [statues] Frame 4
stop();
Symbol 1182 MovieClip [statues] Frame 5
stop();
Symbol 1182 MovieClip [statues] Frame 6
stop();
Symbol 1191 MovieClip Frame 1
stop();
Symbol 1191 MovieClip Frame 2
stop();
Symbol 1198 MovieClip Frame 1
stop();
Instance of Symbol 1191 MovieClip in Symbol 1198 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.quiver);
}
Instance of Symbol 1191 MovieClip in Symbol 1205 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.quiver);
}
Symbol 1265 MovieClip Frame 1
stop();
Symbol 1265 MovieClip Frame 14
stop();
Instance of Symbol 1191 MovieClip in Symbol 1267 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.quiver);
}
Instance of Symbol 1230 MovieClip "bar" in Symbol 1267 MovieClip Frame 26
onClipEvent (load) {
bar._xscale = 0;
}
Symbol 1267 MovieClip Frame 39
stop();
Instance of Symbol 1191 MovieClip in Symbol 1274 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.quiver);
}
Symbol 1274 MovieClip Frame 44
stop();
Instance of Symbol 1191 MovieClip in Symbol 1315 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.quiver);
}
Symbol 1315 MovieClip Frame 39
stop();
Instance of Symbol 1230 MovieClip "bar" in Symbol 1350 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1351 MovieClip [archer] Frame 1
stop();
Instance of Symbol 1198 MovieClip in Symbol 1351 MovieClip [archer] Frame 1
onClipEvent (load) {
time = int(Math.random() * 10000);
lastBreath = getTimer();
}
onClipEvent (enterFrame) {
if ((_currentframe == 1) && ((getTimer() - lastBreath) > time)) {
play();
lastBreath = getTimer();
}
}
Symbol 1352 MovieClip [oldtower1] Frame 1
stop();
Symbol 1352 MovieClip [oldtower1] Frame 20
stop();
Symbol 1358 MovieClip Frame 1
stop();
Symbol 1358 MovieClip Frame 2
stop();
Symbol 1358 MovieClip Frame 3
stop();
Symbol 1407 MovieClip Frame 1
stop();
Symbol 1407 MovieClip Frame 2
stop();
Symbol 1407 MovieClip Frame 3
stop();
Symbol 1412 MovieClip Frame 1
stop();
Symbol 1412 MovieClip Frame 2
stop();
Symbol 1412 MovieClip Frame 3
stop();
Instance of Symbol 1407 MovieClip in Symbol 1418 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.wand);
}
Instance of Symbol 1412 MovieClip in Symbol 1418 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.hat);
}
Instance of Symbol 1407 MovieClip in Symbol 1460 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.wand);
}
Instance of Symbol 1412 MovieClip in Symbol 1460 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.hat);
}
Symbol 1460 MovieClip Frame 100
stop();
Symbol 1495 MovieClip Frame 50
stop();
Instance of Symbol 1407 MovieClip in Symbol 1513 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.wand);
}
Instance of Symbol 1412 MovieClip in Symbol 1513 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.hat);
}
Instance of Symbol 1407 MovieClip in Symbol 1513 MovieClip Frame 34
onClipEvent (load) {
gotoAndStop(_parent._parent.wand);
}
Instance of Symbol 1412 MovieClip in Symbol 1513 MovieClip Frame 36
onClipEvent (load) {
gotoAndStop(_parent._parent.hat);
}
Symbol 1513 MovieClip Frame 90
stop();
Instance of Symbol 1412 MovieClip in Symbol 1585 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.hat);
}
Instance of Symbol 1407 MovieClip in Symbol 1585 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.wand);
}
Instance of Symbol 1407 MovieClip in Symbol 1597 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.wand);
}
Instance of Symbol 1412 MovieClip in Symbol 1597 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.hat);
}
Symbol 1597 MovieClip Frame 86
stop();
Symbol 1598 MovieClip [wizard_main] Frame 1
stop();
Symbol 1598 MovieClip [wizard_main] Frame 2
stop();
Symbol 1598 MovieClip [wizard_main] Frame 3
stop();
Symbol 1598 MovieClip [wizard_main] Frame 4
stop();
Symbol 1598 MovieClip [wizard_main] Frame 5
stop();
Symbol 1598 MovieClip [wizard_main] Frame 6
stop();
Symbol 1869 MovieClip Frame 80
stop();
Symbol 1873 MovieClip [giant] Frame 1
stop();
Symbol 1873 MovieClip [giant] Frame 2
stop();
Symbol 1873 MovieClip [giant] Frame 3
stop();
Symbol 1873 MovieClip [giant] Frame 4
stop();
Symbol 1873 MovieClip [giant] Frame 5
stop();
Symbol 1874 MovieClip Frame 2
stop();
Instance of Symbol 200 MovieClip [miner] in Symbol 1874 MovieClip Frame 2
onClipEvent (load) {
weapon = _root.campaignData.technology.getMinerPickaxe() * 2;
bag = _root.campaignData.technology.getMinerBag();
if (_root.campaignData.technology.getMinerEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 1874 MovieClip Frame 3
stop();
Instance of Symbol 1351 MovieClip [archer] in Symbol 1874 MovieClip Frame 3
onClipEvent (load) {
if (_root.campaignData.technology.getArcherEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 1874 MovieClip Frame 4
stop();
Instance of Symbol 948 MovieClip [swordMan] in Symbol 1874 MovieClip Frame 4
onClipEvent (load) {
weapon = _root.campaignData.technology.getSwordmanSword();
if (_root.campaignData.technology.getSwordmanEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 1874 MovieClip Frame 5
stop();
Instance of Symbol 584 MovieClip [spartan] in Symbol 1874 MovieClip Frame 5
onClipEvent (load) {
helmet = _root.campaignData.technology.getSpartanHelmet();
weapon = 1 + ((_root.campaignData.technology.getSpartanSpear() - 1) * 2);
shield = _root.campaignData.technology.getSpartanShield();
if (_root.campaignData.technology.getSpartanEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 1874 MovieClip Frame 6
stop();
Instance of Symbol 1598 MovieClip [wizard_main] in Symbol 1874 MovieClip Frame 6
onClipEvent (load) {
wand = _root.campaignData.technology.getWizardAttack();
hat = _root.campaignData.technology.getWizardHealing();
if (_root.campaignData.technology.getWizardEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 1874 MovieClip Frame 7
stop();
Instance of Symbol 1873 MovieClip [giant] in Symbol 1874 MovieClip Frame 7
onClipEvent (load) {
weapon = (_root.campaignData.technology.getGiantClub() * 2) - 1;
_xscale = (_xscale * (1 + (_root.campaignData.technology.getGiantStrength() * 0.1)));
_yscale = (_yscale * (1 + (_root.campaignData.technology.getGiantStrength() * 0.1)));
health._visible = false;
if (_root.campaignData.technology.getGiantEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Symbol 1884 MovieClip Frame 1
stop();
Symbol 1885 MovieClip Frame 16
display.text = _parent._parent.cost;
Symbol 1885 MovieClip Frame 18
stop();
Symbol 1887 Button
on (release) {
_root.game.getSquad1().addMinerInQueue();
}
on (rollOver) {
var cost = _root.game.squad1.MINER_COST;
}
Symbol 1890 Button
on (release) {
_root.game.getSquad1().addArcherInQueue();
}
on (rollOver) {
var cost = _root.game.squad1.ARCHER_COST;
}
Symbol 1893 MovieClip Frame 1
stop();
Symbol 1893 MovieClip Frame 2
stop();
Symbol 1894 Button
on (release) {
_root.game.getSquad1().addSwordManInQueue();
}
on (rollOver) {
var cost = _root.game.squad1.SWORD_MAN_COST;
}
Symbol 1896 Button
on (release) {
_root.game.getSquad1().addSpartanInQueue();
}
on (rollOver) {
var cost = _root.game.squad1.SPARTAN_COST;
}
Symbol 1897 Button
on (release) {
_root.game.getSquad1().addWizardInQueue();
}
on (rollOver) {
var cost = _root.game.squad1.WIZARD_COST;
}
Symbol 1899 Button
on (release) {
_root.game.getSquad1().addGiantInQueue();
}
on (rollOver) {
var cost = _root.game.squad1.GIANT_COST;
}
Symbol 1905 MovieClip Frame 1
stop();
Symbol 1908 MovieClip Frame 30
stop();
Symbol 1910 Button
on (release) {
_root.game.getSquad1().removeMinerInQueue();
}
Symbol 1911 Button
on (release) {
_root.game.getSquad1().removeArcherInQueue();
}
Symbol 1912 Button
on (release) {
_root.game.getSquad1().removeSwordManInQueue();
}
Symbol 1913 Button
on (release) {
_root.game.getSquad1().removeSpartanInQueue();
}
Symbol 1914 Button
on (release) {
_root.game.getSquad1().removeWizardInQueue();
}
Symbol 1915 Button
on (release) {
_root.game.getSquad1().removeGiantInQueue();
}
Symbol 1919 MovieClip Frame 16
display.text = _parent._parent.message;
Symbol 1919 MovieClip Frame 18
stop();
Symbol 1920 Button
on (release) {
_root.game.setSquad1Mode(2);
_root.soundManager.playSoundCentre("defend1");
gotoAndStop ("defend");
}
on (rollOver) {
message = "Set units to Defense mode";
}
Symbol 1922 Button
on (release) {
_root.game.setSquad1Mode(3);
_root.soundManager.playSoundCentre("attack1");
gotoAndStop ("attack");
}
on (rollOver) {
message = "Set units to Attack mode";
}
Symbol 1925 Button
on (release) {
_root.game.setSquad1Mode(3);
_root.soundManager.playSoundCentre("attack1");
gotoAndStop ("attack");
}
on (rollOver) {
message = "Set units to Attack mode";
}
Symbol 1927 Button
on (release) {
_root.game.setSquad1Mode(1);
_root.soundManager.playSoundCentre("manTheFort");
gotoAndStop ("garrison");
}
on (rollOver) {
message = "Set units to Garrison mode";
}
Symbol 1929 Button
on (release) {
_root.game.setSquad1Mode(2);
_root.soundManager.playSoundCentre("defend1");
gotoAndStop ("defend");
}
on (rollOver) {
message = "Set units to Defense mode";
}
Symbol 1930 Button
on (release) {
_root.game.setSquad1Mode(1);
_root.soundManager.playSoundCentre("manTheFort");
gotoAndStop ("garrison");
}
on (rollOver) {
message = "Set units to Garrison mode";
}
Symbol 1932 MovieClip [attackDefenceMenu] Frame 1
stop();
Symbol 1932 MovieClip [attackDefenceMenu] Frame 2
stop();
Symbol 1932 MovieClip [attackDefenceMenu] Frame 3
stop();
Symbol 1932 MovieClip [attackDefenceMenu] Frame 4
stop();
Symbol 1935 MovieClip Frame 15
stop();
Symbol 1937 MovieClip Frame 15
stop();
Symbol 1939 MovieClip Frame 1
stop();
Symbol 1939 MovieClip Frame 2
stop();
Symbol 1942 MovieClip Frame 1
stop();
Instance of Symbol 1358 MovieClip in Symbol 1950 MovieClip [HUD] Frame 1
onClipEvent (load) {
gotoAndStop(_root.campaignData.difficultyLevel);
}
Instance of Symbol 1939 MovieClip "soundToggle" in Symbol 1950 MovieClip [HUD] Frame 1
on (release) {
_root.soundManager.toggleSound();
}
Instance of Symbol 1949 MovieClip in Symbol 1950 MovieClip [HUD] Frame 1
on (release) {
_root.game.pauseGame();
}
Symbol 1951 MovieClip Frame 70
stop();
Symbol 1952 MovieClip Frame 50
stop();
Symbol 1964 MovieClip Frame 32
stop();
Symbol 1965 MovieClip [dustsplat] Frame 1
stop();
Symbol 1965 MovieClip [dustsplat] Frame 2
stop();
Symbol 1965 MovieClip [dustsplat] Frame 3
stop();
Symbol 1965 MovieClip [dustsplat] Frame 4
stop();
Symbol 1965 MovieClip [dustsplat] Frame 5
stop();
Symbol 1970 MovieClip [castle] Frame 1
stop();
Instance of Symbol 1351 MovieClip [archer] "archer" in Symbol 1970 MovieClip [castle] Frame 2
onClipEvent (load) {
gotoAndStop (2);
}
Symbol 1970 MovieClip [castle] Frame 29
stop();
Instance of Symbol 1351 MovieClip [archer] "archer" in Symbol 1970 MovieClip [castle] Frame 30
onClipEvent (load) {
gotoAndStop (2);
}
Instance of Symbol 1351 MovieClip [archer] "archer" in Symbol 1970 MovieClip [castle] Frame 46
onClipEvent (load) {
gotoAndStop (4);
}
Symbol 1971 MovieClip [bloodsplat] Frame 1
stop();
Symbol 1971 MovieClip [bloodsplat] Frame 2
stop();
Symbol 1971 MovieClip [bloodsplat] Frame 3
stop();
Symbol 1971 MovieClip [bloodsplat] Frame 4
stop();
Symbol 1971 MovieClip [bloodsplat] Frame 5
stop();
Symbol 1978 MovieClip [blood] Frame 1
stop();
Symbol 1978 MovieClip [blood] Frame 2
stop();
Symbol 1978 MovieClip [blood] Frame 3
stop();
Symbol 2005 MovieClip Frame 13
stop();
Symbol 2005 MovieClip Frame 26
stop();
Symbol 2006 Button
on (release) {
_root.game.isGameStart = false;
_root.game.unpauseGame();
}
Symbol 2039 MovieClip Frame 13
stop();
Symbol 2039 MovieClip Frame 26
stop();
Symbol 2041 MovieClip [levelDescription] Frame 1
stop();
Symbol 2041 MovieClip [levelDescription] Frame 2
stop();
Symbol 2043 Button
on (release) {
if (_root.isTesting) {
_root.game.getSquad2().damageCastle(1000000);
}
}
Symbol 2044 Button
on (release) {
_root.game.unpauseGame();
}
Symbol 2045 Button
on (release) {
_root.levelDescription.removeMovieClip();
_root.tips.removeMovieClip();
_root.game.screen.removeMovieClip();
_root.game.HUD.removeMovieClip();
_root.soundManager.stopBackgroundMusic();
_root.canvas._visible = false;
_root.game = undefined;
_root.gotoAndPlay("mainMenu");
_root.gameMenu.removeMovieClip();
}
Symbol 2046 Button
on (release) {
getURL ("http://www.stickpage.com/stickwarguide.shtml", "_blank");
}
Symbol 2047 Button
on (release) {
_root.removeMovieClip(_root.game.screen);
_root.removeMovieClip(_root.game.HUD);
_root.soundManager.stopBackgroundMusic();
_root.game = undefined;
_root.campaignData.loadLevel();
}
Symbol 2051 Button
on (release) {
gotoAndStop (1);
_root._quality = "high";
}
Symbol 2055 Button
on (release) {
gotoAndStop (2);
_root._quality = "medium";
}
Symbol 2059 Button
on (release) {
gotoAndStop (3);
_root._quality = "low";
}
Symbol 2062 MovieClip Frame 1
stop();
stop();
Symbol 2062 MovieClip Frame 2
stop();
Symbol 2062 MovieClip Frame 3
stop();
Symbol 2065 Button
on (release) {
_root.game.enableGlow();
}
Symbol 2068 Button
on (release) {
_root.game.disableGlow();
}
Symbol 2069 MovieClip Frame 1
stop();
Symbol 2069 MovieClip Frame 2
stop();
Symbol 2138 MovieClip [goldAdded] Frame 50
this.removeMovieClip();
Symbol 2154 MovieClip [tips5] Frame 1
stop();
Symbol 2157 MovieClip [healthLost] Frame 50
this.removeMovieClip();
Symbol 2160 MovieClip Frame 1
stop();
Symbol 2160 MovieClip Frame 2
stop();
Symbol 2163 MovieClip [tipsDefence] Frame 101
stop();
Symbol 2165 MovieClip [tipsAttack] Frame 101
stop();
Symbol 2167 MovieClip [tips6] Frame 1
stop();
Symbol 2169 MovieClip [tips7] Frame 1
stop();
Symbol 2171 MovieClip [tips8] Frame 1
stop();
Symbol 2174 MovieClip [tips3] Frame 1
stop();
Symbol 2502 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager
{
var game, sounds, currentTrack, tracks, isSound, fadeAmount, x, y;
function SoundManager () {
game = game;
sounds = [];
currentTrack = undefined;
tracks = {};
isSound = true;
fadeAmount = 0;
addTrack("Battle_of_the_Shadow_Elves");
addTrack("fieldOfMemories");
addTrack("Entering_the_Stronghold");
addSound("marching", "marching");
addSound("arrowShot", "arrowShot");
addSound("magicSound", "magicSound");
addSound("arrowHitDirt", "arrowHitDirt");
addSound("arrowHitMetal", "arrowHitMetal");
addSound("victoryHorns", "victoryHorns");
addSound("swordHit1", "swordHit1");
addSound("swordHit2", "swordHit2");
addSound("swordHit3", "swordHit3");
addSound("swordHit4", "swordHit4");
addSound("magesummon", "magesummon");
addSound("magespellfail", "magespellfail");
addSound("buildingDestroySound", "buildingDestroySound");
addSound("attack1", "attack1");
addSound("defend1", "defend1");
addSound("manTheFort", "manTheFort");
addSound("pain4", "pain4");
addSound("pain5", "pain5");
addSound("pain6", "pain6");
addSound("pain7", "pain7");
addSound("giantSwing1", "giantSwing1");
addSound("giantSwing2", "giantSwing2");
addSound("unitCreateButtonSound", "unitCreateButtonSound");
addSound("failmission1", "failmission1");
addSound("victorysound1", "victorysound1");
addSound("victorysound2", "victorysound2");
addSound("victorysound3", "victorysound3");
}
function setGame(game) {
this.game = game;
}
function update() {
x = game.getScreenX();
y = 0;
}
function playSoundCentre(soundLabel) {
playSoundStunt(soundLabel, -game.getScreenX());
}
function playSound(soundLabel, xPosition) {
if (!isSound) {
return(undefined);
}
if (sounds[soundLabel] != undefined) {
var _local3 = (100 * Math.abs(game.getScreenX() + xPosition)) / (game.getRIGHT() - game.getLEFT());
if (game == undefined) {
_local3 = 0;
}
var _local4 = ((100 - _local3) * (100 - _local3)) / 100;
sounds[soundLabel].setVolume(_local4);
var _local5 = (200 * (game.getScreenX() + xPosition)) / (game.getRIGHT() - game.getLEFT());
sounds[soundLabel].setPan(_local5);
if (sounds[soundLabel].position == sounds[soundLabel].duration) {
sounds[soundLabel].start();
} else if (sounds[soundLabel].position == 0) {
sounds[soundLabel].start();
}
}
}
function playSoundStunt(soundLabel, xPosition) {
if (!isSound) {
return(undefined);
}
if (sounds[soundLabel] != undefined) {
var _local2 = (100 * Math.abs(game.getScreenX() + xPosition)) / (game.getRIGHT() - game.getLEFT());
if (game == undefined) {
_local2 = 0;
}
var _local4 = ((100 - _local2) * (100 - _local2)) / 100;
sounds[soundLabel].setVolume(_local4 * 0.7);
var _local5 = (200 * (game.getScreenX() + xPosition)) / (game.getRIGHT() - game.getLEFT());
sounds[soundLabel].setPan(_local5);
sounds[soundLabel].start();
}
}
function addTrack(labelName) {
var _local5 = _root.attachMovie(labelName + "Mc", labelName + "Mc", trackDepth + trackNumber);
var _local4 = new Sound(_local5);
_local4.attachSound(labelName);
tracks[labelName] = _local4;
trackNumber++;
}
function addSound(labelName, libraryName) {
var _local4 = _root.attachMovie(labelName + "Mc", libraryName + "Mc", soundDepth + soundNumber);
var _local3 = new Sound(_local4);
_local3.attachSound(libraryName);
sounds[labelName] = _local3;
soundNumber++;
}
function playBackgroundMusic(name) {
tracks[currentTrack].stop();
currentTrack = name;
tracks[name].setVolume(100);
if (!isSound) {
tracks[name].setVolume(0);
}
tracks[name].start(0, 99);
}
function stopBackgroundMusic() {
tracks[currentTrack].stop();
}
function setSoundToggle() {
toggleSound();
toggleSound();
}
function toggleSound() {
if (isSound) {
isSound = false;
tracks[currentTrack].setVolume(0);
_root.HUD.soundToggle.gotoAndStop(2);
} else {
isSound = true;
tracks[currentTrack].setVolume(100);
_root.HUD.soundToggle.gotoAndStop(1);
}
}
var soundDepth = 1900000000;
var soundNumber = 0;
var trackDepth = 2000000000;
var trackNumber = 0;
}
Symbol 2503 MovieClip [__Packages.Game] Frame 0
class Game
{
var lastCharacter, enemyAi, viewportWidth, viewportHeight, level, gold, canvas, screenX, currentLevel, screenDx, redTechnology, blueTechnology, selectedGroup, backNumber, middleNumber, foreNumber, lastMousePress, lastManAdd, startTime, pauseTime, hadCharacter, charChangeTime, pauseStartTime, isPaused, isGameStart, keys, background, middleground, screen, screenWidth, screenHeight, cursor, HUD, LEFT_BOUNDARY, RIGHT_BOUNDARY, TOP_BOUNDARY, BOTTOM_BOUNDARY, mineHolder, bloodManager, projectileManager, partitionManager, squad1Members, squad2Members, squad1, squad2, isGameOver, gameEndTime, colourTint, currentCharacter, lastKeyDown, lastKeyTime;
function Game (currentLevel, screen, viewportWidth, viewportHeight, level, gold, redTech, blueTech, ai, backNumber, middleNumber, foreNumber) {
lastCharacter = undefined;
enemyAi = ai;
this.viewportWidth = viewportWidth;
this.viewportHeight = viewportHeight;
this.level = level;
this.gold = gold;
canvas = screen;
screenX = 0;
this.currentLevel = currentLevel;
screenDx = 0;
redTechnology = redTech;
blueTechnology = blueTech;
selectedGroup = 0;
this.backNumber = backNumber;
this.middleNumber = middleNumber;
this.foreNumber = foreNumber;
init();
lastMousePress = getTimer();
lastManAdd = getTimer();
startTime = getTimer();
pauseTime = 0;
hadCharacter = false;
charChangeTime = 0;
pauseStartTime = getTimer();
}
function init() {
_root.soundManager.setGame(this);
_root.soundManager.playBackgroundMusic("Battle_of_the_Shadow_Elves");
isPaused = true;
isGameStart = true;
keys = {};
keys.UP = 87;
keys.DOWN = 83;
keys.LEFT = 65;
keys.RIGHT = 68;
keys.ARROW_UP = 38;
keys.ARROW_DOWN = 40;
keys.ARROW_LEFT = 37;
keys.ARROW_RIGHT = 39;
keys.ATTACK = 32;
keys.BLOCK = 81;
keys.THROW = 70;
_root.attachMovie("levelDescription", "levelDescription", 19999999, {_x:0, _y:0});
_root.levelDescription.screen.gotoAndStop(_root.campaignData.getLevel() + 1);
_root.attachMovie("gameMenu", "gameMenu", 19999998, {_x:0, _y:0, _visible:false});
canvas.attachMovie("background" + backNumber, "background", baseDepth++, {_x:0, _y:0});
canvas.background.cacheAsBitmap = true;
background = canvas.background;
canvas.attachMovie("middleground" + middleNumber, "middleground", baseDepth++, {_x:0, _y:0});
canvas.middleground.cacheAsBitmap = true;
middleground = canvas.middleground;
canvas.createEmptyMovieClip("screen", baseDepth++);
screen = canvas.screen;
screen.attachMovie("foreground" + foreNumber, "gameBackground", baseDepth++, {_x:0, _y:0});
screen.gameBackground.cacheAsBitmap = true;
screenWidth = screen._width;
screenHeight = 400;
screen.attachMovie("castle", "leftCastle", topDepth++);
screen.leftCastle._x = -55;
screen.leftCastle.type = -1;
screen.leftCastle.x = screen.leftCastle._x;
screen.leftCastle._y = screenHeight;
screen.leftCastle._visible = true;
screen.leftCastle.cacheAsBitmap = true;
screen.attachMovie("castle", "rightCastle", topDepth++);
screen.rightCastle._x = screenWidth + 55;
screen.rightCastle.type = -1;
screen.rightCastle.x = screen.rightCastle._x;
screen.rightCastle._y = screenHeight;
screen.rightCastle._xscale = screen.rightCastle._xscale * -1;
screen.rightCastle._visible = true;
screen.rightCastle.cacheAsBitmap = true;
screen.attachMovie("statues", "leftStatue", topDepth++);
screen.leftStatue.gotoAndStop(blueTechnology.statue);
screen.leftStatue._x = 200;
screen.leftStatue.type = -1;
screen.leftStatue.x = screen.leftStatue._x;
screen.leftStatue._y = screenHeight - 30;
screen.leftStatue.cacheAsBitmap(true);
screen.leftStatue.swapDepths((getManBaseDepth() + (screen.leftStatue._y * getScreenWidth())) + screen.leftStatue._x);
screen.leftStatue.cacheAsBitmap = true;
screen.attachMovie("castleHitArea", "leftStatueHitArea", topDepth++);
screen.leftStatueHitArea._x = 200;
screen.leftStatueHitArea.type = -1;
screen.leftStatueHitArea.x = screen.leftStatue._x;
screen.leftStatueHitArea._y = screenHeight - 30;
screen.leftStatueHitArea._alpha = 0;
screen.attachMovie("statues", "rightStatue", topDepth++);
screen.rightStatue.gotoAndStop(redTechnology.statue);
screen.rightStatue._x = screenWidth - 200;
screen.rightStatue.type = -1;
screen.rightStatue.x = screen.rightStatue._x;
screen.rightStatue._y = screenHeight - 30;
screen.rightStatue._xscale = screen.rightStatue._xscale * -1;
screen.rightStatue.cacheAsBitmap(true);
screen.rightStatue.swapDepths((getManBaseDepth() + (screen.rightStatue._y * getScreenWidth())) + screen.rightStatue._x);
screen.rightStatue.cacheAsBitmap = true;
screen.attachMovie("castleHitArea", "rightStatueHitArea", topDepth++);
screen.rightStatueHitArea._x = screenWidth - 200;
screen.rightStatueHitArea.type = -1;
screen.rightStatueHitArea.x = screen.rightStatue._x;
screen.rightStatueHitArea._y = screenHeight - 30;
screen.rightStatueHitArea._alpha = 0;
screen.attachMovie("cursor", "cursor", 100000001);
cursor = screen.cursor;
_root.attachMovie("HUD", "HUD", 9999999, {_x:0, _y:0});
HUD = _root.HUD;
HUD.attackDefenceMenu.gotoAndStop(2);
LEFT_BOUNDARY = 0;
RIGHT_BOUNDARY = screenWidth;
TOP_BOUNDARY = screenHeight - 50;
BOTTOM_BOUNDARY = screenHeight - 5;
mineHolder = new GoldMineManager(this);
bloodManager = new BloodManager(this);
projectileManager = new ProjectileManager(this);
partitionManager = new PartitionManager(this);
initSound();
squad1Members = [];
squad2Members = [];
squad1 = new AiSquad(screen.leftCastle, screen.leftStatue, screen.leftStatueHitArea, squad1Members, squad2Members, 0, 350, "blue", this, blueTechnology);
squad2 = new AiSquad(screen.rightCastle, screen.rightStatue, screen.rightStatueHitArea, squad2Members, squad1Members, RIGHT_BOUNDARY + 0, 350, "red", this, redTechnology);
squad1.setEnemySquad(squad2);
squad2.setEnemySquad(squad1);
mineHolder.addCloseMines();
mineHolder.addCloseMines();
enemyAi.init(this, squad2);
squad1.update();
squad2.update();
_root.soundManager.setSoundToggle();
updateHUDButtons();
}
function initSound() {
}
function update() {
if (!isGameStart) {
if (_root.levelDescription._x > -400) {
_root.levelDescription._x = _root.levelDescription._x - 9;
} else {
_root.levelDescription._visible = false;
}
}
if (((!isGameOver) && (isPaused)) && (!isGameStart)) {
_root.gameMenu.screen.qualityBox.gotoAndStop(_root._quality);
if (_root.campaignData.isGlow) {
_root.gameMenu.screen.glowBox.gotoAndStop(1);
} else {
_root.gameMenu.screen.glowBox.gotoAndStop(2);
}
if (_root.gameMenu._x < 0) {
_root.gameMenu._x = _root.gameMenu._x + 40;
if (_root.gameMenu._x > 0) {
_root.gameMenu._x = 0;
}
}
_root.gameMenu._visible = true;
var _local6 = canvas.filters;
if (_local6[0].blurX < 10) {
canvas.filters = _local6;
}
if (Key.isDown(27)) {
if (_root.gameMenu._x == 0) {
unpauseGame();
}
}
return(undefined);
}
if (_root.gameMenu._x > -400) {
_root.gameMenu._x = _root.gameMenu._x - 20;
} else {
_root.gameMenu._visible = false;
}
if (isGameOver && ((getTimer() - gameEndTime) > GAME_END_WAIT)) {
if (tintAmount < 100) {
if (tintAmount >= 0) {
tintAmount = tintAmount + ((110 - tintAmount) / 5);
}
if (tintAmount < 0) {
tintAmount = 0;
}
colourTint = new Color(canvas);
colourTint.setTint(0, 0, 0, tintAmount);
colourTint = new Color(_root.HUD);
colourTint.setTint(0, 0, 0, tintAmount);
colourTint = new Color(_root.levelDescription);
colourTint.setTint(0, 0, 0, tintAmount);
} else {
_root.canvas._visible = false;
HUD._visible = false;
_root.levelDescription.removeMovieClip();
_root.gameMenu.removeMovieClip();
_root.tips.removeMovieClip();
_root.gotoAndPlay("postLevelCampaign");
}
return(undefined);
}
HUD.goldBox.goldDisplay.text = Math.round(squad1.getTeamsGold());
HUD.goldBox.populationDisplay.text = (squad1.getNumberLiving() + squad1.getQueueSize()) + "/20";
HUD.menuDisplay.text = squad1.getTeamSize() + squad2.getTeamSize();
if (tintAmount > 0) {
if (tintAmount > 0) {
tintAmount = tintAmount - ((110 - tintAmount) / 5);
}
if (tintAmount < 0) {
tintAmount = 0;
}
colourTint = new Color(canvas);
colourTint.setTint(0, 0, 0, tintAmount);
colourTint = new Color(_root.HUD);
colourTint.setTint(0, 0, 0, tintAmount);
colourTint = new Color(_root.levelDescription);
colourTint.setTint(0, 0, 0, tintAmount);
}
var _local6 = canvas.filters;
if (_local6.length != 0) {
_local6[0].blurX = _local6[0].blurX - 0.5;
_local6[0].blurY = _local6[0].blurY - 0.5;
canvas.filters = _local6;
if (_local6[0].blurX == 0) {
_local6.pop();
canvas.filters = _local6;
}
}
if (isGameStart) {
return(undefined);
}
var _local4;
var _local3;
var _local5;
enemyAi.update(this, squad2);
if (Key.isDown(192)) {
if (selectedGroup != 0) {
currentCharacter = undefined;
}
selectedGroup = 0;
}
if (Key.isDown(49)) {
if (selectedGroup != 1) {
currentCharacter = undefined;
}
selectedGroup = 1;
currentCharacter = squad1.getManFromGroup(selectedGroup);
lastKeyDown = 49;
lastKeyTime = getTimer();
}
if (Key.isDown(50)) {
if (selectedGroup != 2) {
currentCharacter = undefined;
}
selectedGroup = 2;
currentCharacter = squad1.getManFromGroup(selectedGroup);
lastKeyDown = 50;
lastKeyTime = getTimer();
}
if (Key.isDown(51)) {
if (selectedGroup != 3) {
currentCharacter = undefined;
}
selectedGroup = 3;
currentCharacter = squad1.getManFromGroup(selectedGroup);
lastKeyDown = 51;
lastKeyTime = getTimer();
}
if (Key.isDown(52)) {
if (selectedGroup != 4) {
currentCharacter = undefined;
}
selectedGroup = 4;
currentCharacter = squad1.getManFromGroup(selectedGroup);
lastKeyDown = 52;
lastKeyTime = getTimer();
}
if (Key.isDown(53)) {
if (selectedGroup != 5) {
currentCharacter = undefined;
}
selectedGroup = 5;
currentCharacter = squad1.getManFromGroup(selectedGroup);
lastKeyDown = 53;
lastKeyTime = getTimer();
}
if (Key.isDown(54)) {
if (selectedGroup != 6) {
currentCharacter = undefined;
}
selectedGroup = 6;
currentCharacter = squad1.getManFromGroup(selectedGroup);
lastKeyDown = 54;
lastKeyTime = getTimer();
}
if ((getTimer() - lastManAdd) > 100) {
if (Key.isDown(55)) {
squad2.addMiner();
lastManAdd = getTimer();
}
if (Key.isDown(56)) {
squad2.addArcher();
lastManAdd = getTimer();
}
if (Key.isDown(57)) {
squad2.addSwordMan();
lastManAdd = getTimer();
}
if (Key.isDown(58)) {
squad2.addSpartan();
lastManAdd = getTimer();
}
}
_local5 = (screenX - screen._x) / 6;
screen._x = screen._x + _local5;
middleground._x = middleground._x + (_local5 / 2);
if (((middleground._x + _local5) <= 0) && ((middleground._x + _local5) >= ((-screenWidth) + viewportWidth))) {
middleground._x = middleground._x + _local5;
}
if (((screen._x + _local5) <= 0) && ((screen._x + _local5) >= ((-screenWidth) + viewportWidth))) {
screen._x = screen._x + _local5;
}
if (screenX > 0) {
screenX = 0;
}
if (screenX < ((-screenWidth) + viewportWidth)) {
screenX = (-screenWidth) + viewportWidth;
}
updateSelected();
if (((currentCharacter.getUnitType() == "archer") && (!Archer(currentCharacter).getIsShooting())) || (currentCharacter.getUnitType() != "archer")) {
if (isMouseDown) {
_local3 = squad1.getCastleArcherGroup();
for (_local4 in _local3) {
if (((getTimer() - lastMousePress) > 300) && (_local3[_local4].clip.hitTest(_root._xmouse, _root._ymouse))) {
_root.attachMovie("tipsDefence", "tipsDefence", 99999999999432);
}
}
_local3 = squad2.getCastleArcherGroup();
for (_local4 in _local3) {
if (((getTimer() - lastMousePress) > 300) && (_local3[_local4].clip.hitTest(_root._xmouse, _root._ymouse))) {
_root.attachMovie("tipsAttack", "tipsAttack", 99999999999433);
}
}
_local3 = squad1.getMen();
for (_local4 in _local3) {
if (((getTimer() - lastMousePress) > 300) && (_local3[_local4].clip.hitTest(_root._xmouse, _root._ymouse))) {
if (currentCharacter == _local3[_local4]) {
currentCharacter = undefined;
selectedGroup = currentCharacter.type;
currentCharacter.clearStatus();
lastMousePress = getTimer();
} else {
currentCharacter = _local3[_local4];
selectedGroup = currentCharacter.type;
currentCharacter.clearStatus();
lastMousePress = getTimer();
}
}
}
}
}
if (currentCharacter) {
if (currentCharacter.getClip().filters.length == 0) {
}
if (Math.abs(currentCharacter.getX() - cursor._x) > 20) {
}
cursor._xscale = currentCharacter.getScale() * 1.5;
cursor._yscale = currentCharacter.getScale() * 1.5;
cursor._x = cursor._x + ((currentCharacter.getX() - cursor._x) / 4);
cursor._y = cursor._y + (((currentCharacter.getY() - ((90 * currentCharacter.getScale()) / 100)) - cursor._y) / 4);
} else {
cursor._y = -5;
}
if (currentCharacter.getIsAlive() == false) {
currentCharacter = undefined;
charChangeTime = getTimer();
}
if (lastCharacter != currentCharacter) {
}
userInput();
squad1.update();
squad2.update();
mineHolder.update();
projectileManager.update();
bloodManager.update();
centerScreen();
wasIsMouseDown = isMouseDown;
lastCharacter = currentCharacter;
}
function updateHUDButtons() {
HUD.minerButton._visible = squad1.getTechnology().getMinerEnabled();
HUD.swordmanButton._visible = squad1.getTechnology().getSwordmanEnabled();
HUD.archerButton._visible = squad1.getTechnology().getArcherEnabled();
HUD.spartanButton._visible = squad1.getTechnology().getSpartanEnabled();
HUD.wizardButton._visible = squad1.getTechnology().getWizardEnabled();
HUD.giantButton._visible = squad1.getTechnology().getGiantEnabled();
}
function updateSelected() {
if (currentCharacter != undefined) {
selectedGroup = currentCharacter.type;
}
_root.HUD.groupDisplay.gotoAndStop(selectedGroup + 1);
}
function centerScreen() {
if (currentCharacter) {
if (currentCharacter.getUnitType() == "archer") {
if (currentCharacter.getCurrentDirection() == 1) {
screenX = (-currentCharacter.getX()) + (viewportWidth / 6);
if (currentCharacter.getX() < (viewportWidth / 6)) {
screenX = 0;
}
if (currentCharacter.getX() > ((RIGHT_BOUNDARY - viewportWidth) + (viewportWidth / 6))) {
screenX = (-RIGHT_BOUNDARY) + viewportWidth;
}
} else {
screenX = (-currentCharacter.getX()) + ((viewportWidth * 5) / 6);
if (currentCharacter.getX() < ((viewportWidth * 5) / 6)) {
screenX = 0;
}
if (currentCharacter.getX() > (RIGHT_BOUNDARY - (viewportWidth / 6))) {
screenX = (-RIGHT_BOUNDARY) + viewportWidth;
}
}
} else {
screenX = (-currentCharacter.getX()) + (viewportWidth / 2);
if (currentCharacter.getX() < (viewportWidth / 2)) {
screenX = 0;
}
if (currentCharacter.getX() > (RIGHT_BOUNDARY - (viewportWidth / 2))) {
screenX = (-RIGHT_BOUNDARY) + viewportWidth;
}
}
}
}
function userInput() {
if (Key.isDown(27)) {
if (_root.gameMenu._x < -300) {
pauseGame();
}
}
if (currentCharacter) {
currentCharacter.keyInterface();
} else if ((getTimer() - charChangeTime) > 500) {
if ((Key.isDown(getKey("ARROW_LEFT")) || (Key.isDown(getKey("LEFT")))) || ((_root._ymouse > 60) && (_root._xmouse < 60))) {
if ((screenX + SCROLL_SPEED) < 0) {
screenX = screenX + SCROLL_SPEED;
} else {
screenX = 0;
}
} else if ((Key.isDown(getKey("ARROW_RIGHT")) || (Key.isDown(getKey("RIGHT")))) || ((_root._ymouse > 60) && (_root._xmouse > 540))) {
if ((screenX - SCROLL_SPEED) > ((-screenWidth) + viewportWidth)) {
screenX = screenX + (-SCROLL_SPEED);
} else {
screenX = (-screenWidth) + viewportWidth;
}
}
}
}
function getScreenWidth() {
return(screenWidth);
}
function getScreenHeight() {
return(screenHeight);
}
function nextUnitIndex() {
return(unitIndex++);
}
function getManBaseDepth() {
return(manBaseDepth);
}
function setCurrentCharacter(man) {
currentCharacter = man;
}
function getCurrentCharacter() {
return(currentCharacter);
}
function setMouseDown(v) {
isMouseDown = v;
}
function getIsMouseDown() {
return(isMouseDown);
}
function getLEFT() {
return(LEFT_BOUNDARY);
}
function getRIGHT() {
return(RIGHT_BOUNDARY);
}
function getTOP() {
return(TOP_BOUNDARY);
}
function getBOTTOM() {
return(BOTTOM_BOUNDARY);
}
function getMineHolder() {
return(mineHolder);
}
function getScreenX() {
return(screenX);
}
function setScreenX(num) {
screenX = num;
}
function getPartitionManager() {
return(partitionManager);
}
function getBloodManager() {
return(bloodManager);
}
function setSquad1Mode(newMode) {
squad1.setGroupMode(newMode, 0);
}
function getSoundManager() {
return(_root.soundManager);
}
function getKey(str) {
return(keys[str]);
}
function getSquad1() {
return(squad1);
}
function getSquad2() {
return(squad2);
}
function pauseGame() {
if (isPaused) {
return(undefined);
}
isPaused = true;
pauseStartTime = getTimer();
var _local4 = new flash.filters.BlurFilter(0, 0, 1);
var _local3 = canvas.filters;
_local3 = [];
_local3.push(_local4);
canvas.filters = _local3;
_root.gameMenu.scroll.gotoAndPlay(1);
_root.gameMenu.mask.gotoAndPlay(1);
}
function unpauseGame() {
if (!isPaused) {
return(undefined);
}
if (pauseStartTime != undefined) {
pauseTime = pauseTime + (getTimer() - pauseStartTime);
}
isPaused = false;
_root.levelDescription.scroll.play();
_root.levelDescription.mask.play();
_root.gameMenu.scroll.gotoAndPlay(14);
_root.gameMenu.mask.gotoAndPlay(14);
}
function finishLevel() {
if (isGameOver) {
return(undefined);
}
isGameOver = true;
gameEndTime = getTimer();
if (isPaused) {
unpauseGame();
}
}
function getGameTime() {
if (isPaused) {
var _local2 = ((getTimer() - startTime) - pauseTime) - (getTimer() - pauseStartTime);
if (isNaN(_local2)) {
return(0);
}
return(((getTimer() - startTime) - pauseTime) - (getTimer() - pauseStartTime));
}
var _local2 = (getTimer() - startTime) - pauseTime;
if (isNaN(_local2)) {
return(0);
}
return((getTimer() - startTime) - pauseTime);
}
function getIsGlow() {
return(_root.campaignData.isGlow);
}
function enableGlow() {
_root.campaignData.isGlow = true;
squad1.enableGlow();
squad2.enableGlow();
}
function disableGlow() {
_root.campaignData.isGlow = false;
squad1.disableGlow();
squad2.disableGlow();
}
var KEY_DOUBLE_TIME = 1000;
var KEY_DOUBLE_TIME_MIN = 30;
var baseDepth = 2;
var manBaseDepth = 10000;
var topDepth = 5000000;
var unitIndex = 0;
var isMouseDown = false;
var wasIsMouseDown = false;
var SCROLL_SPEED = 20;
var tintAmount = 100;
var GAME_END_WAIT = 2000;
}
Symbol 2504 MovieClip [__Packages.Man] Frame 0
class Man
{
var x, y, health, squad, game, simUnits, yOffset, dy, isAlive, unitType, maxVelocityModifier, damageTime, damageDirectionTime, currentDirection, lastActionTime, isInAction, isGarrisoned, isQueued, deathType, inShock, shockTime, currentTint, clip, name, baseScale, dieTime, dx;
function Man (x, y, squad, simUnits, game) {
this.x = x;
this.y = y;
health = MAX_HEALTH;
this.squad = squad;
this.game = game;
this.simUnits = simUnits;
yOffset = (Math.random() * 8) - 4;
dy = (dy = 0);
isAlive = true;
unitType = undefined;
maxVelocityModifier = 1;
damageTime = 0;
damageDirectionTime = 1000;
currentDirection = 1;
lastActionTime = game.getGameTime();
isInAction = false;
isGarrisoned = false;
isQueued = false;
deathType = undefined;
inShock = false;
shockTime = game.getGameTime();
currentTint = -200;
}
function updateTint() {
}
function initMovieClip(movieName) {
var _local3 = game.nextUnitIndex();
game.screen.attachMovie(movieName, movieName + _local3, game.getManBaseDepth() + _local3, {_x:x, _y:y});
clip = game.screen[movieName + _local3];
clip.name = movieName + _local3;
clip._x = -100;
clip._y = y;
name = movieName + _local3;
baseScale = 1700;
var _local5 = _root.campaignData.isGlow;
if ((_local5 == undefined) || (_local5 == true)) {
var _local6 = new flash.filters.GlowFilter(16777215, 1, 4, 4, 1.5, 1);
clip.filters = [_local6];
}
game.getPartitionManager().add(this);
dieTime = undefined;
if (squad.getTeamName() == "red") {
clip.click._visible = false;
}
}
function walkDamage(ddx, ddy) {
if (inShock) {
return(undefined);
}
if (isNaN(ddx)) {
trace("HERE");
}
if (isAttacking() && (type != 2)) {
return(undefined);
}
if ((game.getGameTime() - damageTime) > damageDirectionTime) {
if ((dx < 0) && (currentDirection == 1)) {
currentDirection = -1;
} else if ((dx > 0) && (currentDirection == -1)) {
currentDirection = 1;
}
if ((dx + ddx) > (MAX_VELOCITY * maxVelocityModifier)) {
dx = MAX_VELOCITY * maxVelocityModifier;
} else if ((dx + ddx) < ((-MAX_VELOCITY) * maxVelocityModifier)) {
dx = (-MAX_VELOCITY) * maxVelocityModifier;
} else {
dx = dx + ddx;
}
if ((dy + ddy) > ((MAX_VELOCITY * maxVelocityModifier) / 2)) {
dy = (MAX_VELOCITY * maxVelocityModifier) / 2;
} else if ((dy + ddy) < (((-MAX_VELOCITY) * maxVelocityModifier) / 2)) {
dy = ((-MAX_VELOCITY) * maxVelocityModifier) / 2;
} else {
dy = dy + ddy;
}
}
}
function walk(ddx, ddy) {
if (inShock) {
return(undefined);
}
if (isAttacking() && (type != 2)) {
return(undefined);
}
if (isNaN(ddx)) {
trace("HERE");
}
damageTime = 0;
if ((game.getGameTime() - damageTime) > damageDirectionTime) {
if (!(isAttacking() && (type == 2))) {
if ((ddx < 0) && (currentDirection == 1)) {
currentDirection = -1;
} else if ((ddx > 0) && (currentDirection == -1)) {
currentDirection = 1;
}
}
if ((dx + ddx) > (MAX_VELOCITY * maxVelocityModifier)) {
dx = MAX_VELOCITY * maxVelocityModifier;
} else if ((dx + ddx) < ((-MAX_VELOCITY) * maxVelocityModifier)) {
dx = (-MAX_VELOCITY) * maxVelocityModifier;
} else {
dx = dx + ddx;
}
if ((dy + ddy) > ((MAX_VELOCITY * maxVelocityModifier) / 2)) {
dy = (MAX_VELOCITY * maxVelocityModifier) / 2;
} else if ((dy + ddy) < (((-MAX_VELOCITY) * maxVelocityModifier) / 2)) {
dy = ((-MAX_VELOCITY) * maxVelocityModifier) / 2;
} else {
dy = dy + ddy;
}
}
}
function update() {
if (clip == undefined) {
trace("MAN DISAPPEARING");
health = 0;
}
if (Math.abs(dx) > ((2 * MAX_VELOCITY) * maxVelocityModifier)) {
dx = (((dx / Math.abs(dx)) * 2) * MAX_VELOCITY) * maxVelocityModifier;
}
var _local5 = false;
var _local9;
var _local6;
var _local4;
var _local3 = game.getPartitionManager().getEnemyTeam(this, x);
var _local8;
var _local12;
updateTint();
clip.swapDepths((game.getManBaseDepth() + (y * game.getScreenWidth())) + x);
if ((inShock == true) && ((game.getGameTime() - shockTime) > squad.getEnemyTeam().getTechnology().getWizardStunTime())) {
inShock = false;
}
if ((health <= 0) && (dieTime == undefined)) {
dieTime = game.getGameTime();
if (isAlive) {
clip.filters = [];
game.getPartitionManager().remove(this);
squad.removeManFromFormation(this, simUnits);
var _local11 = int(Math.random() * 4) + 4;
_root.soundManager.playSound("pain" + _local11, x);
squad.numBodies++;
}
isAlive = false;
}
if (!isAlive) {
die();
return(undefined);
}
_local9 = false;
for (_local4 in _local3) {
_local8 = _local3[_local4].getClip();
if (isMenHitTest(this, _local3[_local4], 0, 0) && (_local3[_local4].getSquad().getTeamName() != getSquad().getTeamName())) {
_local6 = _local3[_local4];
_local9 = true;
continue;
}
}
if (dx != 0) {
var _local7;
for (_local4 in _local3) {
_local8 = _local3[_local4].getClip();
if (isMenHitTest(this, _local3[_local4], dx, 0)) {
_local5 = true;
_local7 = _local3[_local4];
continue;
}
}
if (((((!willHitCastles(dx)) && ((x + dx) > -100)) && ((x + dx) < (game.getRIGHT() + 100))) && (!_local5)) || (_local9)) {
x = x + dx;
} else if (_local5 && (!_local9)) {
var _local10 = (_local7.getDx() * _local7.getMASS()) + (dx * MASS);
if (_local9) {
_local7.setDx((POWER / _local7.getMASS()) * currentDirection);
} else {
_local10 = _local10 / (MASS + _local7.getMASS());
_local7.setDx(_local10);
setDx(_local10);
}
}
}
if (_local9) {
if (x < _local6.getX()) {
_local6.setDx(_local6.getDx() + 0.5);
} else {
_local6.setDx(_local6.getDx() - 0.5);
}
if (y < _local6.getY()) {
_local6.setDy(_local6.getDy() + 0.5);
} else {
_local6.setDy(_local6.getDy() - 0.5);
}
}
_local5 = false;
if (dy != 0) {
for (_local4 in _local3) {
if (isMenHitTest(this, _local3[_local4], 0, dy)) {
_local5 = true;
_local3[_local4].setDy((POWER / _local3[_local4].getMASS()) * currentDirection);
continue;
}
}
if (((((y + dy) < game.getBOTTOM()) && ((y + dy) > game.getTOP())) && (!_local5)) || (_local9)) {
y = y + dy;
}
}
if (y < game.getTOP()) {
y = game.getTOP();
} else if (y > game.getBOTTOM()) {
y = game.getBOTTOM();
}
dx = dx * FRICTION;
dy = dy * (FRICTION / 1.5);
if (Math.abs(dx) < ZERO_VELOCITY_LIMIT) {
dx = 0;
}
if (Math.abs(dy) < ZERO_VELOCITY_LIMIT) {
dy = 0;
}
clip._xscale = getScale();
clip._yscale = getScale();
if (currentDirection == -1) {
clip._xscale = clip._xscale * -1;
}
if (!getIsGarrisoned()) {
if ((clip._x - 10) < ((game.screen.leftCastle._x + game.screen.leftCastle._width) + 60)) {
dx = 0.4;
dy = 0;
x = x + MAX_VELOCITY;
}
if ((clip._x + 10) > ((game.screen.rightCastle._x - game.screen.rightCastle._width) - 60)) {
dx = -0.4;
dy = 0;
x = x - MAX_VELOCITY;
}
}
clip._x = x;
clip._y = y + yOffset;
game.getPartitionManager().update(this);
unaction();
visibleUpdate();
}
function willHitCastles(dx) {
return(false);
}
function visibleUpdate() {
if ((((game.screen._x + clip._x) + clip._width) > 0) && ((game.screen._x + clip._x) < 650)) {
clip._visible = true;
} else {
clip._visible = false;
}
}
function die() {
isAlive = false;
if (squad.numBodies > 3) {
if ((game.getGameTime() - dieTime) >= 5000) {
cleanUp();
}
} else if ((game.getGameTime() - dieTime) >= 50000) {
cleanUp();
}
}
function cleanUp() {
squad.removeMan(this, simUnits);
removeMovieClip(clip);
squad.numBodies--;
}
function damage(amount, direction, type) {
if (isGarrisoned) {
return(undefined);
}
action();
var _local2 = (((amount * amount) / MASS) * direction) * DAMAGE_MOMENTOM_CONSTANT;
if ((type == "arrow") || (type == "arrow_headshot")) {
_local2 = 0;
}
if (type == "giant") {
clearStatus();
inShock = true;
shockTime = game.getGameTime();
setDy(-10 + (Math.random() * 20));
_local2 = _local2 * 30;
} else if (type == "wizard") {
clearStatus();
inShock = true;
shockTime = game.getGameTime();
_local2 = _local2 * 10;
}
setDx(_local2);
if (direction == currentDirection) {
amount = amount * 4;
}
if (type != "arrow") {
game.getBloodManager().addSplatter(x, y - 30, getScale(), getCurrentDirection());
}
damageTime = game.getGameTime();
if (game.getCurrentCharacter() == this) {
health = health - (amount * 0.8);
} else {
health = health - amount;
}
game.getBloodManager().addBlood(x, y, getScale(), getCurrentDirection());
deathType = type;
return(true);
}
function isMenHitTest(a, b, dx, dy) {
if ((!a.getIsAlive()) || (!b.getIsAlive())) {
trace((("Problem: " + b.clip) + " ") + b.clip._x);
}
if (a == b) {
return(false);
}
var _local3;
_local3 = 1;
if (a.getSquad().getTeamName() == b.getSquad().getTeamName()) {
_local3 = 1;
}
if (Math.abs((b.getY() - a.getY()) - dy) > (8 * _local3)) {
return(false);
}
if (Math.abs((b.getX() - a.getX()) - dx) > 40) {
return(false);
}
return(true);
}
function keyInterface() {
}
function faceDirection(direction) {
if (isAttacking()) {
return(undefined);
}
if ((game.getGameTime() - damageTime) <= damageDirectionTime) {
return(undefined);
}
if (isNaN(direction) || (direction == undefined)) {
return(undefined);
}
if (Math.abs(direction) != 1) {
return(undefined);
}
if (getCurrentDirection() != direction) {
currentDirection = direction;
}
}
function getX() {
return(x);
}
function getY() {
return(y);
}
function setX(num) {
x = num;
}
function setY(num) {
y = num;
}
function getSpeed() {
return(Math.sqrt((dx * dx) + (dy * dy)));
}
function getMAXSPEED() {
return(MAX_VELOCITY);
}
function getClip() {
return(clip);
}
function clearStatus() {
}
function getUnitType() {
return(unitType);
}
function getScale() {
return((y * y) / baseScale);
}
function getSquad() {
return(squad);
}
function getCurrentDirection() {
return(currentDirection);
}
function getName() {
return(name);
}
function getMAX_ACCELERATION() {
return(MAX_ACCELERATION);
}
function getIsAlive() {
return(isAlive);
}
function isAttacking() {
return(false);
}
function shouldAttack() {
return(true);
}
function getDx() {
return(dx);
}
function getDy() {
return(dy);
}
function setDx(dx) {
damageTime = game.getGameTime();
this.dx = dx;
}
function setDy(dy) {
this.dy = dy;
}
function getMASS() {
return(MASS);
}
function heal() {
clearStatus();
}
function action() {
lastActionTime = game.getGameTime();
squad.action();
isInAction = true;
}
function unaction() {
if ((game.getGameTime() - lastActionTime) > ACTION_TIMEOUT) {
isInAction = false;
}
}
function getIsInAction() {
return(isInAction);
}
function getIsGarrisoned() {
return(isGarrisoned);
}
function setIsGarrisoned(v) {
isGarrisoned = v;
}
function getIsQueued() {
return(isQueued);
}
function setIsQueued(v) {
isQueued = v;
}
function controlMultiply() {
if (game.getCurrentCharacter() == this) {
return(controlMultiplier);
}
return(1);
}
function compound(base, rate, level) {
return(Math.pow(1 + rate, level) * base);
}
function getHealth() {
return(health);
}
function enableGlow() {
var _local2 = new flash.filters.GlowFilter(16777215, 1, 4, 4, 1.5, 1);
clip.filters = [_local2];
}
function disableGlow() {
clip.filters = [];
}
var controlMultiplier = 3;
var type = 0;
var DAMAGE_MOMENTOM_CONSTANT = 1;
var POWER = 100;
var FRICTION = 0.9;
var ZERO_VELOCITY_LIMIT = 0.08;
var MAX_VELOCITY = 4;
var MAX_ACCELERATION = 0.2;
var MASS = 500;
var MAX_HEALTH = 100;
var ACTION_TIMEOUT = 5000;
var SHOCK_AMOUNT = 3300;
}
Symbol 2505 MovieClip [__Packages.AiSquad] Frame 0
class AiSquad
{
var friends, oponents, game, statue, baseX, baseY, teamName, technology, statueHitArea, newUnGarrisonMode, numBodies, isUnGarrison, unGarrisonTime, teamDirection, goldAddedNum, castle, castleHealth, defenceForwardPosition, men, queue, swordManGroup, spartanGroup, archerGroup, minerGroup, giantGroup, wizardGroup, groups, lastSpawnTime, aiMode, garrisonQueue, numGarrisoned, lastGarrisonTime, castleArcherGroup, lastGoldTime, actionTime, miners, enemyTeam;
function AiSquad (castle, statue, statueHitArea, friends, oponents, baseX, baseY, name, game, technology) {
this.friends = friends;
this.oponents = oponents;
this.game = game;
this.statue = statue;
this.baseX = baseX;
this.baseY = baseY;
teamName = name;
this.technology = technology;
this.statueHitArea = statueHitArea;
newUnGarrisonMode = 1;
numBodies = 0;
isUnGarrison = false;
unGarrisonTime = 0;
if (teamName == "blue") {
teamDirection = 1;
} else {
teamDirection = -1;
}
goldAddedNum = 0;
this.castle = castle;
castleHealth = technology.getCastleHealth();
if (teamName == "red") {
var _local5;
_local5 = new Color(castle);
_local5.setTint(100, 0, 0, 60);
}
defenceForwardPosition = baseX + (teamDirection * 100);
men = friends;
queue = new QueueManager(this);
swordManGroup = new SwordManGroup(game, this, ATTACK);
spartanGroup = new SpartanGroup(game, this, ATTACK);
archerGroup = new ArcherGroup(game, this, ATTACK);
minerGroup = new MinerGroup(game, this, ATTACK);
giantGroup = new GiantGroup(game, this, ATTACK);
wizardGroup = new WizardGroup(game, this, ATTACK);
groups = new Array();
groups = [minerGroup, archerGroup, swordManGroup, spartanGroup, wizardGroup, giantGroup];
lastSpawnTime = 0;
aiMode = DEFEND;
setMode(2);
garrisonQueue = new Array();
numGarrisoned = 0;
lastGarrisonTime = game.getGameTime();
castleArcherGroup = new CastleArcherGroup(game, this);
lastGoldTime = game.getGameTime();
var _local4 = 1 + (technology.getCastleHealthLevel() / 4);
statue._xscale = statue._xscale * ((_local4 * 80) / 100);
statue._yscale = _local4 * 80;
actionTime = 0;
if (getCastle()._currentframe != 1) {
var _local2 = 0;
while (_local2 < 5) {
game.getBloodManager().addDust((getCastle()._x - 30) + (Math.random() * 40), (getCastle()._y - 30) + (Math.random() * 40), 100, getTeamDirection());
_local2++;
}
}
}
function update() {
if (getTower() == undefined) {
trace("CASTLE DISAPPEARING");
}
if ((getCastleHealth() <= 0) && (!((_root.campaignData.getLevel() == 12) && (getTeamName() == "red")))) {
game.getBloodManager().addDust((getCastle()._x - 20) + (Math.random() * 40), (getCastle()._y - 10) + (Math.random() * 20), 100 + (Math.random() * 100), getTeamDirection());
}
var _local3 = game.getMineHolder().getClosestMine(getMenFromGroup(1)[0].instance).clip._x;
if (_local3 == undefined) {
_local3 = castle._x + (teamDirection * 200);
}
queue.update();
archerGroup.update(_local3);
minerGroup.update(_local3);
giantGroup.update(_local3);
wizardGroup.update(_local3);
swordManGroup.update(_local3);
spartanGroup.update(_local3);
castleArcherGroup.update();
garrisonUnits();
if ((game.getGameTime() - lastGoldTime) > GOLD_ADD_FREQUENCY) {
lastGoldTime = game.getGameTime();
giveGold(2 + (getTechnology().getCastleIncome() * 2));
}
}
function closeScore(a, b) {
return(Math.pow(a.getX() - b.getX(), 2) + Math.pow(a.getY() - b.getY(), 4));
}
function addToGarrisonQueue(man) {
garrisonQueue.push(man);
man.setIsQueued(true);
}
function garrisonUnits() {
var _local3;
var _local2;
if ((garrisonQueue.length > 0) && ((game.getGameTime() - lastGarrisonTime) > GARRISON_SPEED)) {
_local2 = garrisonQueue.pop();
_local2.setIsGarrisoned(true);
numGarrisoned++;
_local2.setIsQueued(false);
lastGarrisonTime = game.getGameTime();
}
}
function addMiner() {
var _local2 = new Miner(baseX, game.getTOP() + ((game.getTOP() - game.getBOTTOM()) * Math.random()), this, minerGroup.getMen(), game);
var _local3 = {instance:_local2};
_local3 = {instance:_local2, state:0, lastStateChange:game.getGameTime()};
miners.push(_local3);
minerGroup.addMan(_local3);
addMan(_local2);
minerGroup.addToFormation(_local3);
}
function addArcher() {
var _local3 = new Archer(baseX, game.getTOP() + ((game.getTOP() - game.getBOTTOM()) * Math.random()), this, archerGroup.getMen(), game);
var _local2 = {instance:_local3, state:0, lastStateChange:game.getGameTime(), target:undefined, targetAquireTime:0, targetRange:Infinity, row:undefined, col:undefined, formation:Array};
archerGroup.addMan(_local2);
addMan(_local3);
archerGroup.addToFormation(_local2);
}
function addSwordMan() {
var _local2 = new SwordMan(baseX, game.getTOP() + ((game.getTOP() - game.getBOTTOM()) * Math.random()), this, swordManGroup.getMen(), game);
var _local3 = {instance:_local2, state:0, lastStateChange:game.getGameTime(), target:undefined, targetAquireTime:0, targetRange:Infinity, row:undefined, col:undefined, formation:Array};
swordManGroup.addMan(_local3);
addMan(_local2);
swordManGroup.addToFormation(_local3);
return(_local2);
}
function addSpartan() {
var _local3 = new Spartan(baseX, game.getTOP() + ((game.getTOP() - game.getBOTTOM()) * Math.random()), this, spartanGroup.getMen(), game);
var _local2 = {instance:_local3, state:0, lastStateChange:game.getGameTime(), target:undefined, targetAquireTime:0, targetRange:Infinity, row:undefined, col:undefined, formation:Array};
spartanGroup.addMan(_local2);
addMan(_local3);
spartanGroup.addToFormation(_local2);
}
function addGiant() {
var _local2 = new Giant(baseX, game.getTOP() + ((game.getTOP() - game.getBOTTOM()) * Math.random()), this, giantGroup.getMen(), game);
var _local3 = {instance:_local2, state:0, lastStateChange:game.getGameTime(), target:undefined, targetAquireTime:0, targetRange:Infinity, row:undefined, col:undefined, formation:Array};
giantGroup.addMan(_local3);
addMan(_local2);
giantGroup.addToFormation(_local3);
return(_local2);
}
function addWizard() {
var _local2 = new Wizard(baseX, game.getTOP() + ((game.getTOP() - game.getBOTTOM()) * Math.random()), this, wizardGroup.getMen(), game);
var _local3 = {instance:_local2, state:0, lastStateChange:game.getGameTime(), target:undefined, targetAquireTime:0, targetRange:Infinity, row:undefined, col:undefined, formation:Array};
wizardGroup.addMan(_local3);
addMan(_local2);
wizardGroup.addToFormation(_local3);
return(_local2);
}
function addToFormation(man, formation) {
var _local1 = formation.length - 1;
if (formation[_local1].length >= 5) {
var _local4 = new Array();
formation.push(_local4);
_local1++;
}
formation[_local1].push(man);
man.row = _local1;
man.col = formation[_local1].length - 1;
man.formation = formation;
}
function filterDown(formation, line, deletedIndex) {
if (line < (formation.length - 1)) {
if (deletedIndex > (formation[line + 1].length - 1)) {
deletedIndex = formation[line + 1].length - 1;
}
var _local8 = formation[line + 1].shift();
var _local5 = Array();
var _local7 = false;
for (var _local9 in formation[line]) {
if (_local9 == deletedIndex) {
_local5.push(_local8);
_local7 = true;
}
_local5.push(formation[line][_local9]);
}
if (_local7 == false) {
_local5.push(_local8);
}
formation[line] = _local5;
filterDown(formation, line + 1, deletedIndex);
}
line = 0;
while (line < formation.length) {
var _local3 = 0;
while (_local3 < formation[line].length) {
formation[line][_local3].row = line;
formation[line][_local3].col = _local3;
_local3++;
}
line++;
}
}
function removeFromFormation(man) {
var _local4;
var _local2 = man.formation;
_local2[man.row].splice(man.col, 1);
filterDown(_local2, man.row, man.col);
if (_local2[_local2.length - 1].length == 0) {
_local2.pop();
}
}
function removeManFromFormation(man, simUnits) {
var _local2;
for (_local2 in simUnits) {
if (simUnits[_local2].instance == man) {
removeFromFormation(simUnits[_local2]);
}
}
}
function addMan(man) {
var _local3;
_local3 = new Color(man.getClip());
men.push(man);
if (teamName == "blue") {
man.walk(4, 0);
} else {
man.walk(-4, 0);
_local3.setTint(100, 0, 0, 60);
}
lastSpawnTime = game.getGameTime();
}
function removeMan(man, simUnits) {
var _local2;
for (_local2 in men) {
if (men[_local2] == man) {
men.splice(_local2, 1);
}
}
for (_local2 in simUnits) {
if (simUnits[_local2].instance == man) {
simUnits.splice(_local2, 1);
}
}
}
function getNumGarrisoned() {
return(numGarrisoned);
}
function setMode(newMode) {
aiMode = newMode;
swordManGroup.setStance(newMode);
spartanGroup.setStance(newMode);
archerGroup.setStance(newMode);
wizardGroup.setStance(newMode);
minerGroup.setStance(newMode);
if (newMode != GARRISON) {
numGarrisoned = 0;
for (var _local3 in men) {
men[_local3].setIsGarrisoned(false);
men[_local3].setIsQueued(false);
}
}
}
function setGroupMode(newMode, group) {
if (group == 0) {
setMode(newMode);
}
groups[group - 1].setStance(newMode);
if (newMode != GARRISON) {
var _local2 = groups[group - 1].getMen();
for (var _local3 in _local2) {
_local2[_local3].instance.setIsGarrisoned(false);
_local2[_local3].instance.setIsQueued(false);
}
}
}
function getGroupMode(group) {
if (group == 0) {
var _local2 = 0;
while (_local2 < (groups.length - 1)) {
if (groups[_local2].getStance() != groups[_local2 + 1].getStance()) {
return(4);
}
_local2++;
}
return(groups[0]);
}
return(groups[group - 1].getStance());
}
function getMode() {
return(aiMode);
}
function getMen() {
return(men);
}
function getBaseX() {
return(baseX);
}
function getBaseY() {
return(baseY);
}
function minerGiveGold(g) {
if (teamName == "red") {
giveGold(g);
}
if (g == 0) {
return(undefined);
}
goldAddedNum = (goldAddedNum + 1) % 5;
var _local2 = "goldAdded" + goldAddedNum;
game.screen.attachMovie("goldAdded", _local2, 10000000000006 + goldAddedNum);
game.screen[_local2]._x = baseX + 50;
game.screen[_local2]._y = 300;
game.screen[_local2].gold.gold.text = "+ " + int(g);
giveGold(g);
}
function giveGold(g) {
technology.gold = technology.gold + g;
}
function getTeamsGold() {
return(technology.gold);
}
function getTeamName() {
return(teamName);
}
function getTeamDirection() {
return(teamDirection);
}
function getTeamSize() {
return(men.length);
}
function getTechnology() {
return(technology);
}
function getEnemyTeam() {
return(enemyTeam);
}
function setEnemySquad(squad) {
enemyTeam = squad;
}
function damageCastle(num) {
castleHealth = castleHealth - num;
if (castleHealth < 0) {
castleHealth = 0;
if (!((_root.campaignData.getLevel() == 12) && (teamName == "red"))) {
game.finishLevel();
_root.soundManager.playSoundCentre("buildingDestroySound");
}
}
game.getBloodManager().addDust((getCastle()._x - 20) + (Math.random() * 40), (getCastle()._y - 10) + (Math.random() * 20), 100, getTeamDirection());
if (isNaN((100 * castleHealth) / technology.getCastleHealth())) {
trace("ERROR with castle health");
}
getCastle().health.bar._xscale = (100 * castleHealth) / technology.getCastleHealth();
}
function getCastleHealth() {
return(castleHealth);
}
function getCastle() {
return(statue);
}
function getCastleHitArea() {
return(statueHitArea);
}
function getOponents() {
return(oponents);
}
function getMenFromGroup(group) {
return(groups[group - 1].getMen());
}
function getSpartanFormation() {
return(spartanGroup.getFormation());
}
function getSwordmenFormation() {
return(swordManGroup.getFormation());
}
function getManFromGroup(group) {
return(groups[group - 1].getFormation()[0][0].instance);
}
function addMinerInQueue() {
if ((technology.gold >= MINER_COST) and canAddMan()) {
technology.gold = technology.gold - MINER_COST;
queue.push("addMiner", MINER_TIME);
unitCreateSound();
} else if (technology.gold < MINER_COST) {
if (teamName == "blue") {
_root.HUD.goldBox.gold.play();
}
unitNotCreateSound();
}
}
function removeMinerInQueue() {
if (queue.pop("addMiner")) {
technology.gold = technology.gold + MINER_COST;
unitStopCreateSound();
}
}
function addArcherInQueue() {
if ((technology.gold >= ARCHER_COST) and canAddMan()) {
technology.gold = technology.gold - ARCHER_COST;
queue.push("addArcher", ARCHER_TIME);
unitCreateSound();
} else if (technology.gold < ARCHER_COST) {
if (teamName == "blue") {
_root.HUD.goldBox.gold.play();
}
unitNotCreateSound();
}
}
function removeArcherInQueue() {
if (queue.pop("addArcher")) {
technology.gold = technology.gold + ARCHER_COST;
unitStopCreateSound();
}
}
function addSpartanInQueue() {
if ((technology.gold >= SPARTAN_COST) and canAddMan()) {
technology.gold = technology.gold - SPARTAN_COST;
queue.push("addSpartan", SPARTAN_TIME);
unitCreateSound();
} else if (technology.gold < SPARTAN_COST) {
if (teamName == "blue") {
_root.HUD.goldBox.gold.play();
}
unitNotCreateSound();
}
}
function removeSpartanInQueue() {
if (queue.pop("addSpartan")) {
technology.gold = technology.gold + SPARTAN_COST;
unitStopCreateSound();
}
}
function addSwordManInQueue() {
if ((technology.gold >= SWORD_MAN_COST) and canAddMan()) {
technology.gold = technology.gold - SWORD_MAN_COST;
queue.push("addSwordMan", SWORD_MAN_TIME);
unitCreateSound();
} else if (technology.gold < SWORD_MAN_COST) {
if (teamName == "blue") {
_root.HUD.goldBox.gold.play();
}
unitNotCreateSound();
}
}
function removeSwordManInQueue() {
if (queue.pop("addSwordMan")) {
technology.gold = technology.gold + SWORD_MAN_COST;
unitStopCreateSound();
}
}
function addGiantInQueue() {
if ((technology.gold >= GIANT_COST) and canAddMan()) {
technology.gold = technology.gold - GIANT_COST;
queue.push("addGiant", GIANT_TIME);
unitCreateSound();
} else if (technology.gold < GIANT_COST) {
if (teamName == "blue") {
_root.HUD.goldBox.gold.play();
}
unitNotCreateSound();
}
}
function removeGiantInQueue() {
if (queue.pop("addGiant")) {
technology.gold = technology.gold + GIANT_COST;
unitStopCreateSound();
}
}
function addWizardInQueue() {
if ((technology.gold >= WIZARD_COST) and canAddMan()) {
technology.gold = technology.gold - WIZARD_COST;
queue.push("addWizard", WIZARD_TIME);
unitCreateSound();
} else if (technology.gold < WIZARD_COST) {
if (teamName == "blue") {
_root.HUD.goldBox.gold.play();
}
unitNotCreateSound();
}
}
function removeWizardInQueue() {
if (queue.pop("addWizard")) {
technology.gold = technology.gold + WIZARD_COST;
unitStopCreateSound();
}
}
function unitCreateSound() {
if (teamName == "blue") {
_root.soundManager.playSoundCentre("unitCreateButtonSound");
}
}
function unitNotCreateSound() {
if (teamName == "blue") {
_root.soundManager.playSoundCentre("arrowHitMetal");
}
}
function unitStopCreateSound() {
if (teamName == "blue") {
_root.soundManager.playSoundCentre("arrowHitDirt");
}
}
function canAddMan() {
if ((getNumberLiving() + queue.size()) < 20) {
return(true);
}
if (teamName == "blue") {
_root.HUD.goldBox.populationFlicker.play();
}
return(false);
}
function getQueueSize() {
return(queue.size());
}
function getForwardMan(exclude) {
var _local5;
var _local4 = Number.NEGATIVE_INFINITY * getTeamDirection();
var _local3;
_local3 = 1;
while (_local3 < 6) {
var _local2 = groups[_local3].getFormation()[0][0].instance;
if ((_local2 != undefined) && (_local3 != exclude)) {
if ((_local2.getX() * getTeamDirection()) > (_local4 * getTeamDirection())) {
_local4 = _local2.getX();
_local5 = _local2;
}
}
_local3++;
}
return(_local5);
}
function getNumberGarrisoned() {
var _local2 = 0;
for (var _local3 in men) {
if (men[_local3].getIsGarrisoned() && ((men[_local3].getX() * teamDirection) < ((baseX + (10 * teamDirection)) * teamDirection))) {
_local2++;
}
}
return(_local2);
}
function getTower() {
return(castle);
}
function getNumberLiving() {
var _local2 = 0;
for (var _local3 in men) {
if (men[_local3].getIsAlive()) {
_local2 = _local2 + 1;
}
}
return(_local2);
}
function action() {
actionTime = game.getGameTime();
}
function isAction() {
return((game.getGameTime() - actionTime) < 5000);
}
function getCastleArcherGroup() {
return(castleArcherGroup.getMen());
}
function enableGlow() {
for (var _local3 in men) {
if (men[_local3].getIsAlive()) {
men[_local3].enableGlow();
}
}
var _local2 = castleArcherGroup.getMen();
for (var _local3 in _local2) {
if (_local2[_local3].getIsAlive()) {
_local2[_local3].enableGlow();
}
}
}
function disableGlow() {
for (var _local3 in men) {
if (men[_local3].getIsAlive()) {
men[_local3].disableGlow();
}
}
var _local2 = castleArcherGroup.getMen();
for (var _local3 in _local2) {
if (_local2[_local3].getIsAlive()) {
_local2[_local3].disableGlow();
}
}
}
var MIN_SPAWN_FREQ = 500;
var FORMATION_Y_OFFSET = 50;
var ARCHER_COST = 400;
var MINER_COST = 250;
var SWORD_MAN_COST = 150;
var SPARTAN_COST = 400;
var GIANT_COST = 1400;
var WIZARD_COST = 1200;
var ARCHER_TIME = 8000;
var MINER_TIME = 4000;
var SWORD_MAN_TIME = 3000;
var SPARTAN_TIME = 10000;
var GIANT_TIME = 20000;
var WIZARD_TIME = 20000;
var GARRISON = 1;
var DEFEND = 2;
var ATTACK = 3;
var GARRISON_SPEED = 200;
var GOLD_ADD_FREQUENCY = 1000;
var GOLD_ADD_AMOUNT = 1;
}
Symbol 2506 MovieClip [__Packages.Group] Frame 0
class Group
{
var squad, game, stance, men, formation;
function Group (game, squad, stance) {
this.squad = squad;
this.game = game;
this.stance = stance;
men = [];
formation = new Array();
}
function update(forwardPos) {
if (stance == GARRISON) {
garrison();
} else if (stance == DEFEND) {
attack(forwardPos + (100 * squad.getTeamDirection()));
} else if (stance == ATTACK) {
if (squad.getTeamDirection() == 1) {
attack(game.getScreenWidth());
} else {
attack(0);
}
}
}
function garrison() {
for (var _local9 in men) {
if (game.getCurrentCharacter() == men[_local9].instance) {
men[_local9].instance.update();
continue;
}
var _local2 = men[_local9].instance;
var _local7;
var _local8;
var _local3;
var _local4 = 0;
var _local6 = 0;
var _local5 = 0;
if ((!_local2.getIsQueued()) && (!_local2.getIsGarrisoned())) {
_local7 = squad.getBaseX() + (50 * squad.getTeamDirection());
_local3 = int(_local7 - _local2.getX());
if (Math.abs(_local3) < 50) {
squad.addToGarrisonQueue(_local2);
}
} else if (_local2.getIsGarrisoned()) {
_local7 = squad.getBaseX() - (60 * squad.getTeamDirection());
_local8 = (game.getTOP() + game.getBOTTOM()) / 2;
_local3 = int(_local7 - _local2.getX());
_local4 = int(_local8 - _local2.getY());
}
_local5 = 0;
_local6 = _local5;
if (_local3 != 0) {
_local6 = (_local3 / Math.abs(_local3)) * _local2.getMAX_ACCELERATION();
}
if (_local4 != 0) {
_local5 = (_local4 / Math.abs(_local4)) * _local2.getMAX_ACCELERATION();
}
_local2.clearStatus();
_local2.faceDirection((squad.getBaseX() - _local2.getX()) / Math.abs(squad.getBaseX() - _local2.getX()));
if (Math.abs((squad.getBaseX() - (60 * squad.getTeamDirection())) - _local2.getX()) < 10) {
_local2.heal();
_local2.clearStatus();
_local2.setDx(0);
_local2.setDy(0);
} else if (Math.abs(_local3) > 10) {
_local2.walk(_local6, _local5);
}
_local2.update();
}
}
function attack(forwardPos) {
}
function closeScore(a, b) {
return(Math.pow(a.getX() - b.getX(), 2) + Math.pow(a.getY() - b.getY(), 2));
}
function addMan(man) {
men.push(man);
}
function addToFormation(man) {
var _local2 = formation.length - 1;
if (formation[_local2].length >= 5) {
var _local4 = new Array();
formation.push(_local4);
_local2++;
}
formation[_local2].push(man);
man.row = _local2;
man.col = formation[_local2].length - 1;
man.formation = formation;
}
function filterDown(line, deletedIndex) {
if (line < (formation.length - 1)) {
if (deletedIndex > (formation[line + 1].length - 1)) {
deletedIndex = formation[line + 1].length - 1;
}
var _local6 = formation[line + 1].splice(deletedIndex, 1)[0];
var _local4 = [];
for (var _local7 in formation[line]) {
if (_local7 == deletedIndex) {
_local4.push(_local6);
}
_local4.push(formation[line]);
}
formation[line] = _local4;
filterDown(line + 1, deletedIndex);
}
line = 0;
while (line < formation.length) {
var _local3 = 0;
while (_local3 < formation[line].length) {
formation[line][_local3].row = line;
formation[line][_local3].col = _local3;
_local3++;
}
line++;
}
}
function removeFromFormation(man) {
var _local4;
var _local2 = man.formation;
_local2[man.row].splice(man.col, 1);
filterDown(man.row, man.col);
if (_local2[_local2.length - 1].length == 0) {
_local2.pop();
}
}
function removeManFromFormation(man, simUnits) {
var _local2;
for (_local2 in simUnits) {
if (simUnits[_local2].instance == man) {
removeFromFormation(simUnits[_local2]);
}
}
}
function setStance(stance) {
this.stance = stance;
}
function getStance() {
return(stance);
}
function getMen() {
return(men);
}
function getFormation() {
return(formation);
}
function getYOffset(position, partners) {
var _local2 = (game.getBOTTOM() - game.getTOP()) / (partners + 1);
return(game.getTOP() + ((position + 1) * _local2));
}
function getIfIsForward(num, man) {
if ((num * squad.getTeamDirection()) > (man.getX() * squad.getTeamDirection())) {
return(num);
}
return(man.getX());
}
var UPDATE_PERIOD = 1000;
var GARRISON = 1;
var DEFEND = 2;
var ATTACK = 3;
var FORMATION_Y_OFFSET = 50;
}
Symbol 2507 MovieClip [__Packages.SwordManGroup] Frame 0
class SwordManGroup extends Group
{
var squad, game, stance, men, formation, globalActionTime, UPDATE_PERIOD, closeScore, ATTACK, getYOffset, getIfIsForward, FORMATION_Y_OFFSET, DEFEND;
function SwordManGroup (game, squad, stance) {
super();
this.squad = squad;
this.game = game;
this.stance = stance;
men = [];
formation = new Array();
globalActionTime = game.getGameTime();
}
function attack(forwardPos) {
var _local2;
var _local15;
var _local6;
var _local3;
var _local9;
var _local4;
for (_local2 in men) {
_local9 = men[_local2].instance;
_local9.update();
if (men[_local2].instance != game.getCurrentCharacter()) {
if ((men[_local2].instance.dx != 0) || (men[_local2].instance.dy != 0)) {
men[_local2].instance.clearStatus();
}
var _local8 = men[_local2].target;
if (((!men[_local2].target) || (!men[_local2].target.getIsAlive())) || ((game.getGameTime() - men[_local2].targetAquireTime) > UPDATE_PERIOD)) {
if (men[_local2].row <= 4) {
if (((((game.getGameTime() - men[_local2].targetAquireTime) > UPDATE_PERIOD) || (!men[_local2].target.getIsAlive())) || (men[_local2].target == undefined)) || (!((Math.abs(men[_local2].target.x - men[_local2].instance.x) < men[_local2].instance.getSWORD_MAN_RANGE()) && (Math.abs(men[_local2].target.y - men[_local2].instance.y) < 14)))) {
men[_local2].targetRange = Infinity;
men[_local2].target = undefined;
men[_local2].state = 0;
for (_local4 in squad.getOponents()) {
if (squad.getOponents()[_local4].getIsGarrisoned()) {
continue;
}
if (squad.getOponents()[_local4].getIsAlive() && (closeScore(squad.getOponents()[_local4], men[_local2].instance) < men[_local2].targetRange)) {
men[_local2].target = squad.getOponents()[_local4];
men[_local2].targetRange = closeScore(squad.getOponents()[_local4], men[_local2].instance);
men[_local2].state = 1;
}
}
}
}
men[_local2].targetAquireTime = game.getGameTime();
}
if (squad.getTeamName() != "blue") {
if (((_local8 == men[_local2].instance.getSquad().getEnemyTeam().getCastleHitArea()) && (stance == ATTACK)) && (Math.abs(men[_local2].target.getX() - men[_local2].instance.getX()) > Math.abs(_local8._x - men[_local2].instance.getX()))) {
men[_local2].target = _local8;
}
}
if (((men[_local2].target == undefined) || (men[_local2].target == men[_local2].instance.getSquad().getEnemyTeam().getCastleHitArea())) && (stance == ATTACK)) {
men[_local2].state = 7;
men[_local2].targetRange = 5001;
men[_local2].target = men[_local2].instance.getSquad().getEnemyTeam().getCastleHitArea();
}
if ((men[_local2].target != undefined) && (men[_local2].state != 7)) {
men[_local2].instance.faceDirection((men[_local2].target.x - men[_local2].instance.x) / Math.abs(men[_local2].target.x - men[_local2].instance.x));
}
if ((men[_local2].state == 7) && (Math.abs((men[_local2].target.x - (squad.getTeamDirection() * 40)) - men[_local2].instance.getX()) > 10)) {
var _local14 = men[_local2].target.x - (squad.getTeamDirection() * 40);
var _local13 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local3 = int(_local14 - men[_local2].instance.x);
_local6 = int(_local13 - men[_local2].instance.y);
if (_local3 == 0) {
_local3 = 1;
}
if ((formation[0][0] == men[_local2]) && (((_local3 + men[_local2].instance.getX()) * squad.getTeamDirection()) > (forwardPos * squad.getTeamDirection()))) {
_local3 = forwardPos - men[_local2].instance.getX();
}
var _local11 = (_local6 / Math.abs(_local6)) * men[_local2].instance.getMAX_ACCELERATION();
if (_local6 == 0) {
_local11 = 0;
}
if (((_local3 * _local3) + (_local6 * _local6)) >= 5) {
men[_local2].instance.walk((_local3 / Math.abs(_local3)) * men[_local2].instance.getMAX_ACCELERATION(), _local11);
}
} else if (((Math.abs(men[_local2].target.x - men[_local2].instance.x) < men[_local2].instance.getSWORD_MAN_RANGE()) && (Math.abs(men[_local2].target.y - men[_local2].instance.y) < 14)) || ((men[_local2].target.type == -1) && (Math.abs((men[_local2].target.x - men[_local2].instance.x) - ((men[_local2].instance.getSquad().getTeamDirection() * men[_local2].target._width) / 2)) < men[_local2].instance.getSWORD_MAN_RANGE()))) {
men[_local2].state = 2;
if ((!men[_local2].target.getIsAlive()) && ((!men[_local2].instance.getSquad().getEnemyTeam().getCastleHitArea()) == men[_local2].target)) {
trace("SWORDMAN ATTACKS DEAD PEOPLE");
}
var _local12 = (men[_local2].target.x - men[_local2].instance.x) / Math.abs(men[_local2].target.x - men[_local2].instance.x);
men[_local2].instance.faceDirection(_local12);
if ((men[_local2].instance.getCurrentDirection() == _local12) && (men[_local2].instance.swordSwing(men[_local2].target))) {
men[_local2].state = 0;
men[_local2].target = undefined;
men[_local2].instance.clearStatus();
}
} else {
var _local5;
if (formation[0][0] == men[_local2]) {
if (squad.getSpartanFormation().length > 0) {
if (stance == ATTACK) {
_local5 = getIfIsForward(squad.getSpartanFormation()[squad.getSpartanFormation().length - 1][0].instance.getX() - (FORMATION_Y_OFFSET * squad.getTeamDirection()), men[_local2].instance);
} else {
_local5 = squad.getSpartanFormation()[squad.getSpartanFormation().length - 1][0].instance.getX() - (FORMATION_Y_OFFSET * squad.getTeamDirection());
}
} else {
_local5 = forwardPos;
}
if ((_local5 == undefined) || (isNaN(_local5))) {
_local5 = forwardPos;
}
} else {
_local5 = formation[0][0].instance.getX();
}
if (((formation[0][0] != men[_local2]) || (squad.getSpartanFormation().length != 0)) && (Math.abs(men[_local2].target.x - men[_local2].instance.x) > (160 / (((men[_local2].row + 1) * (men[_local2].row + 1)) * (men[_local2].row + 1))))) {
var _local14 = _local5 + (((men[_local2].row * FORMATION_Y_OFFSET) * -1) * squad.getTeamDirection());
var _local13 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local3 = int(_local14 - men[_local2].instance.x);
_local6 = int(_local13 - men[_local2].instance.y);
} else if (men[_local2].target != undefined) {
_local3 = int(men[_local2].target.x - men[_local2].instance.x);
_local6 = int(men[_local2].target.y - men[_local2].instance.y);
if (Math.abs(_local3) < 10) {
_local3 = 1;
}
} else {
var _local14 = _local5 + (((men[_local2].row * FORMATION_Y_OFFSET) * -1) * squad.getTeamDirection());
var _local13 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local3 = int(_local14 - men[_local2].instance.x);
_local6 = int(_local13 - men[_local2].instance.y);
}
if ((stance == DEFEND) && (Math.abs(men[_local2].target.x - men[_local2].instance.x) < 120)) {
} else if ((stance == DEFEND) && (((_local3 + men[_local2].instance.getX()) * squad.getTeamDirection()) > (forwardPos * squad.getTeamDirection()))) {
_local3 = forwardPos - men[_local2].instance.getX();
men[_local2].clearStatus();
}
if (((((_local3 * _local3) + (_local6 * _local6)) < 40) && (stance == DEFEND)) && (_local9.getIsInAction() || ((game.getGameTime() - globalActionTime) < 2000))) {
men[_local2].instance.block();
if (_local9.getIsInAction()) {
globalActionTime = game.getGameTime();
}
}
if (_local3 == 0) {
_local3 = 1;
}
if ((formation[0][0] == men[_local2]) && (((_local3 + men[_local2].instance.getX()) * squad.getTeamDirection()) > (forwardPos * squad.getTeamDirection()))) {
}
var _local11 = (_local6 / Math.abs(_local6)) * men[_local2].instance.getMAX_ACCELERATION();
if (_local6 == 0) {
_local11 = 0;
}
var _local10 = men[_local2].target.getX() - men[_local2].instance.getX();
if ((men[_local2].target != undefined) && ((_local10 / Math.abs(_local10)) != squad.getTeamDirection())) {
} else if ((stance == ATTACK) && ((_local3 / Math.abs(_local3)) != squad.getTeamDirection())) {
_local3 = 1;
men[_local2].instance.block();
}
if (((_local3 * _local3) + (_local6 * _local6)) >= 40) {
men[_local2].instance.walk((_local3 / Math.abs(_local3)) * men[_local2].instance.getMAX_ACCELERATION(), _local11);
}
}
}
}
}
}
Symbol 2508 MovieClip [__Packages.SwordMan] Frame 0
class SwordMan extends Man
{
var x, y, dy, dx, squad, game, simUnits, lastSwordSwing, isSwinging, hasDamaged, unitType, initMovieClip, isBlocking, yOffset, compound, isDieing, health, isMinion, clip, inShock, isAlive, deathType, damageTime, swingType, currentDirection, getSquad, controlMultiply, walk, DAMAGE_MOMENTOM_CONSTANT, MASS, shockTime, setDy, setDx, baseScale;
function SwordMan (x, y, squad, simUnits, game) {
super();
this.x = x;
this.y = y;
dy = (dx = 0);
this.squad = squad;
this.game = game;
this.simUnits = simUnits;
lastSwordSwing = 0;
isSwinging = false;
hasDamaged = false;
unitType = "swordMan";
initMovieClip("swordMan");
isBlocking = false;
yOffset = 0;
MAX_VELOCITY = compound(3, 0.2, squad.getTechnology().getSwordmanSpeed() - 1);
MAX_ACCELERATION = MAX_VELOCITY * 0.1;
MAX_HEALTH = squad.getTechnology().getSwordmanHealth();
isDieing = false;
health = MAX_HEALTH;
isMinion = false;
}
function update() {
super.update();
if (isMinion) {
clip.weapon = 5;
MAX_VELOCITY = 3;
} else {
clip.weapon = squad.getTechnology().getSwordmanSword();
}
if (inShock) {
isSwinging = false;
}
if (isSwinging) {
dx = (dy = 0);
}
if ((isSwinging && (clip.swing != undefined)) && (clip.swing._currentframe == clip.swing._totalframes)) {
isSwinging = false;
}
if (!isAlive) {
if (isDieing == false) {
if (((deathType == "sword") || (deathType == "spear")) && (Math.random() < 0.3)) {
clip.gotoAndStop("death2");
} else if (deathType == "arrow_headshot") {
clip.gotoAndStop("death3");
} else {
clip.gotoAndStop("death");
}
}
isDieing = true;
} else if (inShock) {
clip.gotoAndStop("shocked");
} else if ((clip.block._currentframe < 14) && (!isBlocking)) {
clip.block.play();
} else if (isBlocking) {
clip.gotoAndStop("block");
if (clip.block._currentframe == 7) {
clip.block.stop();
}
} else if (isSwinging) {
damageTime = game.getGameTime();
clip.gotoAndStop(swingType);
var _local4;
var _local5;
if (isHitPeriod()) {
_local4 = game.getPartitionManager().getEnemyTeam(this, x + ((SWORD_MAN_RANGE / 2) * currentDirection));
for (_local5 in _local4) {
if (Math.abs(_local4[_local5].getClip()._y - y) < HIT_WIDTH) {
if ((_local4[_local5].getSquad() != getSquad()) && swordHasHit(_local4[_local5])) {
var _local6 = 1 + int(Math.random() * 4);
_root.soundManager.playSound("swordHit" + _local6, x);
if (isMinion) {
_local4[_local5].damage((controlMultiply() * squad.getTechnology().getSwordmanAttack()) / 1.5, currentDirection, "sword");
} else {
_local4[_local5].damage(controlMultiply() * squad.getTechnology().getSwordmanAttack(), currentDirection, "sword");
}
hasDamaged = true;
return(undefined);
}
}
}
if (clip.hitTest(squad.getEnemyTeam().getCastleHitArea())) {
var _local6 = 1 + int(Math.random() * 4);
_root.soundManager.playSound("swordHit" + _local6, x);
squad.getEnemyTeam().damageCastle(controlMultiply() * squad.getTechnology().getSwordmanAttack());
hasDamaged = true;
}
}
} else if ((Math.abs(dx) > RUN_MIN) || (Math.abs(dy) > RUN_MIN)) {
clip.gotoAndStop("run");
} else {
clip.gotoAndStop("stand");
}
isBlocking = false;
}
function keyInterface() {
if (!isSwinging) {
if ((!isBlocking) && (clip.block == undefined)) {
if (Key.isDown(game.getKey("LEFT")) || (Key.isDown(game.getKey("ARROW_LEFT")))) {
walk(-MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("RIGHT")) || (Key.isDown(game.getKey("ARROW_RIGHT")))) {
walk(MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("UP")) || (Key.isDown(game.getKey("ARROW_UP")))) {
walk(0, -MAX_ACCELERATION);
}
if (Key.isDown(game.getKey("DOWN")) || (Key.isDown(game.getKey("ARROW_DOWN")))) {
walk(0, MAX_ACCELERATION);
}
if (Key.isDown(32)) {
swordSwing();
}
}
if (Key.isDown(game.getKey("BLOCK"))) {
isBlocking = true;
}
}
}
function block() {
isBlocking = true;
}
function clearStatus() {
}
function isHitPeriod() {
return((((game.getGameTime() - lastSwordSwing) <= MIN_SWING_TIME) && ((game.getGameTime() - lastSwordSwing) >= MIN_HIT_TIME)) && (!hasDamaged));
}
function swordHasHit(man) {
if (Math.abs(man.y - y) > 50) {
return(false);
}
if (((currentDirection * (man.getX() - x)) > (SWORD_MAN_RANGE * 1.8)) || ((currentDirection * (man.getX() - x)) <= 0)) {
return(false);
}
return(true);
}
function swordSwing() {
if ((game.getGameTime() - lastSwordSwing) >= (MIN_SWING_TIME + MIN_WAIT_TIME)) {
isSwinging = true;
swingType = "swing";
MIN_SWING_TIME = 1133.33333333333;
MIN_HIT_TIME = 700;
if (Math.random() <= 0.2) {
swingType = "swing2";
MIN_HIT_TIME = 500;
MIN_SWING_TIME = 1000;
} else if (Math.random() <= 0.2) {
swingType = "swing3";
MIN_HIT_TIME = 1166.66666666667;
MIN_SWING_TIME = 2033.33333333333;
} else if (Math.random() <= 0.2) {
swingType = "swing4";
MIN_HIT_TIME = 1000;
MIN_SWING_TIME = 1666.66666666667;
}
lastSwordSwing = game.getGameTime();
hasDamaged = false;
}
return(false);
}
function damage(amount, direction, type) {
if (((clip.block != undefined) && (!isSwinging)) && (direction != currentDirection)) {
if (int(Math.random() * 5) < 2) {
super.damage(amount, direction, type);
// unexpected jump
}
var _local3 = (((amount * amount) / MASS) * direction) * DAMAGE_MOMENTOM_CONSTANT;
if ((type == "arrow") || (type == "arrow_headshot")) {
game.getSoundManager().playSound("arrowHitMetal", x);
_local3 = 0;
}
if (type == "wizard") {
inShock = true;
shockTime = game.getGameTime();
}
if (type == "giant") {
clearStatus();
inShock = true;
shockTime = game.getGameTime();
setDy((_local3 * (1 - (Math.random() * 2))) * 70);
_local3 = _local3 * 31;
}
setDx(_local3);
return(false);
} else {
super.damage(amount, direction, type);
}
return(true);
}
function getHasDamaged() {
return(hasDamaged);
}
function getIsSwinging() {
return(isSwinging);
}
function getSWORD_MAN_RANGE() {
return(SWORD_MAN_RANGE);
}
function isAttacking() {
return(isSwinging);
}
function shouldAttack() {
return(true);
}
function setAsMinion() {
baseScale = baseScale * 1.25;
MAX_HEALTH = MAX_HEALTH / 1.5;
isMinion = true;
}
var type = 3;
var MAX_VELOCITY = 4;
var MAX_ACCELERATION = 0.4;
var SWORD_MAN_RANGE = 50;
var MIN_SWING_TIME = 1010;
var MIN_WAIT_TIME = 0;
var MAX_HEALTH = 500;
var MIN_HIT_TIME = 700;
var HIT_WIDTH = 20;
var RUN_MIN = 0.2;
}
Symbol 2509 MovieClip [__Packages.SpartanGroup] Frame 0
class SpartanGroup extends Group
{
var squad, game, stance, men, formation, globalActionTime, UPDATE_PERIOD, closeScore, ATTACK, getYOffset, FORMATION_Y_OFFSET, DEFEND;
function SpartanGroup (game, squad, stance) {
super();
this.squad = squad;
this.game = game;
this.stance = stance;
men = [];
formation = new Array();
globalActionTime = game.getGameTime();
}
function attack(forwardPos) {
var _local2;
var _local12;
var _local5;
var _local3;
var _local13;
var _local4;
for (_local2 in men) {
_local13 = men[_local2].instance;
_local13.update();
if (men[_local2].instance != game.getCurrentCharacter()) {
_local12 = Infinity;
men[_local2].state = 0;
var _local7 = men[_local2].target;
if (((men[_local2].target == undefined) || (!men[_local2].target.getIsAlive())) || ((game.getGameTime() - men[_local2].targetAquireTime) > UPDATE_PERIOD)) {
if (men[_local2].row <= 4) {
if (((!men[_local2].target.getIsAlive()) || (men[_local2].target == undefined)) || (!((Math.abs(men[_local2].target.x - men[_local2].instance.x) < men[_local2].instance.getSWORD_MAN_RANGE()) && (Math.abs(men[_local2].target.y - men[_local2].instance.y) < 14)))) {
men[_local2].targetRange = Infinity;
men[_local2].target = undefined;
men[_local2].state = 0;
for (_local4 in squad.getOponents()) {
if (squad.getOponents()[_local4].getIsGarrisoned()) {
continue;
}
if (squad.getOponents()[_local4].getIsAlive() && (closeScore(squad.getOponents()[_local4], men[_local2].instance) < men[_local2].targetRange)) {
men[_local2].target = squad.getOponents()[_local4];
men[_local2].targetRange = closeScore(squad.getOponents()[_local4], men[_local2].instance);
men[_local2].state = 1;
}
}
}
}
men[_local2].targetAquireTime = game.getGameTime();
}
if (squad.getTeamName() != "blue") {
if (((_local7 == men[_local2].instance.getSquad().getEnemyTeam().getCastleHitArea()) && (stance == ATTACK)) && (Math.abs(men[_local2].target.getX() - men[_local2].instance.getX()) > Math.abs(_local7._x - men[_local2].instance.getX()))) {
men[_local2].target = _local7;
}
}
if (((men[_local2].target == undefined) || (men[_local2].target == men[_local2].instance.getSquad().getEnemyTeam().getCastleHitArea())) && (stance == ATTACK)) {
men[_local2].state = 7;
men[_local2].targetRange = 5001;
men[_local2].target = men[_local2].instance.getSquad().getEnemyTeam().getCastleHitArea();
}
if ((men[_local2].target != undefined) && (men[_local2].state != 7)) {
men[_local2].instance.faceDirection((men[_local2].target.x - men[_local2].instance.x) / Math.abs(men[_local2].target.x - men[_local2].instance.x));
}
if ((men[_local2].state == 7) && (Math.abs((men[_local2].target.x - (squad.getTeamDirection() * 40)) - men[_local2].instance.getX()) > 10)) {
var _local10 = men[_local2].target.x - (squad.getTeamDirection() * 40);
var _local9 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local3 = int(_local10 - men[_local2].instance.x);
_local5 = int(_local9 - men[_local2].instance.y);
if (_local3 == 0) {
_local3 = 1;
}
if ((formation[0][0] == men[_local2]) && (((_local3 + men[_local2].instance.getX()) * squad.getTeamDirection()) > (forwardPos * squad.getTeamDirection()))) {
_local3 = forwardPos - men[_local2].instance.getX();
}
var _local8 = (_local5 / Math.abs(_local5)) * men[_local2].instance.getMAX_ACCELERATION();
if (_local5 == 0) {
_local8 = 0;
}
if ((_local3 / Math.abs(_local3)) == squad.getTeamDirection()) {
men[_local2].instance.block();
} else {
men[_local2].instance.unblock();
}
if (((_local3 * _local3) + (_local5 * _local5)) >= 5) {
men[_local2].instance.walk((_local3 / Math.abs(_local3)) * men[_local2].instance.getMAX_ACCELERATION(), _local8);
}
} else if ((((stance == ATTACK) && (!men[_local2].instance.isThrown())) && (Math.abs(men[_local2].target.x - men[_local2].instance.x) < 400)) && ((Math.abs(men[_local2].target.y - men[_local2].instance.y) < 10) || (men[_local2].target.type == -1))) {
men[_local2].state = 2;
men[_local2].instance.throwSpear(-7);
} else if (((Math.abs(men[_local2].target.x - men[_local2].instance.x) < men[_local2].instance.getSPARTAN_RANGE()) && (Math.abs(men[_local2].target.y - men[_local2].instance.y) < 14)) || ((men[_local2].target.type == -1) && (Math.abs((men[_local2].target.x - men[_local2].instance.x) - ((men[_local2].instance.getSquad().getTeamDirection() * men[_local2].target._width) / 2)) < men[_local2].instance.getSPARTAN_RANGE()))) {
men[_local2].state = 2;
if (men[_local2].target == men[_local2].instance.getSquad().getEnemyTeam().getCastleHitArea()) {
men[_local2].instance.faceDirection((men[_local2].target.x - men[_local2].instance.x) / Math.abs(men[_local2].target.x - men[_local2].instance.x));
}
if (((men[_local2].target.shouldAttack() || (men[_local2].instance.isAttacking())) || (men[_local2].target.type == -1)) && (men[_local2].instance.thrust(men[_local2].target))) {
men[_local2].state = 0;
men[_local2].target = undefined;
}
if (squad.getTeamDirection() != men[_local2].instance.getCurrentDirection()) {
men[_local2].instance.unblock();
} else {
men[_local2].instance.block();
}
} else {
if ((formation[0][0] != men[_local2]) && (_local12 > 5000)) {
var _local11 = formation[0][0].instance.getX();
var _local10 = _local11 + (((men[_local2].row * FORMATION_Y_OFFSET) * -1) * squad.getTeamDirection());
var _local9 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local3 = int(_local10 - men[_local2].instance.x);
_local5 = int(_local9 - men[_local2].instance.y);
} else if (men[_local2].target != undefined) {
_local3 = int(men[_local2].target.x - men[_local2].instance.x);
_local5 = int(men[_local2].target.y - men[_local2].instance.y);
if (Math.abs(_local3) < 30) {
_local3 = 1;
}
} else {
var _local11 = forwardPos;
var _local10 = _local11 + (((men[_local2].row * FORMATION_Y_OFFSET) * -1) * squad.getTeamDirection());
var _local9 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local3 = int(_local10 - men[_local2].instance.x);
_local5 = int(_local9 - men[_local2].instance.y);
}
if (((stance == DEFEND) && (_local3 == 0)) && ((men[_local2].target != undefined) && (Math.abs(men[_local2].target.x - men[_local2].instance.x) < 700))) {
men[_local2].instance.block();
} else if ((men[_local2].instance.getIsInAction() && (squad.getTeamDirection() == men[_local2].instance.getCurrentDirection())) || (((men[_local2].target != undefined) && (Math.abs(men[_local2].target.x - men[_local2].instance.x) < 100)) && (men[_local2].target.getCurrentDirection() != men[_local2].instance.getCurrentDirection()))) {
men[_local2].instance.block();
} else {
men[_local2].instance.unblock();
}
if ((formation[0][0] == men[_local2]) && (((_local3 + men[_local2].instance.getX()) * squad.getTeamDirection()) > (forwardPos * squad.getTeamDirection()))) {
_local3 = forwardPos - men[_local2].instance.getX();
}
if ((men[_local2].instance.getSquad().getTeamDirection() * (men[_local2].instance.getX() + _local3)) < (men[_local2].instance.getSquad().getTeamDirection() * (men[_local2].instance.getSquad().getBaseX() + (men[_local2].instance.getSquad().getTeamDirection() * 100)))) {
_local3 = (men[_local2].instance.getSquad().getBaseX() + (men[_local2].instance.getSquad().getTeamDirection() * 100)) - men[_local2].instance.getX();
}
if (_local5 == 0) {
var _local8 = 0;
} else {
var _local8 = (_local5 / Math.abs(_local5)) * men[_local2].instance.getMAX_ACCELERATION();
}
if (_local3 == 0) {
_local3 = 1;
}
var _local14 = men[_local2].target.getX() - men[_local2].instance.getX();
if (((_local3 * _local3) + (_local5 * _local5)) >= 60) {
men[_local2].instance.walk((_local3 / Math.abs(_local3)) * men[_local2].instance.getMAX_ACCELERATION(), _local8);
}
}
}
}
}
}
Symbol 2510 MovieClip [__Packages.ArcherGroup] Frame 0
class ArcherGroup extends Group
{
var squad, game, stance, men, formation, UPDATE_PERIOD, closeScore, DEFEND, ATTACK, FORMATION_Y_OFFSET, getYOffset;
function ArcherGroup (game, squad, stance) {
super();
this.squad = squad;
this.game = game;
this.stance = stance;
men = [];
formation = new Array();
}
function attack(forwardPos) {
var _local2;
var _local5;
var _local7;
var _local4;
var _local14;
var _local3;
for (_local2 in men) {
_local14 = men[_local2].instance;
_local14.update();
if (men[_local2].instance != game.getCurrentCharacter()) {
if ((men[_local2].instance.dx != 0) || (men[_local2].instance.dy != 0)) {
}
_local5 = Infinity;
men[_local2].state = 0;
if (((!men[_local2].target) || (!men[_local2].target.getIsAlive())) || ((game.getGameTime() - men[_local2].targetAquireTime) > UPDATE_PERIOD)) {
if ((((!men[_local2].target.getIsAlive()) || (men[_local2].target == undefined)) || ((!Math.abs(men[_local2].target.x - men[_local2].instance.x)) < men[_local2].instance.getARCHER())) || ((!Math.abs(men[_local2].target.y - men[_local2].instance.y)) < 50)) {
men[_local2].targetRange = Infinity;
men[_local2].target = undefined;
men[_local2].state = 0;
for (_local3 in squad.getOponents()) {
if (squad.getOponents()[_local3].getIsGarrisoned()) {
continue;
}
if (squad.getOponents()[_local3].getIsAlive() && (closeScore(squad.getOponents()[_local3], men[_local2].instance) < men[_local2].targetRange)) {
men[_local2].target = squad.getOponents()[_local3];
men[_local2].targetRange = closeScore(squad.getOponents()[_local3], men[_local2].instance);
men[_local2].state = 1;
}
}
}
men[_local2].targetAquireTime = game.getGameTime();
}
if ((squad.getMode() == DEFEND) && ((squad.getTeamDirection() * men[_local2].instance.getX()) > (squad.getTeamDirection() * forwardPos))) {
men[_local2].target = undefined;
}
if (((squad.getMode() == ATTACK) && (men[_local2].target == undefined)) && (Math.abs(squad.getEnemyTeam().getCastleHitArea()._x - men[_local2].instance.x) < men[_local2].instance.getARCHER_RANGE())) {
men[_local2].state = 2;
men[_local2].instance.faceDirection((squad.getEnemyTeam().getCastleHitArea()._x - men[_local2].instance.x) / Math.abs(squad.getEnemyTeam().getCastleHitArea()._x - men[_local2].instance.x));
if (men[_local2].instance.shootAtTarget(squad.getEnemyTeam().getCastleHitArea(), true, 0)) {
men[_local2].state = 0;
men[_local2].target = undefined;
men[_local2].instance.clearStatus();
}
} else if (men[_local2].instance.isAttacking() || ((Math.abs(men[_local2].target.x - men[_local2].instance.x) < men[_local2].instance.getARCHER_RANGE()) && (Math.abs(men[_local2].target.y - men[_local2].instance.y) < 100))) {
men[_local2].state = 2;
men[_local2].instance.faceDirection((men[_local2].target.x - men[_local2].instance.x) / Math.abs(men[_local2].target.x - men[_local2].instance.x));
if (men[_local2].instance.shootAtTarget(men[_local2].target.getClip(), false, men[_local2].target.getDx())) {
men[_local2].state = 0;
men[_local2].target = undefined;
men[_local2].instance.clearStatus();
}
} else {
if (formation[0][0] == men[_local2]) {
var _local6 = squad.getForwardMan(1).getX();
if ((_local6 == undefined) && (stance == ATTACK)) {
_local5 = Infinity;
var _local9;
for (_local3 in squad.getOponents()) {
if (squad.getOponents()[_local3].getIsAlive() && (Math.abs(squad.getOponents()[_local3].x - men[_local2].instance.x) < _local5)) {
_local5 = Math.abs(squad.getOponents()[_local3].x - men[_local2].instance.x);
_local9 = _local3;
}
}
_local6 = forwardPos;
if (_local5 != Infinity) {
_local6 = squad.getOponents()[_local9].getX() - ((men[_local2].instance.getARCHER_RANGE() - 190) * squad.getTeamDirection());
}
} else {
_local6 = forwardPos;
}
var _local13 = _local6 - (squad.getTeamDirection() * 180);
var _local12 = _local13 + (((men[_local2].row * FORMATION_Y_OFFSET) * -1) * squad.getTeamDirection());
var _local11 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local4 = int(_local12 - men[_local2].instance.x);
_local7 = int(_local11 - men[_local2].instance.y);
} else {
var _local13 = formation[0][0].instance.getX();
var _local12 = _local13 + (((men[_local2].row * FORMATION_Y_OFFSET) * -1) * squad.getTeamDirection());
var _local11 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local4 = int(_local12 - men[_local2].instance.x);
_local7 = int(_local11 - men[_local2].instance.y);
}
if (((squad.getTeamDirection() * men[_local2].instance.getX()) + _local4) > (squad.getTeamDirection() * forwardPos)) {
_local4 = forwardPos - men[_local2].instance.getX();
}
if (_local4 == 0) {
_local4 = 1;
}
var _local10 = (_local7 / Math.abs(_local7)) * men[_local2].instance.getMAX_ACCELERATION();
if (_local7 == 0) {
_local10 = 0;
}
if ((men[_local2].instance.getSquad().getTeamDirection() * (men[_local2].instance.getX() + _local4)) < ((men[_local2].instance.getSquad().getTeamDirection() * men[_local2].instance.getSquad().getBaseX()) + (men[_local2].instance.getSquad().getTeamDirection() * 100))) {
_local4 = (men[_local2].instance.getSquad().getBaseX() + (men[_local2].instance.getSquad().getTeamDirection() * 100)) - men[_local2].instance.getX();
}
if (((_local4 * _local4) + (_local7 * _local7)) >= 100) {
men[_local2].instance.walk((_local4 / Math.abs(_local4)) * men[_local2].instance.getMAX_ACCELERATION(), _local10);
} else if (men[_local2].instance.getSpeed() == 0) {
men[_local2].instance.faceDirection(squad.getTeamDirection());
}
}
}
}
}
}
Symbol 2511 MovieClip [__Packages.Archer] Frame 0
class Archer extends Man
{
var x, y, dy, dx, squad, game, hasPrep, simUnits, unitType, initMovieClip, isShooting, hasShot, armRotation, shootStartTime, shootFinishTime, ARCHER_RANGE, inaccuracy, yOffset, health, arrowType, clip, isAlive, power, powerDirection, controlMultiplier, controlMultiply, currentDirection, compound, walk;
function Archer (x, y, squad, simUnits, game) {
super();
this.x = x;
this.y = y;
dy = (dx = 0);
this.squad = squad;
this.game = game;
hasPrep = false;
this.simUnits = simUnits;
unitType = "archer";
initMovieClip("archer");
isShooting = false;
hasShot = false;
armRotation = 0;
shootStartTime = game.getGameTime();
shootFinishTime = game.getGameTime();
ARCHER_RANGE = 700;
inaccuracy = (Math.random() * 300) - 100;
yOffset = 0;
MAX_HEALTH = squad.getTechnology().getArcherHealth();
health = MAX_HEALTH;
arrowType = squad.getTechnology().getArcherDamage();
}
function update() {
super.update();
clip.arrows = squad.getTechnology().getArcherDamage();
if (hasShot) {
if ((Math.abs(clip.prep.bow.bow._rotation) > 5) || ((game.getGameTime() - shootFinishTime) <= 500)) {
aim(0);
} else {
hasShot = false;
isShooting = false;
}
}
if (!isAlive) {
clip.gotoAndStop("death");
} else if (isShooting) {
if ((this != game.getCurrentCharacter()) || (clip.prep.bow._currentframe < 34)) {
clip.prep.bar._visible = false;
} else {
clip.prep.bar._visible = true;
var _local3 = 150 - power;
if (!hasShot) {
if (powerDirection == 1) {
power = power + (500 * (1 / _local3));
} else {
power = power - (500 * (1 / _local3));
}
}
if (power > 100) {
power = 99;
powerDirection = -1;
} else if (power < 0) {
power = 1;
powerDirection = 1;
}
clip.prep.bar.bar._xscale = power;
}
clip.gotoAndStop("walk");
if ((dx != 0) || (dy != 0)) {
clip.prep.play();
} else {
clip.prep.gotoAndStop(1);
}
} else if ((dx != 0) || (dy != 0)) {
clip.gotoAndStop("run");
} else {
clip.gotoAndStop("stand");
}
}
function aim(gangle) {
if ((game.getGameTime() - shootStartTime) > 866.666666666667) {
clip.prep.bow.bow._rotation = clip.prep.bow.bow._rotation + ((gangle - clip.prep.bow.bow._rotation) / 5);
if (Math.abs(gangle - clip.prep.bow.bow._rotation) < 1.5) {
clip.prep.bow.bow._rotation = gangle;
}
return(Math.abs(gangle - clip.prep.bow.bow._rotation) < 0.4);
}
return(false);
}
function shoot() {
if (hasShot || (!isAlive)) {
return(undefined);
}
if ((clip.prep != undefined) && (clip.prep.bow._currentframe >= 39)) {
var _local2 = arrowType;
if (controlMultiply() == controlMultiplier) {
_local2 = _local2 + 1;
}
if (game.getCurrentCharacter() != this) {
power = 70;
}
if (currentDirection == 1) {
game.projectileManager.addArrow(this, clip.prep.bow.bow._rotation, _local2, power / 100);
} else {
game.projectileManager.addArrow(this, 180 - clip.prep.bow.bow._rotation, _local2, power / 100);
}
clip.prep.bow.bow.play();
hasShot = true;
shootFinishTime = game.getGameTime();
}
}
function shootFail() {
if (hasShot || (!isAlive)) {
return(undefined);
}
var _local2 = arrowType;
if (controlMultiply() == 2) {
_local2 = _local2 + 1;
}
if (currentDirection == 1) {
game.projectileManager.addArrowFail(this, 0, _local2);
} else {
game.projectileManager.addArrowFail(this, 180, _local2);
}
clip.prep.bow.bow.play();
hasShot = true;
shootFinishTime = game.getGameTime();
}
function beginShot() {
isShooting = true;
shootStartTime = game.getGameTime();
var _local2 = compound(2, 0.5, squad.getTechnology().getArcherAccuracy());
inaccuracy = ((Math.random() * 300) - 150) / _local2;
power = 0;
powerDirection = 1;
hasPrep = false;
}
function keyInterface() {
var _local3;
if (hasShot) {
} else if (isShooting) {
if (Key.isDown(game.getKey("LEFT")) || (Key.isDown(game.getKey("ARROW_LEFT")))) {
walk((-MAX_ACCELERATION) / 4, 0);
}
if (Key.isDown(game.getKey("RIGHT")) || (Key.isDown(game.getKey("ARROW_RIGHT")))) {
walk(MAX_ACCELERATION / 4, 0);
}
if (Key.isDown(game.getKey("UP")) || (Key.isDown(game.getKey("ARROW_UP")))) {
walk(0, (-MAX_ACCELERATION) / 4);
}
if (Key.isDown(game.getKey("DOWN")) || (Key.isDown(game.getKey("ARROW_DOWN")))) {
walk(0, MAX_ACCELERATION / 4);
}
_local3 = (Math.atan(((_root._xmouse - x) - game.getScreenX()) / ((_root._ymouse - y) + 40)) * 180) / Math.PI;
if (currentDirection == 1) {
if (_root._ymouse >= (y - 40)) {
aim(90 - _local3);
} else {
aim(-90 - _local3);
}
} else if (_root._ymouse >= (y - 40)) {
aim(90 + _local3);
} else {
aim(_local3 - 90);
}
if (!game.getIsMouseDown()) {
shoot();
}
} else if (((_root._ymouse > 60) && (game.getIsMouseDown())) && ((game.getGameTime() - shootFinishTime) > 500)) {
beginShot();
} else {
if (Key.isDown(game.getKey("LEFT")) || (Key.isDown(game.getKey("ARROW_LEFT")))) {
walk(-MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("RIGHT")) || (Key.isDown(game.getKey("ARROW_RIGHT")))) {
walk(MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("UP")) || (Key.isDown(game.getKey("ARROW_UP")))) {
walk(0, -MAX_ACCELERATION);
}
if (Key.isDown(game.getKey("DOWN")) || (Key.isDown(game.getKey("ARROW_DOWN")))) {
walk(0, MAX_ACCELERATION);
}
}
}
function aimAtTarget(mc, dx) {
var _local2 = mc._x - x;
if (dx != undefined) {
_local2 = _local2 + (dx * 10);
}
_local2 = (0.9 * Math.abs(_local2)) + inaccuracy;
if (_local2 >= 700) {
return(aim(-45));
}
var _local3 = (0.00153061224489796 * _local2) / 2;
return(aim(-57.2957795130823 * Math.asin(_local3)));
}
function shootAtTarget(mc, isCastle, dx) {
if (mc == undefined) {
}
if (hasShot) {
return(true);
}
if (((Math.abs(mc._y - y) >= 4) && (!isShooting)) && (!isCastle)) {
walk(0, ((mc._y - y) / Math.abs(mc._y - y)) * MAX_ACCELERATION);
} else if (!canShootForAi()) {
} else if (!isShooting) {
beginShot();
} else if (aimAtTarget(mc, dx) == true) {
shoot();
}
return(false);
}
function clearStatus() {
shootFinishTime = game.getGameTime();
isShooting = false;
hasShot = false;
}
function getIsShooting() {
return(isShooting);
}
function getARCHER_RANGE() {
return(ARCHER_RANGE);
}
function isAttacking() {
return(isShooting);
}
function shouldAttack() {
return(true);
}
function canShootForAi() {
return((game.getGameTime() - shootFinishTime) > 1000);
}
var type = 2;
var MAX_VELOCITY = 3.5;
var MAX_ACCELERATION = 0.4;
var MAX_HEALTH = 300;
}
Symbol 2512 MovieClip [__Packages.MinerGroup] Frame 0
class MinerGroup extends Group
{
var squad, game, stance, men, formation;
function MinerGroup (game, squad, stance) {
super();
this.squad = squad;
this.game = game;
this.stance = stance;
men = [];
formation = new Array();
}
function attack(forwardPos) {
var _local3;
var _local6;
var _local5;
var _local4;
var _local2;
for (_local3 in men) {
_local2 = men[_local3].instance;
_local2.update();
if ((_local2 == game.getCurrentCharacter()) && (!_local2.getIsMining())) {
_local2.clearStatus();
}
if (_local2 != game.getCurrentCharacter()) {
_local6 = game.getMineHolder().getClosestMine(_local2);
if ((_local6 == undefined) || (_local2.isGoldFull())) {
_local2.stopMining();
men[_local3].state = 1;
} else {
men[_local3].state = 0;
}
if (men[_local3].state == 0) {
_local5 = _local6.clip._y - _local2.getClip()._y;
_local4 = (_local6.clip._x - _local2.getClip()._x) - (squad.getTeamDirection() * 30);
if (_local3 >= (men.length / 2)) {
_local4 = (_local6.clip._x - _local2.getClip()._x) + (squad.getTeamDirection() * 30);
}
if (_local4 == 0) {
_local4 = 1;
}
if (_local5 == 0) {
_local5 = 1;
}
if ((Math.abs(_local5) >= 10) || (Math.abs(_local4) >= 10)) {
_local2.walk((_local4 / Math.abs(_local4)) * _local2.getMAX_ACCELERATION(), ((_local5 / Math.abs(_local5)) * _local2.getMAX_ACCELERATION()) / 1.5);
_local2.stopMining();
} else {
_local2.startMining();
if ((game.getGameTime() - men[_local3].lastStateChange) > 500) {
_local2.hit();
men[_local3].lastStateChange = game.getGameTime();
}
}
} else if (_local2.hasGold()) {
_local2.walk(((-((_local2.getX() - squad.getBaseX()) + (100 * squad.getTeamDirection()))) / Math.abs((_local2.getX() - squad.getBaseX()) + (100 * squad.getTeamDirection()))) * _local2.getMAX_ACCELERATION(), 0);
} else {
men[_local3].state = 0;
}
}
}
}
}
Symbol 2513 MovieClip [__Packages.Miner] Frame 0
class Miner extends Man
{
var x, y, isPostMine, dy, dx, squad, game, simUnits, isMining, gold, currentMine, lastKeyPress, lastMineHit, unitType, initMovieClip, yOffset, compound, health, miningTime, clip, currentDirection, isAlive, faceDirection, controlMultiply, walk, MAX_ACCELERATION;
function Miner (x, y, squad, simUnits, game) {
super();
this.x = x;
this.y = y;
isPostMine = false;
dy = (dx = 0);
this.squad = squad;
this.game = game;
this.simUnits = simUnits;
isMining = false;
gold = 0;
currentMine = undefined;
lastKeyPress = game.getGameTime();
lastMineHit = game.getGameTime();
unitType = "miner";
initMovieClip("miner");
yOffset = 2;
MAX_GOLD = compound(100, 0.2, squad.getTechnology().getMinerBag() - 1);
GOLD_HIT_INC = compound(10, 0.2, squad.getTechnology().getMinerPickaxe() - 1);
MAX_HEALTH = squad.getTechnology().getMinerHealth();
health = MAX_HEALTH;
miningTime = game.getGameTime();
}
function update() {
super.update();
clip.weapon = squad.getTechnology().getMinerPickaxe() * 2;
clip.bag = squad.getTechnology().getMinerBag();
if (game.getCurrentCharacter() == this) {
clip.bar._visible = true;
clip.bar.barFill._xscale = (100 * gold) / MAX_GOLD;
if (currentDirection == -1) {
}
} else {
clip.bar._visible = false;
}
if (!isAlive) {
clip.gotoAndStop("death");
} else if (isMining) {
mine();
clip.gotoAndStop("mine");
faceDirection((currentMine.clip._x - x) / Math.abs(currentMine.clip._x - x));
if (clip.mining._currentframe == 20) {
addGold();
}
if (isPostMine && ((game.getGameTime() - miningTime) > MINING_WAIT)) {
isMining = false;
}
if (clip.mining._currentframe == 43) {
miningTime = game.getGameTime();
clip.mining.gotoAndStop(1);
isPostMine = true;
}
} else if ((dx != 0) || (dy != 0)) {
clip.gotoAndStop("walk");
faceDirection(dx / Math.abs(dx));
isMining = false;
} else {
clip.gotoAndStop("stand");
}
if (Math.abs(x - squad.getBaseX()) < 100) {
squad.minerGiveGold(dropOffGold());
}
}
function mine() {
currentMine = game.getMineHolder().closeToMine(this);
dx = (dy = 0);
}
function addGold() {
if ((gold + (GOLD_HIT_INC * controlMultiply())) <= MAX_GOLD) {
currentMine.goldRemaining = currentMine.goldRemaining - (GOLD_HIT_INC * controlMultiply());
gold = gold + (GOLD_HIT_INC * controlMultiply());
return(true);
}
if ((gold + (GOLD_HIT_INC * controlMultiply())) > MAX_GOLD) {
currentMine.goldRemaining = currentMine.goldRemaining - (MAX_GOLD - gold);
gold = MAX_GOLD;
return(true);
}
return(false);
}
function hit() {
if ((gold + GOLD_HIT_INC) <= MAX_GOLD) {
return(true);
}
if ((gold + GOLD_HIT_INC) > MAX_GOLD) {
return(true);
}
return(false);
}
function startMining() {
var _local2 = game.getMineHolder().closeToMine(this);
if (_local2) {
isPostMine = false;
isMining = true;
clip.mining.play();
}
}
function stopMining() {
isMining = false;
}
function keyInterface() {
if ((Key.isDown(32) && ((isMining == false) || (isPostMine))) && ((game.getGameTime() - lastKeyPress) > 500)) {
startMining();
lastKeyPress = game.getGameTime();
}
if (isMining == false) {
if (Key.isDown(game.getKey("LEFT")) || (Key.isDown(game.getKey("ARROW_LEFT")))) {
walk(-MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("RIGHT")) || (Key.isDown(game.getKey("ARROW_RIGHT")))) {
walk(MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("UP")) || (Key.isDown(game.getKey("ARROW_UP")))) {
walk(0, -MAX_ACCELERATION);
}
if (Key.isDown(game.getKey("DOWN")) || (Key.isDown(game.getKey("ARROW_DOWN")))) {
walk(0, MAX_ACCELERATION);
}
} else {
if ((currentMine && (gold < MAX_GOLD)) && ((game.getGameTime() - lastKeyPress) > 200)) {
if (Key.isDown(32)) {
hit();
lastKeyPress = game.getGameTime();
}
}
if (!Key.isDown(32)) {
lastKeyPress = game.getGameTime() - 10000;
}
if (Key.isDown(game.getKey("LEFT")) || (Key.isDown(game.getKey("ARROW_LEFT")))) {
stopMining();
}
if (Key.isDown(game.getKey("RIGHT")) || (Key.isDown(game.getKey("ARROW_RIGHT")))) {
stopMining();
}
if (Key.isDown(game.getKey("UP")) || (Key.isDown(game.getKey("ARROW_UP")))) {
stopMining();
}
if (Key.isDown(game.getKey("DOWN")) || (Key.isDown(game.getKey("ARROW_DOWN")))) {
stopMining();
}
}
}
function clearStatus() {
isMining = false;
}
function dropOffGold() {
var _local2 = gold;
gold = 0;
return(_local2);
}
function isGoldFull() {
return(gold >= MAX_GOLD);
}
function hasGold() {
return(gold > 0);
}
function getIsMining() {
return(isMining);
}
function isAttacking() {
return(false);
}
function shouldAttack() {
return(true);
}
var type = 1;
var MAX_VELOCITY = 1.6;
var MAX_HEALTH = 100;
var GOLD_HIT_INC = 20;
var MAX_GOLD = 100;
var MINING_WAIT = 2000;
}
Symbol 2514 MovieClip [__Packages.GiantGroup] Frame 0
class GiantGroup extends Group
{
var squad, game, stance, men, formation, UPDATE_PERIOD, closeScore, FORMATION_Y_OFFSET;
function GiantGroup (game, squad, stance) {
super();
this.squad = squad;
this.game = game;
this.stance = stance;
men = [];
formation = new Array();
}
function attack(forwardPos) {
var _local3;
var _local15;
var _local6;
var _local4;
var _local13;
var _local5;
for (_local3 in men) {
_local13 = men[_local3].instance;
_local13.update();
if (men[_local3].instance != game.getCurrentCharacter()) {
if ((men[_local3].instance.dx != 0) || (men[_local3].instance.dy != 0)) {
men[_local3].instance.clearStatus();
}
if (((!men[_local3].target) || (!men[_local3].target.getIsAlive())) || ((game.getGameTime() - men[_local3].targetAquireTime) > UPDATE_PERIOD)) {
if (((!men[_local3].target.getIsAlive()) || (men[_local3].target == undefined)) || (!((Math.abs(men[_local3].target.x - men[_local3].instance.x) < men[_local3].instance.getGIANT_RANGE()) && (Math.abs(men[_local3].target.y - men[_local3].instance.y) < 10)))) {
men[_local3].targetRange = Infinity;
men[_local3].target = undefined;
men[_local3].state = 0;
for (_local5 in squad.getOponents()) {
if (squad.getOponents()[_local5].getIsGarrisoned()) {
continue;
}
if (squad.getOponents()[_local5].getIsAlive() && (closeScore(squad.getOponents()[_local5], men[_local3].instance) < men[_local3].targetRange)) {
men[_local3].target = squad.getOponents()[_local5];
men[_local3].targetRange = closeScore(squad.getOponents()[_local5], men[_local3].instance);
men[_local3].state = 1;
}
}
}
men[_local3].targetAquireTime = game.getGameTime();
}
if (!((_root.campaignData.getLevel() == 12) && (squad.getTeamName() == "blue"))) {
if ((!men[_local3].instance.isAttacking()) && ((((squad.getTeamDirection() * men[_local3].target.getX()) - men[_local3].instance.getX()) > (squad.getTeamDirection() * 50)) || (Math.random() < 0.9))) {
men[_local3].state = 1;
men[_local3].targetRange = 5001;
men[_local3].target = men[_local3].instance.getSquad().getEnemyTeam().getCastleHitArea();
}
}
if (men[_local3].target == undefined) {
men[_local3].state = 1;
men[_local3].targetRange = 5001;
men[_local3].target = men[_local3].instance.getSquad().getEnemyTeam().getCastleHitArea();
}
if (((men[_local3].instance.isAttacking() == false) && (men[_local3].target != undefined)) && (Math.abs(men[_local3].target.getX() - men[_local3].instance.getX()) < 60)) {
}
if ((((men[_local3].target != undefined) && (Math.abs(men[_local3].target.x - men[_local3].instance.x) < men[_local3].instance.getGIANT_RANGE())) && (Math.abs(men[_local3].target.y - men[_local3].instance.y) < 14)) || (Math.abs((men[_local3].target.x - men[_local3].instance.x) - ((men[_local3].instance.getSquad().getTeamDirection() * men[_local3].target._width) / 2)) < men[_local3].instance.getGIANT_RANGE())) {
men[_local3].state = 2;
if (men[_local3].target.isAttacking() && (int(Math.random() * 10) == 1)) {
men[_local3].instance.block();
}
var _local8 = (men[_local3].target.x - men[_local3].instance.x) / Math.abs(men[_local3].target.x - men[_local3].instance.x);
men[_local3].instance.faceDirection(_local8);
if ((men[_local3].instance.getCurrentDirection() == _local8) && (men[_local3].instance.swordSwing(men[_local3].target))) {
men[_local3].state = 0;
men[_local3].target = undefined;
men[_local3].instance.clearStatus();
}
} else {
var _local12;
_local12 = formation[0][0].instance.getX();
if ((formation[0][0] != men[_local3]) && (men[_local3].targetRange > 5000)) {
var _local11 = _local12 + (((men[_local3].row * 50) * -1) * squad.getTeamDirection());
var _local10 = game.getTOP() + ((FORMATION_Y_OFFSET / formation[men[_local3].row].length) * men[_local3].col);
_local4 = int(_local11 - men[_local3].instance.x);
_local6 = int(_local10 - men[_local3].instance.y);
} else {
var _local9 = (_root.campaignData.getLevel() == 12) && (squad.getTeamName() == "blue");
if (((men[_local3].target != undefined) && (_local9)) || (((Math.abs(men[_local3].target.x - men[_local3].instance.x) < men[_local3].instance.getGIANT_RANGE()) && (Math.abs(men[_local3].target.y - men[_local3].instance.y) < 10)) || (men[_local3].target == men[_local3].instance.getSquad().getEnemyTeam().getCastleHitArea()))) {
_local4 = int(men[_local3].target.x - men[_local3].instance.x);
_local6 = int(men[_local3].target.y - men[_local3].instance.y);
if (Math.abs(_local4) < 30) {
_local4 = 1;
}
} else {
_local4 = 0;
var _local10 = game.getTOP() + ((FORMATION_Y_OFFSET / formation[men[_local3].row].length) * men[_local3].col);
_local6 = int(_local10 - men[_local3].instance.y);
}
}
if (_local4 == 0) {
_local4 = 1;
}
if (((_local4 + men[_local3].instance.getX()) * squad.getTeamDirection()) > (forwardPos * squad.getTeamDirection())) {
_local4 = forwardPos - men[_local3].instance.getX();
}
if ((men[_local3].instance.getSquad().getTeamDirection() * (men[_local3].instance.getX() + _local4)) < (men[_local3].instance.getSquad().getTeamDirection() * (men[_local3].instance.getSquad().getBaseX() + (men[_local3].instance.getSquad().getTeamDirection() * 100)))) {
_local4 = (men[_local3].instance.getSquad().getBaseX() + (men[_local3].instance.getSquad().getTeamDirection() * 100)) - men[_local3].instance.getX();
}
var _local7 = (_local6 / Math.abs(_local6)) * men[_local3].instance.getMAX_ACCELERATION();
if (_local6 == 0) {
_local7 = 0;
}
if ((_local4 / Math.abs(_local4)) != squad.getTeamDirection()) {
_local4 = squad.getTeamDirection() * 100;
}
if (((_local4 * _local4) + (_local6 * _local6)) >= 40) {
men[_local3].instance.walk((_local4 / Math.abs(_local4)) * men[_local3].instance.getMAX_ACCELERATION(), _local7);
}
}
}
}
}
}
Symbol 2515 MovieClip [__Packages.Giant] Frame 0
class Giant extends Man
{
var x, y, dy, dx, healthLostnum, squad, game, simUnits, lastSwordSwing, isSwinging, hasDamaged, unitType, initMovieClip, damageDirectionTime, isBlocking, yOffset, baseScale, MAX_HEALTH, health, clip, isAlive, setDx, setDy, swingType, near, getSquad, currentDirection, walk, hitFrame, damageTime, isSuperGiant;
function Giant (x, y, squad, simUnits, game) {
super();
this.x = x;
this.y = y;
dy = (dx = 0);
healthLostnum = 0;
this.squad = squad;
this.game = game;
this.simUnits = simUnits;
lastSwordSwing = 0;
isSwinging = false;
hasDamaged = false;
unitType = "giant";
initMovieClip("giant");
damageDirectionTime = 200;
isBlocking = false;
yOffset = 0;
baseScale = baseScale / (1 + (squad.getTechnology().getGiantStrength() * 0.1));
MAX_HEALTH = squad.getTechnology().getGiantHealth();
health = MAX_HEALTH;
}
function update() {
super.update();
clip.health.bar._xscale = (health / MAX_HEALTH) * 100;
clip.weapon = (squad.getTechnology().getGiantClub() * 2) - 1;
if (!isAlive) {
clip.gotoAndStop("die");
clip.health._visible = false;
} else if ((clip.block._currentframe < 30) && (!isBlocking)) {
clip.block.play();
} else if (isBlocking) {
if (clip.block._currentframe == 20) {
clip.block.stop();
}
} else if (isSwinging) {
setDx(0);
setDy(0);
clip.gotoAndStop(swingType);
var _local4;
if (clip.swing._currentframe == 20) {
var _local5 = 1 + int(Math.random() * 2);
_root.soundManager.playSound("giantSwing" + _local5, x);
}
if (isHitPeriod()) {
for (_local4 in near) {
if ((Math.abs(near[_local4].getClip()._y - y) < HIT_WIDTH) && (near[_local4].getIsAlive())) {
if ((near[_local4].getSquad() != getSquad()) && swordHasHit(near[_local4])) {
near[_local4].damage(squad.getTechnology().getGiantAttack(), currentDirection, "giant");
near.splice(_local4, 1);
hasDamaged = true;
}
}
}
if (clip.hitTest(squad.getEnemyTeam().getCastleHitArea())) {
squad.getEnemyTeam().damageCastle(squad.getTechnology().getGiantAttack() * 10);
hasDamaged = true;
}
}
} else if ((dx != 0) || (dy != 0)) {
clip.gotoAndStop("run");
} else {
clip.gotoAndStop("stand");
}
if (isSwinging && (clip.swing._currentframe >= 127)) {
isSwinging = false;
}
isBlocking = false;
}
function keyInterface() {
if (!isSwinging) {
if ((!isBlocking) && (clip.block == undefined)) {
if (Key.isDown(game.getKey("LEFT")) || (Key.isDown(game.getKey("ARROW_LEFT")))) {
walk(-MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("RIGHT")) || (Key.isDown(game.getKey("ARROW_RIGHT")))) {
walk(MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("UP")) || (Key.isDown(game.getKey("ARROW_UP")))) {
walk(0, -MAX_ACCELERATION);
}
if (Key.isDown(game.getKey("DOWN")) || (Key.isDown(game.getKey("ARROW_DOWN")))) {
walk(0, MAX_ACCELERATION);
}
if (Key.isDown(32)) {
swordSwing();
}
}
if (Key.isDown(game.getKey("BLOCK"))) {
isBlocking = true;
}
}
}
function block() {
isBlocking = true;
}
function clearStatus() {
}
function isHitPeriod() {
return((clip.swing._currentFrame == hitFrame) && (!hasDamaged));
}
function swordHasHit(man) {
if (Math.abs(man.y - y) > HIT_WIDTH) {
return(false);
}
if (((currentDirection * (man.getX() - x)) > GIANT_RANGE) || ((currentDirection * (man.getX() - x)) <= -30)) {
return(false);
}
return(true);
}
function swordSwing() {
if ((game.getGameTime() - lastSwordSwing) >= (MIN_SWING_TIME + MIN_WAIT_TIME)) {
isSwinging = true;
lastSwordSwing = game.getGameTime();
hasDamaged = false;
damageTime = game.getGameTime();
near = squad.getEnemyTeam().getMen().slice();
swingType = "swing";
hitFrame = 42;
MIN_HIT_TIME = 1250;
if (Math.random() <= 0.5) {
hitFrame = 64;
MIN_HIT_TIME = 1900;
swingType = "swing2";
}
}
return(false);
}
function damage(amount, direction, type) {
if (type == "giant") {
amount = amount * 40;
}
var _local4 = amount;
if ((type == "sword") || (type == "spear")) {
_local4 = _local4 * 2;
super.damage(2 * amount, -currentDirection, "");
} else {
super.damage(amount, -currentDirection, "");
}
healthLostnum = (healthLostnum + 1) % 5;
var _local3 = "healthLost" + healthLostnum;
game.screen.attachMovie("healthLost", _local3, 10000000000040 + healthLostnum);
game.screen[_local3]._x = x;
game.screen[_local3]._y = y - 100;
game.screen[_local3].gold.gold.text = "- " + int(_local4);
}
function getHasDamaged() {
return(hasDamaged);
}
function getIsSwinging() {
return(isSwinging);
}
function getGIANT_RANGE() {
return(GIANT_RANGE);
}
function isAttacking() {
if (!isSwinging) {
return(false);
}
return(clip.swing._currentframe <= 122);
}
function shouldAttack() {
return(true);
}
function setAsSuperGiant() {
isSuperGiant = true;
health = health * 5;
MAX_HEALTH = MAX_HEALTH * 5;
GIANT_RANGE = GIANT_RANGE * 2.1;
baseScale = baseScale / 2.1;
}
var type = 6;
var MAX_VELOCITY = 1.2;
var MAX_ACCELERATION = 0.2;
var GIANT_RANGE = 80;
var MIN_SWING_TIME = 3010;
var MIN_WAIT_TIME = 0;
var MIN_HIT_TIME = 1650;
var HIT_WIDTH = 60;
var MASS = 100000;
var POWER = 100;
}
Symbol 2516 MovieClip [__Packages.WizardGroup] Frame 0
class WizardGroup extends Group
{
var squad, game, stance, men, formation, UPDATE_PERIOD, closeScore, FORMATION_Y_OFFSET, getYOffset;
function WizardGroup (game, squad, stance) {
super();
this.squad = squad;
this.game = game;
this.stance = stance;
men = [];
formation = new Array();
}
function attack(forwardPos) {
var _local2;
var _local5;
var _local6;
var _local4;
var _local14;
var _local3;
for (_local2 in men) {
_local14 = men[_local2].instance;
_local14.update();
if (men[_local2].instance != game.getCurrentCharacter()) {
if ((men[_local2].instance.dx != 0) || (men[_local2].instance.dy != 0)) {
men[_local2].instance.clearStatus();
}
_local5 = Infinity;
men[_local2].state = 0;
if ((((!men[_local2].target) || (!men[_local2].target.getIsAlive())) || (men[_local2].target.getIsAlive())) && ((game.getGameTime() - men[_local2].targetAquireTime) > UPDATE_PERIOD)) {
if (((!men[_local2].target.getIsAlive()) || (men[_local2].target == undefined)) || (!((Math.abs(men[_local2].target.x - men[_local2].instance.x) < men[_local2].instance.getSWORD_MAN_RANGE()) && (Math.abs(men[_local2].target.y - men[_local2].instance.y) < 50)))) {
men[_local2].targetRange = Infinity;
men[_local2].target = undefined;
men[_local2].state = 0;
for (_local3 in squad.getOponents()) {
if (squad.getOponents()[_local3].getIsGarrisoned()) {
continue;
}
if (squad.getOponents()[_local3].getIsAlive() && (closeScore(squad.getOponents()[_local3], men[_local2].instance) < men[_local2].targetRange)) {
men[_local2].target = squad.getOponents()[_local3];
men[_local2].targetRange = closeScore(squad.getOponents()[_local3], men[_local2].instance);
men[_local2].state = 1;
}
}
}
men[_local2].targetAquireTime = game.getGameTime();
}
if (men[_local2].instance.canAddMinion() && (Math.random() < 0.1)) {
men[_local2].instance.swordSwing("summon");
} else if ((men[_local2].target == undefined) && (Math.abs(squad.getEnemyTeam().getCastleHitArea()._x - men[_local2].instance.x) < men[_local2].instance.getWIZARD_RANGE())) {
men[_local2].state = 2;
var _local9 = (squad.getEnemyTeam().getCastleHitArea()._x - men[_local2].instance.x) / Math.abs(squad.getEnemyTeam().getCastleHitArea()._x - men[_local2].instance.x);
men[_local2].instance.faceDirection(_local9);
if (men[_local2].instance.getCurrentDirection() == _local9) {
men[_local2].instance.swordSwing();
}
} else if ((Math.abs(men[_local2].target.x - men[_local2].instance.x) < men[_local2].instance.getWIZARD_RANGE()) && (Math.abs(men[_local2].target.y - men[_local2].instance.y) < 100)) {
men[_local2].state = 2;
var _local9 = (squad.getEnemyTeam().getCastleHitArea()._x - men[_local2].instance.x) / Math.abs(squad.getEnemyTeam().getCastleHitArea()._x - men[_local2].instance.x);
men[_local2].instance.faceDirection(_local9);
if (men[_local2].instance.getCurrentDirection() == _local9) {
men[_local2].instance.swordSwing();
}
} else {
if (formation[0][0] == men[_local2]) {
var _local7 = squad.getForwardMan(1).getX();
if (_local7 == undefined) {
_local5 = Infinity;
var _local8;
for (_local3 in squad.getOponents()) {
if (squad.getOponents()[_local3].getIsAlive() && (Math.abs(squad.getOponents()[_local3].x - men[_local2].instance.x) < _local5)) {
_local5 = Math.abs(squad.getOponents()[_local3].x - men[_local2].instance.x);
_local8 = _local3;
}
}
_local7 = forwardPos;
if (_local5 != Infinity) {
_local7 = squad.getOponents()[_local8].getX() - ((men[_local2].instance.getWIZARD_RANGE() - 100) * squad.getTeamDirection());
}
}
var _local13 = _local7 - (squad.getTeamDirection() * 100);
var _local12 = _local13 + (((men[_local2].row * FORMATION_Y_OFFSET) * -1) * squad.getTeamDirection());
var _local11 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local4 = int(_local12 - men[_local2].instance.x);
_local6 = int(_local11 - men[_local2].instance.y);
} else {
var _local13 = formation[0][0].instance.getX();
var _local12 = _local13 + (((men[_local2].row * FORMATION_Y_OFFSET) * -1) * squad.getTeamDirection());
var _local11 = getYOffset(men[_local2].col, formation[men[_local2].row].length);
_local4 = int(_local12 - men[_local2].instance.x);
_local6 = int(_local11 - men[_local2].instance.y);
}
if (_local4 == 0) {
_local4 = 1;
}
var _local10 = (_local6 / Math.abs(_local6)) * men[_local2].instance.getMAX_ACCELERATION();
if (_local6 == 0) {
_local10 = 0;
}
if ((men[_local2].instance.getSquad().getTeamDirection() * (men[_local2].instance.getX() + _local4)) < (men[_local2].instance.getSquad().getTeamDirection() * (men[_local2].instance.getSquad().getBaseX() + (men[_local2].instance.getSquad().getTeamDirection() * 100)))) {
_local4 = (men[_local2].instance.getSquad().getBaseX() + (men[_local2].instance.getSquad().getTeamDirection() * 100)) - men[_local2].instance.getX();
}
if (((_local4 * _local4) + (_local6 * _local6)) >= 100) {
men[_local2].instance.walk((_local4 / Math.abs(_local4)) * men[_local2].instance.getMAX_ACCELERATION(), _local10);
} else if (men[_local2].instance.getSpeed() == 0) {
men[_local2].instance.faceDirection(squad.getTeamDirection());
}
}
}
}
}
}
Symbol 2517 MovieClip [__Packages.Wizard] Frame 0
class Wizard extends Man
{
var x, y, dy, dx, squad, game, simUnits, minions, lastSwordSwing, isSwinging, hasDamaged, unitType, initMovieClip, damageDirectionTime, isBlocking, yOffset, health, clip, isAlive, spellType, near, getSquad, controlMultiply, currentDirection, walk, DAMAGE_MOMENTOM_CONSTANT, setDx, getDx;
function Wizard (x, y, squad, simUnits, game) {
super();
this.x = x;
this.y = y;
dy = (dx = 0);
this.squad = squad;
this.game = game;
this.simUnits = simUnits;
minions = [];
lastSwordSwing = 0;
isSwinging = false;
hasDamaged = false;
unitType = "wizard";
initMovieClip("wizard_main");
damageDirectionTime = 2500;
isBlocking = false;
yOffset = 0;
MAX_HEALTH = squad.getTechnology().getWizardHealth();
MAX_MINION = squad.getTechnology().getWizardHealing();
health = MAX_HEALTH;
}
function update() {
super.update();
clip.wand = squad.getTechnology().getWizardAttack();
clip.hat = squad.getTechnology().getWizardHealing();
if (!isAlive) {
clip.gotoAndStop("die");
} else if ((clip.block._currentframe < 30) && (!isBlocking)) {
clip.block.play();
} else if (isBlocking) {
if (clip.block._currentframe == 20) {
clip.block.stop();
}
} else if (isSwinging) {
if (spellType == "summon") {
clip.gotoAndStop("swing2");
if (isHitPeriod() && (hasDamaged == false)) {
hasDamaged = true;
if (canAddMinion()) {
game.getSoundManager().playSound("magesummon", x);
} else {
game.getSoundManager().playSound("magespellfail", x);
}
var _local3 = 0;
while ((_local3 < 1) && (canAddMinion())) {
var _local4 = squad.addSwordMan();
_local4.setX(x + (10 * squad.getTeamDirection()));
_local4.setY(y);
minions.push(_local4);
var _local5 = SwordMan(_local4);
_local5.setAsMinion();
_local3++;
}
}
} else {
clip.gotoAndStop("swing");
if (clip.swing._currentframe == 20) {
game.getSoundManager().playSound("magicSound", x);
}
if (isHitPeriod()) {
if (!hasDamaged) {
var _local6;
for (var _local3 in near) {
if ((Math.abs(near[_local3].getClip()._y - y) < HIT_WIDTH) && near[_local3].getIsAlive()) {
if ((near[_local3].getSquad() != getSquad()) && swordHasHit(near[_local3])) {
near[_local3].damage(controlMultiply() * squad.getTechnology().getWizardAttackPower(), currentDirection, "wizard");
near.splice(_local3, 1);
hasDamaged = true;
}
}
}
}
if (clip.hitTest(squad.getEnemyTeam().getCastleHitArea())) {
squad.getEnemyTeam().damageCastle(controlMultiply() * squad.getTechnology().getWizardAttackPower());
hasDamaged = true;
}
}
}
} else if ((dx != 0) || (dy != 0)) {
clip.gotoAndStop("run");
} else {
clip.gotoAndStop("stand");
}
if (isSwinging) {
if ((spellType == "summon") && (clip.swing._currentframe >= 85)) {
isSwinging = false;
} else if (clip.swing._currentframe >= 89) {
isSwinging = false;
}
}
isBlocking = false;
}
function keyInterface() {
if (!isSwinging) {
if ((!isBlocking) && (clip.block == undefined)) {
if (Key.isDown(game.getKey("LEFT")) || (Key.isDown(game.getKey("ARROW_LEFT")))) {
walk(-MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("RIGHT")) || (Key.isDown(game.getKey("ARROW_RIGHT")))) {
walk(MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("UP")) || (Key.isDown(game.getKey("ARROW_UP")))) {
walk(0, -MAX_ACCELERATION);
}
if (Key.isDown(game.getKey("DOWN")) || (Key.isDown(game.getKey("ARROW_DOWN")))) {
walk(0, MAX_ACCELERATION);
}
if (Key.isDown(32)) {
swordSwing("shock");
}
if (Key.isDown(game.getKey("THROW"))) {
swordSwing("summon");
}
}
if (Key.isDown(game.getKey("BLOCK"))) {
isBlocking = true;
}
}
}
function block() {
isBlocking = true;
}
function clearStatus() {
}
function isHitPeriod() {
return((((game.getGameTime() - lastSwordSwing) <= (MIN_HIT_TIME + 100)) && ((game.getGameTime() - lastSwordSwing) >= MIN_HIT_TIME)) && (!hasDamaged));
}
function swordHasHit(man) {
if (Math.abs(man.y - y) > 20) {
return(false);
}
if (((currentDirection * (man.getX() - x)) > (WIZARD_RANGE + 20)) || ((currentDirection * (man.getX() - x)) <= -50)) {
return(false);
}
return(true);
}
function swordSwing(type) {
if (!isSwinging) {
if (type == "summon") {
spellType = type;
isSwinging = true;
lastSwordSwing = game.getGameTime();
hasDamaged = false;
} else {
spellType = "shock";
isSwinging = true;
lastSwordSwing = game.getGameTime();
hasDamaged = false;
near = squad.getEnemyTeam().getMen().slice();
}
}
return(false);
}
function damage(amount, direction, type) {
var _local5 = (((amount * amount) / MASS) * direction) * DAMAGE_MOMENTOM_CONSTANT;
setDx(getDx() + _local5);
if ((isBlocking && (!isSwinging)) && (direction != currentDirection)) {
if (int(Math.random() * 5) == 5) {
super.damage(amount, direction, type);
}
} else {
super.damage(amount, direction, type);
}
}
function getHasDamaged() {
return(hasDamaged);
}
function getIsSwinging() {
return(isSwinging);
}
function getWIZARD_RANGE() {
return(WIZARD_RANGE);
}
function isAttacking() {
if (!isSwinging) {
return(false);
}
if (isSwinging) {
return(clip.swing._currentframe <= 75);
}
}
function shouldAttack() {
return(true);
}
function updateMinionList() {
for (var _local2 in minions) {
if (minions[_local2].getIsAlive() == false) {
minions.splice(_local2, 1);
}
}
}
function canAddMinion() {
updateMinionList();
return(minions.length < MAX_MINION);
}
var type = 5;
var MAX_VELOCITY = 1.2;
var MAX_ACCELERATION = 0.2;
var WIZARD_RANGE = 180;
var MIN_SWING_TIME = 3000;
var MIN_WAIT_TIME = 100;
var MAX_HEALTH = 100;
var MIN_HIT_TIME = 1100;
var HIT_WIDTH = 25;
var MASS = 500;
var POWER = 100;
var MAX_MINION = 3;
}
Symbol 2518 MovieClip [__Packages.TechnologyManager] Frame 0
class TechnologyManager
{
var castleType, castleHealth, castleArcherNumber, gold, difficulty, difficultyMultiplier, statue, minerEnabled, spartanEnabled, archerEnabled, swordmanEnabled, giantEnabled, wizardEnabled, isNotClubman, isNotSpartan, minerBagsize, minerPickaxe, archerDamage, archerAccuracy, spartanHelmet, spartanShield, spartanSpear, swordmanSword, swordmanSpeed, giantStrength, giantClub, wizardHealing, wizardAttack, castleIncome;
function TechnologyManager (defaultEnabled, startGold, dif) {
castleType = "oldTower1";
castleHealth = 1;
castleArcherNumber = 0;
gold = startGold;
difficulty = dif;
difficultyMultiplier = 1;
if (difficulty == 2) {
difficultyMultiplier = 1.2;
}
if (difficulty == 3) {
difficultyMultiplier = 1.35;
}
statue = 2;
minerEnabled = defaultEnabled;
spartanEnabled = defaultEnabled;
archerEnabled = defaultEnabled;
swordmanEnabled = defaultEnabled;
giantEnabled = defaultEnabled;
wizardEnabled = defaultEnabled;
isNotClubman = defaultEnabled;
isNotSpartan = false;
minerBagsize = 1;
minerPickaxe = 1;
archerDamage = 1;
archerAccuracy = 1;
spartanHelmet = 1;
spartanShield = 1;
spartanSpear = 1;
swordmanSword = 1;
swordmanSpeed = 1;
giantStrength = 1;
giantClub = 1;
wizardHealing = 1;
wizardAttack = 1;
castleArcherNumber = 1;
castleIncome = 0;
}
function getIsNotSpartan() {
return(isNotSpartan);
}
function setIsNotSpartan(b) {
isNotSpartan = b;
}
function getIsNotClubman() {
return(isNotClubman);
}
function setIsNotClubman(num) {
isNotClubman = num;
}
function setMinerEnabled(isEnabled) {
minerEnabled = isEnabled;
}
function getMinerEnabled(isEnabled) {
return(minerEnabled);
}
function setMinerBagsize(num) {
minerBagsize = num;
}
function setMinerPickaxe(num) {
minerPickaxe = num;
return(num);
}
function getMinerBag() {
return(minerBagsize);
}
function getMinerPickaxe() {
return(minerPickaxe);
}
function getMinerHealth() {
return((difficultyMultiplier * BASE_HEALTH) / 2);
}
function setSpartanEnabled(isEnabled) {
spartanEnabled = isEnabled;
}
function getSpartanEnabled(isEnabled) {
return(spartanEnabled);
}
function setSpartanSpear(num) {
spartanSpear = num;
}
function setSpartanHelmet(num) {
spartanHelmet = num;
}
function getSpartanHeadShotReduction() {
return(1 - (spartanHelmet * 0.1));
}
function getSpartanBlockChance() {
return(compound(0.4, -0.1, spartanShield));
}
function setSpartanShield(num) {
spartanShield = num;
}
function getSpartanSpear() {
return(spartanSpear);
}
function getSpartanHelmet() {
if (isNotSpartan) {
return(spartanHelmet);
}
return(spartanHelmet + 1);
}
function getSpartanShield() {
if (isNotSpartan) {
return(spartanShield);
}
return(spartanShield + 2);
}
function getSpartanHealth() {
if (isNotSpartan) {
return((difficultyMultiplier * BASE_HEALTH) / 1.5);
}
return(difficultyMultiplier * compound(BASE_HEALTH / 2, 0.2, spartanHelmet + (spartanShield / 2)));
}
function getSpartanAttack() {
if (isNotSpartan) {
return(difficultyMultiplier * BASE_ATTACK);
}
return(difficultyMultiplier * compound(BASE_ATTACK, 0.2, spartanSpear));
}
function setSwordmanEnabled(isEnabled) {
swordmanEnabled = isEnabled;
}
function getSwordmanEnabled(isEnabled) {
return(swordmanEnabled);
}
function setSwordmanSword(num) {
swordmanSword = num;
}
function setSwordmanSpeed(num) {
swordmanSpeed = num;
}
function getSwordmanSword() {
return(swordmanSword);
}
function getSwordmanSpeed() {
return(swordmanSpeed);
}
function getSwordmanAttack() {
return(difficultyMultiplier * compound(BASE_ATTACK, 0.2, swordmanSword - 1));
}
function getSwordmanHealth() {
return((difficultyMultiplier * BASE_HEALTH) / 2);
}
function setArcherEnabled(isEnabled) {
archerEnabled = isEnabled;
}
function getArcherEnabled(isEnabled) {
return(archerEnabled);
}
function setArcherDamage(num) {
archerDamage = num;
}
function setArcherAccuracy(num) {
archerAccuracy = num;
}
function getArcherAccuracy() {
return(archerAccuracy);
}
function getArcherDamage() {
return(archerDamage);
}
function getArcherAttack() {
return(difficultyMultiplier * compound(BASE_ATTACK / 4, 0.5, archerDamage));
}
function getArcherHealth() {
return(difficultyMultiplier * compound(BASE_HEALTH * 0.1, 0.2, archerAccuracy));
}
function setGiantEnabled(isEnabled) {
giantEnabled = isEnabled;
}
function getGiantEnabled(isEnabled) {
return(giantEnabled);
}
function setGiantStrength(num) {
giantStrength = num;
}
function setGiantClub(num) {
giantClub = num;
}
function getGiantStrength() {
return(giantStrength);
}
function getGiantClub() {
return(giantClub);
}
function getGiantHealth() {
return(difficultyMultiplier * compound(BASE_HEALTH * 12, 0.2, giantStrength));
}
function getGiantAttack() {
return(difficultyMultiplier * compound(BASE_ATTACK, 0.2, giantClub));
}
function setWizardEnabled(isEnabled) {
wizardEnabled = isEnabled;
}
function getWizardEnabled(isEnabled) {
return(wizardEnabled);
}
function setWizardAttack(num) {
wizardAttack = num;
}
function setWizardHealing(num) {
wizardHealing = num;
}
function getWizardAttack() {
return(wizardAttack);
}
function getWizardAttackPower() {
return(difficultyMultiplier * compound(BASE_ATTACK / 2, 0.2, wizardAttack));
}
function getWizardHealth() {
return(difficultyMultiplier * BASE_HEALTH);
}
function getWizardStunTime() {
return(compound(1500, 0.4, wizardAttack - 1));
}
function getWizardHealing() {
return(wizardHealing);
}
function getCastleHealth() {
return(difficultyMultiplier * compound(BASE_HEALTH * 3, 1, castleHealth));
}
function getCastleHealthLevel() {
return(castleHealth);
}
function setCastleHealth(health) {
castleHealth = health;
}
function getCastleArcherNumber() {
return(castleArcherNumber);
}
function setCastleArcherNumber(num) {
castleArcherNumber = num;
}
function getCastleIncome() {
return(difficultyMultiplier * castleIncome);
}
function setCastleIncome(num) {
castleIncome = num;
}
function compound(base, rate, level) {
return(Math.pow(1 + rate, level) * base);
}
var BASE_HEALTH = 100;
var BASE_ATTACK = TechnologyManager.prototype.BASE_HEALTH / 10;
var DIFFICULTY_INCREASE = 0.2;
}
Symbol 2519 MovieClip [__Packages.QueueManager] Frame 0
class QueueManager
{
var lastSpawnTime, queue, PRODUCTION_TIME, squad, numMiners, numArchers, numSwordman, numSpartan, numWizard, numGiants;
function QueueManager (squad) {
lastSpawnTime = squad.game.getGameTime();
queue = new Array();
PRODUCTION_TIME = 2000;
this.squad = squad;
numMiners = (numArchers = (numSwordman = (numSpartan = (numWizard = (numGiants = 0)))));
}
function update() {
if (queue.length != 0) {
if ((squad.game.getGameTime() - lastSpawnTime) > queue[0].time) {
if (queue[0].init == "addMiner") {
numMiners--;
}
if (queue[0].init == "addArcher") {
numArchers--;
}
if (queue[0].init == "addGiant") {
numGiants--;
}
if (queue[0].init == "addSwordMan") {
numSwordman--;
}
if (queue[0].init == "addSpartan") {
numSpartan--;
}
if (queue[0].init == "addWizard") {
numWizard--;
}
lastSpawnTime = squad.game.getGameTime();
squad[queue[0].init]();
queue.shift();
}
}
if (squad.getTeamName() == "blue") {
updateLoadingElement(numMiners, _root.HUD.minerLoading, _root.HUD.minerCancel, "addMiner");
updateLoadingElement(numSwordman, _root.HUD.swordManLoading, _root.HUD.swordManCancel, "addSwordMan");
updateLoadingElement(numArchers, _root.HUD.archerLoading, _root.HUD.archerCancel, "addArcher");
updateLoadingElement(numSpartan, _root.HUD.spartanLoading, _root.HUD.spartanCancel, "addSpartan");
updateLoadingElement(numGiants, _root.HUD.giantLoading, _root.HUD.giantCancel, "addGiant");
updateLoadingElement(numWizard, _root.HUD.wizardLoading, _root.HUD.wizardCancel, "addWizard");
}
}
function updateLoadingElement(number, clip, cancelClip, init) {
if (number != 0) {
clip._visible = true;
cancelClip._visible = true;
clip.num.text = number;
if (queue[0].init == init) {
clip.gotoAndStop(int(((squad.game.getGameTime() - lastSpawnTime) / queue[0].time) * 5) + 1);
}
} else {
cancelClip._visible = false;
clip._visible = false;
}
}
function pop(initFunction) {
if (initFunction == "addMiner") {
numMiners--;
}
if (initFunction == "addArcher") {
numArchers--;
}
if (initFunction == "addGiant") {
numGiants--;
}
if (initFunction == "addSwordMan") {
numSwordman--;
}
if (initFunction == "addSpartan") {
numSpartan--;
}
if (initFunction == "addWizard") {
numWizard--;
}
var _local4 = -1;
var _local2 = 0;
while (_local2 < queue.length) {
if (queue[_local2].init == initFunction) {
_local4 = _local2;
}
_local2++;
}
if (_local4 != -1) {
queue.splice(_local4, 1);
return(true);
}
return(false);
}
function push(initFunction, productionTime) {
if (queue.length == 0) {
lastSpawnTime = squad.game.getGameTime();
}
if (initFunction == "addMiner") {
numMiners++;
}
if (initFunction == "addArcher") {
numArchers++;
}
if (initFunction == "addGiant") {
numGiants++;
}
if (initFunction == "addSwordMan") {
numSwordman++;
}
if (initFunction == "addSpartan") {
numSpartan++;
}
if (initFunction == "addWizard") {
numWizard++;
}
queue.push({init:initFunction, time:productionTime});
}
function size() {
return(queue.length);
}
}
Symbol 2520 MovieClip [__Packages.CastleArcherGroup] Frame 0
class CastleArcherGroup
{
var squad, game, numberArchers, lastVolleyTime, archers, targets;
function CastleArcherGroup (game, squad) {
this.squad = squad;
this.game = game;
numberArchers = Math.ceil(20 / ARCHER_RATIO);
lastVolleyTime = game.getGameTime();
squad.getTower().archer.prep.stop();
archers = [];
targets = [];
var _local2 = 0;
while (_local2 < numberArchers) {
createMan(_local2);
_local2++;
}
}
function createMan(i) {
var _local2 = new Archer(squad.getBaseX() - (50 * squad.getTeamDirection()), game.getTOP(), squad, archers, game);
_local2.update();
archers.push(_local2);
_local2.setIsGarrisoned(true);
targets[_local2] = undefined;
if (squad.getTeamName() == "red") {
var _local3;
_local3 = new Color(_local2.getClip());
_local3.setTint(100, 0, 0, 60);
}
_local2.arrowType = squad.getTechnology().getCastleArcherNumber();
}
function update() {
var _local7 = Math.ceil(squad.getNumberGarrisoned() / ARCHER_RATIO);
var _local6 = (game.getBOTTOM() - game.getTOP()) / (_local7 + 1);
var _local2 = 0;
while (_local2 < Math.ceil(20 / ARCHER_RATIO)) {
if (_local2 < _local7) {
var _local5 = game.getTOP() + (_local2 * _local6);
var _local3 = squad.getTower()._x + ((65 - (_local2 * 2)) * squad.getTeamDirection());
if (Math.abs(_local3 - archers[_local2].getX()) > 20) {
archers[_local2].walk(_local3 - archers[_local2].getX(), _local5 - archers[_local2].getY());
} else {
archers[_local2].faceDirection(squad.getTeamDirection());
if (archers[_local2].getDx() == 0) {
if (!shootIfCan(archers[_local2])) {
if (Math.abs(_local5 - archers[_local2].getY()) > 5) {
archers[_local2].walk(0, _local5 - archers[_local2].getY());
}
}
}
}
} else {
var _local5 = game.getTOP() + (_local2 * _local6);
var _local3 = squad.getTower()._x - (100 * squad.getTeamDirection());
if (archers[_local2].isAttacking()) {
archers[_local2].shootFail();
}
if (Math.abs(_local3 - archers[_local2].getX()) > 20) {
archers[_local2].walk(_local3 - archers[_local2].getX(), _local5 - archers[_local2].getY());
} else {
archers[_local2].faceDirection(squad.getTeamDirection());
}
}
_local2++;
}
_local2 = 0;
while (_local2 < Math.ceil(20 / ARCHER_RATIO)) {
var _local4 = archers[_local2];
_local4.update();
_local2++;
}
}
function shootIfCan(archer) {
var _local3 = targets[archer];
if (((_local3 != undefined) && (_local3.getIsAlive())) && (Math.abs(_local3.getX() - archer.getX()) < archer.getARCHER_RANGE())) {
archer.shootAtTarget(_local3.getClip(), false, _local3.getDx());
return(true);
}
var _local4 = findNextTarget(archer);
if (_local4 != undefined) {
if (Math.abs(_local4.getX() - archer.getX()) < archer.getARCHER_RANGE()) {
archer.shootAtTarget(_local4.getClip(), false, _local4.getDx());
targets[archer] = _local4;
return(true);
}
}
targets[archer] = undefined;
return(false);
}
function findNextTarget(archer) {
var _local2 = Infinity;
var _local4;
for (var _local5 in squad.getOponents()) {
if (squad.getOponents()[_local5].getIsGarrisoned()) {
continue;
}
if (squad.getOponents()[_local5].getIsAlive() && (closeScore(squad.getOponents()[_local5], archer) < _local2)) {
_local4 = squad.getOponents()[_local5];
_local2 = closeScore(squad.getOponents()[_local5], archer);
}
}
return(_local4);
}
function closeScore(a, b) {
return(Math.pow(a.getX() - b.getX(), 2) + Math.pow(a.getY() - b.getY(), 4));
}
function getMen() {
return(archers);
}
var VOLLEY_INTERVAL = 500;
var GARRISON = 1;
var DEFEND = 2;
var ATTACK = 3;
var ARCHER_RATIO = 3;
}
Symbol 2521 MovieClip [__Packages.Spartan] Frame 0
class Spartan extends Man
{
var x, y, dy, dx, health, attackPower, squad, game, simUnits, lastThrust, isThrusting, isBlocking, hasThrown, blockTime, hasDamaged, unitType, technology, clip, yOffset, initMovieClip, isThrowing, inShock, throwTime, isAlive, throwAngle, currentDirection, damageTime, spartanThrust, getSquad, controlMultiply, maxVelocityModifier, DAMAGE_MOMENTOM_CONSTANT, MASS, shockTime, setDy, setDx;
function Spartan (x, y, squad, simUnits, game) {
super();
this.x = x;
this.y = y;
dy = (dx = 0);
health = squad.getTechnology().getSpartanHealth();
attackPower = squad.getTechnology().getSpartanAttack();
this.squad = squad;
this.game = game;
this.simUnits = simUnits;
lastThrust = 0;
isThrusting = false;
isBlocking = false;
hasThrown = false;
blockTime = 0;
hasDamaged = false;
unitType = "spartan";
technology = {};
clip.helmet = squad.getTechnology().getSpartanHelmet();
technology.weapon = (squad.getTechnology().getSpartanSpear() * 2) - 1;
technology.secondary = squad.getTechnology().getSpartanSpear() * 2;
technology.shield = squad.getTechnology().getSpartanShield();
technology.helmet = squad.getTechnology().getSpartanHelmet();
yOffset = 0;
MAX_HEALTH = squad.getTechnology().getSpartanHealth();
initMovieClip("spartan");
health = MAX_HEALTH;
}
function walk(ddx, ddy) {
if (!isThrowing) {
super.walk(ddx, ddy);
}
}
function update() {
super.update();
if (hasThrown) {
clip.weapon = squad.getTechnology().getSpartanSpear() * 2;
} else {
clip.weapon = (squad.getTechnology().getSpartanSpear() * 2) - 1;
}
clip.shield = squad.getTechnology().getSpartanShield();
clip.helmet = squad.getTechnology().getSpartanHelmet();
if (squad.getTechnology().getIsNotSpartan()) {
clip.helmet = squad.getTechnology().getSpartanHelmet() + 5;
}
if (inShock) {
isThrusting = false;
}
if (isThrusting && ((game.getGameTime() - lastThrust) > MIN_THRUST_TIME)) {
isThrusting = false;
}
if ((isThrowing && (hasThrown)) && ((game.getGameTime() - throwTime) > SPEAR_THROW_TIME)) {
isThrowing = false;
}
if (!isAlive) {
clip.gotoAndStop("death");
} else if (inShock) {
clip.gotoAndStop("shocked");
} else if (isThrowing) {
if ((clip.spartan != undefined) && (clip.spartan._currentframe == clip.spartan._totalframes)) {
clip.gotoAndStop("drawsword");
} else if (clip.drawSword == undefined) {
clip.gotoAndStop("throw");
}
if ((!hasThrown) && (clip.spartan._currentframe == 38)) {
throwAngle = -12;
if (currentDirection == 1) {
game.projectileManager.addSpear(this, throwAngle);
} else {
game.projectileManager.addSpear(this, 180 - throwAngle);
}
hasThrown = true;
}
} else if (isThrusting) {
damageTime = game.getGameTime();
clip.gotoAndStop(spartanThrust);
var _local4;
var _local5;
if (isHitPeriod()) {
_local4 = game.getPartitionManager().getEnemyTeam(this, x + ((getSPARTAN_RANGE() / 2) * currentDirection));
for (_local5 in _local4) {
if (Math.abs(_local4[_local5].getClip()._y - y) < HIT_WIDTH) {
if ((_local4[_local5].getSquad() != getSquad()) && thrustHasHit(_local4[_local5])) {
var _local6 = 1 + int(Math.random() * 4);
_root.soundManager.playSound("swordHit" + _local6, x);
_local4[_local5].damage(controlMultiply() * squad.getTechnology().getSpartanAttack(), currentDirection, "spear");
hasDamaged = true;
return(undefined);
}
}
}
if (clip.hitTest(squad.getEnemyTeam().getCastleHitArea())) {
var _local6 = 1 + int(Math.random() * 4);
_root.soundManager.playSound("swordHit" + _local6, x);
squad.getEnemyTeam().damageCastle(controlMultiply() * squad.getTechnology().getSpartanAttack());
hasDamaged = true;
}
}
} else if ((dx != 0) || (dy != 0)) {
if (isBlocking) {
if ((game.getGameTime() - blockTime) < 500) {
clip.gotoAndStop("block");
} else {
clip.gotoAndStop("walk");
}
} else {
clip.gotoAndStop("run");
}
} else if (isBlocking) {
clip.gotoAndStop("block");
if ((game.getGameTime() - blockTime) > 500) {
clip.spartan.gotoAndStop(21);
}
} else {
clip.gotoAndStop("stand");
}
}
function keyInterface() {
if (!isThrusting) {
if (Key.isDown(game.getKey("BLOCK"))) {
block();
} else {
unblock();
}
if (Key.isDown(game.getKey("LEFT")) || (Key.isDown(game.getKey("ARROW_LEFT")))) {
walk(-MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("RIGHT")) || (Key.isDown(game.getKey("ARROW_RIGHT")))) {
walk(MAX_ACCELERATION, 0);
}
if (Key.isDown(game.getKey("UP")) || (Key.isDown(game.getKey("ARROW_UP")))) {
walk(0, -MAX_ACCELERATION);
}
if (Key.isDown(game.getKey("DOWN")) || (Key.isDown(game.getKey("ARROW_DOWN")))) {
walk(0, MAX_ACCELERATION);
}
if (Key.isDown(32)) {
thrust();
} else if (Key.isDown(game.getKey("THROW"))) {
var _local3 = (Math.atan(((_root._xmouse - x) - game.getScreenX()) / (_root._ymouse - y)) * 180) / Math.PI;
if (currentDirection == 1) {
if (_root._ymouse >= y) {
_local3 = 90 - _local3;
} else {
_local3 = -90 - _local3;
}
} else if (_root._ymouse >= y) {
_local3 = 90 + _local3;
} else {
_local3 = _local3 - 90;
}
throwSpear(_local3);
}
} else if (Key.isDown(32)) {
thrust();
}
}
function clearStatus() {
unblock();
isThrowing = false;
isThrusting = false;
}
function isHitPeriod() {
return((((game.getGameTime() - lastThrust) <= MIN_THRUST_TIME) && ((game.getGameTime() - lastThrust) >= MIN_HIT_TIME)) && (!hasDamaged));
}
function thrustHasHit(man) {
if (Math.abs(man.y - y) > 30) {
return(false);
}
if (((currentDirection * (man.getX() - x)) > (getSPARTAN_RANGE() * 1.1)) || ((currentDirection * (man.getX() - x)) <= 0)) {
return(false);
}
return(true);
}
function thrust() {
if ((game.getGameTime() - lastThrust) >= ((MIN_THRUST_TIME + MIN_WAIT_TIME) - 100)) {
isThrusting = true;
isThrowing = false;
lastThrust = game.getGameTime();
hasDamaged = false;
damageTime = game.getGameTime();
spartanThrust = "thrust";
if (Math.random() < 0.3) {
spartanThrust = "thrust2";
}
}
return(false);
}
function isAttacking() {
return(isThrusting);
}
function unblock() {
isBlocking = false;
maxVelocityModifier = 1;
}
function block() {
if (!isBlocking) {
blockTime = game.getGameTime();
}
isBlocking = true;
maxVelocityModifier = WALK_MODIFIER;
}
function damage(amount, direction, type) {
if ((isBlocking && (!isThrusting)) && (direction != currentDirection)) {
var _local5 = squad.getTechnology().getSpartanBlockChance();
if (type == "sword") {
_local5 = _local5 / 3;
}
if (Math.random() < _local5) {
super.damage(amount, direction, type);
// unexpected jump
}
var _local4 = (((amount * amount) / MASS) * direction) * DAMAGE_MOMENTOM_CONSTANT;
if ((type == "arrow") || (type == "arrow_headshot")) {
game.getSoundManager().playSound("arrowHitMetal", x);
_local4 = 0;
}
if (type == "wizard") {
inShock = true;
shockTime = game.getGameTime();
}
if (type == "giant") {
clearStatus();
inShock = true;
shockTime = game.getGameTime();
setDy((_local4 * (1 - (Math.random() * 2))) * 70);
_local4 = _local4 * 31;
}
setDx(_local4);
return(false);
} else {
super.damage(amount, direction, type);
}
return(true);
}
function getHasDamaged() {
return(hasDamaged);
}
function getisThrusting() {
return(isThrusting);
}
function getSPARTAN_RANGE() {
if (hasThrown) {
return(SPARTAN_RANGE);
}
return(SPARTAN_RANGE * 1.5);
}
function shouldAttack() {
return(true);
}
function faceDirection(num) {
if (getisThrusting()) {
return(undefined);
}
super.faceDirection(num);
}
function throwSpear(throwAngle) {
if ((throwAngle < -90) && (throwAngle >= -180)) {
throwAngle = -90;
} else if ((throwAngle > 90) && (throwAngle <= 180)) {
throwAngle = 90;
}
if ((!hasThrown) && (!isThrowing)) {
throwTime = game.getGameTime();
this.throwAngle = throwAngle;
isThrusting = false;
isThrowing = true;
}
}
function isThrown() {
if (squad.getTechnology().getIsNotSpartan()) {
return(true);
}
return(hasThrown);
}
function heal() {
hasThrown = false;
isThrowing = false;
isThrusting = false;
isBlocking = false;
}
var type = 4;
var MAX_VELOCITY = 3.5;
var MAX_ACCELERATION = 0.4;
var SPARTAN_RANGE = 50;
var MIN_THRUST_TIME = 900;
var MIN_WAIT_TIME = 0;
var MIN_HIT_TIME = 350;
var MAX_HEALTH = 600;
var HIT_WIDTH = 16;
var WALK_MODIFIER = 0.25;
var SPEAR_THROW_TIME = 3666.66666666667;
}
Symbol 2522 MovieClip [__Packages.GoldMineManager] Frame 0
class GoldMineManager
{
var game, mines, mineIndex, mineBaseDepth, MAX_MINES, MINE_DISTANCE;
function GoldMineManager (game) {
this.game = game;
mines = [];
mineIndex = 0;
mineBaseDepth = 5000;
MAX_MINES = 10;
MINE_DISTANCE = 40;
}
function addCloseMines() {
var _local3 = 150 + (Math.random() * 30);
var _local2 = game.getTOP() + (Math.random() * (game.getBOTTOM() - game.getTOP()));
addMine(_local3, _local2, AMOUNT_IN_MINE + (MINE_RANDOMNES * Math.random()));
addMine(_local3 + 300, _local2, AMOUNT_IN_MINE + (MINE_RANDOMNES * Math.random()));
_local3 = (game.getRIGHT() - 150) - (Math.random() * 30);
_local2 = game.getTOP() + (Math.random() * (game.getBOTTOM() - game.getTOP()));
addMine(_local3, _local2, AMOUNT_IN_MINE + (MINE_RANDOMNES * Math.random()));
addMine(_local3 - 300, _local2, AMOUNT_IN_MINE + (MINE_RANDOMNES * Math.random()));
}
function addMiddleMine() {
var _local3 = (((game.getRIGHT() - game.getLEFT()) / 2) - 100) + (200 * Math.random());
var _local2 = game.getTOP() + (Math.random() * (game.getBOTTOM() - game.getTOP()));
addMine(_local3, _local2, AMOUNT_IN_MINE + (MINE_RANDOMNES * Math.random()));
}
function addMine(x, y, amount) {
mineIndex = mineIndex % MAX_MINES;
var _local2 = "mine_" + mineIndex;
game.screen.attachMovie("gold", _local2, mineBaseDepth + mineIndex);
game.screen[_local2]._x = x;
game.screen[_local2]._y = y;
game.screen[_local2]._alpha = 0;
game.screen[_local2].name = _local2;
game.screen[_local2].cacheAsBitmap = true;
game.screen[_local2].swapDepths((game.getManBaseDepth() + (game.screen[_local2]._y * game.getScreenWidth())) + game.screen[_local2]._x);
mines.push({clip:game.screen[_local2], goldRemaining:amount});
mineIndex++;
}
function update() {
var _local2;
var _local3;
for (_local2 in mines) {
if (mines[_local2].goldRemaining <= 0) {
removeMovieClip(mines[_local2].clip);
mines.splice(_local2, 1);
addMiddleMine();
} else if (mines[_local2].clip._alpha <= 100) {
mines[_local2].clip._alpha = mines[_local2].clip._alpha + 5;
}
_local3 = (AMOUNT_IN_MINE / 2) + (((mines[_local2].goldRemaining / AMOUNT_IN_MINE) * AMOUNT_IN_MINE) / 2);
mines[_local2].clip._yscale = (_local3 / AMOUNT_IN_MINE) * 100;
mines[_local2].clip._xscale = (_local3 / AMOUNT_IN_MINE) * 100;
}
}
function distance(a, b) {
return(((a._x - b._x) * (a._x - b._x)) + Math.abs((a._y - b._y) * (a._y - b._y)));
}
function getClosestMine(man) {
var _local2;
var _local3;
var _local5;
var _local4 = 9999999 /* 0x98967F */;
for (_local2 in mines) {
_local3 = distance(man.getClip(), mines[_local2].clip);
if (_local3 < _local4) {
_local4 = _local3;
_local5 = mines[_local2];
}
}
return(_local5);
}
function closeToMine(man) {
var _local2;
for (_local2 in mines) {
if ((Math.abs(man.getClip()._x - mines[_local2].clip._x) < MINE_DISTANCE) && (Math.abs(man.getClip()._y - mines[_local2].clip._y) < 20)) {
return(mines[_local2]);
}
}
return(undefined);
}
function getMINE_DISTANCE() {
return(MINE_DISTANCE);
}
var AMOUNT_IN_MINE = 1450;
var MINE_RANDOMNES = 300;
}
Symbol 2523 MovieClip [__Packages.ProjectileManager] Frame 0
class ProjectileManager
{
var game, arrows, deadArrows, arrayIndex, lastCollection;
function ProjectileManager (game) {
this.game = game;
arrows = [];
deadArrows = [];
arrayIndex = 0;
lastCollection = getTimer();
}
function update() {
updateArrows();
}
function updateArrows() {
var _local2;
var _local4;
var _local8;
var _local3;
for (_local2 in arrows) {
if (game.getSquad1().getCastleHitArea().hitTest(arrows[_local2].clip) && (arrows[_local2].team == "red")) {
arrows[_local2].state = 2;
arrows[_local2].hitTime = getTimer();
game.getSquad1().damageCastle(arrows[_local2].damage / 5);
} else if (game.getSquad2().getCastleHitArea().hitTest(arrows[_local2].clip) && (arrows[_local2].team == "blue")) {
arrows[_local2].state = 2;
arrows[_local2].hitTime = getTimer();
game.getSquad2().damageCastle(arrows[_local2].damage / 5);
} else if (arrows[_local2].state == 0) {
_local3 = game.getPartitionManager().getLabeledTeam(arrows[_local2].team, arrows[_local2].clip._x);
for (_local4 in _local3) {
if (Math.abs(_local3[_local4].getClip()._y - arrows[_local2].initY) < HIT_WIDTH) {
if ((_local3[_local4].getSquad().getTeamName() != arrows[_local2].team) && (arrows[_local2].clip.hitTest(_local3[_local4].getClip()))) {
var _local5 = false;
var _local6 = _local3[_local4].getClip()._y - _local3[_local4].getClip()._height;
var _local7 = (10 * arrows[_local2].man.getScale()) / 100;
if ((arrows[_local2].clip._y > _local6) && (arrows[_local2].clip._y < (_local6 + _local7))) {
_local5 = _local3[_local4].damage(arrows[_local2].damage * 7, arrows[_local2].dx / Math.abs(arrows[_local2].dx), "arrow_headshot");
if (_local3[_local4].getHealth() <= 0) {
if (arrows[_local2].clip._xscale > 0) {
_local3[_local4].faceDirection(1);
} else {
_local3[_local4].faceDirection(-1);
}
}
} else {
_local5 = _local3[_local4].damage(arrows[_local2].damage, arrows[_local2].dx / Math.abs(arrows[_local2].dx), "arrow");
}
if (_local5) {
game.getBloodManager().addSplatter(_local3[_local4].clip._x, arrows[_local2].clip._y, _local3[_local4].getScale(), _local3[_local4].getCurrentDirection());
}
arrows[_local2].state = 2;
arrows[_local2].hitTime = getTimer();
break;
}
}
}
}
if (arrows[_local2].state == 0) {
if (arrows[_local2].clip._y >= (arrows[_local2].initY + (Math.random() * 5))) {
if (arrows[_local2].clip.arrow._currentframe == 4) {
game.getBloodManager().addSpark(arrows[_local2].clip._x, arrows[_local2].clip._y, (arrows[_local2].clip._y * arrows[_local2].clip._y) / baseScale, 1);
}
arrows[_local2].clip._xscale = (arrows[_local2].scale * 3) / 4;
arrows[_local2].state = 1;
arrows[_local2].hitTime = getTimer();
game.getSoundManager().playSound("arrowHitDirt", arrows[_local2].clip._x);
} else {
arrows[_local2].clip._x = arrows[_local2].clip._x + arrows[_local2].dx;
arrows[_local2].clip._y = arrows[_local2].clip._y + arrows[_local2].dy;
if (arrows[_local2].dy < 0) {
_local8 = ((Math.atan(arrows[_local2].dx / (-arrows[_local2].dy)) * 180) / Math.PI) - 90;
} else {
_local8 = ((Math.atan(arrows[_local2].dx / (-arrows[_local2].dy)) * 180) / Math.PI) + 90;
}
arrows[_local2].clip._rotation = _local8;
arrows[_local2].dy = arrows[_local2].dy + GRAVITY;
}
} else if (arrows[_local2].state == 2) {
deadArrows.push(arrows[_local2]);
arrows.splice(_local2, 1);
}
}
if ((getTimer() - lastCollection) > 10000) {
for (_local2 in deadArrows) {
if (deadArrows[_local2].state != 2) {
deadArrows.splice(_local2, 1);
} else if ((deadArrows[_local2].state == 2) || ((getTimer() - deadArrows[_local2].hitTime) > 60000)) {
removeMovieClip(deadArrows[_local2].clip);
deadArrows.splice(_local2, 1);
}
}
}
}
function addArrow(man, rot, type, power) {
var _local10;
var _local9;
arrayIndex++;
arrayIndex = arrayIndex % 75;
if (isNaN(rot) || (rot == undefined)) {
rot = 0;
}
var _local4 = (ARROW_INIT_VELOCITY * 1.5) * power;
_local10 = _local4 * Math.cos(rot / 57.2957795130823);
_local9 = _local4 * Math.sin(rot / 57.2957795130823);
_root.soundManager.playSound("arrowShot", man.getX());
game.screen.attachMovie("arrow", "arrow_" + arrayIndex, baseArrayDepth + arrayIndex, {_x:man.getX(), _y:man.getY() - ((50 * man.getScale()) / 100)});
game.screen["arrow_" + arrayIndex]._xscale = man.getScale();
game.screen["arrow_" + arrayIndex]._yscale = man.getScale();
if (man == game.getCurrentCharacter()) {
type--;
arrows.push({team:man.getSquad().getTeamName(), clip:game.screen["arrow_" + arrayIndex], dx:_local10, dy:_local9, man:man, state:0, initY:man.getY(), hitTime:0, damage:(2 * Math.pow(1.25, type - 1)) * ARROW_DAMAGE});
} else {
arrows.push({team:man.getSquad().getTeamName(), clip:game.screen["arrow_" + arrayIndex], dx:_local10, dy:_local9, man:man, state:0, initY:man.getY(), hitTime:0, damage:Math.pow(1.25, type - 1) * ARROW_DAMAGE});
}
game.screen["arrow_" + arrayIndex].arrow.gotoAndStop(type);
}
function addArrowFail(man, rot, type) {
var _local9;
var _local8;
arrayIndex++;
arrayIndex = arrayIndex % 100;
if (isNaN(rot) || (rot == undefined)) {
rot = 0;
}
_local9 = (ARROW_INIT_VELOCITY / 10) * Math.cos(rot / 57.2957795130823);
_local8 = (ARROW_INIT_VELOCITY / 10) * Math.sin(rot / 57.2957795130823);
_root.soundManager.playSound("arrowShot", man.getX());
game.screen.attachMovie("arrow", "arrow_" + arrayIndex, baseArrayDepth + arrayIndex, {_x:man.getX(), _y:man.getY() - ((50 * man.getScale()) / 100)});
if (man == game.getCurrentCharacter()) {
type--;
}
game.screen["arrow_" + arrayIndex].arrow.gotoAndStop(type);
game.screen["arrow_" + arrayIndex]._xscale = man.getScale();
game.screen["arrow_" + arrayIndex]._yscale = man.getScale();
arrows.push({team:man.getSquad().getTeamName(), clip:game.screen["arrow_" + arrayIndex], dx:_local9, dy:_local8, man:man, state:0, initY:man.getY(), hitTime:0, damage:Math.pow(1.25, type - 1) * ARROW_DAMAGE});
}
function addArrowFromCastle(x, y, rot, type, teamName) {
var _local8;
var _local6;
arrayIndex++;
arrayIndex = arrayIndex % 100;
y = y - 25;
_local8 = ARROW_INIT_VELOCITY * Math.cos(rot / 57.2957795130823);
_local6 = ARROW_INIT_VELOCITY * Math.sin(rot / 57.2957795130823);
_root.soundManager.playSound("arrowShot", x);
game.screen.attachMovie("arrow", "arrow_" + arrayIndex, baseArrayDepth + arrayIndex, {_x:x, _y:y});
game.screen["arrow_" + arrayIndex].arrow.gotoAndStop(type);
y = y + 25;
game.screen["arrow_" + arrayIndex]._xscale = (y * y) / (baseScale / 1.5);
game.screen["arrow_" + arrayIndex]._yscale = (y * y) / (baseScale / 1.5);
arrows.push({team:teamName, clip:game.screen["arrow_" + arrayIndex], dx:_local8, dy:_local6, man:undefined, state:0, initY:y, hitTime:0, damage:Math.pow(1.25, type - 1) * ARROW_DAMAGE});
}
function addSpear(man, rot) {
var _local6;
var _local5;
arrayIndex++;
arrayIndex = arrayIndex % 100;
_local6 = SPEAR_INIT_VELOCITY * Math.cos(rot / 57.2957795130823);
_local5 = SPEAR_INIT_VELOCITY * Math.sin(rot / 57.2957795130823);
game.screen.attachMovie("throwspear", "arrow_" + arrayIndex, baseArrayDepth + arrayIndex, {_x:man.getX(), _y:man.getY() - ((50 * man.getScale()) / 100)});
game.screen["arrow_" + arrayIndex]._xscale = man.getScale();
game.screen["arrow_" + arrayIndex]._yscale = man.getScale();
arrows.push({team:man.getSquad().getTeamName(), clip:game.screen["arrow_" + arrayIndex], dx:_local6, dy:_local5, man:man, state:0, initY:man.getY(), hitTime:0, damage:SPEAR_DAMAGE});
}
var ARROW_INIT_VELOCITY = 14;
var SPEAR_INIT_VELOCITY = 14;
var baseArrayDepth = 6000;
var GRAVITY = 0.3;
var HIT_WIDTH = 10;
var ARROW_DAMAGE = 5;
var SPEAR_DAMAGE = 40;
var baseScale = 2000;
}
Symbol 2524 MovieClip [__Packages.PartitionManager] Frame 0
class PartitionManager
{
var game, allIndex, allPartitions;
function PartitionManager (game) {
this.game = game;
allIndex = {blue:{}, red:{}};
var _local2;
allPartitions = {blue:[], red:[]};
_local2 = 0;
while (_local2 < game.getRIGHT()) {
allPartitions.blue.push([]);
allPartitions.red.push([]);
_local2 = _local2 + PARTITION_SIZE;
}
}
function remove(man) {
var _local3 = allPartitions[man.getSquad().getTeamName()];
var _local5 = allIndex[man.getSquad().getTeamName()];
var _local2 = man.getName();
var _local4 = _local5[_local2];
var _local7 = _local4 - 1;
var _local6 = _local4 + 1;
getEnemyTeam();
delete _local3[_local4][_local2];
if (_local7 >= 0) {
delete _local3[_local7][_local2];
}
if (_local6 < _local3.length) {
delete _local3[_local6][_local2];
}
delete _local5[_local2];
}
function add(man) {
var _local5 = allPartitions[man.getSquad().getTeamName()];
var _local8 = allIndex[man.getSquad().getTeamName()];
var _local3 = man.getName();
var _local4 = int(man.getClip()._x / PARTITION_SIZE);
var _local7 = _local4 - 1;
var _local6 = _local4 + 1;
if (_local7 >= 0) {
_local5[_local7][_local3] = man;
}
_local5[_local4][_local3] = man;
if (_local6 < _local5.length) {
_local5[_local6][_local3] = man;
}
_local8[_local3] = _local4;
}
function update(man) {
var _local5 = allPartitions[man.getSquad().getTeamName()];
var _local4 = allIndex[man.getSquad().getTeamName()];
var _local3 = man.getName();
remove(man);
add(man);
}
function getTeamAround(x, teamName, menArray) {
var _local3 = allPartitions[teamName];
var _local9 = allIndex[teamName];
var _local4 = int(x / PARTITION_SIZE);
var _local7 = _local4 - 1;
var _local6 = _local4 + 1;
var _local2;
if (_local7 >= 0) {
for (_local2 in _local3[_local7]) {
menArray[_local2] = _local3[_local7][_local2];
}
}
for (_local2 in _local3[_local4]) {
for (_local2 in _local3[_local4]) {
menArray[_local2] = _local3[_local4][_local2];
}
}
if (_local6 < _local3.length) {
for (_local2 in _local3[_local6]) {
menArray[_local2] = _local3[_local6][_local2];
}
}
}
function getEnemyTeam(man, x) {
var _local2 = [];
if (man.getSquad().getTeamName() == "blue") {
getTeamAround(x, "red", _local2);
} else {
getTeamAround(x, "blue", _local2);
}
return(_local2);
}
function getLabeledTeam(team, x) {
var _local2 = [];
if (team == "blue") {
getTeamAround(x, "red", _local2);
} else {
getTeamAround(x, "blue", _local2);
}
return(_local2);
}
function getMenAround(x) {
var _local2 = [];
getTeamAround(x, "blue", _local2);
getTeamAround(x, "red", _local2);
return(_local2);
}
var PARTITION_SIZE = 35;
}
Symbol 2525 MovieClip [__Packages.BloodManager] Frame 0
class BloodManager
{
var game, bloodIndex, splatIndex, screenSplatIndex, screenSplatArray, bloodArray;
function BloodManager (game) {
this.game = game;
bloodIndex = 0;
splatIndex = 0;
screenSplatIndex = 0;
screenSplatArray = [];
}
function update() {
for (var _local3 in screenSplatArray) {
var _local2 = screenSplatArray[_local3];
if (_local2._alpha > 0) {
_local2._alpha = _local2._alpha - 2;
} else {
removeMovieClip(_local2);
screenSplatArray.splice(_local3, 1);
}
}
}
function addBlood(x, y, scale, direction) {
bloodIndex = (bloodIndex + 1) % MAX_BLOOD;
var _local2 = "blood_" + bloodIndex;
game.screen.attachMovie("blood", _local2, BLOOD_BASE_DEPTH + bloodIndex);
game.screen[_local2]._x = x;
game.screen[_local2]._y = y;
game.screen[_local2].name = _local2;
game.screen[_local2]._xscale = (scale * direction) * -1;
game.screen[_local2]._yscale = scale;
game.screen[_local2].gotoAndStop(int(Math.random() * NUMBER_OF_BLOODS) + 1);
game.screen[_local2].cacheAsBitmap = true;
bloodArray[bloodIndex] = game.screen[_local2];
}
function addDust(x, y, scale, direction) {
splatIndex = (splatIndex + 1) % MAX_SPLATTER;
var _local2 = "splat_" + splatIndex;
if (game.screen[_local2] != undefined) {
game.screen[_local2].removeMovieClip();
}
game.screen.attachMovie("dustsplat", _local2, (game.getManBaseDepth() + (y * game.getScreenWidth())) + x);
game.screen[_local2]._x = x;
game.screen[_local2]._y = y;
game.screen[_local2].name = _local2;
game.screen[_local2]._xscale = scale * direction;
game.screen[_local2]._yscale = scale;
game.screen[_local2].gotoAndStop(1);
}
function addSplatter(x, y, scale, direction) {
splatIndex = (splatIndex + 1) % MAX_SPLATTER;
var _local2 = "splat_" + splatIndex;
game.screen.attachMovie("bloodsplat", _local2, SPLATTER_BASE_DEPTH + splatIndex);
game.screen[_local2]._x = x;
game.screen[_local2]._y = y;
game.screen[_local2].name = _local2;
game.screen[_local2]._xscale = scale * direction;
game.screen[_local2]._yscale = scale;
game.screen[_local2].gotoAndStop(int(Math.random() * NUMBER_OF_SPLATTERS) + 1);
}
function addSpark(x, y, scale, direction) {
splatIndex = (splatIndex + 1) % MAX_SPLATTER;
var _local2 = "splat_" + splatIndex;
game.screen.attachMovie("footsteps", _local2, SPLATTER_BASE_DEPTH + splatIndex);
game.screen[_local2]._x = x;
game.screen[_local2]._y = y;
game.screen[_local2].name = _local2;
game.screen[_local2]._xscale = (0.7 * scale) * direction;
game.screen[_local2]._yscale = 0.7 * scale;
}
function addScreenSplatter(x, y, scale) {
screenSplatIndex = (screenSplatIndex + 1) % MAX_SCREEN_SPLATTER;
var _local2 = "screensplat_" + screenSplatIndex;
game.canvas.attachMovie("screensplat", _local2, SCREEN_SPLATTER_BASE_DEPTH + screenSplatIndex);
game.canvas[_local2]._x = x;
game.canvas[_local2]._y = y;
game.canvas[_local2].name = _local2;
game.canvas[_local2]._xscale = game.canvas[_local2]._xscale * scale;
game.canvas[_local2]._yscale = game.canvas[_local2]._yscale * scale;
game.canvas[_local2].gotoAndStop(int(Math.random() * NUMBER_OF_SCREEN_SPLATTERS) + 1);
screenSplatArray.push(game.canvas[_local2]);
}
var MAX_SPLATTER = 10;
var MAX_SCREEN_SPLATTER = 10;
var MAX_BLOOD = 30;
var BLOOD_BASE_DEPTH = 9000;
var SPLATTER_BASE_DEPTH = 9500;
var SCREEN_SPLATTER_BASE_DEPTH = 9000000;
var NUMBER_OF_BLOODS = 3;
var NUMBER_OF_SPLATTERS = 5;
var NUMBER_OF_SCREEN_SPLATTERS = 2;
}
Symbol 2526 MovieClip [__Packages.Ai] Frame 0
class Ai
{
function Ai () {
}
function init(game, squad) {
}
function update(game, squad) {
}
function createMiners(squad, numMiners) {
if ((squad.getQueueSize() == 0) && (squad.getMenFromGroup(1).length < numMiners)) {
squad.addMinerInQueue();
}
}
function getNumMiners(squad) {
return(squad.getMenFromGroup(1).length);
}
function getSquadMilitary(squad) {
return(squad.getNumberLiving() - getNumMiners(squad));
}
function garrisionIfLosing(squad) {
var _local4 = squad.getEnemyTeam().getForwardMan(-1).getX();
var _local3 = false;
if ((_local4 != undefined) && (Math.abs(_local4 - squad.getCastle()._x) < 180)) {
_local3 = true;
}
if ((((getSquadMilitary(squad) == 0) && (getSquadMilitary(squad.getEnemyTeam()) != 0)) && (squad.getEnemyTeam().getMode() == ATTACK)) && (Math.abs(_local4 - squad.getCastle()._x) < 1000)) {
_local3 = true;
squad.setMode(GARRISON);
return(true);
}
if (squad.getCastleHealth() < (squad.getTechnology().getCastleHealth() / 3)) {
_local3 = false;
}
if ((getSquadMilitary(squad) < (getSquadMilitary(squad.getEnemyTeam()) / 3)) && (_local3)) {
squad.setMode(GARRISON);
return(true);
}
return(false);
}
var GARRISON = 1;
var DEFEND = 2;
var ATTACK = 3;
}
Symbol 2527 MovieClip [__Packages.Campaign] Frame 0
class Campaign
{
var technology, level, gold, isGlow, times;
function Campaign () {
technology = new TechnologyManager(false, 5000, 1);
technology.setMinerEnabled(true);
technology.setSwordmanEnabled(true);
level = 1;
gold = 2 * (level - 1);
isGlow = true;
times = [];
var _local2 = 0;
while (_local2 < 13) {
times.push(0);
_local2++;
}
}
function setGlowQuality(n) {
glowQuality = n;
}
function getGlowQuality() {
return(glowQuality);
}
function getGold() {
return(gold);
}
function setGold(g) {
gold = g;
}
function getLevel() {
return(level);
}
function getTime(n) {
return(times[n]);
}
function getTotalTime() {
var _local3 = 0;
var _local2 = 1;
while (_local2 < 13) {
_local3 = _local3 + times[_local2];
_local2++;
}
return(_local3);
}
function setLevelTime(time) {
times[level] = time;
}
function levelUp() {
level++;
gold = gold + 2;
if (level == 1) {
technology.setSwordmanEnabled(true);
} else if (level == 2) {
technology.setArcherEnabled(true);
} else if (level == 4) {
technology.setIsNotClubman(true);
} else if (level == 5) {
technology.setSpartanEnabled(true);
} else if (level == 7) {
technology.setWizardEnabled(true);
} else if (level == 10) {
technology.setGiantEnabled(true);
}
}
function loadLevel() {
technology.gold = 500;
if (level == 0) {
technology.gold = 250;
loadLevel0();
} else if (level == 1) {
technology.gold = 250;
loadLevel1();
} else if (level == 2) {
loadLevel2();
} else if (level == 3) {
loadLevel3();
} else if (level == 4) {
loadLevel4();
} else if (level == 5) {
loadLevel5();
} else if (level == 6) {
loadLevel6();
} else if (level == 7) {
loadLevel7();
} else if (level == 8) {
loadLevel8();
} else if (level == 9) {
loadLevel9();
} else if (level == 10) {
loadLevel10();
} else if (level == 11) {
loadLevel11();
} else if (level == 12) {
loadLevel12();
} else {
loadLevel5();
}
}
function loadLevel0() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.statue = 0;
var _local4 = new AiLevel0();
var _local5 = new Game(0, _root.canvas, 600, 400, 1, 0, _local3, technology, _local4, 1, 2, 1);
_root.game = _local5;
_root.gotoAndPlay("game");
}
function loadLevel1() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setCastleArcherNumber(3);
_local3.setMinerPickaxe(2);
_local3.statue = 5;
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local5 = new AiLevel1();
var _local4 = new Game(1, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 4, 2, 1);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel2() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setMinerPickaxe(2);
_local3.statue = 1;
_local3.setIsNotSpartan(true);
_local3.setCastleArcherNumber(3);
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local5 = new AiLevel2();
var _local4 = new Game(2, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 3, 4, 4);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel3() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setMinerPickaxe(2);
_local3.statue = 3;
_local3.setCastleArcherNumber(1);
_local3.setSwordmanSword(3);
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local5 = new AiLevel3();
var _local4 = new Game(3, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 5, 6, 5);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel4() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setMinerPickaxe(2);
_local3.statue = 4;
_local3.setCastleArcherNumber(1);
if (difficultyLevel == 3) {
_local3.setSpartanHelmet(4);
_local3.setSpartanShield(4);
} else {
_local3.setSpartanHelmet(2);
_local3.setSpartanShield(2);
}
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local5 = new AiLevel4();
var _local4 = new Game(4, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 3, 5, 2);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel5() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setMinerPickaxe(2);
_local3.setSwordmanSword(3);
_local3.statue = 0;
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local5 = new AiLevel5();
var _local4 = new Game(5, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 3, 8, 4);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel6() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setCastleHealth(2);
_local3.setMinerPickaxe(3);
_local3.setCastleArcherNumber(1);
_local3.setCastleHealth(2);
_local3.setWizardHealing(2);
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
_local3.statue = 10;
var _local5 = new AiLevel6();
var _local4 = new Game(5, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 5, 3, 3);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel7() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setCastleHealth(2);
_local3.setMinerPickaxe(3);
_local3.statue = 9;
_local3.setSwordmanSword(3);
_local3.setCastleArcherNumber(2);
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local5 = new AiLevel7();
var _local4 = new Game(5, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 7, 5, 2);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel8() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setCastleHealth(2);
_local3.setMinerPickaxe(3);
_local3.setSpartanHelmet(3);
_local3.setSpartanShield(1);
_local3.setArcherDamage(1);
_local3.setCastleArcherNumber(2);
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
_local3.statue = 4;
var _local5 = new AiLevel8();
var _local4 = new Game(5, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 4, 8, 7);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel9() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setMinerPickaxe(3);
_local3.setCastleHealth(3);
var _local5 = new AiLevel9();
_local3.statue = 8;
_local3.setCastleArcherNumber(1);
_local3.setGiantStrength(2);
_local3.setGiantClub(3);
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local4 = new Game(5, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 7, 9, 8);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel10() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setCastleHealth(3);
_local3.setMinerPickaxe(4);
var _local5 = new AiLevel10();
_local3.statue = 0;
_local3.setCastleArcherNumber(2);
if (difficultyLevel == 3) {
_local3.setGiantStrength(2);
_local3.setGiantClub(3);
_local3.setSwordmanSword(3);
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local4 = new Game(5, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 3, 4, 4);
_root.game = _local4;
_local3.statue = 0;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel11() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setCastleHealth(2);
_local3.setMinerPickaxe(4);
_local3.setSwordmanSword(3);
_local3.setSpartanShield(3);
_local3.setWizardHealing(3);
_local3.statue = 9;
var _local5 = new AiLevel11();
_local3.setCastleArcherNumber(3);
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local4 = new Game(5, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 5, 10, 9);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadLevel12() {
_root.createEmptyMovieClip("canvas", 1);
var _local3 = new TechnologyManager(true, 500, difficultyLevel);
_local3.setCastleHealth(2);
_local3.setMinerPickaxe(4);
_local3.setSwordmanSword(3);
_local3.setSpartanShield(3);
_local3.setWizardHealing(3);
_local3.statue = 11;
var _local5 = new AiLevel12();
_local3.setCastleArcherNumber(3);
if (difficultyLevel == 3) {
_local3.setArcherDamage(4);
_local3.setCastleArcherNumber(4);
}
var _local4 = new Game(5, _root.canvas, 600, 400, 1, 0, _local3, technology, _local5, 6, 7, 6);
_root.game = _local4;
_local4.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
function loadTesting() {
_root.createEmptyMovieClip("canvas", 1);
var _local4 = new TechnologyManager(true, 500, difficultyLevel);
var _local5 = new AiLevel6();
var _local3 = new Game(1, _root.canvas, 600, 400, 1, 0, _local4, new TechnologyManager(true, 4000), _local5, 5, 6, 5);
_root.game = _local3;
_local3.getSquad1().addMiner();
_root.gotoAndPlay("game");
}
var difficultyLevel = 1;
var glowQuality = 1;
}
Symbol 2528 MovieClip [__Packages.AiLevel0] Frame 0
class AiLevel0 extends Ai
{
var lastTime, messageState;
function AiLevel0 () {
super();
lastTime = getTimer();
messageState = 1;
}
function init(game, squad) {
}
function update(game, squad) {
_root.game.screen.leftStatue._visible = false;
_root.game.screen.rightCastle._visible = false;
_root.game.screen.leftCastle._visible = false;
_root.HUD.attackDefenceMenu.gotoAndStop(4);
if ((messageState == 4) && (_root.game.squad1.getTeamsGold() > 700)) {
_root.tips.removeMovieClip();
messageState = 5;
} else if ((messageState == 3) && (_root.game.squad1.getTeamsGold() > 400)) {
_root.tips.gotoAndStop(4);
messageState = 4;
} else if ((messageState == 2) && (game.getCurrentCharacter() != undefined)) {
_root.tips.gotoAndStop(3);
messageState = 3;
} else if ((messageState == 1) && (squad.getEnemyTeam().getMenFromGroup(1).length > 0)) {
_root.tips.gotoAndStop(2);
messageState = 2;
}
if (_root.game.squad1.getTeamsGold() >= 800) {
_root.game.finishLevel();
}
}
}
Symbol 2529 MovieClip [__Packages.AiLevel1] Frame 0
class AiLevel1 extends Ai
{
var messageState, hasShownAttackTip, hasRemovedTipTime, hasShownSlowHelp, noHelp, lastTime, attackTipTime, ATTACK, createMiners, garrisionIfLosing, getSquadMilitary;
function AiLevel1 () {
super();
messageState = 0;
hasShownAttackTip = false;
hasRemovedTipTime = false;
hasShownSlowHelp = false;
noHelp = false;
}
function init(game, squad) {
lastTime = 0;
attackTipTime = game.getGameTime();
}
function update(game, squad) {
if (messageState == 0) {
_root.HUD.swordmanButton._visible = false;
_root.HUD.attackDefenceMenu._visible = false;
}
if ((messageState == 0) && (game.getGameTime() > 1000)) {
_root.attachMovie("tips1", "tips", 10000000);
_root.HUD.swordmanButton._visible = false;
_root.HUD.attackDefenceMenu._visible = false;
messageState = 1;
} else if ((messageState == 1) && (squad.getEnemyTeam().getMenFromGroup(1).length >= 2)) {
messageState = 2;
_root.tips.gotoAndStop(messageState);
} else if ((messageState == 2) && (game.getCurrentCharacter() != undefined)) {
messageState = 3;
lastTime = getTimer();
_root.tips.gotoAndStop(messageState);
} else if ((messageState == 3) && ((getTimer() - lastTime) > 10000)) {
messageState = 5;
_root.tips.gotoAndStop(messageState);
lastTime = getTimer();
} else if ((messageState == 4) && ((getTimer() - lastTime) > 4000)) {
messageState = 5;
_root.tips.gotoAndStop(messageState);
} else if ((messageState == 5) && (game.getCurrentCharacter() == undefined)) {
messageState = 6;
squad.getEnemyTeam().giveGold(500);
_root.HUD.swordmanButton._visible = true;
_root.tips.gotoAndStop(messageState);
} else if ((messageState == 6) && (squad.getEnemyTeam().getMenFromGroup(3).length >= 2)) {
messageState = 7;
_root.HUD.attackDefenceMenu._visible = true;
_root.tips.gotoAndStop(messageState);
} else if ((messageState == 7) && (squad.getEnemyTeam().getMode() == ATTACK)) {
messageState = 8;
lastTime = game.getGameTime();
_root.tips.gotoAndStop(messageState);
} else if ((messageState == 8) && (game.getScreenX() != 0)) {
messageState = 9;
lastTime = game.getGameTime();
squad.addArcher();
_root.tips.removeMovieClip();
} else if (messageState == 12) {
noHelp = true;
_root.HUD.attackDefenceMenu._visible = true;
_root.HUD.swordmanButton._visible = true;
messageState = 9;
lastTime = game.getGameTime();
squad.addArcher();
squad.getEnemyTeam().giveGold(500);
_root.tips.removeMovieClip();
}
if (noHelp == false) {
if (((messageState == 9) && (game.getScreenX() < -1200)) && ((!hasShownAttackTip) || ((game.getGameTime() - attackTipTime) < 4000))) {
game.setScreenX(-1450);
if (!hasShownAttackTip) {
_root.attachMovie("tips7", "tips", 10000000);
attackTipTime = game.getGameTime();
hasShownAttackTip = true;
}
}
if (((!hasRemovedTipTime) && (hasShownAttackTip)) && ((game.getGameTime() - attackTipTime) > 4000)) {
_root.tips.removeMovieClip();
game.setScreenX(-1200);
hasRemovedTipTime = true;
}
if (((((!hasShownSlowHelp) && (hasRemovedTipTime)) && (messageState == 9)) && (hasShownAttackTip)) && ((game.getGameTime() - attackTipTime) > 10000)) {
_root.attachMovie("tips8", "tips", 10000000);
hasShownSlowHelp = true;
}
if (hasShownSlowHelp && ((game.getGameTime() - attackTipTime) > 17000)) {
if (_root.tips != undefined) {
_root.tips.removeMovieClip();
}
}
}
createMiners(squad, 3);
if (messageState != 9) {
_root.game.setScreenX(0);
} else {
if (garrisionIfLosing(squad)) {
} else {
squad.setMode(ATTACK);
}
if ((game.getGameTime() - lastTime) > 20000) {
if (_root.campaignData.difficultyLevel == 3) {
squad.addArcherInQueue();
}
while (getSquadMilitary(squad) == 0) {
squad.addArcher();
}
lastTime = game.getGameTime();
}
}
}
}
Symbol 2530 MovieClip [__Packages.AiLevel2] Frame 0
class AiLevel2 extends Ai
{
var messageState, lastTime, waveNum, ATTACK;
function AiLevel2 () {
super();
messageState = 0;
}
function init(game, squad) {
isDone = false;
lastTime = 0;
game.background.sun._y = startPos;
var _local3 = 0;
while (_local3 < 1) {
squad.addSpartan();
_local3++;
}
_local3 = 0;
while (_local3 < 2) {
squad.getEnemyTeam().addMiner();
_local3++;
}
_root.soundManager.playBackgroundMusic("fieldOfMemories");
waveNum = 0;
squad.getCastleHitArea()._x = squad.getCastleHitArea()._x + 1000;
}
function update(game, squad) {
if ((messageState == 0) && (game.getGameTime() > 3000)) {
_root.attachMovie("tips2", "tips", 10000000);
messageState = 1;
} else if ((messageState == 1) && (game.getGameTime() > 11000)) {
messageState = 2;
_root.tips.removeMovieClip();
}
game.background.sun._y = ((game.getGameTime() / setTime) * (finalPos - startPos)) + startPos;
if ((game.getGameTime() > setTime) && (squad.getNumberLiving() == 0)) {
game.finishLevel();
}
squad.setMode(ATTACK);
if ((squad.getNumberLiving() == 0) && (waveNum < 3)) {
var _local3 = 0;
while (_local3 < (2 + (1 * waveNum))) {
squad.addSpartan();
_local3++;
}
waveNum++;
}
}
var isDone = false;
var finalPos = 250;
var setTime = 120000;
var startPos = 80;
}
Symbol 2531 MovieClip [__Packages.AiLevel3] Frame 0
class AiLevel3 extends Ai
{
var isJustAttack, newBuildPercent, lastStand, messageState, lastTime, lastInjectionTime, createMiners, getSquadMilitary, ATTACK, garrisionIfLosing, DEFEND;
function AiLevel3 () {
super();
isJustAttack = false;
newBuildPercent = Math.random() * 0.75;
lastStand = false;
messageState = 0;
}
function init(game, squad) {
lastTime = 0;
lastInjectionTime = 0;
squad.addSwordMan();
_root.soundManager.playBackgroundMusic("Entering_the_Stronghold");
}
function update(game, squad) {
if ((messageState == 0) && (game.getGameTime() > 3000)) {
_root.attachMovie("tips3", "tips", 10000000);
messageState = 1;
} else if ((messageState == 1) && (game.getGameTime() > 10000)) {
messageState = 2;
_root.tips.removeMovieClip();
}
createMiners(squad, 2);
if ((game.getGameTime() - lastTime) > 30000) {
if (getSquadMilitary(squad) < (getSquadMilitary(squad.getEnemyTeam()) + 1)) {
squad.addSwordManInQueue();
if (_root.campaignData.difficultyLevel == 3) {
squad.addSwordManInQueue();
squad.addSwordManInQueue();
}
}
newBuildPercent = Math.random() * 0.75;
lastTime = game.getGameTime();
}
if (lastStand) {
squad.setMode(ATTACK);
} else if (garrisionIfLosing(squad)) {
} else if (game.getGameTime() < 120000) {
squad.setMode(ATTACK);
isJustAttack = true;
} else if (getSquadMilitary(squad) < (getSquadMilitary(squad.getEnemyTeam()) * newBuildPercent)) {
squad.setMode(DEFEND);
if (isJustAttack) {
isJustAttack = false;
newBuildPercent = 0.5 + (Math.random() * 0.5);
}
} else {
isJustAttack = true;
squad.setMode(ATTACK);
}
if ((game.getGameTime() - lastInjectionTime) > 15000) {
var _local4 = 0;
while (_local4 < 4) {
squad.addSwordManInQueue();
_local4++;
}
lastInjectionTime = getTimer();
}
if ((!lastStand) && (squad.getCastleHealth() < (squad.getTechnology().getCastleHealth() / 3))) {
var _local4 = 0;
while (_local4 < 3) {
squad.addSwordMan();
_local4++;
}
squad.addMiner();
squad.addMiner();
lastStand = true;
}
}
}
Symbol 2532 MovieClip [__Packages.AiLevel4] Frame 0
class AiLevel4 extends Ai
{
var isJustAttack, newBuildPercent, lastStand, lastTime, lastInjectionTime, messageState, createMiners, getSquadMilitary, getNumMiners, ATTACK, DEFEND, garrisionIfLosing;
function AiLevel4 () {
super();
}
function AiLevel3() {
isJustAttack = false;
newBuildPercent = 0.5 + (Math.random() * 0.5);
lastStand = false;
}
function init(game, squad) {
lastTime = -20000;
lastInjectionTime = 0;
squad.addSpartan();
messageState = 0;
}
function update(game, squad) {
if ((messageState == 0) && (game.getGameTime() > 2000)) {
messageState = 1;
} else if ((messageState == 1) && (game.getGameTime() > 10000)) {
messageState = 2;
}
createMiners(squad, 3);
if ((game.getGameTime() - lastTime) > 20000) {
if (getSquadMilitary(squad) < 3) {
squad.addSpartanInQueue();
}
newBuildPercent = 0.5 + (Math.random() * 0.5);
lastTime = game.getGameTime();
}
if ((getSquadMilitary(squad) <= (0.2 * getSquadMilitary(squad.getEnemyTeam()))) && (getNumMiners(squad) >= 3)) {
}
if (lastStand) {
squad.setMode(ATTACK);
} else if (game.getGameTime() < 20000) {
squad.setMode(DEFEND);
} else if (garrisionIfLosing(squad)) {
} else if (game.getGameTime() < 60) {
squad.setMode(ATTACK);
isJustAttack = true;
} else if (getSquadMilitary(squad) < (getSquadMilitary(squad.getEnemyTeam()) * newBuildPercent)) {
squad.setMode(DEFEND);
if (isJustAttack) {
isJustAttack = false;
newBuildPercent = 0.5 + (Math.random() * 0.5);
}
} else {
isJustAttack = true;
squad.setMode(ATTACK);
}
if ((game.getGameTime() - lastInjectionTime) > 120000) {
var _local3 = 0;
while (_local3 < 3) {
_local3++;
}
lastInjectionTime = getTimer();
}
if ((!lastStand) && (squad.getCastleHealth() < (squad.getTechnology().getCastleHealth() / 3))) {
var _local3 = 0;
while (_local3 < 2) {
squad.addSpartan();
_local3++;
}
squad.addMiner();
squad.addMiner();
lastStand = true;
}
}
}
Symbol 2533 MovieClip [__Packages.AiLevel5] Frame 0
class AiLevel5 extends Ai
{
var messageState, lastTime, count, ATTACK, getSquadMilitary;
function AiLevel5 () {
super();
messageState = 0;
}
function init(game, squad) {
isDone = false;
lastTime = 0;
game.background.sun._y = startPos;
var _local3 = 0;
while (_local3 < 8) {
squad.addSwordMan();
_local3++;
}
count = 0;
_root.soundManager.playBackgroundMusic("fieldOfMemories");
squad.getCastleHitArea()._x = squad.getCastleHitArea()._x + 1000;
}
function update(game, squad) {
if ((messageState == 0) && (game.getGameTime() > 3000)) {
_root.attachMovie("tips5", "tips", 10000000);
messageState = 1;
} else if ((messageState == 1) && (game.getGameTime() > 11000)) {
messageState = 2;
_root.tips.removeMovieClip();
}
game.background.sun._y = ((game.getGameTime() / setTime) * (finalPos - startPos)) + startPos;
if ((!isDone) && (game.getGameTime() > setTime)) {
isDone = true;
}
if (game.getGameTime() > setTime) {
squad.setMode(ATTACK);
}
while ((count < 15) && (getSquadMilitary(squad) < 8)) {
squad.addSwordMan();
count++;
}
if ((squad.getNumberLiving() == 0) && (game.getGameTime() > setTime)) {
game.finishLevel();
}
}
var isDone = false;
var finalPos = 195;
var setTime = 120000;
var startPos = 120;
}
Symbol 2534 MovieClip [__Packages.AiLevel6] Frame 0
class AiLevel6 extends Ai
{
var isJustAttack, newBuildPercent, lastStand, hasInitial, messageState, lastTime, lastInjectionTime, createMiners, ATTACK, garrisionIfLosing, getSquadMilitary, DEFEND;
function AiLevel6 () {
super();
isJustAttack = false;
newBuildPercent = Math.random() * 0.75;
lastStand = false;
hasInitial = false;
messageState = 0;
}
function init(game, squad) {
lastTime = 0;
lastInjectionTime = 0;
_root.soundManager.playBackgroundMusic("Entering_the_Stronghold");
}
function update(game, squad) {
if ((messageState == 0) && (game.getGameTime() > 1000)) {
_root.attachMovie("tips6", "tips", 10000000);
messageState = 1;
} else if ((messageState == 1) && (game.getGameTime() > 10000)) {
messageState = 2;
_root.tips.removeMovieClip();
}
createMiners(squad, 4);
if ((!hasInitial) && ((game.getGameTime() - lastTime) > 20000)) {
squad.addWizard();
hasInitial = true;
}
if ((game.getGameTime() - lastTime) > 30000) {
newBuildPercent = Math.random() * 0.75;
lastTime = game.getGameTime();
}
if (lastStand) {
squad.setMode(ATTACK);
} else if (garrisionIfLosing(squad)) {
} else if (game.getGameTime() < 120000) {
squad.setMode(ATTACK);
isJustAttack = true;
} else if (getSquadMilitary(squad) < (getSquadMilitary(squad.getEnemyTeam()) * newBuildPercent)) {
squad.setMode(DEFEND);
if (isJustAttack) {
isJustAttack = false;
newBuildPercent = 0.25 + (Math.random() * 0.75);
}
} else {
isJustAttack = true;
squad.setMode(ATTACK);
}
if (((game.getGameTime() - lastInjectionTime) > 70000) && (squad.getMenFromGroup(5).length < 3)) {
squad.addWizard();
lastInjectionTime = getTimer();
}
if ((!lastStand) && (squad.getCastleHealth() < (squad.getTechnology().getCastleHealth() / 3.5))) {
var _local3 = 0;
while (_local3 < 2) {
squad.addWizard();
_local3++;
}
squad.addMiner();
squad.addMiner();
lastStand = true;
}
}
}
Symbol 2535 MovieClip [__Packages.AiLevel7] Frame 0
class AiLevel7 extends Ai
{
var isJustAttack, newBuildPercent, lastStand, lastTime, lastInjectionTime, createMiners, ATTACK, garrisionIfLosing, getSquadMilitary, DEFEND;
function AiLevel7 () {
super();
isJustAttack = false;
newBuildPercent = Math.random() * 0.75;
lastStand = false;
}
function init(game, squad) {
lastTime = 0;
lastInjectionTime = 0;
squad.addSwordMan();
}
function update(game, squad) {
createMiners(squad, 4);
if ((game.getGameTime() - lastTime) > 30000) {
squad.addSwordManInQueue();
squad.addSwordManInQueue();
squad.addSwordManInQueue();
squad.addSwordManInQueue();
if (squad.getMenFromGroup(2).length < 2) {
squad.addArcherInQueue();
}
newBuildPercent = Math.random() * 0.75;
lastTime = game.getGameTime();
}
if (lastStand) {
squad.setMode(ATTACK);
} else if (garrisionIfLosing(squad)) {
} else if (game.getGameTime() < 120000) {
squad.setMode(ATTACK);
isJustAttack = true;
} else if (getSquadMilitary(squad) < (getSquadMilitary(squad.getEnemyTeam()) * newBuildPercent)) {
squad.setMode(DEFEND);
if (isJustAttack) {
isJustAttack = false;
newBuildPercent = Math.random() * 0.75;
}
} else {
isJustAttack = true;
squad.setMode(ATTACK);
}
if ((game.getGameTime() - lastInjectionTime) > 60000) {
if (squad.getMenFromGroup(2).length < 2) {
squad.addArcher();
}
squad.addSwordMan();
lastInjectionTime = getTimer();
}
if ((!lastStand) && (squad.getCastleHealth() < (squad.getTechnology().getCastleHealth() / 2.5))) {
var _local3 = 0;
while (_local3 < 3) {
squad.addSwordMan();
_local3++;
}
_local3 = 0;
while (_local3 < 3) {
squad.addArcher();
_local3++;
}
squad.addMiner();
squad.addMiner();
lastStand = true;
}
}
}
Symbol 2536 MovieClip [__Packages.AiLevel8] Frame 0
class AiLevel8 extends Ai
{
var isJustAttack, newBuildPercent, lastStand, lastTime, lastInjectionTime, createMiners, ATTACK, garrisionIfLosing, DEFEND, getSquadMilitary;
function AiLevel8 () {
super();
isJustAttack = false;
newBuildPercent = 0.5 + (Math.random() * 0.5);
lastStand = false;
}
function init(game, squad) {
lastTime = 0;
lastInjectionTime = 0;
squad.addSpartan();
_root.soundManager.playBackgroundMusic("Entering_the_Stronghold");
}
function update(game, squad) {
createMiners(squad, 5);
if ((game.getGameTime() - lastTime) > 30000) {
squad.addSpartanInQueue();
squad.addSpartanInQueue();
if (squad.getMenFromGroup(2).length < 2) {
squad.addArcherInQueue();
squad.addArcherInQueue();
}
newBuildPercent = Math.random() * 0.75;
lastTime = game.getGameTime();
}
if (lastStand) {
squad.setMode(ATTACK);
} else if (garrisionIfLosing(squad)) {
} else if (game.getGameTime() < 60000) {
squad.setMode(DEFEND);
isJustAttack = true;
} else if (getSquadMilitary(squad) < (getSquadMilitary(squad.getEnemyTeam()) * newBuildPercent)) {
squad.setMode(DEFEND);
if (isJustAttack) {
isJustAttack = false;
newBuildPercent = 0.25 + (Math.random() * 0.75);
}
} else {
isJustAttack = true;
squad.setMode(ATTACK);
}
if (((game.getGameTime() - lastInjectionTime) > 60000) && (squad.getMenFromGroup(6).length < 3)) {
if (getSquadMilitary(squad) < 3) {
if (squad.getMenFromGroup(2).length < 2) {
squad.addArcherInQueue();
}
squad.addSpartan();
}
lastInjectionTime = getTimer();
}
if ((!lastStand) && (squad.getCastleHealth() < (squad.getTechnology().getCastleHealth() / 3))) {
var _local3 = 0;
while (_local3 < 1) {
squad.addSpartan();
_local3++;
}
_local3 = 0;
while (_local3 < 1) {
squad.addArcher();
_local3++;
}
squad.addMiner();
squad.addMiner();
lastStand = true;
}
}
}
Symbol 2537 MovieClip [__Packages.AiLevel9] Frame 0
class AiLevel9 extends Ai
{
var lastTime, lastStand, lastGiantTime, createMiners, ATTACK, garrisionIfLosing;
function AiLevel9 () {
super();
lastTime = 0;
lastStand = false;
}
function init(game, squad) {
lastTime = 0;
lastGiantTime = 0;
squad.addGiant();
}
function update(game, squad) {
if (game.getGameTime() > 60000) {
createMiners(squad, 5);
} else {
createMiners(squad, 3);
}
if (lastStand) {
squad.setMode(ATTACK);
} else if (garrisionIfLosing(squad)) {
} else if (game.getGameTime() < 60000) {
squad.setMode(ATTACK);
} else {
squad.setMode(ATTACK);
}
if (((game.getGameTime() - lastGiantTime) > 70000) && (squad.getMenFromGroup(6).length < 2)) {
squad.addGiant();
lastGiantTime = game.getGameTime();
}
if ((!lastStand) && (squad.getCastleHealth() < (squad.getTechnology().getCastleHealth() / 2.5))) {
squad.addGiant();
lastStand = true;
}
}
}
Symbol 2538 MovieClip [__Packages.AiLevel10] Frame 0
class AiLevel10 extends Ai
{
var lastTime, count, ATTACK, getSquadMilitary;
function AiLevel10 () {
super();
}
function init(game, squad) {
isDone = false;
lastTime = 0;
game.background.sun._y = startPos;
squad.addGiant();
var _local3 = 0;
while (_local3 < 10) {
squad.addSwordMan();
_local3++;
}
count = 0;
_root.soundManager.playBackgroundMusic("fieldOfMemories");
squad.getCastleHitArea()._x = squad.getCastleHitArea()._x + 1000;
}
function update(game, squad) {
game.background.sun._y = ((game.getGameTime() / setTime) * (finalPos - startPos)) + startPos;
if ((!isDone) && (game.getGameTime() > setTime)) {
isDone = true;
}
if (game.getGameTime() > setTime) {
squad.setMode(ATTACK);
}
while ((count < 30) && (getSquadMilitary(squad) < 10)) {
squad.addSwordMan();
count++;
}
if ((squad.getNumberLiving() == 0) && (game.getGameTime() > setTime)) {
game.finishLevel();
}
}
var isDone = false;
var finalPos = 250;
var setTime = 120000;
var startPos = 120;
}
Symbol 2539 MovieClip [__Packages.AiLevel11] Frame 0
class AiLevel11 extends Ai
{
var isJustAttack, newBuildPercent, lastStand, isCreateType, lastCreateTime, lastTime, lastInjectionTime, createMiners, getSquadMilitary, ATTACK, garrisionIfLosing, DEFEND;
function AiLevel11 () {
super();
isJustAttack = false;
newBuildPercent = 0.5 + (Math.random() * 0.5);
lastStand = false;
isCreateType = true;
lastCreateTime = 0;
_root.soundManager.playBackgroundMusic("Entering_the_Stronghold");
}
function init(game, squad) {
lastTime = 0;
lastInjectionTime = 0;
squad.addArcher();
squad.addSwordManInQueue();
squad.addMiner();
squad.addSwordManInQueue();
}
function update(game, squad) {
if ((game.getGameTime() - lastCreateTime) > 120000) {
isCreateType = !isCreateType;
lastCreateTime = game.getGameTime();
if (squad.getMenFromGroup(6).length < 1) {
squad.addGiant();
}
}
createMiners(squad, 6);
if (game.getGameTime() < 60000) {
if (getSquadMilitary(squad) < 1) {
squad.addSwordMan();
}
}
if ((game.getGameTime() - lastTime) > 30000) {
if (isCreateType) {
if (getSquadMilitary(squad) < 5) {
squad.addArcher();
squad.addSwordManInQueue();
squad.addSwordManInQueue();
squad.addSwordManInQueue();
squad.addSwordManInQueue();
}
} else if (_root.campaignData.difficultyLevel == 3) {
if (squad.getMenFromGroup(5).length < 2) {
squad.addWizardInQueue();
}
} else if (squad.getMenFromGroup(5).length < 1) {
squad.addWizardInQueue();
}
newBuildPercent = Math.random() * 0.75;
lastTime = game.getGameTime();
}
if (lastStand) {
squad.setMode(ATTACK);
} else if (garrisionIfLosing(squad)) {
} else if (game.getGameTime() < 30000) {
squad.setMode(ATTACK);
isJustAttack = true;
} else if (getSquadMilitary(squad) < (getSquadMilitary(squad.getEnemyTeam()) * newBuildPercent)) {
squad.setMode(DEFEND);
if (isJustAttack) {
isJustAttack = false;
newBuildPercent = 0.5 + (Math.random() * 0.5);
}
} else {
isJustAttack = true;
squad.setMode(ATTACK);
}
if ((!lastStand) && (squad.getCastleHealth() < (squad.getTechnology().getCastleHealth() / 3))) {
var _local4 = 0;
while (_local4 < 5) {
squad.addSwordMan();
_local4++;
}
_local4 = 0;
while (_local4 < 1) {
squad.addGiant();
_local4++;
}
squad.addMiner();
squad.addMiner();
squad.addMiner();
lastStand = true;
}
}
}
Symbol 2540 MovieClip [__Packages.AiLevel12] Frame 0
class AiLevel12 extends Ai
{
var isJustAttack, newBuildPercent, lastStand, isCreateType, lastCreateTime, lastTime, lastInjectionTime, hasGiant, hasGianted, giant, giantedTime, createMiners, getSquadMilitary, ATTACK, garrisionIfLosing, DEFEND;
function AiLevel12 () {
super();
isJustAttack = false;
newBuildPercent = 0.5 + (Math.random() * 0.5);
lastStand = false;
isCreateType = true;
lastCreateTime = 0;
}
function init(game, squad) {
lastTime = 0;
lastInjectionTime = 0;
squad.addArcher();
squad.addMiner();
squad.addSwordManInQueue();
squad.addSwordManInQueue();
hasGiant = (hasGianted = false);
}
function update(game, squad) {
if ((!hasGianted) && (squad.getCastleHealth() == 0)) {
squad.getCastle().giantStatue.play();
hasGianted = true;
}
if (((!hasGiant) && (hasGianted)) && (squad.getCastle().giantStatue._currentframe == squad.getCastle().giantStatue._totalframes)) {
giant = Giant(squad.addGiant());
giant.setAsSuperGiant();
giant.setX(squad.getCastle()._x - 140);
giant.setY(squad.getCastle()._y - 10);
hasGiant = true;
giantedTime = getTimer();
}
if (hasGiant && ((getTimer() - giantedTime) < 1000)) {
giant.faceDirection(-1);
}
if (hasGiant && (!giant.getIsAlive())) {
game.finishLevel();
}
if ((!hasGiant) && ((game.getGameTime() - lastCreateTime) > 120000)) {
isCreateType = !isCreateType;
lastCreateTime = game.getGameTime();
if (squad.getMenFromGroup(6).length < 2) {
squad.addGiant();
}
}
createMiners(squad, 6);
if (game.getGameTime() < 60000) {
if (getSquadMilitary(squad) < 1) {
squad.addSwordMan();
}
}
if ((!hasGiant) && ((game.getGameTime() - lastTime) > 30000)) {
if (isCreateType) {
if (getSquadMilitary(squad) < 5) {
squad.addArcher();
squad.addSwordManInQueue();
squad.addSwordManInQueue();
squad.addSwordManInQueue();
squad.addSwordManInQueue();
}
} else if (_root.campaignData.difficultyLevel == 3) {
if (squad.getMenFromGroup(5).length < 2) {
squad.addWizardInQueue();
}
} else if (squad.getMenFromGroup(5).length < 1) {
squad.addWizardInQueue();
}
newBuildPercent = Math.random() * 0.75;
lastTime = game.getGameTime();
}
if (lastStand) {
squad.setMode(ATTACK);
} else if (garrisionIfLosing(squad)) {
} else if (game.getGameTime() < 120000) {
squad.setMode(ATTACK);
isJustAttack = true;
} else if (getSquadMilitary(squad) < (getSquadMilitary(squad.getEnemyTeam()) * newBuildPercent)) {
squad.setMode(DEFEND);
if (isJustAttack) {
isJustAttack = false;
newBuildPercent = 0.5 + (Math.random() * 0.5);
}
} else {
isJustAttack = true;
squad.setMode(ATTACK);
}
if (((game.getGameTime() - lastInjectionTime) > 60000) && (squad.getMenFromGroup(6).length < 3)) {
lastInjectionTime = getTimer();
}
if ((!lastStand) && (squad.getCastleHealth() < (squad.getTechnology().getCastleHealth() / 3))) {
var _local4 = 0;
while (_local4 < 2) {
_local4++;
}
_local4 = 0;
while (_local4 < 1) {
_local4++;
}
lastStand = true;
}
}
}
Symbol 2541 MovieClip [__Packages.AiScenario] Frame 0
class AiScenario extends Ai
{
var lastTime, DEFEND, ATTACK;
function AiScenario () {
super();
lastTime = getTimer();
}
function init(game, squad) {
squad.addArcherInQueue();
}
function update(game, squad) {
if (squad.getMen().length < 20) {
squad.setMode(DEFEND);
} else {
squad.setMode(ATTACK);
}
if ((getTimer() - lastTime) > 15000) {
var _local2 = 0;
while (_local2 < 5) {
_local2++;
}
lastTime = getTimer();
}
}
}
Symbol 201 MovieClip [__Packages.mx.core.UIObject] Frame 0
class mx.core.UIObject extends MovieClip
{
var _width, _height, _x, _y, _parent, _minHeight, _minWidth, _visible, dispatchEvent, _xscale, _yscale, methodTable, onEnterFrame, tfList, __width, __height, moveTo, lineTo, createTextField, attachMovie, buildDepthTable, findNextAvailableDepth, idNames, childrenCreated, _name, createAccessibilityImplementation, _endInit, validateNow, hasOwnProperty, initProperties, stylecache, className, ignoreClassStyleDeclaration, _tf, fontFamily, fontSize, color, marginLeft, marginRight, fontStyle, fontWeight, textAlign, textIndent, textDecoration, embedFonts, styleName, enabled;
function UIObject () {
super();
constructObject();
}
function get width() {
return(_width);
}
function get height() {
return(_height);
}
function get left() {
return(_x);
}
function get x() {
return(_x);
}
function get top() {
return(_y);
}
function get y() {
return(_y);
}
function get right() {
return(_parent.width - (_x + width));
}
function get bottom() {
return(_parent.height - (_y + height));
}
function getMinHeight(Void) {
return(_minHeight);
}
function setMinHeight(h) {
_minHeight = h;
}
function get minHeight() {
return(getMinHeight());
}
function set minHeight(h) {
setMinHeight(h);
//return(minHeight);
}
function getMinWidth(Void) {
return(_minWidth);
}
function setMinWidth(w) {
_minWidth = w;
}
function get minWidth() {
return(getMinWidth());
}
function set minWidth(w) {
setMinWidth(w);
//return(minWidth);
}
function setVisible(x, noEvent) {
if (x != _visible) {
_visible = x;
if (noEvent != true) {
dispatchEvent({type:(x ? "reveal" : "hide")});
}
}
}
function get visible() {
return(_visible);
}
function set visible(x) {
setVisible(x, false);
//return(visible);
}
function get scaleX() {
return(_xscale);
}
function set scaleX(x) {
_xscale = x;
//return(scaleX);
}
function get scaleY() {
return(_yscale);
}
function set scaleY(y) {
_yscale = y;
//return(scaleY);
}
function doLater(obj, fn) {
if (methodTable == undefined) {
methodTable = new Array();
}
methodTable.push({obj:obj, fn:fn});
onEnterFrame = doLaterDispatcher;
}
function doLaterDispatcher(Void) {
delete onEnterFrame;
if (invalidateFlag) {
redraw();
}
var _local3 = methodTable;
methodTable = new Array();
if (_local3.length > 0) {
var _local2;
while (_local2 = _local3.shift() , _local2 != undefined) {
_local2.obj[_local2.fn]();
}
}
}
function cancelAllDoLaters(Void) {
delete onEnterFrame;
methodTable = new Array();
}
function invalidate(Void) {
invalidateFlag = true;
onEnterFrame = doLaterDispatcher;
}
function invalidateStyle(Void) {
invalidate();
}
function redraw(bAlways) {
if (invalidateFlag || (bAlways)) {
invalidateFlag = false;
var _local2;
for (_local2 in tfList) {
tfList[_local2].draw();
}
draw();
dispatchEvent({type:"draw"});
}
}
function draw(Void) {
}
function move(x, y, noEvent) {
var _local3 = _x;
var _local2 = _y;
_x = x;
_y = y;
if (noEvent != true) {
dispatchEvent({type:"move", oldX:_local3, oldY:_local2});
}
}
function setSize(w, h, noEvent) {
var _local2 = __width;
var _local3 = __height;
__width = w;
__height = h;
size();
if (noEvent != true) {
dispatchEvent({type:"resize", oldWidth:_local2, oldHeight:_local3});
}
}
function size(Void) {
_width = __width;
_height = __height;
}
function drawRect(x1, y1, x2, y2) {
moveTo(x1, y1);
lineTo(x2, y1);
lineTo(x2, y2);
lineTo(x1, y2);
lineTo(x1, y1);
}
function createLabel(name, depth, text) {
createTextField(name, depth, 0, 0, 0, 0);
var _local2 = this[name];
_local2._color = textColorList;
_local2._visible = false;
_local2.__text = text;
if (tfList == undefined) {
tfList = new Object();
}
tfList[name] = _local2;
_local2.invalidateStyle();
invalidate();
_local2.styleName = this;
return(_local2);
}
function createObject(linkageName, id, depth, initobj) {
return(attachMovie(linkageName, id, depth, initobj));
}
function createClassObject(className, id, depth, initobj) {
var _local3 = className.symbolName == undefined;
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className);
}
var _local4 = createObject(className.symbolOwner.symbolName, id, depth, initobj);
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className.symbolOwner);
}
return(_local4);
}
function createEmptyObject(id, depth) {
return(createClassObject(mx.core.UIObject, id, depth));
}
function destroyObject(id) {
var _local2 = this[id];
if (_local2.getDepth() < 0) {
var _local4 = buildDepthTable();
var _local5 = findNextAvailableDepth(0, _local4, "up");
var _local3 = _local5;
_local2.swapDepths(_local3);
}
_local2.removeMovieClip();
delete this[id];
}
function getSkinIDName(tag) {
return(idNames[tag]);
}
function setSkin(tag, linkageName, initObj) {
if (_global.skinRegistry[linkageName] == undefined) {
mx.skins.SkinElement.registerElement(linkageName, mx.skins.SkinElement);
}
return(createObject(linkageName, getSkinIDName(tag), tag, initObj));
}
function createSkin(tag) {
var _local2 = getSkinIDName(tag);
createEmptyObject(_local2, tag);
return(this[_local2]);
}
function createChildren(Void) {
}
function _createChildren(Void) {
createChildren();
childrenCreated = true;
}
function constructObject(Void) {
if (_name == undefined) {
return(undefined);
}
init();
_createChildren();
createAccessibilityImplementation();
_endInit();
if (validateNow) {
redraw(true);
} else {
invalidate();
}
}
function initFromClipParameters(Void) {
var _local4 = false;
var _local2;
for (_local2 in clipParameters) {
if (hasOwnProperty(_local2)) {
_local4 = true;
this["def_" + _local2] = this[_local2];
delete this[_local2];
}
}
if (_local4) {
for (_local2 in clipParameters) {
var _local3 = this["def_" + _local2];
if (_local3 != undefined) {
this[_local2] = _local3;
}
}
}
}
function init(Void) {
__width = _width;
__height = _height;
if (initProperties == undefined) {
initFromClipParameters();
} else {
initProperties();
}
if (_global.cascadingStyles == true) {
stylecache = new Object();
}
}
function getClassStyleDeclaration(Void) {
var _local4 = this;
var _local3 = className;
while (_local3 != undefined) {
if (ignoreClassStyleDeclaration[_local3] == undefined) {
if (_global.styles[_local3] != undefined) {
return(_global.styles[_local3]);
}
}
_local4 = _local4.__proto__;
_local3 = _local4.className;
}
}
function setColor(color) {
}
function __getTextFormat(tf, bAll) {
var _local8 = stylecache.tf;
if (_local8 != undefined) {
var _local3;
for (_local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
tf[_local3] = _local8[_local3];
}
}
}
return(false);
}
var _local6 = false;
for (var _local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
var _local5 = _tf[_local3];
if (_local5 != undefined) {
tf[_local3] = _local5;
} else if ((_local3 == "font") && (fontFamily != undefined)) {
tf[_local3] = fontFamily;
} else if ((_local3 == "size") && (fontSize != undefined)) {
tf[_local3] = fontSize;
} else if ((_local3 == "color") && (color != undefined)) {
tf[_local3] = color;
} else if ((_local3 == "leftMargin") && (marginLeft != undefined)) {
tf[_local3] = marginLeft;
} else if ((_local3 == "rightMargin") && (marginRight != undefined)) {
tf[_local3] = marginRight;
} else if ((_local3 == "italic") && (fontStyle != undefined)) {
tf[_local3] = fontStyle == _local3;
} else if ((_local3 == "bold") && (fontWeight != undefined)) {
tf[_local3] = fontWeight == _local3;
} else if ((_local3 == "align") && (textAlign != undefined)) {
tf[_local3] = textAlign;
} else if ((_local3 == "indent") && (textIndent != undefined)) {
tf[_local3] = textIndent;
} else if ((_local3 == "underline") && (textDecoration != undefined)) {
tf[_local3] = textDecoration == _local3;
} else if ((_local3 == "embedFonts") && (embedFonts != undefined)) {
tf[_local3] = embedFonts;
} else {
_local6 = true;
}
}
}
}
if (_local6) {
var _local9 = styleName;
if (_local9 != undefined) {
if (typeof(_local9) != "string") {
_local6 = _local9.__getTextFormat(tf, true, this);
} else if (_global.styles[_local9] != undefined) {
_local6 = _global.styles[_local9].__getTextFormat(tf, true, this);
}
}
}
if (_local6) {
var _local10 = getClassStyleDeclaration();
if (_local10 != undefined) {
_local6 = _local10.__getTextFormat(tf, true, this);
}
}
if (_local6) {
if (_global.cascadingStyles) {
if (_parent != undefined) {
_local6 = _parent.__getTextFormat(tf, false);
}
}
}
if (_local6) {
_local6 = _global.style.__getTextFormat(tf, true, this);
}
return(_local6);
}
function _getTextFormat(Void) {
var _local2 = stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
__getTextFormat(_local2, true);
stylecache.tf = _local2;
if (enabled == false) {
var _local3 = getStyle("disabledColor");
_local2.color = _local3;
}
return(_local2);
}
function getStyleName(Void) {
var _local2 = styleName;
if (_local2 != undefined) {
if (typeof(_local2) != "string") {
return(_local2.getStyleName());
}
return(_local2);
}
if (_parent != undefined) {
return(_parent.getStyleName());
}
return(undefined);
}
function getStyle(styleProp) {
var _local3;
_global.getStyleCounter++;
if (this[styleProp] != undefined) {
return(this[styleProp]);
}
var _local6 = styleName;
if (_local6 != undefined) {
if (typeof(_local6) != "string") {
_local3 = _local6.getStyle(styleProp);
} else {
var _local7 = _global.styles[_local6];
_local3 = _local7.getStyle(styleProp);
}
}
if (_local3 != undefined) {
return(_local3);
}
var _local7 = getClassStyleDeclaration();
if (_local7 != undefined) {
_local3 = _local7[styleProp];
}
if (_local3 != undefined) {
return(_local3);
}
if (_global.cascadingStyles) {
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (mx.styles.StyleManager.isColorStyle(styleProp))) {
var _local5 = stylecache;
if (_local5 != undefined) {
if (_local5[styleProp] != undefined) {
return(_local5[styleProp]);
}
}
if (_parent != undefined) {
_local3 = _parent.getStyle(styleProp);
} else {
_local3 = _global.style[styleProp];
}
if (_local5 != undefined) {
_local5[styleProp] = _local3;
}
return(_local3);
}
}
if (_local3 == undefined) {
_local3 = _global.style[styleProp];
}
return(_local3);
}
static function mergeClipParameters(o, p) {
for (var _local3 in p) {
o[_local3] = p[_local3];
}
return(true);
}
static var symbolName = "UIObject";
static var symbolOwner = mx.core.UIObject;
static var version = "2.0.2.127";
static var textColorList = {color:1, disabledColor:1};
var invalidateFlag = false;
var lineWidth = 1;
var lineColor = 0;
var tabEnabled = false;
var clipParameters = {visible:1, minHeight:1, minWidth:1, maxHeight:1, maxWidth:1, preferredHeight:1, preferredWidth:1};
}
Symbol 202 MovieClip [__Packages.mx.core.UIComponent] Frame 0
class mx.core.UIComponent extends mx.core.UIObject
{
var __width, __height, invalidate, stylecache, removeEventListener, dispatchEvent, drawFocus, addEventListener, _xscale, _yscale, _focusrect, watch, enabled;
function UIComponent () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function setVisible(x, noEvent) {
super.setVisible(x, noEvent);
}
function enabledChanged(id, oldValue, newValue) {
setEnabled(newValue);
invalidate();
delete stylecache.tf;
return(newValue);
}
function setEnabled(enabled) {
invalidate();
}
function getFocus() {
var selFocus = Selection.getFocus();
return(((selFocus === null) ? null : (eval (selFocus))));
}
function setFocus() {
Selection.setFocus(this);
}
function getFocusManager() {
var _local2 = this;
while (_local2 != undefined) {
if (_local2.focusManager != undefined) {
return(_local2.focusManager);
}
_local2 = _local2._parent;
}
return(undefined);
}
function onKillFocus(newFocus) {
removeEventListener("keyDown", this);
removeEventListener("keyUp", this);
dispatchEvent({type:"focusOut"});
drawFocus(false);
}
function onSetFocus(oldFocus) {
addEventListener("keyDown", this);
addEventListener("keyUp", this);
dispatchEvent({type:"focusIn"});
if (getFocusManager().bDrawFocus != false) {
drawFocus(true);
}
}
function findFocusInChildren(o) {
if (o.focusTextField != undefined) {
return(o.focusTextField);
}
if (o.tabEnabled == true) {
return(o);
}
return(undefined);
}
function findFocusFromObject(o) {
if (o.tabEnabled != true) {
if (o._parent == undefined) {
return(undefined);
}
if (o._parent.tabEnabled == true) {
o = o._parent;
} else if (o._parent.tabChildren) {
o = findFocusInChildren(o._parent);
} else {
o = findFocusFromObject(o._parent);
}
}
return(o);
}
function pressFocus() {
var _local3 = findFocusFromObject(this);
var _local2 = getFocus();
if (_local3 != _local2) {
_local2.drawFocus(false);
if (getFocusManager().bDrawFocus != false) {
_local3.drawFocus(true);
}
}
}
function releaseFocus() {
var _local2 = findFocusFromObject(this);
if (_local2 != getFocus()) {
_local2.setFocus();
}
}
function isParent(o) {
while (o != undefined) {
if (o == this) {
return(true);
}
o = o._parent;
}
return(false);
}
function size() {
}
function init() {
super.init();
_xscale = 100;
_yscale = 100;
_focusrect = _global.useFocusRect == false;
watch("enabled", enabledChanged);
if (enabled == false) {
setEnabled(false);
}
}
function dispatchValueChangedEvent(value) {
dispatchEvent({type:"valueChanged", value:value});
}
static var symbolName = "UIComponent";
static var symbolOwner = mx.core.UIComponent;
static var version = "2.0.2.127";
static var kStretch = 5000;
var focusEnabled = true;
var tabEnabled = true;
var origBorderStyles = {themeColor:16711680};
var clipParameters = {};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.core.UIComponent.prototype.clipParameters, mx.core.UIObject.prototype.clipParameters);
}
Symbol 203 MovieClip [__Packages.mx.controls.SimpleButton] Frame 0
class mx.controls.SimpleButton extends mx.core.UIComponent
{
static var emphasizedStyleDeclaration;
var preset, boundingBox_mc, useHandCursor, skinName, linkLength, iconName, destroyObject, __width, _width, __height, _height, __emphaticStyleName, styleName, enabled, invalidate, pressFocus, dispatchEvent, autoRepeat, interval, getStyle, releaseFocus, createLabel, invalidateStyle;
function SimpleButton () {
super();
}
function init(Void) {
super.init();
if (preset == undefined) {
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
useHandCursor = false;
}
function createChildren(Void) {
if (preset != undefined) {
var _local2 = this[idNames[preset]];
this[refNames[preset]] = _local2;
skinName = _local2;
if (falseOverSkin.length == 0) {
rolloverSkin = fus;
}
if (falseOverIcon.length == 0) {
rolloverIcon = fui;
}
initializing = false;
} else if (__state == true) {
setStateVar(true);
} else {
if (falseOverSkin.length == 0) {
rolloverSkin = fus;
}
if (falseOverIcon.length == 0) {
rolloverIcon = fui;
}
}
}
function setIcon(tag, linkageName) {
return(setSkin(tag + 8, linkageName));
}
function changeIcon(tag, linkageName) {
linkLength = linkageName.length;
var _local2 = stateNames[tag] + "Icon";
this[_local2] = linkageName;
this[idNames[tag + 8]] = _local2;
setStateVar(getState());
}
function changeSkin(tag, linkageName) {
var _local2 = stateNames[tag] + "Skin";
this[_local2] = linkageName;
this[idNames[tag]] = _local2;
setStateVar(getState());
}
function viewIcon(varName) {
var _local4 = varName + "Icon";
var _local3 = this[_local4];
if (typeof(_local3) == "string") {
var _local5 = _local3;
if (__emphasized) {
if (this[_local3 + "Emphasized"].length > 0) {
_local3 = _local3 + "Emphasized";
}
}
if (this[_local3].length == 0) {
return(undefined);
}
_local3 = setIcon(tagMap[_local5], this[_local3]);
if ((_local3 == undefined) && (_global.isLivePreview)) {
_local3 = setIcon(0, "ButtonIcon");
}
this[_local4] = _local3;
}
iconName._visible = false;
iconName = _local3;
iconName._visible = true;
}
function removeIcons() {
var _local3 = 0;
while (_local3 < 2) {
var _local2 = 8;
while (_local2 < 16) {
destroyObject(idNames[_local2]);
this[stateNames[_local2 - 8] + "Icon"] = "";
_local2++;
}
_local3++;
}
refresh();
}
function setSkin(tag, linkageName, initobj) {
var _local3 = super.setSkin(tag, linkageName, ((initobj != undefined) ? (initobj) : ({styleName:this})));
calcSize(tag, _local3);
return(_local3);
}
function calcSize(Void) {
__width = _width;
__height = _height;
}
function viewSkin(varName, initObj) {
var _local3 = varName + "Skin";
var _local2 = this[_local3];
if (typeof(_local2) == "string") {
var _local4 = _local2;
if (__emphasized) {
if (this[_local2 + "Emphasized"].length > 0) {
_local2 = _local2 + "Emphasized";
}
}
if (this[_local2].length == 0) {
return(undefined);
}
_local2 = setSkin(tagMap[_local4], this[_local2], ((initObj != undefined) ? (initObj) : ({styleName:this})));
this[_local3] = _local2;
}
skinName._visible = false;
skinName = _local2;
skinName._visible = true;
}
function showEmphasized(e) {
if (e && (!__emphatic)) {
if (emphasizedStyleDeclaration != undefined) {
__emphaticStyleName = styleName;
styleName = emphasizedStyleDeclaration;
}
__emphatic = true;
} else {
if (__emphatic) {
styleName = __emphaticStyleName;
}
__emphatic = false;
}
}
function refresh(Void) {
var _local2 = getState();
if (enabled == false) {
viewIcon("disabled");
viewSkin("disabled");
} else {
viewSkin(phase);
viewIcon(phase);
}
setView(phase == "down");
iconName.enabled = enabled;
}
function setView(offset) {
if (iconName == undefined) {
return(undefined);
}
var _local2 = (offset ? (btnOffset) : 0);
iconName._x = ((__width - iconName._width) / 2) + _local2;
iconName._y = ((__height - iconName._height) / 2) + _local2;
}
function setStateVar(state) {
if (state) {
if (trueOverSkin.length == 0) {
rolloverSkin = tus;
} else {
rolloverSkin = trs;
}
if (trueOverIcon.length == 0) {
rolloverIcon = tui;
} else {
rolloverIcon = tri;
}
upSkin = tus;
downSkin = tds;
disabledSkin = dts;
upIcon = tui;
downIcon = tdi;
disabledIcon = dti;
} else {
if (falseOverSkin.length == 0) {
rolloverSkin = fus;
} else {
rolloverSkin = frs;
}
if (falseOverIcon.length == 0) {
rolloverIcon = fui;
} else {
rolloverIcon = fri;
}
upSkin = fus;
downSkin = fds;
disabledSkin = dfs;
upIcon = fui;
downIcon = fdi;
disabledIcon = dfi;
}
__state = state;
}
function setState(state) {
if (state != __state) {
setStateVar(state);
invalidate();
}
}
function size(Void) {
refresh();
}
function draw(Void) {
if (initializing) {
initializing = false;
skinName.visible = true;
iconName.visible = true;
}
size();
}
function getState(Void) {
return(__state);
}
function setToggle(val) {
__toggle = val;
if (__toggle == false) {
setState(false);
}
}
function getToggle(Void) {
return(__toggle);
}
function set toggle(val) {
setToggle(val);
//return(toggle);
}
function get toggle() {
return(getToggle());
}
function set value(val) {
setSelected(val);
//return(value);
}
function get value() {
return(getSelected());
}
function set selected(val) {
setSelected(val);
//return(selected);
}
function get selected() {
return(getSelected());
}
function setSelected(val) {
if (__toggle) {
setState(val);
} else {
setState((initializing ? (val) : (__state)));
}
}
function getSelected() {
return(__state);
}
function setEnabled(val) {
if (enabled != val) {
super.setEnabled(val);
invalidate();
}
}
function onPress(Void) {
pressFocus();
phase = "down";
refresh();
dispatchEvent({type:"buttonDown"});
if (autoRepeat) {
interval = setInterval(this, "onPressDelay", getStyle("repeatDelay"));
}
}
function onPressDelay(Void) {
dispatchEvent({type:"buttonDown"});
if (autoRepeat) {
clearInterval(interval);
interval = setInterval(this, "onPressRepeat", getStyle("repeatInterval"));
}
}
function onPressRepeat(Void) {
dispatchEvent({type:"buttonDown"});
updateAfterEvent();
}
function onRelease(Void) {
releaseFocus();
phase = "rollover";
if (interval != undefined) {
clearInterval(interval);
delete interval;
}
if (getToggle()) {
setState(!getState());
} else {
refresh();
}
dispatchEvent({type:"click"});
}
function onDragOut(Void) {
phase = "up";
refresh();
dispatchEvent({type:"buttonDragOut"});
}
function onDragOver(Void) {
if (phase != "up") {
onPress();
return(undefined);
}
phase = "down";
refresh();
}
function onReleaseOutside(Void) {
releaseFocus();
phase = "up";
if (interval != undefined) {
clearInterval(interval);
delete interval;
}
}
function onRollOver(Void) {
phase = "rollover";
refresh();
}
function onRollOut(Void) {
phase = "up";
refresh();
}
function getLabel(Void) {
return(fui.text);
}
function setLabel(val) {
if (typeof(fui) == "string") {
createLabel("fui", 8, val);
fui.styleName = this;
} else {
fui.text = val;
}
var _local4 = fui._getTextFormat();
var _local2 = _local4.getTextExtent2(val);
fui._width = _local2.width + 5;
fui._height = _local2.height + 5;
iconName = fui;
setView(__state);
}
function get emphasized() {
return(__emphasized);
}
function set emphasized(val) {
__emphasized = val;
var _local2 = 0;
while (_local2 < 8) {
this[idNames[_local2]] = stateNames[_local2] + "Skin";
if (typeof(this[idNames[_local2 + 8]]) == "movieclip") {
this[idNames[_local2 + 8]] = stateNames[_local2] + "Icon";
}
_local2++;
}
showEmphasized(__emphasized);
setStateVar(__state);
invalidateStyle();
//return(emphasized);
}
function keyDown(e) {
if (e.code == 32) {
onPress();
}
}
function keyUp(e) {
if (e.code == 32) {
onRelease();
}
}
function onKillFocus(newFocus) {
super.onKillFocus();
if (phase != "up") {
phase = "up";
refresh();
}
}
static var symbolName = "SimpleButton";
static var symbolOwner = mx.controls.SimpleButton;
static var version = "2.0.2.127";
var className = "SimpleButton";
var style3dInset = 4;
var btnOffset = 1;
var __toggle = false;
var __state = false;
var __emphasized = false;
var __emphatic = false;
static var falseUp = 0;
static var falseDown = 1;
static var falseOver = 2;
static var falseDisabled = 3;
static var trueUp = 4;
static var trueDown = 5;
static var trueOver = 6;
static var trueDisabled = 7;
var falseUpSkin = "SimpleButtonUp";
var falseDownSkin = "SimpleButtonIn";
var falseOverSkin = "";
var falseDisabledSkin = "SimpleButtonUp";
var trueUpSkin = "SimpleButtonIn";
var trueDownSkin = "";
var trueOverSkin = "";
var trueDisabledSkin = "SimpleButtonIn";
var falseUpIcon = "";
var falseDownIcon = "";
var falseOverIcon = "";
var falseDisabledIcon = "";
var trueUpIcon = "";
var trueDownIcon = "";
var trueOverIcon = "";
var trueDisabledIcon = "";
var phase = "up";
var fui = "falseUpIcon";
var fus = "falseUpSkin";
var fdi = "falseDownIcon";
var fds = "falseDownSkin";
var frs = "falseOverSkin";
var fri = "falseOverIcon";
var dfi = "falseDisabledIcon";
var dfs = "falseDisabledSkin";
var tui = "trueUpIcon";
var tus = "trueUpSkin";
var tdi = "trueDownIcon";
var tds = "trueDownSkin";
var trs = "trueOverSkin";
var tri = "trueOverIcon";
var dts = "trueDisabledSkin";
var dti = "trueDisabledIcon";
var rolloverSkin = mx.controls.SimpleButton.prototype.frs;
var rolloverIcon = mx.controls.SimpleButton.prototype.fri;
var upSkin = mx.controls.SimpleButton.prototype.fus;
var downSkin = mx.controls.SimpleButton.prototype.fds;
var disabledSkin = mx.controls.SimpleButton.prototype.dfs;
var upIcon = mx.controls.SimpleButton.prototype.fui;
var downIcon = mx.controls.SimpleButton.prototype.fdi;
var disabledIcon = mx.controls.SimpleButton.prototype.dfi;
var initializing = true;
var idNames = ["fus", "fds", "frs", "dfs", "tus", "tds", "trs", "dts", "fui", "fdi", "fri", "dfi", "tui", "tdi", "tri", "dti"];
var stateNames = ["falseUp", "falseDown", "falseOver", "falseDisabled", "trueUp", "trueDown", "trueOver", "trueDisabled"];
var refNames = ["upSkin", "downSkin", "rolloverSkin", "disabledSkin"];
var tagMap = {falseUpSkin:0, falseDownSkin:1, falseOverSkin:2, falseDisabledSkin:3, trueUpSkin:4, trueDownSkin:5, trueOverSkin:6, trueDisabledSkin:7, falseUpIcon:0, falseDownIcon:1, falseOverIcon:2, falseDisabledIcon:3, trueUpIcon:4, trueDownIcon:5, trueOverIcon:6, trueDisabledIcon:7};
}
Symbol 204 MovieClip [__Packages.mx.controls.Button] Frame 0
class mx.controls.Button extends mx.controls.SimpleButton
{
var initializing, labelPath, initIcon, getState, enabled, phase, idNames, __width, __height, setState, invalidate, iconName, refresh, createLabel, _iconLinkageName, removeIcons, hitArea_mc, createEmptyObject;
function Button () {
super();
}
function init(Void) {
super.init();
}
function draw() {
if (initializing) {
labelPath.visible = true;
}
super.draw();
if (initIcon != undefined) {
_setIcon(initIcon);
}
delete initIcon;
}
function onRelease(Void) {
super.onRelease();
}
function createChildren(Void) {
super.createChildren();
}
function setSkin(tag, linkageName, initobj) {
return(super.setSkin(tag, linkageName, initobj));
}
function viewSkin(varName) {
var _local3 = (getState() ? "true" : "false");
_local3 = _local3 + (enabled ? (phase) : "disabled");
super.viewSkin(varName, {styleName:this, borderStyle:_local3});
}
function invalidateStyle(c) {
labelPath.invalidateStyle(c);
super.invalidateStyle(c);
}
function setColor(c) {
var _local2 = 0;
while (_local2 < 8) {
this[idNames[_local2]].redraw(true);
_local2++;
}
}
function setEnabled(enable) {
labelPath.enabled = enable;
super.setEnabled(enable);
}
function calcSize(tag, ref) {
if ((__width == undefined) || (__height == undefined)) {
return(undefined);
}
if (tag < 7) {
ref.setSize(__width, __height, true);
}
}
function size(Void) {
setState(getState());
setHitArea(__width, __height);
var _local3 = 0;
while (_local3 < 8) {
var _local4 = idNames[_local3];
if (typeof(this[_local4]) == "movieclip") {
this[_local4].setSize(__width, __height, true);
}
_local3++;
}
super.size();
}
function set labelPlacement(val) {
__labelPlacement = val;
invalidate();
//return(labelPlacement);
}
function get labelPlacement() {
return(__labelPlacement);
}
function getLabelPlacement(Void) {
return(__labelPlacement);
}
function setLabelPlacement(val) {
__labelPlacement = val;
invalidate();
}
function getBtnOffset(Void) {
if (getState()) {
var _local2 = btnOffset;
} else if (phase == "down") {
var _local2 = btnOffset;
} else {
var _local2 = 0;
}
return(_local2);
}
function setView(offset) {
var _local16 = (offset ? (btnOffset) : 0);
var _local12 = getLabelPlacement();
var _local7 = 0;
var _local6 = 0;
var _local9 = 0;
var _local8 = 0;
var _local5 = 0;
var _local4 = 0;
var _local3 = labelPath;
var _local2 = iconName;
var _local15 = _local3.textWidth;
var _local14 = _local3.textHeight;
var _local10 = (__width - borderW) - borderW;
var _local11 = (__height - borderW) - borderW;
if (_local2 != undefined) {
_local7 = _local2._width;
_local6 = _local2._height;
}
if ((_local12 == "left") || (_local12 == "right")) {
if (_local3 != undefined) {
_local9 = Math.min(_local10 - _local7, _local15 + 5);
_local3._width = _local9;
_local8 = Math.min(_local11, _local14 + 5);
_local3._height = _local8;
}
if (_local12 == "right") {
_local5 = _local7;
if (centerContent) {
_local5 = _local5 + (((_local10 - _local9) - _local7) / 2);
}
_local2._x = _local5 - _local7;
} else {
_local5 = (_local10 - _local9) - _local7;
if (centerContent) {
_local5 = _local5 / 2;
}
_local2._x = _local5 + _local9;
}
_local4 = 0;
_local2._y = _local4;
if (centerContent) {
_local2._y = (_local11 - _local6) / 2;
_local4 = (_local11 - _local8) / 2;
}
if (!centerContent) {
_local2._y = _local2._y + Math.max(0, (_local8 - _local6) / 2);
}
} else {
if (_local3 != undefined) {
_local9 = Math.min(_local10, _local15 + 5);
_local3._width = _local9;
_local8 = Math.min(_local11 - _local6, _local14 + 5);
_local3._height = _local8;
}
_local5 = (_local10 - _local9) / 2;
_local2._x = (_local10 - _local7) / 2;
if (_local12 == "top") {
_local4 = (_local11 - _local8) - _local6;
if (centerContent) {
_local4 = _local4 / 2;
}
_local2._y = _local4 + _local8;
} else {
_local4 = _local6;
if (centerContent) {
_local4 = _local4 + (((_local11 - _local8) - _local6) / 2);
}
_local2._y = _local4 - _local6;
}
}
var _local13 = borderW + _local16;
_local3._x = _local5 + _local13;
_local3._y = _local4 + _local13;
_local2._x = _local2._x + _local13;
_local2._y = _local2._y + _local13;
}
function set label(lbl) {
setLabel(lbl);
//return(label);
}
function setLabel(label) {
if (label == "") {
labelPath.removeTextField();
refresh();
return(undefined);
}
if (labelPath == undefined) {
var _local2 = createLabel("labelPath", 200, label);
_local2._width = _local2.textWidth + 5;
_local2._height = _local2.textHeight + 5;
if (initializing) {
_local2.visible = false;
}
} else {
delete labelPath.__text;
labelPath.text = label;
refresh();
}
}
function getLabel(Void) {
return(((labelPath.__text != undefined) ? (labelPath.__text) : (labelPath.text)));
}
function get label() {
return(getLabel());
}
function _getIcon(Void) {
return(_iconLinkageName);
}
function get icon() {
if (initializing) {
return(initIcon);
}
return(_iconLinkageName);
}
function _setIcon(linkage) {
if (initializing) {
if (linkage == "") {
return(undefined);
}
initIcon = linkage;
} else {
if (linkage == "") {
removeIcons();
return(undefined);
}
super.changeIcon(0, linkage);
super.changeIcon(1, linkage);
super.changeIcon(3, linkage);
super.changeIcon(4, linkage);
super.changeIcon(5, linkage);
_iconLinkageName = linkage;
refresh();
}
}
function set icon(linkage) {
_setIcon(linkage);
//return(icon);
}
function setHitArea(w, h) {
if (hitArea_mc == undefined) {
createEmptyObject("hitArea_mc", 100);
}
var _local2 = hitArea_mc;
_local2.clear();
_local2.beginFill(16711680);
_local2.drawRect(0, 0, w, h);
_local2.endFill();
_local2.setVisible(false);
}
static var symbolName = "Button";
static var symbolOwner = mx.controls.Button;
var className = "Button";
static var version = "2.0.2.127";
var btnOffset = 0;
var _color = "buttonColor";
var __label = "default value";
var __labelPlacement = "right";
var falseUpSkin = "ButtonSkin";
var falseDownSkin = "ButtonSkin";
var falseOverSkin = "ButtonSkin";
var falseDisabledSkin = "ButtonSkin";
var trueUpSkin = "ButtonSkin";
var trueDownSkin = "ButtonSkin";
var trueOverSkin = "ButtonSkin";
var trueDisabledSkin = "ButtonSkin";
var falseUpIcon = "";
var falseDownIcon = "";
var falseOverIcon = "";
var falseDisabledIcon = "";
var trueUpIcon = "";
var trueDownIcon = "";
var trueOverIcon = "";
var trueDisabledIcon = "";
var clipParameters = {labelPlacement:1, icon:1, toggle:1, selected:1, label:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.Button.prototype.clipParameters, mx.controls.SimpleButton.prototype.clipParameters);
var centerContent = true;
var borderW = 1;
}
Symbol 205 MovieClip [__Packages.mx.controls.RadioButton] Frame 0
class mx.controls.RadioButton extends mx.controls.Button
{
var setToggle, __value, selected, releaseFocus, phase, dispatchEvent, _parent, __data, setState, __state, getFocusManager;
function RadioButton () {
super();
}
function init(Void) {
setToggle(__toggle);
__value = this;
super.init();
}
function size(Void) {
super.size();
}
function onRelease() {
if (selected) {
return(undefined);
}
releaseFocus();
phase = "up";
setSelected(true);
dispatchEvent({type:"click"});
_parent[__groupName].dispatchEvent({type:"click"});
}
function setData(val) {
__data = val;
}
function set data(val) {
__data = val;
//return(data);
}
function getData(val) {
return(__data);
}
function get data() {
return(__data);
}
function onUnload() {
if (_parent[__groupName].selectedRadio == this) {
_parent[__groupName].selectedRadio = undefined;
}
_parent[__groupName].radioList[indexNumber] = null;
delete _parent[__groupName].radioList[indexNumber];
}
function setSelected(val) {
var _local2 = _parent[__groupName];
var _local4 = _local2.selectedRadio.__width;
var _local5 = _local2.selectedRadio.__height;
if (val) {
_local2.selectedRadio.setState(false);
_local2.selectedRadio = this;
} else if (_local2.selectedRadio == this) {
_local2.selectedRadio.setState(false);
_local2.selectedRadio = undefined;
}
setState(val);
}
function deleteGroupObj(groupName) {
delete _parent[groupName];
}
function getGroupName() {
return(__groupName);
}
function get groupName() {
return(__groupName);
}
function setGroupName(groupName) {
if ((groupName == undefined) || (groupName == "")) {
return(undefined);
}
delete _parent[__groupName].radioList[__data];
addToGroup(groupName);
__groupName = groupName;
}
function set groupName(groupName) {
setGroupName(groupName);
//return(this.groupName);
}
function addToGroup(groupName) {
if ((groupName == "") || (groupName == undefined)) {
return(undefined);
}
var _local2 = _parent[groupName];
if (_local2 == undefined) {
_local2 = (_parent[groupName] = new mx.controls.RadioButtonGroup());
_local2.__groupName = groupName;
}
_local2.addInstance(this);
if (__state) {
_local2.selectedRadio.setState(false);
_local2.selectedRadio = this;
}
}
function get emphasized() {
return(undefined);
}
function keyDown(e) {
switch (e.code) {
case 40 :
setNext();
break;
case 38 :
setPrev();
break;
case 37 :
setPrev();
break;
case 39 :
setNext();
}
}
function setNext() {
var _local2 = _parent[groupName];
if ((_local2.selectedRadio.indexNumber + 1) == _local2.radioList.length) {
return(undefined);
}
var _local4 = (_local2.selectedRadio ? (_local2.selectedRadio.indexNumber) : -1);
var _local3 = 1;
while (_local3 < _local2.radioList.length) {
if ((_local2.radioList[_local4 + _local3] != undefined) && (_local2.radioList[_local4 + _local3].enabled)) {
var _local5 = getFocusManager();
_local2.radioList[_local4 + _local3].selected = true;
_local5.setFocus(_local2.radioList[_local2.selectedRadio.indexNumber]);
_local2.dispatchEvent({type:"click"});
break;
}
_local3++;
}
}
function setPrev() {
var _local2 = _parent[groupName];
if (_local2.selectedRadio.indexNumber == 0) {
return(undefined);
}
var _local4 = (_local2.selectedRadio ? (_local2.selectedRadio.indexNumber) : 1);
var _local3 = 1;
while (_local3 < _local2.radioList.length) {
if ((_local2.radioList[_local4 - _local3] != undefined) && (_local2.radioList[_local4 - _local3].enabled)) {
var _local5 = getFocusManager();
_local2.radioList[_local4 - _local3].selected = true;
_local5.setFocus(_local2.radioList[_local2.selectedRadio.indexNumber]);
_local2.dispatchEvent({type:"click"});
break;
}
_local3++;
}
}
function set toggle(v) {
//return(toggle);
}
function get toggle() {
}
function set icon(v) {
//return(icon);
}
function get icon() {
}
static var symbolName = "RadioButton";
static var symbolOwner = mx.controls.RadioButton;
static var version = "2.0.2.127";
var className = "RadioButton";
var btnOffset = 0;
var __toggle = true;
var __label = "Radio Button";
var __labelPlacement = "right";
var ignoreClassStyleDeclaration = {Button:1};
var __groupName = "radioGroup";
var indexNumber = 0;
var offset = false;
var falseUpSkin = "";
var falseDownSkin = "";
var falseOverSkin = "";
var falseDisabledSkin = "";
var trueUpSkin = "";
var trueDownSkin = "";
var trueOverSkin = "";
var trueDisabledSkin = "";
var falseUpIcon = "RadioFalseUp";
var falseDownIcon = "RadioFalseDown";
var falseOverIcon = "RadioFalseOver";
var falseDisabledIcon = "RadioFalseDisabled";
var trueUpIcon = "RadioTrueUp";
var trueDownIcon = "";
var trueOverIcon = "";
var trueDisabledIcon = "RadioTrueDisabled";
var centerContent = false;
var borderW = 0;
var clipParameters = {labelPlacement:1, data:1, label:1, groupName:1, selected:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.RadioButton.prototype.clipParameters, mx.controls.Button.prototype.clipParameters);
}
Symbol 251 MovieClip [__Packages.mx.skins.SkinElement] Frame 0
class mx.skins.SkinElement extends MovieClip
{
var _visible, _x, _y, _width, _height;
function SkinElement () {
super();
}
static function registerElement(name, className) {
Object.registerClass(name, ((className == undefined) ? (mx.skins.SkinElement) : (className)));
_global.skinRegistry[name] = true;
}
function __set__visible(visible) {
_visible = visible;
}
function move(x, y) {
_x = x;
_y = y;
}
function setSize(w, h) {
_width = w;
_height = h;
}
}
Symbol 252 MovieClip [__Packages.mx.styles.CSSTextStyles] Frame 0
class mx.styles.CSSTextStyles
{
function CSSTextStyles () {
}
static function addTextStyles(o, bColor) {
o.addProperty("textAlign", function () {
return(this._tf.align);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.align = x;
});
o.addProperty("fontWeight", function () {
return(((this._tf.bold != undefined) ? ((this._tf.bold ? "bold" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.bold = x == "bold";
});
if (bColor) {
o.addProperty("color", function () {
return(this._tf.color);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.color = x;
});
}
o.addProperty("fontFamily", function () {
return(this._tf.font);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.font = x;
});
o.addProperty("textIndent", function () {
return(this._tf.indent);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.indent = x;
});
o.addProperty("fontStyle", function () {
return(((this._tf.italic != undefined) ? ((this._tf.italic ? "italic" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.italic = x == "italic";
});
o.addProperty("marginLeft", function () {
return(this._tf.leftMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.leftMargin = x;
});
o.addProperty("marginRight", function () {
return(this._tf.rightMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.rightMargin = x;
});
o.addProperty("fontSize", function () {
return(this._tf.size);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.size = x;
});
o.addProperty("textDecoration", function () {
return(((this._tf.underline != undefined) ? ((this._tf.underline ? "underline" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.underline = x == "underline";
});
o.addProperty("embedFonts", function () {
return(this._tf.embedFonts);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.embedFonts = x;
});
}
}
Symbol 253 MovieClip [__Packages.mx.styles.StyleManager] Frame 0
class mx.styles.StyleManager
{
function StyleManager () {
}
static function registerInheritingStyle(styleName) {
inheritingStyles[styleName] = true;
}
static function isInheritingStyle(styleName) {
return(inheritingStyles[styleName] == true);
}
static function registerColorStyle(styleName) {
colorStyles[styleName] = true;
}
static function isColorStyle(styleName) {
return(colorStyles[styleName] == true);
}
static function registerColorName(colorName, colorValue) {
colorNames[colorName] = colorValue;
}
static function isColorName(colorName) {
return(colorNames[colorName] != undefined);
}
static function getColorName(colorName) {
return(colorNames[colorName]);
}
static var inheritingStyles = {color:true, direction:true, fontFamily:true, fontSize:true, fontStyle:true, fontWeight:true, textAlign:true, textIndent:true};
static var colorStyles = {barColor:true, trackColor:true, borderColor:true, buttonColor:true, color:true, dateHeaderColor:true, dateRollOverColor:true, disabledColor:true, fillColor:true, highlightColor:true, scrollTrackColor:true, selectedDateColor:true, shadowColor:true, strokeColor:true, symbolBackgroundColor:true, symbolBackgroundDisabledColor:true, symbolBackgroundPressedColor:true, symbolColor:true, symbolDisabledColor:true, themeColor:true, todayIndicatorColor:true, shadowCapColor:true, borderCapColor:true, focusColor:true};
static var colorNames = {black:0, white:16777215, red:16711680, green:65280, blue:255, magenta:16711935, yellow:16776960, cyan:65535, haloGreen:8453965, haloBlue:2881013, haloOrange:16761344};
static var TextFormatStyleProps = {font:true, size:true, color:true, leftMargin:false, rightMargin:false, italic:true, bold:true, align:true, indent:true, underline:false, embedFonts:false};
static var TextStyleMap = {textAlign:true, fontWeight:true, color:true, fontFamily:true, textIndent:true, fontStyle:true, lineHeight:true, marginLeft:true, marginRight:true, fontSize:true, textDecoration:true, embedFonts:true};
}
Symbol 254 MovieClip [__Packages.mx.styles.CSSStyleDeclaration] Frame 0
class mx.styles.CSSStyleDeclaration
{
var _tf;
function CSSStyleDeclaration () {
}
function __getTextFormat(tf, bAll) {
var _local5 = false;
if (_tf != undefined) {
var _local2;
for (_local2 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local2])) {
if (tf[_local2] == undefined) {
var _local3 = _tf[_local2];
if (_local3 != undefined) {
tf[_local2] = _local3;
} else {
_local5 = true;
}
}
}
}
} else {
_local5 = true;
}
return(_local5);
}
function getStyle(styleProp) {
var _local2 = this[styleProp];
var _local3 = mx.styles.StyleManager.getColorName(_local2);
return(((_local3 == undefined) ? (_local2) : (_local3)));
}
static function classConstruct() {
mx.styles.CSSTextStyles.addTextStyles(mx.styles.CSSStyleDeclaration.prototype, true);
return(true);
}
static var classConstructed = classConstruct();
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
}
Symbol 255 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 256 MovieClip [__Packages.mx.events.UIEventDispatcher] Frame 0
class mx.events.UIEventDispatcher extends mx.events.EventDispatcher
{
var dispatchQueue, owner, __sentLoadEvent, __origAddEventListener;
function UIEventDispatcher () {
super();
}
static function addKeyEvents(obj) {
if (obj.keyHandler == undefined) {
var _local1 = (obj.keyHandler = new Object());
_local1.owner = obj;
_local1.onKeyDown = _fEventDispatcher.onKeyDown;
_local1.onKeyUp = _fEventDispatcher.onKeyUp;
}
Key.addListener(obj.keyHandler);
}
static function removeKeyEvents(obj) {
Key.removeListener(obj.keyHandler);
}
static function addLoadEvents(obj) {
if (obj.onLoad == undefined) {
obj.onLoad = _fEventDispatcher.onLoad;
obj.onUnload = _fEventDispatcher.onUnload;
if (obj.getBytesTotal() == obj.getBytesLoaded()) {
obj.doLater(obj, "onLoad");
}
}
}
static function removeLoadEvents(obj) {
delete obj.onLoad;
delete obj.onUnload;
}
static function initialize(obj) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.UIEventDispatcher();
}
obj.addEventListener = _fEventDispatcher.__addEventListener;
obj.__origAddEventListener = _fEventDispatcher.addEventListener;
obj.removeEventListener = _fEventDispatcher.removeEventListener;
obj.dispatchEvent = _fEventDispatcher.dispatchEvent;
obj.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(mx.events.EventDispatcher, eventObj);
dispatchQueue(this, eventObj);
}
function onKeyDown(Void) {
owner.dispatchEvent({type:"keyDown", code:Key.getCode(), ascii:Key.getAscii(), shiftKey:Key.isDown(16), ctrlKey:Key.isDown(17)});
}
function onKeyUp(Void) {
owner.dispatchEvent({type:"keyUp", code:Key.getCode(), ascii:Key.getAscii(), shiftKey:Key.isDown(16), ctrlKey:Key.isDown(17)});
}
function onLoad(Void) {
if (__sentLoadEvent != true) {
dispatchEvent({type:"load"});
}
__sentLoadEvent = true;
}
function onUnload(Void) {
dispatchEvent({type:"unload"});
}
function __addEventListener(event, handler) {
__origAddEventListener(event, handler);
var _local3 = lowLevelEvents;
for (var _local5 in _local3) {
if (mx.events.UIEventDispatcher[_local5][event] != undefined) {
var _local2 = _local3[_local5][0];
mx.events.UIEventDispatcher[_local2](this);
}
}
}
function removeEventListener(event, handler) {
var _local6 = "__q_" + event;
mx.events.EventDispatcher._removeEventListener(this[_local6], event, handler);
if (this[_local6].length == 0) {
var _local2 = lowLevelEvents;
for (var _local5 in _local2) {
if (mx.events.UIEventDispatcher[_local5][event] != undefined) {
var _local3 = _local2[_local5][1];
mx.events.UIEventDispatcher[_local2[_local5][1]](this);
}
}
}
}
static var keyEvents = {keyDown:1, keyUp:1};
static var loadEvents = {load:1, unload:1};
static var lowLevelEvents = {keyEvents:["addKeyEvents", "removeKeyEvents"], loadEvents:["addLoadEvents", "removeLoadEvents"]};
static var _fEventDispatcher = undefined;
}
Symbol 257 MovieClip [__Packages.mx.controls.RadioButtonGroup] Frame 0
class mx.controls.RadioButtonGroup
{
var radioList, __groupName, selectedRadio;
function RadioButtonGroup () {
init();
mx.events.UIEventDispatcher.initialize(this);
}
function init(Void) {
radioList = new Array();
}
function setGroupName(groupName) {
if ((groupName == undefined) || (groupName == "")) {
return(undefined);
}
var _local6 = __groupName;
_parent[groupName] = this;
for (var _local5 in radioList) {
radioList[_local5].groupName = groupName;
var _local3 = radioList[_local5];
}
_local3.deleteGroupObj(_local6);
}
function getGroupName() {
return(__groupName);
}
function addInstance(instance) {
instance.indexNumber = indexNumber++;
radioList.push(instance);
}
function getValue() {
if (selectedRadio.data == "") {
return(selectedRadio.label);
}
return(selectedRadio.__data);
}
function getLabelPlacement() {
for (var _local3 in radioList) {
var _local2 = radioList[_local3].getLabelPlacement();
}
return(_local2);
}
function setLabelPlacement(pos) {
for (var _local3 in radioList) {
radioList[_local3].setLabelPlacement(pos);
}
}
function setEnabled(val) {
for (var _local3 in radioList) {
radioList[_local3].enabled = val;
}
}
function setSize(val, val1) {
for (var _local3 in radioList) {
radioList[_local3].setSize(val, val1);
}
}
function getEnabled() {
for (var _local4 in radioList) {
var _local2 = radioList[_local4].enabled;
var _local3 = t + (_local2 + 0);
}
if (_local3 == radioList.length) {
return(true);
}
if (_local3 == 0) {
return(false);
}
}
function setStyle(name, val) {
for (var _local4 in radioList) {
radioList[_local4].setStyle(name, val);
}
}
function setInstance(val) {
for (var _local3 in radioList) {
if (radioList[_local3] == val) {
radioList[_local3].selected = true;
}
}
}
function getInstance() {
return(selectedRadio);
}
function setValue(val) {
for (var _local4 in radioList) {
if ((radioList[_local4].__data == val) || (radioList[_local4].label == val)) {
var _local2 = _local4;
break;
}
}
if (_local2 != undefined) {
selectedRadio.setState(false);
selectedRadio.hitArea_mc._height = selectedRadio.__height;
selectedRadio.hitArea_mc._width = selectedRadio.__width;
selectedRadio = radioList[_local2];
selectedRadio.setState(true);
selectedRadio.hitArea_mc._height = (selectedRadio.hitArea_mc._width = 0);
}
}
function set groupName(groupName) {
if ((groupName == undefined) || (groupName == "")) {
return;
}
var _local6 = __groupName;
_parent[groupName] = this;
for (var _local5 in radioList) {
radioList[_local5].groupName = groupName;
var _local3 = radioList[_local5];
}
_local3.deleteGroupObj(_local6);
//return(this.groupName);
}
function get groupName() {
return(__groupName);
}
function set selectedData(val) {
for (var _local4 in radioList) {
if ((radioList[_local4].__data == val) || (radioList[_local4].label == val)) {
var _local2 = _local4;
break;
}
}
if (_local2 != undefined) {
selectedRadio.setState(false);
selectedRadio = radioList[_local2];
selectedRadio.setState(true);
}
//return(selectedData);
}
function get selectedData() {
if ((selectedRadio.data == "") || (selectedRadio.data == undefined)) {
return(selectedRadio.label);
}
return(selectedRadio.__data);
}
function get selection() {
return(selectedRadio);
}
function set selection(val) {
for (var _local3 in radioList) {
if (radioList[_local3] == val) {
radioList[_local3].selected = true;
}
}
//return(selection);
}
function set labelPlacement(pos) {
for (var _local3 in radioList) {
radioList[_local3].setLabelPlacement(pos);
}
//return(labelPlacement);
}
function get labelPlacement() {
for (var _local3 in radioList) {
var _local2 = radioList[_local3].getLabelPlacement();
}
return(_local2);
}
function set enabled(val) {
for (var _local3 in radioList) {
radioList[_local3].enabled = val;
}
//return(enabled);
}
function get enabled() {
var _local2 = 0;
for (var _local3 in radioList) {
_local2 = _local2 + radioList[_local3].enabled;
}
if (_local2 == 0) {
return(false);
}
if (_local2 == radioList.length) {
return(true);
}
}
static var symbolName = "RadioButtonGroup";
static var symbolOwner = mx.controls.RadioButtonGroup;
static var version = "2.0.2.127";
var className = "RadioButtonGroup";
var indexNumber = 0;
}
Symbol 258 MovieClip [__Packages.mx.skins.ColoredSkinElement] Frame 0
class mx.skins.ColoredSkinElement
{
var getStyle, _color, onEnterFrame;
function ColoredSkinElement () {
}
function setColor(c) {
if (c != undefined) {
var _local2 = new Color(this);
_local2.setRGB(c);
}
}
function draw(Void) {
setColor(getStyle(_color));
onEnterFrame = undefined;
}
function invalidateStyle(Void) {
onEnterFrame = draw;
}
static function setColorStyle(p, colorStyle) {
if (p._color == undefined) {
p._color = colorStyle;
}
p.setColor = mixins.setColor;
p.invalidateStyle = mixins.invalidateStyle;
p.draw = mixins.draw;
p.setColor(p.getStyle(colorStyle));
}
static var mixins = new mx.skins.ColoredSkinElement();
}
Symbol 259 MovieClip [__Packages.mx.core.ext.UIObjectExtensions] Frame 0
class mx.core.ext.UIObjectExtensions
{
function UIObjectExtensions () {
}
static function addGeometry(tf, ui) {
tf.addProperty("width", ui.__get__width, null);
tf.addProperty("height", ui.__get__height, null);
tf.addProperty("left", ui.__get__left, null);
tf.addProperty("x", ui.__get__x, null);
tf.addProperty("top", ui.__get__top, null);
tf.addProperty("y", ui.__get__y, null);
tf.addProperty("right", ui.__get__right, null);
tf.addProperty("bottom", ui.__get__bottom, null);
tf.addProperty("visible", ui.__get__visible, ui.__set__visible);
}
static function Extensions() {
if (bExtended == true) {
return(true);
}
bExtended = true;
var _local6 = mx.core.UIObject.prototype;
var _local9 = mx.skins.SkinElement.prototype;
addGeometry(_local9, _local6);
mx.events.UIEventDispatcher.initialize(_local6);
var _local13 = mx.skins.ColoredSkinElement;
mx.styles.CSSTextStyles.addTextStyles(_local6);
var _local5 = MovieClip.prototype;
_local5.getTopLevel = _local6.getTopLevel;
_local5.createLabel = _local6.createLabel;
_local5.createObject = _local6.createObject;
_local5.createClassObject = _local6.createClassObject;
_local5.createEmptyObject = _local6.createEmptyObject;
_local5.destroyObject = _local6.destroyObject;
_global.ASSetPropFlags(_local5, "getTopLevel", 1);
_global.ASSetPropFlags(_local5, "createLabel", 1);
_global.ASSetPropFlags(_local5, "createObject", 1);
_global.ASSetPropFlags(_local5, "createClassObject", 1);
_global.ASSetPropFlags(_local5, "createEmptyObject", 1);
_global.ASSetPropFlags(_local5, "destroyObject", 1);
_local5.__getTextFormat = _local6.__getTextFormat;
_local5._getTextFormat = _local6._getTextFormat;
_local5.getStyleName = _local6.getStyleName;
_local5.getStyle = _local6.getStyle;
_global.ASSetPropFlags(_local5, "__getTextFormat", 1);
_global.ASSetPropFlags(_local5, "_getTextFormat", 1);
_global.ASSetPropFlags(_local5, "getStyleName", 1);
_global.ASSetPropFlags(_local5, "getStyle", 1);
var _local7 = TextField.prototype;
addGeometry(_local7, _local6);
_local7.addProperty("enabled", function () {
return(this.__enabled);
}, function (x) {
this.__enabled = x;
this.invalidateStyle();
});
_local7.move = _local9.move;
_local7.setSize = _local9.setSize;
_local7.invalidateStyle = function () {
this.invalidateFlag = true;
};
_local7.draw = function () {
if (this.invalidateFlag) {
this.invalidateFlag = false;
var _local2 = this._getTextFormat();
this.setTextFormat(_local2);
this.setNewTextFormat(_local2);
this.embedFonts = _local2.embedFonts == true;
if (this.__text != undefined) {
if (this.text == "") {
this.text = this.__text;
}
delete this.__text;
}
this._visible = true;
}
};
_local7.setColor = function (color) {
this.textColor = color;
};
_local7.getStyle = _local5.getStyle;
_local7.__getTextFormat = _local6.__getTextFormat;
_local7.setValue = function (v) {
this.text = v;
};
_local7.getValue = function () {
return(this.text);
};
_local7.addProperty("value", function () {
return(this.getValue());
}, function (v) {
this.setValue(v);
});
_local7._getTextFormat = function () {
var _local2 = this.stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
this.__getTextFormat(_local2);
this.stylecache.tf = _local2;
if (this.__enabled == false) {
if (this.enabledColor == undefined) {
var _local4 = this.getTextFormat();
this.enabledColor = _local4.color;
}
var _local3 = this.getStyle("disabledColor");
_local2.color = _local3;
} else if (this.enabledColor != undefined) {
if (_local2.color == undefined) {
_local2.color = this.enabledColor;
}
}
return(_local2);
};
_local7.getPreferredWidth = function () {
this.draw();
return(this.textWidth + 4);
};
_local7.getPreferredHeight = function () {
this.draw();
return(this.textHeight + 4);
};
TextFormat.prototype.getTextExtent2 = function (s) {
var _local3 = _root._getTextExtent;
if (_local3 == undefined) {
_root.createTextField("_getTextExtent", -2, 0, 0, 1000, 100);
_local3 = _root._getTextExtent;
_local3._visible = false;
}
_root._getTextExtent.text = s;
var _local4 = this.align;
this.align = "left";
_root._getTextExtent.setTextFormat(this);
this.align = _local4;
return({width:_local3.textWidth, height:_local3.textHeight});
};
if (_global.style == undefined) {
_global.style = new mx.styles.CSSStyleDeclaration();
_global.cascadingStyles = true;
_global.styles = new Object();
_global.skinRegistry = new Object();
if (_global._origWidth == undefined) {
_global.origWidth = Stage.width;
_global.origHeight = Stage.height;
}
}
var _local4 = _root;
while (_local4._parent != undefined) {
_local4 = _local4._parent;
}
_local4.addProperty("width", function () {
return(Stage.width);
}, null);
_local4.addProperty("height", function () {
return(Stage.height);
}, null);
_global.ASSetPropFlags(_local4, "width", 1);
_global.ASSetPropFlags(_local4, "height", 1);
return(true);
}
static var bExtended = false;
static var UIObjectExtended = Extensions();
static var UIObjectDependency = mx.core.UIObject;
static var SkinElementDependency = mx.skins.SkinElement;
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
static var UIEventDispatcherDependency = mx.events.UIEventDispatcher;
}
Symbol 260 MovieClip [__Packages.mx.skins.halo.Defaults] Frame 0
class mx.skins.halo.Defaults
{
var beginGradientFill, beginFill, moveTo, lineTo, curveTo, endFill;
function Defaults () {
}
static function setThemeDefaults() {
var _local2 = _global.style;
_local2.themeColor = 8453965 /* 0x80FF4D */;
_local2.disabledColor = 8684164 /* 0x848284 */;
_local2.modalTransparency = 0;
_local2.filled = true;
_local2.stroked = true;
_local2.strokeWidth = 1;
_local2.strokeColor = 0;
_local2.fillColor = 16777215 /* 0xFFFFFF */;
_local2.repeatInterval = 35;
_local2.repeatDelay = 500;
_local2.fontFamily = "_sans";
_local2.fontSize = 12;
_local2.selectionColor = 13500353 /* 0xCDFFC1 */;
_local2.rollOverColor = 14942166 /* 0xE3FFD6 */;
_local2.useRollOver = true;
_local2.backgroundDisabledColor = 14540253 /* 0xDDDDDD */;
_local2.selectionDisabledColor = 14540253 /* 0xDDDDDD */;
_local2.selectionDuration = 200;
_local2.openDuration = 250;
_local2.borderStyle = "inset";
_local2.color = 734012 /* 0x0B333C */;
_local2.textSelectedColor = 24371;
_local2.textRollOverColor = 2831164 /* 0x2B333C */;
_local2.textDisabledColor = 16777215 /* 0xFFFFFF */;
_local2.vGridLines = true;
_local2.hGridLines = false;
_local2.vGridLineColor = 6710886 /* 0x666666 */;
_local2.hGridLineColor = 6710886 /* 0x666666 */;
_local2.headerColor = 15395562 /* 0xEAEAEA */;
_local2.indentation = 17;
_local2.folderOpenIcon = "TreeFolderOpen";
_local2.folderClosedIcon = "TreeFolderClosed";
_local2.defaultLeafIcon = "TreeNodeIcon";
_local2.disclosureOpenIcon = "TreeDisclosureOpen";
_local2.disclosureClosedIcon = "TreeDisclosureClosed";
_local2.popupDuration = 150;
_local2.todayColor = 6710886 /* 0x666666 */;
_local2 = (_global.styles.ScrollSelectList = new mx.styles.CSSStyleDeclaration());
_local2.backgroundColor = 16777215 /* 0xFFFFFF */;
_local2.borderColor = 13290186 /* 0xCACACA */;
_local2.borderStyle = "inset";
_local2 = (_global.styles.ComboBox = new mx.styles.CSSStyleDeclaration());
_local2.borderStyle = "inset";
_local2 = (_global.styles.NumericStepper = new mx.styles.CSSStyleDeclaration());
_local2.textAlign = "center";
_local2 = (_global.styles.RectBorder = new mx.styles.CSSStyleDeclaration());
_local2.borderColor = 14015965 /* 0xD5DDDD */;
_local2.buttonColor = 7305079 /* 0x6F7777 */;
_local2.shadowColor = 15658734 /* 0xEEEEEE */;
_local2.highlightColor = 12897484 /* 0xC4CCCC */;
_local2.shadowCapColor = 14015965 /* 0xD5DDDD */;
_local2.borderCapColor = 9542041 /* 0x919999 */;
var _local4 = new Object();
_local4.borderColor = 16711680 /* 0xFF0000 */;
_local4.buttonColor = 16711680 /* 0xFF0000 */;
_local4.shadowColor = 16711680 /* 0xFF0000 */;
_local4.highlightColor = 16711680 /* 0xFF0000 */;
_local4.shadowCapColor = 16711680 /* 0xFF0000 */;
_local4.borderCapColor = 16711680 /* 0xFF0000 */;
mx.core.UIComponent.prototype.origBorderStyles = _local4;
var _local3;
_local3 = (_global.styles.TextInput = new mx.styles.CSSStyleDeclaration());
_local3.backgroundColor = 16777215 /* 0xFFFFFF */;
_local3.borderStyle = "inset";
_global.styles.TextArea = _global.styles.TextInput;
_local3 = (_global.styles.Window = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "default";
_local3 = (_global.styles.windowStyles = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3 = (_global.styles.dataGridStyles = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3 = (_global.styles.Alert = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "alert";
_local3 = (_global.styles.ScrollView = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "inset";
_local3 = (_global.styles.View = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "none";
_local3 = (_global.styles.ProgressBar = new mx.styles.CSSStyleDeclaration());
_local3.color = 11187123 /* 0xAAB3B3 */;
_local3.fontWeight = "bold";
_local3 = (_global.styles.AccordionHeader = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3.fontSize = "11";
_local3 = (_global.styles.Accordion = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "solid";
_local3.backgroundColor = 16777215 /* 0xFFFFFF */;
_local3.borderColor = 9081738 /* 0x8A938A */;
_local3.headerHeight = 22;
_local3.marginLeft = (_local3.marginRight = (_local3.marginTop = (_local3.marginBottom = -1)));
_local3.verticalGap = -1;
_local3 = (_global.styles.DateChooser = new mx.styles.CSSStyleDeclaration());
_local3.borderColor = 9542041 /* 0x919999 */;
_local3.headerColor = 16777215 /* 0xFFFFFF */;
_local3 = (_global.styles.CalendarLayout = new mx.styles.CSSStyleDeclaration());
_local3.fontSize = 10;
_local3.textAlign = "right";
_local3.color = 2831164 /* 0x2B333C */;
_local3 = (_global.styles.WeekDayStyle = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3.fontSize = 11;
_local3.textAlign = "center";
_local3.color = 2831164 /* 0x2B333C */;
_local3 = (_global.styles.TodayStyle = new mx.styles.CSSStyleDeclaration());
_local3.color = 16777215 /* 0xFFFFFF */;
_local3 = (_global.styles.HeaderDateText = new mx.styles.CSSStyleDeclaration());
_local3.fontSize = 12;
_local3.fontWeight = "bold";
_local3.textAlign = "center";
}
function drawRoundRect(x, y, w, h, r, c, alpha, rot, gradient, ratios) {
if (typeof(r) == "object") {
var _local18 = r.br;
var _local16 = r.bl;
var _local15 = r.tl;
var _local10 = r.tr;
} else {
var _local10 = r;
var _local15 = _local10;
var _local16 = _local15;
var _local18 = _local16;
}
if (typeof(c) == "object") {
if (typeof(alpha) != "object") {
var _local9 = [alpha, alpha];
} else {
var _local9 = alpha;
}
if (ratios == undefined) {
ratios = [0, 255];
}
var _local14 = h * 0.7;
if (typeof(rot) != "object") {
var _local11 = {matrixType:"box", x:-_local14, y:_local14, w:w * 2, h:h * 4, r:rot * 0.0174532925199433 /* Math.PI/180 */};
} else {
var _local11 = rot;
}
if (gradient == "radial") {
beginGradientFill("radial", c, _local9, ratios, _local11);
} else {
beginGradientFill("linear", c, _local9, ratios, _local11);
}
} else if (c != undefined) {
beginFill(c, alpha);
}
r = _local18;
var _local13 = r - (r * 0.707106781186547);
var _local12 = r - (r * 0.414213562373095);
moveTo(x + w, (y + h) - r);
lineTo(x + w, (y + h) - r);
curveTo(x + w, (y + h) - _local12, (x + w) - _local13, (y + h) - _local13);
curveTo((x + w) - _local12, y + h, (x + w) - r, y + h);
r = _local16;
_local13 = r - (r * 0.707106781186547);
_local12 = r - (r * 0.414213562373095);
lineTo(x + r, y + h);
curveTo(x + _local12, y + h, x + _local13, (y + h) - _local13);
curveTo(x, (y + h) - _local12, x, (y + h) - r);
r = _local15;
_local13 = r - (r * 0.707106781186547);
_local12 = r - (r * 0.414213562373095);
lineTo(x, y + r);
curveTo(x, y + _local12, x + _local13, y + _local13);
curveTo(x + _local12, y, x + r, y);
r = _local10;
_local13 = r - (r * 0.707106781186547);
_local12 = r - (r * 0.414213562373095);
lineTo((x + w) - r, y);
curveTo((x + w) - _local12, y, (x + w) - _local13, y + _local13);
curveTo(x + w, y + _local12, x + w, y + r);
lineTo(x + w, (y + h) - r);
if (c != undefined) {
endFill();
}
}
static function classConstruct() {
mx.core.ext.UIObjectExtensions.Extensions();
setThemeDefaults();
mx.core.UIObject.prototype.drawRoundRect = mx.skins.halo.Defaults.prototype.drawRoundRect;
return(true);
}
static var classConstructed = classConstruct();
static var CSSStyleDeclarationDependency = mx.styles.CSSStyleDeclaration;
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
static var UIObjectDependency = mx.core.UIObject;
}
Symbol 261 MovieClip [__Packages.mx.managers.DepthManager] Frame 0
class mx.managers.DepthManager
{
var _childCounter, createClassObject, createObject, _parent, swapDepths, _topmost, getDepth;
function DepthManager () {
MovieClip.prototype.createClassChildAtDepth = createClassChildAtDepth;
MovieClip.prototype.createChildAtDepth = createChildAtDepth;
MovieClip.prototype.setDepthTo = setDepthTo;
MovieClip.prototype.setDepthAbove = setDepthAbove;
MovieClip.prototype.setDepthBelow = setDepthBelow;
MovieClip.prototype.findNextAvailableDepth = findNextAvailableDepth;
MovieClip.prototype.shuffleDepths = shuffleDepths;
MovieClip.prototype.getDepthByFlag = getDepthByFlag;
MovieClip.prototype.buildDepthTable = buildDepthTable;
_global.ASSetPropFlags(MovieClip.prototype, "createClassChildAtDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "createChildAtDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthTo", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthAbove", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthBelow", 1);
_global.ASSetPropFlags(MovieClip.prototype, "findNextAvailableDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "shuffleDepths", 1);
_global.ASSetPropFlags(MovieClip.prototype, "getDepthByFlag", 1);
_global.ASSetPropFlags(MovieClip.prototype, "buildDepthTable", 1);
}
static function sortFunction(a, b) {
if (a.getDepth() > b.getDepth()) {
return(1);
}
return(-1);
}
static function test(depth) {
if (depth == reservedDepth) {
return(false);
}
return(true);
}
static function createClassObjectAtDepth(className, depthSpace, initObj) {
var _local1;
switch (depthSpace) {
case kCursor :
_local1 = holder.createClassChildAtDepth(className, kTopmost, initObj);
break;
case kTooltip :
_local1 = holder.createClassChildAtDepth(className, kTop, initObj);
break;
}
return(_local1);
}
static function createObjectAtDepth(linkageName, depthSpace, initObj) {
var _local1;
switch (depthSpace) {
case kCursor :
_local1 = holder.createChildAtDepth(linkageName, kTopmost, initObj);
break;
case kTooltip :
_local1 = holder.createChildAtDepth(linkageName, kTop, initObj);
break;
}
return(_local1);
}
function createClassChildAtDepth(className, depthFlag, initObj) {
if (_childCounter == undefined) {
_childCounter = 0;
}
var _local3 = buildDepthTable();
var _local2 = getDepthByFlag(depthFlag, _local3);
var _local6 = "down";
if (depthFlag == kBottom) {
_local6 = "up";
}
var _local5;
if (_local3[_local2] != undefined) {
_local5 = _local2;
_local2 = findNextAvailableDepth(_local2, _local3, _local6);
}
var _local4 = createClassObject(className, "depthChild" + (_childCounter++), _local2, initObj);
if (_local5 != undefined) {
_local3[_local2] = _local4;
shuffleDepths(_local4, _local5, _local3, _local6);
}
if (depthFlag == kTopmost) {
_local4._topmost = true;
}
return(_local4);
}
function createChildAtDepth(linkageName, depthFlag, initObj) {
if (_childCounter == undefined) {
_childCounter = 0;
}
var _local3 = buildDepthTable();
var _local2 = getDepthByFlag(depthFlag, _local3);
var _local6 = "down";
if (depthFlag == kBottom) {
_local6 = "up";
}
var _local5;
if (_local3[_local2] != undefined) {
_local5 = _local2;
_local2 = findNextAvailableDepth(_local2, _local3, _local6);
}
var _local4 = createObject(linkageName, "depthChild" + (_childCounter++), _local2, initObj);
if (_local5 != undefined) {
_local3[_local2] = _local4;
shuffleDepths(_local4, _local5, _local3, _local6);
}
if (depthFlag == kTopmost) {
_local4._topmost = true;
}
return(_local4);
}
function setDepthTo(depthFlag) {
var _local2 = _parent.buildDepthTable();
var _local3 = _parent.getDepthByFlag(depthFlag, _local2);
if (_local2[_local3] != undefined) {
shuffleDepths(this, _local3, _local2, undefined);
} else {
swapDepths(_local3);
}
if (depthFlag == kTopmost) {
_topmost = true;
} else {
delete _topmost;
}
}
function setDepthAbove(targetInstance) {
if (targetInstance._parent != _parent) {
return(undefined);
}
var _local2 = targetInstance.getDepth() + 1;
var _local3 = _parent.buildDepthTable();
if ((_local3[_local2] != undefined) && (getDepth() < _local2)) {
_local2 = _local2 - 1;
}
if (_local2 > highestDepth) {
_local2 = highestDepth;
}
if (_local2 == highestDepth) {
_parent.shuffleDepths(this, _local2, _local3, "down");
} else if (_local3[_local2] != undefined) {
_parent.shuffleDepths(this, _local2, _local3, undefined);
} else {
swapDepths(_local2);
}
}
function setDepthBelow(targetInstance) {
if (targetInstance._parent != _parent) {
return(undefined);
}
var _local6 = targetInstance.getDepth() - 1;
var _local3 = _parent.buildDepthTable();
if ((_local3[_local6] != undefined) && (getDepth() > _local6)) {
_local6 = _local6 + 1;
}
var _local4 = lowestDepth + numberOfAuthortimeLayers;
var _local5;
for (_local5 in _local3) {
var _local2 = _local3[_local5];
if (_local2._parent != undefined) {
_local4 = Math.min(_local4, _local2.getDepth());
}
}
if (_local6 < _local4) {
_local6 = _local4;
}
if (_local6 == _local4) {
_parent.shuffleDepths(this, _local6, _local3, "up");
} else if (_local3[_local6] != undefined) {
_parent.shuffleDepths(this, _local6, _local3, undefined);
} else {
swapDepths(_local6);
}
}
function findNextAvailableDepth(targetDepth, depthTable, direction) {
var _local5 = lowestDepth + numberOfAuthortimeLayers;
if (targetDepth < _local5) {
targetDepth = _local5;
}
if (depthTable[targetDepth] == undefined) {
return(targetDepth);
}
var _local2 = targetDepth;
var _local1 = targetDepth;
if (direction == "down") {
while (depthTable[_local1] != undefined) {
_local1--;
}
return(_local1);
}
while (depthTable[_local2] != undefined) {
_local2++;
}
return(_local2);
}
function shuffleDepths(subject, targetDepth, depthTable, direction) {
var _local9 = lowestDepth + numberOfAuthortimeLayers;
var _local8 = _local9;
var _local5;
for (_local5 in depthTable) {
var _local7 = depthTable[_local5];
if (_local7._parent != undefined) {
_local9 = Math.min(_local9, _local7.getDepth());
}
}
if (direction == undefined) {
if (subject.getDepth() > targetDepth) {
direction = "up";
} else {
direction = "down";
}
}
var _local1 = new Array();
for (_local5 in depthTable) {
var _local7 = depthTable[_local5];
if (_local7._parent != undefined) {
_local1.push(_local7);
}
}
_local1.sort(sortFunction);
if (direction == "up") {
var _local3;
var _local11;
do {
if (_local1.length <= 0) {
break;
}
_local3 = _local1.pop();
} while (_local3 != subject);
do {
if (_local1.length <= 0) {
break;
}
_local11 = subject.getDepth();
_local3 = _local1.pop();
var _local4 = _local3.getDepth();
if (_local11 > (_local4 + 1)) {
if (_local4 >= 0) {
subject.swapDepths(_local4 + 1);
} else if ((_local11 > _local8) && (_local4 < _local8)) {
subject.swapDepths(_local8);
}
}
subject.swapDepths(_local3);
} while (_local4 != targetDepth);
} else if (direction == "down") {
var _local3;
do {
if (_local1.length <= 0) {
break;
}
_local3 = _local1.shift();
} while (_local3 != subject);
do {
if (_local1.length <= 0) {
break;
}
var _local11 = _local3.getDepth();
_local3 = _local1.shift();
var _local4 = _local3.getDepth();
if ((_local11 < (_local4 - 1)) && (_local4 > 0)) {
subject.swapDepths(_local4 - 1);
}
subject.swapDepths(_local3);
} while (_local4 != targetDepth);
}
}
function getDepthByFlag(depthFlag, depthTable) {
var _local2 = 0;
if ((depthFlag == kTop) || (depthFlag == kNotopmost)) {
var _local5 = 0;
var _local7 = false;
var _local8;
for (_local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
if (!_local9._topmost) {
_local2 = Math.max(_local2, _local9.getDepth());
} else if (!_local7) {
_local5 = _local9.getDepth();
_local7 = true;
} else {
_local5 = Math.min(_local5, _local9.getDepth());
}
}
}
}
_local2 = _local2 + 20;
if (_local7) {
if (_local2 >= _local5) {
_local2 = _local5 - 1;
}
}
} else if (depthFlag == kBottom) {
for (var _local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
_local2 = Math.min(_local2, _local9.getDepth());
}
}
}
_local2 = _local2 - 20;
} else if (depthFlag == kTopmost) {
for (var _local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
_local2 = Math.max(_local2, _local9.getDepth());
}
}
}
_local2 = _local2 + 100;
}
if (_local2 >= highestDepth) {
_local2 = highestDepth;
}
var _local6 = lowestDepth + numberOfAuthortimeLayers;
for (var _local9 in depthTable) {
var _local4 = depthTable[_local9];
if (_local4._parent != undefined) {
_local6 = Math.min(_local6, _local4.getDepth());
}
}
if (_local2 <= _local6) {
_local2 = _local6;
}
return(_local2);
}
function buildDepthTable(Void) {
var _local5 = new Array();
var _local4;
for (_local4 in this) {
var _local2 = this[_local4];
var _local3 = typeof(_local2);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local2.__getTextFormat != undefined))) {
if (_local2._parent == this) {
_local5[_local2.getDepth()] = _local2;
}
}
}
return(_local5);
}
static var reservedDepth = 1048575;
static var highestDepth = 1048574;
static var lowestDepth = -16383;
static var numberOfAuthortimeLayers = 383;
static var kCursor = 101;
static var kTooltip = 102;
static var kTop = 201;
static var kBottom = 202;
static var kTopmost = 203;
static var kNotopmost = 204;
static var holder = _root.createEmptyMovieClip("reserved", reservedDepth);
static var __depthManager = new mx.managers.DepthManager();
}
Symbol 262 MovieClip [__Packages.mx.managers.SystemManager] Frame 0
class mx.managers.SystemManager
{
static var _xAddEventListener, addEventListener, __addEventListener, _xRemoveEventListener, removeEventListener, __removeEventListener, form, __screen, dispatchEvent;
function SystemManager () {
}
static function init(Void) {
if (_initialized == false) {
_initialized = true;
mx.events.EventDispatcher.initialize(mx.managers.SystemManager);
Mouse.addListener(mx.managers.SystemManager);
Stage.addListener(mx.managers.SystemManager);
_xAddEventListener = addEventListener;
addEventListener = __addEventListener;
_xRemoveEventListener = removeEventListener;
removeEventListener = __removeEventListener;
}
}
static function addFocusManager(f) {
form = f;
f.focusManager.activate();
}
static function removeFocusManager(f) {
}
static function onMouseDown(Void) {
var _local1 = form;
_local1.focusManager._onMouseDown();
}
static function onResize(Void) {
var _local7 = Stage.width;
var _local6 = Stage.height;
var _local9 = _global.origWidth;
var _local8 = _global.origHeight;
var _local3 = Stage.align;
var _local5 = (_local9 - _local7) / 2;
var _local4 = (_local8 - _local6) / 2;
if (_local3 == "T") {
_local4 = 0;
} else if (_local3 == "B") {
_local4 = _local8 - _local6;
} else if (_local3 == "L") {
_local5 = 0;
} else if (_local3 == "R") {
_local5 = _local9 - _local7;
} else if (_local3 == "LT") {
_local4 = 0;
_local5 = 0;
} else if (_local3 == "TR") {
_local4 = 0;
_local5 = _local9 - _local7;
} else if (_local3 == "LB") {
_local4 = _local8 - _local6;
_local5 = 0;
} else if (_local3 == "RB") {
_local4 = _local8 - _local6;
_local5 = _local9 - _local7;
}
if (__screen == undefined) {
__screen = new Object();
}
__screen.x = _local5;
__screen.y = _local4;
__screen.width = _local7;
__screen.height = _local6;
_root.focusManager.relocate();
dispatchEvent({type:"resize"});
}
static function get screen() {
init();
if (__screen == undefined) {
onResize();
}
return(__screen);
}
static var _initialized = false;
static var idleFrames = 0;
static var isMouseDown = false;
static var forms = new Array();
}
Symbol 263 MovieClip [__Packages.mx.managers.FocusManager] Frame 0
class mx.managers.FocusManager extends mx.core.UIComponent
{
var __defaultPushButton, defPushButton, form, move, tabEnabled, _width, _height, _x, _y, _alpha, _parent, tabCapture, watch, lastMouse, _visible, lastFocus, doLater, lastSelFocus, cancelAllDoLaters, _searchKey, _lastTarget, _firstNode, _nextIsNext, _nextNode, _lastx, _prevNode, _needPrev, _foundList, _prevObj, _nextObj, _firstObj, _lastObj, _lastNode, lastTabFocus, findFocusFromObject;
function FocusManager () {
super();
}
function get defaultPushButton() {
return(__defaultPushButton);
}
function set defaultPushButton(x) {
if (x != __defaultPushButton) {
__defaultPushButton.__set__emphasized(false);
__defaultPushButton = x;
defPushButton = x;
x.__set__emphasized(true);
}
//return(defaultPushButton);
}
function getMaxTabIndex(o) {
var _local3 = 0;
var _local6;
for (_local6 in o) {
var _local2 = o[_local6];
if (_local2._parent == o) {
if (_local2.tabIndex != undefined) {
if (_local2.tabIndex > _local3) {
_local3 = _local2.tabIndex;
}
}
if (_local2.tabChildren == true) {
var _local4 = getMaxTabIndex(_local2);
if (_local4 > _local3) {
_local3 = _local4;
}
}
}
}
return(_local3);
}
function getNextTabIndex(Void) {
return(getMaxTabIndex(form) + 1);
}
function get nextTabIndex() {
return(getNextTabIndex());
}
function relocate(Void) {
var _local2 = mx.managers.SystemManager.__get__screen();
move(_local2.x - 1, _local2.y - 1);
}
function init(Void) {
super.init();
tabEnabled = false;
_width = (_height = 1);
_x = (_y = -1);
_alpha = 0;
_parent.focusManager = this;
_parent.tabChildren = true;
_parent.tabEnabled = false;
form = _parent;
_parent.addEventListener("hide", this);
_parent.addEventListener("reveal", this);
mx.managers.SystemManager.init();
mx.managers.SystemManager.addFocusManager(form);
tabCapture.tabIndex = 0;
watch("enabled", enabledChanged);
Selection.addListener(this);
lastMouse = new Object();
_global.ASSetPropFlags(_parent, "focusManager", 1);
_global.ASSetPropFlags(_parent, "tabChildren", 1);
_global.ASSetPropFlags(_parent, "tabEnabled", 1);
}
function enabledChanged(id, oldValue, newValue) {
_visible = newValue;
return(newValue);
}
function activate(Void) {
Key.addListener(this);
activated = (_visible = true);
if (lastFocus != undefined) {
bNeedFocus = true;
if (!mx.managers.SystemManager.isMouseDown) {
doLater(this, "restoreFocus");
}
}
}
function deactivate(Void) {
Key.removeListener(this);
activated = (_visible = false);
var _local2 = getSelectionFocus();
var _local3 = getActualFocus(_local2);
if (isOurFocus(_local3)) {
lastSelFocus = _local2;
lastFocus = _local3;
}
cancelAllDoLaters();
}
function isOurFocus(o) {
if (o.focusManager == this) {
return(true);
}
while (o != undefined) {
if (o.focusManager != undefined) {
return(false);
}
if (o._parent == _parent) {
return(true);
}
o = o._parent;
}
return(false);
}
function onSetFocus(o, n) {
if (n == null) {
if (activated) {
bNeedFocus = true;
}
} else {
var _local2 = getFocus();
if (isOurFocus(_local2)) {
bNeedFocus = false;
lastFocus = _local2;
lastSelFocus = n;
}
}
}
function restoreFocus(Void) {
var _local2 = lastSelFocus.hscroll;
if (_local2 != undefined) {
var _local5 = lastSelFocus.scroll;
var _local4 = lastSelFocus.background;
}
lastFocus.setFocus();
var _local3 = Selection;
Selection.setSelection(_local3.lastBeginIndex, _local3.lastEndIndex);
if (_local2 != undefined) {
lastSelFocus.scroll = _local5;
lastSelFocus.hscroll = _local2;
lastSelFocus.background = _local4;
}
}
function onUnload(Void) {
mx.managers.SystemManager.removeFocusManager(form);
}
function setFocus(o) {
if (o == null) {
Selection.setFocus(null);
} else if (o.setFocus == undefined) {
Selection.setFocus(o);
} else {
o.setFocus();
}
}
function getActualFocus(o) {
var _local1 = o._parent;
while (_local1 != undefined) {
if (_local1.focusTextField != undefined) {
while (_local1.focusTextField != undefined) {
o = _local1;
_local1 = _local1._parent;
if (_local1 == undefined) {
return(undefined);
}
if (_local1.focusTextField == undefined) {
return(o);
}
}
}
if (_local1.tabEnabled != true) {
return(o);
}
o = _local1;
_local1 = o._parent;
}
return(undefined);
}
function getSelectionFocus() {
var m = Selection.getFocus();
var o = eval (m);
return(o);
}
function getFocus(Void) {
var _local2 = getSelectionFocus();
return(getActualFocus(_local2));
}
function walkTree(p, index, groupName, dir, lookup, firstChild) {
var _local5 = true;
var _local11;
for (_local11 in p) {
var _local2 = p[_local11];
if ((((_local2._parent == p) && (_local2.enabled != false)) && (_local2._visible != false)) && ((_local2.tabEnabled == true) || ((_local2.tabEnabled != false) && ((((((((_local2.onPress != undefined) || (_local2.onRelease != undefined)) || (_local2.onReleaseOutside != undefined)) || (_local2.onDragOut != undefined)) || (_local2.onDragOver != undefined)) || (_local2.onRollOver != undefined)) || (_local2.onRollOut != undefined)) || (_local2 instanceof TextField))))) {
if (_local2._searchKey == _searchKey) {
continue;
}
_local2._searchKey = _searchKey;
if (_local2 != _lastTarget) {
if (((_local2.groupName != undefined) || (groupName != undefined)) && (_local2.groupName == groupName)) {
continue;
}
if ((_local2 instanceof TextField) && (_local2.selectable == false)) {
continue;
}
if (_local5 || (((_local2.groupName != undefined) && (_local2.groupName == _firstNode.groupName)) && (_local2.selected == true))) {
if (firstChild) {
_firstNode = _local2;
firstChild = false;
}
}
if (_nextIsNext == true) {
if ((((_local2.groupName != undefined) && (_local2.groupName == _nextNode.groupName)) && (_local2.selected == true)) || ((_nextNode == undefined) && ((_local2.groupName == undefined) || ((_local2.groupName != undefined) && (_local2.groupName != groupName))))) {
_nextNode = _local2;
}
}
if ((_local2.groupName == undefined) || (groupName != _local2.groupName)) {
if (((_lastx.groupName != undefined) && (_local2.groupName == _lastx.groupName)) && (_lastx.selected == true)) {
} else {
_lastx = _local2;
}
}
} else {
_prevNode = _lastx;
_needPrev = false;
_nextIsNext = true;
}
if (_local2.tabIndex != undefined) {
if (_local2.tabIndex == index) {
if (_foundList[_local2._name] == undefined) {
if (_needPrev) {
_prevObj = _local2;
_needPrev = false;
}
_nextObj = _local2;
}
}
if (dir && (_local2.tabIndex > index)) {
if (((_nextObj == undefined) || ((_nextObj.tabIndex > _local2.tabIndex) && (((_local2.groupName == undefined) || (_nextObj.groupName == undefined)) || (_local2.groupName != _nextObj.groupName)))) || ((((_nextObj.groupName != undefined) && (_nextObj.groupName == _local2.groupName)) && (_nextObj.selected != true)) && ((_local2.selected == true) || (_nextObj.tabIndex > _local2.tabIndex)))) {
_nextObj = _local2;
}
} else if ((!dir) && (_local2.tabIndex < index)) {
if (((_prevObj == undefined) || ((_prevObj.tabIndex < _local2.tabIndex) && (((_local2.groupName == undefined) || (_prevObj.groupName == undefined)) || (_local2.groupName != _prevObj.groupName)))) || ((((_prevObj.groupName != undefined) && (_prevObj.groupName == _local2.groupName)) && (_prevObj.selected != true)) && ((_local2.selected == true) || (_prevObj.tabIndex < _local2.tabIndex)))) {
_prevObj = _local2;
}
}
if (((_firstObj == undefined) || ((_local2.tabIndex < _firstObj.tabIndex) && (((_local2.groupName == undefined) || (_firstObj.groupName == undefined)) || (_local2.groupName != _firstObj.groupName)))) || ((((_firstObj.groupName != undefined) && (_firstObj.groupName == _local2.groupName)) && (_firstObj.selected != true)) && ((_local2.selected == true) || (_local2.tabIndex < _firstObj.tabIndex)))) {
_firstObj = _local2;
}
if (((_lastObj == undefined) || ((_local2.tabIndex > _lastObj.tabIndex) && (((_local2.groupName == undefined) || (_lastObj.groupName == undefined)) || (_local2.groupName != _lastObj.groupName)))) || ((((_lastObj.groupName != undefined) && (_lastObj.groupName == _local2.groupName)) && (_lastObj.selected != true)) && ((_local2.selected == true) || (_local2.tabIndex > _lastObj.tabIndex)))) {
_lastObj = _local2;
}
}
if (_local2.tabChildren) {
getTabCandidateFromChildren(_local2, index, groupName, dir, _local5 && (firstChild));
}
_local5 = false;
} else if (((_local2._parent == p) && (_local2.tabChildren == true)) && (_local2._visible != false)) {
if (_local2 == _lastTarget) {
if (_local2._searchKey == _searchKey) {
continue;
}
_local2._searchKey = _searchKey;
if (_prevNode == undefined) {
var _local3 = _lastx;
var _local7 = false;
while (_local3 != undefined) {
if (_local3 == _local2) {
_local7 = true;
break;
}
_local3 = _local3._parent;
}
if (_local7 == false) {
_prevNode = _lastx;
}
}
_needPrev = false;
if (_nextNode == undefined) {
_nextIsNext = true;
}
} else if (!((_local2.focusManager != undefined) && (_local2.focusManager._parent == _local2))) {
if (_local2._searchKey == _searchKey) {
continue;
}
_local2._searchKey = _searchKey;
getTabCandidateFromChildren(_local2, index, groupName, dir, _local5 && (firstChild));
}
_local5 = false;
}
}
_lastNode = _lastx;
if (lookup) {
if (p._parent != undefined) {
if (p != _parent) {
if ((_prevNode == undefined) && (dir)) {
_needPrev = true;
} else if ((_nextNode == undefined) && (!dir)) {
_nextIsNext = false;
}
_lastTarget = _lastTarget._parent;
getTabCandidate(p._parent, index, groupName, dir, true);
}
}
}
}
function getTabCandidate(o, index, groupName, dir, firstChild) {
var _local2;
var _local3 = true;
if (o == _parent) {
_local2 = o;
_local3 = false;
} else {
_local2 = o._parent;
if (_local2 == undefined) {
_local2 = o;
_local3 = false;
}
}
walkTree(_local2, index, groupName, dir, _local3, firstChild);
}
function getTabCandidateFromChildren(o, index, groupName, dir, firstChild) {
walkTree(o, index, groupName, dir, false, firstChild);
}
function getFocusManagerFromObject(o) {
while (o != undefined) {
if (o.focusManager != undefined) {
return(o.focusManager);
}
o = o._parent;
}
return(undefined);
}
function tabHandler(Void) {
bDrawFocus = true;
var _local5 = getSelectionFocus();
var _local4 = getActualFocus(_local5);
if (_local4 != _local5) {
_local5 = _local4;
}
if (getFocusManagerFromObject(_local5) != this) {
_local5 == undefined;
}
if (_local5 == undefined) {
_local5 = form;
} else if (_local5.tabIndex != undefined) {
if ((_foundList != undefined) || (_foundList.tabIndex != _local5.tabIndex)) {
_foundList = new Object();
_foundList.tabIndex = _local5.tabIndex;
}
_foundList[_local5._name] = _local5;
}
var _local3 = Key.isDown(16) != true;
_searchKey = getTimer();
_needPrev = true;
_nextIsNext = false;
_lastx = undefined;
_firstNode = undefined;
_lastNode = undefined;
_nextNode = undefined;
_prevNode = undefined;
_firstObj = undefined;
_lastObj = undefined;
_nextObj = undefined;
_prevObj = undefined;
_lastTarget = _local5;
var _local6 = _local5;
getTabCandidate(_local6, ((_local5.tabIndex == undefined) ? 0 : (_local5.tabIndex)), _local5.groupName, _local3, true);
var _local2;
if (_local3) {
if (_nextObj != undefined) {
_local2 = _nextObj;
} else {
_local2 = _firstObj;
}
} else if (_prevObj != undefined) {
_local2 = _prevObj;
} else {
_local2 = _lastObj;
}
if (_local2.tabIndex != _local5.tabIndex) {
_foundList = new Object();
_foundList.tabIndex = _local2.tabIndex;
_foundList[_local2._name] = _local2;
} else {
if (_foundList == undefined) {
_foundList = new Object();
_foundList.tabIndex = _local2.tabIndex;
}
_foundList[_local2._name] = _local2;
}
if (_local2 == undefined) {
if (_local3 == false) {
if (_nextNode != undefined) {
_local2 = _nextNode;
} else {
_local2 = _firstNode;
}
} else if ((_prevNode == undefined) || (_local5 == form)) {
_local2 = _lastNode;
} else {
_local2 = _prevNode;
}
}
if (_local2 == undefined) {
return(undefined);
}
lastTabFocus = _local2;
setFocus(_local2);
if (_local2.emphasized != undefined) {
if (defPushButton != undefined) {
_local5 = defPushButton;
defPushButton = _local2;
_local5.emphasized = false;
_local2.emphasized = true;
}
} else if ((defPushButton != undefined) && (defPushButton != __defaultPushButton)) {
_local5 = defPushButton;
defPushButton = __defaultPushButton;
_local5.emphasized = false;
__defaultPushButton.__set__emphasized(true);
}
}
function onKeyDown(Void) {
mx.managers.SystemManager.idleFrames = 0;
if (defaultPushButtonEnabled) {
if (Key.getCode() == 13) {
if (defaultPushButton != undefined) {
doLater(this, "sendDefaultPushButtonEvent");
}
}
}
}
function sendDefaultPushButtonEvent(Void) {
defPushButton.dispatchEvent({type:"click"});
}
function getMousedComponentFromChildren(x, y, o) {
for (var _local7 in o) {
var _local2 = o[_local7];
if (((_local2._visible && (_local2.enabled)) && (_local2._parent == o)) && (_local2._searchKey != _searchKey)) {
_local2._searchKey = _searchKey;
if (_local2.hitTest(x, y, true)) {
if ((_local2.onPress != undefined) || (_local2.onRelease != undefined)) {
return(_local2);
}
var _local3 = getMousedComponentFromChildren(x, y, _local2);
if (_local3 != undefined) {
return(_local3);
}
return(_local2);
}
}
}
return(undefined);
}
function mouseActivate(Void) {
if (!bNeedFocus) {
return(undefined);
}
_searchKey = getTimer();
var _local2 = getMousedComponentFromChildren(lastMouse.x, lastMouse.y, form);
if (_local2 instanceof mx.core.UIComponent) {
return(undefined);
}
_local2 = findFocusFromObject(_local2);
if (_local2 == lastFocus) {
return(undefined);
}
if (_local2 == undefined) {
doLater(this, "restoreFocus");
return(undefined);
}
var _local3 = _local2.hscroll;
if (_local3 != undefined) {
var _local6 = _local2.scroll;
var _local5 = _local2.background;
}
setFocus(_local2);
var _local4 = Selection;
Selection.setSelection(_local4.lastBeginIndex, _local4.lastEndIndex);
if (_local3 != undefined) {
_local2.scroll = _local6;
_local2.hscroll = _local3;
_local2.background = _local5;
}
}
function _onMouseDown(Void) {
bDrawFocus = false;
if (lastFocus != undefined) {
lastFocus.drawFocus(false);
}
mx.managers.SystemManager.idleFrames = 0;
var _local3 = Selection;
_local3.lastBeginIndex = Selection.getBeginIndex();
_local3.lastEndIndex = Selection.getEndIndex();
lastMouse.x = _root._xmouse;
lastMouse.y = _root._ymouse;
_root.localToGlobal(lastMouse);
}
function onMouseUp(Void) {
if (_visible) {
doLater(this, "mouseActivate");
}
}
function handleEvent(e) {
if (e.type == "reveal") {
mx.managers.SystemManager.activate(form);
} else {
mx.managers.SystemManager.deactivate(form);
}
}
static function enableFocusManagement() {
if (!initialized) {
initialized = true;
Object.registerClass("FocusManager", mx.managers.FocusManager);
if (_root.focusManager == undefined) {
_root.createClassObject(mx.managers.FocusManager, "focusManager", mx.managers.DepthManager.highestDepth--);
}
}
}
static var symbolName = "FocusManager";
static var symbolOwner = mx.managers.FocusManager;
static var version = "2.0.2.127";
var className = "FocusManager";
var bNeedFocus = false;
var bDrawFocus = false;
var defaultPushButtonEnabled = true;
var activated = true;
static var initialized = false;
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
}
Symbol 264 MovieClip [__Packages.mx.skins.halo.FocusRect] Frame 0
class mx.skins.halo.FocusRect extends mx.skins.SkinElement
{
var boundingBox_mc, _xscale, _yscale, clear, beginFill, drawRoundRect, endFill, _visible;
function FocusRect () {
super();
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
function draw(o) {
o.adjustFocusRect();
}
function setSize(w, h, r, a, rectCol) {
_xscale = (_yscale = 100);
clear();
if (typeof(r) == "object") {
r.br = ((r.br > 2) ? (r.br - 2) : 0);
r.bl = ((r.bl > 2) ? (r.bl - 2) : 0);
r.tr = ((r.tr > 2) ? (r.tr - 2) : 0);
r.tl = ((r.tl > 2) ? (r.tl - 2) : 0);
beginFill(rectCol, a * 0.3);
drawRoundRect(0, 0, w, h, r);
drawRoundRect(2, 2, w - 4, h - 4, r);
endFill();
r.br = ((r.br > 1) ? (r.br + 1) : 0);
r.bl = ((r.bl > 1) ? (r.bl + 1) : 0);
r.tr = ((r.tr > 1) ? (r.tr + 1) : 0);
r.tl = ((r.tl > 1) ? (r.tl + 1) : 0);
beginFill(rectCol, a * 0.3);
drawRoundRect(1, 1, w - 2, h - 2, r);
r.br = ((r.br > 1) ? (r.br - 1) : 0);
r.bl = ((r.bl > 1) ? (r.bl - 1) : 0);
r.tr = ((r.tr > 1) ? (r.tr - 1) : 0);
r.tl = ((r.tl > 1) ? (r.tl - 1) : 0);
drawRoundRect(2, 2, w - 4, h - 4, r);
endFill();
} else {
var _local5;
if (r != 0) {
_local5 = r - 2;
} else {
_local5 = 0;
}
beginFill(rectCol, a * 0.3);
drawRoundRect(0, 0, w, h, r);
drawRoundRect(2, 2, w - 4, h - 4, _local5);
endFill();
beginFill(rectCol, a * 0.3);
if (r != 0) {
_local5 = r - 2;
r = r - 1;
} else {
_local5 = 0;
r = 0;
}
drawRoundRect(1, 1, w - 2, h - 2, r);
drawRoundRect(2, 2, w - 4, h - 4, _local5);
endFill();
}
}
function handleEvent(e) {
if (e.type == "unload") {
_visible = true;
} else if (e.type == "resize") {
e.target.adjustFocusRect();
} else if (e.type == "move") {
e.target.adjustFocusRect();
}
}
static function classConstruct() {
mx.core.UIComponent.prototype.drawFocus = function (focused) {
var _local2 = this._parent.focus_mc;
if (!focused) {
_local2._visible = false;
this.removeEventListener("unload", _local2);
this.removeEventListener("move", _local2);
this.removeEventListener("resize", _local2);
} else {
if (_local2 == undefined) {
_local2 = this._parent.createChildAtDepth("FocusRect", mx.managers.DepthManager.kTop);
_local2.tabEnabled = false;
this._parent.focus_mc = _local2;
} else {
_local2._visible = true;
}
_local2.draw(this);
if (_local2.getDepth() < this.getDepth()) {
_local2.setDepthAbove(this);
}
this.addEventListener("unload", _local2);
this.addEventListener("move", _local2);
this.addEventListener("resize", _local2);
}
};
mx.core.UIComponent.prototype.adjustFocusRect = function () {
var _local2 = this.getStyle("themeColor");
if (_local2 == undefined) {
_local2 = 8453965 /* 0x80FF4D */;
}
var _local3 = this._parent.focus_mc;
_local3.setSize(this.width + 4, this.height + 4, 0, 100, _local2);
_local3.move(this.x - 2, this.y - 2);
};
TextField.prototype.drawFocus = mx.core.UIComponent.prototype.drawFocus;
TextField.prototype.adjustFocusRect = mx.core.UIComponent.prototype.adjustFocusRect;
mx.skins.halo.FocusRect.prototype.drawRoundRect = mx.skins.halo.Defaults.prototype.drawRoundRect;
return(true);
}
static var classConstructed = classConstruct();
static var DefaultsDependency = mx.skins.halo.Defaults;
static var UIComponentDependency = mx.core.UIComponent;
}
Symbol 265 MovieClip [__Packages.mx.managers.OverlappedWindows] Frame 0
class mx.managers.OverlappedWindows
{
function OverlappedWindows () {
}
static function checkIdle(Void) {
if (mx.managers.SystemManager.idleFrames > 10) {
mx.managers.SystemManager.dispatchEvent({type:"idle"});
} else {
mx.managers.SystemManager.idleFrames++;
}
}
static function __addEventListener(e, o, l) {
if (e == "idle") {
if (mx.managers.SystemManager.interval == undefined) {
mx.managers.SystemManager.interval = setInterval(mx.managers.SystemManager.checkIdle, 100);
}
}
mx.managers.SystemManager._xAddEventListener(e, o, l);
}
static function __removeEventListener(e, o, l) {
if (e == "idle") {
if (mx.managers.SystemManager._xRemoveEventListener(e, o, l) == 0) {
clearInterval(mx.managers.SystemManager.interval);
}
} else {
mx.managers.SystemManager._xRemoveEventListener(e, o, l);
}
}
static function onMouseDown(Void) {
mx.managers.SystemManager.idleFrames = 0;
mx.managers.SystemManager.isMouseDown = true;
var _local5 = _root;
var _local3;
var _local8 = _root._xmouse;
var _local7 = _root._ymouse;
if (mx.managers.SystemManager.form.modalWindow == undefined) {
if (mx.managers.SystemManager.forms.length > 1) {
var _local6 = mx.managers.SystemManager.forms.length;
var _local4;
_local4 = 0;
while (_local4 < _local6) {
var _local2 = mx.managers.SystemManager.forms[_local4];
if (_local2._visible) {
if (_local2.hitTest(_local8, _local7)) {
if (_local3 == undefined) {
_local3 = _local2.getDepth();
_local5 = _local2;
} else if (_local3 < _local2.getDepth()) {
_local3 = _local2.getDepth();
_local5 = _local2;
}
}
}
_local4++;
}
if (_local5 != mx.managers.SystemManager.form) {
mx.managers.SystemManager.activate(_local5);
}
}
}
var _local9 = mx.managers.SystemManager.form;
_local9.focusManager._onMouseDown();
}
static function onMouseMove(Void) {
mx.managers.SystemManager.idleFrames = 0;
}
static function onMouseUp(Void) {
mx.managers.SystemManager.isMouseDown = false;
mx.managers.SystemManager.idleFrames = 0;
}
static function activate(f) {
if (mx.managers.SystemManager.form != undefined) {
if ((mx.managers.SystemManager.form != f) && (mx.managers.SystemManager.forms.length > 1)) {
var _local1 = mx.managers.SystemManager.form;
_local1.focusManager.deactivate();
}
}
mx.managers.SystemManager.form = f;
f.focusManager.activate();
}
static function deactivate(f) {
if (mx.managers.SystemManager.form != undefined) {
if ((mx.managers.SystemManager.form == f) && (mx.managers.SystemManager.forms.length > 1)) {
var _local5 = mx.managers.SystemManager.form;
_local5.focusManager.deactivate();
var _local3 = mx.managers.SystemManager.forms.length;
var _local1;
var _local2;
_local1 = 0;
while (_local1 < _local3) {
if (mx.managers.SystemManager.forms[_local1] == f) {
_local1 = _local1 + 1;
while (_local1 < _local3) {
if (mx.managers.SystemManager.forms[_local1]._visible == true) {
_local2 = mx.managers.SystemManager.forms[_local1];
}
_local1++;
}
mx.managers.SystemManager.form = _local2;
break;
}
if (mx.managers.SystemManager.forms[_local1]._visible == true) {
_local2 = mx.managers.SystemManager.forms[_local1];
}
_local1++;
}
_local5 = mx.managers.SystemManager.form;
_local5.focusManager.activate();
}
}
}
static function addFocusManager(f) {
mx.managers.SystemManager.forms.push(f);
mx.managers.SystemManager.activate(f);
}
static function removeFocusManager(f) {
var _local3 = mx.managers.SystemManager.forms.length;
var _local1;
_local1 = 0;
while (_local1 < _local3) {
if (mx.managers.SystemManager.forms[_local1] == f) {
if (mx.managers.SystemManager.form == f) {
mx.managers.SystemManager.deactivate(f);
}
mx.managers.SystemManager.forms.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
static function enableOverlappedWindows() {
if (!initialized) {
initialized = true;
mx.managers.SystemManager.checkIdle = checkIdle;
mx.managers.SystemManager.__addEventListener = __addEventListener;
mx.managers.SystemManager.__removeEventListener = __removeEventListener;
mx.managers.SystemManager.onMouseDown = onMouseDown;
mx.managers.SystemManager.onMouseMove = onMouseMove;
mx.managers.SystemManager.onMouseUp = onMouseUp;
mx.managers.SystemManager.activate = activate;
mx.managers.SystemManager.deactivate = deactivate;
mx.managers.SystemManager.addFocusManager = addFocusManager;
mx.managers.SystemManager.removeFocusManager = removeFocusManager;
}
}
static var initialized = false;
static var SystemManagerDependency = mx.managers.SystemManager;
}
Symbol 266 MovieClip [__Packages.mx.styles.CSSSetStyle] Frame 0
class mx.styles.CSSSetStyle
{
var styleName, stylecache, _color, setColor, invalidateStyle;
function CSSSetStyle () {
}
function _setStyle(styleProp, newValue) {
this[styleProp] = newValue;
if (mx.styles.StyleManager.TextStyleMap[styleProp] != undefined) {
if (styleProp == "color") {
if (isNaN(newValue)) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
}
_level0.changeTextStyleInChildren(styleProp);
return(undefined);
}
if (mx.styles.StyleManager.isColorStyle(styleProp)) {
if (isNaN(newValue)) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
if (styleProp == "themeColor") {
var _local7 = mx.styles.StyleManager.colorNames.haloBlue;
var _local6 = mx.styles.StyleManager.colorNames.haloGreen;
var _local8 = mx.styles.StyleManager.colorNames.haloOrange;
var _local4 = {};
_local4[_local7] = 12188666 /* 0xB9FBFA */;
_local4[_local6] = 13500353 /* 0xCDFFC1 */;
_local4[_local8] = 16766319 /* 0xFFD56F */;
var _local5 = {};
_local5[_local7] = 13958653 /* 0xD4FDFD */;
_local5[_local6] = 14942166 /* 0xE3FFD6 */;
_local5[_local8] = 16772787 /* 0xFFEEB3 */;
var _local9 = _local4[newValue];
var _local10 = _local5[newValue];
if (_local9 == undefined) {
_local9 = newValue;
}
if (_local10 == undefined) {
_local10 = newValue;
}
setStyle("selectionColor", _local9);
setStyle("rollOverColor", _local10);
}
_level0.changeColorStyleInChildren(styleName, styleProp, newValue);
} else {
if ((styleProp == "backgroundColor") && (isNaN(newValue))) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
_level0.notifyStyleChangeInChildren(styleName, styleProp, newValue);
}
}
function changeTextStyleInChildren(styleProp) {
var _local4 = getTimer();
var _local5;
for (_local5 in this) {
var _local2 = this[_local5];
if (_local2._parent == this) {
if (_local2.searchKey != _local4) {
if (_local2.stylecache != undefined) {
delete _local2.stylecache.tf;
delete _local2.stylecache[styleProp];
}
_local2.invalidateStyle(styleProp);
_local2.changeTextStyleInChildren(styleProp);
_local2.searchKey = _local4;
}
}
}
}
function changeColorStyleInChildren(sheetName, colorStyle, newValue) {
var _local6 = getTimer();
var _local7;
for (_local7 in this) {
var _local2 = this[_local7];
if (_local2._parent == this) {
if (_local2.searchKey != _local6) {
if (((_local2.getStyleName() == sheetName) || (sheetName == undefined)) || (sheetName == "_global")) {
if (_local2.stylecache != undefined) {
delete _local2.stylecache[colorStyle];
}
if (typeof(_local2._color) == "string") {
if (_local2._color == colorStyle) {
var _local4 = _local2.getStyle(colorStyle);
if (colorStyle == "color") {
if (stylecache.tf.color != undefined) {
stylecache.tf.color = _local4;
}
}
_local2.setColor(_local4);
}
} else if (_local2._color[colorStyle] != undefined) {
if (typeof(_local2) != "movieclip") {
_local2._parent.invalidateStyle();
} else {
_local2.invalidateStyle(colorStyle);
}
}
}
_local2.changeColorStyleInChildren(sheetName, colorStyle, newValue);
_local2.searchKey = _local6;
}
}
}
}
function notifyStyleChangeInChildren(sheetName, styleProp, newValue) {
var _local5 = getTimer();
var _local6;
for (_local6 in this) {
var _local2 = this[_local6];
if (_local2._parent == this) {
if (_local2.searchKey != _local5) {
if (((_local2.styleName == sheetName) || ((_local2.styleName != undefined) && (typeof(_local2.styleName) == "movieclip"))) || (sheetName == undefined)) {
if (_local2.stylecache != undefined) {
delete _local2.stylecache[styleProp];
delete _local2.stylecache.tf;
}
delete _local2.enabledColor;
_local2.invalidateStyle(styleProp);
}
_local2.notifyStyleChangeInChildren(sheetName, styleProp, newValue);
_local2.searchKey = _local5;
}
}
}
}
function setStyle(styleProp, newValue) {
if (stylecache != undefined) {
delete stylecache[styleProp];
delete stylecache.tf;
}
this[styleProp] = newValue;
if (mx.styles.StyleManager.isColorStyle(styleProp)) {
if (isNaN(newValue)) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
if (styleProp == "themeColor") {
var _local10 = mx.styles.StyleManager.colorNames.haloBlue;
var _local9 = mx.styles.StyleManager.colorNames.haloGreen;
var _local11 = mx.styles.StyleManager.colorNames.haloOrange;
var _local6 = {};
_local6[_local10] = 12188666 /* 0xB9FBFA */;
_local6[_local9] = 13500353 /* 0xCDFFC1 */;
_local6[_local11] = 16766319 /* 0xFFD56F */;
var _local7 = {};
_local7[_local10] = 13958653 /* 0xD4FDFD */;
_local7[_local9] = 14942166 /* 0xE3FFD6 */;
_local7[_local11] = 16772787 /* 0xFFEEB3 */;
var _local12 = _local6[newValue];
var _local13 = _local7[newValue];
if (_local12 == undefined) {
_local12 = newValue;
}
if (_local13 == undefined) {
_local13 = newValue;
}
setStyle("selectionColor", _local12);
setStyle("rollOverColor", _local13);
}
if (typeof(_color) == "string") {
if (_color == styleProp) {
if (styleProp == "color") {
if (stylecache.tf.color != undefined) {
stylecache.tf.color = newValue;
}
}
setColor(newValue);
}
} else if (_color[styleProp] != undefined) {
invalidateStyle(styleProp);
}
changeColorStyleInChildren(undefined, styleProp, newValue);
} else {
if ((styleProp == "backgroundColor") && (isNaN(newValue))) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
invalidateStyle(styleProp);
}
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (styleProp == "styleName")) {
var _local8;
var _local5 = newValue;
if (styleProp == "styleName") {
_local8 = ((typeof(newValue) == "string") ? (_global.styles[newValue]) : (_local5));
_local5 = _local8.themeColor;
if (_local5 != undefined) {
_local8.rollOverColor = (_local8.selectionColor = _local5);
}
}
notifyStyleChangeInChildren(undefined, styleProp, newValue);
}
}
static function enableRunTimeCSS() {
}
static function classConstruct() {
var _local2 = MovieClip.prototype;
var _local3 = mx.styles.CSSSetStyle.prototype;
mx.styles.CSSStyleDeclaration.prototype.setStyle = _local3._setStyle;
_local2.changeTextStyleInChildren = _local3.changeTextStyleInChildren;
_local2.changeColorStyleInChildren = _local3.changeColorStyleInChildren;
_local2.notifyStyleChangeInChildren = _local3.notifyStyleChangeInChildren;
_local2.setStyle = _local3.setStyle;
_global.ASSetPropFlags(_local2, "changeTextStyleInChildren", 1);
_global.ASSetPropFlags(_local2, "changeColorStyleInChildren", 1);
_global.ASSetPropFlags(_local2, "notifyStyleChangeInChildren", 1);
_global.ASSetPropFlags(_local2, "setStyle", 1);
var _local4 = TextField.prototype;
_local4.setStyle = _local2.setStyle;
_local4.changeTextStyleInChildren = _local3.changeTextStyleInChildren;
return(true);
}
static var classConstructed = classConstruct();
static var CSSStyleDeclarationDependency = mx.styles.CSSStyleDeclaration;
}
Symbol 267 MovieClip [__Packages.mx.core.ext.UIComponentExtensions] Frame 0
class mx.core.ext.UIComponentExtensions
{
function UIComponentExtensions () {
}
static function Extensions() {
if (bExtended == true) {
return(true);
}
bExtended = true;
TextField.prototype.setFocus = function () {
Selection.setFocus(this);
};
TextField.prototype.onSetFocus = function (oldFocus) {
if (this.tabEnabled != false) {
if (this.getFocusManager().bDrawFocus) {
this.drawFocus(true);
}
}
};
TextField.prototype.onKillFocus = function (oldFocus) {
if (this.tabEnabled != false) {
this.drawFocus(false);
}
};
TextField.prototype.drawFocus = mx.core.UIComponent.prototype.drawFocus;
TextField.prototype.getFocusManager = mx.core.UIComponent.prototype.getFocusManager;
mx.managers.OverlappedWindows.enableOverlappedWindows();
mx.styles.CSSSetStyle.enableRunTimeCSS();
mx.managers.FocusManager.enableFocusManagement();
}
static var bExtended = false;
static var UIComponentExtended = Extensions();
static var UIComponentDependency = mx.core.UIComponent;
static var FocusManagerDependency = mx.managers.FocusManager;
static var OverlappedWindowsDependency = mx.managers.OverlappedWindows;
}
Symbol 268 MovieClip [__Packages.mx.skins.Border] Frame 0
class mx.skins.Border extends mx.core.UIObject
{
function Border () {
super();
}
function init(Void) {
super.init();
}
static var symbolName = "Border";
static var symbolOwner = mx.skins.Border;
var className = "Border";
var tagBorder = 0;
var idNames = new Array("border_mc");
}
Symbol 269 MovieClip [__Packages.mx.skins.RectBorder] Frame 0
class mx.skins.RectBorder extends mx.skins.Border
{
var __width, __height, offset, __borderMetrics;
function RectBorder () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function init(Void) {
super.init();
}
function draw(Void) {
size();
}
function getBorderMetrics(Void) {
var _local2 = offset;
if (__borderMetrics == undefined) {
__borderMetrics = {left:_local2, top:_local2, right:_local2, bottom:_local2};
} else {
__borderMetrics.left = _local2;
__borderMetrics.top = _local2;
__borderMetrics.right = _local2;
__borderMetrics.bottom = _local2;
}
return(__borderMetrics);
}
function get borderMetrics() {
return(getBorderMetrics());
}
function drawBorder(Void) {
}
function size(Void) {
drawBorder();
}
function setColor(Void) {
drawBorder();
}
static var symbolName = "RectBorder";
static var symbolOwner = mx.skins.RectBorder;
static var version = "2.0.2.127";
var className = "RectBorder";
var borderStyleName = "borderStyle";
var borderColorName = "borderColor";
var shadowColorName = "shadowColor";
var highlightColorName = "highlightColor";
var buttonColorName = "buttonColor";
var backgroundColorName = "backgroundColor";
}
Symbol 270 MovieClip [__Packages.mx.skins.halo.RectBorder] Frame 0
class mx.skins.halo.RectBorder extends mx.skins.RectBorder
{
var offset, getStyle, borderStyleName, __borderMetrics, className, borderColorName, backgroundColorName, shadowColorName, highlightColorName, buttonColorName, __get__width, __get__height, clear, _color, drawRoundRect, beginFill, drawRect, endFill;
function RectBorder () {
super();
}
function init(Void) {
borderWidths.default = 3;
super.init();
}
function getBorderMetrics(Void) {
if (offset == undefined) {
var _local3 = getStyle(borderStyleName);
offset = borderWidths[_local3];
}
if ((getStyle(borderStyleName) == "default") || (getStyle(borderStyleName) == "alert")) {
__borderMetrics = {left:3, top:1, right:3, bottom:3};
return(__borderMetrics);
}
return(super.getBorderMetrics());
}
function drawBorder(Void) {
var _local6 = _global.styles[className];
if (_local6 == undefined) {
_local6 = _global.styles.RectBorder;
}
var _local5 = getStyle(borderStyleName);
var _local7 = getStyle(borderColorName);
if (_local7 == undefined) {
_local7 = _local6[borderColorName];
}
var _local8 = getStyle(backgroundColorName);
if (_local8 == undefined) {
_local8 = _local6[backgroundColorName];
}
var _local16 = getStyle("backgroundImage");
if (_local5 != "none") {
var _local14 = getStyle(shadowColorName);
if (_local14 == undefined) {
_local14 = _local6[shadowColorName];
}
var _local13 = getStyle(highlightColorName);
if (_local13 == undefined) {
_local13 = _local6[highlightColorName];
}
var _local12 = getStyle(buttonColorName);
if (_local12 == undefined) {
_local12 = _local6[buttonColorName];
}
var _local11 = getStyle(borderCapColorName);
if (_local11 == undefined) {
_local11 = _local6[borderCapColorName];
}
var _local10 = getStyle(shadowCapColorName);
if (_local10 == undefined) {
_local10 = _local6[shadowCapColorName];
}
}
offset = borderWidths[_local5];
var _local9 = offset;
var _local3 = __get__width();
var _local4 = __get__height();
clear();
_color = undefined;
if (_local5 == "none") {
} else if (_local5 == "inset") {
_color = colorList;
draw3dBorder(_local11, _local12, _local7, _local13, _local14, _local10);
} else if (_local5 == "outset") {
_color = colorList;
draw3dBorder(_local11, _local7, _local12, _local14, _local13, _local10);
} else if (_local5 == "alert") {
var _local15 = getStyle("themeColor");
drawRoundRect(0, 5, _local3, _local4 - 5, 5, 6184542, 10);
drawRoundRect(1, 4, _local3 - 2, _local4 - 5, 4, [6184542, 6184542], 10, 0, "radial");
drawRoundRect(2, 0, _local3 - 4, _local4 - 2, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(2, 0, _local3 - 4, _local4 - 2, 3, _local15, 50);
drawRoundRect(3, 1, _local3 - 6, _local4 - 4, 2, 16777215, 100);
} else if (_local5 == "default") {
drawRoundRect(0, 5, _local3, _local4 - 5, {tl:5, tr:5, br:0, bl:0}, 6184542, 10);
drawRoundRect(1, 4, _local3 - 2, _local4 - 5, {tl:4, tr:4, br:0, bl:0}, [6184542, 6184542], 10, 0, "radial");
drawRoundRect(2, 0, _local3 - 4, _local4 - 2, {tl:3, tr:3, br:0, bl:0}, [12897484, 11844796], 100, 0, "radial");
drawRoundRect(3, 1, _local3 - 6, _local4 - 4, {tl:2, tr:2, br:0, bl:0}, 16777215, 100);
} else if (_local5 == "dropDown") {
drawRoundRect(0, 0, _local3 + 1, _local4, {tl:4, tr:0, br:0, bl:4}, [13290186, 7895160], 100, -10, "linear");
drawRoundRect(1, 1, _local3 - 1, _local4 - 2, {tl:3, tr:0, br:0, bl:3}, 16777215, 100);
} else if (_local5 == "menuBorder") {
var _local15 = getStyle("themeColor");
drawRoundRect(4, 4, _local3 - 2, _local4 - 3, 0, [6184542, 6184542], 10, 0, "radial");
drawRoundRect(4, 4, _local3 - 1, _local4 - 2, 0, 6184542, 10);
drawRoundRect(0, 0, _local3 + 1, _local4, 0, [0, 14342874], 100, 250, "linear");
drawRoundRect(0, 0, _local3 + 1, _local4, 0, _local15, 50);
drawRoundRect(2, 2, _local3 - 3, _local4 - 4, 0, 16777215, 100);
} else if (_local5 == "comboNonEdit") {
} else {
beginFill(_local7);
drawRect(0, 0, _local3, _local4);
drawRect(1, 1, _local3 - 1, _local4 - 1);
endFill();
_color = borderColorName;
}
if (_local8 != undefined) {
beginFill(_local8);
drawRect(_local9, _local9, __get__width() - _local9, __get__height() - _local9);
endFill();
}
}
function draw3dBorder(c1, c2, c3, c4, c5, c6) {
var _local3 = __get__width();
var _local2 = __get__height();
beginFill(c1);
drawRect(0, 0, _local3, _local2);
drawRect(1, 0, _local3 - 1, _local2);
endFill();
beginFill(c2);
drawRect(1, 0, _local3 - 1, 1);
endFill();
beginFill(c3);
drawRect(1, _local2 - 1, _local3 - 1, _local2);
endFill();
beginFill(c4);
drawRect(1, 1, _local3 - 1, 2);
endFill();
beginFill(c5);
drawRect(1, _local2 - 2, _local3 - 1, _local2 - 1);
endFill();
beginFill(c6);
drawRect(1, 2, _local3 - 1, _local2 - 2);
drawRect(2, 2, _local3 - 2, _local2 - 2);
endFill();
}
static function classConstruct() {
mx.core.ext.UIObjectExtensions.Extensions();
_global.styles.rectBorderClass = mx.skins.halo.RectBorder;
_global.skinRegistry.RectBorder = true;
return(true);
}
static var symbolName = "RectBorder";
static var symbolOwner = mx.skins.halo.RectBorder;
static var version = "2.0.2.127";
var borderCapColorName = "borderCapColor";
var shadowCapColorName = "shadowCapColor";
var colorList = {highlightColor:0, borderColor:0, buttonColor:0, shadowColor:0, borderCapColor:0, shadowCapColor:0};
var borderWidths = {none:0, solid:1, inset:2, outset:2, alert:3, dropDown:2, menuBorder:2, comboNonEdit:2};
static var classConstructed = classConstruct();
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
}
Symbol 271 MovieClip [__Packages.mx.skins.halo.ButtonSkin] Frame 0
class mx.skins.halo.ButtonSkin extends mx.skins.RectBorder
{
var __get__width, __get__height, getStyle, _parent, clear, drawRoundRect, __get__x, __get__y;
function ButtonSkin () {
super();
}
function init() {
super.init();
}
function size() {
drawHaloRect(__get__width(), __get__height());
}
function drawHaloRect(w, h) {
var _local6 = getStyle("borderStyle");
var _local4 = getStyle("themeColor");
var _local5 = _parent.emphasized;
clear();
switch (_local6) {
case "falseup" :
if (_local5) {
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 75);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16777215], 85, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, _local4, 75);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16316664, 100);
} else {
drawRoundRect(0, 0, w, h, 5, 9542041, 100);
drawRoundRect(1, 1, w - 2, h - 2, 4, [13291985, 16250871], 100, 0, "radial");
drawRoundRect(2, 2, w - 4, h - 4, 3, [9542041, 13818586], 100, 0, "radial");
drawRoundRect(3, 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(3, 4, w - 6, h - 7, 2, 16316664, 100);
}
break;
case "falsedown" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16579836], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 50);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, _local4, 20);
break;
case "falserollover" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 50);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16777215], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, _local4, 50);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16316664, 100);
break;
case "falsedisabled" :
drawRoundRect(0, 0, w, h, 5, 13159628, 100);
drawRoundRect(1, 1, w - 2, h - 2, 4, 15921906, 100);
drawRoundRect(2, 2, w - 4, h - 4, 3, 13949401, 100);
drawRoundRect(3, 3, w - 6, h - 6, 2, 15921906, 100);
break;
case "trueup" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 10066329, 100);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16579836], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 50);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16250871, 100);
break;
case "truedown" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 10066329, 100);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16579836], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 50);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, _local4, 20);
break;
case "truerollover" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 50);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16777215], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 40);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16316664, 100);
break;
case "truedisabled" :
drawRoundRect(0, 0, w, h, 5, 13159628, 100);
drawRoundRect(1, 1, w - 2, h - 2, 4, 15921906, 100);
drawRoundRect(2, 2, w - 4, h - 4, 3, 13949401, 100);
drawRoundRect(3, 3, w - 6, h - 6, 2, 15921906, 100);
}
}
static function classConstruct() {
mx.core.ext.UIObjectExtensions.Extensions();
_global.skinRegistry.ButtonSkin = true;
return(true);
}
static var symbolName = "ButtonSkin";
static var symbolOwner = mx.skins.halo.ButtonSkin;
var className = "ButtonSkin";
var backgroundColorName = "buttonColor";
static var classConstructed = classConstruct();
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
}
Symbol 2183 Button
on (release) {
getURL ("http://www.stickpage.com", "_blank");
}
Symbol 2186 MovieClip Frame 200
_root.gotoAndPlay("intro");
Symbol 2194 Button
on (release) {
_root.gotoAndPlay("mainMenu");
}
Instance of Symbol 1407 MovieClip in Symbol 2212 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.wand);
}
Instance of Symbol 1412 MovieClip in Symbol 2212 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.hat);
}
Instance of Symbol 1598 MovieClip [wizard_main] in Symbol 2226 MovieClip Frame 1
onClipEvent (load) {
hat = 2;
wand = 3;
}
Instance of Symbol 1598 MovieClip [wizard_main] in Symbol 2226 MovieClip Frame 1
onClipEvent (load) {
hat = 2;
wand = 3;
}
Symbol 2226 MovieClip Frame 2
Instance of Symbol 1598 MovieClip [wizard_main] in Symbol 2226 MovieClip Frame 2
onClipEvent (load) {
gotoAndPlay (3);
hat = 2;
wand = 3;
}
Instance of Symbol 1598 MovieClip [wizard_main] in Symbol 2226 MovieClip Frame 2
onClipEvent (load) {
gotoAndPlay (3);
hat = 2;
wand = 3;
}
Instance of Symbol 1598 MovieClip [wizard_main] in Symbol 2226 MovieClip Frame 127
onClipEvent (load) {
gotoAndStop (3);
hat = 2;
wand = 3;
}
Symbol 2226 MovieClip Frame 181
Instance of Symbol 1598 MovieClip [wizard_main] in Symbol 2226 MovieClip Frame 181
onClipEvent (load) {
gotoAndStop (4);
hat = 2;
wand = 3;
}
Instance of Symbol 1873 MovieClip [giant] in Symbol 2226 MovieClip Frame 634
onClipEvent (load) {
gotoAndPlay (1);
health._visible = false;
}
Instance of Symbol 1873 MovieClip [giant] in Symbol 2226 MovieClip Frame 651
onClipEvent (load) {
gotoAndPlay (3);
health._visible = false;
}
Instance of Symbol 200 MovieClip [miner] in Symbol 2226 MovieClip Frame 673
onClipEvent (load) {
weapon = "pickaxe";
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 673
onClipEvent (load) {
weapon = "sword";
shield = 1;
helmet = 2;
}
Symbol 2226 MovieClip Frame 725
Instance of Symbol 1598 MovieClip [wizard_main] in Symbol 2226 MovieClip Frame 729
onClipEvent (load) {
gotoAndStop (4);
hat = 2;
wand = 3;
}
Instance of Symbol 1598 MovieClip [wizard_main] in Symbol 2226 MovieClip Frame 729
onClipEvent (load) {
gotoAndStop (4);
hat = 2;
wand = 3;
}
Instance of Symbol 1873 MovieClip [giant] in Symbol 2226 MovieClip Frame 841
onClipEvent (load) {
gotoAndPlay (1);
health._visible = false;
}
Instance of Symbol 1873 MovieClip [giant] in Symbol 2226 MovieClip Frame 850
onClipEvent (load) {
gotoAndPlay (5);
health._visible = false;
}
Instance of Symbol 1351 MovieClip [archer] in Symbol 2226 MovieClip Frame 1594
onClipEvent (load) {
gotoAndStop (1);
}
Instance of Symbol 1351 MovieClip [archer] in Symbol 2226 MovieClip Frame 1661
onClipEvent (load) {
gotoAndStop (3);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 1715
onClipEvent (load) {
weapon = 3;
gotoAndStop (1);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 1903
onClipEvent (load) {
weapon = "spear";
shield = 4;
helmet = 4;
gotoAndStop (1);
}
Instance of Symbol 200 MovieClip [miner] in Symbol 2226 MovieClip Frame 2001
onClipEvent (load) {
weapon = "pickaxe";
gotoAndStop (3);
mining.gotoAndPlay(26);
}
Instance of Symbol 200 MovieClip [miner] in Symbol 2226 MovieClip Frame 2001
onClipEvent (load) {
weapon = "pickaxe";
gotoAndStop (3);
mining.gotoAndPlay(4);
}
Instance of Symbol 200 MovieClip [miner] in Symbol 2226 MovieClip Frame 2001
onClipEvent (load) {
weapon = "pickaxe";
gotoAndStop (3);
mining.gotoAndPlay(40);
}
Instance of Symbol 200 MovieClip [miner] in Symbol 2226 MovieClip Frame 2001
onClipEvent (load) {
weapon = "pickaxe";
gotoAndStop (3);
mining.gotoAndPlay(35);
}
Instance of Symbol 200 MovieClip [miner] in Symbol 2226 MovieClip Frame 2001
onClipEvent (load) {
weapon = "pickaxe";
gotoAndStop (3);
mining.gotoAndPlay(15);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2001
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
gotoAndStop (1);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2225
onClipEvent (load) {
weapon = 5;
shield = 1;
helmet = 2;
gotoAndStop (6);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2290
onClipEvent (load) {
weapon = 5;
shield = 1;
helmet = 2;
gotoAndStop (4);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2294
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
}
Instance of Symbol 200 MovieClip [miner] in Symbol 2226 MovieClip Frame 2303
onClipEvent (load) {
weapon = "pickaxe";
gotoAndStop (4);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2321
onClipEvent (load) {
weapon = 5;
shield = 1;
helmet = 2;
gotoAndStop (6);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2379
onClipEvent (load) {
weapon = 3;
gotoAndStop (7);
}
Instance of Symbol 200 MovieClip [miner] in Symbol 2226 MovieClip Frame 2387
onClipEvent (load) {
weapon = "pickaxe";
gotoAndStop (2);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2561
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
gotoAndStop (7);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2616
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
gotoAndStop (8);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2627
onClipEvent (load) {
weapon = 5;
shield = 1;
helmet = 2;
gotoAndStop (3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2641
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
spartan.gotoAndPlay(26);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2641
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
spartan.gotoAndPlay(31);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2641
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 1;
gotoAndStop (3);
spartan.gotoAndPlay(18);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2641
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
spartan.gotoAndPlay(3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2641
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
spartan.gotoAndPlay(3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2641
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
spartan.gotoAndPlay(14);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2649
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 5;
gotoAndStop (3);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2658
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
run.gotoAndPlay(37);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2658
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2658
onClipEvent (load) {
weapon = 4;
gotoAndStop (4);
run.gotoAndPlay(15);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2658
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
run.gotoAndPlay(8);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2658
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
run.gotoAndPlay(3);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2686
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
run.gotoAndPlay(37);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2686
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2686
onClipEvent (load) {
weapon = 4;
gotoAndStop (4);
run.gotoAndPlay(17);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2686
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
run.gotoAndPlay(16);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2686
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
run.gotoAndPlay(7);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2740
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
gotoAndStop (3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 4;
gotoAndStop (4);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
}
Instance of Symbol 948 MovieClip [swordMan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 3;
gotoAndStop (4);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 1;
gotoAndStop (3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2226 MovieClip Frame 2771
onClipEvent (load) {
weapon = 2;
shield = 7;
helmet = 1;
gotoAndStop (3);
}
Symbol 2226 MovieClip Frame 2772
stop();
Symbol 2228 Button
on (release) {
_root.menu.goto = "difficulty";
}
Symbol 2229 Button
on (release) {
var so = SharedObject.getLocal("stickwar_save");
_root.campaignData.gold = so.data.data.gold;
_root.campaignData.difficultyLevel = so.data.data.difficultyLevel;
_root.campaignData.level = so.data.data.level;
_root.campaignData.times = so.data.data.times;
for (a in so.data.data.technology) {
_root.campaignData.technology[a] = so.data.data.technology[a];
}
_root.menu.goto = "campaign";
}
Symbol 2232 Button
on (release) {
getURL ("http://www.stickpage.com", "_blank");
}
Symbol 2235 Button
on (release) {
_root.menu.goto = "credits";
}
Symbol 2237 MovieClip Frame 1
var so = SharedObject.getLocal("stickwar_save");
if (so.data.data.technology == undefined) {
loadButton._visible = false;
loadButtonText._visible = false;
} else {
loadButton._visible = true;
loadButtonText._visible = true;
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2237 MovieClip Frame 1
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
}
Symbol 2242 Button
on (release) {
_root.goto = "loadLevel";
}
Symbol 2247 Button
on (release) {
var so = SharedObject.getLocal("stickwar_save");
so.data.data = _root.campaignData;
so.flush();
_root.campaignData = Campaign(so.data.data);
_parent.gotoAndStop(2);
_visible = false;
}
Symbol 2251 MovieClip Frame 1
stop();
Symbol 2251 MovieClip Frame 2
stop();
Symbol 2252 Button
on (release) {
getURL ("http://www.stickpage.com/stickwarguide.shtml", "_blank");
}
Symbol 2332 MovieClip Frame 1
stop();
Symbol 2332 MovieClip Frame 11
stop();
Symbol 2332 MovieClip Frame 21
stop();
Symbol 2332 MovieClip Frame 26
stop();
Symbol 2332 MovieClip Frame 46
stop();
Symbol 2332 MovieClip Frame 53
stop();
Symbol 2332 MovieClip Frame 64
stop();
Symbol 2332 MovieClip Frame 75
stop();
Symbol 2332 MovieClip Frame 90
stop();
Symbol 2332 MovieClip Frame 100
stop();
Symbol 2332 MovieClip Frame 104
stop();
Symbol 2332 MovieClip Frame 110
stop();
Symbol 2332 MovieClip Frame 120
stop();
Symbol 2336 Button
on (release) {
_root.goto = "campaign";
}
Symbol 2341 Button
on (release) {
_root.goto = "shop";
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2430 MovieClip Frame 1
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
gotoAndStop (1);
}
Instance of Symbol 630 MovieClip in Symbol 2431 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(_parent._parent.weapon);
}
Symbol 2432 Button
on (release) {
nextFrame();
}
Symbol 2435 Button
on (release) {
_root.goto = "credits";
}
Symbol 2438 MovieClip Frame 1
stop();
Symbol 2438 MovieClip Frame 2
stop();
Symbol 2438 MovieClip Frame 4
stop();
Symbol 2438 MovieClip Frame 5
stop();
Symbol 2438 MovieClip Frame 7
stop();
Symbol 2438 MovieClip Frame 8
stop();
Symbol 2438 MovieClip Frame 9
stop();
Symbol 2438 MovieClip Frame 10
stop();
Instance of Symbol 310 MovieClip in Symbol 2438 MovieClip Frame 10
onClipEvent (load) {
time = int(Math.random() * 10000);
lastBreath = getTimer();
}
onClipEvent (enterFrame) {
if ((_currentframe == 1) && ((getTimer() - lastBreath) > time)) {
play();
lastBreath = getTimer();
}
}
Instance of Symbol 584 MovieClip [spartan] in Symbol 2438 MovieClip Frame 10
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
}
Symbol 2438 MovieClip Frame 11
stop();
Symbol 2438 MovieClip Frame 12
stop();
Symbol 2438 MovieClip Frame 13
stop();
Symbol 2438 MovieClip Frame 26
Instance of Symbol 310 MovieClip in Symbol 2438 MovieClip Frame 26
onClipEvent (load) {
time = int(Math.random() * 10000);
lastBreath = getTimer();
}
onClipEvent (enterFrame) {
if ((_currentframe == 1) && ((getTimer() - lastBreath) > time)) {
play();
lastBreath = getTimer();
}
}
Symbol 2438 MovieClip Frame 27
var difficulty = _root.campaignData.difficultyLevel;
var difficultyStr = "normal";
if (difficulty == 2) {
difficultyStr = "hard";
} else if (difficulty == 3) {
difficultyStr = "insane";
}
titleDisplay.text = ("Congratulations on finishing the game on " + difficultyStr) + "!";
var seconds = Math.round(_root.campaignData.getTotalTime());
var minutes = Math.floor(seconds / 60);
seconds = seconds - (minutes * 60);
trace(_root.campaignData.getTotalTime());
timeDisplay.text = "";
var i = 1;
while (i < 13) {
lvlStr = i;
seconds = Math.round(_root.campaignData.getTime(i));
minutes = Math.floor(seconds / 60);
seconds = seconds - (minutes * 60);
time = ((minutes + "m and ") + seconds) + "s!\n";
if (i < 10) {
i = "0" + i;
}
timeDisplay.text = timeDisplay.text + ((("Lvl " + i) + " finished in ") + time);
i++;
}
seconds = Math.round(_root.campaignData.getTotalTime());
minutes = Math.floor(seconds / 60);
seconds = seconds - (minutes * 60);
timeDisplay.text = timeDisplay.text + (((("\nYou have completed the game in " + minutes) + "m and ") + seconds) + "s!");
Symbol 2446 Button
on (release) {
_root.goto = "campaign";
}
Symbol 2463 MovieClip Frame 1
gold.text = _root.campaignData.getGold();
Instance of Symbol 200 MovieClip [miner] "miner2" in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
weapon = _root.campaignData.technology.getMinerPickaxe() * 2;
bag = _root.campaignData.technology.getMinerBag();
if (_root.campaignData.technology.getMinerEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 948 MovieClip [swordMan] "swordman2" in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
weapon = _root.campaignData.technology.getSwordmanSword();
if (_root.campaignData.technology.getSwordmanEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 1351 MovieClip [archer] "archer2" in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
if (_root.campaignData.technology.getArcherEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 584 MovieClip [spartan] "spartan2" in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
helmet = _root.campaignData.technology.getSpartanHelmet();
weapon = 1 + ((_root.campaignData.technology.getSpartanSpear() - 1) * 2);
shield = _root.campaignData.technology.getSpartanShield();
if (_root.campaignData.technology.getSpartanEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 1873 MovieClip [giant] "giant2" in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
weapon = (_root.campaignData.technology.getGiantClub() * 2) - 1;
_xscale = (_xscale * (1 + (_root.campaignData.technology.getGiantStrength() * 0.1)));
_yscale = (_yscale * (1 + (_root.campaignData.technology.getGiantStrength() * 0.1)));
health._visible = false;
if (_root.campaignData.technology.getGiantEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 1598 MovieClip [wizard_main] "wizard2" in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
wand = _root.campaignData.technology.getWizardAttack();
hat = _root.campaignData.technology.getWizardHealing();
if (_root.campaignData.technology.getWizardEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 2452 MovieClip "statue2" in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
var scale = (1 + (_root.campaignData.technology.getCastleHealthLevel() / 10));
_xscale = (scale * 100);
_yscale = (scale * 100);
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+20% mining rate";
var heading = "Pickaxe Upgrade";
var price = 100;
var effect = "setMinerPickaxe";
var orig = "getMinerPickaxe";
var maxLevel = 4;
if (_root.campaignData.technology.getMinerEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+20% mining bag capacity";
var heading = "Mining bag Upgrade";
var price = 100;
var effect = "setMinerBagsize";
var orig = "getMinerBag";
var maxLevel = 4;
if (_root.campaignData.technology.getMinerEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+20% attack strength";
var heading = "Swordman sword Upgrade";
var price = 100;
var effect = "setSwordmanSword";
var orig = "getSwordmanSword";
var maxLevel = 4;
if (!_root.campaignData.technology.getIsNotClubman()) {
maxLevel = 1;
}
if (_root.campaignData.technology.getSwordmanEnabled() && (_root.campaignData.technology.getIsNotClubman())) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "Increases Archer health by 20%";
var heading = "Archer health Upgrade";
var price = 100;
var effect = "setArcherAccuracy";
var orig = "getArcherAccuracy";
var maxLevel = 4;
if (_root.campaignData.technology.getArcherEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+25% arrow damage.";
var heading = "Archer arrow damage Upgrade";
var price = 100;
var effect = "setArcherDamage";
var orig = "getArcherDamage";
var maxLevel = 4;
if (_root.campaignData.technology.getArcherEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 3) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "Increases Spearton health by 10% and increases the chance that a Speartons block will be successfull";
var heading = "Spearton shield Upgrade";
var price = 100;
var effect = "setSpartanShield";
var orig = "getSpartanShield";
var maxLevel = 5;
if (_root.campaignData.technology.getSpartanEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() - 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 2) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "Increase Spearton health by 20%.";
var heading = "Spearton Helmet upgrade";
var price = 100;
var effect = "setSpartanHelmet";
var orig = "getSpartanHelmet";
var maxLevel = 4;
if (_root.campaignData.technology.getSpartanEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = _root.campaignData.technology[orig]();
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "Increases speed by 20%";
var heading = "Swordman speed Upgrade";
var price = 100;
var effect = "setSwordmanSpeed";
var orig = "getSwordmanSpeed";
var maxLevel = 4;
if (_root.campaignData.technology.getSwordmanEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "Increases Spearton attack by 20%";
var heading = "Spearton spear Upgrade";
var price = 100;
var effect = "setSpartanSpear";
var orig = "getSpartanSpear";
var maxLevel = 3;
if (_root.campaignData.technology.getSpartanEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+1 to number of units summoned by wizard";
var heading = "Wizard summoning spell Upgrade";
var price = 100;
var effect = "setWizardHealing";
var orig = "getWizardHealing";
var maxLevel = 4;
if (_root.campaignData.technology.getWizardEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+15% stun time";
var heading = "Wizard stun spell Upgrade";
var price = 100;
var effect = "setWizardAttack";
var orig = "getWizardAttack";
var maxLevel = 4;
if (_root.campaignData.technology.getWizardEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+20% giant health";
var heading = "Giant health Upgrade";
var price = 100;
var effect = "setGiantStrength";
var orig = "getGiantStrength";
var maxLevel = 4;
if (_root.campaignData.technology.getGiantEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+20% attack power";
var heading = "Giant attack Upgrade";
var price = 100;
var effect = "setGiantClub";
var orig = "getGiantClub";
var maxLevel = 2;
if (_root.campaignData.technology.getGiantEnabled()) {
_visible = true;
} else {
_visible = false;
}
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+100% hitpoints";
var heading = "Castle hitpoints upgrade";
var price = 100;
var effect = "setCastleHealth";
var orig = "getCastleHealthLevel";
var maxLevel = 3;
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * (_root.campaignData.technology[orig]() / maxLevel);
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "+2 gold/second generated by castle";
var heading = "Castle income upgrade";
var price = 100;
var effect = "setCastleIncome";
var orig = "getCastleIncome";
var maxLevel = 4;
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Instance of Symbol 2462 MovieClip in Symbol 2463 MovieClip Frame 1
onClipEvent (load) {
function setbar() {
bar._yscale = 100 * ((_root.campaignData.technology[orig]() - 1) / (maxLevel - 1));
if (maxLevel == _root.campaignData.technology[orig]()) {
plus._visible = false;
}
}
var description = "Improves arrows fired by castle archers by 25%.";
var heading = "Castle archer upgrade";
var price = 100;
var effect = "setCastleArcherNumber";
var orig = "getCastleArcherNumber";
var maxLevel = 4;
setbar();
}
on (rollOver) {
_root.menu.description.text = description;
_root.menu.heading.text = heading;
}
on (rollOut) {
_root.menu.description.text = _root.defaultDescription;
_root.menu.heading.text = _root.defaultHeading;
}
on (release) {
var n = (_root.campaignData.technology[orig]() + 1);
if (n <= maxLevel) {
_root.tryToBuy(price, effect, n);
setbar();
}
}
Symbol 2463 MovieClip Frame 2
stop();
Instance of Symbol 200 MovieClip [miner] "miner" in Symbol 2463 MovieClip Frame 2
onClipEvent (load) {
weapon = _root.campaignData.technology.getMinerPickaxe() * 2;
bag = _root.campaignData.technology.getMinerBag();
if (_root.campaignData.technology.getMinerEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 948 MovieClip [swordMan] "swordman" in Symbol 2463 MovieClip Frame 2
onClipEvent (load) {
weapon = _root.campaignData.technology.getSwordmanSword();
if (_root.campaignData.technology.getSwordmanEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 1351 MovieClip [archer] "archer" in Symbol 2463 MovieClip Frame 2
onClipEvent (load) {
quiver = _root.campaignData.technology.getArcherAccuracy();
if (_root.campaignData.technology.getArcherEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 584 MovieClip [spartan] "spartan" in Symbol 2463 MovieClip Frame 2
onClipEvent (load) {
helmet = _root.campaignData.technology.getSpartanHelmet();
weapon = (_root.campaignData.technology.getSpartanSpear() * 2) - 1;
shield = _root.campaignData.technology.getSpartanShield();
if (_root.campaignData.technology.getSpartanEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 1873 MovieClip [giant] "giant" in Symbol 2463 MovieClip Frame 2
onClipEvent (load) {
weapon = (_root.campaignData.technology.getGiantClub() * 2) - 1;
trace(weapon);
_xscale = (_xscale * (1 + (_root.campaignData.technology.getGiantStrength() * 0.1)));
_yscale = (_yscale * (1 + (_root.campaignData.technology.getGiantStrength() * 0.1)));
health._visible = false;
if (_root.campaignData.technology.getGiantEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 1598 MovieClip [wizard_main] "wizard" in Symbol 2463 MovieClip Frame 2
onClipEvent (load) {
wand = _root.campaignData.technology.getWizardAttack();
hat = _root.campaignData.technology.getWizardHealing();
if (_root.campaignData.technology.getWizardEnabled()) {
_visible = true;
} else {
_visible = false;
}
}
Instance of Symbol 2452 MovieClip "statue" in Symbol 2463 MovieClip Frame 2
onClipEvent (load) {
var scale = (1 + (_root.campaignData.technology.getCastleHealthLevel() / 10));
_xscale = (scale * 100);
_yscale = (scale * 100);
}
Symbol 2463 MovieClip Frame 5
gotoAndPlay ("shop");
Symbol 2464 Button
on (release) {
_root.campaignData.difficultyLevel = 1;
_root.goto = "campaign";
}
Symbol 2465 Button
on (release) {
_root.campaignData.difficultyLevel = 2;
_root.goto = "campaign";
}
Symbol 2466 Button
on (release) {
_root.campaignData.difficultyLevel = 3;
_root.goto = "campaign";
}
Symbol 2472 Button
on (release) {
getURL ("http://www.stickpage.com/stickwargameplay.shtml", "_blank");
}
Symbol 2473 MovieClip Frame 1
domain_parts = _url.split("://");
real_domain = domain_parts[1].split("/");
domain = real_domain[0];
if ((domain != "www.stickpage.com") && (domain != "farm.stickpage.com")) {
gotoAndStop (2);
}
stop();
Instance of Symbol 584 MovieClip [spartan] in Symbol 2473 MovieClip Frame 1
onClipEvent (load) {
weapon = 3;
shield = 7;
helmet = 5;
}
Symbol 2473 MovieClip Frame 2
stop();
Symbol 2474 Button
on (release) {
getURL ("http://www.stickpage.com/stickwargameplay4123.shtml", "_blank");
}
Symbol 2478 Button
on (release) {
_root.gotoAndPlay("mainMenu");
}