Frame 1
_root.kongregateServices.connect();
MochiAd.showPreGameAd({id:"b0aded9ef0f82b14", res:"800x600"});
releaseMode = true;
mochiAds = true;
kongregate = false;
mindJolt = false;
hallPass = false;
mochiScore = true;
var _mochiads_game_id = "b0aded9ef0f82b14";
Stage.showMenu = false;
MovieClip.prototype.tabEnabled = false;
Button.prototype.tabEnabled = false;
TextField.prototype.tabEnabled = false;
NumericStepper.prototype.tabEnabled = false;
ComboBox.prototype.tabEnabled = false;
Frame 2
var preloaderOn = true;
if (preloaderOn == true) {
stop();
}
Instance of Symbol 81 MovieClip in Frame 2
onClipEvent (load) {
}
onClipEvent (enterFrame) {
var p = (this._parent.getBytesLoaded() / this._parent.getBytesTotal());
percent = Math.floor(p * 100);
bar._width = p * 500;
if (percent >= 100) {
this._parent.play();
}
}
Frame 5
if (releaseMode == true) {
if (mindJolt == true) {
ScoreAPI = new LocalConnection();
}
}
Instance of Symbol 222 MovieClip [themesong_credits] in Frame 5
onClipEvent (load) {
stop();
}
Instance of Symbol 871 MovieClip [CheckBox] in Frame 5
//component parameters
onClipEvent (construct) {
label = "CheckBox";
labelPlacement = "right";
selected = false;
}
Instance of Symbol 957 MovieClip [ComboBox] in Frame 5
//component parameters
onClipEvent (construct) {
editable = false;
rowCount = 5;
restrict = "";
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] in Frame 5
//component parameters
onClipEvent (construct) {
maximum = 10;
minimum = 0;
stepSize = 1;
value = 0;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 50 MovieClip [RadioButton] in Frame 5
//component parameters
onClipEvent (construct) {
data = "";
groupName = "radioGroup";
label = "Radio Button";
labelPlacement = "right";
selected = false;
}
Frame 6
Frame 7
function konamiCode() {
_root.kongregateStats.submit("konamiCode", 1);
stopAllSounds();
if (theSuperDirector != undefined) {
theSuperDirector.removeMovieClip();
var _local3 = theSuperDirector.getDepth();
theSuperDirector = this.attachMovie("mc_superDirector", "theSuperDirector", _local3);
} else {
theSuperDirector = this.attachMovie("mc_superDirector", "theSuperDirector", getNextHighestDepth());
}
theSuperDirector.showCutScene(K.END_MOVIE);
}
var theSuperDirector;
Mouse.show();
Frame 8
stop();
Instance of Symbol 957 MovieClip [ComboBox] "levelDifficulty" in Frame 9
//component parameters
onClipEvent (construct) {
data = [];
data[0] = 0;
data[1] = 1;
data[2] = 2;
editable = false;
labels = [];
labels[0] = "Super Easy";
labels[1] = "Super Normal";
labels[2] = "Super Hard";
rowCount = 5;
restrict = "";
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
onClipEvent (load) {
this.selectedIndex = 1;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "levelStepper" in Frame 9
//component parameters
onClipEvent (construct) {
maximum = 9;
minimum = 1;
stepSize = 1;
value = 1;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Frame 10
currentLevel = -1;
displayLevel = Math.abs(currentLevel);
Instance of Symbol 1713 MovieClip [NumericStepper] "r_s" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 50;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_e" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 400;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_f" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 30;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_r" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 0;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_m" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 400;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_g" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 30;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_ff" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 30;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_c" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 30;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "increase_time" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 10;
minimum = 1;
stepSize = 1;
value = 2;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "spawn_time" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 10;
minimum = 1;
stepSize = 1;
value = 2;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 957 MovieClip [ComboBox] "zombiesOn" in Frame 10
//component parameters
onClipEvent (construct) {
data = [];
data[0] = true;
data[1] = false;
editable = false;
labels = [];
labels[0] = "Yes";
labels[1] = "No";
rowCount = 2;
restrict = "";
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "time_night" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 10;
stepSize = 10;
value = 80;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "time_day" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 10;
stepSize = 10;
value = 150;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "spawn_rate" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 20;
minimum = 0;
stepSize = 1;
value = 3;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "increase_rate" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 5;
minimum = 0;
stepSize = 1;
value = 1;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "surviveDays" in Frame 10
//component parameters
onClipEvent (construct) {
maximum = 99;
minimum = 1;
stepSize = 1;
value = 5;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Frame 12
stop();
Instance of Symbol 1713 MovieClip [NumericStepper] "r_f" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 30;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_s" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 50;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_r" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 0;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_m" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 400;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_g" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 30;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_ff" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 30;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "r_e" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 400;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "increase_time" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 10;
minimum = 1;
stepSize = 1;
value = 2;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "spawn_time" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 10;
minimum = 1;
stepSize = 1;
value = 2;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 957 MovieClip [ComboBox] "zombiesOn" in Frame 12
//component parameters
onClipEvent (construct) {
data = [];
data[0] = true;
data[1] = false;
editable = false;
labels = [];
labels[0] = "Yes";
labels[1] = "No";
rowCount = 2;
restrict = "";
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "time_night" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 80;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "time_day" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 999;
minimum = 0;
stepSize = 10;
value = 150;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "spawn_rate" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 20;
minimum = 0;
stepSize = 1;
value = 3;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 1713 MovieClip [NumericStepper] "increase_rate" in Frame 12
//component parameters
onClipEvent (construct) {
maximum = 5;
minimum = 0;
stepSize = 1;
value = 1;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Frame 16
gotoAndStop ("game");
Symbol 9 MovieClip [BrdrShdw] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "shadowColor");
Symbol 11 MovieClip [BrdrFace] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "buttonColor");
Symbol 14 MovieClip [BrdrBlk] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "borderColor");
Symbol 16 MovieClip [BrdrHilght] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "highlightColor");
Symbol 19 MovieClip [Defaults] Frame 1
#initclip 131
Object.registerClass("Defaults", mx.skins.halo.Defaults);
#endinitclip
Symbol 20 MovieClip [UIObjectExtensions] Frame 1
#initclip 132
Object.registerClass("UIObjectExtensions", mx.core.ext.UIObjectExtensions);
#endinitclip
Symbol 21 MovieClip [UIObject] Frame 1
#initclip 133
Object.registerClass("UIObject", mx.core.UIObject);
#endinitclip
stop();
Symbol 24 Button
on (keyPress "<Tab>") {
this.tabHandler();
}
Symbol 25 MovieClip Frame 1
#initclip 134
Object.registerClass("FocusManager", mx.managers.FocusManager);
if (_root.focusManager == undefined) {
_root.createClassObject(mx.managers.FocusManager, "focusManager", mx.managers.DepthManager.highestDepth--);
}
#endinitclip
Symbol 26 MovieClip [FocusRect] Frame 1
#initclip 135
Object.registerClass("FocusRect", mx.skins.halo.FocusRect);
#endinitclip
Symbol 27 MovieClip [FocusManager] Frame 1
#initclip 136
Object.registerClass("FocusManager", mx.managers.FocusManager);
#endinitclip
stop();
Symbol 28 MovieClip [UIComponentExtensions] Frame 1
#initclip 137
Object.registerClass("UIComponentExtensions", mx.core.ext.UIComponentExtensions);
#endinitclip
Symbol 29 MovieClip [UIComponent] Frame 1
#initclip 138
Object.registerClass("UIComponent", mx.core.UIComponent);
#endinitclip
stop();
Symbol 30 MovieClip [SimpleButton] Frame 1
#initclip 139
Object.registerClass("SimpleButton", mx.controls.SimpleButton);
#endinitclip
stop();
Symbol 31 MovieClip [Border] Frame 1
#initclip 140
Object.registerClass("Border", mx.skins.Border);
#endinitclip
stop();
Symbol 32 MovieClip [RectBorder] Frame 1
#initclip 141
mx.skins.SkinElement.registerElement(mx.skins.RectBorder.symbolName, Object(mx.skins.RectBorder));
Object.registerClass("RectBorder", mx.skins.halo.RectBorder);
#endinitclip
stop();
Symbol 33 MovieClip [ButtonSkin] Frame 1
#initclip 142
Object.registerClass("ButtonSkin", mx.skins.halo.ButtonSkin);
#endinitclip
Symbol 34 MovieClip [Button] Frame 1
#initclip 143
Object.registerClass("Button", mx.controls.Button);
#endinitclip
stop();
Instance of Symbol 30 MovieClip [SimpleButton] in Symbol 34 MovieClip [Button] Frame 2
//component parameters
onClipEvent (initialize) {
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 39 MovieClip [RadioThemeColor1] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 43 MovieClip [RadioThemeColor2] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 49 MovieClip [RadioButtonAssets] Frame 1
#initclip 144
mx.controls.RadioButton.prototype.adjustFocusRect = function () {
var _local4 = this._parent.focus_mc;
var _local2 = this.iconName;
var _local3 = this.getStyle("themeColor");
if (_local3 == undefined) {
_local3 = 8453965 /* 0x80FF4D */;
}
var _local5 = _local2._width + 4;
var _local6 = _local2._height + 4;
_local4.setSize(_local5, _local6, 8, 100, _local3);
var _local8 = _local2._x;
var _local7 = _local2._y;
_local4.move((this.x - 2) + _local8, (this.y + _local7) - 2);
};
#endinitclip
Symbol 50 MovieClip [RadioButton] Frame 1
#initclip 145
Object.registerClass("RadioButton", mx.controls.RadioButton);
#endinitclip
stop();
Instance of Symbol 34 MovieClip [Button] "foo" in Symbol 50 MovieClip [RadioButton] Frame 2
//component parameters
onClipEvent (initialize) {
icon = "";
label = "Button";
labelPlacement = "right";
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 2844 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.2");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
}
return(_local4);
}
}
Symbol 2845 MovieClip [__Packages.K] Frame 0
class K
{
static var RESEARCH_NUGGET, level_total;
function K () {
}
static function propertyToBuilding(i) {
switch (i) {
case _COALPLANT :
return("CoalPlant");
case _FFPLANT :
return("FFPlant");
case _GASPLANT :
return("GasPlant");
case _NUCLEARPLANT :
return("NuclearPlant");
case _WINDPLANT :
return("WindPlant");
case _SOLARPLANT :
return("SolarPlant");
case _GEOPLANT :
return("GeoPlant");
case _SUPERGEOPLANT :
return("superGeoPlant");
case _FARM :
return("Farm");
case _MINE :
return("Mine");
case _COALMINE :
return("CoalMine");
case _SUPERFARM :
return("superFarm");
case _NUCLEARDUMP :
return("NuclearDump");
case _OILGASWELL :
return("OilGasWell");
case _FACTORY :
return("Factory");
case _LAB :
return("Lab");
case _LANDFILL :
return("Landfill");
case _FLOODLIGHTS :
return("Floodlights");
case _TESLACOIL :
return("TeslaCoil");
case _GUNTURRET :
return("GunTurret");
case _FLAMETURRET :
return("FlameTurret");
}
return("");
}
static function setTheQuality(s) {
_quality = s.toUpperCase();
QUALITY = s.toUpperCase();
}
static function saveResearch() {
RESEARCH_NUGGET = new ResearchNugget();
RESEARCH_NUGGET.snapShotLevels();
}
static function getDiffStr(d) {
switch (d) {
case DIFF_EASY :
return("Easy");
case DIFF_NORMAL :
return("Normal");
case DIFF_HARD :
return("Hard");
}
}
static function restoreResearch() {
level_f_gasoline = RESEARCH_NUGGET.level_f_gasoline;
level_f_diesel = RESEARCH_NUGGET.level_f_diesel;
level_f_electric = RESEARCH_NUGGET.level_f_electric;
level_f_ethanol = RESEARCH_NUGGET.level_f_ethanol;
level_f_natgas = RESEARCH_NUGGET.level_f_natgas;
level_f_fuelcell = RESEARCH_NUGGET.level_f_fuelcell;
level_coalplant = RESEARCH_NUGGET.level_coalplant;
level_ffplant = RESEARCH_NUGGET.level_ffplant;
level_gasplant = RESEARCH_NUGGET.level_gasplant;
level_solarplant = RESEARCH_NUGGET.level_solarplant;
level_hydroplant = RESEARCH_NUGGET.level_hydroplant;
level_geoplant = RESEARCH_NUGGET.level_geoplant;
level_nuclearplant = RESEARCH_NUGGET.level_nuclearplant;
level_windplant = RESEARCH_NUGGET.level_windplant;
level_mine = RESEARCH_NUGGET.level_mine;
level_coalmine = RESEARCH_NUGGET.level_mine;
level_farm = RESEARCH_NUGGET.level_farm;
level_gunturret = RESEARCH_NUGGET.level_gunturret;
level_flameturret = RESEARCH_NUGGET.level_flameturret;
level_teslacoil = RESEARCH_NUGGET.level_teslacoil;
level_factory = RESEARCH_NUGGET.level_factory;
level_lab = RESEARCH_NUGGET.level_lab;
level_landfill = RESEARCH_NUGGET.level_landfill;
level_oilgaswell = RESEARCH_NUGGET.level_oilgaswell;
level_floodlights = RESEARCH_NUGGET.level_floodlights;
level_recyclingcenter = RESEARCH_NUGGET.level_recyclingcenter;
level_recycling = RESEARCH_NUGGET.level_recycling;
level_r_metal = RESEARCH_NUGGET.level_r_metal;
level_r_PETE = RESEARCH_NUGGET.level_r_PETE;
level_r_gas = RESEARCH_NUGGET.level_r_gas;
level_r_bioFuel = RESEARCH_NUGGET.level_r_bioFuel;
}
static function killResearch() {
level_f_gasoline = 1;
level_f_diesel = 0;
level_f_electric = 0;
level_f_ethanol = 0;
level_f_natgas = 0;
level_f_fuelcell = 0;
level_coalplant = 0;
level_ffplant = 0;
level_gasplant = 0;
level_solarplant = 0;
level_hydroplant = 0;
level_geoplant = 0;
level_nuclearplant = 0;
level_windplant = 0;
level_mine = 0;
level_coalmine = 0;
level_farm = 0;
level_gunturret = 0;
level_flameturret = 0;
level_teslacoil = 0;
level_factory = 0;
level_lab = 0;
level_landfill = 0;
level_oilgaswell = 0;
level_floodlights = 0;
level_recyclingcenter = 0;
level_recycling = 0;
level_r_metal = 0;
level_r_PETE = 0;
level_r_gas = 0;
level_r_bioFuel = 0;
}
static function propertyToBuildingCode(i) {
switch (i) {
case START :
return(FORTRESS);
case _COALPLANT :
return(COALPLANT);
case _FFPLANT :
return(FFPLANT);
case _GASPLANT :
return(GASPLANT);
case _NUCLEARPLANT :
return(NUCLEARPLANT);
case _WINDPLANT :
return(WINDPLANT);
case _SOLARPLANT :
return(SOLARPLANT);
case _GEOPLANT :
return(GEOPLANT);
case _FARM :
return(FARM);
case _MINE :
return(MINE);
case _SUPERFARM :
return(SUPERFARM);
case _NUCLEARDUMP :
return(NUCLEARDUMP);
case _OILGASWELL :
return(OILGASWELL);
case _FACTORY :
return(FACTORY);
case _LAB :
return(LAB);
case _LANDFILL :
return(LANDFILL);
case _FLOODLIGHTS :
return(FLOODLIGHTS);
case _TESLACOIL :
return(TESLACOIL);
case _GUNTURRET :
return(GUNTURRET);
case _FLAMETURRET :
return(FLAMETURRET);
case _RECYCLINGCENTER :
return(RECYCLINGCENTER);
}
return(-100);
}
static function getE_Usage(theName) {
var _local2 = K["level_" + theName.toLowerCase()];
var _local1 = getEfficiency(theName, _local2);
return(Math.round(_local1 * 10) / 10);
}
static function getS_Usage(theName) {
var _local2 = K["level_" + theName.toLowerCase()];
var _local1 = getEmissions(theName, _local2);
return(Math.round(_local1 * 10) / 10);
}
static function getEmissions(theName, level) {
var _local2 = K["S_OUT_" + theName.toUpperCase()];
var _local3 = K["U_EM_" + theName.toUpperCase()];
var _local1 = 0;
while (_local1 < level) {
_local2 = _local2 * _local3;
_local1++;
}
if ((_local2 == undefined) || (_local2 == NaN)) {
_local2 = 0;
}
return(_local2);
}
static function updateEfficiency(theName) {
var _local2 = getLevels(theName);
var _local1 = getEfficiency(theName, _local2);
return(_local1);
}
static function updateEmissions(theName) {
var _local2 = getLevels(theName);
var _local1 = getEmissions(theName, _local2);
return(_local1);
}
static function updateRecycling() {
return(level_recycling);
}
static function getEfficiency(theName, level) {
var _local2 = K["E_OUT_" + theName.toUpperCase()];
var _local3 = K["U_EF_" + theName.toUpperCase()];
var _local1 = 0;
while (_local1 < level) {
_local2 = _local2 * _local3;
_local1++;
}
if ((_local2 == undefined) || (_local2 == NaN)) {
_local2 = 0;
}
return(_local2);
}
static function error(c, f, msg) {
}
static function success(c, f, msg) {
if (VERBOSE) {
}
}
static function adjustDestRange(destX, destY) {
if (destY < INT_OFF_Y_PX) {
destY = INT_OFF_Y_PX;
} else if (destY > (Stage.height - (TILE_SIZE * 2))) {
destY = Stage.height - (TILE_SIZE * 2);
}
if (destX < TILE_SIZE) {
destX = TILE_SIZE;
} else if (destX > (Stage.width - INT_OFF_X_PX)) {
destX > (Stage.width - INT_OFF_X_PX);
}
return([destX, destY]);
}
static function getDist(thing1, thing2) {
var _local2 = thing1._x - thing2._x;
var _local1 = thing1._y - thing2._y;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
}
static function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
static function getLocalRawPath() {
var _local1 = _url;
_local1 = chopEndPath(_local1);
return(_local1);
}
static function chopEndPath(somePath) {
var _local3;
var _local1 = somePath.length;
while (_local1 > 0) {
if ((somePath.charAt(_local1 - 1) == "/") || (somePath.charCodeAt(_local1 - 1) == 92)) {
_local3 = _local1;
_local1 = 0;
}
_local1--;
}
var _local4 = somePath.slice(0, _local3);
return(_local4);
}
static function codeToState(code) {
switch (code) {
case PAUSE_CODE :
return(PAUSE_STATE);
case MENU_CODE :
return(MENU_STATE);
}
}
static function getStateName(state) {
var _local1 = "";
switch (state) {
case PAUSE_STATE :
_local1 = "paused";
break;
case MENU_STATE :
_local1 = "menu";
break;
case GAME_STATE :
_local1 = "game";
break;
case START_STATE :
_local1 = "start";
}
return(_local1);
}
static function getFuelLevel(fuel) {
var _local1 = getFuelLevels();
return(_local1[fuel]);
}
static function getRecycleLevels() {
var _local1 = new Array();
_local1[0] = level_r_metal;
_local1[1] = level_r_PETE;
_local1[2] = level_r_gas;
_local1[3] = level_r_bioFuel;
return(_local1);
}
static function getFuelLevels() {
var _local1 = new Array();
_local1[0] = level_f_gasoline;
_local1[1] = level_f_diesel;
_local1[2] = level_f_electric;
_local1[3] = level_f_ethanol;
_local1[4] = level_f_natgas;
_local1[5] = level_f_fuelcell;
return(_local1);
}
static function getLevels(s) {
var _local1;
_local1 = K["level_" + s.toLowerCase()];
return(_local1);
}
static function countUpgrades() {
var _local1 = 0;
_local1 = _local1 + (((level_f_gasoline + level_f_ethanol) + level_f_natgas) + level_f_electric);
_local1 = _local1 + (((((level_coalplant + level_gasplant) + level_solarplant) + level_geoplant) + level_nuclearplant) + level_windplant);
_local1 = _local1 + level_recyclingcenter;
level_total = _local1;
return(level_total);
}
static function upgradeLevel(target, upgrade) {
var _local4 = K["level_" + target.toLowerCase()];
var _local2;
if (target.toLowerCase() == "fuel") {
K["level_f_" + upgrade.toLowerCase()]++;
_local2 = K["level_f_" + upgrade.toLowerCase()];
} else if (upgrade.toLowerCase() == "recycling") {
K["level_r_" + upgrade.toLowerCase()]++;
_local2 = K["level_r_" + upgrade.toLowerCase()]++;
} else if (upgrade.toLowerCase() == "both") {
K["level_" + target.toLowerCase()]++;
_local2 = K["level_" + target.toLowerCase()];
}
return(_local2);
}
static function getUpgradeCost(s) {
var _local1 = new Array();
var _local3 = K["level_" + s.toLowerCase()];
if (_local3 < 3) {
_local1[0] = K["COST_U_" + s.toUpperCase()][0];
_local1[1] = K["COST_U_" + s.toUpperCase()][1];
_local1[2] = K["COST_U_" + s.toUpperCase()][2];
var _local2 = 0;
while (_local2 < _local3) {
_local1[0] = _local1[0] * _local1[2];
_local1[1] = _local1[1] * _local1[2];
_local2++;
}
} else {
_local1 = undefined;
}
return(_local1);
}
static function getRecyclingCost(s) {
return(COST_U_RECYCLING);
}
static function getFuelCost(s) {
var _local1 = new Array();
var _local3 = K["level_f_" + s.toLowerCase()];
if (_local3 < 3) {
_local1[0] = K["COST_U_" + s.toUpperCase()][0];
_local1[1] = K["COST_U_" + s.toUpperCase()][1];
_local1[2] = K["COST_U_" + s.toUpperCase()][2];
var _local2 = 0;
while (_local2 < _local3) {
_local1[0] = _local1[0] * _local1[2];
_local1[1] = _local1[1] * _local1[2];
_local2++;
}
} else {
_local1 = undefined;
}
return(_local1);
}
static function getCost(s) {
var _local1 = new Array();
_local1[0] = K["COST_" + s.toUpperCase()][0];
_local1[1] = K["COST_" + s.toUpperCase()][1];
_local1[2] = K["COST_" + s.toUpperCase()][2];
return(_local1);
}
static function testUnd4(amt, amt2, amt3, amt4, str) {
if ((((amt == undefined) || (amt2 == undefined)) || (amt3 == undefined)) || (amt4 == undefined)) {
if (amt == undefined) {
}
if (amt2 == undefined) {
}
if (amt3 == undefined) {
}
if (amt4 == undefined) {
}
return(false);
}
return(true);
}
static function testUnd3(amt, amt2, amt3, str) {
if (((amt == undefined) || (amt2 == undefined)) || (amt3 == undefined)) {
if (amt == undefined) {
}
if (amt2 == undefined) {
}
if (amt3 == undefined) {
}
return(false);
}
return(true);
}
static function testUnd2(amt, amt2, str) {
if ((amt == undefined) || (amt2 == undefined)) {
if (amt == undefined) {
}
if (amt2 == undefined) {
}
return(false);
}
return(true);
}
static function testUnd(amt, str) {
if ((amt == undefined) || (amt == NaN)) {
return(false);
}
return(true);
}
static var EASY_BOARD_ID = "f389d0d8bcd97e20";
static var NORMAL_BOARD_ID = "b11cddc9a40c3ab5";
static var HARD_BOARD_ID = "648696a0f53247a2";
static var DIFF_EASY = 0;
static var DIFF_NORMAL = 1;
static var DIFF_HARD = 2;
static var DIFF_IMPOSSIBLE = 3;
static var VERBOSE = false;
static var FRAME_RATE = 30;
static var SCROLL_SPEED = 10;
static var MAX_LEVEL = 15;
static var TILESET_WIDTH = 26;
static var TILESET_HEIGHT = 25;
static var TILE_SIZE = 16;
static var TILESET_WIDTH_PX = TILESET_WIDTH * TILE_SIZE;
static var TILESET_HEIGHT_PX = TILESET_HEIGHT * TILE_SIZE;
static var STAGE_WIDTH = Math.floor(Stage.width / TILE_SIZE);
static var STAGE_HEIGHT = Math.floor(Stage.height / TILE_SIZE);
static var TILE_MILES = 7.5;
static var HORIZONTAL = 1;
static var VERTICAL = 2;
static var FANCYCURSOR = false;
static var QUALITY = "medium";
static var INT_OFF_Y_PX = 80;
static var INT_OFF_X_PX = 140;
static var TERRAIN_OFFSET_Y = 3;
static var MAX_X_TILE = 20;
static var MAX_Y_TILE = 15;
static var MAX_X_UNIT_TILE = MAX_X_TILE * 2;
static var MAX_Y_UNIT_TILE = MAX_Y_TILE * 2;
static var INT_OFF_Y = INT_OFF_Y_PX / TILE_SIZE;
static var INT_OFF_X = INT_OFF_X_PX / TILE_SIZE;
static var SCROLL_FUDGE_X = 11;
static var SCROLL_FUDGE_Y = 10;
static var DEMOLISH = 0;
static var REPAIR = 1;
static var CLICK = 2;
static var BUILD = 3;
static var MOVE = 4;
static var ATTACK = 5;
static var IDLE = 0;
static var GETGARBAGE = 1;
static var GETWASTE = 2;
static var GETRESOURCE = 2;
static var DUMPGARBAGE = 3;
static var DELIVERRESOURCE = 4;
static var IDLE_GARBAGE = 5;
static var IDLE_RESOURCE = 6;
static var GOTOSPILL = 7;
static var CLEANUPSPILL = 8;
static var GOTOBUILDING = 9;
static var ATTACKTASK = 10;
static var ATTACKPOSITION = 11;
static var DYING = 12;
static var RUNAWAY = 13;
static var STARTRUN = 14;
static var LEAVE = 15;
static var NWASTE_MULT = 50;
static var METAL_MULT = 2;
static var GAS_MULT = 5;
static var FF_MULT = 10;
static var COAL_MULT = 10;
static var ENERGY_MULT = 1;
static var FOOD_MULT = 3;
static var RESEARCH_MULT = 3;
static var AVG_MULT = 4.857;
static var ZOMBIEKILL_MULT = 5;
static var POLLUTION_MULT = 100;
static var CLEANUP_MULT = POLLUTION_MULT / 2;
static var GARBAGEEAT_MULT = 2;
static var SMOG_MULT = 2;
static var GARBAGE_MULT = 1;
static var DMG_EDDERKOP = 1;
static var DMG_RAIDER = 25;
static var DMG_MONSTER_TRUCK = 10;
static var BURN_TIME = 5;
static var WASTE = 104;
static var SCREEN_WIDTH = STAGE_WIDTH - INT_OFF_X;
static var SCREEN_HEIGHT = STAGE_HEIGHT - INT_OFF_Y;
static var SCREEN_WIDTH_PX = Stage.width - INT_OFF_X_PX;
static var SCREEN_HEIGHT_PX = Stage.height - INT_OFF_Y_PX;
static var UP_CODE = 38;
static var DOWN_CODE = 40;
static var LEFT_CODE = 37;
static var RIGHT_CODE = 39;
static var UP_CODE_ = 87;
static var LEFT_CODE_ = 65;
static var RIGHT_CODE_ = 68;
static var DOWN_CODE_ = 83;
static var PAUSE_CODE = -20;
static var MENU_CODE = -21;
static var START_BUTT_CODE = 13;
static var ABUTT_CODE = 32;
static var BBUTT_CODE = 90;
static var CBUTT_CODE = 70;
static var MOUSEBUTT_CODE = -1;
static var MOUSEMOVE_CODE = -2;
static var START_STATE = 2;
static var GAME_STATE = 3;
static var PAUSE_STATE = -1;
static var MENU_STATE = 1;
static var INTRO_MOVIE = 0;
static var END_MOVIE = 1;
static var OUTRO_MOVIE = 2;
static var TILES = 0;
static var PROPERTIES = 1;
static var DIRT = 0;
static var START = 1;
static var GRASS = 2;
static var HARD = 3;
static var STONE = 4;
static var COALSPOT = 5;
static var WATER = 6;
static var GEO = 9;
static var GEO_BIG = 10;
static var OIL = 11;
static var OIL_BIG = 12;
static var _SUPERFARM = 7;
static var _GEOPLANT = 8;
static var _COALPLANT = 13;
static var _FFPLANT = -130;
static var _GASPLANT = 14;
static var _NUCLEARPLANT = 15;
static var _WINDPLANT = 16;
static var _SOLARPLANT = 17;
static var _SUPERGEOPLANT = 18;
static var _SUPERWINDPLANT = 19;
static var _MINE = 20;
static var _FARM = 21;
static var _REYCLINGCENTER = 22;
static var _COALMINE = 23;
static var _NUCLEARDUMP = 38;
static var _OILGASWELL = 39;
static var _FACTORY = 40;
static var _LAB = 41;
static var _LANDFILL = 42;
static var _FLOODLIGHTS = 43;
static var _TESLACOIL = 44;
static var _GUNTURRET = 45;
static var _FLAMETURRET = 46;
static var _RECYCLINGCENTER = 47;
static var _POLLUTION = -9;
static var POLLUTED = 99;
static var SCORCHED = 100;
static var ALT_LOW = -1;
static var ALT_NORM = 0;
static var ALT_HIGH = 1;
static var EDGE_CRATER = -1;
static var EDGE_FLAT = 0;
static var EDGE_CLIFF = 1;
static var GRID_WIDTH = 30;
static var GRID_HEIGHT = 30;
static var GRID_SIZE = 20;
static var GRID_HEIGHT_PX = GRID_SIZE * GRID_HEIGHT;
static var GRID_WIDTH_PX = GRID_SIZE * GRID_WIDTH;
static var MOUSE_IS_DOWN = false;
static var TICK_COUNT = 20;
static var REFUEL_COUNT = TICK_COUNT - 2;
static var FAST_TICK_AMOUNT = 3;
static var UNIT = 0;
static var BUILDING = 1;
static var ENEMY = 2;
static var ENERGY = 0;
static var FOOD = 1;
static var METAL = 2;
static var FF = 3;
static var GAS = 4;
static var SMOG = 5;
static var NWASTE = 6;
static var RESEARCH = 7;
static var RESOURCE = 8;
static var RECYCLING = 9;
static var GARBAGE = 10;
static var COMPREHENSIVE = 11;
static var POLLUTION = 12;
static var COAL = 13;
static var DEFENSE = 14;
static var TIMETAKEN = 15;
static var TOTAL = 16;
static var FARM = 0;
static var FORTRESS = 1;
static var COALPLANT = 2;
static var FFPLANT = -200;
static var GASPLANT = 3;
static var HYDROPLANT = 4;
static var SOLARPLANT = 5;
static var GEOPLANT = 6;
static var WINDPLANT = 7;
static var NUCLEARPLANT = 8;
static var MINE = 10;
static var OILGASWELL = 11;
static var LAB = 12;
static var RECYCLINGCENTER = 13;
static var COALMINE = 14;
static var SUPERFARM = -8;
static var FOODTIME = LAB + 1;
static var REPAIRTIME = FOODTIME + 1;
static var RESETTIME = REPAIRTIME + 1;
static var SMOG_DILUTE = 3;
static var CYCLETIME = RESETTIME;
static var NATURAL_DILUTE = 3 * RESETTIME;
static var LANDFILL = 20;
static var NUCLEARDUMP = 21;
static var FACTORY = 22;
static var GUNTURRET = 23;
static var FLAMETURRET = 24;
static var TESLACOIL = 25;
static var FLOODLIGHTS = 26;
static var ENGINEER = 0;
static var GARBAGETRUCK = 1;
static var SCOUT = 2;
static var HUMVEE = 3;
static var TANK = 4;
static var ZOMBIE = 99;
static var EDDERKOP = 100;
static var RAIDER = 101;
static var MONSTER_TRUCK = 102;
static var GIANTENEMYCRAB = 103;
static var NIGHT = 0;
static var DAY = 1;
static var TWILIGHT = 2;
static var DAYTIMEAMOUNT = RESETTIME * 10;
static var E_IN_FORTRESS = 5;
static var S_OUT_FORTRESS = 4;
static var G_OUT_FORTRESS = 5;
static var F_IN_FORTRESS = 1;
static var E_CHARGE_GEOMETRO = 0.024;
static var GEOMETRO_MPG = 40;
static var E_OUT_FFPLANT = 50;
static var FF_IN_FFPLANT = 40;
static var GASOLINE_IN_FF = 374595;
static var ETHANOL_IN_FOOD = 84468.3;
static var S_OUT_FFPLANT = 35;
static var E_OUT_COALPLANT = 50;
static var COAL_IN_COALPLANT = 1;
static var S_OUT_COALPLANT = 35;
static var S_OUT_TRUCK = S_OUT_FFPLANT / 10;
static var S_OUT_CAR = S_OUT_FFPLANT / 30;
static var F_OUT_SUPERFARM = 2;
static var E_IN_FARM = 5;
static var F_OUT_FARM = 1;
static var G_OUT_FARM = 0.5;
static var S_OUT_FARM = 2;
static var E_IN_MINE = 5;
static var M_OUT_MINE = 15;
static var G_OUT_MINE = 1.2;
static var S_OUT_MINE = 2.5;
static var E_IN_COALMINE = 0.5;
static var C_OUT_COALMINE = 5;
static var G_OUT_COALMINE = 20;
static var S_OUT_COALMINE = 12.5;
static var E_IN_FACTORY = 0.2;
static var M_IN_FACTORY = 4;
static var S_OUT_FACTORY = 0.1;
static var G_OUT_FACTORY = 10;
static var E_IN_RECYCLINGCENTER = 1;
static var GAS_TO_OIL_RATIO = 1.22;
static var GAS_IN_GASPLANT = 1;
static var E_OUT_GASPLANT = 50;
static var S_OUT_GASPLANT = 15;
static var E_OUT_SUPERGEOPLANT = 25;
static var E_OUT_SUPERWINDPLANT = 14.2857142857143;
static var E_OUT_GEOPLANT = 12.5;
static var S_OUT_GEOPLANT = 0;
static var E_OUT_HYDROPLANT = 100;
static var E_OUT_WINDPLANT = 14.2857142857143;
static var E_OUT_SOLARPLANT = 6.66666666666667;
static var E_OUT_NUCLEARPLANT = 25;
static var NWASTE_OUT_NUCLEARPLANT = 1;
static var E_IN_OILGASWELL = 0;
static var FF_OUT_OILGASWELL = 5;
static var GAS_OUT_OILGASWELL = 5;
static var G_OUT_OILGASWELL = 1.25;
static var E_IN_LAB = 0.11;
static var M_IN_LAB = 0;
static var G_OUT_LAB = 0;
static var R_OUT_LAB = 5;
static var E_IN_TESLACOIL = 5;
static var DMG_TESLACOIL = 50;
static var E_IN_FLOODLIGHTS = 3;
static var DMG_FLOODLIGHTS = 0.5;
static var M_IN_GUNTURRET = 0.1;
static var DMG_GUNTURRET = 3;
static var COOLDOWN_GUNTURRET = 0;
static var R_IN_FLAMETURRET = 0.5;
static var FF_IN_FLAMETURRET = 1;
static var GAS_IN_FLAMETURRET = 1;
static var DMG_FLAMETURRET = 25;
static var COOLDOWN_FLAMETURRET = 8;
static var WIND_NO = 0;
static var WIND_GENTLE = 1;
static var WIND_LOW = 2;
static var WIND_MID = 3;
static var WIND_HIGH = 4;
static var SUN_NO = 0;
static var SUN_OVERCAST = 1;
static var SUN_LOW = 2;
static var SUN_MID = 3;
static var SUN_HIGH = 4;
static var COST_COALPLANT = [250, 25];
static var COST_FFPLANT = [200, 25];
static var COST_GASPLANT = [75, 25];
static var COST_SOLARPLANT = [95, 10];
static var COST_SOLARTHERMALPLANT = [90, 25];
static var COST_HYDROPLANT = [500, 15];
static var COST_GEOPLANT = [200, 15];
static var COST_SUPERGEOPLANT = COST_GEOPLANT;
static var COST_NUCLEARPLANT = [150, 25];
static var COST_WINDPLANT = [80, 20];
static var COST_SUPERWINDPLANT = COST_WINDPLANT;
static var COST_MINE = [1, 0];
static var COST_COALMINE = [1, 0];
static var COST_FARM = [50, 0];
static var COST_SUPERFARM = COST_FARM;
static var COST_GUNTURRET = [25, 5];
static var COST_FLAMETURRET = [50, 10];
static var COST_TESLACOIL = [75, 10];
static var COST_FACTORY = [75, 15];
static var COST_LAB = [75, 15];
static var COST_RECYCLINGCENTER = [75, 0];
static var COST_LANDFILL = [25, 0];
static var COST_NUCLEARDUMP = [25, 0];
static var COST_OILGASWELL = [1, 0];
static var COST_FLOODLIGHTS = [10, 0];
static var level_f_gasoline = 1;
static var level_f_electric = 0;
static var level_f_ethanol = 0;
static var level_f_natgas = 0;
static var level_f_diesel = 0;
static var level_f_fuelcell = 0;
static var level_coalplant = 0;
static var level_ffplant = 0;
static var level_gasplant = 0;
static var level_solarplant = 0;
static var level_hydroplant = 0;
static var level_geoplant = 0;
static var level_nuclearplant = 0;
static var level_windplant = 0;
static var level_recyclingcenter = 0;
static var level_recycling = 0;
static var level_r_metal = 0;
static var level_r_PETE = 0;
static var level_r_gas = 0;
static var level_r_bioFuel = 0;
static var U_EF_COALPLANT = 1.5;
static var U_EM_COALPLANT = 0.75;
static var U_EF_FFPLANT = 1.5;
static var U_EM_FFPLANT = 0.75;
static var U_EF_GASPLANT = 1.5;
static var U_EM_GASPLANT = 0.75;
static var U_EF_SOLARPLANT = 1.5;
static var U_EM_SOLARPLANT = 0.75;
static var U_EF_GEOPLANT = 1.5;
static var U_EF_SUPERGEOPLANT = 1.5;
static var U_EM_GEOPLANT = 0.75;
static var U_EM_SUPERGEOPLANT = 0.75;
static var U_EF_NUCLEARPLANT = 1.5;
static var U_EM_NUCLEARPLANT = 0.75;
static var U_EF_WINDPLANT = 1.5;
static var U_EM_WINDPLANT = 0.75;
static var U_EF_RECYCLINGCENTER = 1.1;
static var level_mine = 0;
static var level_coalmine = 0;
static var level_farm = 0;
static var level_gunturret = 0;
static var level_flameturret = 0;
static var level_teslacoil = 0;
static var level_factory = 0;
static var level_lab = 0;
static var level_landfill = 0;
static var level_oilgaswell = 0;
static var level_floodlights = 0;
static var COST_ENGINEER = [10, 2.5];
static var COST_GARBAGETRUCK = [10, 2.5];
static var COST_SCOUT = [10, 0];
static var COST_HUMVEE = [30, 10];
static var COST_TANK = [75, 25];
static var COST_EFFICIENCY_1 = [100, 25];
static var COST_EFFICIENCY_2 = [200, 35];
static var COST_EFFICIENCY_3 = [350, 50];
static var COST_EMISSIONS_1 = [100, 25];
static var COST_U_COALPLANT = [100, 10, 1.25];
static var COST_U_FFPLANT = [100, 10, 1.25];
static var COST_U_GASPLANT = [100, 10, 1.5];
static var COST_U_WINDPLANT = [100, 5, 2];
static var COST_U_NUCLEARPLANT = [100, 10, 1.5];
static var COST_U_GEOPLANT = [100, 10, 1.5];
static var COST_U_SOLARPLANT = [100, 10, 2];
static var COST_U_RECYCLINGCENTER = [100, 25, 1.3];
static var COST_U_RECYCLING = [100, 25, 1.3];
static var COST_U_DIESEL = [50, 2, 2];
static var COST_U_GASOLINE = [25, 1, 2];
static var COST_U_ELECTRIC = [100, 5, 2];
static var COST_U_FUELCELL = [150, 7, 2];
static var COST_U_ETHANOL = [75, 1, 2];
static var COST_U_NATGAS = [50, 3, 2];
static var GASOLINE = 0;
static var DIESEL = 1;
static var ELECTRIC = 2;
static var ETHANOL = 3;
static var NATGAS = 4;
static var FUELCELL = 5;
static var BARREL_GASOLINE = 22;
static var MUSIC_VOLUME_MAX = 50;
static var FX_VOLUME_MAX = 50;
}
Symbol 2846 MovieClip [__Packages.ResearchNugget] Frame 0
class ResearchNugget
{
function ResearchNugget () {
}
function onLoad() {
}
function setLevel(str, lvl) {
if (this["level_" + str.toLowerCase()] != undefined) {
this["level_" + str.toLowerCase()] = lvl;
} else {
K.error("ResearchNugget", "setLevel", "no such level: " + str);
}
}
function getLevel(str) {
if (this["level_" + str.toLowerCase()] != undefined) {
return(this["level_" + str.toLowerCase()]);
}
K.error("ResearchNugget", "getLevel", "no such level: " + str);
return(0);
}
function snapShotLevels() {
level_f_gasoline = K.level_f_gasoline;
level_f_diesel = K.level_f_diesel;
level_f_electric = K.level_f_electric;
level_f_ethanol = K.level_f_ethanol;
level_f_natgas = K.level_f_natgas;
level_f_fuelcell = K.level_f_fuelcell;
level_coalplant = K.level_coalplant;
level_ffplant = K.level_ffplant;
level_gasplant = K.level_gasplant;
level_solarplant = K.level_solarplant;
level_hydroplant = K.level_hydroplant;
level_geoplant = K.level_geoplant;
level_nuclearplant = K.level_nuclearplant;
level_windplant = K.level_windplant;
level_mine = K.level_mine;
level_farm = K.level_farm;
level_gunturret = K.level_gunturret;
level_flameturret = K.level_flameturret;
level_teslacoil = K.level_teslacoil;
level_factory = K.level_factory;
level_lab = K.level_lab;
level_landfill = K.level_landfill;
level_oilgaswell = K.level_oilgaswell;
level_floodlights = K.level_floodlights;
level_recyclingcenter = K.level_recyclingcenter;
level_recycling = K.level_recycling;
level_r_metal = K.level_r_metal;
level_r_PETE = K.level_r_PETE;
level_r_gas = K.level_r_gas;
level_r_bioFuel = K.level_r_bioFuel;
}
var level_f_gasoline = 1;
var level_f_diesel = 0;
var level_f_electric = 0;
var level_f_ethanol = 0;
var level_f_natgas = 0;
var level_f_fuelcell = 0;
var level_coalplant = 0;
var level_ffplant = 0;
var level_gasplant = 0;
var level_solarplant = 0;
var level_hydroplant = 0;
var level_geoplant = 0;
var level_nuclearplant = 0;
var level_windplant = 0;
var level_mine = 0;
var level_farm = 0;
var level_gunturret = 0;
var level_flameturret = 0;
var level_teslacoil = 0;
var level_factory = 0;
var level_lab = 0;
var level_landfill = 0;
var level_oilgaswell = 0;
var level_floodlights = 0;
var level_recyclingcenter = 0;
var level_1_score = 0;
var level_2_score = 0;
var level_3_score = 0;
var level_4_score = 0;
var level_5_score = 0;
var level_6_score = 0;
var level_7_score = 0;
var level_8_score = 0;
var level_9_score = 0;
var level_total_score = 0;
var level_recycling = 0;
var level_r_metal = 0;
var level_r_PETE = 0;
var level_r_gas = 0;
var level_r_bioFuel = 0;
}
Symbol 2847 MovieClip [__Packages.ThemeSong] Frame 0
class ThemeSong extends MovieClip
{
var finalScore;
function ThemeSong () {
super();
}
function onLoad() {
}
function setFinalScore(i) {
finalScore = i;
}
}
Symbol 2848 MovieClip [__Packages.Arrow] Frame 0
class Arrow extends MovieClip
{
var _x, _parent;
function Arrow () {
super();
}
function onLoad() {
}
function onPress() {
followMouse = true;
}
function onRelease() {
followMouse = false;
}
function onReleaseOutside() {
followMouse = false;
}
function setVal(i) {
_x = Math.floor(i);
}
function onEnterFrame() {
if (followMouse) {
_x = _parent._xmouse;
if (_x < 0) {
_x = 0;
} else if (_x > 100) {
_x = 100;
}
_parent.updateVal(Math.floor(_x));
}
}
var followMouse = false;
}
Symbol 2849 MovieClip [__Packages.VolumeSlider] Frame 0
class VolumeSlider extends MovieClip
{
var val, a;
function VolumeSlider () {
super();
}
function updateVal(i) {
val = i;
}
function setVal(i) {
val = i;
a.setVal(i);
a._x = i;
}
}
Symbol 2850 MovieClip [__Packages.MenuThingy] Frame 0
class MenuThingy extends MovieClip
{
var gotoAndStop, frame, fx, music, r_fancyCursor, r_normalCursor, r_lowquality, r_midquality, r_highquality, _parent;
function MenuThingy () {
super();
}
function onLoad() {
gotoAndStop(frame);
fx.setVal(K.FX_VOLUME_MAX);
music.setVal(K.MUSIC_VOLUME_MAX);
if (K.FANCYCURSOR == true) {
r_fancyCursor.selected = true;
r_normalCursor.selected = false;
} else {
r_fancyCursor.selected = false;
r_normalCursor.selected = true;
}
r_lowquality.selected = false;
r_midquality.selected = false;
r_highquality.selected = false;
if (K.QUALITY.toLowerCase() == "low") {
r_lowquality.selected = true;
r_midquality.selected = false;
r_highquality.selected = false;
} else if (K.QUALITY.toLowerCase() == "medium") {
r_midquality.selected = true;
r_lowquality.selected = false;
r_highquality.selected = false;
} else if (K.QUALITY.toLowerCase() == "high") {
r_highquality.selected = true;
r_lowquality.selected = false;
r_midquality.selected = false;
}
}
function fancyCursorOff() {
_parent.fancyCursorOff();
}
function fancyCursorOn() {
_parent.fancyCursorOn();
}
}
Symbol 1 MovieClip [__Packages.mx.core.UIObject] Frame 0
class mx.core.UIObject extends MovieClip
{
var _width, _height, _x, _y, _parent, _minHeight, _minWidth, _visible, dispatchEvent, _xscale, _yscale, methodTable, onEnterFrame, tfList, __width, __height, moveTo, lineTo, createTextField, attachMovie, buildDepthTable, findNextAvailableDepth, idNames, childrenCreated, _name, createAccessibilityImplementation, _endInit, validateNow, hasOwnProperty, initProperties, stylecache, className, ignoreClassStyleDeclaration, _tf, fontFamily, fontSize, color, marginLeft, marginRight, fontStyle, fontWeight, textAlign, textIndent, textDecoration, embedFonts, styleName, enabled;
function UIObject () {
super();
constructObject();
}
function get width() {
return(_width);
}
function get height() {
return(_height);
}
function get left() {
return(_x);
}
function get x() {
return(_x);
}
function get top() {
return(_y);
}
function get y() {
return(_y);
}
function get right() {
return(_parent.width - (_x + width));
}
function get bottom() {
return(_parent.height - (_y + height));
}
function getMinHeight(Void) {
return(_minHeight);
}
function setMinHeight(h) {
_minHeight = h;
}
function get minHeight() {
return(getMinHeight());
}
function set minHeight(h) {
setMinHeight(h);
//return(minHeight);
}
function getMinWidth(Void) {
return(_minWidth);
}
function setMinWidth(w) {
_minWidth = w;
}
function get minWidth() {
return(getMinWidth());
}
function set minWidth(w) {
setMinWidth(w);
//return(minWidth);
}
function setVisible(x, noEvent) {
if (x != _visible) {
_visible = x;
if (noEvent != true) {
dispatchEvent({type:(x ? "reveal" : "hide")});
}
}
}
function get visible() {
return(_visible);
}
function set visible(x) {
setVisible(x, false);
//return(visible);
}
function get scaleX() {
return(_xscale);
}
function set scaleX(x) {
_xscale = x;
//return(scaleX);
}
function get scaleY() {
return(_yscale);
}
function set scaleY(y) {
_yscale = y;
//return(scaleY);
}
function doLater(obj, fn) {
if (methodTable == undefined) {
methodTable = new Array();
}
methodTable.push({obj:obj, fn:fn});
onEnterFrame = doLaterDispatcher;
}
function doLaterDispatcher(Void) {
delete onEnterFrame;
if (invalidateFlag) {
redraw();
}
var _local3 = methodTable;
methodTable = new Array();
if (_local3.length > 0) {
var _local2;
while (_local2 = _local3.shift() , _local2 != undefined) {
_local2.obj[_local2.fn]();
}
}
}
function cancelAllDoLaters(Void) {
delete onEnterFrame;
methodTable = new Array();
}
function invalidate(Void) {
invalidateFlag = true;
onEnterFrame = doLaterDispatcher;
}
function invalidateStyle(Void) {
invalidate();
}
function redraw(bAlways) {
if (invalidateFlag || (bAlways)) {
invalidateFlag = false;
var _local2;
for (_local2 in tfList) {
tfList[_local2].draw();
}
draw();
dispatchEvent({type:"draw"});
}
}
function draw(Void) {
}
function move(x, y, noEvent) {
var _local3 = _x;
var _local2 = _y;
_x = x;
_y = y;
if (noEvent != true) {
dispatchEvent({type:"move", oldX:_local3, oldY:_local2});
}
}
function setSize(w, h, noEvent) {
var _local3 = __width;
var _local2 = __height;
__width = w;
__height = h;
size();
if (noEvent != true) {
dispatchEvent({type:"resize", oldWidth:_local3, oldHeight:_local2});
}
}
function size(Void) {
_width = __width;
_height = __height;
}
function drawRect(x1, y1, x2, y2) {
moveTo(x1, y1);
lineTo(x2, y1);
lineTo(x2, y2);
lineTo(x1, y2);
lineTo(x1, y1);
}
function createLabel(name, depth, text) {
createTextField(name, depth, 0, 0, 0, 0);
var _local2 = this[name];
_local2._color = textColorList;
_local2._visible = false;
_local2.__text = text;
if (tfList == undefined) {
tfList = new Object();
}
tfList[name] = _local2;
_local2.invalidateStyle();
invalidate();
_local2.styleName = this;
return(_local2);
}
function createObject(linkageName, id, depth, initobj) {
return(attachMovie(linkageName, id, depth, initobj));
}
function createClassObject(className, id, depth, initobj) {
var _local3 = className.symbolName == undefined;
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className);
}
var _local4 = mx.core.UIObject(createObject(className.symbolOwner.symbolName, id, depth, initobj));
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className.symbolOwner);
}
return(_local4);
}
function createEmptyObject(id, depth) {
return(createClassObject(mx.core.UIObject, id, depth));
}
function destroyObject(id) {
var _local2 = this[id];
if (_local2.getDepth() < 0) {
var _local4 = buildDepthTable();
var _local5 = findNextAvailableDepth(0, _local4, "up");
var _local3 = _local5;
_local2.swapDepths(_local3);
}
_local2.removeMovieClip();
delete this[id];
}
function getSkinIDName(tag) {
return(idNames[tag]);
}
function setSkin(tag, linkageName, initObj) {
if (_global.skinRegistry[linkageName] == undefined) {
mx.skins.SkinElement.registerElement(linkageName, mx.skins.SkinElement);
}
return(createObject(linkageName, getSkinIDName(tag), tag, initObj));
}
function createSkin(tag) {
var _local2 = getSkinIDName(tag);
createEmptyObject(_local2, tag);
return(this[_local2]);
}
function createChildren(Void) {
}
function _createChildren(Void) {
createChildren();
childrenCreated = true;
}
function constructObject(Void) {
if (_name == undefined) {
return(undefined);
}
init();
_createChildren();
createAccessibilityImplementation();
_endInit();
if (validateNow) {
redraw(true);
} else {
invalidate();
}
}
function initFromClipParameters(Void) {
var _local4 = false;
var _local2;
for (_local2 in clipParameters) {
if (hasOwnProperty(_local2)) {
_local4 = true;
this["def_" + _local2] = this[_local2];
delete this[_local2];
}
}
if (_local4) {
for (_local2 in clipParameters) {
var _local3 = this["def_" + _local2];
if (_local3 != undefined) {
this[_local2] = _local3;
}
}
}
}
function init(Void) {
__width = _width;
__height = _height;
if (initProperties == undefined) {
initFromClipParameters();
} else {
initProperties();
}
if (_global.cascadingStyles == true) {
stylecache = new Object();
}
}
function getClassStyleDeclaration(Void) {
var _local4 = this;
var _local3 = className;
while (_local3 != undefined) {
if (ignoreClassStyleDeclaration[_local3] == undefined) {
if (_global.styles[_local3] != undefined) {
return(_global.styles[_local3]);
}
}
_local4 = _local4.__proto__;
_local3 = _local4.className;
}
}
function setColor(color) {
}
function __getTextFormat(tf, bAll) {
var _local8 = stylecache.tf;
if (_local8 != undefined) {
var _local3;
for (_local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
tf[_local3] = _local8[_local3];
}
}
}
return(false);
}
var _local6 = false;
for (var _local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
var _local5 = _tf[_local3];
if (_local5 != undefined) {
tf[_local3] = _local5;
} else if ((_local3 == "font") && (fontFamily != undefined)) {
tf[_local3] = fontFamily;
} else if ((_local3 == "size") && (fontSize != undefined)) {
tf[_local3] = fontSize;
} else if ((_local3 == "color") && (color != undefined)) {
tf[_local3] = color;
} else if ((_local3 == "leftMargin") && (marginLeft != undefined)) {
tf[_local3] = marginLeft;
} else if ((_local3 == "rightMargin") && (marginRight != undefined)) {
tf[_local3] = marginRight;
} else if ((_local3 == "italic") && (fontStyle != undefined)) {
tf[_local3] = fontStyle == _local3;
} else if ((_local3 == "bold") && (fontWeight != undefined)) {
tf[_local3] = fontWeight == _local3;
} else if ((_local3 == "align") && (textAlign != undefined)) {
tf[_local3] = textAlign;
} else if ((_local3 == "indent") && (textIndent != undefined)) {
tf[_local3] = textIndent;
} else if ((_local3 == "underline") && (textDecoration != undefined)) {
tf[_local3] = textDecoration == _local3;
} else if ((_local3 == "embedFonts") && (embedFonts != undefined)) {
tf[_local3] = embedFonts;
} else {
_local6 = true;
}
}
}
}
if (_local6) {
var _local9 = styleName;
if (_local9 != undefined) {
if (typeof(_local9) != "string") {
_local6 = _local9.__getTextFormat(tf, true, this);
} else if (_global.styles[_local9] != undefined) {
_local6 = _global.styles[_local9].__getTextFormat(tf, true, this);
}
}
}
if (_local6) {
var _local10 = getClassStyleDeclaration();
if (_local10 != undefined) {
_local6 = _local10.__getTextFormat(tf, true, this);
}
}
if (_local6) {
if (_global.cascadingStyles) {
if (_parent != undefined) {
_local6 = _parent.__getTextFormat(tf, false);
}
}
}
if (_local6) {
_local6 = _global.style.__getTextFormat(tf, true, this);
}
return(_local6);
}
function _getTextFormat(Void) {
var _local2 = stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
__getTextFormat(_local2, true);
stylecache.tf = _local2;
if (enabled == false) {
var _local3 = getStyle("disabledColor");
_local2.color = _local3;
}
return(_local2);
}
function getStyleName(Void) {
var _local2 = styleName;
if (_local2 != undefined) {
if (typeof(_local2) != "string") {
return(_local2.getStyleName());
}
return(_local2);
}
if (_parent != undefined) {
return(_parent.getStyleName());
}
return(undefined);
}
function getStyle(styleProp) {
var _local3;
_global.getStyleCounter++;
if (this[styleProp] != undefined) {
return(this[styleProp]);
}
var _local6 = styleName;
if (_local6 != undefined) {
if (typeof(_local6) != "string") {
_local3 = _local6.getStyle(styleProp);
} else {
var _local7 = _global.styles[_local6];
_local3 = _local7.getStyle(styleProp);
}
}
if (_local3 != undefined) {
return(_local3);
}
var _local7 = getClassStyleDeclaration();
if (_local7 != undefined) {
_local3 = _local7[styleProp];
}
if (_local3 != undefined) {
return(_local3);
}
if (_global.cascadingStyles) {
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (mx.styles.StyleManager.isColorStyle(styleProp))) {
var _local5 = stylecache;
if (_local5 != undefined) {
if (_local5[styleProp] != undefined) {
return(_local5[styleProp]);
}
}
if (_parent != undefined) {
_local3 = _parent.getStyle(styleProp);
} else {
_local3 = _global.style[styleProp];
}
if (_local5 != undefined) {
_local5[styleProp] = _local3;
}
return(_local3);
}
}
if (_local3 == undefined) {
_local3 = _global.style[styleProp];
}
return(_local3);
}
static function mergeClipParameters(o, p) {
for (var _local3 in p) {
o[_local3] = p[_local3];
}
return(true);
}
static var symbolName = "UIObject";
static var symbolOwner = mx.core.UIObject;
static var version = "2.0.2.127";
static var textColorList = {color:1, disabledColor:1};
var invalidateFlag = false;
var lineWidth = 1;
var lineColor = 0;
var tabEnabled = false;
var clipParameters = {visible:1, minHeight:1, minWidth:1, maxHeight:1, maxWidth:1, preferredHeight:1, preferredWidth:1};
}
Symbol 51 MovieClip [__Packages.mx.skins.SkinElement] Frame 0
class mx.skins.SkinElement extends MovieClip
{
var _visible, _x, _y, _width, _height;
function SkinElement () {
super();
}
static function registerElement(name, className) {
Object.registerClass(name, ((className == undefined) ? (mx.skins.SkinElement) : (className)));
_global.skinRegistry[name] = true;
}
function __set__visible(visible) {
_visible = visible;
}
function move(x, y) {
_x = x;
_y = y;
}
function setSize(w, h) {
_width = w;
_height = h;
}
}
Symbol 52 MovieClip [__Packages.mx.styles.CSSTextStyles] Frame 0
class mx.styles.CSSTextStyles
{
function CSSTextStyles () {
}
static function addTextStyles(o, bColor) {
o.addProperty("textAlign", function () {
return(this._tf.align);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.align = x;
});
o.addProperty("fontWeight", function () {
return(((this._tf.bold != undefined) ? ((this._tf.bold ? "bold" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.bold = x == "bold";
});
if (bColor) {
o.addProperty("color", function () {
return(this._tf.color);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.color = x;
});
}
o.addProperty("fontFamily", function () {
return(this._tf.font);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.font = x;
});
o.addProperty("textIndent", function () {
return(this._tf.indent);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.indent = x;
});
o.addProperty("fontStyle", function () {
return(((this._tf.italic != undefined) ? ((this._tf.italic ? "italic" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.italic = x == "italic";
});
o.addProperty("marginLeft", function () {
return(this._tf.leftMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.leftMargin = x;
});
o.addProperty("marginRight", function () {
return(this._tf.rightMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.rightMargin = x;
});
o.addProperty("fontSize", function () {
return(this._tf.size);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.size = x;
});
o.addProperty("textDecoration", function () {
return(((this._tf.underline != undefined) ? ((this._tf.underline ? "underline" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.underline = x == "underline";
});
o.addProperty("embedFonts", function () {
return(this._tf.embedFonts);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.embedFonts = x;
});
}
}
Symbol 54 MovieClip [__Packages.mx.styles.CSSStyleDeclaration] Frame 0
class mx.styles.CSSStyleDeclaration
{
var _tf;
function CSSStyleDeclaration () {
}
function __getTextFormat(tf, bAll) {
var _local5 = false;
if (_tf != undefined) {
var _local2;
for (_local2 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local2])) {
if (tf[_local2] == undefined) {
var _local3 = _tf[_local2];
if (_local3 != undefined) {
tf[_local2] = _local3;
} else {
_local5 = true;
}
}
}
}
} else {
_local5 = true;
}
return(_local5);
}
function getStyle(styleProp) {
var _local2 = this[styleProp];
var _local3 = mx.styles.StyleManager.getColorName(_local2);
return(((_local3 == undefined) ? (_local2) : (_local3)));
}
static function classConstruct() {
mx.styles.CSSTextStyles.addTextStyles(mx.styles.CSSStyleDeclaration.prototype, true);
return(true);
}
static var classConstructed = classConstruct();
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
}
Symbol 53 MovieClip [__Packages.mx.styles.StyleManager] Frame 0
class mx.styles.StyleManager
{
function StyleManager () {
}
static function registerInheritingStyle(styleName) {
inheritingStyles[styleName] = true;
}
static function isInheritingStyle(styleName) {
return(inheritingStyles[styleName] == true);
}
static function registerColorStyle(styleName) {
colorStyles[styleName] = true;
}
static function isColorStyle(styleName) {
return(colorStyles[styleName] == true);
}
static function registerColorName(colorName, colorValue) {
colorNames[colorName] = colorValue;
}
static function isColorName(colorName) {
return(colorNames[colorName] != undefined);
}
static function getColorName(colorName) {
return(colorNames[colorName]);
}
static var inheritingStyles = {color:true, direction:true, fontFamily:true, fontSize:true, fontStyle:true, fontWeight:true, textAlign:true, textIndent:true};
static var colorStyles = {barColor:true, trackColor:true, borderColor:true, buttonColor:true, color:true, dateHeaderColor:true, dateRollOverColor:true, disabledColor:true, fillColor:true, highlightColor:true, scrollTrackColor:true, selectedDateColor:true, shadowColor:true, strokeColor:true, symbolBackgroundColor:true, symbolBackgroundDisabledColor:true, symbolBackgroundPressedColor:true, symbolColor:true, symbolDisabledColor:true, themeColor:true, todayIndicatorColor:true, shadowCapColor:true, borderCapColor:true, focusColor:true};
static var colorNames = {black:0, white:16777215, red:16711680, green:65280, blue:255, magenta:16711935, yellow:16776960, cyan:65535, haloGreen:8453965, haloBlue:2881013, haloOrange:16761344};
static var TextFormatStyleProps = {font:true, size:true, color:true, leftMargin:false, rightMargin:false, italic:true, bold:true, align:true, indent:true, underline:false, embedFonts:false};
static var TextStyleMap = {textAlign:true, fontWeight:true, color:true, fontFamily:true, textIndent:true, fontStyle:true, lineHeight:true, marginLeft:true, marginRight:true, fontSize:true, textDecoration:true, embedFonts:true};
}
Symbol 2 MovieClip [__Packages.mx.core.UIComponent] Frame 0
class mx.core.UIComponent extends mx.core.UIObject
{
var __width, __height, invalidate, stylecache, removeEventListener, dispatchEvent, drawFocus, addEventListener, _xscale, _yscale, _focusrect, watch, enabled;
function UIComponent () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function setVisible(x, noEvent) {
super.setVisible(x, noEvent);
}
function enabledChanged(id, oldValue, newValue) {
setEnabled(newValue);
invalidate();
delete stylecache.tf;
return(newValue);
}
function setEnabled(enabled) {
invalidate();
}
function getFocus() {
var selFocus = Selection.getFocus();
return(((selFocus === null) ? null : (eval (selFocus))));
}
function setFocus() {
Selection.setFocus(this);
}
function getFocusManager() {
var _local2 = this;
while (_local2 != undefined) {
if (_local2.focusManager != undefined) {
return(_local2.focusManager);
}
_local2 = _local2._parent;
}
return(undefined);
}
function onKillFocus(newFocus) {
removeEventListener("keyDown", this);
removeEventListener("keyUp", this);
dispatchEvent({type:"focusOut"});
drawFocus(false);
}
function onSetFocus(oldFocus) {
addEventListener("keyDown", this);
addEventListener("keyUp", this);
dispatchEvent({type:"focusIn"});
if (getFocusManager().bDrawFocus != false) {
drawFocus(true);
}
}
function findFocusInChildren(o) {
if (o.focusTextField != undefined) {
return(o.focusTextField);
}
if (o.tabEnabled == true) {
return(o);
}
return(undefined);
}
function findFocusFromObject(o) {
if (o.tabEnabled != true) {
if (o._parent == undefined) {
return(undefined);
}
if (o._parent.tabEnabled == true) {
o = o._parent;
} else if (o._parent.tabChildren) {
o = findFocusInChildren(o._parent);
} else {
o = findFocusFromObject(o._parent);
}
}
return(o);
}
function pressFocus() {
var _local3 = findFocusFromObject(this);
var _local2 = getFocus();
if (_local3 != _local2) {
_local2.drawFocus(false);
if (getFocusManager().bDrawFocus != false) {
_local3.drawFocus(true);
}
}
}
function releaseFocus() {
var _local2 = findFocusFromObject(this);
if (_local2 != getFocus()) {
_local2.setFocus();
}
}
function isParent(o) {
while (o != undefined) {
if (o == this) {
return(true);
}
o = o._parent;
}
return(false);
}
function size() {
}
function init() {
super.init();
_xscale = 100;
_yscale = 100;
_focusrect = _global.useFocusRect == false;
watch("enabled", enabledChanged);
if (enabled == false) {
setEnabled(false);
}
}
function dispatchValueChangedEvent(value) {
dispatchEvent({type:"valueChanged", value:value});
}
static var symbolName = "UIComponent";
static var symbolOwner = mx.core.UIComponent;
static var version = "2.0.2.127";
static var kStretch = 5000;
var focusEnabled = true;
var tabEnabled = true;
var origBorderStyles = {themeColor:16711680};
var clipParameters = {};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.core.UIComponent.prototype.clipParameters, mx.core.UIObject.prototype.clipParameters);
}
Symbol 3 MovieClip [__Packages.mx.controls.SimpleButton] Frame 0
class mx.controls.SimpleButton extends mx.core.UIComponent
{
static var emphasizedStyleDeclaration;
var preset, boundingBox_mc, useHandCursor, skinName, linkLength, iconName, destroyObject, __width, _width, __height, _height, __emphaticStyleName, styleName, enabled, invalidate, pressFocus, dispatchEvent, autoRepeat, interval, getStyle, releaseFocus, createLabel, invalidateStyle;
function SimpleButton () {
super();
}
function init(Void) {
super.init();
if (preset == undefined) {
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
useHandCursor = false;
}
function createChildren(Void) {
if (preset != undefined) {
var _local2 = this[idNames[preset]];
this[refNames[preset]] = _local2;
skinName = _local2;
if (falseOverSkin.length == 0) {
rolloverSkin = fus;
}
if (falseOverIcon.length == 0) {
rolloverIcon = fui;
}
initializing = false;
} else if (__state == true) {
setStateVar(true);
} else {
if (falseOverSkin.length == 0) {
rolloverSkin = fus;
}
if (falseOverIcon.length == 0) {
rolloverIcon = fui;
}
}
}
function setIcon(tag, linkageName) {
return(setSkin(tag + 8, linkageName));
}
function changeIcon(tag, linkageName) {
linkLength = linkageName.length;
var _local2 = stateNames[tag] + "Icon";
this[_local2] = linkageName;
this[idNames[tag + 8]] = _local2;
setStateVar(getState());
}
function changeSkin(tag, linkageName) {
var _local2 = stateNames[tag] + "Skin";
this[_local2] = linkageName;
this[idNames[tag]] = _local2;
setStateVar(getState());
}
function viewIcon(varName) {
var _local4 = varName + "Icon";
var _local3 = this[_local4];
if (typeof(_local3) == "string") {
var _local5 = _local3;
if (__emphasized) {
if (this[_local3 + "Emphasized"].length > 0) {
_local3 = _local3 + "Emphasized";
}
}
if (this[_local3].length == 0) {
return(undefined);
}
_local3 = setIcon(tagMap[_local5], this[_local3]);
if ((_local3 == undefined) && (_global.isLivePreview)) {
_local3 = setIcon(0, "ButtonIcon");
}
this[_local4] = _local3;
}
iconName._visible = false;
iconName = _local3;
iconName._visible = true;
}
function removeIcons() {
var _local3 = 0;
while (_local3 < 2) {
var _local2 = 8;
while (_local2 < 16) {
destroyObject(idNames[_local2]);
this[stateNames[_local2 - 8] + "Icon"] = "";
_local2++;
}
_local3++;
}
refresh();
}
function setSkin(tag, linkageName, initobj) {
var _local3 = super.setSkin(tag, linkageName, ((initobj != undefined) ? (initobj) : ({styleName:this})));
calcSize(tag, _local3);
return(_local3);
}
function calcSize(Void) {
__width = _width;
__height = _height;
}
function viewSkin(varName, initObj) {
var _local3 = varName + "Skin";
var _local2 = this[_local3];
if (typeof(_local2) == "string") {
var _local4 = _local2;
if (__emphasized) {
if (this[_local2 + "Emphasized"].length > 0) {
_local2 = _local2 + "Emphasized";
}
}
if (this[_local2].length == 0) {
return(undefined);
}
_local2 = setSkin(tagMap[_local4], this[_local2], ((initObj != undefined) ? (initObj) : ({styleName:this})));
this[_local3] = _local2;
}
skinName._visible = false;
skinName = _local2;
skinName._visible = true;
}
function showEmphasized(e) {
if (e && (!__emphatic)) {
if (emphasizedStyleDeclaration != undefined) {
__emphaticStyleName = styleName;
styleName = emphasizedStyleDeclaration;
}
__emphatic = true;
} else {
if (__emphatic) {
styleName = __emphaticStyleName;
}
__emphatic = false;
}
}
function refresh(Void) {
var _local2 = getState();
if (enabled == false) {
viewIcon("disabled");
viewSkin("disabled");
} else {
viewSkin(phase);
viewIcon(phase);
}
setView(phase == "down");
iconName.enabled = enabled;
}
function setView(offset) {
if (iconName == undefined) {
return(undefined);
}
var _local2 = (offset ? (btnOffset) : 0);
iconName._x = ((__width - iconName._width) / 2) + _local2;
iconName._y = ((__height - iconName._height) / 2) + _local2;
}
function setStateVar(state) {
if (state) {
if (trueOverSkin.length == 0) {
rolloverSkin = tus;
} else {
rolloverSkin = trs;
}
if (trueOverIcon.length == 0) {
rolloverIcon = tui;
} else {
rolloverIcon = tri;
}
upSkin = tus;
downSkin = tds;
disabledSkin = dts;
upIcon = tui;
downIcon = tdi;
disabledIcon = dti;
} else {
if (falseOverSkin.length == 0) {
rolloverSkin = fus;
} else {
rolloverSkin = frs;
}
if (falseOverIcon.length == 0) {
rolloverIcon = fui;
} else {
rolloverIcon = fri;
}
upSkin = fus;
downSkin = fds;
disabledSkin = dfs;
upIcon = fui;
downIcon = fdi;
disabledIcon = dfi;
}
__state = state;
}
function setState(state) {
if (state != __state) {
setStateVar(state);
invalidate();
}
}
function size(Void) {
refresh();
}
function draw(Void) {
if (initializing) {
initializing = false;
skinName.visible = true;
iconName.visible = true;
}
size();
}
function getState(Void) {
return(__state);
}
function setToggle(val) {
__toggle = val;
if (__toggle == false) {
setState(false);
}
}
function getToggle(Void) {
return(__toggle);
}
function set toggle(val) {
setToggle(val);
//return(toggle);
}
function get toggle() {
return(getToggle());
}
function set value(val) {
setSelected(val);
//return(value);
}
function get value() {
return(getSelected());
}
function set selected(val) {
setSelected(val);
//return(selected);
}
function get selected() {
return(getSelected());
}
function setSelected(val) {
if (__toggle) {
setState(val);
} else {
setState((initializing ? (val) : (__state)));
}
}
function getSelected() {
return(__state);
}
function setEnabled(val) {
if (enabled != val) {
super.setEnabled(val);
invalidate();
}
}
function onPress(Void) {
pressFocus();
phase = "down";
refresh();
dispatchEvent({type:"buttonDown"});
if (autoRepeat) {
interval = setInterval(this, "onPressDelay", getStyle("repeatDelay"));
}
}
function onPressDelay(Void) {
dispatchEvent({type:"buttonDown"});
if (autoRepeat) {
clearInterval(interval);
interval = setInterval(this, "onPressRepeat", getStyle("repeatInterval"));
}
}
function onPressRepeat(Void) {
dispatchEvent({type:"buttonDown"});
updateAfterEvent();
}
function onRelease(Void) {
releaseFocus();
phase = "rollover";
if (interval != undefined) {
clearInterval(interval);
delete interval;
}
if (getToggle()) {
setState(!getState());
} else {
refresh();
}
dispatchEvent({type:"click"});
}
function onDragOut(Void) {
phase = "up";
refresh();
dispatchEvent({type:"buttonDragOut"});
}
function onDragOver(Void) {
if (phase != "up") {
onPress();
return(undefined);
}
phase = "down";
refresh();
}
function onReleaseOutside(Void) {
releaseFocus();
phase = "up";
if (interval != undefined) {
clearInterval(interval);
delete interval;
}
}
function onRollOver(Void) {
phase = "rollover";
refresh();
}
function onRollOut(Void) {
phase = "up";
refresh();
}
function getLabel(Void) {
return(fui.text);
}
function setLabel(val) {
if (typeof(fui) == "string") {
createLabel("fui", 8, val);
fui.styleName = this;
} else {
fui.text = val;
}
var _local4 = fui._getTextFormat();
var _local2 = _local4.getTextExtent2(val);
fui._width = _local2.width + 5;
fui._height = _local2.height + 5;
iconName = fui;
setView(__state);
}
function get emphasized() {
return(__emphasized);
}
function set emphasized(val) {
__emphasized = val;
var _local2 = 0;
while (_local2 < 8) {
this[idNames[_local2]] = stateNames[_local2] + "Skin";
if (typeof(this[idNames[_local2 + 8]]) == "movieclip") {
this[idNames[_local2 + 8]] = stateNames[_local2] + "Icon";
}
_local2++;
}
showEmphasized(__emphasized);
setStateVar(__state);
invalidateStyle();
//return(emphasized);
}
function keyDown(e) {
if (e.code == 32) {
onPress();
}
}
function keyUp(e) {
if (e.code == 32) {
onRelease();
}
}
function onKillFocus(newFocus) {
super.onKillFocus();
if (phase != "up") {
phase = "up";
refresh();
}
}
static var symbolName = "SimpleButton";
static var symbolOwner = mx.controls.SimpleButton;
static var version = "2.0.2.127";
var className = "SimpleButton";
var style3dInset = 4;
var btnOffset = 1;
var __toggle = false;
var __state = false;
var __emphasized = false;
var __emphatic = false;
static var falseUp = 0;
static var falseDown = 1;
static var falseOver = 2;
static var falseDisabled = 3;
static var trueUp = 4;
static var trueDown = 5;
static var trueOver = 6;
static var trueDisabled = 7;
var falseUpSkin = "SimpleButtonUp";
var falseDownSkin = "SimpleButtonIn";
var falseOverSkin = "";
var falseDisabledSkin = "SimpleButtonUp";
var trueUpSkin = "SimpleButtonIn";
var trueDownSkin = "";
var trueOverSkin = "";
var trueDisabledSkin = "SimpleButtonIn";
var falseUpIcon = "";
var falseDownIcon = "";
var falseOverIcon = "";
var falseDisabledIcon = "";
var trueUpIcon = "";
var trueDownIcon = "";
var trueOverIcon = "";
var trueDisabledIcon = "";
var phase = "up";
var fui = "falseUpIcon";
var fus = "falseUpSkin";
var fdi = "falseDownIcon";
var fds = "falseDownSkin";
var frs = "falseOverSkin";
var fri = "falseOverIcon";
var dfi = "falseDisabledIcon";
var dfs = "falseDisabledSkin";
var tui = "trueUpIcon";
var tus = "trueUpSkin";
var tdi = "trueDownIcon";
var tds = "trueDownSkin";
var trs = "trueOverSkin";
var tri = "trueOverIcon";
var dts = "trueDisabledSkin";
var dti = "trueDisabledIcon";
var rolloverSkin = mx.controls.SimpleButton.prototype.frs;
var rolloverIcon = mx.controls.SimpleButton.prototype.fri;
var upSkin = mx.controls.SimpleButton.prototype.fus;
var downSkin = mx.controls.SimpleButton.prototype.fds;
var disabledSkin = mx.controls.SimpleButton.prototype.dfs;
var upIcon = mx.controls.SimpleButton.prototype.fui;
var downIcon = mx.controls.SimpleButton.prototype.fdi;
var disabledIcon = mx.controls.SimpleButton.prototype.dfi;
var initializing = true;
var idNames = ["fus", "fds", "frs", "dfs", "tus", "tds", "trs", "dts", "fui", "fdi", "fri", "dfi", "tui", "tdi", "tri", "dti"];
var stateNames = ["falseUp", "falseDown", "falseOver", "falseDisabled", "trueUp", "trueDown", "trueOver", "trueDisabled"];
var refNames = ["upSkin", "downSkin", "rolloverSkin", "disabledSkin"];
var tagMap = {falseUpSkin:0, falseDownSkin:1, falseOverSkin:2, falseDisabledSkin:3, trueUpSkin:4, trueDownSkin:5, trueOverSkin:6, trueDisabledSkin:7, falseUpIcon:0, falseDownIcon:1, falseOverIcon:2, falseDisabledIcon:3, trueUpIcon:4, trueDownIcon:5, trueOverIcon:6, trueDisabledIcon:7};
}
Symbol 4 MovieClip [__Packages.mx.controls.Button] Frame 0
class mx.controls.Button extends mx.controls.SimpleButton
{
var initializing, labelPath, initIcon, getState, enabled, phase, idNames, __width, __height, setState, invalidate, iconName, refresh, createLabel, _iconLinkageName, removeIcons, hitArea_mc, createEmptyObject;
function Button () {
super();
}
function init(Void) {
super.init();
}
function draw() {
if (initializing) {
labelPath.visible = true;
}
super.draw();
if (initIcon != undefined) {
_setIcon(initIcon);
}
delete initIcon;
}
function onRelease(Void) {
super.onRelease();
}
function createChildren(Void) {
super.createChildren();
}
function setSkin(tag, linkageName, initobj) {
return(super.setSkin(tag, linkageName, initobj));
}
function viewSkin(varName) {
var _local3 = (getState() ? "true" : "false");
_local3 = _local3 + (enabled ? (phase) : "disabled");
super.viewSkin(varName, {styleName:this, borderStyle:_local3});
}
function invalidateStyle(c) {
labelPath.invalidateStyle(c);
super.invalidateStyle(c);
}
function setColor(c) {
var _local2 = 0;
while (_local2 < 8) {
this[idNames[_local2]].redraw(true);
_local2++;
}
}
function setEnabled(enable) {
labelPath.enabled = enable;
super.setEnabled(enable);
}
function calcSize(tag, ref) {
if ((__width == undefined) || (__height == undefined)) {
return(undefined);
}
if (tag < 7) {
ref.setSize(__width, __height, true);
}
}
function size(Void) {
setState(getState());
setHitArea(__width, __height);
var _local3 = 0;
while (_local3 < 8) {
var _local4 = idNames[_local3];
if (typeof(this[_local4]) == "movieclip") {
this[_local4].setSize(__width, __height, true);
}
_local3++;
}
super.size();
}
function set labelPlacement(val) {
__labelPlacement = val;
invalidate();
//return(labelPlacement);
}
function get labelPlacement() {
return(__labelPlacement);
}
function getLabelPlacement(Void) {
return(__labelPlacement);
}
function setLabelPlacement(val) {
__labelPlacement = val;
invalidate();
}
function getBtnOffset(Void) {
if (getState()) {
var _local2 = btnOffset;
} else if (phase == "down") {
var _local2 = btnOffset;
} else {
var _local2 = 0;
}
return(_local2);
}
function setView(offset) {
var _local16 = (offset ? (btnOffset) : 0);
var _local12 = getLabelPlacement();
var _local7 = 0;
var _local6 = 0;
var _local11 = 0;
var _local8 = 0;
var _local5 = 0;
var _local4 = 0;
var _local3 = labelPath;
var _local2 = iconName;
var _local15 = _local3.textWidth;
var _local14 = _local3.textHeight;
var _local9 = (__width - borderW) - borderW;
var _local10 = (__height - borderW) - borderW;
if (_local2 != undefined) {
_local7 = _local2._width;
_local6 = _local2._height;
}
if ((_local12 == "left") || (_local12 == "right")) {
if (_local3 != undefined) {
_local11 = Math.min(_local9 - _local7, _local15 + 5);
_local3._width = _local11;
_local8 = Math.min(_local10, _local14 + 5);
_local3._height = _local8;
}
if (_local12 == "right") {
_local5 = _local7;
if (centerContent) {
_local5 = _local5 + (((_local9 - _local11) - _local7) / 2);
}
_local2._x = _local5 - _local7;
} else {
_local5 = (_local9 - _local11) - _local7;
if (centerContent) {
_local5 = _local5 / 2;
}
_local2._x = _local5 + _local11;
}
_local4 = 0;
_local2._y = _local4;
if (centerContent) {
_local2._y = (_local10 - _local6) / 2;
_local4 = (_local10 - _local8) / 2;
}
if (!centerContent) {
_local2._y = _local2._y + Math.max(0, (_local8 - _local6) / 2);
}
} else {
if (_local3 != undefined) {
_local11 = Math.min(_local9, _local15 + 5);
_local3._width = _local11;
_local8 = Math.min(_local10 - _local6, _local14 + 5);
_local3._height = _local8;
}
_local5 = (_local9 - _local11) / 2;
_local2._x = (_local9 - _local7) / 2;
if (_local12 == "top") {
_local4 = (_local10 - _local8) - _local6;
if (centerContent) {
_local4 = _local4 / 2;
}
_local2._y = _local4 + _local8;
} else {
_local4 = _local6;
if (centerContent) {
_local4 = _local4 + (((_local10 - _local8) - _local6) / 2);
}
_local2._y = _local4 - _local6;
}
}
var _local13 = borderW + _local16;
_local3._x = _local5 + _local13;
_local3._y = _local4 + _local13;
_local2._x = _local2._x + _local13;
_local2._y = _local2._y + _local13;
}
function set label(lbl) {
setLabel(lbl);
//return(label);
}
function setLabel(label) {
if (label == "") {
labelPath.removeTextField();
refresh();
return(undefined);
}
if (labelPath == undefined) {
var _local2 = createLabel("labelPath", 200, label);
_local2._width = _local2.textWidth + 5;
_local2._height = _local2.textHeight + 5;
if (initializing) {
_local2.visible = false;
}
} else {
delete labelPath.__text;
labelPath.text = label;
refresh();
}
}
function getLabel(Void) {
return(((labelPath.__text != undefined) ? (labelPath.__text) : (labelPath.text)));
}
function get label() {
return(getLabel());
}
function _getIcon(Void) {
return(_iconLinkageName);
}
function get icon() {
if (initializing) {
return(initIcon);
}
return(_iconLinkageName);
}
function _setIcon(linkage) {
if (initializing) {
if (linkage == "") {
return(undefined);
}
initIcon = linkage;
} else {
if (linkage == "") {
removeIcons();
return(undefined);
}
super.changeIcon(0, linkage);
super.changeIcon(1, linkage);
super.changeIcon(3, linkage);
super.changeIcon(4, linkage);
super.changeIcon(5, linkage);
_iconLinkageName = linkage;
refresh();
}
}
function set icon(linkage) {
_setIcon(linkage);
//return(icon);
}
function setHitArea(w, h) {
if (hitArea_mc == undefined) {
createEmptyObject("hitArea_mc", 100);
}
var _local2 = hitArea_mc;
_local2.clear();
_local2.beginFill(16711680);
_local2.drawRect(0, 0, w, h);
_local2.endFill();
_local2.setVisible(false);
}
static var symbolName = "Button";
static var symbolOwner = mx.controls.Button;
var className = "Button";
static var version = "2.0.2.127";
var btnOffset = 0;
var _color = "buttonColor";
var __label = "default value";
var __labelPlacement = "right";
var falseUpSkin = "ButtonSkin";
var falseDownSkin = "ButtonSkin";
var falseOverSkin = "ButtonSkin";
var falseDisabledSkin = "ButtonSkin";
var trueUpSkin = "ButtonSkin";
var trueDownSkin = "ButtonSkin";
var trueOverSkin = "ButtonSkin";
var trueDisabledSkin = "ButtonSkin";
var falseUpIcon = "";
var falseDownIcon = "";
var falseOverIcon = "";
var falseDisabledIcon = "";
var trueUpIcon = "";
var trueDownIcon = "";
var trueOverIcon = "";
var trueDisabledIcon = "";
var clipParameters = {labelPlacement:1, icon:1, toggle:1, selected:1, label:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.Button.prototype.clipParameters, mx.controls.SimpleButton.prototype.clipParameters);
var centerContent = true;
var borderW = 1;
}
Symbol 5 MovieClip [__Packages.mx.controls.RadioButton] Frame 0
class mx.controls.RadioButton extends mx.controls.Button
{
var setToggle, __value, selected, releaseFocus, phase, dispatchEvent, _parent, __data, setState, __state, getFocusManager;
function RadioButton () {
super();
}
function init(Void) {
setToggle(__toggle);
__value = this;
super.init();
}
function size(Void) {
super.size();
}
function onRelease() {
if (selected) {
return(undefined);
}
releaseFocus();
phase = "up";
setSelected(true);
dispatchEvent({type:"click"});
_parent[__groupName].dispatchEvent({type:"click"});
}
function setData(val) {
__data = val;
}
function set data(val) {
__data = val;
//return(data);
}
function getData(val) {
return(__data);
}
function get data() {
return(__data);
}
function onUnload() {
if (_parent[__groupName].selectedRadio == this) {
_parent[__groupName].selectedRadio = undefined;
}
_parent[__groupName].radioList[indexNumber] = null;
delete _parent[__groupName].radioList[indexNumber];
}
function setSelected(val) {
var _local2 = _parent[__groupName];
var _local5 = _local2.selectedRadio.__width;
var _local4 = _local2.selectedRadio.__height;
if (val) {
_local2.selectedRadio.setState(false);
_local2.selectedRadio = this;
} else if (_local2.selectedRadio == this) {
_local2.selectedRadio.setState(false);
_local2.selectedRadio = undefined;
}
setState(val);
}
function deleteGroupObj(groupName) {
delete _parent[groupName];
}
function getGroupName() {
return(__groupName);
}
function get groupName() {
return(__groupName);
}
function setGroupName(groupName) {
if ((groupName == undefined) || (groupName == "")) {
return(undefined);
}
delete _parent[__groupName].radioList[__data];
addToGroup(groupName);
__groupName = groupName;
}
function set groupName(groupName) {
setGroupName(groupName);
//return(this.groupName);
}
function addToGroup(groupName) {
if ((groupName == "") || (groupName == undefined)) {
return(undefined);
}
var _local2 = _parent[groupName];
if (_local2 == undefined) {
_local2 = (_parent[groupName] = new mx.controls.RadioButtonGroup());
_local2.__groupName = groupName;
}
_local2.addInstance(this);
if (__state) {
_local2.selectedRadio.setState(false);
_local2.selectedRadio = this;
}
}
function get emphasized() {
return(undefined);
}
function keyDown(e) {
switch (e.code) {
case 40 :
setNext();
break;
case 38 :
setPrev();
break;
case 37 :
setPrev();
break;
case 39 :
setNext();
}
}
function setNext() {
var _local2 = _parent[groupName];
if ((_local2.selectedRadio.indexNumber + 1) == _local2.radioList.length) {
return(undefined);
}
var _local4 = (_local2.selectedRadio ? (_local2.selectedRadio.indexNumber) : -1);
var _local3 = 1;
while (_local3 < _local2.radioList.length) {
if ((_local2.radioList[_local4 + _local3] != undefined) && (_local2.radioList[_local4 + _local3].enabled)) {
var _local5 = getFocusManager();
_local2.radioList[_local4 + _local3].selected = true;
_local5.setFocus(_local2.radioList[_local2.selectedRadio.indexNumber]);
_local2.dispatchEvent({type:"click"});
break;
}
_local3++;
}
}
function setPrev() {
var _local2 = _parent[groupName];
if (_local2.selectedRadio.indexNumber == 0) {
return(undefined);
}
var _local4 = (_local2.selectedRadio ? (_local2.selectedRadio.indexNumber) : 1);
var _local3 = 1;
while (_local3 < _local2.radioList.length) {
if ((_local2.radioList[_local4 - _local3] != undefined) && (_local2.radioList[_local4 - _local3].enabled)) {
var _local5 = getFocusManager();
_local2.radioList[_local4 - _local3].selected = true;
_local5.setFocus(_local2.radioList[_local2.selectedRadio.indexNumber]);
_local2.dispatchEvent({type:"click"});
break;
}
_local3++;
}
}
function set toggle(v) {
//return(toggle);
}
function get toggle() {
}
function set icon(v) {
//return(icon);
}
function get icon() {
}
static var symbolName = "RadioButton";
static var symbolOwner = mx.controls.RadioButton;
static var version = "2.0.2.127";
var className = "RadioButton";
var btnOffset = 0;
var __toggle = true;
var __label = "Radio Button";
var __labelPlacement = "right";
var ignoreClassStyleDeclaration = {Button:1};
var __groupName = "radioGroup";
var indexNumber = 0;
var offset = false;
var falseUpSkin = "";
var falseDownSkin = "";
var falseOverSkin = "";
var falseDisabledSkin = "";
var trueUpSkin = "";
var trueDownSkin = "";
var trueOverSkin = "";
var trueDisabledSkin = "";
var falseUpIcon = "RadioFalseUp";
var falseDownIcon = "RadioFalseDown";
var falseOverIcon = "RadioFalseOver";
var falseDisabledIcon = "RadioFalseDisabled";
var trueUpIcon = "RadioTrueUp";
var trueDownIcon = "";
var trueOverIcon = "";
var trueDisabledIcon = "RadioTrueDisabled";
var centerContent = false;
var borderW = 0;
var clipParameters = {labelPlacement:1, data:1, label:1, groupName:1, selected:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.RadioButton.prototype.clipParameters, mx.controls.Button.prototype.clipParameters);
}
Symbol 57 MovieClip [__Packages.mx.controls.RadioButtonGroup] Frame 0
class mx.controls.RadioButtonGroup
{
var radioList, __groupName, selectedRadio;
function RadioButtonGroup () {
init();
mx.events.UIEventDispatcher.initialize(this);
}
function init(Void) {
radioList = new Array();
}
function setGroupName(groupName) {
if ((groupName == undefined) || (groupName == "")) {
return(undefined);
}
var _local6 = __groupName;
_parent[groupName] = this;
for (var _local5 in radioList) {
radioList[_local5].groupName = groupName;
var _local3 = radioList[_local5];
}
_local3.deleteGroupObj(_local6);
}
function getGroupName() {
return(__groupName);
}
function addInstance(instance) {
instance.indexNumber = indexNumber++;
radioList.push(instance);
}
function getValue() {
if (selectedRadio.data == "") {
return(selectedRadio.label);
}
return(selectedRadio.__data);
}
function getLabelPlacement() {
for (var _local3 in radioList) {
var _local2 = radioList[_local3].getLabelPlacement();
}
return(_local2);
}
function setLabelPlacement(pos) {
for (var _local3 in radioList) {
radioList[_local3].setLabelPlacement(pos);
}
}
function setEnabled(val) {
for (var _local3 in radioList) {
radioList[_local3].enabled = val;
}
}
function setSize(val, val1) {
for (var _local3 in radioList) {
radioList[_local3].setSize(val, val1);
}
}
function getEnabled() {
for (var _local4 in radioList) {
var _local2 = radioList[_local4].enabled;
var _local3 = t + (_local2 + 0);
}
if (_local3 == radioList.length) {
return(true);
}
if (_local3 == 0) {
return(false);
}
}
function setStyle(name, val) {
for (var _local4 in radioList) {
radioList[_local4].setStyle(name, val);
}
}
function setInstance(val) {
for (var _local3 in radioList) {
if (radioList[_local3] == val) {
radioList[_local3].selected = true;
}
}
}
function getInstance() {
return(selectedRadio);
}
function setValue(val) {
for (var _local4 in radioList) {
if ((radioList[_local4].__data == val) || (radioList[_local4].label == val)) {
var _local2 = _local4;
break;
}
}
if (_local2 != undefined) {
selectedRadio.setState(false);
selectedRadio.hitArea_mc._height = selectedRadio.__height;
selectedRadio.hitArea_mc._width = selectedRadio.__width;
selectedRadio = radioList[_local2];
selectedRadio.setState(true);
selectedRadio.hitArea_mc._height = (selectedRadio.hitArea_mc._width = 0);
}
}
function set groupName(groupName) {
if ((groupName == undefined) || (groupName == "")) {
return;
}
var _local6 = __groupName;
_parent[groupName] = this;
for (var _local5 in radioList) {
radioList[_local5].groupName = groupName;
var _local3 = radioList[_local5];
}
_local3.deleteGroupObj(_local6);
//return(this.groupName);
}
function get groupName() {
return(__groupName);
}
function set selectedData(val) {
for (var _local4 in radioList) {
if ((radioList[_local4].__data == val) || (radioList[_local4].label == val)) {
var _local2 = _local4;
break;
}
}
if (_local2 != undefined) {
selectedRadio.setState(false);
selectedRadio = radioList[_local2];
selectedRadio.setState(true);
}
//return(selectedData);
}
function get selectedData() {
if ((selectedRadio.data == "") || (selectedRadio.data == undefined)) {
return(selectedRadio.label);
}
return(selectedRadio.__data);
}
function get selection() {
return(selectedRadio);
}
function set selection(val) {
for (var _local3 in radioList) {
if (radioList[_local3] == val) {
radioList[_local3].selected = true;
}
}
//return(selection);
}
function set labelPlacement(pos) {
for (var _local3 in radioList) {
radioList[_local3].setLabelPlacement(pos);
}
//return(labelPlacement);
}
function get labelPlacement() {
for (var _local3 in radioList) {
var _local2 = radioList[_local3].getLabelPlacement();
}
return(_local2);
}
function set enabled(val) {
for (var _local3 in radioList) {
radioList[_local3].enabled = val;
}
//return(enabled);
}
function get enabled() {
var _local2 = 0;
for (var _local3 in radioList) {
_local2 = _local2 + radioList[_local3].enabled;
}
if (_local2 == 0) {
return(false);
}
if (_local2 == radioList.length) {
return(true);
}
}
static var symbolName = "RadioButtonGroup";
static var symbolOwner = mx.controls.RadioButtonGroup;
static var version = "2.0.2.127";
var className = "RadioButtonGroup";
var indexNumber = 0;
}
Symbol 55 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 56 MovieClip [__Packages.mx.events.UIEventDispatcher] Frame 0
class mx.events.UIEventDispatcher extends mx.events.EventDispatcher
{
var dispatchQueue, owner, __sentLoadEvent, __origAddEventListener;
function UIEventDispatcher () {
super();
}
static function addKeyEvents(obj) {
if (obj.keyHandler == undefined) {
var _local1 = (obj.keyHandler = new Object());
_local1.owner = obj;
_local1.onKeyDown = _fEventDispatcher.onKeyDown;
_local1.onKeyUp = _fEventDispatcher.onKeyUp;
}
Key.addListener(obj.keyHandler);
}
static function removeKeyEvents(obj) {
Key.removeListener(obj.keyHandler);
}
static function addLoadEvents(obj) {
if (obj.onLoad == undefined) {
obj.onLoad = _fEventDispatcher.onLoad;
obj.onUnload = _fEventDispatcher.onUnload;
if (obj.getBytesTotal() == obj.getBytesLoaded()) {
obj.doLater(obj, "onLoad");
}
}
}
static function removeLoadEvents(obj) {
delete obj.onLoad;
delete obj.onUnload;
}
static function initialize(obj) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.UIEventDispatcher();
}
obj.addEventListener = _fEventDispatcher.__addEventListener;
obj.__origAddEventListener = _fEventDispatcher.addEventListener;
obj.removeEventListener = _fEventDispatcher.removeEventListener;
obj.dispatchEvent = _fEventDispatcher.dispatchEvent;
obj.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(mx.events.EventDispatcher, eventObj);
dispatchQueue(this, eventObj);
}
function onKeyDown(Void) {
owner.dispatchEvent({type:"keyDown", code:Key.getCode(), ascii:Key.getAscii(), shiftKey:Key.isDown(16), ctrlKey:Key.isDown(17)});
}
function onKeyUp(Void) {
owner.dispatchEvent({type:"keyUp", code:Key.getCode(), ascii:Key.getAscii(), shiftKey:Key.isDown(16), ctrlKey:Key.isDown(17)});
}
function onLoad(Void) {
if (__sentLoadEvent != true) {
dispatchEvent({type:"load"});
}
__sentLoadEvent = true;
}
function onUnload(Void) {
dispatchEvent({type:"unload"});
}
function __addEventListener(event, handler) {
__origAddEventListener(event, handler);
var _local3 = lowLevelEvents;
for (var _local5 in _local3) {
if (mx.events.UIEventDispatcher[_local5][event] != undefined) {
var _local2 = _local3[_local5][0];
mx.events.UIEventDispatcher[_local2](this);
}
}
}
function removeEventListener(event, handler) {
var _local6 = "__q_" + event;
mx.events.EventDispatcher._removeEventListener(this[_local6], event, handler);
if (this[_local6].length == 0) {
var _local2 = lowLevelEvents;
for (var _local5 in _local2) {
if (mx.events.UIEventDispatcher[_local5][event] != undefined) {
var _local3 = _local2[_local5][1];
mx.events.UIEventDispatcher[_local2[_local5][1]](this);
}
}
}
}
static var keyEvents = {keyDown:1, keyUp:1};
static var loadEvents = {load:1, unload:1};
static var lowLevelEvents = {keyEvents:["addKeyEvents", "removeKeyEvents"], loadEvents:["addLoadEvents", "removeLoadEvents"]};
static var _fEventDispatcher = undefined;
}
Symbol 2851 MovieClip [__Packages.BuildIcon] Frame 0
class BuildIcon extends MovieClip
{
var master, _visible, gotoAndStop, _x, _y;
function BuildIcon () {
super();
}
function onLoad() {
deactivate();
}
function setMaster(whom) {
master = whom;
}
function enterFrameFunction() {
}
function activate(str) {
active = true;
enterFrameFunction = followCursor;
_visible = true;
if (str != undefined) {
myString = str;
}
gotoAndStop("default");
gotoAndStop(myString);
}
function deactivate() {
active = false;
enterFrameFunction = undefined;
_visible = false;
}
function followCursor() {
tileX = master.getBuildingLocX(master.cursor._x);
tileY = master.getBuildingLocY(master.cursor._y);
_x = master.getBuildingX(tileX) + K.TILE_SIZE;
_y = master.getBuildingY(tileY);
if (master.checkTerrain(tileX, tileY, myString)) {
gotoAndStop(myString);
} else {
gotoAndStop(myString + "_NO");
}
}
function onEnterFrame() {
enterFrameFunction();
}
var active = false;
var myString = "default";
var tileX = 0;
var tileY = 0;
}
Symbol 2852 MovieClip [__Packages.Director] Frame 0
#initclip
if (!_global.Director) {
var _local1 = function () {
super();
};
_global.Director = _local1;
//_global.Director extends MovieClip
var _local2 = _local1.prototype;
_local2.onLoad = function () {
this.setMeUp();
};
_local2.setMeUp = function () {
};
_local2.setMaster = function (s) {
this.master = s;
};
_local2.setDifficulty = function (i) {
this.difficulty = i;
this.kongregateSubmit("difficultyMode", i);
};
_local2.setSandBoxObject = function (sO) {
this.sandBoxObject = sO;
};
_local2.setLevelScore = function (i) {
this.levelScore = i;
};
_local2.recyclingOn = function () {
this.allowRecycling = true;
};
_local2.recyclingOff = function () {
this.allowRecycling = false;
};
_local2.doFirstStuff = function (d) {
this.goToState(K.GAME_STATE);
this.music0 = new Sound(this.underLayer);
this.music1 = new Sound(this.resourceLayer);
this.music2 = new Sound(this.groundLayer);
this.music3 = new Sound(this.unitLayer);
this.music0.setVolume(K.MUSIC_VOLUME_MAX);
this.music1.setVolume(K.MUSIC_VOLUME_MAX);
this.music2.setVolume(K.MUSIC_VOLUME_MAX);
this.music3.setVolume(K.MUSIC_VOLUME_MAX);
this.gameSoundClip = this.createEmptyMovieClip("gameSoundClip", this.getNextHighestDepth());
this.fxInterface = new Sound(this.theInterface);
this.fxInterface.setVolume(K.FX_VOLUME_MAX);
this.fxGame = new Sound(this.gameSoundClip);
this.fxGame.setVolume(K.FX_VOLUME_MAX);
this.fxGame2 = new Sound(this.gameSoundClip);
this.fxGame2.setVolume(K.FX_VOLUME_MAX);
this.fxGame3 = new Sound(this.gameSoundClip);
this.fxGame3.setVolume(K.FX_VOLUME_MAX);
this.bldgArray = new Array();
this.gArray = new Array();
this.lArray = new Array();
this.rArray = new Array();
this.sArray = new Array();
this.uArray = new Array();
this.eArray = new Array();
this.dragBoxCoords = new Array(2);
this.dragBoxBound = new Array(4);
this.oldState = new StateStack();
this.gListen = new GameListener();
this.gListen.setMaster(this);
this.attachMovie("mc_terrain", "theTerrain", this.getNextHighestDepth());
this.theTerrain.setMaster(this);
this.theTerrain._y = this.theTerrain._y + K.INT_OFF_Y_PX;
this.underLayer.swapDepths(this.theTerrain.getDepth() + 1);
this.night.swapDepths(this.theTerrain.getDepth() + 2);
this.light.swapDepths(this.theTerrain.getDepth() + 3);
this.groundLayer.swapDepths(this.theTerrain.getDepth() + 4);
this.resourceLayer.swapDepths(this.theTerrain.getDepth() + 6);
this.unitLayer.swapDepths(this.theTerrain.getDepth() + 7);
this.smogLayer.swapDepths(this.theTerrain.getDepth() + 8);
this.drawLayer.swapDepths(this.theTerrain.getDepth() + 9);
this.underLayer._alpha = 100;
this.groundLayer._alpha = 100;
this.resourceLayer._alpha = 100;
this.unitLayer._alpha = 100;
this.smogLayer._alpha = 100;
this.drawLayer._alpha = 100;
this.bigMask.swapDepths(this.theTerrain.getDepth() + 40);
this.setupDrawLayer();
this.attachMovie("mc_interface", "theInterface", this.getNextHighestDepth());
var _local2 = new flash.filters.DropShadowFilter();
_local2.angle = 135;
_local2.strength = 1;
_local2.blurX = 15;
_local2.blurY = 15;
_local2.distance = 2;
var _local4 = this.theInterface.filters;
_local4.push(_local2);
this.theInterface.filters = _local4;
this.theInterface.setMaster(this);
this.theInterface._x = Math.round(this.theInterface._width / 2);
this.theInterface._y = Math.round(this.theInterface._height / 2);
this.setDifficulty(d);
this.lData = new LevelData();
if (this.nextLevel == undefined) {
this.lData.initialize(1, this, this.sandBoxObject, d);
} else {
this.lData.initialize(this.nextLevel, this, this.sandBoxObject, d);
}
this.selectedThings = new Array();
this.multiSelect = false;
this.startTicking();
this.buildingTicks = 0;
this.timeTicks = 0;
this.setFleetFuel(K.GASOLINE);
this.setFleetFuel(this.master.statNugget.carryFuel(this.lData.myIndex));
this.master.statNugget.storeOldFuel(this.lData.myIndex, this.fleetFuelType);
this.normalCursor();
if (this.lData.inCampaign == true) {
K.saveResearch();
this.master.statNugget.logCampaign(true);
} else {
this.master.statNugget.logCampaign(false);
}
this.transition.swapDepths(this.getNextHighestDepth());
fscommand ("showmenu", "false");
};
_local2.unloadItAll = function () {
this.music0.stop();
this.music1.stop();
this.music2.stop();
this.music3.stop();
delete this.music0;
delete this.music1;
delete this.music2;
delete this.music3;
this.fxInterface.stop();
this.fxGame.stop();
this.fxGame2.stop();
this.fxGame3.stop();
delete this.fxInterface;
delete this.fxGame;
delete this.fxGame2;
delete this.fxGame3;
delete this.bldgArray;
delete this.gArray;
delete this.lArray;
delete this.rArray;
delete this.sArray;
delete this.uArray;
delete this.eArray;
delete this.dragBoxCoords;
delete this.dragBoxBound;
delete this.oldState;
delete this.gListen;
this.theTerrain.removeMovieClip();
this.underLayer.removeMovieClip();
this.groundLayer.removeMovieClip();
this.resourceLayer.removeMovieClip();
this.unitLayer.removeMovieClip();
this.smogLayer.removeMovieClip();
this.drawLayer.removeMovieClip();
this.night.removeMovieClip();
this.theInterface.removeMovieClip();
delete this.lData;
delete this.selectedThings;
this.stopTicking();
};
_local2.setupDrawLayer = function () {
this.drawLayer.lineStyle(1, 65280);
};
_local2.onInterfaceLoaded = function () {
this.setResourceAmounts();
this.setResourceVisibility();
this.updateWeather();
};
_local2.stopTicking = function () {
clearInterval(this.tickInterval);
};
_local2.startTicking = function () {
this.tickInterval = setInterval(this, "enterFrameFunction", 1000 / K.FRAME_RATE, this);
};
_local2.enterFrameFunction = function () {
if ((this.state != K.PAUSE_STATE) && (this.state != K.MENU_STATE)) {
this.buildingTickFunction();
this.timeTickFunction();
this.runAllEntities();
}
if (K.FANCYCURSOR == true) {
Mouse.hide();
} else {
Mouse.show();
}
};
_local2.runAllEntities = function () {
var _local2 = 0;
while (_local2 < this.eArray.length) {
this.eArray[_local2].enterFrameFunction();
_local2++;
}
_local2 = 0;
while (_local2 < this.uArray.length) {
this.uArray[_local2].enterFrameFunction();
_local2++;
}
};
_local2.gotoHelp = function () {
this.switchState(K.MENU_STATE);
if (this.state == K.MENU_STATE) {
this.theInterface.showHelp();
} else {
this.theInterface.hideOptions();
}
};
_local2.gotoMenu = function () {
this.switchState(K.MENU_STATE);
if (this.state == K.MENU_STATE) {
this.theInterface.showOptions(false);
} else {
this.theInterface.hideOptions();
}
};
_local2.showFinalScore = function () {
this.theInterface.showFinalScore();
};
_local2.getLevelBonus = function () {
return(this.lData.getLevelBonus());
};
_local2.onEndOfScore = function () {
this.doNextLevel();
};
_local2.onlyShowTextThing = function () {
if (this.state != K.PAUSE_STATE) {
this.switchState(K.PAUSE_STATE);
if (this.state == K.PAUSE_STATE) {
this.theInterface.showTextThing();
}
}
};
_local2.logCasualty = function () {
this.casualties++;
};
_local2.showTutorialCrap = function () {
};
_local2.showReport = function (type) {
this.calculateNets();
this.switchState(K.PAUSE_STATE);
if (this.state == K.PAUSE_STATE) {
this.theInterface.showReport(type);
} else {
this.theInterface.hideTextThing();
}
};
_local2.showCurrObjective = function () {
this.showObjectiveMessageOnClose = true;
this.switchState(K.PAUSE_STATE);
if (this.state == K.PAUSE_STATE) {
this.theInterface.showCurrObjective();
} else {
this.theInterface.hideTextThing();
}
};
_local2.skipTextThing = function () {
this.theInterface.doSkipTextThing();
};
_local2.gotoTextThing = function () {
this.switchState(K.PAUSE_STATE);
if (this.state == K.PAUSE_STATE) {
this.theInterface.showTextThing();
} else {
this.theInterface.hideTextThing();
}
};
_local2.conditionalLose = function (cond) {
if (cond == "losenight") {
this.switchState(K.PAUSE_STATE);
if (this.state == K.PAUSE_STATE) {
this.theInterface.showTextThingLoseRoosevelt();
} else {
this.theInterface.hideTextThing();
}
}
};
_local2.loseLevel = function () {
this.switchState(K.PAUSE_STATE);
if (this.state == K.PAUSE_STATE) {
this.theInterface.showTextThingLose();
} else {
this.theInterface.hideTextThing();
}
};
_local2.hardResetLevel = function () {
if (!this.resetting) {
this.resetting = true;
if (this.lData.inSandbox == true) {
this.killResearch();
} else {
K.restoreResearch();
}
this.freezeEverything();
this.master.hardResetLevel(this.sandBoxObject);
}
};
_local2.resetLevel = function () {
if (!this.resetting) {
this.resetting = true;
if (this.lData.inSandbox == true) {
this.killResearch();
} else {
K.restoreResearch();
}
this.freezeEverything();
this.master.resetLevel(this.sandBoxObject);
}
};
_local2.freezeEverything = function () {
var _local2 = 0;
while (_local2 < this.eArray.length) {
this.eArray[_local2].levelResetMe();
_local2++;
}
_local2 = 0;
while (_local2 < this.uArray.length) {
this.uArray[_local2].levelResetMe();
_local2++;
}
};
_local2.pauseGame = function () {
var _local2 = 0;
while (_local2 < this.eArray.length) {
this.eArray[_local2].pauseMe();
_local2++;
}
};
_local2.unPauseGame = function () {
var _local2 = 0;
while (_local2 < this.eArray.length) {
this.eArray[_local2].unPauseMe();
_local2++;
}
};
_local2.eraseDragBox = function () {
this.drawLayer.clear();
};
_local2.drawDragBox = function () {
if (this.dragBoxOn) {
this.drawLayer.clear();
this.drawLayer.lineStyle(1, 65280);
this.drawLayer.moveTo(this.dragBoxCoords[0], this.dragBoxCoords[1]);
this.drawLayer.lineTo(this.cursor._x, this.dragBoxCoords[1]);
this.drawLayer.lineTo(this.cursor._x, this.cursor._y);
this.drawLayer.lineTo(this.dragBoxCoords[0], this.cursor._y);
this.drawLayer.lineTo(this.dragBoxCoords[0], this.dragBoxCoords[1]);
if (this.cursor._x < this.dragBoxCoords[0]) {
this.dragBoxBound[0] = this.cursor._x;
this.dragBoxBound[2] = this.dragBoxCoords[0];
} else {
this.dragBoxBound[2] = this.cursor._x;
this.dragBoxBound[0] = this.dragBoxCoords[0];
}
if (this.cursor._y < this.dragBoxCoords[1]) {
this.dragBoxBound[1] = this.cursor._y;
this.dragBoxBound[3] = this.dragBoxCoords[1];
} else {
this.dragBoxBound[3] = this.cursor._y;
this.dragBoxBound[1] = this.dragBoxCoords[1];
}
}
};
_local2.scrollFunction = function () {
};
_local2.scrollCheckFunction = function () {
};
_local2.tickTime = function () {
if (this.dayTime != K.TWILIGHT) {
if (this.infiniteTime == false) {
this.setGameTime(this.gameTime - 1);
this.takeTime(1);
this.checkDayNight();
}
}
this.checkCurrentObjective();
};
_local2.takeTime = function (i) {
this.timeTaken = this.timeTaken + i;
};
_local2.checkCurrentObjective = function () {
var _local2 = this.lData.getCurrObjInfo();
if ((_local2.substr(0, 2) == "b_") || (_local2.substr(0, 2) == "u_")) {
_local2 = _local2.substr(0, _local2.length - 3);
} else if (_local2.substr(0, 2) == "r_") {
_local2 = _local2.substr(0, _local2.length - 4);
} else if (_local2.substr(0, 7) == "less_r_") {
_local2 = _local2.substr(0, _local2.length - 4);
}
this.checkObjectives(_local2);
};
_local2.checkEnemyArray = function () {
var _local3 = true;
var _local2 = 0;
while (_local2 < this.eArray.length) {
if (this.eArray[_local2] != undefined) {
if (this.eArray[_local2].destroying == false) {
_local3 = false;
}
}
_local2++;
}
if (_local3) {
this.refreshEnemyArray();
}
};
_local2.checkObjectives = function (code) {
var _local2 = true;
var _local5 = this.lData.getCurrObjInfo();
var _local10 = _local5.substr(0, code.length);
if (code.toLowerCase() == _local5.toLowerCase()) {
if (code == "survive") {
var _local4 = 0;
while (_local4 < this.eArray.length) {
if (this.eArray[_local4] != undefined) {
if (this.eArray[_local4].destroying == false) {
_local2 = false;
}
} else {
_local2 = false;
}
_local4++;
}
} else if (code == "wait_dark") {
if (this.dayTime == K.NIGHT) {
_local2 = true;
} else {
_local2 = false;
}
} else if (code == "survive_day") {
if (this.dayTime == K.DAY) {
_local2 = false;
this.lData.setCurrObjInfo("wait_dark_survive");
} else {
_local2 = false;
this.lData.setCurrObjInfo("morning_survive");
}
} else if (code == "wait_dark_survive") {
if (this.dayTime == K.NIGHT) {
_local2 = false;
this.lData.setCurrObjInfo("morning_survive");
} else {
_local2 = false;
}
} else if (code == "morning_survive") {
if (this.dayTime == K.DAY) {
_local2 = false;
this.lData.setCurrObjInfo("survive");
} else {
_local2 = false;
}
} else if (code == "clean_garbage") {
if (this.gArray.length == 0) {
_local2 = true;
} else {
_local2 = false;
}
} else if (code == "talk") {
_local2 = true;
} else if (code == "score") {
_local2 = true;
} else if (code == "sandboxScore") {
_local2 = true;
} else if (_local5.substr(0, 2) == "d_") {
var _local6 = _local5.substr(2, code.length - 2);
var _local8 = code.substr(2, code.length - 2);
if (((_local6.toLowerCase() == _local8.toLowerCase()) && (_local6 != undefined)) && (_local8 != undefined)) {
if (!this.checkDisableBuildings(_local6)) {
_local2 = false;
}
} else {
_local2 = false;
}
} else if (code.substr(0, 3) == "up_") {
_local2 = this.checkUpgrade(code.substr(3, code.length - 3));
} else {
_local2 = false;
}
} else if ((_local5.substr(0, 12) == "days_survive") && (_local5.susbstr(0, 12) == "days_survive")) {
var _local9 = _local5.susbtr(code.length + 1, 2);
var _local7 = Number(_local9);
if (this.daysSurvived >= _local7) {
this.lData.setCurrObjInfo("survive");
_local2 = false;
} else {
_local2 = false;
}
} else if (_local5.substr(0, 7) == "less_r_") {
if ((code == "less_r_smog") && (_local5.substr(0, 11) == "less_r_smog")) {
var _local9 = _local5.substr(code.length + 1, 3);
var _local7 = Number(_local9);
if (this.smogLevel <= _local7) {
_local2 = true;
} else {
_local2 = false;
}
}
} else if (_local5.substr(0, 2) == "r_") {
if ((code == "r_energy") && (_local5.substr(0, 8) == "r_energy")) {
var _local9 = _local5.substr(code.length + 1, 3);
var _local7 = Number(_local9);
if (this.r_energy >= _local7) {
_local2 = true;
} else {
_local2 = false;
}
} else if ((code == "r_ffgas") && (_local5.substr(0, 6) == "r_ffgas")) {
var _local9 = _local5.substr(code.length + 1, 3);
var _local7 = Number(_local9);
if ((this.r_FF >= _local7) && (this.r_gas >= _local7)) {
_local2 = true;
} else {
_local2 = false;
}
} else if ((code == "r_research") && (_local5.substr(0, 10) == "r_research")) {
var _local9 = _local5.substr(code.length + 1, 3);
var _local7 = Number(_local9);
if (this.r_research >= _local7) {
_local2 = true;
} else {
_local2 = false;
}
} else if ((code == "r_gas") && (_local5.substr(0, 5) == "r_gas")) {
var _local9 = _local5.substr(code.length + 1, 3);
var _local7 = Number(_local9);
if (this.r_gas >= _local7) {
_local2 = true;
} else {
_local2 = false;
}
} else if ((code == "r_metal") && (_local5.substr(0, 7) == "r_metal")) {
var _local9 = _local5.substr(code.length + 1, 3);
var _local7 = Number(_local9);
if (this.r_metal >= _local7) {
_local2 = true;
} else {
_local2 = false;
}
} else if ((code == "r_food") && (_local5.substr(0, 6) == "r_food")) {
var _local9 = _local5.substr(code.length + 1, 3);
var _local7 = Number(_local9);
if (this.r_food >= (_local7 - 1)) {
_local2 = true;
} else {
_local2 = false;
}
} else if ((code == "r_ff") && (_local5.substr(0, 4) == "r_ff")) {
var _local9 = _local5.substr(code.length + 1, 3);
var _local7 = Number(_local9);
if (this.r_FF >= _local7) {
_local2 = true;
} else {
_local2 = false;
}
} else if ((code == "r_coal") && (_local5.substr(0, 5) == "r_coal")) {
var _local9 = _local5.substr(code.length + 1, 3);
var _local7 = Number(_local9);
if (this.r_coal >= _local7) {
_local2 = true;
} else {
_local2 = false;
}
} else {
_local2 = false;
}
} else if ((code.substr(0, 2) == "b_") || (code.substr(0, 2) == "u_")) {
var _local6 = _local5.substr(2, code.length - 2);
var _local8 = code.substr(2, code.length - 2);
var _local9 = _local5.substr(code.length + 1, 2);
var _local7 = Number(_local9);
if (((_local6.toLowerCase() == _local8.toLowerCase()) && (_local6 != undefined)) && (_local8 != undefined)) {
if (_local7 != undefined) {
if (code.substr(0, 2) == "b_") {
if (!this.countBuildings(_local6, _local7)) {
_local2 = false;
}
} else if (code.substr(0, 2) == "u_") {
if (!this.countUnits(_local6, _local7)) {
_local2 = false;
}
} else {
_local2 = false;
}
} else {
_local2 = false;
}
} else {
_local2 = false;
}
} else {
_local2 = false;
}
if (_local2 == true) {
this.achieveObjective();
}
};
_local2.checkUpgrade = function (s) {
var _local1 = K.getLevels(s);
if (_local1 > 0) {
return(true);
}
return(false);
};
_local2.countUnits = function (thing, num) {
var _local3 = 0;
var _local2 = 0;
while (_local2 < this.uArray.length) {
if (this.uArray[_local2].myMenu.toLowerCase() == thing.toLowerCase()) {
_local3++;
} else if (thing == "vehicle") {
_local3++;
}
if (_local3 >= num) {
return(true);
}
_local2++;
}
return(false);
};
_local2.checkDisableBuildings = function (thing) {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].myMenu.toLowerCase() == thing.toLowerCase()) {
if (this.bldgArray[_local2].disabled == false) {
return(false);
}
}
_local2++;
}
return(true);
};
_local2.countBuildings = function (thing, num) {
var _local3 = 0;
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].myMenu.toLowerCase() == thing.toLowerCase()) {
_local3++;
} else if (this.bldgArray[_local2].myMenu.toLowerCase() == ("super" + thing.toLowerCase())) {
_local3++;
}
if (_local3 >= num) {
return(true);
}
_local2++;
}
return(false);
};
_local2.doThisLevel = function (i) {
this.master.doThisLevel(i);
};
_local2.usePower = function (i) {
this.master.statNugget.usePower(i);
};
_local2.useFuel = function (i) {
this.master.statNugget.useFuel(i);
};
_local2.playSandboxLevel = function (i) {
this.master.statNugget.playSandboxLevel(i);
};
_local2.getTotalScore = function () {
return(this.master.getTotalScore());
};
_local2.beatLevel = function (i) {
if (this.lData.inCampaign) {
this.master.statNugget.beatLevel(i);
this.master.statNugget.storeResearch(i, this.getResearch());
this.master.statNugget.storeResources(i, this.getEnergy(), this.getFood(), this.getMetal(), this.getGas(), this.getFF(), this.getCoal());
this.master.statNugget.storeFuel(this.lData.myIndex, this.fleetFuelType);
this.addCampaignStats(i);
this.updateLevelStats(i);
} else if (this.lData.isChallenge) {
}
};
_local2.updateDayStats = function () {
this.daysSpent_Level++;
if (this.lData.inCampaign == true) {
if (this.lData.myIndex > 4) {
this.kongregateSubmit("EnergyProduced_Day", this.energyProduced_Day);
this.kongregateSubmit("EnergyConsumed_Day", this.energyConsumed_Day);
}
}
this.foodProduced_Day = 0;
this.energyProduced_Day = 0;
this.energyConsumed_Day = 0;
this.coalProduced_Day = 0;
this.coalConsumed_Day = 0;
this.fossilFuelsProduced_Day = 0;
this.fossilFuelsConsumed_Day = 0;
this.naturalGasProduced_Day = 0;
this.naturalGasConsumed_Day = 0;
this.foodConsumed_Day = 0;
this.defenseMetalConsumed_Day = 0;
this.defenseFFConsumed_Day = 0;
this.defenseEnergyConsumed_Day = 0;
this.metalProduced_Day = 0;
this.metalConsumed_Day = 0;
this.smogProduced_Day = 0;
this.smogProduced_Level = 0;
this.garbageProduced_Day = 0;
this.garbageConsumed_Day = 0;
this.garbageEaten_Day = 0;
this.garbageEaters_Day = 0;
this.nwasteProduced_Day = 0;
this.nwasteConsumed_Day = 0;
this.nwasteEaten_Day = 0;
this.nwasteEaters_Day = 0;
this.pollutionSpills_Day = 0;
this.nuclearAccidents_Day = 0;
this.pollutionCleanups_Day = 0;
this.zombiesNeutralized_Day = 0;
this.zombiesCorpseGarbage_Day = 0;
this.zombiesCorpseSmog_Day = 0;
this.zombiesFried_Day = 0;
};
_local2.updateLevelStats = function (theLevel) {
this.updateDayStats();
if (this.lData.inCampaign == true) {
if (this.lData.myIndex > 4) {
this.kongregateSubmit("EnergyProduced_Level", this.energyProduced_Level);
this.kongregateSubmit("EnergyConsumed_Level", this.energyConsumed_Level);
}
}
this.energyProduced_Level = 0;
this.energyConsumed_Level = 0;
};
_local2.addCampaignStats = function (theLevel) {
if (this.lData.inCampaign == true) {
this.master.statNugget.addEnergyConsumed(this.energyConsumed_Level);
this.master.statNugget.addGarbage(this.garbageProduced_Level);
this.master.statNugget.addFossilFuelsConsumed(this.fossilFuelsConsumed_Level);
this.master.statNugget.addMetalConsumed(this.metalConsumed_Level);
this.master.statNugget.addNaturalGasConsumed(this.naturalGasConsumed_Level);
this.master.statNugget.addNuclearAccidents(this.nwasteEaten_Level);
this.master.statNugget.addPollutionAccidents(this.pollutionSpills_Level);
this.master.statNugget.addSmog(this.smogProduced_Level);
this.master.statNugget.logResourcesProduced(theLevel, this.energyProduced_Level, this.foodProduced_Level, this.metalProduced_Level, this.naturalGasProduced_Level, this.fossilFuelsProduced_Level, this.coalProduced_Level, this.difficulty);
this.master.statNugget.logResourcesConsumed(theLevel, this.energyConsumed_Level, this.foodConsumed_Level, this.metalConsumed_Level, this.naturalGasConsumed_Level, this.fossilFuelsConsumed_Level, this.coalConsumed_Level, this.difficulty);
this.master.statNugget.logPollutionProduced(theLevel, this.smogProduced_Level, this.garbageProduced_Level, this.nwasteProduced_Level, this.difficulty);
this.master.statNugget.logScore(theLevel, this.levelScore);
if (this.lData.isChallenge == true) {
this.master.statNugget.logChallengeScore(this.lData.challengeIndex, this.levelScore);
}
this.master.statNugget.logRecycle(this.metalRecycled, this.usefulRecycled, this.organicRecycled, this.difficulty);
this.master.statNugget.logCasualties(theLevel, this.casualties, this.difficulty);
this.master.statNugget.logTime(theLevel, this.timeTaken, this.difficulty);
}
};
_local2.submitTheScore = function (l1, l2, l3, l4, l5, l6, l7, l8, l9, lT) {
if (this.lData.inCampaign == true) {
var _local2 = 0;
switch (this.lData.myIndex) {
case 1 :
_local2 = l1;
break;
case 2 :
_local2 = l2;
break;
case 3 :
_local2 = l3;
break;
case 4 :
_local2 = l4;
break;
case 5 :
_local2 = l5;
break;
case 6 :
_local2 = l6;
break;
case 7 :
_local2 = l7;
break;
case 8 :
_local2 = l8;
break;
case 9 :
_local2 = l9;
break;
default :
_local2 = lT;
}
this.totalScoreSoFar = lT;
this.master.statNugget.logScore(this.lData.myIndex, _local2, true);
}
};
_local2.submitChallengeScore = function (s) {
this.master.statNugget.logChallengeScore(this.lData.challengeIndex, s);
};
_local2.logDefenseEfficiency = function (d) {
this.master.statNugget.logDefenseEfficiency(this.lData.myIndex, d, this.difficulty);
};
_local2.finalizeCampaignStats = function () {
this.master.statNugget.finalizeCampaignStats(this.difficulty);
};
_local2.cutscene = function () {
};
_local2.winTheGame = function () {
this.beatLevel(this.lData.myIndex);
this.addCampaignStats(this.lData.myIndex);
this.finalizeCampaignStats();
this.winQuitTheGame();
};
_local2.doNextLevel = function () {
this.beatLevel(this.lData.myIndex);
this.master.doNextLevel();
};
_local2.onWinSandbox = function () {
this.beatLevel(this.lData.challengeIndex);
};
_local2.deleteMe = function () {
this.unloadItAll();
this.removeMovieClip();
};
_local2.doCurrentActions = function (ignoreTalk) {
var _local4 = this.lData.getCurrAction();
if (ignoreTalk) {
if (_local4 == "talk") {
_local4 = "doNothing";
}
}
if (_local4 == "multi") {
var _local3 = this.lData.getCurrMultiActions();
var _local2 = 0;
while (_local2 < _local3.length) {
this.parseAction(_local3[_local2]);
_local2++;
}
} else {
this.parseAction(_local4);
}
};
_local2.parseAction = function (action) {
if (action == "spawn") {
this.spawnEnemies(this.lData.getCurrWave());
} else if (action == "spawn_raider") {
this.spawnRaiders(this.lData.getCurrWave());
} else if (action == "spawn_raider_monstertruck") {
this.spawnRaidersAndMonsterTrucks(this.lData.getCurrWave());
} else if (action == "night_spawn") {
this.spawnWaveAtNight = true;
this.nightFall();
} else if (action.substr(0, 5) == "time_") {
var _local4 = Number(action.substr(5, action.length));
this.setGameTime(_local4 * K.CYCLETIME);
} else if (action.substr(0, 2) == "e_") {
var _local3 = action.substr(2, action.length - 2);
this.enableThing(_local3);
} else if (action == "score") {
this.checkObjectives("score");
} else if (action == "sandboxScore") {
this.checkObjectives("sandboxScore");
} else if (action == "victory") {
this.doNextLevel();
} else if (action == "sandbox_victory") {
this.onWinSandbox();
this.quitTheGame();
} else if (action == "talk") {
this.checkObjectives("talk");
} else if (action == "defeat") {
this.resetLevel();
} else if (action == "resupply") {
this.resupply();
} else if (action == "givemetal") {
this.setMetal(this.r_metal + 100);
} else if (action == "giveenergy") {
this.setEnergy(this.r_energy + 100);
} else if (action == "giveoil") {
this.setFF(this.r_FF + 50);
} else if (action == "killresearch") {
this.killResearch();
} else if (action == "ultimatevictory") {
this.winTheGame();
} else if (action == "force_sunrise") {
this.forceSunRise();
} else if (action == "condition_losenight") {
this.setCondition("losenight");
}
this.theInterface.hideBldgButton();
};
_local2.setCondition = function (cond) {
if (cond == "losenight") {
this.loseAtNight = true;
}
};
_local2.achieveObjective = function () {
this.onlyShowTextThing();
};
_local2.onEnemyRemove = function () {
this.checkEnemyArray();
};
_local2.onEnemyDie = function () {
this.neutralizeZombie(1);
this.checkEnemyArray();
this.attemptStatistic_ZombieKill();
};
_local2.attemptStatistic_ZombieKill = function () {
if (this.lData.inCampaign == true) {
this.kongregateSubmit("campaign_zombiesNeutralized", 1);
} else if (this.lData.isChallenge == true) {
this.kongregateSubmit("challenge_zombiesNeutralized", 1);
}
};
_local2.logRecycle = function (thing, amt) {
if ((amt != NaN) && (amt != undefined)) {
if (thing == "metal") {
this.metalRecycled = this.metalRecycled + amt;
} else if (thing == "useful") {
this.usefulRecycled = this.usefulRecycled + amt;
} else if (thing == "organic") {
this.organicRecycled = this.organicRecycled + amt;
}
}
};
_local2.checkDayNight = function () {
if (this.gameTime <= 0) {
if (this.dayTime == K.DAY) {
this.nightFall();
} else if (this.dayTime == K.NIGHT) {
this.sunRise();
}
this.dayTime = K.TWILIGHT;
this.weatherRefresh();
this.setGameTime(0);
}
};
_local2.nightFall = function () {
this.night.gotoAndPlay("night");
this.musicTheyApproach();
this.putBuildingsToSleep();
this.spawnTicks = 0;
this.updateDayStats();
if (this.loseAtNight == true) {
this.conditionalLose("losenight");
}
};
_local2.cpn_kongregateSubmit = function (str, n) {
if (this.lData.inCampaign == true) {
this.kongregateSubmit(str, n);
}
};
_local2.kongregateSubmit = function (str, n) {
_root.kongregateStats.submit(str, n);
};
_local2.checkLevelsBeaten = function () {
return(this.master.statNugget.checkLevelsBeaten(this.lData));
};
_local2.setNightImmediately = function () {
this.night.gotoAndStop("night_now");
this.musicThePump();
this.putBuildingsToSleep();
this.nowItsNight();
};
_local2.makeLight = function () {
this.light.clearLights();
this.makeLightThings();
};
_local2.killLight = function () {
};
_local2.makeLightThings = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].myIndex == K.FLOODLIGHTS) {
if (this.bldgArray[_local2].isOn == true) {
this.light.makeLight(this.getBuildingX(this.bldgArray[_local2].xTile), this.getBuildingY(this.bldgArray[_local2].yTile));
}
}
_local2++;
}
};
_local2.nowItsNight = function () {
this.setGameTime(this.lData.getNightHours());
this.dayTime = K.NIGHT;
this.weatherRefresh();
if (this.spawnWaveAtNight == true) {
this.spawnEnemies(this.lData.getCurrWave());
this.spawnWaveAtNight = false;
} else {
this.spawnEnemies(this.lData.getLevelEnemies());
}
this.checkObjectives("wait_dark");
};
_local2.setDayImmediately = function () {
this.night.gotoAndStop("day_now");
this.musicDayTime();
this.nowItsDay();
};
_local2.nowItsDay = function () {
this.setGameTime(this.lData.getDayHours());
this.dayTime = K.DAY;
this.weatherRefresh();
this.wakeBuildingsUp();
};
_local2.setGameTime = function (g) {
this.gameTime = g;
if (g >= 0) {
this.theInterface.updateGameTime(this.gameTime);
this.infiniteTime = false;
} else {
this.theInterface.updateGameTime(-1);
this.infiniteTime = true;
}
};
_local2.forceSunRise = function () {
if (this.dayTime != K.DAY) {
this.sunRise();
}
};
_local2.sunRise = function () {
this.night.gotoAndPlay("day");
this.dayTime = K.DAY;
this.musicDayTime();
this.checkObjectives("morning_survive");
this.daysSurvived++;
};
_local2.findBuilding = function (xx, yy) {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if ((this.bldgArray[_local2].xTile == xx) && (this.bldgArray[_local2].yTile == yy)) {
return(this.bldgArray[_local2]);
}
_local2++;
}
};
_local2.putBuildingsToSleep = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].doesSleep == true) {
this.bldgArray[_local2].showSleepAlert();
} else if (this.bldgArray[_local2].doesDrowsy == true) {
this.bldgArray[_local2].makeDrowsy();
}
_local2++;
}
};
_local2.wakeBuildingsUp = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if ((this.bldgArray[_local2].asleep == true) || (this.bldgArray[_local2].drowsy == true)) {
this.bldgArray[_local2].wakeUp();
}
_local2++;
}
_local2 = 0;
while (_local2 < this.uArray.length) {
if (this.uArray[_local2].asleep == true) {
this.uArray[_local2].wakeUp();
}
_local2++;
}
};
_local2.summonToggleGarbage = function () {
this.selectedThing.summonToggle();
};
_local2.disableToggleBuilding = function () {
this.selectedThing.disableToggle();
};
_local2.syncDisableAlerts = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].disabled == true) {
this.bldgArray[_local2].syncDisableAlert();
}
_local2++;
}
};
_local2.syncSleepAlerts = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].asleep == true) {
this.bldgArray[_local2].syncSleepAlert();
}
_local2++;
}
};
_local2.timeTickFunction = function () {
if ((this.timeTicks % K.TICK_COUNT) == 0) {
this.tickTime();
}
this.timeTicks++;
if (this.showObjectiveMessageOnClose == true) {
this.showObjectiveMessageOnClose = false;
this.showObjectiveMessage(this.lData.getCurrObjective());
}
};
_local2.buildingTickFunction = function () {
if (this.alertNextFrame) {
this.alertNextFrame = false;
this.messageAlert(this.theAlert);
}
if ((this.buildingTicks % K.TICK_COUNT) == 0) {
this.tickUnits();
this.tickBuilding(K.FLOODLIGHTS);
this.tickBuilding(K.GUNTURRET);
}
if ((this.buildingTicks % 3) == 0) {
this.doCheckTicks();
}
if ((this.buildingTicks % ((K.TICK_COUNT * K.FAST_TICK_AMOUNT) * 3)) == 0) {
this.tickBuilding(K.OILGASWELL);
}
if ((this.buildingTicks % (K.TICK_COUNT * K.FAST_TICK_AMOUNT)) == 0) {
this.tickBuilding(K.FACTORY);
this.tickBuilding(K.LAB);
this.tickBuilding(K.RECYCLINGCENTER);
this.tickEnemies();
this.repairTick();
this.calculateNets();
}
if ((this.buildingTicks % K.TICK_COUNT) == 0) {
this.checkForAlerts();
this.diluteSmog();
this.landfillAlertReady = true;
}
switch (this.buildingTicks) {
case K.FARM * K.TICK_COUNT :
this.tickBuilding(K.FARM);
break;
case K.FORTRESS * K.TICK_COUNT :
this.tickBuilding(K.FORTRESS);
break;
case K.COALPLANT * K.TICK_COUNT :
this.tickBuilding(K.COALPLANT);
break;
case K.GASPLANT * K.TICK_COUNT :
this.tickBuilding(K.GASPLANT);
break;
case K.HYDROPLANT * K.TICK_COUNT :
this.tickBuilding(K.HYDROPLANT);
break;
case K.SOLARPLANT * K.TICK_COUNT :
this.tickBuilding(K.SOLARPLANT);
break;
case K.GEOPLANT * K.TICK_COUNT :
this.tickBuilding(K.GEOPLANT);
break;
case K.WINDPLANT * K.TICK_COUNT :
this.tickBuilding(K.WINDPLANT);
break;
case K.NUCLEARPLANT * K.TICK_COUNT :
this.tickBuilding(K.NUCLEARPLANT);
break;
case K.MINE * K.TICK_COUNT :
this.tickBuilding(K.MINE);
this.tickBuilding(K.COALMINE);
break;
case K.OILGASWELL * K.TICK_COUNT :
break;
case K.FOODTIME * K.TICK_COUNT :
this.foodTick();
break;
case K.REPAIRTIME * K.TICK_COUNT :
this.weatherRefresh();
this.buildingTickRefresh();
this.unitTickRefresh();
this.statRefresh();
}
this.buildingTicks++;
if (this.buildingTicks > (K.RESETTIME * K.TICK_COUNT)) {
this.buildingTicks = 0;
}
this.checkDead();
};
_local2.statRefresh = function () {
this.zombiesFried_Cycle = 0;
this.zombiesCorpseSmog_Cycle = 0;
};
_local2.checkDead = function () {
var _local3 = 0;
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].myIndex == K.FORTRESS) {
_local3++;
}
_local2++;
}
if (_local3 <= 0) {
this.resetLevel();
}
};
_local2.weatherRefresh = function () {
if (this.dayTime == K.DAY) {
this.sunLight = K.randRange(K.SUN_OVERCAST, K.SUN_HIGH);
this.windSpeed = K.randRange(K.WIND_NO, K.WIND_HIGH);
} else if (this.dayTime == K.TWILIGHT) {
if (this.sunLight > K.SUN_LOW) {
this.sunLight = K.SUN_LOW;
}
} else if (this.dayTime == K.NIGHT) {
this.sunLight = K.SUN_NO;
this.windSpeed = K.randRange(K.WIND_NO, K.WIND_MID);
}
if (this.windSpeed < K.WIND_NO) {
this.windSpeed = K.WIND_NO;
}
if (this.windSpeed > K.WIND_HIGH) {
this.windSpeed = K.WIND_HIGH;
}
this.updateWeather();
};
_local2.updateWeather = function () {
this.buildingWeatherRefresh();
this.theInterface.setWeather(this.sunLight, this.windSpeed);
if (!this.inAMenu) {
var _local2 = this.selectedThing.myMenu.toLowerCase();
if (((_local2 == "windplant") || (_local2 == "superwindplant")) || (_local2 == "solarplant")) {
this.selectBuilding(this.selectedThing.myMenu, 0, this.selectedThing);
}
}
};
_local2.getWindSpeed = function () {
return(this.windSpeed);
};
_local2.getSunLight = function () {
return(this.sunLight);
};
_local2.doCheckTicks = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].isWeapon) {
this.bldgArray[_local2].onCheckTick();
}
_local2++;
}
};
_local2.tickBuilding = function (index) {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].myIndex == index) {
this.bldgArray[_local2].tick();
}
_local2++;
}
};
_local2.repairTick = function (index) {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].repairing == true) {
this.bldgArray[_local2].doRepairs();
}
_local2++;
}
};
_local2.foodTick = function (index) {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].eatsFood == true) {
this.bldgArray[_local2].foodTick();
}
_local2++;
}
};
_local2.buildingWeatherRefresh = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
this.bldgArray[_local2].updateForWeather(this.windSpeed, this.sunLight);
_local2++;
}
};
_local2.buildingTickRefresh = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
this.bldgArray[_local2].refreshTick();
_local2++;
}
};
_local2.unitTickRefresh = function () {
var _local2 = 0;
while (_local2 < this.uArray.length) {
this.uArray[_local2].refreshTick();
_local2++;
}
};
_local2.tickUnits = function () {
var _local2 = 0;
while (_local2 < this.uArray.length) {
this.uArray[_local2].doTick();
_local2++;
}
};
_local2.tickEnemies = function () {
var _local2 = 0;
while (_local2 < this.eArray.length) {
this.eArray[_local2].tick();
_local2++;
}
if (this.dayTime == K.NIGHT) {
if ((this.spawnTicks++) >= this.lData.spawnTicks) {
this.spawnEnemies();
this.spawnTicks = 0;
}
}
};
_local2.refreshEnemyArray = function () {
this.eArray = new Array();
};
_local2.spawnNuclearZombies = function (xx, yy, count) {
var _local2 = 0;
while (_local2 < count) {
this.makeEnemyAt(xx, yy, "edderkopp", 3, true);
_local2++;
}
};
_local2.makeEnemyAt = function (xTile, yTile, str, levelUps, wiggle) {
var _local3 = 0;
var _local2 = 0;
if (wiggle == true) {
_local3 = -16 + K.randRange(0, 32);
_local2 = -16 + K.randRange(0, 32);
}
this.makeEnemy(this.getUnitX(xTile) + _local3, this.getUnitY(yTile) + _local2, xTile, yTile, str, levelUps);
};
_local2.makeEnemy = function (xx, yy, xTile, yTile, str, levelUps) {
var _local3;
var _local5 = this.unitLayer.getNextHighestDepth();
var _local6 = "mc_enemy_" + str;
_local3 = this.unitLayer.attachMovie(_local6, "enemy_" + _local5, _local5);
_local3.setMaster(this);
if (_local3 != undefined) {
_local3._x = xx;
_local3._y = yy;
_local3.setLoc(xTile * 2, yTile * 2);
this.superPush(this.eArray, _local3);
}
var _local2 = 0;
while (_local2 < levelUps) {
_local3.doNextLevel();
_local2++;
}
this.cursor.swapDepths(_local3);
};
_local2.superPush = function (a, thing) {
var _local3 = false;
var _local1 = 0;
while (_local1 < a.length) {
if (a[_local1] == undefined) {
a[_local1] = thing;
_local3 = true;
break;
}
_local1++;
}
if (!_local3) {
a.push(thing);
}
};
_local2.updateFleetFuel = function () {
this.setFleetFuel(this.fleetFuelType);
};
_local2.setFleetFuel = function (f) {
switch (f) {
case K.GASOLINE :
this.fleetFuelString = "gasoline";
this.useFuel(1);
break;
case K.DIESEL :
this.fleetFuelString = "diesel";
break;
case K.ETHANOL :
this.fleetFuelString = "ethanol";
this.useFuel(2);
break;
case K.ELECTRIC :
this.fleetFuelString = "electric";
this.useFuel(3);
break;
case K.NATGAS :
this.fleetFuelString = "natGas";
this.useFuel(4);
break;
case K.FUELCELL :
this.fleetFuelString = "fuelCell";
}
this.fleetFuelType = f;
var _local3 = K.getFuelLevel(this.fleetFuelType);
var _local2 = 0;
while (_local2 < this.uArray.length) {
this.uArray[_local2].setFuelEconomy(this.fleetFuelType, _local3);
_local2++;
}
};
_local2.makeUnitAt = function (xTile, yTile, str, startUpSound) {
this.makeUnit(this.getUnitX(xTile), this.getUnitY(yTile), xTile, yTile, str, startUpSound);
};
_local2.makeUnit = function (xx, yy, xTile, yTile, str, startUpSound) {
var _local2;
var _local3 = this.unitLayer.getNextHighestDepth();
var _local4 = "mc_unit_" + str;
_local2 = this.unitLayer.attachMovie(_local4, "unit_" + _local3, _local3);
_local2.startUpSound = startUpSound;
_local2.setMaster(this);
if (_local2 != undefined) {
_local2._x = xx;
_local2._y = yy;
_local2.setLoc(xTile * 2, yTile * 2);
this.uArray.push(_local2);
}
this.cursor.swapDepths(_local2);
};
_local2.setResourceVisibility = function () {
this.theInterface.setResourceVisibility(this.lData.visibleResources);
};
_local2.setResourceAmounts = function () {
var _local2 = this.lData.rAmounts;
var _local3 = this.master.statNugget.carryResearch(this.lData.myIndex);
this.setResources(_local2[0], _local2[1], _local2[2], _local2[3] + _local3, _local2[4], _local2[5], _local2[6], _local2[7]);
};
_local2.resupply = function () {
var _local2 = this.master.statNugget.carryResources(this.lData.myIndex);
if ((((_local2[0] == 0) && (_local2[1] == 0)) && (_local2[2] == 0)) && (_local2[3] == 0)) {
this.setEnergy(this.r_energy + 250);
this.setFood(this.r_food + 100);
this.setMetal(this.r_metal + 100);
this.setGas(this.r_gas + 100);
} else if (K.testUnd4(_local2[0], _local2[1], _local2[2], _local2[3], "Director.resupply")) {
this.setEnergy(this.r_energy + _local2[0]);
this.setFood(this.r_food + _local2[1]);
this.setMetal(this.r_metal + _local2[2]);
this.setGas(this.r_gas + _local2[3]);
} else {
this.setEnergy(this.r_energy + 250);
this.setFood(this.r_food + 100);
this.setMetal(this.r_metal + 100);
this.setGas(this.r_gas + 100);
}
};
_local2.setResources = function (e, f, s, r, m, g, ff, c) {
this.setEnergy(e);
this.setFood(f);
this.setSmog(s);
this.setMetal(m);
this.setGas(g);
this.setFF(ff);
this.setResearch(r);
this.setCoal(c);
};
_local2.addSmog = function (s) {
if (s != undefined) {
this.smogLevel = this.smogLevel + s;
this.theInterface.setSmog(this.smogLevel);
}
this.updateSmog();
};
_local2.diluteSmog = function () {
this.unproduceSmog(K.SMOG_DILUTE);
this.smogLevel = this.smogLevel - K.SMOG_DILUTE;
if (this.smogLevel <= 0) {
this.smogLevel = 0;
}
this.theInterface.setSmog(this.smogLevel);
this.updateSmog();
};
_local2.updateSmog = function () {
if (this.smogLevel > 999) {
this.smogLevel = 999;
}
var _local2 = Math.floor(100 * (this.smogLevel / 999));
this.smogLayer.gotoAndStop(_local2);
this.smogLevelUps = Math.round(this.smogLevel / 250);
};
_local2.getSmog = function () {
return(this.smogLevel);
};
_local2.getFood = function () {
return(this.r_food);
};
_local2.getEnergy = function () {
return(this.r_energy);
};
_local2.getResearch = function () {
return(this.r_research);
};
_local2.getMetal = function () {
return(this.r_metal);
};
_local2.getGas = function () {
return(this.r_gas);
};
_local2.getCoal = function () {
return(this.r_coal);
};
_local2.getFF = function () {
return(this.r_FF);
};
_local2.setSmog = function (s) {
if (s != undefined) {
this.smogLevel = s;
this.theInterface.setSmog(s);
}
this.updateSmog();
};
_local2.setEnergy = function (e) {
this.r_energy = e;
this.theInterface.setEnergy(e);
};
_local2.setFood = function (f) {
if (this.testUnd(f, "setFood")) {
this.r_food = f;
this.theInterface.setFood(f);
}
};
_local2.recalcResourceNums = function () {
this.recalcResourceNums();
};
_local2.setNetEnergy = function (e, ei, eo) {
if (this.testUnd3(e, ei, eo, "setNetEnergy")) {
this.energyNet = e;
this.theInterface.setEnergyNet(e, ei, eo);
}
};
_local2.setNetFood = function (f, fi, fo) {
if (this.testUnd3(f, fi, fo, "setNetFood")) {
this.foodNet = f;
this.theInterface.setFoodNet(f, fi, fo);
}
};
_local2.checkForAlerts = function () {
if ((this.energyNet < 0) && (this.foodNet < 0)) {
if (this.lastAlert != "efDefecit") {
this.doMessageAlert("efDefecit");
}
} else if (this.energyNet < 0) {
if (this.lastAlert != "eDefecit") {
this.doMessageAlert("eDefecit");
}
} else if ((this.foodNet < 0) && (this.r_food <= 10)) {
if (this.lastAlert != "fDefecit") {
this.doMessageAlert("fDefecit");
}
}
};
_local2.setMetal = function (m) {
this.r_metal = m;
this.theInterface.setMetal(m);
};
_local2.setGas = function (g) {
this.r_gas = g;
this.theInterface.setGas(g);
};
_local2.setCoal = function (c) {
this.r_coal = c;
this.theInterface.setCoal(c);
};
_local2.setFF = function (ff) {
this.r_FF = ff;
this.theInterface.setFF(ff);
};
_local2.setResearch = function (r) {
this.r_research = r;
this.theInterface.setResearch(r);
};
_local2.getRecyclingStats = function () {
var _local16 = K.RECYCLINGCENTER;
var _local3 = 0;
var _local15 = 0;
var _local6 = 0;
var _local12 = 0;
var _local5 = 0;
var _local4 = 0;
var _local10 = 0;
var _local8 = 0;
var _local9 = 0;
var _local13 = 0;
var _local14 = 0;
var _local7 = 0;
var _local11 = 0;
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (((this.bldgArray[_local2].myIndex == _local16) && (this.bldgArray[_local2].disabled == false)) && (this.bldgArray[_local2].asleep == false)) {
_local10++;
_local3 = _local3 + this.bldgArray[_local2].scrapin;
_local15 = _local15 + this.bldgArray[_local2].usefulin;
_local6 = _local6 + this.bldgArray[_local2].organicin;
_local12 = _local12 + this.bldgArray[_local2].mout;
_local5 = _local5 + this.bldgArray[_local2].eout;
_local4 = _local4 + this.bldgArray[_local2]._gasout;
_local8 = _local8 + this.bldgArray[_local2]._scrapin;
_local9 = _local9 + this.bldgArray[_local2]._usefulin;
_local13 = _local13 + this.bldgArray[_local2]._organicin;
_local14 = _local14 + this.bldgArray[_local2]._mout;
_local7 = _local7 + this.bldgArray[_local2]._eout;
_local11 = _local11 + this.bldgArray[_local2].__gasout;
}
_local2++;
}
var _local17 = new Array(_local10, _local3, _local15, _local6, _local12, _local5, _local4, _local8, _local9, _local13, _local14, _local7, _local11);
return(_local17);
};
_local2.getBuildingStats2 = function (index) {
var _local10 = 0;
var _local4 = 0;
var _local7 = 0;
var _local9 = 0;
var _local6 = 0;
var _local8 = 0;
var _local5 = 0;
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (((this.bldgArray[_local2].myIndex == index) && (this.bldgArray[_local2].disabled == false)) && (this.bldgArray[_local2].asleep == false)) {
_local10++;
if (index == K.COALPLANT) {
_local9 = _local9 + this.bldgArray[_local2].coalIn;
} else if (index == K.GASPLANT) {
_local9 = _local9 + this.bldgArray[_local2].gasIn;
}
if (index == K.LAB) {
_local7 = _local7 + ((this.bldgArray[_local2].researchOut * K.REPAIRTIME) / K.FAST_TICK_AMOUNT);
_local6 = _local6 + ((this.bldgArray[_local2].garbageRate * K.REPAIRTIME) / K.FAST_TICK_AMOUNT);
_local5 = _local5 + this.bldgArray[_local2].garbageProduced;
_local4 = _local4 + ((this.bldgArray[_local2].smogAmount * K.REPAIRTIME) / K.FAST_TICK_AMOUNT);
} else if (index == K.RECYCLINGCENTER) {
} else if (index == K.OILGASWELL) {
_local7 = _local7 + ((this.bldgArray[_local2].ffOut * K.REPAIRTIME) / (K.FAST_TICK_AMOUNT * 3));
_local6 = _local6 + ((this.bldgArray[_local2].garbageRate * K.REPAIRTIME) / (K.FAST_TICK_AMOUNT * 3));
_local5 = _local5 + this.bldgArray[_local2].garbageProduced;
_local4 = _local4 + ((this.bldgArray[_local2].smogAmount * K.REPAIRTIME) / (K.FAST_TICK_AMOUNT * 3));
} else if (index == K.MINE) {
_local7 = _local7 + this.bldgArray[_local2].metalOut;
_local6 = _local6 + this.bldgArray[_local2].garbageRate;
_local5 = _local5 + this.bldgArray[_local2].garbageProduced;
_local4 = _local4 + this.bldgArray[_local2].smogAmount;
} else if (index == K.COALMINE) {
_local7 = _local7 + this.bldgArray[_local2].coalOut;
_local6 = _local6 + this.bldgArray[_local2].garbageRate;
_local5 = _local5 + this.bldgArray[_local2].garbageProduced;
_local4 = _local4 + this.bldgArray[_local2].smogAmount;
} else if (index == K.NUCLEARPLANT) {
_local8 = _local8 + this.bldgArray[_local2].nWasteOut;
} else if (index == K.FACTORY) {
_local6 = _local6 + this.bldgArray[_local2].garbageThisCycle;
_local5 = _local5 + this.bldgArray[_local2].garbageProduced;
_local4 = _local4 + this.bldgArray[_local2].smogThisCycle;
} else if (index == K.LANDFILL) {
_local6 = _local6 + this.bldgArray[_local2].garbageInThisCycle;
_local5 = _local5 + this.bldgArray[_local2].garbageProduced;
_local4 = _local4 + this.bldgArray[_local2].smogThisCycle;
} else if (index == K.NUCLEARDUMP) {
_local8 = _local8 + this.bldgArray[_local2].nwasteInThisCycle;
_local4 = _local4 + this.bldgArray[_local2].smogThisCycle;
} else {
_local6 = _local6 + this.bldgArray[_local2].garbageRate;
_local5 = _local5 + this.bldgArray[_local2].garbageProduced;
_local4 = _local4 + this.bldgArray[_local2].smogAmount;
}
}
_local2++;
}
return(new Array(_local10, _local4, _local7, _local9, _local6, _local8, _local5));
};
_local2.getZombieStats = function () {
return(new Array(this.zombiesNeutralized_Day, this.zombiesCorpseGarbage_Day, this.garbageEaters_Day, this.garbageEaten_Day, this.nwasteEaters_Day, this.nwasteEaten_Day, this.zombiesCorpseGarbage_Level, this.zombiesFried_Cycle, this.zombiesCorpseSmog_Cycle));
};
_local2.getBuildingStats = function (index) {
var _local12 = 0;
var _local3 = 0;
var _local4 = 0;
var _local11 = 0;
var _local6 = 0;
var _local13 = 0;
var _local10 = 0;
var _local8 = 0;
var _local9 = 0;
var _local7 = 0;
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (((this.bldgArray[_local2].myIndex == index) && (this.bldgArray[_local2].disabled == false)) && (this.bldgArray[_local2].asleep == false)) {
_local12++;
if (index == K.LAB) {
_local3 = _local3 + ((this.bldgArray[_local2].energyIn * K.REPAIRTIME) / K.FAST_TICK_AMOUNT);
_local4 = _local4 + ((this.bldgArray[_local2].energyOut * K.REPAIRTIME) / K.FAST_TICK_AMOUNT);
} else if (index == K.RECYCLINGCENTER) {
_local3 = 0;
_local4 = 0;
} else if (index == K.OILGASWELL) {
_local3 = _local3 + ((this.bldgArray[_local2].energyIn * K.REPAIRTIME) / (K.FAST_TICK_AMOUNT * 3));
_local4 = _local4 + ((this.bldgArray[_local2].energyOut * K.REPAIRTIME) / (K.FAST_TICK_AMOUNT * 3));
} else {
_local3 = _local3 + this.bldgArray[_local2].energyIn;
_local4 = _local4 + this.bldgArray[_local2].energyOut;
if (this.bldgArray[_local2].amSuper) {
_local10 = _local10 + this.bldgArray[_local2].energyIn;
_local8 = _local8 + this.bldgArray[_local2].energyOut;
_local13++;
_local9 = _local9 + this.bldgArray[_local2].foodIn;
_local7 = _local7 + this.bldgArray[_local2].foodOut;
}
}
_local11 = _local11 + this.bldgArray[_local2].foodIn;
_local6 = _local6 + this.bldgArray[_local2].foodOut;
}
_local2++;
}
return(new Array(_local12, _local3, _local4, _local11, _local6, _local13, _local10, _local8, _local9, _local7));
};
_local2.getUnitStats = function (index) {
var _local3 = 0;
var _local6 = 0;
var _local5 = 0;
var _local2 = 0;
while (_local2 < this.uArray.length) {
if ((this.uArray[_local2].myIndex == index) && (this.uArray[_local2].disabled == false)) {
_local6++;
if (index == K.ENGINEER) {
_local3 = _local3 + this.uArray[_local2].fuelConsumption;
} else {
_local3 = _local3 + (this.uArray[_local2].fuelConsumption * 3);
}
_local5 = _local5 + this.uArray[_local2].smogRate;
}
_local2++;
}
return(new Array(_local6, _local3, _local5));
};
} else {
// unexpected jump
}
_local2.calculateNets = function () {
var _local3 = 0;
var _local5 = 0;
var _local7 = 0;
var _local6 = 0;
var _local4 = 0;
var _local8 = 0;
if (this.fleetFuelType == K.ELECTRIC) {
var _local2 = 0;
while (_local2 < this.uArray.length) {
if (this.uArray[_local2].myIndex == K.ENGINEER) {
_local3 = _local3 - this.uArray[_local2].fuelConsumption;
_local4 = _local4 - this.uArray[_local2].fuelConsumption;
} else {
_local3 = _local3 - (this.uArray[_local2].fuelConsumption * 3);
_local4 = _local4 - (this.uArray[_local2].fuelConsumption * 3);
}
_local2++;
}
} else if (this.fleetFuelType == K.ETHANOL) {
var _local2 = 0;
while (_local2 < this.uArray.length) {
if (this.uArray[_local2].myIndex == K.ENGINEER) {
_local5 = _local5 - this.uArray[_local2].fuelConsumption;
_local6 = _local6 - this.uArray[_local2].fuelConsumption;
} else {
_local5 = _local5 - (this.uArray[_local2].fuelConsumption * 3);
_local6 = _local6 - (this.uArray[_local2].fuelConsumption * 3);
}
_local2++;
}
}
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (((this.bldgArray[_local2].disabled == false) && (this.bldgArray[_local2].asleep == false)) && (this.bldgArray[_local2].isAlert == false)) {
if ((this.bldgArray[_local2].myIndex == K.FACTORY) || (this.bldgArray[_local2].myIndex == K.LAB)) {
if (this.bldgArray[_local2].producing == true) {
_local3 = _local3 - ((this.bldgArray[_local2].energyIn * K.REPAIRTIME) / K.FAST_TICK_AMOUNT);
_local4 = _local4 - ((this.bldgArray[_local2].energyIn * K.REPAIRTIME) / K.FAST_TICK_AMOUNT);
}
} else if (this.bldgArray[_local2].myIndex == K.OILGASWELL) {
_local3 = _local3 - (this.bldgArray[_local2].energyIn * (K.REPAIRTIME / (K.FAST_TICK_AMOUNT * 3)));
_local4 = _local4 - (this.bldgArray[_local2].energyIn * (K.REPAIRTIME / (K.FAST_TICK_AMOUNT * 3)));
} else if (this.bldgArray[_local2].myIndex == K.RECYCLINGCENTER) {
} else if ((this.bldgArray[_local2].myIndex != K.TESLACOIL) && (this.bldgArray[_local2].myIndex != K.FLOODLIGHTS)) {
_local3 = _local3 + this.bldgArray[_local2].energyOut;
_local8 = _local8 + this.bldgArray[_local2].energyOut;
_local3 = _local3 - this.bldgArray[_local2].energyIn;
_local4 = _local4 - this.bldgArray[_local2].energyIn;
_local5 = _local5 + this.bldgArray[_local2].foodOut;
_local6 = _local6 + this.bldgArray[_local2].foodOut;
}
if (this.bldgArray[_local2].eatsFood) {
if (this.dayTime == K.DAY) {
_local5 = _local5 - this.bldgArray[_local2].foodIn;
_local7 = _local7 - this.bldgArray[_local2].foodIn;
}
}
}
_local2++;
}
_local3 = Math.round(_local3);
_local5 = Math.round(_local5);
_local8 = Math.round(_local8);
_local4 = Math.round(_local4);
_local7 = Math.round(_local7);
_local6 = Math.round(_local6);
this.setNetEnergy(_local3, _local8, _local4);
this.setNetFood(_local5, _local6, _local7);
};
_local2.farmDrain = function () {
this.setEnergy(this.r_energy - K.E_IN_FARM);
};
_local2.gasPlantDrain = function () {
this.setGas(this.r_gas - 1);
};
_local2.labDrain = function (e, m) {
this.setEnergy(this.r_energy - e);
this.setMetal(this.r_metal - m);
};
_local2.factoryDrain = function (e, m) {
this.setEnergy(this.r_energy - e);
this.setMetal(this.r_metal - m);
};
_local2.printStats = function () {
};
_local2.produceSmog = function (amt) {
if (this.testUnd(amt, "produceSmog")) {
this.smogProduced_Day = this.smogProduced_Day + amt;
this.smogProduced_Level = this.smogProduced_Level + amt;
}
};
_local2.unproduceSmog = function (amt) {
if (this.testUnd(amt, "unproduceSmog")) {
this.smogConsumed_Day = this.smogConsumed_Day + amt;
this.smogConsumed_Level = this.smogConsumed_Level + amt;
}
};
_local2.onGarbageEat = function (amt) {
if (this.testUnd(amt, "onGarbageEat")) {
this.garbageEaters_Day = this.garbageEaters_Day + amt;
this.garbageEaters_Level = this.garbageEaters_Level + amt;
this.garbageEaten_Day = this.garbageEaten_Day + amt;
this.garbageEaten_Level = this.garbageEaten_Level + amt;
}
};
_local2.onNWasteEat = function (amt) {
if (this.testUnd(amt, "onNWasteEat")) {
this.nwasteEaters_Day = this.nwasteEaters_Day + amt;
this.nwasteEaters_Level = this.nwasteEaters_Level + amt;
this.nwasteEaten_Day = this.nwasteEaten_Day + amt;
this.nwasteEaten_Level = this.nwasteEaten_Level + amt;
}
};
_local2.producePollutionSpill = function (amt) {
if (this.testUnd(amt, "producePollutionSpill")) {
this.pollutionSpills_Day = this.pollutionSpills_Day + amt;
this.pollutionSpills_Level = this.pollutionSpills_Level + amt;
}
};
_local2.unproducePollutionSpill = function (amt) {
if (this.testUnd(amt, "unproducePollutionSpill")) {
this.pollutionCleanups_Day = this.pollutionCleanups_Day + amt;
this.pollutionCleanups_Level = this.pollutionCleanups_Level + amt;
}
};
_local2.produceNWaste = function (amt) {
if (this.testUnd(amt, "produceNWaste")) {
this.nwasteProduced_Day = this.nwasteProduced_Day + amt;
this.nwasteProduced_Level = this.nwasteProduced_Level + amt;
}
};
_local2.unproduceNWaste = function (amt) {
if (this.testUnd(amt, "unproduceNWaste")) {
this.nwasteConsumed_Day = this.nwasteConsumed_Day + amt;
this.nwasteConsumed_Level = this.nwasteConsumed_Level + amt;
}
};
_local2.neutralizeZombie = function (amt) {
if (this.testUnd(amt, "neturalizeZombie")) {
this.zombiesNeutralized_Day = this.zombiesNeutralized_Day + amt;
this.zombiesNeutralized_Level = this.zombiesNeutralized_Level + amt;
}
};
_local2.produceGarbage = function (amt) {
if (this.testUnd(amt, "produceGarbage")) {
this.garbageProduced_Day = this.garbageProduced_Day + amt;
this.garbageProduced_Level = this.garbageProduced_Level + amt;
}
};
_local2.unproduceGarbage = function (amt) {
if (this.testUnd(amt, "makeGarbage")) {
this.garbageConsumed_Day = this.garbageConsumed_Day + amt;
this.garbageConsumed_Level = this.garbageConsumed_Level + amt;
}
};
_local2.makeFF = function (f) {
if (this.testUnd(f, "makeFF")) {
this.setFF(this.r_FF + f);
this.fossilFuelsProduced_Day = this.fossilFuelsProduced_Day + f;
this.fossilFuelsProduced_Level = this.fossilFuelsProduced_Level + f;
}
};
_local2.makeCoal = function (c) {
if (this.testUnd(c, "makeCoal")) {
this.setCoal(this.r_coal + c);
this.coalProduced_Day = this.coalProduced_Day + c;
this.coalProduced_Level = this.coalProduced_Level + c;
}
};
_local2.makeResearch = function (r) {
if (this.testUnd(r, "makeResearch")) {
this.setResearch(this.r_research + r);
}
};
_local2.drainCoal = function (c) {
if (this.testUnd(c, "drainCoal")) {
this.setCoal(this.r_coal - c);
this.coalConsumed_Day = this.coalConsumed_Day + c;
this.coalConsumed_Level = this.coalConsumed_Level + c;
}
};
_local2.drainFF = function (f, defense) {
if (this.testUnd(f, "drainFF")) {
this.setFF(this.r_FF - f);
this.fossilFuelsConsumed_Day = this.fossilFuelsConsumed_Day + f;
this.fossilFuelsConsumed_Level = this.fossilFuelsConsumed_Level + f;
if (defense) {
this.defenseFFConsumed_Day = this.defenseFFConsumed_Day + f;
this.defenseFFConsumed_Level = this.defenseFFConsumed_Level + f;
}
}
};
_local2.drainResearch = function (r) {
if (this.testUnd(r, "drainResearch")) {
this.setResearch(this.r_research - r);
}
};
_local2.testUnd3 = function (amt, amt2, amt3, str) {
return(K.testUnd3(amt, amt2, amt3, "Director." + str));
};
_local2.testUnd = function (amt, str) {
return(K.testUnd(amt, "Director." + str));
};
_local2.drainSomething = function (amt, s) {
if (s == "energy") {
this.drainEnergy(amt, false);
} else if (s == "food") {
this.drainFood(amt);
} else if (s == "metal") {
this.drainMetal(amt, false);
} else if (s == "gas") {
this.drainGas(amt, false);
} else if (s == "research") {
this.drainResearch(amt);
} else if (s == "FF") {
this.drainFF(amt, false);
} else if (s == "coal") {
this.drainCoal(amt);
}
};
_local2.makeGas = function (g) {
if (this.testUnd(g, "makeGas")) {
this.setGas(this.r_gas + g);
this.naturalGasProduced_Day = this.naturalGasProduced_Day + g;
this.naturalGasProduced_Level = this.naturalGasProduced_Level + g;
}
};
_local2.drainGas = function (g, defense) {
if (this.testUnd(g, "drainGas")) {
this.setGas(this.r_gas - g);
this.naturalGasConsumed_Day = this.naturalGasConsumed_Day + g;
this.naturalGasConsumed_Level = this.naturalGasConsumed_Level + g;
if (defense) {
this.defenseGasConsumed_Day = this.defenseGasConsumed_Day + g;
this.defenseGasConsumed_Level = this.defenseGasConsumed_Level + g;
}
if (this.r_gas < 0) {
this.r_gas = 0;
}
}
};
_local2.makeEnergy = function (e) {
if (this.testUnd(e, "makeEnergy")) {
this.energyProduced_Day = this.energyProduced_Day + e;
this.energyProduced_Level = this.energyProduced_Level + e;
this.setEnergy(this.r_energy + e);
}
};
_local2.drainEnergy = function (e, defense) {
if (this.testUnd(e, "drainEnergy")) {
this.energyConsumed_Day = this.energyConsumed_Day + e;
this.energyConsumed_Level = this.energyConsumed_Level + e;
if (defense) {
this.defenseEnergyConsumed_Day = this.defenseEnergyConsumed_Day + e;
this.defenseEnergyConsumed_Level = this.defenseEnergyConsumed_Level + e;
}
this.setEnergy(this.r_energy - e);
if (this.r_energy < 0) {
this.r_energy = 0;
}
}
};
_local2.makeFood = function (f) {
if (this.testUnd(f, "makeFood")) {
this.foodProduced_Day = this.foodProduced_Day + f;
this.foodProduced_Level = this.foodProduced_Level + f;
this.setFood(this.r_food + f);
}
};
_local2.drainFood = function (f) {
if (this.testUnd(f, "drainFood")) {
this.setFood(this.r_food - f);
if (this.r_food < 0) {
this.setFood(0);
}
this.foodConsumed_Day = this.foodConsumed_Day + f;
this.foodConsumed_Level = this.foodConsumed_Level + f;
}
};
_local2.makeMetal = function (m) {
if (this.testUnd(m, "makeMetal")) {
this.setMetal(this.r_metal + m);
this.metalProduced_Day = this.metalProduced_Day + m;
this.metalProduced_Level = this.metalProduced_Level + m;
}
};
_local2.drainMetal = function (m, defense) {
if (this.testUnd(m, "drainMetal")) {
this.setMetal(this.r_metal - m);
if (this.r_metal < 0) {
this.setMetal(0);
}
this.metalConsumed_Day = this.metalConsumed_Day + m;
this.metalConsumed_Level = this.metalConsumed_Level + m;
if (defense) {
this.defenseMetalConsumed_Day = this.defenseMetalConsumed_Day + m;
this.defenseMetalConsumed_Level = this.defenseMetalConsumed_Level + m;
}
}
};
_local2.unitCoalDrain = function () {
this.drainCoal(1);
};
_local2.unitFFDrain = function () {
this.drainFF(1);
};
_local2.coalPlantDrain = function () {
this.drainCoal(1);
};
_local2.FFPlantDrain = function () {
this.drainFF(1);
};
_local2.foodDrain = function (f) {
if (this.testUnd(f, "foodDrain")) {
this.setFood(this.r_food - f);
}
};
_local2.energyDrain = function (e) {
this.drainEnergy(e);
};
_local2.coalMineDrain = function () {
this.mineDrain();
};
_local2.mineDrain = function () {
this.drainEnergy(K.E_IN_MINE);
};
_local2.farmMake = function () {
this.setFood(this.r_food + 5);
};
_local2.superFarmMake = function () {
this.setFood(this.r_food + 10);
};
_local2.gasPlantMake = function () {
this.makeEnergy(20);
};
_local2.giveMetal = function (m) {
this.makeMetal(m);
};
_local2.FFPlantMake = function () {
this.makeEnergy(30);
};
_local2.coalMineMake = function () {
this.makeCoal(5);
};
_local2.mineMake = function () {
this.makeMetal(5);
};
_local2.lessThanMaxResearch = function () {
if (this.r_research < 999) {
return(true);
}
return(false);
};
_local2.lessThanMaxFood = function () {
if (this.r_food < 999) {
return(true);
}
return(false);
};
_local2.lessThanMaxMetal = function () {
if (this.r_metal < 999) {
return(true);
}
return(false);
};
_local2.hasFood = function (amt) {
if (this.r_food >= amt) {
return(true);
}
return(false);
};
_local2.hasEnergy = function (amt) {
if (this.r_energy >= amt) {
return(true);
}
return(false);
};
_local2.hasResearch = function (amt) {
if (this.r_research >= amt) {
return(true);
}
return(false);
};
_local2.checkCoal = function (amt) {
return(this.r_coal - amt);
};
_local2.checkFF = function (amt) {
return(this.r_FF - amt);
};
_local2.checkGas = function (amt) {
return(this.r_gas - amt);
};
_local2.hasMetal = function (amt) {
if (amt <= 0) {
return(true);
}
if (this.r_metal >= amt) {
return(true);
}
return(false);
};
_local2.hasGas = function (amt) {
if (amt <= 0) {
return(true);
}
if (this.r_gas >= amt) {
return(true);
}
return(false);
};
_local2.hasCoal = function (amt) {
if (amt <= 0) {
return(true);
}
if (this.r_coal >= amt) {
return(true);
}
return(false);
};
_local2.hasFF = function (amt) {
if (amt <= 0) {
return(true);
}
if (this.r_FF >= amt) {
return(true);
}
return(false);
};
_local2.lessThanMaxGas = function () {
if (this.r_gas < 999) {
return(true);
}
return(false);
};
_local2.lessThanMaxCoal = function () {
if (this.r_coal < 999) {
return(true);
}
return(false);
};
_local2.lessThanMaxFF = function () {
if (this.r_FF < 999) {
return(true);
}
return(false);
};
_local2.lessThanMaxEnergy = function () {
if (this.r_energy < 999) {
return(true);
}
return(false);
};
_local2.interfaceHasFocus = function () {
this.interfaceFocus = true;
if (this.buildCursor) {
this.buildIcon.deactivate();
}
};
_local2.interfaceLoseFocus = function () {
this.interfaceFocus = false;
if (this.buildCursor) {
this.buildIcon.activate();
}
};
_local2.showCursor = function (str) {
if (K.FANCYCURSOR == true) {
this.cursor.showCursor(str);
this.cursor._visible = true;
} else {
this.cursor.showCursor("_" + str);
this.cursor._visible = true;
}
this.currCursor = str;
};
_local2.updateCursor = function () {
this.showCursor(this.currCursor);
};
_local2.cursorOnTop = function (d) {
this.cursor.swapDepths(d);
};
_local2.levelDataLoaded = function (type) {
this.loadData(type);
};
_local2.loadData = function (type) {
this.theTerrain.makeMap();
if (this.lData.noMansLand[0] == true) {
this.makeNoMansLand(0, K.VERTICAL);
}
if (this.lData.noMansLand[1] == true) {
this.makeNoMansLand(1, K.VERTICAL);
}
if (this.lData.noMansLand[2] == true) {
this.makeNoMansLand(0, K.HORIZONTAL);
}
if (this.lData.noMansLand[3] == true) {
this.makeNoMansLand(1, K.HORIZONTAL);
}
this.makeStartLocation();
};
_local2.makeStartGarbage = function () {
var _local3 = 0;
while (_local3 < this.lData.gArray.length) {
var _local2 = 0;
while (_local2 < this.lData.gArray[_local3].length) {
if (this.lData.gArray[_local3][_local2] != 0) {
if ((this.lData.gArray[_local3][_local2] < 0) && (this.lData.gArray[_local3][_local2] != -99)) {
this.makeResourceUnit(_local2 * 2, _local3 * 2, Math.abs(this.lData.gArray[_local3][_local2]), "nWaste");
} else if (this.lData.gArray[_local3][_local2] == -99) {
this.polluteTile(_local2, _local3);
} else if (this.lData.gArray[_local3][_local2] < 100) {
var _local6 = Math.abs(this.lData.gArray[_local3][_local2]);
var _local8 = _local6 * 0.25;
var _local5 = _local6 * 0;
var _local9 = _local6 * 0.25;
var _local7 = _local6 * 0.5;
this.makeGarbageUnit2(_local2 * 2, _local3 * 2, _local8, _local5, _local9, _local7, false);
} else {
var _local4 = Math.abs(this.lData.gArray[_local3][_local2] - 100);
_local4 = Math.round(_local4 / 4);
var _local8 = _local4 * 0;
var _local5 = _local4 * 0.25;
var _local9 = _local4 * 0.25;
var _local7 = _local4 * 0.5;
this.makeGarbageUnit2(_local2 * 2, _local3 * 2, _local8, _local5, _local9, _local7, true);
this.makeGarbageUnit2((_local2 * 2) + 1, _local3 * 2, _local8, _local5, _local9, _local7, true);
this.makeGarbageUnit2(_local2 * 2, (_local3 * 2) + 1, _local8, _local5, _local9, _local7, true);
this.makeGarbageUnit2((_local2 * 2) + 1, (_local3 * 2) + 1, _local8, _local5, _local9, _local7, true);
}
}
_local2++;
}
_local3++;
}
};
_local2.makeStartLocation = function () {
this.disableThings();
var _local3 = this.lData.getStartLoc();
var _local2 = 0;
while (_local2 < _local3.length) {
this.buildBuilding(_local3[_local2][0], _local3[_local2][1], "fortress", false, true);
_local2++;
}
this.makeStartGarbage();
this.makeStartBuildings();
this.setDefecits();
this.startDayTime();
this.gotoTextThing();
};
_local2.enableThing = function (str) {
var _local4 = 0;
while (_local4 < this.lData.disables.length) {
if (this.lData.disables[_local4].toLowerCase() == str.toLowerCase()) {
if (((str.toLowerCase() == "floodlights") || (str.toLowerCase() == "gunturret")) || (str.toLowerCase() == "teslacoil")) {
var _local2 = 0;
while (_local2 < this.lData.disables.length) {
if (this.lData.disables[_local2].toLowerCase() == "defenses") {
this.lData.disables.splice(_local2, 1);
this.theInterface["showGlowy" + str]();
}
_local2++;
}
}
this.lData.disables.splice(_local4, 1);
}
_local4++;
}
if (str.toLowerCase() == "gas") {
this.lData.setVisibleResource(4, true);
this.setResourceVisibility();
} else if (str.toLowerCase() == "food") {
this.lData.setVisibleResource(1, true);
this.setResourceVisibility();
} else if (str.toLowerCase() == "energy") {
this.lData.setVisibleResource(0, true);
this.setResourceVisibility();
} else if (str.toLowerCase() == "coal") {
this.lData.setVisibleResource(6, true);
this.setResourceVisibility();
} else if (str.toLowerCase() == "ff") {
this.lData.setVisibleResource(5, true);
this.setResourceVisibility();
} else if (str.toLowerCase() == "metal") {
this.lData.setVisibleResource(3, true);
this.setResourceVisibility();
} else if (str.toLowerCase() == "smog") {
this.lData.setVisibleResource(2, true);
this.setResourceVisibility();
}
this.theInterface["showGlowy" + str]();
};
_local2.disableThings = function () {
this.theInterface.disableAllFuelsExcept(this.fleetFuelString);
var _local2 = 0;
while (_local2 < this.lData.disables.length) {
this.theInterface["disable" + this.lData.disables[_local2]]();
_local2++;
}
};
_local2.setDefecits = function () {
this.energyDefecits = this.lData.energyDefecits;
this.foodDefecits = this.lData.foodDefecits;
};
_local2.makeStartBuildings = function () {
var _local2 = this.lData.getBuildingArray();
var _local3 = 0;
while (_local3 < _local2.length) {
var _local4 = false;
if (_local2[_local3].name.substr(0, 4) == "super") {
_local4 = true;
_local2[_local3].p = _local2[_local3].p.substr(4, _local2[_local3].p.length - 4);
}
this.buildBuilding(_local2[_local3].xLoc, _local2[_local3].yLoc, _local2[_local3].p, _local4, true);
_local3++;
}
_local3 = 0;
while (_local3 < this.lData.freeTrucks) {
if (this.lData.freeTrucks < this.bldgArray.length) {
this.makeUnitAt(this.bldgArray[_local3].xTile, this.bldgArray[_local3].yTile, "GarbageTruck", false);
} else {
this.makeUnitAt(10 + _local3, 10 + _local3, "GarbageTruck", false);
}
_local3++;
}
_local3 = 0;
while (_local3 < this.lData.freeEngineers) {
if (this.lData.freeTrucks < this.bldgArray.length) {
this.makeUnitAt(this.bldgArray[_local3].xTile, this.bldgArray[_local3].yTile, "Engineer", false);
} else {
this.makeUnitAt(10 + _local3, 10 + _local3, "Engineer", false);
}
_local3++;
}
};
_local2.startDayTime = function () {
var _local2 = this.lData.getStartDayTime();
if (_local2 == K.DAY) {
this.setDayImmediately();
} else if (_local2 == K.NIGHT) {
this.setNightImmediately();
}
};
_local2.makeNoMansLand = function (i, dir) {
var _local2 = 0;
switch (i) {
case 0 :
if (dir == K.HORIZONTAL) {
i = 0;
while (i <= (K.MAX_X_TILE / 2)) {
this.drawTerrainTile(i * 2, -1.5, K.SCORCHED, K.HORIZONTAL);
this.lData.setProp(_local2, 0, K.SCORCHED);
this.lData.setProp(_local2 + 1, 0, K.SCORCHED);
_local2 = _local2 + 2;
i++;
}
} else if (dir == K.VERTICAL) {
i = -1;
while (i < (K.MAX_Y_TILE / 2)) {
this.drawTerrainTile(-1, i * 2, K.SCORCHED, K.VERTICAL);
this.lData.setProp(0, _local2, K.SCORCHED);
this.lData.setProp(0, _local2 + 1, K.SCORCHED);
_local2 = _local2 + 2;
i++;
}
}
break;
case 1 :
if (dir == K.HORIZONTAL) {
i = 0;
while (i <= (K.MAX_X_TILE / 2)) {
this.drawTerrainTile(i * 2, K.MAX_Y_TILE - 0.5, K.SCORCHED, K.HORIZONTAL);
this.lData.setProp(_local2, K.MAX_Y_TILE, K.SCORCHED);
this.lData.setProp(_local2 + 1, K.MAX_Y_TILE, K.SCORCHED);
_local2 = _local2 + 2;
i++;
}
} else {
if (dir != K.VERTICAL) {
break;
}
i = -1;
for(;;){
if (i >= (K.MAX_Y_TILE / 2)) {
break;
}
this.drawTerrainTile(K.MAX_X_TILE, i * 2, K.SCORCHED, K.VERTICAL);
this.lData.setProp(K.MAX_X_TILE, _local2, K.SCORCHED);
this.lData.setProp(K.MAX_X_TILE, _local2 + 1, K.SCORCHED);
_local2 = _local2 + 2;
i++;
};
}
}
};
_local2.onMapDrawn = function () {
this.attachMovie("mc_buildIcon", "buildIcon", this.getNextHighestDepth());
this.buildIcon.setMaster(this);
this.theInterface.swapDepths(this.buildIcon);
this.attachMovie("mc_arrow", "cursor", this.getNextHighestDepth());
this.cursor.setMaster(this);
var _local2 = new flash.filters.DropShadowFilter();
_local2.angle = 135;
_local2.strength = 0.5;
_local2.blurX = 5;
_local2.blurY = 5;
_local2.distance = 2;
var _local3 = this.cursor.filters;
_local3.push(_local2);
this.cursor.filters = _local3;
};
_local2.showError = function (str) {
this.playSound(1, "alert.wav", 1);
this.showMessage(str);
};
_local2.doMessageAlert = function (str, thing) {
if (str == "eDefecit") {
if (this.energyDefecits) {
this.theAlert = str;
this.alertNextFrame = true;
}
} else if (str == "fDefecit") {
if (this.foodDefecits) {
this.theAlert = str;
this.alertNextFrame = true;
}
} else if (str == "efDefecit") {
if (this.foodDefecits && (this.energyDefecits)) {
this.theAlert = str;
this.alertNextFrame = true;
}
} else if (str == "gWarning") {
if (this.gWarnCounter != 0) {
this.gWarnCounter--;
} else if (this.gWarnCounter == 0) {
this.theAlert = str;
this.alertNextFrame = true;
this.gWarnCounter = 60;
}
} else if (str == "nWastePickupAlert") {
if (this.nWarnCounter != 0) {
this.nWarnCounter--;
} else if (this.nWarnCounter == 0) {
this.theAlert = str;
this.alertNextFrame = true;
this.nWarnCounter = 60;
}
} else if (str == "noWasteDump") {
if (this.nDumpWarnCounter != 0) {
this.nDumpWarnCounter--;
} else if (this.nWarnCounter == 0) {
this.theAlert = str;
this.alertNextFrame = true;
this.nDumpWarnCounter = 60;
}
} else if (str == "noLandfill") {
if (this.landfillWarnCounter != 0) {
this.landfillWarnCounter--;
} else if (this.landfillWarnCounter == 0) {
this.theAlert = str;
this.alertNextFrame = true;
this.landfillWarnCounter = 60;
}
} else if (str == "gPollute") {
if (this.gpWarnCounter != 0) {
this.gpWarnCounter--;
} else if (this.gpWarnCounter == 0) {
this.theAlert = str;
this.alertNextFrame = true;
this.gpWarnCounter = 60;
}
} else {
this.theAlert = str;
this.alertNextFrame = true;
}
this.alertTarget = thing;
};
_local2.messageAlert = function (str) {
this.lastAlert = str;
if (str == "starvation") {
this.showMessage("People are starving! Build farms!");
this.playSound(1, "alert.wav", 1);
this.theInterface.showGlowyFarm();
} else if (str == "eDefecit") {
if (this.energyDefecits) {
this.showMessage("Energy Defecit!");
this.playSound(1, "alert.wav", 1);
this.theInterface.showGlowyEnergy();
this.theInterface.showGlowyPowerPlant();
}
} else if (str == "fDefecit") {
if (this.foodDefecits) {
this.showMessage("Food Defecit!");
this.playSound(1, "alert.wav", 1);
this.theInterface.showGlowyFarm();
this.theInterface.showGlowyFood();
}
} else if (str == "efDefecit") {
if (this.foodDefecits && (this.energyDefecits)) {
this.showMessage("Food AND Energy Defecit!");
this.playSound(1, "alert.wav", 1);
this.theInterface.showGlowyEnergy();
this.theInterface.showGlowyFood();
this.theInterface.showGlowyFarm();
this.theInterface.showGlowyPowerPlant();
}
} else if (str == "gPollute") {
this.showMessage("Garbage is polluting! Build engineers!");
this.playSound(1, "alert.wav", 1);
this.alertZoom();
this.makeBuildingGlow("factory");
} else if (str == "gWarning") {
this.showMessage("Garbage levels critical! Build garbage trucks!");
this.playSound(1, "alert.wav", 1);
this.alertZoom();
this.makeBuildingGlow("factory");
} else if (str == "mPickupAlert") {
this.showMessage("Metal is piling up! Make some engineers to get it!");
this.playSound(1, "alert.wav", 1);
this.alertZoom();
this.theInterface.showGlowyFactory();
} else if (str == "nWastePickupAlert") {
this.showMessage("Nuclear waste levels critical! Make some engineers to get it!");
this.playSound(1, "alert.wav", 1);
this.alertZoom();
this.makeBuildingGlow("factory");
} else if (str == "noWasteDump") {
this.showMessage("Nowhere to take Nuclear Waste! Build a N. Waste Dump!");
this.playSound(1, "alert.wav", 1);
this.alertZoom();
this.makeBuildingGlow("factory");
} else if (str == "noLandfill") {
if ((this.landfillAlertReady == true) && (this.landfillAlertReady != undefined)) {
this.landfillAlertReady = false;
this.showMessage("Nowhere to take garbage! Build a landfill!");
this.playSound(1, "alert.wav", 1);
this.theInterface.showGlowyLandFill();
}
}
};
_local2.globalRepair = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].hp < 100) {
this.bldgArray[_local2].repairMe();
}
_local2++;
}
};
_local2.repairSelected = function () {
this.selectedThing.repairMe();
};
_local2.makeBuildingGlow = function (b) {
b = b.toLowerCase();
var _local4 = false;
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (b == this.bldgArray[_local2].myMenu.toLowerCase()) {
this.bldgArray[_local2].makeGlow();
_local4 = true;
}
_local2++;
}
if (!_local4) {
if (b == "factory") {
this.theInterface.showGlowyFactory();
}
}
};
_local2.alertZoom = function () {
if (this.alertTarget != undefined) {
var _local3 = this.drawLayer.getNextHighestDepth();
var _local2 = this.drawLayer.attachMovie("mc_zoomCircle", "theZoomer_" + _local3, _local3);
if (((this.alertTarget.myIndex == K.WASTE) || (this.alertTarget.isResource == true)) || (this.alertTarget.typeOfThing == K.UNIT)) {
_local2._x = this.alertTarget._x + (this.alertTarget._width / 2);
_local2._y = this.alertTarget._y - (this.alertTarget._height / 2);
} else {
_local2._x = this.alertTarget._x + (this.alertTarget._width / 2);
_local2._y = this.alertTarget._y;
}
this.alertTarget = undefined;
}
};
_local2.showObjectiveMessage = function (str) {
this.playSound(1, "alert.wav", 1);
this.showMessage("OBJECTIVE >> " + str);
};
_local2.showMessage = function (str) {
this.theInterface.showMessage(str);
};
_local2.unitButton = function (str) {
if (str == "cleanup") {
}
};
_local2.actionButton = function (str) {
if (str == "repair") {
this.theInterface.demolishOff();
if (this.actionMode == K.REPAIR) {
this.theInterface.repairOff();
this.defaultAction();
} else {
this.actionMode = K.REPAIR;
this.theInterface.repairOn();
this.showCursor(str);
}
} else if (str == "demolish") {
this.theInterface.repairOff();
if (this.actionMode == K.DEMOLISH) {
this.theInterface.demolishOff();
this.defaultAction();
} else {
this.actionMode = K.DEMOLISH;
this.theInterface.demolishOn();
this.showCursor(str);
}
}
};
_local2.defaultAction = function () {
if (this.actionMode == K.DEMOLISH) {
this.theInterface.demolishOff();
} else if (this.actionMode == K.REPAIR) {
this.theInterface.repairOff();
}
this.actionMode = K.CLICK;
this.normalCursor();
};
_local2.moveMode = function () {
this.buildCursor = false;
this.actionMode = K.MOVE;
};
_local2.doBuildCursor = function (str) {
this.buildMode(str);
this.showCursor("build");
};
_local2.buildMode = function (str) {
this.buildCursor = true;
this.actionMode = K.BUILD;
this.buildIcon.activate(str);
};
_local2.unBuildMode = function () {
this.buildCursor = false;
this.actionMode = K.CLICK;
this.theTerrain.unBuildMode();
this.buildIcon.deactivate();
};
_local2.onPressTerrain = function () {
this.dragBoxCoords = [this.cursor._x, this.cursor._y];
this.dragBoxOn = true;
};
_local2.bruteForceClick = function (notThis) {
var _local5 = this.getBuildingLocX(this._xmouse);
var _local4 = this.getBuildingLocY(this._ymouse);
var _local3 = false;
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if ((this.bldgArray[_local2].xTile == _local5) && (this.bldgArray[_local2].yTile == _local4)) {
if (this.bldgArray[_local2] != notThis) {
this.bldgArray[_local2].onRelease();
_local3 = true;
}
}
_local2++;
}
if (!_local3) {
this.onClickTerrain();
}
};
_local2.onClickInterfaceRegion = function () {
this.onClickTerrain();
this.unClickEverything();
};
_local2.onClickTerrain = function () {
this.dragBoxOn = false;
this.eraseDragBox();
var _local2 = Math.abs(this.dragBoxCoords[0] - this.cursor._x);
var _local3 = Math.abs(this.dragBoxCoords[1] - this.cursor._y);
if ((_local2 < K.TILE_SIZE) || (_local3 < K.TILE_SIZE)) {
this.doClickThing();
} else {
this.doDragThing();
}
};
_local2.onClickTerrainOutside = function () {
if (this.dragBoxOn) {
this.onClickTerrain();
}
};
_local2.onClickInterface = function () {
};
_local2.doDragThing = function () {
this.unClickEverything();
var _local5 = false;
var _local3 = 0;
var _local4 = false;
var _local2 = 0;
while (_local2 < this.uArray.length) {
if (((this.uArray[_local2]._x + (this.uArray[_local2]._width / 2)) >= this.dragBoxBound[0]) && ((this.uArray[_local2]._x - (this.uArray[_local2]._width / 2)) <= this.dragBoxBound[2])) {
if (_local3 < 9) {
if (((this.uArray[_local2]._y + (this.uArray[_local2]._height / 2)) >= this.dragBoxBound[1]) && ((this.uArray[_local2]._y - (this.uArray[_local2]._width / 2)) <= this.dragBoxBound[3])) {
if (this.uArray[_local2].myIndex != K.GARBAGETRUCK) {
if (_local4 == false) {
this.startMultiSelect();
_local4 = true;
}
this.uArray[_local2].multiSelectMe(_local3);
_local3++;
_local5 = true;
}
}
}
}
_local2++;
}
if (_local5) {
this.onMultiSelect();
}
};
_local2.startMultiSelect = function () {
this.selectedThings = new Array();
};
_local2.onMultiSelect = function () {
this.multiSelect = true;
this.playSound(1, this.selectedThings[0].selectSound, 1);
};
_local2.onJuicyButtonClick = function (isDown) {
this.stickyClicky = isDown;
};
_local2.tryBuildBuilding = function (str, tileX, tileY) {
if ((this.checkGarbageClear(tileX, tileY) && (this.checkBuildingClear(tileX, tileY, str))) || (str == "recyclingCenter")) {
var _local2 = this.checkPurchase(str);
if (_local2 == 1) {
this.buildBuilding(tileX, tileY, str, false, undefined, false);
} else if (_local2 == -1) {
this.errorBuilding(0, 1, 0);
} else if (_local2 == -2) {
this.errorBuilding(0, 0, 1);
} else if (_local2 == -3) {
this.errorBuilding(0, 1, 1);
} else {
this.errorBuilding(0, 0, 0);
}
} else {
this.errorBuilding(1, 0, 0);
}
};
_local2.doClickThing = function () {
switch (this.actionMode) {
case K.REPAIR :
this.unClickEverything();
this.defaultAction();
this.playSound(0, "click2.wav", 1);
break;
case K.DEMOLISH :
this.unClickEverything();
this.defaultAction();
this.playSound(0, "click2.wav", 1);
break;
case K.BUILD :
this.playSound(0, "click2.wav", 1);
break;
case K.MOVE :
if (!this.multiSelect) {
this.moveUnit(this.cursor._x, this.cursor._y);
this.playSound(1, this.selectedThing.affirmSound, 1);
} else {
this.playSound(1, this.selectedThings[0].affirmSound, 1);
this.moveUnits(this.cursor._x, this.cursor._y);
}
break;
default :
this.unClickEverything();
this.playSound(0, "click2.wav", 1);
}
if (this.buildCursor) {
var _local3 = this.checkTerrain(this.buildIcon.tileX, this.buildIcon.tileY, this.buildIcon.myString);
if (_local3 == 1) {
var _local2 = this.checkPurchase(this.buildIcon.myString);
if (_local2 == 1) {
this.buildBuilding(this.buildIcon.tileX, this.buildIcon.tileY, this.buildIcon.myString, false, undefined, false);
} else if (_local2 == -1) {
this.errorBuilding(0, 1, 0);
} else if (_local2 == -2) {
this.errorBuilding(0, 0, 1);
} else if (_local2 == -3) {
this.errorBuilding(0, 1, 1);
} else {
this.errorBuilding(0, 0, 0);
}
} else if (_local3 == 2) {
var _local2 = this.checkPurchase(this.buildIcon.myString);
if (_local2 == 1) {
this.buildBuilding(this.buildIcon.tileX, this.buildIcon.tileY, this.buildIcon.myString, true, undefined, false);
} else if (_local2 == -1) {
this.errorBuilding(0, 1, 0);
} else if (_local2 == -2) {
this.errorBuilding(0, 0, 1);
} else if (_local2 == -3) {
this.errorBuilding(0, 1, 1);
} else {
this.errorBuilding(0, 0, 0);
}
} else if (_local3 == 3) {
var _local2 = this.checkPurchase(this.buildIcon.myString);
if (_local2 == 1) {
this.buildBuilding(this.buildIcon.tileX, this.buildIcon.tileY, this.buildIcon.myString, false, undefined, true);
} else if (_local2 == -1) {
this.errorBuilding(0, 1, 0);
} else if (_local2 == -2) {
this.errorBuilding(0, 0, 1);
} else if (_local2 == -3) {
this.errorBuilding(0, 1, 1);
} else {
this.errorBuilding(0, 0, 0);
}
} else {
this.errorBuilding(1, 0, 0);
}
}
};
_local2.multiSelectUnit = function (s, n, what) {
var _local4 = false;
var _local2 = 0;
while (_local2 < this.selectedThings.length) {
if (this.selectedThings[_local2] == what) {
_local4 = true;
}
_local2++;
}
if (!_local4) {
this.selectedThings.push(what);
}
var _local3 = new Object();
_local2 = 0;
while (_local2 < 9) {
if (this.selectedThings[_local2] != undefined) {
_local3["u" + _local2] = this.selectedThings[_local2].myMenu;
} else {
_local3["u" + _local2] = "nothing";
}
_local2++;
}
this.theInterface.showUnitMenu("imultiUnits", n, _local3);
this.selectedThing = undefined;
this.enemyTargetted = false;
};
_local2.selectEnemy = function (s, n, what) {
this.theInterface.showEnemyMenu("i" + s, n);
this.selectedThing = what;
this.playSound(1, this.selectedThing.selectSound, 1);
this.enemyTargetted = true;
};
_local2.selectUnit = function (s, n, what, playSound) {
this.theInterface.showUnitMenu("i" + s, n, what);
this.selectedThing = what;
if (playSound) {
playSound(1, this.selectedThing.selectSound, 1);
}
};
_local2.moveUnit = function (xx, yy) {
var _local4 = this.getUnitLocX(xx);
var _local3 = this.getUnitLocY(yy);
var _local2 = this.drawLayer.attachMovie("mc_ripple", "theRipple", this.drawLayer.getNextHighestDepth());
_local2._x = xx;
_local2._y = yy;
this.selectedThing.moveToLoc(_local4, _local3, xx, yy);
if (!this.stickyClicky) {
this.unClickEverything();
}
};
_local2.moveUnits = function (xx, yy) {
var _local6 = this.getUnitLocX(xx);
var _local5 = this.getUnitLocY(yy);
if (_local6 < 2) {
_local6 = 2;
} else if (_local6 > (K.MAX_X_UNIT_TILE - 2)) {
_local6 = K.MAX_X_UNIT_TILE - 2;
}
if (_local5 < 2) {
_local5 = 2;
} else if (_local5 > (K.MAX_Y_UNIT_TILE - 2)) {
_local5 = K.MAX_Y_UNIT_TILE - 2;
}
var _local7 = this.drawLayer.attachMovie("mc_ripple", "theRipple", this.drawLayer.getNextHighestDepth());
_local7._x = xx;
_local7._y = yy;
var _local4 = 0;
while (_local4 < this.selectedThings.length) {
var _local3 = _local6;
var _local2 = _local5;
switch (_local4) {
case 0 :
_local3 = _local3 - 2;
_local2 = _local2 - 2;
break;
case 1 :
_local2 = _local2 - 2;
break;
case 2 :
_local2 = _local2 - 2;
_local3 = _local3 + 2;
break;
case 3 :
_local3 = _local3 - 2;
break;
case 4 :
break;
case 5 :
_local3 = _local3 + 2;
break;
case 6 :
_local2 = _local2 + 2;
_local3 = _local3 - 2;
break;
case 7 :
_local2 = _local2 + 2;
break;
case 8 :
_local2 = _local2 + 2;
_local3 = _local3 + 2;
}
this.selectedThings[_local4].moveToLoc(_local3, _local2);
_local4++;
}
if (!this.stickyClicky) {
this.unClickEverything();
}
};
_local2.selectBuilding = function (s, n, what) {
this.theInterface.showBuildingMenu("i" + s, n, what);
this.selectedThing = what;
};
_local2.selectGarbage = function (s, n, what, stuff) {
this.theInterface.showBuildingMenu("i" + s, n, stuff);
this.selectedThing = what;
};
_local2.doUpgrade = function (target, upgrade, type, cost) {
var _local2 = this.checkEnoughRE(cost[0], cost[1]);
switch (_local2) {
case 1 :
this.upgradeSomething(target, upgrade, type);
if (target.toLowerCase == "recyclingCenter") {
this.checkPowerUse("RecyclingCenter");
}
break;
case -1 :
this.errorResearch(0, 1, 0);
break;
case -2 :
this.errorResearch(0, 0, 1);
break;
case -3 :
this.errorResearch(0, 1, 1);
}
};
_local2.upgradeSomething = function (target, upgrade, type) {
var _local6 = K.upgradeLevel(target, upgrade);
var _local7 = K.countUpgrades();
this.cpn_kongregateSubmit("upgradesAchieved", _local7);
var _local3;
if (type == K.BUILDING) {
_local3 = this.bldgArray;
} else if (type == K.UNIT) {
_local3 = this.uArray;
}
var _local2 = 0;
while (_local2 < _local3.length) {
if ((_local3[_local2].myMenu.toLowerCase() == target) || (target.toLowerCase() == "fuel")) {
_local3[_local2].setUpgradeLevel(upgrade, _local6);
} else if (_local3[_local2].myMenu.toLowerCase() == ("super" + target)) {
_local3[_local2].setUpgradeLevel(upgrade, _local6);
}
_local2++;
}
if (target == "fuel") {
this.theInterface.showFuelLevels();
} else {
this.theInterface.showLevels(target);
}
};
_local2.checkEnoughRE = function (rCost, eCost) {
if (rCost <= this.r_research) {
if (eCost <= this.r_energy) {
this.drainResearch(rCost);
this.drainEnergy(eCost);
return(1);
}
return(-2);
}
if (eCost < this.r_energy) {
return(-3);
}
return(-1);
};
_local2.checkEnoughEM = function (eCost, mCost) {
if ((this.r_energy - eCost) >= 0) {
if ((this.r_metal - mCost) >= 0) {
this.drainEnergy(eCost);
this.drainMetal(mCost);
return(1);
}
return(-2);
}
if ((this.r_metal - mCost) < 0) {
return(-3);
}
return(-1);
};
_local2.checkPurchase = function (s) {
var _local2 = K.getCost(s)[0];
var _local3 = K.getCost(s)[1];
return(this.checkEnoughEM(_local2, _local3, 0));
};
_local2.getBuildingDepth = function (xx, yy) {
var _local1 = (yy * (K.MAX_X_TILE + 1)) + xx;
return(_local1);
};
_local2.getResourceDepth = function (xx, yy) {
return(this.resourceLayer.getNextHighestDepth());
};
_local2.getGarbageDepth = function (xx, yy) {
return(this.resourceLayer.getNextHighestDepth());
};
_local2.polluteTile = function (xx, yy) {
this.producePollutionSpill(1);
var _local3 = false;
var _local4;
var _local6 = xx - 0.5;
var _local5 = yy - 1;
var _local2 = 0;
while (_local2 < this.lArray.length) {
if ((this.lArray[_local2].xLoc == _local6) && (this.lArray[_local2].yLoc == _local5)) {
_local3 = true;
_local4 = this.lArray[_local2];
}
_local2++;
}
if (!_local3) {
this.drawTerrainTileOffset(xx, yy, K.POLLUTED);
} else {
_local4.setHp(100);
}
};
_local2.drawTerrainTileOffset = function (xx, yy, type, dir) {
xx = xx - 0.5;
yy = yy - 1;
this.drawTerrainTile(xx, yy, type, dir);
};
_local2.drawTerrainTile = function (xx, yy, type, dir) {
var _local4 = this.underLayer.getNextHighestDepth();
var _local2 = this.underLayer.attachMovie("mc_terrainSquare", "terr_" + _local4, _local4);
_local2._x = this.getBuildingX(xx);
_local2._y = this.getBuildingY(yy);
var _local3;
switch (type) {
case K.DIRT :
_local3 = "dirt";
break;
case K.POLLUTED :
_local3 = "polluted";
break;
case K.SCORCHED :
_local3 = "scorch";
}
switch (dir) {
case K.HORIZONTAL :
_local3 = _local3 + "_h";
break;
case K.VERTICAL :
_local3 = _local3 + "_v";
break;
}
_local2.gotoAndStop(_local3);
if (_local3 == "polluted") {
_local2.amSpill = true;
}
_local2.setHp(100);
_local2.setIndex(type);
_local2.setLoc(xx, yy);
_local2.setMaster(this);
this.lArray.push(_local2);
};
_local2.deleteTerrainTile = function (t) {
var _local2 = 0;
while (_local2 < this.lArray.length) {
if (this.lArray[_local2] == t) {
this.lArray[_local2].splice(_local2, 1);
}
_local2++;
}
t.removeMovieClip();
};
_local2.checkPowerUse = function (thing) {
if (thing == "CoalPlant") {
this.usePower(1);
} else if (thing == "GasPlant") {
this.usePower(2);
} else if (thing == "GeoPlant") {
this.usePower(3);
} else if (thing == "NuclearPlant") {
this.usePower(4);
} else if (thing == "SolarPlant") {
this.usePower(5);
} else if (thing == "WindPlant") {
this.usePower(6);
} else if (thing == "RecyclingCenter") {
if (K.level_recyclingcenter >= 1) {
this.usePower(7);
}
this.master.statNugget.logRecyclingLevel(K.level_recyclingcenter, this.difficulty);
}
};
_local2.buildBuilding = function (xx, yy, thing, buildSuper, dontSelectIt, buildAlt) {
this.checkPowerUse(thing);
var _local3 = this.getBuildingDepth(xx, yy);
var _local2;
if (buildSuper) {
_local2 = this.groundLayer.attachMovie("mc_building_super_" + thing, "bldg_" + _local3, _local3);
} else if (buildAlt) {
_local2 = this.groundLayer.attachMovie(("mc_building_" + thing) + "_alt", "bldg_" + _local3, _local3);
} else {
_local2 = this.groundLayer.attachMovie("mc_building_" + thing, "bldg_" + _local3, _local3);
}
if (_local2 != undefined) {
_local2._x = this.getBuildingX(xx);
_local2._y = this.getBuildingY(yy);
this.cursor.swapDepths(_local2);
this.playSound(0, "thump.wav", 1);
_local2.setMaster(this);
_local2.setLoc(xx, yy);
this.bldgArray.push(_local2);
if (_local2.myIndex == K.FACTORY) {
this.checkFactoryFlag(_local2);
}
if (!Key.isDown(32)) {
this.normalCursor();
this.theInterface.goBackButton();
this.unClickEverything();
} else {
this.buildMode();
}
}
if (this.dayTime == K.NIGHT) {
if (_local2.doesSleep) {
_local2.showSleepAlert();
}
}
this.recalculateBuildingAttackLocs();
this.checkTutorialBeacon(_local2);
this.calculateNets();
};
_local2.findReservoir = function (xx, yy) {
return(this.lData.findReservoir(xx, yy));
};
_local2.checkTutorialBeacon = function (bldg) {
};
_local2.recalculateBuildingAttackLocs = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
this.bldgArray[_local2].calculateAttackVacancy();
_local2++;
}
};
_local2.deleteBuilding = function (b) {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2] == b) {
this.bldgArray.splice(_local2, 1);
}
_local2++;
}
this.recalculateBuildingAttackLocs();
};
_local2.normalCursor = function () {
this.showCursor("cursor");
this.unBuildMode();
};
_local2.checkFactoryFlag = function (b) {
var _local3 = true;
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].myIndex == K.FACTORY) {
if (this.bldgArray[_local2].deployHere == true) {
_local3 = false;
}
}
_local2++;
}
if (_local3) {
b.setMeUp = function () {
this.deployTheFlag();
};
}
};
_local2.undeployFactoryFlags = function () {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].myIndex == K.FACTORY) {
if (this.bldgArray[_local2].deployHere == true) {
this.bldgArray[_local2].undeployTheFlag();
}
}
_local2++;
}
};
_local2.deleteGarbage = function (g) {
var _local2 = 0;
while (_local2 < this.gArray.length) {
if (this.gArray[_local2] == g) {
this.gArray.splice(_local2, 1);
this.unproduceGarbage(g.amount);
g.deleteMe();
break;
}
_local2++;
}
};
_local2.deleteResourceToken = function (r) {
var _local2 = 0;
while (_local2 < this.rArray.length) {
if (this.rArray[_local2] == r) {
this.rArray.splice(_local2, 1);
}
_local2++;
}
if (r.myType == "nwaste") {
this.unproduceNWaste();
}
r.deleteMe();
};
_local2.checkResourceThere = function (xT, yT) {
var _local2 = 0;
while (_local2 < this.rArray.length) {
if ((this.rArray[_local2].xTile == xT) && (this.rArray[_local2].yTile == yT)) {
return(this.rArray[_local2]);
}
_local2++;
}
return(undefined);
};
_local2.checkGarbageThere = function (xT, yT) {
var _local2 = 0;
while (_local2 < this.gArray.length) {
if ((this.gArray[_local2].xTile == xT) && (this.gArray[_local2].yTile == yT)) {
return(this.gArray[_local2]);
}
_local2++;
}
return(undefined);
};
_local2.makeResourceUnit = function (xT, yT, amt, theKind) {
var _local3 = this.checkResourceThere(xT, yT);
var _local4 = false;
if (theKind == "nwaste") {
this.produceNWaste(amt);
}
if (_local3 != undefined) {
if (_local3.myMenu.toLowerCase() == theKind.toLowerCase()) {
_local3.addAmount(amt);
} else {
_local4 = true;
}
} else {
_local4 = true;
}
if (_local4 == true) {
var _local2;
var _local7 = this.getResourceDepth(xT, yT);
_local2 = this.resourceLayer.attachMovie("mc_" + theKind, "resource_" + _local7, _local7);
_local2.setMaster(this);
if (_local2 != undefined) {
_local2._x = this.getUnitX(xT);
_local2._y = this.getUnitY(yT);
_local2.setLoc(xT, yT);
_local2.setAmount(amt);
this.rArray.push(_local2);
}
this.cursor.swapDepths(_local2);
return(_local2);
}
return(_local3);
};
_local2.makeEnemyGarbageUnit2 = function (xT, yT, organic, metal, reuse, junk, isRubble) {
var _local2 = ((organic + metal) + reuse) + junk;
this.zombiesCorpseGarbage_Day = this.zombiesCorpseGarbage_Day + _local2;
this.zombiesCorpseGarbage_Level = this.zombiesCorpseGarbage_Level + _local2;
this.makeGarbageUnit2(xT, yT, organic, metal, reuse, junk, isRubble);
};
_local2.makeEnemyGarbageUnit = function (xT, yT, amt, isRubble) {
this.zombiesCorpseGarbage_Day = this.zombiesCorpseGarbage_Day + amt;
this.zombiesCorpseGarbage_Level = this.zombiesCorpseGarbage_Level + amt;
this.makeGarbageUnit(xT, yT, amt, isRubble);
};
_local2.makeGarbageUnit2 = function (xT, yT, amtO, amtM, amtR, amtJ, isRubble) {
this.produceGarbage(((amtO + amtM) + amtR) + amtJ);
var _local4 = this.checkGarbageThere(xT, yT);
var _local3 = false;
if (_local4 != undefined) {
if (_local4.isRubble == isRubble) {
_local4.addGarbageByKind(amtO, amtM, amtR, amtJ);
} else {
_local3 = true;
}
} else {
_local3 = true;
}
if (_local3 == true) {
var _local2;
var _local7 = this.getGarbageDepth(xT, yT);
_local2 = this.resourceLayer.attachMovie("mc_garbage", "garbage_" + _local7, _local7);
_local2.setMaster(this);
if (_local2 != undefined) {
_local2._x = this.getUnitX(xT);
_local2._y = this.getUnitY(yT);
_local2.setLoc(xT, yT);
if (isRubble) {
_local2.setRubble();
}
_local2.addGarbageByKind(amtO, amtM, amtR, amtJ);
this.gArray.push(_local2);
}
this.cursor.swapDepths(_local2);
return(_local2);
}
};
_local2.makeGarbageUnit = function (xT, yT, amt, isRubble) {
this.produceGarbage(amt);
var _local4 = this.checkGarbageThere(xT, yT);
var _local3 = false;
if (_local4 != undefined) {
if (_local4.isRubble == isRubble) {
_local4.addGarbage(amt);
} else {
_local3 = true;
}
} else {
_local3 = true;
}
if (_local3 == true) {
var _local2;
var _local7 = this.getGarbageDepth(xT, yT);
_local2 = this.resourceLayer.attachMovie("mc_garbage", "garbage_" + _local7, _local7);
_local2.setMaster(this);
if (_local2 != undefined) {
_local2._x = this.getUnitX(xT);
_local2._y = this.getUnitY(yT);
_local2.setLoc(xT, yT);
_local2.setAmount(amt);
if (isRubble) {
_local2.setRubble();
}
this.gArray.push(_local2);
}
this.cursor.swapDepths(_local2);
return(_local2);
}
};
_local2.makeNWaste = function (x1, y1, x2, y2, amt) {
var _local2;
var _local5 = y1;
while (_local5 <= y2) {
var _local3 = x1;
while (_local3 <= x2) {
var _local7 = this.getGarbageDepth(_local3, _local5);
this.produceNWaste(amt);
_local2 = this.resourceLayer.attachMovie("mc_nwaste", "nwaste_" + _local7, _local7);
_local2.setMaster(this);
if (_local2 != undefined) {
_local2._x = this.getBuildingX(x1) + ((_local3 - x1) * K.TILE_SIZE);
_local2._y = this.getBuildingY(y1) + ((_local5 - y1) * K.TILE_SIZE);
_local2.setLoc((x1 * 2) + (_local3 - x1), (y1 * 2) + (_local5 - y1));
_local2.setAmount(amt);
this.rArray.push(_local2);
}
_local3++;
}
_local5++;
}
this.cursor.swapDepths(_local2);
};
_local2.makeGarbage2 = function (x1, y1, x2, y2, amtO, amtM, amtR, amtJ, isRubble) {
var _local2;
var _local5 = y1;
while (_local5 <= y2) {
var _local3 = x1;
while (_local3 <= x2) {
var _local7 = this.getGarbageDepth(_local3, _local5);
this.produceGarbage(((amtO + amtM) + amtR) + amtJ);
_local2 = this.resourceLayer.attachMovie("mc_garbage", "garbage_" + _local7, _local7);
_local2.setMaster(this);
if (_local2 != undefined) {
_local2._x = this.getBuildingX(x1) + ((_local3 - x1) * K.TILE_SIZE);
_local2._y = this.getBuildingY(y1) + ((_local5 - y1) * K.TILE_SIZE);
_local2.setLoc((x1 * 2) + (_local3 - x1), (y1 * 2) + (_local5 - y1));
_local2.addGarbageByKind(amtO, amtM, amtR, amtJ);
if (isRubble) {
_local2.setRubble();
}
this.gArray.push(_local2);
}
_local3++;
}
_local5++;
}
this.cursor.swapDepths(_local2);
};
_local2.makeGarbage = function (x1, y1, x2, y2, amt, isRubble) {
var _local2;
var _local5 = y1;
while (_local5 <= y2) {
var _local3 = x1;
while (_local3 <= x2) {
var _local7 = this.getGarbageDepth(_local3, _local5);
this.produceGarbage(amt);
_local2 = this.resourceLayer.attachMovie("mc_garbage", "garbage_" + _local7, _local7);
_local2.setMaster(this);
if (_local2 != undefined) {
_local2._x = this.getBuildingX(x1) + ((_local3 - x1) * K.TILE_SIZE);
_local2._y = this.getBuildingY(y1) + ((_local5 - y1) * K.TILE_SIZE);
_local2.setLoc((x1 * 2) + (_local3 - x1), (y1 * 2) + (_local5 - y1));
_local2.setAmount(amt);
if (isRubble) {
_local2.setRubble();
}
this.gArray.push(_local2);
}
_local3++;
}
_local5++;
}
this.cursor.swapDepths(_local2);
};
_local2.makeZombieSmog = function (xx, yy, amt) {
this.zombiesCorpseSmog_Day = this.zombiesCorpseSmog_Day + amt;
this.zombiesCorpseSmog_Cycle = this.zombiesCorpseSmog_Cycle + amt;
this.zombiesCorpseSmog_Level = this.zombiesCorpseSmog_Level + amt;
this.zombiesFried_Day++;
this.zombiesFried_Cycle++;
this.zombiesFried_Level++;
this.makeSmog(xx, yy, amt);
};
_local2.makeSmog = function (xx, yy, amt) {
if (this.testUnd(amt, "makeSmog")) {
this.produceSmog(amt);
var _local3 = this.smogLayer.getNextHighestDepth();
var _local2 = this.smogLayer.attachMovie("mc_smog", "smog_" + _local3, _local3);
if (_local2 != undefined) {
_local2._x = xx;
_local2._y = yy;
_local2.setAmount(amt);
_local2.setMaster(this, this.sArray.length - 1);
}
this.cursor.swapDepths(_local2);
}
};
_local2.onSmogLeave = function (s) {
this.addSmog(s.amount);
s.removeMovieClip();
};
_local2.getUnitLocX = function (xx) {
return(Math.floor(xx / K.TILE_SIZE));
};
_local2.getUnitLocY = function (yy) {
yy = yy - K.INT_OFF_Y_PX;
return(Math.floor(yy / K.TILE_SIZE));
};
_local2.getBuildingLocX = function (xx) {
return(Math.floor(this.getUnitLocX(xx) / 2));
};
_local2.getBuildingLocY = function (yy) {
return(Math.floor(this.getUnitLocY(yy) / 2));
};
_local2.getUnitX = function (xx) {
return(xx * K.TILE_SIZE);
};
_local2.getUnitY = function (yy) {
return((yy * K.TILE_SIZE) + ((K.TERRAIN_OFFSET_Y * K.TILE_SIZE) * 2));
};
_local2.getBuildingX = function (xx) {
return((xx * K.TILE_SIZE) * 2);
};
_local2.getBuildingY = function (yy) {
return(((yy + K.TERRAIN_OFFSET_Y) * K.TILE_SIZE) * 2);
};
_local2.errorResearch = function (a, b, c) {
this.playSound(1, "alert.wav", 1);
if (a == 1) {
} else if ((b == 1) && (c == 1)) {
this.showError("Need more research points and energy to implement upgrade!");
this.theInterface.r_energy.error();
this.theInterface.r_research.error();
} else if (c == 1) {
this.showError("Need more energy to implement upgrade!");
this.theInterface.r_energy.error();
} else if (b == 1) {
this.showError("Need more research points!");
this.theInterface.r_research.error();
}
};
// unexpected jump
// unexpected jump
_local2.errorBuilding = function (a, b, c) {
this.playSound(1, "alert.wav", 1);
if (a == 1) {
this.showError("Can't build there!");
} else if ((b == 1) && (c == 1)) {
this.showError("We need more energy and metal!");
this.theInterface.r_energy.error();
this.theInterface.r_metal.error();
this.normalCursor();
this.theInterface.goBackButton();
} else if (b == 1) {
this.showError("We need more energy!");
this.theInterface.r_energy.error();
this.normalCursor();
this.theInterface.goBackButton();
} else if (c == 1) {
this.showError("We need more metal!");
this.theInterface.r_metal.error();
this.normalCursor();
this.theInterface.goBackButton();
}
};
_local2.unClickEverything = function () {
this.updateWeather();
this.defaultAction();
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
this.bldgArray[_local2].unClick();
_local2++;
}
_local2 = 0;
while (_local2 < this.gArray.length) {
this.gArray[_local2].unClick();
_local2++;
}
_local2 = 0;
while (_local2 < this.rArray.length) {
this.rArray[_local2].unClick();
_local2++;
}
_local2 = 0;
while (_local2 < this.uArray.length) {
this.uArray[_local2].unClick();
_local2++;
}
_local2 = 0;
while (_local2 < this.eArray.length) {
this.eArray[_local2].unClick();
_local2++;
}
this.selectedThing = undefined;
this.selectedThings = undefined;
this.multiSelect = false;
this.theInterface.unClickBuildings();
this.enemyTargetted = false;
};
_local2.checkTerrain = function (xx, yy, thing) {
if (((xx >= 0) && (yy <= K.MAX_X_TILE)) && ((yy >= 0) && (yy <= K.MAX_Y_TILE))) {
if (this.checkGarbageClear(xx, yy) && (this.checkBuildingClear(xx, yy))) {
if (thing == "Mine") {
switch (this.getProp(xx, yy)) {
case K.STONE :
return(1);
case K.HARD :
return(0);
case K.SCORCHED :
return(0);
}
return(0);
}
if (thing == "CoalMine") {
switch (this.getProp(xx, yy)) {
case K.COALSPOT :
return(1);
case K.SCORCHED :
return(0);
}
return(0);
}
if (thing == "Farm") {
switch (this.getProp(xx, yy)) {
case K.DIRT :
return(1);
case K.GRASS :
return(2);
case K.SCORCHED :
return(0);
}
return(0);
}
if (thing == "WindPlant") {
var _local5 = this.getAltitude(xx, yy);
switch (this.getProp(xx, yy)) {
case K.WATER :
return(0);
case K.OIL :
return(0);
case K.OIL_BIG :
return(0);
case K.GEO_BIG :
return(0);
case K.SCORCHED :
return(0);
}
if (_local5 > 0) {
return(2);
}
return(1);
}
if (thing == "GeoPlant") {
switch (this.getProp(xx, yy)) {
case K.GEO :
return(1);
case K.GEO_BIG :
return(2);
case K.SCORCHED :
return(0);
if (thing == "OilGasWell") {
switch (this.getProp(xx, yy)) {
case K.OIL :
return(1);
case K.OIL_BIG :
return(1);
}
return(0);
}
if (thing == "Landfill") {
var _local6 = this.checkTerrain(xx + 1, yy, "LandfillSide");
if (_local6 == 1) {
switch (this.getProp(xx, yy)) {
case K.OIL :
return(0);
case K.OIL_BIG :
return(0);
case K.GEO_BIG :
return(0);
case K.SCORCHED :
return(0);
case K.WATER :
return(0);
case K.STONE :
return(0);
}
return(1);
}
return(0);
}
if (thing == "LandfillSide") {
switch (this.getProp(xx, yy)) {
case K.OIL :
return(0);
case K.OIL_BIG :
return(0);
case K.GEO_BIG :
return(0);
case K.SCORCHED :
return(0);
case K.WATER :
return(0);
case K.STONE :
return(0);
}
return(1);
}
switch (this.getProp(xx, yy)) {
case K.WATER :
return(0);
case K.STONE :
return(0);
case K.OIL :
return(0);
case K.OIL_BIG :
return(0);
case K.GEO_BIG :
return(0);
case K.SCORCHED :
return(0);
}
return(1);
}
}
if (thing == "OilGasWell") {
switch (this.getProp(xx, yy)) {
case K.OIL :
return(1);
case K.OIL_BIG :
return(1);
}
return(0);
}
if (thing == "Landfill") {
var _local6 = this.checkTerrain(xx + 1, yy, "LandfillSide");
if (_local6 == 1) {
switch (this.getProp(xx, yy)) {
case K.OIL :
return(0);
case K.OIL_BIG :
return(0);
case K.GEO_BIG :
return(0);
case K.SCORCHED :
return(0);
case K.WATER :
return(0);
case K.STONE :
return(0);
}
return(1);
}
return(0);
}
if (thing == "LandfillSide") {
switch (this.getProp(xx, yy)) {
case K.OIL :
return(0);
case K.OIL_BIG :
return(0);
case K.GEO_BIG :
return(0);
case K.SCORCHED :
return(0);
case K.WATER :
return(0);
case K.STONE :
return(0);
}
return(1);
}
switch (this.getProp(xx, yy)) {
case K.WATER :
return(0);
case K.STONE :
return(0);
case K.OIL :
return(0);
case K.OIL_BIG :
return(0);
case K.GEO_BIG :
return(0);
case K.SCORCHED :
return(0);
}
return(1);
}
}
};
_local2.checkBuildingClear = function (xx, yy, thing) {
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if ((Math.floor(this.bldgArray[_local2].xTile) == xx) && (Math.floor(this.bldgArray[_local2].yTile) == yy)) {
return(false);
}
if (this.bldgArray[_local2].myIndex == K.LANDFILL) {
if (thing.toLowerCase() != "recyclingcenter") {
if ((Math.floor(this.bldgArray[_local2].xTile + 1) == xx) && (Math.floor(this.bldgArray[_local2].yTile) == yy)) {
return(false);
}
}
}
_local2++;
}
return(true);
};
_local2.checkGarbageClear = function (xx, yy) {
var _local2 = 0;
while (_local2 < this.gArray.length) {
if ((Math.floor(this.gArray[_local2].xTile / 2) == xx) && (Math.floor(this.gArray[_local2].yTile / 2) == yy)) {
return(false);
}
_local2++;
}
return(true);
};
_local2.checkResourceClear = function (xx, yy) {
var _local2 = 0;
while (_local2 < this.rArray.length) {
if ((Math.floor(this.rArray[_local2].xTile / 2) == xx) && (Math.floor(this.rArray[_local2].yTile / 2) == yy)) {
return(false);
}
_local2++;
}
return(true);
};
_local2.getAltitude = function (xx, yy) {
return(this.lData.getAltitude(xx, yy));
};
_local2.getProp = function (xx, yy) {
return(this.lData.getProp(xx, yy));
};
_local2.getLvlPxWidth = function () {
return(this.lData.getPxWidth());
};
_local2.getLvlPxHeight = function () {
return(this.lData.getPxHeight());
};
_local2.getLvlWidth = function () {
return(this.lData.getWidth());
};
_local2.getLvlHeight = function () {
return(this.lData.getHeight());
};
_local2.getLvlTile = function (xx, yy) {
return(this.lData.getTile(xx, yy));
};
_local2.getLvlProp = function (xx, yy) {
return(this.lData.getProp(xx, yy));
};
_local2.getState = function () {
return(this.state);
};
_local2.getOldState = function () {
return(this.oldState.toNum());
};
_local2.switchState = function (toState) {
switch (this.state) {
case K.MENU_STATE :
if (toState == K.MENU_STATE) {
this.returnToState();
this.unPauseGame();
} else {
this.goToState(toState);
}
break;
case K.GAME_STATE :
this.goToState(toState);
break;
case K.START_STATE :
this.goToState(toState);
break;
case K.PAUSE_STATE :
if (toState == K.PAUSE_STATE) {
this.returnToState();
this.unPauseGame();
} else {
this.goToState(toState);
}
break;
default :
this.goToState(toState);
}
};
_local2.goToState = function (newState) {
if (this.state != undefined) {
this.oldState.push(this.state);
}
if (newState == K.START_STATE) {
newState = K.MENU_STATE;
} else if (newState == K.PAUSE_STATE) {
newState = K.PAUSE_STATE;
this.pauseGame();
this.paused = true;
} else if (newState == K.MENU_STATE) {
newState = K.MENU_STATE;
this.pauseGame();
this.paused = true;
} else {
this.paused = false;
}
this.state = newState;
this.onStateChange();
};
_local2.returnToState = function () {
var _local2 = this.oldState.pop();
if (_local2 != undefined) {
this.state = _local2;
this.onStateChange();
}
};
_local2.onStateChange = function () {
switch (this.state) {
case K.MENU_STATE :
break;
case K.GAME_STATE :
break;
case K.START_STATE :
break;
case K.PAUSE_STATE :
}
};
_local2.cheat = function (code) {
switch (code) {
case 1 :
var _local3 = this.getBuildingLocX(this.cursor._x) * 2;
var _local2 = this.getBuildingLocY(this.cursor._y) * 2;
this.makeGarbageUnit2(_local3, _local2, 25, 10, 15, 50, false);
case 2 :
this.achieveObjective();
break;
case 3 :
this.printStats();
break;
case 4 :
this.showFinalScore();
}
};
_local2.react = function (theKey, wasPushed) {
switch (this.state) {
case K.MENU_STATE :
break;
case K.GAME_STATE :
this.reactToKey(theKey, wasPushed);
break;
case K.START_STATE :
break;
case K.PAUSE_STATE :
}
};
_local2.reactMouse = function (theMouse, wasPushed) {
switch (this.state) {
case K.MENU_STATE :
break;
case K.GAME_STATE :
this.reactToMouse(theMouse, wasPushed);
break;
case K.START_STATE :
break;
case K.PAUSE_STATE :
}
};
_local2.reactToKey = function (theKey, wasPushed) {
if (wasPushed) {
switch (theKey) {
case 27 :
this.theInterface.goBackButton("default");
break;
case 65 :
this.theInterface.doHotKey("a");
break;
case 66 :
this.theInterface.doHotKey("b");
break;
case 67 :
this.theInterface.doHotKey("c");
break;
case 68 :
this.theInterface.doHotKey("d");
break;
case 69 :
this.theInterface.doHotKey("e");
break;
case 70 :
this.theInterface.doHotKey("f");
break;
case 71 :
this.theInterface.doHotKey("g");
break;
case 72 :
this.theInterface.doHotKey("h");
break;
case 73 :
this.theInterface.doHotKey("i");
break;
case 74 :
this.theInterface.doHotKey("j");
break;
case 75 :
this.theInterface.doHotKey("k");
break;
case 76 :
this.theInterface.doHotKey("l");
break;
case 77 :
this.theInterface.doHotKey("m");
break;
case 78 :
this.theInterface.doHotKey("n");
break;
case 79 :
this.theInterface.doHotKey("o");
break;
case 80 :
this.theInterface.doHotKey("p");
break;
case 81 :
this.theInterface.doHotKey("q");
break;
case 82 :
this.theInterface.doHotKey("r");
break;
case 83 :
this.theInterface.doHotKey("s");
break;
case 84 :
this.theInterface.doHotKey("t");
break;
case 85 :
this.theInterface.doHotKey("u");
break;
case 86 :
this.theInterface.doHotKey("v");
break;
case 87 :
this.theInterface.doHotKey("w");
break;
case 88 :
this.theInterface.doHotKey("x");
break;
case 89 :
this.theInterface.doHotKey("y");
break;
case 90 :
this.theInterface.doHotKey("z");
break;
case 48 :
case 49 :
this.theInterface.doHotKey("1");
break;
case 50 :
this.theInterface.doHotKey("2");
break;
case 51 :
this.theInterface.doHotKey("3");
break;
case 52 :
this.theInterface.doHotKey("4");
case 53 :
case 54 :
case 55 :
case 56 :
case 57 :
case 180 :
case 181 :
case 189 :
case 187 :
}
}
};
_local2.hideMap = function () {
this.mapHidden = true;
};
_local2.showMap = function () {
this.mapHidden = false;
};
_local2.reactToMouse = function (theMouse, wasPushed) {
if (this.theInterface.sideRegion.hitTest(this._xmouse, this._ymouse)) {
this.interfaceHasFocus();
} else if (this.theInterface.topRegion.hitTest(this._xmouse, this._ymouse)) {
this.interfaceHasFocus();
} else if (this.theInterface.bottomRegion.hitTest(this._xmouse, this._ymouse)) {
this.interfaceHasFocus();
} else if (!this.mapHidden) {
if (this.theInterface.mapRegion.hitTest(this._xmouse, this._ymouse)) {
this.interfaceHasFocus();
} else {
this.interfaceLoseFocus();
}
} else if (this.mapHidden) {
if (this.theInterface.mapHideRegion.hitTest(this._xmouse, this._ymouse)) {
this.interfaceHasFocus();
} else {
this.interfaceLoseFocus();
}
} else {
this.interfaceLoseFocus();
}
};
_local2.newGame = function (theLevel) {
this.switchState(K.GAME_STATE);
};
_local2.quitGame = function () {
fscommand ("quit");
};
_local2.fadeNightMusic = function (f) {
var counter = 50;
var back = this;
var i = setInterval(function () {
back.music2.setVolume(counter--);
back.music3.setVolume(counter--);
if (counter <= 0) {
back.music2.setVolume(K.MUSIC_VOLUME_MAX);
back.music3.setVolume(K.MUSIC_VOLUME_MAX);
back.music2.stop();
back.music3.stop();
f();
clearInterval(i);
}
}, 100);
};
_local2.fadeDayMusic = function (f) {
var counter = 50;
var back = this;
var i = setInterval(function () {
back.music0.setVolume(counter--);
back.music1.setVolume(counter--);
if (counter <= 0) {
back.music0.stop();
back.back.music1.stop();
this.music0.setVolume(K.MUSIC_VOLUME_MAX);
back.music1.setVolume(K.MUSIC_VOLUME_MAX);
f();
clearInterval(i);
}
}, 100);
};
_local2.musicDayTime = function () {
var back = this;
this.fadeNightMusic(function () {
back.playMusic(0, "music_windsofchange_game.mp3", -1);
});
};
_local2.getLevelEnemies = function () {
return(this.lData.getLevelEnemies());
};
_local2.musicThePump = function () {
this.playMusic(2, "music_getpumped.wav", -1);
};
_local2.musicTheyApproach = function () {
var back = this;
this.fadeDayMusic(function () {
back.playMusic(2, "music_getpumped.wav", -1);
});
};
_local2.spawnMonsterTrucks = function (n) {
var _local5 = 0;
if ((n > 0) && (n != undefined)) {
var _local2 = false;
var _local4 = 0;
while (!_local2) {
if (this.lArray[0] == undefined) {
n = 0;
_local2 = true;
}
_local4 = K.randRange(0, this.lArray.length);
if (this.lArray[_local4].myIndex == K.SCORCHED) {
this.makeABadGuyByName("monsterTruck", _local4, n, 0, 0, false);
_local5++;
if (_local5 >= n) {
_local2 = true;
}
}
}
}
};
_local2.spawnRaidersAndMonsterTrucks = function (n) {
var _local5 = 0;
if ((n > 0) && (n != undefined)) {
var _local4 = false;
var _local2 = 0;
while (!_local4) {
if (this.lArray[0] == undefined) {
n = 0;
_local4 = true;
}
_local2 = K.randRange(0, this.lArray.length);
if (this.lArray[_local2].myIndex == K.SCORCHED) {
if ((_local2 % 2) == 0) {
this.makeABadGuyByName("raider", _local2, n, 0, 0, true);
} else {
this.makeABadGuyByName("monsterTruck", _local2, n, 0, 0, true);
}
_local5++;
if (_local5 >= n) {
_local4 = true;
}
}
}
}
};
_local2.spawnRaiders = function (n) {
var _local5 = 0;
if ((n > 0) && (n != undefined)) {
var _local2 = false;
var _local4 = 0;
while (!_local2) {
if (this.lArray[0] == undefined) {
n = 0;
_local2 = true;
}
_local4 = K.randRange(0, this.lArray.length);
if (this.lArray[_local4].myIndex == K.SCORCHED) {
this.makeABadGuyByName("raider", _local4, n, 0, 0, true);
_local5++;
if (_local5 >= n) {
_local2 = true;
}
}
}
}
};
_local2.spawnEnemies = function (n) {
if (this.lData.zombiesOn == true) {
if (n == undefined) {
n = this.getLevelEnemies();
}
} else {
n = 0;
}
var _local5 = Math.round(this.smogLevel / 250);
var _local6 = 0;
if ((n > 0) && (n != undefined)) {
var _local4 = false;
var _local2 = 0;
while (!_local4) {
if (this.lArray[0] == undefined) {
n = 0;
_local4 = true;
}
_local2 = K.randRange(0, this.lArray.length);
if (this.lArray[_local2].myIndex == K.SCORCHED) {
this.makeABadGuy(_local2, n, _local5, 0, true);
_local6++;
if (_local6 >= n) {
_local4 = true;
}
}
}
_local2 = 0;
while (_local2 < this.lArray.length) {
if (this.lArray[_local2].myIndex == K.POLLUTED) {
this.makeABadGuyByName("edderkopp", _local2, n, _local5, 0, false);
this.makeABadGuyByName("edderkopp", _local2, n, _local5, 1, false);
}
_local2++;
}
}
};
_local2.getNuclearNess = function () {
var _local3 = 0;
var _local2 = 0;
while (_local2 < this.bldgArray.length) {
if (this.bldgArray[_local2].myIndex == K.NUCLEARDUMP) {
_local3 = _local3 + this.bldgArray[_local2].amount;
}
if (this.bldgArray[_local2].myIndex == K.NUCLEARPLANT) {
_local3 = _local3 + 1;
}
if (this.bldgArray[_local2].myIndex == K.LANDFILL) {
_local3 = _local3 + (this.bldgArray[_local2].amount / 50);
}
_local2++;
}
_local2 = 0;
while (_local2 < this.rArray.length) {
if (this.rArray[_local2] != undefined) {
_local3 = _local3 + (this.rArray[_local2].amount * 10);
}
_local2++;
}
return(_local3);
};
_local2.getRichness = function () {
var _local2 = 0;
_local2 = _local2 + (K.FOOD_MULT * this.getFood());
_local2 = _local2 + (K.ENERGY_MULT * this.getEnergy());
_local2 = _local2 + (K.GAS_MULT * this.getGas());
_local2 = _local2 + (K.FF_MULT * this.getFF());
_local2 = _local2 + (K.COAL_MULT * this.getCoal());
_local2 = _local2 + (K.RESEARCH_MULT * this.getResearch());
_local2 = _local2 + (K.METAL_MULT * this.getMetal());
var _local3 = K.AVG_MULT * 70;
return(Math.floor(_local2 / _local3));
};
_local2.makeABadGuyByName = function (str, i, n, levelUps, offset, wiggle) {
if (offset == undefined) {
offset = 0;
}
var _local3 = this.lArray[i].xUnitLoc;
var _local2 = this.lArray[i].yUnitLoc;
if (_local3 >= 40) {
_local3 = 42;
}
if (_local2 >= 29) {
_local2 = 31;
}
this.makeEnemyAt((_local3 + 1) + offset, (_local2 + 1) + offset, str, levelUps, wiggle);
return(false);
};
_local2.makeABadGuy = function (i, n, levelUps, offset, wiggle) {
if (offset == undefined) {
offset = 0;
}
var _local4 = this.lArray[i].xUnitLoc;
var _local3 = this.lArray[i].yUnitLoc;
if (_local4 >= 40) {
_local4 = 42;
}
if (_local3 >= 29) {
_local3 = 31;
}
var _local8 = this.getNuclearNess();
var _local9 = this.getRichness();
var _local10 = 250 / _local8;
var _local6 = 200 / _local9;
var _local5 = K.randRange(1, _local6);
var _local11 = K.randRange(1, _local10);
var _local2 = "edderkopp";
if ((_local5 == 1) && (this.lData.raidersOn == true)) {
_local2 = "raider";
} else if ((_local11 == 1) && (this.lData.monsterTrucksOn == true)) {
_local2 = "monsterTruck";
}
this.makeEnemyAt((_local4 + 1) + offset, (_local3 + 1) + offset, _local2, levelUps, wiggle);
return(false);
};
_local2.playMusic = function (num, file, loops) {
if (loops == -1) {
loops = 9999;
}
var _local2;
switch (num) {
case 0 :
_local2 = this.music0;
break;
case 1 :
_local2 = this.music1;
break;
case 2 :
_local2 = this.music2;
break;
case 3 :
_local2 = this.music3;
}
_local2.setVolume(K.MUSIC_VOLUME_MAX);
_local2.attachSound(file);
_local2.start(0, loops);
};
_local2.playSwitchSound = function (file, loops) {
if (this.switchSounder == 0) {
this.switchSounder = 1;
this.playSound(2, file, loops);
} else if (this.switchSounder == 1) {
this.switchSounder = 0;
this.playSound(3, file, loops);
}
};
_local2.playSound = function (num, file, loops) {
switch (num) {
case 0 :
this.fxInterface.attachSound(file);
this.fxInterface.start(0, loops);
break;
case 1 :
this.fxGame.attachSound(file);
this.fxGame.start(0, loops);
break;
case 2 :
this.fxGame2.attachSound(file);
this.fxGame2.start(0, loops);
break;
case 3 :
this.fxGame3.attachSound(file);
this.fxGame3.start(0, loops);
break;
}
};
_local2.updateMusicVolume = function () {
this.music0.setVolume(K.MUSIC_VOLUME_MAX);
this.music1.setVolume(K.MUSIC_VOLUME_MAX);
this.music2.setVolume(K.MUSIC_VOLUME_MAX);
this.music3.setVolume(K.MUSIC_VOLUME_MAX);
};
_local2.killResearch = function () {
K.killResearch();
};
_local2.winQuitTheGame = function () {
this.killResearch();
this.master.directorWin(this.lData.getCurrLevelIndex(), this.totalScoreSoFar);
};
_local2.quitTheGame = function () {
this.killResearch();
this.master.directorQuit(this.lData.getCurrLevelIndex());
};
_local2.updateFxVolume = function () {
this.fxGame.setVolume(K.FX_VOLUME_MAX);
this.fxGame2.setVolume(K.FX_VOLUME_MAX);
this.fxGame3.setVolume(K.FX_VOLUME_MAX);
this.fxInterface.setVolume(K.FX_VOLUME_MAX);
};
_local2.levelScore = 0;
_local2.difficulty = 0;
_local2.lastAlert = "";
_local2.daysSurvived = 0;
_local2.spawnTicks = 0;
_local2.inAMenu = false;
_local2.resetting = false;
_local2.energyDefecits = false;
_local2.foodDefecits = false;
_local2.gWarnCounter = 0;
_local2.gpWarnCounter = 0;
_local2.nWarnCounter = 0;
_local2.landfillWarnCounter = 0;
_local2.nDumpWarnCounter = 0;
_local2.infiniteTime = false;
_local2.gameTime = 0;
_local2.maxGameTime = 0;
_local2.dayTime = K.DAY;
_local2.landfillAlertReady = true;
_local2.keyScrolling = false;
_local2.mouseScrolling = false;
_local2.interfaceFocus = false;
_local2.smogLevel = 0;
_local2.smogLevelUps = 0;
_local2.buildCursor = false;
_local2.actionMode = K.CLICK;
_local2.enemyTargetted = false;
_local2.multiSelect = false;
_local2.stickyClicky = false;
_local2.mapHidden = false;
_local2.dragBoxOn = false;
_local2.switchSounder = 0;
_local2.windX = -2;
_local2.windY = -2;
_local2.alertNextFrame = false;
_local2.spawnWaveAtNight = false;
_local2.energyIn = 0;
_local2.energyOut = 0;
_local2.energyNet = 0;
_local2.foodIn = 0;
_local2.foodOut = 0;
_local2.foodNet = 0;
_local2.paused = false;
_local2.showObjectiveMessageOnClose = false;
_local2.allowRecycling = true;
_local2.loseAtNight = false;
_local2.sunLight = K.SUN_MID;
_local2.windSpeed = K.WIND_MID;
_local2.daysSpent_Level = 0;
_local2.foodProduced_Level = 0;
_local2.foodProduced_Day = 0;
_local2.foodConsumed_Level = 0;
_local2.foodConsumed_Day = 0;
_local2.energyProduced_Level = 0;
_local2.energyProduced_Day = 0;
_local2.energyConsumed_Level = 0;
_local2.energyConsumed_Day = 0;
_local2.energyConsumed_Campaign = 0;
_local2.upgradesAchieved = 0;
_local2.sandboxMapsPlayed = 0;
_local2.fuelSourcesUsed = 0;
_local2.powerSourcesUsed = 0;
_local2.coalConsumed_Day = 0;
_local2.coalConsumed_Level = 0;
_local2.fossilFuelsConsumed_Day = 0;
_local2.fossilFuelsConsumed_Level = 0;
_local2.coalProduced_Day = 0;
_local2.coalProduced_Level = 0;
_local2.fossilFuelsProduced_Day = 0;
_local2.fossilFuelsProduced_Level = 0;
_local2.naturalGasConsumed_Day = 0;
_local2.naturalGasConsumed_Level = 0;
_local2.naturalGasProduced_Day = 0;
_local2.naturalGasProduced_Level = 0;
_local2.defenseMetalConsumed_Day = 0;
_local2.defenseMetalConsumed_Level = 0;
_local2.defenseFFConsumed_Day = 0;
_local2.defenseFFConsumed_Level = 0;
_local2.defenseGasConsumed_Day = 0;
_local2.defenseGasConsumed_Level = 0;
_local2.defenseEnergyConsumed_Day = 0;
_local2.defenseEnergyConsumed_Level = 0;
_local2.metalConsumed_Day = 0;
_local2.metalConsumed_Level = 0;
_local2.metalProduced_Day = 0;
_local2.metalProduced_Level = 0;
_local2.smogProduced_Day = 0;
_local2.smogProduced_Level = 0;
_local2.smogConsumed_Day = 0;
_local2.smogConsumed_Level = 0;
_local2.garbageProduced_Day = 0;
_local2.garbageProduced_Level = 0;
_local2.nwasteProduced_Day = 0;
_local2.nwasteProduced_Level = 0;
_local2.nwasteConsumed_Day = 0;
_local2.nwasteConsumed_Level = 0;
_local2.garbageConsumed_Day = 0;
_local2.garbageConsumed_Level = 0;
_local2.garbageEaters_Day = 0;
_local2.garbageEaters_Level = 0;
_local2.garbageEaten_Day = 0;
_local2.garbageEaten_Level = 0;
_local2.nwasteEaters_Day = 0;
_local2.nwasteEaters_Level = 0;
_local2.nwasteEaten_Day = 0;
_local2.nwasteEaten_Level = 0;
_local2.pollutionSpills_Day = 0;
_local2.pollutionSpills_Level = 0;
_local2.nuclearAccidents_Day = 0;
_local2.nuclearAccidents_Level = 0;
_local2.pollutionCleanups_Day = 0;
_local2.pollutionCleanups_Level = 0;
_local2.zombiesNeutralized_Day = 0;
_local2.zombiesNeutralized_Level = 0;
_local2.zombiesCorpseGarbage_Day = 0;
_local2.zombiesCorpseGarbage_Level = 0;
_local2.zombiesCorpseSmog_Day = 0;
_local2.zombiesCorpseSmog_Level = 0;
_local2.zombiesCorpseSmog_Cycle = 0;
_local2.zombiesFried_Day = 0;
_local2.zombiesFried_Cycle = 0;
_local2.zombiesFried_Level = 0;
_local2.metalRecycled = 0;
_local2.organicRecycled = 0;
_local2.usefulRecycled = 0;
_local2.casualties = 0;
_local2.energyScore_Level = 0;
_local2.resourceScore_Level = 0;
_local2.pollutionScore_Level = 0;
_local2.defenseScore_Level = 0;
_local2.finalScore_Level = 0;
_local2.challengeScore = 0;
_local2.levelsBeaten = 0;
_local2.fuelsUsed = 0;
_local2.timeTaken = 0;
_local2.totalScoreSoFar = 0;
ASSetPropFlags(_global.Director.prototype, null, 1);
#endinitclip
Symbol 2853 MovieClip [__Packages.SuperDirector] Frame 0
class SuperDirector extends MovieClip
{
var difficulty, currentLevel, statNugget, sandBoxObject, attachMovie, getNextHighestDepth, theCutScene, _parent, theDirector, theTransition, ScoreAPI, removeMovieClip;
function SuperDirector () {
super();
}
function onLoad() {
}
function setMeUp() {
startTheGame();
}
function setDifficulty(i) {
difficulty = i;
}
function setLevel(i) {
currentLevel = i;
}
function getTotalScore() {
return(statNugget.getTotalScore());
}
function setStat(str, n) {
statNugget.setValue(str, n);
}
function setNugget(n) {
sandBoxObject = n;
}
function startTheGame() {
if (currentLevel == 1) {
showCutScene(K.INTRO_MOVIE);
} else {
startGameLevel(currentLevel, difficulty);
}
}
function showCutScene(id, myNum) {
attachMovie("mc_cutScene", "theCutScene", getNextHighestDepth());
theCutScene.setMaster(this);
if (((myNum == undefined) || (myNum == null)) || (myNum == NaN)) {
myNum = 0;
}
var back = this;
theCutScene.setID(id, myNum);
theCutScene.onLoad = function () {
this.setMyNum(back.theFinalScore);
};
}
function endCutScene(id) {
theCutScene.removeMovieClip();
switch (id) {
case K.INTRO_MOVIE :
startGameLevel(currentLevel, difficulty);
break;
case K.END_MOVIE :
_parent.gotoAndPlay("start");
}
}
function startGameLevel(i, d) {
currentLevel = i;
attachMovie("mc_director", "theDirector", getNextHighestDepth());
theDirector.nextLevel = i;
theDirector.setMaster(this);
var back = this;
statNugget = new StatisticNugget(this, theDirector);
theDirector.setMeUp = function () {
this.setSandBoxObject(back.sandBoxObject);
};
onMidTransition = function () {
back.theDirector.doFirstStuff(d);
back.theTransition.play();
};
makeTransition();
}
function nextGameLevel(theLevel, diff) {
currentLevel = theLevel;
attachMovie("mc_director", "theDirector", getNextHighestDepth());
theTransition.swapDepths(theDirector);
theDirector.nextLevel = currentLevel;
theDirector.setMaster(this);
theDirector.doFirstStuff(diff);
}
function sameGameLevel(diff) {
attachMovie("mc_director", "theDirector", getNextHighestDepth());
theDirector.nextLevel = currentLevel;
theDirector.setMaster(this);
var back = this;
theDirector.setMeUp = function () {
this.setSandBoxObject(back.sandBoxObject);
};
makeTransition();
onMidTransition = function () {
this.theDirector.doFirstStuff(diff);
this.theTransition.play();
};
theTransition.gotoAndPlay("mid");
}
function doThisLevel(i) {
makeTransition();
onMidTransition = function () {
this.theDirector.deleteMe();
this.nextGameLevel(i, this.difficulty);
this.theTransition.play();
};
}
function doNextLevel() {
if (currentLevel == undefined) {
currentLevel = 1;
}
makeTransition();
onMidTransition = function () {
this.theDirector.deleteMe();
this.nextGameLevel(this.currentLevel + 1, this.difficulty);
this.theTransition.play();
};
}
function hardResetLevel(n) {
sandBoxObject = n;
theDirector.deleteMe();
sameGameLevel(difficulty);
}
function resetLevel(n) {
sandBoxObject = n;
makeTransition();
onMidTransition = function () {
this.theDirector.deleteMe();
this.sameGameLevel(this.difficulty);
};
}
function directorWin(lastLevel, finalScore) {
makeTransition();
theFinalScore = finalScore;
onMidTransition = function () {
this.theDirector.deleteMe();
this.onWinQuitGame(lastLevel);
this.theTransition.play();
};
var _local2 = this;
}
function directorQuit(lastLevel) {
makeTransition();
onMidTransition = function () {
this.theDirector.deleteMe();
this.onQuitGame(lastLevel);
this.theTransition.play();
};
}
function onWinQuitGame(lastLevel) {
Mouse.show();
_parent.setLastLevel(lastLevel);
showCutScene(K.END_MOVIE);
}
function submitFinalScore(i) {
var _local3 = K.NORMAL_BOARD_ID;
var _local6 = "normal";
if (((i == undefined) || (i == NaN)) || (i == null)) {
i = 0;
}
var _local5 = "Super Normal";
switch (difficulty) {
case K.DIFF_EASY :
_local5 = "Super Easy";
_local6 = "easy";
_local3 = K.EASY_BOARD_ID;
break;
case K.DIFF_NORMAL :
_local5 = "Super Normal";
_local6 = "normal";
_local3 = K.NORMAL_BOARD_ID;
break;
case K.DIFF_HARD :
_local5 = "Super Hard";
_local6 = "hard";
_local3 = K.HARD_BOARD_ID;
break;
default :
_local5 = "Super Normal";
_local6 = "normal";
_local3 = K.NORMAL_BOARD_ID;
}
if (_root.kongregate) {
_root.kongregateScores.setMode(_local5);
_root.kongregateScores.submit(i);
}
if (_root.mindJolt) {
ScoreAPI = new LocalConnection();
ScoreAPI.send(_root.com_mindjolt_api, "submitScore", i, _local6);
}
if (_root.mochiScore) {
mochi.MochiScores.showLeaderboard({boardID:_local3, score:i});
var _local7 = mochi.MochiServices.__get__clip();
var _local8 = mochi.MochiServices.__get__childClip();
_local8.swapDepths(_local7.getNextHighestDepth());
}
}
function onQuitGame(lastLevel) {
Mouse.show();
_parent.setLastLevel(lastLevel);
_parent.gotoAndPlay("start");
removeMovieClip();
removeMovieClip();
}
function makeTransition() {
if (theTransition != undefined) {
theTransition.removeMovieClip();
}
attachMovie("mc_transitioner", "theTransition", getNextHighestDepth());
}
function onTransitionEnd() {
}
function onMidTransition() {
}
var theFinalScore = 0;
}
Symbol 2854 MovieClip [__Packages.LevelNugget] Frame 0
class LevelNugget extends Object
{
var sandboxGoal, sandboxGoalValue, challengeString, challengeIndex, e, f, s, r, m, g, ff, coal, time_day, time_night, spawn_rate, spawn_time, increase_rate, increase_time, zombiesOn, wastelandN, wastelandS, wastelandW, wastelandE;
function LevelNugget () {
super();
}
function setSandboxGoal(str, num, extraStr) {
sandboxGoal = str;
sandboxGoalValue = num;
challengeString = extraStr;
}
function setChallengeIndex(i) {
challengeIndex = i;
}
function setR(_e, _f, _s, _r, _m, _g, _ff, _c) {
e = _e;
f = _f;
s = _s;
r = _r;
m = _m;
g = _g;
ff = _ff;
coal = _c;
}
function setS(td, tn, sr, st, ir, it, zo) {
time_day = td;
time_night = tn;
spawn_rate = sr;
spawn_time = st;
increase_rate = ir;
increase_time = it;
zombiesOn = zo;
}
function setW(n, s, w, e) {
wastelandN = n;
wastelandS = s;
wastelandW = w;
wastelandE = e;
}
}
Symbol 2855 MovieClip [__Packages.StatisticNugget] Frame 0
class StatisticNugget extends Object
{
var master, director, levelBeatArray, fuelsUsedArray, powersUsedArray, sandboxMapsArray, lData, ScoreAPI;
function StatisticNugget (sd, d) {
super();
master = sd;
director = d;
levelBeatArray = new Array(8);
var _local3 = 0;
while (_local3 < levelBeatArray.length) {
levelBeatArray[_local3] = false;
_local3++;
}
fuelsUsedArray = new Array(4);
_local3 = 0;
while (_local3 < fuelsUsedArray.length) {
fuelsUsedArray[_local3] = false;
_local3++;
}
powersUsedArray = new Array(6);
_local3 = 0;
while (_local3 < powersUsedArray.length) {
powersUsedArray[_local3] = false;
_local3++;
}
sandboxMapsArray = new Array(8);
_local3 = 0;
while (_local3 < sandboxMapsArray.length) {
sandboxMapsArray[_local3] = false;
_local3++;
}
}
function storeFuel(lvl, fuel) {
levelCarried = lvl;
fuelCarry = fuel;
}
function storeOldFuel(lvl, fuel) {
sameLevelCarried = lvl;
oldFuelCarry = fuel;
}
function carryFuel(lvl) {
if (lvl == levelCarried) {
K.success("StatisticNugget", "carryFuel", ((((("Carrying " + fuelCarry) + " fuel from Lvl ") + levelCarried) + " to Lvl ") + lvl) + "!");
return(fuelCarry);
}
if (lvl == sameLevelCarried) {
K.success("StatisticNugget", "carryFuel", ((((("Carrying " + oldFuelCarry) + " fuel from Lvl ") + sameLevelCarried) + " to Lvl ") + lvl) + "!");
return(fuelCarry);
}
var _local3 = ((("Can't carry fuel from Lvl " + levelCarried) + " to Lvl ") + lvl) + "!";
K.error("StatisticNugget", "carryFuel", _local3);
return(K.GASOLINE);
}
function carryResearch(lvl) {
if (lvl == (levelCarried + 1)) {
K.success("StatisticNugget", "carryResearch", ((((("Carrying " + researchCarry) + " research from Lvl ") + levelCarried) + " to Lvl ") + lvl) + "!");
return(researchCarry);
}
var _local2 = ((("Can't carry research from Lvl " + levelCarried) + " to Lvl ") + lvl) + "!";
K.error("StatisticNugget", "carryResearch", _local2);
return(0);
}
function storeResearch(lvl, amt) {
levelCarried = lvl;
researchCarry = amt;
}
function storeResources(lvl, e, f, m, g, o, c) {
if (lvl == 8) {
energyCarry = e;
foodCarry = f;
metalCarry = m;
gasCarry = g;
ffCarry = 0;
coalCarry = 0;
}
}
function carryResources(lvl) {
if (lvl == 9) {
return(new Array(energyCarry, foodCarry, metalCarry, gasCarry));
}
}
function setValue(str, n) {
if (this[str] != undefined) {
this[str] = n;
}
}
function setLData() {
lData = master.theDirector.lData;
}
function playSandboxLevel(i) {
kongregateSubmit("sandboxPlayed_" + i, 1);
}
function beatLevel(i) {
levelBeatArray[i - 1] = true;
switch (i) {
case 1 :
kongregateSubmit("levelBeaten_01", 1);
break;
case 2 :
kongregateSubmit("levelBeaten_02", 1);
break;
case 3 :
kongregateSubmit("levelBeaten_03", 1);
break;
case 4 :
kongregateSubmit("levelBeaten_04", 1);
break;
case 5 :
kongregateSubmit("levelBeaten_05", 1);
break;
case 6 :
kongregateSubmit("levelBeaten_06", 1);
break;
case 7 :
kongregateSubmit("levelBeaten_07", 1);
break;
case 8 :
kongregateSubmit("levelBeaten_08", 1);
break;
case 9 :
kongregateSubmit("levelBeaten_09", 1);
}
checkLevelsBeaten();
}
function logCasualties(lvl, i, d) {
var _local2;
_local2 = K.getDiffStr(d);
if ((i != undefined) && (i != NaN)) {
if (d != K.DIFF_EASY) {
switch (lvl) {
case 5 :
kongregateSubmit("levelCasualties_05_" + _local2, i);
break;
case 6 :
kongregateSubmit("levelCasualties_06_" + _local2, i);
break;
case 7 :
kongregateSubmit("levelCasualties_07_" + _local2, i);
break;
case 9 :
kongregateSubmit("levelCasualties_09_" + _local2, i);
}
}
} else {
K.error("StatisticNugget", "logCasualties", "undefined or NaN!");
}
}
function logTime(lvl, i, d) {
var _local2;
_local2 = K.getDiffStr(d);
if ((i != undefined) && (i != NaN)) {
if (d != K.DIFF_EASY) {
if (!(lvl === 8)) {
} else {
kongregateSubmit("levelTime_08_" + _local2, i);
}
}
} else {
K.error("StatisticNugget", "logCasualties", "undefined or NaN!");
}
}
function logCampaign(inCampaign) {
if (inCampaign) {
kongregateSubmit("campaignOrSandbox", 1);
} else {
kongregateSubmit("campaignOrSandbox", 0);
}
}
function logRecycle(m, u, o, d) {
var _local3 = (m + u) + o;
var _local2 = K.getDiffStr(d);
if ((_local3 != undefined) && (_local3 != NaN)) {
if (d != K.DIFF_EASY) {
kongregateSubmit("campaign_metalRecycled_" + _local2, m);
kongregateSubmit("campaign_usefulRecycled_" + _local2, u);
kongregateSubmit("campaign_organicRecycled_" + _local2, o);
}
} else {
K.error("StatisticNugget", "logRecycle", "undefined or NaN!");
}
}
function logResourcesConsumed(i, e, f, m, g, ff, o, c, d) {
var _local3 = (((((e + f) + m) + g) + ff) + o) + c;
var _local2 = K.getDiffStr(d);
if ((_local3 != undefined) && (_local3 != NaN)) {
if (d != K.DIFF_EASY) {
if (!(i === 9)) {
} else {
kongregateSubmit("levelConsumeEnergy_08_" + _local2, e);
kongregateSubmit("levelConsumeFood_08_" + _local2, f);
kongregateSubmit("levelConsumeMetal_08_" + _local2, m);
kongregateSubmit("levelConsumeGas_08_" + _local2, g);
}
}
} else {
K.error("StatisticNugget", "logResourcesConsumed", "undefined or NaN!");
}
}
function logResourcesProduced(i, e, f, m, g, ff, o, c, d) {
var _local3 = (((((e + f) + m) + g) + ff) + o) + c;
var _local2 = K.getDiffStr(d);
if ((_local3 != undefined) && (_local3 != NaN)) {
if (d != K.DIFF_EASY) {
if (!(i === 8)) {
} else {
kongregateSubmit("levelEnergy_08_" + _local2, e);
kongregateSubmit("levelFood_08_" + _local2, f);
kongregateSubmit("levelMetal_08_" + _local2, m);
kongregateSubmit("levelGas_08_" + _local2, g);
}
}
} else {
K.error("StatisticNugget", "logResourcesProduced", "undefined or NaN!");
}
}
function logPollutionProduced(i, smog, garbage, nwaste, d) {
var _local4 = (smog + garbage) + nwaste;
var _local2 = K.getDiffStr(d);
if ((_local4 != undefined) && (_local4 != NaN)) {
if (d != K.DIFF_EASY) {
switch (i) {
case 7 :
kongregateSubmit("levelSmog_07_" + _local2, smog);
kongregateSubmit("levelWaste_08_", garbage + (nwaste * 50));
break;
case 8 :
kongregateSubmit("levelSmog_08_" + _local2, smog);
kongregateSubmit("levelWaste_08_" + _local2, garbage + (nwaste * 50));
break;
case 9 :
kongregateSubmit("levelSmog_09_" + _local2, smog);
kongregateSubmit("levelWaste_09_" + _local2, garbage + (nwaste * 50));
}
}
} else {
K.error("StatisticNugget", "logPollutionProduced", "undefined or NaN!");
}
}
function logDefenseEfficiency(i, d, dif) {
var _local2 = K.getDiffStr(dif);
if (((d != undefined) && (d != NaN)) && (_local2 != undefined)) {
if (dif != K.DIFF_EASY) {
switch (i) {
case 5 :
kongregateSubmit("levelDefenseEfficiency_05_" + _local2, d);
break;
case 6 :
kongregateSubmit("levelDefenseEfficiency_06_" + _local2, d);
break;
case 7 :
kongregateSubmit("levelDefenseEfficiency_07_" + _local2, d);
break;
case 9 :
kongregateSubmit("levelDefenseEfficiency_09_" + _local2, d);
}
kongregateSubmit("defenseEfficiency_" + _local2, d);
}
} else {
K.error("StatisticNugget", "logDefenseEfficiency", "undefined or NaN!");
}
}
function logRecyclingLevel(i, d) {
var _local2 = K.getDiffStr(d);
if (d != K.DIFF_EASY) {
if ((i != undefined) && (i != NaN)) {
kongregateSubmit("recyclingUpgrade_level_" + _local2, i);
} else {
K.error("StatisticNugget", "logRecyclingLevel", "undefined or NaN!");
}
}
}
function logChallengeScore(i, s) {
if ((s != undefined) && (s != NaN)) {
kongregateSubmit(("challenge_" + i) + "_score", s);
}
}
function logScore(i, score, submit) {
if ((score != undefined) && (score != NaN)) {
switch (i) {
case 1 :
score_level_01 = score;
break;
case 2 :
score_level_02 = score;
break;
case 3 :
score_level_03 = score;
break;
case 4 :
score_level_04 = score;
break;
case 5 :
score_level_05 = score;
break;
case 6 :
score_level_06 = score;
break;
case 7 :
score_level_07 = score;
break;
case 8 :
score_level_08 = score;
break;
case 9 :
score_level_09 = score;
}
score_level_total = (((((((score_level_01 + score_level_02) + score_level_03) + score_level_04) + score_level_05) + score_level_06) + score_level_07) + score_level_08) + score_level_09;
if (submit) {
kongregateScore(score_level_total);
}
} else {
K.error("StatisticNugget", "logScore", "undefined or NaN");
}
}
function getTotalScore() {
return(score_level_total);
}
function useFuel(i) {
fuelsUsedArray[i - 1] = true;
checkFuelsUsed();
}
function useUpgrade() {
}
function usePower(i) {
powersUsedArray[i - 1] = true;
checkPowersUsed();
}
function checkPowersUsed() {
setLData();
powersUsed = 0;
var _local2 = 0;
while (_local2 < powersUsedArray.length) {
if (powersUsedArray[_local2] == true) {
powersUsed++;
}
_local2++;
}
if (lData.inCampaign == true) {
kongregateSubmit("powerSourcesUsed", powersUsed);
}
}
function checkFuelsUsed() {
setLData();
fuelsUsed = 0;
var _local2 = 0;
while (_local2 < fuelsUsedArray.length) {
if (fuelsUsedArray[_local2] == true) {
fuelsUsed++;
}
_local2++;
}
if (lData.inCampaign == true) {
kongregateSubmit("fuelSourcesUsed", fuelsUsed);
}
}
function checkSandboxMaps() {
setLData();
sandboxMaps = 0;
var _local2 = 0;
while (_local2 < sandboxMapsArray.length) {
if (sandboxMapsArray[_local2] == true) {
sandboxMaps++;
}
_local2++;
}
kongregateSubmit("sandboxMapsPlayed", sandboxMaps);
}
function checkLevelsBeaten() {
setLData();
levelsBeaten = 0;
var _local2 = 0;
while (_local2 < levelBeatArray.length) {
if (levelBeatArray[_local2] == true) {
levelsBeaten++;
}
_local2++;
}
if (levelsBeaten == 9) {
if (lData.inCampaign == true) {
}
return(true);
}
if (lData.inCampaign == true) {
}
return(false);
}
function addEnergyConsumed(e) {
}
function addGarbage(garbageProduced_) {
}
function addFossilFuelsConsumed(fossilFuelsConsumed_) {
}
function addMetalConsumed(metalConsumed_) {
}
function addNaturalGasConsumed(naturalGasConsumed_) {
}
function addNuclearAccidents(nuclearAccidents_) {
}
function addPollutionAccidents(pollutionAccidents_) {
}
function addSmog(smogProduced_) {
}
function finalizeCampaignStats(d) {
if (checkLevelsBeaten()) {
kongregateSubmit("gameCompleted", 1);
kongregateSubmit("gameCompleted_" + K.getDiffStr(d), 1);
}
}
function kongregateScore(i) {
var _local3 = "Super Normal";
var _local6 = "normal";
var _local4 = K.EASY_BOARD_ID;
switch (master.difficulty) {
case K.DIFF_EASY :
_local3 = "Super Easy";
_local6 = "easy";
_local4 = K.EASY_BOARD_ID;
break;
case K.DIFF_NORMAL :
_local3 = "Super Normal";
_local6 = "normal";
_local4 = K.NORMAL_BOARD_ID;
break;
case K.DIFF_HARD :
_local3 = "Super Hard";
_local6 = "hard";
_local4 = K.HARD_BOARD_ID;
break;
default :
_local3 = "Super Normal";
_local4 = K.NORMAL_BOARD_ID;
}
ScoreAPI = new LocalConnection();
ScoreAPI.send(_root.com_mindjolt_api, "submitScore", i, _local6);
if (_root.kongregate) {
_root.kongregateScores.setMode(_local3);
_root.kongregateScores.submit(i);
}
if (_root.hallPass) {
_root.HPScoreService.postScore(i, _local3);
}
if (_root.mochiScore) {
sendMochiScore(i, _local4);
}
}
function sendMochiScore(i, theBoard) {
mochi.MochiServices.connect("b0aded9ef0f82b14", _root);
mochi.MochiScores.showLeaderboard({boardID:theBoard, score:i});
var _local4 = mochi.MochiServices.__get__clip();
var _local3 = mochi.MochiServices.__get__childClip();
_local3.swapDepths(_local4.getNextHighestDepth());
}
function kongregateSubmit(str, n) {
_root.kongregateStats.submit(str, n);
}
var energyProduced_Level = 0;
var energyProduced_Day = 0;
var energyConsumed_Level = 0;
var energyConsumed_Day = 0;
var upgradesAchieved = 0;
var sandboxMapsPlayed = 0;
var fuelSourcesUsed = 0;
var powerSourcesUsed = 0;
var fossilFuelsConsumed_ = 0;
var fossilFuelsConsumed_Level = 0;
var fossilFuelsConsumed_Campaign = 0;
var fossilFuelsProduced_ = 0;
var fossilFuelsProduced_Level = 0;
var fossilFuelsProduced_Campaign = 0;
var naturalGasConsumed_ = 0;
var naturalGasConsumed_Level = 0;
var naturalGasConsumed_Campaign = 0;
var naturalGasProduced_ = 0;
var naturalGasProduced_Level = 0;
var naturalGasProduced_Campaign = 0;
var metalConsumed_ = 0;
var metalConsumed_Level = 0;
var metalConsumed_Campaign = 0;
var metalProduced_ = 0;
var metalProduced_Level = 0;
var metalProduced_Campaign = 0;
var smogProduced_ = 0;
var smogProduced_Level = 0;
var smogProduced_Campaign = 0;
var smogConsumed_ = 0;
var smogConsumed_Level = 0;
var smogConsumed_Campaign = 0;
var garbageProduced_ = 0;
var garbageProduced_Level = 0;
var garbageProduced_Campaign = 0;
var garbageConsumed_ = 0;
var garbageConsumed_Level = 0;
var garbageConsumed_Campaign = 0;
var garbageEaten_ = 0;
var garbageEaten_Level = 0;
var garbageEaten_Campaign = 0;
var nwasteEaten_ = 0;
var nwasteEaten_Level = 0;
var nwasteEaten_Campaign = 0;
var pollutionSpills_ = 0;
var pollutionSpills_Campaign = 0;
var pollutionCleanups_ = 0;
var pollutionCleanups_Level = 0;
var pollutionCleanups_Campaign = 0;
var zombiesNeutralized_ = 0;
var zombiesNeutralized_Level = 0;
var zombiesNeutralized_Campaign = 0;
var zombieEfficiency_Level = 0;
var zombieEfficiency_Campaign = 0;
var score_level_01 = 0;
var score_level_02 = 0;
var score_level_03 = 0;
var score_level_04 = 0;
var score_level_05 = 0;
var score_level_06 = 0;
var score_level_07 = 0;
var score_level_08 = 0;
var score_level_09 = 0;
var score_level_total = 0;
var energyScore_Level = 0;
var energyScore_Campaign = 0;
var resourceScore_Level = 0;
var resourceScore_Campaign = 0;
var pollutionScore_Level = 0;
var pollutionScore_Campaign = 0;
var defenseScore_Level = 0;
var defenseScore_Campaign = 0;
var finalScore_Level = 0;
var finalScore_Campaign = 0;
var nuclearAccidents_ = 0;
var nuclearAccidents_Campaign = 0;
var levelsBeaten = 0;
var fuelsUsed = 0;
var powersUsed = 0;
var sandboxMaps = 0;
var energyCarry = 0;
var foodCarry = 0;
var metalCarry = 0;
var gasCarry = 0;
var coalCarry = 0;
var ffCarry = 0;
var fuelCarry = K.GASOLINE;
var oldFuelCarry = K.GASOLINE;
var levelCarried = -1;
var sameLevelCarried = 0;
var researchCarry = 0;
}
Symbol 2856 MovieClip [__Packages.LevelData] Frame 0
#initclip
if (!_global.LevelData) {
var _local1 = function (i, d) {
super();
};
_global.LevelData = _local1;
//_global.LevelData extends Object
var _local2 = _local1.prototype;
_local2.setMaster = function (d) {
this.master = d;
};
_local2.initialize = function (i, d, sandO, diff) {
if (sandO != undefined) {
this.getSandSettings(sandO);
}
this.setMaster(d);
this.difficulty = diff;
if (((this.difficulty == undefined) || (this.difficulty == null)) || (this.difficulty == NaN)) {
this.difficulty = 1;
}
if (sandO != undefined) {
if ((this.sandboxGoal != "") && (this.sandboxGoal != undefined)) {
this.setSandBoxGoal(this.sandboxGoal, this.sandboxGoalValue, this.challengeString);
}
}
this.setLevel(i);
};
_local2.getSandSettings = function (sandO) {
this.sandDayTime = sandO.time_day / K.CYCLETIME;
this.sandNightTime = sandO.time_night / K.CYCLETIME;
this.sandSpawnRate = sandO.spawn_rate;
this.sandSpawnTicks = sandO.spawn_time;
this.sandIncreaseRate = sandO.increase_rate;
this.sandIncreaseTicks = sandO.increase_time;
this.sandWasteland = new Array();
this.sandWasteland[0] = sandO.wastelandW;
this.sandWasteland[1] = sandO.wastelandE;
this.sandWasteland[2] = sandO.wastelandN;
this.sandWasteland[3] = sandO.wastelandS;
this.sandboxGoal = sandO.sandboxGoal;
this.sandboxGoalValue = sandO.sandboxGoalValue;
this.challengeString = sandO.challengeString;
this.challengeIndex = sandO.challengeIndex;
if (this.challengeIndex > 0) {
this.isChallenge = true;
}
this.sandResources = new Array(sandO.e, sandO.f, sandO.s, sandO.r, sandO.m, sandO.g, sandO.ff, sandO.coal);
this.zombiesOn = sandO.zombiesOn;
};
_local2.setInSandbox = function () {
this.inSandbox = true;
this.inCampaign = false;
this.master.playSandboxLevel(this.myIndex);
};
_local2.setInCampaign = function () {
this.inSandbox = false;
this.inCampaign = true;
};
_local2.setLevel = function (i) {
if ((i >= (-K.MAX_LEVEL)) && (i <= K.MAX_LEVEL)) {
this.myIndex = Math.abs(i);
this.otherIndex = i;
switch (i) {
case 0 :
this.loadLevel("_level_test");
this.loadLevel("_level_test_p");
this.bakedLevel = false;
this.onWithTheShow();
break;
case -1 :
this.levelSand1();
this.onWithTheShow();
this.setInSandbox();
break;
case -2 :
this.levelSand2();
this.onWithTheShow();
this.setInSandbox();
break;
case -3 :
this.levelSand3();
this.onWithTheShow();
this.setInSandbox();
break;
case -4 :
this.levelSand4();
this.onWithTheShow();
this.setInSandbox();
break;
case -5 :
this.levelSand5();
this.onWithTheShow();
this.setInSandbox();
break;
case -6 :
this.levelSand6();
this.onWithTheShow();
this.setInSandbox();
break;
case -7 :
this.levelSand7();
this.onWithTheShow();
this.setInSandbox();
break;
case -8 :
this.levelSand8();
this.onWithTheShow();
this.setInSandbox();
break;
case -9 :
break;
case -10 :
break;
case 1 :
this.level1();
this.onWithTheShow();
this.setInCampaign();
break;
case 2 :
this.level2();
this.onWithTheShow();
this.setInCampaign();
break;
case 3 :
this.level3();
this.onWithTheShow();
this.setInCampaign();
break;
case 4 :
this.level4();
this.onWithTheShow();
this.setInCampaign();
break;
case 5 :
this.level5();
this.onWithTheShow();
this.setInCampaign();
break;
case 6 :
this.level6();
this.onWithTheShow();
this.setInCampaign();
break;
case 7 :
this.level7();
this.onWithTheShow();
this.setInCampaign();
break;
case 8 :
this.level8();
this.onWithTheShow();
this.setInCampaign();
break;
case 9 :
this.level9();
this.onWithTheShow();
this.setInCampaign();
break;
case 10 :
break;
default :
this.loadLevel("_level_" + this.myIndex);
this.loadLevel(("_level_" + this.myIndex) + "_p");
}
} else {
K.error(this.c, "setLevel", ("index " + i) + " is out of bounds");
}
};
_local2.getBuildingArray = function () {
var _local7 = new Array();
var _local8 = this.pArray[0].length;
var _local4 = 0;
while (_local4 < this.pArray.length) {
var _local2 = 0;
while (_local2 < _local8) {
var _local6 = K.propertyToBuilding(this.pArray[_local4][_local2]);
var _local3 = this.pArray[_local4][_local2];
if ((_local3 != K.DIRT) && (_local3 != K.HARD)) {
var _local5 = new Object();
_local5.xLoc = _local2;
_local5.yLoc = _local4;
_local5.p = _local6;
_local7.push(_local5);
if (_local3 == K._SUPERFARM) {
this.pArray[_local4][_local2] = K.GRASS;
} else if (_local3 == K._OILGASWELL) {
this.pArray[_local4][_local2] = K.OIL;
} else if (_local3 == K._GEOPLANT) {
this.pArray[_local4][_local2] = K.GEO;
} else if (_local3 == K._SUPERGEOPLANT) {
this.pArray[_local4][_local2] = K.GEO_BIG;
} else if (_local3 == K._MINE) {
this.pArray[_local4][_local2] = K.STONE;
} else if (_local3 == K._COALMINE) {
this.pArray[_local4][_local2] = K.COALSPOT;
}
}
_local2++;
}
_local4++;
}
return(_local7);
};
_local2.getStartLoc = function () {
var _local5 = new Array();
var _local3 = 0;
while (_local3 < this.pArray.length) {
var _local2 = 0;
while (_local2 < this.pArray[_local3].length) {
if (this.pArray[_local3][_local2] == K.START) {
this.startX = _local2;
this.startY = _local3;
var _local4 = new Array(this.startX, this.startY);
_local5.push(_local4);
break;
}
_local2++;
}
_local3++;
}
return(_local5);
};
_local2.getTiles = function () {
return(this.tArray);
};
_local2.getProperties = function () {
return(this.pArray);
};
_local2.getTile = function (xx, yy) {
return(this.tArray[yy][xx] - 1);
};
_local2.getAltitude = function (xx, yy) {
if (this.hArray != undefined) {
return(this.hArray[yy][xx]);
}
};
_local2.getProp = function (xx, yy) {
return(this.pArray[yy][xx]);
};
_local2.setProp = function (xx, yy, i) {
this.pArray[yy][xx] = i;
};
_local2.getPWidth = function () {
return(this.pWidth);
};
_local2.getPHeight = function () {
return(this.pHeight);
};
_local2.getWidth = function () {
return(this.myWidth);
};
_local2.getHeight = function () {
return(this.myHeight);
};
_local2.getPxWidth = function () {
return(this.myWidth * K.TILE_SIZE);
};
_local2.getPxHeight = function () {
return(this.myHeight * K.TILE_SIZE);
};
_local2.loadLevel = function (fName) {
var _local2 = new XML();
_local2.ignoreWhite = true;
var _local3 = K.getLocalRawPath();
_local3 = _local3 + (fName + ".xml");
var back = this;
_local2.onLoad = function (didItWork) {
if (didItWork) {
K.success(back.c, "loadLevel", "XML loaded!");
back.onLoadLevel(this.firstChild);
} else {
K.error(back.c, "loadLevel", "XML failed to load!");
}
};
_local2.load(_local3);
};
_local2.onLoadLevel = function (theLevel) {
if (theLevel.nodeName.toUpperCase() == "ENERGYCRAFT") {
K.success(this.c, "loadLevel", "map is valid ENERGYCRAFT map...");
var _local2 = theLevel.firstChild;
if (_local2.nodeName.toUpperCase() == "TILES") {
K.success(this.c, "loadLevel", "type = TILES");
this.parseMap(_local2.firstChild, K.TILES);
} else if (_local2.nodeName.toUpperCase() == "PROPERTIES") {
K.success(this.c, "loadLevel", "type = PROPERTIES");
this.parseMap(_local2.firstChild, K.PROPERTIES);
} else {
K.error(this.c, "loadLevel", "type = UNKNOWN");
}
} else {
K.error(this.c, "loadLevel", "map is NOT valid ENERGYCRAFT map!");
}
};
_local2.parseMap = function (mapData, type) {
var _local4 = new Array();
var _local6 = mapData;
var _local2 = null;
var _local7 = 0;
var _local5 = 0;
var _local9 = 0;
var _local8 = 0;
while (_local6 != null) {
_local7 = 0;
_local2 = _local6.firstChild;
_local4[_local5] = new Array();
while (_local2 != null) {
_local4[_local5].push(Number(_local2.firstChild.nodeValue));
_local7++;
_local2 = _local2.nextSibling;
}
_local9 = _local7;
_local5++;
_local6 = _local6.nextSibling;
}
_local8 = _local5;
if (type == K.TILES) {
this.tArray = _local4;
this.myWidth = _local9;
this.myHeight = _local8;
} else if (type == K.PROPERTIES) {
this.pArray = _local4;
this.pWidth = _local9;
this.pHeight = _local8;
}
K.success(this.c, "parseMap", "Level finished loading! Notifying master...");
var _local3 = 0;
while (_local3 < _local8) {
_local3++;
}
this.master.levelDataLoaded(type);
};
_local2.onWithTheShow = function () {
this.makeReservoirs();
this.master.levelDataLoaded(K.PROPERTIES);
};
_local2.makeReservoirs = function () {
this.reservoirs = new Array();
var _local3 = 0;
while (_local3 < this.pArray.length) {
var _local2 = 0;
while (_local2 < this.pArray[_local3].length) {
if (((this.pArray[_local3][_local2] == K.OIL) || (this.pArray[_local3][_local2] == K.OIL_BIG)) || (this.pArray[_local3][_local2] == K.OILGASWELL)) {
var _local4 = new Reservoir();
_local4.setLoc(_local2, _local3);
this.reservoirs.push(_local4);
} else if ((this.pArray[_local3][_local2] == K.COALSPOT) || (this.pArray[_local3][_local2] == K._COALMINE)) {
var _local4 = new CoalDeposit();
_local4.setLoc(_local2, _local3);
this.reservoirs.push(_local4);
} else if ((this.pArray[_local3][_local2] == K.STONE) || (this.pArray[_local3][_local2] == K._MINE)) {
var _local4 = new MetalDeposit();
_local4.setLoc(_local2, _local3);
this.reservoirs.push(_local4);
}
_local2++;
}
_local3++;
}
};
_local2.findReservoir = function (xx, yy) {
var _local3;
var _local2 = 0;
while (_local2 < this.reservoirs.length) {
if ((this.reservoirs[_local2].xLoc == xx) && (this.reservoirs[_local2].yLoc == yy)) {
_local3 = this.reservoirs[_local2];
}
_local2++;
}
if (_local3 != undefined) {
}
return(_local3);
};
_local2.getStartDayTime = function () {
return(this.missionTime[2]);
};
_local2.getDayHours = function () {
return(this.missionTime[0] * K.CYCLETIME);
};
_local2.getNightHours = function () {
return(this.missionTime[1] * K.CYCLETIME);
};
_local2.level20 = function () {
this.titleName = "Sandbox Mode";
this.missionTime = [8, 2, 1];
this.noMansLand = [true, false, true, false];
this.pArray = new Array(16);
this.pArray[0] = new Array(100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100);
this.pArray[1] = new Array(100, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100);
this.pArray[2] = new Array(100, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 100);
this.pArray[3] = new Array(100, 0, 2, 1, 2, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 100);
this.pArray[4] = new Array(100, 2, 2, 2, 13, 14, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100);
this.pArray[5] = new Array(100, 2, 40, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100);
this.pArray[6] = new Array(100, 0, 2, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100);
this.pArray[7] = new Array(100, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 100);
this.pArray[8] = new Array(100, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 100);
this.pArray[9] = new Array(100, 2, 2, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 4, 100);
this.pArray[10] = new Array(100, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 100);
this.pArray[11] = new Array(100, 2, 2, 2, 0, 0, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 100);
this.pArray[12] = new Array(100, 2, 2, 2, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 100);
this.pArray[13] = new Array(100, 2, 2, 2, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 3, 100);
this.pArray[14] = new Array(100, 2, 2, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 100);
this.pArray[15] = new Array(100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100);
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.waves = new Array();
this.actions = new Array();
this.disables = new Array();
this.spawnRate = 3;
this.spawnTicks = 2;
this.increaseRate = 1;
this.increaseTicks = 2;
this.textPortraits = new Array();
this.textPortraits[0] = "lars";
this.texts[0] = "Sandbox mode is currently under construction. All features are unlocked here, eventually there will be more maps. There is no objective but to not die. Good luck!";
this.objInfo[0] = "";
this.objectives[0] = "Pardon our dust.";
this.titleName = "Sandbox.";
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = [400, 50, 0, 400, 200, 100, 100, 100];
this.disables = [];
this.energyDefecits = false;
this.foodDefecits = false;
};
_local2.level1 = function () {
this.titleName = "Chapter 1: Taking Out the Trash";
this.myWidth = 42;
this.myHeight = 32;
this.pWidth = 21;
this.raidersOn = false;
this.monsterTrucksOn = false;
this.dayPar = 2;
this.pHeight = 16;
this.pArray = new Array(this.pHeight);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 45, 3, 3, 3);
this.pArray[2] = new Array(0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 45, 3, 3, 3);
this.pArray[6] = new Array(0, 0, 3, 0, 0, 0, 45, 0, 0, 3, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 45, 3, 3, 3, 3, 3, 3, 0, 3, 3);
this.pArray[8] = new Array(0, 0, 0, 0, 0, 0, 1, 3, 3, 0, 0, 45, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 45, 0, 0, 3, 0, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[11] = new Array(0, 0, 3, 0, 0, 0, 0, 0, 0, 45, 0, 3, 3, 3, 3, 3, 3, 45, 3, 3, 3);
this.pArray[12] = new Array(0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[13] = new Array(0, 0, 3, 0, 0, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3);
this.pArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 45, 3, 3, 3);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.missionTime = [-1, 2, 0];
this.noMansLand = [false, true, false, false];
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.textPortraits = new Array();
this.waves = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.disables = new Array();
this.tutorials = new Array();
this.spawnRate = 0;
this.spawnTicks = 1;
this.increaseRate = 0;
this.increaseTicks = 100;
this.raidersOn = false;
this.monsterTrucksOn = false;
var _local2 = 0;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "HQ! We have multiple hostiles enroute!";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "Not to worry, Doctor. Our gun turrets set to automatic fire. Just leave this to us.";
this.objInfo[_local2] = "survive";
this.actions[_local2] = "spawn";
this.waves[_local2] = 10;
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "There's more, hold on! We'll need to repair those turrets soon!";
this.objectives[_local2] = "Survive the zombies";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
this.waves[_local2] = 0;
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "There are two ways to repair buildings: \n 1) Select ''Repair All'' from the right-hand panel\n 2) Click on an individual building and select ''Repair'' from its context panel.";
this.objectives[_local2] = "Survive the zombies";
this.objInfo[_local2] = "survive";
this.actions[_local2] = "spawn";
this.waves[_local2] = 10;
this.tutorials[_local2] = "repair";
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "Those monsters...they're eating the dead bodies - and growing! Gross! We better clean up! We'll need a FACTORY.";
this.objectives[_local2] = "Build a factory";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_Factory", "e_Demolish", "talk");
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "To build a factory, select ''Factory'' from the right-hand panel, then click somewhere on the map to build it there.";
this.objectives[_local2] = "Build a factory";
this.objInfo[_local2] = "b_factory_01";
this.actions[_local2] = "e_Factory";
this.tutorials[_local2] = "building";
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "We'll need some garbage trucks.";
this.objectives[_local2] = "Build a garbage truck";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "To build garbage trucks, first select a factory you've built. In the factory's context panel, select ''Garbage Truck.''";
this.objectives[_local2] = "Build a garbage truck";
this.objInfo[_local2] = "u_garbagetruck_01";
this.tutorials[_local2] = "units";
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "Guess we need to put that stuff somewhere, huh? Let's build a landfill.";
this.objectives[_local2] = "Build a landfill";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("talk", "e_LandFill");
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "To build a landfill, select ''Landfill'' from the right-hand panel, then click on the map where you want to build it. It's best to build landfills close to trash sources.";
this.objectives[_local2] = "Build a landfill";
this.objInfo[_local2] = "b_landfill_01";
this.actions[_local2] = "e_LandFill";
this.tutorials[_local2] = "building_landfill";
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "Okay, let's get this mess cleared up. Build more trucks if you like.";
this.objectives[_local2] = "Clean up the garbage";
this.objInfo[_local2] = "clean_garbage";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Zombies will eat garbage, and become stronger. Clean up waste from buildings and dead zombies!";
this.objectives[_local2] = "Clean up the garbage";
this.objInfo[_local2] = "clean_garbage";
this.tutorials[_local2] = "garbage_eat";
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "I think they're waiting for dark - they're sensitive to light. Time to build some defenses.";
this.objectives[_local2] = "Build 4 floodlights";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_Defense", "e_FloodLights", "e_GunTurret", "talk");
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "To build defenses, select ''Defenses'' from the right-hand panel. Then select the defense building you want and place it on the map.";
this.objectives[_local2] = "Build 4 floodlights";
this.objInfo[_local2] = "b_FloodLights_04";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_Defense", "e_FloodLights", "e_GunTurret");
this.tutorials[_local2] = "defenses";
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "Good job. Now we just wait for dark...";
this.objectives[_local2] = "Wait for dark.";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Time is constantly counting down. Pay attention to the clock to know when the day ends and night begins, and vice versa.";
this.objectives[_local2] = "Wait for dark.";
this.objInfo[_local2] = "wait_dark";
this.actions[_local2] = "time_001";
this.tutorials[_local2] = "time";
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "Here they come. Time to take out the trash.";
this.objInfo[_local2] = "survive";
this.objectives[_local2] = "Survive the zombies.";
this.tutorials[_local2] = "";
this.waves[_local2] = 30;
this.actions[_local2] = "spawn";
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "That's the last of them! I wonder if any other bases survived?";
this.objInfo[_local2] = "score";
this.actions[_local2] = "score";
_local2++;
this.textPortraits[_local2] = "score";
this.texts[_local2] = "";
this.objInfo[_local2] = "victory";
this.objectives[_local2] = "";
this.actions[_local2] = "victory";
this.visibleResources = [true, false, false, false, true, false, false, false];
this.rAmounts = [900, 999999, 0, 0, 900, 99999, 99999, 999999];
this.disables = ["", "Defense", "CoalPlant", "WindPlant", "GasPlant", "NuclearPlant", "GeoPlant", "SolarPlant", "NatGas", "Electric", "Ethanol", "Lab", "Factory", "Defenses", "PowerPlant", "Farm", "Mine", "OilGasWell", "NuclearDump", "RecyclingCenter", "LandFill", "Engineer", "TeslaCoil", "FlameTurret", "GunTurret", "FloodLights", "Demolish"];
this.energyDefecits = false;
this.foodDefecits = false;
this.tutorialMode = true;
this.levelBonus = 1000;
switch (this.difficulty) {
case K.DIFF_EASY :
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_HARD :
}
};
} else {
// unexpected jump
}
_local2.level2 = function () {
this.titleName = "CHAPTER 2: Get Juiced!";
this.energyDefecits = true;
this.foodDefecits = false;
this.tutorialMode = true;
this.raidersOn = false;
this.monsterTrucksOn = false;
this.dayPar = 2;
this.myWidth = 42;
this.myHeight = 32;
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.gArray = new Array(16);
this.gArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[2] = new Array(0, 0, 5, 0, 50, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[3] = new Array(0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[5] = new Array(0, 0, 10, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[6] = new Array(0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[7] = new Array(0, 0, 5, 0, 50, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[10] = new Array(0, 0, 10, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[11] = new Array(0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[13] = new Array(0, 0, 5, 0, 50, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[14] = new Array(0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray = [[3, 3, 3, 3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 5], [3, 3, 0, 0, 0, 3, 0, 0, 0, 46, 0, 0, 0, 42, 0, 43, 1, 0, 0, 0, 5], [3, 3, 3, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 5], [3, 3, 3, 3, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 3, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
this.missionTime = [10, 3, 0];
this.noMansLand = [true, false, false, false];
this.hArray = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0]];
this.spawnRate = 3;
this.spawnTicks = 5;
this.increaseRate = 1;
this.increaseTicks = 2;
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.waves = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.disables = new Array();
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.textPortraits = new Array();
this.eventPortraits = new Array();
this.tutorials = new Array();
this.levelBonus = 1500;
this.visibleResources = [true, false, true, false, true, false, true, true];
this.rAmounts = [250, 9999, 0, 0, 250, 0, 300, K.COAL_IN_COALPLANT * 10];
this.disables = ["", "NatGas", "Electric", "Ethanol", "Food", "Research", "Gas", "Lab", "PowerPlant", "GasPlant", "WindPlant", "SolarPlant", "GeoPlant", "NuclearPlant", "Farm", "Mine", "OilGasWell", "NuclearDump", "RecyclingCenter", "TeslaCoil"];
this.conditions[0] = "smog_300";
this.events[0] = "e_u_powerplant";
this.raidersOn = false;
this.monsterTrucksOn = false;
switch (this.difficulty) {
case K.DIFF_EASY :
this.rAmounts[0] = 500;
this.rAmounts[4] = 500;
this.rAmounts[7] = K.COAL_IN_COALPLANT * 20;
this.missionTime = [15, 2, 0];
this.levelBonus = 500;
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_HARD :
this.rAmounts[7] = K.COAL_IN_COALPLANT * 5;
this.rAmounts[6] = 50;
this.missionTime = [7, 4, 0];
this.spawnRate = 4;
this.spawnTicks = 3;
this.increaseRate = 1;
this.increaseTicks = 2;
this.noMansLand = [true, false, true, true];
(this.pArray[7] = [3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 5]);
(this.pArray[8] = [3, 3, 0, 0, 0, 3, 0, 0, 0, 46, 0, 0, 0, 42, 0, 43, 1, 0, 0, 0, 5]);
(this.pArray[9] = [3, 3, 3, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 5]);
(this.levelBonus = 3000);
break;
case K.DIFF_IMPOSSIBLE :
this.rAmounts[7] = K.COAL_IN_COALPLANT * 5;
this.rAmounts[6] = 7;
this.missionTime = [7, 5, 0];
this.spawnRate = 3;
this.spawnTicks = 2;
this.increaseRate = 1;
this.increaseTicks = 2;
this.noMansLand = [true, true, true, true];
(this.pArray[7] = [3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 5, 0]);
(this.pArray[8] = [3, 3, 0, 0, 0, 3, 0, 0, 0, 46, 0, 0, 0, 42, 0, 43, 1, 0, 0, 5, 0]);
(this.pArray[9] = [3, 3, 3, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 5, 0]);
(this.levelBonus = 3000);
}
var _local2 = 0;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Can anyone hear me? This is Dr. Ananastasia Wurstwagen, from the New Texas Advanced Research Center!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Copy that, Doctor! This is Ralph Remington, Nuclear Engineer. Welcome to New Houston - or what's left of it. ";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Howdy, Ralph. What's your situation?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "It's not good, Doctor. We've been guarding these coal deposits from bandits...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "...and now these weird zombie things started showing up! We're trapped!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstagen";
this.texts[_local2] = "We'll have to work together if we want to surv-";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Doctor! What's that behind you?";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Oh no! They're here! Quick, boys, man those turrets!";
this.objectives[_local2] = "Live to see tomorrow!";
this.actions[_local2] = "";
this.tutorials[_local2] = "flameturret";
this.objInfo[_local2] = "morning_survive";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Doctor! Are you alright?";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "I'm fine, Ralph. Who left that garbage out there?";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
switch (this.difficulty) {
case K.DIFF_IMPOSSIBLE :
case K.DIFF_HARD :
this.actions[_local2] = "multi";
this.texts[_local2] = "I'm fine, Ralph. We came to bring you some resources! Now, who left that garbage out there?";
this.multiActions[_local2] = new Array("givemetal", "giveenergy", "giveenergy", "giveenergy", "giveoil", "talk");
}
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Probably the bandits - they like to just dump their waste. We'd better clean up those spills!";
this.objectives[_local2] = "Build Engineers";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "To build engineers, select a factory. Then, select ''Engineer'' from the context menu.";
this.tutorials[_local2] = "engineers";
this.objectives[_local2] = "Build Engineers";
this.objInfo[_local2] = "u_engineer_01";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Cleanup crew is on its way! The monsters like to spawn in garbage spills...";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Garbage is dangerous! If it piles up, it will pollute the ground, producing a zombie spawning ground.";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "warn_garbage";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Yeah - gross. Those critters will be back tonight, I'm sure, we need ENERGY...";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Well, we'll make do with what we've got - coal. Let's build some mines.";
this.objectives[_local2] = "Build a Coal Mine";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_Mine", "e_CoalMine", "talk");
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Coal power is cheap and robust, but very dirty. Coal plants produce smog, and coal mines produce lots of garbage.";
this.objectives[_local2] = "Build a Coal Mine";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_Mine", "e_CoalMine", "talk");
this.tutorials[_local2] = "coal";
this.objInfo[_local2] = "b_coalmine_01";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Good job. Now, build a second coal-fired power plant!";
this.objectives[_local2] = "Build a Coal Plant";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_PowerPlant", "talk");
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "powerplant";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Power plants are the backbone of our economy. They produce energy, but most of them have some kind of environmental downside.";
this.objectives[_local2] = "Build a Coal Plant";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_PowerPlant");
this.objInfo[_local2] = "b_coalplant_02";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "*Cough* *Cough* - Man, what's with the air?";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "That's the downside to coal - it puts out a lot of smog. We should really look into ways to fix that...";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "As smog increases, incoming zombies become stronger. Too much smog makes them nearly invincible.";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "warn_smog";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Awww... can't we just put up some air fresheners or something?";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "I've got a better idea, Ralph. How's about you build me a LAB?";
this.objectives[_local2] = "Build a Laboratory";
this.actions[_local2] = "multi";
this.objInfo[_local2] = "b_lab_01";
this.multiActions[_local2] = new Array("e_Lab", "talk");
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Labs consume energy and produce research points, which you can use to purchase upgrades.";
this.objectives[_local2] = "Build a Laboratory";
this.actions[_local2] = "e_Lab";
this.tutorials[_local2] = "lab";
this.objInfo[_local2] = "b_lab_01";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Lab's ready, Doctor.";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Excellent work. When we've done enough research, we can upgrade our coal plants. This will boost output AND lower emissions.";
this.objectives[_local2] = "Produce 100 research";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_Research", "talk");
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "You can hold down spacebar to build more than one of the same building. Build more labs for more research!";
this.objectives[_local2] = "Produce 100 research";
this.actions[_local2] = "e_Research";
this.tutorials[_local2] = "multilab";
this.objInfo[_local2] = "r_research_100";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Okay! I think we're on the verge of a breaktrough. Go ahead and upgrade the coal plants.";
this.objectives[_local2] = "Upgrade Coal Plants";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Upgrading facilities is essential. For power plants, it increases output and lowers emissions. Upgrading a building upgrades ALL buildings of that type.";
this.objectives[_local2] = "Upgrade Coal Plants";
this.actions[_local2] = "";
this.tutorials[_local2] = "upgrade";
this.objInfo[_local2] = "up_coalplant";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Good job! Our base should be able to run for a while longer like this...";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Um, Doctor, you didn't bring any FOOD with you, did you...?";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "No, we used up our last food stores before we left...";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Well, we appreciate you coming here to save our butts and all, but with your personell added to ours, we're going to need to find some more food or all starve to death... I'm just saying.";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Right you are... I think I saw some good, fertile soil on our way here... we should send out an expedition.";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Sounds good to me. Here, let's juice up these batteries so we'll have something to set up camp with when we get there.";
this.objectives[_local2] = "Produce 500 energy";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "r_energy_500";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "That should do it. Let's get an expedition together and move out first thing tomorrow.";
this.actions[_local2] = "score";
this.objInfo[_local2] = "score";
_local2++;
this.textPortraits[_local2] = "score";
this.texts[_local2] = "";
this.objInfo[_local2] = "victory";
this.objectives[_local2] = "";
this.actions[_local2] = "victory";
};
_local2.level3 = function () {
this.titleName = "CHAPTER 3: Eat Drink, and Blow Stuff Up.";
this.myWidth = 42;
this.myHeight = 32;
this.dayPar = 2;
this.raidersOn = false;
this.monsterTrucksOn = false;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
var _local3 = new Object();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = [[4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5], [4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5], [4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5], [4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5], [0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
this.hArray = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0]];
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.waves = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.disables = new Array();
this.spawnRate = 6;
this.spawnTicks = 2;
this.increaseRate = 1;
this.increaseTicks = 3;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.textPortraits = new Array();
this.eventPortraits = new Array();
this.tutorials = new Array();
this.levelBonus = 2000;
this.visibleResources = [true, true, true, true, true, false, true, true];
this.rAmounts = [750, 25, 0, 0, 0, 0, 35, 15];
this.disables = ["", "Gas", "GasPlant", "WindPlant", "SolarPlant", "RecyclingCenter", "GeoPlant", "NuclearPlant", "OilGasWell", "NuclearDump", "TeslaCoil"];
this.missionTime = [7, 2, 1];
this.noMansLand = [false, false, false, true];
switch (this.difficulty) {
case K.DIFF_EASY :
this.missionTime = [10, 2, 1];
this.rAmounts[6] = 50;
this.rAmounts[7] = 50;
this.levelBonus = 1000;
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_HARD :
this.missionTime = [6, 3, 1];
this.rAmounts[0] = 500;
this.rAmounts[6] = 15;
this.rAmounts[7] = 5;
this.spawnRate = 6;
this.spawnTicks = 2;
this.increaseRate = 2;
this.increaseTicks = 3;
this.noMansLand = [true, true, false, true];
this.levelBonus = 4000;
break;
case K.DIFF_IMPOSSIBLE :
this.missionTime = [5, 4, 1];
this.rAmounts[0] = 350;
this.rAmounts[2] = 150;
this.rAmounts[6] = 15;
this.rAmounts[7] = 5;
this.spawnRate = 1;
this.spawnTicks = 1;
this.increaseRate = 1;
this.increaseTicks = 2;
this.noMansLand = [true, true, true, true];
this.levelBonus = 4000;
}
var _local2 = 0;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Look! Something's growing there! Let's build some farms!";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_farm", "talk");
this.objectives[_local2] = "Build 4 farms";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Building farms on fertile soil yields twice the crops for the same energy input.";
this.actions[_local2] = "e_farm";
this.objectives[_local2] = "Build 4 farms";
this.tutorials[_local2] = "food";
this.objInfo[_local2] = "b_farm_04";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Wow, this tastes way better than fried zombie guts! Our buildings should work better now that they're well fed. Just be sure we always have enough food for all our buildings. I never want to eat zombie again.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Well, now that we've eaten, we'd better get to refilling our stockpiles. We need metal for our bullets. Better mine the metal ore from the rocks.";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_mine", "talk");
this.objectives[_local2] = "Mine 100 metal";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Bullets aren't free! Gun Turrets consume metal, so be sure to stock up on it during the day, because mines don't work at night!";
this.actions[_local2] = "e_mine";
this.objectives[_local2] = "Mine 100 metal";
this.tutorials[_local2] = "bullets";
this.objInfo[_local2] = "r_metal_100";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Dr. Wurstwagen! We've got the metal stockpiled!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "And not a moment too soon - Radar says we've got hostiles just a few miles out! Quick, get some turrets in place!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Roger that, Doctor! It's best to have several kinds of defenses, in case we run out of one source of ammo.";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("talk", "e_Defense");
this.objectives[_local2] = "Prepare Defense!";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Each defensive building consumes a different resource: \n1) Gun Turrets : Metal \n 2) Flood Lights : Energy \n 3) Flame Turrets : Oil or Natural Gas. \n";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("time_002", "e_Defense");
this.objectives[_local2] = "Prepare Defense!";
this.waves[_local2] = 10;
this.tutorials[_local2] = "defenseReview";
this.objInfo[_local2] = "wait_dark";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Lock and load, boys.";
this.actions[_local2] = "spawn";
this.objectives[_local2] = "Survive the zombies";
this.waves[_local2] = 5;
this.objInfo[_local2] = "morning_survive";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "All hostiles have been neutralized, ma'am.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Good work. But they'll be back... We need to set up a sustainable base here, too.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "We'll need oil to bootstrap our economy, and our tanks are low. There's a couple of reservoirs to the southeast we might be able to use...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Roger that. Let's get some wells built.";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_OilGasWell", "talk");
this.objectives[_local2] = "Build an oil well";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Oil is mainly used for gasoline fuel and flame turrets. It's got great gas mileage, but produces smog. Also, it's not renewable - once your oil fields run dry, it's gone";
this.actions[_local2] = "e_OilGasWell";
this.tutorials[_local2] = "oilwell";
this.objectives[_local2] = "Build an oil well";
this.objInfo[_local2] = "b_oilgaswell_01";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Alright, now we just need to stockpile some of this...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Hey, boss! There's something else here too! I'm getting gas!";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Thanks for sharing...";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "No, like - the natural kind. Well - er - the OTHER natural kind. Natural gas!";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "That's great! Maybe we can use it for energy...It should burn cleaner than fossil fuels. Let's build a natural gas plant!";
this.objectives[_local2] = "Build nat'l gas plant.";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_GasPlant", "e_PowerPlant", "e_Gas", "talk");
this.tutorials[_local2] = "naturalgas";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Natural Gas can be used to fuel power plants that emit much less smog than coal, with slightly less energy output. Natural Gas is the cleanest fossil fuel.";
this.objectives[_local2] = "Build a natural gas plant.";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("e_GasPlant", "e_PowerPlant", "e_Gas");
this.tutorials[_local2] = "naturalgas";
this.objInfo[_local2] = "b_gasPlant_01";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Man, this stuff is great! What a fabulous alternative to coal!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "You know what? I bet we could totally use this as fuel for our vehicles if we could only condense it into liquid form...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Sounds like a research project! We should build some labs and get our tech-heads right on it!";
this.objectives[_local2] = "Upgrade N.Gas Fuel";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("talk", "e_NatGas");
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "To upgrade your fuel, select a vehicle, and hit the big green ''Upgrade'' Button. Then, choose the fuel you want to upgrade. Upgrading fuels increases their mileage, which improves efficiency and reduces emissions.";
this.objectives[_local2] = "Upgrade to N.Gas Fuel";
this.objInfo[_local2] = "up_f_natgas";
this.tutorials[_local2] = "upgrade_fuel";
this.actions[_local2] = "e_NatGas";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Awesome. Now we have an alternative to gasoline... if we research more, we can try out other kinds, too...";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Click on a vehicle, and if you've researched new fuel types, you can select them. Changing the fuel type of one vehicle changes EVERY vehicle, Garbage Trucks & Engineers.";
this.objectives[_local2] = "";
this.tutorials[_local2] = "alternative_fuel";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Good job, everyone. Let's try to stockpile as much food as we can, and then return to New Houston.";
this.objectives[_local2] = "Produce 100 food";
this.objInfo[_local2] = "r_food_100";
this.actions[_local2] = "";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Awesome, we're swimming in grain. Man, it's great not to be on the edge of starvation anymore!";
this.objInfo[_local2] = "score";
this.actions[_local2] = "score";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "score";
this.texts[_local2] = "";
this.objInfo[_local2] = "victory";
this.objectives[_local2] = "";
this.actions[_local2] = "victory";
};
// unexpected jump
// unexpected jump
_local2.level4 = function () {
this.titleName = "CHAPTER 4: Remember New Houston!";
this.myWidth = 42;
this.myHeight = 32;
this.dayPar = 3;
this.raidersOn = false;
this.monsterTrucksOn = false;
this.energyDefecits = true;
this.foodDefecits = false;
this.tutorialMode = true;
this.gArray = new Array();
var _local3 = new Object();
this.freeTrucks = 1;
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.gArray = new Array(16);
this.gArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, 150);
this.gArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 0, 150, 125, 0, 150);
this.gArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, 150);
this.gArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray = [[3, 3, 3, 3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 0, 3, 0, 3, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 0, 4, 20, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5], [3, 3, 0, 0, 0, 3, 4, 0, 0, 46, 0, 0, 0, 42, 0, 0, 1, 0, 0, 0, 5], [3, 3, 3, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5], [3, 3, 3, 3, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 3, 3, 3, 3, 3, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
this.missionTime = [10, 2, 0];
this.noMansLand = [true, false, false, false];
this.hArray = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0]];
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.waves = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.disables = new Array();
this.spawnRate = 5;
this.spawnTicks = 1;
this.increaseRate = 1;
this.increaseTicks = 2;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.textPortraits = new Array();
this.eventPortraits = new Array();
this.tutorials = new Array();
this.levelBonus = 2000;
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = [700, 500, 250, 0, 150, 25, 50, 8];
this.disables = ["", "WindPlant", "SolarPlant", "GeoPlant", "NuclearPlant", "RecyclingCenter", "NuclearDump", "TeslaCoil"];
this.missionTime = [6, 3, 1];
this.noMansLand = [true, false, false, false];
switch (this.difficulty) {
case K.DIFF_EASY :
this.rAmounts[0] = 900;
this.rAmounts[2] = 150;
this.rAmounts[4] = 300;
this.rAmounts[5] = 50;
this.rAmounts[6] = 100;
this.rAmounts[7] = 25;
this.missionTime = [10, 2, 1];
this.gArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 200);
this.gArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, 200, 150, 0, 200);
this.gArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 200);
this.gArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.levelBonus = 1000;
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_HARD :
this.rAmounts[0] = 500;
this.rAmounts[2] = 300;
this.rAmounts[4] = 100;
this.rAmounts[5] = 15;
this.rAmounts[6] = 25;
this.rAmounts[7] = 4;
this.missionTime = [6, 3, 1];
this.noMansLand = [true, false, true, true];
this.spawnRate = 7;
this.spawnTicks = 1;
this.increaseRate = 1;
this.increaseTicks = 2;
this.gArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, 0, 300);
this.gArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 300, 200, 0, 300);
this.gArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, 0, 300);
this.gArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[6] = [3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
this.pArray[7] = [3, 3, 3, 3, 0, 0, 20, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5];
this.pArray[8] = [3, 3, 0, 0, 0, 3, 0, 0, 0, 46, 0, 0, 0, 42, 0, 0, 1, 0, 0, 0, 5];
this.levelBonus = 4000;
break;
case K.DIFF_IMPOSSIBLE :
this.rAmounts[0] = 350;
this.rAmounts[2] = 350;
this.rAmounts[4] = 75;
this.rAmounts[5] = 10;
this.rAmounts[6] = 10;
this.rAmounts[7] = 0;
this.missionTime = [6, 4, 1];
this.noMansLand = [true, false, true, true];
this.spawnRate = 5;
this.spawnTicks = 1;
this.increaseRate = 1;
this.increaseTicks = 1;
this.gArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, 0, 300);
this.gArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 300, 200, 0, 300);
this.gArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, 0, 300);
this.gArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[6] = [3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
this.pArray[7] = [3, 3, 3, 3, 0, 0, 20, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5];
this.pArray[8] = [3, 3, 0, 0, 0, 3, 0, 0, 0, 46, 0, 0, 0, 42, 0, 0, 1, 0, 0, 0, 5];
this.levelBonus = 4000;
}
var _local2 = 0;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Home Sweet Home! Well, my fellow New Houstonians... what the...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...Ralph... New Houston... it's totally trashed. What happened here?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Is anyone there! Can anyone hear me? Please tell me someone is still alive!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "Is that you, Ralph? The last of us are holed up in the fortress! Thank God you're here!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "What happened here? This is crazy! Everything's destroyed! ...Who did this?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "It was the bandits, Ralph... they had guns! And humvees! We've never seen anything like it... They were desperate... they took everything!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "I should have never left you here... this is all my fault...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "We're starving, Ralph... with your food and supplies we might still have a chance...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Our scouts just located a hidden mine to the west we didn't notice before... we can use it to get some metal...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "That's great, Doctor, but our first priority is to get power online... we're out of coal and gas...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Well, I've managed to save some blueprints... Those hills of yours look like the perfect place for some wind turbines!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "Build 4 Wind Plants";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Wind power puts out a low amount of energy, but produces NO emissions. The output fluctuates with the wind, which is stronger during the day. High altitude has better wind speeds.";
this.actions[_local2] = "e_windPlant";
this.objectives[_local2] = "Build 4 Wind Plants";
this.objInfo[_local2] = "b_windPlant_04";
this.tutorials[_local2] = "wind_power";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "It's a good start... let's build a solar plant, too!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "Build a Solar Plant";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Solar power puts out a low amount of energy, but produces NO emissions. Solar power obviously doesn't work at night.";
this.actions[_local2] = "e_solarPlant";
this.objectives[_local2] = "Build a Solar Plant";
this.objInfo[_local2] = "b_solarPlant_01";
this.tutorials[_local2] = "solar_power";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Way to go! 'Hard pressed, but not destroyed!' We'll honor the fallen, rise from the ashes, and kick some zombie butt. New Houston won't go down without a fight!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Just remember... the weather changes over time! Solar and Wind power are dependent on the fickleness of wind and sun.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "weather";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "Ralph! We just got the radar back online... looks like we've got hostiles enroute!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Is it the bandits? Or those zombie things?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "I've no idea... they'll be here soon, though";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "I'm putting out a distress call... maybe someone will hear us! Transmitting Now!";
this.actions[_local2] = "time_004";
this.objectives[_local2] = "Prepare Defenses!";
this.objInfo[_local2] = "wait_dark";
this.tutorials[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Here they come, boys! ....Wait a minute, what the-?!?";
this.objInfo[_local2] = "morning_survive";
this.objectives[_local2] = "Survive the zombies";
this.tutorials[_local2] = "";
this.waves[_local2] = 5;
this.actions[_local2] = "spawn_raider";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "What on Earth were those things?";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "I recognized those vehicles... those... things - USED to be the bandits...";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Did the zombies eat them? Or fuse with them? Or...";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "I have no idea, Doctor. All I know is that now the zombies have a bit more firepower...I noticed they were stealing resources, too...";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "Ralph! We're getting a transmission! Patching it through!";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "This is Colonel Tyrone Roosevelt, of the New Texas Survivor's Army! Do you copy?";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Copy that, Colonel! Sure is good to hear your voice.";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "We got your distress call. We're about 300 miles out of your position, care to rendezvous?";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Things might be looking up. Let's get New Houston up and running and see if we can't meet up with him.";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "I wonder if we can't harvest some resources from all this trash...";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "I've got it! Let's build a recycling center!";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Recycling Centers turn trash back into resources. Metal, Energy, and Natural Gas can all be recycled from trash.";
this.objInfo[_local2] = "b_RecyclingCenter_01";
this.objectives[_local2] = "Build a Recycling Center";
this.actions[_local2] = "e_RecyclingCenter";
this.tutorials[_local2] = "recycling_1";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "One man's trash is another man's treasure, they say...";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "I'll say. It seems some kinds of trash are more recyclable than others...";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "recycling_2";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "You know, if we research some, I bet we can upgrade this recycling center...";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Good idea! Upgraded recycling centers can produce energy from \"useful\" garbage and natural gas from organic waste!";
this.objInfo[_local2] = "up_RecyclingCenter";
this.objectives[_local2] = "Upgrade Recycling Center";
this.actions[_local2] = "talk";
this.tutorials[_local2] = "recycling_2";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Ralph... I have some interesting news! We've discovered Uranium in that old mine! More than we could ever need!";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Before the cataclysm, I worked as a Nuclear Engineer... are you thinking what I'm thinking?";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "I am... can you build us a nuclear power plant?";
this.objInfo[_local2] = "b_nuclearPlant_01";
this.objectives[_local2] = "Build a Nuclear PLANT";
this.actions[_local2] = "e_nuclearPlant";
this.tutorials[_local2] = "power_nuclear";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Alright, plant's done - this'll produce MOSTLY clean energy with zero smog... there's just a catch...";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "A catch?";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Yes, although the amount of fuel a Nuclear Plant consumes is negligible (compared to Coal and Natural Gas plants), and even though they emit zero smog, they produce Nuclear Waste. You have to put that somewhere.";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "It's dangerous, right?";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Yes, if the enemy gets a hold of nuclear waste, we are in a BAD situation. But emitting smog from Coal plants is likely to be much, much more dangerous.";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "SO! Build a Nuclear Waste Dump, and then DEFEND it. Who knows what'll happen if the raiders cart it away...";
this.objInfo[_local2] = "b_nuclearDump_01";
this.objectives[_local2] = "Build a Nuclear DUMP";
this.actions[_local2] = "e_NuclearDump";
this.tutorials[_local2] = "power_nuclear";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "And just for the record, we'll need some engineers to handle the stuff safely.";
this.objInfo[_local2] = "u_engineer_01";
this.objectives[_local2] = "Build an engineer";
this.actions[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Now let's see if we can crank out some juice here. We're going to need lots of power to fund our next journey";
this.objInfo[_local2] = "r_energy_500";
this.objectives[_local2] = "Produce 500 energy";
this.actions[_local2] = "";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Colonel Roosevelt? This is Dr. Wurstwagen! We're on our way!";
this.objInfo[_local2] = "talk";
this.objectives[_local2] = "";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Roger that, Doctor. Stay frosty and get here alive!";
this.objInfo[_local2] = "score";
this.actions[_local2] = "score";
_local2++;
this.textPortraits[_local2] = "score";
this.texts[_local2] = "";
this.objInfo[_local2] = "victory";
this.objectives[_local2] = "";
this.actions[_local2] = "victory";
};
// unexpected jump
// unexpected jump
_local2.level5 = function () {
this.titleName = "CHAPTER 5: It's getting hot in here....";
this.myWidth = 42;
this.myHeight = 32;
this.dayPar = 3;
this.raidersOn = true;
this.monsterTrucksOn = true;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 0, 4, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0);
this.pArray[7] = new Array(0, 0, 4, 4, 9, 10, 9, 13, 40, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0);
this.pArray[8] = new Array(0, 0, 4, 0, 9, 9, 9, 0, 44, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 4, 0, 0, 0, 42, 0, 1, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0);
this.pArray[10] = new Array(0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 4, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.levelBonus = 2000;
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = [500, 10, 100, 0, 100, 25, 25, 25];
this.disables = ["TeslaCoil"];
this.missionTime = [8, 3, false];
this.noMansLand = [true, true, false, true];
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.waves = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.disables = new Array();
this.spawnRate = 5;
this.spawnTicks = 2;
this.increaseRate = 1;
this.increaseTicks = 100;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.textPortraits = new Array();
this.eventPortraits = new Array();
this.tutorials = new Array();
switch (this.difficulty) {
case K.DIFF_EASY :
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_HARD :
this.rAmounts[0] = 350;
this.rAmounts[1] = 5;
this.rAmounts[2] = 150;
this.rAmounts[3] = 0;
this.rAmounts[4] = 50;
this.rAmounts[6] = 10;
this.rAmounts[7] = 10;
this.rAmounts[8] = 10;
this.spawnRate = 7;
this.spawnTicks = 2;
this.increaseRate = 1;
this.increaseTicks = 100;
this.missionTime = [7, 4, false];
this.noMansLand = [true, true, true, true];
this.levelBonus = 4000;
break;
case K.DIFF_IMPOSSIBLE :
this.rAmounts[0] = 350;
this.rAmounts[1] = 5;
this.rAmounts[2] = 325;
this.rAmounts[3] = 0;
this.rAmounts[4] = 50;
this.rAmounts[6] = 10;
this.rAmounts[7] = 10;
this.rAmounts[8] = 10;
this.spawnRate = 10;
this.spawnTicks = 1;
this.increaseRate = 5;
this.increaseTicks = 10;
this.missionTime = [5, 6, false];
this.noMansLand = [true, true, true, true];
this.levelBonus = 4000;
}
var _local2 = 0;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Hey, it looks like this town is under attack!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "Eat hot electric death, zombie scum!!!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Citizens! That coal plant of yours is putting out deadly amounts of smog! The zombies will have you for sure!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "No wonder... we'll try to shut it off!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "disable";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Hang on, guys! Doctor! Let's help them build defenses!";
this.actions[_local2] = "";
this.objectives[_local2] = "Survive the zombies";
this.objInfo[_local2] = "morning_survive";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "Welcome to New Thermopalyae, strangers! Friendly faces are a sight for sore eyes...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Happy to help. What was that defense structure of yours?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "That's our state-of-the-art, super deluxe Tesla Coil! Don't leave home without one!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.tutorials[_local2] = "teslacoil";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Doctor! I just got off the radio with NEW New Houston... seems like they're doing well...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Yeah, we'll be on the watch for those mutant raiders from now on... ";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Hey, what are those cracks in the ground?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Those are areas of geothermal activity. We can build geothermal power plants there!";
this.actions[_local2] = "e_GeoPlant";
this.objectives[_local2] = "Build a Geo. plant";
this.objInfo[_local2] = "b_GeoPlant_01";
this.tutorials[_local2] = "geothermal";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "We can build these anywhere that there's craters, but they'll be best if we build them directly on the main pit. Cap each one of the main pits with a Geothermal Power Plant.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "I'm going to set up radio communications and try to contact Colonel Roosevelt. This will take a while... you keep us alive!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "Survive 3 days!";
this.objInfo[_local2] = "survive_day";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Come in, Colonel! Come in!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "I hear you, Doctor! I've sent a squad down to meet up with you near New Thermopylae. They should be there in 2 days to escort you up here!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "We'll hold down the fort! Get here soon! These zombies are getting fiercer every day!";
this.actions[_local2] = "";
this.objectives[_local2] = "Survive 2 days!";
this.objInfo[_local2] = "survive_day";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "The squad's almost there, Doctor. Hold out just a little longer!";
this.actions[_local2] = "";
this.objectives[_local2] = "Survive 1 day!";
this.objInfo[_local2] = "survive_day";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Look! There's a convoy on the horizon! We're saved!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Good work, y'all. Welcome to the New Texas Survivor's Army!";
this.actions[_local2] = "score";
this.objInfo[_local2] = "score";
_local2++;
this.textPortraits[_local2] = "score";
this.texts[_local2] = "";
this.objInfo[_local2] = "victory";
this.objectives[_local2] = "";
this.actions[_local2] = "victory";
};
_local2.level6 = function () {
this.titleName = "CHAPTER 6: Rallying the troops.";
this.myWidth = 42;
this.myHeight = 32;
this.dayPar = 4;
this.raidersOn = true;
this.monsterTrucksOn = true;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[3] = new Array(0, 0, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[4] = new Array(0, 0, 0, 0, 13, 12, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 5, 0, 9, 9, 9, 0, 0, 0, 4, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 9, 10, 9, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 9, 9, 9, 0, 0, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 9, 10, 9, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 9, 9, 9, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.levelBonus = 2500;
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = [400, 50, 250, 0, 50, 35, 10, 15];
this.disables = [];
this.missionTime = [9, 3, true];
this.noMansLand = [false, true, false, true];
this.spawnRate = 10;
this.spawnTicks = 3;
this.increaseRate = 1;
this.increaseTicks = 1;
switch (this.difficulty) {
case K.DIFF_EASY :
this.rAmounts[0] = 800;
this.rAmounts[1] = 100;
this.rAmounts[2] = 100;
this.rAmounts[4] = 100;
this.rAmounts[5] = 70;
this.rAmounts[6] = 25;
this.rAmounts[7] = 30;
this.missionTime = [10, 2, true];
this.levelBonus = 1500;
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_HARD :
this.pArray[3] = new Array(0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 4, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 3, 9, 3, 0, 0, 3, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 9, 3, 9, 0, 0, 9, 3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 3, 9, 3, 0, 0, 3, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.rAmounts[0] = 250;
this.rAmounts[1] = 25;
this.rAmounts[2] = 350;
this.rAmounts[4] = 25;
this.rAmounts[5] = 15;
this.rAmounts[6] = 5;
this.rAmounts[7] = 5;
this.missionTime = [8, 4, true];
this.spawnRate = 15;
this.spawnTicks = 3;
this.increaseRate = 1;
this.increaseTicks = 1;
this.levelBonus = 5000;
break;
case K.DIFF_IMPOSSIBLE :
this.pArray[3] = new Array(0, 0, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 4, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(3, 3, 9, 3, 3, 3, 3, 9, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(3, 9, 9, 9, 3, 3, 9, 9, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(3, 3, 9, 3, 3, 3, 3, 9, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.rAmounts[0] = 250;
this.rAmounts[1] = 25;
this.rAmounts[2] = 350;
this.rAmounts[4] = 25;
this.rAmounts[5] = 15;
this.rAmounts[6] = 5;
this.rAmounts[7] = 5;
this.missionTime = [7, 4, true];
this.spawnRate = 15;
this.spawnTicks = 1;
this.increaseRate = 2;
this.increaseTicks = 1;
this.levelBonus = 4000;
}
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.waves = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.disables = new Array();
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.textPortraits = new Array();
this.eventPortraits = new Array();
this.tutorials = new Array();
var _local2 = 0;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "So, as you can see, there are a good number of us who survived the crisis. We hope to re-establish government, police, security, and of course defense from the monsters...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Do you have any idea where they came from?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "We have no idea whatsoever about where they came from - one thing we do know : they are out-adapting us..";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Out-adapting?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "They reproduce incredibly quickly, like bacteria. They've quickly grown used to the changed environment. In short, our pollution is their paradise...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "We've noticed that... have you had any contact with the rest of the world?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "That's what the internet was originally designed for, a crisis like this. These creatures have been reported on every continent, and they're spreading fast...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "What are we going to do???";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Trust me, I've got a plan, to save New Texas at least... but first things first. This base here is going to be our permanent headquarters.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Start building this base up. The zombies have our scent and will be here tonight. I'll be planning our strike with my Lieutenants.";
this.actions[_local2] = "";
this.objectives[_local2] = "Survive 3 days!";
this.objInfo[_local2] = "survive_day";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Good job, boys! Keep it up! The colonel's still trying to get a hold of the officers!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "Survive 2 days!";
this.objInfo[_local2] = "survive_day";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Colonel! How's it going?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Just fine, Doctor! We've got a plan to take the fight to the zombies! Keep the base alive while the army rendezvous with us!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "Survive 1 day!";
this.objInfo[_local2] = "survive_day";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Colonel! They're here! I see trucks on the horizon!";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "army";
this.texts[_local2] = "We're here, Colonel. Shall we tell them the plan?";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Here's the plan, everybody. We've found the chemical in garbage that attracts the zombies. Now that we have enough firepower, we will bait them into a trap and take them out once and for all.";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "You can't bait them here! You'll put too many civilians at risk!";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "You're absolutely right. Which is why we won't HAVE any civilians here. You, Ralph, and the civilians are going to New Thermopalyae and hunker down there.";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "What are you talking about? I want to fight!";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "You're an engineer, Ralph, not a soldier. I respect your courage but it would be better put to use in protecting these civilians.";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "But....!";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Remember New Houston, Ralph...";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Don't worry - I just radioed ahead. New Thermopalyae is doing just fine and will have plenty of supplies for you.";
this.actions[_local2] = "talk";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "...you're right. They need us. May God be with you, Colonel.";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "And may He also be with you, my friend.";
this.actions[_local2] = "score";
this.objInfo[_local2] = "score";
_local2++;
this.textPortraits[_local2] = "score";
this.texts[_local2] = "";
this.objInfo[_local2] = "victory";
this.actions[_local2] = "victory";
};
// unexpected jump
// unexpected jump
_local2.level7 = function () {
this.titleName = "CHAPTER 7: The best laid plans....";
this.myWidth = 42;
this.myHeight = 32;
this.dayPar = 3;
this.raidersOn = true;
this.monsterTrucksOn = true;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array(16);
this.gArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[1] = new Array(0, 0, 0, -99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[2] = new Array(0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0);
this.gArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[4] = new Array(0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0);
this.gArray[5] = new Array(0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 125, 0, 0, 0, 0, 10, 0, 0, 0);
this.gArray[6] = new Array(0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -99, 0, 0, 0);
this.gArray[7] = new Array(0, 0, 45, 10, 0, 0, 0, 0, 0, 0, 0, 0, -99, 0, 0, 0, 0, 10, 0, 0, 0);
this.gArray[8] = new Array(0, 0, -99, 0, 0, 125, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0);
this.gArray[9] = new Array(0, 0, 0, 0, 0, 0, 125, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0);
this.gArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0);
this.gArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
this.gArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
this.gArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 0, 4, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0);
this.pArray[7] = new Array(0, 0, 4, 4, 9, 10, 9, 13, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0);
this.pArray[8] = new Array(0, 0, 4, 0, 9, 9, 9, 0, 45, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0);
this.pArray[10] = new Array(0, 0, 4, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 4, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.levelBonus = 500;
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = [700, 100, 200, 0, 500, 25, 25, 25];
this.disables = [];
this.missionTime = [8, 3, false];
this.noMansLand = [true, true, false, true];
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.waves = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.disables = new Array();
this.spawnRate = 3;
this.spawnTicks = 4;
this.increaseRate = 1;
this.increaseTicks = 3;
switch (this.difficulty) {
case K.DIFF_EASY :
this.rAmounts[1] = 200;
this.rAmounts[2] = 100;
this.rAmounts[3] = 50;
this.rAmounts[4] = 700;
this.rAmounts[5] = 50;
this.rAmounts[6] = 50;
this.rAmounts[7] = 50;
this.gArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[2] = new Array(0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0);
this.gArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0);
this.gArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 5, 0, 0, 0);
this.gArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[7] = new Array(0, 0, 25, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0);
this.gArray[8] = new Array(0, 0, 0, 0, 0, 50, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[9] = new Array(0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.gArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0);
this.gArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
this.gArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
this.gArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.missionTime = [10, 3, false];
this.noMansLand = [true, true, false, false];
this.levelBonus = 250;
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_HARD :
this.rAmounts[0] = 500;
this.rAmounts[1] = 50;
this.rAmounts[2] = 350;
this.rAmounts[4] = 250;
this.rAmounts[5] = 10;
this.rAmounts[6] = 10;
this.rAmounts[7] = 10;
this.spawnRate = 5;
this.spawnTicks = 4;
this.increaseRate = 2;
this.increaseTicks = 4;
this.missionTime = [7, 4, false];
this.noMansLand = [true, true, true, true];
this.levelBonus = 1000;
break;
case K.DIFF_IMPOSSIBLE :
this.rAmounts[0] = 500;
this.rAmounts[1] = 50;
this.rAmounts[2] = 350;
this.rAmounts[4] = 250;
this.rAmounts[5] = 10;
this.rAmounts[6] = 10;
this.rAmounts[7] = 10;
this.spawnRate = 10;
this.spawnTicks = 2;
this.increaseRate = 5;
this.increaseTicks = 2;
this.missionTime = [5, 5, false];
this.noMansLand = [true, true, true, true];
this.levelBonus = 1000;
}
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.textPortraits = new Array();
this.eventPortraits = new Array();
this.tutorials = new Array();
var _local2 = 0;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "New Thermopalyae! Come in! This is Ralph Remington with the New Texas Survivor's Army... what can we do for you?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "New Thermopalyae here. We are fine. Everything is fine and nothing is ruined. You can go home now.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Um....'kay. What's going on? You sound different...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "We do not sound different. We sound fine. Because we are fine. Because everything is fine. We need no help. Please go away now.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Doctor... look at the base! Something is seriously wrong here!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress_fake";
this.texts[_local2] = "Nothing is seriously wrong. Everything is seriously fine.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "!!! Ralph! I think the zombies are using the radio frequency somehow!!!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "The jig is up, zombie scum! Time to pay for what you did to New Thermopalyae!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "swarm";
this.texts[_local2] = "The jig is not up. We are human beings with soft hair and smooth skin. Come, we are inviting you to a party. There will be ice cream and mountain dew.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "Survive the zombies!";
this.objInfo[_local2] = "morning_survive";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Anyone still here? Anyone alive?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "We're here, Doctor. Not many of us left...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "What happened? We called on the radio-";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "Those zombie things - they're telepathic.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "I don't believe in telepathy.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "fortress";
this.texts[_local2] = "But you believe in RADIO, right? Same difference. They communicate by transmitting and receiving light radiation, including the spectrum we humans call \"radio\".";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "That means... they've been listening to us this whole time! They know our language! And they've been tracking our movements! That means... these things are INTELLIGENT! Sentient!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "And you're EXCITED about this?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Ralph, if they're sentient, that means they can be reasoned with! And they already speak our language! We might be able to broker some kind of agreement with them!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Forgive my skepticism, but I think we'll have to clean up this base and hold down the fort before we start working out a peace treaty...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "I'm going to try to make contact with them! Maybe they're not all of one mind... transmitting now!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "I sure hope you know what you're doing, Doctor, in the meanwhile, I think we should get power back online...";
this.actions[_local2] = "";
this.objectives[_local2] = "Produce 900 energy";
this.objInfo[_local2] = "r_energy_900";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "These guys just keep coming, I don't think we'll be safe here for long - we need an evacuation plan...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Right you are. Let's build a fleet to get the civilians out of here";
this.actions[_local2] = "";
this.objectives[_local2] = "Produce 15 vehicles";
this.objInfo[_local2] = "u_vehicle_15";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "...Um, Doctor - something's on the Radio. You're gonna want to hear this.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "zral";
this.texts[_local2] = "I am the ZRAL. I received the message of the Wurstwagen. There is much unrest and many think we cannot defeat the humans...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Good to meet you, \"ZRAL.\" There's no need for both of our peoples to die. Can we make some sort of deal?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "zral";
this.texts[_local2] = "I wish it were so. I hold no rank, no authority. They do not know I am transmitting to you. They will kill me if they find me.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Where did you come from? What do you want? If you tell us that much...";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "zral";
this.texts[_local2] = "There is no time! I come to warn you: they are coming. Tell the Roosevelt that the others know of his plan, and will attack your civilians instead.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...they're coming HERE? How many?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "zral";
this.texts[_local2] = "All of them, except a small force to distract the Roosevelt. They consider YOU the real threat, Wurstwagen. They are coming for YOU.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Tell me more, ZRAL! I want to know all about you and your people, there is so much to learn-";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "swarm";
this.texts[_local2] = "The ZRAL? Why you are transmitting!?! Who is receiving? Prepare to receive your justice!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "zral_die";
this.texts[_local2] = "...My time is up, Wurstwagen. I would have loved to have met you. As the Ralph said, \"May God be with you...\"";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...ZRAL? ZRAL! Come in, ZRAL!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "swarm";
this.texts[_local2] = "The ZRAL is no more. And soon, you shall join him.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Let's get out of here, Doctor - we'll fall back to the hills up north...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "score";
this.actions[_local2] = "score";
_local2++;
this.textPortraits[_local2] = "score";
this.texts[_local2] = "";
this.objInfo[_local2] = "victory";
this.objectives[_local2] = "";
this.actions[_local2] = "victory";
};
_local2.level8 = function () {
this.titleName = "CHAPTER 8: It's a trap!";
this.myWidth = 42;
this.myHeight = 32;
this.dayPar = 2;
this.raidersOn = true;
this.monsterTrucksOn = true;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0);
this.pArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0);
this.pArray[3] = new Array(0, 0, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 43, 0);
this.pArray[4] = new Array(0, 0, 0, 44, 13, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0);
this.pArray[5] = new Array(0, 0, 40, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0);
this.pArray[6] = new Array(0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0);
this.pArray[7] = new Array(0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 43, 0);
this.pArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 12, 0, 46, 0, 5, 0, 9, 9, 9, 0, 0, 0, 4, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 9, 10, 9, 43, 43, 43, 43, 0);
this.pArray[11] = new Array(0, 9, 9, 9, 46, 0, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 9, 10, 9, 0, 0, 9, 10, 9, 0, 0, 0, 0, 45, 45, 45, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 9, 9, 9, 0, 0, 9, 9, 9, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 44, 0);
this.pArray[14] = new Array(0, 45, 45, 45, 43, 43, 45, 45, 45, 0, 46, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.levelBonus = 2500;
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = [400, 50, 0, 0, 150, 50, 50, 50];
this.disables = [];
this.missionTime = [13, 3, false];
this.noMansLand = [false, true, false, true];
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.waves = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.disables = new Array();
this.spawnRate = 0;
this.spawnTicks = 100;
this.increaseRate = 0;
this.increaseTicks = 100;
switch (this.difficulty) {
case K.DIFF_EASY :
this.rAmounts[4] = 50;
this.missionTime = [16, 3, false];
this.levelBonus = 1000;
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_HARD :
this.pArray[3] = new Array(0, 0, 1, 0, 0, 2, 0, 2, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 4, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 3, 9, 3, 0, 0, 3, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 9, 3, 9, 0, 0, 9, 3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 3, 9, 3, 0, 0, 3, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.rAmounts[0] = 200;
this.rAmounts[1] = 10;
this.rAmounts[2] = 150;
this.rAmounts[4] = 75;
this.rAmounts[5] = 10;
this.rAmounts[6] = 10;
this.rAmounts[7] = 10;
this.missionTime = [11, 4, false];
this.levelBonus = 5000;
break;
case K.DIFF_IMPOSSIBLE :
this.pArray[3] = new Array(0, 0, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 4, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(3, 3, 9, 3, 3, 3, 3, 9, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(3, 9, 9, 9, 3, 3, 9, 9, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(3, 3, 9, 3, 3, 3, 3, 9, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.rAmounts[0] = 100;
this.rAmounts[1] = 10;
this.rAmounts[2] = 300;
this.rAmounts[4] = 75;
this.rAmounts[5] = 5;
this.rAmounts[6] = 0;
this.rAmounts[7] = 0;
this.missionTime = [7, 5, true];
this.levelBonus = 4000;
}
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.textPortraits = new Array();
this.eventPortraits = new Array();
this.tutorials = new Array();
var _local2 = 0;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Alright, soldiers! The trap is set and it looks like they're falling for it!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Okay, zombie scum! Bring it ON!";
this.actions[_local2] = "spawn";
this.waves[_local2] = 30;
this.objectives[_local2] = "Survive the zombies!";
this.objInfo[_local2] = "survive";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Is that all? I'm just getting warmed up!";
this.actions[_local2] = "spawn";
this.waves[_local2] = 5;
this.objectives[_local2] = "Survive the zombies!";
this.objInfo[_local2] = "survive";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "...something is wrong here...";
this.actions[_local2] = "spawn";
this.waves[_local2] = 1;
this.objectives[_local2] = "Survive the zombies!";
this.objInfo[_local2] = "survive";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "I don't get it... didn't we see them on radar?";
this.actions[_local2] = "force_sunrise";
this.objectives[_local2] = "";
this.objInfo[_local2] = "morning_survive";
_local2++;
this.textPortraits[_local2] = "army";
this.texts[_local2] = "Sir, we're getting a transmission!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Colonel! It's a trap! They've been intercepting our messages!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "What???!?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "The civilians are the target! They're after New Thermopalyae!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "How soon till they get there?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "They're already here! We can hold 'em off for a few days, but we need backup NOW!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "We've been duped, boys. Our citizens are in danger.";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "army";
this.texts[_local2] = "What do we do?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "All hands, get to work! They need a resource shipment! We HAVE to have it ready before night!";
this.actions[_local2] = "multi";
this.multiActions[_local2] = new Array("condition_losenight");
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Natural Gas first! 100 units!";
this.actions[_local2] = "";
this.objectives[_local2] = "Produce 100 Nat'l Gas";
this.objInfo[_local2] = "r_gas_100";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Now, 100 units of metal! They'll need bullets!";
this.actions[_local2] = "";
this.objectives[_local2] = "Produce 100 Metal";
this.objInfo[_local2] = "r_metal_100";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Food! We need 100 units of food!";
this.actions[_local2] = "";
this.objectives[_local2] = "Produce 100 Food";
this.objInfo[_local2] = "r_food_100";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Energy! 250 units!";
this.actions[_local2] = "";
this.objectives[_local2] = "Produce 250 Energy";
this.objInfo[_local2] = "r_energy_250";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Alrighty, pack it up and ship it off!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Now, move out! For New Thermopalyae! For New Texas! For the Human Race!";
this.actions[_local2] = "score";
this.objectives[_local2] = "";
this.objInfo[_local2] = "score";
_local2++;
this.textPortraits[_local2] = "score";
this.texts[_local2] = "";
this.objInfo[_local2] = "victory";
this.actions[_local2] = "victory";
};
// unexpected jump
// unexpected jump
_local2.level9 = function () {
this.titleName = "CHAPTER 9: The Last Stand...";
this.myWidth = 42;
this.myHeight = 32;
this.dayPar = 3;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.raidersOn = true;
this.monsterTrucksOn = true;
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 3, 0, 9, 9, 9, 0);
this.pArray[3] = new Array(0, 0, 9, 0, 3, 3, 0, 3, 4, 3, 0, 3, 0, 3, 0, 3, 3, 9, 10, 9, 0);
this.pArray[4] = new Array(0, 9, 10, 9, 3, 3, 3, 0, 4, 4, 3, 3, 0, 3, 3, 3, 0, 9, 9, 9, 3);
this.pArray[5] = new Array(0, 0, 9, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3);
this.pArray[6] = new Array(0, 3, 3, 3, 3, 3, 0, 3, 3, 3, 44, 3, 3, 3, 0, 3, 0, 3, 3, 3, 3);
this.pArray[7] = new Array(0, 3, 3, 3, 3, 3, 0, 3, 0, 21, 1, 43, 0, 3, 0, 9, 0, 0, 0, 3, 3);
this.pArray[8] = new Array(0, 3, 3, 3, 3, 3, 0, 3, 0, 13, 45, 3, 0, 3, 9, 10, 9, 0, 3, 0, 0);
this.pArray[9] = new Array(0, 3, 3, 3, 0, 9, 0, 3, 3, 3, 3, 3, 3, 3, 0, 9, 0, 0, 3, 0, 0);
this.pArray[10] = new Array(0, 3, 3, 3, 9, 10, 9, 3, 3, 3, 3, 3, 3, 3, 0, 3, 0, 3, 3, 3, 0);
this.pArray[11] = new Array(0, 3, 3, 3, 0, 9, 0, 3, 3, 3, 3, 3, 3, 4, 0, 3, 0, 3, 3, 3, 3);
this.pArray[12] = new Array(0, 3, 3, 0, 0, 3, 0, 3, 3, 3, 3, 3, 4, 4, 3, 0, 3, 3, 3, 3, 3);
this.pArray[13] = new Array(0, 3, 3, 3, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 0, 3, 3, 3, 3, 3, 3);
this.pArray[14] = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.levelBonus = 5000;
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = [300, 50, 0, 0, 100, 25, 10, 20];
this.disables = [];
this.missionTime = [10, 3, false];
this.noMansLand = [false, false, true, true];
this.texts = new Array();
this.objectives = new Array();
this.objInfo = new Array();
this.waves = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.disables = new Array();
this.spawnRate = 4;
this.spawnTicks = 2;
this.increaseRate = 2;
this.increaseTicks = 1;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.textPortraits = new Array();
this.eventPortraits = new Array();
this.tutorials = new Array();
switch (this.difficulty) {
case K.DIFF_EASY :
this.rAmounts[0] = 600;
this.rAmounts[1] = 150;
this.rAmounts[2] = 0;
this.rAmounts[3] = 50;
this.rAmounts[4] = 200;
this.rAmounts[5] = 50;
this.rAmounts[6] = 25;
this.rAmounts[7] = 35;
this.spawnRate = 3;
this.spawnTicks = 3;
this.increaseRate = 1;
this.increaseTicks = 2;
this.missionTime = [10, 3, false];
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 3, 0, 9, 9, 9, 0);
this.pArray[3] = new Array(0, 9, 9, 9, 3, 3, 0, 3, 4, 0, 0, 3, 0, 3, 0, 3, 3, 9, 10, 9, 0);
this.pArray[4] = new Array(0, 9, 10, 9, 3, 0, 3, 0, 4, 4, 2, 2, 2, 3, 3, 3, 0, 9, 9, 9, 3);
this.pArray[5] = new Array(0, 9, 9, 9, 3, 3, 0, 0, 2, 2, 2, 2, 2, 0, 0, 3, 3, 3, 3, 3, 3);
this.pArray[6] = new Array(0, 3, 3, 3, 3, 0, 0, 0, 3, 3, 44, 2, 3, 0, 0, 3, 0, 5, 3, 3, 3);
this.pArray[7] = new Array(0, 3, 3, 12, 3, 3, 0, 0, 2, 21, 1, 43, 2, 0, 9, 9, 9, 0, 0, 3, 3);
this.pArray[8] = new Array(0, 3, 3, 3, 3, 0, 0, 0, 2, 13, 45, 2, 2, 0, 9, 10, 9, 0, 3, 0, 0);
this.pArray[9] = new Array(0, 3, 3, 3, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 12, 3, 0, 0);
this.pArray[10] = new Array(0, 3, 3, 3, 9, 10, 9, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 3, 3, 3, 0);
this.pArray[11] = new Array(0, 3, 3, 3, 9, 9, 9, 0, 0, 0, 0, 0, 0, 4, 0, 3, 0, 3, 3, 3, 3);
this.pArray[12] = new Array(0, 3, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 4, 4, 3, 0, 3, 3, 3, 3, 3);
this.pArray[13] = new Array(0, 3, 3, 3, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 0, 3, 3, 3, 3, 3, 3);
this.pArray[14] = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.levelBonus = 2500;
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_HARD :
this.rAmounts[0] = 150;
this.rAmounts[1] = 25;
this.rAmounts[2] = 150;
this.rAmounts[4] = 75;
this.rAmounts[5] = 10;
this.rAmounts[6] = 0;
this.rAmounts[7] = 0;
this.missionTime = [8, 4, false];
this.spawnRate = 8;
this.spawnTicks = 2;
this.increaseTicks = 2;
this.levelBonus = 10000;
break;
case K.DIFF_IMPOSSIBLE :
this.rAmounts[0] = 100;
this.rAmounts[1] = 10;
this.rAmounts[2] = 300;
this.rAmounts[4] = 50;
this.rAmounts[5] = 5;
this.rAmounts[6] = 0;
this.rAmounts[7] = 0;
this.missionTime = [6, 6, false];
this.spawnTicks = 1;
this.increaseTicks = 1;
this.levelBonus = 7500;
}
var _local2 = 0;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Colonel Roosevelt! Come in, Roosevelt!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "army";
this.texts[_local2] = "Ralph? Is that you? What's wrong?";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "I need the Colonel, NOW!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "army";
this.texts[_local2] = "Patching you through now, Ralph!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Colonel! It's a trap! They've been intercepting our messages!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "What???!?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "The civilians are the target! They're after New Thermopalyae!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "How soon till they get there?";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "They're already here! We can hold 'em off for a few days, but we need backup NOW!";
this.actions[_local2] = "talk";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Well, this might be the end. Trapped between two zombie armies...low on supplies. Time to make a desperate last stand.";
this.objectives[_local2] = "Survive 4 nights";
this.objInfo[_local2] = "morning_survive";
this.actions[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Doctor! Radio incoming!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Remington! Wurstwagen! We're sending you supplies, and the army's right behind!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "How long till it gets here?";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "2 days! And the army will be there in 3! The way is clogged with zombies!";
this.objectives[_local2] = "Survive 3 nights";
this.objInfo[_local2] = "wait_dark";
this.actions[_local2] = "";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Here they come! Give em what we got!";
this.objectives[_local2] = "Survive 3 nights";
this.objInfo[_local2] = "morning_survive";
this.actions[_local2] = "";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Hold on! We're on our way!";
this.objectives[_local2] = "Survive 2 nights";
this.objInfo[_local2] = "wait_dark";
this.actions[_local2] = "";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "There's more coming! Get ready!";
this.objectives[_local2] = "Survive 2 nights";
this.objInfo[_local2] = "morning_survive";
this.actions[_local2] = "spawn_raider";
this.waves[_local2] = 10;
switch (this.difficulty) {
case K.DIFF_EASY :
break;
case K.DIFF_NORMAL :
break;
case K.DIFF_IMPOSSIBLE :
case K.DIFF_HARD :
this.actions[_local2] = "spawn_raider_monstertruck";
}
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Doctor! I've gotten word that the supply convoy has reached your position!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "Roger that! Supplies are here! Let's make it last!";
this.objectives[_local2] = "Survive 1 night";
this.objInfo[_local2] = "wait_dark";
this.actions[_local2] = "resupply";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Dear Lord... take a look at that!";
this.objectives[_local2] = "Survive 1 night";
this.objInfo[_local2] = "morning_survive";
this.actions[_local2] = "spawn_raider";
this.waves[_local2] = 25;
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "The calvary's here! Charge!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "It's good to see you, Colonel! I thought we were done for!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "Just doing my job, Doctor. There's still a long road ahead, but I think we've gotten a foothold against the zombies...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "...what's wrong?";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...This war - I lost a lot of friends. We all did...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...The only reason we're still alive... one of the creatures...\"ZRAL\"...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...He was the one who tipped us off to the ambush. The others killed him for it...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "...wow. Talk about a paradigm shift.";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...Yeah, no kidding. I wonder if there could ever be peace between us...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "...It's what we all hope for. But until then, we protect those important to us.";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "ralph";
this.texts[_local2] = "Meet you guys out back? I saved some Mountain Dew from before the cataclysm. I think we should open a case!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "roosevelt";
this.texts[_local2] = "I'll drink to that!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "...! What's this?";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "zral_junior";
this.texts[_local2] = "...?";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "A hatchling... among the rubble!";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "zral_junior";
this.texts[_local2] = "...Mamma?";
this.objectives[_local2] = "";
this.objInfo[_local2] = "talk";
this.actions[_local2] = "talk";
_local2++;
this.textPortraits[_local2] = "wurstwagen";
this.texts[_local2] = "You'll just be my little secret, little one. I owe ZRAL a life. I'll keep yours for his sake...";
this.objectives[_local2] = "";
this.objInfo[_local2] = "score";
this.actions[_local2] = "score";
_local2++;
this.textPortraits[_local2] = "score";
this.texts[_local2] = "";
this.objInfo[_local2] = "ultimatevictory";
this.objectives[_local2] = "";
this.actions[_local2] = "ultimatevictory";
};
_local2.levelSand1 = function () {
this.titleName = "Sandbox 1";
this.myWidth = 42;
this.myHeight = 32;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
var _local2 = new Object();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0);
this.pArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 0, 5, 4);
this.pArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[7] = new Array(0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 21, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[8] = new Array(0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[10] = new Array(0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 4, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0);
this.pArray[13] = new Array(0, 0, 5, 5, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0);
this.pArray[14] = new Array(0, 0, 0, 4, 4, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0);
this.hArray[4] = new Array(0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1);
this.hArray[5] = new Array(0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0);
this.hArray[9] = new Array(0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0);
this.hArray[10] = new Array(0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0);
this.hArray[11] = new Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0);
this.hArray[12] = new Array(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = this.sandResources;
this.disables = [];
this.missionTime = [this.sandDayTime, this.sandNightTime, true];
this.noMansLand = this.sandWasteland;
this.waves = new Array();
this.disables = new Array();
this.spawnRate = this.sandSpawnRate;
this.spawnTicks = this.sandSpawnTicks;
this.increaseRate = this.sandIncreaseRate;
this.increaseTicks = this.sandIncreaseTicks;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.eventPortraits = new Array();
this.energyDefecits = true;
this.foodDefecits = true;
};
_local2.setSandBoxGoal = function (goal, val, extraStr) {
this.textPortraits = new Array();
this.texts = new Array();
this.objInfo = new Array();
this.objectives = new Array();
this.actions = new Array();
this.multiActions = new Array();
this.textPortraits[0] = "lars";
this.objInfo[0] = "talk";
this.objectives[0] = "";
this.actions[0] = "talk";
this.texts[0] = extraStr;
if (goal.toLowerCase() == "survivedays") {
this.dayPar = val;
var _local2 = 1;
while (_local2 < (val + 1)) {
this.textPortraits[_local2] = "lars";
if (_local2 == val) {
this.texts[_local2] = ("Survive " + ((val - _local2) + 1)) + " more day!";
this.objectives[_local2] = ("Survive " + ((val - _local2) + 1)) + " day!";
} else {
this.texts[_local2] = ("Survive " + ((val - _local2) + 1)) + " more days!";
this.objectives[_local2] = ("Survive " + ((val - _local2) + 1)) + " days!";
}
this.objInfo[_local2] = "survive_day";
this.actions[_local2] = "";
_local2++;
}
this.textPortraits[val + 1] = "lars";
this.texts[val + 1] = "Congratulations!";
this.objectives[val + 1] = "";
this.objInfo[val + 1] = "sandboxScore";
this.actions[val + 1] = "sandboxScore";
this.textPortraits[val + 2] = "sandboxScore";
this.texts[val + 2] = "";
this.objInfo[val + 2] = "sandbox_victory";
this.objectives[val + 2] = "";
this.actions[val + 2] = "sandbox_victory";
}
};
_local2.levelSand2 = function () {
this.titleName = "Sandbox 2";
this.myWidth = 42;
this.myHeight = 32;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
var _local2 = new Object();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0);
this.pArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 0, 0);
this.pArray[2] = new Array(0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 4, 0);
this.pArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 21, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
this.pArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0);
this.pArray[14] = new Array(0, 4, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[15] = new Array(0, 4, 4, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = this.sandResources;
this.disables = [];
this.missionTime = [this.sandDayTime, this.sandNightTime, true];
this.noMansLand = this.sandWasteland;
this.waves = new Array();
this.disables = new Array();
this.spawnRate = this.sandSpawnRate;
this.spawnTicks = this.sandSpawnTicks;
this.increaseRate = this.sandIncreaseRate;
this.increaseTicks = this.sandIncreaseTicks;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.eventPortraits = new Array();
this.energyDefecits = true;
this.foodDefecits = true;
};
// unexpected jump
// unexpected jump
_local2.levelSand3 = function () {
this.titleName = "Sandbox 3";
this.myWidth = 42;
this.myHeight = 32;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0);
this.pArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 5, 5, 0, 0, 0);
this.pArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 0, 0, 0, 5, 4, 4, 0);
this.pArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = this.sandResources;
this.disables = [];
this.missionTime = [this.sandDayTime, this.sandNightTime, true];
this.noMansLand = this.sandWasteland;
this.waves = new Array();
this.disables = new Array();
this.spawnRate = this.sandSpawnRate;
this.spawnTicks = this.sandSpawnTicks;
this.increaseRate = this.sandIncreaseRate;
this.increaseTicks = this.sandIncreaseTicks;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.eventPortraits = new Array();
this.energyDefecits = true;
this.foodDefecits = true;
};
_local2.levelSand4 = function () {
this.titleName = "Sandbox 4";
this.myWidth = 42;
this.myHeight = 32;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 5, 4, 4, 5, 0, 0, 0, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 5, 4, 9, 9, 9, 0, 0, 0, 13, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0);
this.pArray[7] = new Array(0, 5, 4, 4, 9, 10, 9, 0, 21, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0);
this.pArray[8] = new Array(0, 5, 4, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 4, 4, 5, 5, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 0, 0, 0);
this.pArray[10] = new Array(0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 4, 5, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = this.sandResources;
this.disables = [];
this.missionTime = [this.sandDayTime, this.sandNightTime, true];
this.noMansLand = this.sandWasteland;
this.waves = new Array();
this.disables = new Array();
this.spawnRate = this.sandSpawnRate;
this.spawnTicks = this.sandSpawnTicks;
this.increaseRate = this.sandIncreaseRate;
this.increaseTicks = this.sandIncreaseTicks;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.eventPortraits = new Array();
this.energyDefecits = true;
this.foodDefecits = true;
};
_local2.levelSand5 = function () {
this.titleName = "Sandbox 5";
this.myWidth = 42;
this.myHeight = 32;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2);
this.pArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[3] = new Array(0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 9, 9, 9);
this.pArray[7] = new Array(0, 0, 0, 0, 3, 3, 3, 0, 3, 3, 1, 3, 3, 13, 3, 3, 3, 0, 9, 10, 9);
this.pArray[8] = new Array(0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 9, 9, 9);
this.pArray[9] = new Array(0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 42, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0, 4, 0, 0);
this.pArray[15] = new Array(2, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 2);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0);
this.hArray[2] = new Array(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);
this.hArray[14] = new Array(0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = this.sandResources;
this.disables = [];
this.missionTime = [this.sandDayTime, this.sandNightTime, true];
this.noMansLand = this.sandWasteland;
this.waves = new Array();
this.disables = new Array();
this.spawnRate = this.sandSpawnRate;
this.spawnTicks = this.sandSpawnTicks;
this.increaseRate = this.sandIncreaseRate;
this.increaseTicks = this.sandIncreaseTicks;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.eventPortraits = new Array();
this.energyDefecits = true;
this.foodDefecits = true;
};
_local2.levelSand6 = function () {
this.titleName = "Sandbox 6";
this.myWidth = 42;
this.myHeight = 32;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[3] = new Array(0, 0, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 9, 9, 9, 0, 0, 0, 4, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 9, 10, 9, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 9, 9, 9, 0, 0, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(0, 9, 10, 9, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[13] = new Array(0, 9, 9, 9, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = this.sandResources;
this.disables = [];
this.missionTime = [this.sandDayTime, this.sandNightTime, true];
this.noMansLand = this.sandWasteland;
this.waves = new Array();
this.disables = new Array();
this.spawnRate = this.sandSpawnRate;
this.spawnTicks = this.sandSpawnTicks;
this.increaseRate = this.sandIncreaseRate;
this.increaseTicks = this.sandIncreaseTicks;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.eventPortraits = new Array();
this.energyDefecits = true;
this.foodDefecits = true;
};
// unexpected jump
// unexpected jump
_local2.levelSand7 = function () {
this.titleName = "Sandbox 7";
this.myWidth = 42;
this.myHeight = 32;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[1] = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[3] = new Array(4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4);
this.pArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0);
this.pArray[5] = new Array(0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0);
this.pArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0);
this.pArray[7] = new Array(2, 2, 2, 2, 2, 2, 2, 2, 2, 21, 1, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2);
this.pArray[8] = new Array(2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
this.pArray[9] = new Array(0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 0, 9, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0);
this.pArray[11] = new Array(0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[12] = new Array(4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4);
this.pArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[14] = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.pArray[15] = new Array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1);
this.hArray[2] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[3] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[4] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[5] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = this.sandResources;
this.disables = [];
this.missionTime = [this.sandDayTime, this.sandNightTime, true];
this.noMansLand = this.sandWasteland;
this.waves = new Array();
this.disables = new Array();
this.spawnRate = this.sandSpawnRate;
this.spawnTicks = this.sandSpawnTicks;
this.increaseRate = this.sandIncreaseRate;
this.increaseTicks = this.sandIncreaseTicks;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.eventPortraits = new Array();
this.energyDefecits = true;
this.foodDefecits = true;
};
_local2.levelSand8 = function () {
this.titleName = "Sandbox 8";
this.myWidth = 42;
this.myHeight = 32;
this.energyDefecits = true;
this.foodDefecits = true;
this.tutorialMode = true;
this.gArray = new Array();
this.pWidth = 21;
this.pHeight = 16;
this.pArray = new Array(16);
this.pArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[1] = new Array(0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.pArray[2] = new Array(0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0);
this.pArray[3] = new Array(0, 9, 9, 9, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 9, 0);
this.pArray[4] = new Array(0, 9, 10, 9, 0, 3, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 3);
this.pArray[5] = new Array(0, 9, 9, 9, 0, 3, 3, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3);
this.pArray[6] = new Array(0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3);
this.pArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 1, 21, 0, 0, 9, 9, 9, 0, 0, 3, 3);
this.pArray[8] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 9, 10, 9, 0, 0, 0, 0);
this.pArray[9] = new Array(0, 0, 0, 0, 9, 9, 9, 0, 0, 3, 3, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0);
this.pArray[10] = new Array(0, 0, 0, 0, 9, 10, 9, 0, 3, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0);
this.pArray[11] = new Array(0, 0, 0, 0, 9, 9, 9, 3, 3, 0, 0, 0, 0, 4, 5, 0, 0, 3, 0, 0, 0);
this.pArray[12] = new Array(0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4, 5, 0, 0, 3, 3, 0, 0, 0);
this.pArray[13] = new Array(0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 3, 3, 3, 0, 0, 0);
this.pArray[14] = new Array(3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0);
this.pArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray = new Array(16);
this.hArray[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[1] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0);
this.hArray[2] = new Array(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0);
this.hArray[3] = new Array(0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1);
this.hArray[4] = new Array(1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0);
this.hArray[5] = new Array(0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0);
this.hArray[6] = new Array(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
this.hArray[7] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0);
this.hArray[8] = new Array(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0);
this.hArray[9] = new Array(0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0);
this.hArray[10] = new Array(0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
this.hArray[11] = new Array(0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[12] = new Array(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[13] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[14] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.hArray[15] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.visibleResources = [true, true, true, true, true, true, true, true];
this.rAmounts = this.sandResources;
this.disables = [];
this.missionTime = [this.sandDayTime, this.sandNightTime, true];
this.noMansLand = this.sandWasteland;
this.waves = new Array();
this.disables = new Array();
this.spawnRate = this.sandSpawnRate;
this.spawnTicks = this.sandSpawnTicks;
this.increaseRate = this.sandIncreaseRate;
this.increaseTicks = this.sandIncreaseTicks;
this.conditions = new Array();
this.events = new Array();
this.eventText = new Array();
this.eventPortraits = new Array();
this.energyDefecits = true;
this.foodDefecits = true;
};
_local2.setVisibleResources = function (e, f, s, m, g, ff) {
this.visibleResources = new Array(e, f, s, m, g, ff);
};
_local2.setVisibleResource = function (i, a) {
this.visibleResources[i] = a;
};
_local2.getLevelEnemies = function () {
var _local2 = this.spawnRate;
if ((this.incTicks++) >= this.increaseTicks) {
this.incTicks = 0;
this.spawnRate = this.spawnRate + this.increaseRate;
}
return(_local2);
};
_local2.priorTextThing = function () {
this.currObjective--;
};
_local2.hasPriorDialog = function () {
var _local2 = this.peekPriorObjInfo();
if (_local2 == "talk") {
return(true);
}
return(false);
};
_local2.peekPriorObjInfo = function () {
return(this.objInfo[this.currObjective - 1]);
};
_local2.peekNextObjInfo = function () {
return(this.objInfo[this.currObjective + 1]);
};
_local2.getNextObjective = function () {
this.currObjective++;
return(this.objectives[this.currObjective]);
};
_local2.defeat = function () {
this.actions[this.currObjective] = "defeat";
};
_local2.getCurrLevelIndex = function () {
if (!this.inSandbox) {
return(this.myIndex);
}
return(1);
};
_local2.getLevelBonus = function () {
return(this.levelBonus);
};
_local2.getCurrText = function () {
return(this.texts[this.currObjective]);
};
_local2.getCurrObjective = function () {
if (this.objectives[this.currObjective] == undefined) {
return("");
}
return(this.objectives[this.currObjective]);
};
_local2.setCurrObjInfo = function (str) {
this.objInfo[this.currObjective] = str;
};
_local2.getCurrObjInfo = function () {
return(this.objInfo[this.currObjective]);
};
_local2.getCurrWave = function () {
return(this.waves[this.currObjective]);
};
_local2.getCurrAction = function () {
return(this.actions[this.currObjective]);
};
_local2.getCurrMultiActions = function () {
return(this.multiActions[this.currObjective]);
};
_local2.getCurrTutorial = function () {
return(this.tutorials[this.currObjective]);
};
_local2.getCurrPortrait = function () {
return(this.textPortraits[this.currObjective]);
};
_local2.getTitle = function () {
return(this.titleName);
};
_local2.c = "LevelData";
_local2.difficulty = 1;
_local2.bakedLevel = true;
_local2.myIndex = 0;
_local2.challengeIndex = 0;
_local2.isChallenge = false;
_local2.otherIndex = 0;
_local2.myWidth = 0;
_local2.myHeight = 0;
_local2.pWidth = 0;
_local2.pHeight = 0;
_local2.readyToLoad = true;
_local2.tutorialMode = false;
_local2.currObjective = -1;
_local2.levelBonus = 0;
_local2.spawnRate = 0;
_local2.spawnTicks = 0;
_local2.incTicks = 0;
_local2.increaseTicks = 0;
_local2.sandDayTime = 50;
_local2.sandNightTime = 50;
_local2.zombiesOn = true;
_local2.raidersOn = true;
_local2.monsterTrucksOn = true;
_local2.sandSpawnRate = 3;
_local2.sandSpawnTicks = 2;
_local2.sandIncreaseRate = 1;
_local2.sandIncreaseTicks = 2;
_local2.sandboxGoal = "";
_local2.sandboxGoalValue = 0;
_local2.challengeString = "";
_local2.inCampaign = false;
_local2.inSandbox = false;
_local2.dayPar = 0;
_local2.freeTrucks = 0;
_local2.freeEngineers = 0;
ASSetPropFlags(_global.LevelData.prototype, null, 1);
#endinitclip
Symbol 2857 MovieClip [__Packages.Reservoir] Frame 0
class Reservoir extends Object
{
var pumpRate, oilPumped, gasPumped, xLoc, yLoc;
function Reservoir () {
super();
pumpRate = 1;
oilPumped = 0;
gasPumped = 0;
}
function setLoc(xx, yy) {
xLoc = xx;
yLoc = yy;
}
function pumpOil(amt) {
amt = amt * pumpRate;
oilPumped = oilPumped + amt;
adjustPumpRate();
return(amt);
}
function pumpGas(amt) {
amt = amt * pumpRate;
gasPumped = gasPumped + amt;
adjustPumpRate();
return(amt);
}
function pumpCoal(amt) {
return(0);
}
function pumpMetal(amt) {
return(0);
}
function adjustPumpRate() {
var _local4 = oilPumped + gasPumped;
var _local3 = Math.floor(_local4 / chunkSize);
pumpRate = 1;
var _local2 = 0;
while (_local2 < _local3) {
pumpRate = pumpRate * 0.75;
_local2++;
}
updateLevel();
}
function updateLevel() {
if (pumpRate >= 0.75) {
level = 2;
} else if (pumpRate >= 0.25) {
level = 1;
} else {
level = 0;
}
}
function getLevel() {
return(level);
}
var chunkSize = K.FF_OUT_OILGASWELL * 5;
var level = 2;
}
Symbol 2858 MovieClip [__Packages.CoalDeposit] Frame 0
class CoalDeposit extends Reservoir
{
var pumpRate, coalPumped, updateLevel;
function CoalDeposit () {
super();
pumpRate = 1;
coalPumped = 0;
}
function pumpCoal(amt) {
amt = amt * pumpRate;
coalPumped = coalPumped + amt;
adjustPumpRate();
return(amt);
}
function adjustPumpRate() {
var _local4 = coalPumped;
var _local3 = Math.floor(_local4 / chunkSize);
pumpRate = 1;
var _local2 = 0;
while (_local2 < _local3) {
pumpRate = pumpRate * 0.75;
_local2++;
}
updateLevel();
}
var chunkSize = K.C_OUT_COALMINE * 5;
}
Symbol 2859 MovieClip [__Packages.MetalDeposit] Frame 0
class MetalDeposit extends Reservoir
{
var pumpRate, metalPumped, updateLevel;
function MetalDeposit () {
super();
pumpRate = 1;
metalPumped = 0;
}
function pumpMetal(amt) {
amt = amt * pumpRate;
metalPumped = metalPumped + amt;
adjustPumpRate();
return(amt);
}
function adjustPumpRate() {
var _local4 = metalPumped;
var _local3 = Math.floor(_local4 / chunkSize);
pumpRate = 1;
var _local2 = 0;
while (_local2 < _local3) {
pumpRate = pumpRate * 0.75;
_local2++;
}
updateLevel();
}
var chunkSize = K.M_OUT_MINE * 5;
}
Symbol 2860 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.43");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local3 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servicesURL != undefined) {
_servicesURL = urlOptions().servicesURL;
}
allowDomains(_servicesURL);
_clip = clip.createEmptyMovieClip(_local3, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip((((_servicesURL + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
if (_root.mochiad_options) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static var _servicesURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
}
Symbol 2861 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if ((options.clip == null) || (options.clip == undefined)) {
options.clip = mochi.MochiServices.clip;
}
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
} else {
if (Math.floor(_local1) != _local1) {
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
} else {
if (Math.floor(score) != score) {
}
score = Number(score);
}
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 2862 MovieClip [__Packages.mochi.MochiDigits] Frame 0
class mochi.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 2863 MovieClip [__Packages.CutScene] Frame 0
class CutScene extends MovieClip
{
var myID, gotoAndStop, theSong, theClip, master;
function CutScene () {
super();
}
function onLoad() {
}
function setID(id, myNum) {
myID = id;
switch (myID) {
case K.INTRO_MOVIE :
gotoAndStop("intro");
break;
case K.END_MOVIE :
gotoAndStop("ending");
theNumber = myNum;
theSong.finalScore = theNumber;
}
}
function setMyNum(i) {
theNumber = i;
theClip.theNumber = theNumber;
theSong.finalScore = theNumber;
var back = this;
theSong.onLoad = function () {
this.finalScore = back.theNumber;
};
theClip.onLoad = function () {
this.theNumber = back.theNumber;
};
}
function setMaster(sd) {
master = sd;
}
function endMovie() {
master.endCutScene(myID);
}
var theNumber = 0;
}
Symbol 2864 MovieClip [__Packages.Interface] Frame 0
class Interface extends MovieClip
{
var lastMenu, currMenu, master, r_energy, r_food, r_smog, r_research, r_metal, r_gas, r_FF, r_coal, attachMovie, getNextHighestDepth, theTextThing, priorButt, theMenu, engineerGlow, mineGlow, farmGlow, defenseGlow, powerPlantGlow, landFillGlow, labGlow, factoryGlow, demolishGlow, teslaCoilGlow, gunTurretGlow, floodLightsGlow, flameTurretGlow, FFPlantGlow, gasPlantGlow, windPlantGlow, solarPlantGlow, nuclearPlantGlow, nuclearDumpGlow, oilGasGlow, geoPlantGlow, recyclingCenterGlow, gasolineGlow, electricGlow, ethanolGlow, natgasGlow, garbageTruckGlow, gameTime, timeString, demolishB, repairB, theMessage, summonButt, disableButt, gotoAndStop, portrait, theStatus, organic, metal, reuse, junk, addOns, recyclingCenter, metal_scrap, gas, energy, hp, theCost, usage, theLevel, recycleMetalLevel, recyclePETELevel, recycleGasLevel, recycleBiofuelLevel, gasolineLevel, dieselLevel, electricLevel, ethanolLevel, natGasLevel, fuelCellLevel, theProduction, objective;
function Interface () {
super();
lastMenu = new Array();
currMenu = "default";
}
function onLoad() {
makeResources();
master.onInterfaceLoaded();
}
function setMaster(d) {
master = d;
}
function setResourceVisibility(a) {
if (a[0] == false) {
r_energy.hideMe();
} else {
r_energy.showMe();
}
if (a[1] == false) {
r_food.hideMe();
} else {
r_food.showMe();
}
if (a[2] == false) {
r_smog.hideMe();
} else {
r_smog.showMe();
}
if (a[3] == false) {
r_research.hideMe();
} else {
r_energy.showMe();
}
if (a[4] == false) {
r_metal.hideMe();
} else {
r_metal.showMe();
}
if (a[5] == false) {
r_gas.hideMe();
} else {
r_gas.showMe();
}
if (a[6] == false) {
r_FF.hideMe();
} else {
r_FF.showMe();
}
if (a[7] == false) {
r_coal.hideMe();
} else {
r_coal.showMe();
}
}
function showReport(type) {
doTheActions = false;
master.unClickEverything();
attachMovie("mc_textThing", "theTextThing", getNextHighestDepth());
theTextThing.setMaster(this);
theTextThing.setReport(type);
}
function showCurrObjective() {
doTheActions = false;
master.unClickEverything();
attachMovie("mc_textThing", "theTextThing", getNextHighestDepth());
theTextThing.setMaster(this);
theTextThing.setObjective(master.lData.getCurrObjective());
theTextThing.setText(master.lData.getCurrText());
theTextThing.setPortrait(master.lData.getCurrPortrait());
theTextThing.setTutorial(master.lData.getCurrTutorial());
theTextThing.setTitle(master.lData.getTitle());
}
function resetLevel() {
master.resetLevel();
}
function restartTheGame() {
master.gotoMenu();
resetLevel();
}
function quitTheGame() {
master.quitTheGame();
}
function showFinalScore() {
endOfScore = true;
master.unClickEverything();
normalCursor();
attachMovie("mc_textThing", "theTextThing", getNextHighestDepth());
theTextThing.showFinalScore();
}
function doSkipTextThing() {
while (master.lData.getCurrObjInfo() == "talk") {
simpleShowTextThing();
}
endTextThing();
}
function simpleShowTextThing() {
hidePriorButton();
doTheActions = true;
master.unClickEverything();
normalCursor();
tryActions();
theTextThing.setObjective(master.lData.getNextObjective());
showObjective();
if (master.lData.getCurrPortrait() == "score") {
theTextThing.showFinalScore();
} else if (master.lData.getCurrPortrait() == "sandboxScore") {
theTextThing.showSandboxScore();
} else {
theTextThing.setText(master.lData.getCurrText());
theTextThing.setTutorial(master.lData.getCurrTutorial());
theTextThing.setPortrait(master.lData.getCurrPortrait());
theTextThing.setTitle(master.lData.getTitle());
}
}
function hidePriorButton() {
if (!master.lData.hasPriorDialog()) {
} else {
priorButt._visible = true;
priorButt.enabled = true;
priorButt._alpha = 100;
}
}
function priorTextThing() {
if (master.lData.hasPriorDialog()) {
master.lData.priorTextThing();
simpleShowTextThing();
}
}
function showTextThing() {
hidePriorButton();
doTheActions = true;
master.unClickEverything();
normalCursor();
attachMovie("mc_textThing", "theTextThing", getNextHighestDepth());
theTextThing.setObjective(master.lData.getNextObjective());
showObjective();
if (master.lData.getCurrPortrait() == "score") {
theTextThing.showFinalScore();
} else if (master.lData.getCurrPortrait() == "sandboxScore") {
theTextThing.showSandboxScore();
} else {
theTextThing.setText(master.lData.getCurrText());
theTextThing.setTutorial(master.lData.getCurrTutorial());
theTextThing.setPortrait(master.lData.getCurrPortrait());
theTextThing.setTitle(master.lData.getTitle());
}
}
function showTextThingLoseRoosevelt() {
attachMovie("mc_textThing", "theTextThing", getNextHighestDepth());
theTextThing.setObjective("");
theTextThing.setTitle("GAME OVER!");
theTextThing.setText("I'm sorry Doctor, I've failed you... and New Texas, too...");
theTextThing.setPortrait("roosevelt");
master.lData.defeat();
}
function showTextThingLose() {
attachMovie("mc_textThing", "theTextThing", getNextHighestDepth());
theTextThing.setObjective("");
theTextThing.setTitle("GAME OVER!");
theTextThing.setText("Can anyone hear me? We're being overrun! Send backup imme- \n **011234**** ******$5# *****%#***** \n -End of Transmission.-");
theTextThing.setPortrait("wurstwagen");
master.lData.defeat();
}
function submitTheScore(l1, l2, l3, l4, l5, l6, l7, l8, l9, lT) {
master.submitTheScore(l1, l2, l3, l4, l5, l6, l7, l8, l9, lT);
}
function submitChallengeScore(s) {
master.submitChallengeScore(s);
}
function endTextThing() {
master.gotoTextThing();
}
function skipTextThing() {
master.skipTextThing();
}
function tryActions() {
if (doTheActions == true) {
master.doCurrentActions(true);
}
}
function hideTextThing() {
theTextThing.removeMovieClip();
if (doTheActions == true) {
master.doCurrentActions(false);
}
if (endOfScore == true) {
master.onEndOfScore();
}
}
function showHelp() {
showOptions(true);
}
function showOptions(isHelp) {
attachMovie("mc_menu", "theMenu", getNextHighestDepth());
var _local2;
if (isHelp == true) {
_local2 = "help";
} else {
_local2 = "default";
}
theMenu.fx.setVal(K.FX_VOLUME_MAX);
theMenu.music.setVal(K.MUSIC_VOLUME_MAX);
theMenu.frame = _local2;
theMenu.gotoAndStop(_local2);
}
function fancyCursorOn() {
K.FANCYCURSOR = true;
master.updateCursor();
}
function fancyCursorOff() {
K.FANCYCURSOR = false;
master.updateCursor();
}
function hideOptions() {
theMenu.removeMovieClip();
}
function saveOptions() {
K.MUSIC_VOLUME_MAX = theMenu.music.val;
master.updateFxVolume();
master.updateMusicVolume();
}
function makeResources() {
attachMovie("mc_r_energy", "r_energy", getNextHighestDepth());
attachMovie("mc_r_food", "r_food", getNextHighestDepth());
attachMovie("mc_r_metal", "r_metal", getNextHighestDepth());
attachMovie("mc_r_research", "r_research", getNextHighestDepth());
attachMovie("mc_r_gas", "r_gas", getNextHighestDepth());
attachMovie("mc_r_FF", "r_FF", getNextHighestDepth());
attachMovie("mc_r_coal", "r_coal", getNextHighestDepth());
attachMovie("mc_r_smog", "r_smog", getNextHighestDepth());
var _local3 = new flash.filters.DropShadowFilter();
_local3.angle = 45;
_local3.strength = 1;
_local3.blurX = 5;
_local3.blurY = 5;
_local3.distance = 2;
var _local2 = r_energy.filters;
_local2.push(_local3);
r_energy.filters = _local2;
r_food.filters = _local2;
r_research.filters = _local2;
r_metal.filters = _local2;
r_gas.filters = _local2;
r_coal.filters = _local2;
r_FF.filters = _local2;
r_smog.filters = _local2;
r_energy._x = -320;
r_energy._y = -252;
r_energy.setType(K.ENERGY);
r_food._x = -190;
r_food._y = -250;
r_food._width = r_food._width * 0.8;
r_food._height = r_food._height * 0.8;
r_food.setType(K.FOOD);
r_smog._x = -60;
r_smog._y = -248;
r_smog._width = r_smog._width * 0.75;
r_smog._height = r_smog._height * 0.75;
r_smog.setType(K.SMOG);
r_research._x = 120;
r_research._y = -245;
r_research._width = r_research._width * 0.75;
r_research._height = r_research._height * 0.75;
r_research.setType(K.RESEARCH);
r_metal._x = 200;
r_metal._y = -245;
r_metal._width = r_metal._width * 0.75;
r_metal._height = r_metal._height * 0.75;
r_metal.setType(K.METAL);
r_gas._x = 250;
r_gas._y = -245;
r_gas._width = r_gas._width * 0.75;
r_gas._height = r_gas._height * 0.75;
r_gas.setType(K.GAS);
r_FF._x = 315;
r_FF._y = -245;
r_FF._width = r_FF._width * 0.75;
r_FF._height = r_FF._height * 0.75;
r_FF.setType(K.FF);
r_coal._x = 375;
r_coal._y = -245;
r_coal._width = r_coal._width * 0.75;
r_coal._height = r_coal._height * 0.75;
r_coal.setType(K.COAL);
}
function setEnergy(e) {
r_energy.setAmount(e);
}
function setSmog(s) {
r_smog.setAmount(s);
}
function recalcResourceNums() {
theTextThing.calcEnergyReport();
theTextThing.calcFoodReport();
theTextThing.calcWasteReport();
theTextThing.calcSmogReport();
theTextThing.calcResourceReport();
r_energy.setNet(theTextThing.enet, theTextThing.ein, theTextThing.eout);
r_food.setNet(theTextThing.fnet, theTextThing.fin, theTextThing.fout);
}
function setWeather(sun, wind) {
var _local2;
var _local3;
switch (sun) {
case K.SUN_NO :
_local2 = "Dark";
break;
case K.SUN_OVERCAST :
_local2 = "Overcast";
break;
case K.SUN_LOW :
_local2 = "Low";
break;
case K.SUN_MID :
_local2 = "Normal";
break;
case K.SUN_HIGH :
_local2 = "Strong";
break;
default :
_local2 = "Error";
}
switch (wind) {
case K.WIND_NO :
_local3 = "None";
break;
case K.WIND_GENTLE :
_local3 = "Gentle";
break;
case K.WIND_LOW :
_local3 = "Low";
break;
case K.WIND_MID :
_local3 = "Normal";
break;
case K.WIND_HIGH :
_local3 = "Strong";
break;
default :
_local3 = "Error";
}
sunLightStr = _local2;
windSpeedStr = _local3;
}
function setEnergyIn(e) {
r_energy.setIn(e);
}
function setEnergyOut(e) {
r_energy.setOut(e);
}
function setEnergyNet(e, ei, eo) {
r_energy.setNet(e, ei, eo);
}
function setFood(f) {
r_food.setAmount(f);
}
function setFoodIn(f) {
r_food.setIn(f);
}
function setFoodOut(f) {
r_food.setOut(f);
}
function setFoodNet(f, fi, fo) {
r_food.setNet(f, fi, fo);
}
function setGas(g) {
r_gas.setAmount(g);
}
function setGasIn(g) {
r_gas.setIn(g);
}
function setGasOut(g) {
r_gas.setOut(g);
}
function setMetal(m) {
r_metal.setAmount(m);
}
function setMetalIn(m) {
r_metal.setIn(m);
}
function setMetalOut(m) {
r_metal.setOut(m);
}
function setCoal(c) {
r_coal.setAmount(c);
}
function setFF(ff) {
r_FF.setAmount(ff);
}
function setResearch(r) {
r_research.setAmount(r);
}
function setFFIn(ff) {
r_FF.setIn(ff);
}
function setFFOut(ff) {
r_FF.setOut(ff);
}
function showGlowyEngineer() {
engineerGlow.gotoAndPlay("glow");
}
function showGlowyMine() {
mineGlow.gotoAndPlay("glow");
}
function showGlowyFarm() {
farmGlow.gotoAndPlay("glow");
}
function showGlowyDefense() {
defenseGlow.gotoAndPlay("glow");
}
function showGlowyPowerPlant() {
powerPlantGlow.gotoAndPlay("glow");
}
function showGlowyLandFill() {
landFillGlow.gotoAndPlay("glow");
}
function showGlowyLab() {
labGlow.gotoAndPlay("glow");
}
function showGlowyFactory() {
factoryGlow.gotoAndPlay("glow");
}
function showGlowyDemolish() {
demolishGlow.gotoAndPlay("demolish");
}
function showGlowyTeslaCoil() {
teslaCoilGlow.gotoAndPlay("glow");
}
function showGlowyGunTurret() {
gunTurretGlow.gotoAndPlay("glow");
}
function showGlowyFloodLights() {
floodLightsGlow.gotoAndPlay("glow");
}
function showGlowyFlameTurret() {
flameTurretGlow.gotoAndPlay("glow");
}
function showGlowyFFPlant() {
FFPlantGlow.gotoAndPlay("glow");
}
function showGlowyGasPlant() {
gasPlantGlow.gotoAndPlay("glow");
}
function showGlowyWindPlant() {
windPlantGlow.gotoAndPlay("glow");
}
function showGlowySolarPlant() {
solarPlantGlow.gotoAndPlay("glow");
}
function showGlowyNuclearPlant() {
nuclearPlantGlow.gotoAndPlay("glow");
}
function showGlowyNuclearDump() {
nuclearDumpGlow.gotoAndPlay("glow");
}
function showGlowyOilGasWell() {
oilGasGlow.gotoAndPlay("glow");
}
function showGlowyGeoPlant() {
geoPlantGlow.gotoAndPlay("glow");
}
function showGlowyRecyclingCenter() {
master.recyclingOn();
recyclingCenterGlow.gotoAndPlay("glow");
}
function setFleetFuel(fn, fs) {
master.setFleetFuel(fn);
master.disableThings();
disableAllFuelsExcept(fs);
}
function disableAllFuelsExcept(f) {
gasolineGlow.gotoAndStop("default");
electricGlow.gotoAndStop("default");
ethanolGlow.gotoAndStop("default");
natgasGlow.gotoAndStop("default");
gasolineGlow.onLoad = function () {
this.gotoAndStop("default");
};
electricGlow.onLoad = function () {
this.gotoAndStop("default");
};
ethanolGlow.onLoad = function () {
this.gotoAndStop("default");
};
natgasGlow.onLoad = function () {
this.gotoAndStop("default");
};
var _local2 = K.getFuelLevels();
if (_local2[0] == 0) {
disableGasoline();
}
if (_local2[2] == 0) {
disableElectric();
}
if (_local2[3] == 0) {
disableEthanol();
}
if (_local2[4] == 0) {
disableNatGas();
}
this[f.toLowerCase() + "Glow"].gotoAndStop("select");
this[f.toLowerCase() + "Glow"].onLoad = function () {
this.gotoAndStop("select");
};
}
function disableDemolish() {
demolishGlow.gotoAndStop("disable");
demolishGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableNatGas() {
natgasGlow.gotoAndStop("disable");
natgasGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableElectric() {
electricGlow.gotoAndStop("disable");
electricGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableEthanol() {
ethanolGlow.gotoAndStop("disable");
ethanolGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableGasoline() {
gasolineGlow.gotoAndStop("disable");
gasolineGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableFFPlant() {
FFPlantGlow.gotoAndStop("disable");
FFPlantGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableGasPlant() {
gasPlantGlow.gotoAndStop("disable");
gasPlantGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableWindPlant() {
windPlantGlow.gotoAndStop("disable");
windPlantGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableSolarPlant() {
solarPlantGlow.gotoAndStop("disable");
solarPlantGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableNuclearPlant() {
nuclearPlantGlow.gotoAndStop("disable");
nuclearPlantGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableGeoPlant() {
geoPlantGlow.gotoAndStop("disable");
geoPlantGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableGarbageTruck() {
garbageTruckGlow.gotoAndStop("disable");
garbageTruckGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableEngineer() {
engineerGlow.gotoAndStop("disable");
engineerGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableRecyclingCenter() {
master.recyclingOff();
recyclingCenterGlow.gotoAndStop("disable");
recyclingCenterGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableLandFill() {
landFillGlow.gotoAndStop("disable");
landFillGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableFactory() {
factoryGlow.gotoAndStop("disable");
factoryGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableDefense() {
defenseGlow.gotoAndStop("disable");
defenseGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableOilGasWell() {
oilGasGlow.gotoAndStop("disable");
oilGasGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableNuclearDump() {
nuclearDumpGlow.gotoAndStop("disable");
nuclearDumpGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableLab() {
labGlow.gotoAndStop("disable");
labGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableMine() {
mineGlow.gotoAndStop("disable");
mineGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableTeslaCoil() {
teslaCoilGlow.gotoAndStop("disable");
teslaCoilGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableFloodLights() {
floodLightsGlow.gotoAndStop("disable");
floodLightsGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableGunTurret() {
gunTurretGlow.gotoAndStop("disable");
gunTurretGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableFlameTurret() {
flameTurretGlow.gotoAndStop("disable");
flameTurretGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disableFarm() {
farmGlow.gotoAndStop("disable");
farmGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function disablePowerPlant() {
powerPlantGlow.gotoAndStop("disable");
powerPlantGlow.onLoad = function () {
this.gotoAndStop("disable");
};
}
function showGlowyEnergy() {
r_energy.showMe();
r_energy.showGlowy();
}
function showGlowyFood() {
r_food.showMe();
r_food.showGlowy();
}
function showGlowyResearch() {
r_research.showMe();
r_research.showGlowy();
}
function showGlowyMetal() {
r_metal.showMe();
r_metal.showGlowy();
}
function showGlowyFF() {
r_FF.showMe();
r_FF.showGlowy();
}
function showGlowyGas() {
r_gas.showGlowy();
r_gas.showMe();
}
function showGlowySmog() {
r_smog.showMe();
r_smog.showGlowy();
}
function showGlowyNatGas() {
natgasGlow.gotoAndPlay("glow");
natgasGlow.onLoad = function () {
this.gotoAndPlay("glow");
};
}
function showGlowyElectric() {
electricGlow.gotoAndPlay("glow");
electricGlow.onLoad = function () {
this.gotoAndPlay("glow");
};
}
function showGlowyEthanol() {
ethanolGlow.gotoAndPlay("glow");
ethanolGlow.onLoad = function () {
this.gotoAndPlay("glow");
};
}
function showGlowyGasoline() {
gasolineGlow.gotoAndPlay("glow");
gasolineGlow.onLoad = function () {
this.gotoAndPlay("glow");
};
}
function updateGameTime(g) {
if (g >= 0) {
gameTime = g;
timeString = String(gameTime);
} else {
gameTime = 999;
timeString = "---";
}
}
function goBackButton(str, playSound) {
if ((currMenu == lastMenu[lastMenu.length - 1]) || (str == "default")) {
currMenu = "default";
}
if (str == undefined) {
currMenu = String(lastMenu.pop());
} else {
currMenu = str;
}
if (currMenu != undefined) {
showMenu();
} else {
currMenu = "default";
showMenu();
}
checkCursor(currMenu);
if (playSound) {
master.playSound(0, "click2.wav", 1);
}
master.selectedThing.updateInterface();
}
function actionButton(s) {
master.actionButton(s);
}
function showEnemyMenu(s, n, m) {
buildingMenu = true;
currMenu = s;
showMenu(n, m);
}
function showUnitMenu(s, n, m) {
buildingMenu = true;
currMenu = s;
showMenu(n, m);
if (currMenu.substr(1, 12).toLowerCase() == "garbagetruck") {
showUsage(currMenu.substr(1, 12).toLowerCase(), m, false);
} else if (currMenu.substr(1, 8).toLowerCase() == "engineer") {
showUsage(currMenu.substr(1, 8).toLowerCase(), m, false);
}
}
function showBuildingMenu(s, n, m) {
buildingMenu = true;
currMenu = s;
if (s == "garbage") {
showMenu(n, m.makeGarbageThing());
} else {
showMenu(n, m);
}
}
function directorUnClickBuildings() {
master.unClickEverything();
master.playSound(0, "click2.wav", 1);
}
function unClickBuildings() {
buildingMenu = false;
currMenu = "default";
showMenu();
}
function onClickRegion() {
master.onClickInterfaceRegion();
}
function demolishOn() {
demolishB.gotoAndStop("on");
}
function demolishOff() {
demolishB.gotoAndStop("off");
}
function repairOn() {
repairB.gotoAndStop("on");
}
function repairOff() {
repairB.gotoAndStop("off");
}
function showMessage(str) {
theMessage.theText = str;
theMessage._alpha = 100;
theMessage.gotoAndPlay("show");
theMessage.theText = str;
}
function setSummonButtDown() {
summonButt.onLoad = function () {
this.setDown();
this.setButton();
this.myFunction = function () {
this._parent._parent.summonToggleGarbage();
};
};
}
function setSummonButtUp() {
summonButt.onLoad = function () {
this.setButton();
this.myFunction = function () {
this._parent._parent.summonToggleGarbage();
};
this.setUp();
};
}
function setDisableButtDown() {
disableButt.onLoad = function () {
this.setDown();
this.setButton();
this.myFunction = function () {
this._parent._parent.disableToggleBuilding();
};
};
}
function setDisableButtUp() {
disableButt.onLoad = function () {
this.setButton();
this.myFunction = function () {
this._parent._parent.disableToggleBuilding();
};
this.setUp();
};
}
function gcm() {
return(currMenu.toLowerCase());
}
function doHotKey(str) {
if (str == "a") {
doTryButton("bFactory");
} else if (str == "b") {
doTryButton("bLab", "lab");
} else if (str == "d") {
doTryButton("b_Defense", "defense");
} else if (str == "f") {
doTryButton("bFarm", "farm");
} else if (str == "l") {
doTryButton("bLandfill", "landfill");
} else if (str == "e") {
doTryButton("b_Mines", "mines");
} else if (str == "u") {
doTryButton("bNuclearDump", "nuclearDump");
} else if (str == "p") {
doTryButton("b_PowerPlant", "powerPlant");
} else if (str == "o") {
doTryButton("bOilGasWell", "oilGasWell");
} else if (str == "z") {
doActionButton("demolish");
} else if (str == "c") {
doTryButton("bCoalPlant", "coalPlant");
} else if (str == "g") {
doTryButton("bGasPlant", "gasPlant");
} else if (str == "n") {
doTryButton("bNuclearPlant", "nuclearPlant");
} else if (str == "w") {
doTryButton("bWindPlant", "windPlant");
} else if (str == "s") {
doTryButton("bSolarPlant", "solarPlant");
} else if (str == "t") {
doTryButton("bGeoPlant", "geoPlant");
} else if (str == "m") {
doTryButton("bMine", "mine");
} else if (str == "k") {
doTryButton("bCoalMine", "coalMine");
} else if (str == "1") {
doTryButton("bFloodLights", "floodLights");
} else if (str == "2") {
doTryButton("bGunTurret", "gunTurret");
} else if (str == "4") {
doTryButton("bTeslaCoil", "teslaCoil");
} else if (str == "3") {
doTryButton("bFlameTurret", "flameTurret");
}
if (gcm() == "default") {
if (str == "r") {
master.globalRepair();
}
} else if (gcm().substr(0, 1) == "i") {
if (str == "r") {
repairSelected();
}
}
}
function inDisables(str) {
var _local2 = 0;
while (_local2 < master.lData.disables.length) {
if (str.toLowerCase() == master.lData.disables[_local2].toLowerCase()) {
return(true);
}
_local2++;
}
return(false);
}
function doTryButton(str, disStr) {
var _local3 = str.substr(1, str.length - 1);
if (!inDisables(disStr)) {
doButtonThing(str);
}
}
function doButtonThing(str) {
doPressButton(str);
}
function showMenu(n, m) {
hideBldgButton();
var _local4 = false;
if (currMenu.substr(0, 1) == "b") {
_local4 = true;
}
master.inAMenu = false;
gotoAndStop(currMenu);
portrait.gotoAndStop(currMenu);
setTheHp(m.hp);
showUsage(currMenu.substr(1, currMenu.length - 1), m, _local4);
if (m.disabled == true) {
setDisableButtDown();
} else {
setDisableButtUp();
}
if (m.summoning == true) {
setSummonButtDown();
} else {
setSummonButtUp();
}
if (m.disabled == true) {
theStatus.gotoAndStop("disabled");
} else if (m.asleep == true) {
theStatus.gotoAndStop("asleep");
} else if (m.notEnoughFood == true) {
theStatus.gotoAndStop("food");
} else if (m.tooMuchGarbage == true) {
theStatus.gotoAndStop("waste");
} else if (m.needsRepair == true) {
theStatus.gotoAndStop("repair");
} else if (m.notEnoughEnergy == true) {
theStatus.gotoAndStop("energy");
} else {
theStatus.gotoAndStop("default");
}
if (currMenu == "imultiUnits") {
} else if (currMenu.substr(0, 1) == "b") {
showCost(currMenu.substr(1, currMenu.length - 1));
master.inAMenu = true;
} else if (currMenu.substr(0, 1) == "u") {
showLevels(currMenu.substr(1, currMenu.length - 1));
master.inAMenu = true;
hideCost();
}
if ((currMenu.substr(1, 7).toLowerCase() == "garbage") || (currMenu.substr(1, 7).toLowerCase() == "rubble")) {
amount = n;
organic = m.organic;
metal = m.metal;
reuse = m.reuse;
junk = m.junk;
} else if (currMenu.substr(1, 5).toLowerCase() == "metal") {
amount = n;
} else if (currMenu.substr(1, 2).toLowerCase() == "ff") {
amount = n;
} else if (currMenu.substr(1, 3).toLowerCase() == "gas") {
amount = n;
} else if (currMenu.substr(1, 6).toLowerCase() == "nwaste") {
amount = n;
} else if (currMenu.substr(1, 7).toLowerCase() == "factory") {
if (m.producing == false) {
hideUnitProduction();
}
} else if (currMenu.substr(1, 9).toLowerCase() == "teslacoil") {
amount = K.DMG_TESLACOIL;
} else if (currMenu.substr(1, 9).toLowerCase() == "gunturret") {
amount = K.DMG_GUNTURRET;
} else if (currMenu.substr(1, 11).toLowerCase() == "flameturret") {
amount = K.DMG_FLAMETURRET;
} else if (currMenu.substr(1, 11).toLowerCase() == "floodlights") {
amount = K.DMG_FLOODLIGHTS;
} else if (currMenu.substr(1, 8).toLowerCase() == "landfill") {
hideCost();
amount = m.getPercent();
if (master.allowRecycling == true) {
addOns._visible = true;
recyclingCenter._visible = true;
} else {
addOns._visible = false;
recyclingCenter._visible = false;
}
organic = m.amountOrganic;
metal = m.amountMetal;
reuse = m.amountReuse;
junk = m.amountJunk;
} else if (currMenu.substr(1, 15).toLowerCase() == "recyclingcenter") {
organic = m.organicIn;
metal_scrap = m.metalIn;
reuse = m.reuseIn;
gas = m.organicToGas;
metal = m.scrapToMetal;
energy = m.reuseToEnergy;
} else if (currMenu.substr(1, 11).toLowerCase() == "nucleardump") {
amount = m.getPercent();
}
master.disableThings();
hideBldgButtonNoHideCost();
}
function repairSelected() {
master.repairSelected();
}
function setTheHp(amt) {
hp.setAmount(amt);
hp.onLoad = function () {
this.setAmount(amt);
};
}
function onJuicyButtonClick(isDown) {
master.onJuicyButtonClick(isDown);
}
function setFactoryFlag() {
master.selectedThing.deployTheFlag();
master.playSound(0, "blop.wav", 1);
}
function hideCost() {
theCost._visible = false;
theCost.onLoad = function () {
this._visible = false;
};
}
function showUsage(str, m, buildMenu) {
setUsageKinds(str, m, buildMenu);
}
function setUsageKinds(theString, m, buildMenu) {
var use1 = "nothing";
var use2 = "nothing";
var make1 = "nothing";
var make2 = "nothing";
var make3 = "nothing";
var _local3 = 0;
var _local2 = 0;
var u1Amount = -1;
var u2Amount = -1;
var m1Amount = 1;
var m2Amount = 1;
var m3Amount = 1;
var _local4 = theString.toLowerCase();
var _local9 = false;
var _local8 = false;
var mileage = 0;
if (_local4 == "farm") {
use1 = "energy";
make1 = "food";
make2 = "garbage";
make3 = "smog";
_local3 = 1;
_local2 = 3;
u1Amount = K.E_IN_FARM;
m1Amount = K.F_OUT_FARM;
m2Amount = K.G_OUT_FARM;
m3Amount = K.S_OUT_FARM;
} else if (_local4 == "superfarm") {
use1 = "energy";
make1 = "food";
make2 = "garbage";
make3 = "smog";
_local3 = 1;
_local2 = 3;
u1Amount = K.E_IN_FARM;
m1Amount = K.F_OUT_SUPERFARM;
m2Amount = K.G_OUT_FARM;
m3Amount = K.S_OUT_FARM;
} else if (_local4 == "mine") {
if (buildMenu == true) {
_local3 = 1;
_local2 = 3;
use1 = "energy";
make1 = "metal";
make2 = "garbage";
u1Amount = K.E_IN_MINE;
m1Amount = K.M_OUT_MINE;
m2Amount = K.G_OUT_MINE;
}
if (buildMenu == false) {
use1 = "energy";
make1 = "metal";
make2 = "garbage";
_local3 = 1;
_local2 = 2;
u1Amount = K.E_IN_MINE;
m1Amount = m.metalOut;
m2Amount = K.G_OUT_MINE;
}
} else if (_local4 == "coalmine") {
if (buildMenu == true) {
use1 = "energy";
make1 = "coal";
make2 = "garbage";
_local3 = 1;
_local2 = 2;
u1Amount = K.E_IN_COALMINE;
m1Amount = K.C_OUT_COALMINE;
m2Amount = K.G_OUT_COALMINE;
}
if (buildMenu == false) {
use1 = "energy";
make1 = "coal";
make2 = "garbage";
_local3 = 1;
_local2 = 2;
u1Amount = K.E_IN_COALMINE;
m1Amount = m.coalOut;
m2Amount = K.G_OUT_COALMINE;
}
} else if (_local4 == "recyclingcenter") {
use1 = "energy";
u1Amount = K.E_IN_RECYCLINGCENTER;
_local3 = 1;
_local2 = 0;
} else if (_local4 == "factory") {
use1 = "energy";
use2 = "metal";
make1 = "units";
make2 = "smog";
make3 = "garbage";
_local3 = 2;
_local2 = 3;
u1Amount = K.E_IN_FACTORY;
u2Amount = K.M_IN_FACTORY;
m1Amount = 0;
m2Amount = K.getS_Usage("factory");
m3Amount = K.G_OUT_FACTORY;
} else if (_local4 == "coalplant") {
use1 = "coal";
make1 = "energy";
make2 = "smog";
_local3 = 1;
_local2 = 2;
u1Amount = K.COAL_IN_COALPLANT;
m1Amount = K.getE_Usage("coalplant");
m2Amount = K.getS_Usage("coalplant");
} else if (_local4 == "ffplant") {
use1 = "ff";
make1 = "energy";
make2 = "smog";
_local3 = 1;
_local2 = 2;
u1Amount = K.FF_IN_FFPLANT;
m1Amount = K.getE_Usage("ffplant");
m2Amount = K.getS_Usage("ffplant");
} else if (_local4 == "gasplant") {
use1 = "gas";
make1 = "energy";
make2 = "smog";
_local3 = 1;
_local2 = 2;
u1Amount = K.GAS_IN_GASPLANT;
m1Amount = K.getE_Usage("gasplant");
m2Amount = K.getS_Usage("gasplant");
} else if (_local4 == "geoplant") {
make1 = "energy";
_local3 = 0;
_local2 = 1;
m1Amount = K.getE_Usage("geoplant");
} else if (_local4 == "supergeoplant") {
make1 = "energy";
_local3 = 0;
_local2 = 1;
m1Amount = K.getE_Usage("geoplant") * 2;
} else if (_local4 == "solarplant") {
make1 = "energy";
_local3 = 0;
_local2 = 1;
m1Amount = m.energyOut;
if (!buildMenu) {
m1Amount = m.energyOut;
} else {
m1Amount = K.getE_Usage("solarplant");
}
} else if (_local4 == "hydroplant") {
make1 = "energy";
_local3 = 0;
_local2 = 1;
m1Amount = K.getE_Usage("hydroplant");
} else if (_local4 == "nuclearplant") {
make1 = "energy";
make2 = "nWaste";
_local2 = 2;
_local3 = 0;
m1Amount = K.getE_Usage("nuclearplant");
m2Amount = K.NWASTE_OUT_NUCLEARPLANT;
} else if (_local4 == "landfill") {
_local3 = 0;
_local2 = 0;
} else if (_local4 == "windplant") {
_local3 = 0;
_local2 = 1;
make1 = "energy";
if (!buildMenu) {
m1Amount = m.energyOut;
} else {
m1Amount = K.getE_Usage("windplant");
}
} else if (_local4 == "superwindplant") {
_local3 = 0;
_local2 = 1;
make1 = "energy";
if (!buildMenu) {
m1Amount = m.energyOut;
} else {
m1Amount = K.getE_Usage("superwindplant");
}
} else if (_local4 == "oilgaswell") {
_local3 = 1;
_local2 = 3;
use1 = "energy";
make1 = "FF";
make2 = "gas";
make3 = "garbage";
u1Amount = K.E_IN_OILGASWELL;
m1Amount = m.ffOut;
m2Amount = K.GAS_OUT_OILGASWELL;
m3Amount = K.G_OUT_OILGASWELL;
} else if (_local4 == "lab") {
_local3 = 1;
_local2 = 2;
use1 = "energy";
make1 = "research";
make2 = "garbage";
u1Amount = K.E_IN_LAB;
m1Amount = K.R_OUT_LAB;
m2Amount = K.G_OUT_LAB;
} else if (_local4 == "teslacoil") {
_local3 = 1;
use1 = "energy";
_local2 = 0;
u1Amount = K.E_IN_TESLACOIL;
} else if (_local4 == "floodlights") {
_local3 = 1;
use1 = "energy";
_local2 = 0;
u1Amount = K.E_IN_FLOODLIGHTS;
} else if (_local4 == "gunturret") {
_local3 = 1;
use1 = "metal";
_local2 = 0;
u1Amount = K.M_IN_GUNTURRET;
} else if (_local4 == "flameturret") {
_local3 = 2;
use1 = "ff";
use2 = "gas";
_local2 = 0;
u1Amount = K.R_IN_FLAMETURRET;
u2Amount = K.R_IN_FLAMETURRET;
_local9 = true;
} else if (_local4 == "fortress") {
_local3 = 1;
use1 = "energy";
u1Amount = K.E_IN_FORTRESS;
_local2 = 2;
make1 = "smog";
make2 = "garbage";
m1Amount = K.S_OUT_FORTRESS;
m2Amount = K.G_OUT_FORTRESS;
} else if (_local4 == "garbagetruck") {
_local8 = true;
use1 = m.fuelSource;
u1Amount = m.fuelConsumption;
make1 = "smog";
m1Amount = m.smogRate;
mileage = m.mpg;
} else if (_local4 == "engineer") {
_local8 = true;
use1 = m.fuelSource;
u1Amount = m.fuelConsumption;
make1 = "smog";
m1Amount = m.smogRate;
mileage = m.mpg;
}
var _local7 = "";
if (_local8 == true) {
_local7 = "fuel";
} else if (_local9) {
_local7 = _local7 + "usesOr";
} else {
if (_local3 > 0) {
_local7 = _local7 + ("uses" + _local3);
}
if (_local2 > 0) {
_local7 = _local7 + ("makes" + _local2);
}
}
usage.gotoAndStop(_local7);
usage.onLoad = function () {
this.setUseResources(use1, use2);
this.setMakeResources(make1, make2, make3);
this.setUsage(u1Amount, u2Amount);
this.setMake(m1Amount, m2Amount, m3Amount);
this.setUnitResources(use1, u1Amount, m1Amount, mileage);
};
usage.setUseResources(use1, use2);
usage.setMakeResources(make1, make2, make3);
usage.setUsage(u1Amount, u2Amount);
usage.setMake(m1Amount, m2Amount, m3Amount);
usage.setUnitResources(use1, u1Amount, m1Amount, mileage);
}
function showLevels(str) {
if (str.toLowerCase() == "fuel") {
showFuelLevels();
} else if (str.toLowerCase() == "factory") {
showRecyclingLevels();
} else {
var l = K.getLevels(str);
theLevel.onLoad = function () {
this.setStars(l, "gold");
};
theLevel.setStars(l, "gold");
}
}
function showRecyclingLevels() {
var f = K.getRecycleLevels();
recycleMetalLevel.onLoad = function () {
this.setStars(f[0], "white");
};
recyclePETELevel.onLoad = function () {
this.setStars(f[1], "magenta");
};
recycleGasLevel.onLoad = function () {
this.setStars(f[2], "blue");
};
recycleBiofuelLevel.onLoad = function () {
this.setStars(f[3], "yellow");
};
}
function showFuelLevels() {
var f = K.getFuelLevels();
gasolineLevel.onLoad = function () {
this.setStars(f[0], "white");
};
dieselLevel.onLoad = function () {
this.setStars(f[1], "green");
};
electricLevel.onLoad = function () {
this.setStars(f[2], "red");
};
ethanolLevel.onLoad = function () {
this.setStars(f[3], "yellow");
};
natGasLevel.onLoad = function () {
this.setStars(f[4], "blue");
};
fuelCellLevel.onLoad = function () {
this.setStars(f[5], "magenta");
};
gasolineLevel.setStars(f[0], "white");
dieselLevel.setStars(f[1], "green");
electricLevel.setStars(f[2], "red");
ethanolLevel.setStars(f[3], "yellow");
natGasLevel.setStars(f[4], "blue");
fuelCellLevel.setStars(f[5], "magenta");
}
function getUpgradeCost(target, upgrade, type) {
var _local5 = K.getLevels(target);
var _local2;
if (target.toLowerCase() == "recycling") {
_local2 = K.getRecyclingCost(upgrade);
} else if (target.toLowerCase() == "fuel") {
_local2 = K.getFuelCost(upgrade);
} else if (upgrade.toLowerCase() == "both") {
_local2 = K.getUpgradeCost(target);
}
_local2 = adjustUpgradeCost(_local2, target, type);
return(_local2);
}
function showLevelCost(target, upgrade, type) {
if (target.toLowerCase() == "fuel") {
showFuelCost(upgrade, target, type);
} else if (target.toLowerCase() == "recycling") {
showRecyclingCost(upgrade, target, type);
} else {
var _local4 = K.getLevels(target);
_local4[0] = _local4[0] + 1;
_local4[1] = _local4[1] + 1;
if (upgrade.toLowerCase() == "emissions") {
showCost((upgrade + "_") + _local4[0], true, target, type);
} else if (upgrade.toLowerCase() == "efficiency") {
showCost((upgrade + "_") + _local4[1], true, target, type);
} else if (upgrade.toLowerCase() == "both") {
showCost(target.toUpperCase(), true, target, type);
}
}
}
function adjustUpgradeCost(costs, str, type) {
var _local3;
switch (type) {
case K.BUILDING :
_local3 = master.bldgArray;
break;
case K.UNIT :
_local3 = master.uArray;
}
var _local4 = 0;
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].myMenu.toLowerCase() == str) {
_local4++;
}
_local2++;
}
costs[1] = costs[1] * _local4;
return(costs);
}
function showRecyclingCost(str, targetName, type) {
theCost._visible = true;
var c = K.getRecyclingCost(str);
if (c[0] == undefined) {
hideCost();
}
var r1;
var r2;
theCost.setResources("research", "energy");
r1 = "research";
r2 = "energy";
theCost.setCosts(c);
theCost.onLoad = function () {
this._visible = true;
this.setResources(r1, r2);
this.setCosts(c);
};
}
function showFuelCost(str, targetName, type) {
theCost._visible = true;
var c = K.getFuelCost(str);
if (c[0] == undefined) {
hideCost();
}
var r1;
var r2;
theCost.setResources("research", "energy");
c = adjustUpgradeCost(c, targetName, type);
r1 = "research";
r2 = "energy";
theCost.setCosts(c);
theCost.onLoad = function () {
this._visible = true;
this.setResources(r1, r2);
this.setCosts(c);
};
}
function showCost(str, isUpgrade, targetName, type) {
theCost._visible = true;
var c;
if (isUpgrade) {
c = K.getUpgradeCost(str);
} else {
c = K.getCost(str);
}
if (c[0] == undefined) {
hideCost();
} else {
var r1;
var r2;
if (isUpgrade != true) {
theCost.setResources("energy", "metal");
r1 = "energy";
r2 = "metal";
} else {
theCost.setResources("research", "energy");
c = adjustUpgradeCost(c, targetName, type);
r1 = "research";
r2 = "energy";
}
theCost.setCosts(c);
theCost.onLoad = function () {
this._visible = true;
this.setResources(r1, r2);
this.setCosts(c);
};
}
}
function checkCursor(str) {
if (str.substr(0, 1) == "b") {
if (str.substr(1, 1) != "_") {
buildCursor(str.substr(1, str.length - 1));
} else {
normalCursor();
}
} else {
normalCursor();
}
}
function doPressButton(str) {
pressButton(str);
}
function doActionButton(str) {
actionButton(str);
}
function pressButton(str) {
if (currMenu != str) {
lastMenu.push(currMenu);
currMenu = str;
showMenu();
checkCursor(str);
master.playSound(0, "click1.wav", 1);
}
}
function researchButton(str) {
master.selectedThing.researchUpgrade(str);
showUnitProduction(master.selectedThing);
}
function upgradeButton(target, upgrade, type) {
var _local2 = getUpgradeCost(target, upgrade, type);
if (_local2 != undefined) {
master.doUpgrade(target, upgrade, type, _local2);
}
showUpgradeButton(target, upgrade, type);
}
function buildButton(str) {
if (str == "RecyclingCenter") {
master.tryBuildBuilding(str, master.selectedThing.xTile + 1, master.selectedThing.yTile);
}
master.selectedThing.buildUnit(str);
}
function onPauseBuild() {
}
function onCancelBuild() {
master.selectedThing.cancelUnit();
scrapUnitProduction(master.selectedThing);
master.playSound(0, "dull.wav", 1);
}
function scrapUnitProduction() {
hideUnitProduction();
theProduction.setPercent(0);
}
function showUnitProduction(what) {
theProduction.turnOn();
theProduction.setUnit(what.currUnit);
if ((what.percent < 1) || (what.percent == undefined)) {
theProduction.setPercent(1);
} else {
theProduction.setPercent(what.percent);
}
theProduction.onLoad = function () {
this.turnOn();
this.setUnit(what.currUnit);
if (what.percent <= 1) {
this.setPercent(1);
} else {
this.setPercent(what.percent);
}
};
}
function hideUnitProduction() {
theProduction.onLoad = function () {
this.turnOff();
};
theProduction.turnOff();
hideCost();
}
function showUpgradeButton(target, upgrade, type) {
showLevelCost(target, upgrade, type);
if (target == "recycling") {
portrait.gotoAndStop("uRecycling_" + upgrade);
} else {
portrait.gotoAndStop("u" + upgrade);
}
}
function showUnitButton(str) {
showCost(str);
portrait.gotoAndStop("b" + str);
}
function showBldgButton(str) {
showCost(str);
portrait.gotoAndStop("b" + str);
}
function hideUnitButton() {
portrait.gotoAndStop(currMenu);
showObjective();
hideCost();
}
function showObjective() {
objective._visible = true;
var theObj = master.lData.getCurrObjective();
objective.setText(theObj);
var _local2 = this;
objective.onLoad = function () {
this.setText(theObj);
};
}
function hideObjective() {
objective._visible = false;
}
function hideBldgButtonNoHideCost() {
portrait.gotoAndStop(currMenu);
showObjective();
}
function hideBldgButton() {
portrait.gotoAndStop(currMenu);
showObjective();
hideCost();
}
function buildCursor(str) {
master.doBuildCursor(str);
}
function normalCursor(str) {
master.normalCursor(str);
}
function upgradeMenu() {
if (currMenu == "build") {
pressButton("upgrade");
} else if (currMenu.substr(0, 1) == "b") {
var _local2 = currMenu.substr(1, currMenu.length - 1);
pressButton("u" + _local2);
}
}
function buildMenu() {
if (currMenu == "upgrade") {
pressButton("build");
} else if (currMenu.substr(0, 1) == "u") {
var _local2 = currMenu.substr(1, currMenu.length - 1);
pressButton("b" + _local2);
}
}
function matchScreen(xx, yy) {
}
function snapScreenTo(xx, yy) {
}
function minimapLoaded() {
}
function drawMinimap(w, h, a) {
}
function hideMap() {
master.hideMap();
}
function showMap() {
master.showMap();
}
var sunLightStr = "Normal";
var windSpeedStr = "Normal";
var buildingMenu = false;
var amount = 0;
var waste = 0;
var doTheActions = false;
var endOfScore = false;
}
Symbol 2865 MovieClip [__Packages.CostDisplay] Frame 0
class CostDisplay extends MovieClip
{
var resource1, resource2, resource1Cost, resource2Cost;
function CostDisplay () {
super();
}
function onLoad() {
}
function setResources(str1, str2) {
resource1.gotoAndStop(str1);
resource2.gotoAndStop(str2);
}
function setCostsN(c1, c2) {
resource1Cost = c1;
resource2Cost = c2;
}
function setCosts(a) {
resource1Cost = a[0];
resource2Cost = a[1];
}
}
Symbol 2866 MovieClip [__Packages.UnitProduction] Frame 0
class UnitProduction extends MovieClip
{
var gotoAndStop, theProgress, hammer, _visible;
function UnitProduction () {
super();
}
function onLoad() {
var _local1 = true;
}
function setUnit(s) {
gotoAndStop(s);
}
function setPercent(p) {
percent = p;
theProgress.setAmount(percent);
hammer.play();
}
function turnOn() {
_visible = true;
}
function turnOff() {
hammer.gotoAndStop(0);
_visible = false;
}
var percent = 0;
var loaded = false;
}
Symbol 2867 MovieClip [__Packages.ProgressBar] Frame 0
class ProgressBar extends MovieClip
{
var gotoAndStop;
function ProgressBar () {
super();
}
function onLoad() {
}
function setAmount(a) {
num = a;
gotoAndStop(num);
amount = String(num + "%");
}
var amount = "100%";
var num = 100;
}
Symbol 2868 MovieClip [__Packages.ToggleButton] Frame 0
class ToggleButton extends MovieClip
{
var theButt, gotoAndStop;
function ToggleButton () {
super();
}
function onLoad() {
setButton();
}
function setButton() {
var back = this;
theButt.onRelease = function () {
back.toggleMe();
};
}
function setDown() {
isDown = true;
gotoAndStop("down");
}
function setUp() {
isDown = false;
gotoAndStop("up");
}
function setToDown() {
setDown();
setButton();
myFunction();
}
function setToUp() {
setUp();
setButton();
myFunction();
}
function toggleMe() {
if (!isDown) {
setDown();
} else {
setUp();
}
setButton();
myFunction();
}
function myFunction() {
}
var isDown = false;
}
Symbol 2869 MovieClip [__Packages.LevelStatus] Frame 0
class LevelStatus extends MovieClip
{
var gotoAndStop, s1, s2, s3;
function LevelStatus () {
super();
}
function onLoad() {
}
function setStars(i, color) {
stars = i;
setColor(color);
switch (i) {
case -1 :
gotoAndStop("blank");
break;
case 0 :
s1.gotoAndStop("empty");
s2.gotoAndStop("empty");
s3.gotoAndStop("empty");
break;
case 1 :
s1.gotoAndStop("default");
s2.gotoAndStop("empty");
s3.gotoAndStop("empty");
break;
case 2 :
s1.gotoAndStop("default");
s2.gotoAndStop("default");
s3.gotoAndStop("empty");
break;
case 3 :
s1.gotoAndStop("default");
s2.gotoAndStop("default");
s3.gotoAndStop("default");
}
}
function setGreen() {
setColor("green");
}
function setGold() {
setColor("gold");
}
function setColor(s) {
gotoAndStop(s);
}
var stars = 0;
}
Symbol 2870 MovieClip [__Packages.LevelStatus1] Frame 0
class LevelStatus1 extends LevelStatus
{
var gotoAndStop, s1;
function LevelStatus1 () {
super();
}
function onLoad() {
}
function setStars(i, color) {
stars = i;
setColor(color);
switch (i) {
case -1 :
gotoAndStop("blank");
break;
case 0 :
s1.gotoAndStop("empty");
break;
case 1 :
s1.gotoAndStop("default");
}
}
function setGreen() {
setColor("green");
}
function setGold() {
setColor("gold");
}
function setColor(s) {
gotoAndStop(s);
}
var stars = 0;
}
Symbol 2871 MovieClip [__Packages.ResourceAmount] Frame 0
class ResourceAmount extends MovieClip
{
var _in, _out, net, netButton, myType, myString, surplusDefecit, amount, _icon, hidden, gotoAndStop;
function ResourceAmount () {
super();
}
function onLoad() {
_in = 0;
_out = 0;
net = 0;
var back = this;
netButton.onRollOver = function () {
this._in = Math.round(back._in * 10) / 10;
this._out = Math.round(back._out * 10) / 10;
};
netButton.onRelease = function () {
this._parent._parent.master.showReport(back.myType);
};
}
function boink() {
}
function setIn(i) {
if (K.testUnd(i, "ResourceAmount.setIn")) {
_in = i;
}
}
function setOut(o) {
if (K.testUnd(o, "ResourceAmount.setOut")) {
_out = o;
}
}
function setType(t) {
myType = t;
switch (myType) {
case K.ENERGY :
myString = "energy";
break;
case K.FOOD :
myString = "food";
break;
case K.SMOG :
myString = "smog";
break;
case K.RESEARCH :
myString = "research";
break;
case K.METAL :
myString = "metal";
break;
case K.FF :
myString = "ff";
break;
case K.GAS :
myString = "gas";
break;
case K.COAL :
myString = "coal";
}
var back = this;
netButton.onRelease = function () {
this._parent._parent.master.showReport(back.myType);
};
}
function setNet(n, i, o) {
if (K.testUnd3(n, i, o, "ResourceAmount.setNet")) {
net = n;
setIn(i);
setOut(o);
if (net == 0) {
surplusDefecit.gotoAndStop("default");
} else if (net > 0) {
surplusDefecit.gotoAndStop("surplus");
surplusDefecit.amount = net;
} else if (net < 0) {
surplusDefecit.gotoAndStop("defecit");
surplusDefecit.amount = Math.abs(net);
}
}
}
function showGlowy() {
surplusDefecit.glowy.gotoAndPlay("yellow");
}
function tick() {
}
function setAmount(a) {
if (K.testUnd(a, "ResourceAmount.setAmount")) {
a = Math.round(a);
if (myType != K.SMOG) {
if (a < amount) {
_icon.gotoAndPlay("bounce");
} else if (a > amount) {
_icon.gotoAndPlay("make");
}
}
amount = a;
if (amount > 999) {
amount = 999;
}
if (amount < 0) {
amount = 0;
}
if (!hidden) {
checkAmount();
}
}
}
function checkAmount() {
switch (myType) {
case K.ENERGY :
if (amount < 10) {
gotoAndStop("1digit");
} else if (amount < 100) {
gotoAndStop("2digits");
} else if (amount < 150) {
gotoAndStop("low");
} else if (amount < 350) {
gotoAndStop("medium");
} else {
gotoAndStop("high");
}
break;
case K.FOOD :
if (amount < 10) {
gotoAndStop("1digit");
} else if (amount < 25) {
gotoAndStop("2digits");
} else if (amount < 50) {
gotoAndStop("medium");
} else if (amount < 100) {
gotoAndStop("high");
} else {
gotoAndStop("3digits");
}
break;
case K.SMOG :
if (amount < 100) {
gotoAndStop("low");
} else if (amount < 500) {
gotoAndStop("medium");
} else {
gotoAndStop("high");
}
var _local2 = Math.floor(amount / 100) + 1;
var _local3 = "level" + _local2;
_icon.gotoAndStop(_local3);
break;
default :
gotoAndStop("default");
}
}
function hideMe() {
hidden = true;
gotoAndStop("hide");
}
function showMe() {
hidden = false;
setAmount(amount);
}
function error() {
if (myType != K.SMOG) {
_icon.gotoAndPlay("error");
}
}
}
Symbol 2872 MovieClip [__Packages.TextThing] Frame 0
class TextThing extends MovieClip
{
var director, _parent, master, theText, portrait, gotoAndStop, report, onScore, objective, tutorial, titleName;
function TextThing () {
super();
}
function onLoad() {
director = _parent.master;
}
function setMaster(i) {
master = i;
director = i.master;
}
function setText(t) {
theText = t;
}
function setPortrait(p) {
portrait.gotoAndStop(p);
}
function getRecyclingStats() {
return(_parent.master.getRecyclingStats());
}
function getBuildingStats2(index) {
return(_parent.master.getBuildingStats2(index));
}
function getZombieStats() {
return(_parent.master.getZombieStats());
}
function getBuildingStats(index) {
return(_parent.master.getBuildingStats(index));
}
function getUnitStats(index) {
return(_parent.master.getUnitStats(index));
}
function setReport(type) {
switch (type) {
case K.ENERGY :
setEnergyReport();
break;
case K.FOOD :
setFoodReport();
break;
case K.SMOG :
setSmogReport();
break;
case K.GARBAGE :
setWasteReport();
break;
case K.COMPREHENSIVE :
setComprehensiveReport();
break;
case K.RECYCLING :
setRecyclingReport();
break;
default :
setResourceReport();
}
}
function setSmogReport() {
gotoAndStop("report");
report.gotoAndStop("smog");
calcSmogReport();
}
function calcSmogReport() {
var ff = getBuildingStats2(K.FFPLANT);
var coal = getBuildingStats2(K.COALPLANT);
var gas = getBuildingStats2(K.GASPLANT);
var nuke = getBuildingStats2(K.NUCLEARPLANT);
var wind = getBuildingStats2(K.WINDPLANT);
var geo = getBuildingStats2(K.GEOPLANT);
var solar = getBuildingStats2(K.SOLARPLANT);
var fort = getBuildingStats2(K.FORTRESS);
var farm = getBuildingStats2(K.FARM);
var lab = getBuildingStats2(K.LAB);
var mine = getBuildingStats2(K.MINE);
var coalmine = getBuildingStats2(K.COALMINE);
var landfill = getBuildingStats2(K.LANDFILL);
var well = getBuildingStats2(K.OILGASWELL);
var gtruck = getUnitStats(K.GARBAGETRUCK);
var engineer = getUnitStats(K.ENGINEER);
var z = getZombieStats();
var back = this;
with (report) {
ffx = ff[0];
coalx = coal[0];
ffout = ff[1];
coalout = coal[1];
gasx = gas[0];
gasout = gas[1];
nukex = nuke[0];
nukeout = nuke[1];
geox = geo[0];
geoout = geo[1];
fortx = fort[0];
fortout = fort[1];
farmx = farm[0];
farmout = farm[1];
labx = lab[0];
labout = lab[1];
coalminex = coalmine[0];
coalmineout = coalmine[1];
landfillx = landfill[0];
landfillout = landfill[1];
minex = mine[0];
mineout = mine[1];
wellx = well[0];
wellout = well[1];
gtruckx = gtruck[0];
gtruckout = gtruck[2];
engineerx = engineer[0];
engineerout = engineer[2];
deadzx = z[7];
deadzout = z[8];
naturalin = K.NATURAL_DILUTE;
smout = ((((((((((farmout + fortout) + labout) + mineout) + wellout) + gtruckout) + engineerout) + coalout) + gasout) + nukeout) + geoout) + deadzout;
smin = naturalin;
smnet = smout - smin;
smnet = Math.round(smnet * 1000) / 1000;
}
}
function setResourceReport() {
gotoAndStop("report");
report.gotoAndStop("resource");
calcResourceReport();
}
function calcResourceReport() {
var ff = getBuildingStats2(K.FFPLANT);
var coal = getBuildingStats2(K.COALPLANT);
var gas = getBuildingStats2(K.GASPLANT);
var lab = getBuildingStats2(K.LAB);
var mine = getBuildingStats2(K.MINE);
var coalmine = getBuildingStats2(K.COALMINE);
var well = getBuildingStats2(K.OILGASWELL);
var gtruck = getUnitStats(K.GARBAGETRUCK);
var engineer = getUnitStats(K.ENGINEER);
var back = this;
with (report) {
ffx = ff[0];
ffin = ff[3];
coalx = coal[0];
coalin = coal[3];
gasx = gas[0];
gasin = gas[3];
labx = lab[0];
labout = lab[2];
minex = mine[0];
mineout = mine[2];
coalminex = coalmine[0];
coalmineout = coalmine[2];
wellx = well[0];
wellffout = well[2] / 2;
wellgasout = well[2] / 2;
gtruckx = gtruck[0];
engineerx = engineer[0];
gtruckin = gtruck[1];
engineerin = engineer[1];
if (back.director.fleetFuelString == "gasoline") {
gtruckResource.gotoAndStop("ff");
engineerResource.gotoAndStop("ff");
} else if (back.director.fleetFuelString == "natGas") {
gtruckResource.gotoAndStop("gas");
engineerResource.gotoAndStop("gas");
} else if (back.director.fleetFuelString == "ethanol") {
gtruckResource.gotoAndStop("food");
engineerResource.gotoAndStop("food");
} else if (back.director.fleetFuelString == "electric") {
gtruckResource.gotoAndStop("energy");
engineerResource.gotoAndStop("energy");
}
metalnet = mineout;
researchnet = labout;
_ffout = wellffout;
_ffin = ffin;
_ffnet = _ffout - _ffin;
_gasout = wellgasout;
_gasin = gasin;
_gasnet = _gasout - _gasin;
_coalout = coalmineout;
_coalin = coalin;
_coalnet = _coalout - _coalin;
}
}
function calcRecyclingReport() {
var nuke = getBuildingStats2(K.NUCLEARPLANT);
var fort = getBuildingStats2(K.FORTRESS);
var farm = getBuildingStats2(K.FARM);
var factory = getBuildingStats2(K.FACTORY);
var landfill = getBuildingStats2(K.LANDFILL);
var dump = getBuildingStats2(K.NUCLEARDUMP);
var lab = getBuildingStats2(K.LAB);
var mine = getBuildingStats2(K.MINE);
var well = getBuildingStats2(K.OILGASWELL);
var coalmine = getBuildingStats2(K.COALMINE);
var recycling = getRecyclingStats();
var z = getZombieStats();
var back = this;
with (report) {
fortx = fort[0];
fortout = fort[4];
farmx = farm[0];
farmout = farm[4];
factoryx = factory[0];
factoryout = factory[4];
landfillx = landfill[0];
landfillin = landfill[4];
dumpx = dump[0];
dumpin = dump[4];
labx = lab[0];
labout = lab[4];
minex = mine[0];
mineout = mine[4];
coalminex = coalmine[0];
coalmineout = coalmine[4];
wellx = well[0];
wellout = well[3];
deadzx = z[0];
deadzout = z[1];
zgarbagex = z[2];
zgarbagein = z[3];
zwastex = z[4];
zwastein = z[5];
_fortout = fort[6];
_farmout = farm[6];
_factoryout = factory[6];
_labout = lab[6];
_coalmineout = coalmine[6];
_mineout = mine[6];
_wellout = well[6];
_deadzout = z[6];
recyclex = recycling[0];
scrapin = recycling[1];
usefulin = recycling[2];
organicin = recycling[3];
mout = recycling[4];
eout = recycling[5];
_gasout = recycling[6];
_scrapin = recycling[7];
_usefulin = recycling[8];
_organicin = recycling[9];
_mout = recycling[10];
_eout = recycling[11];
__gasout = recycling[12];
gout = ((((((fortout + farmout) + factoryout) + labout) + coalmineout) + mineout) + wellout) + deadzout;
gin = landfillin + zgarbagein;
var _gout = (((((((_fortout + _farmout) + _factoryout) + _labout) + _coalmineout) + _mineout) + _wellout) + _deadzout);
totalin = (scrapin + usefulin) + organicin;
totalout = (mout + eout) + _gasout;
_totalin = (_scrapin + _usefulin) + _organicin;
_totalout = (_mout + _eout) + __gasout;
gnet = gout - gin;
gnet = Math.round(gnet * 1000) / 1000;
}
}
function setWasteReport() {
gotoAndStop("report");
report.gotoAndStop("waste");
calcWasteReport();
}
function setRecyclingReport() {
gotoAndStop("report");
report.gotoAndStop("recycling");
calcRecyclingReport();
}
function endTheTextThing() {
if (onScore) {
if (normalScore) {
switchScore(K.TOTAL);
onScore = false;
} else {
_parent.endTextThing();
}
} else {
_parent.endTextThing();
}
}
function calcWasteReport() {
var nuke = getBuildingStats2(K.NUCLEARPLANT);
var fort = getBuildingStats2(K.FORTRESS);
var farm = getBuildingStats2(K.FARM);
var factory = getBuildingStats2(K.FACTORY);
var landfill = getBuildingStats2(K.LANDFILL);
var dump = getBuildingStats2(K.NUCLEARDUMP);
var lab = getBuildingStats2(K.LAB);
var mine = getBuildingStats2(K.MINE);
var well = getBuildingStats2(K.OILGASWELL);
var coalmine = getBuildingStats2(K.COALMINE);
var recycling = getRecyclingStats();
var z = getZombieStats();
var back = this;
with (report) {
nukex = nuke[0];
nukeout = nuke[5];
fortx = fort[0];
fortout = fort[4];
farmx = farm[0];
farmout = farm[4];
factoryx = factory[0];
factoryout = factory[4];
landfillx = landfill[0];
landfillin = landfill[4];
dumpx = dump[0];
dumpin = dump[4];
labx = lab[0];
labout = lab[4];
minex = mine[0];
mineout = mine[4];
coalminex = coalmine[0];
coalmineout = coalmine[4];
wellx = well[0];
wellout = well[3];
recyclex = recycling[0];
recyclein = (recycling[1] + recycling[2]) + recycling[3];
recycleout = (recycling[4] + recycling[5]) + recycling[6];
deadzx = z[0];
deadzout = z[1];
zgarbagex = z[2];
zgarbagein = z[3];
zwastex = z[4];
zwastein = z[5];
gout = ((((((fortout + farmout) + factoryout) + labout) + mineout) + coalmineout) + wellout) + deadzout;
gin = landfillin + zgarbagein;
nwout = nukeout;
nwin = dumpin + zwastein;
gnet = gout - gin;
nwnet = nwout - nwin;
gnet = Math.round(gnet * 1000) / 1000;
nwnet = Math.round(nwnet * 1000) / 1000;
}
}
function twoDecimals(num) {
return(Math.round(num * 100) / 100);
}
function switchScore(n) {
switch (n) {
case K.ENERGY :
report.gotoAndStop("energy_score");
break;
case K.RESOURCE :
report.gotoAndStop("resource_score");
break;
case K.POLLUTION :
report.gotoAndStop("pollution_score");
break;
case K.DEFENSE :
report.gotoAndStop("defense_score");
break;
case K.TIMETAKEN :
report.gotoAndStop("time_score");
break;
case K.TOTAL :
report.gotoAndStop("totalScore");
}
setScoreValues();
}
function setScoreValues() {
var d = _parent.master;
var b = this;
with (report) {
eProduced = 0;
eConsumed = 0;
metalProduced = 0;
metalConsumed = 0;
coalProduced = 0;
coalConsumed = 0;
ffProduced = 0;
ffConsumed = 0;
gasProduced = 0;
gasConsumed = 0;
smogProduced = 0;
metalMult = K.METAL_MULT;
coalMult = K.COAL_MULT;
gasMult = K.GAS_MULT;
ffMult = K.FF_MULT;
energyMult = K.ENERGY_MULT;
tSpent = 0;
tPar = 0;
tDifference = 0;
tMult = 0;
tFraction = 0;
tPercent = 0;
tSpent = d.daysSpent_Level;
tPar = d.lData.dayPar;
tDifference = tPar - tSpent;
tPenaltyMult = 0.8;
tBonusMult = 1.2;
tMult = 1;
if (tDifference != undefined) {
if (tDifference < 0) {
var i = 0;
while (i > tDifference) {
tMult = tMult * tPenaltyMult;
i--;
}
tPercent = Math.round(tMult * 100);
} else {
var i = 0;
while (i < tDifference) {
tMult = tMult * tBonusMult;
i++;
}
tPercent = Math.round(tMult * 100);
}
} else {
K.error("TextThing", "setScoreValues", "tDifference=undefined!");
}
eProduced = b.twoDecimals(d.energyProduced_Level);
eBonus = eProduced;
eConsumed = b.twoDecimals(d.energyConsumed_Level);
ePenalty = eConsumed;
ePenalty = ePenalty * -1;
eScore = eBonus + ePenalty;
eScore = Math.round(eScore);
eConsumed = -eConsumed;
metalProduced = d.metalProduced_Level;
ffProduced = d.fossilFuelsProduced_Level;
gasProduced = d.naturalGasProduced_Level;
coalProduced = d.coalProduced_Level;
metalConsumed = d.metalConsumed_Level;
ffConsumed = d.fossilFuelsConsumed_Level;
gasConsumed = d.naturalGasConsumed_Level;
coalConsumed = d.coalConsumed_Level;
metalProduced = b.twoDecimals(metalProduced);
ffProduced = b.twoDecimals(ffProduced);
gasProduced = b.twoDecimals(gasProduced);
coalProduced = b.twoDecimals(coalProduced);
metalConsumed = b.twoDecimals(metalConsumed);
ffConsumed = b.twoDecimals(ffConsumed);
gasConsumed = b.twoDecimals(gasConsumed);
coalConsumed = b.twoDecimals(coalConsumed);
metalBonus = metalProduced * metalMult;
ffBonus = ffProduced * ffMult;
gasBonus = gasProduced * gasMult;
coalBonus = coalProduced * coalMult;
metalPenalty = (metalConsumed * metalMult) * -1;
ffPenalty = (ffConsumed * ffMult) * -1;
gasPenalty = (gasConsumed * gasMult) * -1;
coalPenalty = (coalConsumed * coalMult) * -1;
rBonus = ((metalBonus + ffBonus) + gasBonus) + coalBonus;
rPenalty = ((metalPenalty + ffPenalty) + gasPenalty) + coalPenalty;
rBonus = b.twoDecimals(rBonus);
rPenalty = b.twoDecimals(rPenalty);
rScore = rBonus + rPenalty;
rScore = Math.round(rScore);
metalMultNeg = metalMult * -1;
coalMultNeg = coalMult * -1;
gasMultNeg = gasMult * -1;
ffMultNeg = ffMult * -1;
energyMultNeg = energyMult * -1;
nwasteProduced = d.nwasteProduced_Level;
nwasteConsumed = d.nwasteConsumed_Level;
garbageConsumed = d.garbageConsumed_Level;
garbageProduced = d.garbageProduced_Level;
smogConsumed = d.smogConsumed_Level;
smogProduced = d.smogProduced_Level;
leaksProduced = d.pollutionSpills_Level;
leaksConsumed = d.pollutionCleanups_Level;
garbageEaten = d.garbageEaten_Level;
nwasteEaten = d.nwasteEaten_Level;
pollutionMult = K.POLLUTION_MULT;
cleanupMult = K.CLEANUP_MULT;
smogMult = K.SMOG_MULT;
smogMult2 = K.SMOG_MULT * 0.9;
garbageMult = K.GARBAGE_MULT;
garbageMult2 = K.GARBAGE_MULT * 0.9;
nwasteMult = K.NWASTE_MULT;
nwasteMult2 = K.NWASTE_MULT * 0.99;
pollutionMult = pollutionMult * -1;
smogMult = smogMult * -1;
garbageMult = garbageMult * -1;
nwasteMult = nwasteMult * -1;
nwastePenalty = nwasteProduced * nwasteMult;
garbagePenalty = garbageProduced * garbageMult;
smogPenalty = smogProduced * smogMult;
leaksPenalty = leaksProduced * pollutionMult;
garbageEatenPenalty = garbageEaten * garbageMult;
nwasteEatenPenalty = nwasteEaten * nwasteMult;
nwasteBonus = nwasteConsumed * nwasteMult2;
garbageBonus = garbageConsumed * garbageMult2;
smogBonus = smogConsumed * smogMult2;
leaksBonus = leaksConsumed * cleanupMult;
pBonus = ((garbageBonus + smogBonus) + leaksBonus) + nwasteBonus;
pPenalty = ((((garbagePenalty + smogPenalty) + leaksPenalty) + garbageEatenPenalty) + nwasteEatenPenalty) + nwastePenalty;
pBonus = b.twoDecimals(pBonus);
pPenalty = b.twoDecimals(pPenalty);
pScore = b.twoDecimals(pBonus + pPenalty);
pScore = Math.round(pScore);
zombieMult = K.ZOMBIEKILL_MULT;
zombiesNeutralized = d.zombiesNeutralized_Level;
zombieBonus = zombiesNeutralized * zombieMult;
metalConsumedDefense = d.defenseMetalConsumed_Level;
ffConsumedDefense = d.defenseFFConsumed_Level;
gasConsumedDefense = d.defenseGasConsumed_Level;
energyConsumedDefense = d.defenseEnergyConsumed_Level;
metalConsumedDefense = b.twoDecimals(metalConsumedDefense);
ffConsumedDefense = b.twoDecimals(ffConsumedDefense);
gasConsumedDefense = b.twoDecimals(gasConsumedDefense);
energyConsumedDefense = b.twoDecimals(energyConsumedDefense);
metalDefensePenalty = metalConsumedDefense * metalMult;
ffDefensePenalty = ffConsumedDefense * ffMult;
gasDefensePenalty = gasConsumedDefense * gasMult;
energyDefensePenalty = energyConsumedDefense * energyMult;
ammoUsed = ((metalConsumedDefense + ffConsumedDefense) + gasConsumedDefense) + energyConsumedDefense;
ammoPenalty = ((metalDefensePenalty + ffDefensePenalty) + gasDefensePenalty) + energyDefensePenalty;
if (ammoPenalty == 0) {
ammoPenalty = 1;
}
dBonus = zombieBonus;
dPenalty = ammoPenalty;
dPenaltyDiv = Math.abs(dPenalty);
if (dPenalty != 0) {
dEff = dBonus / dPenaltyDiv;
} else {
dEff = 0;
}
dEfficiency = Math.round(dEff * 100);
d.logDefenseEfficiency(dEfficiency);
defenseEff = String(dEfficiency + "%");
dScore = b.twoDecimals(dBonus * dEff);
dScore = Math.round(dScore);
levelBonus = d.getLevelBonus();
levelScore = levelBonus;
subScore = (((eScore + rScore) + pScore) + dScore) + levelScore;
finalScore = subScore * tMult;
finalScore = Math.round(finalScore);
d.setLevelScore(finalScore);
totalScore = d.getTotalScore();
totalScore = totalScore + finalScore;
chap1 = (chap2 = (chap3 = (chap4 = (chap5 = (chap6 = (chap7 = (chap8 = (chap9 = (chapTotal = 0)))))))));
var statNugget = d.master.statNugget;
var theLevel = d.lData.myIndex;
chap1 = statNugget.score_level_01;
chap2 = statNugget.score_level_02;
chap3 = statNugget.score_level_03;
chap4 = statNugget.score_level_04;
chap5 = statNugget.score_level_05;
chap6 = statNugget.score_level_06;
chap7 = statNugget.score_level_07;
chap8 = statNugget.score_level_08;
chap9 = statNugget.score_level_09;
switch (theLevel) {
case 1 :
chap1 = finalScore;
break;
case 2 :
chap2 = finalScore;
break;
case 3 :
chap3 = finalScore;
break;
case 4 :
chap4 = finalScore;
break;
case 5 :
chap5 = finalScore;
break;
case 6 :
chap6 = finalScore;
break;
case 7 :
chap7 = finalScore;
break;
case 8 :
chap8 = finalScore;
break;
case 9 :
chap9 = finalScore;
}
chapTotal = (((((((chap1 + chap2) + chap3) + chap4) + chap5) + chap6) + chap7) + chap8) + chap9;
if (d.lData.inCampaign) {
b._parent.submitTheScore(chap1, chap2, chap3, chap4, chap5, chap6, chap7, chap8, chap9, chapTotal);
}
if (d.lData.isChallenge) {
b._parent.submitChallengeScore(finalScore);
}
}
}
function returnScore() {
if (normalScore) {
report.gotoAndStop("score");
} else if (sandboxScore) {
report.gotoAndStop("sandboxScore");
}
onScore = true;
}
function showSandboxScore() {
gotoAndStop("report");
report.gotoAndStop("sandboxScore");
normalScore = false;
sandboxScore = true;
setScoreValues();
}
function showFinalScore() {
gotoAndStop("report");
report.gotoAndStop("score");
normalScore = true;
sandboxScore = false;
setScoreValues();
onScore = true;
}
function setComprehensiveReport() {
gotoAndStop("report");
report.gotoAndStop("comprehensive");
calcComprehensiveReport();
}
function calcComprehensiveReport() {
var coal1 = getBuildingStats(K.COALPLANT);
var ff1 = getBuildingStats(K.FFPLANT);
var gas1 = getBuildingStats(K.GASPLANT);
var nuke1 = getBuildingStats(K.NUCLEARPLANT);
var geo1 = getBuildingStats(K.GEOPLANT);
var wind1 = getBuildingStats(K.WINDPLANT);
var solar1 = getBuildingStats(K.SOLARPLANT);
var lab1 = getBuildingStats(K.LAB);
var fort1 = getBuildingStats(K.FORTRESS);
var mine1 = getBuildingStats(K.MINE);
var coalmine1 = getBuildingStats(K.COALMINE);
var well1 = getBuildingStats(K.OILGASWELL);
var farm1 = getBuildingStats(K.FARM);
var coal2 = getBuildingStats2(K.COALPLANT);
var ff2 = getBuildingStats2(K.FFPLANT);
var gas2 = getBuildingStats2(K.GASPLANT);
var nuke2 = getBuildingStats2(K.NUCLEARPLANT);
var geo2 = getBuildingStats(K.GEOPLANT);
var wind2 = getBuildingStats(K.WINDPLANT);
var solar2 = getBuildingStats(K.SOLARPLANT);
var lab2 = getBuildingStats2(K.LAB);
var fort2 = getBuildingStats2(K.FORTRESS);
var mine2 = getBuildingStats2(K.MINE);
var coalmine2 = getBuildingStats2(K.COALMINE);
var well2 = getBuildingStats2(K.OILGASWELL);
var farm2 = getBuildingStats2(K.FARM);
var landfill = getBuildingStats2(K.LANDFILL);
var dump = getBuildingStats2(K.NUCLEARDUMP);
var naturalin = K.NATURAL_DILUTE;
var gtruck = getUnitStats(K.GARBAGETRUCK);
var engineer = getUnitStats(K.ENGINEER);
var back = this;
with (report) {
plantsx = (((((coal1[0] + ff1[0]) + gas1[0]) + nuke1[0]) + geo1[0]) + wind1[0]) + solar1[0];
plantsout_e = (((((coal1[2] + ff1[2]) + gas1[2]) + nuke1[2]) + geo1[2]) + wind1[2]) + solar1[2];
plantsout_s = (((((coal2[1] + ff2[1]) + gas2[1]) + nuke2[1]) + geo2[1]) + wind2[1]) + solar2[1];
nukeout_nw = nuke2[5];
plantsin_f = (((((coal1[3] + ff1[3]) + gas1[3]) + nuke1[3]) + geo1[3]) + wind1[3]) + solar1[3];
plantsin_ff = ff2[3];
plantsin_gas = gas2[3];
plantsin_coal = coal2[3];
farmx = farm1[0];
farmout_f = farm1[4];
farmout_s = farm2[1];
farmout_g = farm2[4];
farmin_e = farm1[1];
extractx = (mine1[0] + well1[0]) + coal1[0];
extractout_ff = well2[2] / 2;
extractout_gas = well2[2] / 2;
extractout_m = mine2[2];
extractout_s = (mine2[1] + well2[1]) + coalmine2[1];
extractout_g = (mine2[4] + well2[4]) + coalmine2[4];
extractout_c = coalmine2[2];
extractin_e = (mine1[1] + well1[1]) + coalmine1[1];
extractin_f = (mine1[3] + well1[3]) + coalmine1[3];
civx = lab1[0] + fort1[0];
civout_g = lab2[4] + fort2[4];
civout_s = lab2[1] + fort2[1];
civout_r = lab2[2];
civin_e = lab1[1] + fort1[1];
civin_f = lab1[3] + fort1[3];
carsx = gtruck[0] + engineer[0];
carsin = gtruck[1] + engineer[1];
carsin_e = 0;
carsin_f = 0;
carsin_gas = 0;
carsin_ff = 0;
carsout_s = gtruck[2] + engineer[2];
if (back.director.fleetFuelString == "gasoline") {
carResource.gotoAndStop("ff");
carsin_ff = carsin;
} else if (back.director.fleetFuelString == "natGas") {
carResource.gotoAndStop("gas");
carsin_gas = carsin;
} else if (back.director.fleetFuelString == "ethanol") {
carResource.gotoAndStop("food");
carsin_f = carsin;
} else if (back.director.fleetFuelString == "electric") {
carResource.gotoAndStop("energy");
carsin_e = carsin;
}
dispin_g = landfill[4];
dispin_nw = dump[4];
dispx = landfill[0] + dump[0];
eout = plantsout_e;
_ffout = extractout_ff;
_coalout = extractout_c;
_gasout = extractout_gas;
gwout = ((farmout_g + extractout_g) + civout_g) + nukeout_nw;
smout = (((plantsout_s + farmout_s) + extractout_s) + civout_s) + carsout_s;
fout = farmout_f;
_coalin = plantsin_coal;
ein = ((extractin_e + farmin_e) + civin_e) + carsin_e;
_ffin = plantsin_ff + carsin_ff;
_gasin = plantsin_gas + carsin_gas;
gwin = dispin_g + dispin_nw;
smin = K.NATURAL_DILUTE;
fin = ((plantsin_f + extractin_f) + civin_f) + carsin_f;
_coalnet = _coalout - _coalin;
enet = eout - ein;
_ffnet = _ffout - _ffin;
_gasnet = _gasout - _gasin;
gwnet = gwout - gwin;
smnet = smout - smin;
fnet = fout - fin;
}
}
function setFoodReport() {
gotoAndStop("report");
report.gotoAndStop("food");
calcFoodReport();
}
function calcFoodReport() {
var ff = getBuildingStats(K.FFPLANT);
var coal = getBuildingStats(K.COALPLANT);
var gas = getBuildingStats(K.GASPLANT);
var nuke = getBuildingStats(K.NUCLEARPLANT);
var wind = getBuildingStats(K.WINDPLANT);
var geo = getBuildingStats(K.GEOPLANT);
var solar = getBuildingStats(K.SOLARPLANT);
var fort = getBuildingStats(K.FORTRESS);
var farm = getBuildingStats(K.FARM);
var lab = getBuildingStats(K.LAB);
var mine = getBuildingStats(K.MINE);
var coalmine = getBuildingStats(K.COALMINE);
var well = getBuildingStats(K.OILGASWELL);
var gtruck = getUnitStats(K.GARBAGETRUCK);
var engineer = getUnitStats(K.ENGINEER);
var back = this;
with (report) {
ffx = ff[0];
ffin = ff[3];
gasx = gas[0];
gasin = gas[3];
nukex = nuke[0];
nukein = nuke[3];
geox = geo[0];
geoin = geo[3];
fortx = fort[0];
fortin = fort[3];
farmx = farm[0] - farm[5];
farmout = farm[4] - farm[9];
superfarmx = farm[5];
superfarmout = farm[9];
labx = lab[0];
labin = lab[3];
minex = mine[0];
minein = mine[3];
coalminex = coalmine[0];
coalminein = coalmine[3];
coalx = coal[0];
coalin = coal[3];
wellx = well[0];
wellin = well[3];
gtruckx = gtruck[0];
engineerx = engineer[0];
if (back.director.fleetFuelString == "ethanol") {
gtruckin = gtruck[1];
engineerin = engineer[1];
} else {
gtruckin = 0;
engineerin = 0;
}
fout = farmout + superfarmout;
fin = (((((((((fortin + labin) + minein) + coalminein) + wellin) + gtruckin) + engineerin) + ffin) + gasin) + nukein) + geoin;
fnet = fout - fin;
fnet = Math.round(fnet * 1000) / 1000;
}
}
function switchReport(t) {
setReport(t);
}
function setEnergyReport() {
gotoAndStop("report");
report.gotoAndStop("energy");
calcEnergyReport();
}
function calcEnergyReport() {
var ff = getBuildingStats(K.FFPLANT);
var coal = getBuildingStats(K.COALPLANT);
var gas = getBuildingStats(K.GASPLANT);
var nuke = getBuildingStats(K.NUCLEARPLANT);
var wind = getBuildingStats(K.WINDPLANT);
var geo = getBuildingStats(K.GEOPLANT);
var solar = getBuildingStats(K.SOLARPLANT);
var fort = getBuildingStats(K.FORTRESS);
var farm = getBuildingStats(K.FARM);
var lab = getBuildingStats(K.LAB);
var recycling = getBuildingStats(K.RECYCLINGCENTER);
var mine = getBuildingStats(K.MINE);
var coalmine = getBuildingStats(K.MINE);
var well = getBuildingStats(K.OILGASWELL);
var gtruck = getUnitStats(K.GARBAGETRUCK);
var engineer = getUnitStats(K.ENGINEER);
var back = this;
with (report) {
coalx = coal[0];
coalout = coal[2];
gasx = gas[0];
gasout = gas[2];
nukex = nuke[0];
nukeout = nuke[2];
windx = wind[0];
windout = wind[2];
geox = geo[0];
geoout = geo[2];
solarx = solar[0];
solarout = solar[2];
fortx = fort[0];
fortin = fort[1];
farmx = farm[0];
farmin = farm[1];
labx = lab[0];
labin = lab[1];
recyclingx = recycling[0];
recyclingin = recycling[1];
minex = mine[0];
minein = mine[1];
coalminex = coalmine[0];
coalminein = coalmine[1];
wellx = well[0];
wellin = well[1];
gtruckx = gtruck[0];
engineerx = engineer[0];
if (back.director.fleetFuelString == "electric") {
gtruckin = gtruck[1];
engineerin = engineer[1];
} else {
gtruckin = 0;
engineerin = 0;
}
eout = ((((coalout + gasout) + nukeout) + windout) + geoout) + solarout;
ein = (((((fortin + farmin) + labin) + minein) + wellin) + gtruckin) + engineerin;
enet = eout - ein;
enet = Math.round(enet * 1000) / 1000;
}
}
function setObjective(o) {
objective = o;
o = o == undefined;
if (o) {
objective = "";
}
}
function setTutorial(t) {
if ((t == undefined) || (t == "")) {
if ((objective == "") || (objective == undefined)) {
gotoAndStop("default");
} else {
gotoAndStop("objective");
}
} else {
gotoAndStop("tutorial");
tutorial.gotoAndStop(t);
}
}
function setTitle(t) {
titleName = t;
}
var normalScore = false;
var sandboxScore = false;
}
Symbol 2873 MovieClip [__Packages.HpBar] Frame 0
class HpBar extends MovieClip
{
var gotoAndStop;
function HpBar () {
super();
}
function onLoad() {
}
function setAmount(a) {
amount = Math.round(a);
gotoAndStop(amount);
}
var amount = 100;
}
Symbol 2874 MovieClip [__Packages.UsageMeter] Frame 0
class UsageMeter extends MovieClip
{
var uses1, uses2, makes1, makes2, makes3;
function UsageMeter () {
super();
}
function onLoad() {
}
function setUsage(u1, u2) {
uses1.setAmount(-Math.abs(u1));
uses2.setAmount(-Math.abs(u2));
}
function setMake(m1, m2, m3) {
makes1.setAmount(m1);
makes2.setAmount(m2);
makes3.setAmount(m3);
}
function setUseResources(u1, u2) {
uses1.setResource(u1);
uses2.setResource(u2);
}
function setMakeResources(m1, m2, m3) {
makes1.setResource(m1);
makes2.setResource(m2);
makes3.setResource(m3);
}
function setUnitResources(u1, u1amt, smog, mileage) {
uses1.setResource(u1);
uses1.setAmount(-Math.abs(u1amt));
smogAmt = smog;
mpgAmt = mileage;
}
var smogAmt = 0;
var mpgAmt = 0;
}
Symbol 2875 MovieClip [__Packages.UsageLine] Frame 0
class UsageLine extends MovieClip
{
var theAmount, gotoAndStop, amount, theResource, resource;
function UsageLine () {
super();
}
function onLoad() {
}
function setAmount(amt) {
theAmount = amt;
if (theAmount < 0) {
gotoAndStop("uses");
} else if (theAmount > 0) {
gotoAndStop("makes");
} else {
gotoAndStop("default");
}
theAmount = Math.round(amt * 10) / 10;
theAmount = Math.abs(theAmount);
amount = String(theAmount);
}
function setResource(what) {
onLoad = function () {
this.theResource = what;
this.resource.gotoAndStop(this.theResource);
};
theResource = what;
resource.gotoAndStop(theResource);
}
}
Symbol 2876 MovieClip [__Packages.Terrain] Frame 0
class Terrain extends MovieClip
{
var master, tBmp, dirtBmp, grassBmp, metalBmp, hardBmp, coalBmp, oilBmp, geoBmp, oil_smallBmp, geo_smallBmp, tileset, attachMovie, getNextHighestDepth, dirtCanvas, createEmptyMovieClip, canvas, featureCanvas, bumpCanvas, cBmp, fBmp, dcBmp, bakeLevel;
function Terrain () {
super();
}
function onLoad() {
}
function setMaster(d) {
master = d;
}
function makeMap() {
setup();
drawTheMap();
}
function setup() {
tBmp = new flash.display.BitmapData(K.TILESET_WIDTH_PX, K.TILESET_WIDTH_PX, false, 0);
dirtBmp = flash.display.BitmapData.loadBitmap("tile_dirt.png");
grassBmp = flash.display.BitmapData.loadBitmap("tile_grass.png");
metalBmp = flash.display.BitmapData.loadBitmap("tile_metal.png");
hardBmp = flash.display.BitmapData.loadBitmap("tile_hard.png");
coalBmp = flash.display.BitmapData.loadBitmap("tile_coal.png");
oilBmp = flash.display.BitmapData.loadBitmap("tile_oil_big.png");
geoBmp = flash.display.BitmapData.loadBitmap("tile_geo_big.png");
oil_smallBmp = flash.display.BitmapData.loadBitmap("tile_oil_small.png");
geo_smallBmp = flash.display.BitmapData.loadBitmap("tile_geo_small.png");
tileset = attachMovie("mc_tileset", "tileset", getNextHighestDepth());
tileset._x = -tileset._width;
tileset._y = -tileset._height;
tBmp.draw(tileset);
tileset.removeMovieClip();
dirtCanvas = createEmptyMovieClip("dirtCanvas", getNextHighestDepth());
canvas = createEmptyMovieClip("canvas", getNextHighestDepth());
featureCanvas = createEmptyMovieClip("featureCanvas", getNextHighestDepth());
bumpCanvas.swapDepths(getNextHighestDepth() + 10);
cBmp = new flash.display.BitmapData(getPxWidth(), getPxHeight(), true, 15658751);
fBmp = new flash.display.BitmapData(getPxWidth(), getPxHeight(), true, 15658751);
dcBmp = new flash.display.BitmapData(getPxWidth(), getPxHeight(), false, 15658751);
canvas.attachBitmap(cBmp, 2, "auto", true);
dirtCanvas.attachBitmap(dcBmp, 2, "auto", true);
featureCanvas.attachBitmap(fBmp, 2, "auto", true);
var _local2 = new flash.filters.DropShadowFilter();
_local2.angle = 45;
_local2.strength = 0.5;
_local2.blurX = 10;
_local2.blurY = 10;
_local2.distance = 0;
var _local3 = canvas.filters;
_local3.push(_local2);
_local2.inner = true;
_local3.push(_local2);
canvas.filters = _local3;
}
function setBakeLevel(i, isSand) {
var _local3;
if (i < 0) {
i = Math.abs(i);
_local3 = "s" + i;
} else {
_local3 = "" + i;
}
bakeLevel.gotoAndStop(_local3);
}
function getPxWidth() {
return(master.getLvlPxWidth());
}
function getPxHeight() {
return(master.getLvlPxHeight());
}
function drawTheMap() {
K.success(c, "drawTheMap", "drawing map!");
var _local3 = 0;
while (_local3 < getHeight()) {
var _local2 = 0;
while (_local2 < getWidth()) {
drawDirtTile(_local2, _local3);
drawTileThingy(getProp(_local2, _local3), _local2, _local3);
_local2++;
}
_local3++;
}
drawHeightData();
master.onMapDrawn();
}
function getHeight() {
return(master.getLvlHeight());
}
function getWidth() {
return(master.getLvlWidth());
}
function getProp(xx, yy) {
return(master.getLvlProp(xx, yy));
}
function getTile(xx, yy) {
return(master.getLvlTile(xx, yy));
}
function buildMode(str) {
}
function unBuildMode() {
}
function onPress() {
master.onPressTerrain();
}
function onRelease() {
master.onClickTerrain();
}
function onReleaseOutside() {
master.onClickTerrainOutside();
}
function drawDirtTile(xx, yy) {
var _local2 = new flash.geom.Rectangle(0, 0, 41, 40);
blitDirtTile(_local2, xx * 2, yy * 2);
}
function drawTileThingy(i, xx, yy) {
var _local2;
var _local3 = false;
switch (i) {
case K.GRASS :
_local2 = grassBmp;
break;
case K.STONE :
_local2 = metalBmp;
break;
case K._MINE :
_local2 = metalBmp;
break;
case K.HARD :
_local2 = hardBmp;
break;
case K.COALSPOT :
_local2 = coalBmp;
break;
case K.GEO :
_local3 = true;
break;
case K.GEO_BIG :
_local3 = true;
break;
case K.OIL :
_local3 = true;
break;
case K.OIL_BIG :
_local3 = true;
}
if (!_local3) {
var _local5 = new flash.geom.Rectangle(0, 0, 41, 40);
if (i != K.DIRT) {
blitTileThingy(_local2, _local5, xx * 2, yy * 2);
}
} else {
var _local5 = new flash.geom.Rectangle(0, 0, 16, 16);
drawTileFeature(i, xx, yy);
}
}
function drawTileFeature(i, xx, yy) {
var _local3;
var _local2;
var _local4;
var _local5;
_local5 = 0;
_local4 = _local5;
switch (i) {
case K.GEO :
_local3 = geo_smallBmp;
var _local7 = K.randRange(0, 2);
var _local6 = K.randRange(0, 2);
_local2 = new flash.geom.Rectangle(_local7 * 16, _local6 * 16, 16, 16);
_local5 = 8;
_local4 = _local5;
break;
case K.GEO_BIG :
_local3 = geoBmp;
_local2 = new flash.geom.Rectangle(0, 0, 32, 32);
break;
case K.OIL :
_local3 = oil_smallBmp;
_local2 = new flash.geom.Rectangle(0, 0, 16, 16);
_local5 = 8;
_local4 = _local5;
break;
case K.OIL_BIG :
_local3 = oilBmp;
_local2 = new flash.geom.Rectangle(0, 0, 32, 32);
}
blitTileFeature(_local3, _local2, xx * 2, yy * 2, _local4, _local5);
}
function pasteTile(i, xx, yy) {
var _local3 = Math.floor(i / K.TILESET_WIDTH) * K.TILE_SIZE;
var _local4 = (i % K.TILESET_WIDTH) * K.TILE_SIZE;
var _local2 = new flash.geom.Rectangle(_local4, _local3, K.TILE_SIZE, K.TILE_SIZE);
blitTile(_local2, xx, yy);
}
function drawBakeLevel() {
setBakeLevel(master.lData.otherIndex, master.lData.inSandbox);
drawHeightData();
}
function drawHeightData() {
bumpCanvas.swapDepths(canvas.getDepth() + 10);
bumpCanvas.createEmptyMovieClip("mc", bumpCanvas.getNextHighestDepth());
if (master.lData.hArray != undefined) {
var _local3 = 0;
while (_local3 < master.lData.pHeight) {
var _local2 = 0;
while (_local2 < master.lData.pWidth) {
if (master.lData.hArray[_local3][_local2] == 1) {
var _local4 = bumpCanvas.mc.attachMovie("mc_landblob", (("lb_" + _local3) + "_") + _local2, bumpCanvas.mc.getNextHighestDepth());
_local4._x = (_local2 * K.TILE_SIZE) * 2;
_local4._y = (_local3 * K.TILE_SIZE) * 2;
}
_local2++;
}
_local3++;
}
var _local5 = new flash.filters.BevelFilter();
_local5.distance = 5;
_local5.blurX = 10;
_local5.blurY = 10;
_local5.strength = 1.5;
_local5.quality = 2;
_local5.type = "full";
_local5.shadowColor = 3355443 /* 0x333333 */;
var _local6 = bumpCanvas.mc.filters;
_local6.push(_local5);
bumpCanvas.mc.filters = _local6;
bumpCanvas.blendMode = "overlay";
}
}
function blitTileFeature(bmp, rect, xx, yy, xoff, yoff) {
fBmp.copyPixels(bmp, rect, new flash.geom.Point((xx * K.TILE_SIZE) + xoff, (yy * K.TILE_SIZE) + yoff));
}
function blitDirtTile(rect, xx, yy) {
dcBmp.copyPixels(dirtBmp, rect, new flash.geom.Point((xx * K.TILE_SIZE) - 4, (yy * K.TILE_SIZE) - 4));
}
function blitTileThingy(bmp, rect, xx, yy) {
cBmp.copyPixels(bmp, rect, new flash.geom.Point((xx * K.TILE_SIZE) - 4, (yy * K.TILE_SIZE) - 4), undefined, undefined, true);
}
function blitTile(rect, xx, yy) {
cBmp.copyPixels(tBmp, rect, new flash.geom.Point(xx * K.TILE_SIZE, yy * K.TILE_SIZE));
}
var c = "Terrain";
}
Symbol 2877 MovieClip [__Packages.ArrowCursor] Frame 0
class ArrowCursor extends MovieClip
{
var wGutter, eGutter, nGutter, sGutter, sMap, wMap, eMap, nMap, master, gotoAndStop, _x, _y;
function ArrowCursor () {
super();
}
function onLoad() {
Mouse.hide();
wGutter = K.TILE_SIZE * 3;
eGutter = K.SCREEN_WIDTH_PX - (K.TILE_SIZE * 2);
nGutter = K.INT_OFF_Y_PX + (K.TILE_SIZE * 2);
sGutter = (K.INT_OFF_Y_PX + K.SCREEN_HEIGHT_PX) - (K.TILE_SIZE * 2);
sMap = sGutter - 100;
wMap = wGutter + 100;
eMap = K.SCREEN_WIDTH_PX;
nMap = K.INT_OFF_Y_PX;
}
function setMaster(d) {
master = d;
}
function showCursor(s) {
gotoAndStop(s);
}
function hideCursor() {
}
function onMouseMove() {
_x = master._xmouse;
_y = master._ymouse;
}
}
Symbol 2878 MovieClip [__Packages.GameListener] Frame 0
class GameListener
{
var kListener, mListener, myMaster, lastMouse, lastKey;
function GameListener () {
var classObj = this;
kListener = new Object();
mListener = new Object();
kListener.onKeyDown = function () {
classObj.readKey(Key.getCode(), true);
};
kListener.onKeyUp = function () {
classObj.readKey(Key.getCode(), false);
};
mListener.onMouseDown = function () {
classObj.readMouse(K.MOUSEBUTT_CODE, true);
};
mListener.onMouseUp = function () {
classObj.readMouse(K.MOUSEBUTT_CODE, false);
};
mListener.onMouseMove = function () {
classObj.readMouse(K.MOUSEMOVE_CODE, true);
};
Key.addListener(kListener);
Mouse.addListener(mListener);
}
function setMaster(someObj) {
myMaster = someObj;
}
function readMouse(theMouse, isDown) {
lastMouse = theMouse;
if (isDown) {
if ((lastMouse == K.PAUSE_CODE) || (lastMouse == K.MENU_CODE)) {
var _local2 = K.codeToState(lastMouse);
myMaster.switchState(_local2);
} else {
myMaster.reactMouse(lastMouse, true);
}
} else if (!isDown) {
myMaster.reactMouse(lastMouse, false);
}
}
function readKey(theKey, keyIsDown) {
lastKey = theKey;
if (keyIsDown) {
myMaster.react(lastKey, true);
} else if (!keyIsDown) {
myMaster.react(lastKey, false);
}
}
}
Symbol 2879 MovieClip [__Packages.StateStack] Frame 0
class StateStack
{
var STACK_MAX, stack, stackptr;
function StateStack () {
STACK_MAX = 10;
stack = new Array(STACK_MAX);
stackptr = -1;
}
function peek() {
if (stackptr >= 0) {
return(stack[stackptr]);
}
return(undefined);
}
function push(toPush) {
stackptr++;
stack[stackptr] = toPush;
}
function pop() {
if (stackptr < 0) {
return(undefined);
}
stackptr--;
return(stack[stackptr + 1]);
}
function checkfor(goal) {
var _local2 = 0;
while (_local2 <= stackptr) {
if (stack[_local2] == goal) {
return(true);
}
_local2++;
}
return(false);
}
function toString() {
var _local3 = "";
var _local2 = 0;
while (_local2 <= stackptr) {
_local3 = _local3 + (stack[_local2] + ",");
_local2++;
}
return(_local3);
}
function toNum() {
var _local2;
_local2 = stack[stackptr];
return(_local2);
}
function toNames() {
var _local3 = "";
var _local2 = 0;
while (_local2 <= stackptr) {
_local3 = _local3 + K.getStateName(stack[_local2]);
_local3 = _local3 + ",";
_local2++;
}
return(_local3);
}
}
Symbol 2880 MovieClip [__Packages.ClickableThing] Frame 0
class ClickableThing extends MovieClip
{
var master, xTile, yTile, attachMovie, getNextHighestDepth, _visible, removeMovieClip, repairBeacon, outline;
function ClickableThing () {
super();
}
function onLoad() {
}
function setMaster(d) {
master = d;
}
function selectMe() {
}
function onRelease() {
switch (master.actionMode) {
case K.CLICK :
selectMe();
break;
case K.DEMOLISH :
demolishMe();
break;
case K.REPAIR :
repairMe();
break;
case K.MOVE :
selectMe();
break;
case K.BUILD :
master.doClickThing();
}
}
function enterFrameFunction() {
}
function setLoc(xx, yy) {
xTile = xx;
yTile = yy;
}
function destroyMe() {
if (!destroying) {
onRemove();
master.playSound(1, "explosion.wav", 1);
var _local3 = master.getBuildingX(xTile);
var _local2 = master.getBuildingY(yTile);
attachMovie("mc_explodeCloud", "theSmoke", getNextHighestDepth());
destroying = true;
}
}
function demolishMe() {
if (!destroying) {
onRemove();
var _local3 = master.getBuildingX(xTile);
var _local2 = master.getBuildingY(yTile);
master.playSound(1, "demolish.wav", 1);
attachMovie("mc_smokeCloud", "theSmoke", getNextHighestDepth());
destroying = true;
}
master.defaultAction();
}
function halfDestroyAnim() {
var _local2 = K.getCost(myMenu);
if (_local2 == undefined) {
_local2 = new Array();
_local2[0] = 50;
_local2[1] = 0;
}
var _local5 = (_local2[0] * 0.3) / 4;
var _local6 = (_local2[1] * 0.5) / 4;
var _local3 = (_local2[0] * 0.6) / 4;
var _local4 = (_local2[0] * 0.1) / 4;
master.makeGarbage2(xTile, yTile, xTile + 1, yTile + 1, 0, _local6, _local4, _local3, true);
master.makeGarbage2(xTile, yTile, xTile + 1, yTile + 1, _local5, 0, 0, _local3, false);
}
function halfDemolishAnim() {
var _local2 = K.getCost(myMenu);
if (_local2 == undefined) {
_local2 = new Array();
_local2[0] = 50;
_local2[1] = 0;
}
var _local4 = (_local2[0] * 0.35) / 4;
var _local6 = (_local2[1] * 0.9) / 4;
var _local5 = (_local2[0] * 0.3) / 4;
var _local3 = (_local2[0] * 0.35) / 4;
master.makeGarbage2(xTile, yTile, xTile + 1, yTile + 1, _local4, _local6, _local3, _local5, true);
_visible = false;
}
function onDestroyAnim() {
removeMovieClip();
}
function repairMe() {
if (hp < maxhp) {
repairing = true;
showRepairBeacon();
}
}
function showRepairBeacon() {
repairBeacon._visible = true;
repairBeacon.play();
}
function hideRepairBeacon() {
repairBeacon._visible = false;
repairBeacon.stop();
}
function unClick() {
outline._visible = false;
amSelected = false;
}
function onRemove() {
}
var amSelected = false;
var myMenu = "";
var repairing = false;
var destroying = false;
var hp = 100;
var maxhp = ClickableThing.prototype.hp;
var amtO = 0;
var amtM = 0;
var amtJ = 1;
var amtR = 0;
}
Symbol 2881 MovieClip [__Packages.Building] Frame 0
class Building extends ClickableThing
{
var myType, outline, hideRepairBeacon, rinx, resourceIn, riny, routx, resourceOut, routy, blockedAttackLocs, master, xTile, yTile, glow, xTileUnit, yTileUnit, attackLocs, attackers, smogAmount, upgrade, myIndex, resource1, alert, icon, damageClip, destroyMe, hpBar, clickHere, repairing;
function Building () {
super();
}
function onLoad() {
myType = K.BUILDING;
outline._visible = false;
hideResourceIn();
hideResourceOut();
hideRepairBeacon();
rinx = resourceIn._x;
riny = resourceIn._y;
routx = resourceOut._x;
routy = resourceOut._y;
setMeUp();
externalSetMeUp();
amSelected = false;
hideHpBar();
hideClickHere();
var _local2 = this;
updateUpgrades();
checkAsleep();
}
function calculateAttackVacancy() {
blockedAttackLocs[0] = false;
blockedAttackLocs[1] = false;
blockedAttackLocs[2] = false;
blockedAttackLocs[3] = false;
blockedAttackLocs[4] = false;
blockedAttackLocs[5] = false;
blockedAttackLocs[6] = false;
blockedAttackLocs[7] = false;
var _local4 = master.bldgArray;
var _local2 = false;
var _local3 = 0;
while (_local3 < _local4.length) {
if (_local4[_local3].xTile == xTile) {
} else if (_local4[_local3].yTile == yTile) {
if (_local4[_local3].xTile == (xTile - 1)) {
blockAttackLocs(true, true, _local2, _local2, _local2, _local2, _local2, _local2);
} else if (_local4[_local3].xTile == (xTile + 1)) {
blockAttackLocs(_local2, _local2, true, true, _local2, _local2, _local2, _local2);
}
}
_local3++;
}
}
function makeGlow() {
glow.play();
}
function blockAttackLocs(l1, l2, l3, l4, l5, l6, l7, l8) {
if (l1 == true) {
blockedAttackLocs[0] = true;
}
if (l2 == true) {
blockedAttackLocs[1] = true;
}
if (l3 == true) {
blockedAttackLocs[2] = true;
}
if (l4 == true) {
blockedAttackLocs[3] = true;
}
if (l5 == true) {
blockedAttackLocs[4] = true;
}
if (l6 == true) {
blockedAttackLocs[5] = true;
}
if (l7 == true) {
blockedAttackLocs[6] = true;
}
if (l8 == true) {
blockedAttackLocs[7] = true;
}
}
function setMeUp() {
}
function externalSetMeUp() {
}
function deployTheFlag() {
}
function setLoc(xx, yy) {
xTile = xx;
yTile = yy;
xTileUnit = xTile * 2;
yTileUnit = yTile * 2;
var _local9 = new Object();
var _local8 = new Object();
var _local7 = new Object();
var _local6 = new Object();
var _local5 = new Object();
var _local4 = new Object();
var _local3 = new Object();
var _local2 = new Object();
_local9.xTile = xTileUnit - 1;
_local9.yTile = yTileUnit;
_local8.xTile = xTileUnit - 1;
_local8.yTile = yTileUnit - 1;
_local9.facing = "right";
_local8.facing = "right";
_local7.xTile = xTileUnit + 2;
_local7.yTile = yTileUnit;
_local6.xTile = xTileUnit + 2;
_local6.yTile = yTileUnit - 1;
_local7.facing = "left";
_local6.facing = "left";
_local5.xTile = xTileUnit;
_local5.yTile = yTileUnit - 2;
_local4.xTile = xTileUnit + 1;
_local4.yTile = yTileUnit - 2;
_local5.facing = "down";
_local4.facing = "down";
_local3.xTile = xTileUnit;
_local3.yTile = yTileUnit + 1;
_local2.xTile = xTileUnit + 1;
_local2.yTile = yTileUnit + 1;
_local3.facing = "up";
_local2.facing = "up";
blockedAttackLocs = new Array(8);
blockedAttackLocs[0] = false;
blockedAttackLocs[1] = false;
blockedAttackLocs[2] = false;
blockedAttackLocs[3] = false;
blockedAttackLocs[4] = false;
blockedAttackLocs[5] = false;
blockedAttackLocs[6] = false;
blockedAttackLocs[7] = false;
attackLocs = new Array(8);
attackLocs[0] = _local9;
attackLocs[1] = _local8;
attackLocs[2] = _local7;
attackLocs[3] = _local6;
attackLocs[4] = _local5;
attackLocs[5] = _local4;
attackLocs[6] = _local3;
attackLocs[7] = _local2;
attackers = new Array(8);
}
function getGarbagePercent() {
return(Math.round((100 * garbageAmt) / maxGarbage));
}
function updateUpgrades() {
var _local2 = myMenu;
if (amSuper) {
_local2 = myMenu.substr(5, myMenu.length);
}
energyOut = K.updateEfficiency(_local2);
if (amSuper) {
energyOut = energyOut * 2;
}
smogAmount = K.updateEmissions(_local2);
updateRecycling(K.getLevels(myMenu.toLowerCase()));
}
function updateRecycling() {
}
function setUpgradeLevel(upgrade, level) {
this.upgrade.gotoAndPlay("upgrade");
var _local3 = myMenu;
var _local5 = 1;
if (upgrade.toLowerCase() == "both") {
if (amSuper) {
_local3 = myMenu.substr(5, myMenu.length);
}
energyOut = K.getEfficiency(_local3, level);
if (amSuper) {
energyOut = energyOut * 2;
}
smogAmount = K.getEmissions(_local3, level);
}
if (myIndex == K.RECYCLINGCENTER) {
updateRecycling(level);
}
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, 0, this);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function onSelected() {
}
function useResource(str) {
showResourceIn(str);
resourceIn._icon.gotoAndStop("bounce");
resourceIn._x = rinx;
resourceIn._y = riny;
var back = this;
var i = setInterval(function () {
back.resourceIn._y = back.resourceIn._y + 2;
if (back.resourceIn._y >= (back.riny + 20)) {
back.hideResourceIn();
clearInterval(i);
}
}, 50);
}
function makeResource(str, isSuper, level) {
showResourceOut(str);
if (isSuper == true) {
resourceOut._icon.gotoAndStop("super");
} else if ((level == undefined) || (level == 0)) {
resourceOut._icon.gotoAndStop("plus");
} else if (level == 1) {
resourceOut._icon.gotoAndStop("mid_plus");
} else if (level == 2) {
resourceOut._icon.gotoAndStop("hi_plus");
}
resourceOut._x = routx;
resourceOut._y = routy;
var back = this;
var j = setInterval(function () {
back.resourceOut._y = back.resourceOut._y - 2;
if (back.resourceOut._y <= (back.routy - 20)) {
back.hideResourceOut();
clearInterval(j);
}
}, 50);
}
function tickGarbage() {
if (garbageRate > 0) {
garbageAmt = garbageAmt + garbageRate;
garbageProduced = garbageProduced + garbageRate;
tempG = tempG + garbageRate;
updateGarbage();
}
}
function refreshTick() {
garbageThisCycle = tempG;
smogThisCycle = tempS;
tempG = 0;
tempS = 0;
}
function setResource(amount, index) {
resourceAmt = amount;
}
function removeResource(amount, index) {
resourceAmt = resourceAmt - amount;
if (resourceAmt < 0) {
resourceAmt = 0;
}
}
function removeGarbage(amount, index) {
garbageAmt = garbageAmt - amount;
if (garbageAmt < 0) {
garbageAmt = 0;
}
if (garbageAmt < 50) {
tooMuchGarbage = false;
}
updateInterface(garbageAmt);
}
function updateGarbage() {
if (garbageAmt <= 50) {
setExternalGarbage(1, garbageAmt);
} else {
garbageAmt = 50;
setExternalGarbage(1, 50);
tooMuchGarbage = true;
}
updateInterface(garbageAmt);
}
function updateResource(what) {
setExternalResource(resourceAmt, what);
}
function setExternalResource(amount, type) {
if (resource1.myMenu.toLowerCase() == type.toLowerCase()) {
resource1.setAmount(amount);
} else if (resource1.myIndex == undefined) {
var _local2 = master.makeResourceUnit(xTileUnit + 1, yTileUnit + 1, amount, type);
resource1 = _local2;
}
resource1.setBuilding(this);
}
function setExternalGarbage(which, amount) {
var _local3 = this["garbage" + which];
var _local5 = which - 1;
if (_local3.myIndex == K.WASTE) {
_local3.setAmountByKind(gRateO * amount, gRateM * amount, gRateR * amount, gRateJ * amount);
} else if (_local3.myIndex == undefined) {
_local3 = master.makeGarbageUnit2(xTileUnit + _local5, yTileUnit + 1, gRateO * amount, gRateM * amount, gRateR * amount, gRateJ * amount, false);
}
this["garbage" + which] = _local3;
this["garbage" + which].setBuilding(this, which);
}
function showResourceIn(str) {
resourceIn.gotoAndStop(str);
}
function showResourceOut(str) {
resourceOut.gotoAndStop(str);
}
function hideResourceIn() {
resourceIn.gotoAndStop("nothing");
}
function hideResourceOut() {
resourceOut.gotoAndStop("nothing");
}
function enoughFood() {
starvation = 0;
notEnoughFood = false;
}
function foodTick() {
var _local2 = master.dayTime;
if ((_local2 == K.DAY) && (disabled == false)) {
if (master.hasFood(foodIn)) {
enoughFood();
useResource("food");
master.foodDrain(foodIn);
} else {
showFoodAlert(true);
}
}
if (!master.inAMenu) {
updateInterface();
}
}
function tick() {
checkAsleep();
isAlert = true;
if ((asleep == false) && (disabled == false)) {
if (!notEnoughFood) {
if (!tooMuchGarbage) {
if (needsRepair == false) {
if (!notEnoughResource) {
isAlert = false;
}
doTick();
} else {
if (!notEnoughResource) {
isAlert = false;
}
showRepairAlert();
doTick();
}
} else {
showGarbageAlert();
}
} else {
showFoodAlert();
if (!tooMuchGarbage) {
if (needsRepair == false) {
if (!notEnoughResource) {
isAlert = false;
}
doTick();
} else {
if (!notEnoughResource) {
isAlert = false;
}
showRepairAlert();
doTick();
}
} else {
showGarbageAlert();
}
}
} else {
isAlert = false;
}
}
function testUnd3(amt, amt2, amt3, str) {
var _local2 = K.testUnd3(amt, amt2, amt3, "Building." + str);
if (!_local2) {
}
return(_local2);
}
function testUnd(amt, str) {
var _local2 = K.testUnd(amt, "Building." + str);
if (!_local2) {
}
return(_local2);
}
function makeSmog(xx, yy, amt) {
tempS = tempS + amt;
if (testUnd3(xx, yy, amt, "makeSmog")) {
master.makeSmog(xx, yy, amt);
}
}
function updateInterface(n) {
if (n == undefined) {
n = 0;
}
if (amSelected) {
if (!master.inAMenu) {
master.selectBuilding(myMenu, n, this);
}
}
}
function showGarbageAlert() {
alert.gotoAndPlay("garbage");
}
function enoughResource() {
notEnoughResource = false;
}
function showFFGasAlert() {
notEnoughResource = true;
alert.gotoAndPlay("ffGas");
}
function showMetalAlert() {
notEnoughMetal = true;
alert.gotoAndPlay("metal");
}
function showEnergyAlert() {
notEnoughEnergy = true;
alert.gotoAndPlay("energy");
}
function showGasAlert() {
notEnoughResource = true;
alert.gotoAndPlay("gas");
}
function showCoalAlert() {
notEnoughResource = true;
alert.gotoAndPlay("coal");
}
function showFFAlert() {
notEnoughResource = true;
alert.gotoAndPlay("ff");
}
function showFoodAlert(starve) {
notEnoughFood = true;
alert.gotoAndPlay("food");
if (starve == true) {
starvation = starvation + 5;
takeDamage(starvation);
master.doMessageAlert("starvation", this);
}
}
function checkDrowsy() {
if (master.dayTime == K.NIGHT) {
if ((!disabled) && (doesDrowsy == true)) {
makeDrowsy();
return(true);
}
return(false);
}
return(false);
}
function checkAsleep() {
if (master.dayTime == K.NIGHT) {
if ((!disabled) && (doesSleep == true)) {
showSleepAlert();
return(true);
}
return(false);
}
return(false);
}
function makeDrowsy() {
}
function unDrowsy() {
}
function showSleepAlert() {
asleep = true;
if (!disabled) {
alert.gotoAndPlay("asleep");
}
checkDrowsy();
updateInterface();
}
function wakeUp() {
unDrowsy();
asleep = false;
if (!disabled) {
alert.gotoAndStop("default");
icon.gotoAndStop("normal");
} else {
disableMe();
}
updateInterface();
}
function disableToggle() {
if (disabled == true) {
disabled = false;
enableMe();
} else if (disabled == false) {
disabled = true;
disableMe();
}
}
function disableMe() {
alert.gotoAndPlay("disabled");
updateInterface();
}
function syncDisableAlert() {
alert.gotoAndPlay("disabled");
}
function syncSleepAlert() {
alert.gotoAndPlay("asleep");
}
function enableMe() {
if (!checkAsleep()) {
alert.gotoAndPlay("default");
}
checkDrowsy();
updateInterface();
}
function showRepairAlert() {
needsRepair = true;
alert.gotoAndPlay("repair");
}
function requestAttack(e) {
addAnAttacker(e);
return(true);
}
function fixAttackerDepths() {
if (attackers[1].getDepth() > attackers[0].getDepth()) {
attackers[1].swapDepths(attackers[0]);
}
if (attackers[3].getDepth() > attackers[2].getDepth()) {
attackers[3].swapDepths(attackers[2]);
}
}
function addAnAttacker(e) {
e.setAttackLoc(attackLocs[attackCounter]);
attackCounter++;
if (attackCounter > 7) {
attackCounter = 0;
}
return(true);
}
function addAttacker(e, whichLoc) {
if (blockedAttackLocs[whichLoc] == false) {
if (attackers[whichLoc] == undefined) {
attackers[whichLoc] = e;
attackers[whichLoc].setAttackLoc(attackLocs[whichLoc]);
fixAttackerDepths();
return(true);
}
}
return(false);
}
function removeAttacker(whichLoc) {
if (attackers[whichLoc] != undefined) {
attackers[whichLoc].goAway();
attackers[whichLoc] = undefined;
}
}
function updateForWeather(windSpeed, sunLight) {
}
function updateHpBar() {
if (hp < 100) {
showHpBar();
} else {
hideHpBar();
}
}
function takeDamage(amt) {
hp = hp - amt;
damageClip.gotoAndPlay("hit");
updateHpBar();
if (hp <= 75) {
needsRepair = true;
}
if (hp <= 0) {
hp = 0;
if (amSelected) {
master.unClickEverything();
}
master.logCasualty();
destroyMe();
}
updateInterface();
}
function showHpBar() {
hpBar.setAmount(hp);
hpBar._visible = true;
}
function hideHpBar() {
hpBar._visible = false;
hpBar.stop();
}
function hideClickHere() {
clickHere._visible = false;
}
function showClickHere() {
clickHere._visible = true;
}
function doRepairs() {
if (master.hasEnergy(1)) {
hp = hp + 5;
useResource("energy");
makeResource("wrench");
master.energyDrain(1);
if (hp >= 75) {
needsRepair = false;
}
if (hp >= maxhp) {
hp = maxhp;
repairing = false;
hideRepairBeacon();
}
updateInterface();
} else {
repairing = false;
hideRepairBeacon();
}
updateHpBar();
}
function doTick() {
}
function onRemove() {
master.deleteBuilding(this);
}
var typeOfThing = K.BUILDING;
var amSelected = false;
var myMenu = "";
var hp = 100;
var maxhp = Building.prototype.hp;
var amSuper = false;
var doesSleep = true;
var doesDrowsy = true;
var eatsFood = true;
var starvation = 0;
var garbageRate = 0;
var garbageAmt = 0;
var garbageProduced = 0;
var gRateO = 0;
var gRateM = 0;
var gRateJ = 1;
var gRateR = 0;
var resourceAmt = 0;
var maxGarbage = 50;
var tooMuchGarbage = false;
var notEnoughEnergy = false;
var notEnoughMetal = false;
var notEnoughFood = false;
var notEnoughResource = false;
var needsRepair = false;
var isAlert = false;
var isWeapon = false;
var asleep = false;
var drowsy = false;
var disabled = false;
var energyOut = 0;
var energyIn = 0;
var foodOut = 0;
var foodIn = 0.5;
var metalIn = 0;
var metalOut = 0;
var FFIn = 0;
var FFOut = 0;
var gasIn = 0;
var gasOut = 0;
var nWasteOut = 0;
var attackCounter = 0;
var garbageThisCycle = 0;
var smogThisCycle = 0;
var tempG = 0;
var tempS = 0;
var cacheAsBitmap = true;
}
Symbol 2882 MovieClip [__Packages.Garbage] Frame 0
class Garbage extends MovieClip
{
var outline, master, flag, gotoAndStop, countDownID, xTile, yTile, myBuilding, myBuildingIndex, targetEnemy, targetTruck, removeMovieClip;
function Garbage () {
super();
}
function onLoad() {
outline._visible = false;
cancelSummon();
}
function setMaster(d) {
master = d;
}
function addGarbageByKind(organic, metal, reuse, junk) {
amountOrganic = amountOrganic + organic;
amountMetal = amountMetal + metal;
amountJunk = amountJunk + junk;
amountReuse = amountReuse + reuse;
recalcAmount();
}
function getAmount() {
recalcAmount();
return(amount);
}
function recalcAmount() {
var _local2 = amount;
amount = ((amountOrganic + amountMetal) + amountJunk) + amountReuse;
if ((amount > _local2) && (amount > 50)) {
makePollution();
}
setAmount(amount);
}
function addGarbage(amt) {
if ((amount + amt) > 50) {
makePollution();
amt = 0;
} else {
setAmount(amount + amt);
}
}
function doSummon() {
flag._visible = true;
flag.play();
}
function cancelSummon() {
flag._visible = false;
flag.stop();
}
function summonToggle() {
if (summoning == true) {
summoning = false;
cancelSummon();
} else if (summoning == false) {
summoning = true;
doSummon();
}
}
function setAmountByKind(organic, metal, reuse, junk) {
amountOrganic = organic;
amountMetal = metal;
amountJunk = junk;
amountReuse = reuse;
setAmount(((organic + metal) + junk) + reuse);
}
function setAmount(amt) {
var _local3;
if ((amt > 0) && (amt < 15)) {
myMenu = "GarbageLittle";
_local3 = "little";
atMax = false;
} else if ((amt >= 15) && (amt < 35)) {
myMenu = "GarbageSome";
_local3 = "some";
atMax = false;
} else if ((amt >= 35) && (amt < 50)) {
myMenu = "GarbageLots";
_local3 = "lots";
atMax = false;
} else if (amt >= 50) {
myMenu = "GarbageMax";
_local3 = "max";
atMax = true;
} else if (amt <= 0) {
master.deleteGarbage(this);
atMax = false;
}
if (isRubble) {
gotoAndStop("rubble_" + _local3);
myMenu = "Rubble";
} else {
gotoAndStop(_local3);
}
if (amt != undefined) {
amount = amt;
} else {
K.error("Garbage", "setAmount", "amt=undefined!");
}
if (amSelected) {
var _local4 = makeGarbageThing();
master.selectBuilding(myMenu, amount, this, _local4);
}
if (atMax && (isRubble == false)) {
if (countDown == 0) {
startCountDown();
}
} else {
stopCountDown();
}
}
function startCountDown() {
master.doMessageAlert("gWarning", this);
countDownID = setInterval(this, "tickDown", K.TICK_COUNT * K.FRAME_RATE);
}
function stopCountDown() {
countDown = 0;
clearInterval(countDownID);
}
function tickDown() {
countDown++;
if (countDown >= polluteTime) {
stopCountDown();
makePollution();
}
}
function makePollution() {
if (atMax == true) {
var _local3 = Math.floor(xTile / 2);
var _local2 = Math.floor(yTile / 2);
master.polluteTile(_local3, _local2);
master.doMessageAlert("gPollute", this);
}
}
function removeAmount2(minus) {
var _local3 = 0;
var _local4 = amount;
var _local6 = false;
if (amount > minus) {
_local3 = Number(minus);
} else {
_local3 = Number(amount);
_local6 = true;
}
if (amSelected) {
var _local7 = makeGarbageThing();
master.selectGarbage(myMenu, amount, this, _local7);
}
myBuilding.removeGarbage(_local3, myBuildingIndex);
var _local2 = new Array(5);
if (_local4 == 0) {
_local4 = 1;
}
_local2[0] = (amountOrganic / _local4) * _local3;
_local2[1] = (amountMetal / _local4) * _local3;
_local2[2] = (amountReuse / _local4) * _local3;
_local2[3] = (amountJunk / _local4) * _local3;
_local2[4] = _local3;
_local2[5] = _local6;
amountOrganic = amountOrganic - _local2[0];
amountMetal = amountMetal - _local2[1];
amountReuse = amountReuse - _local2[2];
amountJunk = amountJunk - _local2[3];
if ((((_local2[0] + _local2[1]) + _local2[2]) + _local2[3]) != _local2[4]) {
K.error("Garbage", "removeAmount2", (("Totals don't add up!" + (((_local2[0] + _local2[1]) + _local2[2]) + _local2[3])) + " vs ") + _local2[4]);
}
if (amount > minus) {
setAmount(Number(amount) - Number(minus));
} else {
_local2[5] = true;
}
return(_local2);
}
function removeAmount(minus) {
var _local2 = 0;
if (amount > minus) {
setAmount(amount - minus);
_local2 = minus;
} else {
_local2 = amount;
setAmount(0);
}
if (amSelected) {
var _local3 = makeGarbageThing();
master.selectGarbage(myMenu, amount, this, _local3);
}
myBuilding.removeGarbage(_local2, myBuildingIndex);
return(_local2);
}
function makeGarbageThing() {
var _local2 = new Object();
_local2.organic = amountOrganic;
_local2.metal = amountMetal;
_local2.reuse = amountReuse;
_local2.junk = amountJunk;
_local2.total = ((amountOrganic + amountMetal) + amountReuse) + amountJunk;
_local2.summoning = summoning;
return(_local2);
}
function setBuilding(bldg, i) {
myBuilding = bldg;
myBuildingIndex = i;
}
function setRubble() {
isRubble = true;
myMenu = "Rubble";
if ((amount != undefined) && (amount != 0)) {
setAmount(amount);
} else {
gotoAndStop("rubble_some");
}
}
function deactivateMe(str) {
outline._visible = false;
onRelease = undefined;
gotoAndStop(str);
}
function targetForEating(e) {
amEatTargetted = true;
targetEnemy = e;
}
function targetForPickup(whom) {
if (targetTruck != whom) {
if (targetTruck != undefined) {
targetTruck.setToIdle();
}
amTargetted = true;
targetTruck = whom;
}
}
function unEatTarget() {
amEatTargetted = false;
}
function unTarget() {
amTargetted = false;
}
function deleteMe() {
if (amSelected) {
master.unClickEverything();
}
clearInterval(countDownID);
removeMovieClip();
}
function onRelease() {
switch (master.actionMode) {
case K.CLICK :
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
var _local2 = makeGarbageThing();
master.selectGarbage(myMenu, amount, this, _local2);
amSelected = true;
break;
case K.DEMOLISH :
master.showError("You can't demolish garbage! Take it to a waste facility!");
break;
default :
master.onClickTerrain();
}
}
function setLoc(xx, yy) {
xTile = xx;
yTile = yy;
}
function unClick() {
outline._visible = false;
amSelected = false;
}
var amSelected = false;
var myMenu = "garbage";
var myIndex = K.WASTE;
var amount = 0;
var amountOrganic = 0;
var amountMetal = 0;
var amountJunk = 0;
var amountReuse = 0;
var isRubble = false;
var amTargetted = false;
var amEatTargetted = false;
var countDown = 0;
var polluteTime = 20;
var summoning = false;
var atMax = false;
}
Symbol 2883 MovieClip [__Packages.Unit] Frame 0
class Unit extends ClickableThing
{
var myType, outline, vect, speedX, speedY, riny, resourceIn, vehicleRatio, master, xTile, yTile, fuelString, upgrade, myFuel, fuelLevel, fuelSource, mpg, fuelEfficiency, fillUpDistance, smogDistance, mySmog, gasolineGramsPerMile, fuelConsumption, ethanolGramsPerMile, natGasGramsPerMile, onTask, myTask, myTarget, myTargetBldg, amSelected, myMenu, crowder, tempSmogRate, smogRate, _x, destX, _y, destY, gotoAndStop, smogPoint, _icon, o_destX, o_destY, alert, fuelLight;
function Unit () {
super();
}
function onLoad() {
myType = K.UNIT;
outline._visible = false;
setMeUp();
externalSetMeUp();
vect = new Array(2);
speedX = (speedY = 0);
hideResourceIn();
hideFuelLight();
riny = resourceIn._y;
vehicleRatio = vInFFPlant / vInUnit;
master.updateFleetFuel();
}
function setLoc(xx, yy) {
xTile = xx;
yTile = yy;
}
function setMeUp() {
}
function externalSetMeUp() {
}
function gotoSleep() {
if (doesSleep == true) {
asleep = true;
}
}
function levelResetMe() {
enterFrameFunction = undefined;
}
function wakeUp() {
asleep = false;
}
function setUpgradeLevel(up, level) {
if (up.toLowerCase() == fuelString.toLowerCase()) {
upgrade.gotoAndPlay("upgrade");
setFuelEconomy(getFuelNumber(up), level);
}
}
function getFuelNumber(fuel) {
return(K[fuel.toUpperCase()]);
}
function setFuelEconomy(whichFuel, whichLevel) {
myFuel = whichFuel;
fuelLevel = whichLevel;
switch (whichFuel) {
case K.GASOLINE :
fuelString = "gasoline";
fuelSource = "FF";
mpg = 15 * fuelEfficiency;
var _local3 = 1;
var _local2 = 1;
while (_local2 < fuelLevel) {
mpg = mpg * 1.4;
_local3 = _local3 * 1.4;
_local2++;
}
var _local4 = tankSize * mpg;
fillUpDistance = (_local4 / K.TILE_MILES) * K.TILE_SIZE;
smogDistance = fillUpDistance / 4;
mySmog = (((vInUnit * (_local4 / 4)) * gasolineGramsPerMile) / 1000) / 1000;
fuelConsumption = (tankSize * vInUnit) / K.GASOLINE_IN_FF;
break;
case K.ETHANOL :
fuelString = "ethanol";
fuelSource = "food";
mpg = 11.25 * fuelEfficiency;
_local3 = 1;
_local2 = 1;
while (_local2 < fuelLevel) {
mpg = mpg * 1.4;
_local3 = _local3 * 1.4;
_local2++;
}
_local4 = tankSize * mpg;
fillUpDistance = (_local4 / K.TILE_MILES) * K.TILE_SIZE;
smogDistance = fillUpDistance / 4;
mySmog = (((vInUnit * (_local4 / 4)) * ethanolGramsPerMile) / 1000) / 1000;
fuelConsumption = (tankSize * vInUnit) / K.ETHANOL_IN_FOOD;
break;
case K.ELECTRIC :
fuelString = "electric";
fuelSource = "energy";
mpg = 0.75 * fuelEfficiency;
var _local7 = 40 / (15 * fuelEfficiency);
var _local5 = K.E_CHARGE_GEOMETRO * _local7;
_local3 = 1;
_local2 = 1;
while (_local2 < fuelLevel) {
mpg = mpg * 1.4;
_local3 = _local3 * 1.4;
_local2++;
}
_local4 = tankSize * mpg;
fillUpDistance = (_local4 / K.TILE_MILES) * K.TILE_SIZE;
smogDistance = fillUpDistance / 4;
mySmog = 0;
fuelConsumption = _local5 * _local4;
break;
case K.NATGAS :
fuelString = "natgas";
fuelSource = "gas";
var _local6 = 1.14;
mpg = (15 * fuelEfficiency) * _local6;
_local3 = 1;
_local2 = 1;
while (_local2 < fuelLevel) {
mpg = mpg * 1.4;
_local3 = _local3 * 1.4;
_local2++;
}
_local4 = tankSize * mpg;
fillUpDistance = (_local4 / K.TILE_MILES) * K.TILE_SIZE;
smogDistance = fillUpDistance / 4;
mySmog = ((((vInUnit * (_local4 / 4)) * natGasGramsPerMile) / 1000) / 1000) / _local3;
fuelConsumption = (tankSize * vInUnit) / (K.GASOLINE_IN_FF / K.GAS_TO_OIL_RATIO);
break;
}
refreshTick(true);
updateMe();
}
function useResource(str) {
showResourceIn(str);
resourceIn._icon.gotoAndStop("bounce");
resourceIn._y = riny;
var back = this;
var i = setInterval(function () {
back.resourceIn._y = back.resourceIn._y + 2;
if (back.resourceIn._y >= (back.riny + 20)) {
back.hideResourceIn();
clearInterval(i);
}
}, 50);
}
function showResourceIn(str) {
resourceIn.gotoAndStop(str);
}
function hideResourceIn() {
resourceIn.gotoAndStop("nothing");
}
function stopForFuel() {
refueling = 1;
showFuelLight();
}
function setToIdle() {
onTask = false;
myTask = K.IDLE;
myTarget = undefined;
myTargetBldg = undefined;
}
function refuel() {
switch (myFuel) {
case K.GASOLINE :
if (master.hasFF(1)) {
master.drainFF(fuelConsumption);
useResource("FF");
refueling = 2;
}
break;
case K.DIESEL :
if (master.hasFF(fuelConsumption)) {
master.drainFF(fuelConsumption);
useResource("FF");
refueling = 2;
}
break;
case K.ELECTRIC :
if (master.hasEnergy(fuelConsumption)) {
master.drainEnergy(fuelConsumption);
useResource("energy");
refueling = 2;
}
break;
case K.ETHANOL :
if (master.hasFood(fuelConsumption)) {
master.drainFood(fuelConsumption);
useResource("food");
refueling = 2;
}
break;
case K.NATGAS :
if (master.hasGas(fuelConsumption)) {
master.drainGas(fuelConsumption);
useResource("gas");
refueling = 2;
}
break;
default :
refueling = 2;
}
}
function onRelease() {
switch (master.actionMode) {
case K.CLICK :
if (!amSelected) {
selectMe();
} else if (master.multiSelect) {
selectMe();
} else {
unselectMe();
}
break;
case K.DEMOLISH :
demolishMe();
break;
case K.REPAIR :
repairMe();
break;
case K.MOVE :
if (!amSelected) {
selectMe();
} else if (master.multiSelect) {
selectMe();
} else {
unselectMe();
}
}
}
function updateMe() {
if (amSelected) {
if (!master.inAMenu) {
reselectMe();
}
}
}
function reselectMe() {
outline._visible = true;
master.selectUnit(myMenu, 0, this, false);
amSelected = true;
onSelected();
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectUnit(myMenu, 0, this, true);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function unselectMe() {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
function toggleMe() {
if (!amSelected) {
selectMe();
} else {
unselectMe();
}
}
function multiSelectMe() {
if (!amSelected) {
outline._visible = true;
onSelected();
amSelected = true;
master.multiSelectUnit(myMenu, 0, this);
}
}
function startMoving() {
movingX = true;
movingY = true;
}
function stopMoving() {
movingX = false;
movingY = false;
if (checkCrowded()) {
var _local2 = 0;
if (K.randRange(0, 1) == 0) {
unCrowd(-1);
crowder.unCrowd(1);
}
}
}
function onMoveFinish() {
}
function unCrowd(xx) {
moveToLoc(xTile + xx, yTile);
}
function refreshTick(recalc) {
if (tempSmogRate != undefined) {
smogRate = tempSmogRate;
} else {
calcEmissionRate();
}
if (recalc == true) {
calcEmissionRate();
}
tempSmogRate = 0;
}
function doTick() {
tick();
}
function tick() {
}
function enterFrameFunction() {
if (!disabled) {
updateLoc();
if (refueling == 0) {
if (movingX) {
_x = _x + speedX;
var _local3 = Math.abs(destX - _x);
var _local2 = Math.abs(destY - _y);
if (_local3 <= (speed * 4)) {
if ((vect[0] == undefined) || (vect[0] == NaN)) {
speedX = speedX * 0.9;
if (speedX < ((speed * vect[0]) / 4)) {
speedX = (speed * vect[0]) / 4;
}
} else {
speedX = (speed * 0.9) * vect[0];
}
}
if ((_local3 <= 5) || (_local3 <= Math.abs(speedX * 3))) {
_x = destX;
movingX = false;
if ((movingY == false) || (_local2 <= 2)) {
onMoveFinish();
}
}
if (speedX > 0) {
gotoAndStop("right");
} else {
gotoAndStop("left");
}
}
if (movingY == true) {
_y = _y + speedY;
var _local2 = Math.abs(destY - _y);
var _local3 = Math.abs(destX - _x);
if (_local2 <= (speed * 4)) {
if ((vect[1] == undefined) || (vect[1] == NaN)) {
speedY = speedY * 0.9;
if (speedY < ((speed * vect[1]) / 4)) {
speedY = (speed * vect[1]) / 4;
}
} else {
speedY = (speed * 0.9) * vect[1];
}
}
if ((_local2 <= 5) || (_local2 <= Math.abs(speedY * 1.5))) {
_y = destY;
movingY = false;
if ((movingX == false) || (_local3 <= 2)) {
onMoveFinish();
}
}
if (speedY > 0) {
}
}
if (movingX || (movingY)) {
updateOdometer();
}
} else {
if (refueling >= 2) {
refueling++;
}
if (refueling >= K.REFUEL_COUNT) {
refueling = 0;
hideFuelLight();
}
}
}
}
function updateOdometer() {
var _local2 = Math.sqrt((speedX * speedX) + (speedY * speedY));
odometer = odometer + _local2;
smogOMeter = smogOMeter + _local2;
if (odometer > fillUpDistance) {
odometer = 0;
stopForFuel();
}
if (smogOMeter > smogDistance) {
smogOMeter = 0;
makeSmog();
}
}
function calcEmissionRate() {
var _local3 = smogDistance / speed;
_local3 = _local3 + 15;
var _local2 = (K.CYCLETIME * K.TICK_COUNT) / _local3;
smogRate = mySmog * _local2;
}
function makeSmog() {
tempSmogRate = tempSmogRate + mySmog;
var _local3 = _x + smogPoint._x;
var _local2 = _y + smogPoint._y;
if (mySmog > 0) {
_icon.gotoAndPlay("smog");
master.makeSmog(_local3, _local2, mySmog);
}
}
function updateLoc() {
xTile = Math.floor(_x / K.TILE_SIZE);
yTile = Math.floor((_y - K.INT_OFF_Y_PX) / K.TILE_SIZE);
}
function checkCrowded() {
var _local2 = 0;
while (_local2 < master.uArray.length) {
if (master.uArray[_local2].xTile == xTile) {
if (master.uArray[_local2].yTile == yTile) {
crowder = master.uArray[_local2];
return(true);
}
}
_local2++;
}
}
function checkCrowdedX() {
var _local2 = 0;
while (_local2 < master.uArray.length) {
if (master.uArray[_local2].xTile == xTile) {
return(true);
}
_local2++;
}
return(false);
}
function checkCrowdedY() {
var _local2 = 0;
while (_local2 < master.uArray.length) {
if (master.uArray[_local2].yTile == yTile) {
return(true);
}
_local2++;
}
return(false);
}
function moveToLoc(xT, yT) {
destX = master.getUnitX(xT);
destY = master.getUnitY(yT);
if (destY < K.INT_OFF_Y_PX) {
destY = K.INT_OFF_Y_PX;
} else if (destY > (Stage.height - (K.TILE_SIZE * 2))) {
destY = Stage.height - (K.TILE_SIZE * 2);
}
if (destX < K.TILE_SIZE) {
destX = K.TILE_SIZE;
} else if (destX > (Stage.width - K.INT_OFF_X_PX)) {
destX > (Stage.width - K.INT_OFF_X_PX);
}
o_destX = destX;
o_destY = destY;
vect[0] = destX - _x;
vect[1] = destY - _y;
var _local2 = Math.sqrt((vect[0] * vect[0]) + (vect[1] * vect[1]));
vect[0] = vect[0] / _local2;
vect[1] = vect[1] / _local2;
speedX = vect[0] * speed;
speedY = vect[1] * speed;
startMoving();
}
function onMove(sticky) {
if (!sticky) {
master.unClickEverything();
}
}
function onSelected() {
}
function demolishMe() {
}
function repairMe() {
}
function disableToggle() {
if (disabled == true) {
disabled = false;
enableMe();
} else if (disabled == false) {
disabled = true;
disableMe();
}
}
function updateInterface(n) {
if (n == undefined) {
n = 0;
}
if (amSelected) {
if (!master.inAMenu) {
master.selectBuilding(myMenu, n, this);
}
}
}
function disableMe() {
alert.gotoAndPlay("disabled");
updateInterface();
}
function enableMe() {
alert.gotoAndPlay("default");
updateInterface();
}
function hideFuelLight() {
fuelLight._visible = false;
}
function showFuelLight() {
fuelLight._visible = true;
}
var typeOfThing = K.UNIT;
var speed = 1;
var movingX = false;
var movingY = false;
var odometer = 0;
var smogOMeter = 0;
var baseSmog = 0;
var refueling = 0;
var vInUnit = 1000;
var vInFFPlant = 30000;
var tankSize = 25;
var waitForRefuel = false;
var doesSleep = false;
var asleep = false;
var disabled = false;
}
Symbol 2884 MovieClip [__Packages.GarbageTruck] Frame 0
class GarbageTruck extends Unit
{
var startUpSound, master, odometer, setFuelEconomy, asleep, refueling, refuel, myTargetBldg, moveToLoc, myTarget, haul, setToIdle, updateMe;
function GarbageTruck () {
super();
}
function setMeUp() {
if (startUpSound) {
master.playSound(1, "garbage_click1.wav", 1);
}
odometer = 0;
setFuelEconomy(K.GASOLINE, 1);
}
function recalcAmount() {
myGarbageAmt = ((amountOrganic + amountMetal) + amountReuse) + amountJunk;
}
function getAmount() {
recalcAmount();
return(myGarbageAmt);
}
function getAmounts() {
var _local2 = new Array();
_local2[0] = amountMetal;
_local2[1] = amountReuse;
_local2[2] = amountOrganic;
_local2[3] = amountJunk;
return(_local2);
}
function onSelected() {
}
function gotoSleep() {
asleep = true;
}
function tick() {
if (refueling == 0) {
switch (myTask) {
case K.IDLE :
if (!asleep) {
if (myGarbageAmt < garbageHaul) {
if (master.gArray.length >= 1) {
var _local2 = findSomeGarbage();
goGetSomeGarbage(_local2);
}
} else {
findLandfillTask();
}
}
break;
case K.IDLE_GARBAGE :
if (!asleep) {
if (myGarbageAmt < garbageHaul) {
if (master.gArray.length <= master.uArray.length) {
findLandfillTask();
} else if (master.gArray.length >= 1) {
var _local2 = findSomeGarbage();
goGetSomeGarbage(_local2);
}
} else {
findLandfillTask();
}
} else {
findLandfillTask();
}
}
} else {
refuel();
}
}
function findLandfillTask() {
var _local2 = findALandfill();
myTargetBldg = _local2;
if (_local2 != undefined) {
dumpAtLandfill();
} else {
master.doMessageAlert("noLandfill", this);
}
}
function findSomeGarbage() {
var _local3 = master.gArray;
var _local8;
var _local6 = 100000000 /* 0x5F5E100 */;
var _local7 = -10000000;
var _local2 = 0;
while (_local2 < _local3.length) {
var _local4 = 0;
if (_local3[_local2].amTargetted == false) {
var _local5 = K.getDist(this, _local3[_local2]);
if (_local5 <= 15) {
getGarbage(_local3[_local2]);
}
if (_local5 < _local6) {
_local6 = _local5;
_local4 = _local4 + 50;
}
} else {
var _local5 = K.getDist(this, _local3[_local2]);
if (_local5 < _local6) {
if (_local5 < (K.getDist(_local3[_local2], _local3[_local2].targetTruck) - 1)) {
_local6 = _local5;
_local4 = _local4 + 50;
}
}
}
if (_local3[_local2].isRubble == false) {
_local4 = _local4 + _local3[_local2].amount;
} else if (_local3[_local2].isRubble == true) {
_local4 = _local4 + (_local3[_local2].amount / 2);
if (_local3[_local2].amount <= garbageHaul) {
_local4 = _local4 + ((_local3[_local2].amount / 2) + 5);
}
}
if (_local3[_local2].atMax == true) {
_local4 = _local4 + 100;
}
if (_local3[_local2].summoning == true) {
_local4 = _local4 + 500;
}
if (_local4 > _local7) {
_local7 = _local4;
_local8 = _local3[_local2];
}
_local2++;
}
_local8.targetForPickup(this);
return(_local8);
}
function findALandfill(g, l) {
var _local3 = master.bldgArray;
var _local6;
var _local5 = 100000000 /* 0x5F5E100 */;
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].myIndex == K.LANDFILL) {
if (_local3[_local2] != l) {
if (_local3[_local2].amFull == false) {
var _local4;
_local4 = K.getDist(this, _local3[_local2]);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local3[_local2];
}
}
}
}
_local2++;
}
return(_local6);
}
function goGetSomeGarbage(g) {
if ((g != undefined) && (onTask == false)) {
onTask = true;
moveToLoc(g.xTile, g.yTile - 1);
myTask = K.GETGARBAGE;
myTarget = g;
}
}
function takeGarbageToLandfill(g, l) {
if ((g != undefined) && (onTask == false)) {
onTask = true;
moveToLoc(g.xTile, g.yTile - 1);
myTask = K.GETGARBAGE;
myTarget = g;
myTargetBldg = l;
}
}
function getGarbage(g) {
if (g != undefined) {
myGarbageIsRubble = g.isRubble;
if (myGarbageIsRubble) {
haul.gotoAndStop("rubble");
} else {
haul.gotoAndStop("garbage");
}
var _local3 = garbageHaul - myGarbageAmt;
if ((_local3 == undefined) || (_local3 == NaN)) {
_local3 = 5;
}
var _local2 = g.removeAmount2(_local3);
g.unTarget();
myGarbageAmt = myGarbageAmt + _local2[4];
amountOrganic = amountOrganic + _local2[0];
amountMetal = amountMetal + _local2[1];
amountReuse = amountReuse + _local2[2];
amountJunk = amountJunk + _local2[3];
if (_local2[5] == true) {
g.setAmountByKind(0, 0, 0, 0);
}
} else {
setToIdle();
myGarbageAmt = myGarbageAmt + 0;
}
updateMe();
}
function dumpGarbage(l) {
recalcAmount();
if (myGarbageAmt > 0) {
var _local2 = l.addGarbage2(amountOrganic, amountMetal, amountReuse, amountJunk, myGarbageIsRubble);
if (_local2) {
haul.gotoAndStop("nothing");
myGarbageAmt = 0;
amountOrganic = 0;
amountMetal = 0;
amountReuse = 0;
amountJunk = 0;
setToIdle();
} else {
myTargetBldg = findALandfill(Garbage(myTarget), Landfill(myTargetBldg));
dumpAtLandfill();
}
} else {
haul.gotoAndStop("nothing");
setToIdle();
}
updateMe();
}
function dumpAtLandfill() {
onTask = true;
myTask = K.DUMPGARBAGE;
moveToLoc(myTargetBldg.xTileUnit, myTargetBldg.yTileUnit);
}
function onMoveFinish() {
if (onTask) {
if (myTask == K.GETGARBAGE) {
getGarbage(Garbage(myTarget));
if (myTargetBldg != undefined) {
dumpAtLandfill();
} else {
onTask = false;
myTask = K.IDLE_GARBAGE;
myTarget = undefined;
myTargetBldg = undefined;
}
} else if (myTask == K.DUMPGARBAGE) {
dumpGarbage(Landfill(myTargetBldg));
}
}
}
var myIndex = K.GARBAGETRUCK;
var myMenu = "GarbageTruck";
var clicks = 0;
var onTask = false;
var myTask = K.IDLE;
var myGarbageAmt = 0;
var myGarbageIsRubble = false;
var amountOrganic = 0;
var amountMetal = 0;
var amountReuse = 0;
var amountJunk = 0;
var garbageHaul = 15 * (Unit.prototype.vInUnit / 1000);
var fuelEfficiency = 0.266666666666667;
var gasolineGramsPerMile = 24.29;
var natGasGramsPerMile = 1.59;
var ethanolGramsPerMile = 15;
var ngSmog = 0.00394144;
var tankSize = 75;
var speed = 2;
var selectSound = "garbage_click1.wav";
var affirmSound = "garbage_move1.wav";
var buildSound = "garbage_click1.wav";
var alertTime = 0;
}
Symbol 2885 MovieClip [__Packages.Landfill] Frame 0
class Landfill extends Building
{
var amSelected, master, outline, onSelected, attachMovie, getNextHighestDepth, xTile, yTile, _visible, removeMovieClip, tempG, smogThisCycle, tempS, waste;
function Landfill () {
super();
}
function setMeUp() {
}
function doTick() {
}
function getPercent() {
return(Math.floor(100 * ((100 * amount) / capacity)) / 100);
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
updatePercent();
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function demolishMe() {
master.playSound(1, "demolish.wav", 1);
attachMovie("mc_smokeCloud", "theSmoke", getNextHighestDepth());
}
function halfDestroyAnim() {
if (Math.ceil(amount / 4) > 0) {
master.makeGarbage2(xTile, yTile, xTile + 1, yTile + 1, 0, 0, 0, 20, true);
master.makeGarbage2(xTile, yTile, xTile + 1, yTile + 1, Math.ceil(amountOrganic / 4), Math.ceil(amountMetal / 4), Math.ceil(amountReuse / 4), 5 + Math.ceil(amountJunk / 4), false);
}
}
function halfDemolishAnim() {
if (Math.ceil(amount / 4) > 0) {
master.makeGarbage2(xTile, yTile, xTile + 1, yTile + 1, 0, 0, 0, 20, true);
master.makeGarbage2(xTile, yTile, xTile + 1, yTile + 1, Math.ceil(amountOrganic / 4), Math.ceil(amountMetal / 4), 2.5 + Math.ceil(amountReuse / 4), 2.5 + Math.ceil(amountJunk / 4), false);
}
_visible = false;
}
function onDestroyAnim() {
removeMovieClip();
}
function refreshTick() {
garbageInThisCycle = tempG;
smogThisCycle = tempS;
tempG = 0;
tempS = 0;
}
function getGarbageSample() {
var _local2 = new Array();
_local2[0] = amountOrganic;
_local2[1] = amountMetal;
_local2[2] = amountReuse;
_local2[3] = amountJunk;
_local2[4] = ((amountOrganic + amountMetal) + amountReuse) + amountJunk;
return(_local2);
}
function destroyByKind(organic, metal, reuse, junk) {
amountOrganic = amountOrganic - organic;
amountMetal = amountMetal - metal;
amountReuse = amountReuse - reuse;
amountJunk = amountJunk - junk;
amount = amount - (((organic + metal) + reuse) + junk);
}
function addGarbage2(organic, metal, reuse, junk, isRubble) {
var _local3 = false;
var _local2 = ((organic + metal) + reuse) + junk;
if ((_local2 != undefined) && (_local2 != NaN)) {
if ((amount + _local2) < capacity) {
tempG = tempG + _local2;
amount = amount + _local2;
amountOrganic = amountOrganic + organic;
amountMetal = amountMetal + metal;
amountReuse = amountReuse + reuse;
amountJunk = amountJunk + junk;
_local3 = true;
if (amSelected) {
updatePercent();
}
}
} else {
K.error("Landfill", "addGarbage2", "amt = undefined!");
return(false);
}
recalcAmount();
if (isRubble) {
waste.gotoAndPlay("rubble");
} else {
waste.gotoAndPlay("garbage");
}
return(_local3);
}
function recalcAmount() {
amount = ((amountOrganic + amountMetal) + amountReuse) + amountJunk;
if (amount > capacity) {
amount = capacity;
amFull = true;
}
}
function addGarbage(amt, isRubble) {
var _local2 = false;
if ((amount + amt) < capacity) {
tempG = tempG + amt;
amount = amount + amt;
_local2 = true;
if (amSelected) {
updatePercent();
}
} else {
amount = capacity;
amFull = true;
}
if (isRubble) {
waste.gotoAndPlay("rubble");
} else {
waste.gotoAndPlay("garbage");
}
return(_local2);
}
function updatePercent() {
master.unClickEverything();
outline._visible = true;
amSelected = true;
var _local2 = getPercent();
master.selectBuilding(myMenu, _local2, this);
}
var myIndex = K.LANDFILL;
var myMenu = "Landfill";
var smogTicks = 0;
var smogTime = 5;
var amSuper = false;
var capacity = 10000;
var amount = 0;
var amountOrganic = 0;
var amountMetal = 0;
var amountReuse = 0;
var amountJunk = 0;
var eatsFood = false;
var amFull = false;
var foodIn = 0;
var doesSleep = false;
var garbageInThisCycle = 0;
}
Symbol 2886 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends ClickableThing
{
var myType, outline, vect, speedX, speedY, oldTargets, xTile, yTile, startX, startY, master, amSelected, _icon, onTask, myTask, myTarget, myTargetBldg, _x, destX, _y, destY, gotoAndStop, fearsDay, onFire, singe, hp, maxHp, hpBar, upgrade, _width, _height, myDamage, o_destX, o_destY, damage, removeMovieClip, destroying, onRemove, attachMovie, getNextHighestDepth, myTargetWaste, myTargetGarbage, attackFacing, wasteDist, garbageDist, bldgDist, bestDist;
function Enemy () {
super();
}
function onLoad() {
myType = K.ENEMY;
outline._visible = false;
setMeUp();
externalSetMeUp();
vect = new Array(2);
speedX = (speedY = 0);
oldTargets = new Array();
hideHpBar();
}
function setLoc(xx, yy) {
xTile = xx;
yTile = yy;
startX = xTile;
startY = yTile;
}
function setMeUp() {
tick();
}
function externalSetMeUp() {
}
function onRelease() {
switch (master.actionMode) {
case K.CLICK :
if (!amSelected) {
selectMe();
}
break;
case K.DEMOLISH :
break;
case K.REPAIR :
}
}
function selectMe() {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectEnemy(myMenu, 0, this);
amSelected = true;
onSelected();
}
function unselectMe() {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
function levelResetMe() {
enterFrameFunction = undefined;
}
function unPauseMe() {
_icon.startPlay();
_icon.onLoad = function () {
this.startPlay();
};
}
function pauseMe() {
_icon.stopPlay();
_icon.onLoad = function () {
this.stopPlay();
};
}
function multiSelectMe() {
if (!amSelected) {
outline._visible = true;
onSelected();
amSelected = true;
master.multiSelectUnit(myMenu, 0, this);
}
}
function startMoving() {
movingX = true;
movingY = true;
}
function onMoveFinish() {
}
function setToIdle() {
onTask = false;
myTask = K.IDLE;
myTarget = undefined;
myTargetBldg = undefined;
_icon.gotoAndStop("default");
tick();
}
function tick() {
}
function enterFrameFunction() {
updateLoc();
if (movingX) {
_x = _x + speedX;
var _local3 = Math.abs(destX - _x);
var _local2 = Math.abs(destY - _y);
if (_local3 <= (speed * 2)) {
}
if ((_local3 <= 5) || (_local3 <= Math.abs(speedX * 3))) {
_x = destX;
movingX = false;
if ((movingY == false) || (_local2 <= 2)) {
onMoveFinish();
}
}
if ((myTask == K.ATTACKPOSITION) || (myTask == K.GOTOBUILDING)) {
if (speedX >= speedY) {
if (speedX > 0) {
gotoAndStop("right");
} else {
gotoAndStop("left");
}
_icon.gotoAndStop("walk");
} else {
if (speedY > 0) {
gotoAndStop("down");
} else {
gotoAndStop("up");
}
_icon.gotoAndStop("walk");
}
}
}
if (movingY == true) {
_y = _y + speedY;
var _local2 = Math.abs(destY - _y);
var _local3 = Math.abs(destX - _x);
if (_local2 <= (speed * 2)) {
}
if ((_local2 <= 5) || (_local2 <= Math.abs(speedY * 3))) {
_y = destY;
movingY = false;
if ((movingX == false) || (_local3 <= 2)) {
onMoveFinish();
}
}
if ((myTask == K.ATTACKPOSITION) || (myTask == K.GOTOBUILDING)) {
if (speedX >= speedY) {
if (speedX > 0) {
gotoAndStop("right");
} else {
gotoAndStop("left");
}
_icon.gotoAndStop("walk");
} else {
if (speedY > 0) {
gotoAndStop("down");
} else {
gotoAndStop("up");
}
_icon.gotoAndStop("walk");
}
}
}
if (singeTime >= 5) {
if ((master.dayTime == K.DAY) && (fearsDay == true)) {
hardKillMe();
}
singeTime = 0;
}
if (onFire) {
burnMe();
}
singeTime++;
updateHp();
if (singeOn) {
singeOn = false;
singe.gotoAndStop("off");
}
}
function burnMe() {
}
function singeMe() {
}
function hardKillMe() {
singeMe();
burnMe();
killMe();
}
function updateHp() {
if (getHpPercent() < 100) {
showHpBar();
} else {
hideHpBar();
}
}
function giveHp(amt) {
hp = hp + amt;
if (hp > maxHp) {
hp = maxHp;
}
updateHp();
}
function showHpBar() {
hpBar._visible = true;
hpBar.setAmount(getHpPercent());
}
function hideHpBar() {
hpBar._visible = false;
}
function getHpPercent() {
return(Math.round(100 * (hp / maxHp)));
}
function updateLoc() {
xTile = Math.floor(_x / K.TILE_SIZE);
yTile = Math.floor((_y - K.INT_OFF_Y_PX) / K.TILE_SIZE);
}
function eatWaste(w) {
master.onNWasteEat(1);
var _local2 = 0;
while (_local2 < 3) {
doNextLevel();
_local2++;
}
w.removeAmount(1);
setToIdle();
}
function safeEatGarbage(g) {
g.targetEnemy.setToIdle();
eatGarbage(g);
}
function eatGarbage(g) {
master.onGarbageEat(g.getAmount());
if (!g.isRubble) {
levelUp(g.getAmount());
var _local2 = g.removeAmount2(g.getAmount());
amountOrganic = amountOrganic + _local2[2];
amountMetal = amountMetal + _local2[0];
amountReuse = amountReuse + _local2[1];
amountJunk = amountJunk + _local2[3];
if (_local2[5] == true) {
g.setAmountByKind(0, 0, 0, 0);
}
}
setToIdle();
}
function doNextLevel() {
levelUp(nextLevel);
}
function levelUp(amt) {
K.testUnd(amt);
if ("Enemy.levelUp") {
myXP = myXP + amt;
if ((myXP >= nextLevel) && (myLevel < (maxLevel - 1))) {
upgrade.play();
maxHp = maxHp * 3;
myXP = 0;
hp = maxHp;
_width = _width * 1.2;
_height = _height * 1.2;
myDamage = myDamage * 3;
nextLevel = nextLevel * 3;
myLevel++;
}
}
}
function reMoveToLoc() {
vect[0] = destX - _x;
vect[1] = destY - _y;
var _local2 = Math.sqrt((vect[0] * vect[0]) + (vect[1] * vect[1]));
vect[0] = vect[0] / _local2;
vect[1] = vect[1] / _local2;
speedX = vect[0] * speed;
speedY = vect[1] * speed;
startMoving();
}
function moveToLoc(xT, yT) {
destX = master.getUnitX(xT);
destY = master.getUnitY(yT);
if (destY < K.INT_OFF_Y_PX) {
destY = K.INT_OFF_Y_PX;
} else if (destY > (Stage.height - (K.TILE_SIZE * 2))) {
destY = Stage.height - (K.TILE_SIZE * 2);
}
if (destX < K.TILE_SIZE) {
destX = K.TILE_SIZE;
} else if (destX > (Stage.width - K.INT_OFF_X_PX)) {
destX > (Stage.width - K.INT_OFF_X_PX);
}
o_destX = destX;
o_destY = destY;
vect[0] = destX - _x;
vect[1] = destY - _y;
var _local2 = Math.sqrt((vect[0] * vect[0]) + (vect[1] * vect[1]));
vect[0] = vect[0] / _local2;
vect[1] = vect[1] / _local2;
speedX = vect[0] * speed;
speedY = vect[1] * speed;
startMoving();
}
function onSelected() {
}
function toggleMe() {
if (!amSelected) {
selectMe();
} else {
unselectMe();
}
}
function extinguishFire() {
onFire == false;
fireCounter = 0;
singe.gotoAndStop("off");
}
function setOnFire() {
onFire = true;
fireCounter = K.BURN_TIME;
}
function takeDamage(d, type) {
if (type == K.GUNTURRET) {
var _local2 = d / K.DMG_GUNTURRET;
_local2 = _local2 * (K.M_IN_GUNTURRET * 0.75);
bulletMetal = bulletMetal + _local2;
}
if (type == K.TESLACOIL) {
if (myLevel > 0) {
}
}
if (type == K.FLAMETURRET) {
setOnFire();
damage.gotoAndPlay("fire");
} else {
damage.gotoAndPlay("hit");
}
hp = hp - d;
if (hp <= 0) {
killMe();
}
}
function destroyMe() {
var _local2 = 0;
while (_local2 < master.eArray.length) {
if (master.eArray[_local2] == this) {
master.eArray[_local2] = undefined;
master.eArray[_local2].splice(_local2, 1);
}
_local2++;
}
master.onEnemyDie();
removeMovieClip();
}
function removeMe() {
var _local2 = 0;
while (_local2 < master.eArray.length) {
if (master.eArray[_local2] == this) {
master.eArray[_local2] = undefined;
master.eArray[_local2].splice(_local2, 1);
}
_local2++;
}
master.onEnemyRemove();
removeMovieClip();
}
function killMe() {
if (!destroying) {
movingX = false;
movingY = false;
speedX = 0;
speedY = 0;
myTask == K.DYING;
onRemove();
gotoAndStop("dead");
var _local2 = 2.5 * (myLevel + 1);
if (_local2 < 0) {
_local2 = 1;
}
if (_local2 > 25) {
_local2 = 25;
}
var _local3 = attachMovie("mc_goop", "theGoop", getNextHighestDepth());
if (onFire) {
var _local5 = _x;
var _local4 = _y;
makeSmog(_local5, _local4, _local2);
_local3.gotoAndPlay("smoke");
} else {
amountOrganic = amountOrganic + _local2;
makeMyGarbage();
_local3.gotoAndPlay("goop");
}
destroying = true;
}
}
function makeMyGarbage() {
if (((amountMetal + bulletMetal) > 0) || (amountReuse > 0)) {
makeEnemyGarbageUnit2(Math.floor(xTile / 2) * 2, (Math.floor(yTile / 2) * 2) + 1, 0, amountMetal + bulletMetal, amountReuse, 0, true);
}
makeEnemyGarbageUnit2(Math.floor(xTile / 2) * 2, (Math.floor(yTile / 2) * 2) + 1, amountOrganic, 0, 0, amountJunk, false);
}
function makeSmog(xx, yy, amount) {
if (testUnd3(xx, yy, amount, "makeSmog")) {
master.makeZombieSmog(xx, yy, amount);
}
}
function makeEnemyGarbageUnit2(xx, yy, organic, metal, reuse, junk, isRubble) {
if (testUnd3(xx, yy, ((organic + metal) + reuse) + junk, "makeEnemyGarbageUnit")) {
master.makeEnemyGarbageUnit2(xx, yy, organic, metal, reuse, junk, isRubble);
}
}
function makeEnemyGarbageUnit(xx, yy, amt, isRubble) {
if (testUnd3(xx, yy, amt, "makeEnemyGarbageUnit")) {
master.makeEnemyGarbageUnit(xx, yy, amt, isRubble);
}
}
function onDestroyAnim() {
destroyMe();
}
function findAndAttackBuilding() {
var _local2 = findClosestBuilding();
if (_local2[0] != undefined) {
gotoBuilding(_local2[0]);
} else {
setToIdle();
K.error("edderkop", "tick", "can't find a bldg!");
}
}
function findAndEatGarbage() {
var _local2 = findSomeGarbage();
if (_local2[0] != undefined) {
gotoGarbage(_local2[0]);
} else {
findAndAttackBuilding();
}
}
function findAndEatNWaste() {
var _local2 = findSomeNWaste();
if (_local2[0] != undefined) {
gotoWaste(_local2[0]);
} else {
return(false);
}
return(true);
}
function gotoWaste(w) {
if (w == undefined) {
setToIdle();
} else {
myTargetWaste = w;
var _local4 = w.xTile;
var _local3 = w.yTile;
moveToLoc(_local4, _local3);
myTask = K.GETWASTE;
onTask = true;
_icon.gotoAndStop("walk");
}
}
function gotoGarbage(g) {
if (g == undefined) {
setToIdle();
} else {
myTargetGarbage = g;
var _local4 = g.xTile;
var _local3 = g.yTile;
moveToLoc(_local4, _local3);
myTask = K.GETGARBAGE;
onTask = true;
_icon.gotoAndStop("walk");
}
}
function gotoBuilding(bldg) {
if (bldg == undefined) {
setToIdle();
} else {
myTargetBldg = bldg;
var _local3;
var _local2;
if (bldg._x < _x) {
_local3 = myTargetBldg.xTileUnit + 2;
} else {
_local3 = myTargetBldg.xTileUnit - 1;
}
if (bldg._y < _y) {
_local2 = myTargetBldg.yTileUnit + 1;
} else {
_local2 = myTargetBldg.yTileUnit - 2;
}
moveToLoc(_local3, _local2);
myTask = K.GOTOBUILDING;
onTask = true;
_icon.gotoAndStop("walk");
}
}
function attackBuilding(bldg) {
myTask = K.ATTACKTASK;
if (attackFacing != undefined) {
gotoAndStop(attackFacing);
} else {
gotoAndStop("right");
}
_icon.gotoAndStop("attack");
}
function onAttackHit() {
myTargetBldg.takeDamage(myDamage);
}
function findSomeNWaste() {
var _local4 = master.rArray;
var _local8;
var _local6 = 100000000 /* 0x5F5E100 */;
var _local7 = -10000000;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = 0;
if (_local4[_local2].amEatTargetted == false) {
_local3 = _local3 + 50;
}
var _local5 = K.getDist(this, _local4[_local2]);
if (_local5 < _local6) {
_local6 = _local5;
_local3 = _local3 + 50;
_local3 = _local3 + _local4[_local2].amount;
}
if (_local4[_local2].atMax == true) {
_local3 = _local3 + 100;
}
if (_local3 > _local7) {
_local7 = _local3;
_local8 = _local4[_local2];
}
_local2++;
}
if (_local8 != undefined) {
_local8.targetForEating();
}
wasteDist = _local6;
return(new Array(_local8, _local6));
}
function findSomeGarbage() {
var _local4 = master.gArray;
var _local6;
var _local7 = 100000000 /* 0x5F5E100 */;
var _local8 = -10000000;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = 0;
if (_local4[_local2].isRubble == false) {
if (_local4[_local2].amEatTargetted == false) {
_local3 = _local3 + 50;
}
var _local5 = K.getDist(this, _local4[_local2]);
if (_local5 < 15) {
_local3 = _local3 + 1000000;
_local6 = _local4[_local2];
}
if (_local5 < _local7) {
_local7 = _local5;
_local3 = _local3 + 50;
_local3 = _local3 + _local4[_local2].amount;
}
if (_local4[_local2].atMax == true) {
_local3 = _local3 + 100;
}
if (_local3 > _local8) {
_local8 = _local3;
_local6 = _local4[_local2];
}
}
_local2++;
}
_local6.targetForEating(this);
garbageDist = _local7;
return(new Array(_local6, _local7));
}
function findNuclearBuilding() {
var _local3 = master.bldgArray;
var _local8;
var _local7 = 100000000 /* 0x5F5E100 */;
var _local4 = 0;
var _local6 = -1;
var _local5 = 0;
var _local2 = 0;
while (_local2 < _local3.length) {
_local5 = K.getDist(this, _local3[_local2]);
if (_local5 < _local7) {
_local7 = _local5;
_local4 = _local4 + 250;
}
_local4 = _local4 + tasteNuclearBuilding(_local3[_local2]);
if (_local4 > _local6) {
_local6 = _local4;
_local8 = _local3[_local2];
}
_local2++;
}
bldgDist = K.getDist(this, _local8);
return(new Array(_local8, _local6));
}
function findTastiestBuilding() {
var _local3 = master.bldgArray;
var _local8;
var _local7 = 100000000 /* 0x5F5E100 */;
var _local4 = 0;
var _local6 = -1;
var _local5 = 0;
var _local2 = 0;
while (_local2 < _local3.length) {
_local5 = K.getDist(this, _local3[_local2]);
if (_local5 < _local7) {
_local7 = _local5;
_local4 = _local4 + 250;
}
_local4 = _local4 + tasteBuilding(_local3[_local2]);
if (_local4 > _local6) {
_local6 = _local4;
_local8 = _local3[_local2];
}
_local2++;
}
bldgDist = K.getDist(this, _local8);
return(new Array(_local8, _local6));
}
function tasteNuclearBuilding(b) {
switch (b.myIndex) {
case K.NUCLEARDUMP :
return(NuclearDump(b).amount * 1000);
case K.LANDFILL :
return(Landfill(b).amount * 250);
}
return(-250);
}
function tasteBuilding(b) {
switch (b.myIndex) {
case K.FARM :
return(K.FOOD_MULT * master.getFood());
case K.MINE :
return(K.METAL_MULT * master.getMetal());
case K.COALMINE :
return(K.COAL_MULT * master.getCoal());
case K.OILGASWELL :
return((K.FF_MULT * master.getFF()) + (K.GAS_MULT * master.getGas()));
case K.LAB :
return(K.RESEARCH_MULT * master.getResearch());
case K.SUPERFARM :
return((K.FOOD_MULT * 2) * master.getFood());
case K.COALPLANT :
return(((K.COAL_MULT / 2) * master.getCoal()) + (((K.ENERGY_MULT / 2) * master.getEnergy()) / 3));
case K.GASPLANT :
return(((K.GAS_MULT / 2) * master.getGas()) + (((K.ENERGY_MULT / 2) * master.getEnergy()) / 3));
case K.NUCLEARPLANT :
return((K.ENERGY_MULT * master.getEnergy()) / 3);
case K.GEOPLANT :
return(((K.ENERGY_MULT / 2) * master.getEnergy()) / 3);
case K.WINDPLANT :
return(((K.ENERGY_MULT / 3) * master.getEnergy()) / 3);
case K.SOLARPLANT :
return(((K.ENERGY_MULT / 3) * master.getEnergy()) / 3);
}
return(-250);
}
function findClosestBuilding() {
var _local3 = master.bldgArray;
var _local6;
var _local5 = 100000000 /* 0x5F5E100 */;
var _local8 = 0;
var _local7 = 0;
var _local4 = 0;
var _local2 = 0;
while (_local2 < _local3.length) {
_local4 = K.getDist(this, _local3[_local2]);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local3[_local2];
}
_local2++;
}
bldgDist = _local5;
return(new Array(_local6, _local5));
}
function notInOldList(b) {
var _local2 = 0;
while (_local2 < oldTargets.length) {
if (oldTargets[_local2] == b) {
return(false);
}
_local2++;
}
return(true);
}
function findALandfill() {
var _local3 = master.bldgArray;
var _local6;
var _local5 = 100000000 /* 0x5F5E100 */;
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].myIndex == K.LANDFILL) {
var _local4;
_local4 = K.getDist(this, _local3[_local2]);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local3[_local2];
}
}
_local2++;
}
return(_local6);
}
function tryToAttackBuilding() {
if (myTargetBldg.requestAttack(this) == true) {
} else {
findSomethingElse();
}
}
function findSomethingElse() {
oldTargets.push(myTargetBldg);
if (oldTargets.length > 2) {
oldTargets.splice(0, 1);
}
setToIdle();
}
function setAttackLoc(o) {
myTask = K.ATTACKPOSITION;
moveToLoc(o.xTile, o.yTile);
attackFacing = o.facing;
}
function clearDistances() {
garbageDist = 1000000 /* 0x0F4240 */;
wasteDist = 1000000 /* 0x0F4240 */;
buildingDist = 1000000 /* 0x0F4240 */;
bestDist = 1000000 /* 0x0F4240 */;
}
function testUnd4(amt, amt2, amt3, amt4, str) {
var _local2 = K.testUnd4(amt, amt2, amt3, amt4, "Enemy." + str);
if (!_local2) {
}
return(_local2);
}
function testUnd3(amt, amt2, amt3, str) {
var _local2 = K.testUnd3(amt, amt2, amt3, "Enemy." + str);
if (!_local2) {
}
return(_local2);
}
function testUnd(amt, str) {
var _local2 = K.testUnd(amt, "Enemy." + str);
if (!_local2) {
}
return(_local2);
}
var typeOfThing = K.ENEMY;
var myMenu = "GenericEnemy";
var speed = 1;
var movingX = false;
var movingY = false;
var nextLevel = 10;
var myLevel = 0;
var maxLevel = 5;
var wasHereFirst = false;
var fireCounter = 0;
var singeTime = 0;
var myXP = 0;
var singeOn = false;
var pushX = 0;
var pushY = 0;
var amountOrganic = 2;
var amountMetal = 0;
var amountReuse = 0;
var amountJunk = 0;
var bulletMetal = 0;
}
Symbol 2887 MovieClip [__Packages.EnemyIcon] Frame 0
class EnemyIcon extends MovieClip
{
var anim, onLoad;
function EnemyIcon () {
super();
}
function stopPlay() {
anim.stop();
onLoad = function () {
this.anim.stop();
};
}
function startPlay() {
anim.play();
onLoad = function () {
this.anim.play();
};
}
}
Symbol 2888 MovieClip [__Packages.ResourceToken] Frame 0
class ResourceToken extends MovieClip
{
var outline, master, myMenu, myBuilding, myBuildingIndex, gotoAndStop, removeMovieClip, xTile, yTile;
function ResourceToken () {
super();
}
function onLoad() {
outline._visible = false;
}
function targetForEating() {
amEatTargetted = true;
}
function setMaster(d) {
master = d;
}
function addAmount(amt) {
setAmount(amount + amt);
}
function setAmount(amt) {
}
function removeAmount(minus) {
var _local2 = 0;
if (amount > minus) {
setAmount(amount - minus);
_local2 = minus;
} else {
_local2 = amount;
setAmount(0);
}
if (amSelected) {
master.selectBuilding(myMenu, amount);
}
return(_local2);
}
function setBuilding(bldg) {
myBuilding = bldg;
myBuildingIndex = 2;
}
function deactivateMe(str) {
outline._visible = false;
onRelease = undefined;
gotoAndStop(str);
}
function targetForPickup() {
amTargetted = true;
}
function unTarget() {
amTargetted = false;
}
function deleteMe() {
if (amSelected) {
master.unClickEverything();
}
removeMovieClip();
}
function onRelease() {
switch (master.actionMode) {
case K.CLICK :
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, amount);
amSelected = true;
break;
case K.DEMOLISH :
master.showError("You can't demolish resources! Take it to a factory or fortress!");
break;
default :
master.onClickTerrain();
}
}
function setLoc(xx, yy) {
xTile = xx;
yTile = yy;
}
function setType() {
}
function unClick() {
outline._visible = false;
amSelected = false;
}
var isResource = true;
var amSelected = false;
var amount = 0;
var amTargetted = false;
var amEatTargetted = false;
}
Symbol 2889 MovieClip [__Packages.NuclearWaste] Frame 0
class NuclearWaste extends ResourceToken
{
var atMax, myBuilding, master, gotoAndStop;
function NuclearWaste () {
super();
}
function setAmount(amt) {
var _local3;
var _local4 = false;
var _local5 = "nWaste";
if (amt == 1) {
_local3 = "little";
atMax = false;
} else if (amt == 2) {
_local3 = "some";
atMax = false;
} else if (amt == 3) {
_local3 = "lots";
atMax = false;
} else if (amt > 3) {
_local3 = "max";
atMax = true;
} else if (amt <= 0) {
_local4 = true;
atMax = false;
}
amount = amt;
if (myBuilding != undefined) {
myBuilding.setResource(amt, myIndex);
}
if (_local4) {
master.deleteResourceToken(this);
}
gotoAndStop(_local3);
if (amSelected) {
master.selectBuilding(_local5, amount, this);
}
if (atMax) {
master.doMessageAlert("nWastePickupAlert", this);
}
}
var amSelected = false;
var myMenu = "nWaste";
var myType = "nWaste";
var myIndex = K.NWASTE;
var amount = 0;
var amTargetted = false;
}
Symbol 2890 MovieClip [__Packages.Depot] Frame 0
class Depot extends Building
{
var outline, hideResourceIn, hideResourceOut, hideRepairBeacon, rinx, resourceIn, riny, routx, resourceOut, routy, rin2x, resourceIn2, rin2y, rout2x, resourceOut2, rout2y, setMeUp, externalSetMeUp, hideHpBar, updateUpgrades, master;
function Depot () {
super();
}
function onLoad() {
outline._visible = false;
hideResourceIn();
hideResourceOut();
hideResourceIn2();
hideResourceOut2();
hideRepairBeacon();
rinx = resourceIn._x;
riny = resourceIn._y;
routx = resourceOut._x;
routy = resourceOut._y;
rin2x = resourceIn2._x;
rin2y = resourceIn2._y;
rout2x = resourceOut2._x;
rout2y = resourceOut2._y;
setMeUp();
externalSetMeUp();
hideHpBar();
updateUpgrades();
}
function useResource2(str) {
showResourceIn2(str);
resourceIn2._icon.gotoAndStop("bounce");
resourceIn2._x = rin2x;
resourceIn2._y = rin2y;
var back = this;
var i = setInterval(function () {
back.resourceIn2._y = back.resourceIn2._y + 2;
if (back.resourceIn2._y >= (back.rin2y + 20)) {
back.hideResourceIn2();
clearInterval(i);
}
}, 50);
}
function makeResource2(str, isSuper) {
showResourceOut2(str);
if (isSuper == true) {
resourceOut2._icon.gotoAndStop("super");
} else {
resourceOut2._icon.gotoAndStop("plus");
}
resourceOut2._y = routy;
var back = this;
var j = setInterval(function () {
back.resourceOut2._y = back.resourceOut2._y - 2;
if (back.resourceOut2._y <= (back.routy - 20)) {
back.hideResourceOut2();
clearInterval(j);
}
}, 50);
}
function addResource(amt, type) {
switch (type) {
case K.METAL :
makeResource2("metal", false);
master.makeMetal(amt);
return(true);
case K.FF :
makeResource2("ff", false);
master.makeFF(amt);
return(true);
case K.GAS :
makeResource2("gas", false);
master.makeGas(amt);
return(true);
case K.NWASTE :
makeResource2("nwaste", false);
return(true);
}
return(false);
}
function hideResourceIn2() {
resourceIn2.gotoAndStop("nothing");
}
function showResourceIn2(str) {
resourceIn2.gotoAndStop(str);
}
function hideResourceOut2() {
resourceOut2.gotoAndStop("nothing");
}
function showResourceOut2(str) {
resourceOut2.gotoAndStop(str);
}
var isDepot = true;
}
Symbol 2891 MovieClip [__Packages.NuclearDump] Frame 0
class NuclearDump extends Depot
{
var amSelected, master, outline, onSelected, attachMovie, getNextHighestDepth, xTile, yTile, _visible, tempG, smogThisCycle, tempS;
function NuclearDump () {
super();
}
function setMeUp() {
}
function doTick() {
}
function getPercent() {
return((100 * amount) / capacity);
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
updatePercent();
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function demolishMe() {
master.playSound(1, "demolish.wav", 1);
attachMovie("mc_smokeCloud", "theSmoke", getNextHighestDepth());
}
function halfDestroyAnim() {
if (Math.ceil(amount / 4) > 0) {
master.makeGarbage(xTile, yTile, xTile + 1, yTile + 1, Math.ceil(amount / 4), true);
if ((amount > 0) && (amount != undefined)) {
master.makeNWaste(xTile, yTile, xTile + 1, yTile + 1, Math.ceil(amount / 4));
}
}
}
function halfDemolishAnim() {
if (Math.ceil(amount / 4) > 0) {
master.makeGarbage(xTile, yTile, xTile + 1, yTile + 1, Math.ceil(amount / 4), true);
if ((amount > 0) && (amount != undefined)) {
master.makeNWaste(xTile, yTile, xTile + 1, yTile + 1, Math.ceil(amount / 4));
}
}
_visible = false;
}
function refreshTick() {
nwasteInThisCycle = tempG;
smogThisCycle = tempS;
tempG = 0;
tempS = 0;
}
function addResource(amt, type) {
var _local3 = false;
if (amFull == false) {
_local3 = true;
if (amt != undefined) {
if ((amount + amt) < capacity) {
amount = amount + amt;
tempG = tempG + amt;
if (amSelected) {
updatePercent();
}
} else {
amount = capacity;
amFull = true;
}
} else {
amt = 0;
}
}
return(_local3);
}
function updatePercent() {
master.unClickEverything();
outline._visible = true;
amSelected = true;
var _local2 = getPercent();
master.selectBuilding(myMenu, _local2, this);
}
var myIndex = K.NUCLEARDUMP;
var myMenu = "NuclearDump";
var smogTicks = 0;
var smogTime = 5;
var amSuper = false;
var capacity = 10000;
var amount = 0;
var eatsFood = false;
var amFull = false;
var foodIn = 0;
var doesSleep = false;
var nwasteInThisCycle = 0;
}
Symbol 2892 MovieClip [__Packages.TerrainSquare] Frame 0
class TerrainSquare extends MovieClip
{
var master, myIndex, hp, _alpha, xLoc, yLoc, xUnitLoc, yUnitLoc;
function TerrainSquare () {
super();
}
function onLoad() {
amTargetted = false;
}
function setMaster(d) {
master = d;
}
function setIndex(i) {
myIndex = i;
}
function setHp(h) {
hp = h;
_alpha = hp;
}
function cleanUp(amt) {
hp = hp - amt;
_alpha = hp;
if (hp <= 0) {
master.unproducePollutionSpill(1);
master.deleteTerrainTile(this);
return(0);
}
return(hp);
}
function setLoc(xx, yy) {
xLoc = xx;
yLoc = yy;
xUnitLoc = xLoc * 2;
yUnitLoc = yLoc * 2;
}
function targetForPickup() {
amTargetted = true;
}
function untarget() {
amTargetted = false;
}
var amSpill = false;
var amTargetted = false;
}
Symbol 2893 MovieClip [__Packages.Factory] Frame 0
class Factory extends Depot
{
var unitEnergy, unitMetal, unitEnergyT, unitMetalT, percent, energyIn, metalIn, updateInterface, master, makeResource, notEnoughEnergy, gotoAndPlay, useResource, useResource2, enoughResource, tickGarbage, notEnoughFood, showFoodAlert, smogPoint, _x, _y, makeSmog, amSelected, xTile, yTile, deployFlag, deployHere;
function Factory () {
super();
}
function clearFactory() {
producing = false;
currUnit = "";
unitEnergy = 0;
unitMetal = 0;
unitEnergyT = 1000;
unitMetalT = 1000;
percent = 0;
finished = false;
energyIn = 0;
metalIn = 0;
updateInterface();
}
function updateRecycling() {
}
function updateRecyclingGraphic() {
}
function cancelUnit() {
var _local3 = unitEnergyT - unitEnergy;
var _local4 = unitMetalT - unitMetal;
var _local2 = Math.round(_local4 * 0.66);
master.giveMetal(_local2);
if (_local2 > 0) {
makeResource("metal");
}
energyDiscount = Math.round(_local3 * 0.5);
clearFactory();
}
function setRecyclingLevel(type, level) {
}
function buildUnit(str) {
unitEnergy = K.getCost(str)[0];
unitMetal = K.getCost(str)[1];
unitEnergyT = unitEnergy;
unitMetalT = unitMetal;
unitEnergy = unitEnergy - energyDiscount;
energyDiscount = 0;
var _local2 = master.hasEnergy(unitEnergy);
var _local3 = master.hasMetal(unitMetal);
if (_local2 && (_local3)) {
producing = true;
currUnit = str;
notEnoughEnergy = false;
gotoAndPlay("bounce");
if (unitEnergy > 0) {
useResource("energy");
}
if (unitMetal > 0) {
useResource2("metal");
}
master.factoryDrain(unitEnergy, unitMetal);
enoughResource();
finished = true;
tickGarbage();
master.theInterface.showUnitProduction(this);
} else if ((!_local2) && (!_local3)) {
master.errorBuilding(0, 1, 1);
} else if (!_local2) {
master.errorBuilding(0, 1, 0);
} else if (!_local3) {
master.errorBuilding(0, 0, 1);
}
}
function onSelected() {
if (producing == true) {
} else {
master.theInterface.hideUnitProduction();
}
}
function foodTick() {
if (master.hasFood(1)) {
notEnoughFood = false;
useResource("food");
master.drainFood(1);
} else {
showFoodAlert(true);
}
if (!master.inAMenu) {
updateInterface();
}
}
function playHammerSound() {
master.playSound(0, "hammer.wav", 1);
}
function onBounceEnd() {
var _local3 = _x + smogPoint._x;
var _local2 = _y + smogPoint._y;
makeSmog(_local3, _local2, smogAmount);
makeResource("hammer");
if (amSelected) {
if (producing) {
master.theInterface.showUnitProduction(this);
}
}
if (finished) {
producing = false;
master.makeUnit(_x, _y, xTile, yTile, currUnit, true);
clearFactory();
currUnit = "";
}
}
function deployTheFlag() {
master.undeployFactoryFlags();
deployFlag._visible = true;
deployHere = true;
}
function undeployTheFlag() {
deployFlag._visible = false;
deployHere = false;
}
var myIndex = K.FACTORY;
var myMenu = "Factory";
var producing = false;
var finished = false;
var currUnit = "";
var asleep = false;
var garbageRate = K.G_OUT_FACTORY;
var smogAmount = K.S_OUT_FACTORY;
var doesSleep = false;
var eatsFood = false;
var isPaused = false;
var recyclingLevel = 0;
var recycling_metal = 0;
var recycling_PETE = 0;
var recycling_gas = 0;
var recycling_biofuel = 0;
var energyDiscount = 0;
var gRateO = 0;
var gRateM = 0.1;
var gRateR = 0.25;
var gRateJ = 0.65;
}
Symbol 2894 MovieClip [__Packages.Smog] Frame 0
class Smog extends MovieClip
{
var speedY, speedX, master, arrayIndex, amount, gotoAndPlay;
function Smog () {
super();
}
function onLoad() {
speedY = -1;
speedX = -0.2;
}
function setMaster(d, i) {
master = d;
arrayIndex = i;
}
function enterFrameFunction() {
}
function setAmount(amt) {
amount = amt;
if (amount < 5) {
gotoAndPlay("smallGrow");
} else if (amount < 10) {
gotoAndPlay("mediumGrow");
} else {
gotoAndPlay("bigGrow");
}
}
function timeToDie() {
master.onSmogLeave(this);
}
var size = 0.1;
}
Symbol 2895 MovieClip [__Packages.Mine] Frame 0
class Mine extends Building
{
var reservoir, master, xTile, yTile, notEnoughEnergy, gotoAndPlay, useResource, tickGarbage, showEnergyAlert, amSelected, outline, garbageAmt, onSelected, makeResource;
function Mine () {
super();
}
function setMeUp() {
findReservoir();
if (reservoir != undefined) {
metalOut = K.M_OUT_MINE * reservoir.pumpRate;
} else {
K.error("Mine", "SetMeUp", "No Reservoir found!");
}
}
function findReservoir() {
reservoir = master.findReservoir(xTile, yTile);
}
function doTick() {
if (master.lessThanMaxMetal()) {
if (master.hasEnergy(energyIn)) {
notEnoughEnergy = false;
gotoAndPlay("bounce");
master.drainEnergy(energyIn);
useResource("energy");
tickGarbage();
} else {
showEnergyAlert();
}
}
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, garbageAmt, this);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function onBounceEnd() {
makeResource("metal", false, reservoir.getLevel());
master.makeMetal(metalOut);
metalOut = reservoir.pumpMetal(K.M_OUT_MINE);
}
var myIndex = K.MINE;
var myMenu = "mine";
var garbageRate = K.G_OUT_MINE;
var energyIn = K.E_IN_MINE;
var metalOut = K.M_OUT_MINE;
var gRateO = 0;
var gRateM = 0;
var gRateR = 0.05;
var gRateJ = 0.95;
}
Symbol 2896 MovieClip [__Packages.CoalMine] Frame 0
class CoalMine extends Mine
{
var reservoir, master, xTile, yTile, notEnoughEnergy, gotoAndPlay, useResource, tickGarbage, showEnergyAlert, amSelected, outline, garbageAmt, onSelected, makeResource;
function CoalMine () {
super();
}
function setMeUp() {
findReservoir();
if (reservoir != undefined) {
coalOut = K.C_OUT_COALMINE * reservoir.pumpRate;
} else {
K.error("CoalMine", "SetMeUp", "No Reservoir found!");
}
}
function findReservoir() {
reservoir = master.findReservoir(xTile, yTile);
}
function doTick() {
if (master.lessThanMaxCoal()) {
if (master.hasEnergy(energyIn)) {
notEnoughEnergy = false;
gotoAndPlay("bounce");
master.drainEnergy(energyIn);
useResource("energy");
tickGarbage();
} else {
showEnergyAlert();
}
}
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, garbageAmt, this);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function onBounceEnd() {
makeResource("coal", false, reservoir.getLevel());
master.makeCoal(coalOut);
coalOut = reservoir.pumpCoal(K.C_OUT_COALMINE);
}
var myIndex = K.COALMINE;
var myMenu = "CoalMine";
var garbageRate = K.G_OUT_COALMINE;
var energyIn = K.E_IN_COALMINE;
var coalOut = K.C_OUT_COALMINE;
var gRateO = 0;
var gRateM = 0;
var gRateR = 0.05;
var gRateJ = 0.95;
}
Symbol 2897 MovieClip [__Packages.CoalPlant] Frame 0
class CoalPlant extends Building
{
var master, gotoAndPlay, useResource, tickGarbage, enoughResource, showCoalAlert, smogPoint, _x, _y, makeSmog, makeResource;
function CoalPlant () {
super();
}
function doTick() {
if (master.lessThanMaxEnergy()) {
if (master.hasCoal(coalIn)) {
gotoAndPlay("bounce");
master.drainCoal(coalIn);
useResource("coal");
tickGarbage();
enoughResource();
} else {
showCoalAlert();
}
}
}
function setMeUp() {
}
function onBounceEnd() {
var _local3 = _x + smogPoint._x;
var _local2 = _y + smogPoint._y;
makeSmog(_local3, _local2, smogAmount);
makeResource("energy");
master.makeEnergy(energyOut);
}
var myIndex = K.COALPLANT;
var myMenu = "CoalPlant";
var smogAmount = K.S_OUT_COALPLANT;
var energyOut = K.E_OUT_COALPLANT;
var coalIn = K.COAL_IN_COALPLANT;
var doesSleep = false;
var garbageRate = 0;
}
Symbol 2898 MovieClip [__Packages.Farm] Frame 0
class Farm extends Building
{
var master, notEnoughEnergy, gotoAndPlay, useResource, tickGarbage, showEnergyAlert, smogPoint, _x, _y, makeSmog, makeResource;
function Farm () {
super();
}
function setMeUp() {
}
function doTick() {
if (master.hasEnergy(energyIn)) {
foodOut = foodProduction;
notEnoughEnergy = false;
if (master.lessThanMaxFood()) {
gotoAndPlay("bounce");
master.drainEnergy(energyIn);
useResource("energy");
tickGarbage();
}
} else {
showEnergyAlert();
foodOut = 0;
}
}
function onBounceEnd() {
var _local3 = _x + smogPoint._x;
var _local2 = _y + smogPoint._y;
makeSmog(_local3, _local2, smogAmount);
makeResource("food", false);
master.makeFood(foodOut);
}
var myIndex = K.FARM;
var myMenu = "Farm";
var amSuper = false;
var eatsFood = false;
var garbageRate = K.G_OUT_FARM;
var energyIn = K.E_IN_FARM;
var foodIn = 0;
var foodProduction = K.F_OUT_FARM;
var foodOut = K.F_OUT_FARM;
var smogAmount = K.S_OUT_FARM;
var gRateO = 0.8;
var gRateM = 0;
var gRateR = 0.1;
var gRateJ = 0.1;
}
Symbol 2899 MovieClip [__Packages.FFPlant] Frame 0
class FFPlant extends Building
{
var master, enoughResource, gotoAndPlay, useResource, tickGarbage, showFFAlert, smogPoint, _x, _y, makeSmog, makeResource;
function FFPlant () {
super();
}
function doTick() {
if (master.lessThanMaxEnergy()) {
if (master.hasFF(FFIn)) {
enoughResource();
gotoAndPlay("bounce");
master.drainFF(FFIn);
useResource("FF");
tickGarbage();
} else {
showFFAlert();
}
}
}
function setMeUp() {
}
function onBounceEnd() {
var _local3 = _x + smogPoint._x;
var _local2 = _y + smogPoint._y;
makeSmog(_local3, _local2, smogAmount);
makeResource("energy");
master.makeEnergy(energyOut);
}
var myIndex = K.FFPLANT;
var myMenu = "FFPlant";
var smogAmount = K.S_OUT_FFPLANT;
var energyOut = K.E_OUT_FFPLANT;
var FFIn = K.FF_IN_FFPLANT;
var doesSleep = false;
var garbageRate = 0;
}
Symbol 2900 MovieClip [__Packages.FlameTurret] Frame 0
class FlameTurret extends Building
{
var radius, master, useResource, showFFGasAlert, amSelected, outline, onSelected, disabled, _x, _y, target, gun, gotoAndStop;
function FlameTurret () {
super();
}
function setMeUp() {
radius = 6 * K.TILE_SIZE;
ffGasIn = K.R_IN_FLAMETURRET;
}
function fire() {
if (coolDown <= 0) {
var _local3 = master.checkFF(ffGasIn);
var _local4 = master.checkGas(ffGasIn);
var _local2 = false;
if ((_local3 >= _local4) && (_local3 >= 0)) {
master.drainFF(ffGasIn, true);
useResource("ff");
_local2 = true;
} else if ((_local4 >= _local3) & (_local4 >= 0)) {
master.drainGas(ffGasIn, true);
useResource("gas");
_local2 = true;
} else {
showFFGasAlert();
}
if (_local2) {
onFire();
coolDown = K.COOLDOWN_FLAMETURRET;
}
} else {
coolDown--;
}
}
function playAttackSound() {
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, myDamage, this);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function onCheckTick() {
if (!disabled) {
var _local2 = 0;
while (_local2 < master.eArray.length) {
if (master.eArray[_local2]._x != undefined) {
var _local4 = master.eArray[_local2]._x - _x;
var _local3 = master.eArray[_local2]._y - _y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= radius) {
if (master.eArray[_local2].destroying == false) {
target = master.eArray[_local2];
fire();
break;
}
}
}
_local2++;
}
}
}
function onFire() {
var _local4 = target._x - _x;
var _local3 = target._y - _y;
var _local2 = Math.atan2(_local3, _local4);
_local2 = _local2 * 57.2957795130823;
_local2 = _local2 + 180;
gun._rotation = _local2;
gun.gotoAndPlay("fire");
target.takeDamage(myDamage, K.FLAMETURRET);
burnAroundTarget();
}
function burnAroundTarget() {
var _local6 = 3 * K.TILE_SIZE;
var _local2 = 0;
while (_local2 < master.eArray.length) {
var _local4 = master.eArray[_local2]._x - target._x;
var _local3 = master.eArray[_local2]._y - target._y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= _local6) {
master.eArray[_local2].takeDamage(0, K.FLAMETURRET);
}
_local2++;
}
}
function onBounceEnd() {
firing = false;
gotoAndStop("default");
}
var myIndex = K.FLAMETURRET;
var myMenu = "FlameTurret";
var myDamage = K.DMG_FLAMETURRET;
var myRange = 3;
var isWeapon = true;
var firing = false;
var eatsFood = false;
var ffGasIn = K.R_IN_FLAMETURRET;
var coolDown = 0;
var doesSleep = false;
}
Symbol 2901 MovieClip [__Packages.FloodLights] Frame 0
class FloodLights extends Building
{
var clickyThing, master, demolishMe, repairMe, notEnoughEnergy, useResource, showEnergyAlert, amSelected, outline, onSelected, gotoAndPlay, gotoAndStop, disabled, _x, _y;
function FloodLights () {
super();
}
function setMeUp() {
var _local2 = this;
}
function onRelease() {
var _local3;
var _local2;
_local3 = Math.abs(clickyThing._xmouse);
_local2 = Math.abs(clickyThing._ymouse);
if ((_local3 < 32) && (_local2 < 32)) {
normalClick();
} else {
master.bruteForceClick(this);
}
}
function normalClick() {
switch (master.actionMode) {
case K.CLICK :
selectMe();
break;
case K.DEMOLISH :
demolishMe();
break;
case K.REPAIR :
repairMe();
break;
case K.MOVE :
selectMe();
break;
case K.BUILD :
master.doClickThing();
}
}
function doTick() {
if (isOn) {
if (master.hasEnergy(energyIn)) {
notEnoughEnergy = false;
master.drainEnergy(energyIn, true);
useResource("energy");
} else {
showEnergyAlert();
turnOff();
}
}
}
function playAttackSound() {
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, myDamage, this);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function makeLightsHappen() {
master.makeLight();
}
function turnOn() {
if (master.hasEnergy(energyIn)) {
isOn = true;
gotoAndPlay("bounce");
}
}
function turnOff() {
isOn = false;
gotoAndStop("default");
makeLightsHappen();
}
function onCheckTick() {
var _local6 = false;
if (!disabled) {
var _local2 = 0;
while (_local2 < master.eArray.length) {
if (master.eArray[_local2]._x != undefined) {
var _local4 = master.eArray[_local2]._x - _x;
var _local3 = master.eArray[_local2]._y - _y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= radius) {
if (!isOn) {
_local6 = true;
break;
}
_local6 = true;
master.eArray[_local2].singeLight(myDamage, K.FLOODLIGHTS, this);
}
}
_local2++;
}
}
if (_local6) {
if (!isOn) {
turnOn();
}
} else {
turnOffTicks++;
if (turnOffTicks > 10) {
turnOff();
turnOffTicks = 0;
}
}
}
function onBounceEnd() {
}
var myIndex = K.FLOODLIGHTS;
var myMenu = "FloodLights";
var myDamage = K.DMG_FLOODLIGHTS;
var radius = 75;
var isWeapon = true;
var isOn = false;
var turnOffTicks = 0;
var doesSleep = false;
var eatsFood = false;
var energyIn = K.E_IN_FLOODLIGHTS;
}
Symbol 2902 MovieClip [__Packages.Fortress] Frame 0
class Fortress extends Depot
{
var master, gotoAndPlay, notEnoughEnergy, useResource, tickGarbage, showEnergyAlert, hideHpBar, smogPoint, _x, _y, makeSmog;
function Fortress () {
super();
}
function doTick() {
if (master.hasEnergy(energyIn)) {
gotoAndPlay("bounce");
master.drainEnergy(energyIn);
notEnoughEnergy = false;
useResource("energy");
tickGarbage();
} else {
showEnergyAlert();
}
}
function setMeUp() {
hideHpBar();
}
function demolishMe() {
master.showError("You can't demolish your fortress!");
}
function onBounceEnd() {
var _local3 = _x + smogPoint._x;
var _local2 = _y + smogPoint._y;
makeSmog(_local3, _local2, smogAmount);
}
function disableToggle() {
master.doMessageAlert("You can't disable a fortress!");
}
function onRemove() {
master.loseLevel();
}
var myIndex = K.FORTRESS;
var myMenu = "Fortress";
var smogAmount = K.S_OUT_FORTRESS;
var energyIn = K.E_IN_FORTRESS;
var garbageRate = K.G_OUT_FORTRESS;
var gRateO = 0.75;
var gRateM = 0;
var gRateR = 0.1;
var gRateJ = 0.15;
}
Symbol 2903 MovieClip [__Packages.GasPlant] Frame 0
class GasPlant extends Building
{
var master, gotoAndPlay, useResource, tickGarbage, enoughResource, showGasAlert, smogPoint, _x, _y, makeSmog, makeResource;
function GasPlant () {
super();
}
function doTick() {
if (master.lessThanMaxEnergy()) {
if (master.hasGas(gasIn)) {
gotoAndPlay("bounce");
master.drainGas(gasIn);
useResource("gas");
tickGarbage();
enoughResource();
} else {
showGasAlert();
}
}
}
function onBounceEnd() {
var _local3 = _x + smogPoint._x;
var _local2 = _y + smogPoint._y;
makeSmog(_local3, _local2, smogAmount);
makeResource("energy");
master.makeEnergy(energyOut);
}
var myIndex = K.GASPLANT;
var myMenu = "GasPlant";
var smogAmount = 5;
var energyOut = K.E_OUT_GASPLANT;
var gasIn = K.GAS_IN_GASPLANT;
var doesSleep = false;
}
Symbol 2904 MovieClip [__Packages.GeoPlant] Frame 0
class GeoPlant extends Building
{
var master, gotoAndPlay, makeResource;
function GeoPlant () {
super();
}
function doTick() {
if (master.lessThanMaxEnergy()) {
gotoAndPlay("bounce");
}
}
function setMeUp() {
}
function onBounceEnd() {
makeResource("energy");
master.makeEnergy(energyOut);
}
var myIndex = K.GEOPLANT;
var myMenu = "GeoPlant";
var smogAmount = 0;
var energyOut = K.E_OUT_GEOPLANT;
var eatsFood = true;
var garbageRate = 0;
var doesSleep = false;
}
Symbol 2905 MovieClip [__Packages.GunTurret] Frame 0
class GunTurret extends Building
{
var radius, master, notEnoughMetal, useResource, showMetalAlert, amSelected, outline, onSelected, disabled, _x, _y, target, gun, gotoAndStop;
function GunTurret () {
super();
}
function setMeUp() {
radius = 6 * K.TILE_SIZE;
}
function fire() {
if (coolDown <= 0) {
if (master.hasMetal(metalIn)) {
notEnoughMetal = false;
master.drainMetal(metalIn, true);
useResource("metal");
firing = true;
onFire();
coolDown = K.COOLDOWN_GUNTURRET;
} else {
showMetalAlert();
}
} else {
coolDown--;
}
}
function playAttackSound() {
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, myDamage, this);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function onCheckTick() {
if (!disabled) {
var _local2 = 0;
while (_local2 < master.eArray.length) {
if (master.eArray[_local2]._x != undefined) {
var _local4 = master.eArray[_local2]._x - _x;
var _local3 = master.eArray[_local2]._y - _y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= radius) {
target = master.eArray[_local2];
fire();
break;
}
}
_local2++;
}
}
}
function onFire() {
var _local4 = target._x - _x;
var _local3 = target._y - _y;
var _local2 = Math.atan2(_local3, _local4);
_local2 = _local2 * 57.2957795130823;
_local2 = _local2 + 180;
gun._rotation = _local2;
gun.gotoAndPlay("fire");
target.takeDamage(myDamage, K.GUNTURRET);
}
function onBounceEnd() {
firing = false;
gotoAndStop("default");
}
var myIndex = K.GUNTURRET;
var myMenu = "GunTurret";
var myDamage = K.DMG_GUNTURRET;
var myRange = 3;
var isWeapon = true;
var firing = false;
var eatsFood = false;
var metalIn = K.M_IN_GUNTURRET;
var coolDown = 0;
var doesSleep = false;
}
Symbol 2906 MovieClip [__Packages.Lab] Frame 0
class Lab extends Building
{
var master, notEnoughEnergy, gotoAndPlay, useResource, tickGarbage, showEnergyAlert, amSelected, outline, garbageAmt, onSelected, makeResource;
function Lab () {
super();
}
function doTick() {
if (master.lessThanMaxResearch()) {
if (master.hasEnergy(energyIn)) {
notEnoughEnergy = false;
gotoAndPlay("bounce");
master.drainEnergy(energyIn);
useResource("energy");
tickGarbage();
} else {
showEnergyAlert();
}
}
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, garbageAmt, this);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function onBounceEnd() {
makeResource("research");
master.makeResearch(researchOut);
}
var myIndex = K.LAB;
var myMenu = "lab";
var garbageRate = K.G_OUT_LAB;
var energyIn = K.E_IN_LAB;
var researchOut = K.R_OUT_LAB;
var producing = true;
var gRateO = 0.75;
var gRateM = 0;
var gRateR = 0.1;
var gRateJ = 0.15;
}
Symbol 2907 MovieClip [__Packages.NuclearPlant] Frame 0
class NuclearPlant extends Building
{
var master, gotoAndPlay, tickGarbage, smogPoint, _x, _y, makeResource, resource1, xTileUnit, yTileUnit;
function NuclearPlant () {
super();
}
function doTick() {
if (master.lessThanMaxEnergy()) {
gotoAndPlay("bounce");
tickGarbage();
}
}
function setMeUp() {
}
function onBounceEnd() {
var _local3 = _x + smogPoint._x;
var _local2 = _y + smogPoint._y;
makeResource("energy");
master.makeEnergy(energyOut);
nWasteAmt = nWasteAmt + nWasteOut;
updateResource1("nWaste");
}
function setExternalResource1(amount, type) {
if (resource1.myMenu.toLowerCase() == type.toLowerCase()) {
resource1.setAmount(amount);
} else if (resource1.myIndex == undefined) {
var _local2 = master.makeResourceUnit(xTileUnit + 1, yTileUnit + 1, amount, type);
resource1 = _local2;
}
resource1.setBuilding(this);
}
function updateResource1(what) {
setExternalResource1(nWasteAmt, what);
}
function setResource(amount, index) {
if (index == K.NWASTE) {
nWasteAmt = amount;
}
}
function removeResource(amount, index) {
if (index == K.NWASTE) {
nWasteAmt = nWasteAmt - amount;
if (nWasteAmt < 0) {
nWasteAmt = 0;
}
}
}
var myIndex = K.NUCLEARPLANT;
var myMenu = "NuclearPlant";
var energyOut = K.E_OUT_NUCLEARPLANT;
var nWasteOut = K.NWASTE_OUT_NUCLEARPLANT;
var doesSleep = false;
var garbageRate = 0;
var nWasteAmt = 0;
}
Symbol 2908 MovieClip [__Packages.OilGasWell] Frame 0
class OilGasWell extends Building
{
var reservoir, master, xTile, yTile, notEnoughEnergy, gotoAndPlay, useResource, tickGarbage, showEnergyAlert, amSelected, outline, garbageAmt, onSelected, makeResource, resource1, xTileUnit, yTileUnit, resource2;
function OilGasWell () {
super();
}
function setMeUp() {
findReservoir();
if (reservoir != undefined) {
gasOut = K.GAS_OUT_OILGASWELL * reservoir.pumpRate;
ffOut = K.FF_OUT_OILGASWELL * reservoir.pumpRate;
} else {
K.error("OilGasWell", "SetMeUp", "No Reservoir found!");
}
}
function findReservoir() {
reservoir = master.findReservoir(xTile, yTile);
}
function doTick() {
var _local2 = false;
if (gasOrOil == 0) {
_local2 = master.lessThanMaxFF();
} else {
_local2 = master.lessThanMaxGas();
}
if (_local2 == true) {
if (master.hasEnergy(energyIn)) {
notEnoughEnergy = false;
gotoAndPlay("bounce");
master.drainEnergy(energyIn);
useResource("energy");
tickGarbage();
} else {
showEnergyAlert();
}
}
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, garbageAmt, this);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function onBounceEnd() {
if (gasOrOil == 0) {
makeResource("FF");
ffOut = reservoir.pumpOil(K.FF_OUT_OILGASWELL);
master.makeFF(ffOut);
gasOrOil = 1;
} else {
makeResource("gas");
gasOut = reservoir.pumpGas(K.GAS_OUT_OILGASWELL);
master.makeGas(gasOut);
gasOrOil = 0;
}
}
function setExternalResource1(amount, type) {
if (resource1.myMenu.toLowerCase() == type.toLowerCase()) {
resource1.setAmount(amount);
} else if (resource1.myIndex == undefined) {
var _local2 = master.makeResourceUnit(xTileUnit + 1, yTileUnit + 1, amount, type);
resource1 = _local2;
}
resource1.setBuilding(this);
}
function setExternalResource2(amount, type) {
if (resource2.myMenu.toLowerCase() == type.toLowerCase()) {
resource2.setAmount(amount);
} else if (resource2.myIndex == undefined) {
var _local2 = master.makeResourceUnit(xTileUnit + 1, yTileUnit, amount, type);
resource2 = _local2;
}
resource2.setBuilding(this);
}
function updateResource1(what) {
setExternalResource1(ffAmt, what);
}
function updateResource2(what) {
setExternalResource2(gasAmt, what);
}
function setResource(amount, index) {
if (index == K.GAS) {
gasAmt = amount;
} else if (index == K.FF) {
ffAmt = amount;
}
}
function removeResource(amount, index) {
if (index == K.GAS) {
gasAmt = gasAmt - amount;
if (gasAmt < 0) {
gasAmt = 0;
}
} else if (index == K.FF) {
ffAmt = ffAmt - amount;
if (ffAmt < 0) {
ffAmt = 0;
}
}
}
var myIndex = K.OILGASWELL;
var myMenu = "OilGasWell";
var garbageRate = K.G_OUT_OILGASWELL;
var energyIn = K.E_IN_OILGASWELL;
var gasOut = 0;
var ffOut = 0;
var ffAmt = 0;
var gasAmt = 0;
var gasOrOil = 0;
var doesSleep = false;
var gRateO = 0;
var gRateM = 0;
var gRateR = 0.15;
var gRateJ = 0.85;
}
Symbol 2909 MovieClip [__Packages.RecyclingCenter] Frame 0
class RecyclingCenter extends Depot
{
var master, myLandfill, xTile, yTile, notEnoughEnergy, gotoAndPlay, useResource2, useResource, showEnergyAlert, garbageThisCycle, tempG, smogThisCycle, tempS, makeResource;
function RecyclingCenter () {
super();
}
function setMeUp() {
if (master != undefined) {
myLandfill = Landfill(master.findBuilding(xTile - 1, yTile));
} else {
myLandfill = undefined;
}
energyOut = 0;
}
function updateRecycling(lvl) {
currLevel = lvl;
metalMult = 1;
reuseMult = 1;
organicMult = 1;
if (currLevel != 0) {
var _local2 = 1;
while (_local2 <= currLevel) {
metalMult = metalMult * 1.02;
if (_local2 > 1) {
reuseMult = reuseMult * 1.15;
}
if (_local2 > 2) {
organicMult = organicMult * 1.5;
}
_local2++;
}
} else {
K.error("RecyclingCenter", "updateRecycling", "lvl = undefined!");
}
scrapToMetal = (metalFrac * metalQuota) * metalMult;
metalIn = metalQuota;
if (currLevel > 0) {
reuseIn = reuseQuota;
reuseToEnergy = (reuseFrac * reuseQuota) * reuseMult;
} else {
reuseIn = 0;
reuseToEnergy = 0;
}
if (currLevel > 1) {
organicIn = organicQuota;
organicToGas = (organicFrac * organicQuota) * organicMult;
} else {
organicIn = 0;
organicToGas = 0;
}
}
function doTick() {
amtRecycled = 0;
thingCount++;
if (thingCount > currLevel) {
thingCount = 0;
}
var _local3;
if (myLandfill != undefined) {
_local3 = myLandfill.getGarbageSample();
} else {
K.error("RecyclingCenter", "doTick", "No Landfill found!");
}
if (_local3 != undefined) {
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local2 != 0) {
if (_local3[_local2] > 25) {
_local3[_local2] = 25;
}
} else if (_local2 == 0) {
if (_local3[_local2] > 100) {
_local3[_local2] = 100;
}
}
_local2++;
}
currLevel = K.getLevels("recyclingcenter");
switch (thingCount) {
case 0 :
tryRecycleMetal(_local3[1]);
break;
case 1 :
tryRecycleReuse(_local3[2]);
break;
case 2 :
tryRecycleOrganic(_local3[0]);
}
} else {
K.error("RecyclingCenter,", "doTick", "Garbage Sample undefined!");
}
if (myLandfill.amSelected == true) {
myLandfill.updatePercent();
}
}
function tryRecycleMetal(amt) {
if (master.lessThanMaxMetal()) {
if (master.hasEnergy(energyIn)) {
if (amt >= metalQuota) {
notEnoughEnergy = false;
gotoAndPlay("bounce");
master.drainEnergy(energyIn);
useResource2("energy");
useResource("scrap");
amtRecycled = amt;
}
} else {
showEnergyAlert();
}
}
}
function tryRecycleReuse(amt) {
if (master.lessThanMaxEnergy()) {
if (master.hasEnergy(energyIn)) {
if (amt >= reuseQuota) {
notEnoughEnergy = false;
gotoAndPlay("bounce");
master.drainEnergy(energyIn);
useResource2("energy");
useResource("reuse");
amtRecycled = amt;
}
} else {
showEnergyAlert();
}
}
}
function tryRecycleOrganic(amt) {
if (master.lessThanMaxGas()) {
if (master.hasEnergy(energyIn)) {
if (amt >= organicQuota) {
notEnoughEnergy = false;
gotoAndPlay("bounce");
master.drainEnergy(energyIn);
useResource2("energy");
useResource("organic");
amtRecycled = amt;
}
} else {
showEnergyAlert();
}
}
}
function refreshTick() {
garbageThisCycle = tempG;
smogThisCycle = tempS;
tempG = 0;
tempS = 0;
scrapin = tempScrapin;
organicin = tempOrganicin;
usefulin = tempUsefulin;
mout = tempMout;
eout = tempEout;
_gasout = tempGasout;
_scrapin = _scrapin + tempScrapin;
_organicin = _organicin + tempOrganicin;
_usefulin = _usefulin + tempUsefulin;
_mout = _mout + tempMout;
_eout = _eout + tempEout;
__gasout = __gasout + tempGasout;
tempScrapin = 0;
tempOrganicin = 0;
tempUsefulin = 0;
tempMout = 0;
tempEout = 0;
tempGasout = 0;
}
function onBounceEnd() {
var _local2 = "";
switch (thingCount) {
case 0 :
_local2 = "metal";
var _local3 = (metalFrac * metalMult) * amtRecycled;
master.makeMetal(_local3, false, 1);
tempMout = tempMout + _local3;
tempScrapin = tempScrapin + amtRecycled;
master.logRecycle("metal", amtRecycled);
myLandfill.destroyByKind(0, amtRecycled, 0, 0);
break;
case 1 :
_local2 = "energy";
var _local5 = (reuseFrac * reuseMult) * amtRecycled;
master.makeEnergy(_local5);
tempEout = tempEout + _local5;
tempUsefulin = tempUsefulin + amtRecycled;
master.logRecycle("useful", amtRecycled);
myLandfill.destroyByKind(0, 0, amtRecycled, 0);
break;
case 2 :
_local2 = "gas";
var _local4 = (organicFrac * organicMult) * amtRecycled;
master.makeGas(_local4);
tempGasout = tempGasout + _local4;
tempOrganicin = tempOrganicin + amtRecycled;
master.logRecycle("organic", amtRecycled);
myLandfill.destroyByKind(amtRecycled, 0, 0, 0);
}
if (_local2 == "metal") {
makeResource(_local2, false, 1);
} else {
makeResource(_local2, false);
}
}
function getPercent() {
}
var myIndex = K.RECYCLINGCENTER;
var myMenu = "RecyclingCenter";
var smogTicks = 0;
var smogTime = 5;
var amSuper = false;
var eatsFood = false;
var foodIn = 0;
var doesSleep = false;
var garbageInThisCycle = 0;
var thingCount = 0;
var energyIn = K.E_IN_RECYCLINGCENTER;
var energyOut = 0;
var amtRecycled = 0;
var currLevel = 0;
var metalFrac = 0.9;
var reuseFrac = 0.5;
var organicFrac = 0.05;
var metalMult = 1;
var organicMult = 1;
var reuseMult = 1;
var metalQuota = 5;
var organicQuota = 100;
var reuseQuota = 10;
var metalIn = 0;
var organicIn = 0;
var reuseIn = 0;
var scrapToMetal = 0;
var organicToGas = 0;
var reuseToEnergy = 0;
var tempMout = 0;
var tempGasout = 0;
var tempEout = 0;
var tempScrapin = 0;
var tempOrganicin = 0;
var tempUsefulin = 0;
var scrapin = 0;
var usefulin = 0;
var organicin = 0;
var eout = 0;
var mout = 0;
var _gasout = 0;
var _scrapin = 0;
var _usefulin = 0;
var _organicin = 0;
var _eout = 0;
var _mout = 0;
var __gasout = 0;
}
Symbol 2910 MovieClip [__Packages.SolarPlant] Frame 0
class SolarPlant extends Building
{
var master, gotoAndPlay, icon, makeResource;
function SolarPlant () {
super();
}
function doTick() {
if (energyOut > 0) {
if (master.lessThanMaxEnergy()) {
gotoAndPlay("bounce");
}
}
}
function setMeUp() {
getWeatherUpdate();
}
function getWeatherUpdate() {
var _local2 = master.getSunLight();
updateForWeather(0, _local2);
}
function updateForWeather(windSpeed, sunLight) {
updateSun(sunLight);
}
function updateSun(sunLight) {
switch (sunLight) {
case K.SUN_NO :
energyOut = 0;
icon.gotoAndStop("no");
break;
case K.SUN_OVERCAST :
energyOut = realEnergy / 4;
icon.gotoAndStop("min");
break;
case K.SUN_LOW :
energyOut = realEnergy / 2;
icon.gotoAndStop("low");
break;
case K.SUN_MID :
energyOut = realEnergy;
icon.gotoAndStop("mid");
break;
case K.SUN_HIGH :
energyOut = realEnergy * 2;
icon.gotoAndStop("high");
}
}
function makeDrowsy() {
}
function unDrowsy() {
}
function onBounceEnd() {
makeResource("energy");
master.makeEnergy(energyOut);
}
var myIndex = K.SOLARPLANT;
var myMenu = "SolarPlant";
var smogAmount = 0;
var realEnergy = K.E_OUT_SOLARPLANT;
var energyOut = K.E_OUT_SOLARPLANT;
var eatsFood = false;
var garbageRate = 0;
var doesDrowsy = true;
}
Symbol 2911 MovieClip [__Packages.SuperFarm] Frame 0
class SuperFarm extends Farm
{
var smogPoint, _x, _y, makeSmog, smogAmount, makeResource, master;
function SuperFarm () {
super();
}
function onBounceEnd() {
var _local3 = _x + smogPoint._x;
var _local2 = _y + smogPoint._y;
makeSmog(_local3, _local2, smogAmount);
makeResource("food", true);
master.makeFood(foodOut);
}
var foodProduction = K.F_OUT_SUPERFARM;
var foodOut = K.F_OUT_SUPERFARM;
var foodIn = K.F_OUT_SUPERFARM;
var myMenu = "SuperFarm";
var amSuper = true;
}
Symbol 2912 MovieClip [__Packages.SuperGeoPlant] Frame 0
class SuperGeoPlant extends GeoPlant
{
function SuperGeoPlant () {
super();
}
function setMeUp() {
amSuper = true;
}
var energyOut = K.E_OUT_SUPERGEOPLANT;
var myMenu = "SuperGeoPlant";
var amSuper = true;
}
Symbol 2913 MovieClip [__Packages.WindPlant] Frame 0
class WindPlant extends Building
{
var master, gotoAndPlay, icon, makeResource;
function WindPlant () {
super();
}
function doTick() {
if (!hasTicked) {
getWeatherUpdate();
}
if (energyOut > 0) {
if (master.lessThanMaxEnergy()) {
gotoAndPlay("bounce");
}
}
hasTicked = true;
}
function setMeUp() {
getWeatherUpdate();
}
function getWeatherUpdate() {
var _local2 = master.getWindSpeed();
updateForWeather(_local2);
}
function updateForWeather(windSpeed, sunLight) {
updateWind(windSpeed);
}
function updateWind(windSpeed) {
switch (windSpeed) {
case K.WIND_NO :
energyOut = 0;
icon.gotoAndStop("no");
break;
case K.WIND_GENTLE :
energyOut = 0;
icon.gotoAndStop("no");
break;
case K.WIND_LOW :
energyOut = realEnergy / 2;
icon.gotoAndStop("slow");
break;
case K.WIND_MID :
energyOut = realEnergy;
icon.gotoAndStop("normal");
break;
case K.WIND_HIGH :
energyOut = realEnergy * 2;
icon.gotoAndStop("fast");
}
}
function makeDrowsy() {
}
function unDrowsy() {
}
function onBounceEnd() {
makeResource("energy");
master.makeEnergy(energyOut);
}
var myIndex = K.WINDPLANT;
var myMenu = "WindPlant";
var smogAmount = 0;
var realEnergy = K.E_OUT_WINDPLANT;
var energyOut = K.E_OUT_WINDPLANT;
var eatsFood = false;
var garbageRate = 0;
var doesSleep = false;
var doesDrowsy = true;
var hasTicked = false;
}
Symbol 2914 MovieClip [__Packages.SuperWindPlant] Frame 0
class SuperWindPlant extends WindPlant
{
var getWeatherUpdate, energyOut, icon, realEnergy;
function SuperWindPlant () {
super();
}
function setMeUp() {
amSuper = true;
getWeatherUpdate();
}
function updateForWeather(windSpeed) {
switch (windSpeed) {
case K.WIND_NO :
energyOut = 0;
icon.gotoAndStop("no");
break;
case K.WIND_GENTLE :
energyOut = realEnergy / 2;
icon.gotoAndStop("slow");
break;
case K.WIND_LOW :
energyOut = realEnergy;
icon.gotoAndStop("normal");
break;
case K.WIND_MID :
energyOut = realEnergy * 2;
icon.gotoAndStop("fast");
break;
case K.WIND_HIGH :
energyOut = realEnergy * 2;
icon.gotoAndStop("fast");
}
}
var myMenu = "SuperWindPlant";
var amSuper = true;
}
Symbol 2915 MovieClip [__Packages.TeslaCoil] Frame 0
class TeslaCoil extends Building
{
var radius, master, notEnoughEnergy, gotoAndPlay, useResource, showEnergyAlert, amSelected, outline, onSelected, disabled, _x, _y, gotoAndStop;
function TeslaCoil () {
super();
}
function setMeUp() {
radius = 4.5 * K.TILE_SIZE;
}
function fire() {
if (firing == false) {
if (master.hasEnergy(energyIn)) {
notEnoughEnergy = false;
gotoAndPlay("bounce");
master.drainEnergy(energyIn, true);
useResource("energy");
firing = true;
} else {
showEnergyAlert();
}
}
}
function playAttackSound() {
master.playSound(1, "teslacoil.wav", 1);
}
function selectMe() {
if (!amSelected) {
master.unClickEverything();
outline._visible = true;
master.playSound(0, "click4.wav", 1);
master.selectBuilding(myMenu, myDamage, this);
amSelected = true;
onSelected();
} else {
master.playSound(0, "click2.wav", 1);
master.unClickEverything();
}
}
function onCheckTick() {
if (!disabled) {
var _local2 = 0;
while (_local2 < master.eArray.length) {
if (master.eArray[_local2]._x != undefined) {
var _local4 = master.eArray[_local2]._x - _x;
var _local3 = master.eArray[_local2]._y - _y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= radius) {
fire();
break;
}
}
_local2++;
}
}
}
function onFire() {
var _local2 = 0;
while (_local2 < master.eArray.length) {
var _local4 = master.eArray[_local2]._x - _x;
var _local3 = master.eArray[_local2]._y - _y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= radius) {
master.eArray[_local2].takeDamage(myDamage, K.TESLACOIL);
}
_local2++;
}
}
function onBounceEnd() {
firing = false;
gotoAndStop("default");
}
var myIndex = K.TESLACOIL;
var myMenu = "TeslaCoil";
var myDamage = K.DMG_TESLACOIL;
var myRange = 3;
var isWeapon = true;
var firing = false;
var eatsFood = false;
var energyIn = K.E_IN_TESLACOIL;
var doesSleep = false;
}
Symbol 2916 MovieClip [__Packages.FFResource] Frame 0
class FFResource extends ResourceToken
{
var atMax, myBuilding, master, gotoAndStop;
function FFResource () {
super();
}
function setAmount(amt) {
var _local3;
var _local4 = false;
var _local5 = "ff";
if (amt == 1) {
_local3 = "little";
atMax = false;
} else if (amt == 2) {
_local3 = "some";
atMax = false;
} else if (amt == 3) {
_local3 = "lots";
atMax = false;
} else if (amt > 3) {
_local3 = "max";
atMax = true;
} else if (amt <= 0) {
_local4 = true;
atMax = false;
}
amount = amt;
if (myBuilding != undefined) {
myBuilding.setResource(amt, myIndex);
}
if (_local4) {
master.deleteResourceToken(this);
}
gotoAndStop(_local3);
if (amSelected) {
master.selectBuilding(_local5, amount, this);
}
if (atMax) {
master.doMessageAlert("ffPickupAlert", this);
}
}
var amSelected = false;
var myMenu = "ff";
var myType = "ff";
var myIndex = K.FF;
var amount = 0;
var amTargetted = false;
}
Symbol 2917 MovieClip [__Packages.Fly] Frame 0
class Fly extends MovieClip
{
var startX, _x, startY, _y;
function Fly () {
super();
}
function onLoad() {
startX = _x;
startY = _y;
}
function onEnterFrame() {
_x = _x + xSpeed;
_y = _y + ySpeed;
xSpeed = xSpeed + (-0.1 + (Math.random() * 0.2));
ySpeed = ySpeed + (-0.1 + (Math.random() * 0.2));
if (((_x - startX) > 6) || ((_x - startX) < -6)) {
xSpeed = xSpeed * -1;
}
if (((_y - startY) > 6) || ((_y - startY) < -6)) {
ySpeed = ySpeed * -1;
}
if (xSpeed < -1.5) {
xSpeed = -1.5;
} else if (xSpeed > 1.5) {
xSpeed = 1.5;
}
if (ySpeed < -1.5) {
ySpeed = -1.5;
} else if (ySpeed > 1.5) {
ySpeed = 1.5;
}
}
var xSpeed = 0.5;
var ySpeed = 0.5;
}
Symbol 2918 MovieClip [__Packages.GasResource] Frame 0
class GasResource extends ResourceToken
{
var atMax, myBuilding, master, gotoAndStop;
function GasResource () {
super();
}
function setAmount(amt) {
var _local3;
var _local4 = false;
var _local5 = "gas";
if (amt == 1) {
_local3 = "little";
atMax = false;
} else if (amt == 2) {
_local3 = "some";
atMax = false;
} else if (amt == 3) {
_local3 = "lots";
atMax = false;
} else if (amt > 3) {
_local3 = "max";
atMax = true;
} else if (amt <= 0) {
_local4 = true;
atMax = false;
}
amount = amt;
if (myBuilding != undefined) {
myBuilding.setResource(amt, myIndex);
}
if (_local4) {
master.deleteResourceToken(this);
}
gotoAndStop(_local3);
if (amSelected) {
master.selectBuilding(_local5, amount, this);
}
if (atMax) {
master.doMessageAlert("gasPickupAlert", this);
}
}
var amSelected = false;
var myMenu = "gas";
var myType = "gas";
var myIndex = K.GAS;
var amount = 0;
var amTargetted = false;
}
Symbol 2919 MovieClip [__Packages.MetalResource] Frame 0
class MetalResource extends ResourceToken
{
var atMax, myBuilding, master, gotoAndStop;
function MetalResource () {
super();
}
function setAmount(amt) {
var _local3;
var _local4 = false;
myMenu = "metal";
if ((amt > 0) && (amt < 15)) {
_local3 = "little";
atMax = false;
} else if ((amt >= 15) && (amt < 35)) {
_local3 = "some";
atMax = false;
} else if ((amt >= 35) && (amt < 50)) {
_local3 = "lots";
atMax = false;
} else if (amt >= 50) {
_local3 = "max";
atMax = true;
} else if (amt <= 0) {
_local4 = true;
atMax = false;
}
amount = amt;
if (myBuilding != undefined) {
myBuilding.setResource(amt);
}
if (_local4) {
master.deleteResourceToken(this);
}
gotoAndStop(_local3);
if (amSelected) {
master.selectBuilding(myMenu, amount, this);
}
if (atMax) {
master.doMessageAlert("mPickupAlert", this);
}
}
var amSelected = false;
var myMenu = "metal";
var myType = "metal";
var myIndex = K.METAL;
var amount = 0;
var amTargetted = false;
}
Symbol 2920 MovieClip [__Packages.Objective] Frame 0
class Objective extends MovieClip
{
var theText;
function Objective () {
super();
}
function onLoad() {
}
function setText(s) {
theText = s;
}
}
Symbol 2921 MovieClip [__Packages.LightBox] Frame 0
class LightBox extends MovieClip
{
var lightsArray, lightMask, createEmptyMovieClip, getNextHighestDepth, theLight, attachMovie;
function LightBox () {
super();
}
function onLoad() {
lightsArray = new Array();
}
function makeLightMask() {
lightMask = createEmptyMovieClip("lightMask", getNextHighestDepth());
}
function setUpMask() {
theLight.setMask(lightMask);
}
function makeLight(xx, yy) {
var _local2 = attachMovie("mc_floodcircle", "circle_" + lightCount, getNextHighestDepth());
_local2._x = xx + 16;
_local2._y = yy;
_local2.blendMode = "overlay";
lightCount++;
lightsArray.push(_local2);
}
function clearLights() {
var _local2 = 0;
while (_local2 < lightsArray.length) {
lightsArray[_local2].removeMovieClip();
lightsArray[_local2] = undefined;
_local2++;
}
lightsArray = new Array();
}
var lightCount = 0;
}
Symbol 2922 MovieClip [__Packages.Edderkopp] Frame 0
class Edderkopp extends Enemy
{
var findSomeGarbage, findSomeNWaste, findClosestBuilding, maxLevel, myLevel, gotoGarbage, gotoWaste, gotoBuilding, clearDistances, myTargetGarbage, setToIdle, myTargetWaste, myTargetBldg, findAndEatGarbage, master, giveHp, singe, takeDamage, singeOn, tryToAttackBuilding, eatGarbage, eatWaste, attackBuilding, fireCounter, extinguishFire;
function Edderkopp () {
super();
}
function setMeUp() {
fearsDay = true;
}
function onSelected() {
}
function onRelease() {
}
function decideWhatToDo() {
var _local3 = findSomeGarbage();
var _local4 = findSomeNWaste();
var _local2 = findClosestBuilding();
if (myLevel < maxLevel) {
if ((_local3[1] <= _local4[1]) && (_local3[1] <= _local2[1])) {
gotoGarbage(_local3[0]);
} else if ((_local4[1] <= _local3[1]) && (_local4[1] <= _local2[1])) {
gotoWaste(_local4[0]);
} else if ((_local2[1] <= _local3[1]) && (_local2[1] <= _local4[1])) {
gotoBuilding(_local2[0]);
}
} else {
gotoBuilding(_local2[0]);
}
}
function tick() {
switch (myTask) {
case K.IDLE :
clearDistances();
decideWhatToDo();
break;
case K.GETGARBAGE :
if ((myTargetGarbage == undefined) || (myTargetGarbage.amount <= 0)) {
setToIdle();
}
break;
case K.GETWASTE :
if ((myTargetWaste == undefined) || (myTargetWaste.amount <= 0)) {
setToIdle();
}
break;
case K.ATTACKTASK :
if ((myTargetBldg.hp <= 0) || (myTargetBldg == undefined)) {
if (hp <= maxHp) {
if (K.randRange(0, 1) > 0.5) {
findAndEatGarbage();
} else {
setToIdle();
}
} else {
setToIdle();
}
}
break;
case K.DYING :
setToIdle();
}
regenerate();
}
function regenerate() {
var _local2 = 5 * master.smogLevelUps;
giveHp(_local2);
}
function singeLight(i, whatType, whom) {
singe.gotoAndPlay("singe");
if (master.smogLevelUps > 0) {
i = i - (0.125 * master.smogLevelUps);
}
takeDamage(i);
singeOn = true;
}
function onMoveFinish() {
if (onTask) {
if (myTask == K.GOTOBUILDING) {
if (myTargetBldg != undefined) {
tryToAttackBuilding();
} else {
setToIdle();
}
} else if (myTask == K.GETGARBAGE) {
if ((myTargetGarbage != undefined) && (myTargetGarbage.amount > 0)) {
eatGarbage(myTargetGarbage);
} else {
setToIdle();
}
} else if (myTask == K.GETWASTE) {
if ((myTargetWaste != undefined) && (myTargetWaste.amount > 0)) {
eatWaste(myTargetWaste);
} else {
setToIdle();
}
} else if (myTask == K.ATTACKPOSITION) {
if (myTargetBldg != undefined) {
attackBuilding(myTargetBldg);
} else {
setToIdle();
}
}
}
}
function burnMe() {
singe.gotoAndPlay("burn");
fireCounter--;
if (fireCounter <= 0) {
if (fireCounter > (-K.BURN_TIME)) {
var _local2 = K.BURN_TIME + fireCounter;
if (randRange(0, _local2) == 0) {
extinguishFire();
}
} else {
extinguishFire();
}
}
takeDamage(2);
}
function singeMe() {
singe.gotoAndPlay("singe");
var _local2 = 50;
if ((master.smogLevelUps > 0) && (master.smogLevelUps != undefined)) {
_local2 = _local2 - (2 * master.smogLevelUps);
}
takeDamage(_local2);
}
var myIndex = K.EDDERKOP;
var myMenu = "Edderkop";
var speed = 1;
var selectSound = "edderkop_click1.wav";
var myDamage = K.DMG_EDDERKOP;
var fearsDay = true;
var hp = 25;
var maxHp = 25;
var onTask = false;
var myTask = K.IDLE;
}
Symbol 2923 MovieClip [__Packages.Raider] Frame 0
class Raider extends Enemy
{
var rinx, resourceIn, riny, findTastiestBuilding, gotoBuilding, moveToLoc, startX, startY, clearDistances, myTargetBldg, xTile, yTile, setToIdle, master, giveHp, singe, takeDamage, tryToAttackBuilding, removeMe, attackFacing, gotoAndStop, _icon, makeEnemyGarbageUnit2, bulletMetal, fireCounter, extinguishFire;
function Raider () {
super();
}
function setMeUp() {
fearsDay = true;
hideResourceIn();
rinx = resourceIn._x;
riny = resourceIn._y;
}
function onSelected() {
}
function onRelease() {
}
function decideWhatToDo() {
var _local2 = findTastiestBuilding();
gotoBuilding(_local2[0]);
}
function leaveForever() {
myTask = K.LEAVE;
moveToLoc(startX, startY);
}
function tick() {
switch (myTask) {
case K.IDLE :
clearDistances();
decideWhatToDo();
break;
case K.ATTACKTASK :
if ((myTargetBldg.hp <= 0) || (myTargetBldg == undefined)) {
runAway();
}
break;
case K.STARTRUN :
var _local3 = -4;
var _local2 = -4;
if ((xTile * 2) > (K.MAX_X_TILE / 2)) {
_local3 = (K.MAX_X_TILE * 2) + 4;
}
if ((yTile * 2) > (K.MAX_Y_TILE / 2)) {
_local2 = (K.MAX_Y_TILE * 2) + 4;
}
moveToLoc(_local3, _local2);
break;
case K.DYING :
setToIdle();
}
regenerate();
}
function regenerate() {
var _local2 = 5 * master.smogLevelUps;
giveHp(_local2);
}
function singeLight(i) {
singe.gotoAndPlay("singe");
if (master.smogLevelUps > 0) {
i = i - (0.125 * master.smogLevelUps);
}
takeDamage(i) / 2;
}
function onMoveFinish() {
if (onTask) {
if (myTask == K.GOTOBUILDING) {
if (myTargetBldg != undefined) {
tryToAttackBuilding();
} else {
setToIdle();
}
} else if (myTask == K.ATTACKPOSITION) {
if (myTargetBldg != undefined) {
raidBuilding(myTargetBldg);
} else {
setToIdle();
}
} else if ((myTask == K.STARTRUN) || (myTask == K.RUNAWAY)) {
healMe();
decideWhatToDo();
} else if (myTask == K.LEAVE) {
removeMe();
}
}
}
function healMe() {
giveHp(maxHp / 2);
}
function raidBuilding(bldg) {
myTask = K.ATTACKTASK;
if (attackFacing != undefined) {
gotoAndStop(attackFacing);
} else {
gotoAndStop("right");
}
_icon.gotoAndStop("attack");
takeResource(bldg);
}
function onAttackHit() {
myTargetBldg.takeDamage(myDamage);
takeResource(myTargetBldg);
runAway();
}
function takeResource(b) {
a = getBldgResource(b);
master.drainSomething(a[0], a[1]);
useResource(a[1]);
}
function trySpawnNuclearZombie() {
}
function getBldgResource(b) {
switch (b.myIndex) {
case K.FARM :
return([10, "food"]);
case K.MINE :
return([10, "metal"]);
case K.COALMINE :
return([10, "coal"]);
case K.OILGASWELL :
if (master.getFF() > master.getGas()) {
return([10, "FF"]);
}
return([10, "gas"]);
case K.LAB :
return([10, "research"]);
case K.SUPERFARM :
return([20, "food"]);
case K.COALPLANT :
return([10, "coal"]);
case K.GASPLANT :
return([10, "gas"]);
case K.NUCLEARPLANT :
return([10, "energy"]);
case K.NUCLEARDUMP :
trySpawnNuclearZombie();
break;
case K.GEOPLANT :
return([10, "energy"]);
case K.WINDPLANT :
return([10, "energy"]);
case K.SOLARPLANT :
return([10, "energy"]);
default :
return([5, "energy"]);
}
}
function runAway() {
myTask = K.STARTRUN;
_icon.gotoAndStop("default");
}
function useResource(str) {
showResourceIn(str);
resourceIn._icon.gotoAndStop("bounce");
resourceIn._x = rinx;
resourceIn._y = riny;
var back = this;
var i = setInterval(function () {
back.resourceIn._y = back.resourceIn._y + 2;
if (back.resourceIn._y >= (back.riny + 20)) {
back.hideResourceIn();
clearInterval(i);
}
}, 50);
}
function hideResourceIn() {
resourceIn.gotoAndStop("nothing");
}
function showResourceIn(str) {
resourceIn.gotoAndStop(str);
}
function makeMyGarbage() {
makeEnemyGarbageUnit2(Math.floor(xTile / 2) * 2, (Math.floor(yTile / 2) * 2) + 1, amountOrganic, amountMetal + bulletMetal, amountReuse, amountJunk / 2, true);
makeEnemyGarbageUnit2(Math.floor(xTile / 2) * 2, (Math.floor(yTile / 2) * 2) + 1, amountOrganic, 0, 0, 0, false);
}
function burnMe() {
singe.gotoAndPlay("burn");
fireCounter--;
if (fireCounter <= 0) {
if (fireCounter > (-K.BURN_TIME)) {
var _local2 = K.BURN_TIME + fireCounter;
if (randRange(0, _local2) == 0) {
extinguishFire();
}
} else {
extinguishFire();
}
}
takeDamage(2);
}
function singeMe() {
singe.gotoAndPlay("singe");
var _local2 = 50;
if ((master.smogLevelUps > 0) && (master.smogLevelUps != undefined)) {
_local2 = _local2 - (2 * master.smogLevelUps);
}
takeDamage(_local2);
}
var myIndex = K.RAIDER;
var myMenu = "Raider";
var speed = 3;
var selectSound = "";
var myDamage = K.DMG_RAIDER;
var fearsDay = true;
var hp = 200;
var maxHp = 200;
var onTask = false;
var myTask = K.IDLE;
var amountMetal = 2.5;
var amountReuse = 5;
var amountOrganic = 5;
var amountJunk = 5;
}
Symbol 2924 MovieClip [__Packages.Engineer] Frame 0
class Engineer extends Unit
{
var startUpSound, master, odometer, setFuelEconomy, refueling, myTarget, myTargetBldg, useResource, refuel, moveToLoc, myResourceType, haul;
function Engineer () {
super();
}
function setMeUp() {
if (startUpSound) {
master.playSound(1, "engineer_click1.wav", 1);
}
odometer = 0;
setFuelEconomy(K.GASOLINE, 1);
}
function onSelected() {
}
function tick() {
if (refueling == 0) {
switch (myTask) {
case K.IDLE :
var _local4 = findASpill();
if (_local4 != undefined) {
goCleanUpSpill(_local4);
} else if (master.rArray.length >= 1) {
var _local5 = findAResource();
goGetResource(_local5);
}
break;
case K.IDLE_RESOURCE :
var _local3 = findADepot(ResourceToken(myTarget));
myTargetBldg = _local3;
if (_local3 != undefined) {
deliverToDepot();
} else {
master.doMessageAlert("noWasteDump", this);
}
break;
case K.CLEANUPSPILL :
if (!master.hasEnergy(1)) {
break;
}
useResource("energy");
master.energyDrain(2);
var _local2 = TerrainSquare(myTarget).cleanUp(10);
if (!((_local2 <= 0) || (_local2 == undefined))) {
break;
}
setToIdle();
}
} else {
refuel();
}
}
function findASpill() {
var _local3 = master.lArray;
var _local8;
var _local7 = 100000000 /* 0x5F5E100 */;
var _local6 = 0;
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].amSpill == true) {
if (_local3[_local2].amTargetted == false) {
var _local5 = K.getDist(this, _local3[_local2]);
var _local4 = 0;
if (_local5 < _local7) {
_local7 = _local5;
_local4 = _local4 + 25;
_local4 = _local4 + _local3[_local2].hp;
}
if (_local4 > _local6) {
_local6 = _local4;
_local8 = _local3[_local2];
}
}
}
_local2++;
}
if (_local8 != undefined) {
_local8.targetForPickup();
}
return(_local8);
}
function findAResource() {
var _local4 = master.rArray;
var _local8;
var _local7 = 100000000 /* 0x5F5E100 */;
var _local6 = 0;
var _local2 = 0;
while (_local2 < _local4.length) {
if (_local4[_local2].amTargetted == false) {
var _local5 = K.getDist(this, _local4[_local2]);
var _local3 = 0;
if (_local5 < _local7) {
_local7 = _local5;
_local3 = _local3 + 25;
_local3 = _local3 + _local4[_local2].amount;
}
if (_local4[_local2].atMax == true) {
_local3 = _local3 + 100;
}
if (_local3 > _local6) {
_local6 = _local3;
_local8 = _local4[_local2];
}
}
_local2++;
}
_local8.targetForPickup();
return(_local8);
}
function findADepot(r, d) {
var _local3 = master.bldgArray;
var _local6;
var _local5 = 100000000 /* 0x5F5E100 */;
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].myIndex == K.NUCLEARDUMP) {
if (_local3[_local2] != d) {
var _local4;
_local4 = K.getDist(this, _local3[_local2]);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local3[_local2];
}
}
}
_local2++;
}
return(_local6);
}
function goCleanUpSpill(s) {
if ((s != undefined) && (onTask == false)) {
onTask = true;
moveToLoc(s.xUnitLoc, s.yUnitLoc + 3);
myTask = K.GOTOSPILL;
myTarget = s;
}
}
function goGetResource(r) {
if ((r != undefined) && (onTask == false)) {
onTask = true;
moveToLoc(r.xTile, r.yTile - 1);
myTask = K.GETRESOURCE;
myTarget = r;
if (r.myIndex == K.NWASTE) {
isNukeWaste == true;
}
}
}
function takeResourceToDepot(r, b) {
if ((r != undefined) && (onTask == false)) {
onTask = true;
moveToLoc(r.xTile, r.yTile - 1);
myTask = K.GETRESOURCE;
myTarget = r;
if (r.myIndex == K.NWASTE) {
isNukeWaste == true;
}
myTargetBldg = b;
}
}
function getResource(r) {
myResourceType = r.myIndex;
var _local4 = r.myType.toLowerCase();
haul.gotoAndStop(_local4);
var _local3 = r.removeAmount(resourceHaul);
r.unTarget();
myResourceAmt = _local3;
}
function deliverResource(d) {
var _local2 = d.addResource(myResourceAmt, myResourceType);
if (_local2) {
haul.gotoAndStop("nothing");
myResourceAmt = 0;
setToIdle();
} else {
myTargetBldg = findADepot(ResourceToken(myTarget), Depot(myTargetBldg));
deliverToDepot();
}
}
function setToIdle() {
onTask = false;
myTask = K.IDLE;
myTarget = undefined;
myTargetBldg = undefined;
isNukeWaste = false;
}
function deliverToDepot() {
onTask = true;
myTask = K.DELIVERRESOURCE;
moveToLoc(myTargetBldg.xTileUnit, myTargetBldg.yTileUnit);
}
function onMoveFinish() {
if (onTask) {
if (myTask == K.GETRESOURCE) {
getResource(ResourceToken(myTarget));
if (myTargetBldg != undefined) {
deliverToDepot();
} else {
onTask = false;
myTask = K.IDLE_RESOURCE;
myTarget = undefined;
myTargetBldg = undefined;
}
} else if (myTask == K.DELIVERRESOURCE) {
deliverResource(Depot(myTargetBldg));
} else if (myTask == K.GOTOSPILL) {
myTask = K.CLEANUPSPILL;
}
}
}
var myIndex = K.ENGINEER;
var myMenu = "Engineer";
var clicks = 0;
var onTask = false;
var myTask = K.IDLE;
var myResourceAmt = 0;
var resourceHaul = 2;
var fuelEfficiency = 1;
var gasolineGramsPerMile = 6.47733333333333;
var natGasGramsPerMile = 0.424;
var ethanolGramsPerMile = 4;
var ngSmog = 0.00105105066666667;
var tankSize = 25;
var speed = 1.5;
var selectSound = "engineer_click1.wav";
var affirmSound = "engineer_move1.wav";
var buildSound = "engineer_click1.wav";
var isNukeWaste = false;
var alertTime = 0;
}
Symbol 2925 MovieClip [__Packages.KonamiCode] Frame 0
class KonamiCode extends MovieClip
{
var theCode, theSound, listener, _parent;
function KonamiCode () {
super();
theCode = new Array(38, 38, 40, 40, 37, 39, 37, 39, 66, 65);
setUpListener();
theSound = new Sound();
theSound.attachSound("pop.wav");
}
function setUpListener() {
var classObj = this;
listener = new Object();
listener.onKeyDown = function () {
classObj.readKey(Key.getCode(), true);
};
Key.addListener(listener);
}
function readKey(code, isDown) {
if (isDown) {
if (theCode[tempPos] == code) {
tempPos++;
if (tempPos >= theCode.length) {
_parent.konamiCode();
}
theSound.start();
} else {
tempPos = 0;
}
}
}
var tempPos = 0;
}
Symbol 2926 MovieClip [__Packages.MonsterTruck] Frame 0
class MonsterTruck extends Enemy
{
var rinx, resourceIn, riny, findSomeNWaste, findNuclearBuilding, gotoBuilding, gotoWaste, moveToLoc, startX, startY, clearDistances, myTargetBldg, xTile, yTile, setToIdle, master, giveHp, singe, takeDamage, tryToAttackBuilding, removeMe, myTargetWaste, destroying, movingX, movingY, speedX, speedY, onRemove, gotoAndStop, myLevel, attachMovie, getNextHighestDepth, onFire, _x, _y, makeSmog, attackFacing, _icon, makeEnemyGarbageUnit2, bulletMetal, fireCounter, extinguishFire;
function MonsterTruck () {
super();
}
function setMeUp() {
fearsDay = true;
hideResourceIn();
rinx = resourceIn._x;
riny = resourceIn._y;
}
function onSelected() {
}
function onRelease() {
}
function decideWhatToDo() {
var _local2 = findSomeNWaste();
if (_local2[0] == undefined) {
var _local3 = findNuclearBuilding();
gotoBuilding(_local3[0]);
} else {
gotoWaste(_local2[0]);
}
}
function leaveForever() {
myTask = K.LEAVE;
moveToLoc(startX, startY);
}
function tick() {
switch (myTask) {
case K.IDLE :
clearDistances();
decideWhatToDo();
break;
case K.ATTACKTASK :
if ((myTargetBldg.hp <= 0) || (myTargetBldg == undefined)) {
runAway();
}
break;
case K.STARTRUN :
var _local3 = -4;
var _local2 = -4;
if ((xTile * 2) > (K.MAX_X_TILE / 2)) {
_local3 = (K.MAX_X_TILE * 2) + 4;
}
if ((yTile * 2) > (K.MAX_Y_TILE / 2)) {
_local2 = (K.MAX_Y_TILE * 2) + 4;
}
moveToLoc(_local3, _local2);
break;
case K.DYING :
setToIdle();
}
regenerate();
}
function regenerate() {
var _local2 = 5 * master.smogLevelUps;
giveHp(_local2);
}
function singeLight(i) {
singe.gotoAndPlay("singe");
if (master.smogLevelUps > 0) {
i = i - (0.125 * master.smogLevelUps);
}
takeDamage(i) / 2;
}
function onMoveFinish() {
if (onTask) {
if (myTask == K.GOTOBUILDING) {
if (myTargetBldg != undefined) {
tryToAttackBuilding();
} else {
setToIdle();
}
} else if (myTask == K.ATTACKPOSITION) {
if (myTargetBldg != undefined) {
raidBuilding(myTargetBldg);
} else {
setToIdle();
}
} else if ((myTask == K.STARTRUN) || (myTask == K.RUNAWAY)) {
healMe();
decideWhatToDo();
} else if (myTask == K.LEAVE) {
removeMe();
} else if (myTask == K.GETWASTE) {
if ((myTargetWaste != undefined) && (myTargetWaste.amount > 0)) {
eatWaste(myTargetWaste);
} else {
setToIdle();
}
}
}
}
function eatWaste(w) {
master.onNWasteEat(1);
master.spawnNuclearZombies(xTile, yTile, 1);
w.removeAmount(w.amount);
killMe();
}
function killMe() {
if (!destroying) {
movingX = false;
movingY = false;
speedX = 0;
speedY = 0;
myTask == K.DYING;
onRemove();
gotoAndStop("dead");
var _local2 = 2.5 * (myLevel + 1);
if (_local2 < 0) {
_local2 = 1;
}
if (_local2 > 25) {
_local2 = 25;
}
var _local3 = attachMovie("mc_goop", "theGoop", getNextHighestDepth());
if (onFire) {
var _local5 = _x;
var _local4 = _y;
makeSmog(_local5, _local4, _local2);
_local3.gotoAndPlay("smoke");
} else {
amountOrganic = amountOrganic + _local2;
makeMyGarbage();
_local3.gotoAndPlay("goop");
}
dropWaste();
destroying = true;
}
}
function dropWaste() {
if (hasNWaste) {
master.makeResourceUnit(xTile, yTile, nWasteAmount, "nwaste");
}
}
function healMe() {
giveHp(maxHp / 2);
if (hasNWaste) {
hasNWaste = false;
master.onNWasteEat(nWasteAmount);
master.spawnNuclearZombies(xTile, yTile, nWasteAmount);
nWasteAmount = 0;
}
}
function raidBuilding(bldg) {
myTask = K.ATTACKTASK;
if (attackFacing != undefined) {
gotoAndStop(attackFacing);
} else {
gotoAndStop("right");
}
_icon.gotoAndStop("attack");
takeResource(bldg);
}
function onAttackHit() {
myTargetBldg.takeDamage(myDamage);
takeResource(myTargetBldg);
runAway();
}
function takeResource(b) {
a = getBldgResource(b);
if (a[1] == "nWaste") {
hasNWaste = true;
nWasteAmount = a[0];
}
}
function getBldgResource(b) {
switch (b.myIndex) {
case K.NUCLEARPLANT :
return(new Array(10, "energy"));
case K.NUCLEARDUMP :
return(new Array(3, "nWaste"));
}
return([5, "energy"]);
}
function runAway() {
myTask = K.STARTRUN;
_icon.gotoAndStop("default");
}
function useResource(str) {
showResourceIn(str);
resourceIn._icon.gotoAndStop("bounce");
resourceIn._x = rinx;
resourceIn._y = riny;
var back = this;
var i = setInterval(function () {
back.resourceIn._y = back.resourceIn._y + 2;
if (back.resourceIn._y >= (back.riny + 20)) {
back.hideResourceIn();
clearInterval(i);
}
}, 50);
}
function hideResourceIn() {
resourceIn.gotoAndStop("nothing");
}
function showResourceIn(str) {
resourceIn.gotoAndStop(str);
}
function makeMyGarbage() {
makeEnemyGarbageUnit2(Math.floor(xTile / 2) * 2, (Math.floor(yTile / 2) * 2) + 1, amountOrganic, amountMetal + bulletMetal, amountReuse, amountJunk / 2, true);
makeEnemyGarbageUnit2(Math.floor(xTile / 2) * 2, (Math.floor(yTile / 2) * 2) + 1, amountOrganic, 0, 0, 0, false);
}
function burnMe() {
singe.gotoAndPlay("burn");
fireCounter--;
if (fireCounter <= 0) {
if (fireCounter > (-K.BURN_TIME)) {
var _local2 = K.BURN_TIME + fireCounter;
if (randRange(0, _local2) == 0) {
extinguishFire();
}
} else {
extinguishFire();
}
}
takeDamage(2);
}
function singeMe() {
singe.gotoAndPlay("singe");
var _local2 = 50;
if ((master.smogLevelUps > 0) && (master.smogLevelUps != undefined)) {
_local2 = _local2 - (2 * master.smogLevelUps);
}
takeDamage(_local2);
}
var myIndex = K.MONSTER_TRUCK;
var myMenu = "MonsterTruck";
var hasNWaste = false;
var nWasteAmount = 0;
var speed = 2;
var selectSound = "";
var myDamage = K.DMG_MONSTER_TRUCK;
var fearsDay = true;
var hp = 150;
var maxHp = 150;
var onTask = false;
var myTask = K.IDLE;
var amountMetal = 2.5;
var amountReuse = 5;
var amountOrganic = 5;
var amountJunk = 5;
}
Symbol 2927 MovieClip [__Packages.RadioHolder] Frame 0
class RadioHolder extends MovieClip
{
var radChallenge0, challengeGroup, locker, _parent;
function RadioHolder () {
super();
}
function onLoad() {
var _local3 = new Object();
setChallenge(0);
radChallenge0.selected = true;
var _local2 = new Object();
var back = this;
_local2.click = function (evt) {
back.theValue = evt.target.selection.data;
back.selectValue(evt.target.selection.data);
};
challengeGroup.addEventListener("click", _local2);
}
function selectValue(num) {
theValue = num;
if (num == 0) {
locker.gotoAndStop("unlock");
setChallenge(num);
} else {
locker.gotoAndStop("lock");
setChallenge(num);
}
}
function setChallenge(num) {
challengeIndex = num;
switch (num) {
case 0 :
wasteWest = undefined;
wasteEast = undefined;
wasteSouth = undefined;
wasteNorth = undefined;
challengeString = "Just play around, have fun, and try to survive!";
challengeName = "Free Play Mode";
zombies = true;
break;
case 1 :
map = 5;
wasteWest = true;
wasteEast = true;
wasteNorth = true;
wasteSouth = true;
energy = 500;
food = 10;
smog = 200;
research = 0;
metal = 200;
gas = 10;
oil = 10;
coal = 10;
dayTime = 100;
nightTime = 50;
zombies = true;
spawnTime = 2;
spawnRate = 1;
increaseTime = 5;
increaseRate = 3;
surviveDays = 3;
challengeString = "You're low on food, and low on fossil fuels... the zombies are hungry!";
challengeName = "Challenge #1";
break;
case 2 :
map = 7;
wasteWest = false;
wasteEast = false;
wasteNorth = true;
wasteSouth = true;
energy = 500;
food = 30;
smog = 500;
research = 0;
metal = 200;
gas = 0;
oil = 0;
coal = 0;
dayTime = 100;
nightTime = 50;
zombies = true;
spawnTime = 4;
spawnRate = 2;
increaseTime = 5;
increaseRate = 3;
surviveDays = 4;
challengeString = "You've got a little bit of everything, but you'd better watch that smog!";
challengeName = "Challenge #2";
break;
case 3 :
map = 8;
wasteWest = true;
wasteEast = true;
wasteNorth = true;
wasteSouth = true;
energy = 500;
food = 30;
smog = 999;
research = 100;
metal = 200;
gas = 10;
oil = 10;
coal = 10;
dayTime = 150;
nightTime = 50;
zombies = true;
spawnTime = 10;
spawnRate = 1;
increaseTime = 7;
increaseRate = 5;
surviveDays = 3;
challengeString = "This wasteland is thick with deadly smog, but few zombies. Clean this place up before night or face Godzilla-zombies!";
challengeName = "Challenge #3";
break;
case 4 :
map = 1;
wasteWest = true;
wasteEast = true;
wasteNorth = false;
wasteSouth = true;
energy = 500;
food = 30;
smog = 400;
research = 0;
metal = 200;
gas = 0;
oil = 20;
coal = 2;
dayTime = 90;
nightTime = 50;
zombies = true;
spawnTime = 1;
spawnRate = 2;
increaseTime = 3;
increaseRate = 1;
surviveDays = 3;
challengeString = "Plenty of resources, but no Natural Gas! Be sure to use what you've got wisely!";
challengeName = "Challenge #4";
break;
case 5 :
map = 3;
wasteWest = true;
wasteEast = true;
wasteNorth = true;
wasteSouth = true;
energy = 500;
food = 30;
smog = 750;
research = 50;
metal = 200;
gas = 0;
oil = 0;
coal = 2;
dayTime = 120;
nightTime = 70;
zombies = true;
spawnTime = 5;
spawnRate = 5;
increaseTime = 5;
increaseRate = 5;
surviveDays = 3;
challengeString = "You've got to clean this place up, but you've got only low altitudes and no geothermal. See what you can do!";
challengeName = "Challenge #5";
break;
}
updateValues();
}
function updateValues() {
if (wasteWest == true) {
_parent.wasteland_w.setToUp();
} else if (wasteWest == false) {
_parent.wasteland_w.setToDown();
}
if (wasteEast == true) {
_parent.wasteland_e.setToUp();
} else if (wasteEast == false) {
_parent.wasteland_e.setToDown();
}
if (wasteNorth == true) {
_parent.wasteland_n.setToUp();
} else if (wasteNorth == false) {
_parent.wasteland_n.setToDown();
}
if (wasteSouth == true) {
_parent.wasteland_s.setToUp();
} else if (wasteSouth == false) {
_parent.wasteland_s.setToDown();
}
_parent.levels.gotoAndStop(map);
_parent.currentLevel = -_parent.levels._currentframe;
_parent.displayLevel = Math.abs(_parent.currentLevel);
_parent.r_e.value = energy;
_parent.r_f.value = food;
_parent.r_s.value = smog;
_parent.r_r.value = research;
_parent.r_m.value = metal;
_parent.r_g.value = gas;
_parent.r_ff.value = oil;
_parent.r_c.value = coal;
_parent.time_day.value = dayTime;
_parent.time_night.value = nightTime;
if (zombies == true) {
_parent.zombiesOn.selectedIndex = 0;
} else {
_parent.zombiesOn.selectedIndex = 1;
}
_parent.spawn_time.value = spawnTime;
_parent.spawn_rate.value = spawnRate;
_parent.increase_time.value = increaseTime;
_parent.increase_rate.value = increaseRate;
_parent.surviveDays.value = surviveDays;
_parent.challengeString = challengeString;
_parent.challengeName = challengeName;
_parent.sweep.play();
}
var theValue = 0;
var map = 0;
var wasteWest = true;
var wasteEast = true;
var wasteSouth = false;
var wasteNorth = false;
var energy = 999;
var food = 0;
var smog = 0;
var research = 0;
var metal = 0;
var gas = 0;
var oil = 0;
var coal = 0;
var dayTime = 100;
var nightTime = 100;
var zombies = false;
var spawnTime = 1;
var spawnRate = 1;
var increaseTime = 1;
var increaseRate = 1;
var surviveDays = 1;
var challengeString = "Can you handle it?";
var challengeName = "Free Play Mode";
var challengeIndex = 0;
}
Symbol 58 MovieClip [__Packages.mx.skins.ColoredSkinElement] Frame 0
class mx.skins.ColoredSkinElement
{
var getStyle, _color, onEnterFrame;
function ColoredSkinElement () {
}
function setColor(c) {
if (c != undefined) {
var _local2 = new Color(this);
_local2.setRGB(c);
}
}
function draw(Void) {
setColor(getStyle(_color));
onEnterFrame = undefined;
}
function invalidateStyle(Void) {
onEnterFrame = draw;
}
static function setColorStyle(p, colorStyle) {
if (p._color == undefined) {
p._color = colorStyle;
}
p.setColor = mixins.setColor;
p.invalidateStyle = mixins.invalidateStyle;
p.draw = mixins.draw;
p.setColor(p.getStyle(colorStyle));
}
static var mixins = new mx.skins.ColoredSkinElement();
}
Symbol 59 MovieClip [__Packages.mx.core.ext.UIObjectExtensions] Frame 0
class mx.core.ext.UIObjectExtensions
{
function UIObjectExtensions () {
}
static function addGeometry(tf, ui) {
tf.addProperty("width", ui.__get__width, null);
tf.addProperty("height", ui.__get__height, null);
tf.addProperty("left", ui.__get__left, null);
tf.addProperty("x", ui.__get__x, null);
tf.addProperty("top", ui.__get__top, null);
tf.addProperty("y", ui.__get__y, null);
tf.addProperty("right", ui.__get__right, null);
tf.addProperty("bottom", ui.__get__bottom, null);
tf.addProperty("visible", ui.__get__visible, ui.__set__visible);
}
static function Extensions() {
if (bExtended == true) {
return(true);
}
bExtended = true;
var _local6 = mx.core.UIObject.prototype;
var _local9 = mx.skins.SkinElement.prototype;
addGeometry(_local9, _local6);
mx.events.UIEventDispatcher.initialize(_local6);
var _local13 = mx.skins.ColoredSkinElement;
mx.styles.CSSTextStyles.addTextStyles(_local6);
var _local5 = MovieClip.prototype;
_local5.getTopLevel = _local6.getTopLevel;
_local5.createLabel = _local6.createLabel;
_local5.createObject = _local6.createObject;
_local5.createClassObject = _local6.createClassObject;
_local5.createEmptyObject = _local6.createEmptyObject;
_local5.destroyObject = _local6.destroyObject;
_global.ASSetPropFlags(_local5, "getTopLevel", 1);
_global.ASSetPropFlags(_local5, "createLabel", 1);
_global.ASSetPropFlags(_local5, "createObject", 1);
_global.ASSetPropFlags(_local5, "createClassObject", 1);
_global.ASSetPropFlags(_local5, "createEmptyObject", 1);
_global.ASSetPropFlags(_local5, "destroyObject", 1);
_local5.__getTextFormat = _local6.__getTextFormat;
_local5._getTextFormat = _local6._getTextFormat;
_local5.getStyleName = _local6.getStyleName;
_local5.getStyle = _local6.getStyle;
_global.ASSetPropFlags(_local5, "__getTextFormat", 1);
_global.ASSetPropFlags(_local5, "_getTextFormat", 1);
_global.ASSetPropFlags(_local5, "getStyleName", 1);
_global.ASSetPropFlags(_local5, "getStyle", 1);
var _local7 = TextField.prototype;
addGeometry(_local7, _local6);
_local7.addProperty("enabled", function () {
return(this.__enabled);
}, function (x) {
this.__enabled = x;
this.invalidateStyle();
});
_local7.move = _local9.move;
_local7.setSize = _local9.setSize;
_local7.invalidateStyle = function () {
this.invalidateFlag = true;
};
_local7.draw = function () {
if (this.invalidateFlag) {
this.invalidateFlag = false;
var _local2 = this._getTextFormat();
this.setTextFormat(_local2);
this.setNewTextFormat(_local2);
this.embedFonts = _local2.embedFonts == true;
if (this.__text != undefined) {
if (this.text == "") {
this.text = this.__text;
}
delete this.__text;
}
this._visible = true;
}
};
_local7.setColor = function (color) {
this.textColor = color;
};
_local7.getStyle = _local5.getStyle;
_local7.__getTextFormat = _local6.__getTextFormat;
_local7.setValue = function (v) {
this.text = v;
};
_local7.getValue = function () {
return(this.text);
};
_local7.addProperty("value", function () {
return(this.getValue());
}, function (v) {
this.setValue(v);
});
_local7._getTextFormat = function () {
var _local2 = this.stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
this.__getTextFormat(_local2);
this.stylecache.tf = _local2;
if (this.__enabled == false) {
if (this.enabledColor == undefined) {
var _local4 = this.getTextFormat();
this.enabledColor = _local4.color;
}
var _local3 = this.getStyle("disabledColor");
_local2.color = _local3;
} else if (this.enabledColor != undefined) {
if (_local2.color == undefined) {
_local2.color = this.enabledColor;
}
}
return(_local2);
};
_local7.getPreferredWidth = function () {
this.draw();
return(this.textWidth + 4);
};
_local7.getPreferredHeight = function () {
this.draw();
return(this.textHeight + 4);
};
TextFormat.prototype.getTextExtent2 = function (s) {
var _local3 = _root._getTextExtent;
if (_local3 == undefined) {
_root.createTextField("_getTextExtent", -2, 0, 0, 1000, 100);
_local3 = _root._getTextExtent;
_local3._visible = false;
}
_root._getTextExtent.text = s;
var _local4 = this.align;
this.align = "left";
_root._getTextExtent.setTextFormat(this);
this.align = _local4;
return({width:_local3.textWidth, height:_local3.textHeight});
};
if (_global.style == undefined) {
_global.style = new mx.styles.CSSStyleDeclaration();
_global.cascadingStyles = true;
_global.styles = new Object();
_global.skinRegistry = new Object();
if (_global._origWidth == undefined) {
_global.origWidth = Stage.width;
_global.origHeight = Stage.height;
}
}
var _local4 = _root;
while (_local4._parent != undefined) {
_local4 = _local4._parent;
}
_local4.addProperty("width", function () {
return(Stage.width);
}, null);
_local4.addProperty("height", function () {
return(Stage.height);
}, null);
_global.ASSetPropFlags(_local4, "width", 1);
_global.ASSetPropFlags(_local4, "height", 1);
return(true);
}
static var bExtended = false;
static var UIObjectExtended = Extensions();
static var UIObjectDependency = mx.core.UIObject;
static var SkinElementDependency = mx.skins.SkinElement;
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
static var UIEventDispatcherDependency = mx.events.UIEventDispatcher;
}
Symbol 60 MovieClip [__Packages.mx.skins.halo.Defaults] Frame 0
class mx.skins.halo.Defaults
{
var beginGradientFill, beginFill, moveTo, lineTo, curveTo, endFill;
function Defaults () {
}
static function setThemeDefaults() {
var _local2 = _global.style;
_local2.themeColor = 8453965 /* 0x80FF4D */;
_local2.disabledColor = 8684164 /* 0x848284 */;
_local2.modalTransparency = 0;
_local2.filled = true;
_local2.stroked = true;
_local2.strokeWidth = 1;
_local2.strokeColor = 0;
_local2.fillColor = 16777215 /* 0xFFFFFF */;
_local2.repeatInterval = 35;
_local2.repeatDelay = 500;
_local2.fontFamily = "_sans";
_local2.fontSize = 12;
_local2.selectionColor = 13500353 /* 0xCDFFC1 */;
_local2.rollOverColor = 14942166 /* 0xE3FFD6 */;
_local2.useRollOver = true;
_local2.backgroundDisabledColor = 14540253 /* 0xDDDDDD */;
_local2.selectionDisabledColor = 14540253 /* 0xDDDDDD */;
_local2.selectionDuration = 200;
_local2.openDuration = 250;
_local2.borderStyle = "inset";
_local2.color = 734012 /* 0x0B333C */;
_local2.textSelectedColor = 24371;
_local2.textRollOverColor = 2831164 /* 0x2B333C */;
_local2.textDisabledColor = 16777215 /* 0xFFFFFF */;
_local2.vGridLines = true;
_local2.hGridLines = false;
_local2.vGridLineColor = 6710886 /* 0x666666 */;
_local2.hGridLineColor = 6710886 /* 0x666666 */;
_local2.headerColor = 15395562 /* 0xEAEAEA */;
_local2.indentation = 17;
_local2.folderOpenIcon = "TreeFolderOpen";
_local2.folderClosedIcon = "TreeFolderClosed";
_local2.defaultLeafIcon = "TreeNodeIcon";
_local2.disclosureOpenIcon = "TreeDisclosureOpen";
_local2.disclosureClosedIcon = "TreeDisclosureClosed";
_local2.popupDuration = 150;
_local2.todayColor = 6710886 /* 0x666666 */;
_local2 = (_global.styles.ScrollSelectList = new mx.styles.CSSStyleDeclaration());
_local2.backgroundColor = 16777215 /* 0xFFFFFF */;
_local2.borderColor = 13290186 /* 0xCACACA */;
_local2.borderStyle = "inset";
_local2 = (_global.styles.ComboBox = new mx.styles.CSSStyleDeclaration());
_local2.borderStyle = "inset";
_local2 = (_global.styles.NumericStepper = new mx.styles.CSSStyleDeclaration());
_local2.textAlign = "center";
_local2 = (_global.styles.RectBorder = new mx.styles.CSSStyleDeclaration());
_local2.borderColor = 14015965 /* 0xD5DDDD */;
_local2.buttonColor = 7305079 /* 0x6F7777 */;
_local2.shadowColor = 15658734 /* 0xEEEEEE */;
_local2.highlightColor = 12897484 /* 0xC4CCCC */;
_local2.shadowCapColor = 14015965 /* 0xD5DDDD */;
_local2.borderCapColor = 9542041 /* 0x919999 */;
var _local4 = new Object();
_local4.borderColor = 16711680 /* 0xFF0000 */;
_local4.buttonColor = 16711680 /* 0xFF0000 */;
_local4.shadowColor = 16711680 /* 0xFF0000 */;
_local4.highlightColor = 16711680 /* 0xFF0000 */;
_local4.shadowCapColor = 16711680 /* 0xFF0000 */;
_local4.borderCapColor = 16711680 /* 0xFF0000 */;
mx.core.UIComponent.prototype.origBorderStyles = _local4;
var _local3;
_local3 = (_global.styles.TextInput = new mx.styles.CSSStyleDeclaration());
_local3.backgroundColor = 16777215 /* 0xFFFFFF */;
_local3.borderStyle = "inset";
_global.styles.TextArea = _global.styles.TextInput;
_local3 = (_global.styles.Window = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "default";
_local3 = (_global.styles.windowStyles = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3 = (_global.styles.dataGridStyles = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3 = (_global.styles.Alert = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "alert";
_local3 = (_global.styles.ScrollView = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "inset";
_local3 = (_global.styles.View = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "none";
_local3 = (_global.styles.ProgressBar = new mx.styles.CSSStyleDeclaration());
_local3.color = 11187123 /* 0xAAB3B3 */;
_local3.fontWeight = "bold";
_local3 = (_global.styles.AccordionHeader = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3.fontSize = "11";
_local3 = (_global.styles.Accordion = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "solid";
_local3.backgroundColor = 16777215 /* 0xFFFFFF */;
_local3.borderColor = 9081738 /* 0x8A938A */;
_local3.headerHeight = 22;
_local3.marginLeft = (_local3.marginRight = (_local3.marginTop = (_local3.marginBottom = -1)));
_local3.verticalGap = -1;
_local3 = (_global.styles.DateChooser = new mx.styles.CSSStyleDeclaration());
_local3.borderColor = 9542041 /* 0x919999 */;
_local3.headerColor = 16777215 /* 0xFFFFFF */;
_local3 = (_global.styles.CalendarLayout = new mx.styles.CSSStyleDeclaration());
_local3.fontSize = 10;
_local3.textAlign = "right";
_local3.color = 2831164 /* 0x2B333C */;
_local3 = (_global.styles.WeekDayStyle = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3.fontSize = 11;
_local3.textAlign = "center";
_local3.color = 2831164 /* 0x2B333C */;
_local3 = (_global.styles.TodayStyle = new mx.styles.CSSStyleDeclaration());
_local3.color = 16777215 /* 0xFFFFFF */;
_local3 = (_global.styles.HeaderDateText = new mx.styles.CSSStyleDeclaration());
_local3.fontSize = 12;
_local3.fontWeight = "bold";
_local3.textAlign = "center";
}
function drawRoundRect(x, y, w, h, r, c, alpha, rot, gradient, ratios) {
if (typeof(r) == "object") {
var _local18 = r.br;
var _local16 = r.bl;
var _local15 = r.tl;
var _local10 = r.tr;
} else {
var _local10 = r;
var _local15 = _local10;
var _local16 = _local15;
var _local18 = _local16;
}
if (typeof(c) == "object") {
if (typeof(alpha) != "object") {
var _local9 = [alpha, alpha];
} else {
var _local9 = alpha;
}
if (ratios == undefined) {
ratios = [0, 255];
}
var _local14 = h * 0.7;
if (typeof(rot) != "object") {
var _local11 = {matrixType:"box", x:-_local14, y:_local14, w:w * 2, h:h * 4, r:rot * 0.0174532925199433 /* Math.PI/180 */};
} else {
var _local11 = rot;
}
if (gradient == "radial") {
beginGradientFill("radial", c, _local9, ratios, _local11);
} else {
beginGradientFill("linear", c, _local9, ratios, _local11);
}
} else if (c != undefined) {
beginFill(c, alpha);
}
r = _local18;
var _local13 = r - (r * 0.707106781186547);
var _local12 = r - (r * 0.414213562373095);
moveTo(x + w, (y + h) - r);
lineTo(x + w, (y + h) - r);
curveTo(x + w, (y + h) - _local12, (x + w) - _local13, (y + h) - _local13);
curveTo((x + w) - _local12, y + h, (x + w) - r, y + h);
r = _local16;
_local13 = r - (r * 0.707106781186547);
_local12 = r - (r * 0.414213562373095);
lineTo(x + r, y + h);
curveTo(x + _local12, y + h, x + _local13, (y + h) - _local13);
curveTo(x, (y + h) - _local12, x, (y + h) - r);
r = _local15;
_local13 = r - (r * 0.707106781186547);
_local12 = r - (r * 0.414213562373095);
lineTo(x, y + r);
curveTo(x, y + _local12, x + _local13, y + _local13);
curveTo(x + _local12, y, x + r, y);
r = _local10;
_local13 = r - (r * 0.707106781186547);
_local12 = r - (r * 0.414213562373095);
lineTo((x + w) - r, y);
curveTo((x + w) - _local12, y, (x + w) - _local13, y + _local13);
curveTo(x + w, y + _local12, x + w, y + r);
lineTo(x + w, (y + h) - r);
if (c != undefined) {
endFill();
}
}
static function classConstruct() {
mx.core.ext.UIObjectExtensions.Extensions();
setThemeDefaults();
mx.core.UIObject.prototype.drawRoundRect = mx.skins.halo.Defaults.prototype.drawRoundRect;
return(true);
}
static var classConstructed = classConstruct();
static var CSSStyleDeclarationDependency = mx.styles.CSSStyleDeclaration;
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
static var UIObjectDependency = mx.core.UIObject;
}
Symbol 61 MovieClip [__Packages.mx.managers.DepthManager] Frame 0
class mx.managers.DepthManager
{
var _childCounter, createClassObject, createObject, _parent, swapDepths, _topmost, getDepth;
function DepthManager () {
MovieClip.prototype.createClassChildAtDepth = createClassChildAtDepth;
MovieClip.prototype.createChildAtDepth = createChildAtDepth;
MovieClip.prototype.setDepthTo = setDepthTo;
MovieClip.prototype.setDepthAbove = setDepthAbove;
MovieClip.prototype.setDepthBelow = setDepthBelow;
MovieClip.prototype.findNextAvailableDepth = findNextAvailableDepth;
MovieClip.prototype.shuffleDepths = shuffleDepths;
MovieClip.prototype.getDepthByFlag = getDepthByFlag;
MovieClip.prototype.buildDepthTable = buildDepthTable;
_global.ASSetPropFlags(MovieClip.prototype, "createClassChildAtDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "createChildAtDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthTo", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthAbove", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthBelow", 1);
_global.ASSetPropFlags(MovieClip.prototype, "findNextAvailableDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "shuffleDepths", 1);
_global.ASSetPropFlags(MovieClip.prototype, "getDepthByFlag", 1);
_global.ASSetPropFlags(MovieClip.prototype, "buildDepthTable", 1);
}
static function sortFunction(a, b) {
if (a.getDepth() > b.getDepth()) {
return(1);
}
return(-1);
}
static function test(depth) {
if (depth == reservedDepth) {
return(false);
}
return(true);
}
static function createClassObjectAtDepth(className, depthSpace, initObj) {
var _local1;
switch (depthSpace) {
case kCursor :
_local1 = holder.createClassChildAtDepth(className, kTopmost, initObj);
break;
case kTooltip :
_local1 = holder.createClassChildAtDepth(className, kTop, initObj);
break;
}
return(_local1);
}
static function createObjectAtDepth(linkageName, depthSpace, initObj) {
var _local1;
switch (depthSpace) {
case kCursor :
_local1 = holder.createChildAtDepth(linkageName, kTopmost, initObj);
break;
case kTooltip :
_local1 = holder.createChildAtDepth(linkageName, kTop, initObj);
break;
}
return(_local1);
}
function createClassChildAtDepth(className, depthFlag, initObj) {
if (_childCounter == undefined) {
_childCounter = 0;
}
var _local3 = buildDepthTable();
var _local2 = getDepthByFlag(depthFlag, _local3);
var _local6 = "down";
if (depthFlag == kBottom) {
_local6 = "up";
}
var _local5;
if (_local3[_local2] != undefined) {
_local5 = _local2;
_local2 = findNextAvailableDepth(_local2, _local3, _local6);
}
var _local4 = createClassObject(className, "depthChild" + (_childCounter++), _local2, initObj);
if (_local5 != undefined) {
_local3[_local2] = _local4;
shuffleDepths(_local4, _local5, _local3, _local6);
}
if (depthFlag == kTopmost) {
_local4._topmost = true;
}
return(_local4);
}
function createChildAtDepth(linkageName, depthFlag, initObj) {
if (_childCounter == undefined) {
_childCounter = 0;
}
var _local3 = buildDepthTable();
var _local2 = getDepthByFlag(depthFlag, _local3);
var _local6 = "down";
if (depthFlag == kBottom) {
_local6 = "up";
}
var _local5;
if (_local3[_local2] != undefined) {
_local5 = _local2;
_local2 = findNextAvailableDepth(_local2, _local3, _local6);
}
var _local4 = createObject(linkageName, "depthChild" + (_childCounter++), _local2, initObj);
if (_local5 != undefined) {
_local3[_local2] = _local4;
shuffleDepths(_local4, _local5, _local3, _local6);
}
if (depthFlag == kTopmost) {
_local4._topmost = true;
}
return(_local4);
}
function setDepthTo(depthFlag) {
var _local2 = _parent.buildDepthTable();
var _local3 = _parent.getDepthByFlag(depthFlag, _local2);
if (_local2[_local3] != undefined) {
shuffleDepths(this, _local3, _local2, undefined);
} else {
swapDepths(_local3);
}
if (depthFlag == kTopmost) {
_topmost = true;
} else {
delete _topmost;
}
}
function setDepthAbove(targetInstance) {
if (targetInstance._parent != _parent) {
return(undefined);
}
var _local2 = targetInstance.getDepth() + 1;
var _local3 = _parent.buildDepthTable();
if ((_local3[_local2] != undefined) && (getDepth() < _local2)) {
_local2 = _local2 - 1;
}
if (_local2 > highestDepth) {
_local2 = highestDepth;
}
if (_local2 == highestDepth) {
_parent.shuffleDepths(this, _local2, _local3, "down");
} else if (_local3[_local2] != undefined) {
_parent.shuffleDepths(this, _local2, _local3, undefined);
} else {
swapDepths(_local2);
}
}
function setDepthBelow(targetInstance) {
if (targetInstance._parent != _parent) {
return(undefined);
}
var _local6 = targetInstance.getDepth() - 1;
var _local3 = _parent.buildDepthTable();
if ((_local3[_local6] != undefined) && (getDepth() > _local6)) {
_local6 = _local6 + 1;
}
var _local4 = lowestDepth + numberOfAuthortimeLayers;
var _local5;
for (_local5 in _local3) {
var _local2 = _local3[_local5];
if (_local2._parent != undefined) {
_local4 = Math.min(_local4, _local2.getDepth());
}
}
if (_local6 < _local4) {
_local6 = _local4;
}
if (_local6 == _local4) {
_parent.shuffleDepths(this, _local6, _local3, "up");
} else if (_local3[_local6] != undefined) {
_parent.shuffleDepths(this, _local6, _local3, undefined);
} else {
swapDepths(_local6);
}
}
function findNextAvailableDepth(targetDepth, depthTable, direction) {
var _local5 = lowestDepth + numberOfAuthortimeLayers;
if (targetDepth < _local5) {
targetDepth = _local5;
}
if (depthTable[targetDepth] == undefined) {
return(targetDepth);
}
var _local2 = targetDepth;
var _local1 = targetDepth;
if (direction == "down") {
while (depthTable[_local1] != undefined) {
_local1--;
}
return(_local1);
}
while (depthTable[_local2] != undefined) {
_local2++;
}
return(_local2);
}
function shuffleDepths(subject, targetDepth, depthTable, direction) {
var _local9 = lowestDepth + numberOfAuthortimeLayers;
var _local8 = _local9;
var _local5;
for (_local5 in depthTable) {
var _local7 = depthTable[_local5];
if (_local7._parent != undefined) {
_local9 = Math.min(_local9, _local7.getDepth());
}
}
if (direction == undefined) {
if (subject.getDepth() > targetDepth) {
direction = "up";
} else {
direction = "down";
}
}
var _local1 = new Array();
for (_local5 in depthTable) {
var _local7 = depthTable[_local5];
if (_local7._parent != undefined) {
_local1.push(_local7);
}
}
_local1.sort(sortFunction);
if (direction == "up") {
var _local3;
var _local11;
do {
if (_local1.length <= 0) {
break;
}
_local3 = _local1.pop();
} while (_local3 != subject);
do {
if (_local1.length <= 0) {
break;
}
_local11 = subject.getDepth();
_local3 = _local1.pop();
var _local4 = _local3.getDepth();
if (_local11 > (_local4 + 1)) {
if (_local4 >= 0) {
subject.swapDepths(_local4 + 1);
} else if ((_local11 > _local8) && (_local4 < _local8)) {
subject.swapDepths(_local8);
}
}
subject.swapDepths(_local3);
} while (_local4 != targetDepth);
} else if (direction == "down") {
var _local3;
do {
if (_local1.length <= 0) {
break;
}
_local3 = _local1.shift();
} while (_local3 != subject);
do {
if (_local1.length <= 0) {
break;
}
var _local11 = _local3.getDepth();
_local3 = _local1.shift();
var _local4 = _local3.getDepth();
if ((_local11 < (_local4 - 1)) && (_local4 > 0)) {
subject.swapDepths(_local4 - 1);
}
subject.swapDepths(_local3);
} while (_local4 != targetDepth);
}
}
function getDepthByFlag(depthFlag, depthTable) {
var _local2 = 0;
if ((depthFlag == kTop) || (depthFlag == kNotopmost)) {
var _local5 = 0;
var _local7 = false;
var _local8;
for (_local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
if (!_local9._topmost) {
_local2 = Math.max(_local2, _local9.getDepth());
} else if (!_local7) {
_local5 = _local9.getDepth();
_local7 = true;
} else {
_local5 = Math.min(_local5, _local9.getDepth());
}
}
}
}
_local2 = _local2 + 20;
if (_local7) {
if (_local2 >= _local5) {
_local2 = _local5 - 1;
}
}
} else if (depthFlag == kBottom) {
for (var _local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
_local2 = Math.min(_local2, _local9.getDepth());
}
}
}
_local2 = _local2 - 20;
} else if (depthFlag == kTopmost) {
for (var _local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
_local2 = Math.max(_local2, _local9.getDepth());
}
}
}
_local2 = _local2 + 100;
}
if (_local2 >= highestDepth) {
_local2 = highestDepth;
}
var _local6 = lowestDepth + numberOfAuthortimeLayers;
for (var _local9 in depthTable) {
var _local4 = depthTable[_local9];
if (_local4._parent != undefined) {
_local6 = Math.min(_local6, _local4.getDepth());
}
}
if (_local2 <= _local6) {
_local2 = _local6;
}
return(_local2);
}
function buildDepthTable(Void) {
var _local5 = new Array();
var _local4;
for (_local4 in this) {
var _local2 = this[_local4];
var _local3 = typeof(_local2);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local2.__getTextFormat != undefined))) {
if (_local2._parent == this) {
_local5[_local2.getDepth()] = _local2;
}
}
}
return(_local5);
}
static var reservedDepth = 1048575;
static var highestDepth = 1048574;
static var lowestDepth = -16383;
static var numberOfAuthortimeLayers = 383;
static var kCursor = 101;
static var kTooltip = 102;
static var kTop = 201;
static var kBottom = 202;
static var kTopmost = 203;
static var kNotopmost = 204;
static var holder = _root.createEmptyMovieClip("reserved", reservedDepth);
static var __depthManager = new mx.managers.DepthManager();
}
Symbol 62 MovieClip [__Packages.mx.managers.SystemManager] Frame 0
class mx.managers.SystemManager
{
static var _xAddEventListener, addEventListener, __addEventListener, _xRemoveEventListener, removeEventListener, __removeEventListener, form, __screen, dispatchEvent;
function SystemManager () {
}
static function init(Void) {
if (_initialized == false) {
_initialized = true;
mx.events.EventDispatcher.initialize(mx.managers.SystemManager);
Mouse.addListener(mx.managers.SystemManager);
Stage.addListener(mx.managers.SystemManager);
_xAddEventListener = addEventListener;
addEventListener = __addEventListener;
_xRemoveEventListener = removeEventListener;
removeEventListener = __removeEventListener;
}
}
static function addFocusManager(f) {
form = f;
f.focusManager.activate();
}
static function removeFocusManager(f) {
}
static function onMouseDown(Void) {
var _local1 = form;
_local1.focusManager._onMouseDown();
}
static function onResize(Void) {
var _local7 = Stage.width;
var _local6 = Stage.height;
var _local9 = _global.origWidth;
var _local8 = _global.origHeight;
var _local3 = Stage.align;
var _local5 = (_local9 - _local7) / 2;
var _local4 = (_local8 - _local6) / 2;
if (_local3 == "T") {
_local4 = 0;
} else if (_local3 == "B") {
_local4 = _local8 - _local6;
} else if (_local3 == "L") {
_local5 = 0;
} else if (_local3 == "R") {
_local5 = _local9 - _local7;
} else if (_local3 == "LT") {
_local4 = 0;
_local5 = 0;
} else if (_local3 == "TR") {
_local4 = 0;
_local5 = _local9 - _local7;
} else if (_local3 == "LB") {
_local4 = _local8 - _local6;
_local5 = 0;
} else if (_local3 == "RB") {
_local4 = _local8 - _local6;
_local5 = _local9 - _local7;
}
if (__screen == undefined) {
__screen = new Object();
}
__screen.x = _local5;
__screen.y = _local4;
__screen.width = _local7;
__screen.height = _local6;
_root.focusManager.relocate();
dispatchEvent({type:"resize"});
}
static function get screen() {
init();
if (__screen == undefined) {
onResize();
}
return(__screen);
}
static var _initialized = false;
static var idleFrames = 0;
static var isMouseDown = false;
static var forms = new Array();
}
Symbol 63 MovieClip [__Packages.mx.managers.FocusManager] Frame 0
class mx.managers.FocusManager extends mx.core.UIComponent
{
var __defaultPushButton, defPushButton, form, move, tabEnabled, _width, _height, _x, _y, _alpha, _parent, tabCapture, watch, lastMouse, _visible, lastFocus, doLater, lastSelFocus, cancelAllDoLaters, _searchKey, _lastTarget, _firstNode, _nextIsNext, _nextNode, _lastx, _prevNode, _needPrev, _foundList, _prevObj, _nextObj, _firstObj, _lastObj, _lastNode, lastTabFocus, findFocusFromObject;
function FocusManager () {
super();
}
function get defaultPushButton() {
return(__defaultPushButton);
}
function set defaultPushButton(x) {
if (x != __defaultPushButton) {
__defaultPushButton.__set__emphasized(false);
__defaultPushButton = x;
defPushButton = x;
x.__set__emphasized(true);
}
//return(defaultPushButton);
}
function getMaxTabIndex(o) {
var _local3 = 0;
var _local6;
for (_local6 in o) {
var _local2 = o[_local6];
if (_local2._parent == o) {
if (_local2.tabIndex != undefined) {
if (_local2.tabIndex > _local3) {
_local3 = _local2.tabIndex;
}
}
if (_local2.tabChildren == true) {
var _local4 = getMaxTabIndex(_local2);
if (_local4 > _local3) {
_local3 = _local4;
}
}
}
}
return(_local3);
}
function getNextTabIndex(Void) {
return(getMaxTabIndex(form) + 1);
}
function get nextTabIndex() {
return(getNextTabIndex());
}
function relocate(Void) {
var _local2 = mx.managers.SystemManager.__get__screen();
move(_local2.x - 1, _local2.y - 1);
}
function init(Void) {
super.init();
tabEnabled = false;
_width = (_height = 1);
_x = (_y = -1);
_alpha = 0;
_parent.focusManager = this;
_parent.tabChildren = true;
_parent.tabEnabled = false;
form = _parent;
_parent.addEventListener("hide", this);
_parent.addEventListener("reveal", this);
mx.managers.SystemManager.init();
mx.managers.SystemManager.addFocusManager(form);
tabCapture.tabIndex = 0;
watch("enabled", enabledChanged);
Selection.addListener(this);
lastMouse = new Object();
_global.ASSetPropFlags(_parent, "focusManager", 1);
_global.ASSetPropFlags(_parent, "tabChildren", 1);
_global.ASSetPropFlags(_parent, "tabEnabled", 1);
}
function enabledChanged(id, oldValue, newValue) {
_visible = newValue;
return(newValue);
}
function activate(Void) {
Key.addListener(this);
activated = (_visible = true);
if (lastFocus != undefined) {
bNeedFocus = true;
if (!mx.managers.SystemManager.isMouseDown) {
doLater(this, "restoreFocus");
}
}
}
function deactivate(Void) {
Key.removeListener(this);
activated = (_visible = false);
var _local2 = getSelectionFocus();
var _local3 = getActualFocus(_local2);
if (isOurFocus(_local3)) {
lastSelFocus = _local2;
lastFocus = _local3;
}
cancelAllDoLaters();
}
function isOurFocus(o) {
if (o.focusManager == this) {
return(true);
}
while (o != undefined) {
if (o.focusManager != undefined) {
return(false);
}
if (o._parent == _parent) {
return(true);
}
o = o._parent;
}
return(false);
}
function onSetFocus(o, n) {
if (n == null) {
if (activated) {
bNeedFocus = true;
}
} else {
var _local2 = getFocus();
if (isOurFocus(_local2)) {
bNeedFocus = false;
lastFocus = _local2;
lastSelFocus = n;
}
}
}
function restoreFocus(Void) {
var _local2 = lastSelFocus.hscroll;
if (_local2 != undefined) {
var _local5 = lastSelFocus.scroll;
var _local4 = lastSelFocus.background;
}
lastFocus.setFocus();
var _local3 = Selection;
Selection.setSelection(_local3.lastBeginIndex, _local3.lastEndIndex);
if (_local2 != undefined) {
lastSelFocus.scroll = _local5;
lastSelFocus.hscroll = _local2;
lastSelFocus.background = _local4;
}
}
function onUnload(Void) {
mx.managers.SystemManager.removeFocusManager(form);
}
function setFocus(o) {
if (o == null) {
Selection.setFocus(null);
} else if (o.setFocus == undefined) {
Selection.setFocus(o);
} else {
o.setFocus();
}
}
function getActualFocus(o) {
var _local1 = o._parent;
while (_local1 != undefined) {
if (_local1.focusTextField != undefined) {
while (_local1.focusTextField != undefined) {
o = _local1;
_local1 = _local1._parent;
if (_local1 == undefined) {
return(undefined);
}
if (_local1.focusTextField == undefined) {
return(o);
}
}
}
if (_local1.tabEnabled != true) {
return(o);
}
o = _local1;
_local1 = o._parent;
}
return(undefined);
}
function getSelectionFocus() {
var m = Selection.getFocus();
var o = eval (m);
return(o);
}
function getFocus(Void) {
var _local2 = getSelectionFocus();
return(getActualFocus(_local2));
}
function walkTree(p, index, groupName, dir, lookup, firstChild) {
var _local5 = true;
var _local11;
for (_local11 in p) {
var _local2 = p[_local11];
if ((((_local2._parent == p) && (_local2.enabled != false)) && (_local2._visible != false)) && ((_local2.tabEnabled == true) || ((_local2.tabEnabled != false) && ((((((((_local2.onPress != undefined) || (_local2.onRelease != undefined)) || (_local2.onReleaseOutside != undefined)) || (_local2.onDragOut != undefined)) || (_local2.onDragOver != undefined)) || (_local2.onRollOver != undefined)) || (_local2.onRollOut != undefined)) || (_local2 instanceof TextField))))) {
if (_local2._searchKey == _searchKey) {
continue;
}
_local2._searchKey = _searchKey;
if (_local2 != _lastTarget) {
if (((_local2.groupName != undefined) || (groupName != undefined)) && (_local2.groupName == groupName)) {
continue;
}
if ((_local2 instanceof TextField) && (_local2.selectable == false)) {
continue;
}
if (_local5 || (((_local2.groupName != undefined) && (_local2.groupName == _firstNode.groupName)) && (_local2.selected == true))) {
if (firstChild) {
_firstNode = _local2;
firstChild = false;
}
}
if (_nextIsNext == true) {
if ((((_local2.groupName != undefined) && (_local2.groupName == _nextNode.groupName)) && (_local2.selected == true)) || ((_nextNode == undefined) && ((_local2.groupName == undefined) || ((_local2.groupName != undefined) && (_local2.groupName != groupName))))) {
_nextNode = _local2;
}
}
if ((_local2.groupName == undefined) || (groupName != _local2.groupName)) {
if (((_lastx.groupName != undefined) && (_local2.groupName == _lastx.groupName)) && (_lastx.selected == true)) {
} else {
_lastx = _local2;
}
}
} else {
_prevNode = _lastx;
_needPrev = false;
_nextIsNext = true;
}
if (_local2.tabIndex != undefined) {
if (_local2.tabIndex == index) {
if (_foundList[_local2._name] == undefined) {
if (_needPrev) {
_prevObj = _local2;
_needPrev = false;
}
_nextObj = _local2;
}
}
if (dir && (_local2.tabIndex > index)) {
if (((_nextObj == undefined) || ((_nextObj.tabIndex > _local2.tabIndex) && (((_local2.groupName == undefined) || (_nextObj.groupName == undefined)) || (_local2.groupName != _nextObj.groupName)))) || ((((_nextObj.groupName != undefined) && (_nextObj.groupName == _local2.groupName)) && (_nextObj.selected != true)) && ((_local2.selected == true) || (_nextObj.tabIndex > _local2.tabIndex)))) {
_nextObj = _local2;
}
} else if ((!dir) && (_local2.tabIndex < index)) {
if (((_prevObj == undefined) || ((_prevObj.tabIndex < _local2.tabIndex) && (((_local2.groupName == undefined) || (_prevObj.groupName == undefined)) || (_local2.groupName != _prevObj.groupName)))) || ((((_prevObj.groupName != undefined) && (_prevObj.groupName == _local2.groupName)) && (_prevObj.selected != true)) && ((_local2.selected == true) || (_prevObj.tabIndex < _local2.tabIndex)))) {
_prevObj = _local2;
}
}
if (((_firstObj == undefined) || ((_local2.tabIndex < _firstObj.tabIndex) && (((_local2.groupName == undefined) || (_firstObj.groupName == undefined)) || (_local2.groupName != _firstObj.groupName)))) || ((((_firstObj.groupName != undefined) && (_firstObj.groupName == _local2.groupName)) && (_firstObj.selected != true)) && ((_local2.selected == true) || (_local2.tabIndex < _firstObj.tabIndex)))) {
_firstObj = _local2;
}
if (((_lastObj == undefined) || ((_local2.tabIndex > _lastObj.tabIndex) && (((_local2.groupName == undefined) || (_lastObj.groupName == undefined)) || (_local2.groupName != _lastObj.groupName)))) || ((((_lastObj.groupName != undefined) && (_lastObj.groupName == _local2.groupName)) && (_lastObj.selected != true)) && ((_local2.selected == true) || (_local2.tabIndex > _lastObj.tabIndex)))) {
_lastObj = _local2;
}
}
if (_local2.tabChildren) {
getTabCandidateFromChildren(_local2, index, groupName, dir, _local5 && (firstChild));
}
_local5 = false;
} else if (((_local2._parent == p) && (_local2.tabChildren == true)) && (_local2._visible != false)) {
if (_local2 == _lastTarget) {
if (_local2._searchKey == _searchKey) {
continue;
}
_local2._searchKey = _searchKey;
if (_prevNode == undefined) {
var _local3 = _lastx;
var _local7 = false;
while (_local3 != undefined) {
if (_local3 == _local2) {
_local7 = true;
break;
}
_local3 = _local3._parent;
}
if (_local7 == false) {
_prevNode = _lastx;
}
}
_needPrev = false;
if (_nextNode == undefined) {
_nextIsNext = true;
}
} else if (!((_local2.focusManager != undefined) && (_local2.focusManager._parent == _local2))) {
if (_local2._searchKey == _searchKey) {
continue;
}
_local2._searchKey = _searchKey;
getTabCandidateFromChildren(_local2, index, groupName, dir, _local5 && (firstChild));
}
_local5 = false;
}
}
_lastNode = _lastx;
if (lookup) {
if (p._parent != undefined) {
if (p != _parent) {
if ((_prevNode == undefined) && (dir)) {
_needPrev = true;
} else if ((_nextNode == undefined) && (!dir)) {
_nextIsNext = false;
}
_lastTarget = _lastTarget._parent;
getTabCandidate(p._parent, index, groupName, dir, true);
}
}
}
}
function getTabCandidate(o, index, groupName, dir, firstChild) {
var _local2;
var _local3 = true;
if (o == _parent) {
_local2 = o;
_local3 = false;
} else {
_local2 = o._parent;
if (_local2 == undefined) {
_local2 = o;
_local3 = false;
}
}
walkTree(_local2, index, groupName, dir, _local3, firstChild);
}
function getTabCandidateFromChildren(o, index, groupName, dir, firstChild) {
walkTree(o, index, groupName, dir, false, firstChild);
}
function getFocusManagerFromObject(o) {
while (o != undefined) {
if (o.focusManager != undefined) {
return(o.focusManager);
}
o = o._parent;
}
return(undefined);
}
function tabHandler(Void) {
bDrawFocus = true;
var _local5 = getSelectionFocus();
var _local4 = getActualFocus(_local5);
if (_local4 != _local5) {
_local5 = _local4;
}
if (getFocusManagerFromObject(_local5) != this) {
_local5 == undefined;
}
if (_local5 == undefined) {
_local5 = form;
} else if (_local5.tabIndex != undefined) {
if ((_foundList != undefined) || (_foundList.tabIndex != _local5.tabIndex)) {
_foundList = new Object();
_foundList.tabIndex = _local5.tabIndex;
}
_foundList[_local5._name] = _local5;
}
var _local3 = Key.isDown(16) != true;
_searchKey = getTimer();
_needPrev = true;
_nextIsNext = false;
_lastx = undefined;
_firstNode = undefined;
_lastNode = undefined;
_nextNode = undefined;
_prevNode = undefined;
_firstObj = undefined;
_lastObj = undefined;
_nextObj = undefined;
_prevObj = undefined;
_lastTarget = _local5;
var _local6 = _local5;
getTabCandidate(_local6, ((_local5.tabIndex == undefined) ? 0 : (_local5.tabIndex)), _local5.groupName, _local3, true);
var _local2;
if (_local3) {
if (_nextObj != undefined) {
_local2 = _nextObj;
} else {
_local2 = _firstObj;
}
} else if (_prevObj != undefined) {
_local2 = _prevObj;
} else {
_local2 = _lastObj;
}
if (_local2.tabIndex != _local5.tabIndex) {
_foundList = new Object();
_foundList.tabIndex = _local2.tabIndex;
_foundList[_local2._name] = _local2;
} else {
if (_foundList == undefined) {
_foundList = new Object();
_foundList.tabIndex = _local2.tabIndex;
}
_foundList[_local2._name] = _local2;
}
if (_local2 == undefined) {
if (_local3 == false) {
if (_nextNode != undefined) {
_local2 = _nextNode;
} else {
_local2 = _firstNode;
}
} else if ((_prevNode == undefined) || (_local5 == form)) {
_local2 = _lastNode;
} else {
_local2 = _prevNode;
}
}
if (_local2 == undefined) {
return(undefined);
}
lastTabFocus = _local2;
setFocus(_local2);
if (_local2.emphasized != undefined) {
if (defPushButton != undefined) {
_local5 = defPushButton;
defPushButton = _local2;
_local5.emphasized = false;
_local2.emphasized = true;
}
} else if ((defPushButton != undefined) && (defPushButton != __defaultPushButton)) {
_local5 = defPushButton;
defPushButton = __defaultPushButton;
_local5.emphasized = false;
__defaultPushButton.__set__emphasized(true);
}
}
function onKeyDown(Void) {
mx.managers.SystemManager.idleFrames = 0;
if (defaultPushButtonEnabled) {
if (Key.getCode() == 13) {
if (defaultPushButton != undefined) {
doLater(this, "sendDefaultPushButtonEvent");
}
}
}
}
function sendDefaultPushButtonEvent(Void) {
defPushButton.dispatchEvent({type:"click"});
}
function getMousedComponentFromChildren(x, y, o) {
for (var _local7 in o) {
var _local2 = o[_local7];
if (((_local2._visible && (_local2.enabled)) && (_local2._parent == o)) && (_local2._searchKey != _searchKey)) {
_local2._searchKey = _searchKey;
if (_local2.hitTest(x, y, true)) {
if ((_local2.onPress != undefined) || (_local2.onRelease != undefined)) {
return(_local2);
}
var _local3 = getMousedComponentFromChildren(x, y, _local2);
if (_local3 != undefined) {
return(_local3);
}
return(_local2);
}
}
}
return(undefined);
}
function mouseActivate(Void) {
if (!bNeedFocus) {
return(undefined);
}
_searchKey = getTimer();
var _local2 = getMousedComponentFromChildren(lastMouse.x, lastMouse.y, form);
if (_local2 instanceof mx.core.UIComponent) {
return(undefined);
}
_local2 = findFocusFromObject(_local2);
if (_local2 == lastFocus) {
return(undefined);
}
if (_local2 == undefined) {
doLater(this, "restoreFocus");
return(undefined);
}
var _local3 = _local2.hscroll;
if (_local3 != undefined) {
var _local6 = _local2.scroll;
var _local5 = _local2.background;
}
setFocus(_local2);
var _local4 = Selection;
Selection.setSelection(_local4.lastBeginIndex, _local4.lastEndIndex);
if (_local3 != undefined) {
_local2.scroll = _local6;
_local2.hscroll = _local3;
_local2.background = _local5;
}
}
function _onMouseDown(Void) {
bDrawFocus = false;
if (lastFocus != undefined) {
lastFocus.drawFocus(false);
}
mx.managers.SystemManager.idleFrames = 0;
var _local3 = Selection;
_local3.lastBeginIndex = Selection.getBeginIndex();
_local3.lastEndIndex = Selection.getEndIndex();
lastMouse.x = _root._xmouse;
lastMouse.y = _root._ymouse;
_root.localToGlobal(lastMouse);
}
function onMouseUp(Void) {
if (_visible) {
doLater(this, "mouseActivate");
}
}
function handleEvent(e) {
if (e.type == "reveal") {
mx.managers.SystemManager.activate(form);
} else {
mx.managers.SystemManager.deactivate(form);
}
}
static function enableFocusManagement() {
if (!initialized) {
initialized = true;
Object.registerClass("FocusManager", mx.managers.FocusManager);
if (_root.focusManager == undefined) {
_root.createClassObject(mx.managers.FocusManager, "focusManager", mx.managers.DepthManager.highestDepth--);
}
}
}
static var symbolName = "FocusManager";
static var symbolOwner = mx.managers.FocusManager;
static var version = "2.0.2.127";
var className = "FocusManager";
var bNeedFocus = false;
var bDrawFocus = false;
var defaultPushButtonEnabled = true;
var activated = true;
static var initialized = false;
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
}
Symbol 64 MovieClip [__Packages.mx.skins.halo.FocusRect] Frame 0
class mx.skins.halo.FocusRect extends mx.skins.SkinElement
{
var boundingBox_mc, _xscale, _yscale, clear, beginFill, drawRoundRect, endFill, _visible;
function FocusRect () {
super();
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
function draw(o) {
o.adjustFocusRect();
}
function setSize(w, h, r, a, rectCol) {
_xscale = (_yscale = 100);
clear();
if (typeof(r) == "object") {
r.br = ((r.br > 2) ? (r.br - 2) : 0);
r.bl = ((r.bl > 2) ? (r.bl - 2) : 0);
r.tr = ((r.tr > 2) ? (r.tr - 2) : 0);
r.tl = ((r.tl > 2) ? (r.tl - 2) : 0);
beginFill(rectCol, a * 0.3);
drawRoundRect(0, 0, w, h, r);
drawRoundRect(2, 2, w - 4, h - 4, r);
endFill();
r.br = ((r.br > 1) ? (r.br + 1) : 0);
r.bl = ((r.bl > 1) ? (r.bl + 1) : 0);
r.tr = ((r.tr > 1) ? (r.tr + 1) : 0);
r.tl = ((r.tl > 1) ? (r.tl + 1) : 0);
beginFill(rectCol, a * 0.3);
drawRoundRect(1, 1, w - 2, h - 2, r);
r.br = ((r.br > 1) ? (r.br - 1) : 0);
r.bl = ((r.bl > 1) ? (r.bl - 1) : 0);
r.tr = ((r.tr > 1) ? (r.tr - 1) : 0);
r.tl = ((r.tl > 1) ? (r.tl - 1) : 0);
drawRoundRect(2, 2, w - 4, h - 4, r);
endFill();
} else {
var _local5;
if (r != 0) {
_local5 = r - 2;
} else {
_local5 = 0;
}
beginFill(rectCol, a * 0.3);
drawRoundRect(0, 0, w, h, r);
drawRoundRect(2, 2, w - 4, h - 4, _local5);
endFill();
beginFill(rectCol, a * 0.3);
if (r != 0) {
_local5 = r - 2;
r = r - 1;
} else {
_local5 = 0;
r = 0;
}
drawRoundRect(1, 1, w - 2, h - 2, r);
drawRoundRect(2, 2, w - 4, h - 4, _local5);
endFill();
}
}
function handleEvent(e) {
if (e.type == "unload") {
_visible = true;
} else if (e.type == "resize") {
e.target.adjustFocusRect();
} else if (e.type == "move") {
e.target.adjustFocusRect();
}
}
static function classConstruct() {
mx.core.UIComponent.prototype.drawFocus = function (focused) {
var _local2 = this._parent.focus_mc;
if (!focused) {
_local2._visible = false;
this.removeEventListener("unload", _local2);
this.removeEventListener("move", _local2);
this.removeEventListener("resize", _local2);
} else {
if (_local2 == undefined) {
_local2 = this._parent.createChildAtDepth("FocusRect", mx.managers.DepthManager.kTop);
_local2.tabEnabled = false;
this._parent.focus_mc = _local2;
} else {
_local2._visible = true;
}
_local2.draw(this);
if (_local2.getDepth() < this.getDepth()) {
_local2.setDepthAbove(this);
}
this.addEventListener("unload", _local2);
this.addEventListener("move", _local2);
this.addEventListener("resize", _local2);
}
};
mx.core.UIComponent.prototype.adjustFocusRect = function () {
var _local2 = this.getStyle("themeColor");
if (_local2 == undefined) {
_local2 = 8453965 /* 0x80FF4D */;
}
var _local3 = this._parent.focus_mc;
_local3.setSize(this.width + 4, this.height + 4, 0, 100, _local2);
_local3.move(this.x - 2, this.y - 2);
};
TextField.prototype.drawFocus = mx.core.UIComponent.prototype.drawFocus;
TextField.prototype.adjustFocusRect = mx.core.UIComponent.prototype.adjustFocusRect;
mx.skins.halo.FocusRect.prototype.drawRoundRect = mx.skins.halo.Defaults.prototype.drawRoundRect;
return(true);
}
static var classConstructed = classConstruct();
static var DefaultsDependency = mx.skins.halo.Defaults;
static var UIComponentDependency = mx.core.UIComponent;
}
Symbol 65 MovieClip [__Packages.mx.managers.OverlappedWindows] Frame 0
class mx.managers.OverlappedWindows
{
function OverlappedWindows () {
}
static function checkIdle(Void) {
if (mx.managers.SystemManager.idleFrames > 10) {
mx.managers.SystemManager.dispatchEvent({type:"idle"});
} else {
mx.managers.SystemManager.idleFrames++;
}
}
static function __addEventListener(e, o, l) {
if (e == "idle") {
if (mx.managers.SystemManager.interval == undefined) {
mx.managers.SystemManager.interval = setInterval(mx.managers.SystemManager.checkIdle, 100);
}
}
mx.managers.SystemManager._xAddEventListener(e, o, l);
}
static function __removeEventListener(e, o, l) {
if (e == "idle") {
if (mx.managers.SystemManager._xRemoveEventListener(e, o, l) == 0) {
clearInterval(mx.managers.SystemManager.interval);
}
} else {
mx.managers.SystemManager._xRemoveEventListener(e, o, l);
}
}
static function onMouseDown(Void) {
mx.managers.SystemManager.idleFrames = 0;
mx.managers.SystemManager.isMouseDown = true;
var _local5 = _root;
var _local3;
var _local8 = _root._xmouse;
var _local7 = _root._ymouse;
if (mx.managers.SystemManager.form.modalWindow == undefined) {
if (mx.managers.SystemManager.forms.length > 1) {
var _local6 = mx.managers.SystemManager.forms.length;
var _local4;
_local4 = 0;
while (_local4 < _local6) {
var _local2 = mx.managers.SystemManager.forms[_local4];
if (_local2._visible) {
if (_local2.hitTest(_local8, _local7)) {
if (_local3 == undefined) {
_local3 = _local2.getDepth();
_local5 = _local2;
} else if (_local3 < _local2.getDepth()) {
_local3 = _local2.getDepth();
_local5 = _local2;
}
}
}
_local4++;
}
if (_local5 != mx.managers.SystemManager.form) {
mx.managers.SystemManager.activate(_local5);
}
}
}
var _local9 = mx.managers.SystemManager.form;
_local9.focusManager._onMouseDown();
}
static function onMouseMove(Void) {
mx.managers.SystemManager.idleFrames = 0;
}
static function onMouseUp(Void) {
mx.managers.SystemManager.isMouseDown = false;
mx.managers.SystemManager.idleFrames = 0;
}
static function activate(f) {
if (mx.managers.SystemManager.form != undefined) {
if ((mx.managers.SystemManager.form != f) && (mx.managers.SystemManager.forms.length > 1)) {
var _local1 = mx.managers.SystemManager.form;
_local1.focusManager.deactivate();
}
}
mx.managers.SystemManager.form = f;
f.focusManager.activate();
}
static function deactivate(f) {
if (mx.managers.SystemManager.form != undefined) {
if ((mx.managers.SystemManager.form == f) && (mx.managers.SystemManager.forms.length > 1)) {
var _local5 = mx.managers.SystemManager.form;
_local5.focusManager.deactivate();
var _local3 = mx.managers.SystemManager.forms.length;
var _local1;
var _local2;
_local1 = 0;
while (_local1 < _local3) {
if (mx.managers.SystemManager.forms[_local1] == f) {
_local1 = _local1 + 1;
while (_local1 < _local3) {
if (mx.managers.SystemManager.forms[_local1]._visible == true) {
_local2 = mx.managers.SystemManager.forms[_local1];
}
_local1++;
}
mx.managers.SystemManager.form = _local2;
break;
}
if (mx.managers.SystemManager.forms[_local1]._visible == true) {
_local2 = mx.managers.SystemManager.forms[_local1];
}
_local1++;
}
_local5 = mx.managers.SystemManager.form;
_local5.focusManager.activate();
}
}
}
static function addFocusManager(f) {
mx.managers.SystemManager.forms.push(f);
mx.managers.SystemManager.activate(f);
}
static function removeFocusManager(f) {
var _local3 = mx.managers.SystemManager.forms.length;
var _local1;
_local1 = 0;
while (_local1 < _local3) {
if (mx.managers.SystemManager.forms[_local1] == f) {
if (mx.managers.SystemManager.form == f) {
mx.managers.SystemManager.deactivate(f);
}
mx.managers.SystemManager.forms.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
static function enableOverlappedWindows() {
if (!initialized) {
initialized = true;
mx.managers.SystemManager.checkIdle = checkIdle;
mx.managers.SystemManager.__addEventListener = __addEventListener;
mx.managers.SystemManager.__removeEventListener = __removeEventListener;
mx.managers.SystemManager.onMouseDown = onMouseDown;
mx.managers.SystemManager.onMouseMove = onMouseMove;
mx.managers.SystemManager.onMouseUp = onMouseUp;
mx.managers.SystemManager.activate = activate;
mx.managers.SystemManager.deactivate = deactivate;
mx.managers.SystemManager.addFocusManager = addFocusManager;
mx.managers.SystemManager.removeFocusManager = removeFocusManager;
}
}
static var initialized = false;
static var SystemManagerDependency = mx.managers.SystemManager;
}
Symbol 66 MovieClip [__Packages.mx.styles.CSSSetStyle] Frame 0
class mx.styles.CSSSetStyle
{
var styleName, stylecache, _color, setColor, invalidateStyle;
function CSSSetStyle () {
}
function _setStyle(styleProp, newValue) {
this[styleProp] = newValue;
if (mx.styles.StyleManager.TextStyleMap[styleProp] != undefined) {
if (styleProp == "color") {
if (isNaN(newValue)) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
}
_level0.changeTextStyleInChildren(styleProp);
return(undefined);
}
if (mx.styles.StyleManager.isColorStyle(styleProp)) {
if (isNaN(newValue)) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
if (styleProp == "themeColor") {
var _local7 = mx.styles.StyleManager.colorNames.haloBlue;
var _local6 = mx.styles.StyleManager.colorNames.haloGreen;
var _local8 = mx.styles.StyleManager.colorNames.haloOrange;
var _local4 = {};
_local4[_local7] = 12188666 /* 0xB9FBFA */;
_local4[_local6] = 13500353 /* 0xCDFFC1 */;
_local4[_local8] = 16766319 /* 0xFFD56F */;
var _local5 = {};
_local5[_local7] = 13958653 /* 0xD4FDFD */;
_local5[_local6] = 14942166 /* 0xE3FFD6 */;
_local5[_local8] = 16772787 /* 0xFFEEB3 */;
var _local9 = _local4[newValue];
var _local10 = _local5[newValue];
if (_local9 == undefined) {
_local9 = newValue;
}
if (_local10 == undefined) {
_local10 = newValue;
}
setStyle("selectionColor", _local9);
setStyle("rollOverColor", _local10);
}
_level0.changeColorStyleInChildren(styleName, styleProp, newValue);
} else {
if ((styleProp == "backgroundColor") && (isNaN(newValue))) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
_level0.notifyStyleChangeInChildren(styleName, styleProp, newValue);
}
}
function changeTextStyleInChildren(styleProp) {
var _local4 = getTimer();
var _local5;
for (_local5 in this) {
var _local2 = this[_local5];
if (_local2._parent == this) {
if (_local2.searchKey != _local4) {
if (_local2.stylecache != undefined) {
delete _local2.stylecache.tf;
delete _local2.stylecache[styleProp];
}
_local2.invalidateStyle(styleProp);
_local2.changeTextStyleInChildren(styleProp);
_local2.searchKey = _local4;
}
}
}
}
function changeColorStyleInChildren(sheetName, colorStyle, newValue) {
var _local6 = getTimer();
var _local7;
for (_local7 in this) {
var _local2 = this[_local7];
if (_local2._parent == this) {
if (_local2.searchKey != _local6) {
if (((_local2.getStyleName() == sheetName) || (sheetName == undefined)) || (sheetName == "_global")) {
if (_local2.stylecache != undefined) {
delete _local2.stylecache[colorStyle];
}
if (typeof(_local2._color) == "string") {
if (_local2._color == colorStyle) {
var _local4 = _local2.getStyle(colorStyle);
if (colorStyle == "color") {
if (stylecache.tf.color != undefined) {
stylecache.tf.color = _local4;
}
}
_local2.setColor(_local4);
}
} else if (_local2._color[colorStyle] != undefined) {
if (typeof(_local2) != "movieclip") {
_local2._parent.invalidateStyle();
} else {
_local2.invalidateStyle(colorStyle);
}
}
}
_local2.changeColorStyleInChildren(sheetName, colorStyle, newValue);
_local2.searchKey = _local6;
}
}
}
}
function notifyStyleChangeInChildren(sheetName, styleProp, newValue) {
var _local5 = getTimer();
var _local6;
for (_local6 in this) {
var _local2 = this[_local6];
if (_local2._parent == this) {
if (_local2.searchKey != _local5) {
if (((_local2.styleName == sheetName) || ((_local2.styleName != undefined) && (typeof(_local2.styleName) == "movieclip"))) || (sheetName == undefined)) {
if (_local2.stylecache != undefined) {
delete _local2.stylecache[styleProp];
delete _local2.stylecache.tf;
}
delete _local2.enabledColor;
_local2.invalidateStyle(styleProp);
}
_local2.notifyStyleChangeInChildren(sheetName, styleProp, newValue);
_local2.searchKey = _local5;
}
}
}
}
function setStyle(styleProp, newValue) {
if (stylecache != undefined) {
delete stylecache[styleProp];
delete stylecache.tf;
}
this[styleProp] = newValue;
if (mx.styles.StyleManager.isColorStyle(styleProp)) {
if (isNaN(newValue)) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
if (styleProp == "themeColor") {
var _local10 = mx.styles.StyleManager.colorNames.haloBlue;
var _local9 = mx.styles.StyleManager.colorNames.haloGreen;
var _local11 = mx.styles.StyleManager.colorNames.haloOrange;
var _local6 = {};
_local6[_local10] = 12188666 /* 0xB9FBFA */;
_local6[_local9] = 13500353 /* 0xCDFFC1 */;
_local6[_local11] = 16766319 /* 0xFFD56F */;
var _local7 = {};
_local7[_local10] = 13958653 /* 0xD4FDFD */;
_local7[_local9] = 14942166 /* 0xE3FFD6 */;
_local7[_local11] = 16772787 /* 0xFFEEB3 */;
var _local12 = _local6[newValue];
var _local13 = _local7[newValue];
if (_local12 == undefined) {
_local12 = newValue;
}
if (_local13 == undefined) {
_local13 = newValue;
}
setStyle("selectionColor", _local12);
setStyle("rollOverColor", _local13);
}
if (typeof(_color) == "string") {
if (_color == styleProp) {
if (styleProp == "color") {
if (stylecache.tf.color != undefined) {
stylecache.tf.color = newValue;
}
}
setColor(newValue);
}
} else if (_color[styleProp] != undefined) {
invalidateStyle(styleProp);
}
changeColorStyleInChildren(undefined, styleProp, newValue);
} else {
if ((styleProp == "backgroundColor") && (isNaN(newValue))) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
invalidateStyle(styleProp);
}
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (styleProp == "styleName")) {
var _local8;
var _local5 = newValue;
if (styleProp == "styleName") {
_local8 = ((typeof(newValue) == "string") ? (_global.styles[newValue]) : (_local5));
_local5 = _local8.themeColor;
if (_local5 != undefined) {
_local8.rollOverColor = (_local8.selectionColor = _local5);
}
}
notifyStyleChangeInChildren(undefined, styleProp, newValue);
}
}
static function enableRunTimeCSS() {
}
static function classConstruct() {
var _local2 = MovieClip.prototype;
var _local3 = mx.styles.CSSSetStyle.prototype;
mx.styles.CSSStyleDeclaration.prototype.setStyle = _local3._setStyle;
_local2.changeTextStyleInChildren = _local3.changeTextStyleInChildren;
_local2.changeColorStyleInChildren = _local3.changeColorStyleInChildren;
_local2.notifyStyleChangeInChildren = _local3.notifyStyleChangeInChildren;
_local2.setStyle = _local3.setStyle;
_global.ASSetPropFlags(_local2, "changeTextStyleInChildren", 1);
_global.ASSetPropFlags(_local2, "changeColorStyleInChildren", 1);
_global.ASSetPropFlags(_local2, "notifyStyleChangeInChildren", 1);
_global.ASSetPropFlags(_local2, "setStyle", 1);
var _local4 = TextField.prototype;
_local4.setStyle = _local2.setStyle;
_local4.changeTextStyleInChildren = _local3.changeTextStyleInChildren;
return(true);
}
static var classConstructed = classConstruct();
static var CSSStyleDeclarationDependency = mx.styles.CSSStyleDeclaration;
}
Symbol 67 MovieClip [__Packages.mx.core.ext.UIComponentExtensions] Frame 0
class mx.core.ext.UIComponentExtensions
{
function UIComponentExtensions () {
}
static function Extensions() {
if (bExtended == true) {
return(true);
}
bExtended = true;
TextField.prototype.setFocus = function () {
Selection.setFocus(this);
};
TextField.prototype.onSetFocus = function (oldFocus) {
if (this.tabEnabled != false) {
if (this.getFocusManager().bDrawFocus) {
this.drawFocus(true);
}
}
};
TextField.prototype.onKillFocus = function (oldFocus) {
if (this.tabEnabled != false) {
this.drawFocus(false);
}
};
TextField.prototype.drawFocus = mx.core.UIComponent.prototype.drawFocus;
TextField.prototype.getFocusManager = mx.core.UIComponent.prototype.getFocusManager;
mx.managers.OverlappedWindows.enableOverlappedWindows();
mx.styles.CSSSetStyle.enableRunTimeCSS();
mx.managers.FocusManager.enableFocusManagement();
}
static var bExtended = false;
static var UIComponentExtended = Extensions();
static var UIComponentDependency = mx.core.UIComponent;
static var FocusManagerDependency = mx.managers.FocusManager;
static var OverlappedWindowsDependency = mx.managers.OverlappedWindows;
}
Symbol 68 MovieClip [__Packages.mx.skins.Border] Frame 0
class mx.skins.Border extends mx.core.UIObject
{
function Border () {
super();
}
function init(Void) {
super.init();
}
static var symbolName = "Border";
static var symbolOwner = mx.skins.Border;
var className = "Border";
var tagBorder = 0;
var idNames = new Array("border_mc");
}
Symbol 69 MovieClip [__Packages.mx.skins.RectBorder] Frame 0
class mx.skins.RectBorder extends mx.skins.Border
{
var __width, __height, offset, __borderMetrics;
function RectBorder () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function init(Void) {
super.init();
}
function draw(Void) {
size();
}
function getBorderMetrics(Void) {
var _local2 = offset;
if (__borderMetrics == undefined) {
__borderMetrics = {left:_local2, top:_local2, right:_local2, bottom:_local2};
} else {
__borderMetrics.left = _local2;
__borderMetrics.top = _local2;
__borderMetrics.right = _local2;
__borderMetrics.bottom = _local2;
}
return(__borderMetrics);
}
function get borderMetrics() {
return(getBorderMetrics());
}
function drawBorder(Void) {
}
function size(Void) {
drawBorder();
}
function setColor(Void) {
drawBorder();
}
static var symbolName = "RectBorder";
static var symbolOwner = mx.skins.RectBorder;
static var version = "2.0.2.127";
var className = "RectBorder";
var borderStyleName = "borderStyle";
var borderColorName = "borderColor";
var shadowColorName = "shadowColor";
var highlightColorName = "highlightColor";
var buttonColorName = "buttonColor";
var backgroundColorName = "backgroundColor";
}
Symbol 70 MovieClip [__Packages.mx.skins.halo.RectBorder] Frame 0
class mx.skins.halo.RectBorder extends mx.skins.RectBorder
{
var offset, getStyle, borderStyleName, __borderMetrics, className, borderColorName, backgroundColorName, shadowColorName, highlightColorName, buttonColorName, __get__width, __get__height, clear, _color, drawRoundRect, beginFill, drawRect, endFill;
function RectBorder () {
super();
}
function init(Void) {
borderWidths.default = 3;
super.init();
}
function getBorderMetrics(Void) {
if (offset == undefined) {
var _local3 = getStyle(borderStyleName);
offset = borderWidths[_local3];
}
if ((getStyle(borderStyleName) == "default") || (getStyle(borderStyleName) == "alert")) {
__borderMetrics = {left:3, top:1, right:3, bottom:3};
return(__borderMetrics);
}
return(super.getBorderMetrics());
}
function drawBorder(Void) {
var _local6 = _global.styles[className];
if (_local6 == undefined) {
_local6 = _global.styles.RectBorder;
}
var _local5 = getStyle(borderStyleName);
var _local7 = getStyle(borderColorName);
if (_local7 == undefined) {
_local7 = _local6[borderColorName];
}
var _local8 = getStyle(backgroundColorName);
if (_local8 == undefined) {
_local8 = _local6[backgroundColorName];
}
var _local16 = getStyle("backgroundImage");
if (_local5 != "none") {
var _local14 = getStyle(shadowColorName);
if (_local14 == undefined) {
_local14 = _local6[shadowColorName];
}
var _local13 = getStyle(highlightColorName);
if (_local13 == undefined) {
_local13 = _local6[highlightColorName];
}
var _local12 = getStyle(buttonColorName);
if (_local12 == undefined) {
_local12 = _local6[buttonColorName];
}
var _local11 = getStyle(borderCapColorName);
if (_local11 == undefined) {
_local11 = _local6[borderCapColorName];
}
var _local10 = getStyle(shadowCapColorName);
if (_local10 == undefined) {
_local10 = _local6[shadowCapColorName];
}
}
offset = borderWidths[_local5];
var _local9 = offset;
var _local3 = __get__width();
var _local4 = __get__height();
clear();
_color = undefined;
if (_local5 == "none") {
} else if (_local5 == "inset") {
_color = colorList;
draw3dBorder(_local11, _local12, _local7, _local13, _local14, _local10);
} else if (_local5 == "outset") {
_color = colorList;
draw3dBorder(_local11, _local7, _local12, _local14, _local13, _local10);
} else if (_local5 == "alert") {
var _local15 = getStyle("themeColor");
drawRoundRect(0, 5, _local3, _local4 - 5, 5, 6184542, 10);
drawRoundRect(1, 4, _local3 - 2, _local4 - 5, 4, [6184542, 6184542], 10, 0, "radial");
drawRoundRect(2, 0, _local3 - 4, _local4 - 2, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(2, 0, _local3 - 4, _local4 - 2, 3, _local15, 50);
drawRoundRect(3, 1, _local3 - 6, _local4 - 4, 2, 16777215, 100);
} else if (_local5 == "default") {
drawRoundRect(0, 5, _local3, _local4 - 5, {tl:5, tr:5, br:0, bl:0}, 6184542, 10);
drawRoundRect(1, 4, _local3 - 2, _local4 - 5, {tl:4, tr:4, br:0, bl:0}, [6184542, 6184542], 10, 0, "radial");
drawRoundRect(2, 0, _local3 - 4, _local4 - 2, {tl:3, tr:3, br:0, bl:0}, [12897484, 11844796], 100, 0, "radial");
drawRoundRect(3, 1, _local3 - 6, _local4 - 4, {tl:2, tr:2, br:0, bl:0}, 16777215, 100);
} else if (_local5 == "dropDown") {
drawRoundRect(0, 0, _local3 + 1, _local4, {tl:4, tr:0, br:0, bl:4}, [13290186, 7895160], 100, -10, "linear");
drawRoundRect(1, 1, _local3 - 1, _local4 - 2, {tl:3, tr:0, br:0, bl:3}, 16777215, 100);
} else if (_local5 == "menuBorder") {
var _local15 = getStyle("themeColor");
drawRoundRect(4, 4, _local3 - 2, _local4 - 3, 0, [6184542, 6184542], 10, 0, "radial");
drawRoundRect(4, 4, _local3 - 1, _local4 - 2, 0, 6184542, 10);
drawRoundRect(0, 0, _local3 + 1, _local4, 0, [0, 14342874], 100, 250, "linear");
drawRoundRect(0, 0, _local3 + 1, _local4, 0, _local15, 50);
drawRoundRect(2, 2, _local3 - 3, _local4 - 4, 0, 16777215, 100);
} else if (_local5 == "comboNonEdit") {
} else {
beginFill(_local7);
drawRect(0, 0, _local3, _local4);
drawRect(1, 1, _local3 - 1, _local4 - 1);
endFill();
_color = borderColorName;
}
if (_local8 != undefined) {
beginFill(_local8);
drawRect(_local9, _local9, __get__width() - _local9, __get__height() - _local9);
endFill();
}
}
function draw3dBorder(c1, c2, c3, c4, c5, c6) {
var _local3 = __get__width();
var _local2 = __get__height();
beginFill(c1);
drawRect(0, 0, _local3, _local2);
drawRect(1, 0, _local3 - 1, _local2);
endFill();
beginFill(c2);
drawRect(1, 0, _local3 - 1, 1);
endFill();
beginFill(c3);
drawRect(1, _local2 - 1, _local3 - 1, _local2);
endFill();
beginFill(c4);
drawRect(1, 1, _local3 - 1, 2);
endFill();
beginFill(c5);
drawRect(1, _local2 - 2, _local3 - 1, _local2 - 1);
endFill();
beginFill(c6);
drawRect(1, 2, _local3 - 1, _local2 - 2);
drawRect(2, 2, _local3 - 2, _local2 - 2);
endFill();
}
static function classConstruct() {
mx.core.ext.UIObjectExtensions.Extensions();
_global.styles.rectBorderClass = mx.skins.halo.RectBorder;
_global.skinRegistry.RectBorder = true;
return(true);
}
static var symbolName = "RectBorder";
static var symbolOwner = mx.skins.halo.RectBorder;
static var version = "2.0.2.127";
var borderCapColorName = "borderCapColor";
var shadowCapColorName = "shadowCapColor";
var colorList = {highlightColor:0, borderColor:0, buttonColor:0, shadowColor:0, borderCapColor:0, shadowCapColor:0};
var borderWidths = {none:0, solid:1, inset:2, outset:2, alert:3, dropDown:2, menuBorder:2, comboNonEdit:2};
static var classConstructed = classConstruct();
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
}
Symbol 71 MovieClip [__Packages.mx.skins.halo.ButtonSkin] Frame 0
class mx.skins.halo.ButtonSkin extends mx.skins.RectBorder
{
var __get__width, __get__height, getStyle, _parent, clear, drawRoundRect, __get__x, __get__y;
function ButtonSkin () {
super();
}
function init() {
super.init();
}
function size() {
drawHaloRect(__get__width(), __get__height());
}
function drawHaloRect(w, h) {
var _local6 = getStyle("borderStyle");
var _local4 = getStyle("themeColor");
var _local5 = _parent.emphasized;
clear();
switch (_local6) {
case "falseup" :
if (_local5) {
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 75);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16777215], 85, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, _local4, 75);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16316664, 100);
} else {
drawRoundRect(0, 0, w, h, 5, 9542041, 100);
drawRoundRect(1, 1, w - 2, h - 2, 4, [13291985, 16250871], 100, 0, "radial");
drawRoundRect(2, 2, w - 4, h - 4, 3, [9542041, 13818586], 100, 0, "radial");
drawRoundRect(3, 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(3, 4, w - 6, h - 7, 2, 16316664, 100);
}
break;
case "falsedown" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16579836], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 50);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, _local4, 20);
break;
case "falserollover" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 50);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16777215], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, _local4, 50);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16316664, 100);
break;
case "falsedisabled" :
drawRoundRect(0, 0, w, h, 5, 13159628, 100);
drawRoundRect(1, 1, w - 2, h - 2, 4, 15921906, 100);
drawRoundRect(2, 2, w - 4, h - 4, 3, 13949401, 100);
drawRoundRect(3, 3, w - 6, h - 6, 2, 15921906, 100);
break;
case "trueup" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 10066329, 100);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16579836], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 50);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16250871, 100);
break;
case "truedown" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 10066329, 100);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16579836], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 50);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, _local4, 20);
break;
case "truerollover" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 50);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16777215], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 40);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16316664, 100);
break;
case "truedisabled" :
drawRoundRect(0, 0, w, h, 5, 13159628, 100);
drawRoundRect(1, 1, w - 2, h - 2, 4, 15921906, 100);
drawRoundRect(2, 2, w - 4, h - 4, 3, 13949401, 100);
drawRoundRect(3, 3, w - 6, h - 6, 2, 15921906, 100);
}
}
static function classConstruct() {
mx.core.ext.UIObjectExtensions.Extensions();
_global.skinRegistry.ButtonSkin = true;
return(true);
}
static var symbolName = "ButtonSkin";
static var symbolOwner = mx.skins.halo.ButtonSkin;
var className = "ButtonSkin";
var backgroundColorName = "buttonColor";
static var classConstructed = classConstruct();
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
}
Symbol 855 MovieClip [__Packages.mx.controls.CheckBox] Frame 0
class mx.controls.CheckBox extends mx.controls.Button
{
var _getTextFormat, labelPath, iconName;
function CheckBox () {
super();
}
function onRelease() {
super.onRelease();
}
function init() {
super.init();
}
function size() {
super.size();
}
function get emphasized() {
return(undefined);
}
function calcPreferredHeight() {
var _local5 = _getTextFormat();
var _local3 = _local5.getTextExtent2(labelPath.text).height;
var _local4 = iconName._height;
var _local2 = 0;
if ((__labelPlacement == "left") || (__labelPlacement == "right")) {
_local2 = Math.max(_local3, _local4);
} else {
_local2 = _local3 + _local4;
}
return(Math.max(14, _local2));
}
function set toggle(v) {
//return(toggle);
}
function get toggle() {
}
function set icon(v) {
//return(icon);
}
function get icon() {
}
static var symbolName = "CheckBox";
static var symbolOwner = mx.controls.CheckBox;
static var version = "2.0.2.126";
var className = "CheckBox";
var ignoreClassStyleDeclaration = {Button:1};
var btnOffset = 0;
var __toggle = true;
var __selected = false;
var __labelPlacement = "right";
var __label = "CheckBox";
var falseUpSkin = "";
var falseDownSkin = "";
var falseOverSkin = "";
var falseDisabledSkin = "";
var trueUpSkin = "";
var trueDownSkin = "";
var trueOverSkin = "";
var trueDisabledSkin = "";
var falseUpIcon = "CheckFalseUp";
var falseDownIcon = "CheckFalseDown";
var falseOverIcon = "CheckFalseOver";
var falseDisabledIcon = "CheckFalseDisabled";
var trueUpIcon = "CheckTrueUp";
var trueDownIcon = "CheckTrueDown";
var trueOverIcon = "CheckTrueOver";
var trueDisabledIcon = "CheckTrueDisabled";
var clipParameters = {label:1, labelPlacement:1, selected:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.CheckBox.prototype.clipParameters, mx.controls.Button.prototype.clipParameters);
var centerContent = false;
var borderW = 0;
}
Symbol 872 MovieClip [__Packages.mx.controls.listclasses.DataSelector] Frame 0
class mx.controls.listclasses.DataSelector extends Object
{
var __vPosition, setVPosition, __dataProvider, enabled, lastSelID, lastSelected, selected, invUpdateControl, invalidate, multipleSelection, updateControl, __rowCount, rows;
function DataSelector () {
super();
}
static function Initialize(obj) {
var _local3 = mixinProps;
var _local4 = _local3.length;
obj = obj.prototype;
var _local1 = 0;
while (_local1 < _local4) {
obj[_local3[_local1]] = mixins[_local3[_local1]];
_local1++;
}
mixins.createProp(obj, "dataProvider", true);
mixins.createProp(obj, "length", false);
mixins.createProp(obj, "value", false);
mixins.createProp(obj, "selectedIndex", true);
mixins.createProp(obj, "selectedIndices", true);
mixins.createProp(obj, "selectedItems", false);
mixins.createProp(obj, "selectedItem", true);
return(true);
}
function createProp(obj, propName, setter) {
var p = (propName.charAt(0).toUpperCase() + propName.substr(1));
var _local2 = null;
var _local4 = function (Void) {
return(this["get" + p]());
};
if (setter) {
_local2 = function (val) {
this["set" + p](val);
};
}
obj.addProperty(propName, _local4, _local2);
}
function setDataProvider(dP) {
if (__vPosition != 0) {
setVPosition(0);
}
clearSelected();
__dataProvider.removeEventListener(this);
__dataProvider = dP;
dP.addEventListener("modelChanged", this);
dP.addView(this);
modelChanged({eventName:"updateAll"});
}
function getDataProvider(Void) {
return(__dataProvider);
}
function addItemAt(index, label, data) {
if ((index < 0) || (!enabled)) {
return(undefined);
}
var _local2 = __dataProvider;
if (_local2 == undefined) {
_local2 = (__dataProvider = new Array());
_local2.addEventListener("modelChanged", this);
index = 0;
}
if ((typeof(label) == "object") || (typeof(_local2.getItemAt(0)) == "string")) {
_local2.addItemAt(index, label);
} else {
_local2.addItemAt(index, {label:label, data:data});
}
}
function addItem(label, data) {
addItemAt(__dataProvider.length, label, data);
}
function removeItemAt(index) {
return(__dataProvider.removeItemAt(index));
}
function removeAll(Void) {
__dataProvider.removeAll();
}
function replaceItemAt(index, newLabel, newData) {
if (typeof(newLabel) == "object") {
__dataProvider.replaceItemAt(index, newLabel);
} else {
__dataProvider.replaceItemAt(index, {label:newLabel, data:newData});
}
}
function sortItemsBy(fieldName, order) {
lastSelID = __dataProvider.getItemID(lastSelected);
__dataProvider.sortItemsBy(fieldName, order);
}
function sortItems(compareFunc, order) {
lastSelID = __dataProvider.getItemID(lastSelected);
__dataProvider.sortItems(compareFunc, order);
}
function getLength(Void) {
return(__dataProvider.length);
}
function getItemAt(index) {
return(__dataProvider.getItemAt(index));
}
function modelChanged(eventObj) {
var _local3 = eventObj.firstItem;
var _local6 = eventObj.lastItem;
var _local7 = eventObj.eventName;
if (_local7 == undefined) {
_local7 = eventObj.event;
_local3 = eventObj.firstRow;
_local6 = eventObj.lastRow;
if (_local7 == "addRows") {
_local7 = (eventObj.eventName = "addItems");
} else if (_local7 == "deleteRows") {
_local7 = (eventObj.eventName = "removeItems");
} else if (_local7 == "updateRows") {
_local7 = (eventObj.eventName = "updateItems");
}
}
if (_local7 == "addItems") {
for (var _local2 in selected) {
var _local5 = selected[_local2];
if ((_local5 != undefined) && (_local5 >= _local3)) {
selected[_local2] = selected[_local2] + ((_local6 - _local3) + 1);
}
}
} else if (_local7 == "removeItems") {
if (__dataProvider.length == 0) {
delete selected;
} else {
var _local9 = eventObj.removedIDs;
var _local10 = _local9.length;
var _local2 = 0;
while (_local2 < _local10) {
var _local4 = _local9[_local2];
if (selected[_local4] != undefined) {
delete selected[_local4];
}
_local2++;
}
for (_local2 in selected) {
if (selected[_local2] >= _local3) {
selected[_local2] = selected[_local2] - ((_local6 - _local3) + 1);
}
}
}
} else if (_local7 == "sort") {
if (typeof(__dataProvider.getItemAt(0)) != "object") {
delete selected;
} else {
var _local10 = __dataProvider.length;
var _local2 = 0;
while (_local2 < _local10) {
if (isSelected(_local2)) {
var _local4 = __dataProvider.getItemID(_local2);
if (_local4 == lastSelID) {
lastSelected = _local2;
}
selected[_local4] = _local2;
}
_local2++;
}
}
} else if (_local7 == "filterModel") {
setVPosition(0);
}
invUpdateControl = true;
invalidate();
}
function getValue(Void) {
var _local2 = getSelectedItem();
if (typeof(_local2) != "object") {
return(_local2);
}
return(((_local2.data == undefined) ? (_local2.label) : (_local2.data)));
}
function getSelectedIndex(Void) {
for (var _local3 in selected) {
var _local2 = selected[_local3];
if (_local2 != undefined) {
return(_local2);
}
}
}
function setSelectedIndex(index) {
if (((index >= 0) && (index < __dataProvider.length)) && (enabled)) {
delete selected;
selectItem(index, true);
lastSelected = index;
invUpdateControl = true;
invalidate();
} else if (index == undefined) {
clearSelected();
}
}
function getSelectedIndices(Void) {
var _local2 = new Array();
for (var _local3 in selected) {
_local2.push(selected[_local3]);
}
_local2.reverse();
return(((_local2.length > 0) ? (_local2) : undefined));
}
function setSelectedIndices(indexArray) {
if (multipleSelection != true) {
return(undefined);
}
delete selected;
var _local3 = 0;
while (_local3 < indexArray.length) {
var _local2 = indexArray[_local3];
if ((_local2 >= 0) && (_local2 < __dataProvider.length)) {
selectItem(_local2, true);
}
_local3++;
}
invUpdateControl = true;
updateControl();
}
function getSelectedItems(Void) {
var _local3 = getSelectedIndices();
var _local4 = new Array();
var _local2 = 0;
while (_local2 < _local3.length) {
_local4.push(getItemAt(_local3[_local2]));
_local2++;
}
return(((_local4.length > 0) ? (_local4) : undefined));
}
function getSelectedItem(Void) {
return(__dataProvider.getItemAt(getSelectedIndex()));
}
function selectItem(index, selectedFlag) {
if (selected == undefined) {
selected = new Object();
}
var _local2 = __dataProvider.getItemID(index);
if (_local2 == undefined) {
return(undefined);
}
if (selectedFlag && (!isSelected(index))) {
selected[_local2] = index;
} else if (!selectedFlag) {
delete selected[_local2];
}
}
function isSelected(index) {
var _local2 = __dataProvider.getItemID(index);
if (_local2 == undefined) {
return(false);
}
return(selected[_local2] != undefined);
}
function clearSelected(transition) {
var _local3 = 0;
for (var _local4 in selected) {
var _local2 = selected[_local4];
if (((_local2 != undefined) && (__vPosition <= _local2)) && (_local2 < (__vPosition + __rowCount))) {
rows[_local2 - __vPosition].drawRow(rows[_local2 - __vPosition].item, "normal", transition && ((_local3 % 3) == 0));
}
_local3++;
}
delete selected;
}
static var mixins = new mx.controls.listclasses.DataSelector();
static var mixinProps = ["setDataProvider", "getDataProvider", "addItem", "addItemAt", "removeAll", "removeItemAt", "replaceItemAt", "sortItemsBy", "sortItems", "getLength", "getItemAt", "modelChanged", "calcPreferredWidthFromData", "calcPreferredHeightFromData", "getValue", "getSelectedIndex", "getSelectedItem", "getSelectedIndices", "getSelectedItems", "selectItem", "isSelected", "clearSelected", "setSelectedIndex", "setSelectedIndices"];
}
Symbol 873 MovieClip [__Packages.mx.controls.ComboBase] Frame 0
class mx.controls.ComboBase extends mx.core.UIComponent
{
var getValue, tabEnabled, tabChildren, boundingBox_mc, downArrow_mc, createClassObject, onDownArrow, border_mc, __border, text_mc, focusTextField, __width, __height, getFocusManager, __get__height, height, _parent;
function ComboBase () {
super();
getValue = _getValue;
}
function init() {
super.init();
tabEnabled = !_editable;
tabChildren = _editable;
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
function createChildren() {
var _local3 = new Object();
_local3.styleName = this;
if (downArrow_mc == undefined) {
_local3.falseUpSkin = downArrowUpName;
_local3.falseOverSkin = downArrowOverName;
_local3.falseDownSkin = downArrowDownName;
_local3.falseDisabledSkin = downArrowDisabledName;
_local3.validateNow = true;
_local3.tabEnabled = false;
createClassObject(mx.controls.SimpleButton, "downArrow_mc", 19, _local3);
downArrow_mc.buttonDownHandler = onDownArrow;
downArrow_mc.useHandCursor = false;
downArrow_mc.onPressWas = downArrow_mc.onPress;
downArrow_mc.onPress = function () {
this.trackAsMenuWas = this.trackAsMenu;
this.trackAsMenu = true;
if (!this._editable) {
this._parent.text_mc.trackAsMenu = this.trackAsMenu;
}
this.onPressWas();
};
downArrow_mc.onDragOutWas = downArrow_mc.onDragOut;
downArrow_mc.onDragOut = function () {
this.trackAsMenuWas = this.trackAsMenu;
this.trackAsMenu = false;
if (!this._editable) {
this._parent.text_mc.trackAsMenu = this.trackAsMenu;
}
this.onDragOutWas();
};
downArrow_mc.onDragOverWas = downArrow_mc.onDragOver;
downArrow_mc.onDragOver = function () {
this.trackAsMenu = this.trackAsMenuWas;
if (!this._editable) {
this._parent.text_mc.trackAsMenu = this.trackAsMenu;
}
this.onDragOverWas();
};
}
if (border_mc == undefined) {
_local3.tabEnabled = false;
createClassObject(_global.styles.rectBorderClass, "border_mc", 17, _local3);
border_mc.move(0, 0);
__border = border_mc;
}
_local3.borderStyle = "none";
_local3.readOnly = !_editable;
_local3.tabEnabled = _editable;
if (text_mc == undefined) {
createClassObject(mx.controls.TextInput, "text_mc", 18, _local3);
text_mc.move(0, 0);
text_mc.addEnterEvents();
text_mc.enterHandler = _enterHandler;
text_mc.changeHandler = _changeHandler;
text_mc.oldOnSetFocus = text_mc.onSetFocus;
text_mc.onSetFocus = function () {
this.oldOnSetFocus();
this._parent.onSetFocus();
};
text_mc.__set__restrict("^\x1B");
text_mc.oldOnKillFocus = text_mc.onKillFocus;
text_mc.onKillFocus = function (n) {
this.oldOnKillFocus(n);
this._parent.onKillFocus(n);
};
text_mc.drawFocus = function (b) {
this._parent.drawFocus(b);
};
delete text_mc.borderStyle;
}
focusTextField = text_mc;
text_mc.owner = this;
layoutChildren(__width, __height);
}
function onKillFocus() {
super.onKillFocus();
Key.removeListener(text_mc);
getFocusManager().defaultPushButtonEnabled = true;
}
function onSetFocus() {
super.onSetFocus();
getFocusManager().defaultPushButtonEnabled = false;
Key.addListener(text_mc);
}
function setFocus() {
if (_editable) {
Selection.setFocus(text_mc);
} else {
Selection.setFocus(this);
}
}
function setSize(w, h, noEvent) {
super.setSize(w, ((h == undefined) ? (__get__height()) : (h)), noEvent);
}
function setEnabled(enabledFlag) {
super.setEnabled(enabledFlag);
downArrow_mc.enabled = enabledFlag;
text_mc.enabled = enabledFlag;
}
function setEditable(e) {
_editable = e;
if (wrapDownArrowButton == false) {
if (e) {
border_mc.borderStyle = "inset";
text_mc.borderStyle = "inset";
symbolName = "ComboBox";
invalidateStyle();
} else {
border_mc.borderStyle = "comboNonEdit";
text_mc.borderStyle = "dropDown";
symbolName = "DropDown";
invalidateStyle();
}
}
tabEnabled = !e;
tabChildren = e;
text_mc.tabEnabled = e;
if (e) {
delete text_mc.onPress;
delete text_mc.onRelease;
delete text_mc.onReleaseOutside;
delete text_mc.onDragOut;
delete text_mc.onDragOver;
delete text_mc.onRollOver;
delete text_mc.onRollOut;
} else {
text_mc.onPress = function () {
this._parent.downArrow_mc.onPress();
};
text_mc.onRelease = function () {
this._parent.downArrow_mc.onRelease();
};
text_mc.onReleaseOutside = function () {
this._parent.downArrow_mc.onReleaseOutside();
};
text_mc.onDragOut = function () {
this._parent.downArrow_mc.onDragOut();
};
text_mc.onDragOver = function () {
this._parent.downArrow_mc.onDragOver();
};
text_mc.onRollOver = function () {
this._parent.downArrow_mc.onRollOver();
};
text_mc.onRollOut = function () {
this._parent.downArrow_mc.onRollOut();
};
text_mc.useHandCursor = false;
}
}
function get editable() {
return(_editable);
}
function set editable(e) {
setEditable(e);
//return(editable);
}
function _getValue() {
return((_editable ? (text_mc.getText()) : (DSgetValue())));
}
function draw() {
downArrow_mc.draw();
border_mc.draw();
}
function size() {
layoutChildren(__width, __height);
}
function setTheme(t) {
downArrowUpName = (t + "downArrow") + "Up_mc";
downArrowDownName = (t + "downArrow") + "Down_mc";
downArrowDisabledName = (t + "downArrow") + "Disabled_mc";
}
function get text() {
return(text_mc.getText());
}
function set text(t) {
setText(t);
//return(text);
}
function setText(t) {
text_mc.setText(t);
}
function get textField() {
return(text_mc);
}
function get restrict() {
return(text_mc.__get__restrict());
}
function set restrict(w) {
text_mc.__set__restrict(w);
//return(restrict);
}
function invalidateStyle() {
downArrow_mc.invalidateStyle();
text_mc.invalidateStyle();
border_mc.invalidateStyle();
}
function layoutChildren(w, h) {
if (downArrow_mc == undefined) {
return(undefined);
}
if (wrapDownArrowButton) {
var _local2 = border_mc.__get__borderMetrics();
downArrow_mc._width = (downArrow_mc._height = (h - _local2.top) - _local2.bottom);
downArrow_mc.move((w - downArrow_mc._width) - _local2.right, _local2.top);
border_mc.setSize(w, h);
text_mc.setSize(w - downArrow_mc._width, h);
} else {
downArrow_mc.move(w - downArrow_mc._width, 0);
border_mc.setSize(w - downArrow_mc.width, h);
text_mc.setSize(w - downArrow_mc._width, h);
downArrow_mc._height = height;
}
}
function _changeHandler(obj) {
}
function _enterHandler(obj) {
var _local2 = _parent;
obj.target = _local2;
_local2.dispatchEvent(obj);
}
function get tabIndex() {
return(text_mc.__get__tabIndex());
}
function set tabIndex(w) {
text_mc.__set__tabIndex(w);
//return(tabIndex);
}
static var mixIt1 = mx.controls.listclasses.DataSelector.Initialize(mx.controls.ComboBase);
static var symbolName = "ComboBase";
static var symbolOwner = mx.controls.ComboBase;
static var version = "2.0.2.126";
var _editable = false;
var downArrowUpName = "ScrollDownArrowUp";
var downArrowDownName = "ScrollDownArrowDown";
var downArrowOverName = "ScrollDownArrowOver";
var downArrowDisabledName = "ScrollDownArrowDisabled";
var wrapDownArrowButton = true;
var DSgetValue = mx.controls.listclasses.DataSelector.prototype.getValue;
var multipleSelection = false;
}
Symbol 874 MovieClip [__Packages.mx.controls.ComboBox] Frame 0
class mx.controls.ComboBox extends mx.controls.ComboBase
{
var __set__editable, editable, __labels, data, __dropdownWidth, __width, _editable, selectedIndex, __dropdown, dataProvider, __labelFunction, createObject, border_mc, mask, text_mc, dispatchValueChangedEvent, getValue, length, selectedItem, _y, isPressed, owner, __set__visible, height, localToGlobal, __selectedIndexOnDropdown, __initialSelectedIndexOnDropdown, __get__height, getStyle, _parent, width, __dataProvider, selected, dispatchEvent;
function ComboBox () {
super();
}
function init() {
super.init();
}
function createChildren() {
super.createChildren();
__set__editable(editable);
if (__labels.length > 0) {
var _local6 = new Array();
var _local3 = 0;
while (_local3 < labels.length) {
_local6.addItem({label:labels[_local3], data:data[_local3]});
_local3++;
}
setDataProvider(_local6);
}
dropdownWidth = (((typeof(__dropdownWidth) == "number") ? (__dropdownWidth) : (__width)));
if (!_editable) {
selectedIndex = 0;
}
initializing = false;
}
function onKillFocus(n) {
if (_showingDropdown && (n != null)) {
displayDropdown(false);
}
super.onKillFocus();
}
function getDropdown() {
if (initializing) {
return(undefined);
}
if (!hasDropdown()) {
var _local3 = new Object();
_local3.styleName = this;
if (dropdownBorderStyle != undefined) {
_local3.borderStyle = dropdownBorderStyle;
}
_local3._visible = false;
__dropdown = mx.managers.PopUpManager.createPopUp(this, mx.controls.List, false, _local3, true);
__dropdown.scroller.mask.removeMovieClip();
if (dataProvider == undefined) {
dataProvider = new Array();
}
__dropdown.setDataProvider(dataProvider);
__dropdown.selectMultiple = false;
__dropdown.rowCount = __rowCount;
__dropdown.selectedIndex = selectedIndex;
__dropdown.vScrollPolicy = "auto";
__dropdown.labelField = __labelField;
__dropdown.labelFunction = __labelFunction;
__dropdown.owner = this;
__dropdown.changeHandler = _changeHandler;
__dropdown.scrollHandler = _scrollHandler;
__dropdown.itemRollOverHandler = _itemRollOverHandler;
__dropdown.itemRollOutHandler = _itemRollOutHandler;
__dropdown.resizeHandler = _resizeHandler;
__dropdown.mouseDownOutsideHandler = function (eventObj) {
var _local3 = this.owner;
var _local4 = new Object();
_local4.x = _local3._root._xmouse;
_local4.y = _local3._root._ymouse;
_local3._root.localToGlobal(_local4);
if (_local3.hitTest(_local4.x, _local4.y, false)) {
} else if ((!this.wrapDownArrowButton) && (this.owner.downArrow_mc.hitTest(_root._xmouse, _root._ymouse, false))) {
} else {
_local3.displayDropdown(false);
}
};
__dropdown.onTweenUpdate = function (v) {
this._y = v;
};
__dropdown.setSize(__dropdownWidth, __dropdown.height);
createObject("BoundingBox", "mask", 20);
mask._y = border_mc.height;
mask._width = __dropdownWidth;
mask._height = __dropdown.height;
mask._visible = false;
__dropdown.setMask(mask);
}
return(__dropdown);
}
function setSize(w, h, noEvent) {
super.setSize(w, h, noEvent);
__dropdownWidth = w;
__dropdown.rowHeight = h;
__dropdown.setSize(__dropdownWidth, __dropdown.height);
}
function setEditable(e) {
super.setEditable(e);
if (e) {
text_mc.setText("");
} else {
text_mc.setText(selectedLabel);
}
}
function get labels() {
return(__labels);
}
function set labels(lbls) {
__labels = lbls;
setDataProvider(lbls);
//return(labels);
}
function getLabelField() {
return(__labelField);
}
function get labelField() {
return(getLabelField());
}
function setLabelField(s) {
__dropdown.labelField = (__labelField = s);
text_mc.setText(selectedLabel);
}
function set labelField(s) {
setLabelField(s);
//return(labelField);
}
function getLabelFunction() {
return(__labelFunction);
}
function get labelFunction() {
return(getLabelFunction());
}
function set labelFunction(f) {
__dropdown.labelFunction = (__labelFunction = f);
text_mc.setText(selectedLabel);
//return(labelFunction);
}
function setSelectedItem(v) {
super.setSelectedItem(v);
__dropdown.selectedItem = v;
text_mc.setText(selectedLabel);
}
function setSelectedIndex(v) {
super.setSelectedIndex(v);
__dropdown.selectedIndex = v;
if (v != undefined) {
text_mc.setText(selectedLabel);
}
dispatchValueChangedEvent(getValue());
}
function setRowCount(count) {
if (isNaN(count)) {
return(undefined);
}
__rowCount = count;
__dropdown.setRowCount(count);
}
function get rowCount() {
return(Math.max(1, Math.min(length, __rowCount)));
}
function set rowCount(v) {
setRowCount(v);
//return(rowCount);
}
function setDropdownWidth(w) {
__dropdownWidth = w;
__dropdown.setSize(w, __dropdown.height);
}
function get dropdownWidth() {
return(__dropdownWidth);
}
function set dropdownWidth(v) {
setDropdownWidth(v);
//return(dropdownWidth);
}
function get dropdown() {
return(getDropdown());
}
function setDataProvider(dp) {
super.setDataProvider(dp);
__dropdown.setDataProvider(dp);
if (!_editable) {
selectedIndex = 0;
}
}
function open() {
displayDropdown(true);
}
function close() {
displayDropdown(false);
}
function get selectedLabel() {
var _local2 = selectedItem;
if (_local2 == undefined) {
return("");
}
if (labelFunction != undefined) {
return(labelFunction(_local2));
}
if (typeof(_local2) != "object") {
return(_local2);
}
if (_local2[labelField] != undefined) {
return(_local2[labelField]);
}
if (_local2.label != undefined) {
return(_local2.label);
}
var _local3 = " ";
for (var _local4 in _local2) {
if (_local4 != "__ID__") {
_local3 = (_local2[_local4] + ", ") + _local3;
}
}
_local3 = _local3.substring(0, _local3.length - 3);
return(_local3);
}
function hasDropdown() {
return((__dropdown != undefined) && (__dropdown.valueOf() != undefined));
}
function tweenEndShow(value) {
_y = value;
isPressed = true;
owner.dispatchEvent({type:"open", target:owner});
}
function tweenEndHide(value) {
_y = value;
__set__visible(false);
owner.dispatchEvent({type:"close", target:owner});
}
function displayDropdown(show) {
if (show == _showingDropdown) {
return(undefined);
}
var _local3 = new Object();
_local3.x = 0;
_local3.y = height;
localToGlobal(_local3);
if (show) {
__selectedIndexOnDropdown = selectedIndex;
__initialSelectedIndexOnDropdown = selectedIndex;
getDropdown();
var _local2 = __dropdown;
_local2.isPressed = true;
_local2.rowCount = rowCount;
_local2.visible = show;
_local2._parent.globalToLocal(_local3);
_local2.onTweenEnd = tweenEndShow;
var _local5;
var _local8;
if ((_local3.y + _local2.height) > Stage.height) {
_local5 = _local3.y - __get__height();
_local8 = _local5 - _local2.height;
mask._y = -_local2.height;
} else {
_local5 = _local3.y - _local2.height;
_local8 = _local3.y;
mask._y = border_mc.height;
}
var _local6 = _local2.selectedIndex;
if (_local6 == undefined) {
_local6 = 0;
}
var _local4 = _local2.vPosition;
_local4 = _local6 - 1;
_local4 = Math.min(Math.max(_local4, 0), _local2.length - _local2.rowCount);
_local2.vPosition = _local4;
_local2.move(_local3.x, _local5);
_local2.tween = new mx.effects.Tween(__dropdown, _local5, _local8, getStyle("openDuration"));
} else {
__dropdown._parent.globalToLocal(_local3);
delete __dropdown.dragScrolling;
__dropdown.onTweenEnd = tweenEndHide;
__dropdown.tween = new mx.effects.Tween(__dropdown, __dropdown._y, _local3.y - __dropdown.height, getStyle("openDuration"));
if (__initialSelectedIndexOnDropdown != selectedIndex) {
dispatchChangeEvent(undefined, __initialSelectedIndexOnDropdown, selectedIndex);
}
}
var _local9 = getStyle("openEasing");
if (_local9 != undefined) {
__dropdown.tween.easingEquation = _local9;
}
_showingDropdown = show;
}
function onDownArrow() {
_parent.displayDropdown(!_parent._showingDropdown);
}
function keyDown(e) {
if (e.ctrlKey && (e.code == 40)) {
displayDropdown(true);
} else if (e.ctrlKey && (e.code == 38)) {
displayDropdown(false);
dispatchChangeEvent(undefined, __selectedIndexOnDropdown, selectedIndex);
} else if (e.code == 27) {
displayDropdown(false);
} else if (e.code == 13) {
if (_showingDropdown) {
selectedIndex = __dropdown.selectedIndex;
displayDropdown(false);
}
} else if (((((!_editable) || (e.code == 38)) || (e.code == 40)) || (e.code == 33)) || (e.code == 34)) {
selectedIndex = 0 + selectedIndex;
bInKeyDown = true;
var _local3 = dropdown;
_local3.keyDown(e);
bInKeyDown = false;
selectedIndex = __dropdown.selectedIndex;
}
}
function invalidateStyle(styleProp) {
__dropdown.invalidateStyle(styleProp);
super.invalidateStyle(styleProp);
}
function changeTextStyleInChildren(styleProp) {
if (dropdown.stylecache != undefined) {
delete dropdown.stylecache[styleProp];
delete dropdown.stylecache.tf;
}
__dropdown.changeTextStyleInChildren(styleProp);
super.changeTextStyleInChildren(styleProp);
}
function changeColorStyleInChildren(sheetName, styleProp, newValue) {
if (dropdown.stylecache != undefined) {
delete dropdown.stylecache[styleProp];
delete dropdown.stylecache.tf;
}
__dropdown.changeColorStyleInChildren(sheetName, styleProp, newValue);
super.changeColorStyleInChildren(sheetName, styleProp, newValue);
}
function notifyStyleChangeInChildren(sheetName, styleProp, newValue) {
if (dropdown.stylecache != undefined) {
delete dropdown.stylecache[styleProp];
delete dropdown.stylecache.tf;
}
__dropdown.notifyStyleChangeInChildren(sheetName, styleProp, newValue);
super.notifyStyleChangeInChildren(sheetName, styleProp, newValue);
}
function onUnload() {
__dropdown.removeMovieClip();
}
function _resizeHandler() {
var _local2 = owner;
_local2.mask._width = width;
_local2.mask._height = height;
}
function _changeHandler(obj) {
var _local2 = owner;
var _local3 = _local2.selectedIndex;
obj.target = _local2;
if (this == owner.text_mc) {
_local2.selectedIndex = undefined;
_local2.dispatchChangeEvent(obj, -1, -2);
} else {
_local2.selectedIndex = selectedIndex;
if (!_local2._showingDropdown) {
_local2.dispatchChangeEvent(obj, _local3, _local2.selectedIndex);
} else if (!_local2.bInKeyDown) {
_local2.displayDropdown(false);
}
}
}
function _scrollHandler(obj) {
var _local2 = owner;
obj.target = _local2;
_local2.dispatchEvent(obj);
}
function _itemRollOverHandler(obj) {
var _local2 = owner;
obj.target = _local2;
_local2.dispatchEvent(obj);
}
function _itemRollOutHandler(obj) {
var _local2 = owner;
obj.target = _local2;
_local2.dispatchEvent(obj);
}
function modelChanged(eventObj) {
super.modelChanged(eventObj);
if (0 == __dataProvider.length) {
text_mc.setText("");
delete selected;
} else if ((__dataProvider.length == ((eventObj.lastItem - eventObj.firstItem) + 1)) && (eventObj.eventName == "addItems")) {
selectedIndex = 0;
}
}
function dispatchChangeEvent(obj, prevValue, newValue) {
var _local2;
if (prevValue != newValue) {
if ((obj != undefined) && (obj.type == "change")) {
_local2 = obj;
} else {
_local2 = {type:"change"};
}
dispatchEvent(_local2);
}
}
static var symbolName = "ComboBox";
static var symbolOwner = mx.controls.ComboBox;
static var version = "2.0.2.126";
var clipParameters = {labels:1, data:1, editable:1, rowCount:1, dropdownWidth:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.ComboBox.prototype.clipParameters, mx.controls.ComboBase.prototype.clipParameters);
var className = "ComboBox";
var _showingDropdown = false;
var __rowCount = 5;
var dropdownBorderStyle = undefined;
var initializing = true;
var __labelField = "label";
var bInKeyDown = false;
}
Symbol 958 MovieClip [__Packages.mx.controls.TextInput] Frame 0
class mx.controls.TextInput extends mx.core.UIComponent
{
var owner, enterListener, label, tabChildren, tabEnabled, focusTextField, _color, _parent, border_mc, createClassObject, dispatchValueChangedEvent, __get__width, __get__height, tfx, tfy, tfw, tfh, getStyle, bind, updateModel, _getTextFormat, enabled;
function TextInput () {
super();
}
function addEventListener(event, handler) {
if (event == "enter") {
addEnterEvents();
}
super.addEventListener(event, handler);
}
function enterOnKeyDown() {
if (Key.getAscii() == 13) {
owner.dispatchEvent({type:"enter"});
}
}
function addEnterEvents() {
if (enterListener == undefined) {
enterListener = new Object();
enterListener.owner = this;
enterListener.onKeyDown = enterOnKeyDown;
}
}
function init(Void) {
super.init();
label.styleName = this;
tabChildren = true;
tabEnabled = false;
focusTextField = label;
_color = mx.core.UIObject.textColorList;
label.onSetFocus = function () {
this._parent.onSetFocus();
};
label.onKillFocus = function (n) {
this._parent.onKillFocus(n);
};
label.drawFocus = function (b) {
this._parent.drawFocus(b);
};
label.onChanged = onLabelChanged;
}
function setFocus() {
Selection.setFocus(label);
}
function onLabelChanged(Void) {
_parent.dispatchEvent({type:"change"});
_parent.dispatchValueChangedEvent(text);
}
function createChildren(Void) {
super.createChildren();
if (border_mc == undefined) {
createClassObject(_global.styles.rectBorderClass, "border_mc", 0, {styleName:this});
}
border_mc.swapDepths(label);
label.autoSize = "none";
}
function get html() {
return(getHtml());
}
function set html(value) {
setHtml(value);
//return(html);
}
function getHtml() {
return(label.html);
}
function setHtml(value) {
if (value != label.html) {
label.html = value;
}
}
function get text() {
return(getText());
}
function set text(t) {
setText(t);
//return(text);
}
function getText() {
if (initializing) {
return(initText);
}
if (label.html == true) {
return(label.htmlText);
}
return(label.text);
}
function setText(t) {
if (initializing) {
initText = t;
} else {
var _local2 = label;
if (_local2.html == true) {
_local2.htmlText = t;
} else {
_local2.text = t;
}
}
dispatchValueChangedEvent(t);
}
function size(Void) {
border_mc.setSize(__get__width(), __get__height());
var _local2 = border_mc.__get__borderMetrics();
var _local6 = _local2.left + _local2.right;
var _local3 = _local2.top + _local2.bottom;
var _local5 = _local2.left;
var _local4 = _local2.top;
tfx = _local5;
tfy = _local4;
tfw = __get__width() - _local6;
tfh = __get__height() - _local3;
label.move(tfx, tfy);
label.setSize(tfw, tfh + 1);
}
function setEnabled(enable) {
label.type = (((__editable == true) || (enable == false)) ? "input" : "dynamic");
label.selectable = enable;
var _local2 = getStyle((enable ? "color" : "disabledColor"));
if (_local2 == undefined) {
_local2 = (enable ? 0 : 8947848);
}
setColor(_local2);
}
function setColor(col) {
label.textColor = col;
}
function onKillFocus(newFocus) {
if (enterListener != undefined) {
Key.removeListener(enterListener);
}
if (bind != undefined) {
updateModel(text);
}
super.onKillFocus(newFocus);
}
function onSetFocus(oldFocus) {
var f = Selection.getFocus();
var o = eval (f);
if (o != label) {
Selection.setFocus(label);
return(undefined);
}
if (enterListener != undefined) {
Key.addListener(enterListener);
}
super.onSetFocus(oldFocus);
}
function draw(Void) {
var _local2 = label;
var _local4 = getText();
if (initializing) {
initializing = false;
delete initText;
}
var _local3 = _getTextFormat();
_local2.embedFonts = _local3.embedFonts == true;
if (_local3 != undefined) {
_local2.setTextFormat(_local3);
_local2.setNewTextFormat(_local3);
}
_local2.multiline = false;
_local2.wordWrap = false;
if (_local2.html == true) {
_local2.setTextFormat(_local3);
_local2.htmlText = _local4;
} else {
_local2.text = _local4;
}
_local2.type = (((__editable == true) || (enabled == false)) ? "input" : "dynamic");
size();
}
function setEditable(s) {
__editable = s;
label.type = (s ? "input" : "dynamic");
}
function get maxChars() {
return(label.maxChars);
}
function set maxChars(w) {
label.maxChars = w;
//return(maxChars);
}
function get length() {
return(label.length);
}
function get restrict() {
return(label.restrict);
}
function set restrict(w) {
label.restrict = ((w == "") ? null : (w));
//return(restrict);
}
function get hPosition() {
return(label.hscroll);
}
function set hPosition(w) {
label.hscroll = w;
//return(hPosition);
}
function get maxHPosition() {
return(label.maxhscroll);
}
function get editable() {
return(__editable);
}
function set editable(w) {
setEditable(w);
//return(editable);
}
function get password() {
return(label.password);
}
function set password(w) {
label.password = w;
//return(password);
}
function get tabIndex() {
return(label.tabIndex);
}
function set tabIndex(w) {
label.tabIndex = w;
//return(tabIndex);
}
function set _accProps(val) {
label._accProps = val;
//return(_accProps);
}
function get _accProps() {
return(label._accProps);
}
static var symbolName = "TextInput";
static var symbolOwner = mx.controls.TextInput;
static var version = "2.0.2.126";
var className = "TextInput";
var initializing = true;
var clipParameters = {text:1, editable:1, password:1, maxChars:1, restrict:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.TextInput.prototype.clipParameters, mx.core.UIComponent.prototype.clipParameters);
var _maxWidth = mx.core.UIComponent.kStretch;
var __editable = true;
var initText = "";
}
Symbol 959 MovieClip [__Packages.mx.managers.PopUpManager] Frame 0
class mx.managers.PopUpManager
{
var popUp, setSize, move, modalWindow, _parent, _name, _visible, owner;
function PopUpManager () {
}
static function createModalWindow(parent, o, broadcastOutsideEvents) {
var _local2 = parent.createChildAtDepth("Modal", mx.managers.DepthManager.kTopmost);
_local2.setDepthBelow(o);
o.modalID = _local2._name;
_local2._alpha = _global.style.modalTransparency;
_local2.tabEnabled = false;
if (broadcastOutsideEvents) {
_local2.onPress = mixins.onPress;
} else {
_local2.onPress = mixins.nullFunction;
}
_local2.onRelease = mixins.nullFunction;
_local2.resize = mixins.resize;
mx.managers.SystemManager.init();
mx.managers.SystemManager.addEventListener("resize", _local2);
_local2.resize();
_local2.useHandCursor = false;
_local2.popUp = o;
o.modalWindow = _local2;
o.deletePopUp = mixins.deletePopUp;
o.setVisible = mixins.setVisible;
o.getVisible = mixins.getVisible;
o.addProperty("visible", o.getVisible, o.setVisible);
}
static function createPopUp(parent, className, modal, initobj, broadcastOutsideEvents) {
if (mixins == undefined) {
mixins = new mx.managers.PopUpManager();
}
if (broadcastOutsideEvents == undefined) {
broadcastOutsideEvents = false;
}
var _local5 = parent._root;
if (_local5 == undefined) {
_local5 = _root;
}
while (parent != _local5) {
parent = parent._parent;
}
initobj.popUp = true;
var _local4 = parent.createClassChildAtDepth(className, ((broadcastOutsideEvents || (modal)) ? (mx.managers.DepthManager.kTopmost) : (mx.managers.DepthManager.kTop)), initobj);
var _local2 = _root;
var _local6 = _local2.focusManager != undefined;
while (_local2._parent != undefined) {
_local2 = _local2._parent._root;
if (_local2.focusManager != undefined) {
_local6 = true;
break;
}
}
if (_local6) {
_local4.createObject("FocusManager", "focusManager", -1);
if (_local4._visible == false) {
mx.managers.SystemManager.deactivate(_local4);
}
}
if (modal) {
createModalWindow(parent, _local4, broadcastOutsideEvents);
} else {
if (broadcastOutsideEvents) {
_local4.mouseListener = new Object();
_local4.mouseListener.owner = _local4;
_local4.mouseListener.onMouseDown = mixins.onMouseDown;
Mouse.addListener(_local4.mouseListener);
}
_local4.deletePopUp = mixins.deletePopUp;
}
return(_local4);
}
function onPress(Void) {
var _local3 = popUp._root;
if (_local3 == undefined) {
_local3 = _root;
}
if (popUp.hitTest(_local3._xmouse, _local3._ymouse, false)) {
return(undefined);
}
popUp.dispatchEvent({type:"mouseDownOutside"});
}
function nullFunction(Void) {
}
function resize(Void) {
var _local2 = mx.managers.SystemManager.__get__screen();
setSize(_local2.width, _local2.height);
move(_local2.x, _local2.y);
}
function deletePopUp(Void) {
if (modalWindow != undefined) {
_parent.destroyObject(modalWindow._name);
}
_parent.destroyObject(_name);
}
function setVisible(v, noEvent) {
super.setVisible(v, noEvent);
modalWindow._visible = v;
}
function getVisible(Void) {
return(_visible);
}
function onMouseDown(Void) {
var _local3 = owner._root;
if (_local3 == undefined) {
_local3 = _root;
}
var _local4 = new Object();
_local4.x = _local3._xmouse;
_local4.y = _local3._ymouse;
_local3.localToGlobal(_local4);
if (owner.hitTest(_local4.x, _local4.y, false)) {
} else {
owner.mouseDownOutsideHandler(owner);
}
}
static var version = "2.0.2.126";
static var mixins = undefined;
}
Symbol 960 MovieClip [__Packages.mx.core.View] Frame 0
class mx.core.View extends mx.core.UIComponent
{
var tabChildren, tabEnabled, boundingBox_mc, border_mc, __get__width, __get__height, __tabIndex, depth, createObject, createClassObject, loadExternal, destroyObject, createClassChildAtDepth, doLater;
function View () {
super();
}
function init() {
super.init();
tabChildren = true;
tabEnabled = false;
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
function size() {
border_mc.move(0, 0);
border_mc.setSize(__get__width(), __get__height());
doLayout();
}
function draw() {
size();
}
function get numChildren() {
var _local3 = childNameBase;
var _local2 = 0;
while (true) {
if (this[_local3 + _local2] == undefined) {
return(_local2);
}
_local2++;
}
}
function get tabIndex() {
return((tabEnabled ? (__tabIndex) : undefined));
}
function addLayoutObject(object) {
}
function createChild(className, instanceName, initProps) {
if (depth == undefined) {
depth = 1;
}
var _local2;
if (typeof(className) == "string") {
_local2 = createObject(className, instanceName, depth++, initProps);
} else {
_local2 = createClassObject(className, instanceName, depth++, initProps);
}
if (_local2 == undefined) {
_local2 = loadExternal(className, _loadExternalClass, instanceName, depth++, initProps);
} else {
this[childNameBase + numChildren] = _local2;
_local2._complete = true;
childLoaded(_local2);
}
addLayoutObject(_local2);
return(_local2);
}
function getChildAt(childIndex) {
return(this[childNameBase + childIndex]);
}
function destroyChildAt(childIndex) {
if (!((childIndex >= 0) && (childIndex < numChildren))) {
return(undefined);
}
var _local4 = childNameBase + childIndex;
var _local6 = numChildren;
var _local3;
for (_local3 in this) {
if (_local3 == _local4) {
_local4 = "";
destroyObject(_local3);
break;
}
}
var _local2 = Number(childIndex);
while (_local2 < (_local6 - 1)) {
this[childNameBase + _local2] = this[childNameBase + (_local2 + 1)];
_local2++;
}
delete this[childNameBase + (_local6 - 1)];
depth--;
}
function initLayout() {
if (!hasBeenLayedOut) {
doLayout();
}
}
function doLayout() {
hasBeenLayedOut = true;
}
function createChildren() {
if (border_mc == undefined) {
border_mc = createClassChildAtDepth(_global.styles.rectBorderClass, mx.managers.DepthManager.kBottom, {styleName:this});
}
doLater(this, "initLayout");
}
function convertToUIObject(obj) {
}
function childLoaded(obj) {
convertToUIObject(obj);
}
static function extension() {
mx.core.ExternalContent.enableExternalContent();
}
static var symbolName = "View";
static var symbolOwner = mx.core.View;
static var version = "2.0.2.126";
var className = "View";
static var childNameBase = "_child";
var hasBeenLayedOut = false;
var _loadExternalClass = "UIComponent";
}
Symbol 961 MovieClip [__Packages.mx.core.ExternalContent] Frame 0
class mx.core.ExternalContent
{
var createObject, numChildren, prepList, doLater, loadList, dispatchEvent, loadedList, childLoaded;
function ExternalContent () {
}
function loadExternal(url, placeholderClassName, instanceName, depth, initProps) {
var _local2;
_local2 = createObject(placeholderClassName, instanceName, depth, initProps);
this[mx.core.View.childNameBase + numChildren] = _local2;
if (prepList == undefined) {
prepList = new Object();
}
prepList[instanceName] = {obj:_local2, url:url, complete:false, initProps:initProps};
prepareToLoadMovie(_local2);
return(_local2);
}
function prepareToLoadMovie(obj) {
obj.unloadMovie();
doLater(this, "waitForUnload");
}
function waitForUnload() {
var _local3;
for (_local3 in prepList) {
var _local2 = prepList[_local3];
if (_local2.obj.getBytesTotal() == 0) {
if (loadList == undefined) {
loadList = new Object();
}
loadList[_local3] = _local2;
_local2.obj.loadMovie(_local2.url);
delete prepList[_local3];
doLater(this, "checkLoadProgress");
} else {
doLater(this, "waitForUnload");
}
}
}
function checkLoadProgress() {
var _local8 = false;
var _local3;
for (_local3 in loadList) {
var _local2 = loadList[_local3];
_local2.loaded = _local2.obj.getBytesLoaded();
_local2.total = _local2.obj.getBytesTotal();
if (_local2.total > 0) {
_local2.obj._visible = false;
dispatchEvent({type:"progress", target:_local2.obj, current:_local2.loaded, total:_local2.total});
if (_local2.loaded == _local2.total) {
if (loadedList == undefined) {
loadedList = new Object();
}
loadedList[_local3] = _local2;
delete loadList[_local3];
doLater(this, "contentLoaded");
}
} else if (_local2.total == -1) {
if (_local2.failedOnce != undefined) {
_local2.failedOnce++;
if (_local2.failedOnce > 3) {
dispatchEvent({type:"complete", target:_local2.obj, current:_local2.loaded, total:_local2.total});
delete loadList[_local3];
}
} else {
_local2.failedOnce = 0;
}
}
_local8 = true;
}
if (_local8) {
doLater(this, "checkLoadProgress");
}
}
function contentLoaded() {
var _local4;
for (_local4 in loadedList) {
var _local2 = loadedList[_local4];
_local2.obj._visible = true;
_local2.obj._complete = true;
var _local3;
for (_local3 in _local2.initProps) {
_local2.obj[_local3] = _local2.initProps[_local3];
}
childLoaded(_local2.obj);
dispatchEvent({type:"complete", target:_local2.obj, current:_local2.loaded, total:_local2.total});
delete loadedList[_local4];
}
}
function convertToUIObject(obj) {
if (obj.setSize == undefined) {
var _local2 = mx.core.UIObject.prototype;
obj.addProperty("width", _local2.__get__width, null);
obj.addProperty("height", _local2.__get__height, null);
obj.addProperty("left", _local2.__get__left, null);
obj.addProperty("x", _local2.__get__x, null);
obj.addProperty("top", _local2.__get__top, null);
obj.addProperty("y", _local2.__get__y, null);
obj.addProperty("right", _local2.__get__right, null);
obj.addProperty("bottom", _local2.__get__bottom, null);
obj.addProperty("visible", _local2.__get__visible, _local2.__set__visible);
obj.move = mx.core.UIObject.prototype.move;
obj.setSize = mx.core.UIObject.prototype.setSize;
obj.size = mx.core.UIObject.prototype.size;
mx.events.UIEventDispatcher.initialize(obj);
}
}
static function enableExternalContent() {
}
static function classConstruct() {
var _local1 = mx.core.View.prototype;
var _local2 = mx.core.ExternalContent.prototype;
_local1.loadExternal = _local2.loadExternal;
_local1.prepareToLoadMovie = _local2.prepareToLoadMovie;
_local1.waitForUnload = _local2.waitForUnload;
_local1.checkLoadProgress = _local2.checkLoadProgress;
_local1.contentLoaded = _local2.contentLoaded;
_local1.convertToUIObject = _local2.convertToUIObject;
return(true);
}
static var classConstructed = classConstruct();
static var ViewDependency = mx.core.View;
}
Symbol 962 MovieClip [__Packages.mx.skins.CustomBorder] Frame 0
class mx.skins.CustomBorder extends mx.skins.Border
{
var __width, __height, l_mc, setSkin, minHeight, minWidth, m_mc, r_mc;
function CustomBorder () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function init(Void) {
super.init();
}
function createChildren(Void) {
}
function draw(Void) {
if (l_mc == undefined) {
var _local2 = setSkin(tagL, leftSkin);
if (horizontal) {
minHeight = l_mc._height;
minWidth = l_mc._width;
} else {
minHeight = l_mc._height;
minWidth = l_mc._width;
}
}
if (m_mc == undefined) {
setSkin(tagM, middleSkin);
if (horizontal) {
minHeight = m_mc._height;
minWidth = minWidth + m_mc._width;
} else {
minHeight = minHeight + m_mc._height;
minWidth = m_mc._width;
}
}
if (r_mc == undefined) {
setSkin(tagR, rightSkin);
if (horizontal) {
minHeight = r_mc._height;
minWidth = minWidth + r_mc._width;
} else {
minHeight = minHeight + r_mc._height;
minWidth = r_mc._width;
}
}
size();
}
function size(Void) {
l_mc.move(0, 0);
if (horizontal) {
r_mc.move(width - r_mc.width, 0);
m_mc.move(l_mc.width, 0);
m_mc.setSize(r_mc.x - m_mc.x, m_mc.height);
} else {
r_mc.move(0, height - r_mc.height, 0);
m_mc.move(0, l_mc.height);
m_mc.setSize(m_mc.width, r_mc.y - m_mc.y);
}
}
static var symbolName = "CustomBorder";
static var symbolOwner = mx.skins.CustomBorder;
static var version = "2.0.2.126";
var className = "CustomBorder";
static var tagL = 0;
static var tagM = 1;
static var tagR = 2;
var idNames = new Array("l_mc", "m_mc", "r_mc");
var leftSkin = "F3PieceLeft";
var middleSkin = "F3PieceMiddle";
var rightSkin = "F3PieceRight";
var horizontal = true;
}
Symbol 963 MovieClip [__Packages.mx.controls.scrollClasses.ScrollThumb] Frame 0
class mx.controls.scrollClasses.ScrollThumb extends mx.skins.CustomBorder
{
var useHandCursor, ymin, ymax, datamin, datamax, scrollMove, lastY, _ymouse, _y, _parent, onMouseMove, grip_mc, setSkin, gripSkin, __get__width, __get__height;
function ScrollThumb () {
super();
}
function createChildren(Void) {
super.createChildren();
useHandCursor = false;
}
function setRange(_ymin, _ymax, _datamin, _datamax) {
ymin = _ymin;
ymax = _ymax;
datamin = _datamin;
datamax = _datamax;
}
function dragThumb(Void) {
scrollMove = _ymouse - lastY;
scrollMove = scrollMove + _y;
if (scrollMove < ymin) {
scrollMove = ymin;
} else if (scrollMove > ymax) {
scrollMove = ymax;
}
_parent.isScrolling = true;
_y = scrollMove;
var _local2 = Math.round(((datamax - datamin) * (_y - ymin)) / (ymax - ymin)) + datamin;
_parent.scrollPosition = _local2;
_parent.dispatchScrollEvent("ThumbTrack");
updateAfterEvent();
}
function stopDragThumb(Void) {
_parent.isScrolling = false;
_parent.dispatchScrollEvent("ThumbPosition");
_parent.dispatchScrollChangedEvent();
delete onMouseMove;
}
function onPress(Void) {
_parent.pressFocus();
lastY = _ymouse;
onMouseMove = dragThumb;
super.onPress();
}
function onRelease(Void) {
_parent.releaseFocus();
stopDragThumb();
super.onRelease();
}
function onReleaseOutside(Void) {
_parent.releaseFocus();
stopDragThumb();
super.onReleaseOutside();
}
function draw() {
super.draw();
if (grip_mc == undefined) {
setSkin(3, gripSkin);
}
}
function size() {
super.size();
grip_mc.move((__get__width() - grip_mc.width) / 2, (__get__height() - grip_mc.height) / 2);
}
static var symbolOwner = mx.skins.CustomBorder.symbolOwner;
var className = "ScrollThumb";
var btnOffset = 0;
var horizontal = false;
var idNames = new Array("l_mc", "m_mc", "r_mc", "grip_mc");
}
Symbol 964 MovieClip [__Packages.mx.controls.scrollClasses.ScrollBar] Frame 0
class mx.controls.scrollClasses.ScrollBar extends mx.core.UIComponent
{
var isScrolling, scrollTrack_mc, scrollThumb_mc, __height, tabEnabled, focusEnabled, boundingBox_mc, setSkin, upArrow_mc, _minHeight, _minWidth, downArrow_mc, createObject, createClassObject, enabled, _height, dispatchEvent, minMode, maxMode, plusMode, minusMode, _parent, getStyle, scrolling, _ymouse;
function ScrollBar () {
super();
}
function get scrollPosition() {
return(_scrollPosition);
}
function set scrollPosition(pos) {
_scrollPosition = pos;
if (isScrolling != true) {
pos = Math.min(pos, maxPos);
pos = Math.max(pos, minPos);
var _local3 = (((pos - minPos) * (scrollTrack_mc.height - scrollThumb_mc._height)) / (maxPos - minPos)) + scrollTrack_mc.top;
scrollThumb_mc.move(0, _local3);
}
//return(scrollPosition);
}
function get pageScrollSize() {
return(largeScroll);
}
function set pageScrollSize(lScroll) {
largeScroll = lScroll;
//return(pageScrollSize);
}
function set lineScrollSize(sScroll) {
smallScroll = sScroll;
//return(lineScrollSize);
}
function get lineScrollSize() {
return(smallScroll);
}
function get virtualHeight() {
return(__height);
}
function init(Void) {
super.init();
_scrollPosition = 0;
tabEnabled = false;
focusEnabled = false;
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
function createChildren(Void) {
if (scrollTrack_mc == undefined) {
setSkin(skinIDTrack, scrollTrackName);
}
scrollTrack_mc.visible = false;
var _local3 = new Object();
_local3.enabled = false;
_local3.preset = mx.controls.SimpleButton.falseDisabled;
_local3.initProperties = 0;
_local3.autoRepeat = true;
_local3.tabEnabled = false;
var _local2;
if (upArrow_mc == undefined) {
_local2 = createButton(upArrowName, "upArrow_mc", skinIDUpArrow, _local3);
}
_local2.buttonDownHandler = onUpArrow;
_local2.clickHandler = onScrollChanged;
_minHeight = _local2.height;
_minWidth = _local2.width;
if (downArrow_mc == undefined) {
_local2 = createButton(downArrowName, "downArrow_mc", skinIDDownArrow, _local3);
}
_local2.buttonDownHandler = onDownArrow;
_local2.clickHandler = onScrollChanged;
_minHeight = _minHeight + _local2.height;
}
function createButton(linkageName, id, skinID, o) {
if (skinID == skinIDUpArrow) {
o.falseUpSkin = upArrowUpName;
o.falseDownSkin = upArrowDownName;
o.falseOverSkin = upArrowOverName;
} else {
o.falseUpSkin = downArrowUpName;
o.falseDownSkin = downArrowDownName;
o.falseOverSkin = downArrowOverName;
}
var _local3 = createObject(linkageName, id, skinID, o);
this[id].visible = false;
this[id].useHandCursor = false;
return(_local3);
}
function createThumb(Void) {
var _local2 = new Object();
_local2.validateNow = true;
_local2.tabEnabled = false;
_local2.leftSkin = thumbTopName;
_local2.middleSkin = thumbMiddleName;
_local2.rightSkin = thumbBottomName;
_local2.gripSkin = thumbGripName;
createClassObject(mx.controls.scrollClasses.ScrollThumb, "scrollThumb_mc", skinIDThumb, _local2);
}
function setScrollProperties(pSize, mnPos, mxPos, ls) {
var _local4;
var _local2 = scrollTrack_mc;
pageSize = pSize;
largeScroll = (((ls != undefined) && (ls > 0)) ? (ls) : (pSize));
minPos = Math.max(mnPos, 0);
maxPos = Math.max(mxPos, 0);
_scrollPosition = Math.max(minPos, _scrollPosition);
_scrollPosition = Math.min(maxPos, _scrollPosition);
if (((maxPos - minPos) > 0) && (enabled)) {
var _local5 = _scrollPosition;
if (!initializing) {
upArrow_mc.enabled = true;
downArrow_mc.enabled = true;
}
_local2.onPress = (_local2.onDragOver = startTrackScroller);
_local2.onRelease = releaseScrolling;
_local2.onDragOut = (_local2.stopScrolling = stopScrolling);
_local2.onReleaseOutside = releaseScrolling;
_local2.useHandCursor = false;
if (scrollThumb_mc == undefined) {
createThumb();
}
var _local3 = scrollThumb_mc;
if (scrollTrackOverName.length > 0) {
_local2.onRollOver = trackOver;
_local2.onRollOut = trackOut;
}
_local4 = (pageSize / ((maxPos - minPos) + pageSize)) * _local2.height;
if (_local4 < _local3.minHeight) {
if (_local2.height < _local3.minHeight) {
_local3.__set__visible(false);
} else {
_local4 = _local3.minHeight;
_local3.__set__visible(true);
_local3.setSize(_minWidth, _local3.minHeight + 0);
}
} else {
_local3.__set__visible(true);
_local3.setSize(_minWidth, _local4);
}
_local3.setRange(upArrow_mc.__get__height() + 0, (virtualHeight - downArrow_mc.__get__height()) - _local3.__get__height(), minPos, maxPos);
_local5 = Math.min(_local5, maxPos);
scrollPosition = (Math.max(_local5, minPos));
} else {
scrollThumb_mc.__set__visible(false);
if (!initializing) {
upArrow_mc.enabled = false;
downArrow_mc.enabled = false;
}
delete _local2.onPress;
delete _local2.onDragOver;
delete _local2.onRelease;
delete _local2.onDragOut;
delete _local2.onRollOver;
delete _local2.onRollOut;
delete _local2.onReleaseOutside;
}
if (initializing) {
scrollThumb_mc.__set__visible(false);
}
}
function setEnabled(enabledFlag) {
super.setEnabled(enabledFlag);
setScrollProperties(pageSize, minPos, maxPos, largeScroll);
}
function draw(Void) {
if (initializing) {
initializing = false;
scrollTrack_mc.visible = true;
upArrow_mc.__set__visible(true);
downArrow_mc.__set__visible(true);
}
size();
}
function size(Void) {
if (_height == 1) {
return(undefined);
}
if (upArrow_mc == undefined) {
return(undefined);
}
var _local3 = upArrow_mc.__get__height();
var _local2 = downArrow_mc.__get__height();
upArrow_mc.move(0, 0);
var _local4 = scrollTrack_mc;
_local4._y = _local3;
_local4._height = (virtualHeight - _local3) - _local2;
downArrow_mc.move(0, virtualHeight - _local2);
setScrollProperties(pageSize, minPos, maxPos, largeScroll);
}
function dispatchScrollEvent(detail) {
dispatchEvent({type:"scroll", detail:detail});
}
function isScrollBarKey(k) {
if (k == 36) {
if (scrollPosition != 0) {
scrollPosition = (0);
dispatchScrollEvent(minMode);
}
return(true);
}
if (k == 35) {
if (scrollPosition < maxPos) {
scrollPosition = (maxPos);
dispatchScrollEvent(maxMode);
}
return(true);
}
return(false);
}
function scrollIt(inc, mode) {
var _local3 = smallScroll;
if (inc != "Line") {
_local3 = ((largeScroll == 0) ? (pageSize) : (largeScroll));
}
var _local2 = _scrollPosition + (mode * _local3);
if (_local2 > maxPos) {
_local2 = maxPos;
} else if (_local2 < minPos) {
_local2 = minPos;
}
if (scrollPosition != _local2) {
scrollPosition = (_local2);
var _local4 = ((mode < 0) ? (minusMode) : (plusMode));
dispatchScrollEvent(inc + _local4);
}
}
function startTrackScroller(Void) {
_parent.pressFocus();
if (_parent.scrollTrackDownName.length > 0) {
if (_parent.scrollTrackDown_mc == undefined) {
_parent.setSkin(skinIDTrackDown, scrollTrackDownName);
} else {
_parent.scrollTrackDown_mc.visible = true;
}
}
_parent.trackScroller();
_parent.scrolling = setInterval(_parent, "scrollInterval", getStyle("repeatDelay"), "Page", -1);
}
function scrollInterval(inc, mode) {
clearInterval(scrolling);
if (inc == "Page") {
trackScroller();
} else {
scrollIt(inc, mode);
}
scrolling = setInterval(this, "scrollInterval", getStyle("repeatInterval"), inc, mode);
}
function trackScroller(Void) {
if ((scrollThumb_mc._y + scrollThumb_mc.__get__height()) < _ymouse) {
scrollIt("Page", 1);
} else if (scrollThumb_mc._y > _ymouse) {
scrollIt("Page", -1);
}
}
function dispatchScrollChangedEvent(Void) {
dispatchEvent({type:"scrollChanged"});
}
function stopScrolling(Void) {
clearInterval(_parent.scrolling);
_parent.scrollTrackDown_mc.visible = false;
}
function releaseScrolling(Void) {
_parent.releaseFocus();
stopScrolling();
_parent.dispatchScrollChangedEvent();
}
function trackOver(Void) {
if (_parent.scrollTrackOverName.length > 0) {
if (_parent.scrollTrackOver_mc == undefined) {
_parent.setSkin(skinIDTrackOver, scrollTrackOverName);
} else {
_parent.scrollTrackOver_mc.visible = true;
}
}
}
function trackOut(Void) {
_parent.scrollTrackOver_mc.visible = false;
}
function onUpArrow(Void) {
_parent.scrollIt("Line", -1);
}
function onDownArrow(Void) {
_parent.scrollIt("Line", 1);
}
function onScrollChanged(Void) {
_parent.dispatchScrollChangedEvent();
}
static var symbolOwner = mx.core.UIComponent;
var className = "ScrollBar";
var minPos = 0;
var maxPos = 0;
var pageSize = 0;
var largeScroll = 0;
var smallScroll = 1;
var _scrollPosition = 0;
var scrollTrackName = "ScrollTrack";
var scrollTrackOverName = "";
var scrollTrackDownName = "";
var upArrowName = "BtnUpArrow";
var upArrowUpName = "ScrollUpArrowUp";
var upArrowOverName = "ScrollUpArrowOver";
var upArrowDownName = "ScrollUpArrowDown";
var downArrowName = "BtnDownArrow";
var downArrowUpName = "ScrollDownArrowUp";
var downArrowOverName = "ScrollDownArrowOver";
var downArrowDownName = "ScrollDownArrowDown";
var thumbTopName = "ScrollThumbTopUp";
var thumbMiddleName = "ScrollThumbMiddleUp";
var thumbBottomName = "ScrollThumbBottomUp";
var thumbGripName = "ScrollThumbGripUp";
static var skinIDTrack = 0;
static var skinIDTrackOver = 1;
static var skinIDTrackDown = 2;
static var skinIDUpArrow = 3;
static var skinIDDownArrow = 4;
static var skinIDThumb = 5;
var idNames = new Array("scrollTrack_mc", "scrollTrackOver_mc", "scrollTrackDown_mc", "upArrow_mc", "downArrow_mc");
var clipParameters = {minPos:1, maxPos:1, pageSize:1, scrollPosition:1, lineScrollSize:1, pageScrollSize:1, visible:1, enabled:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.scrollClasses.ScrollBar.prototype.clipParameters, mx.core.UIComponent.prototype.clipParameters);
var initializing = true;
}
Symbol 965 MovieClip [__Packages.mx.core.ScrollView] Frame 0
class mx.core.ScrollView extends mx.core.View
{
var __width, hScroller, vScroller, __maxHPosition, propsInited, scrollAreaChanged, specialHScrollCase, createObject, viewableColumns, __height, oldRndUp, viewableRows, __viewMetrics, owner, enabled, border_mc, __get__width, __get__height, invLayout, mask_mc, _parent, dispatchEvent;
function ScrollView () {
super();
}
function getHScrollPolicy(Void) {
return(__hScrollPolicy);
}
function setHScrollPolicy(policy) {
__hScrollPolicy = policy.toLowerCase();
if (__width == undefined) {
return(undefined);
}
setScrollProperties(numberOfCols, columnWidth, rowC, rowH, heightPadding, widthPadding);
}
function get hScrollPolicy() {
return(getHScrollPolicy());
}
function set hScrollPolicy(policy) {
setHScrollPolicy(policy);
//return(hScrollPolicy);
}
function getVScrollPolicy(Void) {
return(__vScrollPolicy);
}
function setVScrollPolicy(policy) {
__vScrollPolicy = policy.toLowerCase();
if (__width == undefined) {
return(undefined);
}
setScrollProperties(numberOfCols, columnWidth, rowC, rowH, heightPadding, widthPadding);
}
function get vScrollPolicy() {
return(getVScrollPolicy());
}
function set vScrollPolicy(policy) {
setVScrollPolicy(policy);
//return(vScrollPolicy);
}
function get hPosition() {
return(getHPosition());
}
function set hPosition(pos) {
setHPosition(pos);
//return(hPosition);
}
function getHPosition(Void) {
return(__hPosition);
}
function setHPosition(pos) {
hScroller.__set__scrollPosition(pos);
__hPosition = pos;
}
function get vPosition() {
return(getVPosition());
}
function set vPosition(pos) {
setVPosition(pos);
//return(vPosition);
}
function getVPosition(Void) {
return(__vPosition);
}
function setVPosition(pos) {
vScroller.__set__scrollPosition(pos);
__vPosition = pos;
}
function get maxVPosition() {
var _local2 = vScroller.maxPos;
return(((_local2 == undefined) ? 0 : (_local2)));
}
function get maxHPosition() {
return(getMaxHPosition());
}
function set maxHPosition(pos) {
setMaxHPosition(pos);
//return(maxHPosition);
}
function getMaxHPosition(Void) {
if (__maxHPosition != undefined) {
return(__maxHPosition);
}
var _local2 = hScroller.maxPos;
return(((_local2 == undefined) ? 0 : (_local2)));
}
function setMaxHPosition(pos) {
__maxHPosition = pos;
}
function setScrollProperties(colCount, colWidth, rwCount, rwHeight, hPadding, wPadding) {
var _local3 = getViewMetrics();
if (hPadding == undefined) {
hPadding = 0;
}
if (wPadding == undefined) {
wPadding = 0;
}
propsInited = true;
delete scrollAreaChanged;
heightPadding = hPadding;
widthPadding = wPadding;
if (colWidth == 0) {
colWidth = 1;
}
if (rwHeight == 0) {
rwHeight = 1;
}
var _local5 = Math.ceil((((__width - _local3.left) - _local3.right) - widthPadding) / colWidth);
if ((__hScrollPolicy == "on") || ((_local5 < colCount) && (__hScrollPolicy == "auto"))) {
if ((hScroller == undefined) || (specialHScrollCase)) {
delete specialHScrollCase;
hScroller = createObject("HScrollBar", "hSB", 1001);
hScroller.__set__lineScrollSize(20);
hScroller.scrollHandler = scrollProxy;
hScroller.__set__scrollPosition(__hPosition);
scrollAreaChanged = true;
}
if ((((numberOfCols != colCount) || (columnWidth != colWidth)) || (viewableColumns != _local5)) || (scrollAreaChanged)) {
hScroller.setScrollProperties(_local5, 0, colCount - _local5);
viewableColumns = _local5;
numberOfCols = colCount;
columnWidth = colWidth;
}
} else if (((__hScrollPolicy == "auto") || (__hScrollPolicy == "off")) && (hScroller != undefined)) {
hScroller.removeMovieClip();
delete hScroller;
scrollAreaChanged = true;
}
if (heightPadding == undefined) {
heightPadding = 0;
}
var _local4 = Math.ceil((((__height - _local3.top) - _local3.bottom) - heightPadding) / rwHeight);
var _local8 = (((__height - _local3.top) - _local3.bottom) % rwHeight) != 0;
if ((__vScrollPolicy == "on") || ((_local4 < (rwCount + _local8)) && (__vScrollPolicy == "auto"))) {
if (vScroller == undefined) {
vScroller = createObject("VScrollBar", "vSB", 1002);
vScroller.scrollHandler = scrollProxy;
vScroller.__set__scrollPosition(__vPosition);
scrollAreaChanged = true;
rowH = 0;
}
if ((((rowC != rwCount) || (rowH != rwHeight)) || ((viewableRows + _local8) != (_local4 + oldRndUp))) || (scrollAreaChanged)) {
vScroller.setScrollProperties(_local4, 0, (rwCount - _local4) + _local8);
viewableRows = _local4;
rowC = rwCount;
rowH = rwHeight;
oldRndUp = _local8;
}
} else if (((__vScrollPolicy == "auto") || (__vScrollPolicy == "off")) && (vScroller != undefined)) {
vScroller.removeMovieClip();
delete vScroller;
scrollAreaChanged = true;
}
numberOfCols = colCount;
columnWidth = colWidth;
if (scrollAreaChanged) {
doLayout();
var _local2 = __viewMetrics;
var _local12 = ((owner != undefined) ? (owner) : this);
_local12.layoutContent(_local2.left, _local2.top, ((columnWidth * numberOfCols) - _local2.left) - _local2.right, rowC * rowH, (__width - _local2.left) - _local2.right, (__height - _local2.top) - _local2.bottom);
}
if (!enabled) {
setEnabled(false);
}
}
function getViewMetrics(Void) {
var _local2 = __viewMetrics;
var _local3 = border_mc.__get__borderMetrics();
_local2.left = _local3.left;
_local2.right = _local3.right;
if (vScroller != undefined) {
_local2.right = _local2.right + vScroller.minWidth;
}
_local2.top = _local3.top;
if ((hScroller == undefined) && ((__hScrollPolicy == "on") || (__hScrollPolicy == true))) {
hScroller = createObject("FHScrollBar", "hSB", 1001);
specialHScrollCase = true;
}
_local2.bottom = _local3.bottom;
if (hScroller != undefined) {
_local2.bottom = _local2.bottom + hScroller.minHeight;
}
return(_local2);
}
function doLayout(Void) {
var _local10 = __get__width();
var _local8 = __get__height();
delete invLayout;
var _local3 = (__viewMetrics = getViewMetrics());
var _local2 = _local3.left;
var _local9 = _local3.right;
var _local5 = _local3.top;
var _local11 = _local3.bottom;
var _local7 = hScroller;
var _local6 = vScroller;
_local7.setSize((_local10 - _local2) - _local9, _local7.minHeight + 0);
_local7.move(_local2, _local8 - _local11);
_local6.setSize(_local6.minWidth + 0, (_local8 - _local5) - _local11);
_local6.move(_local10 - _local9, _local5);
var _local4 = mask_mc;
_local4._width = (_local10 - _local2) - _local9;
_local4._height = (_local8 - _local5) - _local11;
_local4._x = _local2;
_local4._y = _local5;
}
function createChild(id, name, props) {
var _local2 = super.createChild(id, name, props);
return(_local2);
}
function init(Void) {
super.init();
__viewMetrics = new Object();
if (_global.__SVMouseWheelManager == undefined) {
var _local4 = (_global.__SVMouseWheelManager = new Object());
_local4.onMouseWheel = __onMouseWheel;
Mouse.addListener(_local4);
}
}
function __onMouseWheel(delta, scrollTarget) {
var _local4 = scrollTarget;
var _local1;
while (_local4 != undefined) {
if (_local4 instanceof mx.core.ScrollView) {
_local1 = _local4;
}
_local4 = _local4._parent;
}
if (_local1 != undefined) {
_local4 = ((delta <= 0) ? 1 : -1);
var _local2 = _local1.vScroller.lineScrollSize;
if (_local2 == undefined) {
_local2 = 0;
}
_local2 = Math.max(Math.abs(delta), _local2);
var _local3 = _local1.vPosition + (_local2 * _local4);
_local1.vPosition = Math.max(0, Math.min(_local3, _local1.maxVPosition));
_local1.dispatchEvent({type:"scroll", direction:"vertical", position:_local1.vPosition});
}
}
function createChildren(Void) {
super.createChildren();
if (mask_mc == undefined) {
mask_mc = createObject("BoundingBox", "mask_mc", MASK_DEPTH);
}
mask_mc._visible = false;
}
function invalidate(Void) {
super.invalidate();
}
function draw(Void) {
size();
}
function size(Void) {
super.size();
}
function scrollProxy(docObj) {
_parent.onScroll(docObj);
}
function onScroll(docObj) {
var _local3 = docObj.target;
var _local2 = _local3.scrollPosition;
if (_local3 == vScroller) {
var _local4 = "vertical";
var _local5 = "__vPosition";
} else {
var _local4 = "horizontal";
var _local5 = "__hPosition";
}
this[_local5] = _local2;
dispatchEvent({type:"scroll", direction:_local4, position:_local2});
}
function setEnabled(v) {
vScroller.enabled = (hScroller.enabled = v);
}
function childLoaded(obj) {
super.childLoaded(obj);
obj.setMask(mask_mc);
}
static var symbolName = "ScrollView";
static var symbolOwner = mx.core.ScrollView;
static var version = "2.0.2.126";
var className = "ScrollView";
var __vScrollPolicy = "auto";
var __hScrollPolicy = "off";
var __vPosition = 0;
var __hPosition = 0;
var numberOfCols = 0;
var rowC = 0;
var columnWidth = 1;
var rowH = 0;
var heightPadding = 0;
var widthPadding = 0;
var MASK_DEPTH = 10000;
}
Symbol 966 MovieClip [__Packages.mx.controls.listclasses.DataProvider] Frame 0
class mx.controls.listclasses.DataProvider extends Object
{
var length, splice, dispatchEvent, sortOn, reverse, sort;
function DataProvider (obj) {
super();
}
static function Initialize(obj) {
var _local4 = mixinProps;
var _local6 = _local4.length;
obj = obj.prototype;
var _local3 = 0;
while (_local3 < _local6) {
obj[_local4[_local3]] = mixins[_local4[_local3]];
_global.ASSetPropFlags(obj, _local4[_local3], 1);
_local3++;
}
mx.events.EventDispatcher.initialize(obj);
_global.ASSetPropFlags(obj, "addEventListener", 1);
_global.ASSetPropFlags(obj, "removeEventListener", 1);
_global.ASSetPropFlags(obj, "dispatchEvent", 1);
_global.ASSetPropFlags(obj, "dispatchQueue", 1);
Object.prototype.LargestID = 0;
Object.prototype.getID = function () {
if (this.__ID__ == undefined) {
this.__ID__ = Object.prototype.LargestID++;
_global.ASSetPropFlags(this, "__ID__", 1);
}
return(this.__ID__);
};
_global.ASSetPropFlags(Object.prototype, "LargestID", 1);
_global.ASSetPropFlags(Object.prototype, "getID", 1);
return(true);
}
function addItemAt(index, value) {
if (index < length) {
splice(index, 0, value);
} else if (index > length) {
trace("Cannot add an item past the end of the DataProvider");
return(undefined);
}
this[index] = value;
updateViews("addItems", index, index);
}
function addItem(value) {
addItemAt(length, value);
}
function addItemsAt(index, newItems) {
index = Math.min(length, index);
newItems.unshift(index, 0);
splice.apply(this, newItems);
newItems.splice(0, 2);
updateViews("addItems", index, (index + newItems.length) - 1);
}
function removeItemsAt(index, len) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < len) {
_local3.push(getItemID(index + _local2));
_local2++;
}
var _local6 = splice(index, len);
dispatchEvent({type:"modelChanged", eventName:"removeItems", firstItem:index, lastItem:(index + len) - 1, removedItems:_local6, removedIDs:_local3});
}
function removeItemAt(index) {
var _local2 = this[index];
removeItemsAt(index, 1);
return(_local2);
}
function removeAll(Void) {
splice(0);
updateViews("removeItems", 0, length - 1);
}
function replaceItemAt(index, itemObj) {
if ((index < 0) || (index >= length)) {
return(undefined);
}
var _local3 = getItemID(index);
this[index] = itemObj;
this[index].__ID__ = _local3;
updateViews("updateItems", index, index);
}
function getItemAt(index) {
return(this[index]);
}
function getItemID(index) {
var _local2 = this[index];
if ((typeof(_local2) != "object") && (_local2 != undefined)) {
return(index);
}
return(_local2.getID());
}
function sortItemsBy(fieldName, order) {
if (typeof(order) == "string") {
sortOn(fieldName);
if (order.toUpperCase() == "DESC") {
reverse();
}
} else {
sortOn(fieldName, order);
}
updateViews("sort");
}
function sortItems(compareFunc, optionFlags) {
sort(compareFunc, optionFlags);
updateViews("sort");
}
function editField(index, fieldName, newData) {
this[index][fieldName] = newData;
dispatchEvent({type:"modelChanged", eventName:"updateField", firstItem:index, lastItem:index, fieldName:fieldName});
}
function getEditingData(index, fieldName) {
return(this[index][fieldName]);
}
function updateViews(event, first, last) {
dispatchEvent({type:"modelChanged", eventName:event, firstItem:first, lastItem:last});
}
static var mixinProps = ["addView", "addItem", "addItemAt", "removeAll", "removeItemAt", "replaceItemAt", "getItemAt", "getItemID", "sortItemsBy", "sortItems", "updateViews", "addItemsAt", "removeItemsAt", "getEditingData", "editField"];
static var evtDipatcher = mx.events.EventDispatcher;
static var mixins = new mx.controls.listclasses.DataProvider();
}
Symbol 967 MovieClip [__Packages.mx.controls.listclasses.ScrollSelectList] Frame 0
class mx.controls.listclasses.ScrollSelectList extends mx.core.ScrollView
{
var invLayoutContent, rows, topRowZ, listContent, __dataProvider, __vPosition, tW, layoutX, layoutY, tH, invRowHeight, invalidate, __height, invUpdateControl, __cellRenderer, __labelFunction, __iconField, __iconFunction, getLength, baseRowZ, lastPosition, propertyTable, isSelected, wasKeySelected, changeFlag, clearSelected, selectItem, lastSelected, dispatchEvent, dragScrolling, _ymouse, scrollInterval, isPressed, onMouseUp, getSelectedIndex, enabled, tabEnabled, tabChildren, createEmptyMovieClip, border_mc;
function ScrollSelectList () {
super();
}
function layoutContent(x, y, w, h) {
delete invLayoutContent;
var _local4 = Math.ceil(h / __rowHeight);
roundUp = (h % __rowHeight) != 0;
var _local12 = _local4 - __rowCount;
if (_local12 < 0) {
var _local3 = _local4;
while (_local3 < __rowCount) {
rows[_local3].removeMovieClip();
delete rows[_local3];
_local3++;
}
topRowZ = topRowZ + _local12;
} else if (_local12 > 0) {
if (rows == undefined) {
rows = new Array();
}
var _local3 = __rowCount;
while (_local3 < _local4) {
var _local2 = (rows[_local3] = listContent.createObject(__rowRenderer, "listRow" + (topRowZ++), topRowZ, {owner:this, styleName:this, rowIndex:_local3}));
_local2._x = x;
_local2._y = Math.round((_local3 * __rowHeight) + y);
_local2.setSize(w, __rowHeight);
_local2.drawRow(__dataProvider.getItemAt(__vPosition + _local3), getStateAt(__vPosition + _local3));
_local2.lastY = _local2._y;
_local3++;
}
}
if (w != tW) {
var _local11 = ((_local12 > 0) ? (__rowCount) : (_local4));
var _local3 = 0;
while (_local3 < _local11) {
rows[_local3].setSize(w, __rowHeight);
_local3++;
}
}
if ((layoutX != x) || (layoutY != y)) {
var _local3 = 0;
while (_local3 < _local4) {
rows[_local3]._x = x;
rows[_local3]._y = Math.round((_local3 * __rowHeight) + y);
_local3++;
}
}
__rowCount = _local4;
layoutX = x;
layoutY = y;
tW = w;
tH = h;
}
function getRowHeight(Void) {
return(__rowHeight);
}
function setRowHeight(v) {
__rowHeight = v;
invRowHeight = true;
invalidate();
}
function get rowHeight() {
return(getRowHeight());
}
function set rowHeight(w) {
setRowHeight(w);
//return(rowHeight);
}
function setRowCount(v) {
__rowCount = v;
}
function getRowCount(Void) {
var _local2 = ((__rowCount == 0) ? (Math.ceil(__height / __rowHeight)) : (__rowCount));
return(_local2);
}
function get rowCount() {
return(getRowCount());
}
function set rowCount(w) {
setRowCount(w);
//return(rowCount);
}
function setEnabled(v) {
super.setEnabled(v);
invUpdateControl = true;
invalidate();
}
function setCellRenderer(cR) {
__cellRenderer = cR;
var _local2 = 0;
while (_local2 < rows.length) {
rows[_local2].setCellRenderer(true);
_local2++;
}
invUpdateControl = true;
invalidate();
}
function set cellRenderer(cR) {
setCellRenderer(cR);
//return(cellRenderer);
}
function get cellRenderer() {
return(__cellRenderer);
}
function set labelField(field) {
setLabelField(field);
//return(labelField);
}
function setLabelField(field) {
__labelField = field;
invUpdateControl = true;
invalidate();
}
function get labelField() {
return(__labelField);
}
function set labelFunction(func) {
setLabelFunction(func);
//return(labelFunction);
}
function setLabelFunction(func) {
__labelFunction = func;
invUpdateControl = true;
invalidate();
}
function get labelFunction() {
return(__labelFunction);
}
function set iconField(field) {
setIconField(field);
//return(iconField);
}
function setIconField(field) {
__iconField = field;
invUpdateControl = true;
invalidate();
}
function get iconField() {
return(__iconField);
}
function set iconFunction(func) {
setIconFunction(func);
//return(iconFunction);
}
function setIconFunction(func) {
__iconFunction = func;
invUpdateControl = true;
invalidate();
}
function get iconFunction() {
return(__iconFunction);
}
function setVPosition(pos) {
if (pos < 0) {
return(undefined);
}
if ((pos > 0) && (pos > ((getLength() - __rowCount) + roundUp))) {
return(undefined);
}
var _local8 = pos - __vPosition;
if (_local8 == 0) {
return(undefined);
}
__vPosition = pos;
var _local10 = _local8 > 0;
_local8 = Math.abs(_local8);
if (_local8 >= __rowCount) {
updateControl();
} else {
var _local4 = new Array();
var _local9 = __rowCount - _local8;
var _local12 = _local8 * __rowHeight;
var _local11 = _local9 * __rowHeight;
var _local6 = (_local10 ? 1 : -1);
var _local3 = 0;
while (_local3 < __rowCount) {
if (((_local3 < _local8) && (_local10)) || ((_local3 >= _local9) && (!_local10))) {
rows[_local3]._y = rows[_local3]._y + Math.round(_local6 * _local11);
var _local5 = _local3 + (_local6 * _local9);
var _local7 = __vPosition + _local5;
_local4[_local5] = rows[_local3];
_local4[_local5].rowIndex = _local5;
_local4[_local5].drawRow(__dataProvider.getItemAt(_local7), getStateAt(_local7), false);
} else {
rows[_local3]._y = rows[_local3]._y - Math.round(_local6 * _local12);
var _local5 = _local3 - (_local6 * _local8);
_local4[_local5] = rows[_local3];
_local4[_local5].rowIndex = _local5;
}
_local3++;
}
rows = _local4;
_local3 = 0;
while (_local3 < __rowCount) {
rows[_local3].swapDepths(baseRowZ + _local3);
_local3++;
}
}
lastPosition = pos;
super.setVPosition(pos);
}
function setPropertiesAt(index, obj) {
var _local2 = __dataProvider.getItemID(index);
if (_local2 == undefined) {
return(undefined);
}
if (propertyTable == undefined) {
propertyTable = new Object();
}
propertyTable[_local2] = obj;
rows[index - __vPosition].drawRow(__dataProvider.getItemAt(index), getStateAt(index));
}
function getPropertiesAt(index) {
var _local2 = __dataProvider.getItemID(index);
if (_local2 == undefined) {
return(undefined);
}
return(propertyTable[_local2]);
}
function getPropertiesOf(obj) {
var _local2 = obj.getID();
if (_local2 == undefined) {
return(undefined);
}
return(propertyTable[_local2]);
}
function getStyle(styleProp) {
var _local2 = super.getStyle(styleProp);
var _local3 = mx.styles.StyleManager.colorNames[_local2];
if (_local3 != undefined) {
_local2 = _local3;
}
return(_local2);
}
function updateControl(Void) {
var _local2 = 0;
while (_local2 < __rowCount) {
rows[_local2].drawRow(__dataProvider.getItemAt(_local2 + __vPosition), getStateAt(_local2 + __vPosition));
_local2++;
}
delete invUpdateControl;
}
function getStateAt(index) {
return((isSelected(index) ? "selected" : "normal"));
}
function selectRow(rowIndex, transition, allowChangeEvent) {
if (!selectable) {
return(undefined);
}
var _local3 = __vPosition + rowIndex;
var _local8 = __dataProvider.getItemAt(_local3);
var _local5 = rows[rowIndex];
if (_local8 == undefined) {
return(undefined);
}
if (transition == undefined) {
transition = true;
}
if (allowChangeEvent == undefined) {
allowChangeEvent = wasKeySelected;
}
changeFlag = true;
if (((!multipleSelection) && (!Key.isDown(17))) || ((!Key.isDown(16)) && (!Key.isDown(17)))) {
clearSelected(transition);
selectItem(_local3, true);
lastSelected = _local3;
_local5.drawRow(_local5.item, getStateAt(_local3), transition);
} else if (Key.isDown(16) && (multipleSelection)) {
if (lastSelected == undefined) {
lastSelected = _local3;
}
var _local4 = ((lastSelected < _local3) ? 1 : -1);
clearSelected(false);
var _local2 = lastSelected;
while (_local2 != _local3) {
selectItem(_local2, true);
if ((_local2 >= __vPosition) && (_local2 < (__vPosition + __rowCount))) {
rows[_local2 - __vPosition].drawRow(rows[_local2 - __vPosition].item, "selected", false);
}
_local2 = _local2 + _local4;
}
selectItem(_local3, true);
_local5.drawRow(_local5.item, "selected", transition);
} else if (Key.isDown(17)) {
var _local7 = isSelected(_local3);
if ((!multipleSelection) || (wasKeySelected)) {
clearSelected(transition);
}
if (!((!multipleSelection) && (_local7))) {
selectItem(_local3, !_local7);
var _local9 = ((!_local7) ? "selected" : "normal");
_local5.drawRow(_local5.item, _local9, transition);
}
lastSelected = _local3;
}
if (allowChangeEvent) {
dispatchEvent({type:"change"});
}
delete wasKeySelected;
}
function dragScroll(Void) {
clearInterval(dragScrolling);
if (_ymouse < 0) {
setVPosition(__vPosition - 1);
selectRow(0, false);
var _local2 = Math.min((-_ymouse) - 30, 0);
scrollInterval = (((0.593 * _local2) * _local2) + 1) + minScrollInterval;
dragScrolling = setInterval(this, "dragScroll", scrollInterval);
dispatchEvent({type:"scroll", direction:"vertical", position:__vPosition});
} else if (_ymouse > __height) {
var _local3 = __vPosition;
setVPosition(__vPosition + 1);
if (_local3 != __vPosition) {
selectRow((__rowCount - 1) - roundUp, false);
}
var _local2 = Math.min((_ymouse - __height) - 30, 0);
scrollInterval = (((0.593 * _local2) * _local2) + 1) + minScrollInterval;
dragScrolling = setInterval(this, "dragScroll", scrollInterval);
dispatchEvent({type:"scroll", direction:"vertical", position:__vPosition});
} else {
dragScrolling = setInterval(this, "dragScroll", 15);
}
updateAfterEvent();
}
function __onMouseUp(Void) {
clearInterval(dragScrolling);
delete dragScrolling;
delete dragScrolling;
delete isPressed;
delete onMouseUp;
if (!selectable) {
return(undefined);
}
if (changeFlag) {
dispatchEvent({type:"change"});
}
delete changeFlag;
}
function moveSelBy(incr) {
if (!selectable) {
setVPosition(__vPosition + incr);
return(undefined);
}
var _local3 = getSelectedIndex();
if (_local3 == undefined) {
_local3 = -1;
}
var _local2 = _local3 + incr;
_local2 = Math.max(0, _local2);
_local2 = Math.min(getLength() - 1, _local2);
if (_local2 == _local3) {
return(undefined);
}
if ((_local3 < __vPosition) || (_local3 >= (__vPosition + __rowCount))) {
setVPosition(_local3);
}
if ((_local2 >= ((__vPosition + __rowCount) - roundUp)) || (_local2 < __vPosition)) {
setVPosition(__vPosition + incr);
}
wasKeySelected = true;
selectRow(_local2 - __vPosition, false);
}
function keyDown(e) {
if (selectable) {
if (findInputText()) {
return(undefined);
}
}
if (e.code == 40) {
moveSelBy(1);
} else if (e.code == 38) {
moveSelBy(-1);
} else if (e.code == 34) {
if (selectable) {
var _local3 = getSelectedIndex();
if (_local3 == undefined) {
_local3 = 0;
}
setVPosition(_local3);
}
moveSelBy((__rowCount - 1) - roundUp);
} else if (e.code == 33) {
if (selectable) {
var _local3 = getSelectedIndex();
if (_local3 == undefined) {
_local3 = 0;
}
setVPosition(_local3);
}
moveSelBy((1 - __rowCount) + roundUp);
} else if (e.code == 36) {
moveSelBy(-__dataProvider.length);
} else if (e.code == 35) {
moveSelBy(__dataProvider.length);
}
}
function findInputText(Void) {
var _local2 = Key.getAscii();
if ((_local2 >= 33) && (_local2 <= 126)) {
findString(String.fromCharCode(_local2));
return(true);
}
}
function findString(str) {
if (__dataProvider.length == 0) {
return(undefined);
}
var _local4 = getSelectedIndex();
if (_local4 == undefined) {
_local4 = 0;
}
var _local6 = 0;
var _local3 = _local4 + 1;
while (_local3 != _local4) {
var _local2 = __dataProvider.getItemAt(_local3);
if (_local2 instanceof XMLNode) {
_local2 = _local2.attributes[__labelField];
} else if (typeof(_local2) != "string") {
_local2 = String(_local2[__labelField]);
}
_local2 = _local2.substring(0, str.length);
if ((str == _local2) || (str.toUpperCase() == _local2.toUpperCase())) {
_local6 = _local3 - _local4;
break;
}
if (_local3 >= (getLength() - 1)) {
_local3 = -1;
}
_local3++;
}
if (_local6 != 0) {
moveSelBy(_local6);
}
}
function onRowPress(rowIndex) {
if (!enabled) {
return(undefined);
}
isPressed = true;
dragScrolling = setInterval(this, "dragScroll", 15);
onMouseUp = __onMouseUp;
if (!selectable) {
return(undefined);
}
selectRow(rowIndex);
}
function onRowRelease(rowIndex) {
}
function onRowRollOver(rowIndex) {
if (!enabled) {
return(undefined);
}
var _local2 = rows[rowIndex].item;
if (getStyle("useRollOver") && (_local2 != undefined)) {
rows[rowIndex].drawRow(_local2, "highlighted", false);
}
dispatchEvent({type:"itemRollOver", index:rowIndex + __vPosition});
}
function onRowRollOut(rowIndex) {
if (!enabled) {
return(undefined);
}
if (getStyle("useRollOver")) {
rows[rowIndex].drawRow(rows[rowIndex].item, getStateAt(rowIndex + __vPosition), false);
}
dispatchEvent({type:"itemRollOut", index:rowIndex + __vPosition});
}
function onRowDragOver(rowIndex) {
if (((!enabled) || (isPressed != true)) || (!selectable)) {
return(undefined);
}
if (dropEnabled) {
} else if (dragScrolling) {
selectRow(rowIndex, false);
} else {
onMouseUp = __onMouseUp;
onRowPress(rowIndex);
}
}
function onRowDragOut(rowIndex) {
if (!enabled) {
return(undefined);
}
if (dragEnabled) {
} else {
onRowRollOut(rowIndex);
}
}
function init(Void) {
super.init();
tabEnabled = true;
tabChildren = false;
if (__dataProvider == undefined) {
__dataProvider = new Array();
__dataProvider.addEventListener("modelChanged", this);
}
baseRowZ = (topRowZ = 10);
}
function createChildren(Void) {
super.createChildren();
listContent = createEmptyMovieClip("content_mc", CONTENTDEPTH);
invLayoutContent = true;
invalidate();
}
function draw(Void) {
if (invRowHeight) {
delete invRowHeight;
__rowCount = 0;
listContent.removeMovieClip();
listContent = createEmptyMovieClip("content_mc", CONTENTDEPTH);
}
if (invUpdateControl) {
updateControl();
}
border_mc.draw();
}
function invalidateStyle(propName) {
if (isRowStyle[propName]) {
invUpdateControl = true;
invalidate();
} else {
var _local3 = 0;
while (_local3 < __rowCount) {
rows[_local3].invalidateStyle(propName);
_local3++;
}
}
super.invalidateStyle(propName);
}
static var mixIt1 = mx.controls.listclasses.DataSelector.Initialize(mx.controls.listclasses.ScrollSelectList);
static var mixIt2 = mx.controls.listclasses.DataProvider.Initialize(Array);
var CONTENTDEPTH = 100;
var __hPosition = 0;
var __rowRenderer = "SelectableRow";
var __rowHeight = 22;
var __rowCount = 0;
var __labelField = "label";
var minScrollInterval = 30;
var dropEnabled = false;
var dragEnabled = false;
var className = "ScrollSelectList";
var isRowStyle = {styleName:true, backgroundColor:true, selectionColor:true, rollOverColor:true, selectionDisabledColor:true, backgroundDisabledColor:true, textColor:true, textSelectedColor:true, textRollOverColor:true, textDisabledColor:true, alternatingRowColors:true, defaultIcon:true};
var roundUp = 0;
var selectable = true;
var multipleSelection = false;
}
Symbol 968 MovieClip [__Packages.mx.controls.List] Frame 0
class mx.controls.List extends mx.controls.listclasses.ScrollSelectList
{
var border_mc, __labels, setDataProvider, roundUp, __get__rowCount, __dataProvider, __maxHPosition, invScrollProps, invalidate, __vPosition, getViewMetrics, setSize, __width, __rowHeight, totalWidth, totalHeight, displayWidth, __hScrollPolicy, vScroller, __hPosition, listContent, data, mask_mc, __height, __rowCount, invRowHeight, invLayoutContent, setScrollProperties, oldVWidth;
function List () {
super();
}
function setEnabled(v) {
super.setEnabled(v);
border_mc.backgroundColorName = (v ? "backgroundColor" : "backgroundDisabledColor");
border_mc.invalidate();
}
function get labels() {
return(__labels);
}
function set labels(lbls) {
__labels = lbls;
setDataProvider(lbls);
//return(labels);
}
function setVPosition(pos) {
pos = Math.min((__dataProvider.length - __get__rowCount()) + roundUp, pos);
pos = Math.max(0, pos);
super.setVPosition(pos);
}
function setHPosition(pos) {
pos = Math.max(Math.min(__maxHPosition, pos), 0);
super.setHPosition(pos);
hScroll(pos);
}
function setMaxHPosition(pos) {
__maxHPosition = pos;
invScrollProps = true;
invalidate();
}
function setHScrollPolicy(policy) {
if ((policy.toLowerCase() == "auto") && (!autoHScrollAble)) {
return(undefined);
}
super.setHScrollPolicy(policy);
if (policy == "off") {
setHPosition(0);
setVPosition(Math.min((__dataProvider.length - __get__rowCount()) + roundUp, __vPosition));
}
}
function setRowCount(rC) {
if (isNaN(rC)) {
return(undefined);
}
var _local2 = getViewMetrics();
setSize(__width, ((__rowHeight * rC) + _local2.top) + _local2.bottom);
}
function layoutContent(x, y, tW, tH, dW, dH) {
totalWidth = tW;
totalHeight = tH;
displayWidth = dW;
var _local4 = (((__hScrollPolicy == "on") || (__hScrollPolicy == "auto")) ? (Math.max(tW, dW)) : (dW));
super.layoutContent(x, y, _local4, dH);
}
function modelChanged(eventObj) {
super.modelChanged(eventObj);
var _local3 = eventObj.eventName;
if ((((_local3 == "addItems") || (_local3 == "removeItems")) || (_local3 == "updateAll")) || (_local3 == "filterModel")) {
invScrollProps = true;
invalidate("invScrollProps");
}
}
function onScroll(eventObj) {
var _local3 = eventObj.target;
if (_local3 == vScroller) {
setVPosition(_local3.scrollPosition);
} else {
hScroll(_local3.scrollPosition);
}
super.onScroll(eventObj);
}
function hScroll(pos) {
__hPosition = pos;
listContent._x = -pos;
}
function init(Void) {
super.init();
if (labels.length > 0) {
var _local6 = new Array();
var _local3 = 0;
while (_local3 < labels.length) {
_local6.addItem({label:labels[_local3], data:data[_local3]});
_local3++;
}
setDataProvider(_local6);
}
__maxHPosition = 0;
}
function createChildren(Void) {
super.createChildren();
listContent.setMask(mask_mc);
border_mc.move(0, 0);
border_mc.setSize(__width, __height);
}
function getRowCount(Void) {
var _local2 = getViewMetrics();
return(((__rowCount == 0) ? (Math.ceil(((__height - _local2.top) - _local2.bottom) / __rowHeight)) : (__rowCount)));
}
function size(Void) {
super.size();
configureScrolling();
var _local3 = getViewMetrics();
layoutContent(_local3.left, _local3.top, __width + __maxHPosition, totalHeight, (__width - _local3.left) - _local3.right, (__height - _local3.top) - _local3.bottom);
}
function draw(Void) {
if (invRowHeight) {
invScrollProps = true;
super.draw();
listContent.setMask(mask_mc);
invLayoutContent = true;
}
if (invScrollProps) {
configureScrolling();
delete invScrollProps;
}
if (invLayoutContent) {
var _local3 = getViewMetrics();
layoutContent(_local3.left, _local3.top, __width + __maxHPosition, totalHeight, (__width - _local3.left) - _local3.right, (__height - _local3.top) - _local3.bottom);
}
super.draw();
}
function configureScrolling(Void) {
var _local2 = __dataProvider.length;
if (__vPosition > Math.max(0, (_local2 - getRowCount()) + roundUp)) {
setVPosition(Math.max(0, Math.min((_local2 - getRowCount()) + roundUp, __vPosition)));
}
var _local3 = getViewMetrics();
var _local4 = ((__hScrollPolicy != "off") ? (((__maxHPosition + __width) - _local3.left) - _local3.right) : ((__width - _local3.left) - _local3.right));
if (_local2 == undefined) {
_local2 = 0;
}
setScrollProperties(_local4, 1, _local2, __rowHeight);
if (oldVWidth != _local4) {
invLayoutContent = true;
}
oldVWidth = _local4;
}
static var symbolOwner = mx.controls.List;
static var symbolName = "List";
var className = "List";
static var version = "2.0.2.126";
var clipParameters = {rowHeight:1, enabled:1, visible:1, labels:1};
var scrollDepth = 1;
var __vScrollPolicy = "on";
var autoHScrollAble = false;
}
Symbol 969 MovieClip [__Packages.mx.effects.Tween] Frame 0
class mx.effects.Tween extends Object
{
static var IntervalToken;
var arrayMode, listener, initVal, endVal, startTime, updateFunc, endFunc, ID;
function Tween (listenerObj, init, end, dur) {
super();
if (listenerObj == undefined) {
return;
}
if (typeof(init) != "number") {
arrayMode = true;
}
listener = listenerObj;
initVal = init;
endVal = end;
if (dur != undefined) {
duration = dur;
}
startTime = getTimer();
if (duration == 0) {
endTween();
} else {
AddTween(this);
}
}
static function AddTween(tween) {
tween.ID = ActiveTweens.length;
ActiveTweens.push(tween);
if (IntervalToken == undefined) {
Dispatcher.DispatchTweens = DispatchTweens;
IntervalToken = setInterval(Dispatcher, "DispatchTweens", Interval);
}
}
static function RemoveTweenAt(index) {
var _local2 = ActiveTweens;
if (((index >= _local2.length) || (index < 0)) || (index == undefined)) {
return(undefined);
}
_local2.splice(index, 1);
var _local4 = _local2.length;
var _local1 = index;
while (_local1 < _local4) {
_local2[_local1].ID--;
_local1++;
}
if (_local4 == 0) {
clearInterval(IntervalToken);
delete IntervalToken;
}
}
static function DispatchTweens(Void) {
var _local2 = ActiveTweens;
var _local3 = _local2.length;
var _local1 = 0;
while (_local1 < _local3) {
_local2[_local1].doInterval();
_local1++;
}
updateAfterEvent();
}
function doInterval() {
var _local2 = getTimer() - startTime;
var _local3 = getCurVal(_local2);
if (_local2 >= duration) {
endTween();
} else if (updateFunc != undefined) {
listener[updateFunc](_local3);
} else {
listener.onTweenUpdate(_local3);
}
}
function getCurVal(curTime) {
if (arrayMode) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < initVal.length) {
_local3[_local2] = easingEquation(curTime, initVal[_local2], endVal[_local2] - initVal[_local2], duration);
_local2++;
}
return(_local3);
}
return(easingEquation(curTime, initVal, endVal - initVal, duration));
}
function endTween() {
if (endFunc != undefined) {
listener[endFunc](endVal);
} else {
listener.onTweenEnd(endVal);
}
RemoveTweenAt(ID);
}
function setTweenHandlers(update, end) {
updateFunc = update;
endFunc = end;
}
function easingEquation(t, b, c, d) {
return(((c / 2) * (Math.sin(Math.PI * ((t / d) - 0.5)) + 1)) + b);
}
static var ActiveTweens = new Array();
static var Interval = 10;
static var Dispatcher = new Object();
var duration = 3000;
}
Symbol 970 MovieClip [__Packages.mx.controls.listclasses.SelectableRow] Frame 0
class mx.controls.listclasses.SelectableRow extends mx.core.UIComponent
{
var __height, cell, owner, rowIndex, icon_mc, createObject, __width, backGround, highlight, highlightColor, createLabel, createClassObject, listOwner, tabEnabled, item, createEmptyMovieClip, drawRect, isChangedToSelected, bGTween, grandOwner;
function SelectableRow () {
super();
}
function setValue(itmObj, state) {
var _local7 = __height;
var _local2 = cell;
var _local5 = owner;
var _local8 = itemToString(itmObj);
if (_local2.getValue() != _local8) {
_local2.setValue(_local8, itmObj, state);
}
var _local4 = _local5.getPropertiesAt(rowIndex + _local5.__vPosition).icon;
if (_local4 == undefined) {
_local4 = _local5.__iconFunction(itmObj);
if (_local4 == undefined) {
_local4 = itmObj[_local5.__iconField];
if (_local4 == undefined) {
_local4 = _local5.getStyle("defaultIcon");
}
}
}
var _local3 = icon_mc;
if ((_local4 != undefined) && (itmObj != undefined)) {
_local3 = createObject(_local4, "icon_mc", 20);
_local3._x = 2;
_local3._y = (_local7 - _local3._height) / 2;
_local2._x = 4 + _local3._width;
} else {
_local3.removeMovieClip();
_local2._x = 2;
}
var _local9 = ((_local3 == undefined) ? 0 : (_local3._width));
_local2.setSize(__width - _local9, Math.min(_local7, _local2.getPreferredHeight()));
_local2._y = (_local7 - _local2._height) / 2;
}
function size(Void) {
var _local3 = backGround;
var _local2 = cell;
var _local4 = __height;
var _local5 = __width;
var _local6 = ((icon_mc == undefined) ? 0 : (icon_mc._width));
_local2.setSize(_local5 - _local6, Math.min(_local4, _local2.getPreferredHeight()));
_local2._y = (_local4 - _local2._height) / 2;
icon_mc._y = (_local4 - icon_mc._height) / 2;
_local3._x = 0;
_local3._width = _local5;
_local3._height = _local4;
drawRowFill(_local3, normalColor);
drawRowFill(highlight, highlightColor);
}
function setCellRenderer(forceSizing) {
var _local3 = owner.__cellRenderer;
var _local4;
if (cell != undefined) {
_local4 = cell._x;
cell.removeMovieClip();
cell.removeTextField();
}
var _local2;
if (_local3 == undefined) {
_local2 = (cell = createLabel("cll", 0, {styleName:this}));
_local2.styleName = owner;
_local2.selectable = false;
_local2.tabEnabled = false;
_local2.background = false;
_local2.border = false;
} else if (typeof(_local3) == "string") {
_local2 = (cell = createObject(_local3, "cll", 0, {styleName:this}));
} else {
_local2 = (cell = createClassObject(_local3, "cll", 0, {styleName:this}));
}
_local2.owner = this;
_local2.listOwner = owner;
_local2.getCellIndex = getCellIndex;
_local2.getDataLabel = getDataLabel;
if (_local4 != undefined) {
_local2._x = _local4;
}
if (forceSizing) {
size();
}
}
function getCellIndex(Void) {
return({columnIndex:0, itemIndex:owner.rowIndex + listOwner.__vPosition});
}
function getDataLabel() {
return(listOwner.labelField);
}
function init(Void) {
super.init();
tabEnabled = false;
}
function createChildren(Void) {
setCellRenderer(false);
setupBG();
setState(state, false);
}
function drawRow(itmObj, state, transition) {
item = itmObj;
setState(state, transition);
setValue(itmObj, state, transition);
}
function itemToString(itmObj) {
if (itmObj == undefined) {
return(" ");
}
var _local2 = owner.__labelFunction(itmObj);
if (_local2 == undefined) {
_local2 = ((itmObj instanceof XMLNode) ? (itmObj.attributes[owner.__labelField]) : (itmObj[owner.__labelField]));
if (_local2 == undefined) {
_local2 = " ";
if (typeof(itmObj) == "object") {
for (var _local4 in itmObj) {
if (_local4 != "__ID__") {
_local2 = (itmObj[_local4] + ", ") + _local2;
}
}
_local2 = _local2.substring(0, _local2.length - 2);
} else {
_local2 = itmObj;
}
}
}
return(_local2);
}
function setupBG(Void) {
var _local2 = (backGround = createEmptyMovieClip("bG_mc", LOWEST_DEPTH));
drawRowFill(_local2, normalColor);
highlight = createEmptyMovieClip("tran_mc", LOWEST_DEPTH + 10);
_local2.owner = this;
_local2.grandOwner = owner;
_local2.onPress = bGOnPress;
_local2.onRelease = bGOnRelease;
_local2.onRollOver = bGOnRollOver;
_local2.onRollOut = bGOnRollOut;
_local2.onDragOver = bGOnDragOver;
_local2.onDragOut = bGOnDragOut;
_local2.useHandCursor = false;
_local2.trackAsMenu = true;
_local2.drawRect = drawRect;
highlight.drawRect = drawRect;
}
function drawRowFill(mc, newClr) {
mc.clear();
mc.beginFill(newClr);
mc.drawRect(1, 0, __width, __height);
mc.endFill();
mc._width = __width;
mc._height = __height;
}
function setState(newState, transition) {
var _local2 = highlight;
var _local8 = backGround;
var _local4 = __height;
var _local3 = owner;
if (!_local3.enabled) {
if ((newState == "selected") || (state == "selected")) {
highlightColor = _local3.getStyle("selectionDisabledColor");
drawRowFill(_local2, highlightColor);
_local2._visible = true;
_local2._y = 0;
_local2._height = _local4;
} else {
_local2._visible = false;
normalColor = _local3.getStyle("backgroundDisabledColor");
drawRowFill(_local8, normalColor);
}
cell.__enabled = false;
cell.setColor(_local3.getStyle("disabledColor"));
} else {
cell.__enabled = true;
if (transition && ((newState == state) || ((newState == "highlighted") && (state == "selected")))) {
isChangedToSelected = true;
return(undefined);
}
var _local6 = _local3.getStyle("selectionDuration");
var _local7 = 0;
if (isChangedToSelected && (newState == "selected")) {
transition = false;
}
var _local10 = transition && (_local6 != 0);
if (newState == "normal") {
_local7 = _local3.getStyle("color");
normalColor = getNormalColor();
drawRowFill(_local8, normalColor);
if (_local10) {
_local6 = _local6 / 2;
_local2._height = _local4;
_local2._width = __width;
_local2._y = 0;
bGTween = new mx.effects.Tween(this, _local4 + 2, _local4 * 0.2, _local6, 5);
} else {
_local2._visible = false;
}
delete isChangedToSelected;
} else {
highlightColor = _local3.getStyle(((newState == "highlighted") ? "rollOverColor" : "selectionColor"));
drawRowFill(_local2, highlightColor);
_local2._visible = true;
_local7 = _local3.getStyle(((newState == "highlighted") ? "textRollOverColor" : "textSelectedColor"));
if (_local10) {
_local2._height = _local4 * 0.5;
_local2._y = (_local4 - _local2._height) / 2;
bGTween = new mx.effects.Tween(this, _local2._height, _local4 + 2, _local6, 5);
var _local9 = _local3.getStyle("selectionEasing");
if (_local9 != undefined) {
bGTween.easingEquation = _local9;
}
} else {
_local2._y = 0;
_local2._height = _local4;
}
}
cell.setColor(_local7);
}
state = newState;
}
function onTweenUpdate(val) {
highlight._height = val;
highlight._y = (__height - val) / 2;
}
function onTweenEnd(val) {
onTweenUpdate(val);
highlight._visible = state != "normal";
}
function getNormalColor(Void) {
var _local3;
var _local2 = owner;
if (!owner.enabled) {
_local3 = _local2.getStyle("backgroundDisabledColor");
} else {
var _local5 = rowIndex + _local2.__vPosition;
if (rowIndex == undefined) {
_local3 = _local2.getPropertiesOf(item).backgroundColor;
} else {
_local3 = _local2.getPropertiesAt(_local5).backgroundColor;
}
if (_local3 == undefined) {
var _local4 = _local2.getStyle("alternatingRowColors");
if (_local4 == undefined) {
_local3 = _local2.getStyle("backgroundColor");
} else {
_local3 = _local4[_local5 % _local4.length];
}
}
}
return(_local3);
}
function invalidateStyle(propName) {
cell.invalidateStyle(propName);
super.invalidateStyle(propName);
}
function bGOnPress(Void) {
grandOwner.pressFocus();
grandOwner.onRowPress(owner.rowIndex);
}
function bGOnRelease(Void) {
grandOwner.releaseFocus();
grandOwner.onRowRelease(owner.rowIndex);
}
function bGOnRollOver(Void) {
grandOwner.onRowRollOver(owner.rowIndex);
}
function bGOnRollOut(Void) {
grandOwner.onRowRollOut(owner.rowIndex);
}
function bGOnDragOver(Void) {
grandOwner.onRowDragOver(owner.rowIndex);
}
function bGOnDragOut(Void) {
grandOwner.onRowDragOut(owner.rowIndex);
}
static var LOWEST_DEPTH = -16384;
var state = "normal";
var disabledColor = 15263976;
var normalColor = 16777215;
}
Symbol 971 MovieClip [__Packages.mx.controls.HScrollBar] Frame 0
class mx.controls.HScrollBar extends mx.controls.scrollClasses.ScrollBar
{
var _minHeight, _minWidth, _xscale, _rotation, __width, scrollIt;
function HScrollBar () {
super();
}
function getMinWidth(Void) {
return(_minHeight);
}
function getMinHeight(Void) {
return(_minWidth);
}
function init(Void) {
super.init();
_xscale = -100;
_rotation = -90;
}
function get virtualHeight() {
return(__width);
}
function isScrollBarKey(k) {
if (k == 37) {
scrollIt("Line", -1);
return(true);
}
if (k == 39) {
scrollIt("Line", 1);
return(true);
}
return(super.isScrollBarKey(k));
}
static var symbolName = "HScrollBar";
static var symbolOwner = mx.core.UIComponent;
static var version = "2.0.2.126";
var className = "HScrollBar";
var minusMode = "Left";
var plusMode = "Right";
var minMode = "AtLeft";
var maxMode = "AtRight";
}
Symbol 972 MovieClip [__Packages.mx.controls.VScrollBar] Frame 0
class mx.controls.VScrollBar extends mx.controls.scrollClasses.ScrollBar
{
var scrollIt;
function VScrollBar () {
super();
}
function init(Void) {
super.init();
}
function isScrollBarKey(k) {
if (k == 38) {
scrollIt("Line", -1);
return(true);
}
if (k == 40) {
scrollIt("Line", 1);
return(true);
}
if (k == 33) {
scrollIt("Page", -1);
return(true);
}
if (k == 34) {
scrollIt("Page", 1);
return(true);
}
return(super.isScrollBarKey(k));
}
static var symbolName = "VScrollBar";
static var symbolOwner = mx.core.UIComponent;
static var version = "2.0.2.126";
var className = "VScrollBar";
var minusMode = "Up";
var plusMode = "Down";
var minMode = "AtTop";
var maxMode = "AtBottom";
}
Symbol 1696 MovieClip [__Packages.mx.controls.NumericStepper] Frame 0
class mx.controls.NumericStepper extends mx.core.UIComponent
{
var boundingBox_mc, _visible, tabEnabled, tabChildren, nextButton_mc, __width, prevButton_mc, __height, inputField, StepTrack_mc, focusTextField, createObject, enabled, __set__visible, setSize, createClassObject, __maxChars, dispatchEvent;
function NumericStepper () {
super();
}
function init() {
super.init();
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
_visible = false;
tabEnabled = false;
tabChildren = true;
}
function setVisible(x, noEvent) {
super.setVisible(x, noEvent);
if (initializing) {
__visible = x;
}
}
function layoutControl() {
nextButton_mc._x = __width - nextButton_mc.__width;
nextButton_mc._y = 0;
prevButton_mc._x = __width - prevButton_mc.__width;
prevButton_mc._y = __height - prevButton_mc.__height;
inputField.setSize(__width - nextButton_mc.__width, __height);
StepTrack_mc._width = Math.max(nextButton_mc.__width, prevButton_mc.__width);
StepTrack_mc._x = __width - StepTrack_mc._width;
StepTrack_mc._height = __height - (nextButton_mc._height + prevButton_mc._height);
StepTrack_mc._y = nextButton_mc.__height;
}
function createChildren() {
super.createChildren();
addAsset("nextButton_mc", skinIDUpArrow);
addAsset("prevButton_mc", skinIDDownArrow);
addAsset("inputField", skinIDInput);
focusTextField = inputField.label;
createObject("StepTrack", "StepTrack_mc", 2);
size();
}
function draw() {
prevButton_mc.enabled = enabled;
nextButton_mc.enabled = enabled;
inputField.enabled = enabled;
size();
initializing = false;
__set__visible(__visible);
}
function size() {
var _local2 = calcMinHeight();
var _local3 = calcMinWidth();
if (__height < _local2) {
setSize(__width, _local2);
}
if (__width < _local3) {
setSize(_local3, __height);
}
layoutControl();
}
function calcMinHeight() {
return(22);
}
function calcMinWidth() {
return(40);
}
function addAsset(id, skinID) {
var _local2 = new Object();
_local2.styleName = this;
if (skinID == 10) {
_local2.falseUpSkin = upArrowUp;
_local2.falseOverSkin = upArrowOver;
_local2.falseDownSkin = upArrowDown;
_local2.falseDisabledSkin = upArrowDisabled;
createClassObject(mx.controls.SimpleButton, id, skinID, _local2);
var _local5 = nextButton_mc;
_local5.tabEnabled = false;
_local5.styleName = this;
_local5._x = __width - _local5.__width;
_local5._y = 0;
_local5.owner = this;
_local5.autoRepeat = true;
_local5.clickHandler = function () {
Selection.setSelection(0, 0);
};
_local5.buttonDownHandler = function () {
this.owner.buttonPress(this);
};
} else if (skinID == 11) {
_local2.falseUpSkin = downArrowUp;
_local2.falseOverSkin = downArrowOver;
_local2.falseDownSkin = downArrowDown;
_local2.falseDisabledSkin = downArrowDisabled;
createClassObject(mx.controls.SimpleButton, id, skinID, _local2);
var _local3 = prevButton_mc;
_local3.tabEnabled = false;
_local3.styleName = this;
_local3._x = __width - _local3.__width;
_local3._y = __height - _local3.__height;
_local3.owner = this;
_local3.autoRepeat = true;
_local3.clickHandler = function () {
Selection.setSelection(0, 0);
};
_local3.buttonDownHandler = function () {
this.owner.buttonPress(this);
};
} else if (skinID == 9) {
createClassObject(mx.controls.TextInput, id, skinID);
var _local4 = inputField;
_local4.styleName = this;
_local4.setSize(__width - nextButton_mc.__width, __height);
_local4.restrict = "0-9\\-\\.\\,";
_local4.maxChars = __maxChars;
_local4.text = value;
_local4.onSetFocus = function () {
this._parent.onSetFocus();
};
_local4.onKillFocus = function () {
this._parent.onKillFocus();
};
_local4.drawFocus = function (b) {
this._parent.drawFocus(b);
};
_local4.onKeyDown = function () {
this._parent.onFieldKeyDown();
};
}
}
function setFocus() {
Selection.setFocus(inputField);
}
function onKillFocus() {
mx.managers.SystemManager.form.focusManager.defaultPushButtonEnabled = true;
super.onKillFocus();
Key.removeListener(inputField);
if (Number(inputField.text) != value) {
var _local3 = checkValidValue(Number(inputField.text));
inputField.text = _local3;
value = (_local3);
dispatchEvent({type:"change"});
}
}
function onSetFocus() {
super.onSetFocus();
Key.addListener(inputField);
mx.managers.SystemManager.form.focusManager.defaultPushButtonEnabled = false;
}
function onFieldKeyDown() {
var _local2 = value;
switch (Key.getCode()) {
case 40 :
var _local3 = value - stepSize;
value = (_local3);
if (_local2 != value) {
dispatchEvent({type:"change"});
}
break;
case 38 :
_local3 = stepSize + value;
value = (_local3);
if (_local2 != value) {
dispatchEvent({type:"change"});
}
break;
case 36 :
inputField.text = minimum;
value = (minimum);
if (_local2 != value) {
dispatchEvent({type:"change"});
}
break;
case 35 :
inputField.text = maximum;
value = (maximum);
if (_local2 != value) {
dispatchEvent({type:"change"});
}
break;
case 13 :
value = (Number(inputField.text));
if (_local2 == value) {
break;
}
dispatchEvent({type:"change"});
}
}
function get nextValue() {
if (checkRange(value + stepSize)) {
__nextValue = value + stepSize;
return(__nextValue);
}
}
function get previousValue() {
if (checkRange(__value - stepSize)) {
__previousValue = value - stepSize;
return(__previousValue);
}
}
function set maxChars(num) {
__maxChars = num;
inputField.maxChars = __maxChars;
//return(maxChars);
}
function get maxChars() {
return(__maxChars);
}
function get value() {
return(__value);
}
function set value(v) {
var _local2 = checkValidValue(v);
if (_local2 == __value) {
return;
}
inputField.text = (__value = _local2);
//return(value);
}
function get minimum() {
return(__minimum);
}
function set minimum(v) {
__minimum = v;
//return(minimum);
}
function get maximum() {
return(__maximum);
}
function set maximum(v) {
__maximum = v;
//return(maximum);
}
function get stepSize() {
return(__stepSize);
}
function set stepSize(v) {
__stepSize = v;
//return(stepSize);
}
function onFocus() {
}
function buttonPress(button) {
var _local2 = value;
if (button._name == "nextButton_mc") {
value = value + stepSize;
} else {
value = value - stepSize;
}
if (_local2 != value) {
dispatchEvent({type:"change"});
Selection.setSelection(0, 0);
}
}
function checkRange(v) {
return((v >= minimum) and (v <= maximum));
}
function checkValidValue(val) {
var _local7 = val / stepSize;
var _local9 = Math.floor(_local7);
var _local2 = stepSize;
var _local6 = minimum;
var _local5 = maximum;
if ((val > _local6) and (val < _local5)) {
if ((_local7 - _local9) == 0) {
return(val);
}
var _local8 = Math.floor(val / _local2);
var _local4 = _local8 * _local2;
if (((((val - _local4) >= (_local2 / 2)) && (_local5 >= (_local4 + _local2))) && (_local6 <= (_local4 - _local2))) || (((val + _local2) == _local5) && (((_local5 - _local4) - _local2) > 1E-14))) {
_local4 = _local4 + _local2;
}
return(_local4);
}
if (val >= _local5) {
return(_local5);
}
return(_local6);
}
function onLabelChanged(o) {
var _local2 = checkValidValue(Number(o.__get__text()));
o.__set__text(_local2);
value = (_local2);
}
function get tabIndex() {
return(inputField.tabIndex);
}
function set tabIndex(w) {
inputField.tabIndex = w;
//return(tabIndex);
}
static var symbolName = "NumericStepper";
static var symbolOwner = mx.controls.NumericStepper;
static var version = "2.0.2.126";
var className = "NumericStepper";
var upArrowUp = "StepUpArrowUp";
var upArrowDown = "StepUpArrowDown";
var upArrowOver = "StepUpArrowOver";
var upArrowDisabled = "StepUpArrowDisabled";
var downArrowUp = "StepDownArrowUp";
var downArrowDown = "StepDownArrowDown";
var downArrowOver = "StepDownArrowOver";
var downArrowDisabled = "StepDownArrowDisabled";
var skinIDUpArrow = 10;
var skinIDDownArrow = 11;
var skinIDInput = 9;
var initializing = true;
var __visible = true;
var __minimum = 0;
var __maximum = 10;
var __stepSize = 1;
var __value = 0;
var __nextValue = 0;
var __previousValue = 0;
var clipParameters = {minimum:1, maximum:1, stepSize:1, value:1, maxChars:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.NumericStepper.prototype.clipParameters, mx.core.UIComponent.prototype.clipParameters);
}
Symbol 100 MovieClip [mc_pauseToggle] Frame 1
#initclip 246
Object.registerClass("mc_pauseToggle", ToggleButton);
#endinitclip
stop();
Symbol 100 MovieClip [mc_pauseToggle] Frame 2
stop();
Symbol 133 Button
on (release) {
gotoAndPlay ("end");
}
Symbol 202 Button
on (release) {
gotoAndPlay ("start");
}
Symbol 215 Button
on (release) {
_parent.master.submitFinalScore(theNumber);
}
Symbol 221 Button
on (release) {
_parent.endMovie();
}
Symbol 222 MovieClip [themesong_credits] Frame 1
#initclip 166
Object.registerClass("themesong_credits", ThemeSong);
#endinitclip
Instance of Symbol 100 MovieClip [mc_pauseToggle] in Symbol 222 MovieClip [themesong_credits] Frame 1
onClipEvent (load) {
myFunction = function () {
if (isDown) {
_parent.stop();
} else {
_parent.play();
}
};
}
Symbol 222 MovieClip [themesong_credits] Frame 5983
stop();
Symbol 232 MovieClip [mc_parrowww] Frame 1
#initclip 167
Object.registerClass("mc_parrowww", Arrow);
#endinitclip
Symbol 234 MovieClip [mc_slider] Frame 1
#initclip 168
Object.registerClass("mc_slider", VolumeSlider);
#endinitclip
Symbol 238 Button
on (release) {
_parent.master.gotoMenu();
}
Symbol 242 Button
on (release) {
_parent.saveOptions(this);
_parent.master.gotoMenu();
}
Symbol 244 Button
on (release) {
_parent.quitTheGame();
}
Symbol 250 Button
on (release) {
_parent.restartTheGame();
}
Symbol 496 MovieClip Frame 1
stop();
Symbol 496 MovieClip Frame 2
stop();
Symbol 496 MovieClip Frame 3
stop();
Symbol 496 MovieClip Frame 4
stop();
Symbol 496 MovieClip Frame 5
stop();
Symbol 496 MovieClip Frame 6
stop();
Symbol 496 MovieClip Frame 7
stop();
Symbol 496 MovieClip Frame 8
stop();
Symbol 496 MovieClip Frame 9
stop();
Symbol 496 MovieClip Frame 10
stop();
Symbol 496 MovieClip Frame 11
stop();
Symbol 496 MovieClip Frame 12
stop();
Symbol 496 MovieClip Frame 13
stop();
Symbol 496 MovieClip Frame 14
stop();
Symbol 496 MovieClip Frame 15
stop();
Symbol 496 MovieClip Frame 16
stop();
Symbol 496 MovieClip Frame 17
stop();
Symbol 496 MovieClip Frame 18
stop();
Symbol 496 MovieClip Frame 19
stop();
Symbol 496 MovieClip Frame 20
stop();
Symbol 496 MovieClip Frame 21
stop();
Symbol 496 MovieClip Frame 22
stop();
Symbol 496 MovieClip Frame 23
stop();
Symbol 496 MovieClip Frame 24
stop();
Symbol 496 MovieClip Frame 25
stop();
Symbol 496 MovieClip Frame 26
stop();
Symbol 496 MovieClip Frame 27
stop();
Symbol 496 MovieClip Frame 28
stop();
Symbol 496 MovieClip Frame 29
stop();
Symbol 496 MovieClip Frame 30
stop();
Symbol 496 MovieClip Frame 31
stop();
Symbol 496 MovieClip Frame 32
stop();
Symbol 496 MovieClip Frame 33
stop();
Symbol 496 MovieClip Frame 34
stop();
Symbol 496 MovieClip Frame 35
stop();
Symbol 498 Button
on (release) {
_parent.master.gotoMenu();
}
Symbol 501 Button
on (release) {
tutorial.gotoAndStop(tutorial._currentframe - 1);
}
Symbol 502 Button
on (release) {
tutorial.gotoAndStop(tutorial._currentframe + 1);
}
Symbol 503 MovieClip [mc_menu] Frame 1
#initclip 169
Object.registerClass("mc_menu", MenuThingy);
#endinitclip
stop();
Instance of Symbol 50 MovieClip [RadioButton] "r_normalCursor" in Symbol 503 MovieClip [mc_menu] Frame 1
//component parameters
onClipEvent (construct) {
data = "";
groupName = "cursorGroup";
label = "normal";
labelPlacement = "right";
selected = false;
}
onClipEvent (load) {
function __f_click(eventObj) {
_parent.fancyCursorOff();
}
this.addEventListener("click", __f_click);
}
Instance of Symbol 50 MovieClip [RadioButton] "r_fancyCursor" in Symbol 503 MovieClip [mc_menu] Frame 1
//component parameters
onClipEvent (construct) {
data = "";
groupName = "cursorGroup";
label = "fancy";
labelPlacement = "right";
selected = true;
}
onClipEvent (load) {
function __f_click(eventObj) {
_parent.fancyCursorOn();
}
this.addEventListener("click", __f_click);
}
Instance of Symbol 50 MovieClip [RadioButton] "r_lowquality" in Symbol 503 MovieClip [mc_menu] Frame 1
//component parameters
onClipEvent (construct) {
data = "";
groupName = "qualityGroup";
label = "low";
labelPlacement = "right";
selected = false;
}
onClipEvent (load) {
function __f_click(eventObj) {
K.setTheQuality("low");
}
this.addEventListener("click", __f_click);
}
Instance of Symbol 50 MovieClip [RadioButton] "r_midquality" in Symbol 503 MovieClip [mc_menu] Frame 1
//component parameters
onClipEvent (construct) {
data = "";
groupName = "qualityGroup";
label = "medium";
labelPlacement = "right";
selected = false;
}
onClipEvent (load) {
function __f_click(eventObj) {
K.setTheQuality("medium");
}
this.addEventListener("click", __f_click);
}
Instance of Symbol 50 MovieClip [RadioButton] "r_highquality" in Symbol 503 MovieClip [mc_menu] Frame 1
//component parameters
onClipEvent (construct) {
data = "";
groupName = "qualityGroup";
label = "high";
labelPlacement = "right";
selected = false;
}
onClipEvent (load) {
function __f_click(eventObj) {
K.setTheQuality("high");
}
this.addEventListener("click", __f_click);
}
Symbol 503 MovieClip [mc_menu] Frame 2
stop();
Symbol 554 MovieClip Frame 1
stop();
Symbol 554 MovieClip Frame 2
stop();
Symbol 554 MovieClip Frame 3
stop();
Symbol 554 MovieClip Frame 4
stop();
Symbol 554 MovieClip Frame 5
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 1
#initclip 170
Object.registerClass("mc_buildIcon", BuildIcon);
#endinitclip
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 2
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 3
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 4
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 5
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 6
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 7
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 8
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 9
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 10
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 11
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 12
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 13
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 14
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 15
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 16
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 17
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 18
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 19
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 20
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 21
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 22
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 23
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 24
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 25
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 26
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 27
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 28
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 29
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 30
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 31
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 32
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 33
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 34
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 35
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 36
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 37
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 38
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 39
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 40
stop();
Symbol 573 MovieClip [mc_buildIcon] Frame 41
stop();
Symbol 580 MovieClip Frame 1
stop();
Symbol 580 MovieClip Frame 2
stop();
Symbol 582 MovieClip Frame 1
stop();
Symbol 582 MovieClip Frame 34
onUpgradedFinish();
Symbol 590 MovieClip Frame 2
stop();
Symbol 590 MovieClip Frame 12
stop();
Symbol 590 MovieClip Frame 22
stop();
Symbol 590 MovieClip Frame 32
stop();
Symbol 590 MovieClip Frame 33
stop();
Symbol 594 MovieClip Frame 1
stop();
Symbol 594 MovieClip Frame 15
stop();
Symbol 594 MovieClip Frame 29
stop();
Symbol 594 MovieClip Frame 43
stop();
Symbol 594 MovieClip Frame 44
stop();
Symbol 594 MovieClip Frame 45
stop();
Symbol 597 MovieClip Frame 1
stop();
Symbol 597 MovieClip Frame 11
stop();
Symbol 597 MovieClip Frame 21
stop();
Symbol 597 MovieClip Frame 30
stop();
Symbol 597 MovieClip Frame 31
stop();
Symbol 597 MovieClip Frame 33
stop();
Symbol 597 MovieClip Frame 34
stop();
Symbol 602 MovieClip Frame 1
stop();
Symbol 602 MovieClip Frame 2
stop();
Symbol 606 MovieClip Frame 2
stop();
Symbol 606 MovieClip Frame 13
stop();
Symbol 606 MovieClip Frame 23
stop();
Symbol 606 MovieClip Frame 34
stop();
Symbol 606 MovieClip Frame 35
stop();
Symbol 610 MovieClip Frame 1
stop();
Symbol 610 MovieClip Frame 2
stop();
Symbol 610 MovieClip Frame 3
stop();
Symbol 610 MovieClip Frame 4
stop();
Symbol 613 MovieClip Frame 1
stop();
Symbol 613 MovieClip Frame 2
stop();
Symbol 631 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 2
stop();
Symbol 631 MovieClip Frame 3
stop();
Symbol 631 MovieClip Frame 4
stop();
Symbol 631 MovieClip Frame 5
stop();
Symbol 631 MovieClip Frame 6
stop();
Symbol 631 MovieClip Frame 7
stop();
Symbol 631 MovieClip Frame 8
stop();
Symbol 631 MovieClip Frame 9
stop();
Symbol 631 MovieClip Frame 10
stop();
Symbol 631 MovieClip Frame 11
stop();
Symbol 631 MovieClip Frame 12
stop();
Symbol 631 MovieClip Frame 13
stop();
Symbol 631 MovieClip Frame 14
stop();
Symbol 631 MovieClip Frame 15
stop();
Symbol 631 MovieClip Frame 16
stop();
Symbol 631 MovieClip Frame 17
stop();
Symbol 634 MovieClip [mc_miniHpBar] Frame 1
#initclip 171
Object.registerClass("mc_miniHpBar", HpBar);
#endinitclip
Symbol 659 MovieClip Frame 2
stop();
Symbol 659 MovieClip Frame 70
stop();
Symbol 659 MovieClip Frame 141
stop();
Symbol 659 MovieClip Frame 213
stop();
Symbol 659 MovieClip Frame 285
stop();
Symbol 659 MovieClip Frame 357
stop();
Symbol 659 MovieClip Frame 429
stop();
Symbol 659 MovieClip Frame 436
stop();
Symbol 659 MovieClip Frame 443
stop();
Symbol 659 MovieClip Frame 515
stop();
Symbol 659 MovieClip Frame 587
stop();
Symbol 659 MovieClip Frame 659
stop();
Symbol 659 MovieClip Frame 731
stop();
Symbol 674 MovieClip Frame 1
stop();
Symbol 674 MovieClip Frame 17
stop();
Symbol 674 MovieClip Frame 26
stop();
Symbol 677 MovieClip [mc_building_CoalMine] Frame 1
#initclip 172
Object.registerClass("mc_building_CoalMine", CoalMine);
#endinitclip
stop();
Symbol 677 MovieClip [mc_building_CoalMine] Frame 32
onBounceEnd();
Symbol 681 MovieClip [mc_building_CoalPlant] Frame 1
#initclip 173
Object.registerClass("mc_building_CoalPlant", CoalPlant);
#endinitclip
stop();
Symbol 681 MovieClip [mc_building_CoalPlant] Frame 32
onBounceEnd();
gotoAndStop ("default");
Symbol 684 MovieClip Frame 1
stop();
Symbol 686 MovieClip [mc_building_factory] Frame 1
#initclip 174
Object.registerClass("mc_building_factory", Factory);
#endinitclip
stop();
Symbol 686 MovieClip [mc_building_factory] Frame 32
onBounceEnd();
gotoAndStop ("default");
Symbol 691 MovieClip [mc_building_farm] Frame 1
#initclip 175
Object.registerClass("mc_building_farm", Farm);
#endinitclip
stop();
Symbol 691 MovieClip [mc_building_farm] Frame 32
onBounceEnd();
gotoAndStop ("default");
Symbol 693 MovieClip [mc_building_FFPlant] Frame 1
#initclip 176
Object.registerClass("mc_building_FFPlant", FFPlant);
#endinitclip
stop();
Symbol 693 MovieClip [mc_building_FFPlant] Frame 32
onBounceEnd();
gotoAndStop ("default");
Symbol 711 MovieClip Frame 1
_parent.onBounceEnd();
stop();
Symbol 711 MovieClip Frame 63
_parent.onBounceEnd();
Symbol 712 MovieClip [mc_building_Flameturret] Frame 1
#initclip 177
Object.registerClass("mc_building_Flameturret", FlameTurret);
#endinitclip
Symbol 716 MovieClip [mc_building_FloodLights] Frame 1
#initclip 178
Object.registerClass("mc_building_FloodLights", FloodLights);
#endinitclip
stop();
Symbol 716 MovieClip [mc_building_FloodLights] Frame 4
playAttackSound();
Symbol 716 MovieClip [mc_building_FloodLights] Frame 12
makeLightsHappen();
Symbol 716 MovieClip [mc_building_FloodLights] Frame 46
onBounceEnd();
stop();
Symbol 731 MovieClip [mc_building_Fortress] Frame 1
#initclip 179
Object.registerClass("mc_building_Fortress", Fortress);
#endinitclip
stop();
Symbol 731 MovieClip [mc_building_Fortress] Frame 32
onBounceEnd();
gotoAndStop ("default");
Symbol 736 MovieClip [mc_building_GasPlant] Frame 1
#initclip 180
Object.registerClass("mc_building_GasPlant", GasPlant);
#endinitclip
stop();
Symbol 736 MovieClip [mc_building_GasPlant] Frame 32
onBounceEnd();
gotoAndStop ("default");
Symbol 739 MovieClip [mc_building_GeoPlant] Frame 1
#initclip 181
Object.registerClass("mc_building_GeoPlant", GeoPlant);
#endinitclip
stop();
Symbol 739 MovieClip [mc_building_GeoPlant] Frame 32
onBounceEnd();
Symbol 746 MovieClip Frame 1
_parent.onBounceEnd();
stop();
Symbol 746 MovieClip Frame 35
_parent.onBounceEnd();
Symbol 747 MovieClip [mc_building_gunturret] Frame 1
#initclip 182
Object.registerClass("mc_building_gunturret", GunTurret);
#endinitclip
Symbol 750 MovieClip [mc_building_lab] Frame 1
#initclip 183
Object.registerClass("mc_building_lab", Lab);
#endinitclip
stop();
Symbol 750 MovieClip [mc_building_lab] Frame 32
onBounceEnd();
Symbol 751 MovieClip Frame 1
stop();
Symbol 751 MovieClip Frame 13
stop();
Symbol 751 MovieClip Frame 25
stop();
Symbol 754 MovieClip [mc_building_landfill] Frame 1
#initclip 184
Object.registerClass("mc_building_landfill", Landfill);
#endinitclip
stop();
Symbol 754 MovieClip [mc_building_landfill] Frame 2
stop();
Symbol 754 MovieClip [mc_building_landfill] Frame 3
stop();
Symbol 754 MovieClip [mc_building_landfill] Frame 4
stop();
Symbol 754 MovieClip [mc_building_landfill] Frame 5
stop();
Symbol 756 MovieClip [mc_building_Mine] Frame 1
#initclip 185
Object.registerClass("mc_building_Mine", Mine);
#endinitclip
stop();
Symbol 756 MovieClip [mc_building_Mine] Frame 32
onBounceEnd();
Symbol 757 MovieClip [mc_building_nucleardump] Frame 1
#initclip 186
Object.registerClass("mc_building_nucleardump", NuclearDump);
#endinitclip
stop();
Symbol 757 MovieClip [mc_building_nucleardump] Frame 2
stop();
Symbol 757 MovieClip [mc_building_nucleardump] Frame 3
stop();
Symbol 757 MovieClip [mc_building_nucleardump] Frame 4
stop();
Symbol 757 MovieClip [mc_building_nucleardump] Frame 5
stop();
Symbol 759 MovieClip [mc_building_NuclearPlant] Frame 1
#initclip 187
Object.registerClass("mc_building_NuclearPlant", NuclearPlant);
#endinitclip
stop();
Symbol 759 MovieClip [mc_building_NuclearPlant] Frame 32
onBounceEnd();
gotoAndStop ("default");
Symbol 761 MovieClip [mc_building_OilGasWell] Frame 1
#initclip 188
Object.registerClass("mc_building_OilGasWell", OilGasWell);
#endinitclip
stop();
Symbol 761 MovieClip [mc_building_OilGasWell] Frame 32
onBounceEnd();
Symbol 765 MovieClip [mc_building_RecyclingCenter] Frame 1
#initclip 189
Object.registerClass("mc_building_RecyclingCenter", RecyclingCenter);
#endinitclip
stop();
Symbol 765 MovieClip [mc_building_RecyclingCenter] Frame 32
onBounceEnd();
Symbol 768 MovieClip [mc_building_SolarPlant] Frame 1
#initclip 190
Object.registerClass("mc_building_SolarPlant", SolarPlant);
#endinitclip
stop();
Symbol 768 MovieClip [mc_building_SolarPlant] Frame 32
onBounceEnd();
Symbol 772 MovieClip [mc_building_super_farm] Frame 1
#initclip 191
Object.registerClass("mc_building_super_farm", SuperFarm);
#endinitclip
stop();
Symbol 772 MovieClip [mc_building_super_farm] Frame 32
onBounceEnd();
Symbol 776 MovieClip [mc_building_super_GeoPlant] Frame 1
#initclip 192
Object.registerClass("mc_building_super_GeoPlant", SuperGeoPlant);
#endinitclip
stop();
Symbol 776 MovieClip [mc_building_super_GeoPlant] Frame 32
onBounceEnd();
Symbol 797 MovieClip Frame 1
stop();
Symbol 797 MovieClip Frame 2
stop();
Symbol 797 MovieClip Frame 3
stop();
Symbol 797 MovieClip Frame 4
stop();
Symbol 800 MovieClip [mc_building_super_WindPlant] Frame 1
#initclip 193
Object.registerClass("mc_building_super_WindPlant", SuperWindPlant);
#endinitclip
stop();
Symbol 800 MovieClip [mc_building_super_WindPlant] Frame 32
onBounceEnd();
Symbol 819 MovieClip [mc_building_teslaCoil] Frame 1
#initclip 194
Object.registerClass("mc_building_teslaCoil", TeslaCoil);
#endinitclip
stop();
Symbol 819 MovieClip [mc_building_teslaCoil] Frame 12
playAttackSound();
Symbol 819 MovieClip [mc_building_teslaCoil] Frame 36
onFire();
Symbol 819 MovieClip [mc_building_teslaCoil] Frame 46
onBounceEnd();
Symbol 824 MovieClip Frame 1
stop();
Symbol 824 MovieClip Frame 2
stop();
Symbol 824 MovieClip Frame 3
stop();
Symbol 824 MovieClip Frame 4
stop();
Symbol 825 MovieClip [mc_building_WindPlant] Frame 1
#initclip 195
Object.registerClass("mc_building_WindPlant", WindPlant);
#endinitclip
stop();
Symbol 825 MovieClip [mc_building_WindPlant] Frame 32
onBounceEnd();
Symbol 828 MovieClip [mc_ff] Frame 1
#initclip 196
Object.registerClass("mc_ff", FFResource);
#endinitclip
stop();
Symbol 828 MovieClip [mc_ff] Frame 2
stop();
Symbol 828 MovieClip [mc_ff] Frame 3
stop();
Symbol 828 MovieClip [mc_ff] Frame 4
stop();
Symbol 833 MovieClip [mc_fly] Frame 1
#initclip 197
Object.registerClass("mc_fly", Fly);
#endinitclip
Symbol 839 MovieClip [mc_garbage] Frame 1
#initclip 198
Object.registerClass("mc_garbage", Garbage);
#endinitclip
stop();
Symbol 839 MovieClip [mc_garbage] Frame 2
stop();
Symbol 839 MovieClip [mc_garbage] Frame 3
stop();
Symbol 839 MovieClip [mc_garbage] Frame 4
stop();
Symbol 839 MovieClip [mc_garbage] Frame 5
stop();
Symbol 839 MovieClip [mc_garbage] Frame 6
stop();
Symbol 839 MovieClip [mc_garbage] Frame 7
stop();
Symbol 839 MovieClip [mc_garbage] Frame 8
stop();
Symbol 842 MovieClip [mc_gas] Frame 1
#initclip 199
Object.registerClass("mc_gas", GasResource);
#endinitclip
stop();
Symbol 842 MovieClip [mc_gas] Frame 2
stop();
Symbol 842 MovieClip [mc_gas] Frame 3
stop();
Symbol 842 MovieClip [mc_gas] Frame 4
stop();
Symbol 843 MovieClip [mc_metal] Frame 1
#initclip 200
Object.registerClass("mc_metal", MetalResource);
#endinitclip
stop();
Symbol 843 MovieClip [mc_metal] Frame 2
stop();
Symbol 843 MovieClip [mc_metal] Frame 3
stop();
Symbol 843 MovieClip [mc_metal] Frame 4
stop();
Symbol 844 MovieClip [mc_nwaste] Frame 1
#initclip 201
Object.registerClass("mc_nwaste", NuclearWaste);
#endinitclip
stop();
Symbol 844 MovieClip [mc_nwaste] Frame 2
stop();
Symbol 844 MovieClip [mc_nwaste] Frame 3
stop();
Symbol 844 MovieClip [mc_nwaste] Frame 4
stop();
Symbol 847 MovieClip [mc_smog] Frame 1
#initclip 202
Object.registerClass("mc_smog", Smog);
#endinitclip
Symbol 847 MovieClip [mc_smog] Frame 46
stop();
timeToDie();
Symbol 847 MovieClip [mc_smog] Frame 71
stop();
timeToDie();
Symbol 847 MovieClip [mc_smog] Frame 105
stop();
timeToDie();
Symbol 848 MovieClip [mc_smokeCloud] Frame 22
_parent.halfDemolishAnim();
Symbol 848 MovieClip [mc_smokeCloud] Frame 40
_parent.onDestroyAnim();
this.removeMovieClip();
Symbol 854 MovieClip [mc_build_button_toggle] Frame 1
#initclip 203
Object.registerClass("mc_build_button_toggle", ToggleButton);
#endinitclip
stop();
Symbol 854 MovieClip [mc_build_button_toggle] Frame 2
stop();
Symbol 859 MovieClip [CheckThemeColor1] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 870 MovieClip [CheckBoxAssets] Frame 1
#initclip 146
mx.controls.CheckBox.prototype.adjustFocusRect = function () {
var _local4 = this._parent.focus_mc;
var _local2 = this.iconName;
var _local3 = this.getStyle("themeColor");
if (_local3 == undefined) {
_local3 = 8453965 /* 0x80FF4D */;
}
var _local8 = _local2._width + 4;
var _local5 = _local2._height + 4;
_local4.setSize(_local8, _local5, 0, 100, _local3);
var _local7 = _local2._x;
var _local6 = _local2._y;
_local4.move((this.x - 2) + _local7, (this.y + _local6) - 2);
};
#endinitclip
Symbol 871 MovieClip [CheckBox] Frame 1
#initclip 147
Object.registerClass("CheckBox", mx.controls.CheckBox);
#endinitclip
stop();
Instance of Symbol 34 MovieClip [Button] in Symbol 871 MovieClip [CheckBox] Frame 2
//component parameters
onClipEvent (initialize) {
icon = "";
label = "Button";
labelPlacement = "right";
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 877 MovieClip [TextInput] Frame 1
#initclip 148
Object.registerClass("TextInput", mx.controls.TextInput);
#endinitclip
stop();
Symbol 878 MovieClip [ComboBase] Frame 1
#initclip 149
mx.controls.listclasses.DataSelector.Initialize(Object(mx.controls.ComboBase).prototype);
Object.registerClass("ComboBase", mx.controls.ComboBase);
#endinitclip
stop();
Instance of Symbol 30 MovieClip [SimpleButton] in Symbol 878 MovieClip [ComboBase] Frame 2
//component parameters
onClipEvent (initialize) {
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 877 MovieClip [TextInput] in Symbol 878 MovieClip [ComboBase] Frame 2
//component parameters
onClipEvent (initialize) {
editable = true;
password = false;
text = "";
maxChars = null;
restrict = "null";
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 879 MovieClip [DataProvider] Frame 1
#initclip 150
Object.registerClass("DataProvider", mx.controls.listclasses.DataProvider);
#endinitclip
stop();
Symbol 880 MovieClip [DataSelector] Frame 1
#initclip 151
Object.registerClass("DataSelector", mx.controls.listclasses.DataSelector);
#endinitclip
stop();
Symbol 881 MovieClip [SelectableRow] Frame 1
#initclip 152
Object.registerClass("SelectableRow", mx.controls.listclasses.SelectableRow);
#endinitclip
stop();
Symbol 882 MovieClip [CustomBorder] Frame 1
#initclip 153
Object.registerClass("CustomBorder", mx.skins.CustomBorder);
mx.skins.SkinElement.registerElement("CustomBorder", mx.skins.CustomBorder);
#endinitclip
Symbol 894 MovieClip [ScrollThemeColor1] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 896 MovieClip [ScrollThemeColor2] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 907 MovieClip [ThumbThemeColor1] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 909 MovieClip [ThumbThemeColor3] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 916 MovieClip [ThumbThemeColor2] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 937 MovieClip [BtnDownArrow] Frame 1
#initclip 154
Object.registerClass("BtnDownArrow", mx.controls.SimpleButton);
#endinitclip
Symbol 938 MovieClip [BtnUpArrow] Frame 1
#initclip 155
Object.registerClass("BtnUpArrow", mx.controls.SimpleButton);
#endinitclip
Symbol 940 MovieClip [HScrollBar] Frame 1
#initclip 156
Object.registerClass("HScrollBar", mx.controls.HScrollBar);
#endinitclip
stop();
Instance of Symbol 34 MovieClip [Button] in Symbol 940 MovieClip [HScrollBar] Frame 2
//component parameters
onClipEvent (initialize) {
icon = "";
label = "Button";
labelPlacement = "right";
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 30 MovieClip [SimpleButton] in Symbol 940 MovieClip [HScrollBar] Frame 2
//component parameters
onClipEvent (initialize) {
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 941 MovieClip [VScrollBar] Frame 1
#initclip 157
Object.registerClass("VScrollBar", mx.controls.VScrollBar);
#endinitclip
stop();
Instance of Symbol 34 MovieClip [Button] in Symbol 941 MovieClip [VScrollBar] Frame 2
//component parameters
onClipEvent (initialize) {
icon = "";
label = "Button";
labelPlacement = "right";
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 30 MovieClip [SimpleButton] in Symbol 941 MovieClip [VScrollBar] Frame 2
//component parameters
onClipEvent (initialize) {
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 942 MovieClip [View] Frame 1
#initclip 158
Object.registerClass("View", mx.core.View);
#endinitclip
stop();
Symbol 943 MovieClip [ScrollView] Frame 1
#initclip 159
Object.registerClass("ScrollView", mx.core.ScrollView);
#endinitclip
stop();
Instance of Symbol 940 MovieClip [HScrollBar] in Symbol 943 MovieClip [ScrollView] Frame 2
//component parameters
onClipEvent (initialize) {
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 941 MovieClip [VScrollBar] in Symbol 943 MovieClip [ScrollView] Frame 2
//component parameters
onClipEvent (initialize) {
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 944 MovieClip [ScrollSelectList] Frame 1
#initclip 160
Object.registerClass("ScrollSelectList", mx.controls.listclasses.ScrollSelectList);
#endinitclip
stop();
Symbol 945 MovieClip [List] Frame 1
#initclip 161
Object.registerClass("List", mx.controls.List);
#endinitclip
stop();
Symbol 951 MovieClip [ComboDownArrowDisabled] Frame 1
#initclip 162
Object.registerClass("ComboDownArrowDisabled", mx.controls.SimpleButton);
#endinitclip
Symbol 953 MovieClip [ComboThemeColor1] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 956 MovieClip [ComboAssets] Frame 1
#initclip 163
mx.controls.ComboBox.prototype.downArrowUpName = "ComboDownArrowUp";
mx.controls.ComboBox.prototype.downArrowDownName = "ComboDownArrowDown";
mx.controls.ComboBox.prototype.downArrowOverName = "ComboDownArrowOver";
mx.controls.ComboBox.prototype.downArrowDisabledName = "ComboDownArrowDisabled";
mx.controls.ComboBox.prototype.wrapDownArrowButton = false;
mx.controls.ComboBox.prototype.dropDownBorderStyle = "solid";
mx.controls.ComboBox.prototype.adjustFocusRect = function () {
var _local2 = this.getStyle("themeColor");
if (_local2 == undefined) {
_local2 = 8453965 /* 0x80FF4D */;
}
var _local3 = this._parent.focus_mc;
_local3.setSize(this.width + 4, this.height + 4, {bl:0, tl:0, tr:5, br:5}, 100, _local2);
_local3.move(this.x - 2, this.y - 2);
};
#endinitclip
Symbol 957 MovieClip [ComboBox] Frame 1
#initclip 164
Object.registerClass("ComboBox", mx.controls.ComboBox);
#endinitclip
stop();
Instance of Symbol 945 MovieClip [List] in Symbol 957 MovieClip [ComboBox] Frame 2
//component parameters
onClipEvent (initialize) {
multipleSelection = false;
rowHeight = 20;
}
Symbol 978 MovieClip [mc_cost] Frame 1
#initclip 204
Object.registerClass("mc_cost", CostDisplay);
#endinitclip
Instance of Symbol 631 MovieClip "resource2" in Symbol 978 MovieClip [mc_cost] Frame 1
onClipEvent (load) {
this.gotoAndStop("metal");
}
Symbol 986 MovieClip [mc_disabletoggle] Frame 1
#initclip 205
Object.registerClass("mc_disabletoggle", ToggleButton);
#endinitclip
stop();
Symbol 986 MovieClip [mc_disabletoggle] Frame 2
stop();
Symbol 991 MovieClip [mc_hpbar] Frame 1
#initclip 206
Object.registerClass("mc_hpbar", HpBar);
#endinitclip
Symbol 993 MovieClip [mc_inspect_button_toggle] Frame 1
#initclip 207
Object.registerClass("mc_inspect_button_toggle", ToggleButton);
#endinitclip
stop();
Symbol 993 MovieClip [mc_inspect_button_toggle] Frame 2
stop();
Symbol 995 MovieClip [mc_levelStatus] Frame 1
#initclip 208
Object.registerClass("mc_levelStatus", LevelStatus);
#endinitclip
stop();
Symbol 995 MovieClip [mc_levelStatus] Frame 2
stop();
Symbol 995 MovieClip [mc_levelStatus] Frame 3
stop();
Symbol 995 MovieClip [mc_levelStatus] Frame 4
stop();
Symbol 995 MovieClip [mc_levelStatus] Frame 5
stop();
Symbol 995 MovieClip [mc_levelStatus] Frame 6
stop();
Symbol 995 MovieClip [mc_levelStatus] Frame 7
stop();
Symbol 995 MovieClip [mc_levelStatus] Frame 8
stop();
Symbol 996 MovieClip [mc_levelStatus_1] Frame 1
#initclip 209
Object.registerClass("mc_levelStatus_1", LevelStatus1);
#endinitclip
stop();
Symbol 996 MovieClip [mc_levelStatus_1] Frame 2
stop();
Symbol 996 MovieClip [mc_levelStatus_1] Frame 3
stop();
Symbol 996 MovieClip [mc_levelStatus_1] Frame 4
stop();
Symbol 996 MovieClip [mc_levelStatus_1] Frame 5
stop();
Symbol 996 MovieClip [mc_levelStatus_1] Frame 6
stop();
Symbol 996 MovieClip [mc_levelStatus_1] Frame 7
stop();
Symbol 996 MovieClip [mc_levelStatus_1] Frame 8
stop();
Symbol 998 Button
on (release) {
_parent.master.showCurrObjective();
}
Symbol 1000 MovieClip [mc_objective] Frame 1
#initclip 210
Object.registerClass("mc_objective", Objective);
#endinitclip
Symbol 1004 MovieClip [mc_progressbar] Frame 1
#initclip 211
Object.registerClass("mc_progressbar", ProgressBar);
#endinitclip
Symbol 1008 MovieClip Frame 1
stop();
Symbol 1008 MovieClip Frame 11
stop();
Symbol 1008 MovieClip Frame 21
stop();
Symbol 1008 MovieClip Frame 31
stop();
Symbol 1008 MovieClip Frame 32
stop();
Symbol 1017 MovieClip [mc_r_coal] Frame 1
#initclip 212
Object.registerClass("mc_r_coal", ResourceAmount);
#endinitclip
stop();
Symbol 1017 MovieClip [mc_r_coal] Frame 2
stop();
Symbol 1022 MovieClip Frame 1
stop();
Symbol 1022 MovieClip Frame 6
stop();
Symbol 1022 MovieClip Frame 19
stop();
gotoAndStop ("default");
Symbol 1022 MovieClip Frame 32
stop();
gotoAndStop ("default");
Symbol 1022 MovieClip Frame 45
stop();
gotoAndStop ("default");
Symbol 1030 MovieClip Frame 1
stop();
Symbol 1030 MovieClip Frame 2
stop();
Symbol 1030 MovieClip Frame 3
stop();
Symbol 1043 MovieClip [mc_r_energy] Frame 1
#initclip 213
Object.registerClass("mc_r_energy", ResourceAmount);
#endinitclip
stop();
Symbol 1043 MovieClip [mc_r_energy] Frame 2
stop();
Symbol 1043 MovieClip [mc_r_energy] Frame 3
stop();
Symbol 1043 MovieClip [mc_r_energy] Frame 4
stop();
Symbol 1043 MovieClip [mc_r_energy] Frame 5
stop();
Symbol 1043 MovieClip [mc_r_energy] Frame 6
stop();
Symbol 1047 MovieClip [mc_r_ethanol] Frame 1
#initclip 214
Object.registerClass("mc_r_ethanol", ResourceAmount);
#endinitclip
stop();
Symbol 1047 MovieClip [mc_r_ethanol] Frame 2
stop();
Symbol 1051 MovieClip [mc_r_FF] Frame 1
#initclip 215
Object.registerClass("mc_r_FF", ResourceAmount);
#endinitclip
stop();
Symbol 1051 MovieClip [mc_r_FF] Frame 2
stop();
Symbol 1060 MovieClip [mc_r_food] Frame 1
#initclip 216
Object.registerClass("mc_r_food", ResourceAmount);
#endinitclip
stop();
Symbol 1060 MovieClip [mc_r_food] Frame 2
stop();
Symbol 1060 MovieClip [mc_r_food] Frame 3
stop();
Symbol 1060 MovieClip [mc_r_food] Frame 4
stop();
Symbol 1060 MovieClip [mc_r_food] Frame 5
stop();
Symbol 1060 MovieClip [mc_r_food] Frame 6
stop();
Symbol 1065 MovieClip [mc_r_gas] Frame 1
#initclip 217
Object.registerClass("mc_r_gas", ResourceAmount);
#endinitclip
stop();
Symbol 1065 MovieClip [mc_r_gas] Frame 2
stop();
Symbol 1069 MovieClip [mc_r_metal] Frame 1
#initclip 218
Object.registerClass("mc_r_metal", ResourceAmount);
#endinitclip
stop();
Symbol 1069 MovieClip [mc_r_metal] Frame 2
stop();
Symbol 1073 MovieClip [mc_r_research] Frame 1
#initclip 219
Object.registerClass("mc_r_research", ResourceAmount);
#endinitclip
stop();
Symbol 1073 MovieClip [mc_r_research] Frame 2
stop();
Symbol 1079 MovieClip Frame 1
stop();
Symbol 1079 MovieClip Frame 2
stop();
Symbol 1079 MovieClip Frame 3
stop();
Symbol 1079 MovieClip Frame 4
stop();
Symbol 1079 MovieClip Frame 5
stop();
Symbol 1079 MovieClip Frame 6
stop();
Symbol 1079 MovieClip Frame 7
stop();
Symbol 1079 MovieClip Frame 8
stop();
Symbol 1079 MovieClip Frame 9
stop();
Symbol 1079 MovieClip Frame 10
stop();
Symbol 1085 MovieClip [mc_r_smog] Frame 1
#initclip 220
Object.registerClass("mc_r_smog", ResourceAmount);
#endinitclip
stop();
Symbol 1085 MovieClip [mc_r_smog] Frame 2
stop();
Symbol 1085 MovieClip [mc_r_smog] Frame 3
stop();
Symbol 1085 MovieClip [mc_r_smog] Frame 4
stop();
Symbol 1099 MovieClip [mc_toggle_deploy] Frame 1
#initclip 221
Object.registerClass("mc_toggle_deploy", ToggleButton);
#endinitclip
stop();
Symbol 1099 MovieClip [mc_toggle_deploy] Frame 2
stop();
Symbol 1110 MovieClip Frame 1
stop();
Symbol 1114 MovieClip Frame 6
stop();
Symbol 1123 MovieClip Frame 1
stop();
Symbol 1131 MovieClip Frame 6
stop();
Symbol 1135 Button
on (release) {
_parent.onCancelBuild();
}
Symbol 1141 MovieClip [mc_unitProduction] Frame 1
#initclip 222
Object.registerClass("mc_unitProduction", UnitProduction);
#endinitclip
stop();
Symbol 1141 MovieClip [mc_unitProduction] Frame 2
stop();
Symbol 1141 MovieClip [mc_unitProduction] Frame 3
stop();
Symbol 1141 MovieClip [mc_unitProduction] Frame 4
stop();
Symbol 1141 MovieClip [mc_unitProduction] Frame 5
stop();
Symbol 1160 MovieClip Frame 1
stop();
Symbol 1160 MovieClip Frame 2
stop();
Symbol 1160 MovieClip Frame 3
stop();
Symbol 1160 MovieClip Frame 4
stop();
Symbol 1160 MovieClip Frame 5
stop();
Symbol 1160 MovieClip Frame 6
stop();
Symbol 1160 MovieClip Frame 7
stop();
Symbol 1160 MovieClip Frame 8
stop();
Symbol 1160 MovieClip Frame 9
stop();
Symbol 1160 MovieClip Frame 10
stop();
Symbol 1160 MovieClip Frame 11
stop();
Symbol 1160 MovieClip Frame 12
stop();
Symbol 1160 MovieClip Frame 13
stop();
Symbol 1165 MovieClip [mc_usageLine] Frame 1
#initclip 223
Object.registerClass("mc_usageLine", UsageLine);
#endinitclip
stop();
Symbol 1165 MovieClip [mc_usageLine] Frame 2
stop();
Symbol 1165 MovieClip [mc_usageLine] Frame 3
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 1
#initclip 224
Object.registerClass("mc_usage_key", UsageMeter);
#endinitclip
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 2
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 3
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 4
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 5
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 6
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 7
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 8
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 9
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 10
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 11
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 12
stop();
Symbol 1171 MovieClip [mc_usage_key] Frame 13
stop();
Symbol 1174 MovieClip [mc_zoomCircle] Frame 21
stop();
this.removeMovieClip();
Symbol 1195 MovieClip [mc_arrow] Frame 1
#initclip 225
Object.registerClass("mc_arrow", ArrowCursor);
#endinitclip
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 2
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 3
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 4
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 5
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 6
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 7
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 8
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 9
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 10
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 11
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 12
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 15
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 16
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 17
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 18
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 19
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 20
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 21
stop();
Symbol 1195 MovieClip [mc_arrow] Frame 22
stop();
Symbol 1197 MovieClip Frame 1
stop();
Symbol 1197 MovieClip Frame 61
stop();
_parent.nowItsNight();
Symbol 1197 MovieClip Frame 121
stop();
_parent.nowItsDay();
Symbol 1198 MovieClip [mc_light] Frame 1
#initclip 226
Object.registerClass("mc_light", LightBox);
#endinitclip
stop();
Symbol 1198 MovieClip [mc_light] Frame 2
stop();
Symbol 1201 MovieClip Frame 1
stop();
Symbol 1204 MovieClip [mc_director] Frame 1
#initclip 227
Object.registerClass("mc_director", Director);
#endinitclip
Symbol 1214 Button
on (release) {
master.gotoMenu();
}
Symbol 1216 Button
on (release) {
master.gotoHelp();
}
Symbol 1222 Button
on (release) {
pressButton("bFarm");
}
on (rollOver) {
showBldgButton("Farm");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1226 Button
on (release) {
pressButton("b_PowerPlant");
}
on (rollOver) {
showBldgButton("_PowerPlant");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1233 Button
on (release) {
pressButton("b_Mines");
}
on (rollOver) {
showBldgButton("_Mine");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1239 Button
on (release) {
pressButton("bOilGasWell");
}
on (rollOver) {
showBldgButton("OilGasWell");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1243 Button
on (release) {
pressButton("bFactory");
}
on (rollOver) {
showBldgButton("Factory");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1246 Button
on (release) {
pressButton("bLab");
}
on (rollOver) {
showBldgButton("Lab");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1249 Button
on (release) {
pressButton("b_Defense");
}
on (rollOver) {
showBldgButton("Defense");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1254 Button
on (release) {
_parent.actionButton("demolish");
}
Symbol 1256 MovieClip Frame 1
stop();
Symbol 1256 MovieClip Frame 2
stop();
Symbol 1259 Button
on (release) {
pressButton("bLandfill");
}
on (rollOver) {
showBldgButton("Landfill");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1263 Button
on (release) {
pressButton("bNuclearDump");
}
on (rollOver) {
showBldgButton("NuclearDump");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1266 Button
on (release) {
_parent.globalRepair();
}
Symbol 1406 MovieClip Frame 1
stop();
Symbol 1406 MovieClip Frame 2
stop();
Symbol 1406 MovieClip Frame 3
stop();
Symbol 1406 MovieClip Frame 4
stop();
Symbol 1406 MovieClip Frame 5
stop();
Symbol 1406 MovieClip Frame 6
stop();
Symbol 1406 MovieClip Frame 7
stop();
Symbol 1406 MovieClip Frame 8
stop();
Symbol 1406 MovieClip Frame 9
stop();
Symbol 1406 MovieClip Frame 10
stop();
Symbol 1406 MovieClip Frame 11
stop();
Symbol 1406 MovieClip Frame 12
stop();
Symbol 1406 MovieClip Frame 13
stop();
Symbol 1406 MovieClip Frame 14
stop();
Symbol 1406 MovieClip Frame 15
stop();
Symbol 1406 MovieClip Frame 16
stop();
Symbol 1406 MovieClip Frame 17
stop();
Symbol 1406 MovieClip Frame 18
stop();
Symbol 1406 MovieClip Frame 19
stop();
Symbol 1406 MovieClip Frame 20
stop();
Symbol 1406 MovieClip Frame 21
stop();
Instance of Symbol 514 MovieClip "g" in Symbol 1406 MovieClip Frame 21
onClipEvent (load) {
function __f_load(eventObj) {
deactivateMe("little");
}
this.addEventListener("load", __f_load);
}
Symbol 1406 MovieClip Frame 22
stop();
Instance of Symbol 577 MovieClip "g" in Symbol 1406 MovieClip Frame 22
onClipEvent (load) {
function __f_load(eventObj) {
deactivateMe("little");
}
this.addEventListener("load", __f_load);
}
Symbol 1406 MovieClip Frame 23
stop();
Instance of Symbol 556 MovieClip "g" in Symbol 1406 MovieClip Frame 23
onClipEvent (load) {
function __f_load(eventObj) {
deactivateMe("little");
}
this.addEventListener("load", __f_load);
}
Symbol 1406 MovieClip Frame 24
stop();
Symbol 1406 MovieClip Frame 25
stop();
Symbol 1406 MovieClip Frame 26
stop();
Symbol 1406 MovieClip Frame 27
stop();
Symbol 1406 MovieClip Frame 28
stop();
Symbol 1406 MovieClip Frame 29
stop();
Symbol 1406 MovieClip Frame 30
stop();
Symbol 1406 MovieClip Frame 31
stop();
Symbol 1406 MovieClip Frame 32
stop();
Symbol 1406 MovieClip Frame 33
stop();
Symbol 1406 MovieClip Frame 34
stop();
Symbol 1406 MovieClip Frame 35
stop();
Symbol 1406 MovieClip Frame 36
stop();
Symbol 1406 MovieClip Frame 37
stop();
Symbol 1406 MovieClip Frame 38
stop();
Symbol 1406 MovieClip Frame 39
stop();
Symbol 1406 MovieClip Frame 40
stop();
Symbol 1406 MovieClip Frame 41
stop();
Symbol 1406 MovieClip Frame 42
stop();
Symbol 1406 MovieClip Frame 43
stop();
Symbol 1406 MovieClip Frame 44
stop();
Symbol 1406 MovieClip Frame 45
stop();
Symbol 1406 MovieClip Frame 46
stop();
Symbol 1406 MovieClip Frame 47
stop();
Symbol 1406 MovieClip Frame 48
stop();
Symbol 1406 MovieClip Frame 49
stop();
Symbol 1406 MovieClip Frame 50
stop();
Symbol 1406 MovieClip Frame 51
stop();
Symbol 1406 MovieClip Frame 52
stop();
Symbol 1406 MovieClip Frame 53
stop();
Symbol 1406 MovieClip Frame 54
stop();
Symbol 1406 MovieClip Frame 55
stop();
Symbol 1406 MovieClip Frame 56
stop();
Symbol 1406 MovieClip Frame 57
stop();
Symbol 1406 MovieClip Frame 58
stop();
Symbol 1406 MovieClip Frame 59
stop();
Symbol 1406 MovieClip Frame 60
stop();
Symbol 1406 MovieClip Frame 61
stop();
Symbol 1406 MovieClip Frame 62
stop();
Symbol 1406 MovieClip Frame 63
stop();
Symbol 1406 MovieClip Frame 64
stop();
Symbol 1406 MovieClip Frame 65
stop();
Symbol 1406 MovieClip Frame 66
stop();
Symbol 1406 MovieClip Frame 67
stop();
Symbol 1406 MovieClip Frame 68
stop();
Symbol 1406 MovieClip Frame 69
stop();
Symbol 1406 MovieClip Frame 70
stop();
Symbol 1406 MovieClip Frame 71
stop();
Symbol 1406 MovieClip Frame 72
stop();
Symbol 1406 MovieClip Frame 73
stop();
Symbol 1406 MovieClip Frame 74
stop();
Symbol 1406 MovieClip Frame 75
stop();
Symbol 1406 MovieClip Frame 76
stop();
Symbol 1406 MovieClip Frame 77
stop();
Symbol 1406 MovieClip Frame 78
stop();
Symbol 1406 MovieClip Frame 79
stop();
Symbol 1406 MovieClip Frame 80
stop();
Symbol 1406 MovieClip Frame 81
stop();
Symbol 1406 MovieClip Frame 82
stop();
Symbol 1406 MovieClip Frame 83
stop();
Symbol 1406 MovieClip Frame 84
stop();
Symbol 1406 MovieClip Frame 85
stop();
Symbol 1406 MovieClip Frame 86
stop();
Symbol 1406 MovieClip Frame 87
stop();
Symbol 1406 MovieClip Frame 88
stop();
g.deactivateMe("lots");
Symbol 1406 MovieClip Frame 89
stop();
g.deactivateMe("some");
Instance of Symbol 839 MovieClip [mc_garbage] "g" in Symbol 1406 MovieClip Frame 89
onClipEvent (load) {
function __f_load(eventObj) {
deactivateMe("some");
}
this.addEventListener("load", __f_load);
}
Symbol 1406 MovieClip Frame 90
stop();
g.deactivateMe("little");
Instance of Symbol 839 MovieClip [mc_garbage] "g" in Symbol 1406 MovieClip Frame 90
onClipEvent (load) {
function __f_load(eventObj) {
deactivateMe("little");
}
this.addEventListener("load", __f_load);
}
Symbol 1406 MovieClip Frame 91
stop();
Instance of Symbol 514 MovieClip "g" in Symbol 1406 MovieClip Frame 91
onClipEvent (load) {
function __f_load(eventObj) {
deactivateMe("little");
}
this.addEventListener("load", __f_load);
}
Symbol 1406 MovieClip Frame 92
stop();
Instance of Symbol 577 MovieClip "g" in Symbol 1406 MovieClip Frame 92
onClipEvent (load) {
function __f_load(eventObj) {
deactivateMe("little");
}
this.addEventListener("load", __f_load);
}
Symbol 1406 MovieClip Frame 93
stop();
Instance of Symbol 556 MovieClip "g" in Symbol 1406 MovieClip Frame 93
onClipEvent (load) {
function __f_load(eventObj) {
deactivateMe("little");
}
this.addEventListener("load", __f_load);
}
Symbol 1406 MovieClip Frame 94
stop();
Instance of Symbol 630 MovieClip "g" in Symbol 1406 MovieClip Frame 94
onClipEvent (load) {
function __f_load(eventObj) {
deactivateMe("rubble");
}
this.addEventListener("load", __f_load);
}
Symbol 1406 MovieClip Frame 95
stop();
Symbol 1406 MovieClip Frame 96
stop();
Symbol 1406 MovieClip Frame 97
stop();
Symbol 1406 MovieClip Frame 98
stop();
Symbol 1406 MovieClip Frame 99
stop();
Symbol 1406 MovieClip Frame 100
stop();
Symbol 1406 MovieClip Frame 101
stop();
Symbol 1406 MovieClip Frame 102
stop();
Symbol 1406 MovieClip Frame 103
stop();
Symbol 1406 MovieClip Frame 104
stop();
Symbol 1406 MovieClip Frame 105
stop();
Symbol 1406 MovieClip Frame 106
stop();
Symbol 1406 MovieClip Frame 107
stop();
Symbol 1406 MovieClip Frame 108
stop();
Symbol 1406 MovieClip Frame 109
stop();
Symbol 1406 MovieClip Frame 110
stop();
Symbol 1406 MovieClip Frame 111
stop();
Symbol 1417 MovieClip Frame 1
stop();
Symbol 1417 MovieClip Frame 227
stop();
Symbol 1420 MovieClip Frame 1
stop();
Symbol 1420 MovieClip Frame 28
gotoAndStop ("default");
Symbol 1420 MovieClip Frame 29
stop();
Symbol 1420 MovieClip Frame 30
stop();
Symbol 1420 MovieClip Frame 31
stop();
Symbol 1428 Button
on (release) {
goBackButton("default");
}
Symbol 1430 Button
on (release) {
buildButton("scout");
}
Symbol 1432 Button
on (release) {
buildButton("humVee");
}
Symbol 1434 Button
on (release) {
buildButton("engineer");
}
Symbol 1436 Button
on (release) {
buildButton("tank");
}
Symbol 1439 Button
on (release) {
pressButton("uFuel");
}
Symbol 1440 Button
on (release) {
pressButton("uPowerPlants");
}
Symbol 1441 Button
on (release) {
pressButton("uDefense");
}
Symbol 1445 Button
on (release) {
pressButton("uRecycling");
}
Symbol 1446 Button
on (release) {
pressButton("uBuildings");
}
Symbol 1447 Button
on (release) {
pressButton("uUnits");
}
Symbol 1452 Button
on (release) {
pressButton("uCoalPlant");
}
on (rollOver) {
showBldgButton("CoalPlant");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1456 Button
on (release) {
pressButton("uGasPlant");
}
Symbol 1459 Button
on (release) {
pressButton("uWindPlant");
}
Symbol 1462 Button
on (release) {
pressButton("uSolarPlant");
}
Symbol 1466 Button
on (release) {
pressButton("uGeoPlant");
}
Symbol 1469 Button
on (release) {
pressButton("uNuclearPlant");
}
Symbol 1472 Button
on (release) {
goBackButton();
}
Symbol 1473 Button
on (release) {
upgradeButton("fuel", "gasoline", K.UNIT);
}
on (rollOver) {
showUpgradeButton("fuel", "gasoline", K.UNIT);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1474 Button
on (release) {
upgradeButton("fuel", "electric", K.UNIT);
}
on (rollOver) {
showUpgradeButton("fuel", "electric", K.UNIT);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1475 Button
on (release) {
upgradeButton("fuel", "ethanol", K.UNIT);
}
on (rollOver) {
showUpgradeButton("fuel", "ethanol", K.UNIT);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1477 Button
on (release) {
upgradeButton("fuel", "natGas", K.UNIT);
}
on (rollOver) {
showUpgradeButton("fuel", "natGas", K.UNIT);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1479 Button
on (release) {
goBackButton("iFFPlant");
}
Symbol 1483 Button
on (release) {
upgradeButton("ffplant", "Both", K.BUILDING);
}
on (rollOver) {
showUpgradeButton("ffplant", "Both", K.BUILDING);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1485 Button
on (release) {
upgradeButton("coalplant", "Both", K.BUILDING);
}
on (rollOver) {
showUpgradeButton("coalplant", "Both", K.BUILDING);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1486 Button
on (release) {
goBackButton("iGasPlant");
}
Symbol 1488 Button
on (release) {
upgradeButton("gasplant", "Both", K.BUILDING);
}
on (rollOver) {
showUpgradeButton("gasplant", "Both", K.BUILDING);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1489 Button
on (release) {
goBackButton("iHydroPlant");
}
Symbol 1491 Button
on (release) {
upgradeButton("hydroplant", "Both", K.BUILDING);
}
on (rollOver) {
showUpgradeButton("hydroplant", "Both", K.BUILDING);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1492 Button
on (release) {
goBackButton("iWindPlant");
}
Symbol 1494 Button
on (release) {
upgradeButton("windplant", "Both", K.BUILDING);
}
on (rollOver) {
showUpgradeButton("windplant", "Both", K.BUILDING);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1495 Button
on (release) {
goBackButton("iGeoPlant");
}
Symbol 1497 Button
on (release) {
upgradeButton("geoplant", "Both", K.BUILDING);
}
on (rollOver) {
showUpgradeButton("geoplant", "Both", K.BUILDING);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1498 Button
on (release) {
goBackButton("iSolarPlant");
}
Symbol 1500 Button
on (release) {
upgradeButton("solarplant", "Both", K.BUILDING);
}
on (rollOver) {
showUpgradeButton("solarplant", "Both", K.BUILDING);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1501 Button
on (release) {
goBackButton("iNuclearPlant");
}
Symbol 1503 Button
on (release) {
upgradeButton("nuclearplant", "Both", K.BUILDING);
}
on (rollOver) {
showUpgradeButton("nuclearplant", "Both", K.BUILDING);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1505 Button
on (release) {
upgradeButton("recyclingcenter", "Both", K.BUILDING);
}
on (rollOver) {
showUpgradeButton("recyclingcenter", "Both", K.BUILDING);
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1511 Button
on (release) {
pressButton("uFloodLights");
}
Symbol 1515 Button
on (release) {
pressButton("uGunTurret");
}
Symbol 1519 Button
on (release) {
pressButton("uLaserTurret");
}
Symbol 1522 Button
on (release) {
pressButton("uFlameTurret");
}
Symbol 1544 Button
on (release) {
pressButton("bCoalPlant");
}
on (rollOver) {
showBldgButton("CoalPlant");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1545 Button
on (release) {
pressButton("bGasPlant");
}
on (rollOver) {
showBldgButton("GasPlant");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1546 Button
on (release) {
pressButton("bWindPlant");
}
on (rollOver) {
showBldgButton("WindPlant");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1547 Button
on (release) {
pressButton("bSolarPlant");
}
on (rollOver) {
showBldgButton("SolarPlant");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1548 Button
on (release) {
pressButton("bGeoPlant");
}
on (rollOver) {
showBldgButton("GeoPlant");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1549 Button
on (release) {
pressButton("bNuclearPlant");
}
on (rollOver) {
showBldgButton("NuclearPlant");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1553 Button
on (release) {
pressButton("bMine");
}
on (rollOver) {
showBldgButton("Mine");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1556 Button
on (release) {
pressButton("bCoalMine");
}
on (rollOver) {
showBldgButton("CoalMine");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1557 Button
on (release) {
pressButton("bFloodLights");
}
on (rollOver) {
showBldgButton("FloodLights");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1558 Button
on (release) {
pressButton("bGunTurret");
}
on (rollOver) {
showBldgButton("GunTurret");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1559 Button
on (release) {
pressButton("bTeslaCoil");
}
on (rollOver) {
showBldgButton("TeslaCoil");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1560 Button
on (release) {
pressButton("bFlameTurret");
}
on (rollOver) {
showBldgButton("FlameTurret");
}
on (rollOut) {
hideBldgButton();
}
on (releaseOutside) {
hideBldgButton();
}
Symbol 1568 Button
on (release) {
directorUnClickBuildings();
}
Symbol 1571 Button
on (release) {
pressButton("uCoalPlant");
}
Symbol 1573 Button
on (release) {
repairSelected();
}
Symbol 1576 Button
on (release) {
pressButton("uNuclearPlant");
}
Symbol 1577 Button
on (release) {
pressButton("uWindPlant");
}
Symbol 1581 Button
on (release) {
pressButton("uSolarPlant");
}
Symbol 1584 Button
on (release) {
pressButton("uGeoPlant");
}
Symbol 1585 Button
on (release) {
pressButton("uGasPlant");
}
Symbol 1593 MovieClip [mc_trucktoggle] Frame 1
#initclip 228
Object.registerClass("mc_trucktoggle", ToggleButton);
#endinitclip
stop();
Symbol 1593 MovieClip [mc_trucktoggle] Frame 2
stop();
Symbol 1624 Button
on (release) {
buildButton("garbageTruck");
}
on (rollOver) {
showUnitButton("garbageTruck");
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1626 Button
on (release) {
buildButton("engineer");
}
on (rollOver) {
showUnitButton("engineer");
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1634 Button
on (release) {
buildButton("RecyclingCenter");
}
on (rollOver) {
showUnitButton("RecyclingCenter");
}
on (rollOut) {
hideUnitButton();
}
on (releaseOutside) {
hideUnitButton();
}
Symbol 1640 Button
on (release) {
pressButton("uRecyclingCenter");
}
Symbol 1664 Button
on (release) {
setFleetFuel(K.GASOLINE, "gasoline");
}
Symbol 1665 Button
on (release) {
setFleetFuel(K.ETHANOL, "ethanol");
}
Symbol 1666 Button
on (release) {
setFleetFuel(K.ELECTRIC, "electric");
}
Symbol 1667 Button
on (release) {
setFleetFuel(K.NATGAS, "natgas");
}
Symbol 1668 Button
on (release) {
pressButton("uFuel");
}
Symbol 1671 MovieClip [mc_interface] Frame 1
#initclip 229
Object.registerClass("mc_interface", Interface);
#endinitclip
resourceText = "";
pollutionText = "";
nutrientText = "";
materialText = "";
stop();
Instance of Symbol 85 MovieClip "sideRegion" in Symbol 1671 MovieClip [mc_interface] Frame 1
on (release) {
_parent.onClickRegion();
}
Instance of Symbol 85 MovieClip "topRegion" in Symbol 1671 MovieClip [mc_interface] Frame 1
on (release) {
_parent.onClickRegion();
}
Instance of Symbol 85 MovieClip "bottomRegion" in Symbol 1671 MovieClip [mc_interface] Frame 1
on (release) {
_parent.onClickRegion();
}
Instance of Symbol 978 MovieClip [mc_cost] "theCost" in Symbol 1671 MovieClip [mc_interface] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 1671 MovieClip [mc_interface] Frame 2
stop();
Symbol 1671 MovieClip [mc_interface] Frame 3
stop();
Symbol 1671 MovieClip [mc_interface] Frame 4
stop();
Instance of Symbol 978 MovieClip [mc_cost] "theCost" in Symbol 1671 MovieClip [mc_interface] Frame 4
onClipEvent (load) {
_visible = false;
}
Symbol 1671 MovieClip [mc_interface] Frame 5
stop();
Symbol 1671 MovieClip [mc_interface] Frame 6
stop();
Symbol 1671 MovieClip [mc_interface] Frame 7
stop();
Symbol 1671 MovieClip [mc_interface] Frame 8
stop();
Symbol 1671 MovieClip [mc_interface] Frame 9
stop();
Symbol 1671 MovieClip [mc_interface] Frame 10
stop();
Symbol 1671 MovieClip [mc_interface] Frame 11
stop();
Symbol 1671 MovieClip [mc_interface] Frame 12
stop();
Symbol 1671 MovieClip [mc_interface] Frame 13
stop();
Symbol 1671 MovieClip [mc_interface] Frame 14
stop();
Symbol 1671 MovieClip [mc_interface] Frame 15
stop();
Symbol 1671 MovieClip [mc_interface] Frame 16
stop();
Symbol 1671 MovieClip [mc_interface] Frame 17
stop();
Symbol 1671 MovieClip [mc_interface] Frame 18
stop();
Symbol 1671 MovieClip [mc_interface] Frame 19
stop();
Symbol 1671 MovieClip [mc_interface] Frame 20
stop();
Symbol 1671 MovieClip [mc_interface] Frame 21
stop();
Symbol 1671 MovieClip [mc_interface] Frame 22
stop();
Symbol 1671 MovieClip [mc_interface] Frame 23
stop();
Symbol 1671 MovieClip [mc_interface] Frame 24
stop();
Symbol 1671 MovieClip [mc_interface] Frame 25
stop();
Symbol 1671 MovieClip [mc_interface] Frame 26
resourceText = "";
pollutionText = "";
nutrientText = "";
materialText = "";
stop();
Symbol 1671 MovieClip [mc_interface] Frame 27
stop();
Symbol 1671 MovieClip [mc_interface] Frame 28
stop();
Symbol 1671 MovieClip [mc_interface] Frame 29
stop();
Symbol 1671 MovieClip [mc_interface] Frame 30
stop();
Symbol 1671 MovieClip [mc_interface] Frame 31
stop();
Symbol 1671 MovieClip [mc_interface] Frame 32
stop();
Symbol 1671 MovieClip [mc_interface] Frame 33
stop();
Symbol 1671 MovieClip [mc_interface] Frame 34
stop();
Symbol 1671 MovieClip [mc_interface] Frame 35
stop();
Symbol 1671 MovieClip [mc_interface] Frame 36
stop();
Symbol 1671 MovieClip [mc_interface] Frame 37
stop();
Symbol 1671 MovieClip [mc_interface] Frame 38
stop();
Symbol 1671 MovieClip [mc_interface] Frame 39
stop();
Symbol 1671 MovieClip [mc_interface] Frame 40
stop();
Symbol 1671 MovieClip [mc_interface] Frame 41
stop();
Symbol 1671 MovieClip [mc_interface] Frame 42
stop();
Symbol 1671 MovieClip [mc_interface] Frame 43
stop();
Symbol 1671 MovieClip [mc_interface] Frame 44
stop();
Symbol 1671 MovieClip [mc_interface] Frame 45
stop();
Symbol 1671 MovieClip [mc_interface] Frame 46
stop();
Symbol 1671 MovieClip [mc_interface] Frame 47
stop();
Symbol 1671 MovieClip [mc_interface] Frame 48
stop();
Instance of Symbol 986 MovieClip [mc_disabletoggle] "disableButt" in Symbol 1671 MovieClip [mc_interface] Frame 48
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.disableToggleBuilding();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 49
stop();
Symbol 1671 MovieClip [mc_interface] Frame 50
stop();
Symbol 1671 MovieClip [mc_interface] Frame 51
stop();
Symbol 1671 MovieClip [mc_interface] Frame 52
stop();
Symbol 1671 MovieClip [mc_interface] Frame 53
stop();
Symbol 1671 MovieClip [mc_interface] Frame 54
stop();
Symbol 1671 MovieClip [mc_interface] Frame 55
stop();
Symbol 1671 MovieClip [mc_interface] Frame 56
stop();
Instance of Symbol 1593 MovieClip [mc_trucktoggle] "summonButt" in Symbol 1671 MovieClip [mc_interface] Frame 56
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.summonToggleGarbage();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 57
stop();
Symbol 1671 MovieClip [mc_interface] Frame 58
stop();
Symbol 1671 MovieClip [mc_interface] Frame 59
stop();
Instance of Symbol 1593 MovieClip [mc_trucktoggle] "summonButt" in Symbol 1671 MovieClip [mc_interface] Frame 59
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.summonToggleGarbage();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 60
stop();
Symbol 1671 MovieClip [mc_interface] Frame 61
stop();
Symbol 1671 MovieClip [mc_interface] Frame 62
stop();
Symbol 1671 MovieClip [mc_interface] Frame 63
stop();
Instance of Symbol 986 MovieClip [mc_disabletoggle] "disableButt" in Symbol 1671 MovieClip [mc_interface] Frame 63
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.disableToggleBuilding();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 64
stop();
Symbol 1671 MovieClip [mc_interface] Frame 65
stop();
Symbol 1671 MovieClip [mc_interface] Frame 66
stop();
Instance of Symbol 1593 MovieClip [mc_trucktoggle] "summonButt" in Symbol 1671 MovieClip [mc_interface] Frame 66
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.summonToggleGarbage();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 67
stop();
Symbol 1671 MovieClip [mc_interface] Frame 68
stop();
Instance of Symbol 986 MovieClip [mc_disabletoggle] "disableButt" in Symbol 1671 MovieClip [mc_interface] Frame 68
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.disableToggleBuilding();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 69
stop();
Symbol 1671 MovieClip [mc_interface] Frame 70
stop();
Symbol 1671 MovieClip [mc_interface] Frame 71
stop();
Instance of Symbol 986 MovieClip [mc_disabletoggle] "disableButt" in Symbol 1671 MovieClip [mc_interface] Frame 71
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.disableToggleBuilding();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 72
stop();
Symbol 1671 MovieClip [mc_interface] Frame 73
stop();
Instance of Symbol 986 MovieClip [mc_disabletoggle] "disableButt" in Symbol 1671 MovieClip [mc_interface] Frame 73
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.disableToggleBuilding();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 74
stop();
Symbol 1671 MovieClip [mc_interface] Frame 75
stop();
Instance of Symbol 986 MovieClip [mc_disabletoggle] "disableButt" in Symbol 1671 MovieClip [mc_interface] Frame 75
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.disableToggleBuilding();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 76
stop();
Symbol 1671 MovieClip [mc_interface] Frame 77
stop();
Symbol 1671 MovieClip [mc_interface] Frame 78
stop();
Symbol 1671 MovieClip [mc_interface] Frame 79
stop();
Instance of Symbol 986 MovieClip [mc_disabletoggle] "disableButt" in Symbol 1671 MovieClip [mc_interface] Frame 79
onClipEvent (load) {
setButton();
this.myFunction = function () {
_parent._parent.disableToggleBuilding();
};
}
Symbol 1671 MovieClip [mc_interface] Frame 80
stop();
Symbol 1671 MovieClip [mc_interface] Frame 81
stop();
Symbol 1671 MovieClip [mc_interface] Frame 82
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 1
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 2
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 3
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 4
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 5
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 6
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 7
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 8
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 9
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 10
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 11
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 12
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 13
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 14
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 15
stop();
Symbol 1693 MovieClip [mc_levelBaker] Frame 16
stop();
Symbol 1694 MovieClip [mc_superDirector] Frame 1
#initclip 230
Object.registerClass("mc_superDirector", SuperDirector);
#endinitclip
Symbol 1695 MovieClip [mc_transitioner] Frame 30
stop();
_parent.onMidTransition();
Symbol 1695 MovieClip [mc_transitioner] Frame 59
stop();
_parent.onTransitionEnd();
this.removeMovieClip();
Symbol 1701 MovieClip [StepThemeColor1] Frame 1
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 1713 MovieClip [NumericStepper] Frame 1
#initclip 165
Object.registerClass("NumericStepper", mx.controls.NumericStepper);
#endinitclip
stop();
Instance of Symbol 30 MovieClip [SimpleButton] in Symbol 1713 MovieClip [NumericStepper] Frame 2
//component parameters
onClipEvent (initialize) {
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Instance of Symbol 877 MovieClip [TextInput] in Symbol 1713 MovieClip [NumericStepper] Frame 2
//component parameters
onClipEvent (initialize) {
editable = true;
password = false;
text = "";
maxChars = null;
restrict = "null";
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 1765 MovieClip Frame 1
function cheapRandom() {
return(Math.floor(9 * Math.random()) + 1);
}
Symbol 1765 MovieClip Frame 3
gotoAndPlay(cheapRandom());
Symbol 1765 MovieClip Frame 6
gotoAndPlay(cheapRandom());
Symbol 1765 MovieClip Frame 9
gotoAndPlay(cheapRandom());
Symbol 1765 MovieClip Frame 12
gotoAndPlay(cheapRandom());
Symbol 1765 MovieClip Frame 15
gotoAndPlay(cheapRandom());
Symbol 1765 MovieClip Frame 18
gotoAndPlay(cheapRandom());
Symbol 1765 MovieClip Frame 21
gotoAndPlay(cheapRandom());
Symbol 1765 MovieClip Frame 24
gotoAndPlay(cheapRandom());
Symbol 1765 MovieClip Frame 27
gotoAndPlay(cheapRandom());
Symbol 1765 MovieClip Frame 30
gotoAndPlay(cheapRandom());
Symbol 1769 MovieClip Frame 43
stop();
Symbol 1781 MovieClip Frame 17
stop();
Symbol 1791 MovieClip Frame 17
stop();
Symbol 1792 MovieClip [mc_goop] Frame 28
_parent.onDestroyAnim();
this.removeMovieClip();
stop();
Symbol 1792 MovieClip [mc_goop] Frame 56
_parent.onDestroyAnim();
this.removeMovieClip();
stop();
Symbol 1793 MovieClip Frame 70
stop();
Symbol 1796 MovieClip Frame 1
stop();
Symbol 1796 MovieClip Frame 2
stop();
Symbol 1796 MovieClip Frame 3
stop();
Symbol 1796 MovieClip Frame 4
stop();
Symbol 1796 MovieClip Frame 5
stop();
Symbol 1796 MovieClip Frame 6
stop();
Symbol 1796 MovieClip Frame 7
stop();
Symbol 1796 MovieClip Frame 8
stop();
Symbol 1796 MovieClip Frame 9
stop();
Symbol 1796 MovieClip Frame 10
stop();
Symbol 1796 MovieClip Frame 11
stop();
Symbol 1796 MovieClip Frame 12
stop();
Symbol 1796 MovieClip Frame 13
stop();
Symbol 1801 Button
on (release) {
_parent.endTextThing();
}
Symbol 1802 Button
on (release) {
_parent.skipTextThing();
}
Symbol 1820 Button
on (release) {
_parent.endTheTextThing();
}
Symbol 1822 Button
on (release) {
_parent.switchReport(K.ENERGY);
}
Symbol 1824 Button
on (release) {
_parent.switchReport(K.FOOD);
}
Symbol 1826 Button
on (release) {
_parent.switchReport(K.SMOG);
}
Symbol 1830 Button
on (release) {
_parent.switchReport(K.RESOURCE);
}
Symbol 1832 Button
on (release) {
_parent.switchReport(K.GARBAGE);
}
Symbol 1834 Button
on (release) {
_parent.switchReport(K.COMPREHENSIVE);
}
Symbol 1837 Button
on (release) {
_parent.switchReport(K.RECYCLING);
}
Symbol 2189 Button
on (release) {
_parent.switchScore(K.TIMETAKEN);
}
Symbol 2195 Button
on (release) {
_parent.switchScore(K.POLLUTION);
}
Symbol 2203 Button
on (release) {
_parent.switchScore(K.DEFENSE);
}
Symbol 2215 Button
on (release) {
_parent.switchScore(K.RESOURCE);
}
Symbol 2219 Button
on (release) {
_parent.switchScore(K.ENERGY);
}
Symbol 2233 Button
on (release) {
_parent.returnScore();
}
Symbol 2429 Button
on (release) {
pleaseWait.play();
_parent._parent.submitTheScore(chap1, chap2, chap3, chap4, chap5, chap6, chap7, chap8, chap9, chapTotal);
}
Symbol 2437 MovieClip Frame 1
stop();
Symbol 2456 MovieClip Frame 1
stop();
Symbol 2456 MovieClip Frame 2
stop();
Symbol 2456 MovieClip Frame 3
stop();
Symbol 2456 MovieClip Frame 4
stop();
Symbol 2456 MovieClip Frame 5
stop();
Symbol 2456 MovieClip Frame 6
stop();
Symbol 2456 MovieClip Frame 7
stop();
Symbol 2456 MovieClip Frame 8
stop();
Symbol 2456 MovieClip Frame 9
stop();
Symbol 2456 MovieClip Frame 10
stop();
Symbol 2456 MovieClip Frame 11
stop();
Symbol 2456 MovieClip Frame 12
stop();
Symbol 2456 MovieClip Frame 13
stop();
Symbol 2456 MovieClip Frame 14
stop();
Symbol 2456 MovieClip Frame 15
stop();
Symbol 2457 MovieClip [mc_textThing] Frame 1
#initclip 231
Object.registerClass("mc_textThing", TextThing);
#endinitclip
stop();
Symbol 2457 MovieClip [mc_textThing] Frame 2
stop();
Symbol 2457 MovieClip [mc_textThing] Frame 3
stop();
Symbol 2457 MovieClip [mc_textThing] Frame 4
stop();
Symbol 2471 MovieClip Frame 10
_parent._parent.onAttackHit();
Symbol 2472 MovieClip [mc_icon_edderkopp] Frame 1
#initclip 232
Object.registerClass("mc_icon_edderkopp", EnemyIcon);
#endinitclip
Symbol 2472 MovieClip [mc_icon_edderkopp] Frame 20
stop();
Symbol 2472 MovieClip [mc_icon_edderkopp] Frame 21
stop();
Symbol 2472 MovieClip [mc_icon_edderkopp] Frame 22
stop();
Symbol 2472 MovieClip [mc_icon_edderkopp] Frame 23
gotoAndStop ("default");
Symbol 2480 MovieClip Frame 1
stop();
Symbol 2480 MovieClip Frame 51
stop();
Symbol 2480 MovieClip Frame 101
stop();
Symbol 2484 MovieClip Frame 10
_parent._parent.onAttackHit();
Symbol 2485 MovieClip [mc_icon_edderkopp_up] Frame 1
#initclip 233
Object.registerClass("mc_icon_edderkopp_up", EnemyIcon);
#endinitclip
stop();
Symbol 2485 MovieClip [mc_icon_edderkopp_up] Frame 2
stop();
Symbol 2485 MovieClip [mc_icon_edderkopp_up] Frame 3
stop();
Symbol 2485 MovieClip [mc_icon_edderkopp_up] Frame 4
gotoAndStop ("default");
Symbol 2488 MovieClip Frame 10
_parent._parent.onAttackHit();
Symbol 2489 MovieClip [mc_icon_edderkopp_down] Frame 1
#initclip 234
Object.registerClass("mc_icon_edderkopp_down", EnemyIcon);
#endinitclip
stop();
Symbol 2489 MovieClip [mc_icon_edderkopp_down] Frame 2
stop();
Symbol 2489 MovieClip [mc_icon_edderkopp_down] Frame 3
stop();
Symbol 2489 MovieClip [mc_icon_edderkopp_down] Frame 4
gotoAndStop ("default");
Symbol 2490 MovieClip [mc_enemy_edderkopp] Frame 1
#initclip 235
Object.registerClass("mc_enemy_edderkopp", Edderkopp);
#endinitclip
stop();
Symbol 2490 MovieClip [mc_enemy_edderkopp] Frame 2
stop();
Symbol 2490 MovieClip [mc_enemy_edderkopp] Frame 3
stop();
Symbol 2490 MovieClip [mc_enemy_edderkopp] Frame 4
stop();
Symbol 2490 MovieClip [mc_enemy_edderkopp] Frame 5
stop();
Symbol 2502 MovieClip Frame 10
_parent._parent.onAttackHit();
Symbol 2503 MovieClip Frame 20
stop();
Symbol 2503 MovieClip Frame 21
stop();
Symbol 2503 MovieClip Frame 22
stop();
Symbol 2503 MovieClip Frame 23
gotoAndStop ("default");
Symbol 2521 MovieClip Frame 10
_parent._parent.onAttackHit();
Symbol 2522 MovieClip Frame 1
stop();
Symbol 2522 MovieClip Frame 2
stop();
Symbol 2522 MovieClip Frame 3
stop();
Symbol 2522 MovieClip Frame 4
gotoAndStop ("default");
Symbol 2539 MovieClip Frame 10
_parent._parent.onAttackHit();
Symbol 2540 MovieClip Frame 1
stop();
Symbol 2540 MovieClip Frame 2
stop();
Symbol 2540 MovieClip Frame 3
stop();
Symbol 2540 MovieClip Frame 4
gotoAndStop ("default");
Symbol 2541 MovieClip [mc_enemy_raider] Frame 1
#initclip 236
Object.registerClass("mc_enemy_raider", Raider);
#endinitclip
stop();
Symbol 2541 MovieClip [mc_enemy_raider] Frame 2
stop();
Symbol 2541 MovieClip [mc_enemy_raider] Frame 3
stop();
Symbol 2541 MovieClip [mc_enemy_raider] Frame 4
stop();
Symbol 2541 MovieClip [mc_enemy_raider] Frame 5
stop();
Symbol 2545 MovieClip [mc_terrain] Frame 1
#initclip 237
Object.registerClass("mc_terrain", Terrain);
#endinitclip
Symbol 2555 MovieClip [mc_terrainSquare] Frame 1
#initclip 238
Object.registerClass("mc_terrainSquare", TerrainSquare);
#endinitclip
stop();
Symbol 2555 MovieClip [mc_terrainSquare] Frame 2
stop();
Symbol 2555 MovieClip [mc_terrainSquare] Frame 3
stop();
Symbol 2555 MovieClip [mc_terrainSquare] Frame 4
stop();
Symbol 2555 MovieClip [mc_terrainSquare] Frame 5
stop();
Symbol 2567 MovieClip Frame 1
stop();
Symbol 2567 MovieClip Frame 2
stop();
Symbol 2567 MovieClip Frame 3
stop();
Symbol 2567 MovieClip Frame 4
stop();
Symbol 2567 MovieClip Frame 5
stop();
Symbol 2571 MovieClip [mc_unit_engineer] Frame 1
#initclip 239
Object.registerClass("mc_unit_engineer", Engineer);
#endinitclip
stop();
Symbol 2571 MovieClip [mc_unit_engineer] Frame 2
stop();
Symbol 2571 MovieClip [mc_unit_engineer] Frame 3
stop();
Symbol 2571 MovieClip [mc_unit_engineer] Frame 4
stop();
Symbol 2572 MovieClip Frame 1
stop();
Symbol 2572 MovieClip Frame 2
stop();
Symbol 2572 MovieClip Frame 3
stop();
Symbol 2573 MovieClip [mc_unit_garbageTruck] Frame 1
#initclip 240
Object.registerClass("mc_unit_garbageTruck", GarbageTruck);
#endinitclip
stop();
Symbol 2573 MovieClip [mc_unit_garbageTruck] Frame 2
stop();
Symbol 2573 MovieClip [mc_unit_garbageTruck] Frame 3
stop();
Symbol 2573 MovieClip [mc_unit_garbageTruck] Frame 4
stop();
Symbol 2587 MovieClip [wasteland_button_horiz] Frame 1
#initclip 241
Object.registerClass("wasteland_button_horiz", ToggleButton);
#endinitclip
stop();
Symbol 2587 MovieClip [wasteland_button_horiz] Frame 2
stop();
Symbol 2596 MovieClip [mc_wasteland_vertical] Frame 1
#initclip 242
Object.registerClass("mc_wasteland_vertical", ToggleButton);
#endinitclip
stop();
Symbol 2596 MovieClip [mc_wasteland_vertical] Frame 2
stop();
Symbol 2619 MovieClip Frame 1
stop();
Symbol 2639 MovieClip Frame 471
stop();
Symbol 2644 Button
on (release) {
_parent.endMovie();
}
Symbol 2645 MovieClip Frame 416
stop();
Symbol 2646 MovieClip [mc_cutScene] Frame 1
#initclip 243
Object.registerClass("mc_cutScene", CutScene);
#endinitclip
stop();
Symbol 2646 MovieClip [mc_cutScene] Frame 2
stop();
Symbol 2646 MovieClip [mc_cutScene] Frame 3
stop();
Symbol 2647 MovieClip [mc_konamicode_listener] Frame 1
#initclip 244
Object.registerClass("mc_konamicode_listener", KonamiCode);
#endinitclip
Symbol 2653 MovieClip Frame 10
_parent._parent.onAttackHit();
Symbol 2654 MovieClip Frame 20
stop();
Symbol 2654 MovieClip Frame 21
stop();
Symbol 2654 MovieClip Frame 22
stop();
Symbol 2654 MovieClip Frame 23
gotoAndStop ("default");
Symbol 2671 MovieClip Frame 10
_parent._parent.onAttackHit();
Symbol 2672 MovieClip Frame 1
stop();
Symbol 2672 MovieClip Frame 2
stop();
Symbol 2672 MovieClip Frame 3
stop();
Symbol 2672 MovieClip Frame 4
gotoAndStop ("default");
Symbol 2687 MovieClip Frame 10
_parent._parent.onAttackHit();
Symbol 2688 MovieClip Frame 1
stop();
Symbol 2688 MovieClip Frame 2
stop();
Symbol 2688 MovieClip Frame 3
stop();
Symbol 2688 MovieClip Frame 4
gotoAndStop ("default");
Symbol 2689 MovieClip [mc_enemy_monsterTruck] Frame 1
#initclip 245
Object.registerClass("mc_enemy_monsterTruck", MonsterTruck);
#endinitclip
stop();
Symbol 2689 MovieClip [mc_enemy_monsterTruck] Frame 2
stop();
Symbol 2689 MovieClip [mc_enemy_monsterTruck] Frame 3
stop();
Symbol 2689 MovieClip [mc_enemy_monsterTruck] Frame 4
stop();
Symbol 2689 MovieClip [mc_enemy_monsterTruck] Frame 5
stop();
Symbol 2690 MovieClip [mc_explodeCloud] Frame 22
_parent.halfDestroyAnim();
Symbol 2690 MovieClip [mc_explodeCloud] Frame 40
_parent.onDestroyAnim();
this.removeMovieClip();
Symbol 2693 MovieClip Frame 10
stop();
Symbol 2696 MovieClip Frame 1
stop();
Symbol 2696 MovieClip Frame 2
stop();
Instance of Symbol 2695 MovieClip in Symbol 2696 MovieClip Frame 2
on (release) {
}
Symbol 2697 MovieClip [mc_radioHolder] Frame 1
#initclip 247
Object.registerClass("mc_radioHolder", RadioHolder);
#endinitclip
Instance of Symbol 50 MovieClip [RadioButton] "radChallenge1" in Symbol 2697 MovieClip [mc_radioHolder] Frame 1
//component parameters
onClipEvent (construct) {
data = 1;
groupName = "challengeGroup";
label = "Challenge #1";
labelPlacement = "right";
selected = false;
}
Instance of Symbol 50 MovieClip [RadioButton] "radChallenge2" in Symbol 2697 MovieClip [mc_radioHolder] Frame 1
//component parameters
onClipEvent (construct) {
data = 2;
groupName = "challengeGroup";
label = "Challenge #2";
labelPlacement = "right";
selected = false;
}
Instance of Symbol 50 MovieClip [RadioButton] "radChallenge3" in Symbol 2697 MovieClip [mc_radioHolder] Frame 1
//component parameters
onClipEvent (construct) {
data = 3;
groupName = "challengeGroup";
label = "Challenge #3";
labelPlacement = "right";
selected = false;
}
Instance of Symbol 50 MovieClip [RadioButton] "radChallenge4" in Symbol 2697 MovieClip [mc_radioHolder] Frame 1
//component parameters
onClipEvent (construct) {
data = 4;
groupName = "challengeGroup";
label = "Challenge #4";
labelPlacement = "right";
selected = false;
}
Instance of Symbol 50 MovieClip [RadioButton] "radChallenge5" in Symbol 2697 MovieClip [mc_radioHolder] Frame 1
//component parameters
onClipEvent (construct) {
data = 5;
groupName = "challengeGroup";
label = "Challenge #5";
labelPlacement = "right";
selected = false;
}
Instance of Symbol 50 MovieClip [RadioButton] "radChallenge0" in Symbol 2697 MovieClip [mc_radioHolder] Frame 1
//component parameters
onClipEvent (construct) {
data = 0;
groupName = "challengeGroup";
label = "Free Play";
labelPlacement = "right";
selected = false;
}
Symbol 2709 Button
on (release) {
gotoAndStop ("campaign");
}
Symbol 2715 Button
on (release) {
gotoAndStop ("credits");
}
Symbol 2721 Button
on (release) {
gotoAndStop ("sandbox");
}
Symbol 2728 Button
on (release) {
getURL ("http://jayisgames.com/archives/2009/01/super_energy_apocalypse_recycled.php", "_blank");
}
Symbol 2729 MovieClip Frame 1
function answer() {
answered = true;
}
function noResponse() {
if (!answered) {
getURL ("http://jayisgames.com/cgdc5/?ref=8fefdbfa");
}
}
if (flash.external.ExternalInterface.available) {
flash.external.ExternalInterface.addCallback("answer", this, answer);
}
var answered = false;
button_mc.onRelease = function () {
with (_parent) {
if (flash.external.ExternalInterface.available) {
flash.external.ExternalInterface.call("close");
}
setTimeout(noResponse, 500);
}
};
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("8fefdbfa", this, 10301, true);
Symbol 2733 Button
on (release) {
getURL ("http://www.indiecade.com", "_blank");
}
Symbol 2741 Button
on (release) {
getURL ("http://www.harc.edu", "_blank");
}
Symbol 2742 MovieClip Frame 1
button_mc.onRelease = function () {
getURL ("http://www.harc.edu", "_blank");
};
Symbol 2746 Button
on (release) {
getURL ("http://www.brainjuicegames.com/paypal.html", "_blank");
}
Symbol 2754 Button
on (release) {
var temp = levelStepper.value;
var diff = levelDifficulty.selectedIndex;
stopAllSounds();
gotoAndStop ("game");
if (theSuperDirector != undefined) {
theSuperDirector.removeMovieClip();
var d = theSuperDirector.getDepth();
theSuperDirector = this.attachMovie("mc_superDirector", "theSuperDirector", d);
} else {
theSuperDirector = this.attachMovie("mc_superDirector", "theSuperDirector", getNextHighestDepth());
}
theSuperDirector.setDifficulty(diff);
theSuperDirector.setLevel(temp);
theSuperDirector.startTheGame();
}
Symbol 2758 Button
on (release) {
gotoAndStop ("main");
}
Symbol 2791 MovieClip Frame 1
stop();
Symbol 2791 MovieClip Frame 2
stop();
Symbol 2791 MovieClip Frame 3
stop();
Symbol 2791 MovieClip Frame 4
stop();
Symbol 2791 MovieClip Frame 5
stop();
Symbol 2791 MovieClip Frame 6
stop();
Symbol 2791 MovieClip Frame 7
stop();
Symbol 2791 MovieClip Frame 8
stop();
Symbol 2792 Button
on (release) {
levels.gotoAndStop(levels._currentframe - 1);
currentLevel = -levels._currentframe;
displayLevel = Math.abs(currentLevel);
}
Symbol 2793 Button
on (release) {
levels.gotoAndStop(levels._currentframe + 1);
currentLevel = -levels._currentframe;
displayLevel = Math.abs(currentLevel);
}
Symbol 2811 Button
on (release) {
gotoAndStop ("main");
}
Symbol 2813 Button
on (release) {
stopAllSounds();
if (theSuperDirector != undefined) {
theSuperDirector.removeMovieClip();
var d = theSuperDirector.getDepth();
theSuperDirector = this.attachMovie("mc_superDirector", "theSuperDirector", d);
} else {
theSuperDirector = this.attachMovie("mc_superDirector", "theSuperDirector", getNextHighestDepth());
}
var back = this;
var n = new LevelNugget();
n.setR(r_e.value, r_f.value, r_s.value, r_r.value, r_m.value, r_g.value, r_ff.value, r_c.value);
n.setS(time_day.value, time_night.value, spawn_rate.value, spawn_time.value, increase_rate.value, increase_time.value, zombiesOn.value);
n.setW(!wasteland_n.isDown, !wasteland_s.isDown, !wasteland_w.isDown, !wasteland_e.isDown);
n.setSandboxGoal("surviveDays", surviveDays.value, challengeString);
n.setChallengeIndex(theRadio.challengeIndex);
theSuperDirector.onLoad = function () {
this.setNugget(back.n);
this.setLevel(back.currentLevel);
this.startTheGame();
};
gotoAndStop ("game");
}
Symbol 2814 MovieClip Frame 12
stop();
Symbol 2836 Button
on (release) {
gotoAndStop ("main");
}