Frame 1
function MainMenu_RC(obj, item) {
if (item.caption == RightClick_Option3) {
getURL ("http://www.godlygamer.com/", "_blank");
}
if (item.caption == RightClick_Option5) {
getURL ("http://www.maxgames.com/", "_blank");
}
}
fscommand ("AllowScale", false);
RightClick_Option1 = "Conflict Resolution";
RightClick_Option2 = "Created By: GodlyGamer";
RightClick_Option3 = "http://www.godlygamer.com/";
RightClick_Option4 = "Sponsored By: MaxGames";
RightClick_Option5 = "http://www.maxgames.com/";
var MainMenu_cm = new ContextMenu();
MainMenu_cm.hideBuiltInItems();
MainMenu_cm.customItems.push(new ContextMenuItem(RightClick_Option1, MainMenu_RC));
MainMenu_cm.customItems.push(new ContextMenuItem(RightClick_Option2, MainMenu_RC, true));
MainMenu_cm.customItems.push(new ContextMenuItem(RightClick_Option3, MainMenu_RC));
MainMenu_cm.customItems.push(new ContextMenuItem(RightClick_Option4, MainMenu_RC, true));
MainMenu_cm.customItems.push(new ContextMenuItem(RightClick_Option5, MainMenu_RC));
_root.menu = MainMenu_cm;
i = 1;
while (i <= 8) {
_level["c" + i].gotoAndPlay(i * 5);
i++;
}
delete i;
Frame 2
stop();
Frame 3
stop();
gotoAndStop ("Preloader");
Frame 4
stop();
var saveData = SharedObject.getLocal("Data");
MenuVariables_array = saveData.data.MySavedData;
if (MenuVariables_array.DataVersion != "Version2.4") {
trace("Save Data has been set to Default");
saveData.clear();
MenuVariables_array = new Array();
MenuVariables_array.DataVersion = "Version2.4";
MenuVariables_array.menuTab = "Instructions";
MenuVariables_array.subInstructionsCurrent = 1;
MenuVariables_array.subInstructionsTotal = 40;
MenuVariables_array.compDifficulty = "Easy";
MenuVariables_array.startingTeir = "One";
MenuVariables_array.customGame = "Off";
MenuVariables_array.customResources = "Off";
MenuVariables_array.customTrain = "Off";
MenuVariables_array.customUpgrade = "Off";
MenuVariables_array.highscoreTable = "Easy";
MenuVariables_array.gamesPlayed = 0;
MenuVariables_array.gamesWon = 0;
MenuVariables_array.gamesLost = 0;
MenuVariables_array.unitsTrained = 0;
MenuVariables_array.unitsKilled = 0;
MenuVariables_array.unitsLost = 0;
MenuVariables_array.buildingsCreated = 0;
MenuVariables_array.buildingsDestroyed = 0;
MenuVariables_array.buildingsLost = 0;
MenuVariables_array.resourcesCollected = 0;
MenuVariables_array.timePlayed = 0;
saveData.data.MySavedData = MenuVariables_array;
} else {
trace("Save Data is up to date.");
}
_root.gotoAndStop("Intro_MG");
Frame 5
function Complete() {
gotoAndStop ("Intro_GG");
delete Complete;
}
stop();
Frame 6
stop();
Frame 7
_root.gotoAndStop("GameMenu");
Frame 8
function PlayGame() {
delete PlayGame;
gotoAndStop ("GameSettings");
}
stop();
Frame 9
function Timer() {
if (_root.PauseGame == false) {
_root.MatchVars_array.timePlayed++;
}
}
function Conditions_VD() {
if (_root.PauseGame == false) {
if (((_root.GameTime - _root.CompUnit_Ping) > 60) && ((_root.GameTime - _root.CompBuilding_Ping) > 60)) {
_root.sounds_mc.CreateSound("End_", "Victory", 100, 0, true);
_root.UserAction = "None";
_root.UserPassiveAction = "None";
Mouse.show();
_root.Power_mc.removeMovieClip();
_root.CommandPosition_mc.removeMovieClip();
_root.CommandUnable_mc.removeMovieClip();
_root.LevelScroller_mc.removeMovieClip();
_root.ScrollerPoint_mc.removeMovieClip();
_root.PauseGame = true;
if (_root.MenuVariables_array.customGame != "On") {
_root.MenuVariables_array.gamesPlayed++;
_root.MenuVariables_array.gamesWon++;
_root.MenuVariables_array.unitsTrained = _root.MenuVariables_array.unitsTrained + _root.MatchVars_array.unitsTrained;
_root.MenuVariables_array.unitsKilled = _root.MenuVariables_array.unitsKilled + _root.MatchVars_array.unitsKilled;
_root.MenuVariables_array.unitsLost = _root.MenuVariables_array.unitsLost + _root.MatchVars_array.unitsLost;
_root.MenuVariables_array.buildingsCreated = _root.MenuVariables_array.buildingsCreated + _root.MatchVars_array.buildingsCreated;
_root.MenuVariables_array.buildingsDestroyed = _root.MenuVariables_array.buildingsDestroyed + _root.MatchVars_array.buildingsDestroyed;
_root.MenuVariables_array.buildingsLost = _root.MenuVariables_array.buildingsLost + _root.MatchVars_array.buildingsLost;
_root.MenuVariables_array.resourcesCollected = _root.MenuVariables_array.resourcesCollected + _root.MatchVars_array.resourcesCollected;
_root.MenuVariables_array.timePlayed = _root.MenuVariables_array.timePlayed + _root.MatchVars_array.timePlayed;
var _local2 = SharedObject.getLocal("Data");
_local2.data.MySavedData = _root.MenuVariables_array;
}
_root.gameMenu_mc.gotoAndStop("Victory");
_root.TBB_mc.pause_mc.gotoAndStop("disabled");
}
if (((_root.GameTime - _root.UserUnit_Ping) > 60) && ((_root.GameTime - _root.UserBuilding_Ping) > 60)) {
_root.sounds_mc.CreateSound("End_", "Defeat", 100, 0, true);
_root.UserAction = "None";
_root.UserPassiveAction = "None";
Mouse.show();
_root.Power_mc.removeMovieClip();
_root.CommandPosition_mc.removeMovieClip();
_root.CommandUnable_mc.removeMovieClip();
_root.LevelScroller_mc.removeMovieClip();
_root.ScrollerPoint_mc.removeMovieClip();
_root.PauseGame = true;
if (_root.MenuVariables_array.customGame != "On") {
_root.MenuVariables_array.gamesPlayed++;
_root.MenuVariables_array.gamesLost++;
_root.MenuVariables_array.unitsTrained = _root.MenuVariables_array.unitsTrained + _root.MatchVars_array.unitsTrained;
_root.MenuVariables_array.unitsKilled = _root.MenuVariables_array.unitsKilled + _root.MatchVars_array.unitsKilled;
_root.MenuVariables_array.unitsLost = _root.MenuVariables_array.unitsLost + _root.MatchVars_array.unitsLost;
_root.MenuVariables_array.buildingsCreated = _root.MenuVariables_array.buildingsCreated + _root.MatchVars_array.buildingsCreated;
_root.MenuVariables_array.buildingsDestroyed = _root.MenuVariables_array.buildingsDestroyed + _root.MatchVars_array.buildingsDestroyed;
_root.MenuVariables_array.buildingsLost = _root.MenuVariables_array.buildingsLost + _root.MatchVars_array.buildingsLost;
_root.MenuVariables_array.resourcesCollected = _root.MenuVariables_array.resourcesCollected + _root.MatchVars_array.resourcesCollected;
_root.MenuVariables_array.timePlayed = _root.MenuVariables_array.timePlayed + _root.MatchVars_array.timePlayed;
var _local2 = SharedObject.getLocal("Data");
_local2.data.MySavedData = _root.MenuVariables_array;
}
_root.gameMenu_mc.gotoAndStop("Defeat");
_root.TBB_mc.pause_mc.gotoAndStop("disabled");
}
}
}
function AbortGameFunctions() {
_quality = "HIGH";
Mouse.removeListener(mouseListener);
Key.removeListener(keyListener);
clearInterval(_root.SetScroller);
clearInterval(_root.SetDrag);
clearInterval(_root.SetArrays);
clearInterval(_root.SetKeys);
clearInterval(_root.set_MGP);
clearInterval(_root.CompAI);
clearInterval(_root.set_Timer);
clearInterval(_root.set_CVD);
delete MatchVars_array;
delete Depths_array;
delete Units_array;
delete Buildings_array;
delete CompUnits_array;
delete CompBuildings_array;
delete UserUnits_array;
delete UserBuildings_array;
delete UnitSelect_array;
ii = 0;
while (ii < 10) {
delete _level[("UnitSelect" + ii) + "_array"];
ii++;
}
delete Buildings_Stats;
delete Current_array;
delete Current0_array;
delete Unit1_Swordsman;
delete Unit2_Swordsman;
delete Unit1_Spearman;
delete Unit2_Spearman;
delete Unit1_Archer;
delete Unit2_Archer;
delete Unit1_MountedSwordsman;
delete Unit2_MountedSwordsman;
delete Unit1_MountedArcher;
delete Unit2_MountedArcher;
delete Unit1_MachineGunner;
delete Unit2_MachineGunner;
delete Unit1_RPGTrooper;
delete Unit2_RPGTrooper;
delete Swordsman_array;
delete Spearman_array;
delete Archer_array;
delete MountedSwordsman_array;
delete MountedArcher_array;
delete MachineGunner_array;
delete RPGTrooper_array;
delete Humvee_array;
delete LightTank_array;
delete HeavyTank_array;
delete Sniper_array;
delete LaserTrooper_array;
delete LaserTank_array;
delete Unit1_Humvee;
delete Unit1_LightTank;
delete Unit1_HeavyTank;
delete Unit1_Sniper;
delete Unit1_LaserTrooper;
delete Unit1_LaserTank;
delete Unit2_Humvee;
delete Unit2_LightTank;
delete Unit2_HeavyTank;
delete Unit2_Sniper;
delete Unit2_LaserTrooper;
delete Unit2_LaserTank;
delete Research_Time;
delete Costs_array;
delete Units_Default_array;
delete Buildings1_array;
delete Buildings2_array;
delete Defaults_array;
delete UnitsOwned1_array;
delete UnitsOwned2_array;
delete CompBuildPriority;
delete mouseListener;
delete keyListener;
delete AbortGameFunctions;
delete ReassembleArrays;
delete RemoveArrayValue;
delete RecalculateControlGroups;
delete KeyIntervals;
delete RemoveBuilding;
delete RemoveUnit;
delete EndUnitSelections;
delete AddUnitSelections;
delete PlaceBuilding;
delete PlaceFoundation;
delete CheckDepths;
delete CreateUnit;
delete Scroller;
delete DragBox;
delete GetViewLocation;
delete SetStance;
delete GetStance;
delete Comp_AI_Building;
delete CreateObject;
delete ClearDR;
delete MGP;
delete ComputerAI;
delete CompBuyUpgrade;
delete i;
delete ii;
delete iii;
delete iiii;
delete User_DisplayEnemyHealth;
delete User_DisplayBuildingHealth;
delete User_Formation;
delete User_DefaultStance;
delete User_Food;
delete User_Gold;
delete User_Stone;
delete User_Wood;
delete UserUnitSpacing;
delete Comp_LOS;
delete C_LE_D;
delete C_LE_Dmin;
delete C_LE_Dmax;
delete ArrowScrollAmount;
delete ControlKey;
delete ShiftKey;
delete DTK;
delete DTKV;
delete PauseGame;
delete UserAction;
delete UserPassiveAction;
delete UnitSelected;
delete TotalBuildings;
delete TotalUnits;
delete SetArrays;
delete SetKeys;
delete ScrollerActivated;
delete CommandActivated;
delete CommandClickSelect;
delete DragCommandClicked;
delete DragCommandActive;
delete SetScroller;
delete SetDrag;
delete PlaceSetX;
delete PlaceSetY;
delete PlaceSetY_str;
delete PlaceSetX_str;
delete PlaceDepth;
delete PlaceName;
delete MiniX;
delete MiniY;
delete CreateName;
delete UnitSelect;
delete UnitAdded;
delete DragVars_StartX;
delete DragVars_StartY;
delete DragVars_XVar;
delete DragVars_YVar;
delete DragVars_Width;
delete DragVars_Height;
delete CommandPositionTarget;
delete CommandPositionAttack;
delete BuildingTest;
delete Selected;
delete UnitSpacing;
delete NewName;
delete RowLength;
delete TotalRows;
delete CurrentRow;
delete CurrentRowUnits;
delete ExtraX;
delete ExtraY;
delete GoToX;
delete GoToY;
delete Comparing;
delete UnitSelectAdd;
delete ScrollStartX;
delete ScrollStartY;
delete opposite;
delete adjacent;
delete CommandPositionType;
delete FirstX;
delete FirstY;
delete LastX;
delete LastY;
delete AverageX;
delete AverageY;
delete DepthInUse;
delete Stance1;
delete Stance2;
delete Stance3;
delete GotStance;
delete KeyPressed;
delete KeyAction;
delete DT;
delete myBFPoint0;
delete myBFPoint;
delete myPoint;
delete myUserPoint;
delete NewUnit;
delete RandomizeUnitType;
delete UnitSpawnType;
delete C_LE_D2;
delete C_LE_D2min;
delete C_LE_D2max;
delete Opposite;
delete Adjacent;
delete Hypotenuse;
delete User_Teir;
delete User_Advancing;
delete User_LOS;
delete User_Pop;
delete User_PopCap;
delete Comp_Teir;
delete Comp_Pop;
delete Comp_PopCap;
delete Swordsman_CV;
delete Spearman_CV;
delete Archer_CV;
delete MountedSwordsman_CV;
delete MountedArcher_CV;
delete Swordsman_CV1;
delete Swordsman_CV2;
delete Spearman_CV1;
delete Spearman_CV2;
delete Archer_CV1;
delete Archer_CV2;
delete MountedSwordsman_CV1;
delete MountedSwordsman_CV2;
delete MountedArcher_CV1;
delete MountedArcher_CV2;
delete MachineGunner_CV1;
delete MachineGunner_CV2;
delete RPGTrooper_CV1;
delete RPGTrooper_CV2;
delete DevX;
delete DevY;
delete Humvee_CV1;
delete Humvee_CV2;
delete LightTank_CV1;
delete LightTank_CV2;
delete HeavyTank_CV1;
delete HeavyTank_CV2;
delete Sniper_CV1;
delete Sniper_CV2;
delete LaserTrooper_CV1;
delete LaserTrooper_CV2;
delete LaserTank_CV1;
delete LaserTank_CV2;
delete User_DR_Pop;
delete User_DR_Food;
delete User_DR_Gold;
delete User_DR_Stone;
delete User_DR_Wood;
delete Produce_Farm1;
delete Produce_Mine1;
delete Produce_Mill1;
delete Produce_Farm1D;
delete Produce_Mine1D1;
delete Produce_Mine1D2;
delete Produce_Mill1D;
delete Produce_Farm1B;
delete Produce_Mine1B1;
delete Produce_Mine1B2;
delete Produce_Mill1B;
delete Produce_Farm2;
delete Produce_Mine2;
delete Produce_Mill2;
delete Produce_Farm2D;
delete Produce_Mine2D1;
delete Produce_Mine2D2;
delete Produce_Mill2D;
delete Produce_Farm2B;
delete Produce_Mine2B1;
delete Produce_Mine2B2;
delete Produce_Mill2B;
delete User_Repair;
delete User_DR_Info;
delete Armoury_A_1;
delete Armoury_B_1;
delete Armoury_C_1;
delete Armoury_D_1;
delete ResearchLab_A_1;
delete ResearchLab_B_1;
delete ResearchLab_C_1;
delete ResearchLab_D_1;
delete ResearchLab_E_1;
delete ResearchLab_F_1;
delete ResearchLab_G_1;
delete ResearchLab_H_1;
delete ResearchLab_I_1;
delete ResearchLab_J_1;
delete ResearchLab_K_1;
delete ResearchLab_L_1;
delete Comp_Repair;
delete Armoury_A_2;
delete Armoury_B_2;
delete Armoury_C_2;
delete Armoury_D_2;
delete ResearchLab_A_2;
delete ResearchLab_B_2;
delete ResearchLab_C_2;
delete ResearchLab_D_2;
delete ResearchLab_E_2;
delete ResearchLab_F_2;
delete ResearchLab_G_2;
delete ResearchLab_H_2;
delete ResearchLab_I_2;
delete ResearchLab_J_2;
delete ResearchLab_K_2;
delete ResearchLab_L_2;
delete Comp_Gold;
delete Comp_Stone;
delete Comp_Wood;
delete Comp_Food;
delete User_AirstrikeLaunch;
delete User_AirstrikeDamage;
delete User_AirstrikeRange;
delete User_AirstrikeTimer;
delete User_AirstrikeSet;
delete User_AirstrikeX;
delete User_AirstrikeY;
delete User_AirstrikeActivated;
delete User_MissileLaunch;
delete User_MissileDamage;
delete User_MissileRange;
delete User_MissileLaunchTimer;
delete User_MissileLaunchSet;
delete User_MissileX;
delete User_MissileY;
delete User_MissileLaunchActivated;
delete TechCenter_A_1;
delete TechCenter_B_1;
delete TechCenter_C_1;
delete TechCenter_D_1;
delete Comp_MissileLaunch;
delete TechCenter_A_2;
delete TechCenter_B_2;
delete TechCenter_C_2;
delete TechCenter_D_2;
delete C_LE_D3;
delete C_LE_D3min;
delete C_LE_D3max;
delete PowerActivated;
delete set_MGP;
delete opp;
delete adj;
delete hyp;
delete DoDamage;
delete rotation;
delete myPoint2;
delete Comp_Building_TimerSet;
delete Comp_Building_Timer;
delete Comp_Keep_Timer;
delete Comp_Barracks1_TimerSet;
delete Comp_Barracks1_Timer;
delete Comp_Stables_TimerSet;
delete Comp_Stables_Timer;
delete Comp_Barracks2_TimerSet;
delete Comp_Barracks2_Timer;
delete Comp_WarFactory_TimerSet;
delete Comp_WarFactory_Timer;
delete Comp_Armoury_TimerSet;
delete Comp_Armoury_Timer;
delete Comp_ResearchLab_TimerSet;
delete Comp_ResearchLab_Timer;
delete Comp_TechCenter_TimerSet;
delete Comp_TechCenter_Timer;
delete CurrentPriorityRate;
delete UnitSpawnID;
delete CompAI;
delete Comp_WorkerCap;
delete Comp_AirstrikeLaunch;
delete Comp_AirstrikeDamage;
delete Comp_AirstrikeRange;
delete Comp_AirstrikeTimer;
delete Comp_AirstrikeSet;
delete Comp_AirstrikeX;
delete Comp_AirstrikeY;
delete Comp_AirstrikeActivated;
delete Comp_MissileDamage;
delete Comp_MissileRange;
delete Comp_MissileLaunchTimer;
delete Comp_MissileLaunchSet;
delete Comp_MissileX;
delete Comp_MissileY;
delete Comp_MissileLaunchActivated;
delete Comp_Armoury_Set;
delete Comp_ResearchLab_Set;
delete Comp_TechCenter_Set;
delete Comp_T2_Advance;
delete Comp_T3_Advance;
delete Comp_AP1;
delete Comp_AP2;
delete Comp_Difficulty;
delete Headstart;
delete CompUnit_Ping;
delete CompBuilding_Ping;
delete UserUnit_Ping;
delete UserBuilding_Ping;
delete GameTime;
}
function ClearDR() {
_root.User_DR_Info = "None";
_root.User_DR_Pop = 0;
_root.User_DR_Food = 0;
_root.User_DR_Gold = 0;
_root.User_DR_Stone = 0;
_root.User_DR_Wood = 0;
}
stop();
_root.User_Food = _root.User_Food;
_root.User_Gold = _root.User_Gold;
_root.User_Stone = _root.User_Stone;
_root.User_Wood = _root.User_Wood;
_root.set_Timer = setInterval(Timer, 1000);
_root.set_CVD = setInterval(Conditions_VD, 250);
function SetStance(SelectedStance) {
if (_root.UserAction == "Command") {
i = 0;
while (i < UnitSelect_array.length) {
_root.container_mc.level_mc[UnitSelect_array[i]].stance = SelectedStance;
i++;
}
} else {
_root.User_DefaultStance = SelectedStance;
}
_root.TBS_mc.stances_mc.gotoAndStop(SelectedStance);
}
function GetStance() {
if (_root.UserAction == "Command") {
Stance1 = false;
Stance2 = false;
Stance3 = false;
i = 0;
while (i < UnitSelect_array.length) {
if (_root.container_mc.level_mc[UnitSelect_array[i]].stance == "Aggressive") {
Stance1 = true;
}
if (_root.container_mc.level_mc[UnitSelect_array[i]].stance == "Defensive") {
Stance2 = true;
}
if (_root.container_mc.level_mc[UnitSelect_array[i]].stance == "Passive") {
Stance3 = true;
}
i++;
}
GotStance = "None";
if (((Stance1 == true) && (Stance2 == false)) && (Stance3 == false)) {
GotStance = "Aggressive";
} else if (((Stance1 == false) && (Stance2 == true)) && (Stance3 == false)) {
GotStance = "Defensive";
} else if (((Stance1 == false) && (Stance2 == false)) && (Stance3 == true)) {
GotStance = "Passive";
}
_root.TBS_mc.stances_mc.gotoAndStop(GotStance);
} else {
_root.TBS_mc.stances_mc.gotoAndStop(_root.User_DefaultStance);
}
}
GetStance();
function ReassembleArrays() {
Units_array.sort();
i = 1;
while (i <= Units_array.length) {
if (Units_array[i] == undefined) {
Units_array.length = i;
}
i++;
}
CompUnits_array.sort();
i = 1;
while (i <= CompUnits_array.length) {
if (CompUnits_array[i] == undefined) {
CompUnits_array.length = i;
}
i++;
}
UserUnits_array.sort();
i = 1;
while (i <= UserUnits_array.length) {
if (UserUnits_array[i] == undefined) {
UserUnits_array.length = i;
}
i++;
}
Buildings_array.sort();
i = 1;
while (i <= Buildings_array.length) {
if (Buildings_array[i] == undefined) {
Buildings_array.length = i;
}
i++;
}
CompBuildings_array.sort();
i = 1;
while (i <= CompBuildings_array.length) {
if (CompBuildings_array[i] == undefined) {
CompBuildings_array.length = i;
}
i++;
}
UserBuildings_array.sort();
i = 1;
while (i <= UserBuildings_array.length) {
if (UserBuildings_array[i] == undefined) {
UserBuildings_array.length = i;
}
i++;
}
UnitSelect_array.sort();
i = 1;
while (i <= UnitSelect_array.length) {
if (UnitSelect_array[i] == undefined) {
UnitSelect_array.length = i;
}
i++;
}
ii = 0;
while (ii < 10) {
_level[("UnitSelect" + ii) + "_array"].sort();
i = 0;
while (i <= _level[("UnitSelect" + ii) + "_array"].length) {
if (_level[("UnitSelect" + ii) + "_array"][i] == undefined) {
_level[("UnitSelect" + ii) + "_array"].length = i;
}
i++;
}
ii++;
}
}
function RemoveArrayValue(ArrayType, ArrayValue, Ownership) {
if (ArrayType == "Unit") {
Current_array = Units_array;
if (Ownership == 1) {
Current0_array = UserUnits_array;
} else {
Current0_array = CompUnits_array;
}
}
if (ArrayType == "Building") {
Current_array = Buildings_array;
if (Ownership == 1) {
Current0_array = UserBuildings_array;
} else {
Current0_array = CompBuildings_array;
}
}
Current_array.sort();
i = 0;
ii = false;
while ((i < Current_array.length) && (ii == false)) {
if (Current_array[i] == ArrayValue) {
delete Current_array[i];
ii = true;
}
i++;
}
Current_array.sort();
i = 1;
while (i <= Current_array.length) {
if (Current_array[i] == undefined) {
Current_array.length = i;
}
i++;
}
Current0_array.sort();
i = 0;
ii = false;
while ((i < Current0_array.length) && (ii == false)) {
if (Current0_array[i] == ArrayValue) {
delete Current0_array[i];
ii = true;
}
i++;
}
Current0_array.sort();
i = 1;
while (i <= Current0_array.length) {
if (Current0_array[i] == undefined) {
Current0_array.length = i;
}
i++;
}
if (ArrayType == "Unit") {
i = 0;
while (i < 10) {
_level[("UnitSelect" + i) + "_array"].sort();
ii = 0;
while (ii <= _level[("UnitSelect" + i) + "_array"].length) {
if (_level[("UnitSelect" + i) + "_array"][ii] == ArrayValue) {
delete _level[("UnitSelect" + i) + "_array"][ii];
}
ii++;
}
i++;
}
UnitSelect_array.sort();
i = 0;
while (i <= UnitSelect_array.length) {
if (UnitSelect_array[i] == ArrayValue) {
delete UnitSelect_array[i];
}
i++;
}
ReassembleArrays();
if (UnitSelect_array[0] == undefined) {
UnitSelect_array.length = 0;
}
}
}
function RecalculateControlGroups(MCG) {
i = 0;
while (i < _level[("UnitSelect" + MCG) + "_array"].length) {
Comparing = _level[("UnitSelect" + MCG) + "_array"][i];
ii = 0;
while (ii < 10) {
if (ii != MCG) {
_level[("UnitSelect" + ii) + "_array"].sort();
iii = 0;
while (iii <= _level[("UnitSelect" + ii) + "_array"].length) {
if (_level[("UnitSelect" + ii) + "_array"][iii] == Comparing) {
_root.container_mc.level_mc[_level[("UnitSelect" + ii) + "_array"][iii]].GroupNo = "";
delete _level[("UnitSelect" + ii) + "_array"][iii];
}
iii++;
}
}
ii++;
}
i++;
}
ReassembleArrays();
}
Depths_array = new Array();
Depths_array.length = 0;
Depths_array.D0 = "Reserved";
Units_array = new Array();
Units_array.length = 0;
Buildings_array = new Array();
Buildings_array.length = 0;
CompUnits_array = new Array();
CompUnits_array.length = 0;
CompBuildings_array = new Array();
CompBuildings_array.length = 0;
UserUnits_array = new Array();
UserUnits_array.length = 0;
UserBuildings_array = new Array();
UserBuildings_array.length = 0;
UnitSelect_array = new Array();
UnitSelect_array.length = 0;
i = 0;
while (i < 10) {
_level[("UnitSelect" + i) + "_array"] = new Array();
_level[("UnitSelect" + i) + "_array"].length = 0;
i++;
}
_root.SetArrays = setInterval(ReassembleArrays, 1000);
function KeyIntervals() {
if (Key.isDown(17)) {
_root.ControlKey = true;
_root.ControlKeyTime = _root.GameTime;
} else if ((_root.GameTime - _root.ControlKeyTime) > 10) {
_root.ControlKey = false;
}
if (Key.isDown(16)) {
_root.ShiftKey = true;
} else {
_root.ShiftKey = false;
}
if (DTK > 0) {
DTK--;
}
}
_root.ControlKeyTime = 0;
_root.SetKeys = setInterval(KeyIntervals, 25);
var keyListener = new Object();
keyListener.onKeyDown = function () {
KeyPressed = chr(Key.getAscii()).toUpperCase();
if (Key.getCode() == 46) {
KeyPressed = "DELETE";
}
KeyAction = "None";
DT = false;
if ((DTK > 0) && (KeyPressed == DTKV)) {
DT = true;
}
DTK = 15;
DTKV = KeyPressed;
if (KeyPressed != "") {
if ((KeyPressed == "DELETE") && (KeyAction == "None")) {
i = 0;
while (i <= UnitSelect_array.length) {
_root.container_mc.level_mc[UnitSelect_array[i]].health = 0;
i++;
}
KeyAction = "Active";
}
if (_root.ShiftKey == true) {
if (_root.UserAction == "None") {
if (((((KeyPressed == "N") && (KeyAction == "None")) && (_root.User_AirstrikeTimer == 0)) && (_root.User_AirstrikeLaunch == "None")) && (Buildings1_array.Teir3_CommandPost >= 1)) {
KeyAction = "Active";
_root.UserAction = "Airstrike";
}
if ((((((KeyPressed == "M") && (KeyAction == "None")) && (_root.User_MissileLaunchTimer == 0)) && (_root.User_MissileLaunch == "None")) && (Buildings1_array.Teir3_CommandPost >= 1)) && (Buildings1_array.Teir2_ResearchLab >= 1)) {
KeyAction = "Active";
_root.UserAction = "Missile";
}
}
}
if ((KeyPressed == "Q") && (KeyAction == "None")) {
if ((_quality == "HIGH") && (KeyAction == "None")) {
_quality = "LOW";
KeyAction = "Active";
}
if ((_quality == "MEDIUM") && (KeyAction == "None")) {
_quality = "HIGH";
KeyAction = "Active";
}
if ((_quality == "LOW") && (KeyAction == "None")) {
_quality = "MEDIUM";
KeyAction = "Active";
}
}
if ((KeyPressed == "Z") && (KeyAction == "None")) {
if ((_root.User_DisplayEnemyHealth == false) && (KeyAction == "None")) {
_root.User_DisplayEnemyHealth = true;
KeyAction = "Active";
}
if ((_root.User_DisplayEnemyHealth == true) && (KeyAction == "None")) {
_root.User_DisplayEnemyHealth = false;
KeyAction = "Active";
}
}
if ((KeyPressed == "X") && (KeyAction == "None")) {
if ((_root.User_DisplayBuildingHealth == false) && (KeyAction == "None")) {
_root.User_DisplayBuildingHealth = true;
KeyAction = "Active";
}
if ((_root.User_DisplayBuildingHealth == true) && (KeyAction == "None")) {
_root.User_DisplayBuildingHealth = false;
KeyAction = "Active";
}
}
if (_root.ShiftKey == true) {
if ((KeyPressed == "A") && (KeyAction == "None")) {
SetStance("Aggressive");
KeyAction = "Active";
}
if ((KeyPressed == "S") && (KeyAction == "None")) {
SetStance("Defensive");
KeyAction = "Active";
}
if ((KeyPressed == "D") && (KeyAction == "None")) {
SetStance("Passive");
KeyAction = "Active";
}
}
if ((((_root.ShiftKey == false) && (_root.UserAction == "Command")) && (KeyPressed == "S")) && (KeyAction == "None")) {
i = 0;
while (i <= UnitSelect_array.length) {
_root.container_mc.level_mc[UnitSelect_array[i]].Command = "StopMovement";
i++;
}
KeyAction = "Active";
}
if (((KeyPressed == "W") && (KeyAction == "None")) && ((_root.UserAction == "None") or "Command")) {
EndUnitSelections();
AUS = false;
i = 0;
while (i <= UserUnits_array.length) {
if (_root.container_mc.level_mc[UserUnits_array[i]].MyName != undefined) {
AUS = true;
UnitSelect_array[UnitSelect_array.length + 1] = _root.container_mc.level_mc[UserUnits_array[i]].MyName;
_root.container_mc.level_mc[UserUnits_array[i]].Selected = true;
_root.container_mc.level_mc[UserUnits_array[i]].gotoAndStop("selected");
}
i++;
}
if (AUS == true) {
_root.UserAction = "Command";
}
KeyAction = "Active";
}
if (_root.ShiftKey == true) {
if (KeyPressed == "!") {
KeyPressed = 1;
}
if (KeyPressed == "@") {
KeyPressed = 2;
}
if (KeyPressed == "#") {
KeyPressed = 3;
}
if (KeyPressed == "$") {
KeyPressed = 4;
}
if (KeyPressed == "%") {
KeyPressed = 5;
}
if (KeyPressed == "^") {
KeyPressed = 6;
}
if (KeyPressed == "&") {
KeyPressed = 7;
}
if (KeyPressed == "*") {
KeyPressed = 8;
}
if (KeyPressed == "(") {
KeyPressed = 9;
}
if (KeyPressed == ")") {
KeyPressed = 0;
}
}
if ((_root.ControlKey == true) && (KeyAction == "None")) {
if (!isNaN(Number(KeyPressed))) {
ReassembleArrays();
i = 0;
while (i < _level[("UnitSelect" + KeyPressed) + "_array"].length) {
_root.container_mc.level_mc[_level[("UnitSelect" + KeyPressed) + "_array"][i]].GroupNo = "";
i++;
}
_level[("UnitSelect" + KeyPressed) + "_array"].length = 0;
i = 0;
while (i < UnitSelect_array.length) {
_level[("UnitSelect" + KeyPressed) + "_array"][i] = UnitSelect_array[i];
i++;
}
KeyAction = "Active";
RecalculateControlGroups(Number(KeyPressed));
i = 0;
while (i < UnitSelect_array.length) {
_root.container_mc.level_mc[UnitSelect_array[i]].GroupNo = KeyPressed;
i++;
}
}
}
if ((KeyAction == "None") && ((_root.UserAction == "None") or (_root.UserAction == "Command"))) {
if (!isNaN(Number(KeyPressed))) {
if (DT == false) {
ReassembleArrays();
if (_root.ShiftKey == false) {
EndUnitSelections();
_root.UnitSelected = false;
_root.UserAction = "None";
UnitSelect_array.length = 0;
UnitSelectAdd = UnitSelect_array.length;
} else {
UnitSelectAdd = UnitSelect_array.length;
}
i = 0;
while (i < _level[("UnitSelect" + KeyPressed) + "_array"].length) {
if (_root.container_mc.level_mc[_level[("UnitSelect" + KeyPressed) + "_array"][i]].Selected == false) {
UnitSelect_array[i + UnitSelectAdd] = _level[("UnitSelect" + KeyPressed) + "_array"][i];
}
i++;
}
i = 0;
while (i <= _level[("UnitSelect" + KeyPressed) + "_array"].length) {
if (_level[("UnitSelect" + KeyPressed) + "_array"][i] != undefined) {
_root.UnitSelected = true;
_root.UserAction = "Command";
}
_root.container_mc.level_mc[_level[("UnitSelect" + KeyPressed) + "_array"][i]].gotoAndStop("selected");
_root.container_mc.level_mc[_level[("UnitSelect" + KeyPressed) + "_array"][i]].Selected = true;
i++;
}
KeyAction = "Active";
GetStance();
} else {
FirstX = _root.container_mc.level_mc[UnitSelect_array[0]]._x;
FirstY = _root.container_mc.level_mc[UnitSelect_array[0]]._y;
LastX = _root.container_mc.level_mc[UnitSelect_array[UnitSelect_array.length - 1]]._x;
LastY = _root.container_mc.level_mc[UnitSelect_array[UnitSelect_array.length - 1]]._y;
AverageX = (FirstX + LastX) / 2;
AverageY = (FirstY + LastY) / 2;
GetViewLocation(AverageX, AverageY);
}
}
}
if ((KeyPressed == "C") && (_root.UserAction == "Command")) {
FirstX = _root.container_mc.level_mc[UnitSelect_array[0]]._x;
FirstY = _root.container_mc.level_mc[UnitSelect_array[0]]._y;
LastX = _root.container_mc.level_mc[UnitSelect_array[UnitSelect_array.length - 1]]._x;
LastY = _root.container_mc.level_mc[UnitSelect_array[UnitSelect_array.length - 1]]._y;
AverageX = (FirstX + LastX) / 2;
AverageY = (FirstY + LastY) / 2;
GetViewLocation(AverageX, AverageY);
}
}
};
Key.addListener(keyListener);
function RemoveBuilding(RemoveID, RemoveDepth) {
delete Depths_array["D" + RemoveDepth];
RemoveArrayValue("Building", _root.container_mc.level_mc["Building" + RemoveID].MyName, _root.container_mc.level_mc["Building" + RemoveID].Ownership);
_root.container_mc.level_mc["Building" + RemoveID].swapDepths(0);
_root.TBS_mc.MM_mc["Building" + RemoveID].swapDepths(0);
removeMovieClip(_root.container_mc.level_mc["Building" + RemoveID]);
removeMovieClip(_root.TBS_mc.MM_mc["Building" + RemoveID]);
}
function RemoveUnit(RemoveID, RemoveDepth) {
if (_root.container_mc.level_mc["Unit" + RemoveID].Ownership == 1) {
_root.User_Pop = _root.User_Pop - _root.container_mc.level_mc["Unit" + RemoveID].population;
} else {
_root.Comp_Pop = _root.Comp_Pop - _root.container_mc.level_mc["Unit" + RemoveID].population;
}
delete Depths_array["D" + RemoveDepth];
RemoveArrayValue("Unit", _root.container_mc.level_mc["Unit" + RemoveID].MyName, _root.container_mc.level_mc["Unit" + RemoveID].Ownership);
_root.container_mc.level_mc["Unit" + RemoveID].swapDepths(0);
_root.TBS_mc.MM_mc["Unit" + RemoveID].swapDepths(0);
removeMovieClip(_root.container_mc.level_mc["Unit" + RemoveID]);
removeMovieClip(_root.TBS_mc.MM_mc["Unit" + RemoveID]);
}
function EndUnitSelections() {
i = 0;
while (i <= UnitSelect_array.length) {
_root.container_mc.level_mc[UnitSelect_array[i]].gotoAndStop("idle");
_root.container_mc.level_mc[UnitSelect_array[i]].Selected = false;
i++;
}
UnitSelect_array.length = 0;
GetStance();
}
function AddUnitSelections() {
UnitAdded = false;
i = 0;
while (i < UserUnits_array.length) {
if (((UnitAdded == false) && (_root.container_mc.level_mc[UserUnits_array[i]].hitTest(_root._xmouse, _root._ymouse, true))) && (_root.container_mc.level_mc[UserUnits_array[i]].Selected == false)) {
UnitAdded = true;
UnitSelect_array[UnitSelect_array.length] = _root.container_mc.level_mc[UserUnits_array[i]].MyName;
_root.container_mc.level_mc[UserUnits_array[i]].Selected = true;
_root.container_mc.level_mc[UserUnits_array[i]].gotoAndStop("selected");
_root.UserAction = "Command";
GetStance();
}
i++;
}
return(UnitAdded);
}
function PlaceBuilding(PlaceType, TypeName, PlaceX, PlaceY, Player, Conversion) {
PlaceSetX = Math.round(PlaceX);
PlaceSetY = Math.round(PlaceY);
if (Conversion == true) {
myPoint = {x:PlaceX, y:PlaceY};
_root.container_mc.level_mc.globalToLocal(myPoint);
PlaceSetX = Math.round(myPoint.x);
PlaceSetY = Math.round(myPoint.y);
}
PlaceSetY_str = String(PlaceSetY + 600);
PlaceSetX_str = String(PlaceSetX + 800);
PlaceDepth = Number(PlaceSetY_str + PlaceSetX_str);
_root.TotalBuildings++;
PlaceName = "Building" + _root.TotalBuildings;
Depths_array["D" + PlaceDepth] = PlaceName;
Buildings_array[Buildings_array.length] = PlaceName;
if (Player == 1) {
UserBuildings_array[UserBuildings_array.length] = PlaceName;
if (PlaceType != "BuildingFoundation") {
MatchVars_array.buildingsCreated++;
}
} else {
CompBuildings_array[CompBuildings_array.length] = PlaceName;
}
_root.container_mc.level_mc.attachMovie(PlaceType, PlaceName, PlaceDepth);
_root.container_mc.level_mc[PlaceName]._x = PlaceSetX;
_root.container_mc.level_mc[PlaceName]._y = PlaceSetY;
_root.container_mc.level_mc[PlaceName].Ownership = Player;
_root.container_mc.level_mc[PlaceName].MyName = PlaceName;
_root.container_mc.level_mc[PlaceName].MyDepth = PlaceDepth;
_root.container_mc.level_mc[PlaceName].BuildingNumber = _root.TotalBuildings;
_root.container_mc.level_mc[PlaceName].BuildingName = TypeName;
_root.container_mc.level_mc[PlaceName].PlacePosition = 1;
_root.container_mc.level_mc[PlaceName].Type = PlaceType;
_root.container_mc.level_mc[PlaceName].dead = false;
_root.container_mc.level_mc[PlaceName].repair = false;
_level[("Buildings" + Player) + "_array"][PlaceType]++;
_root.container_mc.level_mc[PlaceName].Workers = 0;
if (PlaceType == "TC_Keep") {
}
if (PlaceType == "Teir1_Armoury") {
_root.container_mc.level_mc[PlaceName].production = ["None", "None", "None", "None", "None", "None", "None", "None"];
}
if (PlaceType == "Teir1_Barracks") {
_root.container_mc.level_mc[PlaceName].timerCount = 0;
_root.container_mc.level_mc[PlaceName].timerSet = 0;
_root.container_mc.level_mc[PlaceName].training = "None";
_root.container_mc.level_mc[PlaceName].production = ["None", "None", "None", "None", "None", "None", "None", "None"];
}
if (PlaceType == "Teir1_Farm") {
_root.container_mc.level_mc[PlaceName].FoodProduced = 0;
_root.container_mc.level_mc[PlaceName].ProduceSet = _root["Produce_Farm" + Player];
_root.container_mc.level_mc[PlaceName].ProduceTimer = _root["Produce_Farm" + Player];
}
if (PlaceType == "Teir1_LumberMill") {
_root.container_mc.level_mc[PlaceName].WoodProduced = 0;
_root.container_mc.level_mc[PlaceName].ProduceSet = _root["Produce_Mill" + Player];
_root.container_mc.level_mc[PlaceName].ProduceTimer = _root["Produce_Mill" + Player];
}
if (PlaceType == "Teir1_Mine") {
_root.container_mc.level_mc[PlaceName].GoldProduced = 0;
_root.container_mc.level_mc[PlaceName].StoneProduced = 0;
_root.container_mc.level_mc[PlaceName].ProduceSet = _root["Produce_Mine" + Player];
_root.container_mc.level_mc[PlaceName].ProduceTimer = _root["Produce_Mine" + Player];
}
if (PlaceType == "Teir1_Stables") {
_root.container_mc.level_mc[PlaceName].production = ["None", "None", "None", "None", "None", "None", "None", "None"];
}
if (PlaceType == "Teir2_Barracks") {
_root.container_mc.level_mc[PlaceName].production = ["None", "None", "None", "None", "None", "None", "None", "None"];
}
if (PlaceType == "Teir2_ResearchLab") {
_root.container_mc.level_mc[PlaceName].production = ["None", "None", "None", "None", "None", "None", "None", "None"];
}
if (PlaceType == "Teir2_WarFactory") {
_root.container_mc.level_mc[PlaceName].production = ["None", "None", "None", "None", "None", "None", "None", "None"];
_root.container_mc.level_mc[PlaceName].MissileLaunch = false;
}
if (PlaceType == "Teir3_CommandPost") {
_root.container_mc.level_mc[PlaceName].production = ["None", "None", "None", "None", "None", "None", "None", "None"];
}
if (PlaceType == "Teir3_TechCenter") {
_root.container_mc.level_mc[PlaceName].production = ["None", "None", "None", "None", "None", "None", "None", "None"];
}
_root.container_mc.level_mc[PlaceName].health = Buildings_Stats[(PlaceType + Player) + "_health"];
_root.container_mc.level_mc[PlaceName].healthMax = Buildings_Stats[(PlaceType + Player) + "_health"];
if (Player == 2) {
Comp_AI_Building(PlaceType, PlaceName);
_root.container_mc.level_mc[PlaceName].repair = true;
} else {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.UserBuilding_Ping = _root.GameTime;
} else if (this.dead == false) {
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.User_Pop = _root.User_Pop - this.Workers;
if ((this.Type == "Teir2_ResearchLab") && (this.MissileLaunch == true)) {
_root.User_MissileLaunch = "None";
}
this.dead = true;
if (this.Type != "BuildingFoundation") {
this.building_mc.gotoAndStop("die");
} else {
this.gotoAndPlay("die");
}
if (this.Type != "BuildingFoundation") {
_root.MatchVars_array.buildingsLost++;
}
}
}
};
}
MiniX = PlaceSetX * 0.055;
MiniY = PlaceSetY * 0.055;
_root.TBS_mc.MM_mc.attachMovie("Mini_Building" + Player, PlaceName, PlaceDepth);
_root.TBS_mc.MM_mc[PlaceName]._x = MiniX;
_root.TBS_mc.MM_mc[PlaceName]._y = MiniY;
_root.TBS_mc.MM_mc[PlaceName].Ownership = Player;
}
function PlaceFoundation() {
_root.attachMovie("BFP", "BFP_mc", 999);
_root.BFP_mc._x = _root._xmouse;
_root.BFP_mc._y = _root._ymouse;
_root.BFP_mc.ActivatePlacement = false;
_root.BFP_mc.onEnterFrame = function () {
this._x = _root._xmouse;
this._y = _root._ymouse;
this.AllowPlacement = true;
i = 1;
while (i <= 4) {
myBFPoint0 = {x:this["point" + i]._x, y:this["point" + i]._y};
this.localToGlobal(myBFPoint0);
myBFPoint = {x:myBFPoint0.x, y:myBFPoint0.y};
_root.container_mc.level_mc.globalToLocal(myBFPoint);
if (myBFPoint.x > 800) {
this.AllowPlacement = false;
}
if (myBFPoint.x < -800) {
this.AllowPlacement = false;
}
if (myBFPoint.y > 600) {
this.AllowPlacement = false;
}
if (myBFPoint.y < -600) {
this.AllowPlacement = false;
}
if (this.AllowPlacement == true) {
myBFPoint = {x:myBFPoint0.x, y:myBFPoint0.y};
_root.container_mc.level_mc[Buildings_array[ii]].globalToLocal(myBFPoint);
if (_root.container_mc.level_mc.restrict_mc.hitTest(myBFPoint.x, myBFPoint.y, true)) {
this.AllowPlacement = false;
}
ii = 0;
while (ii < Buildings_array.length) {
if (_root.container_mc.level_mc[Buildings_array[ii]].foundation_mc.hitTest(myBFPoint.x, myBFPoint.y, true)) {
this.AllowPlacement = false;
}
ii++;
}
iii = 0;
while (iii < Units_array.length) {
myUserPoint = {x:_root.container_mc.level_mc[Units_array[iii]]._x, y:_root.container_mc.level_mc[Units_array[iii]]._y};
_root.container_mc.level_mc.localToGlobal(myUserPoint);
if (this.foundation_mc.unit_mc.hitTest(myUserPoint.x, myUserPoint.y, true)) {
this.AllowPlacement = false;
}
iii++;
}
}
i++;
}
if (this.AllowPlacement == true) {
this.gotoAndStop("open");
} else {
this.gotoAndStop("closed");
}
if ((((((((this.ActivatePlacement == true) && (this.AllowPlacement == true)) && (_root._xmouse < 550)) && (_root._ymouse < 400)) && (_root.User_Food >= _root.Costs_array.Misc_Foundation_Food)) && (_root.User_Gold >= _root.Costs_array.Misc_Foundation_Gold)) && (_root.User_Stone >= _root.Costs_array.Misc_Foundation_Stone)) && (_root.User_Wood >= _root.Costs_array.Misc_Foundation_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Misc_Foundation_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Misc_Foundation_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Misc_Foundation_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Misc_Foundation_Wood;
PlaceBuilding("BuildingFoundation", "Foundation", _root._xmouse, _root._ymouse, 1, true);
_root.TBS_mc.FP_mc.gotoAndStop("recharge");
_root.UserAction = "None";
this.removeMovieClip();
} else {
this.ActivatePlacement = false;
}
if (Key.isDown(27) or Key.isDown(192)) {
_root.UserAction = "None";
this.removeMovieClip();
}
};
}
function CheckDepths(PlaceX, PlaceY, Self) {
if (Self == undefined) {
Self = "";
}
PlaceSetX = Math.round(PlaceX);
PlaceSetY = Math.round(PlaceY);
PlaceSetY_str = String(PlaceSetY + 600);
PlaceSetX_str = String(PlaceSetX + 800);
PlaceDepth = Number(PlaceSetY_str + PlaceSetX_str);
DepthInUse = false;
if (Depths_array["D" + PlaceDepth] != undefined) {
DepthInUse = true;
}
if (Depths_array["D" + PlaceDepth] == Self) {
DepthInUse = false;
}
return(DepthInUse);
}
function CreateUnit(UnitType, UnitName, PlaceX, PlaceY, Player, Conversion) {
PlaceSetX = Math.round(PlaceX);
PlaceSetY = Math.round(PlaceY);
if (Conversion == true) {
myPoint = {x:PlaceX, y:PlaceY};
_root.container_mc.level_mc.globalToLocal(myPoint);
PlaceSetX = Math.round(myPoint.x);
PlaceSetY = Math.round(myPoint.y);
}
PlaceSetY_str = String(PlaceSetY + 600);
PlaceSetX_str = String(PlaceSetX + 800);
PlaceDepth = Number(PlaceSetY_str + PlaceSetX_str);
if (Depths_array["D" + PlaceDepth] == undefined) {
_root.TotalUnits++;
CreateName = "Unit" + _root.TotalUnits;
Units_array[Units_array.length] = CreateName;
if (Player == 1) {
UserUnits_array[UserUnits_array.length] = CreateName;
} else {
CompUnits_array[CompUnits_array.length] = CreateName;
}
Depths_array["D" + PlaceDepth] = CreateName;
_root.container_mc.level_mc.attachMovie(UnitType, CreateName, PlaceDepth);
_root.container_mc.level_mc[CreateName]._x = PlaceSetX;
_root.container_mc.level_mc[CreateName]._y = PlaceSetY;
_root.container_mc.level_mc[CreateName].Selected = false;
if (Player == 1) {
_root.container_mc.level_mc[CreateName].eHealth_mc.gotoAndStop("clear");
MatchVars_array.unitsTrained++;
}
_level[("UnitsOwned" + Player) + "_array"][UnitType]++;
_root.container_mc.level_mc[CreateName].Ownership = Player;
_root.container_mc.level_mc[CreateName].MyName = CreateName;
_root.container_mc.level_mc[CreateName].MyDepth = PlaceDepth;
_root.container_mc.level_mc[CreateName].UnitNumber = _root.TotalUnits;
_root.container_mc.level_mc[CreateName].UnitName = UnitName;
_root.container_mc.level_mc[CreateName].TimeSet = 0;
_root.container_mc.level_mc[CreateName].dead = false;
_root.container_mc.level_mc[CreateName].GroupNo = "";
_root.container_mc.level_mc[CreateName].stance = _root.User_DefaultStance;
if (Player == 2) {
_root.container_mc.level_mc[CreateName].stance = "Aggressive";
_root.Comp_Pop = _root.Comp_Pop + _level[(("Unit" + Player) + "_") + UnitType].pop;
} else {
_root.User_Pop = _root.User_Pop + _level[(("Unit" + Player) + "_") + UnitType].pop;
}
_root.container_mc.level_mc[CreateName].health = _level[(("Unit" + Player) + "_") + UnitType].health;
_root.container_mc.level_mc[CreateName].healthMax = _level[(("Unit" + Player) + "_") + UnitType].health;
_root.container_mc.level_mc[CreateName].speed = _level[(("Unit" + Player) + "_") + UnitType].speed;
_root.container_mc.level_mc[CreateName].damage = _level[(("Unit" + Player) + "_") + UnitType].damage;
_root.container_mc.level_mc[CreateName].range = _level[(("Unit" + Player) + "_") + UnitType].range;
_root.container_mc.level_mc[CreateName].population = _level[(("Unit" + Player) + "_") + UnitType].pop;
_root.container_mc.level_mc[CreateName].counters = _level[(("Unit" + Player) + "_") + UnitType].counter;
_root.container_mc.level_mc[CreateName].counterValue1 = _level[(("Unit" + Player) + "_") + UnitType].counterValue1;
_root.container_mc.level_mc[CreateName].counterValue2 = _level[(("Unit" + Player) + "_") + UnitType].counterValue2;
_root.container_mc.level_mc[CreateName].AttackingActive = false;
_root.container_mc.level_mc[CreateName].AttackSet = false;
_root.container_mc.level_mc[CreateName].AttackType = "";
_root.container_mc.level_mc[CreateName].AttackTarget = "";
_root.container_mc.level_mc[CreateName].AttackTD = "";
_root.container_mc.level_mc[CreateName].Detour = false;
_root.container_mc.level_mc[CreateName].Command = "None";
_root.container_mc.level_mc[CreateName].CreateSoundEffect = false;
_root.container_mc.level_mc[CreateName].Move = false;
_root.container_mc.level_mc[CreateName].GoToX = PlaceSetX;
_root.container_mc.level_mc[CreateName].GoToY = PlaceSetY;
_root.container_mc.level_mc[CreateName].DetourX = PlaceSetX;
_root.container_mc.level_mc[CreateName].DetourY = PlaceSetY;
_root.container_mc.level_mc[CreateName].TravelToX = PlaceSetX;
_root.container_mc.level_mc[CreateName].TravelToY = PlaceSetY;
_root.container_mc.level_mc[CreateName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
if (this.AttackingActive == false) {
this.Move = false;
this.stopDistance = this.speed;
if ((this.AttackSet == true) && (this.Detour == false)) {
if (_root.container_mc.level_mc[this.AttackTarget].health > 0) {
this.GoToX = _root.container_mc.level_mc[this.AttackTarget]._x;
this.GoToY = _root.container_mc.level_mc[this.AttackTarget]._y;
this.stopDistance = this.range;
if (this.AttackType == "Building") {
if ((this._x > _root.container_mc.level_mc[this.AttackTarget]._x) && (this._y >= _root.container_mc.level_mc[this.AttackTarget]._y)) {
this.stopDistance = this.stopDistance + 30;
}
if ((this._x <= _root.container_mc.level_mc[this.AttackTarget]._x) && (this._y > _root.container_mc.level_mc[this.AttackTarget]._y)) {
this.stopDistance = this.stopDistance + 55;
}
if ((this._x > _root.container_mc.level_mc[this.AttackTarget]._x) && (this._y <= _root.container_mc.level_mc[this.AttackTarget]._y)) {
this.stopDistance = this.stopDistance + 55;
}
if ((this._x <= _root.container_mc.level_mc[this.AttackTarget]._x) && (this._y < _root.container_mc.level_mc[this.AttackTarget]._y)) {
this.stopDistance = this.stopDistance + 30;
}
}
} else {
this.Command = "StopMovement";
}
}
if (this.Detour == true) {
this.opposite = this.DetourY - this._y;
this.adjacent = this.DetourX - this._x;
} else {
this.opposite = this.GoToY - this._y;
this.adjacent = this.GoToX - this._x;
}
this.hypotenuse = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
this._rotation = Math.atan2(this.opposite, this.adjacent) * 57.2957795130823;
if (this.hypotenuse > this.stopDistance) {
this.Move = true;
this.myPoint = {x:this.speed, y:0};
this.localToGlobal(this.myPoint);
this.myPoint2 = {x:this.myPoint.x, y:this.myPoint.y};
_root.container_mc.level_mc.globalToLocal(this.myPoint2);
this.myPoint3 = {x:-this.speed, y:0};
this.localToGlobal(this.myPoint3);
this.myPoint4 = {x:this.myPoint3.x, y:this.myPoint3.y};
_root.container_mc.level_mc.globalToLocal(this.myPoint4);
this.TravelToX = this.myPoint2.x;
this.TravelToY = this.myPoint2.y;
i = 0;
while (i < Buildings_array.length) {
if ((this.Detour == false) && (_root.container_mc.level_mc[Buildings_array[i]].foundation_mc.unit_mc.hitTest(this.myPoint.x, this.myPoint.y, true))) {
this._x = this.myPoint4.x;
this._y = this.myPoint4.y;
this.Detour = true;
this.DetourX = this.myPoint2.x;
this.DetourY = this.myPoint2.y;
this.Move = false;
this.YMod = _root.container_mc.level_mc[Buildings_array[i]]._y - this._y;
if (_root.container_mc.level_mc[Buildings_array[i]].foundation_mc.a5.hitTest(this.myPoint3.x, this.myPoint3.y, true)) {
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y + 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x + 35;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse1 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
this.DetourX = this.TX;
this.DetourY = this.TY;
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y - 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x + 85;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse2 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
if (this.TestHypotenuse2 < this.TestHypotenuse1) {
this.DetourX = this.TX;
this.DetourY = this.TY;
}
}
if (_root.container_mc.level_mc[Buildings_array[i]].foundation_mc.a4.hitTest(this.myPoint3.x, this.myPoint3.y, true)) {
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y + 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x - 85;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse1 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
this.DetourX = this.TX;
this.DetourY = this.TY;
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y - 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x - 35;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse2 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
if (this.TestHypotenuse2 < this.TestHypotenuse1) {
this.DetourX = this.TX;
this.DetourY = this.TY;
}
}
if (_root.container_mc.level_mc[Buildings_array[i]].foundation_mc.a7.hitTest(this.myPoint3.x, this.myPoint3.y, true)) {
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y + 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x + 35;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse1 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
this.DetourX = this.TX;
this.DetourY = this.TY;
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y + 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x - 85;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse2 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
if (this.TestHypotenuse2 < this.TestHypotenuse1) {
this.DetourX = this.TX;
this.DetourY = this.TY;
}
}
if (_root.container_mc.level_mc[Buildings_array[i]].foundation_mc.a2.hitTest(this.myPoint3.x, this.myPoint3.y, true)) {
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y - 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x + 85;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse1 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
this.DetourX = this.TX;
this.DetourY = this.TY;
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y - 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x - 35;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse2 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
if (this.TestHypotenuse2 < this.TestHypotenuse1) {
this.DetourX = this.TX;
this.DetourY = this.TY;
}
}
if (_root.container_mc.level_mc[Buildings_array[i]].foundation_mc.a8.hitTest(this.myPoint3.x, this.myPoint3.y, true)) {
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x + 60;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse1 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
this.DetourX = this.TX;
this.DetourY = this.TY;
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y + 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x - 25;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse2 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
if (this.TestHypotenuse2 < this.TestHypotenuse1) {
this.DetourX = this.TX;
this.DetourY = this.TY;
}
}
if (_root.container_mc.level_mc[Buildings_array[i]].foundation_mc.a6.hitTest(this.myPoint3.x, this.myPoint3.y, true)) {
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x - 60;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse1 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
this.DetourX = this.TX;
this.DetourY = this.TY;
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y + 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x - 25;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse2 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
if (this.TestHypotenuse2 < this.TestHypotenuse1) {
this.DetourX = this.TX;
this.DetourY = this.TY;
}
}
if (_root.container_mc.level_mc[Buildings_array[i]].foundation_mc.a3.hitTest(this.myPoint3.x, this.myPoint3.y, true)) {
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x + 60;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse1 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
this.DetourX = this.TX;
this.DetourY = this.TY;
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y - 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x + 25;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse2 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
if (this.TestHypotenuse2 < this.TestHypotenuse1) {
this.DetourX = this.TX;
this.DetourY = this.TY;
}
}
if (_root.container_mc.level_mc[Buildings_array[i]].foundation_mc.a1.hitTest(this.myPoint3.x, this.myPoint3.y, true)) {
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x - 60;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse1 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
this.DetourX = this.TX;
this.DetourY = this.TY;
this.TY = _root.container_mc.level_mc[Buildings_array[i]]._y - 35;
this.TX = _root.container_mc.level_mc[Buildings_array[i]]._x + 25;
this.opposite = this.GoToY - this.TY;
this.adjacent = this.GoToX - this.TX;
this.TestHypotenuse2 = Math.sqrt((this.opposite * this.opposite) + (this.adjacent * this.adjacent));
if (this.TestHypotenuse2 < this.TestHypotenuse1) {
this.DetourX = this.TX;
this.DetourY = this.TY;
}
}
}
i++;
}
if (CheckDepths(this.myPoint2.x, this.myPoint2.y, this.MyName) == true) {
this.Move = false;
}
if (((this.myPoint2.x > 800) or (this.myPoint2.x < -800)) or ((this.myPoint2.y > 600) or (this.myPoint2.y < -600))) {
this.Command = "StopMovement";
}
}
if (((this.hypotenuse <= this.stopDistance) && (this.AttackSet == true)) && (this.Detour == false)) {
this.unit_mc.gotoAndStop("attack");
this.unit_mc.unit_mc.gotoAndPlay("attack");
this.AttackTD = this.AttackTarget;
}
if (this.Command == "StopMovement") {
this.Command = "None";
this.AttackSet = false;
this.AttackTarget = "";
this.Move = false;
this.GoToX = this.myPoint2.x;
this.GoToY = this.myPoint2.y;
}
if ((this.hypotenuse <= this.stopDistance) && (this.Detour == true)) {
this.Detour = false;
}
if (this.Move == true) {
this.unit_mc.gotoAndStop("move");
this._x = this.TravelToX;
this._y = this.TravelToY;
delete Depths_array["D" + this.MyDepth];
this.DepthY_str = String(Math.round(this._y + 600));
this.DepthX_str = String(Math.round(this._x + 800));
this.NewDepth = Math.round(Number(this.DepthY_str + this.DepthX_str));
Depths_array["D" + this.NewDepth] = this.MyName;
this.MyDepth = this.NewDepth;
this.swapDepths(this.MyDepth);
MiniX = this._x * 0.055;
MiniY = this._y * 0.055;
_root.TBS_mc.MM_mc[this.MyName]._x = MiniX;
_root.TBS_mc.MM_mc[this.MyName]._y = MiniY;
_root.TBS_mc.MM_mc[this.MyName].swapDepths(this.MyDepth);
} else if (this.AttackSet == false) {
this.unit_mc.gotoAndStop("idle");
this.AttackTarget = "";
}
}
if (this.CreateSoundEffect == true) {
this.CreateSoundEffect = false;
this.My_str = this.UnitName;
if (this.My_str.indexOf("Mounted") != -1) {
this.My_str = this.My_str.substr(this.My_str.indexOf("Mounted") + 7, this.My_str.length);
}
this.myPoint = {x:0, y:0};
this.localToGlobal(this.myPoint);
this.adj = this.myPoint.x - 275;
this.opp = this.myPoint.y - 200;
this.hyp = Math.sqrt((this.adj * this.adj) + (this.opp * this.opp));
this.VolumeFade = 1 - ((this.hyp - 200) / 300);
if (this.VolumeFade > 1) {
this.VolumeFade = 1;
}
if (this.VolumeFade < 0) {
this.VolumeFade = 0;
}
this.Pan = 0;
if (this.adj > 150) {
this.Pan = Math.round((1 - ((this.adj - 150) / 200)) * 100);
if (this.Pan < 0) {
this.Pan = 0;
}
this.Pan = 100 - this.Pan;
}
if (this.adj < -150) {
this.Pan = Math.round((1 - ((this.adj + 150) / 200)) * 100);
if (this.Pan > 200) {
this.Pan = 200;
}
this.Pan = -1 * (this.Pan - 100);
}
this.CreateVolume = Math.round(_root.Sound_array.volume * this.VolumeFade);
if (this.CreateVolume > 0) {
_root.sounds_mc.CreateSound("Unit_", this.My_str, this.CreateVolume, this.Pan, false);
}
}
if (this.AttackingActive == true) {
if (this.AttackDamageActive == true) {
this.dealDamage = this.damage;
this.i = 0;
while (this.i < this.counters.length) {
if (this.counters[this.i] == _root.container_mc.level_mc[this.AttackTD].UnitName) {
this.dealDamage = this.dealDamage * this.counterValue1;
}
this.i++;
}
this.i = 0;
while (this.i < _root.container_mc.level_mc[this.AttackTD].counters.length) {
if (_root.container_mc.level_mc[this.AttackTD].counters[this.i] == this.UnitName) {
this.dealDamage = this.dealDamage / _root.container_mc.level_mc[this.AttackTD].counterValue2;
}
this.i++;
}
_root.container_mc.level_mc[this.AttackTD].health = _root.container_mc.level_mc[this.AttackTD].health - this.dealDamage;
this.AttackDamageActive = false;
if ((((_root.container_mc.level_mc[this.AttackTD].stance == "Defensive") or (_root.container_mc.level_mc[this.AttackTarget].stance == "Aggressive")) && (_root.container_mc.level_mc[this.AttackTarget].AttackTarget == "")) && (_root.container_mc.level_mc[this.AttackTarget].AttackSet == false)) {
_root.container_mc.level_mc[this.AttackTD].AttackSet = true;
_root.container_mc.level_mc[this.AttackTD].AttackType = "Unit";
_root.container_mc.level_mc[this.AttackTD].AttackTarget = this.MyName;
}
if ((this.Ownership == 1) && (_root.container_mc.level_mc[this.AttackTarget].AttackType == "Building")) {
_root.container_mc.level_mc[this.AttackTD].AttackSet = true;
_root.container_mc.level_mc[this.AttackTD].AttackType = "Unit";
_root.container_mc.level_mc[this.AttackTD].AttackTarget = this.MyName;
}
if ((this.Ownership == 1) && (this.AttackType == "Building")) {
i = 0;
while (i < CompUnits_array.length) {
if ((((_root.container_mc.level_mc[CompUnits_array[i]].stance == "Defensive") or (_root.container_mc.level_mc[CompUnits_array[i]].stance == "Aggressive")) && (_root.container_mc.level_mc[CompUnits_array[i]].AttackTarget == "")) && (_root.container_mc.level_mc[CompUnits_array[i]].AttackSet == false)) {
_root.container_mc.level_mc[CompUnits_array[i]].AttackSet = true;
_root.container_mc.level_mc[this.AttackTD].AttackType = "Unit";
_root.container_mc.level_mc[CompUnits_array[i]].AttackTarget = this.MyName;
}
i++;
}
}
}
}
if (((this.stance == "Aggressive") && (this.AttackTarget == "")) && (this.AttackSet == false)) {
if (this.TimeSet <= 0) {
this.TimeSet = 20;
if (this.Ownership == 1) {
this.Search = "Comp";
} else {
this.Search = "User";
}
this.SearchType = "";
this.SearchClosest = Infinity;
this.SearchTarget = Infinity;
i = 0;
while (i < _level[this.Search + "Units_array"].length) {
this.SearchOpposite = _root.container_mc.level_mc[_level[this.Search + "Units_array"][i]]._y - this._y;
this.SearchAdjacent = _root.container_mc.level_mc[_level[this.Search + "Units_array"][i]]._x - this._x;
this.SearchHypotenuse = Math.sqrt((this.SearchOpposite * this.SearchOpposite) + (this.SearchAdjacent * this.SearchAdjacent));
if ((this.SearchHypotenuse < this.SearchClosest) && (_root.container_mc.level_mc[_level[this.Search + "Units_array"][i]].health > 0)) {
this.SearchType = "Unit";
this.SearchClosest = this.SearchHypotenuse;
this.SearchTarget = _level[this.Search + "Units_array"][i];
}
i++;
}
i = 0;
while (i < _level[this.Search + "Buildings_array"].length) {
this.SearchOpposite = _root.container_mc.level_mc[_level[this.Search + "Buildings_array"][i]]._y - this._y;
this.SearchAdjacent = _root.container_mc.level_mc[_level[this.Search + "Buildings_array"][i]]._x - this._x;
this.SearchHypotenuse = Math.sqrt((this.SearchOpposite * this.SearchOpposite) + (this.SearchAdjacent * this.SearchAdjacent));
if ((this.SearchHypotenuse < this.SearchClosest) && (_root.container_mc.level_mc[_level[this.Search + "Buildings_array"][i]].health > 0)) {
this.SearchType = "Building";
this.SearchClosest = this.SearchHypotenuse;
this.SearchTarget = _level[this.Search + "Buildings_array"][i];
}
i++;
}
if (this.Search == "Comp") {
this.SearchLOS = _root.User_LOS;
} else {
this.SearchLOS = _root.Comp_LOS;
}
if (this.SearchClosest <= this.SearchLOS) {
this.AttackSet = true;
this.AttackType = this.SearchType;
this.AttackTarget = this.SearchTarget;
}
} else {
this.TimeSet--;
}
}
if (this.Ownership == 2) {
_root.CompUnit_Ping = _root.GameTime;
} else {
_root.UserUnit_Ping = _root.GameTime;
}
} else if (this.dead == false) {
_level[("UnitsOwned" + this.Ownership) + "_array"][this.UnitName]--;
this.dead = true;
this.unit_mc.gotoAndStop("die");
if (this.Ownership == 2) {
_root.MatchVars_array.unitsKilled++;
} else {
_root.MatchVars_array.unitsLost++;
}
}
}
};
MiniX = PlaceSetX * 0.055;
MiniY = PlaceSetY * 0.055;
_root.TBS_mc.MM_mc.attachMovie("Mini_Unit" + Player, CreateName, PlaceDepth);
_root.TBS_mc.MM_mc[CreateName]._x = MiniX;
_root.TBS_mc.MM_mc[CreateName]._y = MiniY;
_root.TBS_mc.MM_mc[CreateName].Ownership = Player;
return(CreateName);
}
}
function Scroller() {
if (_root.PauseGame == false) {
_root.GameTime++;
if ((_root.UserAction == "Command") && ((Key.isDown(27) or Key.isDown(192)) or (UnitSelect_array.length == 0))) {
_root.UserAction = "None";
EndUnitSelections();
}
if (((_root.UserAction == "Airstrike") or (_root.UserAction == "Missile")) && (Key.isDown(27) or Key.isDown(192))) {
_root.UserAction = "None";
}
if ((_root.UserAction == "Airstrike") && (Buildings1_array.Teir3_CommandPost == 0)) {
_root.UserAction = "None";
}
if ((_root.UserAction == "Missile") && ((Buildings1_array.Teir2_ResearchLab == 0) or (Buildings1_array.Teir3_CommandPost == 0))) {
_root.UserAction = "None";
}
if (((_root.UserAction == "Airstrike") or (_root.UserAction == "Missile")) && (PowerActivated == false)) {
Mouse.hide();
_root.attachMovie(_root.UserAction + "Cursor", "Power_mc", 998);
_root.Power_mc._x = _root._xmouse;
_root.Power_mc._y = _root._ymouse;
_root.Power_mc._visible = true;
_root.Power_mc.onEnterFrame = function () {
this._x = _root._xmouse;
this._y = _root._ymouse;
if ((this._x > 550) or (this._y > 400)) {
Mouse.show();
this._visible = false;
} else {
Mouse.hide();
this._visible = true;
}
};
PowerActivated = true;
}
if ((_root.UserAction == "None") && (PowerActivated == true)) {
Mouse.show();
_root.Power_mc.removeMovieClip();
PowerActivated = false;
}
if ((_root.UserAction == "Command") && (CommandActivated == false)) {
Mouse.hide();
_root.attachMovie("CommandPosition", "CommandPosition_mc", 1000);
_root.CommandPosition_mc._x = _root._xmouse;
_root.CommandPosition_mc._y = _root._ymouse;
_root.CommandPosition_mc._visible = true;
_root.CommandPosition_mc.onEnterFrame = function () {
this._x = _root._xmouse;
this._y = _root._ymouse;
if ((this._x > 550) or (this._y > 400)) {
Mouse.show();
this._visible = false;
} else {
Mouse.hide();
this._visible = true;
}
if (this._visible == true) {
_root.CommandPositionTarget = "";
this.MyHitTest = false;
i = 0;
while (i < CompBuildings_array.length) {
if (this.MyHitTest == false) {
if (_root.container_mc.level_mc[CompBuildings_array[i]].foundation_mc.unit_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.CommandPositionAttack = true;
_root.CommandPositionType = "Building";
_root.CommandPositionTarget = [CompBuildings_array[i]];
this.command_mc.t_mc.gotoAndStop(2);
this.command_mc.l_mc.gotoAndStop(2);
this.command_mc.r_mc.gotoAndStop(2);
this.command_mc.b_mc.gotoAndStop(2);
this.MyHitTest = true;
} else {
_root.CommandPositionAttack = false;
this.command_mc.t_mc.gotoAndStop(1);
this.command_mc.l_mc.gotoAndStop(1);
this.command_mc.r_mc.gotoAndStop(1);
this.command_mc.b_mc.gotoAndStop(1);
}
}
i++;
}
i = 0;
while (i < CompUnits_array.length) {
if (this.MyHitTest == false) {
if (_root.container_mc.level_mc[CompUnits_array[i]].unit_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.CommandPositionAttack = true;
_root.CommandPositionType = "Unit";
_root.CommandPositionTarget = [CompUnits_array[i]];
this.command_mc.t_mc.gotoAndStop(2);
this.command_mc.l_mc.gotoAndStop(2);
this.command_mc.r_mc.gotoAndStop(2);
this.command_mc.b_mc.gotoAndStop(2);
this.MyHitTest = true;
} else {
_root.CommandPositionAttack = false;
this.command_mc.t_mc.gotoAndStop(1);
this.command_mc.l_mc.gotoAndStop(1);
this.command_mc.r_mc.gotoAndStop(1);
this.command_mc.b_mc.gotoAndStop(1);
}
}
i++;
}
}
if (this._visible == true) {
this.MyHitTest = false;
i = 0;
while (i < UserBuildings_array.length) {
if (this.MyHitTest == false) {
if (_root.container_mc.level_mc[UserBuildings_array[i]].foundation_mc.unit_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
this._visible = false;
_root.CommandUnable_mc._visible = true;
this.MyHitTest = true;
} else {
this._visible = true;
_root.CommandUnable_mc._visible = false;
}
}
i++;
}
}
};
_root.attachMovie("CommandUnable", "CommandUnable_mc", 1001);
_root.CommandUnable_mc._x = _root._xmouse;
_root.CommandUnable_mc._y = _root._ymouse;
_root.CommandUnable_mc._visible = false;
_root.CommandUnable_mc.onEnterFrame = function () {
this._x = _root._xmouse;
this._y = _root._ymouse;
if ((this._x > 550) or (this._y > 400)) {
Mouse.show();
this._visible = false;
} else {
Mouse.hide();
this._visible = true;
}
};
CommandActivated = true;
}
if ((_root.UserAction == "None") && (CommandActivated == true)) {
Mouse.show();
_root.CommandPosition_mc.removeMovieClip();
_root.CommandUnable_mc.removeMovieClip();
CommandActivated = false;
}
if (Key.isDown(37)) {
_root.container_mc.level_mc._x = _root.container_mc.level_mc._x + _root.ArrowScrollAmount;
if (_root.container_mc.level_mc._x > 525) {
_root.container_mc.level_mc._x = 525;
}
_root.TBS_mc.MM_mc.view_mc._x = -(_root.container_mc.level_mc._x * 0.055);
_root.TBS_mc.MM_mc.view_mc._y = -(_root.container_mc.level_mc._y * 0.055);
}
if (Key.isDown(39)) {
_root.container_mc.level_mc._x = _root.container_mc.level_mc._x - _root.ArrowScrollAmount;
if (_root.container_mc.level_mc._x < -525) {
_root.container_mc.level_mc._x = -525;
}
_root.TBS_mc.MM_mc.view_mc._x = -(_root.container_mc.level_mc._x * 0.055);
_root.TBS_mc.MM_mc.view_mc._y = -(_root.container_mc.level_mc._y * 0.055);
}
if (Key.isDown(38)) {
_root.container_mc.level_mc._y = _root.container_mc.level_mc._y + _root.ArrowScrollAmount;
if (_root.container_mc.level_mc._y > 400) {
_root.container_mc.level_mc._y = 400;
}
_root.TBS_mc.MM_mc.view_mc._x = -(_root.container_mc.level_mc._x * 0.055);
_root.TBS_mc.MM_mc.view_mc._y = -(_root.container_mc.level_mc._y * 0.055);
}
if (Key.isDown(40)) {
_root.container_mc.level_mc._y = _root.container_mc.level_mc._y - _root.ArrowScrollAmount;
if (_root.container_mc.level_mc._y < -400) {
_root.container_mc.level_mc._y = -400;
}
_root.TBS_mc.MM_mc.view_mc._x = -(_root.container_mc.level_mc._x * 0.055);
_root.TBS_mc.MM_mc.view_mc._y = -(_root.container_mc.level_mc._y * 0.055);
}
if (Key.isDown(32) && (ScrollerActivated == false)) {
_root.UserPassiveAction = "Scrolling";
Mouse.hide();
ScrollStartX = _root.container_mc._xmouse;
ScrollStartY = _root.container_mc._ymouse;
ScrollerActivated = true;
myPoint = {x:ScrollStartX, y:ScrollStartY};
_root.container_mc.localToGlobal(myPoint);
_root.attachMovie("LevelScroller", "LevelScroller_mc", 1002);
_root.LevelScroller_mc._x = myPoint.x;
_root.LevelScroller_mc._y = myPoint.y;
if (_root.UserAction != "Command") {
_root.attachMovie("ScrollerPoint", "ScrollerPoint_mc", 1000);
_root.ScrollerPoint_mc._x = _root._xmouse;
_root.ScrollerPoint_mc._y = _root._ymouse;
_root.ScrollerPoint_mc.onEnterFrame = function () {
this._x = _root._xmouse;
this._y = _root._ymouse;
opposite = this._y - _root.LevelScroller_mc._y;
adjacent = this._x - _root.LevelScroller_mc._x;
this._rotation = Math.atan2(opposite, adjacent) * 57.2957795130823;
};
}
}
if (Key.isDown(32) && (ScrollerActivated == true)) {
_root.container_mc.level_mc._x = _root.container_mc.level_mc._x - ((_root.container_mc._xmouse - ScrollStartX) / 5);
_root.container_mc.level_mc._y = _root.container_mc.level_mc._y - ((_root.container_mc._ymouse - ScrollStartY) / 5);
if (_root.container_mc.level_mc._x > 525) {
_root.container_mc.level_mc._x = 525;
}
if (_root.container_mc.level_mc._x < -525) {
_root.container_mc.level_mc._x = -525;
}
if (_root.container_mc.level_mc._y > 400) {
_root.container_mc.level_mc._y = 400;
}
if (_root.container_mc.level_mc._y < -400) {
_root.container_mc.level_mc._y = -400;
}
_root.TBS_mc.MM_mc.view_mc._x = -(_root.container_mc.level_mc._x * 0.055);
_root.TBS_mc.MM_mc.view_mc._y = -(_root.container_mc.level_mc._y * 0.055);
}
if ((!Key.isDown(32)) && (ScrollerActivated == true)) {
_root.UserPassiveAction = "None";
if (_root.UserAction != "Command") {
Mouse.show();
}
ScrollStartX = 0;
ScrollStartY = 0;
ScrollerActivated = false;
_root.LevelScroller_mc.removeMovieClip();
_root.ScrollerPoint_mc.removeMovieClip();
}
}
_root.container_mc.levelEffects_mc._x = _root.container_mc.level_mc._x;
_root.container_mc.levelEffects_mc._y = _root.container_mc.level_mc._y;
}
function DragBox() {
if (DragCommandClicked == true) {
_root.DragVars_XVar = _root.container_mc.levelEffects_mc._xmouse;
_root.DragVars_YVar = _root.container_mc.levelEffects_mc._ymouse;
_root.DragVars_Width = _root.DragVars_XVar - _root.DragVars_StartX;
_root.DragVars_Height = _root.DragVars_YVar - _root.DragVars_StartY;
if ((Math.abs(_root.DragVars_Width) * Math.abs(_root.DragVars_Height)) > 500) {
_root.container_mc.levelEffects_mc.attachMovie("DragBox", "DragBox_mc", 1000);
_root.container_mc.levelEffects_mc.DragBox_mc.fill_mc._width = Math.abs(_root.DragVars_Width);
_root.container_mc.levelEffects_mc.DragBox_mc.fill_mc._height = Math.abs(_root.DragVars_Height);
_root.container_mc.levelEffects_mc.DragBox_mc.top_mc._width = Math.abs(_root.DragVars_Width) + 10;
_root.container_mc.levelEffects_mc.DragBox_mc.left_mc._height = Math.abs(_root.DragVars_Height) + 10;
_root.container_mc.levelEffects_mc.DragBox_mc.right_mc._height = Math.abs(_root.DragVars_Height) + 10;
_root.container_mc.levelEffects_mc.DragBox_mc.bottom_mc._width = Math.abs(_root.DragVars_Width) + 10;
_root.container_mc.levelEffects_mc.DragBox_mc.right_mc._x = Math.abs(_root.DragVars_Width) + 7.5;
_root.container_mc.levelEffects_mc.DragBox_mc.bottom_mc._y = Math.abs(_root.DragVars_Height) + 7.5;
_root.container_mc.levelEffects_mc.DragBox_mc._x = _root.DragVars_XVar - _root.DragVars_Width;
_root.container_mc.levelEffects_mc.DragBox_mc._y = _root.DragVars_YVar - _root.DragVars_Height;
if (_root.DragVars_Width < 0) {
_root.container_mc.levelEffects_mc.DragBox_mc._xscale = -100;
} else {
_root.container_mc.levelEffects_mc.DragBox_mc._xscale = 100;
}
if (_root.DragVars_Height < 0) {
_root.container_mc.levelEffects_mc.DragBox_mc._yscale = -100;
} else {
_root.container_mc.levelEffects_mc.DragBox_mc._yscale = 100;
}
DragCommandActive = true;
} else {
_root.container_mc.levelEffects_mc.DragBox_mc.removeMovieClip();
DragCommandActive = false;
}
}
}
function GetViewLocation(SetX, SetY) {
_root.container_mc.level_mc._x = -SetX;
_root.container_mc.level_mc._y = -SetY;
if (_root.container_mc.level_mc._x > 525) {
_root.container_mc.level_mc._x = 525;
}
if (_root.container_mc.level_mc._x < -525) {
_root.container_mc.level_mc._x = -525;
}
if (_root.container_mc.level_mc._y > 400) {
_root.container_mc.level_mc._y = 400;
}
if (_root.container_mc.level_mc._y < -400) {
_root.container_mc.level_mc._y = -400;
}
_root.TBS_mc.MM_mc.view_mc._x = -(_root.container_mc.level_mc._x * 0.055);
_root.TBS_mc.MM_mc.view_mc._y = -(_root.container_mc.level_mc._y * 0.055);
}
ScrollerActivated = false;
CommandActivated = false;
CommandClickSelect = false;
DragCommandClicked = false;
DragCommandActive = false;
PowerActivated = false;
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if ((((_root.UserAction == "None") or (_root.UserAction == "Command")) && (_root._xmouse < 550)) && (_root._ymouse < 400)) {
DragCommandClicked = true;
DragCommandActive = false;
_root.DragVars_StartX = _root.container_mc.levelEffects_mc._xmouse;
_root.DragVars_StartY = _root.container_mc.levelEffects_mc._ymouse;
}
if (_root.UserAction == "Airstrike") {
_root.sounds_mc.CreateSound("Power_", "AirstrikeLaunch", 100, 0, true);
NewName = "Airstrike" + C_LE_D3;
_root.container_mc.levelEffects_mc.attachMovie("AirstrikeAnimation", NewName, C_LE_D3);
_root.container_mc.levelEffects_mc[NewName]._x = _root.container_mc.levelEffects_mc._xmouse;
_root.container_mc.levelEffects_mc[NewName]._y = _root.container_mc.levelEffects_mc._ymouse;
C_LE_D3++;
if (C_LE_D3 > C_LE_D3max) {
C_LE_D3 = C_LE_D3min;
}
_root.User_AirstrikeLaunch = "Launch";
_root.User_AirstrikeActivated = true;
_root.User_AirstrikeX = _root.container_mc.levelEffects_mc._xmouse;
_root.User_AirstrikeY = _root.container_mc.levelEffects_mc._ymouse;
_root.UserAction = "None";
opp = -675 - _root.container_mc.levelEffects_mc._ymouse;
adj = 875 - _root.container_mc.levelEffects_mc._xmouse;
rotation = (Math.atan2(opp, adj) * 57.2957795130823) + 180;
NewName = "AirstrikeAction" + C_LE_D3;
_root.container_mc.levelEffects_mc.attachMovie("AirstrikeLaunched", NewName, C_LE_D3);
_root.container_mc.levelEffects_mc[NewName]._x = 875;
_root.container_mc.levelEffects_mc[NewName]._y = -675;
_root.container_mc.levelEffects_mc[NewName]._rotation = rotation;
_root.container_mc.levelEffects_mc[NewName].Zone = "None";
_root.container_mc.levelEffects_mc[NewName].FireMissiles = false;
_root.container_mc.levelEffects_mc[NewName].TargetX = _root.container_mc.levelEffects_mc._xmouse;
_root.container_mc.levelEffects_mc[NewName].TargetY = _root.container_mc.levelEffects_mc._ymouse;
_root.container_mc.levelEffects_mc[NewName].onEnterFrame = function () {
if (_root.PauseGame == false) {
adj = this.TargetX - this._x;
opp = this.TargetY - this._y;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((this.Zone == "None") && (hyp < 400)) {
this.FireMissiles = true;
this.Zone = "First";
}
if ((this.Zone == "First") && (hyp < 320)) {
this.FireMissiles = true;
this.Zone = "Second";
}
if ((this.Zone == "Second") && (hyp < 240)) {
this.FireMissiles = true;
this.Zone = "Third";
}
if ((this.Zone == "Third") && (hyp < 160)) {
this.FireMissiles = true;
this.Zone = "Fourth";
}
if ((this.Zone == "Fourth") && (hyp > 0)) {
this.Zone = "Damage";
_root.User_AirstrikeLaunch = "Damage";
}
if (this.FireMissiles == true) {
this.FireMissiles = false;
i = 1;
while (i <= 3) {
myPoint = {x:0, y:7.5};
this["raptor" + i].localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("RPG", this._rotation + ((Math.random() * 6) - 3), myPoint2.x, myPoint2.y, this.TargetX, this.TargetY, 0, random(100) - 49);
i++;
}
i = 1;
while (i <= 3) {
myPoint = {x:0, y:-7.5};
this["raptor" + i].localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("RPG", this._rotation + ((Math.random() * 6) - 3), myPoint2.x, myPoint2.y, this.TargetX, this.TargetY, 0, random(100) - 49);
i++;
}
}
this.myPoint = {x:7.5, y:0};
this.localToGlobal(this.myPoint);
this.myPoint2 = {x:this.myPoint.x, y:this.myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(this.myPoint2);
this._x = this.myPoint2.x;
this._y = this.myPoint2.y;
if (this._x > 900) {
_root.User_AirstrikeLaunch = "None";
this.removeMovieClip();
}
if (this._x < -900) {
_root.User_AirstrikeLaunch = "None";
this.removeMovieClip();
}
if (this._y > 700) {
_root.User_AirstrikeLaunch = "None";
this.removeMovieClip();
}
if (this._y < -700) {
_root.User_AirstrikeLaunch = "None";
this.removeMovieClip();
}
}
};
C_LE_D3++;
if (C_LE_D3 > C_LE_D3max) {
C_LE_D3 = C_LE_D3min;
}
}
if (_root.UserAction == "Missile") {
_root.sounds_mc.CreateSound("Power_", "MissileLaunch", 100, 0, true);
NewName = "Missile" + C_LE_D3;
_root.container_mc.levelEffects_mc.attachMovie("MissileAnimation", NewName, C_LE_D3);
_root.container_mc.levelEffects_mc[NewName]._x = _root.container_mc.levelEffects_mc._xmouse;
_root.container_mc.levelEffects_mc[NewName]._y = _root.container_mc.levelEffects_mc._ymouse;
C_LE_D3++;
if (C_LE_D3 > C_LE_D3max) {
C_LE_D3 = C_LE_D3min;
}
_root.User_MissileLaunch = "Launch";
_root.User_MissileLaunchActivated = true;
_root.User_MissileX = _root.container_mc.levelEffects_mc._xmouse;
_root.User_MissileY = _root.container_mc.levelEffects_mc._ymouse;
_root.UserAction = "None";
}
};
mouseListener.onMouseUp = function () {
if ((_root.UserAction == "None") or (_root.UserAction == "Command")) {
CommandClickSelect = true;
UnitSelect = false;
if (!Key.isDown(16)) {
i = 0;
while (i < UserUnits_array.length) {
if (_root.container_mc.level_mc[UserUnits_array[i]].hitTest(_root._xmouse, _root._ymouse, true) && (_root.container_mc.level_mc[UserUnits_array[i]].Selected == false)) {
UnitSelect = true;
}
i++;
}
if (UnitSelect == true) {
EndUnitSelections();
}
}
UnitSelect = AddUnitSelections();
}
if ((_root.UserAction == "Command") && (UnitSelect == false)) {
_root.CommandPosition_mc.command_mc.gotoAndPlay(2);
}
if (CommandClickSelect == true) {
CommandClickSelect = false;
if (_root.UserAction == "Command") {
BuildingTest = false;
i = 0;
while (i < UserBuildings_array.length) {
if (_root.container_mc.level_mc[UserBuildings_array[i]].foundation_mc.unit_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
BuildingTest = true;
}
i++;
}
if (BuildingTest == false) {
if ((((UnitSelect == false) && (DragCommandActive == false)) && (_root._xmouse < 550)) && (_root._ymouse < 400)) {
ReassembleArrays();
Selected = UnitSelect_array.length;
UnitSpacing = _root.UserUnitSpacing;
NewName = "GoToLocation" + C_LE_D;
_root.container_mc.levelEffects_mc.attachMovie("GoToLocation", NewName, C_LE_D);
_root.container_mc.levelEffects_mc[NewName]._x = _root.container_mc.levelEffects_mc._xmouse;
_root.container_mc.levelEffects_mc[NewName]._y = _root.container_mc.levelEffects_mc._ymouse;
if (_root.CommandPositionAttack == true) {
_root.container_mc.levelEffects_mc[NewName].t_mc.gotoAndStop(2);
_root.container_mc.levelEffects_mc[NewName].l_mc.gotoAndStop(2);
_root.container_mc.levelEffects_mc[NewName].r_mc.gotoAndStop(2);
_root.container_mc.levelEffects_mc[NewName].b_mc.gotoAndStop(2);
}
C_LE_D++;
if (C_LE_D > C_LE_Dmax) {
C_LE_D = C_LE_Dmin;
}
if (_root.User_Formation == "Square") {
if (Selected > 49) {
RowLength = 8;
} else if (Selected > 36) {
RowLength = 7;
} else if (Selected > 25) {
RowLength = 6;
} else if (Selected > 16) {
RowLength = 5;
} else if (Selected > 9) {
RowLength = 4;
} else if (Selected > 4) {
RowLength = 3;
} else {
RowLength = 2;
}
} else if (Selected > 48) {
RowLength = 9;
} else if (Selected > 35) {
RowLength = 8;
} else if (Selected > 24) {
RowLength = 7;
} else if (Selected > 15) {
RowLength = 6;
} else if (Selected > 8) {
RowLength = 5;
} else {
RowLength = 4;
}
TotalRows = Math.ceil(Selected / RowLength);
i = 0;
while (i < Selected) {
CurrentRow = 1;
ii = i + 1;
while (ii > RowLength) {
ii = ii - RowLength;
CurrentRow++;
}
CurrentRowUnits = RowLength;
if (CurrentRow == TotalRows) {
CurrentRowUnits = Selected % RowLength;
if (CurrentRowUnits == 0) {
CurrentRowUnits = RowLength;
}
}
ExtraX = (((CurrentRowUnits / 2) - ii) * UnitSpacing) + (UnitSpacing / 2);
ExtraY = (((TotalRows / 2) - CurrentRow) * UnitSpacing) + (UnitSpacing / 2);
GoToX = _root.container_mc.level_mc._xmouse + ExtraX;
GoToY = _root.container_mc.level_mc._ymouse + ExtraY;
_root.container_mc.level_mc[UnitSelect_array[i]].GoToX = GoToX;
_root.container_mc.level_mc[UnitSelect_array[i]].GoToY = GoToY;
_root.container_mc.level_mc[UnitSelect_array[i]].Detour = false;
_root.container_mc.level_mc[UnitSelect_array[i]].AttackSet = false;
if (_root.CommandPositionAttack == true) {
_root.container_mc.level_mc[UnitSelect_array[i]].AttackSet = true;
_root.container_mc.level_mc[UnitSelect_array[i]].AttackType = _root.CommandPositionType;
_root.container_mc.level_mc[UnitSelect_array[i]].AttackTarget = _root.CommandPositionTarget;
}
i++;
}
}
}
}
}
if (DragCommandClicked == true) {
DragCommandClicked = false;
if (((!Key.isDown(16)) && (DragCommandActive == true)) && (_root.UserAction == "Command")) {
_root.UserAction = "None";
EndUnitSelections();
}
i = 0;
while (i < UserUnits_array.length) {
myUserPoint = {x:_root.container_mc.level_mc[UserUnits_array[i]]._x, y:_root.container_mc.level_mc[UserUnits_array[i]]._y};
_root.container_mc.level_mc.localToGlobal(myUserPoint);
if (_root.container_mc.levelEffects_mc.DragBox_mc.hitTest(myUserPoint.x, myUserPoint.y, true) && (_root.container_mc.level_mc[UserUnits_array[i]].Selected == false)) {
UnitSelect_array[UnitSelect_array.length + 1] = _root.container_mc.level_mc[UserUnits_array[i]].MyName;
_root.container_mc.level_mc[UserUnits_array[i]].Selected = true;
_root.container_mc.level_mc[UserUnits_array[i]].gotoAndStop("selected");
_root.UserAction = "Command";
}
i++;
}
GetStance();
_root.container_mc.levelEffects_mc.DragBox_mc.removeMovieClip();
}
};
Mouse.addListener(mouseListener);
_root.SetScroller = setInterval(Scroller, 25);
_root.SetDrag = setInterval(DragBox, 25);
_root.Comp_LOS = 400;
_root.Comp_Pop = 0;
_root.Comp_PopCap = 60;
_root.Comp_Food = 500;
_root.Comp_Gold = 225;
_root.Comp_Stone = 375;
_root.Comp_Wood = 325;
if (_root.Comp_Difficulty == "Brutal") {
_root.TBB_mc.headstart_txt.text = "Headstart: " + Math.round(Headstart / 2);
_root.Comp_T2_Advance = 4800;
_root.Comp_T3_Advance = 4800;
_root.Comp_AP1 = 1200;
_root.Comp_AP2 = 2400;
_root.Comp_Repair = 25;
_root.Comp_WorkerCap = 16;
_root.Comp_AirstrikeLaunch = "None";
_root.Comp_AirstrikeDamage = 1000;
_root.Comp_AirstrikeRange = 175;
_root.Comp_AirstrikeTimer = 320;
_root.Comp_AirstrikeSet = 320;
_root.Comp_AirstrikeX = 0;
_root.Comp_AirstrikeY = 0;
_root.Comp_AirstrikeActivated = false;
_root.Comp_MissileLaunch = "None";
_root.Comp_MissileDamage = 1500;
_root.Comp_MissileRange = 275;
_root.Comp_MissileLaunchTimer = 400;
_root.Comp_MissileLaunchSet = 400;
_root.Comp_MissileX = 0;
_root.Comp_MissileY = 0;
_root.Comp_MissileLaunchActivated = false;
Comp_Building_TimerSet = 14;
Comp_Building_Timer = 0;
Comp_Keep_Timer = 0;
Comp_Barracks1_TimerSet = 240;
Comp_Barracks1_Timer = Comp_Barracks1_TimerSet;
Comp_Stables_TimerSet = 480;
Comp_Stables_Timer = Comp_Stables_TimerSet;
Comp_Barracks2_TimerSet = 240;
Comp_Barracks2_Timer = Comp_Barracks2_TimerSet;
Comp_WarFactory_TimerSet = 480;
Comp_WarFactory_Timer = Comp_WarFactory_TimerSet;
Comp_Armoury_TimerSet = 400;
Comp_Armoury_Timer = Comp_Armoury_TimerSet;
Comp_Armoury_Set = 1;
Comp_ResearchLab_TimerSet = 400;
Comp_ResearchLab_Timer = Comp_ResearchLab_TimerSet;
Comp_ResearchLab_Set = 1;
Comp_TechCenter_TimerSet = 500;
Comp_TechCenter_Timer = Comp_TechCenter_TimerSet;
Comp_TechCenter_Set = 1;
} else if (_root.Comp_Difficulty == "Hard") {
_root.TBB_mc.headstart_txt.text = "Headstart: " + Math.round(Headstart / 2);
_root.Comp_T2_Advance = 6000;
_root.Comp_T3_Advance = 6000;
_root.Comp_AP1 = 1800;
_root.Comp_AP2 = 3600;
_root.Comp_Repair = 20;
_root.Comp_WorkerCap = 14;
_root.Comp_AirstrikeLaunch = "None";
_root.Comp_AirstrikeDamage = 900;
_root.Comp_AirstrikeRange = 175;
_root.Comp_AirstrikeTimer = 320;
_root.Comp_AirstrikeSet = 320;
_root.Comp_AirstrikeX = 0;
_root.Comp_AirstrikeY = 0;
_root.Comp_AirstrikeActivated = false;
_root.Comp_MissileLaunch = "None";
_root.Comp_MissileDamage = 1400;
_root.Comp_MissileRange = 275;
_root.Comp_MissileLaunchTimer = 400;
_root.Comp_MissileLaunchSet = 400;
_root.Comp_MissileX = 0;
_root.Comp_MissileY = 0;
_root.Comp_MissileLaunchActivated = false;
Comp_Building_TimerSet = 18;
Comp_Building_Timer = 0;
Comp_Keep_Timer = 0;
Comp_Barracks1_TimerSet = 280;
Comp_Barracks1_Timer = Comp_Barracks1_TimerSet;
Comp_Stables_TimerSet = 520;
Comp_Stables_Timer = Comp_Stables_TimerSet;
Comp_Barracks2_TimerSet = 280;
Comp_Barracks2_Timer = Comp_Barracks2_TimerSet;
Comp_WarFactory_TimerSet = 520;
Comp_WarFactory_Timer = Comp_WarFactory_TimerSet;
Comp_Armoury_TimerSet = 500;
Comp_Armoury_Timer = Comp_Armoury_TimerSet;
Comp_Armoury_Set = 1;
Comp_ResearchLab_TimerSet = 500;
Comp_ResearchLab_Timer = Comp_ResearchLab_TimerSet;
Comp_ResearchLab_Set = 1;
Comp_TechCenter_TimerSet = 600;
Comp_TechCenter_Timer = Comp_TechCenter_TimerSet;
Comp_TechCenter_Set = 1;
} else if (_root.Comp_Difficulty == "Normal") {
_root.TBB_mc.headstart_txt.text = "";
_root.Comp_T2_Advance = 9600;
_root.Comp_T3_Advance = 7200;
_root.Comp_AP1 = 2400;
_root.Comp_AP2 = 4800;
_root.Comp_Repair = 15;
_root.Comp_WorkerCap = 10;
_root.Comp_AirstrikeLaunch = "None";
_root.Comp_AirstrikeDamage = 750;
_root.Comp_AirstrikeRange = 175;
_root.Comp_AirstrikeTimer = 320;
_root.Comp_AirstrikeSet = 320;
_root.Comp_AirstrikeX = 0;
_root.Comp_AirstrikeY = 0;
_root.Comp_AirstrikeActivated = false;
_root.Comp_MissileLaunch = "None";
_root.Comp_MissileDamage = 1250;
_root.Comp_MissileRange = 275;
_root.Comp_MissileLaunchTimer = 400;
_root.Comp_MissileLaunchSet = 400;
_root.Comp_MissileX = 0;
_root.Comp_MissileY = 0;
_root.Comp_MissileLaunchActivated = false;
Comp_Building_TimerSet = 22;
Comp_Building_Timer = 2;
Comp_Keep_Timer = 0;
Comp_Barracks1_TimerSet = 320;
Comp_Barracks1_Timer = Comp_Barracks1_TimerSet;
Comp_Stables_TimerSet = 600;
Comp_Stables_Timer = Comp_Stables_TimerSet;
Comp_Barracks2_TimerSet = 320;
Comp_Barracks2_Timer = Comp_Barracks2_TimerSet;
Comp_WarFactory_TimerSet = 600;
Comp_WarFactory_Timer = Comp_WarFactory_TimerSet;
Comp_Armoury_TimerSet = 600;
Comp_Armoury_Timer = Comp_Armoury_TimerSet;
Comp_Armoury_Set = 1;
Comp_ResearchLab_TimerSet = 600;
Comp_ResearchLab_Timer = Comp_ResearchLab_TimerSet;
Comp_ResearchLab_Set = 1;
Comp_TechCenter_TimerSet = 800;
Comp_TechCenter_Timer = Comp_TechCenter_TimerSet;
Comp_TechCenter_Set = 1;
} else {
_root.TBB_mc.headstart_txt.text = "";
_root.Comp_T2_Advance = 9600;
_root.Comp_T3_Advance = 7200;
_root.Comp_AP1 = 2400;
_root.Comp_AP2 = 4800;
_root.Comp_Repair = 10;
_root.Comp_WorkerCap = 6;
_root.Comp_AirstrikeLaunch = "None";
_root.Comp_AirstrikeDamage = 750;
_root.Comp_AirstrikeRange = 175;
_root.Comp_AirstrikeTimer = 320;
_root.Comp_AirstrikeSet = 320;
_root.Comp_AirstrikeX = 0;
_root.Comp_AirstrikeY = 0;
_root.Comp_AirstrikeActivated = false;
_root.Comp_MissileLaunch = "None";
_root.Comp_MissileDamage = 1250;
_root.Comp_MissileRange = 275;
_root.Comp_MissileLaunchTimer = 400;
_root.Comp_MissileLaunchSet = 400;
_root.Comp_MissileX = 0;
_root.Comp_MissileY = 0;
_root.Comp_MissileLaunchActivated = false;
Comp_Building_TimerSet = 28;
Comp_Building_Timer = 10;
Comp_Keep_Timer = 0;
Comp_Barracks1_TimerSet = 400;
Comp_Barracks1_Timer = Comp_Barracks1_TimerSet;
Comp_Stables_TimerSet = 640;
Comp_Stables_Timer = Comp_Stables_TimerSet;
Comp_Barracks2_TimerSet = 400;
Comp_Barracks2_Timer = Comp_Barracks2_TimerSet;
Comp_WarFactory_TimerSet = 640;
Comp_WarFactory_Timer = Comp_WarFactory_TimerSet;
Comp_Armoury_TimerSet = 800;
Comp_Armoury_Timer = Comp_Armoury_TimerSet;
Comp_Armoury_Set = 1;
Comp_ResearchLab_TimerSet = 800;
Comp_ResearchLab_Timer = Comp_ResearchLab_TimerSet;
Comp_ResearchLab_Set = 1;
Comp_TechCenter_TimerSet = 1000;
Comp_TechCenter_Timer = Comp_TechCenter_TimerSet;
Comp_TechCenter_Set = 1;
}
function ComputerAI() {
if (_root.PauseGame == false) {
if (_root.CompUnits_array.length >= 8) {
_root.Comp_LOS = 4000;
} else if (_root.CompUnits_array.length > (_root.UserUnits_array.length + 4)) {
_root.Comp_LOS = 4000;
} else {
_root.Comp_LOS = 400;
}
if (_root.CompUnits_array.length < (_root.UserUnits_array.length - 5)) {
if ((_root.Comp_Food * 5) < _root.User_Food) {
_root.Comp_Food = _root.Comp_Food + 100;
}
if ((_root.Comp_Gold * 5) < _root.User_Gold) {
_root.Comp_Food = _root.Comp_Food + 100;
}
if ((_root.Comp_Stone * 5) < _root.User_Stone) {
_root.Comp_Stone = _root.Comp_Stone + 100;
}
if ((_root.Comp_Wood * 5) < _root.User_Wood) {
_root.Comp_Wood = _root.Comp_Wood + 100;
}
if ((_root.Comp_Food * 10) < _root.User_Food) {
_root.Comp_Food = _root.Comp_Food + 500;
}
if ((_root.Comp_Gold * 10) < _root.User_Gold) {
_root.Comp_Food = _root.Comp_Food + 500;
}
if ((_root.Comp_Stone * 10) < _root.User_Stone) {
_root.Comp_Stone = _root.Comp_Stone + 500;
}
if ((_root.Comp_Wood * 10) < _root.User_Wood) {
_root.Comp_Wood = _root.Comp_Wood + 500;
}
if ((_root.Comp_Food * 20) < _root.User_Food) {
_root.Comp_Food = _root.Comp_Food + 1000;
}
if ((_root.Comp_Gold * 20) < _root.User_Gold) {
_root.Comp_Food = _root.Comp_Food + 1000;
}
if ((_root.Comp_Stone * 20) < _root.User_Stone) {
_root.Comp_Stone = _root.Comp_Stone + 1000;
}
if ((_root.Comp_Wood * 20) < _root.User_Wood) {
_root.Comp_Wood = _root.Comp_Wood + 1000;
}
}
if ((_root.Comp_Food < 1000) && (_root.Comp_Gold > 1500)) {
_root.Comp_Food = _root.Comp_Food + 150;
_root.Comp_Gold = _root.Comp_Gold - 100;
}
if ((_root.Comp_Stone < 1000) && (_root.Comp_Gold > 1500)) {
_root.Comp_Stone = _root.Comp_Stone + 100;
_root.Comp_Gold = _root.Comp_Gold - 100;
}
if ((_root.Comp_Wood < 1000) && (_root.Comp_Gold > 1500)) {
_root.Comp_Wood = _root.Comp_Wood + 200;
_root.Comp_Gold = _root.Comp_Gold - 100;
}
if ((_root.Comp_Gold < 1500) && (_root.Comp_Food > 1000)) {
_root.Comp_Gold = _root.Comp_Gold + 100;
_root.Comp_Food = _root.Comp_Food - 150;
}
if ((_root.Comp_Gold < 1500) && (_root.Comp_Stone > 1000)) {
_root.Comp_Gold = _root.Comp_Gold + 100;
_root.Comp_Stone = _root.Comp_Stone - 100;
}
if ((_root.Comp_Gold < 1500) && (_root.Comp_Wood > 1000)) {
_root.Comp_Gold = _root.Comp_Gold + 100;
_root.Comp_Wood = _root.Comp_Wood - 200;
}
if ((_root.User_Teir >= 2) && (_root.Comp_Teir == 1)) {
_root.Comp_Keep_Timer = _root.Comp_Keep_Timer + 200;
}
if ((_root.User_Teir >= 3) && (_root.Comp_Teir == 2)) {
_root.Comp_Keep_Timer = _root.Comp_Keep_Timer + 200;
}
if (_root.Comp_Food < 0) {
_root.Comp_Food = 0;
}
if (_root.Comp_Gold < 0) {
_root.Comp_Gold = 0;
}
if (_root.Comp_Stone < 0) {
_root.Comp_Stone = 0;
}
if (_root.Comp_Wood < 0) {
_root.Comp_Wood = 0;
}
if (Buildings2_array.TC_Keep != 0) {
if (Comp_Building_Timer > 0) {
Comp_Building_Timer--;
} else {
CurrentPriorityRate = Infinity;
if ((CurrentPriorityRate > 0) && (Buildings2_array.Teir1_Farm == 0)) {
if (_root.Comp_Teir == 1) {
if (_root.Comp_Food > 750) {
if ((Buildings2_array.Teir1_Barracks != 0) || (Buildings2_array.Teir1_Stables != 0)) {
CurrentPriorityRate = 0;
}
} else {
CurrentPriorityRate = 0;
}
} else if (_root.Comp_Food > 750) {
if ((Buildings2_array.Teir2_Barracks != 0) || (Buildings2_array.Teir2_WarFactory != 0)) {
CurrentPriorityRate = 0;
}
} else {
CurrentPriorityRate = 0;
}
}
if ((CurrentPriorityRate > 2) && (Buildings2_array.Teir1_LumberMill == 0)) {
if (_root.Comp_Teir == 1) {
if (_root.Comp_Food > 750) {
if ((Buildings2_array.Teir1_Barracks != 0) || (Buildings2_array.Teir1_Stables != 0)) {
CurrentPriorityRate = 2;
}
} else {
CurrentPriorityRate = 2;
}
} else if (_root.Comp_Food > 750) {
if ((Buildings2_array.Teir2_Barracks != 0) || (Buildings2_array.Teir2_WarFactory != 0)) {
CurrentPriorityRate = 2;
}
} else {
CurrentPriorityRate = 2;
}
}
if ((CurrentPriorityRate > 1) && (Buildings2_array.Teir1_Mine == 0)) {
if (_root.Comp_Teir == 1) {
if (_root.Comp_Food > 750) {
if ((Buildings2_array.Teir1_Barracks != 0) || (Buildings2_array.Teir1_Stables != 0)) {
CurrentPriorityRate = 1;
}
} else {
CurrentPriorityRate = 1;
}
} else if (_root.Comp_Food > 750) {
if ((Buildings2_array.Teir2_Barracks != 0) || (Buildings2_array.Teir2_WarFactory != 0)) {
CurrentPriorityRate = 1;
}
} else {
CurrentPriorityRate = 1;
}
}
if (_root.Comp_Teir == 1) {
if ((CurrentPriorityRate > 5) && (Buildings2_array.Teir1_Armoury == 0)) {
if ((((_root.Comp_Food >= _root.Costs_array.Building_01_Food) && (_root.Comp_Gold >= _root.Costs_array.Building_01_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Building_01_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Building_01_Wood)) {
CurrentPriorityRate = 5;
}
}
if ((CurrentPriorityRate > 3) && (Buildings2_array.Teir1_Barracks == 0)) {
if ((((_root.Comp_Food >= _root.Costs_array.Building_02_Food) && (_root.Comp_Gold >= _root.Costs_array.Building_02_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Building_02_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Building_02_Wood)) {
CurrentPriorityRate = 3;
}
}
if ((CurrentPriorityRate > 4) && (Buildings2_array.Teir1_Stables == 0)) {
if ((((_root.Comp_Food >= _root.Costs_array.Building_06_Food) && (_root.Comp_Gold >= _root.Costs_array.Building_06_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Building_06_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Building_06_Wood)) {
CurrentPriorityRate = 4;
}
}
} else {
if (((CurrentPriorityRate > 6) && (Buildings2_array.Teir2_Barracks == 0)) && (_root.Comp_Teir >= 2)) {
if ((((_root.Comp_Food >= _root.Costs_array.Building_07_Food) && (_root.Comp_Gold >= _root.Costs_array.Building_07_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Building_07_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Building_07_Wood)) {
CurrentPriorityRate = 6;
}
}
if (((CurrentPriorityRate > 8) && (Buildings2_array.Teir2_ResearchLab == 0)) && (_root.Comp_Teir >= 2)) {
if ((((_root.Comp_Food >= _root.Costs_array.Building_08_Food) && (_root.Comp_Gold >= _root.Costs_array.Building_08_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Building_08_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Building_08_Wood)) {
CurrentPriorityRate = 8;
}
}
if (((CurrentPriorityRate > 7) && (Buildings2_array.Teir2_WarFactory == 0)) && (_root.Comp_Teir >= 2)) {
if ((((_root.Comp_Food >= _root.Costs_array.Building_09_Food) && (_root.Comp_Gold >= _root.Costs_array.Building_09_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Building_09_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Building_09_Wood)) {
CurrentPriorityRate = 7;
}
}
if (((CurrentPriorityRate > 10) && (Buildings2_array.Teir3_CommandPost == 0)) && (_root.Comp_Teir == 3)) {
if ((((_root.Comp_Food >= _root.Costs_array.Building_10_Food) && (_root.Comp_Gold >= _root.Costs_array.Building_10_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Building_10_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Building_10_Wood)) {
CurrentPriorityRate = 10;
}
}
if (((CurrentPriorityRate > 9) && (Buildings2_array.Teir3_TechCenter == 0)) && (_root.Comp_Teir == 3)) {
if ((((_root.Comp_Food >= _root.Costs_array.Building_11_Food) && (_root.Comp_Gold >= _root.Costs_array.Building_11_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Building_11_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Building_11_Wood)) {
CurrentPriorityRate = 9;
}
}
}
if (CurrentPriorityRate != Infinity) {
Comp_Building_Timer = Comp_Building_TimerSet;
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Misc_Foundation_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Misc_Foundation_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Misc_Foundation_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Misc_Foundation_Wood;
if (CurrentPriorityRate == 0) {
PlaceBuilding("Teir1_Farm", "Teir 1 Farm", -600, 300, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_03_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_03_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_03_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_03_Wood;
}
if (CurrentPriorityRate == 1) {
PlaceBuilding("Teir1_Mine", "Teir 1 Mine", -350, 450, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_05_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_05_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_05_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_05_Wood;
}
if (CurrentPriorityRate == 2) {
PlaceBuilding("Teir1_LumberMill", "Teir 1 LumberMill", -350, 300, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_04_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_04_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_04_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_04_Wood;
}
if (CurrentPriorityRate == 3) {
PlaceBuilding("Teir1_Barracks", "Teir 1 Barracks", 150, 450, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_02_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_02_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_02_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_02_Wood;
}
if (CurrentPriorityRate == 4) {
PlaceBuilding("Teir1_Stables", "Teir 1 Stables", -600, 0, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_06_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_06_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_06_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_06_Wood;
}
if (CurrentPriorityRate == 5) {
PlaceBuilding("Teir1_Armoury", "Teir 1 Armoury", -600, 150, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_01_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_01_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_01_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_01_Wood;
}
if (CurrentPriorityRate == 6) {
PlaceBuilding("Teir2_Barracks", "Teir 2 Barracks", -600, -150, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_07_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_07_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_07_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_07_Wood;
}
if (CurrentPriorityRate == 7) {
PlaceBuilding("Teir2_WarFactory", "Teir 2 WarFactory", -100, 150, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_09_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_09_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_09_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_09_Wood;
}
if (CurrentPriorityRate == 8) {
PlaceBuilding("Teir2_ResearchLab", "Teir 2 ResearchLab", -350, 150, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_08_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_08_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_08_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_08_Wood;
}
if (CurrentPriorityRate == 9) {
PlaceBuilding("Teir3_TechCenter", "Teir 3 TechCenter", -100, 450, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_11_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_11_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_11_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_11_Wood;
}
if (CurrentPriorityRate == 10) {
PlaceBuilding("Teir3_CommandPost", "Teir 3 CommandPost", -100, 300, 2, false);
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Building_10_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Building_10_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Building_10_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Building_10_Wood;
}
} else {
Comp_Building_Timer = 4;
}
}
}
}
}
function CompBuyUpgrade(Building, Type) {
if (((((_level[("Comp_" + Building) + "Timer"] <= 0) && (_root.Comp_Food >= _root.Costs_array[(Building + Type) + "_Food"])) && (_root.Comp_Gold >= _root.Costs_array[(Building + Type) + "_Gold"])) && (_root.Comp_Stone >= _root.Costs_array[(Building + Type) + "_Stone"])) && (_root.Comp_Wood >= _root.Costs_array[(Building + Type) + "_Wood"])) {
_root.Comp_Food = _root.Comp_Food - _root.Costs_array[(Building + Type) + "_Food"];
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array[(Building + Type) + "_Gold"];
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array[(Building + Type) + "_Stone"];
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array[(Building + Type) + "_Wood"];
if (Building == "Armoury_") {
_root.Comp_Armoury_Timer = _root.Comp_Armoury_TimerSet;
_root.Comp_Armoury_Set++;
}
if (Building == "ResearchLab_") {
_root.Comp_ResearchLab_Timer = _root.Comp_ResearchLab_TimerSet;
_root.Comp_ResearchLab_Set++;
}
if (Building == "TechCenter_") {
_root.Comp_TechCenter_Timer = _root.Comp_TechCenter_TimerSet;
_root.Comp_TechCenter_Set++;
}
return(true);
}
return(false);
}
CompBuildPriority = new Array();
CompBuildPriority[0] = "Teir1_Farm";
CompBuildPriority[1] = "Teir1_Mine";
CompBuildPriority[2] = "Teir1_LumberMill";
CompBuildPriority[3] = "Teir1_Barracks";
CompBuildPriority[4] = "Teir1_Stables";
CompBuildPriority[5] = "Teir1_Armoury";
CompBuildPriority[6] = "Teir2_Barracks";
CompBuildPriority[7] = "Teir2_WarFactory";
CompBuildPriority[8] = "Teir2_ResearchLab";
CompBuildPriority[9] = "Teir3_TechCenter";
CompBuildPriority[10] = "Teir3_CommandPost";
_root.CompAI = setInterval(ComputerAI, 500);
function Comp_AI_Building(PlaceType, PlaceName) {
if (PlaceType == "TC_Keep") {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if (Headstart == 0) {
_root.Comp_Keep_Timer++;
}
if ((_root.Comp_Keep_Timer == (_root.Comp_T2_Advance / 2)) && (_root.Comp_Teir == 1)) {
_root.Comp_WorkerCap++;
}
if (((_root.Comp_Keep_Timer >= _root.Comp_T2_Advance) && (_root.Comp_Teir == 1)) && (Buildings2_array.Teir1_Armoury >= 1)) {
this.affordable = false;
if ((((_root.Comp_Food >= _root.Costs_array.Misc_T2_Food) && (_root.Comp_Gold >= _root.Costs_array.Misc_T2_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Misc_T2_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Misc_T2_Wood)) {
this.affordable = true;
}
if ((_root.Comp_Keep_Timer >= (_root.Comp_T2_Advance + _root.Comp_AP1)) && (_root.User_Teir >= 2)) {
this.affordable = true;
}
if (_root.Comp_Keep_Timer >= (_root.Comp_T2_Advance + _root.Comp_AP2)) {
this.affordable = true;
}
if ((_root.Comp_Difficulty == "Hard") or "Brutal") {
this.affordable = true;
}
if (this.affordable == true) {
_root.Comp_WorkerCap++;
_root.Comp_Keep_Timer = 0;
_root.Comp_Teir = 2;
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Misc_T2_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Misc_T2_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Misc_T2_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Misc_T2_Wood;
}
}
if (((_root.Comp_Keep_Timer == (_root.Comp_T3_Advance / 2)) && (_root.Comp_Teir == 2)) && (Buildings2_array.Teir2_ResearchLab >= 1)) {
_root.Comp_WorkerCap++;
}
if ((_root.Comp_Keep_Timer >= _root.Comp_T3_Advance) && (_root.Comp_Teir == 2)) {
this.affordable = false;
if ((((_root.Comp_Food >= _root.Costs_array.Misc_T3_Food) && (_root.Comp_Gold >= _root.Costs_array.Misc_T3_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Misc_T3_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Misc_T3_Wood)) {
this.affordable = true;
}
if ((_root.Comp_Keep_Timer >= (_root.Comp_T3_Advance + _root.Comp_AP1)) && (_root.User_Teir >= 3)) {
this.affordable = true;
}
if ((_root.Comp_Difficulty == "Hard") or "Brutal") {
this.affordable = true;
}
if (this.affordable == true) {
_root.Comp_WorkerCap++;
_root.Comp_Keep_Timer = 0;
_root.Comp_Teir = 3;
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Misc_T3_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Misc_T3_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Misc_T3_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Misc_T3_Wood;
}
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir1_Armoury") {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if (_root.Comp_Teir == 1) {
if (_root.Comp_Armoury_Timer <= 0) {
if (_root.Comp_Armoury_Set == 1) {
if (_root.CompBuyUpgrade("Armoury_", "A1")) {
_root.Armoury_A_2 = 1;
_root.Unit2_Swordsman.damage = _root.Units_Default_array.Swordsman_Damage * 1.25;
_root.Unit2_Spearman.damage = _root.Units_Default_array.Spearman_Damage * 1.25;
_root.Unit2_MountedSwordsman.damage = _root.Units_Default_array.MountedSwordsman_Damage * 1.25;
}
}
if (_root.Comp_Armoury_Set == 5) {
if (_root.CompBuyUpgrade("Armoury_", "A2")) {
_root.Armoury_A_2 = 2;
_root.Unit2_Swordsman.damage = _root.Units_Default_array.Swordsman_Damage * 1.5;
_root.Unit2_Spearman.damage = _root.Units_Default_array.Spearman_Damage * 1.5;
_root.Unit2_MountedSwordsman.damage = _root.Units_Default_array.MountedSwordsman_Damage * 1.5;
}
}
if (_root.Comp_Armoury_Set == 9) {
if (_root.CompBuyUpgrade("Armoury_", "A3")) {
_root.Armoury_A_2 = 3;
_root.Unit2_Swordsman.damage = _root.Units_Default_array.Swordsman_Damage * 1.75;
_root.Unit2_Spearman.damage = _root.Units_Default_array.Spearman_Damage * 1.75;
_root.Unit2_MountedSwordsman.damage = _root.Units_Default_array.MountedSwordsman_Damage * 1.75;
}
}
if (_root.Comp_Armoury_Set == 2) {
if (_root.CompBuyUpgrade("Armoury_", "B1")) {
_root.Armoury_B_2 = 1;
_root.Unit2_Archer.damage = _root.Units_Default_array.Archer_Damage * 1.25;
_root.Unit2_MountedArcher.damage = _root.Units_Default_array.MountedArcher_Damage * 1.25;
}
}
if (_root.Comp_Armoury_Set == 6) {
if (_root.CompBuyUpgrade("Armoury_", "B2")) {
_root.Armoury_B_2 = 2;
_root.Unit2_Archer.damage = _root.Units_Default_array.Archer_Damage * 1.5;
_root.Unit2_MountedArcher.damage = _root.Units_Default_array.MountedArcher_Damage * 1.5;
}
}
if (_root.Comp_Armoury_Set == 10) {
if (_root.CompBuyUpgrade("Armoury_", "B3")) {
_root.Armoury_B_2 = 3;
_root.Unit2_Archer.damage = _root.Units_Default_array.Archer_Damage * 1.75;
_root.Unit2_MountedArcher.damage = _root.Units_Default_array.MountedArcher_Damage * 1.75;
}
}
if (_root.Comp_Armoury_Set == 3) {
if (_root.CompBuyUpgrade("Armoury_", "C1")) {
_root.Armoury_C_2 = 1;
_root.Unit2_Swordsman.health = _root.Units_Default_array.Swordsman_Health * 1.2;
_root.Unit2_Spearman.health = _root.Units_Default_array.Spearman_Health * 1.2;
_root.Unit2_Archer.health = _root.Units_Default_array.Archer_Health * 1.2;
_root.Unit2_MountedSwordsman.health = _root.Units_Default_array.MountedSwordsman_Health * 1.2;
_root.Unit2_MountedArcher.health = _root.Units_Default_array.MountedArcher_Health * 1.2;
}
}
if (_root.Comp_Armoury_Set == 7) {
if (_root.CompBuyUpgrade("Armoury_", "C2")) {
_root.Armoury_C_2 = 2;
_root.Unit2_Swordsman.health = _root.Units_Default_array.Swordsman_Health * 1.4;
_root.Unit2_Spearman.health = _root.Units_Default_array.Spearman_Health * 1.4;
_root.Unit2_Archer.health = _root.Units_Default_array.Archer_Health * 1.4;
_root.Unit2_MountedSwordsman.health = _root.Units_Default_array.MountedSwordsman_Health * 1.4;
_root.Unit2_MountedArcher.health = _root.Units_Default_array.MountedArcher_Health * 1.4;
}
}
if (_root.Comp_Armoury_Set == 11) {
if (_root.CompBuyUpgrade("Armoury_", "C3")) {
_root.Armoury_C_2 = 3;
_root.Unit2_Swordsman.health = _root.Units_Default_array.Swordsman_Health * 1.8;
_root.Unit2_Spearman.health = _root.Units_Default_array.Spearman_Health * 1.8;
_root.Unit2_Archer.health = _root.Units_Default_array.Archer_Health * 1.8;
_root.Unit2_MountedSwordsman.health = _root.Units_Default_array.MountedSwordsman_Health * 1.8;
_root.Unit2_MountedArcher.health = _root.Units_Default_array.MountedArcher_Health * 1.8;
}
}
if (_root.Comp_Armoury_Set == 4) {
if (_root.CompBuyUpgrade("Armoury_", "D1")) {
Comp_Barracks1_TimerSet = Comp_Barracks1_TimerSet - 40;
Comp_Stables_TimerSet = Comp_Stables_TimerSet - 40;
_root.Armoury_D_2 = 1;
_root.Unit2_Swordsman.time = _root.Units_Default_array.Swordsman_Time * 0.9;
_root.Unit2_Spearman.time = _root.Units_Default_array.Spearman_Time * 0.9;
_root.Unit2_Archer.time = _root.Units_Default_array.Archer_Time * 0.9;
_root.Unit2_MountedSwordsman.time = _root.Units_Default_array.MountedSwordsman_Time * 0.9;
_root.Unit2_MountedArcher.time = _root.Units_Default_array.MountedArcher_Time * 0.9;
}
}
if (_root.Comp_Armoury_Set == 8) {
if (_root.CompBuyUpgrade("Armoury_", "D2")) {
Comp_Barracks1_TimerSet = Comp_Barracks1_TimerSet - 40;
Comp_Stables_TimerSet = Comp_Stables_TimerSet - 40;
_root.Armoury_D_2 = 2;
_root.Unit2_Swordsman.time = _root.Units_Default_array.Swordsman_Time * 0.6;
_root.Unit2_Spearman.time = _root.Units_Default_array.Spearman_Time * 0.6;
_root.Unit2_Archer.time = _root.Units_Default_array.Archer_Time * 0.6;
_root.Unit2_MountedSwordsman.time = _root.Units_Default_array.MountedSwordsman_Time * 0.6;
_root.Unit2_MountedArcher.time = _root.Units_Default_array.MountedArcher_Time * 0.6;
}
}
if (_root.Comp_Armoury_Set == 12) {
if (_root.CompBuyUpgrade("Armoury_", "D3")) {
Comp_Barracks1_TimerSet = Comp_Barracks1_TimerSet - 40;
Comp_Stables_TimerSet = Comp_Stables_TimerSet - 40;
_root.Armoury_D_2 = 3;
_root.Unit2_Swordsman.time = _root.Units_Default_array.Swordsman_Time * 0.3;
_root.Unit2_Spearman.time = _root.Units_Default_array.Spearman_Time * 0.3;
_root.Unit2_Archer.time = _root.Units_Default_array.Archer_Time * 0.3;
_root.Unit2_MountedSwordsman.time = _root.Units_Default_array.MountedSwordsman_Time * 0.3;
_root.Unit2_MountedArcher.time = _root.Units_Default_array.MountedArcher_Time * 0.3;
}
}
} else {
_root.Comp_Armoury_Timer--;
}
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir1_Barracks") {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if ((_root.Comp_Barracks1_Timer <= 0) && (_root.Comp_Teir == 1)) {
if (CompUnits_array.length < 20) {
RandomizeUnitType = random(3);
if (RandomizeUnitType == 0) {
UnitSpawnType = "Swordsman";
UnitSpawnID = "01";
} else if (RandomizeUnitType == 1) {
UnitSpawnType = "Spearman";
UnitSpawnID = "02";
} else {
UnitSpawnType = "Archer";
UnitSpawnID = "03";
}
if ((((_root.Comp_Food >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Food"]) && (_root.Comp_Gold >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Gold"])) && (_root.Comp_Stone >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Stone"])) && (_root.Comp_Wood >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Wood"])) {
_root.Comp_Barracks1_Timer = _root.Comp_Barracks1_TimerSet;
_root.Comp_Food = _root.Comp_Food - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Food"];
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Gold"];
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Stone"];
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Wood"];
if (_root.CheckDepths(this._x - 35, this._y + 35) == false) {
NewUnit = _root.CreateUnit(UnitSpawnType, UnitSpawnType, this._x - 35, this._y + 35, 2, false);
if (_root.container_mc.level_mc[this.MyName].PlacePosition == 1) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 35;
_root.container_mc.level_mc[this.MyName].PlacePosition = 2;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 2) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 3;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 3) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 35;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 4;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 4) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 5;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 5) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 35;
_root.container_mc.level_mc[this.MyName].PlacePosition = 1;
}
}
}
}
} else {
_root.Comp_Barracks1_Timer--;
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir1_Farm") {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if (((((this.Workers < _root.Comp_WorkerCap) && (_root.Comp_Food >= _root.Costs_array.Misc_Worker_Food)) && (_root.Comp_Gold >= _root.Costs_array.Misc_Worker_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Misc_Worker_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Misc_Worker_Wood)) {
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Misc_Worker_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Misc_Worker_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Misc_Worker_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Misc_Worker_Wood;
_root.Comp_Pop++;
this.Workers++;
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir1_LumberMill") {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if (((((this.Workers < _root.Comp_WorkerCap) && (_root.Comp_Food >= _root.Costs_array.Misc_Worker_Food)) && (_root.Comp_Gold >= _root.Costs_array.Misc_Worker_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Misc_Worker_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Misc_Worker_Wood)) {
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Misc_Worker_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Misc_Worker_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Misc_Worker_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Misc_Worker_Wood;
_root.Comp_Pop++;
this.Workers++;
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir1_Mine") {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if (((((this.Workers < _root.Comp_WorkerCap) && (_root.Comp_Food >= _root.Costs_array.Misc_Worker_Food)) && (_root.Comp_Gold >= _root.Costs_array.Misc_Worker_Gold)) && (_root.Comp_Stone >= _root.Costs_array.Misc_Worker_Stone)) && (_root.Comp_Wood >= _root.Costs_array.Misc_Worker_Wood)) {
_root.Comp_Food = _root.Comp_Food - _root.Costs_array.Misc_Worker_Food;
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array.Misc_Worker_Gold;
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array.Misc_Worker_Stone;
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array.Misc_Worker_Wood;
_root.Comp_Pop++;
this.Workers++;
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir1_Stables") {
_root.container_mc.level_mc[PlaceName].ActionTimer = 40;
_root.container_mc.level_mc[PlaceName].ActionTimerSet = 40;
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if ((_root.Comp_Stables_Timer <= 0) && (_root.Comp_Teir == 1)) {
if (CompUnits_array.length < 20) {
RandomizeUnitType = random(2);
if (RandomizeUnitType == 0) {
UnitSpawnType = "MountedSwordsman";
UnitSpawnID = "04";
} else {
UnitSpawnType = "MountedArcher";
UnitSpawnID = "05";
}
if ((((_root.Comp_Food >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Food"]) && (_root.Comp_Gold >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Gold"])) && (_root.Comp_Stone >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Stone"])) && (_root.Comp_Wood >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Wood"])) {
_root.Comp_Stables_Timer = _root.Comp_Stables_TimerSet;
_root.Comp_Food = _root.Comp_Food - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Food"];
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Gold"];
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Stone"];
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Wood"];
if (_root.CheckDepths(this._x - 35, this._y + 35) == false) {
NewUnit = _root.CreateUnit(UnitSpawnType, UnitSpawnType, this._x - 35, this._y + 35, 2, false);
if (_root.container_mc.level_mc[this.MyName].PlacePosition == 1) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 35;
_root.container_mc.level_mc[this.MyName].PlacePosition = 2;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 2) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 3;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 3) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 35;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 4;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 4) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 5;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 5) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 35;
_root.container_mc.level_mc[this.MyName].PlacePosition = 1;
}
}
}
}
} else {
_root.Comp_Stables_Timer--;
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir2_Barracks") {
_root.container_mc.level_mc[PlaceName].ActionTimer = 40;
_root.container_mc.level_mc[PlaceName].ActionTimerSet = 40;
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if (_root.Comp_Barracks2_Timer <= 0) {
if (CompUnits_array.length < 20) {
if (_root.Comp_Teir == 3) {
RandomizeUnitType = random(4);
if (RandomizeUnitType == 0) {
UnitSpawnType = "MachineGunner";
UnitSpawnID = "06";
} else if (RandomizeUnitType == 1) {
UnitSpawnType = "RPGTrooper";
UnitSpawnID = "07";
} else if (RandomizeUnitType == 2) {
UnitSpawnType = "Sniper";
UnitSpawnID = "11";
} else {
UnitSpawnType = "LaserTrooper";
UnitSpawnID = "12";
}
} else {
RandomizeUnitType = random(2);
if (RandomizeUnitType == 0) {
UnitSpawnType = "MachineGunner";
UnitSpawnID = "06";
} else {
UnitSpawnType = "RPGTrooper";
UnitSpawnID = "07";
}
}
if ((((_root.Comp_Food >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Food"]) && (_root.Comp_Gold >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Gold"])) && (_root.Comp_Stone >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Stone"])) && (_root.Comp_Wood >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Wood"])) {
_root.Comp_Barracks2_Timer = _root.Comp_Barracks2_TimerSet;
_root.Comp_Food = _root.Comp_Food - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Food"];
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Gold"];
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Stone"];
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Wood"];
if (_root.CheckDepths(this._x - 35, this._y + 35) == false) {
NewUnit = _root.CreateUnit(UnitSpawnType, UnitSpawnType, this._x - 35, this._y + 35, 2, false);
if (_root.container_mc.level_mc[this.MyName].PlacePosition == 1) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 35;
_root.container_mc.level_mc[this.MyName].PlacePosition = 2;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 2) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 3;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 3) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 35;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 4;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 4) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 5;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 5) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 35;
_root.container_mc.level_mc[this.MyName].PlacePosition = 1;
}
}
}
}
} else {
_root.Comp_Barracks2_Timer--;
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir2_ResearchLab") {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if (_root.Comp_ResearchLab_Timer <= 0) {
if (_root.Comp_ResearchLab_Set == 5) {
if (_root.CompBuyUpgrade("ResearchLab_", "A1")) {
_root.ResearchLab_A_2 = 1;
_root.Unit1_MachineGunner.health = _root.Units_Default_array.MachineGunner_Health * 1.75;
_root.Unit1_RPGTrooper.health = _root.Units_Default_array.RPGTrooper_Health * 1.75;
_root.Unit1_Sniper.health = _root.Units_Default_array.Sniper_Health * 1.75;
_root.Unit1_LaserTrooper.health = _root.Units_Default_array.LaserTrooper_Health * 1.75;
}
}
if (_root.Comp_ResearchLab_Set == 6) {
if (_root.CompBuyUpgrade("ResearchLab_", "B1")) {
_root.ResearchLab_B_2 = 1;
_root.Unit1_Humvee.health = _root.Units_Default_array.Humvee_Health * 1.5;
_root.Unit1_LightTank.health = _root.Units_Default_array.LightTank_Health * 1.5;
_root.Unit1_HeavyTank.health = _root.Units_Default_array.HeavyTank_Health * 1.5;
_root.Unit1_LaserTank.health = _root.Units_Default_array.LaserTank_Health * 1.5;
}
}
if (_root.Comp_ResearchLab_Set == 7) {
if (_root.CompBuyUpgrade("ResearchLab_", "C1")) {
_root.ResearchLab_C_2 = 1;
_root.Unit1_MachineGunner.speed = _root.Units_Default_array.MachineGunner_Speed * 1.1;
_root.Unit1_RPGTrooper.speed = _root.Units_Default_array.RPGTrooper_Speed * 1.1;
_root.Unit1_Sniper.speed = _root.Units_Default_array.Sniper_Speed * 1.1;
_root.Unit1_LaserTrooper.speed = _root.Units_Default_array.LaserTrooper_Speed * 1.1;
}
}
if (_root.Comp_ResearchLab_Set == 8) {
if (_root.CompBuyUpgrade("ResearchLab_", "D1")) {
_root.ResearchLab_D_2 = 1;
_root.Unit1_Humvee.speed = _root.Units_Default_array.Humvee_Speed * 1.15;
_root.Unit1_LightTank.speed = _root.Units_Default_array.LightTank_Speed * 1.15;
_root.Unit1_HeavyTank.speed = _root.Units_Default_array.HeavyTank_Speed * 1.15;
_root.Unit1_LaserTank.speed = _root.Units_Default_array.LaserTank_Speed * 1.15;
}
}
if (_root.Comp_ResearchLab_Set == 13) {
if (_root.CompBuyUpgrade("ResearchLab_", "E1")) {
_root.ResearchLab_E_2 = 1;
_root.Unit1_MachineGunner.damage = _root.Units_Default_array.MachineGunner_Damage * 1.33;
_root.Unit1_Humvee.damage = _root.Units_Default_array.Humvee_Damage * 1.33;
_root.Unit1_Sniper.damage = _root.Units_Default_array.Sniper_Damage * 1.33;
}
}
if (_root.Comp_ResearchLab_Set == 14) {
if (_root.CompBuyUpgrade("ResearchLab_", "F1")) {
_root.ResearchLab_F_2 = 1;
_root.Unit1_RPGTrooper.damage = _root.Units_Default_array.RPGTrooper_Damage * 1.33;
}
}
if (_root.Comp_ResearchLab_Set == 15) {
if (_root.CompBuyUpgrade("ResearchLab_", "G1")) {
_root.ResearchLab_G_2 = 1;
_root.Unit1_LightTank.damage = _root.Units_Default_array.LightTank_Damage * 1.33;
_root.Unit1_HeavyTank.damage = _root.Units_Default_array.HeavyTank_Damage * 1.33;
}
}
if (_root.Comp_ResearchLab_Set == 16) {
if (_root.CompBuyUpgrade("ResearchLab_", "H1")) {
_root.ResearchLab_H_2 = 1;
_root.Comp_Barracks2_TimerSet = _root.Comp_Barracks2_TimerSet - 160;
_root.Comp_WarFactory_TimerSet = _root.Comp_WarFactory_TimerSet - 280;
_root.Unit1_MachineGunner.time = _root.Units_Default_array.MachineGunner_Time * 0.6;
_root.Unit1_RPGTrooper.time = _root.Units_Default_array.RPGTrooper_Time * 0.6;
_root.Unit1_Humvee.time = _root.Units_Default_array.Humvee_Time * 0.6;
_root.Unit1_LightTank.time = _root.Units_Default_array.LightTank_Time * 0.6;
_root.Unit1_HeavyTank.time = _root.Units_Default_array.HeavyTank_Time * 0.6;
_root.Unit1_Sniper.time = _root.Units_Default_array.Sniper_Time * 0.6;
_root.Unit1_LaserTrooper.time = _root.Units_Default_array.LaserTrooper_Time * 0.6;
_root.Unit1_LaserTank.time = _root.Units_Default_array.LaserTank_Time * 0.6;
}
}
if (_root.Comp_ResearchLab_Set == 2) {
if (_root.CompBuyUpgrade("ResearchLab_", "I1")) {
_root.ResearchLab_I_2 = 1;
_root.Produce_Farm2D = Math.round(_root.Defaults_array.Produce_FarmD * 1.2);
_root.Produce_Farm2B = Math.round(_root.Defaults_array.Produce_FarmB * 1.2);
}
}
if (_root.Comp_ResearchLab_Set == 9) {
if (_root.CompBuyUpgrade("ResearchLab_", "I2")) {
_root.ResearchLab_I_2 = 2;
_root.Produce_Farm2D = Math.round(_root.Defaults_array.Produce_FarmD * 1.4);
_root.Produce_Farm2B = Math.round(_root.Defaults_array.Produce_FarmB * 1.4);
}
}
if (_root.Comp_ResearchLab_Set == 18) {
if (_root.CompBuyUpgrade("ResearchLab_", "I3")) {
_root.ResearchLab_I_2 = 3;
_root.Produce_Farm2D = Math.round(_root.Defaults_array.Produce_FarmD * 1.7);
_root.Produce_Farm2B = Math.round(_root.Defaults_array.Produce_FarmB * 1.7);
}
}
if (_root.Comp_ResearchLab_Set == 4) {
if (_root.CompBuyUpgrade("ResearchLab_", "J1")) {
_root.ResearchLab_J_2 = 1;
_root.Produce_Mine2D1 = Math.round(_root.Defaults_array.Produce_MineD1 * 1.15);
_root.Produce_Mine2B1 = Math.round(_root.Defaults_array.Produce_MineB1 * 1.15);
}
}
if (_root.Comp_ResearchLab_Set == 10) {
if (_root.CompBuyUpgrade("ResearchLab_", "J2")) {
_root.ResearchLab_J_2 = 2;
_root.Produce_Mine2D1 = Math.round(_root.Defaults_array.Produce_MineD1 * 1.25);
_root.Produce_Mine2B1 = Math.round(_root.Defaults_array.Produce_MineB1 * 1.25);
}
}
if (_root.Comp_ResearchLab_Set == 19) {
if (_root.CompBuyUpgrade("ResearchLab_", "J3")) {
_root.ResearchLab_J_2 = 3;
_root.Produce_Mine2D1 = Math.round(_root.Defaults_array.Produce_MineD1 * 1.5);
_root.Produce_Mine2B1 = Math.round(_root.Defaults_array.Produce_MineB1 * 1.5);
}
}
if (_root.Comp_ResearchLab_Set == 1) {
if (_root.CompBuyUpgrade("ResearchLab_", "K1")) {
_root.ResearchLab_K_2 = 1;
_root.Produce_Mine2D2 = Math.round(_root.Defaults_array.Produce_MineD2 * 1.25);
_root.Produce_Mine2B2 = Math.round(_root.Defaults_array.Produce_MineB2 * 1.25);
}
}
if (_root.Comp_ResearchLab_Set == 11) {
if (_root.CompBuyUpgrade("ResearchLab_", "K2")) {
_root.ResearchLab_K_2 = 2;
_root.Produce_Mine2D2 = Math.round(_root.Defaults_array.Produce_MineD2 * 1.5);
_root.Produce_Mine2B2 = Math.round(_root.Defaults_array.Produce_MineB2 * 1.5);
}
}
if (_root.Comp_ResearchLab_Set == 17) {
if (_root.CompBuyUpgrade("ResearchLab_", "K3")) {
_root.ResearchLab_K_2 = 3;
_root.Produce_Mine2D2 = Math.round(_root.Defaults_array.Produce_MineD2 * 1.75);
_root.Produce_Mine2B2 = Math.round(_root.Defaults_array.Produce_MineB2 * 1.75);
}
}
if (_root.Comp_ResearchLab_Set == 3) {
if (_root.CompBuyUpgrade("ResearchLab_", "L1")) {
_root.ResearchLab_L_2 = 1;
_root.Produce_Mill2D = Math.round(_root.Defaults_array.Produce_MillD * 1.15);
_root.Produce_Mill2B = Math.round(_root.Defaults_array.Produce_MillB * 1.15);
}
}
if (_root.Comp_ResearchLab_Set == 12) {
if (_root.CompBuyUpgrade("ResearchLab_", "L2")) {
_root.ResearchLab_L_2 = 2;
_root.Produce_Mill2D = Math.round(_root.Defaults_array.Produce_MillD * 1.25);
_root.Produce_Mill2B = Math.round(_root.Defaults_array.Produce_MillB * 1.25);
}
}
if (_root.Comp_ResearchLab_Set == 20) {
if (_root.CompBuyUpgrade("ResearchLab_", "L3")) {
_root.ResearchLab_L_2 = 3;
_root.Produce_Mill2D = Math.round(_root.Defaults_array.Produce_MillD * 1.5);
_root.Produce_Mill2B = Math.round(_root.Defaults_array.Produce_MillB * 1.5);
}
}
} else {
_root.Comp_ResearchLab_Timer--;
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
if ((this.Type == "Teir2_ResearchLab") && (this.MissileLaunch == true)) {
_root.Comp_MissileLaunch = "None";
}
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir2_WarFactory") {
_root.container_mc.level_mc[PlaceName].ActionTimer = 40;
_root.container_mc.level_mc[PlaceName].ActionTimerSet = 40;
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if (_root.Comp_WarFactory_Timer <= 0) {
if (CompUnits_array.length < 20) {
if (_root.Comp_Teir == 3) {
RandomizeUnitType = random(4);
if (RandomizeUnitType == 0) {
UnitSpawnType = "Humvee";
UnitSpawnID = "08";
} else if (RandomizeUnitType == 1) {
UnitSpawnType = "LightTank";
UnitSpawnID = "09";
} else if (RandomizeUnitType == 2) {
UnitSpawnType = "HeavyTank";
UnitSpawnID = "10";
} else {
UnitSpawnType = "LaserTank";
UnitSpawnID = "13";
}
} else {
RandomizeUnitType = random(4);
if (RandomizeUnitType == 0) {
UnitSpawnType = "Humvee";
UnitSpawnID = "08";
} else if (RandomizeUnitType == 1) {
UnitSpawnType = "LightTank";
UnitSpawnID = "09";
} else {
UnitSpawnType = "HeavyTank";
UnitSpawnID = "10";
}
}
if ((((_root.Comp_Food >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Food"]) && (_root.Comp_Gold >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Gold"])) && (_root.Comp_Stone >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Stone"])) && (_root.Comp_Wood >= _root.Costs_array[("Unit_" + UnitSpawnID) + "_Wood"])) {
_root.Comp_WarFactory_Timer = _root.Comp_WarFactory_TimerSet;
_root.Comp_Food = _root.Comp_Food - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Food"];
_root.Comp_Gold = _root.Comp_Gold - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Gold"];
_root.Comp_Stone = _root.Comp_Stone - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Stone"];
_root.Comp_Wood = _root.Comp_Wood - _root.Costs_array[("Unit_" + UnitSpawnID) + "_Wood"];
if (_root.CheckDepths(this._x - 35, this._y + 35) == false) {
NewUnit = _root.CreateUnit(UnitSpawnType, UnitSpawnType, this._x - 35, this._y + 35, 2, false);
if (_root.container_mc.level_mc[this.MyName].PlacePosition == 1) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 35;
_root.container_mc.level_mc[this.MyName].PlacePosition = 2;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 2) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 3;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 3) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 35;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 4;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 4) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 60;
_root.container_mc.level_mc[this.MyName].PlacePosition = 5;
} else if (_root.container_mc.level_mc[this.MyName].PlacePosition == 5) {
_root.container_mc.level_mc[NewUnit].GoToX = this._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._y + 35;
_root.container_mc.level_mc[this.MyName].PlacePosition = 1;
}
}
}
}
} else {
_root.Comp_WarFactory_Timer--;
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir3_CommandPost") {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if ((((_root.TechCenter_C_2 == 1) && (Buildings2_array.Teir3_CommandPost >= 1)) && (_root.Comp_AirstrikeLaunch == "None")) && (_root.Comp_AirstrikeActivated == false)) {
if ((_root.Comp_AirstrikeTimer <= 0) && (_root.UserBuildings_array.length > 0)) {
_root.sounds_mc.CreateSound("Power_", "AirstrikeLaunch", 100, 0, true);
Target = _root.UserBuildings_array[random(_root.UserBuildings_array.length)];
_root.Comp_AirstrikeX = _root.container_mc.level_mc[Target]._x;
_root.Comp_AirstrikeY = _root.container_mc.level_mc[Target]._y;
_root.Comp_AirstrikeLaunch = "Launch";
_root.Comp_AirstrikeActivated = true;
opp = 675 - _root.Comp_AirstrikeY;
adj = -875 - _root.Comp_AirstrikeX;
rotation = (Math.atan2(opp, adj) * 57.2957795130823) + 180;
NewName = "AirstrikeAction" + C_LE_D3;
_root.container_mc.levelEffects_mc.attachMovie("AirstrikeLaunched", NewName, C_LE_D3);
_root.container_mc.levelEffects_mc[NewName]._x = -875;
_root.container_mc.levelEffects_mc[NewName]._y = 675;
_root.container_mc.levelEffects_mc[NewName]._rotation = rotation;
_root.container_mc.levelEffects_mc[NewName].Zone = "None";
_root.container_mc.levelEffects_mc[NewName].FireMissiles = false;
_root.container_mc.levelEffects_mc[NewName].TargetX = _root.Comp_AirstrikeX;
_root.container_mc.levelEffects_mc[NewName].TargetY = _root.Comp_AirstrikeY;
_root.container_mc.levelEffects_mc[NewName].onEnterFrame = function () {
if (_root.PauseGame == false) {
adj = this.TargetX - this._x;
opp = this.TargetY - this._y;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((this.Zone == "None") && (hyp < 400)) {
this.FireMissiles = true;
this.Zone = "First";
}
if ((this.Zone == "First") && (hyp < 320)) {
this.FireMissiles = true;
this.Zone = "Second";
}
if ((this.Zone == "Second") && (hyp < 240)) {
this.FireMissiles = true;
this.Zone = "Third";
}
if ((this.Zone == "Third") && (hyp < 160)) {
this.FireMissiles = true;
this.Zone = "Fourth";
}
if ((this.Zone == "Fourth") && (hyp > 0)) {
this.Zone = "Damage";
_root.Comp_AirstrikeLaunch = "Damage";
}
if (this.FireMissiles == true) {
this.FireMissiles = false;
i = 1;
while (i <= 3) {
myPoint = {x:0, y:7.5};
this["raptor" + i].localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("RPG", this._rotation + ((Math.random() * 6) - 3), myPoint2.x, myPoint2.y, this.TargetX, this.TargetY, 0, random(100) - 49);
i++;
}
i = 1;
while (i <= 3) {
myPoint = {x:0, y:-7.5};
this["raptor" + i].localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("RPG", this._rotation + ((Math.random() * 6) - 3), myPoint2.x, myPoint2.y, this.TargetX, this.TargetY, 0, random(100) - 49);
i++;
}
}
this.myPoint = {x:7.5, y:0};
this.localToGlobal(this.myPoint);
this.myPoint2 = {x:this.myPoint.x, y:this.myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(this.myPoint2);
this._x = this.myPoint2.x;
this._y = this.myPoint2.y;
if (this._x > 900) {
_root.Comp_AirstrikeLaunch = "None";
this.removeMovieClip();
}
if (this._x < -900) {
_root.Comp_AirstrikeLaunch = "None";
this.removeMovieClip();
}
if (this._y > 700) {
_root.Comp_AirstrikeLaunch = "None";
this.removeMovieClip();
}
if (this._y < -700) {
_root.Comp_AirstrikeLaunch = "None";
this.removeMovieClip();
}
}
};
C_LE_D3++;
if (C_LE_D3 > C_LE_D3max) {
C_LE_D3 = C_LE_D3min;
}
} else {
_root.Comp_AirstrikeTimer--;
}
}
if (((((_root.TechCenter_D_2 == 1) && (Buildings2_array.Teir2_ResearchLab >= 1)) && (Buildings2_array.Teir3_CommandPost >= 1)) && (_root.Comp_MissileLaunch == "None")) && (_root.Comp_MissileLaunchActivated == false)) {
if ((_root.Comp_MissileLaunchTimer <= 0) && (_root.UserBuildings_array.length > 0)) {
_root.sounds_mc.CreateSound("Power_", "MissileLaunch", 100, 0, true);
Target = _root.UserBuildings_array[random(_root.UserBuildings_array.length)];
_root.Comp_MissileX = _root.container_mc.level_mc[Target]._x;
_root.Comp_MissileY = _root.container_mc.level_mc[Target]._y;
_root.Comp_MissileLaunch = "Launch";
_root.Comp_MissileLaunchActivated = true;
} else {
_root.Comp_MissileLaunchTimer--;
}
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
if (PlaceType == "Teir3_TechCenter") {
_root.container_mc.level_mc[PlaceName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.health > 0) {
_root.CompBuilding_Ping = _root.GameTime;
if (_root.Comp_TechCenter_Timer <= 0) {
if (_root.Comp_TechCenter_Set == 1) {
if (_root.CompBuyUpgrade("TechCenter_", "A1")) {
_root.TechCenter_A_2 = 1;
_root.Unit2_LaserTrooper.damage = _root.Units_Default_array.LaserTrooper_Damage * 1.25;
_root.Unit2_LaserTank.damage = _root.Units_Default_array.LaserTank_Damage * 1.25;
}
}
if (_root.Comp_TechCenter_Set == 2) {
if (_root.CompBuyUpgrade("TechCenter_", "B1")) {
_root.TechCenter_B_2 = 1;
_root.User_Repair = _root.User_Repair * 3;
}
}
if (((_root.TechCenter_C_2 == 0) && (_root.Comp_TechCenter_Set > 2)) && ((_root.Comp_TechCenter_Set / 2) != Math.round(_root.Comp_TechCenter_Set / 2))) {
if (_root.CompBuyUpgrade("TechCenter_", "C1")) {
_root.TechCenter_C_2 = 1;
}
}
if (((_root.TechCenter_D_2 == 0) && (_root.Comp_TechCenter_Set > 2)) && ((_root.Comp_TechCenter_Set / 2) == Math.round(_root.Comp_TechCenter_Set / 2))) {
if (_root.CompBuyUpgrade("TechCenter_", "D1")) {
_root.TechCenter_D_2 = 1;
}
}
} else {
_root.Comp_TechCenter_Timer--;
}
} else if (this.dead == false) {
if (_root.BuildingTimer < 4) {
_root.BuildingTimer = 4;
}
_level[("Buildings" + this.Ownership) + "_array"][this.Type]--;
_root.Comp_Pop = _root.Comp_Pop - this.Workers;
this.dead = true;
this.building_mc.gotoAndStop("die");
_root.MatchVars_array.buildingsDestroyed++;
}
}
};
}
}
function MGP() {
if ((_root.User_AirstrikeLaunch == "None") && (_root.User_AirstrikeActivated == true)) {
_root.User_AirstrikeActivated = false;
_root.User_AirstrikeTimer = _root.User_AirstrikeSet;
_root.TechCenter_C_1 = 0;
}
if ((_root.User_MissileLaunch == "None") && (_root.User_MissileLaunchActivated == true)) {
_root.User_MissileLaunchActivated = false;
_root.User_MissileLaunchTimer = _root.User_MissileLaunchSet;
_root.TechCenter_D_1 = 0;
}
if (_root.User_AirstrikeLaunch == "Damage") {
_root.User_AirstrikeLaunch = "Active";
i = 0;
while (i < _level.Units_array.length) {
opp = _root.container_mc.level_mc[_level.Units_array[i]]._y - _root.User_AirstrikeY;
adj = _root.container_mc.level_mc[_level.Units_array[i]]._x - _root.User_AirstrikeX;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((hyp - 50) < (_root.User_AirstrikeRange / 2)) {
DoDamage = _root.User_AirstrikeDamage - (hyp * 2);
_root.container_mc.level_mc[_level.Units_array[i]].health = _root.container_mc.level_mc[_level.Units_array[i]].health - DoDamage;
}
i++;
}
i = 0;
while (i < _level.Buildings_array.length) {
opp = _root.container_mc.level_mc[_level.Buildings_array[i]]._y - _root.User_AirstrikeY;
adj = _root.container_mc.level_mc[_level.Buildings_array[i]]._x - _root.User_AirstrikeX;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((hyp - 50) < (_root.User_AirstrikeRange / 2)) {
DoDamage = _root.User_AirstrikeDamage - (hyp * 2);
_root.container_mc.level_mc[_level.Buildings_array[i]].health = _root.container_mc.level_mc[_level.Buildings_array[i]].health - DoDamage;
}
i++;
}
}
if (_root.User_MissileLaunch == "End") {
_root.User_MissileLaunch = "Active";
NewName = "Explosion" + C_LE_D3;
_root.container_mc.levelEffects_mc.attachMovie("MissileHit", NewName, C_LE_D3);
_root.container_mc.levelEffects_mc[NewName].Player = "User";
_root.container_mc.levelEffects_mc[NewName]._x = _root.User_MissileX;
_root.container_mc.levelEffects_mc[NewName]._y = _root.User_MissileY;
C_LE_D3++;
if (C_LE_D3 > C_LE_D3max) {
C_LE_D3 = C_LE_D3min;
}
}
if (_root.User_MissileLaunch == "Damage") {
_root.User_MissileLaunch = "Active";
i = 0;
while (i < _level.Units_array.length) {
opp = _root.container_mc.level_mc[_level.Units_array[i]]._y - _root.User_MissileY;
adj = _root.container_mc.level_mc[_level.Units_array[i]]._x - _root.User_MissileX;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((hyp - 50) < (_root.User_MissileRange / 2)) {
DoDamage = _root.User_MissileDamage - (hyp * 2);
_root.container_mc.level_mc[_level.Units_array[i]].health = _root.container_mc.level_mc[_level.Units_array[i]].health - DoDamage;
}
i++;
}
i = 0;
while (i < _level.Buildings_array.length) {
opp = _root.container_mc.level_mc[_level.Buildings_array[i]]._y - _root.User_MissileY;
adj = _root.container_mc.level_mc[_level.Buildings_array[i]]._x - _root.User_MissileX;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((hyp - 50) < (_root.User_MissileRange / 2)) {
DoDamage = _root.User_MissileDamage - (hyp * 2);
_root.container_mc.level_mc[_level.Buildings_array[i]].health = _root.container_mc.level_mc[_level.Buildings_array[i]].health - DoDamage;
}
i++;
}
}
if ((_root.Comp_AirstrikeLaunch == "None") && (_root.Comp_AirstrikeActivated == true)) {
_root.Comp_AirstrikeActivated = false;
_root.Comp_AirstrikeTimer = _root.Comp_AirstrikeSet;
_root.TechCenter_C_2 = 0;
}
if ((_root.Comp_MissileLaunch == "None") && (_root.Comp_MissileLaunchActivated == true)) {
_root.Comp_MissileLaunchActivated = false;
_root.Comp_MissileLaunchTimer = _root.Comp_MissileLaunchSet;
_root.TechCenter_D_2 = 0;
}
if (_root.Comp_AirstrikeLaunch == "Damage") {
_root.Comp_AirstrikeLaunch = "Active";
i = 0;
while (i < _level.Units_array.length) {
opp = _root.container_mc.level_mc[_level.Units_array[i]]._y - _root.Comp_AirstrikeY;
adj = _root.container_mc.level_mc[_level.Units_array[i]]._x - _root.Comp_AirstrikeX;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((hyp - 50) < (_root.Comp_AirstrikeRange / 2)) {
DoDamage = _root.Comp_AirstrikeDamage - (hyp * 2);
_root.container_mc.level_mc[_level.Units_array[i]].health = _root.container_mc.level_mc[_level.Units_array[i]].health - DoDamage;
}
i++;
}
i = 0;
while (i < _level.Buildings_array.length) {
opp = _root.container_mc.level_mc[_level.Buildings_array[i]]._y - _root.Comp_AirstrikeY;
adj = _root.container_mc.level_mc[_level.Buildings_array[i]]._x - _root.Comp_AirstrikeX;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((hyp - 50) < (_root.Comp_AirstrikeRange / 2)) {
DoDamage = _root.Comp_AirstrikeDamage - (hyp * 2);
_root.container_mc.level_mc[_level.Buildings_array[i]].health = _root.container_mc.level_mc[_level.Buildings_array[i]].health - DoDamage;
}
i++;
}
}
if (_root.Comp_MissileLaunch == "End") {
_root.Comp_MissileLaunch = "Active";
NewName = "Explosion" + C_LE_D3;
_root.container_mc.levelEffects_mc.attachMovie("MissileHit", NewName, C_LE_D3);
_root.container_mc.levelEffects_mc[NewName].Player = "Comp";
_root.container_mc.levelEffects_mc[NewName]._x = _root.Comp_MissileX;
_root.container_mc.levelEffects_mc[NewName]._y = _root.Comp_MissileY;
C_LE_D3++;
if (C_LE_D3 > C_LE_D3max) {
C_LE_D3 = C_LE_D3min;
}
}
if (_root.Comp_MissileLaunch == "Damage") {
_root.Comp_MissileLaunch = "Active";
i = 0;
while (i < _level.Units_array.length) {
opp = _root.container_mc.level_mc[_level.Units_array[i]]._y - _root.Comp_MissileY;
adj = _root.container_mc.level_mc[_level.Units_array[i]]._x - _root.Comp_MissileX;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((hyp - 50) < (_root.Comp_MissileRange / 2)) {
DoDamage = _root.Comp_MissileDamage - (hyp * 2);
_root.container_mc.level_mc[_level.Units_array[i]].health = _root.container_mc.level_mc[_level.Units_array[i]].health - DoDamage;
}
i++;
}
i = 0;
while (i < _level.Buildings_array.length) {
opp = _root.container_mc.level_mc[_level.Buildings_array[i]]._y - _root.Comp_MissileY;
adj = _root.container_mc.level_mc[_level.Buildings_array[i]]._x - _root.Comp_MissileX;
hyp = Math.sqrt((opp * opp) + (adj * adj));
if ((hyp - 50) < (_root.Comp_MissileRange / 2)) {
DoDamage = _root.Comp_MissileDamage - (hyp * 2);
_root.container_mc.level_mc[_level.Buildings_array[i]].health = _root.container_mc.level_mc[_level.Buildings_array[i]].health - DoDamage;
}
i++;
}
}
}
function CreateObject(ObjectType, ObjectRotation, ObjectX, ObjectY, DestinationX, DestinationY, Ownership, ExtraDistance) {
if (ObjectType == "Arrow") {
Opposite = DestinationY - ObjectY;
Adjacent = DestinationX - ObjectX;
Hypotenuse = Math.sqrt((Opposite * Opposite) + (Adjacent * Adjacent));
NewName = "Arrow" + C_LE_D2;
_root.container_mc.levelEffects_mc.attachMovie("Archer_Arrow", NewName, C_LE_D2);
_root.container_mc.levelEffects_mc[NewName]._rotation = ObjectRotation;
_root.container_mc.levelEffects_mc[NewName]._x = ObjectX;
_root.container_mc.levelEffects_mc[NewName]._y = ObjectY;
_root.container_mc.levelEffects_mc[NewName].Distance = Hypotenuse;
_root.container_mc.levelEffects_mc[NewName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.arrow_mc._x < this.Distance) {
this.arrow_mc._x = this.arrow_mc._x + 5;
this._alpha = 100 - Math.round((this.arrow_mc._x / this.Distance) * 100);
} else {
this.removeMovieClip();
}
}
};
C_LE_D2++;
if (C_LE_D2 > C_LE_D2max) {
C_LE_D2 = C_LE_D2min;
}
}
if (ObjectType == "Bullet") {
DevX = (Math.random() * 5) - 10;
DevY = (Math.random() * 5) - 10;
NewName = "Bullet" + C_LE_D2;
_root.container_mc.levelEffects_mc.attachMovie("Gunner_Bullet", NewName, C_LE_D2);
_root.container_mc.levelEffects_mc[NewName]._rotation = ObjectRotation;
_root.container_mc.levelEffects_mc[NewName]._x = DestinationX + DevX;
_root.container_mc.levelEffects_mc[NewName]._y = DestinationY + DevY;
C_LE_D2++;
if (C_LE_D2 > C_LE_D2max) {
C_LE_D2 = C_LE_D2min;
}
}
if (ObjectType == "RPG") {
DestinationX = DestinationX + ((Math.random() * 10) - 20);
DestinationY = DestinationY + ((Math.random() * 10) - 20);
Opposite = DestinationY - ObjectY;
Adjacent = DestinationX - ObjectX;
Hypotenuse = Math.sqrt((Opposite * Opposite) + (Adjacent * Adjacent));
NewName = "RPG" + C_LE_D2;
_root.container_mc.levelEffects_mc.attachMovie("RPG", NewName, C_LE_D2);
_root.container_mc.levelEffects_mc[NewName]._rotation = ObjectRotation;
_root.container_mc.levelEffects_mc[NewName]._x = ObjectX;
_root.container_mc.levelEffects_mc[NewName]._y = ObjectY;
_root.container_mc.levelEffects_mc[NewName].Distance = Hypotenuse + ExtraDistance;
_root.container_mc.levelEffects_mc[NewName].Explode = false;
_root.container_mc.levelEffects_mc[NewName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this.rpg_mc._x < this.Distance) {
this.rpg_mc._x = this.rpg_mc._x + 10;
} else if (this.Explode == false) {
this.Explode = true;
this.rpg_mc.gotoAndPlay("explode");
}
}
};
C_LE_D2++;
if (C_LE_D2 > C_LE_D2max) {
C_LE_D2 = C_LE_D2min;
}
}
if (ObjectType == "Shell") {
DevX = (Math.random() * 5) - 10;
DevY = (Math.random() * 5) - 10;
NewName = "Shell" + C_LE_D2;
_root.container_mc.levelEffects_mc.attachMovie("Tank_Shell", NewName, C_LE_D2);
_root.container_mc.levelEffects_mc[NewName]._rotation = ObjectRotation;
_root.container_mc.levelEffects_mc[NewName]._x = DestinationX + DevX;
_root.container_mc.levelEffects_mc[NewName]._y = DestinationY + DevY;
C_LE_D2++;
if (C_LE_D2 > C_LE_D2max) {
C_LE_D2 = C_LE_D2min;
}
}
if (ObjectType == "Laser") {
Opposite = DestinationY - ObjectY;
Adjacent = DestinationX - ObjectX;
Hypotenuse = Math.sqrt((Opposite * Opposite) + (Adjacent * Adjacent));
NewName = "Laser" + C_LE_D2;
_root.container_mc.levelEffects_mc.attachMovie("Laser", NewName, C_LE_D2);
_root.container_mc.levelEffects_mc[NewName]._rotation = ObjectRotation;
_root.container_mc.levelEffects_mc[NewName]._x = ObjectX;
_root.container_mc.levelEffects_mc[NewName]._y = ObjectY;
_root.container_mc.levelEffects_mc[NewName].laser_mc._width = Hypotenuse;
_root.container_mc.levelEffects_mc[NewName].laser_mc.gotoAndStop(Ownership);
_root.container_mc.levelEffects_mc[NewName].onEnterFrame = function () {
if (_root.PauseGame == false) {
if (this._alpha > 5) {
this._alpha = this._alpha * 0.75;
} else {
this.removeMovieClip();
}
}
};
C_LE_D2++;
if (C_LE_D2 > C_LE_D2max) {
C_LE_D2 = C_LE_D2min;
}
}
}
_root.set_MGP = setInterval(MGP, 100);
PlaceBuilding("TC_Keep", "Keep", 600, -450, 1, false);
PlaceBuilding("TC_Keep", "Keep", -600, 450, 2, false);
Frame 10
_root.GameTime = 0;
_root.CompUnit_Ping = _root.GameTime;
_root.CompBuilding_Ping = _root.GameTime;
_root.UserUnit_Ping = _root.GameTime;
_root.UserBuilding_Ping = _root.GameTime;
MatchVars_array = new Array();
MatchVars_array.unitsTrained = 0;
MatchVars_array.unitsKilled = 0;
MatchVars_array.unitsLost = 0;
MatchVars_array.buildingsCreated = 0;
MatchVars_array.buildingsDestroyed = 0;
MatchVars_array.buildingsLost = 0;
MatchVars_array.resourcesCollected = 0;
MatchVars_array.timePlayed = 0;
if (_root.MenuVariables_array.startingTeir == "Three") {
_root.User_Teir = 3;
_root.Comp_Teir = 3;
} else if (_root.MenuVariables_array.startingTeir == "Two") {
_root.User_Teir = 2;
_root.Comp_Teir = 2;
} else {
_root.User_Teir = 1;
_root.Comp_Teir = 1;
}
if (_root.MenuVariables_array.compDifficulty == "Brutal") {
_root.Comp_Difficulty = "Brutal";
} else if (_root.MenuVariables_array.compDifficulty == "Hard") {
_root.Comp_Difficulty = "Hard";
} else if (_root.MenuVariables_array.compDifficulty == "Normal") {
_root.Comp_Difficulty = "Normal";
} else {
_root.Comp_Difficulty = "Easy";
}
Defaults_array = new Array();
Defaults_array.Produce_FarmD = 50;
Defaults_array.Produce_MineD1 = 75;
Defaults_array.Produce_MineD2 = 25;
Defaults_array.Produce_MillD = 35;
Defaults_array.Produce_FarmB = 20;
Defaults_array.Produce_MineB1 = 25;
Defaults_array.Produce_MineB2 = 10;
Defaults_array.Produce_MillB = 15;
_root.User_Advancing = false;
_root.User_Repair = 10;
_root.User_LOS = 300;
_root.User_Pop = 0;
_root.User_PopCap = 60;
_root.User_DisplayEnemyHealth = false;
_root.User_DisplayBuildingHealth = false;
_root.User_Formation = "Square";
_root.User_DefaultStance = "Aggressive";
_root.User_AirstrikeLaunch = "None";
_root.User_AirstrikeDamage = 750;
_root.User_AirstrikeRange = 175;
_root.User_AirstrikeTimer = 320;
_root.User_AirstrikeSet = 320;
_root.User_AirstrikeX = 0;
_root.User_AirstrikeY = 0;
_root.User_AirstrikeActivated = false;
_root.User_MissileLaunch = "None";
_root.User_MissileDamage = 1250;
_root.User_MissileRange = 275;
_root.User_MissileLaunchTimer = 400;
_root.User_MissileLaunchSet = 400;
_root.User_MissileX = 0;
_root.User_MissileY = 0;
_root.User_MissileLaunchActivated = false;
_root.User_Food = 500;
_root.User_Gold = 225;
_root.User_Stone = 375;
_root.User_Wood = 325;
_root.User_DR_Info = "None";
_root.User_DR_Pop = 0;
_root.User_DR_Food = 0;
_root.User_DR_Gold = 0;
_root.User_DR_Stone = 0;
_root.User_DR_Wood = 0;
if ((_root.MenuVariables_array.customGame == "On") && (_root.MenuVariables_array.customResources == "On")) {
_root.User_Food = Infinity;
_root.User_Gold = Infinity;
_root.User_Stone = Infinity;
_root.User_Wood = Infinity;
}
_root.UserUnitSpacing = 55;
_root.Produce_Farm1 = 400;
_root.Produce_Mine1 = 400;
_root.Produce_Mill1 = 400;
_root.Produce_Farm1D = Defaults_array.Produce_FarmD;
_root.Produce_Mine1D1 = Defaults_array.Produce_MineD1;
_root.Produce_Mine1D2 = Defaults_array.Produce_MineD2;
_root.Produce_Mill1D = Defaults_array.Produce_MillD;
_root.Produce_Farm1B = Defaults_array.Produce_FarmB;
_root.Produce_Mine1B1 = Defaults_array.Produce_MineB1;
_root.Produce_Mine1B2 = Defaults_array.Produce_MineB2;
_root.Produce_Mill1B = Defaults_array.Produce_MillB;
_root.Armoury_A_1 = 0;
_root.Armoury_B_1 = 0;
_root.Armoury_C_1 = 0;
_root.Armoury_D_1 = 0;
_root.ResearchLab_A_1 = 0;
_root.ResearchLab_B_1 = 0;
_root.ResearchLab_C_1 = 0;
_root.ResearchLab_D_1 = 0;
_root.ResearchLab_E_1 = 0;
_root.ResearchLab_F_1 = 0;
_root.ResearchLab_G_1 = 0;
_root.ResearchLab_H_1 = 0;
_root.ResearchLab_I_1 = 0;
_root.ResearchLab_J_1 = 0;
_root.ResearchLab_K_1 = 0;
_root.ResearchLab_L_1 = 0;
_root.TechCenter_A_1 = 0;
_root.TechCenter_B_1 = 0;
_root.TechCenter_C_1 = 0;
_root.TechCenter_D_1 = 0;
Research_Time = new Array();
Research_Time.Armoury_A1 = 200;
Research_Time.Armoury_A2 = 400;
Research_Time.Armoury_A3 = 600;
Research_Time.Armoury_B1 = 200;
Research_Time.Armoury_B2 = 400;
Research_Time.Armoury_B3 = 600;
Research_Time.Armoury_C1 = 200;
Research_Time.Armoury_C2 = 400;
Research_Time.Armoury_C3 = 600;
Research_Time.Armoury_D1 = 200;
Research_Time.Armoury_D2 = 400;
Research_Time.Armoury_D3 = 600;
Research_Time.ResearchLab_A1 = 400;
Research_Time.ResearchLab_B1 = 400;
Research_Time.ResearchLab_C1 = 400;
Research_Time.ResearchLab_D1 = 400;
Research_Time.ResearchLab_E1 = 600;
Research_Time.ResearchLab_F1 = 600;
Research_Time.ResearchLab_G1 = 600;
Research_Time.ResearchLab_H1 = 600;
Research_Time.ResearchLab_I1 = 200;
Research_Time.ResearchLab_I2 = 400;
Research_Time.ResearchLab_I3 = 600;
Research_Time.ResearchLab_J1 = 200;
Research_Time.ResearchLab_J2 = 400;
Research_Time.ResearchLab_J3 = 600;
Research_Time.ResearchLab_K1 = 200;
Research_Time.ResearchLab_K2 = 400;
Research_Time.ResearchLab_K3 = 600;
Research_Time.ResearchLab_L1 = 200;
Research_Time.ResearchLab_L2 = 400;
Research_Time.ResearchLab_L3 = 600;
Research_Time.TechCenter_A1 = 400;
Research_Time.TechCenter_B1 = 400;
Research_Time.TechCenter_C1 = 200;
Research_Time.TechCenter_D1 = 200;
if ((_root.MenuVariables_array.customGame == "On") && (_root.MenuVariables_array.customUpgrade == "On")) {
Research_Time.Armoury_A1 = 1;
Research_Time.Armoury_A2 = 1;
Research_Time.Armoury_A3 = 1;
Research_Time.Armoury_B1 = 1;
Research_Time.Armoury_B2 = 1;
Research_Time.Armoury_B3 = 1;
Research_Time.Armoury_C1 = 1;
Research_Time.Armoury_C2 = 1;
Research_Time.Armoury_C3 = 1;
Research_Time.Armoury_D1 = 1;
Research_Time.Armoury_D2 = 1;
Research_Time.Armoury_D3 = 1;
Research_Time.ResearchLab_A1 = 1;
Research_Time.ResearchLab_B1 = 1;
Research_Time.ResearchLab_C1 = 1;
Research_Time.ResearchLab_D1 = 1;
Research_Time.ResearchLab_E1 = 1;
Research_Time.ResearchLab_F1 = 1;
Research_Time.ResearchLab_G1 = 1;
Research_Time.ResearchLab_H1 = 1;
Research_Time.ResearchLab_I1 = 1;
Research_Time.ResearchLab_I2 = 1;
Research_Time.ResearchLab_I3 = 1;
Research_Time.ResearchLab_J1 = 1;
Research_Time.ResearchLab_J2 = 1;
Research_Time.ResearchLab_J3 = 1;
Research_Time.ResearchLab_K1 = 1;
Research_Time.ResearchLab_K2 = 1;
Research_Time.ResearchLab_K3 = 1;
Research_Time.ResearchLab_L1 = 1;
Research_Time.ResearchLab_L2 = 1;
Research_Time.ResearchLab_L3 = 1;
Research_Time.TechCenter_A1 = 1;
Research_Time.TechCenter_B1 = 1;
Research_Time.TechCenter_C1 = 1;
Research_Time.TechCenter_D1 = 1;
_root.User_AirstrikeTimer = 1;
_root.User_AirstrikeSet = 1;
_root.User_MissileLaunchTimer = 1;
_root.User_MissileLaunchSet = 1;
}
_root.Produce_Farm2 = 400;
_root.Produce_Mine2 = 400;
_root.Produce_Mill2 = 400;
_root.Produce_Farm2D = Defaults_array.Produce_FarmD;
_root.Produce_Mine2D1 = Defaults_array.Produce_MineD1;
_root.Produce_Mine2D2 = Defaults_array.Produce_MineD2;
_root.Produce_Mill2D = Defaults_array.Produce_MillD;
_root.Produce_Farm2B = Defaults_array.Produce_FarmB;
_root.Produce_Mine2B1 = Defaults_array.Produce_MineB1;
_root.Produce_Mine2B2 = Defaults_array.Produce_MineB2;
_root.Produce_Mill2B = Defaults_array.Produce_MillB;
_root.Armoury_A_2 = 0;
_root.Armoury_B_2 = 0;
_root.Armoury_C_2 = 0;
_root.Armoury_D_2 = 0;
_root.ResearchLab_A_2 = 0;
_root.ResearchLab_B_2 = 0;
_root.ResearchLab_C_2 = 0;
_root.ResearchLab_D_2 = 0;
_root.ResearchLab_E_2 = 0;
_root.ResearchLab_F_2 = 0;
_root.ResearchLab_G_2 = 0;
_root.ResearchLab_H_2 = 0;
_root.ResearchLab_I_2 = 0;
_root.ResearchLab_J_2 = 0;
_root.ResearchLab_K_2 = 0;
_root.ResearchLab_L_2 = 0;
_root.TechCenter_A_2 = 0;
_root.TechCenter_B_2 = 0;
_root.TechCenter_C_2 = 0;
_root.TechCenter_D_2 = 0;
Costs_array = new Array();
Costs_array.BF1_Info = "BuyFood100";
Costs_array.BF1_Gold = 150;
Costs_array.BS1_Info = "BuyStone100";
Costs_array.BS1_Gold = 200;
Costs_array.BW1_Info = "BuyWood100";
Costs_array.BW1_Gold = 125;
Costs_array.BF5_Info = "BuyFood500";
Costs_array.BF5_Gold = 713;
Costs_array.BS5_Info = "BuyStone500";
Costs_array.BS5_Gold = 950;
Costs_array.BW5_Info = "BuyWood500";
Costs_array.BW5_Gold = 594;
Costs_array.SF1_Info = "SellFood100";
Costs_array.SF1_Gold = 75;
Costs_array.SS1_Info = "SellStone100";
Costs_array.SS1_Gold = 100;
Costs_array.SW1_Info = "SellWood100";
Costs_array.SW1_Gold = 63;
Costs_array.SF5_Info = "SellFood500";
Costs_array.SF5_Gold = 393;
Costs_array.SS5_Info = "SellStone500";
Costs_array.SS5_Gold = 525;
Costs_array.SW5_Info = "SellWood500";
Costs_array.SW5_Gold = 328;
Costs_array.Misc_T2_Info = "Teir2";
Costs_array.Misc_T2_Pop = 0;
Costs_array.Misc_T2_Food = 1000;
Costs_array.Misc_T2_Gold = 2000;
Costs_array.Misc_T2_Stone = 500;
Costs_array.Misc_T2_Wood = 1000;
Costs_array.Misc_T3_Info = "Teir3";
Costs_array.Misc_T3_Pop = 0;
Costs_array.Misc_T3_Food = 2000;
Costs_array.Misc_T3_Gold = 4000;
Costs_array.Misc_T3_Stone = 1000;
Costs_array.Misc_T3_Wood = 2000;
Costs_array.Misc_Foundation_Info = "Foundation";
Costs_array.Misc_Foundation_Pop = 0;
Costs_array.Misc_Foundation_Food = 0;
Costs_array.Misc_Foundation_Gold = 25;
Costs_array.Misc_Foundation_Stone = 50;
Costs_array.Misc_Foundation_Wood = 0;
Costs_array.Misc_Repair_Info = "Repair";
Costs_array.Misc_Repair_Pop = 0;
Costs_array.Misc_Repair_Food = 0;
Costs_array.Misc_Repair_Gold = 0;
Costs_array.Misc_Repair_Stone = 5;
Costs_array.Misc_Repair_Wood = 10;
Costs_array.Misc_Worker_Info = "Worker";
Costs_array.Misc_Worker_Pop = 1;
Costs_array.Misc_Worker_Food = 50;
Costs_array.Misc_Worker_Gold = 0;
Costs_array.Misc_Worker_Stone = 0;
Costs_array.Misc_Worker_Wood = 0;
Costs_array.Unit_01_Info = "Swordsman";
Costs_array.Unit_01_Pop = 1;
Costs_array.Unit_01_Food = 100;
Costs_array.Unit_01_Gold = 125;
Costs_array.Unit_01_Stone = 0;
Costs_array.Unit_01_Wood = 0;
Costs_array.Unit_02_Info = "Spearman";
Costs_array.Unit_02_Pop = 1;
Costs_array.Unit_02_Food = 100;
Costs_array.Unit_02_Gold = 50;
Costs_array.Unit_02_Stone = 0;
Costs_array.Unit_02_Wood = 0;
Costs_array.Unit_03_Info = "Archer";
Costs_array.Unit_03_Pop = 1;
Costs_array.Unit_03_Food = 50;
Costs_array.Unit_03_Gold = 100;
Costs_array.Unit_03_Stone = 0;
Costs_array.Unit_03_Wood = 0;
Costs_array.Unit_04_Info = "MountedSwordsman";
Costs_array.Unit_04_Pop = 2;
Costs_array.Unit_04_Food = 200;
Costs_array.Unit_04_Gold = 100;
Costs_array.Unit_04_Stone = 0;
Costs_array.Unit_04_Wood = 0;
Costs_array.Unit_05_Info = "MountedArcher";
Costs_array.Unit_05_Pop = 2;
Costs_array.Unit_05_Food = 150;
Costs_array.Unit_05_Gold = 150;
Costs_array.Unit_05_Stone = 0;
Costs_array.Unit_05_Wood = 0;
Costs_array.Unit_06_Info = "MachineGunner";
Costs_array.Unit_06_Pop = 1;
Costs_array.Unit_06_Food = 300;
Costs_array.Unit_06_Gold = 200;
Costs_array.Unit_06_Stone = 0;
Costs_array.Unit_06_Wood = 0;
Costs_array.Unit_07_Info = "RPGTrooper";
Costs_array.Unit_07_Pop = 1;
Costs_array.Unit_07_Food = 300;
Costs_array.Unit_07_Gold = 250;
Costs_array.Unit_07_Stone = 0;
Costs_array.Unit_07_Wood = 0;
Costs_array.Unit_08_Info = "Humvee";
Costs_array.Unit_08_Pop = 2;
Costs_array.Unit_08_Food = 250;
Costs_array.Unit_08_Gold = 300;
Costs_array.Unit_08_Stone = 0;
Costs_array.Unit_08_Wood = 0;
Costs_array.Unit_09_Info = "LightTank";
Costs_array.Unit_09_Pop = 2;
Costs_array.Unit_09_Food = 300;
Costs_array.Unit_09_Gold = 400;
Costs_array.Unit_09_Stone = 0;
Costs_array.Unit_09_Wood = 0;
Costs_array.Unit_10_Info = "HeavyTank";
Costs_array.Unit_10_Pop = 3;
Costs_array.Unit_10_Food = 400;
Costs_array.Unit_10_Gold = 500;
Costs_array.Unit_10_Stone = 0;
Costs_array.Unit_10_Wood = 0;
Costs_array.Unit_11_Info = "Sniper";
Costs_array.Unit_11_Pop = 1;
Costs_array.Unit_11_Food = 400;
Costs_array.Unit_11_Gold = 400;
Costs_array.Unit_11_Stone = 0;
Costs_array.Unit_11_Wood = 0;
Costs_array.Unit_12_Info = "LaserTrooper";
Costs_array.Unit_12_Pop = 2;
Costs_array.Unit_12_Food = 500;
Costs_array.Unit_12_Gold = 600;
Costs_array.Unit_12_Stone = 0;
Costs_array.Unit_12_Wood = 0;
Costs_array.Unit_13_Info = "LaserTank";
Costs_array.Unit_13_Pop = 3;
Costs_array.Unit_13_Food = 700;
Costs_array.Unit_13_Gold = 900;
Costs_array.Unit_13_Stone = 0;
Costs_array.Unit_13_Wood = 0;
Costs_array.Building_01_Info = "Armoury";
Costs_array.Building_01_Food = 0;
Costs_array.Building_01_Gold = 100;
Costs_array.Building_01_Stone = 150;
Costs_array.Building_01_Wood = 50;
Costs_array.Building_02_Info = "Barracks1";
Costs_array.Building_02_Food = 0;
Costs_array.Building_02_Gold = 100;
Costs_array.Building_02_Stone = 50;
Costs_array.Building_02_Wood = 150;
Costs_array.Building_03_Info = "Farm";
Costs_array.Building_03_Food = 0;
Costs_array.Building_03_Gold = 50;
Costs_array.Building_03_Stone = 50;
Costs_array.Building_03_Wood = 150;
Costs_array.Building_04_Info = "LumberMill";
Costs_array.Building_04_Food = 0;
Costs_array.Building_04_Gold = 50;
Costs_array.Building_04_Stone = 75;
Costs_array.Building_04_Wood = 100;
Costs_array.Building_05_Info = "Mine";
Costs_array.Building_05_Food = 0;
Costs_array.Building_05_Gold = 50;
Costs_array.Building_05_Stone = 100;
Costs_array.Building_05_Wood = 75;
Costs_array.Building_06_Info = "Stables";
Costs_array.Building_06_Food = 0;
Costs_array.Building_06_Gold = 150;
Costs_array.Building_06_Stone = 50;
Costs_array.Building_06_Wood = 200;
Costs_array.Building_07_Info = "Barracks2";
Costs_array.Building_07_Food = 0;
Costs_array.Building_07_Gold = 250;
Costs_array.Building_07_Stone = 150;
Costs_array.Building_07_Wood = 300;
Costs_array.Building_08_Info = "ResearchLab";
Costs_array.Building_08_Food = 0;
Costs_array.Building_08_Gold = 300;
Costs_array.Building_08_Stone = 400;
Costs_array.Building_08_Wood = 200;
Costs_array.Building_09_Info = "WarFactory";
Costs_array.Building_09_Food = 0;
Costs_array.Building_09_Gold = 250;
Costs_array.Building_09_Stone = 150;
Costs_array.Building_09_Wood = 300;
Costs_array.Building_10_Info = "CommandPost";
Costs_array.Building_10_Food = 0;
Costs_array.Building_10_Gold = 750;
Costs_array.Building_10_Stone = 250;
Costs_array.Building_10_Wood = 500;
Costs_array.Building_11_Info = "TechCenter";
Costs_array.Building_11_Food = 0;
Costs_array.Building_11_Gold = 750;
Costs_array.Building_11_Stone = 250;
Costs_array.Building_11_Wood = 500;
Costs_array.Armoury_A1_Info = "MeleeCombat1";
Costs_array.Armoury_A1_Food = 0;
Costs_array.Armoury_A1_Gold = 100;
Costs_array.Armoury_A1_Stone = 75;
Costs_array.Armoury_A1_Wood = 50;
Costs_array.Armoury_A2_Info = "MeleeCombat2";
Costs_array.Armoury_A2_Food = 0;
Costs_array.Armoury_A2_Gold = 200;
Costs_array.Armoury_A2_Stone = 125;
Costs_array.Armoury_A2_Wood = 100;
Costs_array.Armoury_A3_Info = "MeleeCombat3";
Costs_array.Armoury_A3_Food = 0;
Costs_array.Armoury_A3_Gold = 400;
Costs_array.Armoury_A3_Stone = 200;
Costs_array.Armoury_A3_Wood = 150;
Costs_array.Armoury_B1_Info = "RangedCombat1";
Costs_array.Armoury_B1_Food = 0;
Costs_array.Armoury_B1_Gold = 100;
Costs_array.Armoury_B1_Stone = 50;
Costs_array.Armoury_B1_Wood = 100;
Costs_array.Armoury_B2_Info = "RangedCombat2";
Costs_array.Armoury_B2_Food = 0;
Costs_array.Armoury_B2_Gold = 200;
Costs_array.Armoury_B2_Stone = 75;
Costs_array.Armoury_B2_Wood = 200;
Costs_array.Armoury_B3_Info = "RangedCombat3";
Costs_array.Armoury_B3_Food = 0;
Costs_array.Armoury_B3_Gold = 400;
Costs_array.Armoury_B3_Stone = 100;
Costs_array.Armoury_B3_Wood = 300;
Costs_array.Armoury_C1_Info = "Defence1";
Costs_array.Armoury_C1_Food = 100;
Costs_array.Armoury_C1_Gold = 100;
Costs_array.Armoury_C1_Stone = 0;
Costs_array.Armoury_C1_Wood = 0;
Costs_array.Armoury_C2_Info = "Defence2";
Costs_array.Armoury_C2_Food = 200;
Costs_array.Armoury_C2_Gold = 200;
Costs_array.Armoury_C2_Stone = 0;
Costs_array.Armoury_C2_Wood = 0;
Costs_array.Armoury_C3_Info = "Defence3";
Costs_array.Armoury_C3_Food = 400;
Costs_array.Armoury_C3_Gold = 400;
Costs_array.Armoury_C3_Stone = 0;
Costs_array.Armoury_C3_Wood = 0;
Costs_array.Armoury_D1_Info = "T1TrainRate1";
Costs_array.Armoury_D1_Food = 100;
Costs_array.Armoury_D1_Gold = 100;
Costs_array.Armoury_D1_Stone = 0;
Costs_array.Armoury_D1_Wood = 0;
Costs_array.Armoury_D2_Info = "T1TrainRate2";
Costs_array.Armoury_D2_Food = 200;
Costs_array.Armoury_D2_Gold = 200;
Costs_array.Armoury_D2_Stone = 0;
Costs_array.Armoury_D2_Wood = 0;
Costs_array.Armoury_D3_Info = "T1TrainRate3";
Costs_array.Armoury_D3_Food = 400;
Costs_array.Armoury_D3_Gold = 400;
Costs_array.Armoury_D3_Stone = 0;
Costs_array.Armoury_D3_Wood = 0;
Costs_array.ResearchLab_A1_Info = "IHealth";
Costs_array.ResearchLab_A1_Food = 500;
Costs_array.ResearchLab_A1_Gold = 750;
Costs_array.ResearchLab_A1_Stone = 0;
Costs_array.ResearchLab_A1_Wood = 0;
Costs_array.ResearchLab_B1_Info = "VHealth";
Costs_array.ResearchLab_B1_Food = 750;
Costs_array.ResearchLab_B1_Gold = 1000;
Costs_array.ResearchLab_B1_Stone = 0;
Costs_array.ResearchLab_B1_Wood = 0;
Costs_array.ResearchLab_C1_Info = "ISpeed";
Costs_array.ResearchLab_C1_Food = 500;
Costs_array.ResearchLab_C1_Gold = 750;
Costs_array.ResearchLab_C1_Stone = 0;
Costs_array.ResearchLab_C1_Wood = 0;
Costs_array.ResearchLab_D1_Info = "VSpeed";
Costs_array.ResearchLab_D1_Food = 750;
Costs_array.ResearchLab_D1_Gold = 1000;
Costs_array.ResearchLab_D1_Stone = 0;
Costs_array.ResearchLab_D1_Wood = 0;
Costs_array.ResearchLab_E1_Info = "BDamage";
Costs_array.ResearchLab_E1_Food = 500;
Costs_array.ResearchLab_E1_Gold = 750;
Costs_array.ResearchLab_E1_Stone = 100;
Costs_array.ResearchLab_E1_Wood = 0;
Costs_array.ResearchLab_F1_Info = "RDamage";
Costs_array.ResearchLab_F1_Food = 750;
Costs_array.ResearchLab_F1_Gold = 1000;
Costs_array.ResearchLab_F1_Stone = 200;
Costs_array.ResearchLab_F1_Wood = 0;
Costs_array.ResearchLab_G1_Info = "SDamage";
Costs_array.ResearchLab_G1_Food = 500;
Costs_array.ResearchLab_G1_Gold = 750;
Costs_array.ResearchLab_G1_Stone = 400;
Costs_array.ResearchLab_G1_Wood = 0;
Costs_array.ResearchLab_H1_Info = "T2TrainRate";
Costs_array.ResearchLab_H1_Food = 500;
Costs_array.ResearchLab_H1_Gold = 1500;
Costs_array.ResearchLab_H1_Stone = 0;
Costs_array.ResearchLab_H1_Wood = 0;
Costs_array.ResearchLab_I1_Info = "Food1";
Costs_array.ResearchLab_I1_Food = 100;
Costs_array.ResearchLab_I1_Gold = 200;
Costs_array.ResearchLab_I1_Stone = 200;
Costs_array.ResearchLab_I1_Wood = 200;
Costs_array.ResearchLab_I2_Info = "Food2";
Costs_array.ResearchLab_I2_Food = 200;
Costs_array.ResearchLab_I2_Gold = 400;
Costs_array.ResearchLab_I2_Stone = 400;
Costs_array.ResearchLab_I2_Wood = 400;
Costs_array.ResearchLab_I3_Info = "Food3";
Costs_array.ResearchLab_I3_Food = 400;
Costs_array.ResearchLab_I3_Gold = 800;
Costs_array.ResearchLab_I3_Stone = 800;
Costs_array.ResearchLab_I3_Wood = 800;
Costs_array.ResearchLab_J1_Info = "Gold1";
Costs_array.ResearchLab_J1_Food = 200;
Costs_array.ResearchLab_J1_Gold = 100;
Costs_array.ResearchLab_J1_Stone = 200;
Costs_array.ResearchLab_J1_Wood = 200;
Costs_array.ResearchLab_J2_Info = "Gold2";
Costs_array.ResearchLab_J2_Food = 400;
Costs_array.ResearchLab_J2_Gold = 200;
Costs_array.ResearchLab_J2_Stone = 400;
Costs_array.ResearchLab_J2_Wood = 400;
Costs_array.ResearchLab_J3_Info = "Gold3";
Costs_array.ResearchLab_J3_Food = 800;
Costs_array.ResearchLab_J3_Gold = 400;
Costs_array.ResearchLab_J3_Stone = 800;
Costs_array.ResearchLab_J3_Wood = 800;
Costs_array.ResearchLab_K1_Info = "Stone1";
Costs_array.ResearchLab_K1_Food = 200;
Costs_array.ResearchLab_K1_Gold = 200;
Costs_array.ResearchLab_K1_Stone = 100;
Costs_array.ResearchLab_K1_Wood = 200;
Costs_array.ResearchLab_K2_Info = "Stone2";
Costs_array.ResearchLab_K2_Food = 400;
Costs_array.ResearchLab_K2_Gold = 400;
Costs_array.ResearchLab_K2_Stone = 200;
Costs_array.ResearchLab_K2_Wood = 400;
Costs_array.ResearchLab_K3_Info = "Stone3";
Costs_array.ResearchLab_K3_Food = 800;
Costs_array.ResearchLab_K3_Gold = 800;
Costs_array.ResearchLab_K3_Stone = 400;
Costs_array.ResearchLab_K3_Wood = 800;
Costs_array.ResearchLab_L1_Info = "Wood1";
Costs_array.ResearchLab_L1_Food = 200;
Costs_array.ResearchLab_L1_Gold = 200;
Costs_array.ResearchLab_L1_Stone = 200;
Costs_array.ResearchLab_L1_Wood = 100;
Costs_array.ResearchLab_L2_Info = "Wood2";
Costs_array.ResearchLab_L2_Food = 400;
Costs_array.ResearchLab_L2_Gold = 400;
Costs_array.ResearchLab_L2_Stone = 400;
Costs_array.ResearchLab_L2_Wood = 200;
Costs_array.ResearchLab_L3_Info = "Wood3";
Costs_array.ResearchLab_L3_Food = 800;
Costs_array.ResearchLab_L3_Gold = 800;
Costs_array.ResearchLab_L3_Stone = 800;
Costs_array.ResearchLab_L3_Wood = 400;
Costs_array.TechCenter_A1_Info = "Laser";
Costs_array.TechCenter_A1_Food = 0;
Costs_array.TechCenter_A1_Gold = 1000;
Costs_array.TechCenter_A1_Stone = 250;
Costs_array.TechCenter_A1_Wood = 500;
Costs_array.TechCenter_B1_Info = "RepairUpg";
Costs_array.TechCenter_B1_Food = 0;
Costs_array.TechCenter_B1_Gold = 500;
Costs_array.TechCenter_B1_Stone = 100;
Costs_array.TechCenter_B1_Wood = 200;
Costs_array.TechCenter_C1_Info = "Airstrike";
Costs_array.TechCenter_C1_Food = 0;
Costs_array.TechCenter_C1_Gold = 1000;
Costs_array.TechCenter_C1_Stone = 0;
Costs_array.TechCenter_C1_Wood = 0;
Costs_array.TechCenter_D1_Info = "MissileStrike";
Costs_array.TechCenter_D1_Food = 0;
Costs_array.TechCenter_D1_Gold = 2000;
Costs_array.TechCenter_D1_Stone = 0;
Costs_array.TechCenter_D1_Wood = 0;
Units_Default_array = new Array();
Units_Default_array.Swordsman_Health = 140;
Units_Default_array.Swordsman_Damage = 12;
Units_Default_array.Swordsman_Speed = 1.9;
Units_Default_array.Swordsman_Time = 400;
Units_Default_array.Spearman_Health = 100;
Units_Default_array.Spearman_Damage = 10;
Units_Default_array.Spearman_Speed = 2;
Units_Default_array.Spearman_Time = 320;
Units_Default_array.Archer_Health = 80;
Units_Default_array.Archer_Damage = 8;
Units_Default_array.Archer_Speed = 2.1;
Units_Default_array.Archer_Time = 240;
Units_Default_array.MountedSwordsman_Health = 200;
Units_Default_array.MountedSwordsman_Damage = 16;
Units_Default_array.MountedSwordsman_Speed = 3;
Units_Default_array.MountedSwordsman_Time = 600;
Units_Default_array.MountedArcher_Health = 140;
Units_Default_array.MountedArcher_Damage = 12;
Units_Default_array.MountedArcher_Speed = 3;
Units_Default_array.MountedArcher_Time = 600;
Units_Default_array.MachineGunner_Health = 200;
Units_Default_array.MachineGunner_Damage = 30;
Units_Default_array.MachineGunner_Speed = 2.2;
Units_Default_array.MachineGunner_Time = 240;
Units_Default_array.RPGTrooper_Health = 240;
Units_Default_array.RPGTrooper_Damage = 60;
Units_Default_array.RPGTrooper_Speed = 2;
Units_Default_array.RPGTrooper_Time = 320;
Units_Default_array.Humvee_Health = 300;
Units_Default_array.Humvee_Damage = 40;
Units_Default_array.Humvee_Speed = 3.2;
Units_Default_array.Humvee_Time = 400;
Units_Default_array.LightTank_Health = 300;
Units_Default_array.LightTank_Damage = 50;
Units_Default_array.LightTank_Speed = 2.5;
Units_Default_array.LightTank_Time = 560;
Units_Default_array.HeavyTank_Health = 500;
Units_Default_array.HeavyTank_Damage = 75;
Units_Default_array.HeavyTank_Speed = 2.4;
Units_Default_array.HeavyTank_Time = 720;
Units_Default_array.Sniper_Health = 100;
Units_Default_array.Sniper_Damage = 10;
Units_Default_array.Sniper_Speed = 2.1;
Units_Default_array.Sniper_Time = 800;
Units_Default_array.LaserTrooper_Health = 400;
Units_Default_array.LaserTrooper_Damage = 75;
Units_Default_array.LaserTrooper_Speed = 2.1;
Units_Default_array.LaserTrooper_Time = 600;
Units_Default_array.LaserTank_Health = 600;
Units_Default_array.LaserTank_Damage = 125;
Units_Default_array.LaserTank_Speed = 2.4;
Units_Default_array.LaserTank_Time = 800;
if ((_root.MenuVariables_array.customGame == "On") && (_root.MenuVariables_array.customTrain == "On")) {
Units_Default_array.Swordsman_Time = 1;
Units_Default_array.Spearman_Time = 1;
Units_Default_array.Archer_Time = 1;
Units_Default_array.MountedSwordsman_Time = 1;
Units_Default_array.MountedArcher_Time = 1;
Units_Default_array.MachineGunner_Time = 1;
Units_Default_array.RPGTrooper_Time = 1;
Units_Default_array.Humvee_Time = 1;
Units_Default_array.LightTank_Time = 1;
Units_Default_array.HeavyTank_Time = 1;
Units_Default_array.Sniper_Time = 1;
Units_Default_array.LaserTrooper_Time = 1;
Units_Default_array.LaserTank_Time = 1;
}
Swordsman_array = ["Spearman", "Archer"];
Swordsman_CV1 = 1.5;
Swordsman_CV2 = 1.5;
Spearman_array = ["MountedSwordsman", "MountedArcher"];
Spearman_CV1 = 2.5;
Spearman_CV2 = 2.5;
Archer_array = ["Spearman"];
Archer_CV1 = 2;
Archer_CV2 = 2;
MountedSwordsman_array = ["Archer"];
MountedSwordsman_CV1 = 1.5;
MountedSwordsman_CV2 = 1.5;
MountedArcher_array = ["Swordsman"];
MountedArcher_CV1 = 2;
MountedArcher_CV2 = 2;
MachineGunner_array = ["RPGTrooper"];
MachineGunner_CV1 = 2;
MachineGunner_CV2 = 2;
RPGTrooper_array = ["Humvee", "LightTank", "HeavyTank", "LaserTank"];
RPGTrooper_CV1 = 2;
RPGTrooper_CV2 = 2;
Humvee_array = ["MachineGunner", "RPGTrooper", "Sniper"];
Humvee_CV1 = 2;
Humvee_CV2 = 1.5;
LightTank_array = ["Humvee"];
LightTank_CV1 = 2;
LightTank_CV2 = 2;
HeavyTank_array = ["Humvee", "LightTank"];
HeavyTank_CV1 = 2;
HeavyTank_CV2 = 2;
Sniper_array = ["Swordsman", "Spearman", "Archer", "MountedSwordsman", "MountedArcher", "MachineGunner", "RPGTrooper", "Sniper", "LaserTrooper"];
Sniper_CV1 = 1000;
Sniper_CV2 = 1;
LaserTrooper_array = ["Humvee", "LightTank", "HeavyTank", "LaserTank"];
LaserTrooper_CV1 = 2;
LaserTrooper_CV2 = 2;
LaserTank_array = ["Humvee", "LightTank", "HeavyTank", "LaserTank"];
LaserTank_CV1 = 2;
LaserTank_CV2 = 2;
i = 1;
while (i <= 2) {
_level[("Unit" + i) + "_Swordsman"] = new Array();
_level[("Unit" + i) + "_Swordsman"].health = Units_Default_array.Swordsman_Health;
_level[("Unit" + i) + "_Swordsman"].damage = Units_Default_array.Swordsman_Damage;
_level[("Unit" + i) + "_Swordsman"].speed = Units_Default_array.Swordsman_Speed;
_level[("Unit" + i) + "_Swordsman"].range = 30;
_level[("Unit" + i) + "_Swordsman"].pop = 1;
_level[("Unit" + i) + "_Swordsman"].counter = Swordsman_array;
_level[("Unit" + i) + "_Swordsman"].counterValue1 = Swordsman_CV1;
_level[("Unit" + i) + "_Swordsman"].counterValue2 = Swordsman_CV2;
_level[("Unit" + i) + "_Swordsman"].time = Units_Default_array.Swordsman_Time;
_level[("Unit" + i) + "_Spearman"] = new Array();
_level[("Unit" + i) + "_Spearman"].health = Units_Default_array.Spearman_Health;
_level[("Unit" + i) + "_Spearman"].damage = Units_Default_array.Spearman_Damage;
_level[("Unit" + i) + "_Spearman"].speed = Units_Default_array.Spearman_Speed;
_level[("Unit" + i) + "_Spearman"].range = 30;
_level[("Unit" + i) + "_Spearman"].pop = 1;
_level[("Unit" + i) + "_Spearman"].counter = Spearman_array;
_level[("Unit" + i) + "_Spearman"].counterValue1 = Spearman_CV1;
_level[("Unit" + i) + "_Spearman"].counterValue2 = Spearman_CV2;
_level[("Unit" + i) + "_Spearman"].time = Units_Default_array.Spearman_Time;
_level[("Unit" + i) + "_Archer"] = new Array();
_level[("Unit" + i) + "_Archer"].health = Units_Default_array.Archer_Health;
_level[("Unit" + i) + "_Archer"].damage = Units_Default_array.Archer_Damage;
_level[("Unit" + i) + "_Archer"].speed = Units_Default_array.Archer_Speed;
_level[("Unit" + i) + "_Archer"].range = 200;
_level[("Unit" + i) + "_Archer"].pop = 1;
_level[("Unit" + i) + "_Archer"].counter = Archer_array;
_level[("Unit" + i) + "_Archer"].counterValue1 = Archer_CV1;
_level[("Unit" + i) + "_Archer"].counterValue2 = Archer_CV2;
_level[("Unit" + i) + "_Archer"].time = Units_Default_array.Archer_Time;
_level[("Unit" + i) + "_MountedSwordsman"] = new Array();
_level[("Unit" + i) + "_MountedSwordsman"].health = Units_Default_array.MountedSwordsman_Health;
_level[("Unit" + i) + "_MountedSwordsman"].damage = Units_Default_array.MountedSwordsman_Damage;
_level[("Unit" + i) + "_MountedSwordsman"].speed = Units_Default_array.MountedSwordsman_Speed;
_level[("Unit" + i) + "_MountedSwordsman"].range = 35;
_level[("Unit" + i) + "_MountedSwordsman"].pop = 2;
_level[("Unit" + i) + "_MountedSwordsman"].counter = MountedSwordsman_array;
_level[("Unit" + i) + "_MountedSwordsman"].counterValue1 = MountedSwordsman_CV1;
_level[("Unit" + i) + "_MountedSwordsman"].counterValue2 = MountedSwordsman_CV2;
_level[("Unit" + i) + "_MountedSwordsman"].time = Units_Default_array.MountedSwordsman_Time;
_level[("Unit" + i) + "_MountedArcher"] = new Array();
_level[("Unit" + i) + "_MountedArcher"].health = Units_Default_array.MountedArcher_Health;
_level[("Unit" + i) + "_MountedArcher"].damage = Units_Default_array.MountedArcher_Damage;
_level[("Unit" + i) + "_MountedArcher"].speed = Units_Default_array.MountedArcher_Speed;
_level[("Unit" + i) + "_MountedArcher"].range = 200;
_level[("Unit" + i) + "_MountedArcher"].pop = 2;
_level[("Unit" + i) + "_MountedArcher"].counter = MountedArcher_array;
_level[("Unit" + i) + "_MountedArcher"].counterValue1 = MountedArcher_CV1;
_level[("Unit" + i) + "_MountedArcher"].counterValue2 = MountedArcher_CV2;
_level[("Unit" + i) + "_MountedArcher"].time = Units_Default_array.MountedArcher_Time;
_level[("Unit" + i) + "_MachineGunner"] = new Array();
_level[("Unit" + i) + "_MachineGunner"].health = Units_Default_array.MachineGunner_Health;
_level[("Unit" + i) + "_MachineGunner"].damage = Units_Default_array.MachineGunner_Damage;
_level[("Unit" + i) + "_MachineGunner"].speed = Units_Default_array.MachineGunner_Speed;
_level[("Unit" + i) + "_MachineGunner"].range = 250;
_level[("Unit" + i) + "_MachineGunner"].pop = 1;
_level[("Unit" + i) + "_MachineGunner"].counter = MachineGunner_array;
_level[("Unit" + i) + "_MachineGunner"].counterValue1 = MachineGunner_CV1;
_level[("Unit" + i) + "_MachineGunner"].counterValue2 = MachineGunner_CV2;
_level[("Unit" + i) + "_MachineGunner"].time = Units_Default_array.MachineGunner_Time;
_level[("Unit" + i) + "_RPGTrooper"] = new Array();
_level[("Unit" + i) + "_RPGTrooper"].health = Units_Default_array.RPGTrooper_Health;
_level[("Unit" + i) + "_RPGTrooper"].damage = Units_Default_array.RPGTrooper_Damage;
_level[("Unit" + i) + "_RPGTrooper"].speed = Units_Default_array.RPGTrooper_Speed;
_level[("Unit" + i) + "_RPGTrooper"].range = 225;
_level[("Unit" + i) + "_RPGTrooper"].pop = 1;
_level[("Unit" + i) + "_RPGTrooper"].counter = RPGTrooper_array;
_level[("Unit" + i) + "_RPGTrooper"].counterValue1 = RPGTrooper_CV1;
_level[("Unit" + i) + "_RPGTrooper"].counterValue2 = RPGTrooper_CV2;
_level[("Unit" + i) + "_RPGTrooper"].time = Units_Default_array.RPGTrooper_Time;
_level[("Unit" + i) + "_Humvee"] = new Array();
_level[("Unit" + i) + "_Humvee"].health = Units_Default_array.Humvee_Health;
_level[("Unit" + i) + "_Humvee"].damage = Units_Default_array.Humvee_Damage;
_level[("Unit" + i) + "_Humvee"].speed = Units_Default_array.Humvee_Speed;
_level[("Unit" + i) + "_Humvee"].range = 250;
_level[("Unit" + i) + "_Humvee"].pop = 2;
_level[("Unit" + i) + "_Humvee"].counter = Humvee_array;
_level[("Unit" + i) + "_Humvee"].counterValue1 = Humvee_CV1;
_level[("Unit" + i) + "_Humvee"].counterValue2 = Humvee_CV2;
_level[("Unit" + i) + "_Humvee"].time = Units_Default_array.Humvee_Time;
_level[("Unit" + i) + "_LightTank"] = new Array();
_level[("Unit" + i) + "_LightTank"].health = Units_Default_array.LightTank_Health;
_level[("Unit" + i) + "_LightTank"].damage = Units_Default_array.LightTank_Damage;
_level[("Unit" + i) + "_LightTank"].speed = Units_Default_array.LightTank_Speed;
_level[("Unit" + i) + "_LightTank"].range = 200;
_level[("Unit" + i) + "_LightTank"].pop = 2;
_level[("Unit" + i) + "_LightTank"].counter = LightTank_array;
_level[("Unit" + i) + "_LightTank"].counterValue1 = LightTank_CV1;
_level[("Unit" + i) + "_LightTank"].counterValue2 = LightTank_CV2;
_level[("Unit" + i) + "_LightTank"].time = Units_Default_array.LightTank_Time;
_level[("Unit" + i) + "_HeavyTank"] = new Array();
_level[("Unit" + i) + "_HeavyTank"].health = Units_Default_array.HeavyTank_Health;
_level[("Unit" + i) + "_HeavyTank"].damage = Units_Default_array.HeavyTank_Damage;
_level[("Unit" + i) + "_HeavyTank"].speed = Units_Default_array.HeavyTank_Speed;
_level[("Unit" + i) + "_HeavyTank"].range = 210;
_level[("Unit" + i) + "_HeavyTank"].pop = 3;
_level[("Unit" + i) + "_HeavyTank"].counter = HeavyTank_array;
_level[("Unit" + i) + "_HeavyTank"].counterValue1 = HeavyTank_CV1;
_level[("Unit" + i) + "_HeavyTank"].counterValue2 = HeavyTank_CV2;
_level[("Unit" + i) + "_HeavyTank"].time = Units_Default_array.HeavyTank_Time;
_level[("Unit" + i) + "_Sniper"] = new Array();
_level[("Unit" + i) + "_Sniper"].health = Units_Default_array.Sniper_Health;
_level[("Unit" + i) + "_Sniper"].damage = Units_Default_array.Sniper_Damage;
_level[("Unit" + i) + "_Sniper"].speed = Units_Default_array.Sniper_Speed;
_level[("Unit" + i) + "_Sniper"].range = 325;
_level[("Unit" + i) + "_Sniper"].pop = 1;
_level[("Unit" + i) + "_Sniper"].counter = Sniper_array;
_level[("Unit" + i) + "_Sniper"].counterValue1 = Sniper_CV1;
_level[("Unit" + i) + "_Sniper"].counterValue2 = Sniper_CV2;
_level[("Unit" + i) + "_Sniper"].time = Units_Default_array.Sniper_Time;
_level[("Unit" + i) + "_LaserTrooper"] = new Array();
_level[("Unit" + i) + "_LaserTrooper"].health = Units_Default_array.LaserTrooper_Health;
_level[("Unit" + i) + "_LaserTrooper"].damage = Units_Default_array.LaserTrooper_Damage;
_level[("Unit" + i) + "_LaserTrooper"].speed = Units_Default_array.LaserTrooper_Speed;
_level[("Unit" + i) + "_LaserTrooper"].range = 230;
_level[("Unit" + i) + "_LaserTrooper"].pop = 2;
_level[("Unit" + i) + "_LaserTrooper"].counter = LaserTrooper_array;
_level[("Unit" + i) + "_LaserTrooper"].counterValue1 = LaserTrooper_CV1;
_level[("Unit" + i) + "_LaserTrooper"].counterValue2 = LaserTrooper_CV2;
_level[("Unit" + i) + "_LaserTrooper"].time = Units_Default_array.LaserTrooper_Time;
_level[("Unit" + i) + "_LaserTank"] = new Array();
_level[("Unit" + i) + "_LaserTank"].health = Units_Default_array.LaserTank_Health;
_level[("Unit" + i) + "_LaserTank"].damage = Units_Default_array.LaserTank_Damage;
_level[("Unit" + i) + "_LaserTank"].speed = Units_Default_array.LaserTank_Speed;
_level[("Unit" + i) + "_LaserTank"].range = 250;
_level[("Unit" + i) + "_LaserTank"].pop = 3;
_level[("Unit" + i) + "_LaserTank"].counter = LaserTank_array;
_level[("Unit" + i) + "_LaserTank"].counterValue1 = LaserTank_CV1;
_level[("Unit" + i) + "_LaserTank"].counterValue2 = LaserTank_CV2;
_level[("Unit" + i) + "_LaserTank"].time = Units_Default_array.LaserTank_Time;
_level[("UnitsOwned" + i) + "_array"] = new Array();
_level[("UnitsOwned" + i) + "_array"].Swordsman = 0;
_level[("UnitsOwned" + i) + "_array"].Spearman = 0;
_level[("UnitsOwned" + i) + "_array"].Archer = 0;
_level[("UnitsOwned" + i) + "_array"].MountedSwordsman = 0;
_level[("UnitsOwned" + i) + "_array"].MountedArcher = 0;
_level[("UnitsOwned" + i) + "_array"].MachineGunner = 0;
_level[("UnitsOwned" + i) + "_array"].RPGTrooper = 0;
_level[("UnitsOwned" + i) + "_array"].Humvee = 0;
_level[("UnitsOwned" + i) + "_array"].LightTank = 0;
_level[("UnitsOwned" + i) + "_array"].HeavyTank = 0;
_level[("UnitsOwned" + i) + "_array"].Sniper = 0;
_level[("UnitsOwned" + i) + "_array"].LaserTrooper = 0;
_level[("UnitsOwned" + i) + "_array"].LaserTank = 0;
i++;
}
Buildings_Stats = new Array();
Buildings1_array = new Array();
Buildings2_array = new Array();
i = 1;
while (i <= 2) {
Buildings_Stats[("TC_Keep" + i) + "_health"] = 2000;
Buildings_Stats[("BuildingFoundation" + i) + "_health"] = 250;
Buildings_Stats[("Teir1_Armoury" + i) + "_health"] = 800;
Buildings_Stats[("Teir1_Barracks" + i) + "_health"] = 1000;
Buildings_Stats[("Teir1_Farm" + i) + "_health"] = 600;
Buildings_Stats[("Teir1_LumberMill" + i) + "_health"] = 600;
Buildings_Stats[("Teir1_Mine" + i) + "_health"] = 600;
Buildings_Stats[("Teir1_Stables" + i) + "_health"] = 1000;
Buildings_Stats[("Teir2_Barracks" + i) + "_health"] = 1400;
Buildings_Stats[("Teir2_ResearchLab" + i) + "_health"] = 1200;
Buildings_Stats[("Teir2_WarFactory" + i) + "_health"] = 1400;
Buildings_Stats[("Teir3_CommandPost" + i) + "_health"] = 1200;
Buildings_Stats[("Teir3_TechCenter" + i) + "_health"] = 1200;
_level[("Buildings" + i) + "_array"].TC_Keep = 0;
_level[("Buildings" + i) + "_array"].BuildingFoundation = 0;
_level[("Buildings" + i) + "_array"].Teir1_Armoury = 0;
_level[("Buildings" + i) + "_array"].Teir1_Barracks = 0;
_level[("Buildings" + i) + "_array"].Teir1_Farm = 0;
_level[("Buildings" + i) + "_array"].Teir1_LumberMill = 0;
_level[("Buildings" + i) + "_array"].Teir1_Mine = 0;
_level[("Buildings" + i) + "_array"].Teir1_Stables = 0;
_level[("Buildings" + i) + "_array"].Teir2_Barracks = 0;
_level[("Buildings" + i) + "_array"].Teir2_ResearchLab = 0;
_level[("Buildings" + i) + "_array"].Teir2_WarFactory = 0;
_level[("Buildings" + i) + "_array"].Teir3_CommandPost = 0;
_level[("Buildings" + i) + "_array"].Teir3_TechCenter = 0;
i++;
}
delete i;
C_LE_D = 900;
C_LE_Dmin = 900;
C_LE_Dmax = 925;
C_LE_D2 = 500;
C_LE_D2min = 500;
C_LE_D2max = 799;
C_LE_D3 = 800;
C_LE_D3min = 800;
C_LE_D3max = 899;
_root.ArrowScrollAmount = 20;
_root.ControlKey = false;
_root.ShiftKey = false;
_root.DTK = 0;
_root.DTKV = "";
_root.PauseGame = false;
_root.UserAction = "None";
_root.UserPassiveAction = "None";
_root.UnitSelected = false;
_root.TotalBuildings = 0;
_root.TotalUnits = 0;
gotoAndStop ("Game");
Symbol 8 MovieClip Frame 1
percent_txt.text = Math.round((_root.getBytesLoaded() / 113215) * 100) + "%";
Symbol 18 Button
on (release) {
getURL ("http://www.godlygamer.com/", "_blank");
}
Symbol 21 Button
on (release) {
getURL ("http://www.maxgames.com/", "_blank");
}
Symbol 25 Button
on (release) {
getURL ("http://www.maxgames.com/", "_blank");
}
Symbol 29 Button
on (release) {
getURL ("http://www.godlygamer.com/", "_blank");
}
Symbol 33 MovieClip Frame 1
function Preloader() {
DisplayLoad_txt.text = ((((((("Loaded " + _root.kbloaded) + " of ") + _root.kbtotal) + " kb at ") + _root.averagekbs) + " kb/s.\nEstimated Time Remaining: ") + _root.remainingtime) + " Seconds.";
_root.kbloaded = Math.round(_root.getBytesLoaded() / 1024);
_root.kbtotal = Math.round(_root.getBytesTotal() / 1024);
_root.PreviewPercent = Math.round((_root.kbloaded / _root.kbtotal) * 100);
if (_root._framesloaded >= _root._totalframes) {
clearInterval(SetMyEstimations);
clearInterval(SetMyPreloader);
gotoAndStop ("continue");
}
}
function Estimations() {
_root.averagekbs = Math.round(_root.kbloaded - _root.averagekbcount);
_root.averagekbcount = _root.kbloaded;
_root.remainingtime = Math.round((_root.kbtotal - _root.kbloaded) / _root.averagekbs);
}
stop();
var remainingtime = 0;
var averagekbs = 0;
var averagekbcount = 0;
var averagetimer = 0;
SetMyPreloader = setInterval(Preloader, 25);
SetMyEstimations = setInterval(Estimations, 1000);
Symbol 33 MovieClip Frame 2
continue_btn.onRelease = function () {
delete _root.kbloaded;
delete _root.kbtotal;
delete _root.PreviewPercent;
delete _root.averagekbs;
delete _root.averagekbcount;
delete _root.remainingtime;
_root.gotoAndStop("LoadLibrary");
};
Symbol 38 MovieClip Frame 1
if (_root.PauseGame == false) {
_parent.nextFrame();
} else {
_parent.stop();
}
Symbol 38 MovieClip Frame 2
gotoAndPlay (1);
Symbol 43 MovieClip [AirstrikeAnimation] Frame 21
this.removeMovieClip();
Symbol 51 MovieClip [MissileAnimation] Frame 21
this.removeMovieClip();
Symbol 63 MovieClip Frame 1
gotoAndStop (2);
Symbol 66 MovieClip [BFP] Frame 1
stop();
place_btn.useHandCursor = false;
place_btn.onPress = function () {
ActivatePlacement = true;
};
Symbol 66 MovieClip [BFP] Frame 2
stop();
Symbol 77 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 83 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 95 MovieClip [GoToLocation] Frame 20
this.removeMovieClip();
Symbol 104 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 104 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 126 MovieClip Frame 32
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 127 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 1
if (_parent.repair == true) {
if (_parent.Ownership == 1) {
if (((((_root.User_Food >= _root.Costs_array.Misc_Repair_Food) && (_root.User_Gold >= _root.Costs_array.Misc_Repair_Gold)) && (_root.User_Stone >= _root.Costs_array.Misc_Repair_Stone)) && (_root.User_Wood >= _root.Costs_array.Misc_Repair_Wood)) && (_parent.health < _parent.healthMax)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Misc_Repair_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Misc_Repair_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Misc_Repair_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Misc_Repair_Wood;
_parent.health = _parent.health + _root.User_Repair;
if (_parent.health > _parent.healthMax) {
_parent.health = _parent.healthMax;
}
gotoAndPlay ("repair");
} else {
_parent.repair = false;
}
} else if (_parent.health < _parent.healthMax) {
_parent.health = _parent.health + _root.Comp_Repair;
if (_parent.health > _parent.healthMax) {
_parent.health = _parent.healthMax;
}
gotoAndPlay ("repair");
}
}
Symbol 130 MovieClip Frame 2
gotoAndPlay (1);
Symbol 130 MovieClip Frame 32
gotoAndPlay (1);
Symbol 134 MovieClip Frame 1
if (_root.User_DisplayBuildingHealth == true) {
GoTo = Math.round((_parent._parent.health / _parent._parent.healthMax) * 100);
_parent.gotoAndStop(GoTo);
if (isNaN(GoTo) || (GoTo <= 0)) {
_parent.gotoAndStop(1);
}
} else {
_parent.gotoAndStop("blank");
}
Symbol 134 MovieClip Frame 2
gotoAndPlay (1);
Symbol 144 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 144 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 169 MovieClip Frame 25
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 170 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.Ownership == 1) {
if ((_parent.production[0] == "Armoury_A1") && (_root.Armoury_A_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_A1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_A1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_A1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_A1_Wood;
}
if ((_parent.production[0] == "Armoury_A2") && (_root.Armoury_A_1 >= 2)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_A2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_A2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_A2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_A2_Wood;
}
if ((_parent.production[0] == "Armoury_A3") && (_root.Armoury_A_1 >= 3)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_A3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_A3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_A3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_A3_Wood;
}
if ((_parent.production[0] == "Armoury_B1") && (_root.Armoury_B_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_B1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_B1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_B1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_B1_Wood;
}
if ((_parent.production[0] == "Armoury_B2") && (_root.Armoury_B_1 >= 2)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_B2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_B2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_B2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_B2_Wood;
}
if ((_parent.production[0] == "Armoury_B3") && (_root.Armoury_B_1 >= 3)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_B3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_B3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_B3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_B3_Wood;
}
if ((_parent.production[0] == "Armoury_C1") && (_root.Armoury_C_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_C1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_C1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_C1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_C1_Wood;
}
if ((_parent.production[0] == "Armoury_C2") && (_root.Armoury_C_1 >= 2)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_C2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_C2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_C2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_C2_Wood;
}
if ((_parent.production[0] == "Armoury_C3") && (_root.Armoury_C_1 >= 3)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_C3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_C3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_C3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_C3_Wood;
}
if ((_parent.production[0] == "Armoury_D1") && (_root.Armoury_D_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_D1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_D1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_D1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_D1_Wood;
}
if ((_parent.production[0] == "Armoury_D2") && (_root.Armoury_D_1 >= 2)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_D2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_D2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_D2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_D2_Wood;
}
if ((_parent.production[0] == "Armoury_D3") && (_root.Armoury_D_1 >= 3)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_D3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_D3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_D3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_D3_Wood;
}
if (_parent.training != _parent.production[0]) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.training = "None";
}
if (_parent.timerCount > 0) {
_parent.timerCount--;
}
if (((_parent.timerCount <= 0) && (_parent.timerSet != 0)) && (_parent.training != "None")) {
if (_parent.production[0] == "Armoury_A1") {
_root.Armoury_A_1 = 1;
_root.Unit1_Swordsman.damage = _root.Units_Default_array.Swordsman_Damage * 1.25;
_root.Unit1_Spearman.damage = _root.Units_Default_array.Spearman_Damage * 1.25;
_root.Unit1_MountedSwordsman.damage = _root.Units_Default_array.MountedSwordsman_Damage * 1.25;
}
if (_parent.production[0] == "Armoury_A2") {
_root.Armoury_A_1 = 2;
_root.Unit1_Swordsman.damage = _root.Units_Default_array.Swordsman_Damage * 1.5;
_root.Unit1_Spearman.damage = _root.Units_Default_array.Spearman_Damage * 1.5;
_root.Unit1_MountedSwordsman.damage = _root.Units_Default_array.MountedSwordsman_Damage * 1.5;
}
if (_parent.production[0] == "Armoury_A3") {
_root.Armoury_A_1 = 3;
_root.Unit1_Swordsman.damage = _root.Units_Default_array.Swordsman_Damage * 1.75;
_root.Unit1_Spearman.damage = _root.Units_Default_array.Spearman_Damage * 1.75;
_root.Unit1_MountedSwordsman.damage = _root.Units_Default_array.MountedSwordsman_Damage * 1.75;
}
if (_parent.production[0] == "Armoury_B1") {
_root.Armoury_B_1 = 1;
_root.Unit1_Archer.damage = _root.Units_Default_array.Archer_Damage * 1.25;
_root.Unit1_MountedArcher.damage = _root.Units_Default_array.MountedArcher_Damage * 1.25;
}
if (_parent.production[0] == "Armoury_B2") {
_root.Armoury_B_1 = 2;
_root.Unit1_Archer.damage = _root.Units_Default_array.Archer_Damage * 1.5;
_root.Unit1_MountedArcher.damage = _root.Units_Default_array.MountedArcher_Damage * 1.5;
}
if (_parent.production[0] == "Armoury_B3") {
_root.Armoury_B_1 = 3;
_root.Unit1_Archer.damage = _root.Units_Default_array.Archer_Damage * 1.75;
_root.Unit1_MountedArcher.damage = _root.Units_Default_array.MountedArcher_Damage * 1.75;
}
if (_parent.production[0] == "Armoury_C1") {
_root.Armoury_C_1 = 1;
_root.Unit1_Swordsman.health = _root.Units_Default_array.Swordsman_Health * 1.2;
_root.Unit1_Spearman.health = _root.Units_Default_array.Spearman_Health * 1.2;
_root.Unit1_Archer.health = _root.Units_Default_array.Archer_Health * 1.2;
_root.Unit1_MountedSwordsman.health = _root.Units_Default_array.MountedSwordsman_Health * 1.2;
_root.Unit1_MountedArcher.health = _root.Units_Default_array.MountedArcher_Health * 1.2;
}
if (_parent.production[0] == "Armoury_C2") {
_root.Armoury_C_1 = 2;
_root.Unit1_Swordsman.health = _root.Units_Default_array.Swordsman_Health * 1.4;
_root.Unit1_Spearman.health = _root.Units_Default_array.Spearman_Health * 1.4;
_root.Unit1_Archer.health = _root.Units_Default_array.Archer_Health * 1.4;
_root.Unit1_MountedSwordsman.health = _root.Units_Default_array.MountedSwordsman_Health * 1.4;
_root.Unit1_MountedArcher.health = _root.Units_Default_array.MountedArcher_Health * 1.4;
}
if (_parent.production[0] == "Armoury_C3") {
_root.Armoury_C_1 = 3;
_root.Unit1_Swordsman.health = _root.Units_Default_array.Swordsman_Health * 1.8;
_root.Unit1_Spearman.health = _root.Units_Default_array.Spearman_Health * 1.8;
_root.Unit1_Archer.health = _root.Units_Default_array.Archer_Health * 1.8;
_root.Unit1_MountedSwordsman.health = _root.Units_Default_array.MountedSwordsman_Health * 1.8;
_root.Unit1_MountedArcher.health = _root.Units_Default_array.MountedArcher_Health * 1.8;
}
if (_parent.production[0] == "Armoury_D1") {
_root.Armoury_D_1 = 1;
_root.Unit1_Swordsman.time = _root.Units_Default_array.Swordsman_Time * 0.9;
_root.Unit1_Spearman.time = _root.Units_Default_array.Spearman_Time * 0.9;
_root.Unit1_Archer.time = _root.Units_Default_array.Archer_Time * 0.9;
_root.Unit1_MountedSwordsman.time = _root.Units_Default_array.MountedSwordsman_Time * 0.9;
_root.Unit1_MountedArcher.time = _root.Units_Default_array.MountedArcher_Time * 0.9;
}
if (_parent.production[0] == "Armoury_D2") {
_root.Armoury_D_1 = 2;
_root.Unit1_Swordsman.time = _root.Units_Default_array.Swordsman_Time * 0.6;
_root.Unit1_Spearman.time = _root.Units_Default_array.Spearman_Time * 0.6;
_root.Unit1_Archer.time = _root.Units_Default_array.Archer_Time * 0.6;
_root.Unit1_MountedSwordsman.time = _root.Units_Default_array.MountedSwordsman_Time * 0.6;
_root.Unit1_MountedArcher.time = _root.Units_Default_array.MountedArcher_Time * 0.6;
}
if (_parent.production[0] == "Armoury_D3") {
_root.Armoury_D_1 = 3;
_root.Unit1_Swordsman.time = _root.Units_Default_array.Swordsman_Time * 0.3;
_root.Unit1_Spearman.time = _root.Units_Default_array.Spearman_Time * 0.3;
_root.Unit1_Archer.time = _root.Units_Default_array.Archer_Time * 0.3;
_root.Unit1_MountedSwordsman.time = _root.Units_Default_array.MountedSwordsman_Time * 0.3;
_root.Unit1_MountedArcher.time = _root.Units_Default_array.MountedArcher_Time * 0.3;
}
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.production[0] = "None";
_parent.training = _parent.production[0];
}
if (((_parent.timerCount == 0) && (_parent.timerSet == 0)) && (_parent.production[0] != "None")) {
_parent.timerSet = _root.Research_Time[_parent.production[0]];
_parent.timerCount = _parent.timerSet;
_parent.training = _parent.production[0];
}
ii = 0;
while (ii < 7) {
if ((_parent.production[ii] == "None") && (_parent.production[ii + 1] != "None")) {
i = ii;
while (i < 7) {
_parent.production[i] = _parent.production[i + 1];
i++;
}
_parent.production[7] = "None";
}
ii++;
}
}
}
Symbol 171 MovieClip Frame 2
gotoAndPlay (1);
Symbol 176 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 176 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 209 MovieClip Frame 25
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 210 MovieClip Frame 1
stop();
Symbol 211 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.Ownership == 1) {
if (_parent.training != _parent.production[0]) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.training = "None";
}
if (_parent.timerCount > 0) {
_parent.timerCount--;
}
if (((_parent.timerCount <= 0) && (_parent.timerSet != 0)) && (_parent.training != "None")) {
if ((_root.User_Pop + _root["Unit1_" + _parent.production[0]].pop) <= _root.User_PopCap) {
if (TrainUnit(_parent.training) == true) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.production[0] = "None";
_parent.training = _parent.production[0];
} else {
timerCount = 1;
}
} else {
timerCount = 1;
}
}
if (((_parent.timerCount == 0) && (_parent.timerSet == 0)) && (_parent.production[0] != "None")) {
_parent.timerSet = _root["Unit1_" + _parent.production[0]].time;
_parent.timerCount = _parent.timerSet;
_parent.training = _parent.production[0];
}
ii = 0;
while (ii < 7) {
if ((_parent.production[ii] == "None") && (_parent.production[ii + 1] != "None")) {
i = ii;
while (i < 7) {
_parent.production[i] = _parent.production[i + 1];
i++;
}
_parent.production[7] = "None";
}
ii++;
}
}
}
function TrainUnit(TrainType) {
if (_root.CheckDepths(this._parent._x - 35, this._parent._y + 35) == false) {
NewUnit = _root.CreateUnit(TrainType, TrainType, this._parent._x - 35, this._parent._y + 35, 1, false);
if (_parent.PlacePosition == 1) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 35;
_parent.PlacePosition = 2;
} else if (_parent.PlacePosition == 2) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 3;
} else if (_parent.PlacePosition == 3) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 35;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 4;
} else if (_parent.PlacePosition == 4) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 5;
} else if (_parent.PlacePosition == 5) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 35;
_parent.PlacePosition = 1;
}
return(true);
}
return(false);
}
Symbol 211 MovieClip Frame 2
gotoAndPlay (1);
Symbol 216 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 216 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 232 MovieClip Frame 20
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 233 MovieClip Frame 1
stop();
Symbol 234 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.ProduceTimer > 0) {
_parent.ProduceTimer--;
}
if (_parent.ProduceTimer <= 0) {
GrantFood = _root[("Produce_Farm" + _parent.Ownership) + "D"] + (_root[("Produce_Farm" + _parent.Ownership) + "B"] * _parent.Workers);
_parent.FoodProduced = _parent.FoodProduced + GrantFood;
if (_parent.Ownership == 1) {
_root.User_Food = _root.User_Food + GrantFood;
_root.MatchVars_array.resourcesCollected = _root.MatchVars_array.resourcesCollected + GrantFood;
} else {
_root.Comp_Food = _root.Comp_Food + GrantFood;
}
_parent.ProduceSet = _root["Produce_Farm" + _parent.Ownership];
_parent.ProduceTimer = _parent.ProduceSet;
}
}
Symbol 234 MovieClip Frame 2
gotoAndPlay (1);
Symbol 239 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 239 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 259 MovieClip Frame 20
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 260 MovieClip Frame 1
stop();
Symbol 261 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.ProduceTimer > 0) {
_parent.ProduceTimer--;
}
if (_parent.ProduceTimer <= 0) {
GrantWood = _root[("Produce_Mill" + _parent.Ownership) + "D"] + (_root[("Produce_Mill" + _parent.Ownership) + "B"] * _parent.Workers);
_parent.WoodProduced = _parent.WoodProduced + GrantWood;
if (_parent.Ownership == 1) {
_root.User_Wood = _root.User_Wood + GrantWood;
_root.MatchVars_array.resourcesCollected = _root.MatchVars_array.resourcesCollected + GrantWood;
} else {
_root.Comp_Wood = _root.Comp_Wood + GrantWood;
}
_parent.ProduceSet = _root["Produce_Mill" + _parent.Ownership];
_parent.ProduceTimer = _parent.ProduceSet;
}
}
Symbol 261 MovieClip Frame 2
gotoAndPlay (1);
Symbol 266 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 266 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 285 MovieClip Frame 20
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 286 MovieClip Frame 1
stop();
Symbol 287 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.ProduceTimer > 0) {
_parent.ProduceTimer--;
}
if (_parent.ProduceTimer <= 0) {
GrantGold = _root[("Produce_Mine" + _parent.Ownership) + "D1"] + (_root[("Produce_Mine" + _parent.Ownership) + "B1"] * _parent.Workers);
_parent.GoldProduced = _parent.GoldProduced + GrantGold;
if (_parent.Ownership == 1) {
_root.User_Gold = _root.User_Gold + GrantGold;
_root.MatchVars_array.resourcesCollected = _root.MatchVars_array.resourcesCollected + GrantGold;
} else {
_root.Comp_Gold = _root.Comp_Gold + GrantGold;
}
GrantStone = _root[("Produce_Mine" + _parent.Ownership) + "D2"] + (_root[("Produce_Mine" + _parent.Ownership) + "B2"] * _parent.Workers);
_parent.StoneProduced = _parent.StoneProduced + GrantStone;
if (_parent.Ownership == 1) {
_root.User_Stone = _root.User_Stone + GrantStone;
_root.MatchVars_array.resourcesCollected = _root.MatchVars_array.resourcesCollected + GrantStone;
} else {
_root.Comp_Stone = _root.Comp_Stone + GrantStone;
}
_parent.ProduceSet = _root["Produce_Mine" + _parent.Ownership];
_parent.ProduceTimer = _parent.ProduceSet;
}
}
Symbol 287 MovieClip Frame 2
gotoAndPlay (1);
Symbol 292 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 292 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 312 MovieClip Frame 20
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 313 MovieClip Frame 1
stop();
Symbol 314 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.Ownership == 1) {
if (_parent.training != _parent.production[0]) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.training = "None";
}
if (_parent.timerCount > 0) {
_parent.timerCount--;
}
if (((_parent.timerCount <= 0) && (_parent.timerSet != 0)) && (_parent.training != "None")) {
if ((_root.User_Pop + _root["Unit1_" + _parent.production[0]].pop) <= _root.User_PopCap) {
if (TrainUnit(_parent.training) == true) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.production[0] = "None";
_parent.training = _parent.production[0];
} else {
timerCount = 1;
}
} else {
timerCount = 1;
}
}
if (((_parent.timerCount == 0) && (_parent.timerSet == 0)) && (_parent.production[0] != "None")) {
_parent.timerSet = _root["Unit1_" + _parent.production[0]].time;
_parent.timerCount = _parent.timerSet;
_parent.training = _parent.production[0];
}
ii = 0;
while (ii < 7) {
if ((_parent.production[ii] == "None") && (_parent.production[ii + 1] != "None")) {
i = ii;
while (i < 7) {
_parent.production[i] = _parent.production[i + 1];
i++;
}
_parent.production[7] = "None";
}
ii++;
}
}
}
function TrainUnit(TrainType) {
if (_root.CheckDepths(this._parent._x - 35, this._parent._y + 35) == false) {
NewUnit = _root.CreateUnit(TrainType, TrainType, this._parent._x - 35, this._parent._y + 35, 1, false);
if (_parent.PlacePosition == 1) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 35;
_parent.PlacePosition = 2;
} else if (_parent.PlacePosition == 2) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 3;
} else if (_parent.PlacePosition == 3) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 35;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 4;
} else if (_parent.PlacePosition == 4) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 5;
} else if (_parent.PlacePosition == 5) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 35;
_parent.PlacePosition = 1;
}
return(true);
}
return(false);
}
Symbol 314 MovieClip Frame 2
gotoAndPlay (1);
Symbol 317 MovieClip [BuildingFoundation] Frame 1
stop();
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "Construction";
_root.construction_mc.BuildingNumber = BuildingNumber;
_root.construction_mc.BuildingX = this._parent._x;
_root.construction_mc.BuildingY = this._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 317 MovieClip [BuildingFoundation] Frame 15
stop();
_root.RemoveBuilding(BuildingNumber, MyDepth);
Symbol 335 MovieClip [MissileHit] Frame 20
_root.sounds_mc.CreateSound("Power_", "MissileImpact", 100, 0, true);
Symbol 335 MovieClip [MissileHit] Frame 30
_root[Player + "_MissileLaunch"] = "Damage";
Symbol 335 MovieClip [MissileHit] Frame 50
_root[Player + "_MissileLaunch"] = "None";
this.removeMovieClip();
Symbol 353 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 355 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 356 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 356 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 356 MovieClip Frame 20
_parent._parent.AttackDamageActive = true;
_parent._parent.CreateSoundEffect = true;
Symbol 356 MovieClip Frame 40
gotoAndStop (1);
Symbol 357 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 361 MovieClip Frame 1
this._parent._rotation = -_parent._parent._rotation;
if (_root.User_DisplayEnemyHealth == true) {
GoTo = Math.round((_parent._parent.health / _parent._parent.healthMax) * 100);
_parent.gotoAndStop(GoTo);
if (isNaN(GoTo) || (GoTo <= 0)) {
_parent.gotoAndStop(1);
}
} else {
_parent.gotoAndStop("blank");
}
Symbol 361 MovieClip Frame 2
gotoAndPlay (1);
Symbol 366 MovieClip Frame 1
GoTo = Math.round((_parent._parent._parent.health / _parent._parent._parent.healthMax) * 100);
_parent.gotoAndStop(GoTo);
if (isNaN(GoTo) || (GoTo <= 0)) {
_parent.gotoAndStop(1);
}
Symbol 366 MovieClip Frame 2
gotoAndPlay (1);
Symbol 368 MovieClip Frame 1
this._rotation = -_parent._rotation;
Symbol 368 MovieClip Frame 2
gotoAndPlay (1);
Symbol 369 MovieClip [Spearman] Frame 1
stop();
Symbol 383 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 385 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 386 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 386 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 386 MovieClip Frame 15
_parent._parent.AttackDamageActive = true;
_parent._parent.CreateSoundEffect = true;
Symbol 386 MovieClip Frame 30
gotoAndStop (1);
Symbol 387 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 389 MovieClip [Swordsman] Frame 1
stop();
Symbol 404 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 443 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 470 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 470 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 470 MovieClip Frame 20
myPoint = {x:10.5, y:0};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Arrow", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y);
_parent._parent.AttackDamageActive = true;
_parent._parent.CreateSoundEffect = true;
Symbol 470 MovieClip Frame 40
gotoAndStop (1);
Symbol 471 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 473 MovieClip [Archer] Frame 1
stop();
Symbol 499 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 501 MovieClip Frame 41
gotoAndPlay ("start");
Symbol 502 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 502 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 502 MovieClip Frame 15
_parent._parent.AttackDamageActive = true;
_parent._parent.CreateSoundEffect = true;
Symbol 502 MovieClip Frame 30
gotoAndStop (1);
Symbol 503 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 505 MovieClip [MountedSwordsman] Frame 1
stop();
Symbol 526 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 529 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 541 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 541 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 541 MovieClip Frame 20
myPoint = {x:14, y:0};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Arrow", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y);
_parent._parent.AttackDamageActive = true;
_parent._parent.CreateSoundEffect = true;
Symbol 541 MovieClip Frame 40
gotoAndStop (1);
Symbol 542 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 544 MovieClip [MountedArcher] Frame 1
stop();
Symbol 548 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 548 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 564 MovieClip Frame 22
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 565 MovieClip Frame 1
stop();
Symbol 566 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.Ownership == 1) {
if (_parent.training != _parent.production[0]) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.training = "None";
}
if (_parent.timerCount > 0) {
_parent.timerCount--;
}
if (((_parent.timerCount <= 0) && (_parent.timerSet != 0)) && (_parent.training != "None")) {
if ((_root.User_Pop + _root["Unit1_" + _parent.production[0]].pop) <= _root.User_PopCap) {
if (TrainUnit(_parent.training) == true) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.production[0] = "None";
_parent.training = _parent.production[0];
} else {
timerCount = 1;
}
} else {
timerCount = 1;
}
}
if (((_parent.timerCount == 0) && (_parent.timerSet == 0)) && (_parent.production[0] != "None")) {
_parent.timerSet = _root["Unit1_" + _parent.production[0]].time;
_parent.timerCount = _parent.timerSet;
_parent.training = _parent.production[0];
}
ii = 0;
while (ii < 7) {
if ((_parent.production[ii] == "None") && (_parent.production[ii + 1] != "None")) {
i = ii;
while (i < 7) {
_parent.production[i] = _parent.production[i + 1];
i++;
}
_parent.production[7] = "None";
}
ii++;
}
}
}
function TrainUnit(TrainType) {
if (_root.CheckDepths(this._parent._x - 35, this._parent._y + 35) == false) {
NewUnit = _root.CreateUnit(TrainType, TrainType, this._parent._x - 35, this._parent._y + 35, 1, false);
if (_parent.PlacePosition == 1) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 35;
_parent.PlacePosition = 2;
} else if (_parent.PlacePosition == 2) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 3;
} else if (_parent.PlacePosition == 3) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 35;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 4;
} else if (_parent.PlacePosition == 4) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 5;
} else if (_parent.PlacePosition == 5) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 35;
_parent.PlacePosition = 1;
}
return(true);
}
return(false);
}
Symbol 566 MovieClip Frame 2
gotoAndPlay (1);
Symbol 571 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 571 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 594 MovieClip Frame 25
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 595 MovieClip Frame 1
stop();
Symbol 597 MovieClip Frame 1
if (_parent.Ownership == 1) {
if (_root.User_MissileLaunch == "Launch") {
_root.User_MissileLaunch = "Start";
_parent.MissileLaunch = true;
gotoAndPlay ("launch");
}
}
if (_parent.Ownership == 2) {
if (_root.Comp_MissileLaunch == "Launch") {
_root.Comp_MissileLaunch = "Start";
_parent.MissileLaunch = true;
gotoAndPlay ("launch");
}
}
Symbol 597 MovieClip Frame 2
gotoAndPlay (1);
Symbol 597 MovieClip Frame 123
if (_parent.Ownership == 1) {
_root.User_MissileLaunch = "End";
_parent.MissileLaunch = false;
}
if (_parent.Ownership == 2) {
_root.Comp_MissileLaunch = "End";
_parent.MissileLaunch = false;
}
gotoAndPlay (1);
Symbol 598 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.Ownership == 1) {
if ((_parent.production[0] == "ResearchLab_A1") && (_root.ResearchLab_A_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_A1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_A1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_A1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_A1_Wood;
}
if ((_parent.production[0] == "ResearchLab_B1") && (_root.ResearchLab_B_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_B1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_B1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_B1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_B1_Wood;
}
if ((_parent.production[0] == "ResearchLab_C1") && (_root.ResearchLab_C_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_C1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_C1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_C1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_C1_Wood;
}
if ((_parent.production[0] == "ResearchLab_D1") && (_root.ResearchLab_D_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_D1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_D1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_D1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_D1_Wood;
}
if ((_parent.production[0] == "ResearchLab_E1") && (_root.ResearchLab_E_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_E1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_E1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_E1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_E1_Wood;
}
if ((_parent.production[0] == "ResearchLab_F1") && (_root.ResearchLab_F_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_F1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_F1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_F1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_F1_Wood;
}
if ((_parent.production[0] == "ResearchLab_G1") && (_root.ResearchLab_G_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_G1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_G1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_G1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_G1_Wood;
}
if ((_parent.production[0] == "ResearchLab_H1") && (_root.ResearchLab_H_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_H1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_H1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_H1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_H1_Wood;
}
if ((_parent.production[0] == "ResearchLab_I1") && (_root.ResearchLab_I_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_I1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_I1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_I1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_I1_Wood;
}
if ((_parent.production[0] == "ResearchLab_I2") && (_root.ResearchLab_I_1 >= 2)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_I2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_I2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_I2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_I2_Wood;
}
if ((_parent.production[0] == "ResearchLab_I3") && (_root.ResearchLab_I_1 >= 3)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_I3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_I3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_I3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_I3_Wood;
}
if ((_parent.production[0] == "ResearchLab_J1") && (_root.ResearchLab_J_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_J1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_J1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_J1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_J1_Wood;
}
if ((_parent.production[0] == "ResearchLab_J2") && (_root.ResearchLab_J_1 >= 2)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_J2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_J2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_J2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_J2_Wood;
}
if ((_parent.production[0] == "ResearchLab_J3") && (_root.ResearchLab_J_1 >= 3)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_J3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_J3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_J3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_J3_Wood;
}
if ((_parent.production[0] == "ResearchLab_K1") && (_root.ResearchLab_K_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_K1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_K1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_K1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_K1_Wood;
}
if ((_parent.production[0] == "ResearchLab_K2") && (_root.ResearchLab_K_1 >= 2)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_K2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_K2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_K2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_K2_Wood;
}
if ((_parent.production[0] == "ResearchLab_K3") && (_root.ResearchLab_K_1 >= 3)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_K3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_K3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_K3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_K3_Wood;
}
if ((_parent.production[0] == "ResearchLab_L1") && (_root.ResearchLab_L_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_L1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_L1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_L1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_L1_Wood;
}
if ((_parent.production[0] == "ResearchLab_L2") && (_root.ResearchLab_L_1 >= 2)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_L2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_L2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_L2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_L2_Wood;
}
if ((_parent.production[0] == "ResearchLab_L3") && (_root.ResearchLab_L_1 >= 3)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_L3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_L3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_L3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_L3_Wood;
}
if (_parent.training != _parent.production[0]) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.training = "None";
}
if (_parent.timerCount > 0) {
_parent.timerCount--;
}
if (((_parent.timerCount <= 0) && (_parent.timerSet != 0)) && (_parent.training != "None")) {
if (_parent.production[0] == "ResearchLab_A1") {
_root.ResearchLab_A_1 = 1;
_root.Unit1_MachineGunner.health = _root.Units_Default_array.MachineGunner_Health * 1.75;
_root.Unit1_RPGTrooper.health = _root.Units_Default_array.RPGTrooper_Health * 1.75;
_root.Unit1_Sniper.health = _root.Units_Default_array.Sniper_Health * 1.75;
_root.Unit1_LaserTrooper.health = _root.Units_Default_array.LaserTrooper_Health * 1.75;
}
if (_parent.production[0] == "ResearchLab_B1") {
_root.ResearchLab_B_1 = 1;
_root.Unit1_Humvee.health = _root.Units_Default_array.Humvee_Health * 1.5;
_root.Unit1_LightTank.health = _root.Units_Default_array.LightTank_Health * 1.5;
_root.Unit1_HeavyTank.health = _root.Units_Default_array.HeavyTank_Health * 1.5;
_root.Unit1_LaserTank.health = _root.Units_Default_array.LaserTank_Health * 1.5;
}
if (_parent.production[0] == "ResearchLab_C1") {
_root.ResearchLab_C_1 = 1;
_root.Unit1_MachineGunner.speed = _root.Units_Default_array.MachineGunner_Speed * 1.1;
_root.Unit1_RPGTrooper.speed = _root.Units_Default_array.RPGTrooper_Speed * 1.1;
_root.Unit1_Sniper.speed = _root.Units_Default_array.Sniper_Speed * 1.1;
_root.Unit1_LaserTrooper.speed = _root.Units_Default_array.LaserTrooper_Speed * 1.1;
}
if (_parent.production[0] == "ResearchLab_D1") {
_root.ResearchLab_D_1 = 1;
_root.Unit1_Humvee.speed = _root.Units_Default_array.Humvee_Speed * 1.15;
_root.Unit1_LightTank.speed = _root.Units_Default_array.LightTank_Speed * 1.15;
_root.Unit1_HeavyTank.speed = _root.Units_Default_array.HeavyTank_Speed * 1.15;
_root.Unit1_LaserTank.speed = _root.Units_Default_array.LaserTank_Speed * 1.15;
}
if (_parent.production[0] == "ResearchLab_E1") {
_root.ResearchLab_E_1 = 1;
_root.Unit1_MachineGunner.damage = _root.Units_Default_array.MachineGunner_Damage * 1.33;
_root.Unit1_Humvee.damage = _root.Units_Default_array.Humvee_Damage * 1.33;
_root.Unit1_Sniper.damage = _root.Units_Default_array.Sniper_Damage * 1.33;
}
if (_parent.production[0] == "ResearchLab_F1") {
_root.ResearchLab_F_1 = 1;
_root.Unit1_RPGTrooper.damage = _root.Units_Default_array.RPGTrooper_Damage * 1.33;
}
if (_parent.production[0] == "ResearchLab_G1") {
_root.ResearchLab_G_1 = 1;
_root.Unit1_LightTank.damage = _root.Units_Default_array.LightTank_Damage * 1.33;
_root.Unit1_HeavyTank.damage = _root.Units_Default_array.HeavyTank_Damage * 1.33;
}
if (_parent.production[0] == "ResearchLab_H1") {
_root.ResearchLab_H_1 = 1;
_root.Unit1_MachineGunner.time = _root.Units_Default_array.MachineGunner_Time * 0.6;
_root.Unit1_RPGTrooper.time = _root.Units_Default_array.RPGTrooper_Time * 0.6;
_root.Unit1_Humvee.time = _root.Units_Default_array.Humvee_Time * 0.6;
_root.Unit1_LightTank.time = _root.Units_Default_array.LightTank_Time * 0.6;
_root.Unit1_HeavyTank.time = _root.Units_Default_array.HeavyTank_Time * 0.6;
_root.Unit1_Sniper.time = _root.Units_Default_array.Sniper_Time * 0.6;
_root.Unit1_LaserTrooper.time = _root.Units_Default_array.LaserTrooper_Time * 0.6;
_root.Unit1_LaserTank.time = _root.Units_Default_array.LaserTank_Time * 0.6;
}
if (_parent.production[0] == "ResearchLab_I1") {
_root.ResearchLab_I_1 = 1;
_root.Produce_Farm1D = Math.round(_root.Defaults_array.Produce_FarmD * 1.2);
_root.Produce_Farm1B = Math.round(_root.Defaults_array.Produce_FarmB * 1.2);
}
if (_parent.production[0] == "ResearchLab_I2") {
_root.ResearchLab_I_1 = 2;
_root.Produce_Farm1D = Math.round(_root.Defaults_array.Produce_FarmD * 1.4);
_root.Produce_Farm1B = Math.round(_root.Defaults_array.Produce_FarmB * 1.4);
}
if (_parent.production[0] == "ResearchLab_I3") {
_root.ResearchLab_I_1 = 3;
_root.Produce_Farm1D = Math.round(_root.Defaults_array.Produce_FarmD * 1.7);
_root.Produce_Farm1B = Math.round(_root.Defaults_array.Produce_FarmB * 1.7);
}
if (_parent.production[0] == "ResearchLab_J1") {
_root.ResearchLab_J_1 = 1;
_root.Produce_Mine1D1 = Math.round(_root.Defaults_array.Produce_MineD1 * 1.15);
_root.Produce_Mine1B1 = Math.round(_root.Defaults_array.Produce_MineB1 * 1.15);
}
if (_parent.production[0] == "ResearchLab_J2") {
_root.ResearchLab_J_1 = 2;
_root.Produce_Mine1D1 = Math.round(_root.Defaults_array.Produce_MineD1 * 1.25);
_root.Produce_Mine1B1 = Math.round(_root.Defaults_array.Produce_MineB1 * 1.25);
}
if (_parent.production[0] == "ResearchLab_J3") {
_root.ResearchLab_J_1 = 3;
_root.Produce_Mine1D1 = Math.round(_root.Defaults_array.Produce_MineD1 * 1.5);
_root.Produce_Mine1B1 = Math.round(_root.Defaults_array.Produce_MineB1 * 1.5);
}
if (_parent.production[0] == "ResearchLab_K1") {
_root.ResearchLab_K_1 = 1;
_root.Produce_Mine1D2 = Math.round(_root.Defaults_array.Produce_MineD2 * 1.25);
_root.Produce_Mine1B2 = Math.round(_root.Defaults_array.Produce_MineB2 * 1.25);
}
if (_parent.production[0] == "ResearchLab_K2") {
_root.ResearchLab_K_1 = 2;
_root.Produce_Mine1D2 = Math.round(_root.Defaults_array.Produce_MineD2 * 1.5);
_root.Produce_Mine1B2 = Math.round(_root.Defaults_array.Produce_MineB2 * 1.5);
}
if (_parent.production[0] == "ResearchLab_K3") {
_root.ResearchLab_K_1 = 3;
_root.Produce_Mine1D2 = Math.round(_root.Defaults_array.Produce_MineD2 * 1.75);
_root.Produce_Mine1B2 = Math.round(_root.Defaults_array.Produce_MineB2 * 1.75);
}
if (_parent.production[0] == "ResearchLab_L1") {
_root.ResearchLab_L_1 = 1;
_root.Produce_Mill1D = Math.round(_root.Defaults_array.Produce_MillD * 1.15);
_root.Produce_Mill1B = Math.round(_root.Defaults_array.Produce_MillB * 1.15);
}
if (_parent.production[0] == "ResearchLab_L2") {
_root.ResearchLab_L_1 = 2;
_root.Produce_Mill1D = Math.round(_root.Defaults_array.Produce_MillD * 1.25);
_root.Produce_Mill1B = Math.round(_root.Defaults_array.Produce_MillB * 1.25);
}
if (_parent.production[0] == "ResearchLab_L3") {
_root.ResearchLab_L_1 = 3;
_root.Produce_Mill1D = Math.round(_root.Defaults_array.Produce_MillD * 1.5);
_root.Produce_Mill1B = Math.round(_root.Defaults_array.Produce_MillB * 1.5);
}
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.production[0] = "None";
_parent.training = _parent.production[0];
}
if (((_parent.timerCount == 0) && (_parent.timerSet == 0)) && (_parent.production[0] != "None")) {
_parent.timerSet = _root.Research_Time[_parent.production[0]];
_parent.timerCount = _parent.timerSet;
_parent.training = _parent.production[0];
}
ii = 0;
while (ii < 7) {
if ((_parent.production[ii] == "None") && (_parent.production[ii + 1] != "None")) {
i = ii;
while (i < 7) {
_parent.production[i] = _parent.production[i + 1];
i++;
}
_parent.production[7] = "None";
}
ii++;
}
}
}
Symbol 598 MovieClip Frame 2
gotoAndPlay (1);
Symbol 603 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 603 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 626 MovieClip Frame 22
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 627 MovieClip Frame 1
stop();
Symbol 628 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.Ownership == 1) {
if (_parent.training != _parent.production[0]) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.training = "None";
}
if (_parent.timerCount > 0) {
_parent.timerCount--;
}
if (((_parent.timerCount <= 0) && (_parent.timerSet != 0)) && (_parent.training != "None")) {
if ((_root.User_Pop + _root["Unit1_" + _parent.production[0]].pop) <= _root.User_PopCap) {
if (TrainUnit(_parent.training) == true) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.production[0] = "None";
_parent.training = _parent.production[0];
} else {
timerCount = 1;
}
} else {
timerCount = 1;
}
}
if (((_parent.timerCount == 0) && (_parent.timerSet == 0)) && (_parent.production[0] != "None")) {
_parent.timerSet = _root["Unit1_" + _parent.production[0]].time;
_parent.timerCount = _parent.timerSet;
_parent.training = _parent.production[0];
}
ii = 0;
while (ii < 7) {
if ((_parent.production[ii] == "None") && (_parent.production[ii + 1] != "None")) {
i = ii;
while (i < 7) {
_parent.production[i] = _parent.production[i + 1];
i++;
}
_parent.production[7] = "None";
}
ii++;
}
}
}
function TrainUnit(TrainType) {
if (_root.CheckDepths(this._parent._x - 35, this._parent._y + 35) == false) {
NewUnit = _root.CreateUnit(TrainType, TrainType, this._parent._x - 35, this._parent._y + 35, 1, false);
if (_parent.PlacePosition == 1) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 35;
_parent.PlacePosition = 2;
} else if (_parent.PlacePosition == 2) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 60;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 3;
} else if (_parent.PlacePosition == 3) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 35;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 4;
} else if (_parent.PlacePosition == 4) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 60;
_parent.PlacePosition = 5;
} else if (_parent.PlacePosition == 5) {
_root.container_mc.level_mc[NewUnit].GoToX = this._parent._x - 10;
_root.container_mc.level_mc[NewUnit].GoToY = this._parent._y + 35;
_parent.PlacePosition = 1;
}
return(true);
}
return(false);
}
Symbol 628 MovieClip Frame 2
gotoAndPlay (1);
Symbol 633 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 633 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 648 MovieClip Frame 22
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 649 MovieClip Frame 1
stop();
Symbol 650 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.Ownership == 1) {
if ((_root.TechCenter_C_1 > 0) && (_root.User_AirstrikeTimer > 0)) {
_root.User_AirstrikeTimer--;
}
if ((_root.TechCenter_D_1 > 0) && (_root.User_MissileLaunchTimer > 0)) {
_root.User_MissileLaunchTimer--;
}
}
}
Symbol 650 MovieClip Frame 2
gotoAndPlay (1);
Symbol 655 MovieClip Frame 1
gotoAndStop(_parent._parent.Ownership + 1);
Symbol 655 MovieClip Frame 2
select_btn.onRelease = function () {
if (_root.UserAction == "None") {
_root.UserAction = "BuildingInfo";
_root.construction_mc.BuildingNumber = _parent._parent.BuildingNumber;
_root.construction_mc.MyDepth = _parent._parent.MyDepth;
_root.construction_mc.BuildingName = _parent._parent.BuildingName;
_root.construction_mc.BuildingX = this._parent._parent._parent._x;
_root.construction_mc.BuildingY = this._parent._parent._parent._y;
_root.construction_mc.gotoAndStop("open");
}
};
Symbol 677 MovieClip Frame 28
stop();
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
Symbol 678 MovieClip Frame 1
stop();
Symbol 679 MovieClip Frame 1
if (_root.PauseGame == false) {
if (_parent.Ownership == 1) {
if ((_parent.production[0] == "TechCenter_A1") && (_root.TechCenter_A_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.TechCenter_A1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.TechCenter_A1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.TechCenter_A1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.TechCenter_A1_Wood;
}
if ((_parent.production[0] == "TechCenter_B1") && (_root.TechCenter_B_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.TechCenter_B1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.TechCenter_B1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.TechCenter_B1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.TechCenter_B1_Wood;
}
if ((_parent.production[0] == "TechCenter_C1") && (_root.TechCenter_C_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.TechCenter_C1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.TechCenter_C1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.TechCenter_C1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.TechCenter_C1_Wood;
}
if ((_parent.production[0] == "TechCenter_D1") && (_root.TechCenter_D_1 >= 1)) {
_parent.production[0] = "None";
_root.User_Food = _root.User_Food + _root.Costs_array.TechCenter_D1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.TechCenter_D1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.TechCenter_D1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.TechCenter_D1_Wood;
}
if (_parent.training != _parent.production[0]) {
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.training = "None";
}
if (_parent.timerCount > 0) {
_parent.timerCount--;
}
if (((_parent.timerCount <= 0) && (_parent.timerSet != 0)) && (_parent.training != "None")) {
if (_parent.production[0] == "TechCenter_A1") {
_root.TechCenter_A_1 = 1;
_root.Unit1_LaserTrooper.damage = _root.Units_Default_array.LaserTrooper_Damage * 1.25;
_root.Unit1_LaserTank.damage = _root.Units_Default_array.LaserTank_Damage * 1.25;
}
if (_parent.production[0] == "TechCenter_B1") {
_root.TechCenter_B_1 = 1;
_root.User_Repair = _root.User_Repair * 3;
_root.Costs_array.Misc_Repair_Food = _root.Costs_array.Misc_Repair_Food * 2;
_root.Costs_array.Misc_Repair_Gold = _root.Costs_array.Misc_Repair_Gold * 2;
_root.Costs_array.Misc_Repair_Stone = _root.Costs_array.Misc_Repair_Stone * 2;
_root.Costs_array.Misc_Repair_Wood = _root.Costs_array.Misc_Repair_Wood * 2;
}
if (_parent.production[0] == "TechCenter_C1") {
_root.TechCenter_C_1 = 1;
}
if (_parent.production[0] == "TechCenter_D1") {
_root.TechCenter_D_1 = 1;
}
_parent.timerCount = 0;
_parent.timerSet = 0;
_parent.production[0] = "None";
_parent.training = _parent.production[0];
}
if (((_parent.timerCount == 0) && (_parent.timerSet == 0)) && (_parent.production[0] != "None")) {
_parent.timerSet = _root.Research_Time[_parent.production[0]];
_parent.timerCount = _parent.timerSet;
_parent.training = _parent.production[0];
}
ii = 0;
while (ii < 7) {
if ((_parent.production[ii] == "None") && (_parent.production[ii + 1] != "None")) {
i = ii;
while (i < 7) {
_parent.production[i] = _parent.production[i + 1];
i++;
}
_parent.production[7] = "None";
}
ii++;
}
}
}
Symbol 679 MovieClip Frame 2
gotoAndPlay (1);
Symbol 695 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 697 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 704 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 704 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 704 MovieClip Frame 11
_parent._parent.CreateSoundEffect = true;
Symbol 704 MovieClip Frame 15
myPoint = {x:10.5, y:0};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Bullet", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y);
_parent._parent.AttackDamageActive = true;
Symbol 704 MovieClip Frame 30
gotoAndStop (1);
Symbol 705 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 707 MovieClip [MachineGunner] Frame 1
stop();
Symbol 714 MovieClip [Gunner_Bullet] Frame 7
this.removeMovieClip();
Symbol 718 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 728 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 728 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 728 MovieClip Frame 12
myPoint = {x:8.8, y:7.5};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("RPG", _parent._parent._rotation + ((Math.random() * 6) - 3), myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y, 0, (Math.random() * 10) - 5);
_parent._parent.AttackDamageActive = true;
_parent._parent.CreateSoundEffect = true;
Symbol 728 MovieClip Frame 50
gotoAndStop (1);
Symbol 729 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 731 MovieClip [RPGTrooper] Frame 1
stop();
Symbol 744 MovieClip Frame 1
stop();
Symbol 744 MovieClip Frame 20
_parent.removeMovieClip();
Symbol 756 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 760 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 771 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 771 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 771 MovieClip Frame 12
_parent._parent.CreateSoundEffect = true;
Symbol 771 MovieClip Frame 15
myPoint = {x:0, y:0};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Bullet", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y);
_parent._parent.AttackDamageActive = true;
Symbol 771 MovieClip Frame 30
gotoAndStop (1);
Symbol 772 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 774 MovieClip [Humvee] Frame 1
stop();
Symbol 782 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 786 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 794 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 794 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 794 MovieClip Frame 10
_parent._parent.CreateSoundEffect = true;
Symbol 794 MovieClip Frame 20
myPoint = {x:20, y:0};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Shell", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y);
_parent._parent.AttackDamageActive = true;
Symbol 794 MovieClip Frame 40
gotoAndStop (1);
Symbol 795 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 797 MovieClip [LightTank] Frame 1
stop();
Symbol 806 MovieClip [Tank_Shell] Frame 9
this.removeMovieClip();
Symbol 809 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 811 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 826 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 826 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 826 MovieClip Frame 12
_parent._parent.CreateSoundEffect = true;
Symbol 826 MovieClip Frame 25
myPoint = {x:20, y:0};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Shell", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y);
Symbol 826 MovieClip Frame 28
_parent._parent.AttackDamageActive = true;
Symbol 826 MovieClip Frame 31
myPoint = {x:20, y:0};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Shell", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y);
Symbol 826 MovieClip Frame 50
gotoAndStop (1);
Symbol 827 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 829 MovieClip [HeavyTank] Frame 1
stop();
Symbol 833 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 842 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 842 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 842 MovieClip Frame 21
_parent._parent.CreateSoundEffect = true;
Symbol 842 MovieClip Frame 25
myPoint = {x:10.5, y:0};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Bullet", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y);
_parent._parent.AttackDamageActive = true;
Symbol 842 MovieClip Frame 50
gotoAndStop (1);
Symbol 843 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 845 MovieClip [Sniper] Frame 1
stop();
Symbol 849 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 851 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 852 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 852 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 852 MovieClip Frame 25
myPoint = {x:11.6, y:5.8};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Laser", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y, _parent._parent.Ownership);
_parent._parent.AttackDamageActive = true;
_parent._parent.CreateSoundEffect = true;
Symbol 852 MovieClip Frame 50
gotoAndStop (1);
Symbol 853 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 855 MovieClip [LaserTrooper] Frame 1
stop();
Symbol 861 MovieClip Frame 1
stop();
gotoAndStop(_parent._parent._parent.Ownership);
Symbol 863 MovieClip Frame 40
gotoAndPlay ("start");
Symbol 864 MovieClip Frame 1
_parent._parent.AttackingActive = false;
Symbol 864 MovieClip Frame 2
_parent._parent.AttackingActive = true;
Symbol 864 MovieClip Frame 20
myPoint = {x:8.8, y:0};
this._parent.localToGlobal(myPoint);
myPoint2 = {x:myPoint.x, y:myPoint.y};
_root.container_mc.levelEffects_mc.globalToLocal(myPoint2);
_root.CreateObject("Laser", _parent._parent._rotation, myPoint2.x, myPoint2.y, _root.container_mc.level_mc[_parent._parent.AttackTD]._x, _root.container_mc.level_mc[_parent._parent.AttackTD]._y, _parent._parent.Ownership);
_parent._parent.AttackDamageActive = true;
_parent._parent.CreateSoundEffect = true;
Symbol 864 MovieClip Frame 40
gotoAndStop (1);
Symbol 865 MovieClip Frame 21
stop();
_root.RemoveUnit(_parent._parent.UnitNumber, _parent._parent.MyDepth);
Symbol 867 MovieClip [LaserTank] Frame 1
stop();
Symbol 868 MovieClip Frame 1
stop();
Symbol 891 MovieClip Frame 1
stop();
Symbol 896 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 901 MovieClip Frame 60
stop();
Symbol 904 MovieClip Frame 260
stop();
_parent.Complete();
Symbol 908 MovieClip Frame 215
stop();
Symbol 911 MovieClip Frame 235
stop();
_parent.gotoAndStop("StartAudio");
Symbol 912 MovieClip Frame 1
function EstablishMusic() {
Music_sound = new Sound(this);
Music_sound.attachSound(_root.Music_array.tracks[_root.Music_array.track]);
Music_sound.start();
_root.Music_array.track++;
if (_root.Music_array.track == _root.Music_array.tracks.length) {
_root.Music_array.track = 0;
}
Music_sound.onSoundComplete = function () {
delete Music_sound;
EstablishMusic();
};
}
function MonitorMusic() {
if (_root.Music_array.status == "On") {
if (Music_sound.getVolume() != _root.Music_array.volume) {
Music_sound.setVolume(_root.Music_array.volume);
}
} else if (Music_sound.getVolume() != 0) {
Music_sound.setVolume(0);
}
}
_root.Music_array = new Array();
_root.Music_array.status = "On";
_root.Music_array.volume = 100;
_root.Music_array.track = 0;
_root.Music_array.tracks = ["MusicTrack8", "MusicTrack9"];
EstablishMusic();
setInterval(MonitorMusic, 100);
Symbol 913 MovieClip Frame 1
function CreateSound(Type, Name, Volume, Pan, Override) {
if (_root.Sound_array.status == "On") {
if (((getTimer() - _root.Sound_array.time) > 25) or (Override == true)) {
var _local3 = new String();
_local3 = (Type + Name) + random(_root.Sound_array[Name]);
Sound_sound = new Sound(this);
Sound_sound.attachSound(_local3);
Sound_sound.start();
Sound_sound.setVolume(Volume);
Sound_sound.setPan(Pan);
_root.Sound_array.time = getTimer();
}
}
}
_root.Sound_array = new Array();
_root.Sound_array.status = "On";
_root.Sound_array.volume = 75;
_root.Sound_array.time = 0;
_root.Sound_array.Swordsman = 3;
_root.Sound_array.Spearman = 2;
_root.Sound_array.Archer = 2;
_root.Sound_array.MachineGunner = 1;
_root.Sound_array.RPGTrooper = 1;
_root.Sound_array.Humvee = 1;
_root.Sound_array.LightTank = 1;
_root.Sound_array.HeavyTank = 1;
_root.Sound_array.Sniper = 1;
_root.Sound_array.LaserTrooper = 1;
_root.Sound_array.LaserTank = 1;
_root.Sound_array.AirstrikeLaunch = 1;
_root.Sound_array.MissileImpact = 1;
_root.Sound_array.MissileLaunch = 1;
Symbol 941 MovieClip Frame 1
instructions_btn.onRelease = function () {
_root.MenuVariables_array.menuTab = "Instructions";
};
controls_btn.onRelease = function () {
_root.MenuVariables_array.menuTab = "Controls";
};
skirmish_btn.onRelease = function () {
_root.MenuVariables_array.menuTab = "Skirmish";
};
skirmishstats_btn.onRelease = function () {
_root.MenuVariables_array.menuTab = "SkirmishStats";
};
options_btn.onRelease = function () {
_root.MenuVariables_array.menuTab = "Options";
};
highscores_btn.onRelease = function () {
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
moregames_btn.onRelease = function () {
getURL ("http://www.maxgames.com/", "_blank");
};
credits_btn.onRelease = function () {
_root.MenuVariables_array.menuTab = "Credits";
};
Symbol 965 MovieClip Frame 1
if (_root.MenuVariables_array.subInstructionsCurrent <= 0) {
_root.MenuVariables_array.subInstructionsCurrent = _root.MenuVariables_array.subInstructionsCurrent + _root.MenuVariables_array.subInstructionsTotal;
}
if (_root.MenuVariables_array.subInstructionsCurrent > _root.MenuVariables_array.subInstructionsTotal) {
_root.MenuVariables_array.subInstructionsCurrent = _root.MenuVariables_array.subInstructionsCurrent - _root.MenuVariables_array.subInstructionsTotal;
}
_parent.gotoAndStop(_root.MenuVariables_array.subInstructionsCurrent);
i = 1;
while (i <= 11) {
PageNo = (_root.MenuVariables_array.subInstructionsCurrent - 6) + i;
if (PageNo <= 0) {
PageNo = PageNo + _root.MenuVariables_array.subInstructionsTotal;
}
if (PageNo > _root.MenuVariables_array.subInstructionsTotal) {
PageNo = PageNo - _root.MenuVariables_array.subInstructionsTotal;
}
_parent[("i" + i) + "_txt"].text = PageNo;
i++;
}
Symbol 965 MovieClip Frame 2
gotoAndPlay (1);
Symbol 980 MovieClip Frame 101
stop();
Symbol 982 MovieClip Frame 401
stop();
_parent._parent.Recharged();
Symbol 1043 MovieClip Frame 1
back_btn.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent--;
};
next_btn.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent++;
};
c1.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i1_txt.text);
};
c2.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i2_txt.text);
};
c3.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i3_txt.text);
};
c4.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i4_txt.text);
};
c5.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i5_txt.text);
};
c7.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i7_txt.text);
};
c8.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i8_txt.text);
};
c9.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i9_txt.text);
};
c10.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i10_txt.text);
};
c11.onRelease = function () {
_root.MenuVariables_array.subInstructionsCurrent = Number(i11_txt.text);
};
Symbol 1043 MovieClip Frame 4
foundation_btn.useHandCursor = false;
Symbol 1046 MovieClip Frame 1
_parent.gotoAndStop(_root.MenuVariables_array.menuTab);
Symbol 1046 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1064 MovieClip Frame 1
gotoAndStop(_root.MenuVariables_array.customGame);
Symbol 1064 MovieClip Frame 2
on_btn.onRelease = function () {
gotoAndStop ("On");
_root.MenuVariables_array.customGame = "On";
};
Symbol 1064 MovieClip Frame 3
off_btn.onRelease = function () {
gotoAndStop ("Off");
_root.MenuVariables_array.customGame = "Off";
};
Symbol 1073 MovieClip Frame 1
_parent.gotoAndStop(_root.MenuVariables_array.customGame);
Symbol 1073 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1080 MovieClip Frame 1
stop();
gotoAndStop(_root[Set1][Set2]);
Symbol 1080 MovieClip Frame 2
off_btn.onRelease = function () {
_root[Set1][Set2] = "Off";
gotoAndStop(_root[Set1][Set2]);
};
Symbol 1080 MovieClip Frame 3
on_btn.onRelease = function () {
if (_root[Set1][Set3] > Set4) {
_root[Set1][Set2] = "On";
gotoAndStop(_root[Set1][Set2]);
} else {
_parent.note_mc.gotoAndStop(Set3);
}
};
Symbol 1089 MovieClip Frame 1
stop();
Symbol 1089 MovieClip Frame 2
okay_btn.onRelease = function () {
gotoAndStop ("close");
};
over_btn.useHandCursor = false;
Symbol 1089 MovieClip Frame 3
okay_btn.onRelease = function () {
gotoAndStop ("close");
};
over_btn.useHandCursor = false;
Symbol 1089 MovieClip Frame 4
okay_btn.onRelease = function () {
gotoAndStop ("close");
};
over_btn.useHandCursor = false;
Symbol 1091 MovieClip Frame 2
res_mc.Set1 = "MenuVariables_array";
res_mc.Set2 = "customResources";
res_mc.Set3 = "resourcesCollected";
res_mc.Set4 = 100000 /* 0x0186A0 */;
tra_mc.Set1 = "MenuVariables_array";
tra_mc.Set2 = "customTrain";
tra_mc.Set3 = "unitsKilled";
tra_mc.Set4 = 50;
upg_mc.Set1 = "MenuVariables_array";
upg_mc.Set2 = "customUpgrade";
upg_mc.Set3 = "buildingsDestroyed";
upg_mc.Set4 = 25;
Symbol 1102 MovieClip Frame 1
_parent.gotoAndStop(_root.MenuVariables_array.compDifficulty);
Symbol 1102 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1109 MovieClip Frame 1
normal_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Normal";
};
hard_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Hard";
};
brutal_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Brutal";
};
Symbol 1109 MovieClip Frame 2
easy_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Easy";
};
hard_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Hard";
};
brutal_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Brutal";
};
Symbol 1109 MovieClip Frame 3
easy_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Easy";
};
normal_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Normal";
};
brutal_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Brutal";
};
Symbol 1109 MovieClip Frame 4
easy_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Easy";
};
normal_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Normal";
};
hard_btn.onRelease = function () {
_root.MenuVariables_array.compDifficulty = "Hard";
};
Symbol 1117 MovieClip Frame 1
_parent.gotoAndStop(_root.MenuVariables_array.startingTeir);
Symbol 1117 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1123 MovieClip Frame 1
teir2_btn.onRelease = function () {
_root.MenuVariables_array.startingTeir = "Two";
};
teir3_btn.onRelease = function () {
_root.MenuVariables_array.startingTeir = "Three";
};
Symbol 1123 MovieClip Frame 2
teir1_btn.onRelease = function () {
_root.MenuVariables_array.startingTeir = "One";
};
teir3_btn.onRelease = function () {
_root.MenuVariables_array.startingTeir = "Three";
};
Symbol 1123 MovieClip Frame 3
teir1_btn.onRelease = function () {
_root.MenuVariables_array.startingTeir = "One";
};
teir2_btn.onRelease = function () {
_root.MenuVariables_array.startingTeir = "Two";
};
Symbol 1154 MovieClip Frame 1
_root.Music_array.volume = Math.round((_parent.scroller_btn._x + 100) / 2);
Symbol 1154 MovieClip Frame 2
gotoAndPlay (2);
Symbol 1155 MovieClip Frame 1
scroller_btn.onPress = function () {
startDrag (scroller_btn, false, -100, 0, 100, 0);
};
scroller_btn.onRelease = function () {
stopDrag();
};
scroller_btn.onReleaseOutside = function () {
stopDrag();
};
scroller_btn._x = (_root.Music_array.volume * 2) - 100;
Symbol 1157 MovieClip Frame 1
_root.Sound_array.volume = Math.round((_parent.scroller_btn._x + 100) / 2);
Symbol 1157 MovieClip Frame 2
gotoAndPlay (2);
Symbol 1158 MovieClip Frame 1
scroller_btn.onPress = function () {
startDrag (scroller_btn, false, -100, 0, 100, 0);
};
scroller_btn.onRelease = function () {
stopDrag();
};
scroller_btn.onReleaseOutside = function () {
stopDrag();
};
scroller_btn._x = (_root.Sound_array.volume * 2) - 100;
Symbol 1168 MovieClip Frame 1
stop();
if (Type == 1) {
gotoAndStop(_root[Set1][Set2]);
} else {
gotoAndStop(_root[Set1]);
}
Symbol 1168 MovieClip Frame 2
off_btn.onRelease = function () {
if (Type == 1) {
_root[Set1][Set2] = "Off";
gotoAndStop(_root[Set1][Set2]);
} else {
_root[Set1] = "Off";
gotoAndStop(_root[Set1]);
}
};
Symbol 1168 MovieClip Frame 3
on_btn.onRelease = function () {
if (Type == 1) {
_root[Set1][Set2] = "On";
gotoAndStop(_root[Set1][Set2]);
} else {
_root[Set1] = "On";
gotoAndStop(_root[Set1]);
}
};
Symbol 1292 MovieClip Frame 3
start_btn.onRelease = function () {
var _local3 = SharedObject.getLocal("Data");
_local3.data.MySavedData = _root.MenuVariables_array;
_parent.PlayGame();
};
Symbol 1292 MovieClip Frame 4
function AddCommas(CommasTo) {
number_str = String(CommasTo);
newnumber_str = "";
newestnumber_str = "";
while (number_str.length > 3) {
newnumber_str = "," + number_str.substr(number_str.length - 3, 3);
number_str = number_str.substr(0, number_str.length - 3);
newestnumber_str = newnumber_str + newestnumber_str;
}
newestnumber_str = number_str + newestnumber_str;
return(newestnumber_str);
}
played_txt.text = AddCommas(_root.MenuVariables_array.gamesPlayed);
won_txt.text = AddCommas(_root.MenuVariables_array.gamesWon);
loss_txt.text = AddCommas(_root.MenuVariables_array.gamesLost);
uTrain_txt.text = AddCommas(_root.MenuVariables_array.unitsTrained);
uKill_txt.text = AddCommas(_root.MenuVariables_array.unitsKilled);
uLost_txt.text = AddCommas(_root.MenuVariables_array.unitsLost);
bCreate_txt.text = AddCommas(_root.MenuVariables_array.buildingsCreated);
bKill_txt.text = AddCommas(_root.MenuVariables_array.buildingsDestroyed);
bLost_txt.text = AddCommas(_root.MenuVariables_array.buildingsLost);
rCollect_txt.text = AddCommas(_root.MenuVariables_array.resourcesCollected);
Hours = 0;
Minutes = 0;
Seconds = 0;
TimePlayed = _root.MenuVariables_array.timePlayed;
while (TimePlayed >= 3600) {
Hours++;
TimePlayed = TimePlayed - 3600;
}
while (TimePlayed >= 60) {
Minutes++;
TimePlayed = TimePlayed - 60;
}
while (TimePlayed >= 1) {
Seconds++;
TimePlayed--;
}
if (Hours < 10) {
Hours = "0" + Hours;
}
if (Minutes < 10) {
Minutes = "0" + Minutes;
}
if (Seconds < 10) {
Seconds = "0" + Seconds;
}
tPlayed_txt.text = (((Hours + " : ") + Minutes) + " : ") + Seconds;
Symbol 1292 MovieClip Frame 5
musicOF_mc.Type = 1;
musicOF_mc.Set1 = "Music_array";
musicOF_mc.Set2 = "status";
soundOF_mc.Type = 1;
soundOF_mc.Set1 = "Sound_array";
soundOF_mc.Set2 = "status";
Symbol 1292 MovieClip Frame 6
function AddCommas(CommasTo) {
number_str = String(CommasTo);
newnumber_str = "";
newestnumber_str = "";
while (number_str.length > 3) {
newnumber_str = "," + number_str.substr(number_str.length - 3, 3);
number_str = number_str.substr(0, number_str.length - 3);
newestnumber_str = newnumber_str + newestnumber_str;
}
newestnumber_str = number_str + newestnumber_str;
return(newestnumber_str);
}
i = 1;
while (i <= 10) {
_parent.content_mc[("name" + i) + "_txt"].text = "Loading...";
_parent.content_mc[("score" + i) + "_txt"].text = "Loading...";
i++;
}
System.security.loadPolicyFile("http://www.godlygamer.com/Highscores/policy.xml");
SendVars = new LoadVars();
targetObject = new LoadVars();
SendVars.Check = "load";
SendVars.SecondCheck = "OLK58Z";
SendVars.Table = "Easy";
targetObject.onLoad = function (success) {
if (success) {
i = 1;
while (i <= 10) {
if (this["name" + i] != "") {
_parent.content_mc[("name" + i) + "_txt"].text = this["name" + i];
_parent.content_mc[("score" + i) + "_txt"].text = AddCommas(this["score" + i]);
} else {
_parent.content_mc[("name" + i) + "_txt"].text = "Empty";
_parent.content_mc[("score" + i) + "_txt"].text = "0";
}
i++;
}
} else {
i = 1;
while (i <= 10) {
_parent.content_mc[("name" + i) + "_txt"].text = "Failed...";
_parent.content_mc[("score" + i) + "_txt"].text = "Failed...";
i++;
}
}
};
SendVars.sendAndLoad("http://www.godlygamer.com/Highscores/conflictresolution2.php", targetObject, "POST");
viewTop50_btn.onRelease = function () {
getURL ("http://www.godlygamer.com/Highscores/conflictresolution.php?Table=Easy", "_blank");
};
normal_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Normal";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
hard_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Hard";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
brutal_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Brutal";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
Symbol 1292 MovieClip Frame 7
function AddCommas(CommasTo) {
number_str = String(CommasTo);
newnumber_str = "";
newestnumber_str = "";
while (number_str.length > 3) {
newnumber_str = "," + number_str.substr(number_str.length - 3, 3);
number_str = number_str.substr(0, number_str.length - 3);
newestnumber_str = newnumber_str + newestnumber_str;
}
newestnumber_str = number_str + newestnumber_str;
return(newestnumber_str);
}
i = 1;
while (i <= 10) {
_parent.content_mc[("name" + i) + "_txt"].text = "Loading...";
_parent.content_mc[("score" + i) + "_txt"].text = "Loading...";
i++;
}
System.security.loadPolicyFile("http://www.godlygamer.com/Highscores/policy.xml");
SendVars = new LoadVars();
targetObject = new LoadVars();
SendVars.Check = "load";
SendVars.SecondCheck = "OLK58Z";
SendVars.Table = "Normal";
targetObject.onLoad = function (success) {
if (success) {
i = 1;
while (i <= 10) {
if (this["name" + i] != "") {
_parent.content_mc[("name" + i) + "_txt"].text = this["name" + i];
_parent.content_mc[("score" + i) + "_txt"].text = AddCommas(this["score" + i]);
} else {
_parent.content_mc[("name" + i) + "_txt"].text = "Empty";
_parent.content_mc[("score" + i) + "_txt"].text = "0";
}
i++;
}
} else {
i = 1;
while (i <= 10) {
_parent.content_mc[("name" + i) + "_txt"].text = "Failed...";
_parent.content_mc[("score" + i) + "_txt"].text = "Failed...";
i++;
}
}
};
SendVars.sendAndLoad("http://www.godlygamer.com/Highscores/conflictresolution2.php", targetObject, "POST");
viewTop50_btn.onRelease = function () {
getURL ("http://www.godlygamer.com/Highscores/conflictresolution.php?Table=Normal", "_blank");
};
easy_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Easy";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
hard_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Hard";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
brutal_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Brutal";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
Symbol 1292 MovieClip Frame 8
function AddCommas(CommasTo) {
number_str = String(CommasTo);
newnumber_str = "";
newestnumber_str = "";
while (number_str.length > 3) {
newnumber_str = "," + number_str.substr(number_str.length - 3, 3);
number_str = number_str.substr(0, number_str.length - 3);
newestnumber_str = newnumber_str + newestnumber_str;
}
newestnumber_str = number_str + newestnumber_str;
return(newestnumber_str);
}
i = 1;
while (i <= 10) {
_parent.content_mc[("name" + i) + "_txt"].text = "Loading...";
_parent.content_mc[("score" + i) + "_txt"].text = "Loading...";
i++;
}
System.security.loadPolicyFile("http://www.godlygamer.com/Highscores/policy.xml");
SendVars = new LoadVars();
targetObject = new LoadVars();
SendVars.Check = "load";
SendVars.SecondCheck = "OLK58Z";
SendVars.Table = "Hard";
targetObject.onLoad = function (success) {
if (success) {
i = 1;
while (i <= 10) {
if (this["name" + i] != "") {
_parent.content_mc[("name" + i) + "_txt"].text = this["name" + i];
_parent.content_mc[("score" + i) + "_txt"].text = AddCommas(this["score" + i]);
} else {
_parent.content_mc[("name" + i) + "_txt"].text = "Empty";
_parent.content_mc[("score" + i) + "_txt"].text = "0";
}
i++;
}
} else {
i = 1;
while (i <= 10) {
_parent.content_mc[("name" + i) + "_txt"].text = "Failed...";
_parent.content_mc[("score" + i) + "_txt"].text = "Failed...";
i++;
}
}
};
SendVars.sendAndLoad("http://www.godlygamer.com/Highscores/conflictresolution2.php", targetObject, "POST");
viewTop50_btn.onRelease = function () {
getURL ("http://www.godlygamer.com/Highscores/conflictresolution.php?Table=Hard", "_blank");
};
easy_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Easy";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
normal_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Normal";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
brutal_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Brutal";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
Symbol 1292 MovieClip Frame 9
function AddCommas(CommasTo) {
number_str = String(CommasTo);
newnumber_str = "";
newestnumber_str = "";
while (number_str.length > 3) {
newnumber_str = "," + number_str.substr(number_str.length - 3, 3);
number_str = number_str.substr(0, number_str.length - 3);
newestnumber_str = newnumber_str + newestnumber_str;
}
newestnumber_str = number_str + newestnumber_str;
return(newestnumber_str);
}
i = 1;
while (i <= 10) {
_parent.content_mc[("name" + i) + "_txt"].text = "Loading...";
_parent.content_mc[("score" + i) + "_txt"].text = "Loading...";
i++;
}
System.security.loadPolicyFile("http://www.godlygamer.com/Highscores/policy.xml");
SendVars = new LoadVars();
targetObject = new LoadVars();
SendVars.Check = "load";
SendVars.SecondCheck = "OLK58Z";
SendVars.Table = "Brutal";
targetObject.onLoad = function (success) {
if (success) {
i = 1;
while (i <= 10) {
if (this["name" + i] != "") {
_parent.content_mc[("name" + i) + "_txt"].text = this["name" + i];
_parent.content_mc[("score" + i) + "_txt"].text = AddCommas(this["score" + i]);
} else {
_parent.content_mc[("name" + i) + "_txt"].text = "Empty";
_parent.content_mc[("score" + i) + "_txt"].text = "0";
}
i++;
}
} else {
i = 1;
while (i <= 10) {
_parent.content_mc[("name" + i) + "_txt"].text = "Failed...";
_parent.content_mc[("score" + i) + "_txt"].text = "Failed...";
i++;
}
}
};
SendVars.sendAndLoad("http://www.godlygamer.com/Highscores/conflictresolution2.php", targetObject, "POST");
viewTop50_btn.onRelease = function () {
getURL ("http://www.godlygamer.com/Highscores/conflictresolution.php?Table=Brutal", "_blank");
};
easy_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Easy";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
normal_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Normal";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
hard_btn.onRelease = function () {
_root.MenuVariables_array.highscoreTable = "Hard";
_root.MenuVariables_array.menuTab = "Highscores" + _root.MenuVariables_array.highscoreTable;
};
Symbol 1297 MovieClip Frame 6
if (_root.UserAction == "Place") {
gotoAndPlay ("restrict");
} else {
gotoAndPlay ("normal");
}
Symbol 1297 MovieClip Frame 12
if (_root.UserAction == "Place") {
gotoAndPlay ("restrict");
} else {
gotoAndPlay ("normal");
}
Symbol 1306 MovieClip Frame 1
if (_root.container_mc.level_mc[Building].health >= _root.container_mc.level_mc[Building].healthMax) {
gotoAndPlay ("repaired");
}
if (_root.container_mc.level_mc[Building].repair == true) {
gotoAndPlay ("repairing");
}
repair_btn.onRelease = function () {
_root.container_mc.level_mc[Building].repair = true;
};
repair_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Misc_Repair_Info;
_root.User_DR_Pop = _root.Costs_array.Misc_Repair_Pop;
_root.User_DR_Food = _root.Costs_array.Misc_Repair_Food;
_root.User_DR_Gold = _root.Costs_array.Misc_Repair_Gold;
_root.User_DR_Stone = _root.Costs_array.Misc_Repair_Stone;
_root.User_DR_Wood = _root.Costs_array.Misc_Repair_Wood;
};
repair_btn.onRollOut = function () {
_root.ClearDR();
};
repair_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1306 MovieClip Frame 2
gotoAndPlay ("available");
Symbol 1306 MovieClip Frame 3
if (_root.container_mc.level_mc[Building].repair == false) {
gotoAndPlay ("available");
}
repair_btn.onRelease = function () {
_root.container_mc.level_mc[Building].repair = false;
};
repair_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Misc_Repair_Info;
_root.User_DR_Pop = _root.Costs_array.Misc_Repair_Pop;
_root.User_DR_Food = _root.Costs_array.Misc_Repair_Food;
_root.User_DR_Gold = _root.Costs_array.Misc_Repair_Gold;
_root.User_DR_Stone = _root.Costs_array.Misc_Repair_Stone;
_root.User_DR_Wood = _root.Costs_array.Misc_Repair_Wood;
};
repair_btn.onRollOut = function () {
_root.ClearDR();
};
repair_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1306 MovieClip Frame 4
gotoAndPlay ("repairing");
Symbol 1306 MovieClip Frame 5
if (_root.container_mc.level_mc[Building].health < _root.container_mc.level_mc[Building].healthMax) {
gotoAndPlay ("available");
}
Symbol 1306 MovieClip Frame 6
gotoAndPlay ("repaired");
Symbol 1308 MovieClip Frame 1
if (isNaN(_root.container_mc.level_mc[Building].health) or (_root.container_mc.level_mc[Building].health <= 0)) {
_parent._parent.Escape();
_root.ClearDR();
}
health_txt.text = (("Health: " + Math.round(_root.container_mc.level_mc[Building].health)) + "/") + _root.container_mc.level_mc[Building].healthMax;
Symbol 1308 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1318 MovieClip Frame 1
if (_root.User_Advancing == false) {
_parent.gotoAndStop(1);
}
Symbol 1318 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1319 MovieClip Frame 1
if (_root.User_Advancing == false) {
if (_root.User_Teir == 1) {
gotoAndStop ("Advance2");
} else if (_root.User_Teir == 2) {
gotoAndStop ("Advance3");
} else {
stop();
}
} else {
gotoAndStop ("Advancing");
}
Symbol 1319 MovieClip Frame 2
advance_btn.onRelease = function () {
if (((((_root.Buildings1_array.Teir1_Armoury >= 1) && (_root.User_Food >= _root.Costs_array.Misc_T2_Food)) && (_root.User_Gold >= _root.Costs_array.Misc_T2_Gold)) && (_root.User_Stone >= _root.Costs_array.Misc_T2_Stone)) && (_root.User_Wood >= _root.Costs_array.Misc_T2_Wood)) {
_root.User_Advancing = true;
_root.TBB_mc.teir_mc.gotoAndPlay("Advance" + _root.User_Teir);
gotoAndStop ("Advancing");
_root.User_Food = _root.User_Food - _root.Costs_array.Misc_T2_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Misc_T2_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Misc_T2_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Misc_T2_Wood;
_root.ClearDR();
}
};
advance_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Misc_T2_Info;
_root.User_DR_Food = _root.Costs_array.Misc_T2_Food;
_root.User_DR_Gold = _root.Costs_array.Misc_T2_Gold;
_root.User_DR_Stone = _root.Costs_array.Misc_T2_Stone;
_root.User_DR_Wood = _root.Costs_array.Misc_T2_Wood;
};
advance_btn.onRollOut = function () {
_root.ClearDR();
};
advance_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1319 MovieClip Frame 3
advance_btn.onRelease = function () {
if (((((_root.Buildings1_array.Teir2_ResearchLab >= 1) && (_root.User_Food >= _root.Costs_array.Misc_T3_Food)) && (_root.User_Gold >= _root.Costs_array.Misc_T3_Gold)) && (_root.User_Stone >= _root.Costs_array.Misc_T3_Stone)) && (_root.User_Wood >= _root.Costs_array.Misc_T3_Wood)) {
_root.User_Advancing = true;
_root.TBB_mc.teir_mc.gotoAndPlay("Advance" + _root.User_Teir);
gotoAndStop ("Advancing");
_root.User_Food = _root.User_Food - _root.Costs_array.Misc_T3_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Misc_T3_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Misc_T3_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Misc_T3_Wood;
_root.ClearDR();
}
};
advance_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Misc_T3_Info;
_root.User_DR_Food = _root.Costs_array.Misc_T3_Food;
_root.User_DR_Gold = _root.Costs_array.Misc_T3_Gold;
_root.User_DR_Stone = _root.Costs_array.Misc_T3_Stone;
_root.User_DR_Wood = _root.Costs_array.Misc_T3_Wood;
};
advance_btn.onRollOut = function () {
_root.ClearDR();
};
advance_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1319 MovieClip Frame 4
cancel_btn.onRelease = function () {
_root.User_Advancing = false;
_root.TBB_mc.teir_mc.gotoAndStop("Teir" + _root.User_Teir);
if (_root.User_Teir == 1) {
gotoAndStop ("Advance2");
_root.User_Food = _root.User_Food + _root.Costs_array.Misc_T2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Misc_T2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Misc_T2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Misc_T2_Wood;
}
if (_root.User_Teir == 2) {
gotoAndStop ("Advance3");
_root.User_Food = _root.User_Food + _root.Costs_array.Misc_T3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Misc_T3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Misc_T3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Misc_T3_Wood;
}
};
Symbol 1407 MovieClip Frame 1
i = 0;
while (i < 8) {
this["i" + (i + 1)].gotoAndStop(_root.container_mc.level_mc[Building].production[i]);
i++;
}
Progress = Math.abs(Math.round(((_root.container_mc.level_mc[Building].timerCount / _root.container_mc.level_mc[Building].timerSet) - 1) * 100));
if (isNaN(Progress)) {
Progress = 1;
}
progress_mc.gotoAndStop(Progress);
function Refund(No) {
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_A1") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_A1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_A1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_A1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_A1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_A2") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_A2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_A2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_A2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_A2_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_A3") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_A3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_A3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_A3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_A3_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_B1") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_B1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_B1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_B1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_B1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_B2") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_B2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_B2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_B2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_B2_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_B3") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_B3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_B3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_B3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_B3_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_C1") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_C1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_C1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_C1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_C1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_C2") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_C2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_C2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_C2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_C2_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_C3") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_C3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_C3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_C3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_C3_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_D1") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_D1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_D1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_D1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_D1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_D2") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_D2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_D2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_D2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_D2_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Armoury_D3") {
_root.User_Food = _root.User_Food + _root.Costs_array.Armoury_D3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Armoury_D3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Armoury_D3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Armoury_D3_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Swordsman") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_01_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_01_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_01_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_01_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Spearman") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_02_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_02_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_02_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_02_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Archer") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_03_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_03_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_03_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_03_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "MountedSwordsman") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_04_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_04_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_04_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_04_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "MountedArcher") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_05_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_05_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_05_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_05_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "MachineGunner") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_06_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_06_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_06_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_06_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "RPGTrooper") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_07_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_07_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_07_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_07_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Sniper") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_11_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_11_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_11_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_11_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "LaserTrooper") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_12_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_12_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_12_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_12_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_A1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_A1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_A1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_A1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_A1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_B1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_B1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_B1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_B1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_B1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_C1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_C1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_C1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_C1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_C1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_D1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_D1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_D1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_D1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_D1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_E1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_E1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_E1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_E1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_E1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_F1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_F1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_F1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_F1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_F1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_G1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_G1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_G1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_G1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_G1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_H1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_H1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_H1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_H1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_H1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_I1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_I1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_I1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_I1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_I1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_I2") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_I2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_I2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_I2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_I2_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_I3") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_I3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_I3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_I3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_I3_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_J1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_J1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_J1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_J1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_J1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_J2") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_J2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_J2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_J2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_J2_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_J3") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_J3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_J3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_J3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_J3_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_K1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_K1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_K1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_K1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_K1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_K2") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_K2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_K2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_K2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_K2_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_K3") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_K3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_K3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_K3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_K3_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_L1") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_L1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_L1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_L1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_L1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_L2") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_L2_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_L2_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_L2_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_L2_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "ResearchLab_L3") {
_root.User_Food = _root.User_Food + _root.Costs_array.ResearchLab_L3_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.ResearchLab_L3_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.ResearchLab_L3_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.ResearchLab_L3_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "Humvee") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_08_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_08_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_08_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_08_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "LightTank") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_09_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_09_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_09_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_09_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "HeavyTank") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_10_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_10_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_10_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_10_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "LaserTank") {
_root.User_Food = _root.User_Food + _root.Costs_array.Unit_13_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.Unit_13_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.Unit_13_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.Unit_13_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "TechCenter_A1") {
_root.User_Food = _root.User_Food + _root.Costs_array.TechCenter_A1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.TechCenter_A1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.TechCenter_A1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.TechCenter_A1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "TechCenter_B1") {
_root.User_Food = _root.User_Food + _root.Costs_array.TechCenter_B1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.TechCenter_B1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.TechCenter_B1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.TechCenter_B1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "TechCenter_C1") {
_root.User_Food = _root.User_Food + _root.Costs_array.TechCenter_C1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.TechCenter_C1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.TechCenter_C1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.TechCenter_C1_Wood;
}
if (_root.container_mc.level_mc[Building].production[No] == "TechCenter_D1") {
_root.User_Food = _root.User_Food + _root.Costs_array.TechCenter_D1_Food;
_root.User_Gold = _root.User_Gold + _root.Costs_array.TechCenter_D1_Gold;
_root.User_Stone = _root.User_Stone + _root.Costs_array.TechCenter_D1_Stone;
_root.User_Wood = _root.User_Wood + _root.Costs_array.TechCenter_D1_Wood;
}
}
c1_btn.onRelease = function () {
Refund(0);
_root.container_mc.level_mc[Building].production[0] = "None";
};
c2_btn.onRelease = function () {
Refund(1);
_root.container_mc.level_mc[Building].production[1] = "None";
};
c3_btn.onRelease = function () {
Refund(2);
_root.container_mc.level_mc[Building].production[2] = "None";
};
c4_btn.onRelease = function () {
Refund(3);
_root.container_mc.level_mc[Building].production[3] = "None";
};
c5_btn.onRelease = function () {
Refund(4);
_root.container_mc.level_mc[Building].production[4] = "None";
};
c6_btn.onRelease = function () {
Refund(5);
_root.container_mc.level_mc[Building].production[5] = "None";
};
c7_btn.onRelease = function () {
Refund(6);
_root.container_mc.level_mc[Building].production[6] = "None";
};
c8_btn.onRelease = function () {
Refund(7);
_root.container_mc.level_mc[Building].production[7] = "None";
};
Symbol 1407 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1411 MovieClip Frame 11
stop();
Symbol 1414 MovieClip Frame 10
stop();
Symbol 1418 MovieClip Frame 1
_parent.gotoAndStop(_root.Armoury_A_1 + 2);
Symbol 1418 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1421 MovieClip Frame 1
a1.enabled = false;
a2.enabled = false;
a3.enabled = false;
Symbol 1421 MovieClip Frame 2
a1.enabled = true;
a1.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_A1_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_A1_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_A1_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_A1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_A1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_A1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_A1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_A1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_A1_Wood;
}
}
};
a1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_A1_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_A1_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_A1_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_A1_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_A1_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_A1_Wood;
};
a1.onRollOut = function () {
_root.ClearDR();
};
a1.onReleaseOutside = function () {
_root.ClearDR();
};
a2.enabled = false;
a3.enabled = false;
Symbol 1421 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.Armoury_A1_Info) {
_root.ClearDR();
}
a1.enabled = false;
a2.enabled = true;
a2.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_A2_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_A2_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_A2_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_A2_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_A2";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_A2_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_A2_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_A2_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_A2_Wood;
}
}
};
a2.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_A2_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_A2_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_A2_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_A2_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_A2_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_A2_Wood;
};
a2.onRollOut = function () {
_root.ClearDR();
};
a2.onReleaseOutside = function () {
_root.ClearDR();
};
a3.enabled = false;
Symbol 1421 MovieClip Frame 4
if (_root.User_DR_Info == _root.Costs_array.Armoury_A2_Info) {
_root.ClearDR();
}
a1.enabled = false;
a2.enabled = false;
a3.enabled = true;
a3.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_A3_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_A3_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_A3_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_A3_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_A3";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_A3_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_A3_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_A3_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_A3_Wood;
}
}
};
a3.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_A3_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_A3_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_A3_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_A3_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_A3_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_A3_Wood;
};
a3.onRollOut = function () {
_root.ClearDR();
};
a3.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1421 MovieClip Frame 5
if (_root.User_DR_Info == _root.Costs_array.Armoury_A3_Info) {
_root.ClearDR();
}
a1.enabled = false;
a2.enabled = false;
a3.enabled = false;
Symbol 1425 MovieClip Frame 1
_parent.gotoAndStop(_root.Armoury_B_1 + 2);
Symbol 1425 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1426 MovieClip Frame 1
b1.enabled = false;
b2.enabled = false;
b3.enabled = false;
Symbol 1426 MovieClip Frame 2
b1.enabled = true;
b1.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_B1_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_B1_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_B1_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_B1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_B1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_B1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_B1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_B1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_B1_Wood;
}
}
};
b1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_B1_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_B1_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_B1_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_B1_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_B1_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_B1_Wood;
};
b1.onRollOut = function () {
_root.ClearDR();
};
b1.onReleaseOutside = function () {
_root.ClearDR();
};
b2.enabled = false;
b3.enabled = false;
Symbol 1426 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.Armoury_B1_Info) {
_root.ClearDR();
}
b1.enabled = false;
b2.enabled = true;
b2.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_B2_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_B2_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_B2_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_B2_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_B2";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_B2_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_B2_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_B2_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_B2_Wood;
}
}
};
b2.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_B2_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_B2_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_B2_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_B2_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_B2_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_B2_Wood;
};
b2.onRollOut = function () {
_root.ClearDR();
};
b2.onReleaseOutside = function () {
_root.ClearDR();
};
b3.enabled = false;
Symbol 1426 MovieClip Frame 4
if (_root.User_DR_Info == _root.Costs_array.Armoury_B2_Info) {
_root.ClearDR();
}
b1.enabled = false;
b2.enabled = false;
b3.enabled = true;
b3.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_B3_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_B3_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_B3_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_B3_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_B3";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_B3_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_B3_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_B3_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_B3_Wood;
}
}
};
b3.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_B3_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_B3_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_B3_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_B3_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_B3_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_B3_Wood;
};
b3.onRollOut = function () {
_root.ClearDR();
};
b3.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1426 MovieClip Frame 5
if (_root.User_DR_Info == _root.Costs_array.Armoury_B3_Info) {
_root.ClearDR();
}
b1.enabled = false;
b2.enabled = false;
b3.enabled = false;
Symbol 1430 MovieClip Frame 1
_parent.gotoAndStop(_root.Armoury_C_1 + 2);
Symbol 1430 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1431 MovieClip Frame 1
c1.enabled = false;
c2.enabled = false;
c3.enabled = false;
Symbol 1431 MovieClip Frame 2
c1.enabled = true;
c1.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_C1_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_C1_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_C1_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_C1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_C1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_C1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_C1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_C1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_C1_Wood;
}
}
};
c1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_C1_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_C1_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_C1_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_C1_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_C1_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_C1_Wood;
};
c1.onRollOut = function () {
_root.ClearDR();
};
c1.onReleaseOutside = function () {
_root.ClearDR();
};
c2.enabled = false;
c3.enabled = false;
Symbol 1431 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.Armoury_C1_Info) {
_root.ClearDR();
}
c1.enabled = false;
c2.enabled = true;
c2.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_C2_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_C2_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_C2_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_C2_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_C2";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_C2_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_C2_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_C2_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_C2_Wood;
}
}
};
c2.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_C2_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_C2_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_C2_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_C2_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_C2_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_C2_Wood;
};
c2.onRollOut = function () {
_root.ClearDR();
};
c2.onReleaseOutside = function () {
_root.ClearDR();
};
c3.enabled = false;
Symbol 1431 MovieClip Frame 4
if (_root.User_DR_Info == _root.Costs_array.Armoury_C2_Info) {
_root.ClearDR();
}
c1.enabled = false;
c2.enabled = false;
c3.enabled = true;
c3.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_C3_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_C3_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_C3_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_C3_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_C3";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_C3_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_C3_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_C3_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_C3_Wood;
}
}
};
c3.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_C3_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_C3_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_C3_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_C3_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_C3_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_C3_Wood;
};
c3.onRollOut = function () {
_root.ClearDR();
};
c3.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1431 MovieClip Frame 5
if (_root.User_DR_Info == _root.Costs_array.Armoury_C3_Info) {
_root.ClearDR();
}
c1.enabled = false;
c2.enabled = false;
c3.enabled = false;
Symbol 1438 MovieClip Frame 1
_parent.gotoAndStop(_root.Armoury_D_1 + 2);
Symbol 1438 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1439 MovieClip Frame 1
d1.enabled = false;
d2.enabled = false;
d3.enabled = false;
Symbol 1439 MovieClip Frame 2
d1.enabled = true;
d1.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_D1_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_D1_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_D1_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_D1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_D1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_D1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_D1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_D1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_D1_Wood;
}
}
};
d1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_D1_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_D1_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_D1_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_D1_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_D1_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_D1_Wood;
};
d1.onRollOut = function () {
_root.ClearDR();
};
d1.onReleaseOutside = function () {
_root.ClearDR();
};
d2.enabled = false;
d3.enabled = false;
Symbol 1439 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.Armoury_D1_Info) {
_root.ClearDR();
}
d1.enabled = false;
d2.enabled = true;
d2.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_D2_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_D2_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_D2_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_D2_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_D2";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_D2_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_D2_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_D2_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_D2_Wood;
}
}
};
d2.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_D2_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_D2_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_D2_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_D2_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_D2_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_D2_Wood;
};
d2.onRollOut = function () {
_root.ClearDR();
};
d2.onReleaseOutside = function () {
_root.ClearDR();
};
d3.enabled = false;
Symbol 1439 MovieClip Frame 4
if (_root.User_DR_Info == _root.Costs_array.Armoury_D2_Info) {
_root.ClearDR();
}
d1.enabled = false;
d2.enabled = false;
d3.enabled = true;
d3.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Armoury_D3_Food) && (_root.User_Gold >= _root.Costs_array.Armoury_D3_Gold)) && (_root.User_Stone >= _root.Costs_array.Armoury_D3_Stone)) && (_root.User_Wood >= _root.Costs_array.Armoury_D3_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Armoury_D3";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Armoury_D3_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Armoury_D3_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Armoury_D3_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Armoury_D3_Wood;
}
}
};
d3.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Armoury_D3_Info;
_root.User_DR_Pop = _root.Costs_array.Armoury_D3_Pop;
_root.User_DR_Food = _root.Costs_array.Armoury_D3_Food;
_root.User_DR_Gold = _root.Costs_array.Armoury_D3_Gold;
_root.User_DR_Stone = _root.Costs_array.Armoury_D3_Stone;
_root.User_DR_Wood = _root.Costs_array.Armoury_D3_Wood;
};
d3.onRollOut = function () {
_root.ClearDR();
};
d3.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1439 MovieClip Frame 5
if (_root.User_DR_Info == _root.Costs_array.Armoury_D3_Info) {
_root.ClearDR();
}
d1.enabled = false;
d2.enabled = false;
d3.enabled = false;
Symbol 1458 MovieClip Frame 1
Percentage = Math.abs(Math.round((_root.container_mc.level_mc[_parent.Building].ProduceTimer / _root.container_mc.level_mc[_parent.Building].ProduceSet) * 100) - 100);
if (isNaN(Percentage)) {
Percentage = 1;
}
_parent.resource_mc.gotoAndStop(Percentage);
_parent.workers_txt.text = _root.container_mc.level_mc[_parent.Building].Workers + "/10";
if (_parent._parent.BuildingName == "Teir 1 Farm") {
Time = Math.round(_root.container_mc.level_mc[_parent.Building].ProduceSet / 40);
FoodGrant = _root.Produce_Farm1D + (_root.Produce_Farm1B * _root.container_mc.level_mc[_parent.Building].Workers);
_parent.food1_txt.text = ((FoodGrant + " food / ") + Time) + " seconds";
_parent.food2_txt.text = "Total Food Produced: " + _root.container_mc.level_mc[_parent.Building].FoodProduced;
}
if (_parent._parent.BuildingName == "Teir 1 LumberMill") {
Time = Math.round(_root.container_mc.level_mc[_parent.Building].ProduceSet / 40);
WoodGrant = _root.Produce_Mill1D + (_root.Produce_Mill1B * _root.container_mc.level_mc[_parent.Building].Workers);
_parent.wood1_txt.text = ((WoodGrant + " wood / ") + Time) + " seconds";
_parent.wood2_txt.text = "Total Wood Produced: " + _root.container_mc.level_mc[_parent.Building].WoodProduced;
}
if (_parent._parent.BuildingName == "Teir 1 Mine") {
Time = Math.round(_root.container_mc.level_mc[_parent.Building].ProduceSet / 40);
GoldGrant = _root.Produce_Mine1D1 + (_root.Produce_Mine1B1 * _root.container_mc.level_mc[_parent.Building].Workers);
_parent.gold1_txt.text = ((GoldGrant + " gold / ") + Time) + " seconds";
_parent.gold2_txt.text = "Total Gold Produced: " + _root.container_mc.level_mc[_parent.Building].GoldProduced;
StoneGrant = _root.Produce_Mine1D2 + (_root.Produce_Mine1B2 * _root.container_mc.level_mc[_parent.Building].Workers);
_parent.stone1_txt.text = ((StoneGrant + " stone / ") + Time) + " seconds";
_parent.stone2_txt.text = "Total Stone Produced: " + _root.container_mc.level_mc[_parent.Building].StoneProduced;
}
Symbol 1458 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1494 MovieClip Frame 1
if (_root.User_Teir >= 3) {
gotoAndStop ("Allow");
}
Symbol 1494 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1494 MovieClip Frame 3
sniper_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_11_Food) && (_root.User_Gold >= _root.Costs_array.Unit_11_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_11_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_11_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[_parent.Building].production[i] == "None") {
_root.container_mc.level_mc[_parent.Building].production[i] = "Sniper";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_11_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_11_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_11_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_11_Wood;
}
}
};
laser_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_12_Food) && (_root.User_Gold >= _root.Costs_array.Unit_12_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_12_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_12_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[_parent.Building].production[i] == "None") {
_root.container_mc.level_mc[_parent.Building].production[i] = "LaserTrooper";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_12_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_12_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_12_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_12_Wood;
}
}
};
sniper_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_11_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_11_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_11_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_11_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_11_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_11_Wood;
};
sniper_btn.onRollOut = function () {
_root.ClearDR();
};
sniper_btn.onReleaseOutside = function () {
_root.ClearDR();
};
laser_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_12_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_12_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_12_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_12_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_12_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_12_Wood;
};
laser_btn.onRollOut = function () {
_root.ClearDR();
};
laser_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1499 MovieClip Frame 11
stop();
Symbol 1501 MovieClip Frame 10
stop();
Symbol 1503 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_A_1 + 2);
Symbol 1503 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1504 MovieClip Frame 1
_btn.enabled = false;
Symbol 1504 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_A1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_A1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_A1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_A1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_A1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_A1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_A1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_A1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_A1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_A1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_A1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_A1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_A1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_A1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_A1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1504 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_A1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1506 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_B_1 + 2);
Symbol 1506 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1507 MovieClip Frame 1
_btn.enabled = false;
Symbol 1507 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_B1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_B1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_B1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_B1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_B1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_B1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_B1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_B1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_B1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_B1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_B1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_B1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_B1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_B1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_B1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1507 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_B1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1509 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_C_1 + 2);
Symbol 1509 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1510 MovieClip Frame 1
_btn.enabled = false;
Symbol 1510 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_C1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_C1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_C1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_C1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_C1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_C1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_C1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_C1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_C1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_C1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_C1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_C1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_C1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_C1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_C1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1510 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_C1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1512 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_D_1 + 2);
Symbol 1512 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1513 MovieClip Frame 1
_btn.enabled = false;
Symbol 1513 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_D1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_D1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_D1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_D1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_D1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_D1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_D1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_D1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_D1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_D1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_D1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_D1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_D1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_D1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_D1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1513 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_D1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1516 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_E_1 + 2);
Symbol 1516 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1517 MovieClip Frame 1
_btn.enabled = false;
Symbol 1517 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_E1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_E1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_E1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_E1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_E1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_E1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_E1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_E1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_E1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_E1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_E1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_E1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_E1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_E1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_E1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1517 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_E1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1520 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_F_1 + 2);
Symbol 1520 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1521 MovieClip Frame 1
_btn.enabled = false;
Symbol 1521 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_F1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_F1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_F1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_F1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_F1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_F1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_F1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_F1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_F1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_F1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_F1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_F1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_F1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_F1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_F1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1521 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_F1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1524 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_G_1 + 2);
Symbol 1524 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1525 MovieClip Frame 1
_btn.enabled = false;
Symbol 1525 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_G1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_G1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_G1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_G1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_G1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_G1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_G1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_G1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_G1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_G1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_G1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_G1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_G1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_G1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_G1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1525 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_G1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1528 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_H_1 + 2);
Symbol 1528 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1529 MovieClip Frame 1
_btn.enabled = false;
Symbol 1529 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_H1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_H1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_H1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_H1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_H1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_H1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_H1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_H1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_H1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_H1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_H1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_H1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_H1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_H1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_H1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1529 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_H1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1533 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_I_1 + 2);
Symbol 1533 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1534 MovieClip Frame 1
i1.enabled = false;
i2.enabled = false;
i3.enabled = false;
Symbol 1534 MovieClip Frame 2
i1.enabled = true;
i1.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_I1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_I1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_I1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_I1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_I1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_I1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_I1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_I1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_I1_Wood;
}
}
};
i1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_I1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_I1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_I1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_I1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_I1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_I1_Wood;
};
i1.onRollOut = function () {
_root.ClearDR();
};
i1.onReleaseOutside = function () {
_root.ClearDR();
};
i2.enabled = false;
i3.enabled = false;
Symbol 1534 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_I1_Info) {
_root.ClearDR();
}
i1.enabled = false;
i2.enabled = true;
i2.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_I2_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_I2_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_I2_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_I2_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_I2";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_I2_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_I2_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_I2_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_I2_Wood;
}
}
};
i2.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_I2_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_I2_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_I2_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_I2_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_I2_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_I2_Wood;
};
i2.onRollOut = function () {
_root.ClearDR();
};
i2.onReleaseOutside = function () {
_root.ClearDR();
};
i3.enabled = false;
Symbol 1534 MovieClip Frame 4
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_I2_Info) {
_root.ClearDR();
}
i1.enabled = false;
i2.enabled = false;
i3.enabled = true;
i3.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_I3_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_I3_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_I3_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_I3_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_I3";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_I3_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_I3_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_I3_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_I3_Wood;
}
}
};
i3.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_I3_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_I3_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_I3_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_I3_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_I3_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_I3_Wood;
};
i3.onRollOut = function () {
_root.ClearDR();
};
i3.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1534 MovieClip Frame 5
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_I3_Info) {
_root.ClearDR();
}
i1.enabled = false;
i2.enabled = false;
i3.enabled = false;
Symbol 1538 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_J_1 + 2);
Symbol 1538 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1539 MovieClip Frame 1
j1.enabled = false;
j2.enabled = false;
j3.enabled = false;
Symbol 1539 MovieClip Frame 2
j1.enabled = true;
j1.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_J1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_J1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_J1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_J1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_J1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_J1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_J1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_J1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_J1_Wood;
}
}
};
j1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_J1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_J1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_J1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_J1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_J1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_J1_Wood;
};
j1.onRollOut = function () {
_root.ClearDR();
};
j1.onReleaseOutside = function () {
_root.ClearDR();
};
j2.enabled = false;
j3.enabled = false;
Symbol 1539 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_J1_Info) {
_root.ClearDR();
}
j1.enabled = false;
j2.enabled = true;
j2.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_J2_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_J2_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_J2_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_J2_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_J2";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_J2_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_J2_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_J2_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_J2_Wood;
}
}
};
j2.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_J2_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_J2_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_J2_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_J2_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_J2_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_J2_Wood;
};
j2.onRollOut = function () {
_root.ClearDR();
};
j2.onReleaseOutside = function () {
_root.ClearDR();
};
j3.enabled = false;
Symbol 1539 MovieClip Frame 4
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_J2_Info) {
_root.ClearDR();
}
j1.enabled = false;
j2.enabled = false;
j3.enabled = true;
j3.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_J3_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_J3_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_J3_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_J3_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_J3";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_J3_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_J3_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_J3_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_J3_Wood;
}
}
};
j3.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_J3_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_J3_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_J3_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_J3_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_J3_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_J3_Wood;
};
j3.onRollOut = function () {
_root.ClearDR();
};
j3.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1539 MovieClip Frame 5
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_J3_Info) {
_root.ClearDR();
}
j1.enabled = false;
j2.enabled = false;
j3.enabled = false;
Symbol 1543 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_K_1 + 2);
Symbol 1543 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1544 MovieClip Frame 1
k1.enabled = false;
k2.enabled = false;
k3.enabled = false;
Symbol 1544 MovieClip Frame 2
k1.enabled = true;
k1.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_K1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_K1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_K1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_K1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_K1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_K1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_K1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_K1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_K1_Wood;
}
}
};
k1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_K1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_K1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_K1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_K1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_K1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_K1_Wood;
};
k1.onRollOut = function () {
_root.ClearDR();
};
k1.onReleaseOutside = function () {
_root.ClearDR();
};
k2.enabled = false;
k3.enabled = false;
Symbol 1544 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_K1_Info) {
_root.ClearDR();
}
k1.enabled = false;
k2.enabled = true;
k2.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_K2_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_K2_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_K2_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_K2_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_K2";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_K2_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_K2_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_K2_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_K2_Wood;
}
}
};
k2.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_K2_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_K2_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_K2_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_K2_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_K2_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_K2_Wood;
};
k2.onRollOut = function () {
_root.ClearDR();
};
k2.onReleaseOutside = function () {
_root.ClearDR();
};
k3.enabled = false;
Symbol 1544 MovieClip Frame 4
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_K2_Info) {
_root.ClearDR();
}
k1.enabled = false;
k2.enabled = false;
k3.enabled = true;
k3.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_K3_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_K3_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_K3_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_K3_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_K3";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_K3_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_K3_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_K3_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_K3_Wood;
}
}
};
k3.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_K3_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_K3_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_K3_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_K3_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_K3_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_K3_Wood;
};
k3.onRollOut = function () {
_root.ClearDR();
};
k3.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1544 MovieClip Frame 5
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_K3_Info) {
_root.ClearDR();
}
k1.enabled = false;
k2.enabled = false;
k3.enabled = false;
Symbol 1548 MovieClip Frame 1
_parent.gotoAndStop(_root.ResearchLab_L_1 + 2);
Symbol 1548 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1549 MovieClip Frame 1
l1.enabled = false;
l2.enabled = false;
l3.enabled = false;
Symbol 1549 MovieClip Frame 2
l1.enabled = true;
l1.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_L1_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_L1_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_L1_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_L1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_L1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_L1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_L1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_L1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_L1_Wood;
}
}
};
l1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_L1_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_L1_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_L1_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_L1_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_L1_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_L1_Wood;
};
l1.onRollOut = function () {
_root.ClearDR();
};
l1.onReleaseOutside = function () {
_root.ClearDR();
};
l2.enabled = false;
l3.enabled = false;
Symbol 1549 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_L1_Info) {
_root.ClearDR();
}
l1.enabled = false;
l2.enabled = true;
l2.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_L2_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_L2_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_L2_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_L2_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_L2";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_L2_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_L2_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_L2_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_L2_Wood;
}
}
};
l2.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_L2_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_L2_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_L2_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_L2_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_L2_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_L2_Wood;
};
l2.onRollOut = function () {
_root.ClearDR();
};
l2.onReleaseOutside = function () {
_root.ClearDR();
};
l3.enabled = false;
Symbol 1549 MovieClip Frame 4
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_L2_Info) {
_root.ClearDR();
}
l1.enabled = false;
l2.enabled = false;
l3.enabled = true;
l3.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.ResearchLab_L3_Food) && (_root.User_Gold >= _root.Costs_array.ResearchLab_L3_Gold)) && (_root.User_Stone >= _root.Costs_array.ResearchLab_L3_Stone)) && (_root.User_Wood >= _root.Costs_array.ResearchLab_L3_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "ResearchLab_L3";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.ResearchLab_L3_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.ResearchLab_L3_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.ResearchLab_L3_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.ResearchLab_L3_Wood;
}
}
};
l3.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.ResearchLab_L3_Info;
_root.User_DR_Pop = _root.Costs_array.ResearchLab_L3_Pop;
_root.User_DR_Food = _root.Costs_array.ResearchLab_L3_Food;
_root.User_DR_Gold = _root.Costs_array.ResearchLab_L3_Gold;
_root.User_DR_Stone = _root.Costs_array.ResearchLab_L3_Stone;
_root.User_DR_Wood = _root.Costs_array.ResearchLab_L3_Wood;
};
l3.onRollOut = function () {
_root.ClearDR();
};
l3.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1549 MovieClip Frame 5
if (_root.User_DR_Info == _root.Costs_array.ResearchLab_L3_Info) {
_root.ClearDR();
}
l1.enabled = false;
l2.enabled = false;
l3.enabled = false;
Symbol 1560 MovieClip Frame 1
if (_root.User_Teir >= 3) {
gotoAndStop ("Allow");
}
Symbol 1560 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1560 MovieClip Frame 3
laser_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_13_Food) && (_root.User_Gold >= _root.Costs_array.Unit_13_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_13_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_13_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[_parent.Building].production[i] == "None") {
_root.container_mc.level_mc[_parent.Building].production[i] = "LaserTank";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_13_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_13_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_13_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_13_Wood;
}
}
};
laser_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_13_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_13_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_13_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_13_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_13_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_13_Wood;
};
laser_btn.onRollOut = function () {
_root.ClearDR();
};
laser_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1567 MovieClip Frame 1
Percentage = Math.abs(Math.round((_root.User_AirstrikeTimer / _root.User_AirstrikeSet) * 100) - 100);
if (isNaN(Percentage) or (Percentage < 1)) {
Percentage = 1;
}
_parent.timer1_mc.gotoAndStop(Percentage);
Percentage = Math.abs(Math.round((_root.User_MissileLaunchTimer / _root.User_MissileLaunchSet) * 100) - 100);
if (isNaN(Percentage) or (Percentage < 1)) {
Percentage = 1;
}
_parent.timer2_mc.gotoAndStop(Percentage);
Symbol 1567 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1573 MovieClip Frame 11
stop();
Symbol 1575 MovieClip Frame 10
stop();
Symbol 1577 MovieClip Frame 1
_parent.gotoAndStop(_root.TechCenter_B_1 + 2);
Symbol 1577 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1578 MovieClip Frame 1
_btn.enabled = false;
Symbol 1578 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.TechCenter_B1_Food) && (_root.User_Gold >= _root.Costs_array.TechCenter_B1_Gold)) && (_root.User_Stone >= _root.Costs_array.TechCenter_B1_Stone)) && (_root.User_Wood >= _root.Costs_array.TechCenter_B1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "TechCenter_B1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.TechCenter_B1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.TechCenter_B1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.TechCenter_B1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.TechCenter_B1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.TechCenter_B1_Info;
_root.User_DR_Pop = _root.Costs_array.TechCenter_B1_Pop;
_root.User_DR_Food = _root.Costs_array.TechCenter_B1_Food;
_root.User_DR_Gold = _root.Costs_array.TechCenter_B1_Gold;
_root.User_DR_Stone = _root.Costs_array.TechCenter_B1_Stone;
_root.User_DR_Wood = _root.Costs_array.TechCenter_B1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1578 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.TechCenter_B1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1581 MovieClip Frame 1
_parent.gotoAndStop(_root.TechCenter_D_1 + 2);
Symbol 1581 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1582 MovieClip Frame 1
_btn.enabled = false;
Symbol 1582 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.TechCenter_D1_Food) && (_root.User_Gold >= _root.Costs_array.TechCenter_D1_Gold)) && (_root.User_Stone >= _root.Costs_array.TechCenter_D1_Stone)) && (_root.User_Wood >= _root.Costs_array.TechCenter_D1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "TechCenter_D1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.TechCenter_D1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.TechCenter_D1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.TechCenter_D1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.TechCenter_D1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.TechCenter_D1_Info;
_root.User_DR_Pop = _root.Costs_array.TechCenter_D1_Pop;
_root.User_DR_Food = _root.Costs_array.TechCenter_D1_Food;
_root.User_DR_Gold = _root.Costs_array.TechCenter_D1_Gold;
_root.User_DR_Stone = _root.Costs_array.TechCenter_D1_Stone;
_root.User_DR_Wood = _root.Costs_array.TechCenter_D1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1582 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.TechCenter_D1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1585 MovieClip Frame 1
_parent.gotoAndStop(_root.TechCenter_A_1 + 2);
Symbol 1585 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1586 MovieClip Frame 1
_btn.enabled = false;
Symbol 1586 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.TechCenter_A1_Food) && (_root.User_Gold >= _root.Costs_array.TechCenter_A1_Gold)) && (_root.User_Stone >= _root.Costs_array.TechCenter_A1_Stone)) && (_root.User_Wood >= _root.Costs_array.TechCenter_A1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "TechCenter_A1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.TechCenter_A1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.TechCenter_A1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.TechCenter_A1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.TechCenter_A1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.TechCenter_A1_Info;
_root.User_DR_Pop = _root.Costs_array.TechCenter_A1_Pop;
_root.User_DR_Food = _root.Costs_array.TechCenter_A1_Food;
_root.User_DR_Gold = _root.Costs_array.TechCenter_A1_Gold;
_root.User_DR_Stone = _root.Costs_array.TechCenter_A1_Stone;
_root.User_DR_Wood = _root.Costs_array.TechCenter_A1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1586 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.TechCenter_A1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1589 MovieClip Frame 1
_parent.gotoAndStop(_root.TechCenter_C_1 + 2);
Symbol 1589 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1590 MovieClip Frame 1
_btn.enabled = false;
Symbol 1590 MovieClip Frame 2
_btn.enabled = true;
_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.TechCenter_C1_Food) && (_root.User_Gold >= _root.Costs_array.TechCenter_C1_Gold)) && (_root.User_Stone >= _root.Costs_array.TechCenter_C1_Stone)) && (_root.User_Wood >= _root.Costs_array.TechCenter_C1_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "TechCenter_C1";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.TechCenter_C1_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.TechCenter_C1_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.TechCenter_C1_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.TechCenter_C1_Wood;
}
}
};
_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.TechCenter_C1_Info;
_root.User_DR_Pop = _root.Costs_array.TechCenter_C1_Pop;
_root.User_DR_Food = _root.Costs_array.TechCenter_C1_Food;
_root.User_DR_Gold = _root.Costs_array.TechCenter_C1_Gold;
_root.User_DR_Stone = _root.Costs_array.TechCenter_C1_Stone;
_root.User_DR_Wood = _root.Costs_array.TechCenter_C1_Wood;
};
_btn.onRollOut = function () {
_root.ClearDR();
};
_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1590 MovieClip Frame 3
if (_root.User_DR_Info == _root.Costs_array.TechCenter_C1_Info) {
_root.ClearDR();
}
_btn.enabled = false;
Symbol 1592 MovieClip Frame 1
gotoAndStop(_parent.BuildingName);
Building = "Building" + _parent.BuildingNumber;
health_mc.Building = "Building" + _parent.BuildingNumber;
repair_mc.Building = "Building" + _parent.BuildingNumber;
bf1.onRelease = function () {
if (_root.User_Gold >= _root.Costs_array.BF1_Gold) {
_root.User_Food = _root.User_Food + 100;
_root.User_Gold = _root.User_Gold - _root.Costs_array.BF1_Gold;
}
};
bs1.onRelease = function () {
if (_root.User_Gold >= _root.Costs_array.BS1_Gold) {
_root.User_Stone = _root.User_Stone + 100;
_root.User_Gold = _root.User_Gold - _root.Costs_array.BS1_Gold;
}
};
bw1.onRelease = function () {
if (_root.User_Gold >= _root.Costs_array.BW1_Gold) {
_root.User_Wood = _root.User_Wood + 100;
_root.User_Gold = _root.User_Gold - _root.Costs_array.BW1_Gold;
}
};
bf1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.BF1_Info;
_root.User_DR_Gold = _root.Costs_array.BF1_Gold;
};
bf1.onRollOut = function () {
_root.ClearDR();
};
bf1.onReleaseOutside = function () {
_root.ClearDR();
};
bs1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.BS1_Info;
_root.User_DR_Gold = _root.Costs_array.BS1_Gold;
};
bs1.onRollOut = function () {
_root.ClearDR();
};
bs1.onReleaseOutside = function () {
_root.ClearDR();
};
bw1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.BW1_Info;
_root.User_DR_Gold = _root.Costs_array.BW1_Gold;
};
bw1.onRollOut = function () {
_root.ClearDR();
};
bw1.onReleaseOutside = function () {
_root.ClearDR();
};
bf5.onRelease = function () {
if (_root.User_Gold >= _root.Costs_array.BF5_Gold) {
_root.User_Food = _root.User_Food + 500;
_root.User_Gold = _root.User_Gold - _root.Costs_array.BF5_Gold;
}
};
bs5.onRelease = function () {
if (_root.User_Gold >= _root.Costs_array.BS5_Gold) {
_root.User_Stone = _root.User_Stone + 500;
_root.User_Gold = _root.User_Gold - _root.Costs_array.BS5_Gold;
}
};
bw5.onRelease = function () {
if (_root.User_Gold >= _root.Costs_array.BW5_Gold) {
_root.User_Wood = _root.User_Wood + 500;
_root.User_Gold = _root.User_Gold - _root.Costs_array.BW5_Gold;
}
};
bf5.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.BF5_Info;
_root.User_DR_Gold = _root.Costs_array.BF5_Gold;
};
bf5.onRollOut = function () {
_root.ClearDR();
};
bf5.onReleaseOutside = function () {
_root.ClearDR();
};
bs5.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.BS5_Info;
_root.User_DR_Gold = _root.Costs_array.BS5_Gold;
};
bs5.onRollOut = function () {
_root.ClearDR();
};
bs5.onReleaseOutside = function () {
_root.ClearDR();
};
bw5.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.BW5_Info;
_root.User_DR_Gold = _root.Costs_array.BW5_Gold;
};
bw5.onRollOut = function () {
_root.ClearDR();
};
bw5.onReleaseOutside = function () {
_root.ClearDR();
};
sf1.onRelease = function () {
if (_root.User_Food >= 100) {
_root.User_Food = _root.User_Food - 100;
_root.User_Gold = _root.User_Gold + _root.Costs_array.SF1_Gold;
}
};
ss1.onRelease = function () {
if (_root.User_Stone >= 100) {
_root.User_Stone = _root.User_Stone - 100;
_root.User_Gold = _root.User_Gold + _root.Costs_array.SS1_Gold;
}
};
sw1.onRelease = function () {
if (_root.User_Wood >= 100) {
_root.User_Wood = _root.User_Wood - 100;
_root.User_Gold = _root.User_Gold + _root.Costs_array.SW1_Gold;
}
};
sf1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.SF1_Info;
_root.User_DR_Gold = _root.Costs_array.SF1_Gold;
};
sf1.onRollOut = function () {
_root.ClearDR();
};
sf1.onReleaseOutside = function () {
_root.ClearDR();
};
ss1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.SS1_Info;
_root.User_DR_Gold = _root.Costs_array.SS1_Gold;
};
ss1.onRollOut = function () {
_root.ClearDR();
};
ss1.onReleaseOutside = function () {
_root.ClearDR();
};
sw1.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.SW1_Info;
_root.User_DR_Gold = _root.Costs_array.SW1_Gold;
};
sw1.onRollOut = function () {
_root.ClearDR();
};
sw1.onReleaseOutside = function () {
_root.ClearDR();
};
sf5.onRelease = function () {
if (_root.User_Food >= 500) {
_root.User_Food = _root.User_Food - 500;
_root.User_Gold = _root.User_Gold + _root.Costs_array.SF5_Gold;
}
};
ss5.onRelease = function () {
if (_root.User_Stone >= 500) {
_root.User_Stone = _root.User_Stone - 500;
_root.User_Gold = _root.User_Gold + _root.Costs_array.SS5_Gold;
}
};
sw5.onRelease = function () {
if (_root.User_Wood >= 500) {
_root.User_Wood = _root.User_Wood - 500;
_root.User_Gold = _root.User_Gold + _root.Costs_array.SW5_Gold;
}
};
sf5.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.SF5_Info;
_root.User_DR_Gold = _root.Costs_array.SF5_Gold;
};
sf5.onRollOut = function () {
_root.ClearDR();
};
sf5.onReleaseOutside = function () {
_root.ClearDR();
};
ss5.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.SS5_Info;
_root.User_DR_Gold = _root.Costs_array.SS5_Gold;
};
ss5.onRollOut = function () {
_root.ClearDR();
};
ss5.onReleaseOutside = function () {
_root.ClearDR();
};
sw5.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.SW5_Info;
_root.User_DR_Gold = _root.Costs_array.SW5_Gold;
};
sw5.onRollOut = function () {
_root.ClearDR();
};
sw5.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1592 MovieClip Frame 2
training_mc.Building = "Building" + _parent.BuildingNumber;
a_mc.Building = "Building" + _parent.BuildingNumber;
b_mc.Building = "Building" + _parent.BuildingNumber;
c_mc.Building = "Building" + _parent.BuildingNumber;
d_mc.Building = "Building" + _parent.BuildingNumber;
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(100 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(150 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(50 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 3
training_mc.Building = "Building" + _parent.BuildingNumber;
swordsman_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_01_Food) && (_root.User_Gold >= _root.Costs_array.Unit_01_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_01_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_01_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Swordsman";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_01_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_01_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_01_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_01_Wood;
}
}
};
spearman_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_02_Food) && (_root.User_Gold >= _root.Costs_array.Unit_02_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_02_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_02_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Spearman";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_02_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_02_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_02_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_02_Wood;
}
}
};
archer_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_03_Food) && (_root.User_Gold >= _root.Costs_array.Unit_03_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_03_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_03_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Archer";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_03_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_03_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_03_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_03_Wood;
}
}
};
swordsman_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_01_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_01_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_01_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_01_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_01_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_01_Wood;
};
swordsman_btn.onRollOut = function () {
_root.ClearDR();
};
swordsman_btn.onReleaseOutside = function () {
_root.ClearDR();
};
spearman_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_02_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_02_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_02_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_02_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_02_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_02_Wood;
};
spearman_btn.onRollOut = function () {
_root.ClearDR();
};
spearman_btn.onReleaseOutside = function () {
_root.ClearDR();
};
archer_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_03_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_03_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_03_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_03_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_03_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_03_Wood;
};
archer_btn.onRollOut = function () {
_root.ClearDR();
};
archer_btn.onReleaseOutside = function () {
_root.ClearDR();
};
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(100 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(50 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(150 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 4
hire_btn.onRelease = function () {
if (((((((_root.User_Pop + _root.Costs_array.Misc_Worker_Pop) <= _root.User_PopCap) && (_root.container_mc.level_mc[Building].Workers < 10)) && (_root.User_Food >= _root.Costs_array.Misc_Worker_Food)) && (_root.User_Gold >= _root.Costs_array.Misc_Worker_Gold)) && (_root.User_Stone >= _root.Costs_array.Misc_Worker_Stone)) && (_root.User_Wood >= _root.Costs_array.Misc_Worker_Wood)) {
_root.User_Pop = _root.User_Pop + _root.Costs_array.Misc_Worker_Pop;
_root.User_Food = _root.User_Food - _root.Costs_array.Misc_Worker_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Misc_Worker_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Misc_Worker_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Misc_Worker_Wood;
_root.container_mc.level_mc[Building].Workers++;
}
};
fire_btn.onRelease = function () {
if (_root.container_mc.level_mc[Building].Workers > 0) {
_root.User_Pop = _root.User_Pop - _root.Costs_array.Misc_Worker_Pop;
_root.container_mc.level_mc[Building].Workers--;
}
};
hire_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Misc_Worker_Info;
_root.User_DR_Pop = _root.Costs_array.Misc_Worker_Pop;
_root.User_DR_Food = _root.Costs_array.Misc_Worker_Food;
_root.User_DR_Gold = _root.Costs_array.Misc_Worker_Gold;
_root.User_DR_Stone = _root.Costs_array.Misc_Worker_Stone;
_root.User_DR_Wood = _root.Costs_array.Misc_Worker_Wood;
};
hire_btn.onRollOut = function () {
_root.ClearDR();
};
hire_btn.onReleaseOutside = function () {
_root.ClearDR();
};
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(50 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(50 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(150 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 5
hire_btn.onRelease = function () {
if (((((((_root.User_Pop + _root.Costs_array.Misc_Worker_Pop) <= _root.User_PopCap) && (_root.container_mc.level_mc[Building].Workers < 10)) && (_root.User_Food >= _root.Costs_array.Misc_Worker_Food)) && (_root.User_Gold >= _root.Costs_array.Misc_Worker_Gold)) && (_root.User_Stone >= _root.Costs_array.Misc_Worker_Stone)) && (_root.User_Wood >= _root.Costs_array.Misc_Worker_Wood)) {
_root.User_Pop = _root.User_Pop + _root.Costs_array.Misc_Worker_Pop;
_root.User_Food = _root.User_Food - _root.Costs_array.Misc_Worker_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Misc_Worker_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Misc_Worker_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Misc_Worker_Wood;
_root.container_mc.level_mc[Building].Workers++;
}
};
fire_btn.onRelease = function () {
if (_root.container_mc.level_mc[Building].Workers > 0) {
_root.User_Pop = _root.User_Pop - _root.Costs_array.Misc_Worker_Pop;
_root.container_mc.level_mc[Building].Workers--;
}
};
hire_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Misc_Worker_Info;
_root.User_DR_Pop = _root.Costs_array.Misc_Worker_Pop;
_root.User_DR_Food = _root.Costs_array.Misc_Worker_Food;
_root.User_DR_Gold = _root.Costs_array.Misc_Worker_Gold;
_root.User_DR_Stone = _root.Costs_array.Misc_Worker_Stone;
_root.User_DR_Wood = _root.Costs_array.Misc_Worker_Wood;
};
hire_btn.onRollOut = function () {
_root.ClearDR();
};
hire_btn.onReleaseOutside = function () {
_root.ClearDR();
};
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(50 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(75 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(100 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 6
hire_btn.onRelease = function () {
if (((((((_root.User_Pop + _root.Costs_array.Misc_Worker_Pop) <= _root.User_PopCap) && (_root.container_mc.level_mc[Building].Workers < 10)) && (_root.User_Food >= _root.Costs_array.Misc_Worker_Food)) && (_root.User_Gold >= _root.Costs_array.Misc_Worker_Gold)) && (_root.User_Stone >= _root.Costs_array.Misc_Worker_Stone)) && (_root.User_Wood >= _root.Costs_array.Misc_Worker_Wood)) {
_root.User_Pop = _root.User_Pop + _root.Costs_array.Misc_Worker_Pop;
_root.User_Food = _root.User_Food - _root.Costs_array.Misc_Worker_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Misc_Worker_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Misc_Worker_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Misc_Worker_Wood;
_root.container_mc.level_mc[Building].Workers++;
}
};
fire_btn.onRelease = function () {
if (_root.container_mc.level_mc[Building].Workers > 0) {
_root.User_Pop = _root.User_Pop - _root.Costs_array.Misc_Worker_Pop;
_root.container_mc.level_mc[Building].Workers--;
}
};
hire_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Misc_Worker_Info;
_root.User_DR_Pop = _root.Costs_array.Misc_Worker_Pop;
_root.User_DR_Food = _root.Costs_array.Misc_Worker_Food;
_root.User_DR_Gold = _root.Costs_array.Misc_Worker_Gold;
_root.User_DR_Stone = _root.Costs_array.Misc_Worker_Stone;
_root.User_DR_Wood = _root.Costs_array.Misc_Worker_Wood;
};
hire_btn.onRollOut = function () {
_root.ClearDR();
};
hire_btn.onReleaseOutside = function () {
_root.ClearDR();
};
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(50 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(100 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(75 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 7
training_mc.Building = "Building" + _parent.BuildingNumber;
swordsman_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_04_Food) && (_root.User_Gold >= _root.Costs_array.Unit_04_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_04_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_04_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "MountedSwordsman";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_04_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_04_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_04_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_04_Wood;
}
}
};
archer_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_05_Food) && (_root.User_Gold >= _root.Costs_array.Unit_05_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_05_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_05_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "MountedArcher";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_05_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_05_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_05_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_05_Wood;
}
}
};
swordsman_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_04_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_04_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_04_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_04_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_04_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_04_Wood;
};
swordsman_btn.onRollOut = function () {
_root.ClearDR();
};
swordsman_btn.onReleaseOutside = function () {
_root.ClearDR();
};
archer_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_05_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_05_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_05_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_05_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_05_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_05_Wood;
};
archer_btn.onRollOut = function () {
_root.ClearDR();
};
archer_btn.onReleaseOutside = function () {
_root.ClearDR();
};
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(150 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(50 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(200 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 8
training_mc.Building = "Building" + _parent.BuildingNumber;
machine_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_06_Food) && (_root.User_Gold >= _root.Costs_array.Unit_06_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_06_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_06_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "MachineGunner";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_06_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_06_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_06_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_06_Wood;
}
}
};
rpg_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_07_Food) && (_root.User_Gold >= _root.Costs_array.Unit_07_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_07_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_07_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "RPGTrooper";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_07_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_07_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_07_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_07_Wood;
}
}
};
machine_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_06_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_06_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_06_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_06_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_06_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_06_Wood;
};
machine_btn.onRollOut = function () {
_root.ClearDR();
};
machine_btn.onReleaseOutside = function () {
_root.ClearDR();
};
rpg_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_07_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_07_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_07_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_07_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_07_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_07_Wood;
};
rpg_btn.onRollOut = function () {
_root.ClearDR();
};
rpg_btn.onReleaseOutside = function () {
_root.ClearDR();
};
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(250 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(300 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(150 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 9
training_mc.Building = "Building" + _parent.BuildingNumber;
a_mc.Building = "Building" + _parent.BuildingNumber;
b_mc.Building = "Building" + _parent.BuildingNumber;
c_mc.Building = "Building" + _parent.BuildingNumber;
d_mc.Building = "Building" + _parent.BuildingNumber;
e_mc.Building = "Building" + _parent.BuildingNumber;
f_mc.Building = "Building" + _parent.BuildingNumber;
g_mc.Building = "Building" + _parent.BuildingNumber;
h_mc.Building = "Building" + _parent.BuildingNumber;
i_mc.Building = "Building" + _parent.BuildingNumber;
j_mc.Building = "Building" + _parent.BuildingNumber;
k_mc.Building = "Building" + _parent.BuildingNumber;
l_mc.Building = "Building" + _parent.BuildingNumber;
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(300 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(400 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(100 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 10
training_mc.Building = "Building" + _parent.BuildingNumber;
humvee_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_08_Food) && (_root.User_Gold >= _root.Costs_array.Unit_08_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_08_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_08_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "Humvee";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_08_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_08_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_08_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_08_Wood;
}
}
};
light_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_09_Food) && (_root.User_Gold >= _root.Costs_array.Unit_09_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_09_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_09_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "LightTank";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_09_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_09_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_09_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_09_Wood;
}
}
};
heavy_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Unit_10_Food) && (_root.User_Gold >= _root.Costs_array.Unit_10_Gold)) && (_root.User_Stone >= _root.Costs_array.Unit_10_Stone)) && (_root.User_Wood >= _root.Costs_array.Unit_10_Wood)) {
i = 0;
ii = false;
while ((i < 8) && (ii == false)) {
if (_root.container_mc.level_mc[Building].production[i] == "None") {
_root.container_mc.level_mc[Building].production[i] = "HeavyTank";
ii = true;
}
i++;
}
if (ii == true) {
_root.User_Food = _root.User_Food - _root.Costs_array.Unit_10_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Unit_10_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Unit_10_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Unit_10_Wood;
}
}
};
humvee_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_08_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_08_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_08_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_08_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_08_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_08_Wood;
};
humvee_btn.onRollOut = function () {
_root.ClearDR();
};
humvee_btn.onReleaseOutside = function () {
_root.ClearDR();
};
light_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_09_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_09_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_09_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_09_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_09_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_09_Wood;
};
light_btn.onRollOut = function () {
_root.ClearDR();
};
light_btn.onReleaseOutside = function () {
_root.ClearDR();
};
heavy_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Unit_10_Info;
_root.User_DR_Pop = _root.Costs_array.Unit_10_Pop;
_root.User_DR_Food = _root.Costs_array.Unit_10_Food;
_root.User_DR_Gold = _root.Costs_array.Unit_10_Gold;
_root.User_DR_Stone = _root.Costs_array.Unit_10_Stone;
_root.User_DR_Wood = _root.Costs_array.Unit_10_Wood;
};
heavy_btn.onRollOut = function () {
_root.ClearDR();
};
heavy_btn.onReleaseOutside = function () {
_root.ClearDR();
};
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(250 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(300 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(150 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 11
training_mc.Building = "Building" + _parent.BuildingNumber;
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(500 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(500 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(500 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1592 MovieClip Frame 12
training_mc.Building = "Building" + _parent.BuildingNumber;
a_mc.Building = "Building" + _parent.BuildingNumber;
b_mc.Building = "Building" + _parent.BuildingNumber;
c_mc.Building = "Building" + _parent.BuildingNumber;
d_mc.Building = "Building" + _parent.BuildingNumber;
sell_btn.onRelease = function () {
Percentage = (_root.container_mc.level_mc[Building].health / _root.container_mc.level_mc[Building].healthMax) / 2;
_root.User_Gold = _root.User_Gold + Math.round(500 * Percentage);
_root.User_Stone = _root.User_Stone + Math.round(500 * Percentage);
_root.User_Wood = _root.User_Wood + Math.round(500 * Percentage);
_root.container_mc.level_mc[Building].health = 0;
};
Symbol 1593 MovieClip Frame 1
if (Key.isDown(27) or Key.isDown(192)) {
_parent.Escape();
}
Symbol 1593 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1594 MovieClip Frame 1
if (isNaN(_root.container_mc.level_mc[Building].health) or (_root.container_mc.level_mc[Building].health <= 0)) {
_parent._parent.Escape();
}
Symbol 1594 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1614 MovieClip Frame 1
if (_root.User_Teir >= 2) {
gotoAndStop ("Allow");
}
Symbol 1614 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1614 MovieClip Frame 3
barracks_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_07_Food) && (_root.User_Gold >= _root.Costs_array.Building_07_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_07_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_07_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_07_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_07_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_07_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_07_Wood;
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
_root.PlaceBuilding("Teir2_Barracks", "Teir 2 Barracks", _parent._parent.BuildingX, _parent._parent.BuildingY, 1, false);
_parent._parent.Escape();
}
};
researchlab_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_08_Food) && (_root.User_Gold >= _root.Costs_array.Building_08_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_08_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_08_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_08_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_08_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_08_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_08_Wood;
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
_root.PlaceBuilding("Teir2_ResearchLab", "Teir 2 ResearchLab", _parent._parent.BuildingX, _parent._parent.BuildingY, 1, false);
_parent._parent.Escape();
}
};
warfactory_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_09_Food) && (_root.User_Gold >= _root.Costs_array.Building_09_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_09_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_09_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_09_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_09_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_09_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_09_Wood;
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
_root.PlaceBuilding("Teir2_WarFactory", "Teir 2 WarFactory", _parent._parent.BuildingX, _parent._parent.BuildingY, 1, false);
_parent._parent.Escape();
}
};
barracks_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_07_Info;
_root.User_DR_Food = _root.Costs_array.Building_07_Food;
_root.User_DR_Gold = _root.Costs_array.Building_07_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_07_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_07_Wood;
};
barracks_btn.onRollOut = function () {
_root.ClearDR();
};
barracks_btn.onReleaseOutside = function () {
_root.ClearDR();
};
researchlab_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_08_Info;
_root.User_DR_Food = _root.Costs_array.Building_08_Food;
_root.User_DR_Gold = _root.Costs_array.Building_08_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_08_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_08_Wood;
};
researchlab_btn.onRollOut = function () {
_root.ClearDR();
};
researchlab_btn.onReleaseOutside = function () {
_root.ClearDR();
};
warfactory_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_09_Info;
_root.User_DR_Food = _root.Costs_array.Building_09_Food;
_root.User_DR_Gold = _root.Costs_array.Building_09_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_09_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_09_Wood;
};
warfactory_btn.onRollOut = function () {
_root.ClearDR();
};
warfactory_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1618 MovieClip Frame 1
if (_root.User_Teir >= 3) {
gotoAndStop ("Allow");
}
Symbol 1618 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1618 MovieClip Frame 3
commandpost_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_10_Food) && (_root.User_Gold >= _root.Costs_array.Building_10_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_10_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_10_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_10_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_10_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_10_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_10_Wood;
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
_root.PlaceBuilding("Teir3_CommandPost", "Teir 3 CommandPost", _parent._parent.BuildingX, _parent._parent.BuildingY, 1, false);
_parent._parent.Escape();
}
};
techcenter_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_11_Food) && (_root.User_Gold >= _root.Costs_array.Building_11_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_11_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_11_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_11_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_11_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_11_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_11_Wood;
_root.RemoveBuilding(_parent._parent.BuildingNumber, _parent._parent.MyDepth);
_root.PlaceBuilding("Teir3_TechCenter", "Teir 3 TechCenter", _parent._parent.BuildingX, _parent._parent.BuildingY, 1, false);
_parent._parent.Escape();
}
};
commandpost_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_10_Info;
_root.User_DR_Food = _root.Costs_array.Building_10_Food;
_root.User_DR_Gold = _root.Costs_array.Building_10_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_10_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_10_Wood;
};
commandpost_btn.onRollOut = function () {
_root.ClearDR();
};
commandpost_btn.onReleaseOutside = function () {
_root.ClearDR();
};
techcenter_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_11_Info;
_root.User_DR_Food = _root.Costs_array.Building_11_Food;
_root.User_DR_Gold = _root.Costs_array.Building_11_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_11_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_11_Wood;
};
techcenter_btn.onRollOut = function () {
_root.ClearDR();
};
techcenter_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1620 MovieClip Frame 1
stop();
armoury_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_01_Food) && (_root.User_Gold >= _root.Costs_array.Building_01_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_01_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_01_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_01_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_01_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_01_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_01_Wood;
_root.RemoveBuilding(_parent.BuildingNumber, _parent.MyDepth);
_root.PlaceBuilding("Teir1_Armoury", "Teir 1 Armoury", _parent.BuildingX, _parent.BuildingY, 1, false);
_parent.Escape();
}
};
barracks_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_02_Food) && (_root.User_Gold >= _root.Costs_array.Building_02_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_02_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_02_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_02_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_02_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_02_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_02_Wood;
_root.RemoveBuilding(_parent.BuildingNumber, _parent.MyDepth);
_root.PlaceBuilding("Teir1_Barracks", "Teir 1 Barracks", _parent.BuildingX, _parent.BuildingY, 1, false);
_parent.Escape();
}
};
farm_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_03_Food) && (_root.User_Gold >= _root.Costs_array.Building_03_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_03_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_03_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_03_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_03_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_03_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_03_Wood;
_root.RemoveBuilding(_parent.BuildingNumber, _parent.MyDepth);
_root.PlaceBuilding("Teir1_Farm", "Teir 1 Farm", _parent.BuildingX, _parent.BuildingY, 1, false);
_parent.Escape();
}
};
lumbermill_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_04_Food) && (_root.User_Gold >= _root.Costs_array.Building_04_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_04_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_04_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_04_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_04_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_04_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_04_Wood;
_root.RemoveBuilding(_parent.BuildingNumber, _parent.MyDepth);
_root.PlaceBuilding("Teir1_LumberMill", "Teir 1 LumberMill", _parent.BuildingX, _parent.BuildingY, 1, false);
_parent.Escape();
}
};
mine_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_05_Food) && (_root.User_Gold >= _root.Costs_array.Building_05_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_05_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_05_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_05_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_05_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_05_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_05_Wood;
_root.RemoveBuilding(_parent.BuildingNumber, _parent.MyDepth);
_root.PlaceBuilding("Teir1_Mine", "Teir 1 Mine", _parent.BuildingX, _parent.BuildingY, 1, false);
_parent.Escape();
}
};
stables_btn.onRelease = function () {
if ((((_root.User_Food >= _root.Costs_array.Building_06_Food) && (_root.User_Gold >= _root.Costs_array.Building_06_Gold)) && (_root.User_Stone >= _root.Costs_array.Building_06_Stone)) && (_root.User_Wood >= _root.Costs_array.Building_06_Wood)) {
_root.User_Food = _root.User_Food - _root.Costs_array.Building_06_Food;
_root.User_Gold = _root.User_Gold - _root.Costs_array.Building_06_Gold;
_root.User_Stone = _root.User_Stone - _root.Costs_array.Building_06_Stone;
_root.User_Wood = _root.User_Wood - _root.Costs_array.Building_06_Wood;
_root.RemoveBuilding(_parent.BuildingNumber, _parent.MyDepth);
_root.PlaceBuilding("Teir1_Stables", "Teir 1 Stables", _parent.BuildingX, _parent.BuildingY, 1, false);
_parent.Escape();
}
};
armoury_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_01_Info;
_root.User_DR_Food = _root.Costs_array.Building_01_Food;
_root.User_DR_Gold = _root.Costs_array.Building_01_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_01_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_01_Wood;
};
armoury_btn.onRollOut = function () {
_root.ClearDR();
};
armoury_btn.onReleaseOutside = function () {
_root.ClearDR();
};
barracks_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_02_Info;
_root.User_DR_Food = _root.Costs_array.Building_02_Food;
_root.User_DR_Gold = _root.Costs_array.Building_02_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_02_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_02_Wood;
};
barracks_btn.onRollOut = function () {
_root.ClearDR();
};
barracks_btn.onReleaseOutside = function () {
_root.ClearDR();
};
farm_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_03_Info;
_root.User_DR_Food = _root.Costs_array.Building_03_Food;
_root.User_DR_Gold = _root.Costs_array.Building_03_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_03_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_03_Wood;
};
farm_btn.onRollOut = function () {
_root.ClearDR();
};
farm_btn.onReleaseOutside = function () {
_root.ClearDR();
};
lumbermill_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_04_Info;
_root.User_DR_Food = _root.Costs_array.Building_04_Food;
_root.User_DR_Gold = _root.Costs_array.Building_04_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_04_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_04_Wood;
};
lumbermill_btn.onRollOut = function () {
_root.ClearDR();
};
lumbermill_btn.onReleaseOutside = function () {
_root.ClearDR();
};
mine_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_05_Info;
_root.User_DR_Food = _root.Costs_array.Building_05_Food;
_root.User_DR_Gold = _root.Costs_array.Building_05_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_05_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_05_Wood;
};
mine_btn.onRollOut = function () {
_root.ClearDR();
};
mine_btn.onReleaseOutside = function () {
_root.ClearDR();
};
stables_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Building_06_Info;
_root.User_DR_Food = _root.Costs_array.Building_06_Food;
_root.User_DR_Gold = _root.Costs_array.Building_06_Gold;
_root.User_DR_Stone = _root.Costs_array.Building_06_Stone;
_root.User_DR_Wood = _root.Costs_array.Building_06_Wood;
};
stables_btn.onRollOut = function () {
_root.ClearDR();
};
stables_btn.onReleaseOutside = function () {
_root.ClearDR();
};
t1_btn.onRelease = function () {
gotoAndStop ("T1");
};
t2_btn.onRelease = function () {
gotoAndStop ("T2");
};
t3_btn.onRelease = function () {
gotoAndStop ("T3");
};
health_mc.Building = "Building" + _parent.BuildingNumber;
Symbol 1620 MovieClip Frame 2
t1_btn.onRelease = function () {
gotoAndStop ("T1");
};
t2_btn.onRelease = function () {
gotoAndStop ("T2");
};
t3_btn.onRelease = function () {
gotoAndStop ("T3");
};
Symbol 1620 MovieClip Frame 3
t1_btn.onRelease = function () {
gotoAndStop ("T1");
};
t2_btn.onRelease = function () {
gotoAndStop ("T2");
};
t3_btn.onRelease = function () {
gotoAndStop ("T3");
};
Symbol 1621 MovieClip Frame 1
stop();
_root.User_DR_Pop = 0;
_root.User_DR_Food = 0;
_root.User_DR_Gold = 0;
_root.User_DR_Stone = 0;
_root.User_DR_Wood = 0;
Symbol 1621 MovieClip Frame 2
gotoAndStop(_root.UserAction);
close_btn.useHandCursor = false;
close_btn.onRelease = function () {
Escape();
};
cover_btn.useHandCursor = false;
Symbol 1621 MovieClip Frame 3
function Escape() {
_root.UserAction = "None";
gotoAndStop ("close");
_root.ClearDR();
}
stop();
Symbol 1621 MovieClip Frame 4
function Escape() {
_root.UserAction = "None";
gotoAndStop ("close");
_root.ClearDR();
}
stop();
Symbol 1641 Button
on (release) {
getURL ("http://www.godlygamer.com/", "_blank");
}
Symbol 1644 Button
on (release) {
getURL ("http://www.maxgames.com/", "_blank");
}
Symbol 1701 MovieClip Frame 1
stop();
Symbol 1705 MovieClip Frame 1
stop();
if (_root.MenuVariables_array.customGame != "On") {
gotoAndStop ("Allow");
}
Symbol 1705 MovieClip Frame 2
username_txt.onKillFocus = function () {
if (username_txt.text == "") {
username_txt.text = "<username>";
}
_root.TextFocus = false;
};
username_txt.onSetFocus = function () {
if (username_txt.text == "<username>") {
username_txt.text = "";
}
_root.TextFocus = true;
};
finalScore_txt.text = ("Final Score: " + _root.TotalPoints) + " Points\n";
submit_mc.submit_btn.onRelease = function () {
if ((username_txt.text != "") && (username_txt.text != "<username>")) {
submit_mc.gotoAndStop("send");
System.security.loadPolicyFile("http://www.godlygamer.com/Highscores/policy.xml");
SendVars = new LoadVars();
targetObject = new LoadVars();
SendVars.Check = "send";
SendVars.SecondCheck = "KSDM41";
SendVars.Table = _root.Comp_Difficulty;
SendVars.SendName = username_txt.text;
SendVars.SendScore = _root.TotalPoints;
targetObject.onLoad = function (success) {
if (success) {
_root.ScoreResult = this.resulted;
gotoAndStop ("sentS");
} else {
gotoAndStop ("sentF");
}
};
SendVars.sendAndLoad("http://www.godlygamer.com/Highscores/conflictresolution2.php", targetObject, "POST");
}
};
Symbol 1705 MovieClip Frame 3
if (_root.ScoreResult != "nohighscore") {
info_txt.text = ("You've made it into the\nTop " + _root.ScoreResult) + " Highscores.";
} else {
info_txt.text = "You've failed to set\na Highscore.";
}
Symbol 1707 MovieClip Frame 1
stop();
Symbol 1707 MovieClip Frame 2
stop();
continue_btn.onRelease = function () {
_root.PauseGame = false;
_root.TBB_mc.pause_mc.gotoAndStop("unpaused");
gotoAndStop ("close");
};
matchstats_btn.onRelease = function () {
gotoAndStop ("Match");
};
options_btn.onRelease = function () {
gotoAndStop ("Options");
};
restart_btn.onRelease = function () {
gotoAndStop ("AskRestart");
};
exit_btn.onRelease = function () {
gotoAndStop ("AskExit");
};
cover_btn.useHandCursor = false;
Symbol 1707 MovieClip Frame 3
yes_btn.onRelease = function () {
if (_root.MenuVariables_array.customGame != "On") {
_root.MenuVariables_array.gamesPlayed++;
_root.MenuVariables_array.gamesLost++;
}
_root.AbortGameFunctions();
_root.gotoAndStop("GameSettings");
};
no_btn.onRelease = function () {
gotoAndStop ("open");
};
Symbol 1707 MovieClip Frame 4
yes_btn.onRelease = function () {
if (_root.MenuVariables_array.customGame != "On") {
_root.MenuVariables_array.gamesPlayed++;
_root.MenuVariables_array.gamesLost++;
}
_root.AbortGameFunctions();
_root.gotoAndStop("GameMenu");
};
no_btn.onRelease = function () {
gotoAndStop ("open");
};
Symbol 1707 MovieClip Frame 5
function AddCommas(CommasTo) {
number_str = String(CommasTo);
newnumber_str = "";
newestnumber_str = "";
while (number_str.length > 3) {
newnumber_str = "," + number_str.substr(number_str.length - 3, 3);
number_str = number_str.substr(0, number_str.length - 3);
newestnumber_str = newnumber_str + newestnumber_str;
}
newestnumber_str = number_str + newestnumber_str;
return(newestnumber_str);
}
back_btn.onRelease = function () {
gotoAndStop ("open");
};
uTrain_txt.text = AddCommas(_root.MatchVars_array.unitsTrained);
uKill_txt.text = AddCommas(_root.MatchVars_array.unitsKilled);
uLost_txt.text = AddCommas(_root.MatchVars_array.unitsLost);
bCreate_txt.text = AddCommas(_root.MatchVars_array.buildingsCreated);
bKill_txt.text = AddCommas(_root.MatchVars_array.buildingsDestroyed);
bLost_txt.text = AddCommas(_root.MatchVars_array.buildingsLost);
rCollect_txt.text = AddCommas(_root.MatchVars_array.resourcesCollected);
Hours = 0;
Minutes = 0;
Seconds = 0;
TimePlayed = _root.MatchVars_array.timePlayed;
while (TimePlayed >= 3600) {
Hours++;
TimePlayed = TimePlayed - 3600;
}
while (TimePlayed >= 60) {
Minutes++;
TimePlayed = TimePlayed - 60;
}
while (TimePlayed >= 1) {
Seconds++;
TimePlayed--;
}
if (Hours < 10) {
Hours = "0" + Hours;
}
if (Minutes < 10) {
Minutes = "0" + Minutes;
}
if (Seconds < 10) {
Seconds = "0" + Seconds;
}
tPlayed_txt.text = (((Hours + " : ") + Minutes) + " : ") + Seconds;
Symbol 1707 MovieClip Frame 6
back_btn.onRelease = function () {
gotoAndStop ("open");
};
musicOF_mc.Type = 1;
musicOF_mc.Set1 = "Music_array";
musicOF_mc.Set2 = "status";
soundOF_mc.Type = 1;
soundOF_mc.Set1 = "Sound_array";
soundOF_mc.Set2 = "status";
Symbol 1707 MovieClip Frame 7
_root.TotalPoints = 0;
if ((_root.MatchVars_array.unitsLost != 0) && (_root.MatchVars_array.unitsTrained != 0)) {
UnitRatio = ((1 - (_root.MatchVars_array.unitsLost / _root.MatchVars_array.unitsTrained)) / 2) + 0.5;
_root.TotalPoints = _root.TotalPoints + (UnitRatio * (_root.MatchVars_array.unitsKilled * 25000));
}
if ((_root.MatchVars_array.buildingsLost != 0) && (_root.MatchVars_array.buildingsCreated != 0)) {
BuildingRatio = ((1 - (_root.MatchVars_array.buildingsLost / _root.MatchVars_array.buildingsCreated)) / 2) + 0.5;
_root.TotalPoints = _root.TotalPoints + (UnitRatio * (_root.MatchVars_array.buildingsDestroyed * 50000));
}
if ((_root.MatchVars_array.resourcesCollected != 0) && (_root.MatchVars_array.timePlayed != 0)) {
_root.TotalPoints = _root.TotalPoints + (_root.MatchVars_array.resourcesCollected / _root.MatchVars_array.timePlayed);
}
_root.TotalPoints = Math.round(_root.TotalPoints);
menu_btn.onRelease = function () {
delete _root.TotalPoints;
delete _root.ScoreResult;
_root.AbortGameFunctions();
_root.gotoAndStop("GameMenu");
};
cover_btn.useHandCursor = false;
Symbol 1707 MovieClip Frame 8
_root.TotalPoints = 0;
if ((_root.MatchVars_array.unitsLost != 0) && (_root.MatchVars_array.unitsTrained != 0)) {
UnitRatio = ((1 - (_root.MatchVars_array.unitsLost / _root.MatchVars_array.unitsTrained)) / 2) + 0.5;
_root.TotalPoints = _root.TotalPoints + (UnitRatio * (_root.MatchVars_array.unitsKilled * 25000));
}
if ((_root.MatchVars_array.buildingsLost != 0) && (_root.MatchVars_array.buildingsCreated != 0)) {
BuildingRatio = ((1 - (_root.MatchVars_array.buildingsLost / _root.MatchVars_array.buildingsCreated)) / 2) + 0.5;
_root.TotalPoints = _root.TotalPoints + (UnitRatio * (_root.MatchVars_array.buildingsDestroyed * 50000));
}
if ((_root.MatchVars_array.resourcesCollected != 0) && (_root.MatchVars_array.timePlayed != 0)) {
_root.TotalPoints = _root.TotalPoints + (_root.MatchVars_array.resourcesCollected / _root.MatchVars_array.timePlayed);
}
_root.TotalPoints = Math.round(_root.TotalPoints);
menu_btn.onRelease = function () {
delete _root.TotalPoints;
delete _root.ScoreResult;
_root.AbortGameFunctions();
_root.gotoAndStop("GameMenu");
};
cover_btn.useHandCursor = false;
Symbol 1725 MovieClip Frame 1
stop();
rectangle_btn.onRelease = function () {
_root.User_Formation = "Rectangle";
gotoAndStop ("rectangle");
};
Symbol 1725 MovieClip Frame 2
stop();
square_btn.onRelease = function () {
_root.User_Formation = "Square";
gotoAndStop ("square");
};
Symbol 1732 MovieClip Frame 1
stop();
stance1_btn.onRelease = function () {
_root.SetStance("Aggressive");
};
stance2_btn.onRelease = function () {
_root.SetStance("Defensive");
};
stance3_btn.onRelease = function () {
_root.SetStance("Passive");
};
Symbol 1732 MovieClip Frame 2
stop();
stance2_btn.onRelease = function () {
_root.SetStance("Defensive");
};
stance3_btn.onRelease = function () {
_root.SetStance("Passive");
};
Symbol 1732 MovieClip Frame 3
stop();
stance1_btn.onRelease = function () {
_root.SetStance("Aggressive");
};
stance3_btn.onRelease = function () {
_root.SetStance("Passive");
};
Symbol 1732 MovieClip Frame 4
stop();
stance1_btn.onRelease = function () {
_root.SetStance("Aggressive");
};
stance2_btn.onRelease = function () {
_root.SetStance("Defensive");
};
Symbol 1733 MovieClip Frame 1
stop();
place_btn.onRelease = function () {
if (((_root.UserAction == "None") && (_root.PauseGame == false)) && (Buildings1_array.TC_Keep != 0)) {
_root.PlaceFoundation();
_root.UserAction = "Place";
}
};
place_btn.onRollOver = function () {
_root.User_DR_Info = _root.Costs_array.Misc_Foundation_Info;
_root.User_DR_Pop = _root.Costs_array.Misc_Foundation_Pop;
_root.User_DR_Food = _root.Costs_array.Misc_Foundation_Food;
_root.User_DR_Gold = _root.Costs_array.Misc_Foundation_Gold;
_root.User_DR_Stone = _root.Costs_array.Misc_Foundation_Stone;
_root.User_DR_Wood = _root.Costs_array.Misc_Foundation_Wood;
};
place_btn.onRollOut = function () {
_root.ClearDR();
};
place_btn.onReleaseOutside = function () {
_root.ClearDR();
};
Symbol 1733 MovieClip Frame 2
function Recharged() {
gotoAndStop ("charged");
}
stop();
Symbol 1738 MovieClip Frame 1
_root.container_mc.level_mc._x = -(_root.TBS_mc.MM_mc.view_mc._x / 0.055);
_root.container_mc.level_mc._y = -(_root.TBS_mc.MM_mc.view_mc._y / 0.055);
Symbol 1738 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1740 MovieClip Frame 1
view_btn.onPress = function () {
if (_root.PauseGame == false) {
_parent.view_mc.startDrag(false, -28.9, -22, 28.9, 22);
}
};
view_btn.onRelease = function () {
_parent.view_mc.stopDrag();
};
view_btn.onReleaseOutside = function () {
_parent.view_mc.stopDrag();
};
Symbol 1741 MovieClip Frame 1
view_mc.swapDepths(20000000);
map_btn.useHandCursor = false;
map_btn.onRelease = function () {
_root.GetViewLocation(_xmouse * 20, _ymouse * 20);
};
Symbol 1751 MovieClip Frame 1
stop();
pause_btn.onRelease = function () {
if ((_root.UserPassiveAction == "None") && (_root.UserAction == "None")) {
_root.PauseGame = true;
_root.gameMenu_mc.gotoAndStop("open");
gotoAndStop ("paused");
}
};
Symbol 1751 MovieClip Frame 2
stop();
play_btn.onRelease = function () {
_root.PauseGame = false;
_root.gameMenu_mc.gotoAndStop("close");
gotoAndStop ("unpaused");
};
Symbol 1754 MovieClip Frame 1
link_btn.onRelease = function () {
if (_root.PauseGame == true) {
getURL ("http://www.godlygamer.com/", "_blank");
} else if ((_root.UserPassiveAction == "None") && (_root.UserAction == "None")) {
_root.PauseGame = true;
_root.gameMenu_mc.gotoAndStop("open");
_parent._parent.pause_mc.gotoAndStop("paused");
getURL ("http://www.godlygamer.com/", "_blank");
}
};
Symbol 1758 MovieClip Frame 1
link_btn.onRelease = function () {
if (_root.PauseGame == true) {
getURL ("http://www.maxgames.com/", "_blank");
} else if ((_root.UserPassiveAction == "None") && (_root.UserAction == "None")) {
_root.PauseGame = true;
_root.gameMenu_mc.gotoAndStop("open");
_parent._parent.pause_mc.gotoAndStop("paused");
getURL ("http://www.maxgames.com/", "_blank");
}
};
Symbol 1777 MovieClip Frame 1
stop();
Symbol 1777 MovieClip Frame 415
stop();
_root.User_Advancing = false;
_root.User_Teir = 2;
_root.Produce_Farm1 = _root.Produce_Farm1 - 40;
_root.Produce_Mine1 = _root.Produce_Mine1 - 40;
_root.Produce_Mill1 = _root.Produce_Mill1 - 40;
Symbol 1777 MovieClip Frame 828
stop();
_root.User_Advancing = false;
_root.User_Teir = 3;
_root.Produce_Farm1 = _root.Produce_Farm1 - 40;
_root.Produce_Mine1 = _root.Produce_Mine1 - 40;
_root.Produce_Mill1 = _root.Produce_Mill1 - 40;
Symbol 1779 MovieClip Frame 1
display_txt.text = (_root.User_Pop + "/") + _root.User_PopCap;
Symbol 1779 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1780 MovieClip Frame 1
teir_mc.gotoAndStop("Teir" + _root.User_Teir);
Symbol 1788 MovieClip Frame 1
stop();
Symbol 1789 MovieClip Frame 1
Cost = _root.User_DR_Pop;
resource_txt.text = Cost;
if ((_root.User_Pop + Cost) <= _root.User_PopCap) {
sphere_mc.gotoAndStop("green");
} else {
sphere_mc.gotoAndStop("red");
}
Symbol 1789 MovieClip Frame 2
gotoAndPlay (2);
Symbol 1790 MovieClip Frame 1
if (_root.User_DR_Pop > 0) {
gotoAndPlay (3);
}
Symbol 1790 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1790 MovieClip Frame 3
if (_root.User_DR_Pop <= 0) {
gotoAndPlay (1);
}
Symbol 1790 MovieClip Frame 4
gotoAndPlay (3);
Symbol 1792 MovieClip Frame 1
Cost = _root.User_DR_Food;
resource_txt.text = Cost;
if ((_root.User_Food - Cost) >= 0) {
sphere_mc.gotoAndStop("green");
} else {
sphere_mc.gotoAndStop("red");
}
Symbol 1792 MovieClip Frame 2
gotoAndPlay (2);
Symbol 1793 MovieClip Frame 1
if (_root.User_DR_Food > 0) {
gotoAndPlay (3);
}
Symbol 1793 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1793 MovieClip Frame 3
if (_root.User_DR_Food <= 0) {
gotoAndPlay (1);
}
Symbol 1793 MovieClip Frame 4
gotoAndPlay (3);
Symbol 1795 MovieClip Frame 1
Cost = _root.User_DR_Gold;
resource_txt.text = Cost;
if ((_root.User_Gold - Cost) >= 0) {
sphere_mc.gotoAndStop("green");
} else {
sphere_mc.gotoAndStop("red");
}
Symbol 1795 MovieClip Frame 2
gotoAndPlay (2);
Symbol 1796 MovieClip Frame 1
if (_root.User_DR_Gold > 0) {
gotoAndPlay (3);
}
Symbol 1796 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1796 MovieClip Frame 3
if (_root.User_DR_Gold <= 0) {
gotoAndPlay (1);
}
Symbol 1796 MovieClip Frame 4
gotoAndPlay (3);
Symbol 1798 MovieClip Frame 1
Cost = _root.User_DR_Stone;
resource_txt.text = Cost;
if ((_root.User_Stone - Cost) >= 0) {
sphere_mc.gotoAndStop("green");
} else {
sphere_mc.gotoAndStop("red");
}
Symbol 1798 MovieClip Frame 2
gotoAndPlay (2);
Symbol 1799 MovieClip Frame 1
if (_root.User_DR_Stone > 0) {
gotoAndPlay (3);
}
Symbol 1799 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1799 MovieClip Frame 3
if (_root.User_DR_Stone <= 0) {
gotoAndPlay (1);
}
Symbol 1799 MovieClip Frame 4
gotoAndPlay (3);
Symbol 1801 MovieClip Frame 1
Cost = _root.User_DR_Wood;
resource_txt.text = Cost;
if ((_root.User_Wood - Cost) >= 0) {
sphere_mc.gotoAndStop("green");
} else {
sphere_mc.gotoAndStop("red");
}
Symbol 1801 MovieClip Frame 2
gotoAndPlay (2);
Symbol 1802 MovieClip Frame 1
if (_root.User_DR_Wood > 0) {
gotoAndPlay (3);
}
Symbol 1802 MovieClip Frame 2
gotoAndPlay (1);
Symbol 1802 MovieClip Frame 3
if (_root.User_DR_Wood <= 0) {
gotoAndPlay (1);
}
Symbol 1802 MovieClip Frame 4
gotoAndPlay (3);
Symbol 1949 MovieClip Frame 2
text_txt.text = ("Purchase 100 Food for " + _root.Costs_array.BF1_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 3
text_txt.text = ("Purchase 100 Stone for " + _root.Costs_array.BS1_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 4
text_txt.text = ("Purchase 100 Wood for " + _root.Costs_array.BW1_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 5
text_txt.text = ("Purchase 500 Food for " + _root.Costs_array.BF5_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 6
text_txt.text = ("Purchase 500 Stone for " + _root.Costs_array.BS5_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 7
text_txt.text = ("Purchase 500 Wood for " + _root.Costs_array.BW5_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 8
text_txt.text = ("Trade 100 Food for " + _root.Costs_array.SF1_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 9
text_txt.text = ("Trade 100 Stone for " + _root.Costs_array.SS1_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 10
text_txt.text = ("Trade 100 Wood for " + _root.Costs_array.SW1_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 11
text_txt.text = ("Trade 500 Food for " + _root.Costs_array.SF5_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 12
text_txt.text = ("Trade 500 Stone for " + _root.Costs_array.SS5_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 13
text_txt.text = ("Trade 500 Wood for " + _root.Costs_array.SW5_Gold) + " Gold.";
Symbol 1949 MovieClip Frame 18
text_txt.text = "Order this building to repair itself.\n";
text_txt.text = text_txt.text + (("You repair at a rate of " + _root.User_Repair) + " health.");
Symbol 1949 MovieClip Frame 21
Health = Math.round(_root.Unit1_Swordsman.health);
Damage = _root.Unit1_Swordsman.damage;
Speed = _root.Unit1_Swordsman.speed;
Range = _root.Unit1_Swordsman.range;
Time = Math.round(_root.Unit1_Swordsman.time / 40);
Counters = _root.Unit1_Swordsman.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 22
Health = Math.round(_root.Unit1_Spearman.health);
Damage = _root.Unit1_Spearman.damage;
Speed = _root.Unit1_Spearman.speed;
Range = _root.Unit1_Spearman.range;
Time = Math.round(_root.Unit1_Spearman.time / 40);
Counters = _root.Unit1_Spearman.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 23
Health = Math.round(_root.Unit1_Archer.health);
Damage = _root.Unit1_Archer.damage;
Speed = _root.Unit1_Archer.speed;
Range = _root.Unit1_Archer.range;
Time = Math.round(_root.Unit1_Archer.time / 40);
Counters = _root.Unit1_Archer.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 24
Health = Math.round(_root.Unit1_MountedSwordsman.health);
Damage = _root.Unit1_MountedSwordsman.damage;
Speed = _root.Unit1_MountedSwordsman.speed;
Range = _root.Unit1_MountedSwordsman.range;
Time = Math.round(_root.Unit1_MountedSwordsman.time / 40);
Counters = _root.Unit1_MountedSwordsman.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 25
Health = Math.round(_root.Unit1_MountedArcher.health);
Damage = _root.Unit1_MountedArcher.damage;
Speed = _root.Unit1_MountedArcher.speed;
Range = _root.Unit1_MountedArcher.range;
Time = Math.round(_root.Unit1_MountedArcher.time / 40);
Counters = _root.Unit1_MountedArcher.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 26
Health = Math.round(_root.Unit1_MachineGunner.health);
Damage = _root.Unit1_MachineGunner.damage;
Speed = _root.Unit1_MachineGunner.speed;
Range = _root.Unit1_MachineGunner.range;
Time = Math.round(_root.Unit1_MachineGunner.time / 40);
Counters = _root.Unit1_MachineGunner.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 27
Health = Math.round(_root.Unit1_RPGTrooper.health);
Damage = _root.Unit1_RPGTrooper.damage;
Speed = _root.Unit1_RPGTrooper.speed;
Range = _root.Unit1_RPGTrooper.range;
Time = Math.round(_root.Unit1_RPGTrooper.time / 40);
Counters = _root.Unit1_RPGTrooper.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 28
Health = Math.round(_root.Unit1_Humvee.health);
Damage = _root.Unit1_Humvee.damage;
Speed = _root.Unit1_Humvee.speed;
Range = _root.Unit1_Humvee.range;
Time = Math.round(_root.Unit1_Humvee.time / 40);
Counters = _root.Unit1_Humvee.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 29
Health = Math.round(_root.Unit1_LightTank.health);
Damage = _root.Unit1_LightTank.damage;
Speed = _root.Unit1_LightTank.speed;
Range = _root.Unit1_LightTank.range;
Time = Math.round(_root.Unit1_LightTank.time / 40);
Counters = _root.Unit1_LightTank.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 30
Health = Math.round(_root.Unit1_HeavyTank.health);
Damage = _root.Unit1_HeavyTank.damage;
Speed = _root.Unit1_HeavyTank.speed;
Range = _root.Unit1_HeavyTank.range;
Time = Math.round(_root.Unit1_HeavyTank.time / 40);
Counters = _root.Unit1_HeavyTank.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 31
Health = Math.round(_root.Unit1_MountedArcher.health);
Damage = _root.Unit1_MountedArcher.damage;
Speed = _root.Unit1_MountedArcher.speed;
Range = _root.Unit1_MountedArcher.range;
Time = Math.round(_root.Unit1_MountedArcher.time / 40);
Counters = "All Infantry";
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 32
Health = Math.round(_root.Unit1_LaserTrooper.health);
Damage = _root.Unit1_LaserTrooper.damage;
Speed = _root.Unit1_LaserTrooper.speed;
Range = _root.Unit1_LaserTrooper.range;
Time = Math.round(_root.Unit1_LaserTrooper.time / 40);
Counters = _root.Unit1_LaserTrooper.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1949 MovieClip Frame 33
Health = Math.round(_root.Unit1_LaserTank.health);
Damage = _root.Unit1_LaserTank.damage;
Speed = _root.Unit1_LaserTank.speed;
Range = _root.Unit1_LaserTank.range;
Time = Math.round(_root.Unit1_LaserTank.time / 40);
Counters = _root.Unit1_LaserTank.counter.toString();
Counters = Counters.split(",").join(", ");
text_txt.text = ((((("Health: " + Health) + " - Damage: ") + Damage) + " - Speed: ") + Speed) + newline;
text_txt.text = text_txt.text + (((("Range: " + Range) + " - Training Time: ") + Time) + " seconds\n");
text_txt.text = text_txt.text + (("Counters: " + Counters) + ".");
Symbol 1950 MovieClip Frame 1
descriptions_mc.gotoAndStop(_root.User_DR_Info);
Symbol 1950 MovieClip Frame 2
gotoAndPlay (1);