Section 1
//ChatBubble (com.citysuperhero.ChatBubble)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
public class ChatBubble {
public var gGameObj;
public var pState;// = 0
public var theText:TextField;
public var pPosX:Number;
public var theTextFormat:TextFormat;
public var pLifetime:int;
public var pPosY:Number;
public var MainObj;
public var pChatBubble_MC:ChatBubbleMovieClip;
public var pParent_MC;
public var pText:String;
public var pStartTime:int;
public function ChatBubble(_arg1:Object, _arg2:String, _arg3:Object, _arg4:MovieClip, _arg5:int){
theText = new TextField();
theTextFormat = new TextFormat();
pState = 0;
pChatBubble_MC = new ChatBubbleMovieClip();
super();
gGameObj = _arg1;
MainObj = gGameObj.MainObj;
pPosX = _arg3.x;
pPosY = _arg3.y;
pLifetime = _arg5;
pText = _arg2;
pParent_MC = _arg4;
MainObj.addEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function CreateChatBubble(){
pChatBubble_MC.x = pPosX;
pChatBubble_MC.y = pPosY;
pChatBubble_MC.gotoAndStop(1);
pParent_MC.addChild(pChatBubble_MC);
theText.text = pText;
theText.width = 70;
theText.x = -35;
theText.y = -40;
theText.wordWrap = true;
theTextFormat.size = "16";
theTextFormat.align = "center";
theTextFormat.bold = true;
theText.setTextFormat(theTextFormat);
pChatBubble_MC.addChild(theText);
}
public function DisplayChatBubble(){
var _local1:int;
switch (pState){
case 0:
CreateChatBubble();
pStartTime = getTimer();
pState = 1;
break;
case 1:
_local1 = (getTimer() - pStartTime);
if (_local1 > pLifetime){
DestroyChatBubble();
};
break;
};
}
public function GameUpdate(_arg1:Event){
switch (gGameObj.gGame_Status){
case "Gameplay":
DisplayChatBubble();
break;
case "CleanUp":
DestroyChatBubble();
break;
};
}
public function DestroyChatBubble(){
theTextFormat = null;
pChatBubble_MC.removeChild(theText);
pParent_MC.removeChild(pChatBubble_MC);
pChatBubble_MC = null;
MainObj.removeEventListener(Event.ENTER_FRAME, GameUpdate);
}
}
}//package com.citysuperhero
Section 2
//Civilian (com.citysuperhero.Civilian)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class Civilian extends NPC {
public var pState:String;// = "1"
public var pDeathDir:String;
var pCameraDir:String;
private var lastTime:int;
var pCameraFlash_MC:MovieClip;
public var pDeathState:String;
private var pStartTime:int;
public var pType:String;
var pCameraState:String;// = "1"
public var pDeathDelay:int;
public function Civilian(_arg1:Object, _arg2:Object){
var _local3:MovieClip;
pState = "1";
pCameraState = "1";
super();
gGameObj = _arg1;
MainObj = gGameObj.MainObj;
gGameObj.pDisplay_Registry_List.push(this);
gGameObj.pCharacter_Registry_List.push(this);
gGameObj.pNPC_Registry_List.push(this);
gamemap = MainObj.gamemap;
pWorldX = _arg2.X;
pWorldY = _arg2.Y;
pWorldZ = _arg2.Z;
pSpeed = _arg2.spd;
pMode = _arg2.mode;
pType = _arg2.type;
pSpawnName = _arg2.name;
pStartX = pWorldX;
pStartY = pWorldY;
pStartZ = pWorldZ;
pWaypoints_List = _arg2.waypoints;
switch (pType){
case "Civ1":
_local3 = new Civilian1MovieClip();
break;
case "Civ2":
_local3 = new Civilian2MovieClip();
break;
case "Civ3":
_local3 = new Civilian3MovieClip();
break;
case "Civ4":
_local3 = new Civilian4MovieClip();
break;
case "Civ5":
_local3 = new Civilian5MovieClip();
break;
case "Civ6":
_local3 = new Civilian6MovieClip();
break;
case "CivK1":
_local3 = new CivilianKidnapped1MovieClip();
break;
case "CivP":
_local3 = new CivilianPhotographer1MovieClip();
break;
};
pCharacter_MC = _local3;
pNPCType = "Civilian";
initShadowMovieClipAttributes();
initCivilianMovieClipAttributes();
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
MainObj.addEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function DestroyCivilian(){
var _local1:*;
var _local2:*;
var _local3:*;
gamemap.removeChild(pShadow_MC);
pShadow_MC = null;
gamemap.removeChild(pCharacter_MC);
pCharacter_MC = null;
if (pCameraFlash_MC != null){
gamemap.removeChild(pCameraFlash_MC);
pCameraFlash_MC = null;
};
_local1 = 0;
while (_local1 < gGameObj.pNPC_Registry_List.length) {
_local2 = gGameObj.pNPC_Registry_List[_local1];
if (_local2 == this){
gGameObj.pNPC_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
_local1 = 0;
while (_local1 < gGameObj.pDisplay_Registry_List.length) {
_local3 = gGameObj.pDisplay_Registry_List[_local1];
if (_local3 == this){
gGameObj.pDisplay_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
MainObj.removeEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function GunBulletNear(){
var _local1:ChatBubble;
var _local2:ScreamSnd;
var _local3:SoundChannel;
if (pState == "1"){
_local1 = new ChatBubble(gGameObj, "I'm going to die!", {x:0, y:"-85"}, pCharacter_MC, 3000);
_local2 = new ScreamSnd();
_local3 = _local2.play();
pStartTime = getTimer();
pSpeed = 10;
pState = "2";
};
}
public function CheckForPlayer(_arg1:int){
var _local2:Array;
var _local3:Array;
var _local4:Number;
_local2 = [pWorldX, pWorldY, pWorldZ];
_local3 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local4 = gGameObj.DistanceTo(_local2, _local3);
if (_local4 < _arg1){
return (true);
};
return (false);
}
public function CheckHeroPictureTaken(){
if (pCameraFlash_MC.hitTestObject(gGameObj.heroClassRef.pCharacter_MC)){
gGameObj.UpdateSecretIdentityBar(-25);
};
}
public function CheckForBadGuys(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:*;
var _local6:*;
var _local7:Point;
var _local8:Point;
var _local9:Number;
var _local10:int;
var _local11:int;
var _local12:Object;
var _local13:TrailParticle;
if (pType != "CivP"){
_local1 = new Point(pCharacter_MC.x, pCharacter_MC.y);
_local2 = gamemap.localToGlobal(_local1);
_local3 = new Point(_local2.x, (_local2.y + 40));
_local4 = new Point(_local3.x, _local3.y);
_local5 = 0;
while (_local5 < gGameObj.pNPC_Registry_List.length) {
_local6 = gGameObj.pNPC_Registry_List[_local5];
_local7 = new Point(_local6.pCharacter_MC.x, _local6.pCharacter_MC.y);
_local1 = new Point(_local6.pCharacter_MC.x, _local6.pCharacter_MC.y);
_local2 = gamemap.localToGlobal(_local1);
_local8 = new Point(_local2.x, (_local2.y + 40));
_local9 = Point.distance(_local8, _local4);
switch (_local6.pNPCType){
case "Mobster":
_local10 = 6;
_local11 = -25;
case "Mutant":
if (_local6.pNPCType == "Mutant"){
_local10 = 5;
_local11 = -50;
};
if (_local9 < 200){
pRunAway_Obj = _local6;
if ((((pState == "1")) || ((pState == "4")))){
gGameObj.UpdateProsperityMeter(_local11);
_local12 = new Object();
_local12.ParentMC = pCharacter_MC;
_local12.ParticleMC = "Point";
_local12.frame = _local10;
_local12.x = pWorldX;
_local12.y = pWorldY;
_local12.z = pWorldZ;
_local12.type = "rise";
_local12.startfade = 1;
_local12.fadeincre = 0.005;
_local13 = new TrailParticle(gGameObj, _local12);
};
return (true);
};
break;
};
_local5++;
};
};
return (false);
}
public function CheckModes(){
switch (pMode){
case "Stroll":
CivilianLogic();
Animate();
break;
case "Stand":
Animate();
break;
case "Captured":
Animate();
Captured();
break;
case "Wander":
WayPoints();
Animate();
break;
case "Patrol":
Animate();
break;
case "Camera":
UseCamera();
break;
case "Chase":
Chase();
Animate();
break;
};
}
public function Animate(){
var _local1:int;
var _local2:Number;
var _local3:Number;
if (lastTime == 0){
lastTime = getTimer();
};
_local1 = (getTimer() - lastTime);
if (_local1 > 100){
switch (pAction){
case "swr":
_local2 = 4;
_local3 = 5;
break;
case "swl":
_local2 = 6;
_local3 = 7;
break;
case "wf":
_local2 = 2;
_local3 = 3;
break;
case "wb":
_local2 = 8;
_local3 = 9;
break;
case "ssr":
_local2 = 4;
_local3 = 4;
break;
case "ssl":
_local2 = 6;
_local3 = 6;
break;
case "sf":
_local2 = 1;
_local3 = 1;
break;
case "sb":
_local2 = 8;
_local3 = 8;
break;
case "chrf":
_local2 = 11;
_local3 = 12;
break;
case "cmr":
_local2 = 31;
_local3 = 31;
break;
case "cml":
_local2 = 32;
_local3 = 32;
break;
case "cmf":
_local2 = 30;
_local3 = 30;
break;
case "cmb":
_local2 = 8;
_local3 = 8;
break;
case "scrm":
_local2 = 20;
_local3 = 21;
break;
};
if (pCharacter_MC.currentFrame >= _local3){
pCharacter_MC.gotoAndStop(_local2);
lastTime = getTimer();
} else {
if (pCharacter_MC.currentFrame < _local2){
pCharacter_MC.gotoAndStop(_local2);
lastTime = getTimer();
} else {
pCharacter_MC.gotoAndStop((pCharacter_MC.currentFrame + 1));
lastTime = getTimer();
};
};
};
}
public function Captured(){
var _local1:int;
var _local2:Object;
var _local3:TrailParticle;
var _local4:ChatBubble;
var _local5:ScreamShortSnd;
var _local6:SoundChannel;
var _local7:Boolean;
switch (pState){
case "1":
FadeIn();
_local1 = (getTimer() - pStartTime);
if (_local1 > 5000){
_local4 = new ChatBubble(gGameObj, "Help Me!!!", {x:0, y:"-85"}, pCharacter_MC, 3000);
_local5 = new ScreamShortSnd();
_local6 = _local5.play();
gGameObj.UpdateProsperityMeter(-100);
_local2 = new Object();
_local2.ParentMC = pCharacter_MC;
_local2.ParticleMC = "Point";
_local2.frame = 4;
_local2.x = pWorldX;
_local2.y = pWorldY;
_local2.z = pWorldZ;
_local2.type = "rise";
_local2.startfade = 1;
_local2.fadeincre = 0.005;
_local3 = new TrailParticle(gGameObj, _local2);
pAction = "scrm";
pStartTime = getTimer();
pState = "2";
} else {
if (gGameObj.heroClassRef.pIdentity == "Hero"){
_local7 = CheckForPlayer(25);
if (_local7 == true){
pState = "Freed-1";
};
};
};
break;
case "2":
FadeIn();
_local1 = (getTimer() - pStartTime);
if (_local1 > 1000){
pAction = "sf";
pStartTime = getTimer();
pState = "1";
};
break;
case "Freed-1":
gGameObj.UpdateProsperityMeter(250);
_local2 = new Object();
_local2.ParentMC = pCharacter_MC;
_local2.ParticleMC = "Point";
_local2.frame = 2;
_local2.x = pWorldX;
_local2.y = pWorldY;
_local2.z = pWorldZ;
_local2.type = "rise";
_local2.startfade = 1;
_local2.fadeincre = 0.005;
_local3 = new TrailParticle(gGameObj, _local2);
pState = "Freed-2";
break;
case "Freed-2":
FadeOut();
if (pCharacter_MC.alpha == 0){
pState = "gone";
};
break;
case "gone":
DestroyCivilian();
break;
};
}
public function GameUpdate(_arg1:Event){
switch (gGameObj.gGame_Status){
case "Gameplay":
CheckModes();
break;
case "CleanUp":
DestroyCivilian();
break;
};
}
public function FadeOut(){
var _local1:Number;
var _local2:Number;
_local1 = pCharacter_MC.alpha;
_local2 = 0.025;
if (_local1 > 0){
_local1 = (_local1 - gGameObj.Translate_Increment(_local2, 50, 30));
};
if (_local1 < 0){
_local1 = 0;
};
pCharacter_MC.alpha = _local1;
if (_local1 > 0.4){
_local1 = 0.4;
};
pShadow_MC.alpha = _local1;
}
public function FadeIn(){
var _local1:Number;
var _local2:Number;
_local1 = pCharacter_MC.alpha;
_local2 = 0.025;
if (_local1 < 1){
_local1 = (_local1 + gGameObj.Translate_Increment(_local2, 50, 30));
};
if (_local1 > 1){
_local1 = 1;
};
pCharacter_MC.alpha = _local1;
if (_local1 > 0.4){
_local1 = 0.4;
};
pShadow_MC.alpha = _local1;
}
public function initCivilianMovieClipAttributes(){
pCharacter_MC.x = 600;
pCharacter_MC.y = 600;
pCharacter_MC.gotoAndStop(1);
pAction = "sf";
pCharacter_MC.alpha = 0;
pShadow_MC.alpha = 0;
gamemap.addChild(pCharacter_MC);
}
public function UseCamera(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:CameraClickSnd;
var _local6:SoundChannel;
var _local7:Number;
switch (pCameraState){
case "1":
lastTime = (getTimer() - 1000);
_local2 = 10;
_local3 = -50;
_local4 = false;
switch (pAction){
case "swr":
case "ssr":
pAction = "cmr";
pCameraDir = "right";
_local2 = 85;
_local3 = -20;
_local1 = 1;
break;
case "swl":
case "ssl":
pAction = "cml";
pCameraDir = "left";
_local2 = -85;
_local3 = -20;
_local1 = 2;
break;
case "wf":
case "sf":
pAction = "cmf";
pCameraDir = "forward";
_local2 = 10;
_local3 = 50;
_local1 = 4;
break;
case "wb":
case "sb":
pAction = "cmb";
pCameraDir = "backward";
_local1 = 3;
_local4 = true;
break;
};
Animate();
pCameraFlash_MC = new CameraFlashMovieClip();
gamemap.addChild(pCameraFlash_MC);
pCameraFlash_MC.gotoAndStop(_local1);
pCameraFlash_MC.x = (pCharacter_MC.x + _local2);
pCameraFlash_MC.y = (pCharacter_MC.y + _local3);
if (_local4 == true){
gamemap.setChildIndex(pCameraFlash_MC, 1);
};
CheckHeroPictureTaken();
_local5 = new CameraClickSnd();
_local6 = _local5.play();
pCameraState = "2";
break;
case "2":
_local7 = pCameraFlash_MC.alpha;
_local7 = (_local7 - gGameObj.Translate_Increment(0.05, 50, 30));
if (_local7 < 0){
_local7 = 0;
};
pCameraFlash_MC.alpha = _local7;
if (_local7 == 0){
pCameraState = "3";
};
break;
case "3":
lastTime = (getTimer() - 1000);
switch (pAction){
case "cmr":
pAction = "ssr";
break;
case "cml":
pAction = "ssl";
break;
case "cmf":
pAction = "sf";
break;
case "cmb":
pAction = "sb";
break;
};
Animate();
gamemap.removeChild(pCameraFlash_MC);
pCameraFlash_MC = null;
pMode = "Stroll";
pCameraState = "1";
break;
};
}
public function CivilianLogic(){
var _local1:Boolean;
var _local2:int;
var _local3:Number;
var _local4:ChatBubble;
var _local5:ScreamSnd;
var _local6:SoundChannel;
var _local7:Boolean;
var _local8:Object;
var _local9:TrailParticle;
if (gGameObj.heroClassRef.pIdentity == "Nerd"){
switch (pState){
case "1":
FadeIn();
WayPoints();
_local1 = CheckForBadGuys();
if ((((_local1 == true)) && (!((pType == "CivP"))))){
_local4 = new ChatBubble(gGameObj, "Help!!!", {x:0, y:"-85"}, pCharacter_MC, 3000);
_local5 = new ScreamSnd();
_local6 = _local5.play();
pStartTime = getTimer();
pSpeed = 10;
pState = "2";
};
break;
case "4":
pSpeed = 2;
pStartTime = getTimer();
pState = "2";
case "2":
RunAway();
_local2 = (getTimer() - pStartTime);
if (_local2 > 3000){
FadeOut();
};
_local3 = pCharacter_MC.alpha;
if (_local3 == 0){
pStartTime = getTimer();
pState = "3";
pWorldX = pStartX;
pWorldY = pStartY;
pWorldZ = pStartZ;
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
};
break;
case "3":
_local2 = (getTimer() - pStartTime);
if (_local2 > 5000){
_local1 = CheckForBadGuys();
if (_local1 == false){
pWaypoint_Pointer = 0;
pWaypoint_State = 1;
pState = "1";
};
};
break;
};
};
if (gGameObj.heroClassRef.pIdentity == "Hero"){
switch (pState){
case "1":
FadeIn();
WayPoints();
_local7 = CheckForPlayer(300);
if (_local7 == true){
if (pType != "CivP"){
_local4 = new ChatBubble(gGameObj, "we're saved!", {x:0, y:"-85"}, pCharacter_MC, 3000);
} else {
_local4 = new ChatBubble(gGameObj, "Ha! I found him!", {x:0, y:"-85"}, pCharacter_MC, 3000);
};
pSpeed = 6;
pState = "4";
pStartTime = getTimer();
};
break;
case "2":
RunAway();
_local2 = (getTimer() - pStartTime);
if (_local2 > 3000){
FadeOut();
};
_local3 = pCharacter_MC.alpha;
if (_local3 == 0){
pStartTime = getTimer();
pState = "3";
pWorldX = pStartX;
pWorldY = pStartY;
pWorldZ = pStartZ;
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
};
break;
case "3":
_local2 = (getTimer() - pStartTime);
if (_local2 > 5000){
_local1 = CheckForBadGuys();
if (_local1 == false){
pWaypoint_Pointer = 0;
pWaypoint_State = 1;
pState = "1";
};
};
break;
case "4":
FadeIn();
Chase();
_local7 = CheckForPlayer(100);
if (_local7 == true){
if (pType != "CivP"){
gGameObj.UpdateSecretIdentityBar(-0.07);
switch (pAction){
case "chrf":
case "sf":
case "sb":
case "ssr":
case "ssl":
pAction = "chrf";
Animate();
break;
};
_local2 = (getTimer() - pStartTime);
if (_local2 > 3000){
_local8 = new Object();
_local8.ParentMC = pCharacter_MC;
_local8.ParticleMC = "Point";
_local8.frame = 3;
gGameObj.UpdateProsperityMeter(25);
_local8.x = pWorldX;
_local8.y = pWorldY;
_local8.z = pWorldZ;
_local8.type = "rise";
_local8.startfade = 1;
_local8.fadeincre = 0.005;
_local9 = new TrailParticle(gGameObj, _local8);
pStartTime = getTimer();
};
} else {
pMode = "Camera";
};
};
_local1 = CheckForBadGuys();
if (_local1 == true){
_local4 = new ChatBubble(gGameObj, "Help!!!", {x:0, y:"-85"}, pCharacter_MC, 3000);
_local5 = new ScreamSnd();
_local6 = _local5.play();
pStartTime = getTimer();
pSpeed = 10;
pState = "2";
};
break;
};
};
}
}
}//package com.citysuperhero
Section 3
//GameObjClass (com.citysuperhero.GameObjClass)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.filters.*;
import flash.net.*;
import flash.external.*;
import flash.utils.*;
public class GameObjClass {
public var pTutorialStartTime:int;
public var pheadlineOverlayMC:MovieClip;
public var pConversation_StartTime;
public var pGoodPrevailedOverlay_MC:MovieClip;
public var pDisplay_Registry_List:Array;
public var heroClassRef;
public var pTimeClock_Timer:int;
public var gGame_Status:String;// = "Frontend"
public var pCurrentLevel:String;// = "1"
public var pProsperityGoalineMC:MovieClip;
public var pConversation_TimeLimt:int;
public var pChannel1:SoundChannel;
public var pIdentityRevealedOverlay_MC:MovieClip;
public var pTotalTranquility:Boolean;
public var gamemap;
public var pTutorialPopup_MC:MovieClip;
public var pContinueYesOverlay_MC:MovieClip;
public var pLoaderInitialized:Boolean;// = false
public var HeroMusicBG_Snd:HeroMusicBG;
public var pConversation_State:String;// = "1"
public var pCharacter_Registry_List:Array;
public var arrowDown:Boolean;
public var pFrontend_Status:String;// = "PreTitleScreen"
public var pProsperity_Points:int;
public var MainObj;
public var pTotalScore:int;
public var pConversation_List:Array;
public var pScoreStartTime:int;
public var SpaceBar_Down:Boolean;// = false
public var pContinueOverlay_MC:MovieClip;
public var gameStartTime:int;
public var lastTime:int;
public var arrowUp;
public var pProsperity_Goal:int;
public var pTimeClock_Limit:int;
public var pEndGame_State:String;// = "1"
public var pScore_GotoNextLevel:Boolean;
public var Attack_KeyDown;
public var NerdMusicBG_Snd:NerdMusicBG;
public var pGame_StartTime:int;
public var pScoreNumbers_List:Array;
public var pCleanUpState:String;// = "1"
public var pScoreIcon_MC:MovieClip;
public var pTutorialTarget_MC:MovieClip;
public var AnimPointer:int;// = 1
public var pMusicFirstPlayed:Boolean;// = false
public var pTimeUpOverlay_MC:MovieClip;
public var collisionmap;
public var pProsperityMeterMC:MovieClip;
public var pGameOverOverlay_MC:MovieClip;
public var pSecretIdentityBar_MC:MovieClip;
public var pNoHeadlineOverlay_MC:MovieClip;
public var pSecretIdentityBar:Number;
public var pCinematic_State:String;
public var pTutorialText1_MC;
public var theMovieClip;
public var pTutorialState:String;
public var pTitleHeroDir:String;// = "up"
public var pEndGame_StartTime:int;
public var pScoreContinueButton:MovieClip;
public var pProsperityIndicator_MC:MovieClip;
public var pContinueNoOverlay_MC:MovieClip;
public var pTutorialText2_MC;
public var pTutorialStatus:Boolean;
public var pSpawn_List:Array;
public var arrowRight;
public var W_KeyDown;
public var pTutorialArrow1_MC:MovieClip;
public var pScoreState:String;
public var arrowLeft;
public var pHeadline_List:Array;
public var pStartTime:int;
public var pSecretIdentityFrameMC:MovieClip;
public var pEvilPrevailedOverlay_MC:MovieClip;
public var pTutorialTurnOff_MC;
public var pPhoneBooth1_MC:PhoneBooth;
public var pSecretIdentityBackFrameMC:MovieClip;
public var pEndGame_Mode:String;
public var HeroNerd_MC:HeroNerdMovieClip;
public var pTimeClock_MC:MovieClip;
public var pNPC_Registry_List:Array;
public var pTutorialArrow2_MC:MovieClip;
public static var gTheLevel:String = "Level 1";
public function GameObjClass(_arg1:Object){
gGame_Status = "Frontend";
pFrontend_Status = "PreTitleScreen";
pCurrentLevel = "1";
pConversation_State = "1";
SpaceBar_Down = false;
AnimPointer = 1;
pEndGame_State = "1";
pCleanUpState = "1";
pTitleHeroDir = "up";
NerdMusicBG_Snd = new NerdMusicBG();
HeroMusicBG_Snd = new HeroMusicBG();
pMusicFirstPlayed = false;
pDisplay_Registry_List = new Array();
pNPC_Registry_List = new Array();
pCharacter_Registry_List = new Array();
HeroNerd_MC = new HeroNerdMovieClip();
pPhoneBooth1_MC = new PhoneBooth();
pScoreNumbers_List = [];
pLoaderInitialized = false;
super();
MainObj = _arg1;
MainObj.addEventListener(Event.ENTER_FRAME, GameUpdate);
MainObj.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
MainObj.stage.addEventListener(KeyboardEvent.KEY_UP, keyUpFunction);
pFrontend_Status = "Loader";
MainObj.gotoAndStop("loader");
MainObj.addEventListener(Event.ENTER_FRAME, loading);
}
protected function sortDisplayList():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:int;
var _local8:int;
_local1 = 0;
while (_local1 < pDisplay_Registry_List.length) {
_local2 = pDisplay_Registry_List[_local1];
switch (_local2.pObject_Type){
case "Character":
_local3 = _local2.pCharacter_MC;
break;
case "Object":
_local3 = _local2.pObject_MC;
break;
};
if (_local3 != null){
_local4 = 0;
while (_local4 < pDisplay_Registry_List.length) {
_local5 = pDisplay_Registry_List[_local4];
switch (_local5.pObject_Type){
case "Character":
_local6 = _local5.pCharacter_MC;
break;
case "Object":
_local6 = _local5.pObject_MC;
break;
};
if (_local6 != null){
if (_local2.pWorldZ > _local5.pWorldZ){
_local7 = gamemap.getChildIndex(_local3);
_local8 = gamemap.getChildIndex(_local6);
if (_local7 < _local8){
gamemap.swapChildrenAt(_local7, _local8);
};
};
};
_local4++;
};
};
_local1++;
};
}
public function RemoveScoreNumbers(){
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < pScoreNumbers_List.length) {
_local2 = pScoreNumbers_List[_local1];
MainObj.stage.removeChild(_local2);
_local1++;
};
pScoreNumbers_List = [];
}
public function Frontend(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:SharedObject;
var _local6:*;
var _local7:HeroClass;
var _local8:*;
var _local9:Number;
switch (pFrontend_Status){
case "PreTitleScreen":
_local1 = ["outsidetheboxsoftware.com", "www.outsidetheboxsoftware.com", "www.flashgamelicense.com", "flashgamelicense.com"];
_local2 = sitelock(_local1);
if (pMusicFirstPlayed == true){
pChannel1.stop();
};
pChannel1 = HeroMusicBG_Snd.play();
pMusicFirstPlayed = true;
_local3 = MainObj.play_button;
if (_local3 == null){
return;
};
_local3.alpha = 0.75;
_local3.addEventListener(MouseEvent.CLICK, StartGame);
_local3.addEventListener(MouseEvent.MOUSE_OVER, StartGame);
_local3.addEventListener(MouseEvent.MOUSE_OUT, StartGame);
_local4 = MainObj.credits_button;
_local4.alpha = 0.75;
_local4.addEventListener(MouseEvent.CLICK, StartGame);
_local4.addEventListener(MouseEvent.MOUSE_OVER, StartGame);
_local4.addEventListener(MouseEvent.MOUSE_OUT, StartGame);
MainObj.sociotown_clicklogo.addEventListener(MouseEvent.CLICK, open_SocioTownPage);
MainObj.sociotown_clicklogo.buttonMode = true;
_local5 = SharedObject.getLocal("CitySuperheroSave");
if (_local5.size > 0){
MainObj.continue_button.addEventListener(MouseEvent.CLICK, GeneralButtonBehavior);
MainObj.continue_button.addEventListener(MouseEvent.MOUSE_OVER, GeneralButtonBehavior);
MainObj.continue_button.addEventListener(MouseEvent.MOUSE_OUT, GeneralButtonBehavior);
MainObj.continue_button.alpha = 0.75;
} else {
MainObj.continue_button.alpha = 0.5;
};
pFrontend_Status = "TitleScreen";
break;
case "TitleScreen":
if (pTitleHeroDir == "up"){
MainObj.title_hero.y = (MainObj.title_hero.y - Translate_Increment(1, 50, 30));
if (MainObj.title_hero.y < 220){
pTitleHeroDir = "down";
};
} else {
MainObj.title_hero.y = (MainObj.title_hero.y + Translate_Increment(1, 50, 30));
if (MainObj.title_hero.y > 270){
pTitleHeroDir = "up";
};
};
break;
case "PreCredits":
_local6 = MainObj.credits_back_button;
if (_local6 == null){
return;
};
_local6.alpha = 0.75;
_local6.addEventListener(MouseEvent.CLICK, StartGame);
_local6.addEventListener(MouseEvent.MOUSE_OVER, StartGame);
_local6.addEventListener(MouseEvent.MOUSE_OUT, StartGame);
MainObj.sociotown_clicklogo.addEventListener(MouseEvent.CLICK, open_SocioTownPage);
MainObj.sociotown_clicklogo.buttonMode = true;
break;
case "Credits":
break;
case "Cinematic":
RunCinematic();
break;
case "PreLevel-1":
switch (pCurrentLevel){
case "1":
MainObj.gotoAndStop("level1");
break;
case "2":
MainObj.gotoAndStop("level2");
break;
case "3":
MainObj.gotoAndStop("level3");
break;
case "4":
MainObj.gotoAndStop("level4");
break;
case "5":
MainObj.gotoAndStop("level5");
break;
case "6":
MainObj.gotoAndStop("level6");
break;
};
pFrontend_Status = "PreLevel-2";
break;
case "PreLevel-2":
switch (pCurrentLevel){
case "1":
pTutorialState = "HowTo_TakePicture-1";
SetupHeadlineOverlay("MOBRULE");
SetupProsperityMeter(3500, 2500);
gamemap = MainObj.gamemap;
collisionmap = MainObj.collisionmap;
gamemap.addChild(collisionmap);
collisionmap.x = 0;
collisionmap.y = 0;
collisionmap.alpha = 0;
pGame_StartTime = getTimer();
pPhoneBooth1_MC.x = 825;
pPhoneBooth1_MC.y = 139;
pPhoneBooth1_MC.gotoAndStop(1);
gamemap.addChild(pPhoneBooth1_MC);
break;
case "2":
pTutorialState = "";
SetupHeadlineOverlay("HEROISBORN");
SetupProsperityMeter(3500, 2500);
gamemap = MainObj.gamemap;
collisionmap = MainObj.collisionmap;
gamemap.addChild(collisionmap);
collisionmap.x = 0;
collisionmap.y = 0;
collisionmap.alpha = 0;
pGame_StartTime = getTimer();
pPhoneBooth1_MC.x = 825;
pPhoneBooth1_MC.y = 139;
pPhoneBooth1_MC.gotoAndStop(1);
gamemap.addChild(pPhoneBooth1_MC);
break;
case "3":
pTutorialState = "";
SetupHeadlineOverlay("SUZYMISSING");
SetupProsperityMeter(3500, 2500);
gamemap = MainObj.gamemap;
collisionmap = MainObj.collisionmap;
gamemap.addChild(collisionmap);
collisionmap.x = 0;
collisionmap.y = 0;
collisionmap.alpha = 0;
pGame_StartTime = getTimer();
pPhoneBooth1_MC.x = 475;
pPhoneBooth1_MC.y = 890;
pPhoneBooth1_MC.gotoAndStop(1);
gamemap.addChild(pPhoneBooth1_MC);
break;
case "4":
pTutorialState = "";
SetupHeadlineOverlay("CITYINDANGER");
SetupProsperityMeter(3500, 2500);
gamemap = MainObj.gamemap;
collisionmap = MainObj.collisionmap;
gamemap.addChild(collisionmap);
collisionmap.x = 0;
collisionmap.y = 0;
collisionmap.alpha = 0;
pGame_StartTime = getTimer();
pPhoneBooth1_MC.x = 475;
pPhoneBooth1_MC.y = 890;
pPhoneBooth1_MC.gotoAndStop(1);
gamemap.addChild(pPhoneBooth1_MC);
break;
case "5":
pTutorialState = "";
SetupHeadlineOverlay("NUCLEARSPILL");
SetupProsperityMeter(3500, 2500);
gamemap = MainObj.gamemap;
collisionmap = MainObj.collisionmap;
gamemap.addChild(collisionmap);
collisionmap.x = 0;
collisionmap.y = 0;
collisionmap.alpha = 0;
pGame_StartTime = getTimer();
pPhoneBooth1_MC.x = 575;
pPhoneBooth1_MC.y = 875;
pPhoneBooth1_MC.gotoAndStop(1);
gamemap.addChild(pPhoneBooth1_MC);
break;
case "6":
pTutorialState = "";
SetupHeadlineOverlay("MUTANTSATTACK");
SetupProsperityMeter(3500, 2500);
gamemap = MainObj.gamemap;
collisionmap = MainObj.collisionmap;
gamemap.addChild(collisionmap);
collisionmap.x = 0;
collisionmap.y = 0;
collisionmap.alpha = 0;
pGame_StartTime = getTimer();
pPhoneBooth1_MC.x = 575;
pPhoneBooth1_MC.y = 875;
pPhoneBooth1_MC.gotoAndStop(1);
gamemap.addChild(pPhoneBooth1_MC);
break;
};
SetupSpawnList();
_local7 = new HeroClass(this);
heroClassRef = _local7;
heroClassRef.centerMap();
SetupTimeClock();
SetupSecretIdentityBar();
pFrontend_Status = "FadeInLevel";
break;
case "FadeInLevel":
_local8 = MainObj.black_screen;
_local8.x = 0;
_local9 = _local8.alpha;
_local9 = (_local9 - Translate_Increment(0.05, 50, 30));
if (_local9 < 0){
_local9 = 0;
};
_local8.alpha = _local9;
if (_local9 == 0){
_local8.x = 640;
gGame_Status = "Gameplay";
pFrontend_Status = "Level";
};
break;
case "PreScore":
if (pProsperity_Points > pProsperity_Goal){
pScore_GotoNextLevel = true;
} else {
pScore_GotoNextLevel = false;
};
if (pScore_GotoNextLevel == true){
MainObj.score_hero_image.gotoAndStop(1);
} else {
MainObj.score_hero_image.gotoAndStop(2);
};
MainObj.score_continue_button.alpha = 0;
pChannel1.stop();
pChannel1 = HeroMusicBG_Snd.play();
pFrontend_Status = "FadeInScore";
break;
case "FadeInScore":
_local8 = MainObj.black_screen;
_local8.x = 0;
_local9 = _local8.alpha;
_local9 = (_local9 - Translate_Increment(0.05, 50, 30));
if (_local9 < 0){
_local9 = 0;
};
_local8.alpha = _local9;
if (_local9 == 0){
_local8.x = 640;
pFrontend_Status = "Score";
};
break;
case "Score":
Score();
break;
};
}
public function GetDirectionFrom(_arg1:Object, _arg2:Object){
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:int;
var _local7:int;
if (_arg1.pWorldX < _arg2.pWorldX){
_local4 = "left";
_local6 = (_arg2.pWorldX - _arg1.pWorldX);
};
if (_arg1.pWorldX > _arg2.pWorldX){
_local4 = "right";
_local6 = (_arg1.pWorldX - _arg2.pWorldX);
};
if (_arg1.pWorldZ < _arg2.pWorldZ){
_local5 = "back";
_local7 = (_arg2.pWorldZ - _arg1.pWorldZ);
};
if (_arg1.pWorldZ > _arg2.pWorldZ){
_local5 = "front";
_local7 = (_arg1.pWorldZ - _arg2.pWorldZ);
};
if (_local4 == "left"){
if (_local6 > _local7){
_local3 = "left";
} else {
_local3 = _local5;
};
};
if (_local4 == "right"){
if (_local6 > _local7){
_local3 = "right";
} else {
_local3 = _local5;
};
};
return (_local3);
}
public function CheckHeadlineComplete(){
var _local1:*;
var _local2:Object;
_local1 = 0;
while (_local1 < pHeadline_List.length) {
_local2 = pHeadline_List[_local1];
if (_local2.status == false){
return (false);
};
_local1++;
};
return (true);
}
public function SetupProsperityMeter(_arg1:int, _arg2:int){
var _local3:ProsperityMeter;
var _local4:ProsperityGoaline;
var _local5:ProsperityIndicator;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
pProsperity_Points = _arg2;
pProsperity_Goal = _arg1;
_local3 = new ProsperityMeter();
_local3.x = 610;
_local3.y = 270;
pProsperityMeterMC = _local3;
MainObj.stage.addChild(_local3);
_local4 = new ProsperityGoaline();
_local4.x = 613;
_local4.y = 100;
pProsperityGoalineMC = _local4;
MainObj.stage.addChild(_local4);
_local5 = new ProsperityIndicator();
_local5.x = 613;
_local5.y = 100;
pProsperityIndicator_MC = _local5;
MainObj.stage.addChild(_local5);
_local6 = (_arg1 / 5000);
_local7 = (335 * _local6);
_local4.y = (435 - _local7);
_local8 = (_arg2 / 5000);
_local9 = (335 * _local8);
_local5.y = (435 - _local9);
}
public function UpdateTimeClock(){
var _local1:int;
var _local2:int;
_local1 = (getTimer() - pTimeClock_Timer);
_local2 = pTimeClock_Limit;
if ((((_local1 > (_local2 * 1))) && ((_local1 < (_local2 * 2))))){
pTimeClock_MC.gotoAndStop(2);
};
if ((((_local1 > (_local2 * 2))) && ((_local1 < (_local2 * 3))))){
pTimeClock_MC.gotoAndStop(3);
};
if ((((_local1 > (_local2 * 3))) && ((_local1 < (_local2 * 4))))){
pTimeClock_MC.gotoAndStop(4);
};
if ((((_local1 > (_local2 * 4))) && ((_local1 < (_local2 * 5))))){
pTimeClock_MC.gotoAndStop(5);
};
if ((((_local1 > (_local2 * 5))) && ((_local1 < (_local2 * 6))))){
pTimeClock_MC.gotoAndStop(6);
};
if ((((_local1 > (_local2 * 6))) && ((_local1 < (_local2 * 7))))){
pTimeClock_MC.gotoAndStop(7);
};
if ((((_local1 > (_local2 * 7))) && ((_local1 < (_local2 * 8))))){
pTimeClock_MC.gotoAndStop(8);
};
if (_local1 > (_local2 * 8)){
pTimeClock_MC.gotoAndStop(9);
gGame_Status = "EndGame";
pEndGame_Mode = "TimeUp";
pEndGame_State = "1";
};
}
public function UpdateProsperityMeter(_arg1:int){
pProsperity_Points = (pProsperity_Points + _arg1);
}
public function Score(){
var _local1:String;
var _local2:PunchHardSnd;
var _local3:SoundChannel;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:*;
switch (pScoreState){
case "1":
_local1 = ("" + pCurrentLevel);
CreateScoreNumbers(_local1, 344, 23);
pScoreState = "2-1";
break;
case "2-1":
pTotalScore = (pTotalScore + pProsperity_Points);
_local1 = ("" + pProsperity_Points);
CreateScoreNumbers(_local1, 344, 110);
_local2 = new PunchHardSnd();
_local3 = _local2.play();
pScoreStartTime = getTimer();
pScoreState = "2-2";
break;
case "2-2":
_local4 = (getTimer() - pScoreStartTime);
if (_local4 > 250){
pScoreState = "3-1";
};
break;
case "3-1":
_local5 = 0;
if (pTotalTranquility == true){
_local5 = 1000;
};
pTotalScore = (pTotalScore + _local5);
_local1 = ("" + _local5);
CreateScoreNumbers(_local1, 344, 152);
_local2 = new PunchHardSnd();
_local3 = _local2.play();
pScoreStartTime = getTimer();
pScoreState = "3-2";
break;
case "3-2":
_local4 = (getTimer() - pScoreStartTime);
if (_local4 > 250){
pScoreState = "4-1";
};
break;
case "4-1":
_local6 = 0;
if (pProsperity_Points > 4000){
_local6 = 500;
};
if (pProsperity_Points > 4200){
_local6 = 1000;
};
if (pProsperity_Points > 4400){
_local6 = 1500;
};
if (pProsperity_Points > 4600){
_local6 = 2000;
};
if (pProsperity_Points > 4800){
_local6 = 2500;
};
if (pProsperity_Points > 5000){
_local6 = 3000;
};
pTotalScore = (pTotalScore + _local6);
_local1 = ("" + _local6);
CreateScoreNumbers(_local1, 344, 196);
_local2 = new PunchHardSnd();
_local3 = _local2.play();
pScoreStartTime = getTimer();
pScoreState = "4-2";
break;
case "4-2":
_local4 = (getTimer() - pScoreStartTime);
if (_local4 > 250){
pScoreState = "5-1";
};
break;
case "5-1":
_local1 = ("" + pTotalScore);
CreateScoreNumbers(_local1, 344, 284);
_local2 = new PunchHardSnd();
_local3 = _local2.play();
pScoreStartTime = getTimer();
pScoreState = "5-2";
break;
case "5-2":
_local4 = (getTimer() - pScoreStartTime);
if (_local4 > 500){
pTotalTranquility = false;
_local7 = MainObj.score_continue_button;
_local7.addEventListener(MouseEvent.CLICK, GeneralButtonBehavior);
_local7.addEventListener(MouseEvent.MOUSE_OVER, GeneralButtonBehavior);
_local7.addEventListener(MouseEvent.MOUSE_OUT, GeneralButtonBehavior);
MainObj.score_continue_button.alpha = 0.7;
pScoreState = "6-1";
};
break;
};
}
public function GeneralButtonBehavior(_arg1:MouseEvent){
var _local2:*;
var _local3:SharedObject;
switch (_arg1.type){
case "mouseOver":
_local2 = _arg1.currentTarget;
switch (_local2.name){
case "continue_button":
case "continue_yes":
case "continue_no":
case "score_continue_button":
_local2.alpha = 1;
break;
};
break;
case "mouseOut":
_local2 = _arg1.currentTarget;
switch (_local2.name){
case "continue_button":
case "continue_yes":
case "continue_no":
case "score_continue_button":
_local2.alpha = 0.7;
break;
};
break;
case "click":
_local2 = _arg1.currentTarget;
switch (_local2.name){
case "continue_button":
_local3 = SharedObject.getLocal("CitySuperheroSave");
pTotalScore = _local3.data.pTotalScore;
pCurrentLevel = _local3.data.pCurrentLevel;
pFrontend_Status = "Cinematic";
pCinematic_State = "PreSetup";
break;
case "continue_yes":
_local2.alpha = 1;
pEndGame_State = "FadeOut-Restart-1";
break;
case "continue_no":
_local2.alpha = 1;
pEndGame_State = "FadeOut-Quit-1";
break;
case "score_continue_button":
RemoveScoreNumbers();
if (pScore_GotoNextLevel == true){
switch (pCurrentLevel){
case "1":
pCurrentLevel = "2";
break;
case "2":
pCurrentLevel = "3";
break;
case "3":
pCurrentLevel = "4";
break;
case "4":
pCurrentLevel = "5";
break;
case "5":
pCurrentLevel = "6";
break;
case "6":
pCurrentLevel = "7";
break;
};
pFrontend_Status = "Cinematic";
pCinematic_State = "PreSetup";
} else {
pTotalScore = 0;
gGame_Status = "Frontend";
pFrontend_Status = "PreTitleScreen";
pConversation_State = "1";
pCurrentLevel = "1";
MainObj.gotoAndStop("title_screen");
};
break;
};
break;
};
}
public function RemoveHeadlineOverlay(){
var _local1:*;
var _local2:Object;
_local1 = 0;
while (_local1 < pHeadline_List.length) {
_local2 = pHeadline_List[_local1];
MainObj.stage.removeChild(_local2.mc);
_local1++;
};
MainObj.stage.removeChild(pheadlineOverlayMC);
}
public function keyDownFunction(_arg1:KeyboardEvent){
if (_arg1.keyCode == 37){
arrowLeft = true;
} else {
if (_arg1.keyCode == 39){
arrowRight = true;
} else {
if (_arg1.keyCode == 38){
arrowUp = true;
} else {
if (_arg1.keyCode == 40){
arrowDown = true;
} else {
if ((((_arg1.keyCode >= 65)) && ((_arg1.keyCode <= 90)))){
Attack_KeyDown = true;
} else {
if (_arg1.keyCode == 32){
SpaceBar_Down = true;
};
};
};
};
};
};
}
public function CreateScoreNumbers(_arg1:String, _arg2:int, _arg3:int){
var _local4:String;
var _local5:Number;
var _local6:int;
var _local7:int;
var _local8:*;
var _local9:ScoreNumbers;
_local6 = _arg2;
_local7 = _arg3;
_local8 = 0;
while (_local8 < _arg1.length) {
_local4 = _arg1.charAt(_local8);
_local5 = Number(_local4);
if (_local4 == "0"){
_local5 = 10;
};
_local9 = new ScoreNumbers();
_local9.gotoAndStop(_local5);
_local9.x = _local6;
_local9.y = _local7;
MainObj.stage.addChild(_local9);
pScoreNumbers_List.push(_local9);
_local6 = (_local6 + 47);
_local8++;
};
}
public function CleanUp(){
switch (pCleanUpState){
case "1":
pCleanUpState = "2";
break;
case "2":
gGame_Status = "Frontend";
pFrontend_Status = "PreLevel-1";
pConversation_State = "1";
pCleanUpState = "1";
break;
case "3":
break;
case "3":
pCleanUpState = "4";
break;
case "4":
MainObj.gotoAndStop("Score");
gGame_Status = "Frontend";
pFrontend_Status = "PreScore";
pScoreState = "1";
break;
};
}
public function GetNextHeadlineLetter(){
var _local1:String;
var _local2:*;
var _local3:Object;
_local1 = null;
_local2 = 0;
while (_local2 < pHeadline_List.length) {
_local3 = pHeadline_List[_local2];
if (_local3.shown == false){
_local1 = _local3.letter;
return (_local1);
};
_local2++;
};
return (_local1);
}
public function SetupSecretIdentityBar(){
var _local1:SecretIdentityBackFrame;
var _local2:SecretIdentityBar;
var _local3:SecretIdentityFrame;
pSecretIdentityBar = 100;
_local1 = new SecretIdentityBackFrame();
_local1.x = 320;
_local1.y = 20;
pSecretIdentityBackFrameMC = _local1;
MainObj.stage.addChild(_local1);
_local2 = new SecretIdentityBar();
_local2.x = 210;
_local2.y = 10;
_local2.width = 217;
pSecretIdentityBar_MC = _local2;
MainObj.stage.addChild(_local2);
_local3 = new SecretIdentityFrame();
_local3.x = 320;
_local3.y = 20;
pSecretIdentityFrameMC = _local3;
MainObj.stage.addChild(_local3);
}
public function AdjustProsperityMeter(){
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = pProsperity_Points;
_local2 = (_local1 / 5000);
_local3 = (335 * _local2);
_local4 = (435 - _local3);
if (pProsperityIndicator_MC.y > _local4){
pProsperityIndicator_MC.y = (pProsperityIndicator_MC.y - Translate_Increment(1, 50, 30));
if (pProsperityIndicator_MC.y < _local4){
pProsperityIndicator_MC.y = _local4;
};
};
if (pProsperityIndicator_MC.y < _local4){
pProsperityIndicator_MC.y = (pProsperityIndicator_MC.y + Translate_Increment(1, 50, 30));
if (pProsperityIndicator_MC.y > _local4){
pProsperityIndicator_MC.y = _local4;
};
};
}
public function SetupSpawnList(){
switch (pCurrentLevel){
case "1":
pTimeClock_Limit = 20000;
pSpawn_List = [{time:1, type:"hdl", stype:"", x:600, y:50, z:280}, {time:1, type:"civ", stype:"Civ6", x:850, y:0, z:650, wtp:"cvlp1"}, {time:1, type:"civ", stype:"Civ2", x:460, y:0, z:1040, wtp:"cv2"}, {time:1, type:"civ", stype:"Civ3", x:750, y:0, z:1070, wtp:"cv1"}, {time:20000, type:"hdl", stype:"", x:460, y:50, z:800}, {time:20000, type:"mb", x:800, y:0, z:650, wtp:"a1"}, {time:40000, type:"hdl", stype:"", x:860, y:50, z:1060}, {time:40000, type:"mb", x:460, y:0, z:1060, wtp:"a1"}, {time:40000, type:"mb", x:950, y:0, z:1060, wtp:"a1"}, {time:60000, type:"hdl", stype:"", x:860, y:50, z:450}, {time:80000, type:"hdl", stype:"", x:1100, y:50, z:800}, {time:80000, type:"mb", x:460, y:0, z:670, wtp:"a1"}, {time:80000, type:"mb", x:860, y:0, z:670, wtp:"a1"}, {time:80000, type:"mb", x:675, y:0, z:1060, wtp:"a1"}, {time:100000, type:"hdl", stype:"", x:240, y:50, z:650}, {time:100000, type:"hdl", stype:"", x:240, y:50, z:1060}, {time:120000, type:"mb", x:675, y:0, z:280, wtp:"a1"}, {time:120000, type:"mb", x:350, y:0, z:1060, wtp:"a1"}, {time:120000, type:"mb", x:950, y:0, z:1060, wtp:"a1"}, {time:140000, type:"mb", x:500, y:0, z:1080, wtp:"a1"}, {time:140000, type:"mb", x:1100, y:0, z:1080, wtp:"a1"}];
break;
case "2":
pTimeClock_Limit = 30000;
pSpawn_List = [{time:1, type:"civ", stype:"Civ4", n:"c1", x:240, y:0, z:280, wtp:"cvlp2"}, {time:1, type:"civ", stype:"Civ6", n:"c2", x:850, y:0, z:650, wtp:"cvlp1"}, {time:1, type:"civ", stype:"Civ2", x:460, y:0, z:1040, wtp:"cv2"}, {time:1, type:"civ", stype:"Civ3", n:"c4", x:750, y:0, z:1070, wtp:"cv1"}, {time:1, type:"hdl", stype:"", host:"c1", x:500, y:50, z:650}, {time:1, type:"hdl", stype:"", x:100, y:50, z:1060}, {time:20000, type:"mb", x:350, y:0, z:650, wtp:"a1"}, {time:20000, type:"mb", x:500, y:0, z:650, wtp:"a1"}, {time:40000, type:"mb", x:1050, y:0, z:260, wtp:"a1"}, {time:40000, type:"mb", x:500, y:0, z:1060, wtp:"a1"}, {time:40000, type:"mb", x:950, y:0, z:1060, wtp:"a1"}, {time:60000, type:"hdl", stype:"", host:"c4", x:100, y:50, z:1060}, {time:80000, type:"hdl", stype:"", x:1100, y:50, z:280}, {time:80000, type:"mb", x:700, y:0, z:260, wtp:"a1"}, {time:100000, type:"hdl", stype:"", x:240, y:50, z:650}, {time:100000, type:"hdl", stype:"", x:700, y:50, z:1050}, {time:120000, type:"mb", x:500, y:0, z:280, wtp:"a1"}, {time:120000, type:"mb", x:375, y:0, z:1060, wtp:"a1"}, {time:140000, type:"hdl", stype:"", x:500, y:50, z:800}, {time:140000, type:"hdl", stype:"", x:1100, y:50, z:800}, {time:160000, type:"hdl", stype:"", x:1100, y:50, z:1060}, {time:160000, type:"hdl", stype:"", host:"c2", x:500, y:50, z:800}, {time:180000, type:"mb", x:700, y:0, z:1040, wtp:"a1"}, {time:180000, type:"mb", x:650, y:0, z:640, wtp:"a1"}, {time:200000, type:"mb", x:500, y:0, z:1070, wtp:"a1"}, {time:200000, type:"mb", x:500, y:0, z:670, wtp:"a1"}, {time:220000, type:"mb", x:900, y:0, z:670, wtp:"a1"}];
break;
case "3":
pTimeClock_Limit = 30000;
pSpawn_List = [{time:0, type:"civ", stype:"Civ4", n:"c1", x:500, y:0, z:270, wtp:"cvlp3"}, {time:0, type:"civ", n:"c2", stype:"Civ5", x:1050, y:0, z:270, wtp:"cv1"}, {time:0, type:"civ", stype:"Civ6", n:"c3", x:700, y:0, z:680, wtp:"cvlp4"}, {time:0, type:"civ", stype:"Civ2", n:"c4", x:860, y:0, z:1040, wtp:"cv1"}, {time:0, type:"civ", stype:"Civ3", n:"c5", x:500, y:0, z:1070, wtp:"cv2"}, {time:0, type:"hdl", stype:"", host:"c1", x:500, y:50, z:650}, {time:0, type:"hdl", stype:"", x:975, y:50, z:1060}, {time:20000, type:"hdl", stype:"", x:500, y:50, z:400}, {time:20000, type:"civK", stype:"CivK1", x:350, y:0, z:670, wtp:"a1"}, {time:20000, type:"mb", x:500, y:0, z:660, wtp:"b1"}, {time:40000, type:"mb", x:800, y:0, z:265, wtp:"a1"}, {time:40000, type:"mb", x:700, y:0, z:700, wtp:"a1"}, {time:40000, type:"mb", x:460, y:0, z:1060, wtp:"a1"}, {time:60000, type:"mb", x:950, y:0, z:650, wtp:"a1"}, {time:60000, type:"mb", x:1000, y:0, z:1075, wtp:"a1"}, {time:80000, type:"hdl", stype:"", host:"c3", x:500, y:50, z:650}, {time:80000, type:"hdl", stype:"", x:240, y:50, z:270}, {time:80000, type:"hdl", stype:"", x:70, y:50, z:1060}, {time:100000, type:"hdl", stype:"", x:700, y:50, z:800}, {time:120000, type:"hdl", stype:"", x:1100, y:50, z:270}, {time:120000, type:"mb", x:950, y:0, z:265, wtp:"a1"}, {time:120000, type:"mb", x:500, y:0, z:300, wtp:"a3"}, {time:140000, type:"hdl", stype:"", x:1150, y:50, z:600}, {time:140000, type:"mb", x:1100, y:0, z:640, wtp:"b1"}, {time:140000, type:"mb", x:800, y:0, z:660, wtp:"b2"}, {time:140000, type:"civK", stype:"CivK1", x:950, y:0, z:650, wtp:"a1"}, {time:160000, type:"hdl", stype:"", x:650, y:50, z:280}, {time:180000, type:"hdl", stype:"", host:"c1", x:500, y:50, z:650}, {time:180000, type:"mb", x:700, y:0, z:1060, wtp:"a1"}, {time:200000, type:"mb", x:500, y:0, z:650, wtp:"a1"}, {time:200000, type:"mb", x:860, y:0, z:1050, wtp:"a1"}, {time:220000, type:"mb", x:525, y:0, z:1070, wtp:"a1"}];
break;
case "4":
pTimeClock_Limit = 30000;
pSpawn_List = [{time:0, type:"civ", stype:"Civ4", n:"c1", x:500, y:0, z:270, wtp:"cvlp3"}, {time:0, type:"civ", n:"c2", stype:"Civ5", x:1050, y:0, z:270, wtp:"cv1"}, {time:0, type:"civ", stype:"Civ6", n:"c3", x:700, y:0, z:680, wtp:"cvlp4"}, {time:0, type:"civ", stype:"Civ2", n:"c4", x:860, y:0, z:1040, wtp:"cv1"}, {time:0, type:"civ", stype:"Civ3", n:"c5", x:500, y:0, z:1070, wtp:"cv2"}, {time:0, type:"civ", stype:"Civ2", n:"c6", x:950, y:0, z:650, wtp:"cv3"}, {time:0, type:"hdl", stype:"", host:"c1", x:500, y:50, z:650}, {time:0, type:"hdl", stype:"", x:600, y:50, z:200}, {time:0, type:"mb", x:750, y:0, z:270, wtp:"a1"}, {time:0, type:"mb", x:500, y:0, z:650, wtp:"a1"}, {time:0, type:"mb", x:860, y:0, z:640, wtp:"a1"}, {time:0, type:"mb", x:675, y:0, z:700, wtp:"a3"}, {time:0, type:"mb", x:800, y:0, z:1050, wtp:"a1"}, {time:0, type:"mb", x:850, y:0, z:1045, wtp:"a1"}, {time:20000, type:"mb", x:1050, y:0, z:1065, wtp:"a1"}, {time:20000, type:"civK", stype:"CivK1", x:1100, y:0, z:1055, wtp:"a1"}, {time:40000, type:"hdl", stype:"", x:375, y:50, z:650}, {time:40000, type:"hdl", stype:"", x:700, y:50, z:850}, {time:60000, type:"hdl", stype:"", x:375, y:50, z:260}, {time:60000, type:"hdl", stype:"", x:1150, y:50, z:500}, {time:80000, type:"mb", n:"m1", x:860, y:0, z:265, wtp:"a1"}, {time:80000, type:"mb", n:"m2", x:460, y:0, z:650, wtp:"a1"}, {time:80000, type:"hdl", stype:"", host:"m1", x:500, y:50, z:650}, {time:80000, type:"hdl", stype:"", host:"m2", x:500, y:50, z:650}, {time:100000, type:"hdl", stype:"", x:50, y:50, z:700}, {time:120000, type:"mb", x:480, y:0, z:300, wtp:"a3"}, {time:120000, type:"mb", x:500, y:0, z:320, wtp:"a3"}, {time:120000, type:"mb", x:520, y:0, z:620, wtp:"a4"}, {time:120000, type:"civK", stype:"CivK1", x:500, y:0, z:400, wtp:"a1"}, {time:140000, type:"hdl", stype:"", x:1100, y:50, z:650}, {time:160000, type:"mb", n:"m3", x:950, y:0, z:1050, wtp:"a1"}, {time:160000, type:"hdl", stype:"", host:"m3", x:500, y:50, z:650}, {time:180000, type:"hdl", stype:"", host:"c1", x:500, y:50, z:650}, {time:180000, type:"mb", x:400, y:0, z:650, wtp:"a1"}, {time:200000, type:"mb", x:900, y:0, z:660, wtp:"a1"}, {time:200000, type:"mb", x:350, y:0, z:1055, wtp:"a1"}, {time:220000, type:"mb", x:1000, y:0, z:640, wtp:"a1"}, {time:220000, type:"hdl", stype:"", x:670, y:50, z:200}, {time:220000, type:"hdl", stype:"", x:1150, y:50, z:400}, {time:220000, type:"hdl", stype:"", x:675, y:50, z:1060}];
break;
case "5":
pTimeClock_Limit = 30000;
pSpawn_List = [{time:0, type:"civ", stype:"Civ1", n:"c1", x:400, y:0, z:270, wtp:"cv2"}, {time:0, type:"civ", stype:"Civ5", n:"c2", x:800, y:0, z:290, wtp:"cv1"}, {time:0, type:"civ", stype:"Civ4", n:"c3", x:600, y:0, z:310, wtp:"a3"}, {time:0, type:"civ", stype:"Civ6", n:"c4", x:325, y:0, z:670, wtp:"cvlp5"}, {time:0, type:"civ", stype:"Civ2", n:"c5", x:860, y:0, z:670, wtp:"cv2"}, {time:0, type:"civ", stype:"Civ3", n:"c6", x:860, y:0, z:690, wtp:"cv1"}, {time:0, type:"civ", stype:"Civ1", n:"c7", x:400, y:0, z:1050, wtp:"cv2"}, {time:0, type:"civ", stype:"Civ5", n:"c8", x:400, y:0, z:1070, wtp:"cv1"}, {time:0, type:"mb", x:950, y:0, z:670, wtp:"a1"}, {time:0, type:"mb", x:950, y:0, z:1040, wtp:"a1"}, {time:0, type:"mut", x:500, y:0, z:260, wtp:"a1"}, {time:20000, type:"hdl", stype:"", host:"c2", x:500, y:50, z:650}, {time:20000, type:"hdl", stype:"", host:"c4", x:500, y:50, z:650}, {time:20000, type:"hdl", stype:"", host:"c8", x:500, y:50, z:650}, {time:40000, type:"hdl", stype:"", x:860, y:50, z:150}, {time:40000, type:"hdl", stype:"", x:200, y:50, z:1050}, {time:40000, type:"mb", x:300, y:0, z:800, wtp:"a3"}, {time:40000, type:"mb", x:300, y:0, z:1040, wtp:"a2"}, {time:60000, type:"hdl", stype:"", x:150, y:50, z:650}, {time:60000, type:"hdl", stype:"", x:250, y:50, z:250}, {time:60000, type:"mb", x:1100, y:0, z:280, wtp:"a1"}, {time:60000, type:"mb", x:500, y:0, z:290, wtp:"a2"}, {time:80000, type:"mut", n:"mu1", x:800, y:0, z:670, wtp:"a1"}, {time:80000, type:"hdl", stype:"", host:"mu1", x:500, y:50, z:650}, {time:100000, type:"mut", x:550, y:0, z:610, wtp:"a1"}, {time:120000, type:"mb", x:820, y:0, z:150, wtp:"a3"}, {time:120000, type:"mb", x:800, y:0, z:230, wtp:"a2"}, {time:120000, type:"mb", x:900, y:0, z:230, wtp:"a1"}, {time:120000, type:"civK", stype:"CivK1", x:865, y:0, z:200, wtp:"a1"}, {time:140000, type:"hdl", stype:"", host:"c1", x:500, y:50, z:650}, {time:140000, type:"hdl", stype:"", host:"c7", x:500, y:50, z:650}, {time:160000, type:"hdl", stype:"", host:"c3", x:500, y:50, z:650}, {time:160000, type:"hdl", stype:"", host:"c5", x:500, y:50, z:650}, {time:180000, type:"mut", x:500, y:0, z:280, wtp:"a1"}, {time:180000, type:"mut", x:650, y:0, z:280, wtp:"a1"}, {time:200000, type:"mb", x:350, y:0, z:620, wtp:"a1"}, {time:200000, type:"mb", x:750, y:0, z:620, wtp:"a2"}, {time:220000, type:"mb", x:350, y:0, z:650, wtp:"a3"}, {time:220000, type:"hdl", stype:"", x:950, y:50, z:700}];
break;
case "6":
pTimeClock_Limit = 30000;
pSpawn_List = [{time:0, type:"civ", stype:"CivP", n:"cp", x:200, y:0, z:280, wtp:"cvpp"}, {time:0, type:"civ", stype:"Civ1", n:"c1", x:400, y:0, z:270, wtp:"cv2"}, {time:0, type:"civ", stype:"Civ5", n:"c2", x:800, y:0, z:290, wtp:"cv1"}, {time:0, type:"civ", stype:"Civ4", n:"c3", x:600, y:0, z:310, wtp:"a3"}, {time:0, type:"civ", stype:"Civ6", n:"c4", x:325, y:0, z:670, wtp:"cvlp5"}, {time:0, type:"civ", stype:"Civ2", n:"c5", x:860, y:0, z:670, wtp:"cv2"}, {time:0, type:"civ", stype:"Civ3", n:"c6", x:860, y:0, z:690, wtp:"cv1"}, {time:0, type:"civ", stype:"Civ1", n:"c7", x:400, y:0, z:1050, wtp:"cv2"}, {time:0, type:"civ", stype:"Civ5", n:"c8", x:400, y:0, z:1070, wtp:"cv1"}, {time:0, type:"mut", x:500, y:0, z:650, wtp:"a1"}, {time:0, type:"mut", x:600, y:0, z:670, wtp:"a1"}, {time:0, type:"mut", x:700, y:0, z:650, wtp:"a1"}, {time:20000, type:"hdl", stype:"", host:"c2", x:500, y:50, z:650}, {time:20000, type:"hdl", stype:"", host:"c4", x:500, y:50, z:650}, {time:20000, type:"hdl", stype:"", host:"c7", x:500, y:50, z:650}, {time:60000, type:"hdl", stype:"", x:150, y:50, z:1060}, {time:60000, type:"hdl", stype:"", x:1000, y:50, z:1050}, {time:80000, type:"mut", n:"mu1", x:500, y:0, z:1060, wtp:"a1"}, {time:80000, type:"hdl", stype:"", host:"mu1", x:500, y:50, z:650}, {time:100000, type:"mut", n:"mu2", x:800, y:0, z:1060, wtp:"a1"}, {time:100000, type:"hdl", stype:"", host:"mu2", x:500, y:50, z:650}, {time:120000, type:"mut", x:600, y:0, z:650, wtp:"a1"}, {time:120000, type:"mut", x:300, y:0, z:800, wtp:"a1"}, {time:120000, type:"mut", x:900, y:0, z:650, wtp:"a1"}, {time:120000, type:"hdl", stype:"", x:925, y:50, z:280}, {time:220000, type:"hdl", stype:"", x:925, y:50, z:800}, {time:140000, type:"hdl", stype:"", host:"c3", x:500, y:50, z:650}, {time:140000, type:"hdl", stype:"", host:"c4", x:500, y:50, z:650}, {time:160000, type:"hdl", stype:"", host:"c5", x:500, y:50, z:650}, {time:160000, type:"hdl", stype:"", host:"c8", x:500, y:50, z:650}, {time:180000, type:"mut", x:500, y:0, z:630, wtp:"a1"}, {time:180000, type:"mut", x:600, y:0, z:630, wtp:"a1"}, {time:180000, type:"mut", x:700, y:0, z:630, wtp:"a1"}, {time:180000, type:"mut", x:900, y:0, z:630, wtp:"a1"}, {time:200000, type:"mut", x:900, y:0, z:1030, wtp:"a1"}, {time:200000, type:"mut", x:250, y:0, z:630, wtp:"a1"}, {time:220000, type:"hdl", stype:"", x:860, y:50, z:200}, {time:220000, type:"hdl", stype:"", x:950, y:50, z:700}, {time:220000, type:"hdl", stype:"", x:925, y:50, z:800}];
break;
};
}
public function RunTutorial(){
var _local1:Point;
var _local2:Point;
var _local3:TextField;
var _local4:TextFormat;
var _local5:TextField;
var _local6:TextFormat;
var _local7:int;
var _local8:*;
var _local9:*;
var _local10:Array;
var _local11:Array;
var _local12:Number;
var _local13:*;
switch (pTutorialState){
case "HowTo_TakePicture-1":
_local8 = 0;
while (_local8 < pDisplay_Registry_List.length) {
_local9 = pDisplay_Registry_List[_local8];
switch (_local9.pObject_Type){
case "Object":
if (_local9.pObject_MC != null){
if (_local9.pObject_MC.name == "headlineletter"){
_local10 = [_local9.pWorldX, _local9.pWorldY, _local9.pWorldZ];
_local11 = [heroClassRef.pWorldX, heroClassRef.pWorldY, heroClassRef.pWorldZ];
_local12 = DistanceTo(_local10, _local11);
if (_local12 < 200){
gGame_Status = "Tutorial";
pTutorialState = "HowTo_TakePicture-2";
pTutorialTarget_MC = _local9.pObject_MC;
};
};
};
break;
};
_local8++;
};
break;
case "HowTo_TakePicture-2":
_local1 = new Point(pTutorialTarget_MC.x, pTutorialTarget_MC.y);
_local2 = gamemap.localToGlobal(_local1);
pTutorialArrow1_MC = new HintPopupArrowOverlay();
pTutorialArrow1_MC.x = (_local2.x - 80);
pTutorialArrow1_MC.y = _local2.y;
pTutorialArrow1_MC.rotation = 90;
MainObj.stage.addChild(pTutorialArrow1_MC);
pTutorialArrow2_MC = new HintPopupArrowOverlay();
pTutorialArrow2_MC.x = 100;
pTutorialArrow2_MC.y = 400;
pTutorialArrow2_MC.rotation = 220;
MainObj.stage.addChild(pTutorialArrow2_MC);
pTutorialPopup_MC = new HintPopupOverlay();
pTutorialPopup_MC.x = 100;
pTutorialPopup_MC.y = 150;
MainObj.stage.addChild(pTutorialPopup_MC);
_local3 = new TextField();
_local4 = new TextFormat();
pTutorialText1_MC = _local3;
_local3.text = (("Press the SPACE BAR to take a picture." + "\n\n") + "Take pictures of all the letters to complete the Headline.");
_local3.width = 160;
_local3.height = 200;
_local3.x = -82;
_local3.y = -50;
_local3.wordWrap = true;
_local4.font = "Tahoma";
_local4.size = "14";
_local4.align = "left";
_local4.bold = true;
_local3.setTextFormat(_local4);
pTutorialPopup_MC.addChild(_local3);
_local5 = new TextField();
_local6 = new TextFormat();
pTutorialText2_MC = _local5;
_local5.text = "Press SPACE BAR to continue";
_local5.width = 220;
_local5.height = 30;
_local5.x = -82;
_local5.y = 60;
_local5.wordWrap = true;
_local6.font = "Tahoma";
_local6.size = "10";
_local6.align = "left";
_local6.bold = true;
_local5.setTextFormat(_local6);
pTutorialPopup_MC.addChild(_local5);
pTutorialTurnOff_MC = new HintsOffOverlay();
pTutorialTurnOff_MC.x = 0;
pTutorialTurnOff_MC.y = 98;
pTutorialTurnOff_MC.gotoAndStop(1);
pTutorialPopup_MC.addChild(pTutorialTurnOff_MC);
pTutorialTurnOff_MC.addEventListener(MouseEvent.CLICK, TutorialOff);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OVER, TutorialOverButton);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OUT, TutorialOverButton);
pTutorialStartTime = getTimer();
pTutorialState = "HowTo_TakePicture-3";
break;
case "HowTo_TakePicture-3":
_local7 = (getTimer() - pTutorialStartTime);
if (_local7 > 1000){
if (SpaceBar_Down){
MainObj.stage.removeChild(pTutorialPopup_MC);
MainObj.stage.removeChild(pTutorialArrow1_MC);
MainObj.stage.removeChild(pTutorialArrow2_MC);
pTutorialArrow1_MC = null;
pTutorialArrow2_MC = null;
pTutorialPopup_MC = null;
gGame_Status = "Gameplay";
pTutorialState = "HowTo_Fly-1";
};
};
break;
case "HowTo_Fly-1":
if (heroClassRef.pIdentity == "Hero"){
pTutorialTarget_MC = heroClassRef.pCharacter_MC;
gGame_Status = "Tutorial";
pTutorialState = "HowTo_Fly-2";
};
break;
case "HowTo_Fly-2":
_local1 = new Point(pTutorialTarget_MC.x, pTutorialTarget_MC.y);
_local2 = gamemap.localToGlobal(_local1);
pTutorialArrow1_MC = new HintPopupArrowOverlay();
pTutorialArrow1_MC.x = (_local2.x + 80);
pTutorialArrow1_MC.y = _local2.y;
pTutorialArrow1_MC.rotation = -90;
MainObj.stage.addChild(pTutorialArrow1_MC);
pTutorialPopup_MC = new HintPopupOverlay();
pTutorialPopup_MC.x = 100;
pTutorialPopup_MC.y = 150;
MainObj.stage.addChild(pTutorialPopup_MC);
_local3 = new TextField();
_local4 = new TextFormat();
pTutorialText1_MC = _local3;
_local3.text = (("you are now CITY HERO! Protect the city from mobsters!" + "\n\n") + "Press and hold the SPACE BAR to fly!");
_local3.width = 160;
_local3.height = 400;
_local3.x = -82;
_local3.y = -50;
_local3.wordWrap = true;
_local4.font = "Tahoma";
_local4.size = "14";
_local4.align = "left";
_local4.bold = true;
_local3.setTextFormat(_local4);
pTutorialPopup_MC.addChild(_local3);
_local5 = new TextField();
_local6 = new TextFormat();
pTutorialText2_MC = _local5;
_local5.text = "Press SPACE BAR to continue";
_local5.width = 220;
_local5.height = 400;
_local5.x = -82;
_local5.y = 60;
_local5.wordWrap = true;
_local6.font = "Tahoma";
_local6.size = "10";
_local6.align = "left";
_local6.bold = true;
_local5.setTextFormat(_local6);
pTutorialPopup_MC.addChild(_local5);
pTutorialTurnOff_MC = new HintsOffOverlay();
pTutorialTurnOff_MC.x = 0;
pTutorialTurnOff_MC.y = 98;
pTutorialTurnOff_MC.gotoAndStop(1);
pTutorialPopup_MC.addChild(pTutorialTurnOff_MC);
pTutorialTurnOff_MC.addEventListener(MouseEvent.CLICK, TutorialOff);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OVER, TutorialOverButton);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OUT, TutorialOverButton);
pTutorialStartTime = getTimer();
pTutorialState = "HowTo_Fly-3";
break;
case "HowTo_Fly-3":
_local7 = (getTimer() - pTutorialStartTime);
if (_local7 > 1000){
if (SpaceBar_Down){
MainObj.stage.removeChild(pTutorialPopup_MC);
MainObj.stage.removeChild(pTutorialArrow1_MC);
pTutorialArrow1_MC = null;
pTutorialPopup_MC = null;
gGame_Status = "Gameplay";
pTutorialState = "HowTo_Punch-1";
};
};
break;
case "HowTo_Punch-1":
_local8 = 0;
while (_local8 < pNPC_Registry_List.length) {
_local13 = pNPC_Registry_List[_local8];
switch (_local13.pNPCType){
case "Mobster":
if (_local13.pCharacter_MC != null){
_local10 = [_local13.pWorldX, _local13.pWorldY, _local13.pWorldZ];
_local11 = [heroClassRef.pWorldX, heroClassRef.pWorldY, heroClassRef.pWorldZ];
_local12 = DistanceTo(_local10, _local11);
_local1 = new Point(_local13.pCharacter_MC.x, _local13.pCharacter_MC.y);
_local2 = gamemap.localToGlobal(_local1);
if ((((((_local2.y > 200)) && ((_local2.y < 380)))) && ((_local2.x > 225)))){
if ((((_local12 < 200)) && ((heroClassRef.pWorldY == 0)))){
gGame_Status = "Tutorial";
pTutorialState = "HowTo_Punch-2";
pTutorialTarget_MC = _local13.pCharacter_MC;
};
};
};
break;
};
_local8++;
};
break;
case "HowTo_Punch-2":
_local1 = new Point(pTutorialTarget_MC.x, pTutorialTarget_MC.y);
_local2 = gamemap.localToGlobal(_local1);
pTutorialArrow1_MC = new HintPopupArrowOverlay();
pTutorialArrow1_MC.x = _local2.x;
pTutorialArrow1_MC.y = (_local2.y - 100);
pTutorialArrow1_MC.rotation = 180;
MainObj.stage.addChild(pTutorialArrow1_MC);
pTutorialPopup_MC = new HintPopupOverlay();
pTutorialPopup_MC.x = 100;
pTutorialPopup_MC.y = 150;
MainObj.stage.addChild(pTutorialPopup_MC);
_local3 = new TextField();
_local4 = new TextFormat();
pTutorialText1_MC = _local3;
_local3.text = "Press \"F\" or any letter key to PUNCH!";
_local3.width = 160;
_local3.height = 400;
_local3.x = -82;
_local3.y = -30;
_local3.wordWrap = true;
_local4.font = "Tahoma";
_local4.size = "14";
_local4.align = "left";
_local4.bold = true;
_local3.setTextFormat(_local4);
pTutorialPopup_MC.addChild(_local3);
_local5 = new TextField();
_local6 = new TextFormat();
pTutorialText2_MC = _local5;
_local5.text = "Press \"F\" to continue";
_local5.width = 220;
_local5.height = 400;
_local5.x = -67;
_local5.y = 60;
_local5.wordWrap = true;
_local6.font = "Tahoma";
_local6.size = "10";
_local6.align = "left";
_local6.bold = true;
_local5.setTextFormat(_local6);
pTutorialPopup_MC.addChild(_local5);
pTutorialTurnOff_MC = new HintsOffOverlay();
pTutorialTurnOff_MC.x = 0;
pTutorialTurnOff_MC.y = 98;
pTutorialTurnOff_MC.gotoAndStop(1);
pTutorialPopup_MC.addChild(pTutorialTurnOff_MC);
pTutorialTurnOff_MC.addEventListener(MouseEvent.CLICK, TutorialOff);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OVER, TutorialOverButton);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OUT, TutorialOverButton);
pTutorialStartTime = getTimer();
pTutorialState = "HowTo_Punch-3";
break;
case "HowTo_Punch-3":
_local7 = (getTimer() - pTutorialStartTime);
if (_local7 > 1000){
if (Attack_KeyDown){
MainObj.stage.removeChild(pTutorialPopup_MC);
MainObj.stage.removeChild(pTutorialArrow1_MC);
pTutorialArrow1_MC = null;
pTutorialPopup_MC = null;
gGame_Status = "Gameplay";
pTutorialState = "HowTo_ProsperityMeter-1";
pTutorialStartTime = getTimer();
};
};
break;
case "HowTo_ProsperityMeter-1":
_local7 = (getTimer() - pTutorialStartTime);
if (_local7 > 5000){
gGame_Status = "Tutorial";
pTutorialState = "HowTo_ProsperityMeter-2";
};
break;
case "HowTo_ProsperityMeter-2":
pTutorialArrow1_MC = new HintPopupArrowOverlay();
pTutorialArrow1_MC.x = 540;
pTutorialArrow1_MC.y = 200;
pTutorialArrow1_MC.rotation = 90;
MainObj.stage.addChild(pTutorialArrow1_MC);
pTutorialPopup_MC = new HintPopupOverlay();
pTutorialPopup_MC.x = 100;
pTutorialPopup_MC.y = 150;
MainObj.stage.addChild(pTutorialPopup_MC);
_local3 = new TextField();
_local4 = new TextFormat();
pTutorialText1_MC = _local3;
_local3.text = "This shows the level of Prosperity in the city. There must be enough GOOD in the city to advance to the next level.";
_local3.width = 160;
_local3.height = 400;
_local3.x = -82;
_local3.y = -50;
_local3.wordWrap = true;
_local4.font = "Tahoma";
_local4.size = "14";
_local4.align = "left";
_local4.bold = true;
_local3.setTextFormat(_local4);
pTutorialPopup_MC.addChild(_local3);
_local5 = new TextField();
_local6 = new TextFormat();
pTutorialText2_MC = _local5;
_local5.text = "Press SPACE BAR to continue";
_local5.width = 220;
_local5.height = 400;
_local5.x = -82;
_local5.y = 60;
_local5.wordWrap = true;
_local6.font = "Tahoma";
_local6.size = "10";
_local6.align = "left";
_local6.bold = true;
_local5.setTextFormat(_local6);
pTutorialPopup_MC.addChild(_local5);
pTutorialTurnOff_MC = new HintsOffOverlay();
pTutorialTurnOff_MC.x = 0;
pTutorialTurnOff_MC.y = 98;
pTutorialTurnOff_MC.gotoAndStop(1);
pTutorialPopup_MC.addChild(pTutorialTurnOff_MC);
pTutorialTurnOff_MC.addEventListener(MouseEvent.CLICK, TutorialOff);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OVER, TutorialOverButton);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OUT, TutorialOverButton);
pTutorialStartTime = getTimer();
pTutorialState = "HowTo_ProsperityMeter-3";
break;
case "HowTo_ProsperityMeter-3":
_local7 = (getTimer() - pTutorialStartTime);
if (_local7 > 1000){
if (SpaceBar_Down){
MainObj.stage.removeChild(pTutorialPopup_MC);
MainObj.stage.removeChild(pTutorialArrow1_MC);
pTutorialArrow1_MC = null;
pTutorialPopup_MC = null;
pTutorialStartTime = getTimer();
gGame_Status = "Gameplay";
pTutorialState = "HowTo_Identity_Descrease-1";
};
};
break;
case "HowTo_Identity_Descrease-1":
_local7 = (getTimer() - pTutorialStartTime);
if (_local7 > 5000){
if (pSecretIdentityBar < 95){
gGame_Status = "Tutorial";
pTutorialState = "HowTo_Identity_Descrease-2";
};
};
break;
case "HowTo_Identity_Descrease-2":
pTutorialArrow1_MC = new HintPopupArrowOverlay();
pTutorialArrow1_MC.x = 320;
pTutorialArrow1_MC.y = 80;
pTutorialArrow1_MC.rotation = 0;
MainObj.stage.addChild(pTutorialArrow1_MC);
pTutorialPopup_MC = new HintPopupOverlay();
pTutorialPopup_MC.x = 100;
pTutorialPopup_MC.y = 150;
MainObj.stage.addChild(pTutorialPopup_MC);
_local3 = new TextField();
_local4 = new TextFormat();
pTutorialText1_MC = _local3;
_local3.text = "Cheering citizens increases the GOOD in the city. But it also decreases your SECRET IDENTITY! So don't bask in the glory too long!";
_local3.width = 160;
_local3.height = 400;
_local3.x = -82;
_local3.y = -50;
_local3.wordWrap = true;
_local4.font = "Tahoma";
_local4.size = "12";
_local4.align = "left";
_local4.bold = true;
_local3.setTextFormat(_local4);
pTutorialPopup_MC.addChild(_local3);
_local5 = new TextField();
_local6 = new TextFormat();
pTutorialText2_MC = _local5;
_local5.text = "Press SPACE BAR to continue";
_local5.width = 220;
_local5.height = 400;
_local5.x = -82;
_local5.y = 60;
_local5.wordWrap = true;
_local6.font = "Tahoma";
_local6.size = "10";
_local6.align = "left";
_local6.bold = true;
_local5.setTextFormat(_local6);
pTutorialPopup_MC.addChild(_local5);
pTutorialTurnOff_MC = new HintsOffOverlay();
pTutorialTurnOff_MC.x = 0;
pTutorialTurnOff_MC.y = 98;
pTutorialTurnOff_MC.gotoAndStop(1);
pTutorialPopup_MC.addChild(pTutorialTurnOff_MC);
pTutorialTurnOff_MC.addEventListener(MouseEvent.CLICK, TutorialOff);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OVER, TutorialOverButton);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OUT, TutorialOverButton);
pTutorialStartTime = getTimer();
pTutorialState = "HowTo_Identity_Descrease-3";
break;
case "HowTo_Identity_Descrease-3":
_local7 = (getTimer() - pTutorialStartTime);
if (_local7 > 1000){
if (SpaceBar_Down){
MainObj.stage.removeChild(pTutorialPopup_MC);
MainObj.stage.removeChild(pTutorialArrow1_MC);
pTutorialArrow1_MC = null;
pTutorialPopup_MC = null;
pTutorialStartTime = getTimer();
gGame_Status = "Gameplay";
pTutorialState = "HowTo_Identity_Increase-1";
};
};
break;
case "HowTo_Identity_Increase-1":
_local7 = (getTimer() - pTutorialStartTime);
if ((((((_local7 > 5000)) && ((heroClassRef.pIdentity == "Nerd")))) && ((heroClassRef.pCharacter_MC.alpha == 1)))){
gGame_Status = "Tutorial";
pTutorialState = "HowTo_Identity_Increase-2";
};
break;
case "HowTo_Identity_Increase-2":
pTutorialArrow1_MC = new HintPopupArrowOverlay();
pTutorialArrow1_MC.x = 320;
pTutorialArrow1_MC.y = 80;
pTutorialArrow1_MC.rotation = 0;
MainObj.stage.addChild(pTutorialArrow1_MC);
pTutorialPopup_MC = new HintPopupOverlay();
pTutorialPopup_MC.x = 100;
pTutorialPopup_MC.y = 150;
MainObj.stage.addChild(pTutorialPopup_MC);
_local3 = new TextField();
_local4 = new TextFormat();
pTutorialText1_MC = _local3;
_local3.text = "When you are your Milton Gray alter-ego, your SECRET IDENTITY will steadily RECOVER.\n\nAlso don't forget to take pictures!";
_local3.width = 160;
_local3.height = 400;
_local3.x = -82;
_local3.y = -50;
_local3.wordWrap = true;
_local4.font = "Tahoma";
_local4.size = "12";
_local4.align = "left";
_local4.bold = true;
_local3.setTextFormat(_local4);
pTutorialPopup_MC.addChild(_local3);
_local5 = new TextField();
_local6 = new TextFormat();
pTutorialText2_MC = _local5;
_local5.text = "Press SPACE BAR to continue";
_local5.width = 220;
_local5.height = 400;
_local5.x = -82;
_local5.y = 60;
_local5.wordWrap = true;
_local6.font = "Tahoma";
_local6.size = "10";
_local6.align = "left";
_local6.bold = true;
_local5.setTextFormat(_local6);
pTutorialPopup_MC.addChild(_local5);
pTutorialTurnOff_MC = new HintsOffOverlay();
pTutorialTurnOff_MC.x = 0;
pTutorialTurnOff_MC.y = 98;
pTutorialTurnOff_MC.gotoAndStop(1);
pTutorialPopup_MC.addChild(pTutorialTurnOff_MC);
pTutorialTurnOff_MC.addEventListener(MouseEvent.CLICK, TutorialOff);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OVER, TutorialOverButton);
pTutorialTurnOff_MC.addEventListener(MouseEvent.MOUSE_OUT, TutorialOverButton);
pTutorialStartTime = getTimer();
pTutorialState = "HowTo_Identity_Increase-3";
break;
case "HowTo_Identity_Increase-3":
_local7 = (getTimer() - pTutorialStartTime);
if (_local7 > 1000){
if (SpaceBar_Down){
MainObj.stage.removeChild(pTutorialPopup_MC);
MainObj.stage.removeChild(pTutorialArrow1_MC);
pTutorialArrow1_MC = null;
pTutorialPopup_MC = null;
pTutorialStartTime = getTimer();
gGame_Status = "Gameplay";
pTutorialState = "Done-1";
};
};
break;
};
}
private function sitelock(_arg1){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local2 = MainObj.stage.loaderInfo;
_local3 = true;
_local4 = _local2.url.split("://");
_local5 = _local4[1].split("/");
for (_local6 in _arg1) {
if (_arg1[_local6] == _local5[0]){
_local3 = false;
};
};
if (_local3){
};
return (_local3);
}
function open_SocioTownPage(_arg1:MouseEvent){
if (ExternalInterface.available){
ExternalInterface.call("window.open", "http://www.sociotown.com", "win");
};
}
public function RemoveTimeClock(){
MainObj.stage.removeChild(pTimeClock_MC);
pTimeClock_MC = null;
}
public function TutorialOff(_arg1:MouseEvent){
pTutorialStatus = false;
if (pTutorialPopup_MC != null){
pTutorialPopup_MC.removeChild(pTutorialTurnOff_MC);
MainObj.stage.removeChild(pTutorialPopup_MC);
pTutorialPopup_MC = null;
};
if (pTutorialArrow1_MC != null){
MainObj.stage.removeChild(pTutorialArrow1_MC);
pTutorialArrow1_MC = null;
};
if (pTutorialArrow2_MC != null){
MainObj.stage.removeChild(pTutorialArrow2_MC);
pTutorialArrow2_MC = null;
};
pTutorialTurnOff_MC.removeEventListener(MouseEvent.CLICK, TutorialOff);
pTutorialState = "Off";
gGame_Status = "Gameplay";
return (true);
}
public function SkipCinematic(_arg1:MouseEvent){
var _local2:*;
_local2 = _arg1.currentTarget;
switch (_local2.name){
case "skip_button":
pConversation_State = "exit";
break;
case "BradfortChatbubble":
case "MiltonChatbubble":
pConversation_State = "2";
break;
};
}
public function RemoveProsperityMeter(){
MainObj.stage.removeChild(pProsperityMeterMC);
pProsperityMeterMC = null;
MainObj.stage.removeChild(pProsperityGoalineMC);
pProsperityGoalineMC = null;
MainObj.stage.removeChild(pProsperityIndicator_MC);
pProsperityIndicator_MC = null;
}
function loading(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:*;
var _local6:int;
var _local7:Number;
var _local8:int;
pLoaderInitialized = true;
MainObj.loader_bg.addEventListener(MouseEvent.CLICK, open_SocioTownPage);
MainObj.loader_bg.buttonMode = true;
_local2 = MainObj.stage.loaderInfo.bytesTotal;
_local3 = MainObj.stage.loaderInfo.bytesLoaded;
_local4 = (_local3 / _local2);
MainObj.loader_bar.alpha = 0.6;
_local5 = MainObj.loader_bar;
_local6 = (360 * _local4);
_local7 = _local6;
if (_local5.width <= _local7){
_local5.width = (_local5.width + Translate_Increment(3, 50, 30));
if (_local5.width > (_local7 - 0.35)){
_local5.width = _local7;
};
} else {
_local5.width = _local7;
};
_local8 = (getTimer() - pStartTime);
if ((((_local2 == _local3)) && ((_local5.width == _local7)))){
pFrontend_Status = "PreTitleScreen";
MainObj.loader_bg.removeEventListener(MouseEvent.CLICK, open_SocioTownPage);
MainObj.gotoAndStop("title_screen");
MainObj.removeEventListener(Event.ENTER_FRAME, loading);
};
}
public function TutorialOverButton(_arg1:MouseEvent){
switch (_arg1.type){
case "mouseOver":
pTutorialTurnOff_MC.gotoAndStop(2);
break;
case "mouseOut":
pTutorialTurnOff_MC.gotoAndStop(1);
break;
};
}
public function keyUpFunction(_arg1:KeyboardEvent){
if (_arg1.keyCode == 37){
arrowLeft = false;
} else {
if (_arg1.keyCode == 39){
arrowRight = false;
} else {
if (_arg1.keyCode == 38){
arrowUp = false;
} else {
if (_arg1.keyCode == 40){
arrowDown = false;
} else {
if ((((_arg1.keyCode >= 65)) && ((_arg1.keyCode <= 90)))){
Attack_KeyDown = false;
} else {
if (_arg1.keyCode == 32){
SpaceBar_Down = false;
};
};
};
};
};
};
}
public function RemoveSecretIdentityBar(){
MainObj.stage.removeChild(pSecretIdentityBackFrameMC);
pSecretIdentityBackFrameMC = null;
MainObj.stage.removeChild(pSecretIdentityBar_MC);
pSecretIdentityBar_MC = null;
MainObj.stage.removeChild(pSecretIdentityFrameMC);
pSecretIdentityFrameMC = null;
}
public function StartGame(_arg1:MouseEvent){
var _local2:*;
switch (_arg1.type){
case "mouseOver":
_local2 = _arg1.currentTarget;
_local2.alpha = 1;
break;
case "mouseOut":
_local2 = _arg1.currentTarget;
_local2.alpha = 0.75;
break;
case "click":
_local2 = _arg1.currentTarget;
switch (_local2.name){
case "play_button":
pFrontend_Status = "Cinematic";
pCinematic_State = "PreSetup";
break;
case "credits_button":
MainObj.gotoAndStop("credits");
pFrontend_Status = "PreCredits";
break;
case "credits_back_button":
MainObj.gotoAndStop("title_screen");
pFrontend_Status = "PreTitleScreen";
break;
};
break;
};
}
public function EndGame(){
var _local1:TimeUpOverlay;
var _local2:BlurFilter;
var _local3:Array;
var _local4:BlurFilter;
var _local5:Number;
var _local6:String;
var _local7:MovieClip;
var _local8:int;
var _local9:*;
var _local10:Number;
var _local11:*;
var _local12:*;
var _local13:Boolean;
switch (pEndGame_Mode){
case "TimeUp":
switch (pEndGame_State){
case "1":
_local1 = new TimeUpOverlay();
_local1.x = 320;
_local1.y = 180;
MainObj.stage.addChild(_local1);
pTimeUpOverlay_MC = _local1;
_local2 = new BlurFilter();
_local2.blurX = 100;
_local2.blurY = 100;
pTimeUpOverlay_MC.filters = [_local2];
pTotalTranquility = true;
_local11 = 0;
while (_local11 < pNPC_Registry_List.length) {
_local12 = pNPC_Registry_List[_local11];
switch (_local12.pNPCType){
case "Mobster":
case "Mutant":
pTotalTranquility = false;
break;
};
_local11++;
};
pEndGame_State = "2";
break;
case "2":
_local3 = pTimeUpOverlay_MC.filters;
_local4 = _local3[0];
_local5 = _local4.blurX;
_local5 = (_local5 - Translate_Increment(5, 50, 30));
if (_local5 < 1){
_local5 = 1;
};
_local4.blurX = _local5;
_local4.blurY = _local5;
pTimeUpOverlay_MC.filters = [_local4];
if (_local5 == 1){
pEndGame_State = "3";
};
break;
case "3":
if (pProsperity_Points >= pProsperity_Goal){
_local6 = "good_prevailed";
} else {
_local6 = "evil_prevailed";
};
if (_local6 == "good_prevailed"){
_local13 = CheckHeadlineComplete();
if (_local13 == false){
_local6 = "headline_incomplete";
pEndGame_StartTime = getTimer();
};
};
pEndGame_State = _local6;
break;
case "good_prevailed":
pGoodPrevailedOverlay_MC = new GoodPrevailedOverlay();
pGoodPrevailedOverlay_MC.x = 320;
pGoodPrevailedOverlay_MC.y = 240;
MainObj.stage.addChild(pGoodPrevailedOverlay_MC);
_local2 = new BlurFilter();
_local2.blurX = 100;
_local2.blurY = 100;
pGoodPrevailedOverlay_MC.filters = [_local2];
pEndGame_State = "good_prevailed-2";
break;
case "good_prevailed-2":
_local7 = pGoodPrevailedOverlay_MC;
_local3 = _local7.filters;
_local4 = _local3[0];
_local5 = _local4.blurX;
_local5 = (_local5 - Translate_Increment(10, 50, 30));
if (_local5 < 1){
_local5 = 1;
};
_local4.blurX = _local5;
_local4.blurY = _local5;
_local7.filters = [_local4];
if (_local5 == 1){
pEndGame_State = "good_prevailed-3";
pEndGame_StartTime = getTimer();
};
break;
case "good_prevailed-3":
_local8 = (getTimer() - pEndGame_StartTime);
if (_local8 > 2500){
pEndGame_State = "FadeOut-Quit-1";
};
break;
case "evil_prevailed":
pEvilPrevailedOverlay_MC = new EvilPrevailedOverlay();
pEvilPrevailedOverlay_MC.x = 320;
pEvilPrevailedOverlay_MC.y = 240;
MainObj.stage.addChild(pEvilPrevailedOverlay_MC);
_local2 = new BlurFilter();
_local2.blurX = 100;
_local2.blurY = 100;
pEvilPrevailedOverlay_MC.filters = [_local2];
pEndGame_State = "evil_prevailed-2";
break;
case "evil_prevailed-2":
_local7 = pEvilPrevailedOverlay_MC;
_local3 = _local7.filters;
_local4 = _local3[0];
_local5 = _local4.blurX;
_local5 = (_local5 - Translate_Increment(10, 50, 30));
if (_local5 < 1){
_local5 = 1;
};
_local4.blurX = _local5;
_local4.blurY = _local5;
_local7.filters = [_local4];
if (_local5 == 1){
pEndGame_State = "game_over";
pEndGame_StartTime = getTimer();
};
break;
case "headline_incomplete":
_local8 = (getTimer() - pEndGame_StartTime);
if (_local8 > 1500){
MainObj.stage.removeChild(pTimeUpOverlay_MC);
pTimeUpOverlay_MC = null;
pNoHeadlineOverlay_MC = new FailedHeadlineOverlay();
pNoHeadlineOverlay_MC.x = 320;
pNoHeadlineOverlay_MC.y = 180;
MainObj.stage.addChild(pNoHeadlineOverlay_MC);
_local2 = new BlurFilter();
_local2.blurX = 100;
_local2.blurY = 100;
pNoHeadlineOverlay_MC.filters = [_local2];
pEndGame_State = "headline_incomplete-2";
};
break;
case "headline_incomplete-2":
_local7 = pNoHeadlineOverlay_MC;
_local3 = _local7.filters;
_local4 = _local3[0];
_local5 = _local4.blurX;
_local5 = (_local5 - Translate_Increment(10, 50, 30));
if (_local5 < 1){
_local5 = 1;
};
_local4.blurX = _local5;
_local4.blurY = _local5;
_local7.filters = [_local4];
if (_local5 == 1){
pEndGame_State = "game_over";
pEndGame_StartTime = getTimer();
};
break;
case "identity_revealed":
pIdentityRevealedOverlay_MC = new IdentityRevealedOverlay();
pIdentityRevealedOverlay_MC.x = 320;
pIdentityRevealedOverlay_MC.y = 180;
MainObj.stage.addChild(pIdentityRevealedOverlay_MC);
_local2 = new BlurFilter();
_local2.blurX = 100;
_local2.blurY = 100;
pIdentityRevealedOverlay_MC.filters = [_local2];
pEndGame_State = "identity_revealed-2";
break;
case "identity_revealed-2":
_local7 = pIdentityRevealedOverlay_MC;
_local3 = _local7.filters;
_local4 = _local3[0];
_local5 = _local4.blurX;
_local5 = (_local5 - Translate_Increment(10, 50, 30));
if (_local5 < 1){
_local5 = 1;
};
_local4.blurX = _local5;
_local4.blurY = _local5;
_local7.filters = [_local4];
if (_local5 == 1){
pEndGame_State = "game_over";
pEndGame_StartTime = getTimer();
};
break;
case "game_over":
_local8 = (getTimer() - pEndGame_StartTime);
if (_local8 > 1500){
if (pTimeUpOverlay_MC != null){
MainObj.stage.removeChild(pTimeUpOverlay_MC);
pTimeUpOverlay_MC = null;
};
if (pEvilPrevailedOverlay_MC != null){
MainObj.stage.removeChild(pEvilPrevailedOverlay_MC);
pEvilPrevailedOverlay_MC = null;
};
if (pIdentityRevealedOverlay_MC != null){
MainObj.stage.removeChild(pIdentityRevealedOverlay_MC);
pIdentityRevealedOverlay_MC = null;
};
if (pNoHeadlineOverlay_MC != null){
MainObj.stage.removeChild(pNoHeadlineOverlay_MC);
pNoHeadlineOverlay_MC = null;
};
pGameOverOverlay_MC = new GameOverOverlay();
pGameOverOverlay_MC.x = 320;
pGameOverOverlay_MC.y = 240;
MainObj.stage.addChild(pGameOverOverlay_MC);
_local2 = new BlurFilter();
_local2.blurX = 100;
_local2.blurY = 100;
pGameOverOverlay_MC.filters = [_local2];
pEndGame_State = "game_over-2";
};
break;
case "game_over-2":
_local7 = pGameOverOverlay_MC;
_local3 = _local7.filters;
_local4 = _local3[0];
_local5 = _local4.blurX;
_local5 = (_local5 - Translate_Increment(10, 50, 30));
if (_local5 < 1){
_local5 = 1;
};
_local4.blurX = _local5;
_local4.blurY = _local5;
_local7.filters = [_local4];
if (_local5 == 1){
pEndGame_State = "continue-1";
pEndGame_StartTime = getTimer();
};
break;
case "continue-1":
_local8 = (getTimer() - pEndGame_StartTime);
if (_local8 > 1500){
pContinueOverlay_MC = new ContinueOverlay();
pContinueOverlay_MC.x = 200;
pContinueOverlay_MC.y = 280;
MainObj.stage.addChild(pContinueOverlay_MC);
pContinueYesOverlay_MC = new ContinueYesOverlay();
pContinueYesOverlay_MC.name = "continue_yes";
pContinueYesOverlay_MC.x = 250;
pContinueYesOverlay_MC.y = 350;
pContinueYesOverlay_MC.alpha = 0.7;
pContinueYesOverlay_MC.addEventListener(MouseEvent.CLICK, GeneralButtonBehavior);
pContinueYesOverlay_MC.addEventListener(MouseEvent.MOUSE_OVER, GeneralButtonBehavior);
pContinueYesOverlay_MC.addEventListener(MouseEvent.MOUSE_OUT, GeneralButtonBehavior);
MainObj.stage.addChild(pContinueYesOverlay_MC);
pContinueNoOverlay_MC = new ContinueNoOverlay();
pContinueNoOverlay_MC.name = "continue_no";
pContinueNoOverlay_MC.x = 350;
pContinueNoOverlay_MC.y = 350;
pContinueNoOverlay_MC.alpha = 0.7;
pContinueNoOverlay_MC.addEventListener(MouseEvent.CLICK, GeneralButtonBehavior);
pContinueNoOverlay_MC.addEventListener(MouseEvent.MOUSE_OVER, GeneralButtonBehavior);
pContinueNoOverlay_MC.addEventListener(MouseEvent.MOUSE_OUT, GeneralButtonBehavior);
MainObj.stage.addChild(pContinueNoOverlay_MC);
pEndGame_State = "continue-2";
};
break;
case "FadeOut-Quit-1":
case "FadeOut-Restart-1":
RemoveTimeClock();
RemoveSecretIdentityBar();
RemoveProsperityMeter();
RemoveHeadlineOverlay();
if (pTimeUpOverlay_MC != null){
MainObj.stage.removeChild(pTimeUpOverlay_MC);
pTimeUpOverlay_MC = null;
};
if (pGoodPrevailedOverlay_MC != null){
MainObj.stage.removeChild(pGoodPrevailedOverlay_MC);
pGoodPrevailedOverlay_MC = null;
};
if (pGameOverOverlay_MC != null){
MainObj.stage.removeChild(pGameOverOverlay_MC);
pGameOverOverlay_MC = null;
};
if (pContinueOverlay_MC != null){
MainObj.stage.removeChild(pContinueOverlay_MC);
pContinueOverlay_MC = null;
};
if (pContinueYesOverlay_MC != null){
MainObj.stage.removeChild(pContinueYesOverlay_MC);
pContinueYesOverlay_MC = null;
};
if (pContinueNoOverlay_MC != null){
MainObj.stage.removeChild(pContinueNoOverlay_MC);
pContinueNoOverlay_MC = null;
};
if (pEndGame_State != "FadeOut-Restart-1"){
pEndGame_State = "FadeOut-Quit-2";
} else {
pEndGame_State = "FadeOut-Restart-2";
};
break;
case "FadeOut-Quit-2":
case "FadeOut-Restart-2":
_local9 = MainObj.black_screen;
_local9.parent.numChildren;
_local9.x = 0;
_local10 = _local9.alpha;
_local10 = (_local10 + Translate_Increment(0.05, 50, 30));
if (_local10 > 1){
_local10 = 1;
};
_local9.alpha = _local10;
if (_local10 == 1){
gGame_Status = "CleanUp";
if (pEndGame_State != "FadeOut-Restart-2"){
pCleanUpState = "4";
} else {
pCleanUpState = "1";
};
};
break;
};
break;
};
}
public function SetupTimeClock(){
var _local1:TimeClock;
_local1 = new TimeClock();
_local1.x = 540;
_local1.y = 40;
_local1.gotoAndStop(1);
MainObj.stage.addChild(_local1);
pTimeClock_MC = _local1;
pTimeClock_Timer = getTimer();
}
function DistanceTo(_arg1:Array, _arg2:Array){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local3 = _arg1[0];
_local4 = _arg1[1];
_local5 = _arg1[2];
_local6 = _arg2[0];
_local7 = _arg2[1];
_local8 = _arg2[2];
_local9 = (_local3 - _local6);
_local10 = (_local4 - _local7);
_local11 = (_local5 - _local8);
_local12 = Math.sqrt((((_local9 * _local9) + (_local10 * _local10)) + (_local11 * _local11)));
return (_local12);
}
public function HeadlineUnShown(_arg1:String){
var _local2:*;
var _local3:Object;
_local2 = 0;
while (_local2 < pHeadline_List.length) {
_local3 = pHeadline_List[_local2];
if ((((_local3.letter == _arg1)) && ((_local3.shown == true)))){
_local3.shown = false;
return;
};
_local2++;
};
}
public function RunCinematicConversation(){
var _local1:SharedObject;
var _local2:*;
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
var _local6:*;
var _local7:*;
var _local8:int;
var _local9:int;
switch (pConversation_State){
case "1":
_local1 = SharedObject.getLocal("CitySuperheroSave");
_local1.data.pTotalScore = pTotalScore;
_local1.data.pCurrentLevel = pCurrentLevel;
_local1.flush();
switch (pCurrentLevel){
case "7":
pConversation_List = [{B:39, d:2500}, {M:21, d:3500}, {B:40, d:2500}, {B:41, d:3500}, {B:42, d:3500}, {M:22, d:2500}, {B:43, d:3500}, {B:44, d:3500}, {B:45, d:3500}, {M:23, d:2500}, {B:46, d:3500}, {M:24, d:3500}, {B:47, d:2500}];
break;
case "6":
pConversation_List = [{B:32, d:3500}, {B:33, d:3500}, {B:34, d:3500}, {M:19, d:2500}, {B:48, d:3500}, {B:35, d:3500}, {M:20, d:3500}, {B:36, d:3500}, {B:37, d:3500}, {B:38, d:2500}];
break;
case "5":
pConversation_List = [{M:12, d:3500}, {M:13, d:3500}, {B:25, d:2500}, {M:14, d:2500}, {B:25, d:2500}, {M:15, d:2500}, {B:26, d:2500}, {M:16, d:2500}, {B:27, d:3500}, {M:18, d:2500}, {B:28, d:2500}, {M:17, d:3500}, {B:29, d:2500}, {B:30, d:3500}, {B:31, d:3500}];
break;
case "4":
pConversation_List = [{B:19, d:3500}, {M:8, d:2500}, {M:9, d:3500}, {M:10, d:3500}, {B:20, d:2500}, {B:21, d:2500}, {B:22, d:3500}, {B:23, d:3500}, {M:11, d:2500}, {B:24, d:3500}];
break;
case "3":
pConversation_List = [{B:12, d:3500}, {B:13, d:3500}, {M:6, d:2500}, {B:14, d:3500}, {B:15, d:3500}, {B:16, d:3500}, {B:17, d:3500}, {B:18, d:3500}, {M:7, d:2500}];
break;
case "2":
pConversation_List = [{M:3, d:3500}, {M:4, d:3500}, {B:6, d:3500}, {B:7, d:3500}, {B:8, d:3500}, {B:9, d:3500}, {B:10, d:3500}, {M:5, d:2500}, {B:11, d:3500}];
break;
case "1":
pConversation_List = [{B:1}, {M:1}, {B:2, d:3500}, {B:3, d:3500}, {B:4, d:3500}, {B:5, d:3500}, {M:1}];
break;
};
if (pMusicFirstPlayed == true){
pChannel1.stop();
};
pChannel1 = NerdMusicBG_Snd.play();
pMusicFirstPlayed = true;
_local2 = MainObj.skip_button;
_local2.addEventListener(MouseEvent.CLICK, SkipCinematic);
MainObj.BradfortChatbubble.addEventListener(MouseEvent.CLICK, SkipCinematic);
MainObj.MiltonChatbubble.addEventListener(MouseEvent.CLICK, SkipCinematic);
pConversation_State = "2";
pConversation_StartTime = getTimer();
break;
case "2":
_local3 = false;
_local4 = false;
pConversation_State = "2-1";
if (pConversation_List.length > 0){
_local6 = 0;
while (_local6 < pConversation_List.length) {
_local7 = pConversation_List[_local6];
if (_local7["d"] != null){
pConversation_TimeLimt = _local7["d"];
} else {
pConversation_TimeLimt = 2500;
};
if (_local7["B"] != null){
_local8 = _local7["B"];
_local3 = true;
pConversation_List.splice(_local6, 1);
break;
};
if (_local7["M"] != null){
_local9 = _local7["M"];
_local4 = true;
pConversation_List.splice(_local6, 1);
break;
};
_local6++;
};
} else {
pConversation_State = "exit";
};
if (_local3 == true){
MainObj.BradfortChatbubble.alpha = 1;
MainObj.BradfortChatbubble.gotoAndStop(1);
MainObj.Bradfort.gotoAndPlay(1);
MainObj.BradfortText.alpha = 1;
MainObj.BradfortText.gotoAndStop(_local8);
} else {
MainObj.BradfortChatbubble.alpha = 0;
MainObj.BradfortChatbubble.gotoAndStop(1);
MainObj.Bradfort.gotoAndStop(1);
MainObj.BradfortText.alpha = 0;
MainObj.BradfortText.gotoAndStop(1);
};
if (_local4 == true){
MainObj.MiltonChatbubble.alpha = 1;
MainObj.MiltonChatbubble.gotoAndStop(2);
MainObj.Milton.gotoAndPlay(1);
MainObj.MiltonText.alpha = 1;
MainObj.MiltonText.gotoAndStop(_local9);
} else {
MainObj.MiltonChatbubble.alpha = 0;
MainObj.MiltonChatbubble.gotoAndStop(1);
MainObj.Milton.gotoAndStop(1);
MainObj.MiltonText.alpha = 0;
MainObj.MiltonText.gotoAndStop(1);
};
pConversation_StartTime = getTimer();
break;
case "2-1":
_local5 = (getTimer() - pConversation_StartTime);
if (_local5 > pConversation_TimeLimt){
pConversation_State = "2";
};
break;
case "exit":
MainObj.BradfortChatbubble.alpha = 0;
MainObj.MiltonChatbubble.alpha = 0;
MainObj.Bradfort.gotoAndStop(1);
MainObj.Milton.gotoAndStop(1);
MainObj.BradfortText.alpha = 0;
MainObj.MiltonText.alpha = 0;
MainObj.BradfortText.gotoAndStop(1);
MainObj.MiltonText.gotoAndStop(1);
pConversation_State = "exit-1";
pConversation_StartTime = getTimer();
break;
case "exit-1":
_local5 = (getTimer() - pConversation_StartTime);
if (_local5 > 1000){
pCinematic_State = "FadeOut";
};
break;
};
}
public function GameUpdate(_arg1:Event){
switch (gGame_Status){
case "Frontend":
Frontend();
break;
case "Gameplay":
RunTutorial();
UpdateTimeClock();
AdjustProsperityMeter();
SpawnGenerator();
sortDisplayList();
break;
case "EndGame":
EndGame();
break;
case "CleanUp":
CleanUp();
break;
case "Tutorial":
RunTutorial();
break;
};
}
public function HeadlineShown(_arg1:String){
var _local2:*;
var _local3:Object;
_local2 = 0;
while (_local2 < pHeadline_List.length) {
_local3 = pHeadline_List[_local2];
if ((((_local3.letter == _arg1)) && ((_local3.shown == false)))){
_local3.shown = true;
return;
};
_local2++;
};
}
function Translate_Increment(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
var _local5:Number;
_local4 = (_arg1 * _arg3);
_local5 = ((_local4 / 1000) * MainObj.gTimeinterval);
if (_local5 > _arg2){
_local5 = _arg2;
};
return (_local5);
}
public function getLetterFrame(_arg1:String){
var _local2:int;
switch (_arg1){
case "A":
_local2 = 1;
break;
case "B":
_local2 = 2;
break;
case "C":
_local2 = 3;
break;
case "D":
_local2 = 4;
break;
case "E":
_local2 = 5;
break;
case "F":
_local2 = 6;
break;
case "G":
_local2 = 7;
break;
case "H":
_local2 = 8;
break;
case "I":
_local2 = 9;
break;
case "J":
_local2 = 10;
break;
case "K":
_local2 = 11;
break;
case "L":
_local2 = 12;
break;
case "M":
_local2 = 13;
break;
case "N":
_local2 = 14;
break;
case "O":
_local2 = 15;
break;
case "P":
_local2 = 16;
break;
case "Q":
_local2 = 17;
break;
case "R":
_local2 = 18;
break;
case "S":
_local2 = 19;
break;
case "T":
_local2 = 20;
break;
case "U":
_local2 = 21;
break;
case "V":
_local2 = 22;
break;
case "W":
_local2 = 23;
break;
case "X":
_local2 = 24;
break;
case "Y":
_local2 = 25;
break;
case "Z":
_local2 = 26;
break;
};
return (_local2);
}
public function UpdateHeadlineOverlay(_arg1:String){
var _local2:*;
var _local3:Object;
_local2 = 0;
while (_local2 < pHeadline_List.length) {
_local3 = pHeadline_List[_local2];
if ((((_local3.letter == _arg1)) && ((_local3.status == false)))){
_local3.mc.alpha = 1;
_local3.status = true;
return;
};
_local2++;
};
}
public function UpdateSecretIdentityBar(_arg1:Number){
var _local2:Number;
pSecretIdentityBar = (pSecretIdentityBar + Translate_Increment(_arg1, 50, 30));
if (pSecretIdentityBar >= 100){
pSecretIdentityBar = 100;
};
if (pSecretIdentityBar <= 0){
pSecretIdentityBar = 0;
};
_local2 = (pSecretIdentityBar / 100);
pSecretIdentityBar_MC.width = (217 * _local2);
if (pSecretIdentityBar == 0){
gGame_Status = "EndGame";
pEndGame_Mode = "TimeUp";
pEndGame_State = "identity_revealed";
};
}
public function SetupHeadlineOverlay(_arg1:String){
var _local2:HeadlineTextOverlay;
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:*;
var _local8:HeadlineLetters;
var _local9:Object;
_local2 = new HeadlineTextOverlay();
_local2.x = 5;
_local2.y = 435;
pheadlineOverlayMC = _local2;
MainObj.stage.addChild(_local2);
pHeadline_List = [];
_local5 = 15;
_local6 = 465;
_local7 = 0;
while (_local7 < _arg1.length) {
_local3 = _arg1.charAt(_local7);
_local4 = getLetterFrame(_local3);
_local8 = new HeadlineLetters();
_local8.gotoAndStop(_local4);
_local8.scaleX = 0.5;
_local8.scaleY = 0.5;
_local8.alpha = 0.5;
_local8.x = _local5;
_local8.y = _local6;
MainObj.stage.addChild(_local8);
_local9 = {};
_local9.letter = _local3;
_local9.mc = _local8;
_local9.status = false;
_local9.shown = false;
pHeadline_List.push(_local9);
_local5 = (_local5 + 25);
_local7++;
};
}
public function SpawnGenerator(){
var _local1:int;
var _local2:*;
var _local3:Object;
var _local4:int;
var _local5:Array;
var _local6:Object;
var _local7:Mobster;
var _local8:Mutant;
var _local9:Civilian;
var _local10:Boolean;
var _local11:String;
var _local12:String;
var _local13:Object;
var _local14:HeadlineLetter;
var _local15:*;
var _local16:*;
_local1 = (getTimer() - pGame_StartTime);
_local2 = 0;
while (_local2 < pSpawn_List.length) {
_local3 = pSpawn_List[_local2];
_local4 = _local3["time"];
if (_local1 > _local4){
switch (_local3["wtp"]){
case "a1":
_local5 = [{x:-300, y:0, z:0, spd:5, t:3}, {x:300, y:0, z:0, spd:5, t:2}];
break;
case "a2":
_local5 = [{x:300, y:0, z:0, spd:5, t:3}, {x:-300, y:0, z:0, spd:5, t:2}];
break;
case "a3":
_local5 = [{x:0, y:0, z:300, spd:5, t:3}, {x:0, y:0, z:-300, spd:5, t:3}];
break;
case "a4":
_local5 = [{x:0, y:0, z:-300, spd:5, t:3}, {x:0, y:0, z:300, spd:5, t:3}];
break;
case "b1":
_local5 = [{x:-300, y:0, z:0, spd:6, t:0}, {x:300, y:0, z:0, spd:6, t:0}];
break;
case "b2":
_local5 = [{x:300, y:0, z:0, spd:6, t:0}, {x:-300, y:0, z:0, spd:6, t:0}];
break;
case "cv1":
_local5 = [{x:-400, y:0, z:0, spd:5, t:3}, {x:400, y:0, z:0, spd:5, t:2}];
break;
case "cv2":
_local5 = [{x:600, y:0, z:0, spd:5, t:3}, {x:-600, y:0, z:0, spd:5, t:2}];
break;
case "cvlp1":
_local5 = [{x:-600, y:0, z:0, spd:5, t:2}, {x:0, y:0, z:-350, spd:5, t:1}, {x:600, y:0, z:0, spd:5, t:1}, {x:0, y:0, z:350, spd:5, t:1}];
break;
case "cvlp2":
_local5 = [{x:600, y:0, z:0, spd:5, t:2}, {x:0, y:0, z:350, spd:5, t:1}, {x:-600, y:0, z:0, spd:5, t:1}, {x:0, y:0, z:-350, spd:5, t:1}];
break;
case "cvlp3":
_local5 = [{x:650, y:0, z:0, spd:8, t:0}, {x:0, y:0, z:350, spd:8, t:0}, {x:-650, y:0, z:0, spd:7, t:0}, {x:0, y:0, z:-350, spd:7, t:0}];
break;
case "cvlp4":
_local5 = [{x:0, y:0, z:350, spd:8, t:0}, {x:-650, y:0, z:0, spd:8, t:0}, {x:0, y:0, z:-350, spd:8, t:0}, {x:650, y:0, z:0, spd:8, t:0}];
break;
case "cvlp5":
_local5 = [{x:625, y:0, z:0, spd:8, t:0}, {x:0, y:0, z:375, spd:8, t:0}, {x:-625, y:0, z:0, spd:7, t:0}, {x:0, y:0, z:-375, spd:7, t:0}];
break;
case "cvpp":
_local5 = [{x:400, y:0, z:0, spd:5, t:0}, {x:0, y:0, z:370, spd:5, t:0}, {x:-300, y:0, z:0, spd:5, t:0}, {x:0, y:0, z:410, spd:5, t:0}, {x:680, y:0, z:0, spd:5, t:0}, {x:0, y:0, z:-410, spd:5, t:0}, {x:-380, y:0, z:0, spd:5, t:0}, {x:0, y:0, z:-370, spd:5, t:0}, {x:450, y:0, z:0, spd:5, t:0}, {x:-850, y:0, z:0, spd:5, t:0}];
break;
};
switch (_local3["type"]){
case "mb":
_local6 = new Object();
_local6.X = _local3["x"];
_local6.Y = _local3["y"];
_local6.Z = _local3["z"];
_local6.mode = "Wander";
_local6.type = "standard";
_local6.spd = 7;
_local6.waypoints = _local5;
if (_local3["n"] != null){
_local6.name = _local3["n"];
};
_local7 = new Mobster(this, _local6);
pSpawn_List.splice(_local2, 1);
break;
case "mut":
_local6 = new Object();
_local6.X = _local3["x"];
_local6.Y = _local3["y"];
_local6.Z = _local3["z"];
_local6.mode = "Wander";
_local6.type = "standard";
_local6.spd = 5;
_local6.waypoints = _local5;
if (_local3["n"] != null){
_local6.name = _local3["n"];
};
_local8 = new Mutant(this, _local6);
pSpawn_List.splice(_local2, 1);
break;
case "civ":
case "civK":
case "civP":
_local6 = new Object();
_local6.X = _local3["x"];
_local6.Y = _local3["y"];
_local6.Z = _local3["z"];
_local6.mode = "Stroll";
_local6.type = _local3["stype"];
_local6.spd = 1;
_local6.waypoints = _local5;
if (_local3["n"] != null){
_local6.name = _local3["n"];
};
if (_local3["type"] == "civK"){
_local6.mode = "Captured";
};
_local9 = new Civilian(this, _local6);
pSpawn_List.splice(_local2, 1);
break;
case "hdl":
_local10 = false;
if (_local3["stype"] == ""){
_local12 = GetNextHeadlineLetter();
if (_local12 != null){
_local10 = true;
_local11 = _local12;
};
} else {
_local11 = _local3["stype"];
};
if (_local10 == true){
_local13 = new Object();
_local13.X = _local3["x"];
_local13.Y = _local3["y"];
_local13.Z = _local3["z"];
_local13.letter = _local11;
_local14 = new HeadlineLetter(this, _local13);
if (_local3["host"] != null){
_local15 = 0;
while (_local15 < pNPC_Registry_List.length) {
_local16 = pNPC_Registry_List[_local15];
if (_local16.pSpawnName == _local3["host"]){
_local14.AddParent(_local16);
};
_local15++;
};
};
};
pSpawn_List.splice(_local2, 1);
break;
};
};
_local2++;
};
}
public function RunCinematic(){
var _local1:*;
var _local2:Number;
switch (pCinematic_State){
case "PreSetup":
MainObj.gotoAndStop("cinematic");
pCinematic_State = "Setup";
break;
case "Setup":
switch (pCurrentLevel){
case "7":
case "6":
case "5":
case "4":
case "3":
case "2":
case "1":
MainObj.BradfortChatbubble.alpha = 0;
MainObj.MiltonChatbubble.alpha = 0;
MainObj.Bradfort.gotoAndStop(1);
MainObj.Milton.gotoAndStop(1);
MainObj.BradfortText.alpha = 0;
MainObj.MiltonText.alpha = 0;
MainObj.BradfortText.gotoAndStop(1);
MainObj.MiltonText.gotoAndStop(1);
break;
};
pCinematic_State = "Reveal";
break;
case "Reveal":
_local1 = MainObj.black_screen;
_local1.x = 0;
_local2 = _local1.alpha;
_local2 = (_local2 - Translate_Increment(0.05, 50, 30));
if (_local2 < 0){
_local2 = 0;
};
_local1.alpha = _local2;
if (_local2 == 0){
_local1.x = 800;
pCinematic_State = "Run";
};
break;
case "Run":
RunCinematicConversation();
break;
case "FadeOut":
_local1 = MainObj.black_screen;
_local2 = _local1.alpha;
_local1.x = 0;
_local2 = (_local2 + Translate_Increment(0.05, 50, 30));
if (_local2 > 1){
_local2 = 1;
};
_local1.alpha = _local2;
if (_local2 == 1){
pFrontend_Status = "PreLevel-1";
pConversation_State = "1";
if (pCurrentLevel == "7"){
gGame_Status = "Frontend";
pFrontend_Status = "PreTitleScreen";
pConversation_State = "1";
pCurrentLevel = "1";
MainObj.gotoAndStop("title_screen");
};
};
break;
};
}
}
}//package com.citysuperhero
Section 4
//GunBullet (com.citysuperhero.GunBullet)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
public class GunBullet extends LevelObject {
public var pState:String;// = "1"
private var lastTime:int;
public var pGunBullet_Snd:GunBulletSnd;
public var pGunBullet_MC:GunBulletMovieClip;
public var pBulletHit_Snd:BulletHitSnd;
public var pGunBang_MC:GunBangMovieClip;
public var pDirection:String;
public var pDistLimit:String;
public function GunBullet(_arg1:Object, _arg2:Object, _arg3:String){
pState = "1";
pGunBullet_MC = new GunBulletMovieClip();
pGunBang_MC = new GunBangMovieClip();
pGunBullet_Snd = new GunBulletSnd();
pBulletHit_Snd = new BulletHitSnd();
super();
gGameObj = _arg1;
MainObj = gGameObj.MainObj;
gamemap = MainObj.gamemap;
gGameObj.pDisplay_Registry_List.push(this);
pDirection = _arg3;
pWorldX = _arg2.x;
pWorldY = _arg2.y;
pWorldZ = _arg2.z;
MainObj.addEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function DisplayBullet(){
var _local1:Array;
var _local2:Array;
var _local3:Number;
var _local4:SoundChannel;
var _local5:int;
var _local6:Boolean;
var _local7:Number;
var _local8:Number;
switch (pState){
case "1":
pGunBang_MC.alpha = 1;
pGunBang_MC.gotoAndStop(1);
gamemap.addChild(pGunBang_MC);
pObject_MC = pGunBang_MC;
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
pGunBullet_MC.gotoAndStop(1);
gamemap.addChild(pGunBullet_MC);
pObject_MC = pGunBullet_MC;
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
_local1 = [pWorldX, pWorldY, pWorldZ];
_local2 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local3 = gGameObj.DistanceTo(_local1, _local2);
_local4 = pGunBullet_Snd.play();
pState = "2";
break;
case "2":
_local5 = 14;
_local6 = false;
_local7 = pGunBang_MC.alpha;
_local8 = 0.04;
_local7 = (_local7 - _local8);
if (_local7 < 0){
_local7 = 0;
};
pGunBang_MC.alpha = _local7;
switch (pDirection){
case "n":
_local6 = WorldTranslate(0, 0, -(_local5), true);
break;
case "e":
_local6 = WorldTranslate(_local5, 0, 0, true);
break;
case "w":
_local6 = WorldTranslate(-(_local5), 0, 0, true);
break;
case "s":
_local6 = WorldTranslate(0, 0, _local5, true);
break;
};
CheckPlayerHit();
if (_local6 == false){
pState = "dead";
};
break;
case "dead":
pGunBang_MC.alpha = 0;
pGunBullet_MC.gotoAndStop(2);
_local7 = pGunBullet_MC.alpha;
_local8 = 0.04;
_local7 = (_local7 - _local8);
if (_local7 < 0){
_local7 = 0;
pState = "destroy";
};
pGunBullet_MC.alpha = _local7;
break;
case "destroy":
DestroyGunBullet();
break;
};
}
public function CheckForCivilians(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:*;
var _local6:*;
var _local7:Point;
var _local8:Point;
var _local9:Number;
_local1 = new Point(pGunBullet_MC.x, pGunBullet_MC.y);
_local2 = gamemap.localToGlobal(_local1);
_local3 = new Point(_local2.x, _local2.y);
_local4 = new Point(_local3.x, _local3.y);
_local5 = 0;
while (_local5 < gGameObj.pNPC_Registry_List.length) {
_local6 = gGameObj.pNPC_Registry_List[_local5];
_local7 = new Point(_local6.pCharacter_MC.x, _local6.pCharacter_MC.y);
_local1 = new Point(_local6.pCharacter_MC.x, _local6.pCharacter_MC.y);
_local2 = gamemap.localToGlobal(_local1);
_local8 = new Point(_local2.x, (_local2.y + 40));
_local9 = Point.distance(_local8, _local4);
switch (_local6.pNPCType){
case "Civilian":
if (_local9 < 100){
_local6.pRunAway_Obj = this;
_local6.GunBulletNear();
};
break;
};
_local5++;
};
}
public function DestroyGunBullet(){
var _local1:*;
var _local2:*;
gamemap.removeChild(pGunBang_MC);
pGunBang_MC = null;
gamemap.removeChild(pGunBullet_MC);
pGunBullet_MC = null;
_local1 = 0;
while (_local1 < gGameObj.pDisplay_Registry_List.length) {
_local2 = gGameObj.pDisplay_Registry_List[_local1];
if (_local2 == this){
gGameObj.pDisplay_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
MainObj.removeEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function CheckPlayerHit(){
var _local1:Array;
var _local2:Array;
var _local3:Number;
var _local4:String;
_local1 = [pWorldX, pWorldY, pWorldZ];
_local2 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local3 = gGameObj.DistanceTo(_local1, _local2);
if (_local3 < 25){
_local4 = gGameObj.GetDirectionFrom(this, gGameObj.heroClassRef);
gGameObj.heroClassRef.PlayerHit(_local4);
pState = "dead";
};
}
public function GameUpdate(_arg1:Event){
switch (gGameObj.gGame_Status){
case "Gameplay":
DisplayBullet();
break;
case "CleanUp":
DestroyGunBullet();
break;
};
}
}
}//package com.citysuperhero
Section 5
//HeadlineLetter (com.citysuperhero.HeadlineLetter)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.filters.*;
public class HeadlineLetter extends LevelObject {
public var pState:String;// = "1"
private var lastTime:int;
public var pLetter:String;
public var pVelocityMax:Number;// = 12
public var pGravity:Number;// = -0.5
public var pRotDir:String;// = "left"
public var pParent_Obj:Object;
public var pParentActive:Boolean;// = false
public var pFadeIncre:Number;
public var pVelocity:Number;// = 4
public var pStartFade:Number;
public function HeadlineLetter(_arg1:Object, _arg2:Object){
pState = "1";
pRotDir = "left";
pGravity = -0.5;
pVelocity = 4;
pVelocityMax = 12;
pParentActive = false;
super();
gGameObj = _arg1;
MainObj = gGameObj.MainObj;
gamemap = MainObj.gamemap;
gGameObj.pDisplay_Registry_List.push(this);
pWorldX = _arg2.X;
pWorldY = _arg2.Y;
pWorldZ = _arg2.Z;
pLetter = _arg2.letter;
gGameObj.HeadlineShown(pLetter);
initHeadlineLetterMovieClip();
initShadowMovieClipAttributes();
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
MainObj.addEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function PictureTaken(){
var _local1:PictureTakenSnd;
var _local2:SoundChannel;
if (pState == "1"){
gGameObj.UpdateHeadlineOverlay(pLetter);
_local1 = new PictureTakenSnd();
_local2 = _local1.play();
pState = "destroy";
};
}
public function AddParent(_arg1:Object){
pParent_Obj = _arg1;
pParentActive = true;
}
public function DestroyHeadlineLetter(){
var _local1:*;
var _local2:*;
pState = null;
gamemap.removeChild(pObject_MC);
gamemap.removeChild(pShadow_MC);
pObject_MC = null;
pShadow_MC = null;
_local1 = 0;
while (_local1 < gGameObj.pDisplay_Registry_List.length) {
_local2 = gGameObj.pDisplay_Registry_List[_local1];
if (_local2 == this){
gGameObj.pDisplay_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
MainObj.removeEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function initShadowMovieClipAttributes(){
pShadow_MC = new CharShadowMovieClip();
pShadow_MC.name = "shadow";
pShadow_MC.width = 45;
pShadow_MC.height = 17;
pShadow_MC.alpha = 0.3;
pShadow_MC.gotoAndStop(1);
gamemap.addChild(pShadow_MC);
}
public function getLetterFrame(){
var _local1:int;
switch (pLetter){
case "A":
_local1 = 1;
break;
case "B":
_local1 = 2;
break;
case "C":
_local1 = 3;
break;
case "D":
_local1 = 4;
break;
case "E":
_local1 = 5;
break;
case "F":
_local1 = 6;
break;
case "G":
_local1 = 7;
break;
case "H":
_local1 = 8;
break;
case "I":
_local1 = 9;
break;
case "J":
_local1 = 10;
break;
case "K":
_local1 = 11;
break;
case "L":
_local1 = 12;
break;
case "M":
_local1 = 13;
break;
case "N":
_local1 = 14;
break;
case "O":
_local1 = 15;
break;
case "P":
_local1 = 16;
break;
case "Q":
_local1 = 17;
break;
case "R":
_local1 = 18;
break;
case "S":
_local1 = 19;
break;
case "T":
_local1 = 20;
break;
case "U":
_local1 = 21;
break;
case "V":
_local1 = 22;
break;
case "W":
_local1 = 23;
break;
case "X":
_local1 = 24;
break;
case "Y":
_local1 = 25;
break;
case "Z":
_local1 = 26;
break;
};
return (_local1);
}
public function DisplayHeadlineLetter(){
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:Array;
var _local5:BlurFilter;
switch (pState){
case "1":
if (pWorldY >= 5){
pVelocity = (pVelocity + gGameObj.Translate_Increment(pGravity, 50, 30));
WorldTranslate(0, pVelocity, 0, false);
if (pWorldY < 5){
pWorldY = 5;
pVelocity = pVelocityMax;
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
if (pRotDir == "right"){
pRotDir = "left";
} else {
pRotDir = "right";
};
};
} else {
pVelocity = pVelocityMax;
};
_local1 = 0;
if (pRotDir == "right"){
if (pObject_MC.rotation < 30){
_local1 = 2;
};
} else {
if (pObject_MC.rotation > -30){
_local1 = -2;
};
};
pObject_MC.rotation = (pObject_MC.rotation + gGameObj.Translate_Increment(_local1, 50, 30));
if (pParentActive == true){
if (pParent_Obj != null){
SetWorldPosition(pParent_Obj.pWorldX, pWorldY, pParent_Obj.pWorldZ);
if (pParent_Obj.pCharacter_MC != null){
pObject_MC.alpha = pParent_Obj.pCharacter_MC.alpha;
if (pParent_Obj.pCharacter_MC.alpha < 0.5){
pShadow_MC.alpha = 0;
pState = "parenthidden";
};
} else {
pState = "destroy";
gGameObj.HeadlineUnShown(pLetter);
};
} else {
pState = "destroy";
gGameObj.HeadlineUnShown(pLetter);
};
};
break;
case "2":
_local2 = pObject_MC.alpha;
_local3 = gGameObj.Translate_Increment(0.02, 50, 30);
_local2 = (_local2 - _local3);
if (_local2 < 0){
_local2 = 0;
};
pObject_MC.alpha = _local2;
_local4 = pObject_MC.filters;
_local5 = _local4[0];
_local4[0].blurX = (_local5.blurX + 0.9);
_local5.blurY = (_local5.blurY + 0.9);
pObject_MC.filters = [_local5];
if (_local2 == 0){
pState = "dead";
};
break;
case "parenthidden":
if (pParentActive == true){
if (pParent_Obj != null){
SetWorldPosition(pParent_Obj.pWorldX, pWorldY, pParent_Obj.pWorldZ);
pObject_MC.alpha = pParent_Obj.pCharacter_MC.alpha;
if (pParent_Obj.pCharacter_MC.alpha > 0.5){
pShadow_MC.alpha = 0.3;
pState = "1";
};
} else {
pParentActive = false;
pState = "1";
};
};
break;
case "dead":
pState = "destroy";
break;
case "destroy":
DestroyHeadlineLetter();
break;
};
}
public function initHeadlineLetterMovieClip(){
var _local1:HeadlineLetters;
var _local2:BlurFilter;
var _local3:int;
_local1 = new HeadlineLetters();
pObject_MC = _local1;
pObject_MC.name = "headlineletter";
_local2 = new BlurFilter();
_local2.blurX = 1;
_local2.blurY = 1;
pObject_MC.filters = [_local2];
_local3 = getLetterFrame();
pObject_MC.gotoAndStop(_local3);
gamemap.addChild(pObject_MC);
}
public function GameUpdate(_arg1:Event){
switch (gGameObj.gGame_Status){
case "Gameplay":
DisplayHeadlineLetter();
break;
case "CleanUp":
DestroyHeadlineLetter();
break;
};
}
}
}//package com.citysuperhero
Section 6
//HeroClass (com.citysuperhero.HeroClass)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class HeroClass {
public var pHeroNerd_MC:HeroNerdMovieClip;
private var lastTime:int;
public var pPunchDelay:int;
public var pCharacter_MC;
public var pShadow_MC:CharShadowMovieClip;
public var pPunchState:String;// = "1"
public var pWorldX:Number;
public var pWorldY:Number;
public var pWorldZ:Number;
var pCameraFlash_MC:MovieClip;
public var pLock_UserInput:Boolean;// = false
var pCameraDir:String;
public var pHurtDelay:int;
public var pPunchDir:String;
public var gamemap;
public var pHurtState:String;// = "0"
public var pMode:String;
public var gGameObj;
var pPhoneDelay:int;
public var pObject_Type;// = "Character"
public var pIdentity:String;
var pPhoneState:String;// = "1"
public var Player_Action:String;// = "swr"
var pMusicPlaying:Boolean;// = true
public var MainObj;
var pCameraState:String;// = "1"
public var pHero_MC:HeroMovieClip;
public var pHurtDir:String;
public function HeroClass(_arg1:Object){
pObject_Type = "Character";
Player_Action = "swr";
pPunchState = "1";
pHurtState = "0";
pHero_MC = new HeroMovieClip();
pHeroNerd_MC = new HeroNerdMovieClip();
pShadow_MC = new CharShadowMovieClip();
pLock_UserInput = false;
pPhoneState = "1";
pCameraState = "1";
pMusicPlaying = true;
super();
gGameObj = _arg1;
MainObj = gGameObj.MainObj;
gGameObj.pDisplay_Registry_List.push(this);
gGameObj.pCharacter_Registry_List.push(this);
pIdentity = "Nerd";
pCharacter_MC = pHeroNerd_MC;
gamemap = MainObj.gamemap;
initShadowMovieClipAttributes();
initNerdMovieClipAttributes();
initHeroMovieClipAttributes();
pMode = "ActiveControl";
MainObj.addEventListener(Event.ENTER_FRAME, GameUpdate);
SwitchIdentity("Nerd");
SetWorldPosition(60, 0, 280);
}
public function initHeroMovieClipAttributes(){
pHero_MC.x = 600;
pHero_MC.y = 600;
pHero_MC.gotoAndStop(7);
gamemap.addChild(pHero_MC);
}
public function Punch(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Object;
var _local5:TrailParticle;
var _local6:int;
var _local7:WhooshSnd;
var _local8:SoundChannel;
switch (pPunchState){
case "1":
lastTime = (getTimer() - 1000);
switch (Player_Action){
case "swr":
case "ssr":
Player_Action = "pr1";
pPunchDir = "right";
break;
case "swl":
case "ssl":
Player_Action = "pl1";
pPunchDir = "left";
break;
case "wf":
case "sf":
Player_Action = "pf1";
pPunchDir = "forward";
break;
case "wb":
case "sb":
Player_Action = "pb1";
pPunchDir = "backward";
break;
};
Animate();
pPunchDelay = getTimer();
pPunchState = "2";
break;
case "2":
_local1 = 0;
_local2 = 0;
_local3 = 0;
switch (pPunchDir){
case "right":
_local1 = -5;
break;
case "left":
_local1 = 5;
break;
case "forward":
_local3 = -5;
break;
case "backward":
_local3 = 5;
break;
};
WorldTranslate(_local1, _local2, _local3, true);
centerMap();
_local4 = new Object();
_local4.ParentMC = pCharacter_MC;
_local4.ParticleMC = "Hero";
_local4.frame = pCharacter_MC.currentFrame;
_local4.x = pWorldX;
_local4.y = pWorldY;
_local4.z = pWorldZ;
_local4.type = "blur";
_local4.startfade = 0.75;
_local4.fadeincre = 0.02;
_local5 = new TrailParticle(gGameObj, _local4);
_local6 = (getTimer() - pPunchDelay);
if (_local6 > 250){
_local7 = new WhooshSnd();
_local8 = _local7.play();
lastTime = (getTimer() - 1000);
pPunchState = "3";
};
break;
case "3":
_local1 = 0;
_local2 = 0;
_local3 = 0;
switch (pPunchDir){
case "right":
Player_Action = "pr2";
_local1 = 20;
break;
case "left":
Player_Action = "pl2";
_local1 = -20;
break;
case "forward":
Player_Action = "pf2";
_local3 = 20;
break;
case "backward":
Player_Action = "pb2";
_local3 = -20;
break;
};
WorldTranslate(_local1, _local2, _local3, true);
Animate();
NPC_HitCollision();
_local4 = new Object();
_local4.ParentMC = pCharacter_MC;
_local4.ParticleMC = "Hero";
_local4.frame = pCharacter_MC.currentFrame;
_local4.x = pWorldX;
_local4.y = pWorldY;
_local4.z = pWorldZ;
_local4.type = "blur";
_local4.startfade = 0.75;
_local4.fadeincre = 0.02;
_local5 = new TrailParticle(gGameObj, _local4);
centerMap();
_local6 = (getTimer() - pPunchDelay);
if (_local6 > 500){
lastTime = (getTimer() - 1000);
pPunchState = "4";
};
break;
case "4":
switch (pPunchDir){
case "right":
Player_Action = "ssr";
break;
case "left":
Player_Action = "ssl";
break;
case "forward":
Player_Action = "sf";
break;
case "backward":
Player_Action = "sb";
break;
};
Animate();
pMode = "ActiveControl";
pPunchState = "1";
break;
};
}
public function CheckForPhoneBooths(){
var _local1:Point;
var _local2:Point;
var _local3:Number;
var _local4:int;
switch (pPhoneState){
case "1":
_local1 = new Point((gGameObj.pPhoneBooth1_MC.x + 35), gGameObj.pPhoneBooth1_MC.y);
_local2 = new Point(pCharacter_MC.x, pCharacter_MC.y);
_local3 = Point.distance(_local2, _local1);
if (_local3 < 80){
if (pWorldY == 0){
gGameObj.pPhoneBooth1_MC.gotoAndStop(1);
pPhoneDelay = getTimer();
pCharacter_MC.alpha = 0;
pShadow_MC.alpha = 0;
pPhoneState = "2";
pLock_UserInput = true;
};
};
if ((((_local3 > 80)) && ((_local3 < 150)))){
gGameObj.pPhoneBooth1_MC.gotoAndStop(2);
};
if (_local3 > 150){
gGameObj.pPhoneBooth1_MC.gotoAndStop(1);
};
break;
case "2":
_local4 = (getTimer() - pPhoneDelay);
if (_local4 > 1000){
pPhoneState = "1";
if (pIdentity == "Nerd"){
SwitchIdentity("Hero");
} else {
SwitchIdentity("Nerd");
};
pShadow_MC.alpha = 0.4;
SetWorldPosition(pWorldX, pWorldY, (pWorldZ + 25));
pLock_UserInput = false;
Player_Action = "sf";
};
};
}
public function WorldTranslate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean){
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:Point;
var _local9:Point;
var _local10:Point;
var _local11:Point;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local5 = gGameObj.Translate_Increment(_arg1, 50, 30);
_local6 = gGameObj.Translate_Increment(_arg2, 50, 30);
_local7 = gGameObj.Translate_Increment(_arg3, 50, 30);
_local8 = new Point(pCharacter_MC.x, pCharacter_MC.y);
_local9 = gamemap.localToGlobal(_local8);
_local10 = new Point(_local9.x, (_local9.y + 40));
_local11 = new Point(_local10.x, _local10.y);
if (_arg4 == true){
if (_local5 > 0){
_local11 = new Point(((_local10.x + 30) + _local5), _local10.y);
if (MainObj.collisionmap.hitTestPoint(_local11.x, _local11.y, true)){
_local5 = 0;
};
};
if (_local5 < 0){
_local11 = new Point(((_local10.x - 30) + _local5), _local10.y);
if (MainObj.collisionmap.hitTestPoint(_local11.x, _local11.y, true)){
_local5 = 0;
};
};
if (_local7 > 0){
_local11 = new Point((_local10.x + _local5), (_local10.y + 30));
if (MainObj.collisionmap.hitTestPoint(_local11.x, _local11.y, true)){
_local7 = 0;
};
_local11 = new Point(((_local10.x - 15) + _local5), (_local10.y + 30));
if (MainObj.collisionmap.hitTestPoint(_local11.x, _local11.y, true)){
_local7 = 0;
};
_local11 = new Point(((_local10.x + 15) + _local5), (_local10.y + 30));
if (MainObj.collisionmap.hitTestPoint(_local11.x, _local11.y, true)){
_local7 = 0;
};
};
if (_local7 < 0){
_local11 = new Point((_local10.x + _local5), (_local10.y - 20));
if (MainObj.collisionmap.hitTestPoint(_local11.x, _local11.y, true)){
_local7 = 0;
};
_local11 = new Point(((_local10.x - 15) + _local5), (_local10.y - 20));
if (MainObj.collisionmap.hitTestPoint(_local11.x, _local11.y, true)){
_local7 = 0;
};
_local11 = new Point(((_local10.x + 15) + _local5), (_local10.y - 20));
if (MainObj.collisionmap.hitTestPoint(_local11.x, _local11.y, true)){
_local7 = 0;
};
};
};
_local12 = (pWorldX + _local5);
_local13 = (pWorldY + _local6);
_local14 = (pWorldZ + _local7);
SetWorldPosition(_local12, _local13, _local14);
}
public function CollisionDetection(_arg1:String){
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
switch (_arg1){
case "CharBase":
_local2 = new Point(pCharacter_MC.x, pCharacter_MC.y);
_local3 = gamemap.localToGlobal(_local2);
_local4 = new Point(_local3.x, (_local3.y + 40));
_local5 = new Point(_local4.x, _local4.y);
if (MainObj.collisionmap.hitTestPoint(_local5.x, _local5.y, true)){
return (true);
};
break;
};
return (false);
}
public function CheckModes(){
switch (pMode){
case "ActiveControl":
UserInput();
centerMap();
CheckForPhoneBooths();
break;
case "Punch":
Punch();
break;
case "Camera":
UseCamera();
break;
case "Hurt":
PlayerHurt();
break;
};
}
public function NPC_HitCollision(){
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:*;
var _local6:*;
var _local7:Point;
var _local8:Point;
var _local9:Number;
var _local10:int;
var _local11:int;
var _local12:Object;
var _local13:TrailParticle;
_local1 = new Point(pCharacter_MC.x, pCharacter_MC.y);
_local2 = gamemap.localToGlobal(_local1);
_local3 = new Point(_local2.x, (_local2.y + 40));
_local4 = new Point(_local3.x, _local3.y);
_local5 = 0;
while (_local5 < gGameObj.pNPC_Registry_List.length) {
_local6 = gGameObj.pNPC_Registry_List[_local5];
_local7 = new Point(_local6.pCharacter_MC.x, _local6.pCharacter_MC.y);
_local1 = new Point(_local6.pCharacter_MC.x, _local6.pCharacter_MC.y);
_local2 = gamemap.localToGlobal(_local1);
_local8 = new Point((_local2.x + 23), (_local2.y + 70));
_local9 = Point.distance(_local8, _local4);
if (_local9 < 50){
if (_local6.pMode != "Death"){
switch (_local6.pNPCType){
case "Mobster":
_local11 = 250;
_local10 = 2;
_local6.KillMobster();
break;
case "Mutant":
_local11 = 350;
_local10 = 1;
_local6.KillMutant();
break;
};
if (_local11 > 0){
gGameObj.UpdateProsperityMeter(_local11);
_local12 = new Object();
_local12.ParentMC = pCharacter_MC;
_local12.ParticleMC = "Point";
_local12.frame = _local10;
_local12.x = pWorldX;
_local12.y = pWorldY;
_local12.z = pWorldZ;
_local12.type = "rise";
_local12.startfade = 1;
_local12.fadeincre = 0.005;
_local13 = new TrailParticle(gGameObj, _local12);
};
return (true);
};
};
_local5++;
};
}
public function initShadowMovieClipAttributes(){
pShadow_MC.name = "shadow";
pShadow_MC.width = 45;
pShadow_MC.height = 17;
pShadow_MC.alpha = 0.4;
pShadow_MC.gotoAndStop(1);
gamemap.addChild(pShadow_MC);
}
public function SetWorldPosition(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Number;
var _local9:Number;
var _local10:Number;
pWorldX = _arg1;
pWorldY = _arg2;
pWorldZ = _arg3;
pCharacter_MC.x = _arg1;
pCharacter_MC.y = _arg3;
pShadow_MC.x = _arg1;
pShadow_MC.y = _arg3;
_local4 = new Point(pShadow_MC.x, pShadow_MC.y);
_local5 = gamemap.localToGlobal(_local4);
_local6 = new Point((_local5.x + 23), _local5.y);
_local7 = new Point(_local6.x, _local6.y);
if (MainObj.collisionmap.hitTestPoint(_local7.x, _local7.y, true)){
pShadow_MC.x = (pShadow_MC.x + 10);
_local8 = (pShadow_MC.width - gGameObj.Translate_Increment(3, 50, 30));
if (_local8 < 10){
_local8 = 10;
};
pShadow_MC.width = _local8;
_local9 = (pShadow_MC.height - gGameObj.Translate_Increment(3, 50, 30));
if (_local9 < 20){
_local9 = 20;
};
pShadow_MC.height = _local9;
pShadow_MC.alpha = 0.2;
} else {
_local8 = (pShadow_MC.width + gGameObj.Translate_Increment(3, 50, 30));
if (_local8 > 45){
_local8 = 45;
};
pShadow_MC.width = _local8;
_local9 = (pShadow_MC.height + gGameObj.Translate_Increment(3, 50, 30));
if (_local9 > 17){
_local9 = 17;
};
pShadow_MC.height = _local9;
pShadow_MC.width = _local8;
pShadow_MC.height = _local9;
pShadow_MC.alpha = 0.4;
};
_local10 = 40;
pCharacter_MC.y = ((pCharacter_MC.y - _local10) - _arg2);
}
public function SwitchIdentity(_arg1:String){
switch (_arg1){
case "Nerd":
pIdentity = "Nerd";
pHero_MC.alpha = 0;
pHeroNerd_MC.alpha = 1;
pCharacter_MC = pHeroNerd_MC;
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
if (pMusicPlaying == true){
gGameObj.pChannel1.stop();
};
gGameObj.pChannel1 = gGameObj.NerdMusicBG_Snd.play(undefined, 50);
pMusicPlaying = true;
break;
case "Hero":
pIdentity = "Hero";
pHeroNerd_MC.alpha = 0;
pHero_MC.alpha = 1;
pCharacter_MC = pHero_MC;
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
if (pMusicPlaying == true){
gGameObj.pChannel1.stop();
};
gGameObj.pChannel1 = gGameObj.HeroMusicBG_Snd.play(undefined, 50);
pMusicPlaying = true;
break;
};
}
public function centerMap(){
gamemap.x = (-(pCharacter_MC.x) + 320);
gamemap.y = (-(pCharacter_MC.y) + 240);
if (gamemap.x < -556){
gamemap.x = -556;
};
if (gamemap.x > 0){
gamemap.x = 0;
};
if (gamemap.y < -715){
gamemap.y = -715;
};
if (gamemap.y > 0){
gamemap.y = 0;
};
if (pWorldZ > 1200){
SetWorldPosition(pWorldX, pWorldY, 1200);
};
if (pWorldZ < 175){
SetWorldPosition(pWorldX, pWorldY, 175);
};
if (pWorldX > 1150){
SetWorldPosition(1150, pWorldY, pWorldZ);
};
if (pWorldX < 0){
SetWorldPosition(0, pWorldY, pWorldZ);
};
}
public function UserInput(){
var _local1:Boolean;
var _local2:Boolean;
var _local3:Boolean;
if (pLock_UserInput == false){
if (pIdentity == "Nerd"){
gGameObj.UpdateSecretIdentityBar(0.05);
_local1 = false;
if (gGameObj.arrowRight){
WorldTranslate(5, 0, 0, true);
Player_Action = "swr";
_local1 = true;
Animate();
};
if (gGameObj.arrowLeft){
WorldTranslate(-5, 0, 0, true);
Player_Action = "swl";
_local1 = true;
Animate();
};
if (gGameObj.arrowUp){
WorldTranslate(0, 0, -5, true);
Player_Action = "wb";
_local1 = true;
Animate();
};
if (gGameObj.arrowDown){
WorldTranslate(0, 0, 5, true);
Player_Action = "wf";
_local1 = true;
Animate();
};
if (gGameObj.SpaceBar_Down){
if (pWorldY < 5){
pMode = "Camera";
};
};
if (_local1 == false){
switch (Player_Action){
case "swr":
Player_Action = "ssr";
break;
case "swl":
Player_Action = "ssl";
break;
case "wf":
Player_Action = "sf";
break;
case "wb":
Player_Action = "sb";
break;
};
};
Animate();
return;
};
if (pIdentity == "Hero"){
_local1 = false;
_local2 = false;
_local3 = false;
if (pWorldY > 0){
_local2 = true;
_local3 = true;
};
if (gGameObj.arrowRight){
if (_local2 == true){
WorldTranslate(10, 0, 0, false);
Player_Action = "sfr";
_local3 = false;
_local1 = false;
} else {
WorldTranslate(15, 0, 0, true);
Player_Action = "swr";
_local1 = true;
};
Animate();
};
if (gGameObj.arrowLeft){
if (_local2 == true){
WorldTranslate(-10, 0, 0, false);
Player_Action = "sfl";
_local3 = false;
_local1 = false;
} else {
WorldTranslate(-15, 0, 0, true);
Player_Action = "swl";
_local1 = true;
};
Animate();
};
if (gGameObj.arrowUp){
if (_local2 == true){
WorldTranslate(0, 0, -10, false);
Player_Action = "bf";
_local3 = false;
_local1 = false;
} else {
WorldTranslate(0, 0, -10, true);
Player_Action = "wb";
_local1 = true;
};
Animate();
};
if (gGameObj.arrowDown){
if (_local2 == true){
WorldTranslate(0, 0, 10, false);
Player_Action = "ff";
_local1 = false;
_local3 = false;
} else {
WorldTranslate(0, 0, 10, true);
Player_Action = "wf";
_local1 = true;
};
Animate();
};
if (gGameObj.SpaceBar_Down){
if (pWorldY < 125){
WorldTranslate(0, 5, 0, false);
Player_Action = "hu";
};
_local2 = true;
Animate();
};
if (gGameObj.Attack_KeyDown){
if (pWorldY < 5){
pMode = "Punch";
};
};
if ((((_local2 == true)) && ((gGameObj.SpaceBar_Down == false)))){
if (pWorldY > 5){
WorldTranslate(0, -6, 0, false);
if (_local3 == true){
Player_Action = "hu";
};
} else {
if (CollisionDetection("CharBase")){
WorldTranslate(0, 0, 4, false);
if (_local3 == true){
Player_Action = "hu";
};
} else {
WorldTranslate(0, -6, 0, false);
};
};
};
if (pWorldY < 1){
SetWorldPosition(pWorldX, 0, pWorldZ);
_local2 = false;
};
if ((((_local1 == false)) && ((_local2 == false)))){
switch (Player_Action){
case "swr":
Player_Action = "ssr";
break;
case "swl":
Player_Action = "ssl";
break;
case "wf":
Player_Action = "sf";
break;
case "wb":
Player_Action = "sb";
break;
case "hu":
case "sfr":
case "sfl":
case "bf":
case "ff":
Player_Action = "sf";
break;
};
pShadow_MC.width = 45;
pShadow_MC.height = 17;
};
Animate();
return;
};
};
}
public function Animate(){
var _local1:int;
var _local2:Number;
var _local3:Number;
if (lastTime == 0){
lastTime = getTimer();
};
_local1 = (getTimer() - lastTime);
if (_local1 > 100){
if (pIdentity == "Nerd"){
switch (Player_Action){
case "swr":
_local2 = 7;
_local3 = 8;
break;
case "swl":
_local2 = 9;
_local3 = 10;
break;
case "wf":
_local2 = 2;
_local3 = 6;
break;
case "wb":
_local2 = 12;
_local3 = 17;
break;
case "ssr":
_local2 = 7;
_local3 = 7;
break;
case "ssl":
_local2 = 9;
_local3 = 9;
break;
case "sf":
_local2 = 1;
_local3 = 1;
break;
case "sb":
_local2 = 11;
_local3 = 11;
break;
case "dd":
_local2 = 20;
_local3 = 20;
break;
case "cmr":
_local2 = 22;
_local3 = 22;
break;
case "cml":
_local2 = 23;
_local3 = 23;
break;
case "cmf":
_local2 = 21;
_local3 = 21;
break;
case "cmb":
_local2 = 24;
_local3 = 24;
break;
};
};
if (pIdentity == "Hero"){
switch (Player_Action){
case "swr":
_local2 = 9;
_local3 = 10;
break;
case "swl":
_local2 = 12;
_local3 = 13;
break;
case "wf":
_local2 = 2;
_local3 = 7;
break;
case "wb":
_local2 = 15;
_local3 = 16;
break;
case "ssr":
_local2 = 8;
_local3 = 8;
break;
case "ssl":
_local2 = 11;
_local3 = 11;
break;
case "sf":
_local2 = 1;
_local3 = 1;
break;
case "sb":
_local2 = 14;
_local3 = 14;
break;
case "hu":
_local2 = 17;
_local3 = 18;
break;
case "sfr":
_local2 = 19;
_local3 = 20;
break;
case "sfl":
_local2 = 21;
_local3 = 22;
break;
case "ff":
_local2 = 25;
_local3 = 26;
break;
case "bf":
_local2 = 27;
_local3 = 28;
break;
case "pr1":
_local2 = 36;
_local3 = 36;
break;
case "pl1":
_local2 = 38;
_local3 = 38;
break;
case "pf1":
_local2 = 34;
_local3 = 34;
break;
case "pb1":
_local2 = 40;
_local3 = 40;
break;
case "pr2":
_local2 = 37;
_local3 = 37;
break;
case "pl2":
_local2 = 39;
_local3 = 39;
break;
case "pf2":
_local2 = 35;
_local3 = 35;
break;
case "pb2":
_local2 = 41;
_local3 = 41;
break;
case "hrtr":
_local2 = 31;
_local3 = 31;
break;
case "hrtl":
_local2 = 32;
_local3 = 32;
break;
case "hrtf":
_local2 = 30;
_local3 = 30;
break;
case "hrtb":
_local2 = 29;
_local3 = 29;
break;
};
};
if (pCharacter_MC.currentFrame >= _local3){
pCharacter_MC.gotoAndStop(_local2);
lastTime = getTimer();
} else {
if (pCharacter_MC.currentFrame < _local2){
pCharacter_MC.gotoAndStop(_local2);
lastTime = getTimer();
} else {
pCharacter_MC.gotoAndStop((pCharacter_MC.currentFrame + 1));
lastTime = getTimer();
};
};
};
}
public function CheckForHeadlineLetters(){
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < gGameObj.pDisplay_Registry_List.length) {
_local2 = gGameObj.pDisplay_Registry_List[_local1];
switch (_local2.pObject_Type){
case "Object":
if (_local2.pObject_MC.name == "headlineletter"){
if (pCameraFlash_MC.hitTestObject(_local2.pObject_MC)){
_local2.PictureTaken();
};
};
break;
};
_local1++;
};
}
public function PlayerHit(_arg1:String){
var _local2:BulletHitSnd;
var _local3:SoundChannel;
if (pHurtState == "0"){
_local2 = new BulletHitSnd();
_local3 = _local2.play();
pMode = "Hurt";
pHurtState = "1";
pHurtDir = _arg1;
};
}
public function PlayerHurt(){
var _local1:Object;
var _local2:TrailParticle;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (pIdentity == "Hero"){
switch (pHurtState){
case "1":
lastTime = (getTimer() - 1000);
switch (pHurtDir){
case "right":
Player_Action = "hrtr";
break;
case "left":
Player_Action = "hrtl";
break;
case "front":
Player_Action = "hrtf";
break;
case "back":
Player_Action = "hrtb";
break;
};
gGameObj.UpdateProsperityMeter(-50);
_local1 = new Object();
_local1.ParentMC = pCharacter_MC;
_local1.ParticleMC = "Point";
_local1.frame = 5;
_local1.x = pWorldX;
_local1.y = pWorldY;
_local1.z = pWorldZ;
_local1.type = "rise";
_local1.startfade = 1;
_local1.fadeincre = 0.005;
_local2 = new TrailParticle(gGameObj, _local1);
pHurtDelay = getTimer();
Animate();
pHurtState = "2";
break;
case "2":
_local3 = 0;
_local4 = 0;
_local5 = 0;
switch (pHurtDir){
case "right":
_local3 = -15;
_local4 = 5;
break;
case "left":
_local3 = 15;
_local4 = 5;
break;
case "back":
_local5 = 12;
_local4 = 5;
break;
case "front":
_local5 = -12;
_local4 = 5;
break;
};
WorldTranslate(_local3, _local4, _local5, false);
centerMap();
_local6 = (getTimer() - pHurtDelay);
if (_local6 > 1000){
switch (pHurtDir){
case "right":
Player_Action = "ssr";
break;
case "left":
Player_Action = "ssl";
break;
case "front":
Player_Action = "sf";
break;
case "back":
Player_Action = "sb";
break;
};
lastTime = (getTimer() - 1000);
Animate();
pHurtState = "0";
pMode = "ActiveControl";
};
break;
};
};
if (pIdentity == "Nerd"){
switch (pHurtState){
case "1":
lastTime = (getTimer() - 1000);
switch (pHurtDir){
case "right":
Player_Action = "dd";
break;
case "left":
Player_Action = "dd";
break;
case "front":
Player_Action = "dd";
break;
case "back":
Player_Action = "dd";
break;
};
gGameObj.UpdateProsperityMeter(-100);
_local1 = new Object();
_local1.ParentMC = pCharacter_MC;
_local1.ParticleMC = "Point";
_local1.frame = 4;
_local1.x = pWorldX;
_local1.y = pWorldY;
_local1.z = pWorldZ;
_local1.type = "rise";
_local1.startfade = 1;
_local1.fadeincre = 0.005;
_local2 = new TrailParticle(gGameObj, _local1);
pHurtDelay = getTimer();
Animate();
pHurtState = "2";
break;
case "2":
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local7 = 20;
switch (pHurtDir){
case "right":
_local3 = -15;
_local4 = 5;
break;
case "left":
_local3 = 15;
_local4 = 5;
break;
case "front":
_local5 = -15;
_local4 = 5;
break;
case "back":
_local5 = 15;
_local4 = 5;
break;
};
WorldTranslate(_local3, _local4, _local5, false);
pCharacter_MC.rotation = (pCharacter_MC.rotation + gGameObj.Translate_Increment(_local7, 50, 30));
centerMap();
_local6 = (getTimer() - pHurtDelay);
if (_local6 > 1500){
Player_Action = "ssr";
lastTime = (getTimer() - 1000);
Animate();
pHurtState = "0";
pMode = "ActiveControl";
pCharacter_MC.rotation = 0;
SetWorldPosition(60, 0, 280);
};
break;
};
};
}
public function UseCamera(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:CameraClickSnd;
var _local6:SoundChannel;
var _local7:Number;
switch (pCameraState){
case "1":
lastTime = (getTimer() - 1000);
_local2 = 10;
_local3 = -50;
_local4 = false;
switch (Player_Action){
case "swr":
case "ssr":
Player_Action = "cmr";
pCameraDir = "right";
_local2 = 100;
_local3 = -14;
_local1 = 1;
break;
case "swl":
case "ssl":
Player_Action = "cml";
pCameraDir = "left";
_local2 = -100;
_local3 = -14;
_local1 = 2;
break;
case "wf":
case "sf":
Player_Action = "cmf";
pCameraDir = "forward";
_local2 = 10;
_local3 = 50;
_local1 = 4;
break;
case "wb":
case "sb":
Player_Action = "cmb";
pCameraDir = "backward";
_local1 = 3;
_local4 = true;
break;
};
Animate();
pCameraFlash_MC = new CameraFlashMovieClip();
gamemap.addChild(pCameraFlash_MC);
pCameraFlash_MC.gotoAndStop(_local1);
pCameraFlash_MC.x = (pCharacter_MC.x + _local2);
pCameraFlash_MC.y = (pCharacter_MC.y + _local3);
if (_local4 == true){
gamemap.setChildIndex(pCameraFlash_MC, 1);
};
CheckForHeadlineLetters();
_local5 = new CameraClickSnd();
_local6 = _local5.play();
pCameraState = "2";
break;
case "2":
_local7 = pCameraFlash_MC.alpha;
_local7 = (_local7 - gGameObj.Translate_Increment(0.05, 50, 30));
if (_local7 < 0){
_local7 = 0;
};
pCameraFlash_MC.alpha = _local7;
if (_local7 == 0){
pCameraState = "3";
};
break;
case "3":
lastTime = (getTimer() - 1000);
_local2 = 10;
_local3 = -50;
_local4 = false;
switch (Player_Action){
case "cmr":
Player_Action = "ssr";
break;
case "cml":
Player_Action = "ssl";
break;
case "cmf":
Player_Action = "sf";
break;
case "cmb":
Player_Action = "sb";
break;
};
Animate();
gamemap.removeChild(pCameraFlash_MC);
pCameraFlash_MC = null;
pMode = "ActiveControl";
pCameraState = "1";
break;
};
}
public function DestroyHero(){
var _local1:*;
var _local2:*;
var _local3:*;
gamemap.removeChild(pShadow_MC);
pShadow_MC = null;
gamemap.removeChild(pCharacter_MC);
pCharacter_MC = null;
if (pCameraFlash_MC != null){
gamemap.removeChild(pCameraFlash_MC);
pCameraFlash_MC = null;
};
_local1 = 0;
while (_local1 < gGameObj.pCharacter_Registry_List.length) {
_local2 = gGameObj.pCharacter_Registry_List[_local1];
if (_local2 == this){
gGameObj.pCharacter_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
_local1 = 0;
while (_local1 < gGameObj.pDisplay_Registry_List.length) {
_local3 = gGameObj.pDisplay_Registry_List[_local1];
if (_local3 == this){
gGameObj.pDisplay_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
MainObj.removeEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function GameUpdate(_arg1:Event){
switch (gGameObj.gGame_Status){
case "Gameplay":
CheckModes();
break;
case "CleanUp":
DestroyHero();
break;
};
}
public function initNerdMovieClipAttributes(){
pHeroNerd_MC.width = 50;
pHeroNerd_MC.height = 78;
pHeroNerd_MC.x = 600;
pHeroNerd_MC.y = 600;
pHeroNerd_MC.gotoAndStop(7);
gamemap.addChild(pHeroNerd_MC);
}
}
}//package com.citysuperhero
Section 7
//LevelObject (com.citysuperhero.LevelObject)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
public class LevelObject {
public var pShadow_MC:MovieClip;
public var pObject_MC;
public var gamemap;
public var gGameObj;
public var pWorldX:Number;
public var pWorldY:Number;
public var pWorldZ:Number;
public var pObject_Type;// = "Object"
public var MainObj;
public function LevelObject(){
pObject_Type = "Object";
super();
}
public function SetWorldPosition(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:Number;
pWorldX = _arg1;
pWorldY = _arg2;
pWorldZ = _arg3;
pObject_MC.x = _arg1;
pObject_MC.y = _arg3;
if (pShadow_MC != null){
pShadow_MC.x = _arg1;
pShadow_MC.y = _arg3;
};
_local4 = 20;
pObject_MC.y = ((pObject_MC.y - _local4) - _arg2);
}
public function CheckForPlayer(_arg1:int){
var _local2:Array;
var _local3:Array;
var _local4:Number;
_local2 = [pWorldX, pWorldY, pWorldZ];
_local3 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local4 = gGameObj.DistanceTo(_local2, _local3);
if (_local4 < _arg1){
return (true);
};
return (false);
}
public function WorldTranslate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean){
var _local5:Boolean;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:Point;
var _local10:Point;
var _local11:Point;
var _local12:Point;
var _local13:Boolean;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local5 = true;
_local6 = gGameObj.Translate_Increment(_arg1, 50, 30);
_local7 = gGameObj.Translate_Increment(_arg2, 50, 30);
_local8 = gGameObj.Translate_Increment(_arg3, 50, 30);
_local9 = new Point(pObject_MC.x, pObject_MC.y);
_local10 = gamemap.localToGlobal(_local9);
_local11 = new Point(_local10.x, _local10.y);
_local12 = new Point(pObject_MC.x, pObject_MC.y);
_local13 = false;
if (_arg4 == true){
if (_local6 > 0){
_local12 = new Point(((_local11.x + 30) + _local6), _local11.y);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local6 = 0;
};
};
if (_local6 < 0){
_local12 = new Point(((_local11.x - 30) + _local6), _local11.y);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local6 = 0;
};
};
if (_local8 > 0){
_local12 = new Point((_local11.x + _local6), (_local11.y + 30));
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
_local12 = new Point(((_local11.x - 15) + _local6), (_local11.y + 30));
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
if (_local13 == true){
_local8 = 0;
};
_local12 = new Point(((_local11.x + 15) + _local6), (_local11.y + 30));
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
};
if (_local8 < 0){
_local12 = new Point((_local11.x + _local6), (_local11.y - 20));
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
_local12 = new Point(((_local11.x - 15) + _local6), (_local11.y - 20));
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
_local12 = new Point(((_local11.x + 15) + _local6), (_local11.y - 20));
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
};
};
if ((((((_local6 == 0)) && ((_local7 == 0)))) && ((_local8 == 0)))){
_local5 = false;
};
_local14 = (pWorldX + _local6);
_local15 = (pWorldY + _local7);
_local16 = (pWorldZ + _local8);
SetWorldPosition(_local14, _local15, _local16);
return (_local5);
}
}
}//package com.citysuperhero
Section 8
//Mobster (com.citysuperhero.Mobster)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class Mobster extends NPC {
public var pState:String;// = "1"
public var pDeathDir:String;
private var lastTime:int;
public var pDeathState:String;
private var pStartTime:int;
public var pMobster_MC:MobsterMovieClip;
public var pType:String;
public var pDeathDelay:int;
public function Mobster(_arg1:Object, _arg2:Object){
pMobster_MC = new MobsterMovieClip();
pState = "1";
super();
gGameObj = _arg1;
MainObj = gGameObj.MainObj;
gGameObj.pDisplay_Registry_List.push(this);
gGameObj.pCharacter_Registry_List.push(this);
gGameObj.pNPC_Registry_List.push(this);
gamemap = MainObj.gamemap;
pWorldX = _arg2.X;
pWorldY = _arg2.Y;
pWorldZ = _arg2.Z;
pSpeed = _arg2.spd;
pMode = _arg2.mode;
pType = _arg2.type;
pSpawnName = _arg2.name;
pWaypoints_List = _arg2.waypoints;
pCharacter_MC = pMobster_MC;
pNPCType = "Mobster";
initShadowMovieClipAttributes();
initMobsterMovieClipAttributes();
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
MainObj.addEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function initMobsterMovieClipAttributes(){
pCharacter_MC.x = 600;
pCharacter_MC.y = 600;
pCharacter_MC.gotoAndStop(1);
gamemap.addChild(pCharacter_MC);
}
public function CheckModes(){
switch (pMode){
case "Stand":
AttackLogic();
Animate();
break;
case "Wander":
WayPoints();
Animate();
AttackLogic();
break;
case "Chase":
Chase();
Animate();
break;
case "Death":
Death();
break;
};
}
public function Animate(){
var _local1:int;
var _local2:Number;
var _local3:Number;
if (lastTime == 0){
lastTime = getTimer();
};
_local1 = (getTimer() - lastTime);
if (_local1 > 100){
switch (pAction){
case "swr":
_local2 = 4;
_local3 = 5;
break;
case "swl":
_local2 = 6;
_local3 = 7;
break;
case "wf":
_local2 = 2;
_local3 = 3;
break;
case "wb":
_local2 = 8;
_local3 = 9;
break;
case "ssr":
_local2 = 4;
_local3 = 4;
break;
case "ssl":
_local2 = 6;
_local3 = 6;
break;
case "sf":
_local2 = 1;
_local3 = 1;
break;
case "sb":
_local2 = 8;
_local3 = 8;
break;
case "asr":
_local2 = 11;
_local3 = 11;
break;
case "asl":
_local2 = 12;
_local3 = 12;
break;
case "dth":
_local2 = 13;
_local3 = 13;
break;
};
if (pCharacter_MC.currentFrame >= _local3){
pCharacter_MC.gotoAndStop(_local2);
lastTime = getTimer();
} else {
if (pCharacter_MC.currentFrame < _local2){
pCharacter_MC.gotoAndStop(_local2);
lastTime = getTimer();
} else {
pCharacter_MC.gotoAndStop((pCharacter_MC.currentFrame + 1));
lastTime = getTimer();
};
};
};
}
public function DestroyMobster(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
gamemap.removeChild(pShadow_MC);
pShadow_MC = null;
gamemap.removeChild(pCharacter_MC);
pCharacter_MC = null;
_local1 = 0;
while (_local1 < gGameObj.pNPC_Registry_List.length) {
_local2 = gGameObj.pNPC_Registry_List[_local1];
if (_local2 == this){
gGameObj.pNPC_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
_local1 = 0;
while (_local1 < gGameObj.pCharacter_Registry_List.length) {
_local3 = gGameObj.pCharacter_Registry_List[_local1];
if (_local3 == this){
gGameObj.pCharacter_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
_local1 = 0;
while (_local1 < gGameObj.pDisplay_Registry_List.length) {
_local4 = gGameObj.pDisplay_Registry_List[_local1];
if (_local4 == this){
gGameObj.pDisplay_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
MainObj.removeEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function AttackLogic(){
var _local1:Array;
var _local2:Array;
var _local3:Number;
var _local4:int;
var _local5:Boolean;
var _local6:ChatBubble;
var _local7:String;
var _local8:Object;
var _local9:GunBullet;
var _local10:String;
var _local11:int;
if (gGameObj.heroClassRef.pIdentity == "Nerd"){
switch (pState){
case "1":
_local1 = [pWorldX, pWorldY, pWorldZ];
_local2 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local3 = gGameObj.DistanceTo(_local1, _local2);
if (_local3 < 200){
_local5 = false;
if (pWorldX < gGameObj.heroClassRef.pWorldX){
switch (pAction){
case "ssr":
case "swr":
pAction = "ssr";
_local5 = true;
break;
};
};
if (pWorldX > gGameObj.heroClassRef.pWorldX){
switch (pAction){
case "ssl":
case "swl":
pAction = "ssl";
_local5 = true;
break;
};
};
if (pWorldZ < gGameObj.heroClassRef.pWorldZ){
switch (pAction){
case "wf":
case "sf":
pAction = "sf";
_local5 = true;
break;
};
};
if (pWorldZ > gGameObj.heroClassRef.pWorldZ){
switch (pAction){
case "wb":
case "sb":
pAction = "sb";
_local5 = true;
break;
};
};
if (_local5 == true){
_local6 = new ChatBubble(gGameObj, "Buzz Off!", {x:0, y:"-85"}, pCharacter_MC, 3000);
pMode = "Stand";
pStartTime = getTimer();
pState = "2";
};
};
break;
case "2":
_local1 = [pWorldX, pWorldY, pWorldZ];
_local2 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local3 = gGameObj.DistanceTo(_local1, _local2);
if (_local3 > 200){
_local4 = (getTimer() - pStartTime);
if (_local4 > 3000){
switch (pType){
case "standard":
pMode = "Wander";
break;
case "chaseattack":
pMode = "Stand";
break;
};
pState = "1";
};
};
if (_local3 < 150){
_local4 = (getTimer() - pStartTime);
if (_local4 > 3000){
_local6 = new ChatBubble(gGameObj, "I Warned You!", {x:0, y:"-85"}, pCharacter_MC, 3000);
};
if (_local4 > 1000){
switch (pAction){
case "ssr":
pAction = "asr";
_local7 = "e";
break;
case "ssl":
pAction = "asl";
_local7 = "w";
break;
case "sf":
pAction = "sf";
_local7 = "s";
break;
case "sb":
pAction = "sb";
_local7 = "n";
break;
};
if (gGameObj.heroClassRef.pHurtState == "0"){
_local8 = new Object();
_local8.x = pWorldX;
_local8.y = pWorldY;
_local8.z = pWorldZ;
_local9 = new GunBullet(gGameObj, _local8, _local7);
pStartTime = getTimer();
};
};
};
_local4 = (getTimer() - pStartTime);
if (_local4 > 300){
if (pWorldX < gGameObj.heroClassRef.pWorldX){
pAction = "ssr";
};
if (pWorldX > gGameObj.heroClassRef.pWorldX){
pAction = "ssl";
};
_local10 = gGameObj.GetDirectionFrom(this, gGameObj.heroClassRef);
switch (_local10){
case "left":
pAction = "ssr";
break;
case "right":
pAction = "ssl";
break;
case "back":
pAction = "sf";
break;
case "front":
pAction = "sb";
break;
};
switch (pAction){
case "asr":
pAction = "ssr";
break;
case "asl":
pAction = "ssl";
break;
};
};
break;
};
};
if (gGameObj.heroClassRef.pIdentity == "Hero"){
switch (pState){
case "1":
_local1 = [pWorldX, pWorldY, pWorldZ];
_local2 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local3 = gGameObj.DistanceTo(_local1, _local2);
if (_local3 < 300){
_local5 = false;
if (pWorldX < gGameObj.heroClassRef.pWorldX){
switch (pAction){
case "ssr":
case "swr":
case "sf":
case "sb":
pAction = "ssr";
_local5 = true;
break;
};
};
if (pWorldX > gGameObj.heroClassRef.pWorldX){
switch (pAction){
case "ssl":
case "swl":
case "sf":
case "sb":
pAction = "ssl";
_local5 = true;
break;
};
};
if (_local5 == true){
_local6 = new ChatBubble(gGameObj, "It's Him!", {x:0, y:"-85"}, pCharacter_MC, 3000);
switch (pType){
case "standard":
pMode = "Stand";
break;
case "chaseattack":
pMode = "Chase";
break;
};
pStartTime = getTimer();
pState = "2";
};
};
break;
case "2":
_local1 = [pWorldX, pWorldY, pWorldZ];
_local2 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local3 = gGameObj.DistanceTo(_local1, _local2);
if (_local3 > 300){
_local4 = (getTimer() - pStartTime);
if (_local4 > 3000){
switch (pType){
case "standard":
pMode = "Wander";
break;
case "chaseattack":
pMode = "Stand";
break;
};
pState = "1";
};
};
if (_local3 < 250){
_local4 = (getTimer() - pStartTime);
if (_local4 > 3000){
_local6 = new ChatBubble(gGameObj, "DIE!!!", {x:0, y:"-85"}, pCharacter_MC, 3000);
};
_local11 = 3000;
if (gGameObj.pCurrentLevel > 2){
_local11 = 2500;
};
if (gGameObj.pCurrentLevel > 4){
_local11 = 2000;
};
if (_local4 > _local11){
switch (pAction){
case "ssr":
pAction = "asr";
_local7 = "e";
break;
case "ssl":
pAction = "asl";
_local7 = "w";
break;
case "sf":
pAction = "sf";
_local7 = "s";
break;
case "sb":
pAction = "sb";
_local7 = "n";
break;
};
_local8 = new Object();
_local8.x = pWorldX;
_local8.y = pWorldY;
_local8.z = pWorldZ;
_local9 = new GunBullet(gGameObj, _local8, _local7);
pStartTime = getTimer();
};
};
_local4 = (getTimer() - pStartTime);
if (_local4 > 300){
_local10 = gGameObj.GetDirectionFrom(this, gGameObj.heroClassRef);
switch (_local10){
case "left":
pAction = "ssr";
break;
case "right":
pAction = "ssl";
break;
case "back":
pAction = "sf";
break;
case "front":
pAction = "sb";
break;
};
switch (pAction){
case "asr":
pAction = "ssr";
break;
case "asl":
pAction = "ssl";
break;
};
};
break;
};
};
}
public function Death(){
var _local1:PunchHardSnd;
var _local2:SoundChannel;
var _local3:ZoomAwaySnd;
var _local4:SoundChannel;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
switch (pDeathState){
case "1":
_local1 = new PunchHardSnd();
_local2 = _local1.play();
_local3 = new ZoomAwaySnd();
_local4 = _local3.play();
lastTime = (getTimer() - 1000);
switch (gGameObj.heroClassRef.Player_Action){
case "pr2":
pAction = "dth";
pDeathDir = "right";
break;
case "pl2":
pAction = "dth";
pDeathDir = "left";
break;
case "pf2":
pAction = "dth";
pDeathDir = "forward";
break;
case "pb2":
pAction = "dth";
pDeathDir = "backward";
break;
};
Animate();
pDeathDelay = getTimer();
pDeathState = "2";
break;
case "2":
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = 20;
switch (pDeathDir){
case "right":
_local5 = 15;
_local6 = 5;
break;
case "left":
_local5 = -15;
_local6 = 5;
break;
case "forward":
_local7 = 15;
_local6 = 5;
break;
case "backward":
_local7 = -15;
_local6 = 5;
break;
};
WorldTranslate(_local5, _local6, _local7, false);
pCharacter_MC.rotation = (pCharacter_MC.rotation + gGameObj.Translate_Increment(_local8, 50, 30));
_local9 = (getTimer() - pDeathDelay);
if (_local9 > 2000){
DestroyMobster();
};
break;
};
}
public function KillMobster(){
if (pDeathState == null){
pMode = "Death";
pDeathState = "1";
return (true);
};
return (false);
}
public function GameUpdate(_arg1:Event){
switch (gGameObj.gGame_Status){
case "Gameplay":
CheckModes();
break;
case "CleanUp":
DestroyMobster();
break;
};
}
}
}//package com.citysuperhero
Section 9
//Mutant (com.citysuperhero.Mutant)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class Mutant extends NPC {
public var pDir:String;
public var pState:String;// = "1"
public var pDeathDir:String;
public var pPunchState:String;// = "1"
private var lastTime:int;
public var pDeathState:String;
public var pMutant_MC:MutantMovieClip;
public var pPunchDelay:int;
private var pStartTime:int;
public var pPunchDir:String;
public var pType:String;
public var pDeathDelay:int;
public function Mutant(_arg1:Object, _arg2:Object){
pMutant_MC = new MutantMovieClip();
pState = "1";
pPunchState = "1";
super();
gGameObj = _arg1;
MainObj = gGameObj.MainObj;
gGameObj.pDisplay_Registry_List.push(this);
gGameObj.pCharacter_Registry_List.push(this);
gGameObj.pNPC_Registry_List.push(this);
gamemap = MainObj.gamemap;
pWorldX = _arg2.X;
pWorldY = _arg2.Y;
pWorldZ = _arg2.Z;
pSpeed = _arg2.spd;
pMode = _arg2.mode;
pType = _arg2.type;
pSpawnName = _arg2.name;
pWaypoints_List = _arg2.waypoints;
pCharacter_MC = pMutant_MC;
pNPCType = "Mutant";
pDir = "left";
initShadowMovieClipAttributes();
initMutantMovieClipAttributes();
SetWorldPosition(pWorldX, pWorldY, pWorldZ);
MainObj.addEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function Punch(){
var _local1:String;
var _local2:RoarSnd;
var _local3:SoundChannel;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Object;
switch (pPunchState){
case "1":
lastTime = (getTimer() - 1000);
_local1 = gGameObj.GetDirectionFrom(this, gGameObj.heroClassRef);
switch (_local1){
case "right":
pAction = "pl1";
pPunchDir = "left";
break;
case "left":
pAction = "pr1";
pPunchDir = "right";
break;
case "front":
pPunchDir = "backward";
break;
case "back":
pAction = "pf1";
pPunchDir = "forward";
break;
};
Animate();
pPunchDelay = getTimer();
pPunchState = "2";
_local2 = new RoarSnd();
_local3 = _local2.play();
break;
case "2":
_local4 = 0;
_local5 = 0;
_local6 = 0;
switch (pPunchDir){
case "right":
_local4 = -5;
break;
case "left":
_local4 = 5;
break;
case "forward":
_local6 = -5;
break;
case "backward":
_local6 = 5;
break;
};
_local7 = (getTimer() - pPunchDelay);
if (_local7 > 250){
lastTime = (getTimer() - 1000);
pPunchDelay = getTimer();
pPunchState = "3";
};
break;
case "3":
_local4 = 0;
_local5 = 0;
_local6 = 0;
switch (pPunchDir){
case "right":
pAction = "pr2";
_local4 = 15;
break;
case "left":
pAction = "pl2";
_local4 = -15;
break;
case "forward":
pAction = "pf2";
_local6 = 15;
break;
case "backward":
_local6 = -15;
break;
};
WorldTranslate(_local4, _local5, _local6, true);
Animate();
_local8 = new Object();
_local8.ParentMC = pCharacter_MC;
_local8.ParticleMC = "Mutant";
_local8.frame = pCharacter_MC.currentFrame;
_local8.x = pWorldX;
_local8.y = pWorldY;
_local8.z = pWorldZ;
_local8.startfade = 0.75;
_local8.fadeincre = 0.02;
CheckPlayerHit();
_local7 = (getTimer() - pPunchDelay);
if (_local7 > 500){
lastTime = (getTimer() - 1000);
pPunchState = "4";
};
break;
case "4":
switch (pPunchDir){
case "right":
Player_Action = "ssr";
break;
case "left":
Player_Action = "ssl";
break;
case "forward":
Player_Action = "sf";
break;
case "backward":
Player_Action = "sb";
break;
};
Animate();
pMode = "Wander";
pPunchState = "1";
break;
};
}
public function CheckForPlayer(_arg1:int){
var _local2:Array;
var _local3:Array;
var _local4:Number;
_local2 = [pWorldX, pWorldY, pWorldZ];
_local3 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local4 = gGameObj.DistanceTo(_local2, _local3);
if (_local4 < _arg1){
return (true);
};
return (false);
}
public function KillMutant(){
if (pDeathState == null){
pMode = "Death";
pDeathState = "1";
return (true);
};
return (false);
}
public function Animate(){
var _local1:int;
var _local2:Number;
var _local3:Number;
if (lastTime == 0){
lastTime = getTimer();
};
_local1 = (getTimer() - lastTime);
if (_local1 > 100){
switch (pAction){
case "swr":
_local2 = 4;
_local3 = 5;
break;
case "swl":
_local2 = 6;
_local3 = 7;
break;
case "wf":
_local2 = 2;
_local3 = 3;
break;
case "wb":
_local2 = 8;
_local3 = 9;
break;
case "ssr":
_local2 = 4;
_local3 = 4;
break;
case "ssl":
_local2 = 6;
_local3 = 6;
break;
case "sf":
_local2 = 1;
_local3 = 1;
break;
case "sb":
_local2 = 8;
_local3 = 8;
break;
case "asr":
_local2 = 11;
_local3 = 11;
break;
case "asl":
_local2 = 12;
_local3 = 12;
break;
case "pr1":
_local2 = 11;
_local3 = 11;
break;
case "pl1":
_local2 = 16;
_local3 = 16;
break;
case "pf1":
_local2 = 13;
_local3 = 13;
break;
case "pr2":
_local2 = 12;
_local3 = 12;
break;
case "pl2":
_local2 = 17;
_local3 = 17;
break;
case "pf2":
_local2 = 14;
_local3 = 14;
break;
case "dth":
_local2 = 13;
_local3 = 13;
break;
};
if (pCharacter_MC.currentFrame >= _local3){
pCharacter_MC.gotoAndStop(_local2);
lastTime = getTimer();
} else {
if (pCharacter_MC.currentFrame < _local2){
pCharacter_MC.gotoAndStop(_local2);
lastTime = getTimer();
} else {
pCharacter_MC.gotoAndStop((pCharacter_MC.currentFrame + 1));
lastTime = getTimer();
};
};
};
}
public function initMutantMovieClipAttributes(){
pCharacter_MC.x = 600;
pCharacter_MC.y = 600;
pCharacter_MC.gotoAndStop(1);
pAction = "sf";
gamemap.addChild(pCharacter_MC);
}
public function AttackLogic(){
var _local1:int;
var _local2:Boolean;
var _local3:*;
var _local4:int;
var _local5:String;
var _local6:Array;
var _local7:Array;
var _local8:Number;
if (gGameObj.heroClassRef.pIdentity == "Nerd"){
switch (pState){
case "1":
_local1 = pSpeed;
_local2 = false;
switch (pDir){
case "left":
_local2 = WorldTranslate(-((_local1 + (_local1 * 0.25))), 0, 0, true);
pAction = "swl";
if (_local2 == false){
pDir = "up";
};
break;
case "right":
_local2 = WorldTranslate((_local1 + (_local1 * 0.25)), 0, 0, true);
pAction = "swr";
if (_local2 == false){
pDir = "down";
};
break;
case "up":
pAction = "wb";
_local2 = WorldTranslate(0, 0, -(_local1), true);
if (_local2 == false){
pDir = "right";
};
break;
case "down":
_local2 = WorldTranslate(0, 0, _local1, true);
pAction = "wf";
if (_local2 == false){
pDir = "left";
};
break;
};
_local3 = (getTimer() - pStartTime);
if (_local3 > 2000){
switch (pDir){
case "left":
pDir = "down";
break;
case "right":
pDir = "up";
break;
case "up":
pDir = "left";
break;
case "down":
pDir = "right";
break;
};
pStartTime = getTimer();
};
_local4 = CheckForPlayer(50);
if (_local4 == true){
_local5 = gGameObj.GetDirectionFrom(this, gGameObj.heroClassRef);
gGameObj.heroClassRef.PlayerHit(_local5);
};
break;
};
};
if (gGameObj.heroClassRef.pIdentity == "Hero"){
switch (pState){
case "1":
Chase();
_local6 = [pWorldX, pWorldY, pWorldZ];
_local7 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local8 = gGameObj.DistanceTo(_local6, _local7);
if (_local8 < 75){
pMode = "Punch";
};
break;
};
};
}
public function CheckModes(){
switch (pMode){
case "Stand":
AttackLogic();
Animate();
break;
case "Wander":
Animate();
AttackLogic();
break;
case "Patrol":
Animate();
AttackLogic();
break;
case "Chase":
Chase();
Animate();
break;
case "Punch":
Punch();
break;
case "Death":
Death();
break;
};
}
public function DestroyMutant(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
gamemap.removeChild(pShadow_MC);
pShadow_MC = null;
gamemap.removeChild(pCharacter_MC);
pCharacter_MC = null;
_local1 = 0;
while (_local1 < gGameObj.pNPC_Registry_List.length) {
_local2 = gGameObj.pNPC_Registry_List[_local1];
if (_local2 == this){
gGameObj.pNPC_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
_local1 = 0;
while (_local1 < gGameObj.pCharacter_Registry_List.length) {
_local3 = gGameObj.pCharacter_Registry_List[_local1];
if (_local3 == this){
gGameObj.pCharacter_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
_local1 = 0;
while (_local1 < gGameObj.pDisplay_Registry_List.length) {
_local4 = gGameObj.pDisplay_Registry_List[_local1];
if (_local4 == this){
gGameObj.pDisplay_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
MainObj.removeEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function Death(){
var _local1:PunchHardSnd;
var _local2:SoundChannel;
var _local3:ZoomAwaySnd;
var _local4:SoundChannel;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
switch (pDeathState){
case "1":
_local1 = new PunchHardSnd();
_local2 = _local1.play();
_local3 = new ZoomAwaySnd();
_local4 = _local3.play();
lastTime = (getTimer() - 1000);
switch (gGameObj.heroClassRef.Player_Action){
case "pr2":
pAction = "dth";
pDeathDir = "right";
break;
case "pl2":
pAction = "dth";
pDeathDir = "left";
break;
case "pf2":
pAction = "dth";
pDeathDir = "forward";
break;
case "pb2":
pAction = "dth";
pDeathDir = "backward";
break;
};
Animate();
pDeathDelay = getTimer();
pDeathState = "2";
break;
case "2":
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = 20;
switch (pDeathDir){
case "right":
_local5 = 15;
_local6 = 5;
break;
case "left":
_local5 = -15;
_local6 = 5;
break;
case "forward":
_local7 = 15;
_local6 = 5;
break;
case "backward":
_local7 = -15;
_local6 = 5;
break;
};
WorldTranslate(_local5, _local6, _local7, false);
pCharacter_MC.rotation = (pCharacter_MC.rotation + gGameObj.Translate_Increment(_local8, 50, 30));
_local9 = (getTimer() - pDeathDelay);
if (_local9 > 2000){
DestroyMutant();
};
break;
};
}
public function CheckPlayerHit(){
var _local1:Array;
var _local2:Array;
var _local3:Number;
var _local4:String;
_local1 = [pWorldX, pWorldY, pWorldZ];
_local2 = [gGameObj.heroClassRef.pWorldX, gGameObj.heroClassRef.pWorldY, gGameObj.heroClassRef.pWorldZ];
_local3 = gGameObj.DistanceTo(_local1, _local2);
if (_local3 < 50){
_local4 = gGameObj.GetDirectionFrom(this, gGameObj.heroClassRef);
gGameObj.heroClassRef.PlayerHit(_local4);
};
}
public function GameUpdate(_arg1:Event){
switch (gGameObj.gGame_Status){
case "Gameplay":
CheckModes();
break;
case "CleanUp":
DestroyMutant();
break;
};
}
}
}//package com.citysuperhero
Section 10
//NPC (com.citysuperhero.NPC)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class NPC {
public var pCharacter_MC;
public var pShadow_MC:CharShadowMovieClip;
private var lastTime:int;
public var pWorldX:Number;
public var pWorldY:Number;
public var pWorldZ:Number;
public var pSpawnName:String;
public var pX_Destin;
public var pRunAway_Obj:Object;
public var gamemap;
public var pNPCType:String;
public var pWaypoint_Delay:int;
public var pSpeed:Number;
public var pMode:String;
public var gGameObj;
public var pWaypoint_State;// = 1
public var pStartX:Number;
public var pStartY:Number;
public var pStartZ:Number;
public var pObject_Type;// = "Character"
public var pAction:String;
public var pIdentity:String;
public var Player_Action:String;// = "swr"
public var pZ_Destin:Number;
public var MainObj;
public var pWaypoints_List:Array;
public var pWaypoint_Pointer;// = 0
public var pWaypoint_Speed:Number;
public var pY_Destin;
public function NPC(){
pObject_Type = "Character";
Player_Action = "swr";
pWaypoint_Pointer = 0;
pWaypoint_State = 1;
pShadow_MC = new CharShadowMovieClip();
super();
}
public function RunAway(){
var _local1:int;
var _local2:int;
_local2 = pSpeed;
if (pRunAway_Obj == null){
pRunAway_Obj = gGameObj.heroClassRef;
};
if (pWorldX > pRunAway_Obj.pWorldX){
_local1 = (pWorldX - pRunAway_Obj.pWorldX);
if (_local1 > 50){
WorldTranslate(_local2, 0, 0, true);
pAction = "swr";
};
};
if (pWorldX < pRunAway_Obj.pWorldX){
_local1 = (pRunAway_Obj.pWorldX - pWorldX);
if (_local1 > 50){
WorldTranslate(-(_local2), 0, 0, true);
pAction = "swl";
};
};
if (pWorldZ > pRunAway_Obj.pWorldZ){
_local1 = (pWorldZ - pRunAway_Obj.pWorldZ);
if (_local1 > 50){
WorldTranslate(0, 0, _local2, true);
pAction = "wf";
};
};
if (pWorldZ < pRunAway_Obj.pWorldZ){
_local1 = (pRunAway_Obj.pWorldZ - pWorldZ);
if (_local1 > 50){
WorldTranslate(0, 0, -(_local2), true);
pAction = "wb";
};
};
}
public function WorldTranslate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean){
var _local5:Boolean;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:Point;
var _local10:Point;
var _local11:Point;
var _local12:Point;
var _local13:Boolean;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local5 = true;
_local6 = gGameObj.Translate_Increment(_arg1, 50, 30);
_local7 = gGameObj.Translate_Increment(_arg2, 50, 30);
_local8 = gGameObj.Translate_Increment(_arg3, 50, 30);
_local9 = new Point(pCharacter_MC.x, pCharacter_MC.y);
_local10 = gamemap.localToGlobal(_local9);
_local11 = new Point(_local10.x, (_local10.y + 40));
_local12 = new Point(_local11.x, _local11.y);
_local13 = false;
if (_arg4 == true){
if (_local6 > 0){
_local12 = new Point(((_local11.x + 30) + _local6), _local11.y);
_local13 = NPC_Collision(_local12);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local6 = 0;
};
if (_local13 == true){
_local6 = 0;
};
};
if (_local6 < 0){
_local12 = new Point(((_local11.x - 30) + _local6), _local11.y);
_local13 = NPC_Collision(_local12);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local6 = 0;
};
if (_local13 == true){
_local6 = 0;
};
};
if (_local8 > 0){
_local12 = new Point((_local11.x + _local6), (_local11.y + 30));
_local13 = NPC_Collision(_local12);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
if (_local13 == true){
_local8 = 0;
};
_local12 = new Point(((_local11.x - 15) + _local6), (_local11.y + 30));
_local13 = NPC_Collision(_local12);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
if (_local13 == true){
_local8 = 0;
};
_local12 = new Point(((_local11.x + 15) + _local6), (_local11.y + 30));
_local13 = NPC_Collision(_local12);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
if (_local13 == true){
_local8 = 0;
};
};
if (_local8 < 0){
_local12 = new Point((_local11.x + _local6), (_local11.y - 20));
_local13 = NPC_Collision(_local12);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
if (_local13 == true){
_local8 = 0;
};
_local12 = new Point(((_local11.x - 15) + _local6), (_local11.y - 20));
_local13 = NPC_Collision(_local12);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
if (_local13 == true){
_local8 = 0;
};
_local12 = new Point(((_local11.x + 15) + _local6), (_local11.y - 20));
_local13 = NPC_Collision(_local12);
if (MainObj.collisionmap.hitTestPoint(_local12.x, _local12.y, true)){
_local8 = 0;
};
if (_local13 == true){
_local8 = 0;
};
};
};
if ((((((_local6 == 0)) && ((_local7 == 0)))) && ((_local8 == 0)))){
_local5 = false;
};
_local14 = (pWorldX + _local6);
_local15 = (pWorldY + _local7);
_local16 = (pWorldZ + _local8);
SetWorldPosition(_local14, _local15, _local16);
return (_local5);
}
public function WayPoints(){
var _local1:Object;
var _local2:Boolean;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:Number;
switch (pWaypoint_State){
case 1:
_local1 = pWaypoints_List[pWaypoint_Pointer];
pX_Destin = (_local1.x + pWorldX);
pY_Destin = (_local1.y + pWorldY);
pZ_Destin = (_local1.z + pWorldZ);
pWaypoint_Speed = _local1.spd;
pWaypoint_State = 2;
break;
case 2:
_local2 = true;
_local1 = pWaypoints_List[pWaypoint_Pointer];
_local3 = pX_Destin;
_local4 = pY_Destin;
_local5 = pZ_Destin;
_local6 = pWaypoint_Speed;
_local7 = pWorldX;
if (_local7 != _local3){
_local2 = false;
if (_local7 < _local3){
_local7 = (_local7 + gGameObj.Translate_Increment(_local6, 50, 30));
if (_local7 > _local3){
_local7 = _local3;
};
};
if (_local7 > _local3){
_local7 = (_local7 - gGameObj.Translate_Increment(_local6, 50, 30));
if (_local7 < _local3){
_local7 = _local3;
};
};
};
_local8 = pWorldY;
if (_local8 != _local4){
_local2 = false;
if (_local8 < _local4){
_local8 = (_local8 + gGameObj.Translate_Increment(_local6, 50, 30));
if (_local8 > _local4){
_local8 = _local4;
};
};
if (_local8 > _local4){
_local8 = (_local8 - gGameObj.Translate_Increment(_local6, 50, 30));
if (_local8 < _local4){
_local8 = _local4;
};
};
};
_local9 = pWorldZ;
if (_local9 != _local5){
_local2 = false;
if (_local9 < _local5){
_local9 = (_local9 + gGameObj.Translate_Increment(_local6, 50, 30));
if (_local9 > _local5){
_local9 = _local5;
};
};
if (_local9 > _local5){
_local9 = (_local9 - gGameObj.Translate_Increment(_local6, 50, 30));
if (_local9 < _local5){
_local9 = _local5;
};
};
};
SetWorldPosition(_local7, _local8, _local9);
if (_local2 == false){
if (_local7 < _local3){
pAction = "swr";
};
if (_local7 > _local3){
pAction = "swl";
};
if (_local9 < _local5){
pAction = "wf";
};
if (_local9 > _local5){
pAction = "wb";
};
};
if (_local2 == true){
switch (pAction){
case "swr":
pAction = "ssr";
break;
case "swl":
pAction = "ssl";
break;
case "wf":
pAction = "sf";
break;
case "wb":
pAction = "sb";
break;
};
pWaypoint_Delay = getTimer();
pWaypoint_State = 3;
};
break;
case 3:
_local1 = pWaypoints_List[pWaypoint_Pointer];
_local10 = _local1.t;
_local11 = ((getTimer() - pWaypoint_Delay) * 0.001);
if (_local11 > _local10){
if ((pWaypoint_Pointer + 1) < pWaypoints_List.length){
pWaypoint_Pointer++;
} else {
pWaypoint_Pointer = 0;
};
pWaypoint_State = 1;
};
break;
};
}
public function NPC_Collision(_arg1:Point){
var _local2:*;
var _local3:*;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Number;
_local2 = 0;
while (_local2 < gGameObj.pNPC_Registry_List.length) {
_local3 = gGameObj.pNPC_Registry_List[_local2];
_local4 = new Point(_local3.pCharacter_MC.x, _local3.pCharacter_MC.y);
_local5 = new Point(_local3.pCharacter_MC.x, _local3.pCharacter_MC.y);
_local6 = gamemap.localToGlobal(_local5);
_local7 = new Point(_local6.x, (_local6.y + 40));
_local8 = Point.distance(_local7, _arg1);
if (_local8 < 20){
return (true);
};
_local2++;
};
}
public function initShadowMovieClipAttributes(){
pShadow_MC.name = "shadow";
pShadow_MC.width = 45;
pShadow_MC.height = 17;
pShadow_MC.alpha = 0.3;
pShadow_MC.gotoAndStop(1);
gamemap.addChild(pShadow_MC);
}
public function SetWorldPosition(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:Number;
pWorldX = _arg1;
pWorldY = _arg2;
pWorldZ = _arg3;
pCharacter_MC.x = _arg1;
pCharacter_MC.y = _arg3;
pShadow_MC.x = _arg1;
pShadow_MC.y = _arg3;
_local4 = 40;
pCharacter_MC.y = ((pCharacter_MC.y - _local4) - _arg2);
}
public function Chase(){
var _local1:int;
var _local2:int;
var _local3:Boolean;
var _local4:Boolean;
_local2 = pSpeed;
_local3 = false;
_local4 = false;
if (pWorldX > gGameObj.heroClassRef.pWorldX){
_local1 = (pWorldX - gGameObj.heroClassRef.pWorldX);
if (_local1 > 50){
_local3 = WorldTranslate(-((_local2 + (_local2 * 0.25))), 0, 0, true);
if (_local3 == true){
_local4 = true;
};
pAction = "swl";
};
};
if (pWorldX < gGameObj.heroClassRef.pWorldX){
_local1 = (gGameObj.heroClassRef.pWorldX - pWorldX);
if (_local1 > 50){
_local3 = WorldTranslate((_local2 + (_local2 * 0.25)), 0, 0, true);
if (_local3 == true){
_local4 = true;
};
pAction = "swr";
};
};
if (pWorldZ > gGameObj.heroClassRef.pWorldZ){
_local1 = (pWorldZ - gGameObj.heroClassRef.pWorldZ);
if (_local1 > 50){
_local3 = WorldTranslate(0, 0, -(_local2), true);
if (_local3 == true){
_local4 = true;
};
pAction = "wb";
};
};
if (pWorldZ < gGameObj.heroClassRef.pWorldZ){
_local1 = (gGameObj.heroClassRef.pWorldZ - pWorldZ);
if (_local1 > 50){
_local3 = WorldTranslate(0, 0, _local2, true);
if (_local3 == true){
_local4 = true;
};
pAction = "wf";
};
};
if (_local4 == false){
switch (pAction){
case "swr":
pAction = "ssr";
break;
case "swl":
pAction = "ssl";
break;
case "wf":
pAction = "sf";
break;
case "wb":
pAction = "sb";
break;
};
};
}
}
}//package com.citysuperhero
Section 11
//TrailParticle (com.citysuperhero.TrailParticle)
package com.citysuperhero {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.media.*;
import flash.filters.*;
public class TrailParticle extends LevelObject {
public var pState:String;// = "1"
public var pParticle_MC_Name;
public var pType;
public var pParticle_MC;
public var pFrame:int;
public var pFadeIncre:Number;
private var lastTime:int;
public var pStartFade:Number;
public var pParent_MC;
private var pStartTime:int;
public function TrailParticle(_arg1:Object, _arg2:Object){
pState = "1";
super();
gGameObj = _arg1;
MainObj = gGameObj.MainObj;
gamemap = MainObj.gamemap;
gGameObj.pDisplay_Registry_List.push(this);
pParent_MC = _arg2.ParentMC;
pParticle_MC_Name = _arg2.ParticleMC;
pFrame = _arg2.frame;
pWorldX = _arg2.x;
pWorldY = _arg2.y;
pWorldZ = _arg2.z;
pType = _arg2.type;
pStartFade = _arg2.startfade;
pFadeIncre = _arg2.fadeincre;
MainObj.addEventListener(Event.ENTER_FRAME, GameUpdate);
}
public function GameUpdate(_arg1:Event){
switch (gGameObj.gGame_Status){
case "Gameplay":
DisplayTrailParticle();
break;
case "CleanUp":
DestroyTrailParticle();
break;
};
}
public function DisplayTrailParticle(){
var _local1:Number;
var _local2:Number;
var _local3:HeroMovieClip;
var _local4:MutantMovieClip;
var _local5:PointsOverlay;
var _local6:BlurFilter;
var _local7:Array;
var _local8:BlurFilter;
switch (pState){
case "1":
switch (pParticle_MC_Name){
case "Hero":
_local3 = new HeroMovieClip();
pParticle_MC = _local3;
break;
case "Mutant":
_local4 = new MutantMovieClip();
pParticle_MC = _local4;
break;
case "Point":
_local5 = new PointsOverlay();
pParticle_MC = _local5;
break;
};
pParticle_MC.alpha = pStartFade;
pParticle_MC.gotoAndStop(pFrame);
gamemap.addChild(pParticle_MC);
pObject_MC = pParticle_MC;
pObject_MC.x = pParent_MC.x;
pObject_MC.y = pParent_MC.y;
pObject_MC.name = "TrailParticle";
switch (pType){
case "blur":
_local6 = new BlurFilter();
_local6.blurX = 1;
_local6.blurY = 1;
pParticle_MC.filters = [_local6];
break;
};
pState = "2";
break;
case "2":
_local1 = pParticle_MC.alpha;
_local2 = pFadeIncre;
_local1 = (_local1 - _local2);
if (_local1 < 0){
_local1 = 0;
};
pParticle_MC.alpha = _local1;
switch (pType){
case "blur":
_local7 = pParticle_MC.filters;
_local8 = _local7[0];
_local7[0].blurX = (_local8.blurX + 2);
_local8.blurY = (_local8.blurY + 2);
pParticle_MC.filters = [_local8];
break;
case "rise":
WorldTranslate(0, 5, 0, false);
break;
};
if (_local1 == 0){
pState = "dead";
};
break;
case "dead":
pState = "destroy";
break;
case "destroy":
DestroyTrailParticle();
break;
};
}
public function DestroyTrailParticle(){
var _local1:*;
var _local2:*;
if (pParticle_MC != null){
gamemap.removeChild(pParticle_MC);
pParticle_MC = null;
};
_local1 = 0;
while (_local1 < gGameObj.pDisplay_Registry_List.length) {
_local2 = gGameObj.pDisplay_Registry_List[_local1];
if (_local2 == this){
gGameObj.pDisplay_Registry_List.splice(_local1, 1);
break;
};
_local1++;
};
MainObj.removeEventListener(Event.ENTER_FRAME, GameUpdate);
}
}
}//package com.citysuperhero
Section 12
//BlueButton (BlueButton)
package {
import flash.display.*;
public dynamic class BlueButton extends MovieClip {
}
}//package
Section 13
//BulletHitSnd (BulletHitSnd)
package {
import flash.media.*;
public dynamic class BulletHitSnd extends Sound {
}
}//package
Section 14
//CameraClickSnd (CameraClickSnd)
package {
import flash.media.*;
public dynamic class CameraClickSnd extends Sound {
}
}//package
Section 15
//CameraFlashMovieClip (CameraFlashMovieClip)
package {
import flash.display.*;
public dynamic class CameraFlashMovieClip extends MovieClip {
}
}//package
Section 16
//CharShadowMovieClip (CharShadowMovieClip)
package {
import flash.display.*;
public dynamic class CharShadowMovieClip extends MovieClip {
}
}//package
Section 17
//ChatBubbleMovieClip (ChatBubbleMovieClip)
package {
import flash.display.*;
public dynamic class ChatBubbleMovieClip extends MovieClip {
}
}//package
Section 18
//CinematicBradfort (CinematicBradfort)
package {
import flash.display.*;
public dynamic class CinematicBradfort extends MovieClip {
}
}//package
Section 19
//CinematicBradfortText (CinematicBradfortText)
package {
import flash.display.*;
public dynamic class CinematicBradfortText extends MovieClip {
}
}//package
Section 20
//CinematicChatbubble (CinematicChatbubble)
package {
import flash.display.*;
public dynamic class CinematicChatbubble extends MovieClip {
}
}//package
Section 21
//CinematicMiltonText (CinematicMiltonText)
package {
import flash.display.*;
public dynamic class CinematicMiltonText extends MovieClip {
}
}//package
Section 22
//CinematicNerd (CinematicNerd)
package {
import flash.display.*;
public dynamic class CinematicNerd extends MovieClip {
}
}//package
Section 23
//CinematicSkipButton (CinematicSkipButton)
package {
import flash.display.*;
public dynamic class CinematicSkipButton extends MovieClip {
}
}//package
Section 24
//Civilian1MovieClip (Civilian1MovieClip)
package {
import flash.display.*;
public dynamic class Civilian1MovieClip extends MovieClip {
}
}//package
Section 25
//Civilian2MovieClip (Civilian2MovieClip)
package {
import flash.display.*;
public dynamic class Civilian2MovieClip extends MovieClip {
}
}//package
Section 26
//Civilian3MovieClip (Civilian3MovieClip)
package {
import flash.display.*;
public dynamic class Civilian3MovieClip extends MovieClip {
}
}//package
Section 27
//Civilian4MovieClip (Civilian4MovieClip)
package {
import flash.display.*;
public dynamic class Civilian4MovieClip extends MovieClip {
}
}//package
Section 28
//Civilian5MovieClip (Civilian5MovieClip)
package {
import flash.display.*;
public dynamic class Civilian5MovieClip extends MovieClip {
}
}//package
Section 29
//Civilian6MovieClip (Civilian6MovieClip)
package {
import flash.display.*;
public dynamic class Civilian6MovieClip extends MovieClip {
}
}//package
Section 30
//CivilianKidnapped1MovieClip (CivilianKidnapped1MovieClip)
package {
import flash.display.*;
public dynamic class CivilianKidnapped1MovieClip extends MovieClip {
}
}//package
Section 31
//CivilianPhotographer1MovieClip (CivilianPhotographer1MovieClip)
package {
import flash.display.*;
public dynamic class CivilianPhotographer1MovieClip extends MovieClip {
}
}//package
Section 32
//CollisionMap3 (CollisionMap3)
package {
import flash.display.*;
public dynamic class CollisionMap3 extends MovieClip {
}
}//package
Section 33
//ContinueNoOverlay (ContinueNoOverlay)
package {
import flash.display.*;
public dynamic class ContinueNoOverlay extends MovieClip {
}
}//package
Section 34
//ContinueOverlay (ContinueOverlay)
package {
import flash.display.*;
public dynamic class ContinueOverlay extends MovieClip {
}
}//package
Section 35
//ContinueYesOverlay (ContinueYesOverlay)
package {
import flash.display.*;
public dynamic class ContinueYesOverlay extends MovieClip {
}
}//package
Section 36
//EvilPrevailedOverlay (EvilPrevailedOverlay)
package {
import flash.display.*;
public dynamic class EvilPrevailedOverlay extends MovieClip {
}
}//package
Section 37
//FailedHeadlineOverlay (FailedHeadlineOverlay)
package {
import flash.display.*;
public dynamic class FailedHeadlineOverlay extends MovieClip {
}
}//package
Section 38
//GameMap3 (GameMap3)
package {
import flash.display.*;
public dynamic class GameMap3 extends MovieClip {
}
}//package
Section 39
//GameOverOverlay (GameOverOverlay)
package {
import flash.display.*;
public dynamic class GameOverOverlay extends MovieClip {
}
}//package
Section 40
//GoodPrevailedOverlay (GoodPrevailedOverlay)
package {
import flash.display.*;
public dynamic class GoodPrevailedOverlay extends MovieClip {
}
}//package
Section 41
//GunBangMovieClip (GunBangMovieClip)
package {
import flash.display.*;
public dynamic class GunBangMovieClip extends MovieClip {
}
}//package
Section 42
//GunBulletMovieClip (GunBulletMovieClip)
package {
import flash.display.*;
public dynamic class GunBulletMovieClip extends MovieClip {
}
}//package
Section 43
//GunBulletSnd (GunBulletSnd)
package {
import flash.media.*;
public dynamic class GunBulletSnd extends Sound {
}
}//package
Section 44
//HeadlineLetters (HeadlineLetters)
package {
import flash.display.*;
public dynamic class HeadlineLetters extends MovieClip {
}
}//package
Section 45
//HeadlineTextOverlay (HeadlineTextOverlay)
package {
import flash.display.*;
public dynamic class HeadlineTextOverlay extends MovieClip {
}
}//package
Section 46
//HeroMovieClip (HeroMovieClip)
package {
import flash.display.*;
public dynamic class HeroMovieClip extends MovieClip {
}
}//package
Section 47
//HeroMusicBG (HeroMusicBG)
package {
import flash.media.*;
public dynamic class HeroMusicBG extends Sound {
}
}//package
Section 48
//HeroNerdMovieClip (HeroNerdMovieClip)
package {
import flash.display.*;
public dynamic class HeroNerdMovieClip extends MovieClip {
}
}//package
Section 49
//HintPopupArrowOverlay (HintPopupArrowOverlay)
package {
import flash.display.*;
public dynamic class HintPopupArrowOverlay extends MovieClip {
}
}//package
Section 50
//HintPopupOverlay (HintPopupOverlay)
package {
import flash.display.*;
public dynamic class HintPopupOverlay extends MovieClip {
}
}//package
Section 51
//HintsOffOverlay (HintsOffOverlay)
package {
import flash.display.*;
public dynamic class HintsOffOverlay extends MovieClip {
}
}//package
Section 52
//HintsOffOverOverlay (HintsOffOverOverlay)
package {
import flash.display.*;
public dynamic class HintsOffOverOverlay extends MovieClip {
}
}//package
Section 53
//IdentityRevealedOverlay (IdentityRevealedOverlay)
package {
import flash.display.*;
public dynamic class IdentityRevealedOverlay extends MovieClip {
}
}//package
Section 54
//LoaderBar (LoaderBar)
package {
import flash.display.*;
public dynamic class LoaderBar extends MovieClip {
}
}//package
Section 55
//LoaderBg (LoaderBg)
package {
import flash.display.*;
public dynamic class LoaderBg extends MovieClip {
}
}//package
Section 56
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import com.citysuperhero.*;
import flash.utils.*;
public class Main extends MovieClip {
public var sociotown_clicklogo:TitleScreenSocioLogoButton;
public var collisionmap:MovieClip;
public var Milton:CinematicNerd;
public var BradfortText:CinematicBradfortText;
public var score_continue_button:ScoreContinueButton;
public var loader_bar:LoaderBar;
public var gamemap:MovieClip;
public var BradfortChatbubble:CinematicChatbubble;
public var gLastMilliseconds:int;
public var MiltonChatbubble:CinematicChatbubble;
public var credits_button:TitleScreenCreditsButton;
public var credits_back_button:BlueButton;
public var title_hero:MovieClip;
public var gTimeinterval:int;
public var play_button:TitleScreenPlayButton;
public var black_screen:MovieClip;
public var score_hero_image:ScoreHeroIcon;
public var continue_button:TitleScreenContinueButton;
public var Bradfort:CinematicBradfort;
public var loader_bg:LoaderBg;
public var skip_button:CinematicSkipButton;
public var MiltonText:CinematicMiltonText;
public function Main(){
var _local1:GameObjClass;
super();
this.addEventListener(Event.ENTER_FRAME, gameLoop);
_local1 = new GameObjClass(this);
}
public function gameLoop(_arg1:Event){
var _local2:int;
_local2 = getTimer();
gTimeinterval = (_local2 - gLastMilliseconds);
gLastMilliseconds = _local2;
}
}
}//package
Section 57
//MobsterMovieClip (MobsterMovieClip)
package {
import flash.display.*;
public dynamic class MobsterMovieClip extends MovieClip {
}
}//package
Section 58
//MutantMovieClip (MutantMovieClip)
package {
import flash.display.*;
public dynamic class MutantMovieClip extends MovieClip {
}
}//package
Section 59
//NerdMusicBG (NerdMusicBG)
package {
import flash.media.*;
public dynamic class NerdMusicBG extends Sound {
}
}//package
Section 60
//PhoneBooth (PhoneBooth)
package {
import flash.display.*;
public dynamic class PhoneBooth extends MovieClip {
}
}//package
Section 61
//PictureTakenSnd (PictureTakenSnd)
package {
import flash.media.*;
public dynamic class PictureTakenSnd extends Sound {
}
}//package
Section 62
//PointsOverlay (PointsOverlay)
package {
import flash.display.*;
public dynamic class PointsOverlay extends MovieClip {
}
}//package
Section 63
//ProsperityGoaline (ProsperityGoaline)
package {
import flash.display.*;
public dynamic class ProsperityGoaline extends MovieClip {
}
}//package
Section 64
//ProsperityIndicator (ProsperityIndicator)
package {
import flash.display.*;
public dynamic class ProsperityIndicator extends MovieClip {
}
}//package
Section 65
//ProsperityMeter (ProsperityMeter)
package {
import flash.display.*;
public dynamic class ProsperityMeter extends MovieClip {
}
}//package
Section 66
//PunchHardSnd (PunchHardSnd)
package {
import flash.media.*;
public dynamic class PunchHardSnd extends Sound {
}
}//package
Section 67
//RoarSnd (RoarSnd)
package {
import flash.media.*;
public dynamic class RoarSnd extends Sound {
}
}//package
Section 68
//ScoreContinueButton (ScoreContinueButton)
package {
import flash.display.*;
public dynamic class ScoreContinueButton extends MovieClip {
}
}//package
Section 69
//ScoreHeroIcon (ScoreHeroIcon)
package {
import flash.display.*;
public dynamic class ScoreHeroIcon extends MovieClip {
}
}//package
Section 70
//ScoreNumbers (ScoreNumbers)
package {
import flash.display.*;
public dynamic class ScoreNumbers extends MovieClip {
}
}//package
Section 71
//ScreamShortSnd (ScreamShortSnd)
package {
import flash.media.*;
public dynamic class ScreamShortSnd extends Sound {
}
}//package
Section 72
//ScreamSnd (ScreamSnd)
package {
import flash.media.*;
public dynamic class ScreamSnd extends Sound {
}
}//package
Section 73
//SecretIdentityBackFrame (SecretIdentityBackFrame)
package {
import flash.display.*;
public dynamic class SecretIdentityBackFrame extends MovieClip {
}
}//package
Section 74
//SecretIdentityBar (SecretIdentityBar)
package {
import flash.display.*;
public dynamic class SecretIdentityBar extends MovieClip {
}
}//package
Section 75
//SecretIdentityFrame (SecretIdentityFrame)
package {
import flash.display.*;
public dynamic class SecretIdentityFrame extends MovieClip {
}
}//package
Section 76
//TimeClock (TimeClock)
package {
import flash.display.*;
public dynamic class TimeClock extends MovieClip {
}
}//package
Section 77
//TimeUpOverlay (TimeUpOverlay)
package {
import flash.display.*;
public dynamic class TimeUpOverlay extends MovieClip {
}
}//package
Section 78
//TitleScreenContinueButton (TitleScreenContinueButton)
package {
import flash.display.*;
public dynamic class TitleScreenContinueButton extends MovieClip {
}
}//package
Section 79
//TitleScreenCreditsButton (TitleScreenCreditsButton)
package {
import flash.display.*;
public dynamic class TitleScreenCreditsButton extends MovieClip {
}
}//package
Section 80
//TitleScreenPlayButton (TitleScreenPlayButton)
package {
import flash.display.*;
public dynamic class TitleScreenPlayButton extends MovieClip {
}
}//package
Section 81
//TitleScreenSocioLogoButton (TitleScreenSocioLogoButton)
package {
import flash.display.*;
public dynamic class TitleScreenSocioLogoButton extends MovieClip {
}
}//package
Section 82
//WhooshSnd (WhooshSnd)
package {
import flash.media.*;
public dynamic class WhooshSnd extends Sound {
}
}//package
Section 83
//ZoomAwaySnd (ZoomAwaySnd)
package {
import flash.media.*;
public dynamic class ZoomAwaySnd extends Sound {
}
}//package