Section 1
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 2
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 3
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 4
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class Tween extends EventDispatcher {
public var isPlaying:Boolean;// = false
public var obj:Object;// = null
public var prop:String;// = ""
public var func:Function;
public var begin:Number;// = NAN
public var change:Number;// = NAN
public var useSeconds:Boolean;// = false
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var looping:Boolean;// = false
private var _duration:Number;// = NAN
private var _time:Number;// = NAN
private var _fps:Number;// = NAN
private var _position:Number;// = NAN
private var _startTime:Number;// = NAN
private var _intervalID:uint;// = 0
private var _finish:Number;// = NAN
private var _timer:Timer;// = null
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function get time():Number{
return (this._time);
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function get duration():Number{
return (this._duration);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get FPS():Number{
return (this._fps);
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
}
}//package fl.transitions
Section 5
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_RESUME:String = "motionResume";
public static const MOTION_LOOP:String = "motionLoop";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 6
//btnChurch_40 (sfd_fla.btnChurch_40)
package sfd_fla {
import flash.display.*;
public dynamic class btnChurch_40 extends MovieClip {
public function btnChurch_40(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 7
//btnConstructionsite_50 (sfd_fla.btnConstructionsite_50)
package sfd_fla {
import flash.display.*;
public dynamic class btnConstructionsite_50 extends MovieClip {
public function btnConstructionsite_50(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 8
//btnDeforest_31 (sfd_fla.btnDeforest_31)
package sfd_fla {
import flash.display.*;
public dynamic class btnDeforest_31 extends MovieClip {
public function btnDeforest_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 9
//btnFarm_37 (sfd_fla.btnFarm_37)
package sfd_fla {
import flash.display.*;
public dynamic class btnFarm_37 extends MovieClip {
public function btnFarm_37(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 10
//btnGarbagedump_49 (sfd_fla.btnGarbagedump_49)
package sfd_fla {
import flash.display.*;
public dynamic class btnGarbagedump_49 extends MovieClip {
public function btnGarbagedump_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 11
//btnGoToIncident_28 (sfd_fla.btnGoToIncident_28)
package sfd_fla {
import flash.display.*;
public dynamic class btnGoToIncident_28 extends MovieClip {
public function btnGoToIncident_28(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 12
//btnGrid_68 (sfd_fla.btnGrid_68)
package sfd_fla {
import flash.display.*;
public dynamic class btnGrid_68 extends MovieClip {
public function btnGrid_68(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 13
//btnGym_48 (sfd_fla.btnGym_48)
package sfd_fla {
import flash.display.*;
public dynamic class btnGym_48 extends MovieClip {
public function btnGym_48(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 14
//btnHospital_46 (sfd_fla.btnHospital_46)
package sfd_fla {
import flash.display.*;
public dynamic class btnHospital_46 extends MovieClip {
public function btnHospital_46(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 15
//btnHouse_36 (sfd_fla.btnHouse_36)
package sfd_fla {
import flash.display.*;
public dynamic class btnHouse_36 extends MovieClip {
public function btnHouse_36(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 16
//btnKrusty_39 (sfd_fla.btnKrusty_39)
package sfd_fla {
import flash.display.*;
public dynamic class btnKrusty_39 extends MovieClip {
public function btnKrusty_39(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 17
//btnKwikmart_38 (sfd_fla.btnKwikmart_38)
package sfd_fla {
import flash.display.*;
public dynamic class btnKwikmart_38 extends MovieClip {
public function btnKwikmart_38(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 18
//btnLaboratory_51 (sfd_fla.btnLaboratory_51)
package sfd_fla {
import flash.display.*;
public dynamic class btnLaboratory_51 extends MovieClip {
public function btnLaboratory_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 19
//btnLardlad_43 (sfd_fla.btnLardlad_43)
package sfd_fla {
import flash.display.*;
public dynamic class btnLardlad_43 extends MovieClip {
public function btnLardlad_43(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 20
//btnMenu_54 (sfd_fla.btnMenu_54)
package sfd_fla {
import flash.display.*;
public dynamic class btnMenu_54 extends MovieClip {
public function btnMenu_54(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 21
//btnMinMax_67 (sfd_fla.btnMinMax_67)
package sfd_fla {
import flash.display.*;
public dynamic class btnMinMax_67 extends MovieClip {
public function btnMinMax_67(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 22
//btnMoes_42 (sfd_fla.btnMoes_42)
package sfd_fla {
import flash.display.*;
public dynamic class btnMoes_42 extends MovieClip {
public function btnMoes_42(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 23
//btnPolice_45 (sfd_fla.btnPolice_45)
package sfd_fla {
import flash.display.*;
public dynamic class btnPolice_45 extends MovieClip {
public function btnPolice_45(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 24
//btnPowerplant_41 (sfd_fla.btnPowerplant_41)
package sfd_fla {
import flash.display.*;
public dynamic class btnPowerplant_41 extends MovieClip {
public function btnPowerplant_41(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 25
//btnPray_33 (sfd_fla.btnPray_33)
package sfd_fla {
import flash.display.*;
public dynamic class btnPray_33 extends MovieClip {
public function btnPray_33(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 26
//btnPray2_64 (sfd_fla.btnPray2_64)
package sfd_fla {
import flash.display.*;
public dynamic class btnPray2_64 extends MovieClip {
public function btnPray2_64(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 27
//btnRay_35 (sfd_fla.btnRay_35)
package sfd_fla {
import flash.display.*;
public dynamic class btnRay_35 extends MovieClip {
public function btnRay_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 28
//btnRay2_66 (sfd_fla.btnRay2_66)
package sfd_fla {
import flash.display.*;
public dynamic class btnRay2_66 extends MovieClip {
public function btnRay2_66(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 29
//btnRepair_32 (sfd_fla.btnRepair_32)
package sfd_fla {
import flash.display.*;
public dynamic class btnRepair_32 extends MovieClip {
public function btnRepair_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 30
//btnRepelling_52 (sfd_fla.btnRepelling_52)
package sfd_fla {
import flash.display.*;
public dynamic class btnRepelling_52 extends MovieClip {
public function btnRepelling_52(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 31
//btnRocket_34 (sfd_fla.btnRocket_34)
package sfd_fla {
import flash.display.*;
public dynamic class btnRocket_34 extends MovieClip {
public function btnRocket_34(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 32
//btnRocket2_65 (sfd_fla.btnRocket2_65)
package sfd_fla {
import flash.display.*;
public dynamic class btnRocket2_65 extends MovieClip {
public function btnRocket2_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 33
//btnSchool_44 (sfd_fla.btnSchool_44)
package sfd_fla {
import flash.display.*;
public dynamic class btnSchool_44 extends MovieClip {
public function btnSchool_44(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 34
//btnSpeaker_26 (sfd_fla.btnSpeaker_26)
package sfd_fla {
import flash.display.*;
public dynamic class btnSpeaker_26 extends MovieClip {
public function btnSpeaker_26(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 35
//btnTownhall_47 (sfd_fla.btnTownhall_47)
package sfd_fla {
import flash.display.*;
public dynamic class btnTownhall_47 extends MovieClip {
public function btnTownhall_47(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 36
//btnUpgrade_61 (sfd_fla.btnUpgrade_61)
package sfd_fla {
import flash.display.*;
public dynamic class btnUpgrade_61 extends MovieClip {
public function btnUpgrade_61(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 37
//MainTimeline (sfd_fla.MainTimeline)
package sfd_fla {
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var btnGrid:MovieClip;
public var bgScreen:MovieClip;
public var btnProceed:MovieClip;
public var btnRay2:MovieClip;
public var txtPopulation:TextField;
public var wndRepair:MovieClip;
public var btnGoToIncident:MovieClip;
public var medalWar:MovieClip;
public var btnSpeaker:MovieClip;
public var btnZoomOut:MovieClip;
public var medalRescue:MovieClip;
public var medalTech:MovieClip;
public var btnPray2:MovieClip;
public var btnNextDay:MovieClip;
public var btnDa:MovieClip;
public var loader_mc:movie_mc;
public var loaded_txt:TextField;
public var medalPeace:MovieClip;
public var barResearch:MovieClip;
public var wndMenu:MovieClip;
public var btnZoomIn:MovieClip;
public var whiteCover:MovieClip;
public var btnMinMax:MovieClip;
public var bokaal:MovieClip;
public var txtPollution:TextField;
public var txtIncome:TextField;
public var txtResources:TextField;
public var cover2:MovieClip;
public var btnRocket2:MovieClip;
public var textBox:MovieClip;
public var btnMenu:MovieClip;
public var btnIntroStart1:introStartButton;
public var txtValues:TextField;
public var btnIntroStart2:MovieClip;
public var shield:MovieClip;
public var medalNature:MovieClip;
public var btnUpgrade:MovieClip;
public var overlaylines:MovieClip;
public var screen:MovieClip;
public var iNoBloodMod;
public var myChannel:SoundChannel;
public var musTheme:wavTheme;
public var transform0:SoundTransform;
public var musIntro:wavIntro;
public var sndDestroy:wavDestroy;
public var sndCool:wavCool;
public var sndDoh:wavDoh;
public var sndLaugh:wavLaugh;
public var sndPity:wavPity;
public var sndLizard:wavLizard;
public var sndNooo:wavNooo;
public var tweenIntro2:Tween;
public var tweenIntro:Tween;
public var iIncomePerPerson;
public var iTopPopulation;
public var iTotBuildingsBuilt;
public var iTotBuildingsDestroyed;
public var iTownValue;
public var iPollutionLevel;
public var iDayCounter;
public var iTotalDeaths;
public var iTotalCuredInHospital;
public var iTotalForestsCut;
public var bTreesDestroyed;
public var bPrayed;
public var bRocketsUsed;
public var bMenuMinimized;
public var houseBufferID;
public var houseBufferX;
public var houseBufferY;
public var iPopulation;
public var iFat;
public var iThin;
public var iBuildingsDestroyed;
public var iBoredom;
public var iAnger;
public var iPopAngerMod;
public var iFleeReason;
public var iTotLabDays;
public var iTotLabDaysRemaining;
public var iLabSegmentSize;
public var iPhase;
public var iCrushingProgressTimer;
public var bRunBack;
public var bWin;
public var iRepairCostBuffer;
public var iRepairX;
public var iRepairY;
public var iRepairID;
public var income;
public var iCash;
public var iHouse1;
public var iHouse2;
public var iKwikmart;
public var iChurch;
public var iPowerplant;
public var iFarm;
public var iMoes;
public var iKrusty;
public var iLardlad;
public var iSchool;
public var iPolice;
public var iTownhall;
public var iHospital;
public var iGym;
public var iRay;
public var iGarbage;
public var iConstruction;
public var iLaboratory;
public var iRepellingtower;
public var iAction;
public var iBuildCost;
public var iBuildingType;
public var bPrayers;
public var bRocket;
public var bRay;
public var bInventedRocket;
public var bInventedRepelling;
public var bInventedRay;
public var bSounds;
public var lisaX;
public var lisaY;
public var tweenX:Tween;
public var tweenY:Tween;
public var tweenWhite:Tween;
public var lisaTweenX:Tween;
public var lisaTweenY:Tween;
public var newLocX;
public var newLocY;
public var i;
public var j;
public var k;
public var myInterval:uint;
public var strChurchText:String;
public var arrSprite:Array;
public var arrBuilding:Array;
public var arrStreet:Array;
public var iRnd;
public var lastTween:Tween;
public var strOut;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
public function onProgress(_arg1:ProgressEvent):void{
var _local2:Number = _arg1.target.bytesLoaded;
var _local3:Number = _arg1.target.bytesTotal;
var _local4:Number = (_local2 / _local3);
loader_mc.scaleX = _local4;
loaded_txt.text = (("Loading... " + Math.round((_local4 * 100))) + "%");
}
public function onComplete(_arg1:Event):void{
loaded_txt.text = "Finished loading.";
var _local2:* = this.loaderInfo.url;
var _local3:* = false;
if (_local2.search("file:") != -1){
_local3 = true;
};
if (_local2.search("deviantart.net") != -1){
_local3 = true;
};
if (_local3 == true){
gotoAndStop(2);
};
}
public function startGame(_arg1:MouseEvent):void{
btnIntroStart1.removeEventListener(MouseEvent.CLICK, startGameNoBlood);
btnIntroStart2.removeEventListener(MouseEvent.CLICK, startGame);
btnDa.removeEventListener(MouseEvent.CLICK, launchDA);
SoundMixer.stopAll();
gotoAndStop(3);
}
public function startGameNoBlood(_arg1:MouseEvent):void{
iNoBloodMod = 1;
btnIntroStart1.removeEventListener(MouseEvent.CLICK, startGameNoBlood);
btnIntroStart2.removeEventListener(MouseEvent.CLICK, startGame);
btnDa.removeEventListener(MouseEvent.CLICK, launchDA);
SoundMixer.stopAll();
gotoAndStop(3);
}
public function launchDA(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://illionore.deviantart.com");
navigateToURL(_local2, "_blank");
}
public function goToGame(_arg1:MouseEvent):void{
btnProceed.removeEventListener(MouseEvent.CLICK, goToGame);
SoundMixer.stopAll();
gotoAndStop(4);
}
public function showNote(_arg1, _arg2):void{
if (_arg2 == ""){
textBox.alpha = 0;
textBox.y = 525;
} else {
textBox.y = 462;
if (_arg1 == true){
textBox.errorBox.alpha = 1;
} else {
textBox.errorBox.alpha = 0;
};
textBox.txt.text = _arg2;
textBox.alpha = 1;
};
}
public function mouseClicked(_arg1:MouseEvent):void{
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local11:*;
var _local12:*;
var _local13:Array;
var _local14:String;
var _local2:* = (stage.mouseX - 400);
var _local3:* = (stage.mouseY - 300);
var _local4:* = "";
showNote(false, "");
if (_arg1.target.name != null){
_local4 = _arg1.target.name;
};
if (_local4 == "screen"){
_local4 = _arg1.target.parent.name;
};
var _local9:* = (screen.x - _local2);
var _local10:* = (screen.y - _local3);
if (_local4 != "btnConfirm"){
showConfirmRepair(false);
};
if (_local4 == "btnZoomIn"){
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
if (screen.scaleX <= 2){
_local5 = (400 - screen.x);
_local6 = (300 - screen.y);
screen.scaleX = (screen.scaleX * 2);
screen.scaleY = (screen.scaleY * 2);
screen.x = -(((_local5 * 2) - 400));
screen.y = -(((_local6 * 2) - 300));
if (screen.scaleX == 4){
btnZoomIn.alpha = 0.2;
};
btnZoomOut.alpha = 0.8;
if (screen.x > 0){
screen.x = 0;
};
if (screen.y > 0){
screen.y = 0;
};
if (screen.x < (-4870 * screen.scaleX)){
screen.x = (-4870 * screen.scaleX);
};
if (screen.y < (-2742 * screen.scaleY)){
screen.y = (-2742 * screen.scaleY);
};
_local7 = -401;
_local8 = -86;
if (screen.scaleX > 3.8){
_local7 = -18688;
_local8 = -10384;
} else {
if (screen.scaleX > 1.8){
_local7 = -8942;
_local8 = -4885;
} else {
if (screen.scaleX > 0.8){
_local7 = -4076;
_local8 = -2145;
} else {
if (screen.scaleX > 0.4){
_local7 = -1637;
_local8 = -770;
};
};
};
};
if (screen.x < _local7){
screen.x = _local7;
};
if (screen.y < _local8){
screen.y = _local8;
};
};
} else {
if (_local4 == "btnZoomOut"){
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
if (screen.scaleX >= 0.5){
_local5 = (400 - screen.x);
_local6 = (300 - screen.y);
screen.scaleX = (screen.scaleX / 2);
screen.scaleY = (screen.scaleY / 2);
screen.x = -(((_local5 / 2) - 400));
screen.y = -(((_local6 / 2) - 300));
if (screen.scaleX == 0.25){
btnZoomOut.alpha = 0.2;
};
btnZoomIn.alpha = 0.8;
if (screen.x > 0){
screen.x = 0;
};
if (screen.y > 0){
screen.y = 0;
};
if (screen.x < (-4870 * screen.scaleX)){
screen.x = (-4870 * screen.scaleX);
};
if (screen.y < (-2742 * screen.scaleY)){
screen.y = (-2742 * screen.scaleY);
};
_local7 = -401;
_local8 = -86;
if (screen.scaleX > 3.8){
_local7 = -18688;
_local8 = -10384;
} else {
if (screen.scaleX > 1.8){
_local7 = -8942;
_local8 = -4885;
} else {
if (screen.scaleX > 0.8){
_local7 = -4076;
_local8 = -2145;
} else {
if (screen.scaleX > 0.4){
_local7 = -1637;
_local8 = -770;
};
};
};
};
if (screen.x < _local7){
screen.x = _local7;
};
if (screen.y < _local8){
screen.y = _local8;
};
};
} else {
if (_local4 == "btnGoToIncident"){
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
if (lisaY != 10){
_local2 = ((-(arrSprite[lisaY][lisaX].x) * screen.scaleX) + (400 - (200 * screen.scaleX)));
_local3 = ((-(arrSprite[lisaY][lisaX].y) * screen.scaleY) + (600 - (20 * screen.scaleY)));
borderCorrection(_local2, _local3, true);
};
} else {
if (_local4 == "btnSpeaker"){
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
if (bSounds == true){
bSounds = false;
btnSpeaker.gotoAndStop(2);
} else {
bSounds = true;
btnSpeaker.gotoAndStop(1);
};
} else {
if ((((_local4 == "btnDeforest")) && ((wndMenu.btnDeforest.currentFrame == 1)))){
iAction = 1;
iBuildCost = 100;
iBuildingType = 2;
showNote(false, "Select the forest location you wish to deforest...");
} else {
if ((((_local4 == "btnRepair")) && ((wndMenu.btnRepair.currentFrame == 1)))){
if (iPhase == 1){
showNote(true, "You can't repair buildings while Lisa is on a rampage.");
} else {
iAction = 2;
showMenu(false);
showNote(false, "Select the damaged (NOT destroyed) building to be repaired...");
};
} else {
if ((((((_local4 == "btnPray")) || ((_local4 == "btnPray2")))) && ((wndMenu.btnPray.currentFrame == 1)))){
if (bRocket == true){
showNote(true, "Praying canceled: A rocket is already being launched...");
} else {
bPrayers = true;
bPrayed = true;
showNote(false, "The town started praying to repel the threat.");
enableBtnPray2(false);
};
showMenu(false);
} else {
if ((((((_local4 == "btnRocket")) || ((_local4 == "btnRocket2")))) && ((wndMenu.btnRocket.currentFrame == 1)))){
bPrayers = false;
bRocket = true;
bRocketsUsed = true;
enableBtnPray2(false);
enableBtnRocket2(false);
showNote(false, "The police force is launching their heat-seeking rockets!");
showMenu(false);
} else {
if ((((((_local4 == "btnRay")) || ((_local4 == "btnRay2")))) && ((wndMenu.btnRay.currentFrame == 1)))){
bPrayers = false;
bRocket = false;
enableBtnPray2(false);
enableBtnRocket2(false);
enableBtnRay2(false);
bWin = true;
doWin();
} else {
if ((((_local4 == "btnFarm")) && ((wndMenu.btnFarm.currentFrame == 1)))){
iAction = 3;
iBuildCost = 150;
iBuildingType = 30;
showNote(false, "Select a location to build a farm...");
showMenu(false);
} else {
if ((((_local4 == "btnHouse")) && ((wndMenu.btnHouse.currentFrame == 1)))){
iAction = 3;
iBuildCost = 500;
if (Math.floor((Math.random() * 2)) == 0){
iBuildingType = 5;
} else {
iBuildingType = 10;
};
showNote(false, "Select a location to build a family house...");
showMenu(false);
} else {
if ((((_local4 == "btnKwikmart")) && ((wndMenu.btnKwikmart.currentFrame == 1)))){
iAction = 3;
iBuildCost = 250;
iBuildingType = 15;
showNote(false, "Select a location to build a kwik-E-mart...");
showMenu(false);
} else {
if ((((_local4 == "btnKrusty")) && ((wndMenu.btnKrusty.currentFrame == 1)))){
iAction = 3;
iBuildCost = 250;
iBuildingType = 40;
showNote(false, "Select a location to build a Krusty burger restaurant...");
showMenu(false);
} else {
if ((((_local4 == "btnChurch")) && ((wndMenu.btnChurch.currentFrame == 1)))){
iAction = 3;
iBuildCost = 1000;
iBuildingType = 20;
showNote(false, "Select a location to build a church...");
showMenu(false);
} else {
if ((((_local4 == "btnPowerplant")) && ((wndMenu.btnPowerplant.currentFrame == 1)))){
iAction = 3;
iBuildCost = 5000;
iBuildingType = 25;
showNote(false, "Select a location to build a power plant...");
showMenu(false);
} else {
if ((((_local4 == "btnGarbage")) && ((wndMenu.btnGarbage.currentFrame == 1)))){
iAction = 3;
iBuildCost = 150;
iBuildingType = 75;
showNote(false, "Select a location to build a garbage dump...");
showMenu(false);
} else {
if ((((_local4 == "btnMoes")) && ((wndMenu.btnMoes.currentFrame == 1)))){
iAction = 3;
iBuildCost = 250;
iBuildingType = 35;
showNote(false, "Select a location to build a pub of Moe's chain...");
showMenu(false);
} else {
if ((((_local4 == "btnLardlad")) && ((wndMenu.btnLardlad.currentFrame == 1)))){
iAction = 3;
iBuildCost = 250;
iBuildingType = 45;
showNote(false, "Select a location to build a lard lad's donut shed...");
showMenu(false);
} else {
if ((((_local4 == "btnGym")) && ((wndMenu.btnGym.currentFrame == 1)))){
iAction = 3;
iBuildCost = 250;
iBuildingType = 70;
showNote(false, "Select a location to build a gym...");
showMenu(false);
} else {
if ((((_local4 == "btnConstruction")) && ((wndMenu.btnConstruction.currentFrame == 1)))){
iAction = 3;
iBuildCost = 2000;
iBuildingType = 80;
showNote(false, "Select a location to build a construction site...");
showMenu(false);
} else {
if ((((_local4 == "btnTownhall")) && ((wndMenu.btnTownhall.currentFrame == 1)))){
iAction = 3;
iBuildCost = 2000;
iBuildingType = 60;
showNote(false, "Select a location to build a town hall...");
showMenu(false);
} else {
if ((((_local4 == "btnSchool")) && ((wndMenu.btnSchool.currentFrame == 1)))){
iAction = 3;
iBuildCost = 2500;
iBuildingType = 50;
showNote(false, "Select a location to build a school...");
showMenu(false);
} else {
if ((((_local4 == "btnPolice")) && ((wndMenu.btnPolice.currentFrame == 1)))){
iAction = 3;
iBuildCost = 5000;
iBuildingType = 55;
showNote(false, "Select a location to build a police station...");
showMenu(false);
} else {
if ((((_local4 == "btnHospital")) && ((wndMenu.btnHospital.currentFrame == 1)))){
iAction = 3;
iBuildCost = 5000;
iBuildingType = 65;
showNote(false, "Select a location to build a hospital...");
showMenu(false);
} else {
if ((((_local4 == "btnLaboratory")) && ((wndMenu.btnLaboratory.currentFrame == 1)))){
iAction = 3;
iBuildCost = 7500;
iBuildingType = 85;
showNote(false, "Select a location to build a laboratory...");
showMenu(false);
} else {
if ((((_local4 == "btnRepelling")) && ((wndMenu.btnRepelling.currentFrame == 1)))){
iAction = 3;
iBuildCost = 2000;
iBuildingType = 90;
showNote(false, "Select a location to build a repelling tower...");
showMenu(false);
} else {
if ((((((_local4 == "btnUpgrade")) && ((btnUpgrade.currentFrame == 1)))) && ((btnUpgrade.alpha == 1)))){
iAction = 4;
iBuildCost = 5000;
iBuildingType = 95;
showNote(false, "Select the repelling tower you want to upgrade to shrink-ray...");
showMenu(false);
} else {
if ((((_local4 == "btnConfirm")) && ((wndRepair.alpha == 1)))){
if (iRepairCostBuffer > iCash){
showConfirmRepair(false);
} else {
iCash = (iCash - iRepairCostBuffer);
placeBuilding(iRepairX, iRepairY, iRepairID, false);
showConfirmRepair(false);
updateUi();
};
} else {
if ((((_local4 == "btnNextDay")) && ((btnNextDay.alpha == 1)))){
btnNextDay.alpha = 0;
btnNextDay.x = -80;
iPhase = 0;
reviveDeadCitizens();
iDayCounter++;
randomizeChurchTextOfTheDay();
iBuildingsDestroyed = 0;
iBoredom = 0;
iFleeReason = 0;
bPrayers = false;
bRocket = false;
iCrushingProgressTimer = 5;
showMenu(false);
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
iCash = (iCash + income);
if (iLaboratory > 0){
_local11 = "s";
barResearch.y = 3;
barResearch.alpha = 1;
if (bInventedRocket == false){
iTotLabDays = 5;
iLabSegmentSize = 4;
iTotLabDaysRemaining = (iTotLabDaysRemaining - iLaboratory);
if (iTotLabDaysRemaining == 1){
_local11 = "";
};
if (iTotLabDaysRemaining < 1){
bInventedRocket = true;
iTotLabDays = 10;
iLabSegmentSize = 2;
iTotLabDaysRemaining = iTotLabDays;
barResearch.txt.text = ((("Researching: Repel-tower. remaining: " + iTotLabDaysRemaining) + " lab-day") + _local11);
} else {
barResearch.txt.text = ((("Researching: Rocket science. remaining: " + iTotLabDaysRemaining) + " lab-day") + _local11);
};
} else {
if (bInventedRepelling == false){
iTotLabDaysRemaining = (iTotLabDaysRemaining - iLaboratory);
if (iTotLabDaysRemaining == 1){
_local11 = "";
};
if (iTotLabDaysRemaining < 1){
bInventedRepelling = true;
iTotLabDays = 20;
iLabSegmentSize = 1;
iTotLabDaysRemaining = iTotLabDays;
barResearch.txt.text = ((("Researching: Shrink-ray. remaining: " + iTotLabDaysRemaining) + " lab-day") + _local11);
} else {
barResearch.txt.text = ((("Researching: Repel-tower. remaining: " + iTotLabDaysRemaining) + " lab-day") + _local11);
};
} else {
if (bInventedRay == false){
iTotLabDaysRemaining = (iTotLabDaysRemaining - iLaboratory);
if (iTotLabDaysRemaining == 1){
_local11 = "";
};
if (iTotLabDaysRemaining < 1){
bInventedRay = true;
iTotLabDays = 20;
iLabSegmentSize = 1;
iTotLabDaysRemaining = 0;
barResearch.txt.text = "Research complete.";
btnUpgrade.y = 7;
btnUpgrade.alpha = 1;
} else {
barResearch.txt.text = ((("Researching: Shrink-ray. remaining: " + iTotLabDaysRemaining) + " lab-day") + _local11);
};
};
};
};
barResearch.bar.scaleX = (0.05 * (20 - (iTotLabDaysRemaining * iLabSegmentSize)));
};
updateUi();
} else {
if (_local4 == "btnMenu"){
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
if (bWin == false){
if (wndMenu.x > 500){
showMenu(true);
} else {
showMenu(false);
};
};
} else {
if (_local4 == "btnMinMax"){
if (bMenuMinimized == false){
bMenuMinimized = true;
btnMinMax.gotoAndStop(2);
if (wndMenu.alpha == 1){
wndMenu.x = 477;
};
} else {
bMenuMinimized = false;
btnMinMax.gotoAndStop(1);
if (wndMenu.alpha == 1){
wndMenu.x = 354;
};
};
} else {
if (_local4 == "btnGrid"){
if (btnGrid.currentFrame == 1){
btnGrid.gotoAndStop(2);
screen.grid.alpha = 1;
} else {
btnGrid.gotoAndStop(1);
screen.grid.alpha = 0;
};
} else {
_local12 = 0;
_local13 = [0, 0];
_local14 = "";
if (iAction == 0){
if (_local4.search("btn") != 0){
borderCorrection(_local2, _local3, false);
};
} else {
if (iAction == 1){
_local14 = _arg1.target.name;
if (_local14.search("cell") == 0){
_local14 = _local14.substring(4);
_local13 = getCellCoords(int(_local14));
if (arrBuilding[_local13[1]][_local13[0]] == 1){
iCash = (iCash - iBuildCost);
placeBuilding(_local13[0], _local13[1], iBuildingType, true);
iTotalForestsCut++;
bTreesDestroyed = true;
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
updateUi();
} else {
showNote(true, "You can only deforest forest locations.");
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
};
};
} else {
if (iAction == 2){
_local14 = _arg1.target.name;
if (_local14.search("cell") == 0){
_local14 = _local14.substring(4);
_local13 = getCellCoords(int(_local14));
_local12 = arrBuilding[_local13[1]][_local13[0]];
if ((((((((((((((((((((((((((((((((((_local12 == 7)) || ((_local12 == 12)))) || ((_local12 == 17)))) || ((_local12 == 22)))) || ((_local12 == 27)))) || ((_local12 == 32)))) || ((_local12 == 37)))) || ((_local12 == 42)))) || ((_local12 == 47)))) || ((_local12 == 52)))) || ((_local12 == 57)))) || ((_local12 == 62)))) || ((_local12 == 67)))) || ((_local12 == 72)))) || ((_local12 == 77)))) || ((_local12 == 82)))) || ((_local12 == 87)))){
showNote(true, "This building is destroyed, you can only repair damaged buildings.");
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
} else {
if ((((((((((((((((((((((((((((((((((_local12 == 6)) || ((_local12 == 11)))) || ((_local12 == 16)))) || ((_local12 == 21)))) || ((_local12 == 26)))) || ((_local12 == 31)))) || ((_local12 == 36)))) || ((_local12 == 41)))) || ((_local12 == 46)))) || ((_local12 == 51)))) || ((_local12 == 56)))) || ((_local12 == 61)))) || ((_local12 == 66)))) || ((_local12 == 71)))) || ((_local12 == 76)))) || ((_local12 == 81)))) || ((_local12 == 86)))){
if (_local12 == 76){
showNote(true, "Garbage dumps cannot be repaired.");
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
} else {
iBuildCost = 0;
if ((((_local12 == 6)) || ((_local12 == 11)))){
iBuildCost = 100;
};
if (_local12 == 16){
iBuildCost = 60;
};
if (_local12 == 21){
iBuildCost = 250;
};
if (_local12 == 26){
iBuildCost = 500;
};
if (_local12 == 31){
iBuildCost = 40;
};
if (_local12 == 36){
iBuildCost = 60;
};
if (_local12 == 41){
iBuildCost = 60;
};
if (_local12 == 46){
iBuildCost = 60;
};
if (_local12 == 51){
iBuildCost = 250;
};
if (_local12 == 56){
iBuildCost = 500;
};
if (_local12 == 61){
iBuildCost = 250;
};
if (_local12 == 66){
iBuildCost = 500;
};
if (_local12 == 71){
iBuildCost = 60;
};
if (_local12 == 81){
iBuildCost = 250;
};
if (_local12 == 86){
iBuildCost = 2000;
};
iRepairCostBuffer = iBuildCost;
iRepairX = _local13[0];
iRepairY = _local13[1];
iRepairID = (_local12 - 1);
showConfirmRepair(true);
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
updateUi();
};
} else {
showNote(true, "There is nothing to repair here.");
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
};
};
};
} else {
if (iAction == 3){
_local14 = _arg1.target.name;
if (_local14.search("cell") == 0){
_local14 = _local14.substring(4);
_local13 = getCellCoords(int(_local14));
_local12 = arrBuilding[_local13[1]][_local13[0]];
if ((((((((((((((((((((((((((((((((_local12 == 2)) || ((_local12 == 7)))) || ((_local12 == 12)))) || ((_local12 == 17)))) || ((_local12 == 22)))) || ((_local12 == 32)))) || ((_local12 == 37)))) || ((_local12 == 42)))) || ((_local12 == 47)))) || ((_local12 == 52)))) || ((_local12 == 57)))) || ((_local12 == 62)))) || ((_local12 == 67)))) || ((_local12 == 72)))) || ((_local12 == 82)))) || ((_local12 == 87)))){
iCash = (iCash - iBuildCost);
houseBufferX = _local13[0];
houseBufferY = _local13[1];
houseBufferID = iBuildingType;
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
iTotBuildingsBuilt++;
updateUi();
} else {
if ((((_local12 == 27)) || ((_local12 == 77)))){
showNote(true, "This piece of ground is too polluted to build anything here again.");
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
} else {
if ((((_local12 == 1)) || ((_local12 == 3)))){
showNote(true, "You cannot build on connecting roads or forests.");
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
} else {
showNote(true, "You cannot build here. Another building is already occupying this area.");
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
};
};
};
};
} else {
if (iAction == 4){
_local14 = _arg1.target.name;
if (_local14.search("cell") == 0){
_local14 = _local14.substring(4);
_local13 = getCellCoords(int(_local14));
_local12 = arrBuilding[_local13[1]][_local13[0]];
if (_local12 == 90){
iCash = (iCash - iBuildCost);
placeBuilding(_local13[0], _local13[1], iBuildingType, true);
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
iTotBuildingsBuilt++;
updateUi();
} else {
showNote(true, "Invalid location. You can only upgrade a repelling tower.");
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public function showConfirmRepair(_arg1):void{
var _local2:*;
if (_arg1 == true){
_local2 = "????";
showMenu(false);
wndRepair.y = 474;
wndRepair.alpha = 1;
if ((((iRepairID == 5)) || ((iRepairID == 10)))){
_local2 = "the family house";
};
if (iRepairID == 15){
_local2 = "the kwik-E-mart";
};
if (iRepairID == 20){
_local2 = "the church";
};
if (iRepairID == 25){
_local2 = "the power plant";
};
if (iRepairID == 30){
_local2 = "the farm";
};
if (iRepairID == 35){
_local2 = "moe's pub";
};
if (iRepairID == 40){
_local2 = "the krusty burger restaurant";
};
if (iRepairID == 45){
_local2 = "the lard lad donuts shed";
};
if (iRepairID == 50){
_local2 = "the school";
};
if (iRepairID == 55){
_local2 = "the police station";
};
if (iRepairID == 60){
_local2 = "the town hall";
};
if (iRepairID == 65){
_local2 = "the hospital";
};
if (iRepairID == 70){
_local2 = "the gym";
};
if (iRepairID == 80){
_local2 = "the construction site";
};
if (iRepairID == 85){
_local2 = "the laboratory";
};
if (iRepairCostBuffer > iCash){
wndRepair.txt.text = (("You don't have enough resources. Needed: k$ " + iRepairCostBuffer) + ".");
} else {
wndRepair.txt.text = (((("Repair " + _local2) + " for k$ ") + iRepairCostBuffer) + " ?");
};
} else {
wndRepair.alpha = 0;
wndRepair.y = 650;
};
}
public function getCellCoords(_arg1:int):Array{
var _local2:* = 0;
var _local3:* = 0;
_arg1--;
if (_arg1 < 10){
_local2 = _arg1;
} else {
while (_arg1 > 9) {
_arg1 = (_arg1 - 10);
_local3++;
};
_local2 = _arg1;
};
return ([_local2, _local3]);
}
public function showMenu(_arg1):void{
if (_arg1 == true){
if (bMenuMinimized == true){
wndMenu.x = 477;
} else {
wndMenu.x = 354;
};
wndMenu.alpha = 1;
btnMenu.gotoAndStop(2);
enableBtnPray2(false);
enableBtnRocket2(false);
enableBtnRay2(false);
} else {
wndMenu.alpha = 0;
wndMenu.x = 590;
btnMenu.gotoAndStop(1);
if (wndMenu.btnPray.currentFrame == 1){
enableBtnPray2(true);
};
if (wndMenu.btnRocket.currentFrame == 1){
enableBtnRocket2(true);
};
if (wndMenu.btnRay.currentFrame == 1){
enableBtnRay2(true);
};
};
}
public function borderCorrection(_arg1, _arg2, _arg3){
var _local4:* = 0;
var _local5:* = 0;
if (_arg3 == false){
_local4 = (screen.x - _arg1);
_local5 = (screen.y - _arg2);
} else {
_local4 = _arg1;
_local5 = _arg2;
};
var _local6:* = -401;
var _local7:* = -86;
if (screen.scaleX > 3.8){
_local6 = -18688;
_local7 = -10384;
} else {
if (screen.scaleX > 1.8){
_local6 = -8942;
_local7 = -4885;
} else {
if (screen.scaleX > 0.8){
_local6 = -4076;
_local7 = -2145;
} else {
if (screen.scaleX > 0.4){
_local6 = -1637;
_local7 = -770;
};
};
};
};
if (_local4 < _local6){
_local4 = _local6;
};
if (_local5 < _local7){
_local5 = _local7;
};
if (_local4 > 0){
_local4 = 0;
};
if (_local5 > 0){
_local5 = 0;
};
if (_local4 < (-4870 * screen.scaleX)){
_local4 = (-4870 * screen.scaleX);
};
if (_local5 < (-2742 * screen.scaleY)){
_local5 = (-2742 * screen.scaleY);
};
moveMapTo(_local4, _local5);
}
public function moveMapTo(_arg1, _arg2):void{
tweenX.stop();
tweenY.stop();
tweenX = new Tween(screen, "x", None.easeNone, screen.x, _arg1, 0.25, true);
tweenX.FPS = 40;
tweenY = new Tween(screen, "y", None.easeNone, screen.y, _arg2, 0.25, true);
tweenY.FPS = 40;
}
public function placeBuilding(_arg1, _arg2, _arg3, _arg4):void{
arrSprite[_arg2][_arg1].gotoAndStop(_arg3);
arrBuilding[_arg2][_arg1] = _arg3;
if (_arg3 == 85){
barResearch.y = 3;
barResearch.alpha = 1;
};
}
public function getBuildingId(_arg1, _arg2):int{
return (arrBuilding[_arg2][_arg1]);
}
public function myTimer():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (iCrushingProgressTimer > 0){
iCrushingProgressTimer--;
if (iCrushingProgressTimer == 8){
if (arrBuilding[lisaY][lisaX] < 5){
iCrushingProgressTimer = 2;
screen.simpson.gotoAndStop(1);
_local6 = arrBuilding[lisaY][lisaX];
if ((((((((((lisaY == 0)) || ((lisaY == 2)))) || ((lisaY == 4)))) || ((lisaY == 6)))) || ((lisaY == 8)))){
screen.simpson.x = (650 + (lisaX * 400));
} else {
screen.simpson.x = (850 + (lisaX * 400));
};
screen.simpson.y = (756 + (lisaY * 210));
} else {
LisaStompsPeople();
};
} else {
if (iCrushingProgressTimer == 3){
if (bRunBack == true){
screen.simpson.y = (756 + (lisaY * 210));
};
screen.simpson.gotoAndStop(1);
updateUi();
} else {
if (iCrushingProgressTimer == 0){
if (iChurch == 0){
wndMenu.btnPray.gotoAndStop(3);
enableBtnPray2(false);
} else {
wndMenu.btnPray.gotoAndStop(2);
enableBtnPray2(false);
};
if (iPolice == 0){
wndMenu.btnRocket.gotoAndStop(3);
enableBtnRocket2(false);
} else {
wndMenu.btnRocket.gotoAndStop(2);
enableBtnRocket2(false);
};
if (iRay == 0){
wndMenu.btnRay.gotoAndStop(3);
enableBtnRay2(false);
} else {
wndMenu.btnRay.gotoAndStop(2);
enableBtnRay2(false);
};
if (bRay == true){
trace("activate ray!");
} else {
if (bRocket == true){
iFleeReason = 2;
flee();
} else {
if (bPrayers == true){
iFleeReason = 1;
flee();
} else {
if (((((iBoredom + iBuildingsDestroyed) >= (iAnger + iPopAngerMod))) || ((iBoredom > 5)))){
iFleeReason = 0;
flee();
} else {
giveLisaNewDestination();
};
};
};
};
};
};
};
};
_local1 = 0;
while (_local1 < 10) {
_local2 = 0;
while (_local2 < 10) {
if ((((((((((((arrSprite[_local1][_local2].currentFrame == 10)) || ((arrSprite[_local1][_local2].currentFrame == 11)))) || ((arrSprite[_local1][_local2].currentFrame == 12)))) || ((arrSprite[_local1][_local2].currentFrame == 5)))) || ((arrSprite[_local1][_local2].currentFrame == 6)))) || ((arrSprite[_local1][_local2].currentFrame == 7)))){
if (_local1 > 0){
_local3 = 400;
} else {
_local3 = 0;
};
if ((((((lisaX == _local1)) && ((lisaY == _local2)))) && (!((_local3 == 0))))){
_local4 = -200;
_local5 = 25;
} else {
_local5 = 0;
_local4 = _local3;
};
if (arrSprite[_local1][_local2].sim1.currentFrame != (3 + iNoBloodMod)){
arrSprite[_local1][_local2].sim1.x = (arrSprite[_local1][_local2].sim1.x + (((Math.floor((Math.random() * 8)) + 4) + _local5) * arrSprite[_local1][_local2].sim1.scaleX));
if ((((arrSprite[_local1][_local2].sim1.x > 370)) || ((arrSprite[_local1][_local2].sim1.x < (-100 - _local4))))){
arrSprite[_local1][_local2].sim1.scaleX = -(arrSprite[_local1][_local2].sim1.scaleX);
correctPos(arrSprite[_local1][_local2].sim1, (-100 - _local4), 370);
};
if ((((((arrSprite[_local1][_local2].sim1.x < 300)) && ((arrSprite[_local1][_local2].sim1.x > (-30 - _local4))))) && ((Math.floor((Math.random() * 100)) == 0)))){
arrSprite[_local1][_local2].sim1.scaleX = -(arrSprite[_local1][_local2].sim1.scaleX);
};
arrSprite[_local1][_local2].sim1.gotoAndStop((3 - arrSprite[_local1][_local2].sim1.currentFrame));
};
if (arrSprite[_local1][_local2].sim2.currentFrame != (3 + iNoBloodMod)){
arrSprite[_local1][_local2].sim2.x = (arrSprite[_local1][_local2].sim2.x + (((Math.floor((Math.random() * 8)) + 4) + _local5) * arrSprite[_local1][_local2].sim2.scaleX));
if ((((arrSprite[_local1][_local2].sim2.x > 370)) || ((arrSprite[_local1][_local2].sim2.x < (-100 - _local4))))){
arrSprite[_local1][_local2].sim2.scaleX = -(arrSprite[_local1][_local2].sim2.scaleX);
correctPos(arrSprite[_local1][_local2].sim2, (-100 - _local4), 370);
};
if ((((((arrSprite[_local1][_local2].sim2.x < 300)) && ((arrSprite[_local1][_local2].sim2.x > (-30 - _local4))))) && ((Math.floor((Math.random() * 100)) == 0)))){
arrSprite[_local1][_local2].sim2.scaleX = -(arrSprite[_local1][_local2].sim2.scaleX);
};
arrSprite[_local1][_local2].sim2.gotoAndStop((3 - arrSprite[_local1][_local2].sim2.currentFrame));
};
if (arrSprite[_local1][_local2].sim3.currentFrame != (3 + iNoBloodMod)){
arrSprite[_local1][_local2].sim3.x = (arrSprite[_local1][_local2].sim3.x + (((Math.floor((Math.random() * 8)) + 4) + _local5) * arrSprite[_local1][_local2].sim3.scaleX));
if ((((arrSprite[_local1][_local2].sim3.x > 370)) || ((arrSprite[_local1][_local2].sim3.x < (-100 - _local4))))){
arrSprite[_local1][_local2].sim3.scaleX = -(arrSprite[_local1][_local2].sim3.scaleX);
correctPos(arrSprite[_local1][_local2].sim3, (-100 - _local4), 370);
};
if ((((((arrSprite[_local1][_local2].sim3.x < 300)) && ((arrSprite[_local1][_local2].sim3.x > (-30 - _local4))))) && ((Math.floor((Math.random() * 100)) == 0)))){
arrSprite[_local1][_local2].sim3.scaleX = -(arrSprite[_local1][_local2].sim3.scaleX);
};
arrSprite[_local1][_local2].sim3.gotoAndStop((3 - arrSprite[_local1][_local2].sim3.currentFrame));
};
if (arrSprite[_local1][_local2].sim4.currentFrame != (3 + iNoBloodMod)){
arrSprite[_local1][_local2].sim4.x = (arrSprite[_local1][_local2].sim4.x + (((Math.floor((Math.random() * 8)) + 4) + _local5) * arrSprite[_local1][_local2].sim4.scaleX));
if ((((arrSprite[_local1][_local2].sim4.x > 370)) || ((arrSprite[_local1][_local2].sim4.x < (-100 - _local4))))){
arrSprite[_local1][_local2].sim4.scaleX = -(arrSprite[_local1][_local2].sim4.scaleX);
correctPos(arrSprite[_local1][_local2].sim4, (-100 - _local4), 370);
};
if ((((((arrSprite[_local1][_local2].sim4.x < 300)) && ((arrSprite[_local1][_local2].sim4.x > (-30 - _local4))))) && ((Math.floor((Math.random() * 100)) == 0)))){
arrSprite[_local1][_local2].sim4.scaleX = -(arrSprite[_local1][_local2].sim4.scaleX);
};
arrSprite[_local1][_local2].sim4.gotoAndStop((3 - arrSprite[_local1][_local2].sim4.currentFrame));
};
} else {
if ((((arrSprite[_local1][_local2].currentFrame == 20)) || ((arrSprite[_local1][_local2].currentFrame == 21)))){
if (arrSprite[_local1][_local2].churchText != null){
arrSprite[_local1][_local2].churchText.text = strChurchText;
};
};
};
_local2++;
};
_local1++;
};
if (houseBufferID > 0){
placeBuilding(houseBufferX, houseBufferY, houseBufferID, true);
houseBufferID = 0;
houseBufferX = 0;
houseBufferY = 0;
updateUi();
};
}
public function correctPos(_arg1, _arg2, _arg3):void{
if (_arg1.x > 300){
_arg1.x = _arg3;
} else {
_arg1.x = _arg2;
};
}
public function updateUi():void{
iPopulation = 0;
iFat = 0;
iThin = 0;
iKwikmart = 0;
iChurch = 0;
iPowerplant = 0;
iFarm = 0;
iMoes = 0;
iKrusty = 0;
iLardlad = 0;
iSchool = 0;
iPolice = 0;
iTownhall = 0;
iHospital = 0;
iGym = 0;
iRay = 0;
iGarbage = 0;
iConstruction = 0;
iLaboratory = 0;
iRepellingtower = 0;
iHouse1 = 0;
iHouse2 = 0;
j = 0;
while (j < 10) {
i = 0;
while (i < 10) {
if ((((arrBuilding[j][i] == 65)) || ((arrBuilding[j][i] == 66)))){
iHospital++;
};
i++;
};
j++;
};
arrStreet[10] = 0;
j = 0;
while (j < 10) {
arrStreet[j] = 0;
i = 0;
while (i < 10) {
if (arrBuilding[j][i] == 5){
iPopulation = (iPopulation + 5);
iFat = (iFat + 5);
iHouse1++;
};
if (arrBuilding[j][i] == 10){
iPopulation = (iPopulation + 5);
iThin = (iThin + 5);
iHouse2++;
};
if (iHospital > 0){
if (arrBuilding[j][i] == 6){
iPopulation = (iPopulation + 5);
iFat = (iFat + 5);
iHouse1++;
};
if (arrBuilding[j][i] == 11){
iPopulation = (iPopulation + 5);
iThin = (iThin + 5);
iHouse2++;
};
} else {
if (arrBuilding[j][i] == 6){
iPopulation = (iPopulation + 3);
iFat = (iFat + 3);
iHouse1++;
};
if (arrBuilding[j][i] == 11){
iPopulation = (iPopulation + 3);
iThin = (iThin + 3);
iHouse2++;
};
};
if ((((arrBuilding[j][i] == 15)) || ((arrBuilding[j][i] == 16)))){
iKwikmart++;
};
if ((((arrBuilding[j][i] == 20)) || ((arrBuilding[j][i] == 21)))){
iChurch++;
};
if ((((arrBuilding[j][i] == 25)) || ((arrBuilding[j][i] == 26)))){
iPowerplant++;
};
if ((((arrBuilding[j][i] == 30)) || ((arrBuilding[j][i] == 31)))){
iFarm++;
};
if ((((arrBuilding[j][i] == 35)) || ((arrBuilding[j][i] == 36)))){
iMoes++;
};
if ((((arrBuilding[j][i] == 40)) || ((arrBuilding[j][i] == 41)))){
iKrusty++;
};
if ((((arrBuilding[j][i] == 45)) || ((arrBuilding[j][i] == 46)))){
iLardlad++;
};
if ((((arrBuilding[j][i] == 50)) || ((arrBuilding[j][i] == 51)))){
iSchool++;
};
if ((((arrBuilding[j][i] == 55)) || ((arrBuilding[j][i] == 56)))){
iPolice++;
};
if ((((arrBuilding[j][i] == 60)) || ((arrBuilding[j][i] == 61)))){
iTownhall++;
};
if ((((arrBuilding[j][i] == 70)) || ((arrBuilding[j][i] == 71)))){
iGym++;
};
if ((((arrBuilding[j][i] == 75)) || ((arrBuilding[j][i] == 76)))){
iGarbage++;
};
if ((((arrBuilding[j][i] == 80)) || ((arrBuilding[j][i] == 81)))){
iConstruction++;
};
if ((((arrBuilding[j][i] == 85)) || ((arrBuilding[j][i] == 86)))){
iLaboratory++;
};
if ((((arrBuilding[j][i] == 90)) || ((arrBuilding[j][i] == 91)))){
iRepellingtower++;
};
if ((((arrBuilding[j][i] == 95)) || ((arrBuilding[j][i] == 96)))){
iRay++;
};
if ((((((((((((((((((((((((((((((((((((arrBuilding[j][i] > 4)) && (!((arrBuilding[j][i] == 7))))) && (!((arrBuilding[j][i] == 12))))) && (!((arrBuilding[j][i] == 17))))) && (!((arrBuilding[j][i] == 22))))) && (!((arrBuilding[j][i] == 27))))) && (!((arrBuilding[j][i] == 32))))) && (!((arrBuilding[j][i] == 37))))) && (!((arrBuilding[j][i] == 42))))) && (!((arrBuilding[j][i] == 47))))) && (!((arrBuilding[j][i] == 52))))) && (!((arrBuilding[j][i] == 57))))) && (!((arrBuilding[j][i] == 62))))) && (!((arrBuilding[j][i] == 67))))) && (!((arrBuilding[j][i] == 72))))) && (!((arrBuilding[j][i] == 77))))) && (!((arrBuilding[j][i] == 82))))) && (!((arrBuilding[j][i] == 87))))){
var _local1 = arrStreet;
var _local2 = j;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
_local1 = arrStreet;
_local2 = 10;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
i++;
};
j++;
};
if (iConstruction == 0){
wndMenu.btnDeforest.gotoAndStop(3);
wndMenu.btnRepair.gotoAndStop(2);
wndMenu.btnTownhall.gotoAndStop(3);
wndMenu.btnPowerplant.gotoAndStop(3);
wndMenu.btnSchool.gotoAndStop(3);
wndMenu.btnPolice.gotoAndStop(3);
wndMenu.btnHospital.gotoAndStop(3);
wndMenu.btnLaboratory.gotoAndStop(4);
} else {
if (iCash < 100){
wndMenu.btnDeforest.gotoAndStop(2);
} else {
wndMenu.btnDeforest.gotoAndStop(1);
};
wndMenu.btnRepair.gotoAndStop(1);
if ((((iMoes == 0)) || ((iLardlad == 0)))){
wndMenu.btnTownhall.gotoAndStop(3);
} else {
if (iCash < 2000){
wndMenu.btnTownhall.gotoAndStop(2);
} else {
wndMenu.btnTownhall.gotoAndStop(1);
};
};
if (iCash < 5000){
wndMenu.btnPowerplant.gotoAndStop(2);
} else {
wndMenu.btnPowerplant.gotoAndStop(1);
};
if (iCash < 2500){
wndMenu.btnSchool.gotoAndStop(2);
} else {
wndMenu.btnSchool.gotoAndStop(1);
};
if (iSchool == 0){
wndMenu.btnPolice.gotoAndStop(3);
wndMenu.btnHospital.gotoAndStop(3);
wndMenu.btnLaboratory.gotoAndStop(4);
} else {
if (iCash < 5000){
wndMenu.btnPolice.gotoAndStop(2);
} else {
wndMenu.btnPolice.gotoAndStop(1);
};
if (iCash < 5000){
wndMenu.btnHospital.gotoAndStop(2);
} else {
wndMenu.btnHospital.gotoAndStop(1);
};
if (((((((iFat + iThin) > 89)) && ((iGarbage > 1)))) && ((iPowerplant > 2)))){
if (iCash < 7500){
wndMenu.btnLaboratory.gotoAndStop(2);
} else {
wndMenu.btnLaboratory.gotoAndStop(1);
};
} else {
wndMenu.btnLaboratory.gotoAndStop(3);
};
};
};
if (((((iHouse1 + iHouse2) >= 5)) && ((iGym > 0)))){
if (iCash < 2000){
wndMenu.btnConstruction.gotoAndStop(2);
} else {
wndMenu.btnConstruction.gotoAndStop(1);
};
} else {
wndMenu.btnConstruction.gotoAndStop(3);
};
if (bInventedRepelling == true){
if (iCash < 2000){
wndMenu.btnRepelling.gotoAndStop(2);
} else {
wndMenu.btnRepelling.gotoAndStop(1);
};
} else {
wndMenu.btnRepelling.gotoAndStop(3);
};
if ((((iTownhall == 0)) && (((iHouse1 + iHouse2) >= 5)))){
wndMenu.btnHouse.gotoAndStop(4);
} else {
if ((iFat + iThin) > ((20 * (iKrusty + iKwikmart)) - 5)){
wndMenu.btnHouse.gotoAndStop(3);
} else {
if (iCash < 500){
wndMenu.btnHouse.gotoAndStop(2);
} else {
wndMenu.btnHouse.gotoAndStop(1);
};
};
};
if ((iKrusty + iKwikmart) >= (iFarm * 2)){
wndMenu.btnKrusty.gotoAndStop(3);
wndMenu.btnKwikmart.gotoAndStop(3);
} else {
if (iCash < 250){
wndMenu.btnKrusty.gotoAndStop(2);
wndMenu.btnKwikmart.gotoAndStop(2);
} else {
wndMenu.btnKrusty.gotoAndStop(1);
wndMenu.btnKwikmart.gotoAndStop(1);
};
};
if (iCash < 1000){
wndMenu.btnChurch.gotoAndStop(2);
} else {
wndMenu.btnChurch.gotoAndStop(1);
};
if (iCash < 250){
wndMenu.btnGym.gotoAndStop(2);
wndMenu.btnMoes.gotoAndStop(2);
wndMenu.btnLardlad.gotoAndStop(2);
} else {
wndMenu.btnGym.gotoAndStop(1);
wndMenu.btnMoes.gotoAndStop(1);
wndMenu.btnLardlad.gotoAndStop(1);
};
if (iCash < 150){
wndMenu.btnGarbage.gotoAndStop(2);
wndMenu.btnFarm.gotoAndStop(2);
} else {
wndMenu.btnGarbage.gotoAndStop(1);
wndMenu.btnFarm.gotoAndStop(1);
};
if (iCash < 5000){
btnUpgrade.gotoAndStop(2);
} else {
btnUpgrade.gotoAndStop(1);
};
txtPopulation.text = ((((((("Fat ppl.:\n" + iFat) + "/") + String((iKrusty * 20))) + "\nThin ppl.:\n") + iThin) + "/") + String((iKwikmart * 20)));
if ((iFat + iThin) > 199){
iPopAngerMod = 8;
} else {
if ((iFat + iThin) > 174){
iPopAngerMod = 7;
} else {
if ((iFat + iThin) > 149){
iPopAngerMod = 6;
} else {
if ((iFat + iThin) > 124){
iPopAngerMod = 5;
} else {
if ((iFat + iThin) > 99){
iPopAngerMod = 4;
} else {
if ((iFat + iThin) > 74){
iPopAngerMod = 3;
} else {
if ((iFat + iThin) > 49){
iPopAngerMod = 2;
} else {
if ((iFat + iThin) > 24){
iPopAngerMod = 1;
} else {
iPopAngerMod = 0;
};
};
};
};
};
};
};
};
if (iPowerplant > 2){
iPopAngerMod = (iPopAngerMod + (iPowerplant - 2));
};
income = iFat;
if ((iKrusty * 20) < iFat){
income = (iKrusty * 20);
};
if ((iKwikmart * 20) < iThin){
income = (income + (iKwikmart * 20));
} else {
income = (income + iThin);
};
income = (income * iIncomePerPerson);
txtResources.text = ("k$ " + iCash);
txtIncome.text = ("k$ " + income);
iPollutionLevel = ((iAnger + iPopAngerMod) - 1);
txtPollution.text = ("level " + iPollutionLevel);
if ((iFat + iThin) > iTopPopulation){
iTopPopulation = (iFat + iThin);
};
}
public function LisaJumpTo(_arg1, _arg2):void{
var _local3:*;
var _local4:*;
lisaTweenX.stop();
lisaTweenY.stop();
lisaX = _arg1;
lisaY = _arg2;
if ((((((((((_arg2 == 0)) || ((_arg2 == 2)))) || ((_arg2 == 4)))) || ((_arg2 == 6)))) || ((_arg2 == 8)))){
_local3 = (650 + (_arg1 * 400));
} else {
_local3 = (850 + (_arg1 * 400));
};
if (_local3 > screen.simpson.x){
screen.simpson.scaleX = -1;
};
_local4 = (756 + (_arg2 * 210));
var _local5:* = Math.abs((_local3 - screen.simpson.x));
var _local6:* = Math.abs((_local4 - screen.simpson.y));
var _local7:* = (Math.floor(Math.sqrt(((2 * _local5) + (2 * _local6)))) / 20);
if (_local7 < 0.2){
_local7 = 0.2;
};
lisaTweenX = new Tween(screen.simpson, "x", Regular.easeInOut, screen.simpson.x, _local3, _local7, true);
lisaTweenX.FPS = 40;
lisaTweenY = new Tween(screen.simpson, "y", Regular.easeInOut, screen.simpson.y, _local4, _local7, true);
lisaTweenY.FPS = 40;
lisaTweenY.addEventListener(TweenEvent.MOTION_FINISH, LisaReachedDestination);
screen.simpson.gotoAndPlay(25);
}
public function flee():void{
var _local4:*;
var _local5:*;
lisaTweenX.stop();
lisaTweenY.stop();
var _local1:* = 0;
var _local2:* = 10;
var _local3:* = lisaY;
if (bPrayers == true){
bRunBack = true;
if (lisaX < 8){
lisaX = (lisaX + (2 + Math.floor((Math.random() * 2))));
if (lisaX > 10){
lisaX = 10;
};
_local2 = lisaX;
_local1 = -200;
} else {
lisaX = 10;
};
} else {
lisaX = 10;
};
if ((((((((((((_local3 == 0)) || ((_local3 == 2)))) || ((_local3 == 4)))) || ((_local3 == 6)))) || ((_local3 == 8)))) || ((_local3 == 10)))){
if (lisaX == 10){
_local4 = 4900;
} else {
_local4 = ((650 + (_local2 * 400)) + _local1);
};
} else {
if (lisaX == 10){
_local4 = 4900;
} else {
_local4 = ((850 + (_local2 * 400)) + _local1);
};
};
_local5 = (756 + (_local3 * 210));
var _local6:* = Math.abs((_local4 - screen.simpson.x));
var _local7:* = Math.abs((_local5 - screen.simpson.y));
var _local8:* = (Math.floor(Math.sqrt(((2 * _local6) + (2 * _local7)))) / 20);
if (_local8 < 0.2){
_local8 = 0.2;
};
lisaTweenX = new Tween(screen.simpson, "x", Regular.easeInOut, screen.simpson.x, _local4, _local8, true);
lisaTweenX.FPS = 40;
lisaTweenY = new Tween(screen.simpson, "y", Regular.easeInOut, screen.simpson.y, _local5, _local8, true);
lisaTweenY.FPS = 40;
if ((((bPrayers == true)) && (!((lisaX == 10))))){
lisaTweenX.addEventListener(TweenEvent.MOTION_FINISH, LisaFearedToDestination);
} else {
lisaTweenX.addEventListener(TweenEvent.MOTION_FINISH, LisaBackAtBeach);
};
if (iFleeReason == 0){
screen.simpson.scaleX = -1;
screen.simpson.gotoAndPlay(25);
} else {
if (iFleeReason == 1){
screen.simpson.scaleX = 1;
screen.simpson.gotoAndPlay(40);
playEffect("rocket");
} else {
if (iFleeReason == 2){
screen.simpson.scaleX = 1;
screen.simpson.gotoAndPlay(55);
playEffect("rocket");
};
};
};
}
public function LisaBackAtBeach(_arg1:TweenEvent):void{
bRunBack = false;
iPhase = 3;
btnNextDay.x = 2.5;
btnNextDay.alpha = 1;
screen.simpson.scaleX = 1;
screen.simpson.gotoAndStop(1);
iPhase = 2;
wndMenu.blocked.alpha = 0;
showNote(false, "The town is safe again... for now...");
}
public function LisaFearedToDestination(_arg1:TweenEvent):void{
bRunBack = true;
LisaCrushBuilding();
}
public function LisaReachedDestination(_arg1:TweenEvent):void{
var _local2:*;
screen.simpson.scaleX = 1;
bRunBack = false;
if (detectArea(90, 1) == false){
LisaCrushBuilding();
} else {
iBoredom++;
iCrushingProgressTimer = 1;
};
if (iChurch == 0){
wndMenu.btnPray.gotoAndStop(3);
} else {
if (detectArea(20, 1) == false){
wndMenu.btnPray.gotoAndStop(2);
enableBtnPray2(false);
} else {
wndMenu.btnPray.gotoAndStop(1);
enableBtnPray2(true);
};
};
if (iPolice == 0){
wndMenu.btnRocket.gotoAndStop(3);
} else {
_local2 = 1;
if (bInventedRocket == true){
_local2 = 2;
};
if (detectArea(55, _local2) == false){
wndMenu.btnRocket.gotoAndStop(2);
enableBtnRocket2(false);
} else {
wndMenu.btnRocket.gotoAndStop(1);
enableBtnRocket2(true);
};
};
if (iRay == 0){
wndMenu.btnRay.gotoAndStop(3);
} else {
if (detectArea(95, 2) == false){
wndMenu.btnRay.gotoAndStop(2);
enableBtnRay2(false);
} else {
wndMenu.btnRay.gotoAndStop(1);
enableBtnRay2(true);
};
};
}
public function LisaCrushBuilding():void{
iCrushingProgressTimer = 18;
lisaTweenX.stop();
lisaTweenY.stop();
var _local1:* = lisaX;
var _local2:* = 0;
var _local3:* = lisaY;
if ((((((((((_local3 == 0)) || ((_local3 == 2)))) || ((_local3 == 4)))) || ((_local3 == 6)))) || ((_local3 == 8)))){
_local2 = ((650 + (_local1 * 400)) - 200);
} else {
_local2 = ((850 + (_local1 * 400)) - 200);
};
screen.simpson.y = (756 + (_local3 * 210));
screen.simpson.y = (screen.simpson.y - 30);
if (bRunBack == false){
screen.simpson.gotoAndStop(15);
lisaTweenX = new Tween(screen.simpson, "x", Regular.easeInOut, screen.simpson.x, _local2, 0.75, true);
lisaTweenX.FPS = 40;
} else {
screen.simpson.gotoAndStop(49);
};
lisaTweenY = new Tween(screen.simpson, "y", Strong.easeIn, screen.simpson.y, (screen.simpson.y + 195), 1, true);
lisaTweenY.FPS = 40;
lisaTweenY.addEventListener(TweenEvent.MOTION_FINISH, LisaDoCrushTween);
if (arrBuilding[lisaY][lisaX] > 4){
playEffect("boom");
btnGoToIncident.gotoAndPlay(1);
};
}
public function LisaDoCrushTween(_arg1:TweenEvent):void{
var _local2:* = arrBuilding[lisaY][lisaX];
if (bRunBack == false){
screen.simpson.gotoAndPlay(16);
} else {
iCrushingProgressTimer = 5;
};
if ((((((((((((((((((((((((((((((((((_local2 == 5)) || ((_local2 == 10)))) || ((_local2 == 15)))) || ((_local2 == 20)))) || ((_local2 == 25)))) || ((_local2 == 30)))) || ((_local2 == 35)))) || ((_local2 == 40)))) || ((_local2 == 45)))) || ((_local2 == 50)))) || ((_local2 == 55)))) || ((_local2 == 60)))) || ((_local2 == 65)))) || ((_local2 == 70)))) || ((_local2 == 75)))) || ((_local2 == 80)))) || ((_local2 == 85)))){
placeBuilding(lisaX, lisaY, (_local2 + 1), false);
iBuildingsDestroyed++;
if (iHospital > 0){
iTotalCuredInHospital = (iTotalCuredInHospital + 2);
};
} else {
if ((((((((((((((((((((((((((((((((((_local2 == 6)) || ((_local2 == 11)))) || ((_local2 == 16)))) || ((_local2 == 21)))) || ((_local2 == 26)))) || ((_local2 == 31)))) || ((_local2 == 36)))) || ((_local2 == 41)))) || ((_local2 == 46)))) || ((_local2 == 51)))) || ((_local2 == 56)))) || ((_local2 == 61)))) || ((_local2 == 66)))) || ((_local2 == 71)))) || ((_local2 == 76)))) || ((_local2 == 81)))) || ((_local2 == 86)))){
screen.simpson.y = (screen.simpson.y + 25);
iTotalDeaths = (iTotalDeaths + 5);
placeBuilding(lisaX, lisaY, (_local2 + 1), false);
iBuildingsDestroyed++;
iTotBuildingsDestroyed++;
if (_local2 == 26){
iAnger = (iAnger + 4);
updateUi();
showNote(true, "WARNING! WARNING! Power plant destroyed! Pollution increased!");
} else {
if (_local2 == 76){
iAnger = (iAnger + 4);
updateUi();
showNote(true, "WARNING! WARNING! Toxic waste dump destroyed! Pollution increased!");
};
};
} else {
screen.simpson.y = (screen.simpson.y + 25);
iBoredom++;
};
};
}
public function LisaStompsPeople():void{
var _local2:*;
playEffect("random");
var _local1:* = arrBuilding[lisaY][lisaX];
if ((((((((((lisaY == 0)) || ((lisaY == 2)))) || ((lisaY == 4)))) || ((lisaY == 6)))) || ((lisaY == 8)))){
screen.simpson.x = (650 + (lisaX * 400));
} else {
screen.simpson.x = (850 + (lisaX * 400));
};
screen.simpson.y = (756 + (lisaY * 210));
if (bRunBack == false){
screen.simpson.gotoAndPlay(5);
};
if ((((((_local1 == 6)) || ((_local1 == 11)))) && ((iHospital == 0)))){
_local2 = Math.floor((Math.random() * 6));
if (_local2 == 0){
arrSprite[lisaY][lisaX].sim1.gotoAndStop((3 + iNoBloodMod));
arrSprite[lisaY][lisaX].sim2.gotoAndStop((3 + iNoBloodMod));
} else {
if (_local2 == 1){
arrSprite[lisaY][lisaX].sim1.gotoAndStop((3 + iNoBloodMod));
arrSprite[lisaY][lisaX].sim3.gotoAndStop((3 + iNoBloodMod));
} else {
if (_local2 == 2){
arrSprite[lisaY][lisaX].sim1.gotoAndStop((3 + iNoBloodMod));
arrSprite[lisaY][lisaX].sim4.gotoAndStop((3 + iNoBloodMod));
} else {
if (_local2 == 3){
arrSprite[lisaY][lisaX].sim2.gotoAndStop((3 + iNoBloodMod));
arrSprite[lisaY][lisaX].sim3.gotoAndStop((3 + iNoBloodMod));
} else {
if (_local2 == 4){
arrSprite[lisaY][lisaX].sim2.gotoAndStop((3 + iNoBloodMod));
arrSprite[lisaY][lisaX].sim4.gotoAndStop((3 + iNoBloodMod));
} else {
arrSprite[lisaY][lisaX].sim3.gotoAndStop((3 + iNoBloodMod));
arrSprite[lisaY][lisaX].sim4.gotoAndStop((3 + iNoBloodMod));
};
};
};
};
};
} else {
if ((((_local1 == 7)) || ((_local1 == 12)))){
arrSprite[lisaY][lisaX].sim1.gotoAndStop((3 + iNoBloodMod));
arrSprite[lisaY][lisaX].sim2.gotoAndStop((3 + iNoBloodMod));
arrSprite[lisaY][lisaX].sim3.gotoAndStop((3 + iNoBloodMod));
arrSprite[lisaY][lisaX].sim4.gotoAndStop((3 + iNoBloodMod));
};
};
if (bRunBack == true){
iCrushingProgressTimer = 4;
};
}
public function giveLisaNewDestination():void{
var _local1:* = 0;
var _local2:* = lisaX;
var _local3:* = lisaY;
iPhase = 1;
wndMenu.blocked.alpha = 1;
_local1 = Math.floor((Math.random() * 2));
if ((((lisaX == 10)) || ((Math.floor((Math.random() * 2)) == 0)))){
pickDestination();
_local2 = newLocX;
_local3 = newLocY;
} else {
if (_local1 == 0){
if (lisaY == 9){
_local3 = 8;
} else {
if (lisaY == 0){
_local3 = 1;
} else {
if (Math.floor((Math.random() * 2)) == 0){
_local3 = (lisaY + 1);
} else {
_local3 = (lisaY - 1);
};
};
};
} else {
if (lisaX == 9){
_local2 = 8;
} else {
if (lisaX == 0){
_local2 = 1;
} else {
if (Math.floor((Math.random() * 2)) == 0){
_local2 = (lisaX + 1);
} else {
_local2 = (lisaX - 1);
};
};
};
};
};
LisaJumpTo(_local2, _local3);
}
public function playEffect(_arg1):void{
var _local2:SoundTransform;
var _local3:*;
if (bSounds == true){
_local2 = new SoundTransform();
SoundMixer.stopAll();
if (_arg1 == "boom"){
_local2.volume = 0.6;
myChannel = sndDestroy.play();
myChannel.soundTransform = _local2;
} else {
if (_arg1 == "random"){
_local3 = Math.floor((Math.random() * 5));
if (_local3 == 0){
_local2.volume = 0.5;
myChannel = sndCool.play();
myChannel.soundTransform = _local2;
} else {
if (_local3 == 1){
_local2.volume = 0.7;
myChannel = sndDoh.play();
myChannel.soundTransform = _local2;
} else {
if (_local3 == 2){
_local2.volume = 0.3;
myChannel = sndLaugh.play();
myChannel.soundTransform = _local2;
} else {
if (_local3 == 3){
_local2.volume = 0.4;
myChannel = sndPity.play();
myChannel.soundTransform = _local2;
} else {
_local2.volume = 0.4;
myChannel = sndLizard.play(500);
myChannel.soundTransform = _local2;
};
};
};
};
} else {
if (_arg1 == "rocket"){
_local2.volume = 0.7;
myChannel = sndNooo.play();
myChannel.soundTransform = _local2;
};
};
};
};
}
public function pickDestination():void{
var _local1:* = 0;
var _local2:* = false;
var _local3:* = -1;
var _local4:* = -1;
var _local5:* = 0;
if (arrStreet[10] > 0){
while (_local4 < 0) {
_local1 = Math.floor((Math.random() * 10));
if (arrStreet[_local1] > 0){
_local4 = _local1;
};
++_local5;
if (_local5 > 20){
_local3 = Math.floor((Math.random() * 10));
_local4 = Math.floor((Math.random() * 10));
_local2 = true;
};
};
if (_local2 == false){
_local5 = 0;
while (_local3 < 0) {
i = Math.floor((Math.random() * 10));
j = _local4;
if ((((((((((((((((((((((((((((((((((((arrBuilding[j][i] > 4)) && (!((arrBuilding[j][i] == 7))))) && (!((arrBuilding[j][i] == 12))))) && (!((arrBuilding[j][i] == 17))))) && (!((arrBuilding[j][i] == 22))))) && (!((arrBuilding[j][i] == 27))))) && (!((arrBuilding[j][i] == 32))))) && (!((arrBuilding[j][i] == 37))))) && (!((arrBuilding[j][i] == 42))))) && (!((arrBuilding[j][i] == 47))))) && (!((arrBuilding[j][i] == 52))))) && (!((arrBuilding[j][i] == 57))))) && (!((arrBuilding[j][i] == 62))))) && (!((arrBuilding[j][i] == 67))))) && (!((arrBuilding[j][i] == 72))))) && (!((arrBuilding[j][i] == 77))))) && (!((arrBuilding[j][i] == 82))))) && (!((arrBuilding[j][i] == 87))))){
_local3 = i;
};
++_local5;
if (_local5 > 20){
_local3 = Math.floor((Math.random() * 10));
_local4 = Math.floor((Math.random() * 10));
};
};
};
} else {
_local3 = Math.floor((Math.random() * 10));
_local4 = Math.floor((Math.random() * 10));
};
newLocX = _local3;
newLocY = _local4;
}
public function reviveDeadCitizens():void{
i = 0;
while (i < 10) {
j = 0;
while (j < 10) {
if ((((arrBuilding[j][i] == 5)) || ((arrBuilding[j][i] == 10)))){
arrSprite[j][i].sim1.gotoAndStop(1);
arrSprite[j][i].sim2.gotoAndStop(1);
arrSprite[j][i].sim3.gotoAndStop(1);
arrSprite[j][i].sim4.gotoAndStop(1);
};
j++;
};
i++;
};
}
public function detectArea(_arg1, _arg2):Boolean{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local3:* = false;
if (lisaX < 10){
_local4 = ((lisaX - _arg2) - 1);
_local5 = ((lisaX + _arg2) + 1);
_local6 = ((lisaY - _arg2) - 1);
_local7 = ((lisaY + _arg2) + 1);
if (_local4 < 0){
_local4 = 0;
};
if (_local5 > 9){
_local5 = 9;
};
if (_local6 < 0){
_local6 = 0;
};
if (_local7 > 9){
_local7 = 9;
};
i = _local4;
while (i < (_local5 + 1)) {
j = _local6;
while (j < (_local7 + 1)) {
if (arrBuilding[j][i] == _arg1){
_local3 = true;
};
if (arrBuilding[j][i] == (_arg1 + 1)){
_local3 = true;
};
j++;
};
i++;
};
};
return (_local3);
}
public function doWin():void{
showMenu(false);
clearInterval(myInterval);
stage.removeEventListener(MouseEvent.CLICK, mouseClicked);
var _local1:* = 0;
var _local2:* = 0;
screen.simpson.y = (756 + (lisaY * 210));
screen.simpson.gotoAndStop(1);
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
if (lisaY != 10){
_local1 = ((-(arrSprite[lisaY][lisaX].x) * screen.scaleX) + (400 - (200 * screen.scaleX)));
_local2 = ((-(arrSprite[lisaY][lisaX].y) * screen.scaleY) + (600 - (20 * screen.scaleY)));
borderCorrection(_local1, _local2, true);
};
whiteCover.alpha = 0;
whiteCover.x = 0;
whiteCover.y = 0;
tweenWhite = new Tween(whiteCover, "alpha", Strong.easeIn, 0, 1, 3, true);
tweenWhite.FPS = 40;
lisaTweenX.stop();
lisaTweenY.stop();
lisaTweenX = new Tween(screen.simpson, "scaleX", Strong.easeIn, 1, 0.1, 3, true);
lisaTweenX.FPS = 40;
lisaTweenY = new Tween(screen.simpson, "scaleY", Strong.easeIn, 1, 0.1, 3, true);
lisaTweenY.FPS = 40;
lisaTweenY.addEventListener(TweenEvent.MOTION_FINISH, goToEnd);
iTownValue = 0;
i = 0;
while (i < 10) {
j = 0;
while (j < 10) {
if (arrBuilding[j][i] == 1){
iTownValue = (iTownValue + 100);
};
if ((((arrBuilding[j][i] == 5)) || ((arrBuilding[j][i] == 6)))){
iTownValue = (iTownValue + 500);
};
if ((((arrBuilding[j][i] == 10)) || ((arrBuilding[j][i] == 11)))){
iTownValue = (iTownValue + 500);
};
if ((((arrBuilding[j][i] == 15)) || ((arrBuilding[j][i] == 16)))){
iTownValue = (iTownValue + 250);
};
if ((((arrBuilding[j][i] == 20)) || ((arrBuilding[j][i] == 21)))){
iTownValue = (iTownValue + 1000);
};
if ((((arrBuilding[j][i] == 25)) || ((arrBuilding[j][i] == 26)))){
iTownValue = (iTownValue + 5000);
};
if ((((arrBuilding[j][i] == 30)) || ((arrBuilding[j][i] == 31)))){
iTownValue = (iTownValue + 150);
};
if ((((arrBuilding[j][i] == 35)) || ((arrBuilding[j][i] == 36)))){
iTownValue = (iTownValue + 250);
};
if ((((arrBuilding[j][i] == 40)) || ((arrBuilding[j][i] == 41)))){
iTownValue = (iTownValue + 250);
};
if ((((arrBuilding[j][i] == 45)) || ((arrBuilding[j][i] == 46)))){
iTownValue = (iTownValue + 250);
};
if ((((arrBuilding[j][i] == 50)) || ((arrBuilding[j][i] == 51)))){
iTownValue = (iTownValue + 2500);
};
if ((((arrBuilding[j][i] == 55)) || ((arrBuilding[j][i] == 56)))){
iTownValue = (iTownValue + 5000);
};
if ((((arrBuilding[j][i] == 60)) || ((arrBuilding[j][i] == 61)))){
iTownValue = (iTownValue + 2000);
};
if ((((arrBuilding[j][i] == 65)) || ((arrBuilding[j][i] == 66)))){
iTownValue = (iTownValue + 5000);
};
if ((((arrBuilding[j][i] == 70)) || ((arrBuilding[j][i] == 71)))){
iTownValue = (iTownValue + 250);
};
if ((((arrBuilding[j][i] == 75)) || ((arrBuilding[j][i] == 76)))){
iTownValue = (iTownValue + 150);
};
if ((((arrBuilding[j][i] == 80)) || ((arrBuilding[j][i] == 81)))){
iTownValue = (iTownValue + 250);
};
if ((((arrBuilding[j][i] == 85)) || ((arrBuilding[j][i] == 86)))){
iTownValue = (iTownValue + 7500);
};
if ((((arrBuilding[j][i] == 90)) || ((arrBuilding[j][i] == 91)))){
iTownValue = (iTownValue + 2000);
};
if ((((arrBuilding[j][i] == 95)) || ((arrBuilding[j][i] == 96)))){
iTownValue = (iTownValue + 7000);
};
if ((((arrBuilding[j][i] == 27)) || ((arrBuilding[j][i] == 77)))){
iTownValue = (iTownValue - 10000);
};
j++;
};
i++;
};
}
public function goToEnd(_arg1:TweenEvent):void{
gotoAndStop(5);
}
public function randomizeChurchTextOfTheDay():void{
var _local1:* = Math.floor((Math.random() * 20));
if (_local1 == 0){
strChurchText = "PRAY ALL FOR SPRINGFIELD!";
} else {
if (_local1 == 1){
strChurchText = "WINTER IS COMING!";
} else {
if (_local1 == 2){
strChurchText = "DON'T FORGET TO TURN OFF THY CAR RADIO!";
} else {
if (_local1 == 3){
strChurchText = "SPECIAL GUEST TODAY: HELLO KITTY!";
} else {
if (_local1 == 4){
strChurchText = "A NUCLEAR DISASTER DAWNING!";
} else {
if (_local1 == 5){
strChurchText = "PRAY AND GET SAVED FROM THE POWER PLANT!";
} else {
if (_local1 == 6){
strChurchText = "SAY 'NO' TO NUCLEAR POWER! SAVE US!";
} else {
if (_local1 == 7){
strChurchText = "NUCLEAR WINTER IS COMING!";
} else {
if (_local1 == 8){
strChurchText = "PRAY ALL FOR LISA AND OUR TOWN!";
} else {
if (_local1 == 9){
strChurchText = "SPRINGFIELD IS DOOMED! PRAY WITH US!";
} else {
if (_local1 == 10){
strChurchText = "WE CAN SAVE OUR SELVES!";
} else {
if (_local1 == 11){
strChurchText = "SPECIAL MASS THIS WEDNESDAY!";
} else {
if (_local1 == 12){
strChurchText = "SOS\n911\nSOS";
} else {
if (_local1 == 13){
strChurchText = "SAVE THE FOREST, SAVE SPRINGFIELD!";
} else {
if (_local1 == 14){
strChurchText = "RUN, SPRINGFIELD, RUN!";
} else {
if (_local1 == 15){
strChurchText = "\nTHE END IS NEAR!";
} else {
if (_local1 == 16){
strChurchText = "DON'T WORRY, PRAY HAPPY!";
} else {
if (_local1 == 17){
strChurchText = "BEGONE, DEMON! BEGONE!";
} else {
if (_local1 == 18){
strChurchText = "\nHEAVEN IS COMIN!";
} else {
strChurchText = "EVERYTHIN'S GONNA BE ALRIGH!";
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public function enableBtnPray2(_arg1):void{
if ((((((((_arg1 == false)) || ((bPrayers == true)))) || ((bRocket == true)))) || ((bRay == true)))){
btnPray2.alpha = 0;
btnPray2.x = 1000;
btnPray2.gotoAndStop(2);
} else {
if (btnMenu.currentFrame == 1){
btnPray2.alpha = 0.8;
btnPray2.x = 701;
btnPray2.gotoAndStop(1);
} else {
btnPray2.alpha = 0;
btnPray2.x = 1000;
btnPray2.gotoAndStop(2);
};
};
}
public function enableBtnRocket2(_arg1):void{
if ((((((_arg1 == false)) || ((bRocket == true)))) || ((bRay == true)))){
btnRocket2.alpha = 0;
btnRocket2.x = 1000;
btnRocket2.gotoAndStop(2);
} else {
if (btnMenu.currentFrame == 1){
btnRocket2.alpha = 0.8;
btnRocket2.x = 701;
btnRocket2.gotoAndStop(1);
} else {
btnRocket2.alpha = 0;
btnRocket2.x = 1000;
btnRocket2.gotoAndStop(2);
};
};
}
public function enableBtnRay2(_arg1):void{
if ((((_arg1 == false)) || ((bRay == true)))){
btnRay2.alpha = 0;
btnRay2.x = 1000;
btnRay2.gotoAndStop(2);
} else {
if (btnMenu.currentFrame == 1){
btnRay2.alpha = 0.8;
btnRay2.x = 701;
btnRay2.gotoAndStop(1);
} else {
btnRay2.alpha = 0;
btnRay2.x = 1000;
btnRay2.gotoAndStop(2);
};
};
}
function frame1(){
stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
function frame2(){
stop();
iNoBloodMod = 0;
musTheme = new wavTheme();
transform0 = new SoundTransform();
transform0.volume = 0.5;
myChannel = musTheme.play();
myChannel.soundTransform = transform0;
sndDestroy = new wavDestroy();
musIntro = new wavIntro();
sndCool = new wavCool();
sndDoh = new wavDoh();
sndLaugh = new wavLaugh();
sndLizard = new wavLizard();
sndPity = new wavPity();
sndNooo = new wavNooo();
tweenIntro2 = new Tween(btnIntroStart2, "alpha", Strong.easeIn, 0, 1, 4, true);
tweenIntro2.FPS = 40;
tweenIntro = new Tween(btnIntroStart1, "alpha", Strong.easeIn, 0, 1, 3, true);
tweenIntro.FPS = 40;
btnIntroStart1.addEventListener(MouseEvent.CLICK, startGameNoBlood);
btnIntroStart2.addEventListener(MouseEvent.CLICK, startGame);
btnDa.addEventListener(MouseEvent.CLICK, launchDA);
}
function frame3(){
stop();
transform0.volume = 0.5;
myChannel = musIntro.play();
myChannel.soundTransform = transform0;
btnProceed.addEventListener(MouseEvent.CLICK, goToGame);
}
function frame4(){
stop();
iIncomePerPerson = 50;
iTopPopulation = 0;
iTotBuildingsBuilt = 0;
iTotBuildingsDestroyed = 0;
iTownValue = 0;
iPollutionLevel = 0;
iDayCounter = 0;
iTotalDeaths = 0;
iTotalCuredInHospital = 0;
iTotalForestsCut = 0;
bTreesDestroyed = false;
bPrayed = false;
bRocketsUsed = false;
bMenuMinimized = false;
houseBufferID = 0;
houseBufferX = 0;
houseBufferY = 0;
iPopulation = 0;
iFat = 0;
iThin = 0;
iBuildingsDestroyed = 0;
iBoredom = 0;
iAnger = 2;
iPopAngerMod = 0;
iFleeReason = 0;
iTotLabDays = 5;
iTotLabDaysRemaining = 5;
iLabSegmentSize = 4;
iPhase = 0;
iCrushingProgressTimer = 5;
bRunBack = false;
bWin = false;
iRepairCostBuffer = 0;
iRepairX = 0;
iRepairY = 0;
iRepairID = 0;
income = 0;
iCash = 2000;
iHouse1 = 0;
iHouse2 = 0;
iKwikmart = 0;
iChurch = 0;
iPowerplant = 0;
iFarm = 0;
iMoes = 0;
iKrusty = 0;
iLardlad = 0;
iSchool = 0;
iPolice = 0;
iTownhall = 0;
iHospital = 0;
iGym = 0;
iRay = 0;
iGarbage = 0;
iConstruction = 0;
iLaboratory = 0;
iRepellingtower = 0;
iAction = 0;
iBuildCost = 0;
iBuildingType = 0;
bPrayers = false;
bRocket = false;
bRay = false;
bInventedRocket = false;
bInventedRepelling = false;
bInventedRay = false;
bSounds = true;
lisaX = 10;
lisaY = 3;
newLocX = 0;
newLocY = 0;
myInterval = setInterval(myTimer, 500);
strChurchText = "Pray all for Springfield!";
arrSprite = [[screen.cell1, screen.cell2, screen.cell3, screen.cell4, screen.cell5, screen.cell6, screen.cell7, screen.cell8, screen.cell9, screen.cell10], [screen.cell11, screen.cell12, screen.cell13, screen.cell14, screen.cell15, screen.cell16, screen.cell17, screen.cell18, screen.cell19, screen.cell20], [screen.cell21, screen.cell22, screen.cell23, screen.cell24, screen.cell25, screen.cell26, screen.cell27, screen.cell28, screen.cell29, screen.cell30], [screen.cell31, screen.cell32, screen.cell33, screen.cell34, screen.cell35, screen.cell36, screen.cell37, screen.cell38, screen.cell39, screen.cell40], [screen.cell41, screen.cell42, screen.cell43, screen.cell44, screen.cell45, screen.cell46, screen.cell47, screen.cell48, screen.cell49, screen.cell50], [screen.cell51, screen.cell52, screen.cell53, screen.cell54, screen.cell55, screen.cell56, screen.cell57, screen.cell58, screen.cell59, screen.cell60], [screen.cell61, screen.cell62, screen.cell63, screen.cell64, screen.cell65, screen.cell66, screen.cell67, screen.cell68, screen.cell69, screen.cell70], [screen.cell71, screen.cell72, screen.cell73, screen.cell74, screen.cell75, screen.cell76, screen.cell77, screen.cell78, screen.cell79, screen.cell80], [screen.cell81, screen.cell82, screen.cell83, screen.cell84, screen.cell85, screen.cell86, screen.cell87, screen.cell88, screen.cell89, screen.cell90], [screen.cell91, screen.cell92, screen.cell93, screen.cell94, screen.cell95, screen.cell96, screen.cell97, screen.cell98, screen.cell99, screen.cell100]];
arrBuilding = [[2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]];
arrStreet = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
screen.scaleX = 0.5;
screen.scaleY = 0.5;
wndMenu.alpha = 0;
showNote(false, "");
btnNextDay.alpha = 0;
barResearch.alpha = 0;
btnUpgrade.alpha = 0;
wndMenu.blocked.mouseEnabled = false;
wndMenu.blocked.alpha = 0;
screen.grid.mouseEnabled = false;
screen.grid.alpha = 0;
j = 0;
while (j < 10) {
iRnd = (Math.floor((Math.random() * 6)) + 2);
i = 0;
while (i < 10) {
if ((((j > 0)) && ((i == iRnd)))){
arrBuilding[j][i] = 3;
} else {
if (Math.floor((Math.random() * 100)) < 40){
arrBuilding[j][i] = 1;
};
};
arrSprite[j][i].gotoAndStop(arrBuilding[j][i]);
i++;
};
j++;
};
i = Math.ceil((Math.random() * 7));
placeBuilding(i, 0, 25, true);
placeBuilding((i + 1), 0, 25, true);
k = ((i + Math.floor((Math.random() * 3))) - 1);
j = Math.ceil((Math.random() * 3));
if (Math.floor((Math.random() * 2)) == 0){
placeBuilding(k, j, 5, true);
placeBuilding((k + 1), j, 5, true);
placeBuilding(k, (j + 1), 40, true);
} else {
placeBuilding(k, j, 10, true);
placeBuilding((k + 1), j, 10, true);
placeBuilding(k, (j + 1), 15, true);
};
placeBuilding(0, (4 + Math.floor((Math.random() * 2))), 30, true);
tweenX = new Tween(screen, "x", None.easeNone, (-200 * (i - 1)), (-200 * (i - 1)), 0.5, true);
tweenY = new Tween(screen, "y", None.easeNone, -200, -200, 0.5, true);
lisaTweenX = new Tween(screen.simpson, "x", None.easeNone, 4850, 4850, 0.5, true);
lisaTweenY = new Tween(screen.simpson, "y", None.easeNone, 1386, 1386, 0.5, true);
stage.addEventListener(MouseEvent.CLICK, mouseClicked);
updateUi();
}
function frame5(){
stop();
cover2.x = 0;
cover2.y = 0;
lastTween = new Tween(cover2, "alpha", None.easeNone, 1, 0, 3, true);
lastTween.FPS = 40;
if ((((bPrayed == false)) && ((bRocketsUsed == true)))){
medalWar.alpha = 1;
};
if ((((bPrayed == true)) && ((bRocketsUsed == false)))){
medalPeace.alpha = 1;
};
if (bTreesDestroyed == false){
medalNature.alpha = 1;
};
if (iLaboratory > 2){
medalTech.alpha = 1;
};
if (iTotalDeaths < 11){
medalRescue.alpha = 1;
};
transform0.volume = 0.5;
myChannel = musIntro.play();
myChannel.soundTransform = transform0;
strOut = (iTopPopulation + " citizens\n");
strOut = ((strOut + iPopulation) + " citizens\n");
strOut = ((((strOut + iTotBuildingsBuilt) + "\n") + iTotBuildingsDestroyed) + "\n");
strOut = ((strOut + arrStreet[10]) + "\n");
strOut = ((strOut + iTownValue) + "\n");
strOut = ((strOut + iPollutionLevel) + "\n");
strOut = ((strOut + iTotalCuredInHospital) + "\n");
strOut = ((strOut + iTotalDeaths) + "\n");
strOut = ((strOut + iTotalForestsCut) + "\n");
strOut = (strOut + iDayCounter);
txtValues.text = strOut;
}
}
}//package sfd_fla
Section 38
//sim1_13 (sfd_fla.sim1_13)
package sfd_fla {
import flash.display.*;
public dynamic class sim1_13 extends MovieClip {
public function sim1_13(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 39
//sim1b_9 (sfd_fla.sim1b_9)
package sfd_fla {
import flash.display.*;
public dynamic class sim1b_9 extends MovieClip {
public function sim1b_9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 40
//sim2_14 (sfd_fla.sim2_14)
package sfd_fla {
import flash.display.*;
public dynamic class sim2_14 extends MovieClip {
public function sim2_14(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 41
//sim2b_10 (sfd_fla.sim2b_10)
package sfd_fla {
import flash.display.*;
public dynamic class sim2b_10 extends MovieClip {
public function sim2b_10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 42
//sim3_15 (sfd_fla.sim3_15)
package sfd_fla {
import flash.display.*;
public dynamic class sim3_15 extends MovieClip {
public function sim3_15(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 43
//sim3b_11 (sfd_fla.sim3b_11)
package sfd_fla {
import flash.display.*;
public dynamic class sim3b_11 extends MovieClip {
public function sim3b_11(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 44
//sim4_16 (sfd_fla.sim4_16)
package sfd_fla {
import flash.display.*;
public dynamic class sim4_16 extends MovieClip {
public function sim4_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 45
//sim4b_12 (sfd_fla.sim4b_12)
package sfd_fla {
import flash.display.*;
public dynamic class sim4b_12 extends MovieClip {
public function sim4b_12(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package sfd_fla
Section 46
//simpson_20 (sfd_fla.simpson_20)
package sfd_fla {
import flash.display.*;
public dynamic class simpson_20 extends MovieClip {
public var rocket:MovieClip;
public function simpson_20(){
addFrameScript(0, frame1, 4, frame5, 12, frame13, 21, frame22, 24, frame25, 36, frame37, 39, frame40, 45, frame46, 48, frame49, 54, frame55, 60, frame61);
}
function frame1(){
stop();
}
function frame5(){
}
function frame13(){
gotoAndPlay(5);
}
function frame22(){
gotoAndPlay(16);
}
function frame25(){
}
function frame37(){
gotoAndPlay(25);
}
function frame40(){
}
function frame46(){
gotoAndPlay(40);
}
function frame49(){
}
function frame55(){
}
function frame61(){
gotoAndPlay(55);
}
}
}//package sfd_fla
Section 47
//spriteHouse1_8 (sfd_fla.spriteHouse1_8)
package sfd_fla {
import flash.display.*;
import flash.text.*;
public dynamic class spriteHouse1_8 extends MovieClip {
public var sim1:MovieClip;
public var sim2:MovieClip;
public var sim3:MovieClip;
public var sim4:MovieClip;
public var electriying:MovieClip;
public var churchText:TextField;
public var waste:MovieClip;
public function spriteHouse1_8(){
addFrameScript(0, frame1, 4, frame5, 9, frame10, 14, frame15, 19, frame20, 24, frame25, 29, frame30, 34, frame35, 39, frame40, 44, frame45, 49, frame50, 54, frame55, 59, frame60, 64, frame65, 69, frame70, 74, frame75, 79, frame80, 84, frame85, 89, frame90, 94, frame95);
}
function frame1(){
stop();
}
function frame5(){
}
function frame10(){
stop();
}
function frame15(){
stop();
}
function frame20(){
stop();
}
function frame25(){
stop();
}
function frame30(){
stop();
}
function frame35(){
stop();
}
function frame40(){
stop();
}
function frame45(){
stop();
}
function frame50(){
stop();
}
function frame55(){
stop();
}
function frame60(){
stop();
}
function frame65(){
stop();
}
function frame70(){
stop();
}
function frame75(){
stop();
}
function frame80(){
stop();
}
function frame85(){
stop();
}
function frame90(){
stop();
}
function frame95(){
stop();
}
}
}//package sfd_fla
Section 48
//introStartButton (introStartButton)
package {
import flash.display.*;
public dynamic class introStartButton extends MovieClip {
}
}//package
Section 49
//movie_mc (movie_mc)
package {
import flash.display.*;
public dynamic class movie_mc extends MovieClip {
}
}//package
Section 50
//wavCool (wavCool)
package {
import flash.media.*;
public dynamic class wavCool extends Sound {
}
}//package
Section 51
//wavDestroy (wavDestroy)
package {
import flash.media.*;
public dynamic class wavDestroy extends Sound {
}
}//package
Section 52
//wavDoh (wavDoh)
package {
import flash.media.*;
public dynamic class wavDoh extends Sound {
}
}//package
Section 53
//wavIntro (wavIntro)
package {
import flash.media.*;
public dynamic class wavIntro extends Sound {
}
}//package
Section 54
//wavLaugh (wavLaugh)
package {
import flash.media.*;
public dynamic class wavLaugh extends Sound {
}
}//package
Section 55
//wavLizard (wavLizard)
package {
import flash.media.*;
public dynamic class wavLizard extends Sound {
}
}//package
Section 56
//wavNooo (wavNooo)
package {
import flash.media.*;
public dynamic class wavNooo extends Sound {
}
}//package
Section 57
//wavPity (wavPity)
package {
import flash.media.*;
public dynamic class wavPity extends Sound {
}
}//package
Section 58
//wavTheme (wavTheme)
package {
import flash.media.*;
public dynamic class wavTheme extends Sound {
}
}//package