Section 1
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class AdLoader {
private static var cpmstarLoader:Loader;
public static function LoadAd(_arg1:int, _arg2:int):DisplayObject{
var _local3:String;
Security.allowDomain("server.cpmstar.com");
_local3 = "http://server.cpmstar.com/adviewas3.swf";
cpmstarLoader = new Loader();
cpmstarLoader.load(new URLRequest(((((_local3 + "?poolid=") + _arg1) + "&subpoolid=") + _arg2)));
return (cpmstarLoader);
}
}
}//package CPMStar
Section 2
//123animation_981 (KONew_fla.123animation_981)
package KONew_fla {
import flash.display.*;
public dynamic class 123animation_981 extends MovieClip {
public function 123animation_981(){
addFrameScript(64, frame65, 88, frame89);
}
function frame65(){
if (MainClass.isSoundOn == true){
MainClass.bs.play();
};
}
function frame89(){
stop();
(this.parent.parent as MainClass).startGame();
}
}
}//package KONew_fla
Section 3
//bar_102 (KONew_fla.bar_102)
package KONew_fla {
import flash.display.*;
public dynamic class bar_102 extends MovieClip {
public function bar_102(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
}
}
}//package KONew_fla
Section 4
//bar_988 (KONew_fla.bar_988)
package KONew_fla {
import flash.display.*;
public dynamic class bar_988 extends MovieClip {
public function bar_988(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 5
//barcopy_103 (KONew_fla.barcopy_103)
package KONew_fla {
import flash.display.*;
public dynamic class barcopy_103 extends MovieClip {
public function barcopy_103(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
}
}
}//package KONew_fla
Section 6
//barcopy2_104 (KONew_fla.barcopy2_104)
package KONew_fla {
import flash.display.*;
public dynamic class barcopy2_104 extends MovieClip {
public function barcopy2_104(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
}
}
}//package KONew_fla
Section 7
//CHREEUP4_968 (KONew_fla.CHREEUP4_968)
package KONew_fla {
import flash.display.*;
public dynamic class CHREEUP4_968 extends MovieClip {
public function CHREEUP4_968(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 8
//CHREEUP6_987 (KONew_fla.CHREEUP6_987)
package KONew_fla {
import flash.display.*;
public dynamic class CHREEUP6_987 extends MovieClip {
public function CHREEUP6_987(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 9
//CHREEUP7_986 (KONew_fla.CHREEUP7_986)
package KONew_fla {
import flash.display.*;
public dynamic class CHREEUP7_986 extends MovieClip {
public function CHREEUP7_986(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 10
//countdown1_31 (KONew_fla.countdown1_31)
package KONew_fla {
import flash.display.*;
public dynamic class countdown1_31 extends MovieClip {
public function countdown1_31(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 11
//countdown10_49 (KONew_fla.countdown10_49)
package KONew_fla {
import flash.display.*;
public dynamic class countdown10_49 extends MovieClip {
public function countdown10_49(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 12
//countdown2_33 (KONew_fla.countdown2_33)
package KONew_fla {
import flash.display.*;
public dynamic class countdown2_33 extends MovieClip {
public function countdown2_33(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 13
//countdown3_35 (KONew_fla.countdown3_35)
package KONew_fla {
import flash.display.*;
public dynamic class countdown3_35 extends MovieClip {
public function countdown3_35(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 14
//countdown4_37 (KONew_fla.countdown4_37)
package KONew_fla {
import flash.display.*;
public dynamic class countdown4_37 extends MovieClip {
public function countdown4_37(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 15
//countdown5_39 (KONew_fla.countdown5_39)
package KONew_fla {
import flash.display.*;
public dynamic class countdown5_39 extends MovieClip {
public function countdown5_39(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 16
//countdown6_41 (KONew_fla.countdown6_41)
package KONew_fla {
import flash.display.*;
public dynamic class countdown6_41 extends MovieClip {
public function countdown6_41(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 17
//countdown7_43 (KONew_fla.countdown7_43)
package KONew_fla {
import flash.display.*;
public dynamic class countdown7_43 extends MovieClip {
public function countdown7_43(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 18
//countdown8_45 (KONew_fla.countdown8_45)
package KONew_fla {
import flash.display.*;
public dynamic class countdown8_45 extends MovieClip {
public function countdown8_45(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 19
//countdown9_47 (KONew_fla.countdown9_47)
package KONew_fla {
import flash.display.*;
public dynamic class countdown9_47 extends MovieClip {
public function countdown9_47(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package KONew_fla
Section 20
//enterYourNameField_52 (KONew_fla.enterYourNameField_52)
package KONew_fla {
import flash.display.*;
import flash.text.*;
public dynamic class enterYourNameField_52 extends MovieClip {
public var nextButton:SimpleButton;
public var playerName:TextField;
public var box:MovieClip;
public var backButton:SimpleButton;
}
}//package KONew_fla
Section 21
//floor_172 (KONew_fla.floor_172)
package KONew_fla {
import flash.display.*;
public dynamic class floor_172 extends MovieClip {
public var platform:MovieClip;
}
}//package KONew_fla
Section 22
//grizzles2ndfall2final_315 (KONew_fla.grizzles2ndfall2final_315)
package KONew_fla {
import flash.display.*;
public dynamic class grizzles2ndfall2final_315 extends MovieClip {
public function grizzles2ndfall2final_315(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
}
}
}//package KONew_fla
Section 23
//highscorescreen_197 (KONew_fla.highscorescreen_197)
package KONew_fla {
import flash.display.*;
import flash.text.*;
public dynamic class highscorescreen_197 extends MovieClip {
public var score1:TextField;
public var score5:TextField;
public var score10:TextField;
public var backhs:SimpleButton;
public var score6:TextField;
public var date1:TextField;
public var date2:TextField;
public var date3:TextField;
public var date6:TextField;
public var date7:TextField;
public var date5:TextField;
public var date9:TextField;
public var player1:TextField;
public var player2:TextField;
public var player6:TextField;
public var player7:TextField;
public var player8:TextField;
public var player5:TextField;
public var date4:TextField;
public var date8:TextField;
public var player3:TextField;
public var player9:TextField;
public var player4:TextField;
public var date10:TextField;
public var playMore:SimpleButton;
public var player10:TextField;
public var score2:TextField;
public var score3:TextField;
public var score7:TextField;
public var score8:TextField;
public var score9:TextField;
public var score4:TextField;
}
}//package KONew_fla
Section 24
//immortals_4UPFINAL_561 (KONew_fla.immortals_4UPFINAL_561)
package KONew_fla {
import flash.display.*;
public dynamic class immortals_4UPFINAL_561 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 25
//immortals_5UPFINAL_442 (KONew_fla.immortals_5UPFINAL_442)
package KONew_fla {
import flash.display.*;
public dynamic class immortals_5UPFINAL_442 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 26
//Myprogressbarmain_6 (KONew_fla.Myprogressbarmain_6)
package KONew_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Myprogressbarmain_6 extends MovieClip {
public var percent:TextField;
public var percentbar:MovieClip;
}
}//package KONew_fla
Section 27
//playnamenewff_110 (KONew_fla.playnamenewff_110)
package KONew_fla {
import flash.display.*;
public dynamic class playnamenewff_110 extends MovieClip {
public function playnamenewff_110(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package KONew_fla
Section 28
//REKL8_182 (KONew_fla.REKL8_182)
package KONew_fla {
import flash.display.*;
public dynamic class REKL8_182 extends MovieClip {
public function REKL8_182(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 29
//shadow_1UPFINAL_776 (KONew_fla.shadow_1UPFINAL_776)
package KONew_fla {
import flash.display.*;
public dynamic class shadow_1UPFINAL_776 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 30
//shadow_2UPFINAL_742 (KONew_fla.shadow_2UPFINAL_742)
package KONew_fla {
import flash.display.*;
public dynamic class shadow_2UPFINAL_742 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 31
//shadow_3UPFINAL_706 (KONew_fla.shadow_3UPFINAL_706)
package KONew_fla {
import flash.display.*;
public dynamic class shadow_3UPFINAL_706 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 32
//shadow_4UPFINAL_669 (KONew_fla.shadow_4UPFINAL_669)
package KONew_fla {
import flash.display.*;
public dynamic class shadow_4UPFINAL_669 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 33
//shadow_5UPFINAL_632 (KONew_fla.shadow_5UPFINAL_632)
package KONew_fla {
import flash.display.*;
public dynamic class shadow_5UPFINAL_632 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 34
//train_a_185 (KONew_fla.train_a_185)
package KONew_fla {
import flash.display.*;
public dynamic class train_a_185 extends MovieClip {
public function train_a_185(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 35
//train_back_190 (KONew_fla.train_back_190)
package KONew_fla {
import flash.display.*;
public dynamic class train_back_190 extends MovieClip {
public function train_back_190(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 36
//train_down_193 (KONew_fla.train_down_193)
package KONew_fla {
import flash.display.*;
public dynamic class train_down_193 extends MovieClip {
public function train_down_193(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 37
//train_front_194 (KONew_fla.train_front_194)
package KONew_fla {
import flash.display.*;
public dynamic class train_front_194 extends MovieClip {
public function train_front_194(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 38
//train_up_195 (KONew_fla.train_up_195)
package KONew_fla {
import flash.display.*;
public dynamic class train_up_195 extends MovieClip {
public function train_up_195(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 39
//train_w_183 (KONew_fla.train_w_183)
package KONew_fla {
import flash.display.*;
public dynamic class train_w_183 extends MovieClip {
public function train_w_183(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 40
//training_170 (KONew_fla.training_170)
package KONew_fla {
import flash.display.*;
public dynamic class training_170 extends MovieClip {
public var introframe:MovieClip;
public var platform:MovieClip;
public var floor1:MovieClip;
}
}//package KONew_fla
Section 41
//trainw_187 (KONew_fla.trainw_187)
package KONew_fla {
import flash.display.*;
public dynamic class trainw_187 extends MovieClip {
public function trainw_187(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package KONew_fla
Section 42
//welcome_199 (KONew_fla.welcome_199)
package KONew_fla {
import flash.display.*;
public dynamic class welcome_199 extends MovieClip {
public var highscore:SimpleButton;
public var continuebtn:SimpleButton;
public var intro:SimpleButton;
public var addMore:SimpleButton;
public var playMore:SimpleButton;
public var fightMode:SimpleButton;
}
}//package KONew_fla
Section 43
//wovlverinr_1backUPFINAL_886 (KONew_fla.wovlverinr_1backUPFINAL_886)
package KONew_fla {
import flash.display.*;
public dynamic class wovlverinr_1backUPFINAL_886 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 44
//wovlverinr_2UPFINAL_960 (KONew_fla.wovlverinr_2UPFINAL_960)
package KONew_fla {
import flash.display.*;
public dynamic class wovlverinr_2UPFINAL_960 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 45
//wovlverinr_3UPFINAL__923 (KONew_fla.wovlverinr_3UPFINAL__923)
package KONew_fla {
import flash.display.*;
public dynamic class wovlverinr_3UPFINAL__923 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 46
//wovlverinr_4UPFINAL_814 (KONew_fla.wovlverinr_4UPFINAL_814)
package KONew_fla {
import flash.display.*;
public dynamic class wovlverinr_4UPFINAL_814 extends MovieClip {
public var frontfoot:MovieClip;
public var backfoot:MovieClip;
}
}//package KONew_fla
Section 47
//youloss_977 (KONew_fla.youloss_977)
package KONew_fla {
import flash.display.*;
public dynamic class youloss_977 extends MovieClip {
public function youloss_977(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
if (GParams.selectedGameMode == GParams.GAMEMODE_STREETBRAWL){
(this.parent.parent as MainClass).createYouWinStreetBrawl();
} else {
if (GParams.playedOpponentIndex.length == 15){
(this.parent.parent as MainClass).createYouWinGangWar();
} else {
(this.parent.parent as MainClass).gotoGym();
};
};
}
}
}//package KONew_fla
Section 48
//youlossse_979 (KONew_fla.youlossse_979)
package KONew_fla {
import flash.display.*;
public dynamic class youlossse_979 extends MovieClip {
public function youlossse_979(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
if (GParams.selectedGameMode == GParams.GAMEMODE_STREETBRAWL){
(this.parent.parent as MainClass).createYouLooseStreetBrawl();
} else {
(this.parent.parent as MainClass).createYouLooseGangWar();
};
}
}
}//package KONew_fla
Section 49
//Album (Album)
package {
import flash.display.*;
public dynamic class Album extends MovieClip {
public function Album(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame18(){
stop();
}
function frame12(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame19(){
stop();
}
function frame25(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame22(){
stop();
}
function frame16(){
stop();
}
function frame8(){
stop();
}
function frame21(){
stop();
}
function frame2(){
stop();
}
function frame15(){
stop();
}
function frame23(){
stop();
}
function frame24(){
stop();
}
function frame20(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 50
//BGS (BGS)
package {
import flash.media.*;
public dynamic class BGS extends Sound {
}
}//package
Section 51
//BLS (BLS)
package {
import flash.media.*;
public dynamic class BLS extends Sound {
}
}//package
Section 52
//BS (BS)
package {
import flash.media.*;
public dynamic class BS extends Sound {
}
}//package
Section 53
//CAS (CAS)
package {
import flash.media.*;
public dynamic class CAS extends Sound {
}
}//package
Section 54
//Container (Container)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
public class Container extends MovieClip {
public var youwintext:MovieClip;
public var opponentRecovery:MovieClip;
public var opponentHealth:MovieClip;
private var opponentClass:Class;// = null
private var startP:Point;
private var countdown:Countdown;// = null
public var opponentStamina:MovieClip;
private var aiStuck:Boolean;// = false
public var playerStamina:MovieClip;
private var userPushbackCounter:int;// = 0
private var aiAction:int;// = 1
public var cheerup2:MovieClip;
public var cheerup4:MovieClip;
public var cheerup1:MovieClip;
private var elapsedtimeAfterAIAction:int;// = 0
public var cheerup3:MovieClip;
public var playerHealth:MovieClip;
private var opponentPushbackCounter:int;// = 0
private var playerDistMin:Point;
private var randomActions:Array;
public var lineArray:Array;
private var directions:Array;
protected var currentRecoveryBarValueOpponent:int;// = 0
private var aiStuckCount:int;// = 0
private var countDownMax:int;// = 0
protected var currentRecoveryBarValueUser:int;// = 0
protected var currentStaminaBarValueOpponent:int;// = 0
public var dias:MovieClip;
private var lastActionTime:int;// = 0
private var heroCountDown:int;// = 0
public var youloosetext:MovieClip;
private var fighterFactory:FighterFactory;// = null
public var playerRecovery:MovieClip;
private var heroClass:Class;// = null
private var opponentCountDown:int;// = 0
public var platformInner:MovieClip;
private var playerPos:Array;
private var elapsedTimeAfterLastAction:int;// = 0
private var AISelectedDirection:int;// = -1
protected var currentHealthBarValueUser:int;// = 0
protected var currentStaminaBarValueUser:int;// = 0
protected var currentHealthBarValueOpponent:int;// = 0
public var playerArray:Array;
private var classNameArray:Array;
public function Container(){
playerPos = new Array(new Point(445, 315), new Point(280, 315));
playerDistMin = new Point(65, 25);
currentHealthBarValueUser = 0;
currentStaminaBarValueUser = 0;
currentRecoveryBarValueUser = 0;
currentHealthBarValueOpponent = 0;
currentStaminaBarValueOpponent = 0;
currentRecoveryBarValueOpponent = 0;
lastActionTime = 0;
elapsedTimeAfterLastAction = 0;
elapsedtimeAfterAIAction = 0;
randomActions = new Array(Fighter.BLOCK, Fighter.LPUNCH, Fighter.PPUNCH, Fighter.JAB);
aiAction = 1;
fighterFactory = null;
opponentCountDown = 0;
countDownMax = 0;
heroCountDown = 0;
countdown = null;
opponentPushbackCounter = 0;
userPushbackCounter = 0;
opponentClass = null;
heroClass = null;
directions = new Array(0, 180, 90, 270);
AISelectedDirection = -1;
playerArray = new Array(2);
aiStuck = false;
aiStuckCount = 0;
classNameArray = new Array("dummy", "GrizzliesOne", "GrizzliesTwo", "GrizzliesThree", "GrizzliesFour", "GrizzliesFive", "WovlverinOne", "WovlverinTwo", "WovlverinThree", "WovlverinFour", "WovlverinFive", "WarrierOne", "WarrierTwo", "WarrierThree", "WarrierFour", "WarrierFive", "ImmortalOne", "ImmortalTwo", "ImmortalThree", "ImmortalFour", "ImmortalFive");
lineArray = new Array(new LineParticle(187.9, 343.3, 1), new LineParticle(123, 0, 1), new LineParticle(188.8, 16.61, 1), new LineParticle(47, 90, 0), new LineParticle(203, 152.4, 1), new LineParticle(126, 180, 0), new LineParticle(202.6, 207.3, 1), new LineParticle(48, 270, 1));
startP = new Point(125, 289);
super();
addFrameScript(55, frame56, 57, frame58, 196, frame197);
}
public function AIHandler(){
var _local1:Boolean;
var _local2:Number;
swapPlayers();
handleFlipping();
if (reactToOpponentHit() > 0){
aiAction = playerArray[1].currentFrame;
return;
};
aiAction = playerArray[1].currentFrame;
elapsedTimeAfterLastAction = (elapsedTimeAfterLastAction + 1);
if ((((aiAction < Fighter.LPUNCH)) || ((aiAction > Fighter.JAB)))){
playerArray[1].regenerateStamina();
if (((((((((((((!((aiAction == Fighter.HURT))) && (!((aiAction == Fighter.FALL))))) && (!((aiAction == Fighter.FALL2))))) && (!((aiAction == Fighter.GASP))))) && (!((aiAction == Fighter.GETUP))))) && (!((aiAction == Fighter.GETUP2))))) && (!((aiAction == Fighter.BLOCK))))){
if ((((playerArray[1].isRecoveryInProgress == false)) && ((elapsedTimeAfterLastAction >= playerArray[1].maxIdleTime)))){
elapsedTimeAfterLastAction = 0;
if ((((playerArray[1].continuesHitsCount < GParams.maxHitsCount)) || ((playerArray[0].currentFrame == Fighter.GASP)))){
if (generateAISpontaneousAction() == true){
};
};
};
};
};
if (playerArray[1].isRecoveryInProgress == true){
if (playerArray[1].checkRecoveryTime() == true){
elapsedTimeAfterLastAction = playerArray[1].maxIdleTime;
};
};
if (aiAction == Fighter.HURT){
handleAIHurt();
return;
};
if (aiAction == Fighter.BLOCK){
playerArray[1].pushBack(playerArray[1].currentSpeed);
};
if ((((aiAction == Fighter.MOVEBACK)) && ((playerArray[1].currentFrame == Fighter.MOVEBACK)))){
handleAIMoveback();
return;
};
if ((((((playerArray[1].currentFrame == Fighter.FALL)) || ((playerArray[1].currentFrame == Fighter.FALL2)))) || ((playerArray[1].currentFrame == Fighter.GASP)))){
_local1 = playerArray[1].checkGetupAction();
if (_local1 == true){
};
if ((((playerArray[1].currentFrame == Fighter.FALL)) || ((playerArray[1].currentFrame == Fighter.FALL2)))){
checkOpponentCountDown();
if (_local1 == true){
removeCountdown();
return;
};
};
return;
};
if (aiAction == Fighter.STAND){
_local2 = Math.random();
if (elapsedtimeAfterAIAction < playerArray[1].maxIdleTime){
elapsedtimeAfterAIAction = (elapsedtimeAfterAIAction + 1);
} else {
if (getTotalDist() < GParams.minDistTotal){
aiAction = Fighter.WALK;
} else {
if ((((playerArray[1].continuesHitsCount >= GParams.maxHitsCount)) || ((playerArray[1].hasInsuficientStamina() == true)))){
choosePlayerdirection(1);
aiAction = Fighter.MOVEBACK;
playerArray[1].gotoMoveBack();
playerArray[1].pushBack((playerArray[1].walkSpeed * 2));
if (playerArray[1].hasInsuficientStamina() == true){
setAIPushBackLength(GParams.PUSHBACK_LENGTH_ON_OPPONENT_FALL);
} else {
setAIPushBackLength(GParams.PUSHBACK_LENGTH_WHEN_WALK);
};
playerArray[1].continuesHitsCount = 0;
playerArray[0].continuesHitsCount = 0;
} else {
if (elapsedtimeAfterAIAction < playerArray[1].maxIdleTime){
elapsedtimeAfterAIAction = (elapsedtimeAfterAIAction + 1);
} else {
if ((((getTotalDist() <= GParams.minPlayerDist)) && ((checkAISuitableToHit() == true)))){
aiAction = generateAIAction();
} else {
if (((((((!((playerArray[0].currentFrame == Fighter.FALL))) && (!((playerArray[0].currentFrame == Fighter.FALL2))))) && (!((playerArray[0].currentFrame == Fighter.GETUP))))) && (!((playerArray[0].currentFrame == Fighter.GETUP2))))){
if (_local2 < playerArray[1].blockFrequency){
aiAction = Fighter.WALK;
};
};
};
};
};
};
};
};
handleAIActions();
}
public function removeCountdown(){
if (contains(countdown)){
this.parent.removeChild(countdown);
};
countDownMax = GParams.GETUP_COUNTDOWN_MAX;
heroCountDown = 0;
opponentCountDown = 0;
}
private function createSurface(){
var _local1:Point;
var _local2:uint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = new Point();
_local1.x = startP.x;
_local1.y = startP.y;
_local2 = 0;
while (_local2 < lineArray.length) {
_local3 = ((lineArray[_local2].angle * Math.PI) / 180);
lineArray[_local2].setMinimum(_local1);
_local4 = ((Math.cos(_local3) * lineArray[_local2].length) / 2);
_local5 = ((Math.sin(_local3) * lineArray[_local2].length) / 2);
_local1.x = (_local1.x + _local4);
_local1.y = (_local1.y + _local5);
lineArray[_local2].setParameters(_local1.x, _local1.y);
addChild(lineArray[_local2]);
_local1.x = (_local1.x + _local4);
_local1.y = (_local1.y + _local5);
lineArray[_local2].setMaximun(_local1);
_local2++;
};
}
public function getPlayerDist():int{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:int;
_local1 = (playerArray[0].x - playerArray[1].x);
_local2 = (playerArray[0].y - playerArray[1].y);
_local3 = Math.atan2(_local2, _local1);
_local4 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
return (Math.abs(_local1));
}
public function checkAISuitableToHit():Boolean{
var _local1:Number;
_local1 = (playerArray[0].y - playerArray[1].y);
if (Math.abs(_local1) < 10){
if ((((playerArray[1].scaleX < 0)) && ((playerArray[0].scaleX > 0)))){
return (true);
};
if ((((playerArray[1].scaleX > 0)) && ((playerArray[0].scaleX < 0)))){
return (true);
};
};
return (false);
}
private function setAIPushBackLength(_arg1:int=0){
if (_arg1 == 0){
playerArray[1].currentPushbackLength = (GParams.PUSHBACK_LENGTH_HURT + Math.floor(((1 - (playerArray[1].currentStamina / playerArray[1].maxStamina)) * 25)));
} else {
playerArray[1].currentPushbackLength = _arg1;
};
}
public function onEnterFrameOpponent(_arg1:Event){
if (playerArray[1].currentFrame == Fighter.LPUNCH){
if (playerArray[1].lpunch != null){
if (playerArray[1].lpunch.currentFrame == 2){
playerArray[1].calculateRecoveryTime();
};
if (playerArray[1].lpunch.currentFrame == 4){
playerArray[1].actionLowPunch();
};
if (playerArray[1].lpunch.currentFrame == playerArray[1].lpunch.totalFrames){
playerArray[1].clearAction();
};
};
} else {
if (playerArray[1].currentFrame == Fighter.PPUNCH){
if (playerArray[1].ppunch != null){
if (playerArray[1].ppunch.currentFrame == 2){
playerArray[1].calculateRecoveryTime();
};
if (playerArray[1].ppunch.currentFrame == 6){
playerArray[1].actionPowerPunch();
};
if (playerArray[1].ppunch.currentFrame == playerArray[1].ppunch.totalFrames){
playerArray[1].clearAction();
};
};
} else {
if (playerArray[1].currentFrame == Fighter.JAB){
if (playerArray[1].jab != null){
if (playerArray[1].jab.currentFrame == 2){
playerArray[1].calculateRecoveryTime();
};
if (playerArray[1].jab.currentFrame == 7){
playerArray[1].actionJab();
};
if (playerArray[1].jab.currentFrame == playerArray[1].jab.totalFrames){
playerArray[1].clearAction();
};
};
} else {
if (playerArray[1].currentFrame == Fighter.BLOCK){
if (playerArray[1].block != null){
if ((((((((playerArray[0].currentFrame == Fighter.LPUNCH)) || ((playerArray[0].currentFrame == Fighter.PPUNCH)))) || ((playerArray[0].currentFrame == Fighter.JAB)))) && ((((getTotalDist() < GParams.minPlayerDist)) && ((checkAISuitableToHit() == true)))))){
if (playerArray[1].block.currentFrame == 5){
choosePlayerdirection(1);
playerArray[1].pushBack(10);
};
};
if (playerArray[1].block.currentFrame == playerArray[1].block.totalFrames){
gotoHitbackAfterblock();
};
};
} else {
if (playerArray[1].currentFrame == Fighter.FALL){
if (playerArray[1].fall != null){
if (playerArray[1].fall.currentFrame == (playerArray[1].fall.totalFrames - 1)){
if (MainClass.isSoundOn == true){
MainClass.fs.play();
};
};
if (playerArray[1].fall.currentFrame == playerArray[1].fall.totalFrames){
playerArray[1].fall.stop();
};
};
} else {
if (playerArray[1].currentFrame == Fighter.FALL2){
if (playerArray[1].fall2 != null){
if (playerArray[1].fall2.currentFrame == (playerArray[1].fall2.totalFrames - 1)){
if (MainClass.isSoundOn == true){
MainClass.fs.play();
};
};
if (playerArray[1].fall2.currentFrame == playerArray[1].fall2.totalFrames){
playerArray[1].fall2.stop();
};
};
} else {
if (playerArray[1].currentFrame == Fighter.GETUP){
if (playerArray[1].getup != null){
if (playerArray[1].getup.currentFrame == playerArray[1].getup.totalFrames){
playerArray[1].gotoStand();
};
};
} else {
if (playerArray[1].currentFrame == Fighter.GETUP2){
if (playerArray[1].getup2 != null){
if (playerArray[1].getup2.currentFrame == playerArray[1].getup2.totalFrames){
playerArray[1].gotoStand();
};
};
};
};
};
};
};
};
};
};
}
public function reactToOpponentHit():int{
var _local1:int;
var _local2:Number;
_local1 = 0;
if (!(((playerArray[0].currentFrame >= Fighter.LPUNCH)) && ((playerArray[0].currentFrame <= Fighter.JAB)))){
return (_local1);
};
if ((((playerArray[1].areAtAttackDist() == false)) || (!((((((((playerArray[1].currentFrame == Fighter.STAND)) || ((playerArray[1].currentFrame == Fighter.WALK)))) || ((playerArray[1].currentFrame == Fighter.MOVEBACK)))) || ((playerArray[1].currentFrame == Fighter.BLOCK))))))){
return (_local1);
};
_local2 = Math.random();
if (playerArray[0].currentFrame == Fighter.LPUNCH){
if (playerArray[0].lpunch == null){
return (_local1);
};
if (playerArray[0].lpunch.currentFrame > 3){
return (_local1);
};
if ((((((_local2 < (playerArray[1].hitbackFrequency + 0.2))) || ((_local2 < playerArray[1].moveAwayFrequency)))) || ((_local2 < (playerArray[1].blockFrequency + 0.1))))){
if (playerArray[1].currentStamina > 0.4){
_local1 = 1;
} else {
_local1 = chooseReactionType();
};
return (_local1);
};
} else {
if (playerArray[0].currentFrame == Fighter.PPUNCH){
if (playerArray[0].ppunch == null){
return (_local1);
};
if (playerArray[0].ppunch.currentFrame > 3){
return (_local1);
};
if ((((((_local2 < playerArray[1].hitbackFrequency)) || ((_local2 < playerArray[1].moveAwayFrequency)))) || ((_local2 < playerArray[1].blockFrequency)))){
_local1 = chooseReactionType();
};
} else {
if (playerArray[0].currentFrame == Fighter.JAB){
if (playerArray[0].jab == null){
return (_local1);
};
if (playerArray[0].jab.currentFrame > 3){
return (_local1);
};
if ((((((_local2 < playerArray[1].hitbackFrequency)) || ((_local2 < playerArray[1].moveAwayFrequency)))) || ((_local2 < playerArray[1].blockFrequency)))){
_local1 = chooseReactionType();
};
};
};
};
if (_local1 == 3){
choosePlayerdirection(1);
setAIPushBackLength(GParams.PUSHBACK_LENGTH_WHEN_CLOSE);
playerArray[1].pushBack((playerArray[1].walkSpeed * 2));
playerArray[1].gotoMoveBack();
aiAction = Fighter.MOVEBACK;
} else {
if (_local1 == 2){
aiAction = Fighter.BLOCK;
playerArray[1].gotoBlock();
} else {
if (_local1 == 1){
if ((((playerArray[1].currentFrame == Fighter.JAB)) || ((playerArray[1].currentFrame == Fighter.PPUNCH)))){
aiAction = Fighter.LPUNCH;
playerArray[1].gotoLowPunch();
} else {
aiAction = Fighter.LPUNCH;
playerArray[1].gotoLowPunch();
};
};
};
};
return (_local1);
}
public function adjustAIPositions(){
var _local1:Boolean;
var _local2:Boolean;
var _local3:Point;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:Point;
var _local9:Boolean;
var _local10:Number;
if ((((((((((((((((((((((((playerArray[0].currentFrame == Fighter.FALL2)) || ((playerArray[0].currentFrame == Fighter.FALL)))) || ((playerArray[1].currentFrame == Fighter.FALL)))) || ((playerArray[1].currentFrame == Fighter.FALL2)))) || ((playerArray[1].currentFrame == Fighter.GASP)))) || ((playerArray[1].currentFrame == Fighter.HURT)))) || ((playerArray[1].currentFrame == Fighter.GETUP)))) || ((playerArray[1].currentFrame == Fighter.GETUP2)))) || ((playerArray[0].currentFrame == Fighter.GETUP)))) || ((playerArray[0].currentFrame == Fighter.GETUP2)))) || ((playerArray[1].currentFrame == Fighter.MOVEBACK)))) || ((playerArray[1].currentFrame == Fighter.BLOCK)))){
return;
};
_local1 = playerArray[1].arePlayersCloseby();
_local2 = playerArray[1].arePlayersAwayToWalk();
_local3 = getFutureAttackPoints();
if (_local3 == null){
_local10 = Math.random();
if (_local10 < 0.5){
_local3 = getFutureAttackPointsOppositeSide();
};
if (_local3 == null){
if (playerArray[1].continuesMovebacks <= 3){
choosePlayerdirection(1);
playerArray[1].gotoMoveBack();
setAIPushBackLength((GParams.PUSHBACK_LENGTH_WHEN_WALK * 2));
} else {
aiStuckCount = (aiStuckCount + 1);
aiStuck = true;
if (aiStuckCount > 300){
aiStuck = false;
};
};
return;
};
};
aiStuck = false;
aiStuckCount = 0;
_local4 = Math.round((playerArray[1].y - _local3.y));
_local5 = Math.round((playerArray[1].x - _local3.x));
_local6 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local6 < GParams.minPlayerDist){
if ((((playerArray[0].currentFrame >= Fighter.LPUNCH)) && ((playerArray[0].currentFrame <= Fighter.JAB)))){
if ((((playerArray[1].areAtAttackDist() == true)) && ((checkAISuitableToHit() == true)))){
playerArray[1].gotoBlock();
return;
};
};
};
if ((((playerArray[1].areAtAttackDist() == true)) && ((checkAISuitableToHit() == true)))){
generateAIAction(Fighter.LPUNCH);
return;
};
_local7 = Math.round(playerArray[1].getWalkSpeed());
_local8 = new Point();
_local9 = false;
if (Math.abs(_local4) > 0){
if (_local4 < 0){
_local8.x = playerArray[1].x;
_local8.y = (playerArray[1].y + _local7);
if (playerArray[1].validatePoint(_local8) == true){
if (playerArray[1].movement(0, _local7) == false){
_local9 = true;
};
if (playerArray[1].y >= _local3.y){
playerArray[1].y = _local3.y;
_local9 = false;
};
} else {
_local9 = true;
};
} else {
if (_local4 > 0){
_local8.x = playerArray[1].x;
_local8.y = (playerArray[1].y - _local7);
if (playerArray[1].validatePoint(_local8) == true){
if (playerArray[1].movement(0, -(_local7)) == false){
_local9 = true;
};
if (playerArray[1].y <= _local3.y){
playerArray[1].y = _local3.y;
_local9 = false;
};
} else {
_local9 = true;
};
};
};
} else {
if (_local5 < 0){
_local8.x = (playerArray[1].x + _local7);
_local8.y = playerArray[1].y;
if (playerArray[1].validatePoint(_local8) == true){
if (playerArray[1].movement(_local7, 0) == false){
_local9 = true;
};
if (playerArray[1].x >= _local3.x){
playerArray[1].x = _local3.x;
_local9 = false;
};
} else {
_local9 = true;
};
} else {
if (_local5 > 0){
_local8.x = (playerArray[1].x - _local7);
_local8.y = playerArray[1].y;
if (playerArray[1].validatePoint(_local8) == true){
if (playerArray[1].movement(-(_local7), 0) == false){
_local9 = true;
};
if (playerArray[1].x <= _local3.x){
playerArray[1].x = _local3.x;
_local9 = false;
};
} else {
_local9 = true;
};
};
};
};
if ((((Math.round(playerArray[1].x) == _local3.x)) && ((Math.round(playerArray[1].y) == _local3.y)))){
if ((((playerArray[0].currentFrame >= Fighter.LPUNCH)) && ((playerArray[0].currentFrame <= Fighter.JAB)))){
playerArray[1].gotoBlock();
} else {
generateAIAction();
};
} else {
if (_local9 == true){
choosePlayerdirection(1);
playerArray[1].gotoMoveBack();
setAIPushBackLength((GParams.PUSHBACK_LENGTH_WHEN_WALK * 2));
} else {
if (playerArray[1].currentFrame != Fighter.WALK){
playerArray[1].gotoWalk();
};
};
};
}
public function setOpponents(){
playerArray[0].setOpponent(playerArray[1]);
playerArray[1].setOpponent(playerArray[0]);
updatePlayersScaleValue();
}
public function getTotalDist():int{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:int;
_local1 = (playerArray[0].x - playerArray[1].x);
_local2 = (playerArray[0].y - playerArray[1].y);
_local3 = Math.atan2(_local2, _local1);
_local4 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
return (_local4);
}
public function handleAIHurt(){
var _local1:int;
var _local2:Number;
if (playerArray[1].hurt == null){
return;
};
if (playerArray[1].hurt.currentFrame == 2){
choosePlayerdirection(1);
};
if (playerArray[1].hurt.currentFrame < 4){
playerArray[1].pushBack(3);
};
if (playerArray[1].hurt.currentFrame != playerArray[1].hurt.totalFrames){
return;
};
_local1 = playerArray[1].showGasping();
playerArray[1].hurt.gotoAndStop(1);
if (_local1 == 1){
aiAction = Fighter.GASP;
playerArray[1].gotoGasping();
return;
};
if (_local1 == 2){
aiAction = Fighter.FALL;
playerArray[1].gotoFall();
return;
};
_local2 = Math.random();
if ((((_local2 < playerArray[1].moveAwayFrequency)) && (!((playerArray[0].previousPunch == Fighter.LPUNCH))))){
if (getTotalDist() < GParams.minDistTotal){
aiAction = Fighter.WALK;
} else {
aiAction = Fighter.MOVEBACK;
choosePlayerdirection(1);
playerArray[1].gotoMoveBack();
setAIPushBackLength(GParams.PUSHBACK_LENGTH_WHEN_WALK);
};
} else {
if (generateAISpontaneousAction() == false){
elapsedTimeAfterLastAction = playerArray[1].maxIdleTime;
aiAction = Fighter.STAND;
playerArray[1].gotoStand();
};
};
}
public function createOpponent(_arg1:int=0, _arg2:int=0, _arg3:int=5, _arg4:int=80, _arg5:int=60){
opponentClass = (loaderInfo.applicationDomain.getDefinition(classNameArray[GParams.selectedOpponentIndex]) as Class);
playerArray[1] = new opponentClass();
playerArray[1].gotoAndStop(Fighter.STAND);
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
GParams.getPlayerParameters(GParams.playerStats[(GParams.selectedOpponentIndex - 1)].playerType, GParams.selectedOpponentIndex, GParams.playedOpponentIndex.length);
playerArray[1].playerCategory = GParams.gangWarPlayerStat[(GParams.selectedOpponentIndex - 1)].playerType;
playerArray[1].setParameters(GParams.BEHAVIOUR_AI, playerPos[1], GParams.gangWarClickedPlayerStat[0], GParams.gangWarClickedPlayerStat[1], GParams.gangWarClickedPlayerStat[2]);
} else {
playerArray[1].playerCategory = GParams.playerStats[(GParams.selectedOpponentIndex - 1)].playerType;
playerArray[1].setParameters(GParams.BEHAVIOUR_AI, playerPos[1], GParams.playerStats[(GParams.selectedOpponentIndex - 1)].speed, GParams.playerStats[(GParams.selectedOpponentIndex - 1)].stamina, GParams.playerStats[(GParams.selectedOpponentIndex - 1)].streng);
};
this.dias.addChild(playerArray[1]);
playerArray[1].setObjectClass(opponentClass);
playerArray[1].init();
playerArray[1].scaleX = (Math.abs(playerArray[1].scaleY) * -1);
playerArray[1].scaleY = Math.abs(playerArray[1].scaleY);
playerArray[1] = (playerArray[1] as opponentClass);
playerArray[1].addEventListener(Event.ENTER_FRAME, onEnterFrameOpponent);
}
public function handleAIActions(){
if (aiAction == Fighter.WALK){
if (playerArray[1].currentFrame != Fighter.WALK){
playerArray[1].gotoWalk();
};
if (playerArray[1].currentFrame == Fighter.WALK){
if (getTotalDist() < GParams.minDistTotal){
adjustAIPositions();
} else {
adjustAIPositions();
};
} else {
adjustAIPositions();
};
return;
};
if ((((aiAction == Fighter.LPUNCH)) && (!((playerArray[1].currentFrame == Fighter.LPUNCH))))){
playerArray[1].gotoLowPunch();
};
if ((((aiAction == Fighter.PPUNCH)) && (!((playerArray[1].currentFrame == Fighter.PPUNCH))))){
playerArray[1].gotoPowerPunch();
};
if ((((aiAction == Fighter.JAB)) && (!((playerArray[1].currentFrame == Fighter.JAB))))){
playerArray[1].gotoJab();
};
if ((((aiAction == Fighter.BLOCK)) && (!((playerArray[1].currentFrame == Fighter.BLOCK))))){
playerArray[1].gotoBlock();
};
if ((((aiAction == Fighter.GASP)) && (!((playerArray[1].currentFrame == Fighter.GASP))))){
playerArray[1].gotoGasping();
};
if ((((aiAction == Fighter.FALL)) && (((!((playerArray[1].currentFrame == Fighter.FALL))) && (!((playerArray[1].currentFrame == Fighter.FALL2))))))){
playerArray[1].gotoFall();
};
}
private function swapPlayers(){
var _local1:int;
var _local2:int;
_local1 = this.dias.getChildIndex(playerArray[0]);
_local2 = this.dias.getChildIndex(playerArray[1]);
if (playerArray[0].y > playerArray[1].y){
if (_local1 < _local2){
this.dias.swapChildren(playerArray[0], playerArray[1]);
};
};
if (playerArray[0].y < playerArray[1].y){
if (_local1 > _local2){
this.dias.swapChildren(playerArray[0], playerArray[1]);
};
};
}
public function choosePlayerdirection(_arg1:int){
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = ((_arg1 + 1) % 2);
_local3 = (playerArray[_local2].x - playerArray[_arg1].x);
_local4 = (playerArray[_local2].y - playerArray[_arg1].y);
_local5 = Math.random();
if ((((playerArray[_local2].currentFrame == Fighter.FALL)) || ((playerArray[_local2].currentFrame == Fighter.FALL2)))){
if (playerArray[_arg1].x <= 230){
playerArray[_arg1].setAngle(0);
} else {
if (playerArray[_arg1].x >= 500){
playerArray[_arg1].setAngle(180);
} else {
if (playerArray[_arg1].y > 400){
playerArray[_arg1].setAngle(-90);
} else {
if (playerArray[_arg1].y < 275){
playerArray[_arg1].setAngle(90);
} else {
if (playerArray[_arg1].scaleX < 0){
playerArray[_arg1].setAngle(180);
} else {
playerArray[_arg1].setAngle(0);
};
};
};
};
};
return;
};
if ((((playerArray[_arg1].x <= 230)) || ((playerArray[_arg1].x >= 500)))){
if (playerArray[_arg1].scaleX < 0){
if (playerArray[_arg1].x <= 230){
if (((!((playerArray[_arg1].moveAwayAngle == -10))) && (!((playerArray[_arg1].moveAwayAngle == 20))))){
if (_local5 < 0.5){
playerArray[_arg1].setAngle(-30);
} else {
playerArray[_arg1].setAngle(30);
};
} else {
if (playerArray[_arg1].moveAwayAngle == -10){
playerArray[_arg1].setAngle(30);
} else {
playerArray[_arg1].setAngle(-30);
};
};
} else {
if (((!((playerArray[_arg1].moveAwayAngle == 150))) && (!((playerArray[_arg1].moveAwayAngle == 210))))){
if (_local5 < 0.5){
playerArray[_arg1].setAngle(150);
} else {
playerArray[_arg1].setAngle(210);
};
} else {
if (playerArray[_arg1].moveAwayAngle == 150){
playerArray[_arg1].setAngle(210);
} else {
playerArray[_arg1].setAngle(150);
};
};
};
} else {
if (playerArray[_arg1].x <= 230){
if (((!((playerArray[_arg1].moveAwayAngle == -10))) && (!((playerArray[_arg1].moveAwayAngle == 20))))){
if (_local5 < 0.5){
playerArray[_arg1].setAngle(-30);
} else {
playerArray[_arg1].setAngle(30);
};
} else {
if (playerArray[_arg1].moveAwayAngle == -10){
playerArray[_arg1].setAngle(30);
} else {
playerArray[_arg1].setAngle(-20);
};
};
} else {
if (((!((playerArray[_arg1].moveAwayAngle == 150))) && (!((playerArray[_arg1].moveAwayAngle == 210))))){
if (_local5 < 0.5){
playerArray[_arg1].setAngle(150);
} else {
playerArray[_arg1].setAngle(210);
};
} else {
if (playerArray[_arg1].moveAwayAngle == 150){
playerArray[_arg1].setAngle(210);
} else {
playerArray[_arg1].setAngle(150);
};
};
};
};
} else {
if (playerArray[_arg1].y > 400){
if (_local5 < 0.25){
playerArray[_arg1].setAngle(-90);
} else {
if (_local5 < 0.5){
playerArray[_arg1].setAngle(-30);
} else {
if (_local5 < 0.75){
playerArray[_arg1].setAngle(225);
} else {
playerArray[_arg1].setAngle(160);
};
};
};
playerArray[_arg1].pushBack(10);
} else {
if (playerArray[_arg1].y < 275){
if (_local5 < 0.25){
playerArray[_arg1].setAngle(90);
} else {
if (_local5 < 0.5){
playerArray[_arg1].setAngle(30);
} else {
if (_local5 < 0.75){
playerArray[_arg1].setAngle(150);
} else {
playerArray[_arg1].setAngle(210);
};
};
};
playerArray[_arg1].pushBack(10);
} else {
if ((((playerArray[_arg1].currentFrame == Fighter.HURT)) || ((playerArray[_arg1].currentFrame == Fighter.BLOCK)))){
if (playerArray[_arg1].scaleX < 0){
playerArray[_arg1].setAngle(180);
} else {
playerArray[_arg1].setAngle(0);
};
return;
};
if (playerArray[_arg1].scaleX < 0){
if (_local5 < 0.25){
playerArray[_arg1].setAngle(210);
} else {
if (_local5 > 0.75){
playerArray[_arg1].setAngle(150);
} else {
if (_local5 < 0.5){
playerArray[_arg1].setAngle(60);
} else {
playerArray[_arg1].setAngle(-60);
};
};
};
} else {
if (_local5 < 0.25){
playerArray[_arg1].setAngle(60);
} else {
if (_local5 > 0.75){
playerArray[_arg1].setAngle(-60);
} else {
if (_local5 < 0.5){
playerArray[_arg1].setAngle(210);
} else {
playerArray[_arg1].setAngle(150);
};
};
};
};
};
};
};
}
public function handleAIMoveback(){
opponentPushbackCounter = (opponentPushbackCounter + 1);
if (playerArray[1].pushBack() == false){
if ((((((playerArray[0].currentFrame == Fighter.FALL)) || ((playerArray[0].currentFrame == Fighter.FALL2)))) || ((playerArray[1].isRecoveryInProgress == true)))){
if (getTotalDist() < GParams.PLAYER_DIST_ONFALL){
choosePlayerdirection(1);
opponentPushbackCounter = 0;
} else {
aiAction = Fighter.STAND;
};
} else {
aiAction = Fighter.STAND;
};
};
if (opponentPushbackCounter >= playerArray[1].currentPushbackLength){
if ((((((playerArray[0].currentFrame == Fighter.FALL)) || ((playerArray[0].currentFrame == Fighter.FALL2)))) || ((playerArray[1].isRecoveryInProgress == true)))){
if (getTotalDist() < GParams.PLAYER_DIST_ONFALL){
opponentPushbackCounter = 0;
} else {
aiAction = Fighter.STAND;
};
} else {
aiAction = Fighter.STAND;
};
opponentPushbackCounter = 0;
};
if (aiAction != Fighter.STAND){
return;
};
opponentPushbackCounter = 0;
playerArray[1].gotoStand();
}
private function getFutureAttackPoints():Point{
var _local1:Point;
_local1 = new Point(playerArray[0].x, playerArray[0].y);
if (playerArray[0].scaleX > 0){
_local1.x = Math.round((playerArray[0].x - (GParams.actionDistMin.x + 5)));
_local1.y = Math.round(playerArray[0].y);
} else {
_local1.x = Math.round((playerArray[0].x + (GParams.actionDistMin.x + 5)));
_local1.y = Math.round(playerArray[0].y);
};
if (playerArray[1].validatePoint(_local1) == true){
return (_local1);
};
return (null);
}
function frame197(){
stop();
}
private function chooseReactionType():int{
var _local1:int;
var _local2:Number;
_local1 = 0;
_local2 = (playerArray[1].currentStamina / playerArray[1].maxStamina);
if ((((_local2 > 0.8)) && ((playerArray[1].currentHealth > 30)))){
_local1 = 1;
} else {
if ((((_local2 > 0.5)) && ((playerArray[1].currentHealth > 15)))){
if (playerArray[0].currentFrame == Fighter.LPUNCH){
_local1 = 1;
} else {
_local1 = 2;
};
} else {
if ((((((playerArray[1].currentSpeed > playerArray[0].currentSpeed)) && ((playerArray[1].currentHealth > 60)))) && ((_local2 > 0.5)))){
_local1 = 3;
} else {
_local1 = 2;
};
};
};
return (_local1);
}
public function calculateScore(_arg1:Boolean){
if (_arg1 == true){
GParams.levelBonus = (Math.round(playerArray[0].currentHealth) * GParams.healthValue);
} else {
GParams.levelBonus = 0;
};
GParams.levelScore = (((GParams.levelBonus + (playerArray[0].actualLPunch * GParams.lPunchValue)) + (playerArray[0].actualPPunch * GParams.pPunchValue)) + (playerArray[0].actualJab * GParams.jabValue));
GParams.totalScore = ((GParams.totalScore + GParams.levelScore) + GParams.levelBonus);
}
public function onEnterFrameHero(_arg1:Event){
var _local2:int;
if (playerArray[0].currentFrame == Fighter.LPUNCH){
if (playerArray[0].lpunch != null){
if (playerArray[0].lpunch.currentFrame == 2){
playerArray[0].calculateRecoveryTime();
};
if (playerArray[0].lpunch.currentFrame == 3){
playerArray[0].actionLowPunch();
};
if (playerArray[0].lpunch.currentFrame == playerArray[0].lpunch.totalFrames){
playerArray[0].clearAction();
};
};
} else {
if (playerArray[0].currentFrame == Fighter.PPUNCH){
if (playerArray[0].ppunch != null){
if (playerArray[0].ppunch.currentFrame == 2){
playerArray[0].calculateRecoveryTime();
};
if (playerArray[0].ppunch.currentFrame == 7){
playerArray[0].actionPowerPunch();
};
if (playerArray[0].ppunch.currentFrame == playerArray[0].ppunch.totalFrames){
playerArray[0].clearAction();
};
};
} else {
if (playerArray[0].currentFrame == Fighter.JAB){
if (playerArray[0].jab != null){
if (playerArray[0].jab.currentFrame == 2){
playerArray[0].calculateRecoveryTime();
};
if (playerArray[0].jab.currentFrame == 7){
playerArray[0].actionJab();
};
if (playerArray[0].jab.currentFrame == playerArray[0].jab.totalFrames){
playerArray[0].clearAction();
};
};
} else {
if (playerArray[0].currentFrame == Fighter.HURT){
if (playerArray[0].hurt != null){
if (playerArray[0].hurt.currentFrame == playerArray[0].hurt.totalFrames){
_local2 = playerArray[0].showGasping();
playerArray[0].hurt.gotoAndStop(1);
if (_local2 == 1){
playerArray[0].gotoGasping();
} else {
if (_local2 == 2){
playerArray[0].gotoFall();
choosePlayerdirection(1);
playerArray[1].gotoMoveBack();
setAIPushBackLength(GParams.PUSHBACK_LENGTH_ON_OPPONENT_FALL);
opponentPushbackCounter = 0;
return;
};
playerArray[0].gotoStand();
};
};
};
} else {
if (playerArray[0].currentFrame == Fighter.BLOCK){
if (playerArray[0].block != null){
if ((((((((playerArray[1].currentFrame == Fighter.LPUNCH)) || ((playerArray[1].currentFrame == Fighter.PPUNCH)))) || ((playerArray[1].currentFrame == Fighter.JAB)))) && ((((getTotalDist() < GParams.minPlayerDist)) && ((checkAISuitableToHit() == true)))))){
if (playerArray[0].block.currentFrame == 5){
playerArray[0].pushBack(10);
};
};
if (playerArray[0].block.currentFrame == playerArray[0].block.totalFrames){
playerArray[0].gotoStand();
};
};
} else {
if (playerArray[0].currentFrame == Fighter.FALL){
if (playerArray[0].fall != null){
if (playerArray[0].fall.currentFrame == (playerArray[0].fall.totalFrames - 1)){
if (MainClass.isSoundOn == true){
MainClass.fs.play();
};
};
if (playerArray[0].fall.currentFrame == playerArray[0].fall.totalFrames){
playerArray[0].fall.stop();
};
};
} else {
if (playerArray[0].currentFrame == Fighter.FALL2){
if (playerArray[0].fall2 != null){
if (playerArray[0].fall2.currentFrame == (playerArray[0].fall2.totalFrames - 1)){
if (MainClass.isSoundOn == true){
MainClass.fs.play();
};
};
if (playerArray[0].fall2.currentFrame == playerArray[0].fall2.totalFrames){
playerArray[0].fall2.stop();
};
};
} else {
if (playerArray[0].currentFrame == Fighter.GETUP){
if (playerArray[0].getup != null){
if (playerArray[0].getup.currentFrame == playerArray[0].getup.totalFrames){
playerArray[0].gotoStand();
};
};
} else {
if (playerArray[0].currentFrame == Fighter.GETUP2){
if (playerArray[0].getup2 != null){
if (playerArray[0].getup2.currentFrame == playerArray[0].getup2.totalFrames){
playerArray[0].gotoStand();
};
};
} else {
if (playerArray[0].currentFrame == Fighter.MOVEBACK){
if (playerArray[0].moveback != null){
if (playerArray[0].moveback.currentFrame == playerArray[0].moveback.totalFrames){
playerArray[0].gotoStand();
};
};
};
};
};
};
};
};
};
};
};
};
}
function frame58(){
stop();
}
function frame56(){
opponentRecovery.gotoAndStop(100);
playerRecovery.gotoAndStop(100);
}
private function generateAIAction(_arg1:int=0):int{
var _local2:Number;
var _local3:int;
aiAction = playerArray[1].currentFrame;
elapsedtimeAfterAIAction = 0;
resetMaxIdleTime(2);
if (((((((((((!((playerArray[0].currentFrame == Fighter.FALL))) && (!((playerArray[0].currentFrame == Fighter.FALL2))))) && (!((playerArray[0].currentFrame == Fighter.GETUP))))) && (!((playerArray[0].currentFrame == Fighter.GETUP2))))) && (!((getTotalDist() < 150))))) && ((playerArray[1].hasMoreStamina() == true)))){
_local2 = Math.random();
if (_local2 < playerArray[1].dummyActionFrequency){
_local3 = Math.floor((Math.random() * randomActions.length));
aiAction = randomActions[_local3];
} else {
if (aiAction == Fighter.STAND){
aiAction = Fighter.WALK;
};
};
elapsedTimeAfterLastAction = 0;
} else {
if (((((((!((playerArray[0].currentFrame == Fighter.FALL))) && (!((playerArray[0].currentFrame == Fighter.FALL2))))) && (!((playerArray[0].currentFrame == Fighter.GETUP))))) && (!((playerArray[0].currentFrame == Fighter.GETUP2))))){
if (generateAISpontaneousAction(_arg1) == true){
elapsedTimeAfterLastAction = 0;
return (aiAction);
};
aiAction = Fighter.WALK;
return (aiAction);
} else {
if (getTotalDist() < 300){
if (playerArray[1].currentFrame != Fighter.MOVEBACK){
choosePlayerdirection(1);
aiAction = Fighter.MOVEBACK;
playerArray[1].gotoMoveBack();
setAIPushBackLength(GParams.PUSHBACK_LENGTH_ON_OPPONENT_FALL);
elapsedTimeAfterLastAction = 0;
return (aiAction);
};
} else {
aiAction = Fighter.STAND;
playerArray[1].gotoStand();
};
};
};
return (aiAction);
}
public function init(){
if (fighterFactory == null){
fighterFactory = new FighterFactory();
};
if (countdown == null){
countdown = new Countdown();
countdown.alpha = 0.65;
countdown.init();
};
countDownMax = GParams.GETUP_COUNTDOWN_MAX;
this.youwintext.gotoAndStop(1);
this.youloosetext.gotoAndStop(1);
this.cheerup1.gotoAndStop(1);
this.cheerup2.gotoAndStop(1);
this.cheerup3.gotoAndStop(1);
this.cheerup4.gotoAndStop(1);
createSurface();
this.platformInner.alpha = 0;
}
private function generateAISpontaneousAction(_arg1:int=0):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
if ((((((((((((((((playerArray[0].currentFrame == Fighter.FALL)) || ((playerArray[0].currentFrame == Fighter.FALL2)))) || ((playerArray[0].currentFrame == Fighter.GETUP)))) || ((playerArray[0].currentFrame == Fighter.GETUP2)))) || ((playerArray[1].currentFrame == Fighter.FALL)))) || ((playerArray[1].currentFrame == Fighter.FALL2)))) || ((playerArray[1].currentFrame == Fighter.GETUP)))) || ((playerArray[1].currentFrame == Fighter.GETUP2)))){
return (false);
};
if (((!((playerArray[1].areAtAttackDist() == true))) || (!((checkAISuitableToHit() == true))))){
return (false);
};
if (playerArray[1].continuesHitsCount > GParams.maxHitsCount){
if (playerArray[0].currentFrame != Fighter.GASP){
return (false);
};
};
_local2 = (playerArray[1].currentStamina / playerArray[1].maxStamina);
_local3 = (playerArray[0].currentStamina / playerArray[0].maxStamina);
_local4 = Math.random();
if ((((((((_arg1 > 0)) && ((playerArray[1].continuesHitsCount <= GParams.maxHitsCount)))) || ((playerArray[1].continuesHitsCount == 0)))) || ((playerArray[1].continuesHitsCount == GParams.maxHitsCount)))){
aiAction = Fighter.LPUNCH;
} else {
if (_local2 > 0.8){
if (_local3 > 0.9){
aiAction = Fighter.JAB;
} else {
aiAction = Fighter.PPUNCH;
};
} else {
if ((((_local2 <= 0.8)) && ((_local2 > 0.6)))){
if (_local3 < _local2){
aiAction = Fighter.JAB;
} else {
if (playerArray[1].currentHealth > playerArray[0].currentHealth){
aiAction = Fighter.PPUNCH;
} else {
if (playerArray[1].currentHealth > 50){
aiAction = Fighter.PPUNCH;
} else {
aiAction = Fighter.LPUNCH;
};
};
};
} else {
if (_local2 > 0.4){
if (_local3 > _local2){
if (playerArray[1].currentHealth > playerArray[0].currentHealth){
aiAction = Fighter.PPUNCH;
} else {
aiAction = Fighter.LPUNCH;
};
} else {
aiAction = Fighter.PPUNCH;
};
} else {
if (playerArray[0].currentFrame == Fighter.GASP){
if (_local2 > 0.4){
aiAction = Fighter.PPUNCH;
} else {
aiAction = Fighter.LPUNCH;
};
} else {
if (playerArray[1].currentFrame != Fighter.MOVEBACK){
choosePlayerdirection(1);
playerArray[1].gotoMoveBack();
setAIPushBackLength(GParams.PUSHBACK_LENGTH_ON_OPPONENT_FALL);
};
};
};
};
};
};
elapsedTimeAfterLastAction = 0;
if (aiAction == Fighter.LPUNCH){
playerArray[1].gotoLowPunch();
} else {
if (aiAction == Fighter.PPUNCH){
playerArray[1].gotoPowerPunch();
} else {
if (aiAction == Fighter.JAB){
playerArray[1].gotoJab();
} else {
if (aiAction == Fighter.BLOCK){
if (_local3 > _local2){
if (playerArray[0].currentHealth > playerArray[1].currentHealth){
aiAction = Fighter.PPUNCH;
} else {
aiAction = Fighter.LPUNCH;
};
};
playerArray[1].gotoBlock();
};
};
};
};
return (true);
}
public function createHero(_arg1:int=0, _arg2:int=0, _arg3:int=5, _arg4:int=80, _arg5:int=60){
heroClass = (loaderInfo.applicationDomain.getDefinition(classNameArray[GParams.selectedHeroIndex]) as Class);
playerArray[0] = new heroClass();
playerArray[0].gotoAndStop(Fighter.STAND);
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
playerArray[0].playerCategory = GParams.gangWarPlayerStat[(GParams.selectedHeroIndex - 1)].playerType;
if (GParams.playedOpponentIndex.length != 0){
playerArray[0].setParameters(GParams.BEHAVIOUR_HERO, playerPos[0], (this.parent as MainClass).newSpeed, (this.parent as MainClass).newStamina, (this.parent as MainClass).newStrength);
playerArray[0].pointsGained = (playerArray[0].pointsGained + (this.parent as MainClass).cfdPoints);
} else {
playerArray[0].setParameters(GParams.BEHAVIOUR_HERO, playerPos[0], GParams.gangWarPlayerStat[(GParams.selectedHeroIndex - 1)].speed, GParams.gangWarPlayerStat[(GParams.selectedHeroIndex - 1)].stamina, GParams.gangWarPlayerStat[(GParams.selectedHeroIndex - 1)].streng);
};
} else {
playerArray[0].playerCategory = GParams.playerStats[(GParams.selectedHeroIndex - 1)].playerType;
playerArray[0].setParameters(GParams.BEHAVIOUR_HERO, playerPos[0], GParams.playerStats[(GParams.selectedHeroIndex - 1)].speed, GParams.playerStats[(GParams.selectedHeroIndex - 1)].stamina, GParams.playerStats[(GParams.selectedHeroIndex - 1)].streng);
};
playerArray[0].setObjectClass(heroClass);
playerArray[0].scaleX = Math.abs(playerArray[0].scaleX);
playerArray[0].scaleY = Math.abs(playerArray[0].scaleY);
playerArray[0].init();
this.dias.addChild(playerArray[0]);
playerArray[0].addEventListener(Event.ENTER_FRAME, onEnterFrameHero);
}
public function generateRandomAIAction():int{
var _local1:int;
_local1 = Math.floor((Math.random() * randomActions.length));
return (randomActions[_local1]);
}
public function restPlayers(){
if (((!((playerArray[0].currentFrame == Fighter.FALL))) && (!((playerArray[0].currentFrame == Fighter.FALL2))))){
playerArray[0].gotoStand();
};
if (((!((playerArray[1].currentFrame == Fighter.FALL))) && (!((playerArray[1].currentFrame == Fighter.FALL2))))){
playerArray[1].gotoStand();
};
}
public function checkOpponentCountDown(){
opponentCountDown = (opponentCountDown + 1);
if (countDownMax <= 0){
(this.parent as MainClass).showResult(true);
return;
};
if (this.parent.contains(countdown) == false){
this.parent.addChild(countdown);
countdown.x = 350;
countdown.y = 250;
};
if ((opponentCountDown % GParams.counterSec) == 0){
countDownMax = (countDownMax - 1);
countdown.setText(countDownMax);
opponentCountDown = 0;
};
if (countDownMax == 1){
if (playerArray[1].checkForcibleGetup() == true){
removeCountdown();
};
};
}
public function updateHUDBars(){
currentHealthBarValueUser = Math.ceil(((100 - Math.round(((100 * playerArray[0].currentHealth) / 100))) + 1));
currentStaminaBarValueUser = Math.ceil(((100 - Math.round(((100 * playerArray[0].currentStamina) / playerArray[0].maxStamina))) + 1));
currentRecoveryBarValueUser = Math.ceil(((100 - Math.round(((100 * playerArray[0].recoveryTime) / GParams.recoveryTimeMax))) + 1));
currentHealthBarValueOpponent = Math.ceil(((100 - Math.round(((100 * playerArray[1].currentHealth) / 100))) + 1));
currentStaminaBarValueOpponent = Math.ceil(((100 - Math.round(((100 * playerArray[1].currentStamina) / playerArray[1].maxStamina))) + 1));
currentRecoveryBarValueOpponent = Math.ceil(((100 - Math.round(((100 * playerArray[1].recoveryTime) / GParams.recoveryTimeMax))) + 1));
if (currentRecoveryBarValueOpponent > 100){
currentRecoveryBarValueOpponent = 100;
};
if (currentRecoveryBarValueOpponent < 1){
currentRecoveryBarValueOpponent = 1;
};
if (currentRecoveryBarValueUser > 100){
currentRecoveryBarValueUser = 100;
};
if (currentRecoveryBarValueUser < 1){
currentRecoveryBarValueUser = 1;
};
this.opponentHealth.gotoAndStop(currentHealthBarValueOpponent);
this.opponentStamina.gotoAndStop(currentStaminaBarValueOpponent);
this.opponentRecovery.gotoAndStop(currentRecoveryBarValueOpponent);
this.playerHealth.gotoAndStop(currentHealthBarValueUser);
this.playerStamina.gotoAndStop(currentStaminaBarValueUser);
this.playerRecovery.gotoAndStop(currentRecoveryBarValueUser);
}
public function checkHeroCountDown(){
heroCountDown = (heroCountDown + 1);
if (countDownMax <= 0){
removeCountdown();
(this.parent as MainClass).showResult(false);
countDownMax = GParams.GETUP_COUNTDOWN_MAX;
return;
};
if (this.parent.contains(countdown) == false){
this.parent.addChild(countdown);
countdown.x = 350;
countdown.y = 250;
countDownMax = GParams.GETUP_COUNTDOWN_MAX;
};
if ((heroCountDown % GParams.counterSec) == 0){
countDownMax = (countDownMax - 1);
countdown.setText(countDownMax);
heroCountDown = 0;
};
if (countDownMax == 1){
if (playerArray[0].checkForcibleGetup() == true){
countDownMax = GParams.GETUP_COUNTDOWN_MAX;
removeCountdown();
};
};
}
public function clearContainerGraphics(){
if (playerArray[0] != null){
if (contains(playerArray[0])){
playerArray[0].removeEventListener(Event.ENTER_FRAME, onEnterFrameHero);
this.dias.removeChild(playerArray[0]);
playerArray[0] = null;
};
};
if (playerArray[1] != null){
if (contains(playerArray[1])){
playerArray[1].removeEventListener(Event.ENTER_FRAME, onEnterFrameOpponent);
this.dias.removeChild(playerArray[1]);
playerArray[1] = null;
};
};
removeCountdown();
}
private function handleUserMoveback(){
userPushbackCounter = (userPushbackCounter + 1);
if (playerArray[0].pushBack() == false){
playerArray[0].gotoStand();
};
if (MainClass.leftKeyDown == true){
if (playerArray[0].movebackKey == 2){
return;
};
} else {
if (MainClass.rightKeyDown == true){
if (playerArray[0].movebackKey == 1){
return;
};
} else {
if (MainClass.upKeyDown == true){
if (playerArray[0].movebackKey == 3){
return;
};
} else {
if (MainClass.downKeyDown == true){
if (playerArray[0].movebackKey == 4){
return;
};
} else {
playerArray[0].gotoStand();
};
};
};
};
}
public function resetMaxIdleTime(_arg1:int=2){
if (_arg1 == Fighter.MOVEBACK){
elapsedTimeAfterLastAction = 0;
playerArray[1].maxIdleTime = (GParams.AI_MAX_VARIABLE_IDLETIME * (1 - (playerArray[1].maxStamina / GParams.STAMINA_MAX)));
} else {
elapsedTimeAfterLastAction = 0;
playerArray[1].maxIdleTime = (GParams.AI_MAX_VARIABLE_IDLETIME * (1 - (playerArray[1].currentStamina / GParams.STAMINA_MAX)));
};
}
public function checkHealth(){
if (playerArray[0].currentHealth <= 0){
(this.parent as MainClass).showResult(false);
};
if (playerArray[1].currentHealth <= 0){
(this.parent as MainClass).showResult(true);
};
}
private function getFutureAttackPointsOppositeSide():Point{
var _local1:Point;
_local1 = new Point(playerArray[0].x, playerArray[0].y);
if (playerArray[0].scaleX > 0){
_local1.x = Math.round((playerArray[0].x + (GParams.actionDistMin.x + 5)));
_local1.y = Math.round(playerArray[0].y);
} else {
_local1.x = Math.round((playerArray[0].x - (GParams.actionDistMin.x + 5)));
_local1.y = Math.round(playerArray[0].y);
};
if (playerArray[1].validatePoint(_local1) == true){
return (_local1);
};
return (null);
}
public function handleFlipping(){
var _local1:int;
var _local2:int;
if (playerArray[0].scaleX < 0){
_local1 = (playerArray[0].x - playerArray[1].x);
_local2 = (playerArray[0].y - playerArray[1].y);
if (_local1 > 0){
if (((((((((!((playerArray[1].currentFrame == Fighter.FALL))) && (!((playerArray[1].currentFrame == Fighter.FALL2))))) && (!((playerArray[1].currentFrame == Fighter.GETUP))))) && (!((playerArray[1].currentFrame == Fighter.GETUP2))))) && (!((playerArray[1].currentFrame == Fighter.GASP))))){
playerArray[1].scaleX = (Math.abs(playerArray[1].scaleX) * -1);
};
if (((((((((!((playerArray[0].currentFrame == Fighter.FALL))) && (!((playerArray[0].currentFrame == Fighter.FALL2))))) && (!((playerArray[0].currentFrame == Fighter.GETUP))))) && (!((playerArray[0].currentFrame == Fighter.GETUP2))))) && (!((playerArray[0].currentFrame == Fighter.GASP))))){
playerArray[0].scaleX = Math.abs(playerArray[0].scaleX);
};
} else {
if (((((((((!((playerArray[1].currentFrame == Fighter.FALL))) && (!((playerArray[1].currentFrame == Fighter.FALL2))))) && (!((playerArray[1].currentFrame == Fighter.GETUP))))) && (!((playerArray[1].currentFrame == Fighter.GETUP2))))) && (!((playerArray[1].currentFrame == Fighter.GASP))))){
playerArray[1].scaleX = Math.abs(playerArray[1].scaleX);
};
};
} else {
if (playerArray[0].scaleX > 0){
_local1 = (playerArray[0].x - playerArray[1].x);
_local2 = (playerArray[0].y - playerArray[1].y);
if (_local1 < 0){
if (((((((((!((playerArray[1].currentFrame == Fighter.FALL))) && (!((playerArray[1].currentFrame == Fighter.FALL2))))) && (!((playerArray[1].currentFrame == Fighter.GETUP))))) && (!((playerArray[1].currentFrame == Fighter.GETUP2))))) && (!((playerArray[1].currentFrame == Fighter.GASP))))){
playerArray[1].scaleX = Math.abs(playerArray[1].scaleX);
};
if (((((((((!((playerArray[0].currentFrame == Fighter.FALL))) && (!((playerArray[0].currentFrame == Fighter.FALL2))))) && (!((playerArray[0].currentFrame == Fighter.GETUP))))) && (!((playerArray[0].currentFrame == Fighter.GETUP2))))) && (!((playerArray[0].currentFrame == Fighter.GASP))))){
playerArray[0].scaleX = (Math.abs(playerArray[0].scaleX) * -1);
};
} else {
if (((((((((!((playerArray[1].currentFrame == Fighter.FALL))) && (!((playerArray[1].currentFrame == Fighter.FALL2))))) && (!((playerArray[1].currentFrame == Fighter.GETUP))))) && (!((playerArray[1].currentFrame == Fighter.GETUP2))))) && (!((playerArray[1].currentFrame == Fighter.GASP))))){
playerArray[1].scaleX = (Math.abs(playerArray[1].scaleX) * -1);
};
};
};
};
}
public function gotoHitbackAfterblock(){
var _local1:Number;
_local1 = Math.random();
if ((((_local1 < playerArray[1].hitBackAfterBlockFrequency)) || ((_local1 < playerArray[1].hitbackFrequency)))){
if (generateAISpontaneousAction(Fighter.LPUNCH) == false){
playerArray[1].gotoStand();
};
} else {
if (playerArray[0].continuesHitsCount > 0){
if (generateAISpontaneousAction(Fighter.LPUNCH) == false){
playerArray[1].gotoStand();
};
} else {
playerArray[1].gotoStand();
};
};
}
public function handleActions(){
var _local1:Boolean;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Boolean;
if (playerArray[0].currentFrame == Fighter.MOVEBACK){
handleUserMoveback();
};
if ((((((((((playerArray[0].currentFrame == Fighter.HURT)) || ((playerArray[0].isRecoveryInProgress == true)))) || ((playerArray[0].currentFrame == Fighter.FALL)))) || ((playerArray[0].currentFrame == Fighter.FALL2)))) || ((playerArray[0].currentFrame == Fighter.GASP)))){
playerArray[0].checkRecoveryTime();
if ((((((playerArray[0].currentFrame == Fighter.FALL)) || ((playerArray[0].currentFrame == Fighter.FALL2)))) || ((playerArray[0].currentFrame == Fighter.GASP)))){
_local1 = playerArray[0].checkGetupAction();
elapsedTimeAfterLastAction = playerArray[0].maxIdleTime;
if ((((playerArray[0].currentFrame == Fighter.FALL)) || ((playerArray[0].currentFrame == Fighter.FALL2)))){
checkHeroCountDown();
};
playerArray[0].regenerateStamina();
return;
};
if (playerArray[0].currentFrame == Fighter.HURT){
if (playerArray[0].hurt != null){
if (playerArray[0].hurt.currentFrame < 4){
if (playerArray[0].hurt.currentFrame == 2){
choosePlayerdirection(0);
playerArray[0].pushBack(3);
};
playerArray[0].pushBack(3);
};
};
};
};
if (!(((playerArray[0].currentFrame >= Fighter.LPUNCH)) && ((playerArray[0].currentFrame <= Fighter.MOVEBACK)))){
_local2 = 0;
_local3 = 0;
_local4 = playerArray[0].getWalkSpeed();
if (MainClass.leftKeyDown == true){
_local2 = (_local2 - _local4);
playerArray[0].movebackKey = 2;
} else {
if (MainClass.rightKeyDown == true){
_local2 = (_local2 + _local4);
playerArray[0].movebackKey = 1;
};
};
if (MainClass.upKeyDown == true){
_local3 = (_local3 - _local4);
playerArray[0].movebackKey = 3;
} else {
if (MainClass.downKeyDown == true){
_local3 = (_local3 + _local4);
playerArray[0].movebackKey = 4;
};
};
if (((!((_local2 == 0))) || (!((_local3 == 0))))){
_local5 = playerArray[0].movement(_local2, _local3);
if ((((_local5 == true)) && (!((playerArray[0].currentFrame == Fighter.WALK))))){
playerArray[0].gotoWalk();
playerArray[0].movebackKey = 0;
};
} else {
playerArray[0].movebackKey = 0;
playerArray[0].gotoStand();
};
};
if (!(((playerArray[0].currentFrame >= Fighter.LPUNCH)) && ((playerArray[0].currentFrame <= Fighter.GETUP2)))){
if (MainClass.sKeyDown == true){
playerArray[0].gotoBlock();
MainClass.sKeyDown = false;
};
};
if ((((((playerArray[0].isRecoveryInProgress == false)) && (((!((((playerArray[0].currentFrame >= Fighter.HURT)) && ((playerArray[0].currentFrame <= Fighter.MOVEBACK))))) && (!((playerArray[0].currentFrame == Fighter.GASP))))))) && (!((((playerArray[0].currentFrame >= Fighter.LPUNCH)) && ((playerArray[0].currentFrame <= Fighter.JAB))))))){
if (MainClass.wKeyDown == true){
MainClass.wKeyDown = false;
elapsedTimeAfterLastAction = 0;
playerArray[0].gotoLowPunch();
} else {
if (MainClass.aKeyDown == true){
MainClass.aKeyDown = false;
elapsedTimeAfterLastAction = 0;
playerArray[0].gotoPowerPunch();
} else {
if (MainClass.dKeyDown == true){
MainClass.dKeyDown = false;
elapsedTimeAfterLastAction = 0;
playerArray[0].gotoJab();
};
};
};
};
if ((((playerArray[0].currentFrame < Fighter.LPUNCH)) || ((playerArray[0].currentFrame > Fighter.JAB)))){
playerArray[0].regenerateStamina();
};
}
public function cheerupAnimation(_arg1:Number){
switch (_arg1){
case 1:
this.cheerup1.gotoAndPlay(2);
this.cheerup3.gotoAndPlay(2);
break;
case 2:
this.cheerup2.gotoAndPlay(2);
this.cheerup4.gotoAndPlay(2);
break;
case 3:
this.cheerup1.gotoAndPlay(2);
this.cheerup3.gotoAndPlay(2);
this.cheerup2.gotoAndPlay(2);
this.cheerup4.gotoAndPlay(2);
break;
default:
break;
};
}
public function updatePlayersScaleValue(){
playerArray[0].scaleX = (playerArray[0].scaleX * GParams.playersScalePercent);
playerArray[0].scaleY = (playerArray[0].scaleY * GParams.playersScalePercent);
playerArray[1].scaleY = (playerArray[1].scaleY * GParams.playersScalePercent);
playerArray[1].scaleX = (playerArray[1].scaleX * GParams.playersScalePercent);
GParams.playerDistMin.x = (GParams.playerDistMinAt100.x * GParams.playersScalePercent);
GParams.playerDistMin.y = (GParams.playerDistMinAt100.y * GParams.playersScalePercent);
GParams.actionDistMin.x = (GParams.actionDistMinAt100.x * GParams.playersScalePercent);
GParams.actionDistMin.y = (GParams.actionDistMinAt100.y * GParams.playersScalePercent);
GParams.minDistTotal = (Math.sqrt((((GParams.actionDistMin.x + 15) * (GParams.actionDistMin.x + 15)) + (GParams.actionDistMin.y * GParams.actionDistMin.y))) / 3);
GParams.minPlayerDist = ((GParams.minDistTotal * 3) + 10);
}
public function removePlayerEvents(){
playerArray[0].removeEventListener(Event.ENTER_FRAME, onEnterFrameHero);
playerArray[1].removeEventListener(Event.ENTER_FRAME, onEnterFrameOpponent);
restPlayers();
}
public function clearGraphics(){
if (playerArray[0] != null){
if (contains(playerArray[0])){
removeChild(playerArray[0]);
};
if (contains(playerArray[1])){
removeChild(playerArray[1]);
};
playerArray[0] = null;
playerArray[1] = null;
};
aiAction = Fighter.STAND;
elapsedTimeAfterLastAction = 0;
}
}
}//package
Section 55
//Countdown (Countdown)
package {
import flash.display.*;
public class Countdown extends MovieClip {
public function Countdown(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
public function init(){
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
public function setText(_arg1:int){
this.gotoAndStop((_arg1 + ""));
}
}
}//package
Section 56
//EnterNameScreen (EnterNameScreen)
package {
import flash.display.*;
public dynamic class EnterNameScreen extends MovieClip {
public var main:MovieClip;
}
}//package
Section 57
//Fighter (Fighter)
package {
import flash.display.*;
import flash.geom.*;
public class Fighter extends MovieClip {
public var walkSpeed:Number;// = 5
public var recoveryTime:int;// = 0
public var continuesHits:Number;// = 0
public var totalMatchesPunches:Number;// = 0
public var dummyActionFrequency:Number;// = 0
public var maxIdleTime:Number;// = 0
private var strength:int;// = 0
public var hurtCount:int;// = 0
public var currentSpeed:Number;// = 0
private var speed:Number;// = 0
public var continuesHitsCount:int;// = 0
public var maxStamina:int;// = 0
private var stamina:int;// = 0
protected var foot2Point:Point;
public var previousPunch:int;// = 0
public var totalPunches:Number;// = 0
private var radius:Number;// = 10
public var dir:int;// = 1
public var isRecoveryInProgress:Boolean;// = false
public var currentStamina:Number;// = 0
public var hitBackAfterBlockFrequency:Number;// = 0
public var currentStrength:Number;// = 0
private var deltaRegenrateStamina:Number;// = 1
private var currentRecoveryTick:int;// = 0
public var actualPunches:Number;// = 0
public var playerCategory:int;// = 0
private var power:Number;// = 0
public var movebackKey:int;// = 0
public var speedy:Number;// = 0
public var speedx:Number;// = 0
public var totalMatchesHits:Number;// = 0
public var pointsGained:int;// = 3
private var fixedSpeed:Number;// = 0
public var currentHealth:int;// = 0
public var currentPushbackLength:int;// = 0
public var maxSpeed:Number;// = 0
public var actionInProgress:Boolean;// = false
public var blockFrequency:Number;// = 0
public var actualLPunch:int;// = 0
public var getupType:int;// = 1
protected var opponent:Fighter;// = null
public var elapsedTimeAfterHurtAI:int;// = 0
public var hitbackFrequency:Number;// = 0
private var behaviourType:int;// = 0
public var actualJab:int;// = 0
public var moveAwayAngle:int;// = 180
private var childClass:Class;// = null
public var moveAwayFrequency:Number;// = 0
public var maxStrength:int;// = 0
public var actualPPunch:int;// = 0
protected var foot1Point:Point;
public var playerId:int;// = 0
public var restFrequency:Number;// = 0
public var continuesMovebacks:int;// = 0
public static var GETUP2:int = 12;
public static var LPUNCH:int = 4;
public static var WALK:int = 1;
public static var HURT:int = 7;
public static var GETUP:int = 11;
public static var FALL2:int = 10;
public static var JAB:int = 6;
public static var BLOCK:int = 8;
public static var STAND:int = 2;
public static var GASP:int = 3;
public static var MOVEBACK:int = 13;
public static var FALL:int = 9;
public static var PPUNCH:int = 5;
public function Fighter(){
playerId = 0;
actionInProgress = false;
dir = 1;
behaviourType = 0;
playerCategory = 0;
walkSpeed = 5;
speed = 0;
strength = 0;
stamina = 0;
power = 0;
foot1Point = new Point();
foot2Point = new Point();
opponent = null;
maxStamina = 0;
maxStrength = 0;
maxSpeed = 0;
pointsGained = 3;
currentStamina = 0;
currentHealth = 0;
currentSpeed = 0;
fixedSpeed = 0;
currentStrength = 0;
isRecoveryInProgress = false;
recoveryTime = 0;
currentRecoveryTick = 0;
deltaRegenrateStamina = 1;
speedx = 0;
speedy = 0;
maxIdleTime = 0;
continuesHits = 0;
elapsedTimeAfterHurtAI = 0;
hurtCount = 0;
getupType = 1;
childClass = null;
totalPunches = 0;
actualPunches = 0;
totalMatchesPunches = 0;
totalMatchesHits = 0;
continuesHitsCount = 0;
moveAwayAngle = 180;
continuesMovebacks = 0;
blockFrequency = 0;
moveAwayFrequency = 0;
restFrequency = 0;
dummyActionFrequency = 0;
hitbackFrequency = 0;
currentPushbackLength = 0;
hitBackAfterBlockFrequency = 0;
movebackKey = 0;
radius = 10;
previousPunch = 0;
actualLPunch = 0;
actualPPunch = 0;
actualJab = 0;
super();
}
public function checkLineVerticle(_arg1:LineParticle, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean=false):Boolean{
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:Number;
var _local11:Number;
_local7 = (_arg2 - radius);
_local8 = (_arg2 + radius);
if ((((_arg3 >= _arg1.min.y)) && ((_arg3 <= _arg1.max.y)))){
if ((((_arg1.x > _local7)) && ((_arg1.x < _local8)))){
if (_arg1.cType == 0){
_local9 = (_arg1.x - _local8);
if (_local9 < 0){
if (_arg6 == true){
x = (_arg1.x - radius);
_arg2 = x;
return (false);
};
return (true);
};
} else {
if (_arg1.cType == 1){
_local9 = (_local7 - _arg1.x);
if (_local9 <= 0){
if (_arg6 == true){
x = (_arg1.x + radius);
_arg2 = x;
return (false);
};
return (true);
};
} else {
if (_arg1.cType == -1){
_local10 = Math.abs((_arg1.x - _local7));
_local11 = Math.abs((_arg1.x - _local8));
if (x < _arg1.x){
if (_arg6 == true){
x = (_arg1.x - radius);
_arg2 = x;
return (false);
};
return (true);
} else {
if (x > _arg1.x){
if (_arg6 == true){
x = (_arg1.x + radius);
_arg2 = x;
return (false);
};
return (true);
} else {
if (_arg6 == true){
x = (_arg1.x + ((Math.abs(_arg4) / _arg4) * radius));
_arg2 = x;
return (false);
};
return (true);
};
};
};
};
};
};
};
return (false);
}
public function gotoHurt(_arg1:int){
continuesMovebacks = 0;
previousPunch = _arg1;
continuesHitsCount = 0;
if (currentFrame == HURT){
(this as childClass).hurt.gotoAndPlay(1);
} else {
gotoAndStop("hurt");
};
}
public function actionJab(){
totalPunches = (totalPunches + 1);
if (canApplyAction() == true){
actualJab = (actualJab + 1);
actualPunches = (actualPunches + 1);
opponent.calculateJabEffect(getCurrentPower());
opponent.gotoHurt(JAB);
if (MainClass.isSoundOn == true){
MainClass.js.play();
};
} else {
if (MainClass.isSoundOn == true){
if (opponent.currentFrame == Fighter.BLOCK){
MainClass.bls.play();
} else {
MainClass.mp.play();
};
};
};
}
public function showGasping():int{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local1 = (maxStamina - currentStamina);
_local2 = (100 - currentHealth);
_local3 = (maxSpeed - currentSpeed);
_local4 = ((currentStamina + currentHealth) + maxSpeed);
_local5 = ((100 + 100) + GParams.SPEED_MAX);
if (currentHealth < GParams.GET_UP_ACTION_HEALTH){
_local6 = (((GParams.GETUP_COUNTDOWN_MAX * (_local5 - _local4)) / (_local5 * 3)) * GParams.frameRate);
recoveryTime = (recoveryTime + _local6);
isRecoveryInProgress = true;
return (2);
};
if ((((currentHealth <= GParams.YELLOW_ZONE_START)) && ((currentStamina <= GParams.YELLOW_ZONE_START)))){
_local6 = (((GParams.GETUP_COUNTDOWN_MAX * (_local5 - _local4)) / (_local5 * 3)) * GParams.frameRate);
recoveryTime = (recoveryTime + _local6);
isRecoveryInProgress = true;
return (2);
};
if ((((recoveryTime > 0)) || ((currentStamina <= GParams.YELLOW_ZONE_END)))){
_local6 = (((GParams.GASPING_INTERVAL_MAX * (_local5 - _local4)) / (_local5 * 3)) * GParams.frameRate);
recoveryTime = (recoveryTime + _local6);
isRecoveryInProgress = true;
return (1);
};
return (0);
}
public function hasToWalk():Boolean{
if (arePlayersAwayToWalk(speedx, speedy) == true){
return (false);
};
return (true);
}
public function validatePoint(_arg1:Point){
var _local2:Boolean;
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Number;
_local2 = true;
_local4 = 0;
_local5 = _arg1.x;
_local6 = _arg1.y;
if (((((this.parent.parent as Container).platformInner.hitTestPoint(_local5, _local6, true) == true)) || (((this.parent.parent as Container).platformInner.hitTestPoint(this.x, this.y, true) == true)))){
_local2 = true;
} else {
_local2 = false;
};
return (_local2);
}
public function calcLPEffectOnSelf(){
var _local1:int;
_local1 = ((GParams.DEDUCT_PERC_USER_STAMINA_LOW / 100) * maxStamina);
currentStamina = (currentStamina - _local1);
if (currentStamina < 1){
currentStamina = 1;
};
calculateDeltaRecoverySelf(GParams.SELF_RECOVERY_LPUNCH);
}
public function handleWalking():Boolean{
if ((this as childClass).currentFrame == Fighter.WALK){
if ((this as childClass).walk.currentFrame == (this as childClass).walk.totalFrames){
gotoStand();
return (false);
};
this.x = (this.x + speedx);
this.y = (this.y + speedy);
};
return (true);
}
public function hasMoreStamina():Boolean{
var _local1:Number;
_local1 = (currentStamina / maxStamina);
if ((((_local1 > GParams.DUMMY_ACTION_STAMINA_MIN)) && ((currentHealth > GParams.DUMMY_ACTION_HEALTH_MIN)))){
return (true);
};
return (false);
}
public function checkLineHorizontal(_arg1:LineParticle, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean=false):Boolean{
var _local7:Number;
var _local8:Number;
var _local9:int;
_local7 = (_arg3 - radius);
_local8 = (_arg3 + radius);
if ((((_arg2 >= _arg1.min.x)) && ((_arg2 <= _arg1.max.x)))){
if ((((_arg1.y >= _local7)) && ((_arg1.y <= _local8)))){
if (_arg1.cType == 0){
_local9 = (_arg1.y - _local8);
if (_local9 < 0){
if (_arg6 == true){
y = (_arg1.y - radius);
_arg3 = y;
return (false);
};
return (true);
};
};
if (_arg1.cType == 1){
_local9 = (_local7 - _arg1.y);
if (_local9 <= 0){
if (_arg6 == true){
y = (_arg1.y + radius);
_arg3 = y;
return (false);
};
return (true);
};
};
if (_arg1.cType == -1){
if (y < _arg1.y){
if (_arg6 == true){
y = (_arg1.y - radius);
_arg3 = y;
};
return (true);
} else {
if (y > _arg1.y){
if (_arg6 == true){
y = (_arg1.y + radius);
_arg3 = y;
};
return (true);
} else {
y = (_arg1.y + ((Math.abs(_arg5) / _arg5) * radius));
_arg3 = y;
return (true);
};
};
};
};
};
return (false);
}
public function hasInsuficientStamina():Boolean{
var _local1:Number;
_local1 = (currentStamina / maxStamina);
if (_local1 > 0.6){
return (false);
};
return (true);
}
public function calcPPEffectOnSelf(){
var _local1:int;
_local1 = ((GParams.DEDUCT_PERC_USER_STAMINA_MEDIUM / 100) * maxStamina);
currentStamina = (currentStamina - _local1);
if (currentStamina < 1){
currentStamina = 1;
};
GParams.SELF_RECOVERY_PPUNCH;
}
public function gotoStand(){
if (currentFrame != STAND){
gotoAndStop("stand");
};
}
public function moveAway(){
if (this.scaleX < 0){
};
}
public function calculateRecoveryTime(){
if (currentFrame == LPUNCH){
calcLPEffectOnSelf();
} else {
if (currentFrame == PPUNCH){
calcPPEffectOnSelf();
} else {
if (currentFrame == JAB){
calcJabEffectOnSelf();
};
};
};
}
public function actionLowPunch(){
totalPunches = (totalPunches + 1);
if (canApplyAction() == true){
actualLPunch = (actualLPunch + 1);
actualPunches = (actualPunches + 1);
opponent.calculateLowPunchEffect(getCurrentPower());
opponent.gotoHurt(LPUNCH);
if (MainClass.isSoundOn == true){
MainClass.lp.play();
};
} else {
if (MainClass.isSoundOn == true){
if (opponent.currentFrame == Fighter.BLOCK){
MainClass.bls.play();
} else {
MainClass.mp.play();
};
};
};
}
public function validatePosition(_arg1:Number, _arg2:Number):Boolean{
var _local3:Boolean;
_local3 = true;
if (arePlayersCloseby(_arg1, _arg2) == true){
return (false);
};
if (boundaryCheck(_arg1, _arg2) == true){
return (true);
};
return (false);
}
public function regenerateStamina(){
if (this.currentFrame == GASP){
deltaRegenrateStamina = ((((currentHealth * maxStamina) / 10) * 8) / (100 * GParams.SPEED_MAX));
} else {
if ((((this.currentFrame == FALL)) || ((this.currentFrame == FALL2)))){
deltaRegenrateStamina = ((((currentHealth * maxStamina) / 10) * 3) / (100 * GParams.SPEED_MAX));
} else {
deltaRegenrateStamina = ((((currentHealth * maxStamina) / 10) * 1.5) / (100 * GParams.SPEED_MAX));
};
};
currentStamina = (currentStamina + deltaRegenrateStamina);
if (currentStamina > maxStamina){
currentStamina = maxStamina;
};
currentSpeed = (fixedSpeed + ((currentStamina / maxStamina) * fixedSpeed));
}
public function movement(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean{
var _local4:Boolean;
var _local5:Boolean;
_local4 = false;
if (arePlayersCloseby(_arg1, _arg2) == true){
_local4 = false;
return (false);
};
if (boundaryCheck(_arg1, _arg2, true) == true){
return (true);
};
if (currentFrame != HURT){
gotoStand();
return (false);
};
_local5 = true;
return (false);
}
public function checkLineOuter(_arg1:LineParticle, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean=false):Boolean{
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:*;
var _local11:Point;
var _local12:Rectangle;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local10 = false;
_local11 = new Point();
_local11.x = _arg1.x;
_local11.y = _arg1.y;
_local12 = _arg1.getBounds((this.parent as MovieClip));
if ((((_arg2 >= _local12.left)) && ((_arg2 <= _local12.right)))){
_local7 = ((_arg1.rotation * Math.PI) / 180);
_local9 = Math.cos(_local7);
_local8 = Math.sin(_local7);
_local13 = (_arg2 - _local11.x);
_local14 = (_arg3 - _local11.y);
_local15 = ((_local9 * _local14) - (_local8 * _local13));
_local16 = ((_local9 * _arg5) - (_local8 * _arg4));
if ((((_local15 <= radius)) && ((_local15 >= _local16)))){
_local15 = radius;
_local17 = ((_local9 * _local13) + (_local8 * _local14));
if ((((_local17 >= _arg1.bounds.left)) && ((_local17 <= _arg1.bounds.right)))){
_local18 = ((_local9 * _arg4) + (_local8 * _arg5));
_local10 = true;
_local15 = radius;
_local16 = (_local16 * -1);
_local13 = ((_local9 * _local17) - (_local8 * _local15));
_local14 = ((_local9 * _local15) + (_local8 * _local17));
_arg4 = ((_local9 * _local18) - (_local8 * _local16));
_arg5 = ((_local9 * _local16) + (_local8 * _local18));
if (_arg6 == true){
x = (_local11.x + _local13);
y = (_local11.y + _local14);
};
};
};
};
return (_local10);
}
public function gotoLowPunch(){
continuesMovebacks = 0;
continuesHitsCount = (continuesHitsCount + 1);
if (currentFrame != LPUNCH){
gotoAndStop("lpunch");
};
}
public function calculateJabEffect(_arg1:int){
var _local2:int;
var _local3:int;
_local2 = ((GParams.DEDUCT_OPPONENT_STAMINA_HIGH / 100) * _arg1);
_local3 = ((GParams.DEDUCT_OPPONENT_HEALTH_MEDIUM / 100) * _arg1);
currentStamina = (currentStamina - _local2);
currentHealth = (currentHealth - _local3);
if (currentStamina < 1){
currentStamina = 1;
};
if (currentHealth < 1){
currentHealth = 1;
};
calculateDeltaRecoverySelf(GParams.OPPONENT_RECOVERY_JAB);
}
public function resetAngle(_arg1:int){
moveAwayAngle = 180;
}
public function gotoGetup(){
continuesMovebacks = 0;
if (((!((currentFrame == GETUP))) && (!((currentFrame == GETUP2))))){
if (getupType == 1){
gotoAndStop("getup");
};
if (getupType == 2){
gotoAndStop("getup2");
};
};
}
public function arePlayersAwayToWalk(_arg1:int=0, _arg2:int=0):Boolean{
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Number;
_local3 = (this.x + _arg1);
_local4 = (this.y + _arg2);
_local5 = Math.abs((_local3 - opponent.x));
_local6 = Math.abs((_local4 - opponent.y));
if ((((_local5 <= GParams.playerDistMin.x)) && ((_local6 <= GParams.playerDistMin.y)))){
return (true);
};
return (false);
}
public function gotoMoveBack(){
if (currentFrame != MOVEBACK){
continuesMovebacks = (continuesMovebacks + 1);
if (currentFrame == HURT){
GParams.PUSHBACK_LENGTH = (2 + Math.ceil((((maxStamina - currentStamina) * GParams.frameRate) / maxStamina)));
} else {
GParams.PUSHBACK_LENGTH = (3 + (2 * Math.ceil((((maxStamina - currentStamina) * GParams.frameRate) / maxStamina))));
};
gotoAndStop("moveback");
};
}
public function gotoGasping(){
continuesMovebacks = 0;
continuesHitsCount = 0;
if (currentFrame != GASP){
gotoAndStop("gasping");
};
}
public function gotoBlock(){
continuesMovebacks = 0;
if (currentFrame != BLOCK){
gotoAndStop("block");
};
}
public function gotoPowerPunch(){
continuesMovebacks = 0;
continuesHitsCount = (continuesHitsCount + 1);
if (currentFrame != PPUNCH){
gotoAndStop("ppunch");
};
}
public function movementTrainee(_arg1:Number, _arg2:Number):Boolean{
if (boundaryCheckTrainee(_arg1, _arg2, true) == true){
return (true);
};
return (false);
}
public function checkMovebackPossible(_arg1:Number=0):Boolean{
var _local2:Number;
var _local3:Number;
if (_arg1 == 0){
_arg1 = currentSpeed;
} else {
};
_local2 = (Math.cos(((moveAwayAngle * Math.PI) / 180)) * _arg1);
_local3 = (Math.sin(((moveAwayAngle * Math.PI) / 180)) * _arg1);
if (boundaryCheck(_local2, _local3) == true){
return (true);
};
return (false);
}
public function handleAIWalking():Boolean{
if ((this as childClass).currentFrame == WALK){
if ((this as childClass).walk.currentFrame == (this as childClass).walk.totalFrames){
if (canApplyAction() == true){
gotoStand();
return (false);
};
} else {
this.x = (this.x + speedx);
this.y = (this.y + speedy);
};
};
return (true);
}
public function boundaryCheck(_arg1:Number=0, _arg2:Number=0, _arg3:Boolean=false):Boolean{
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Container;
var _local8:int;
var _local9:int;
var _local10:int;
_local4 = true;
_local5 = (this.x + _arg1);
_local6 = (this.y + _arg2);
_local7 = (this.parent.parent as Container);
_local8 = 0;
while (_local8 < _local7.lineArray.length) {
if (checkLine(_local7.lineArray[_local8], _local5, _local6, _arg1, _arg2, _arg3) == true){
_local9 = _local8;
_local10 = 0;
while (_local10 < (_local7.lineArray.length - 1)) {
_local9 = ((_local9 + 1) % _local7.lineArray.length);
if (checkLine(_local7.lineArray[_local9], this.x, this.y, 0, 0, _arg3) == true){
return (false);
};
_local10++;
};
if (_arg3 == true){
return (true);
};
return (false);
};
if ((this.parent.parent as Container).platformInner.hitTestPoint(_local5, _local6, true) == false){
return (false);
};
_local8++;
};
if (_arg3 == true){
this.x = (this.x + _arg1);
this.y = (this.y + _arg2);
};
return (true);
}
public function init(){
(this as childClass).gotoAndStop("stand");
isRecoveryInProgress = false;
recoveryTime = 0;
currentRecoveryTick = 0;
continuesHits = 0;
continuesHitsCount = 0;
actualLPunch = 0;
actualPPunch = 0;
actualJab = 0;
}
public function areAtAttackDist():Boolean{
var _local1:Number;
var _local2:Number;
_local1 = Math.abs((this.x - opponent.x));
_local2 = Math.abs((this.y - opponent.y));
if ((((_local1 <= (GParams.actionDistMin.x + 10))) && ((_local2 <= (GParams.actionDistMin.y + 5))))){
return (true);
};
return (false);
}
public function clearAction(){
var _local1:int;
_local1 = showGasping();
if ((((_local1 == 1)) || ((_local1 == 2)))){
if (childClass != null){
(this as childClass).gotoGasping();
};
} else {
(this as childClass).gotoStand();
};
}
private function checkLine(_arg1:LineParticle, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean=false){
if ((((_arg1.angle == 0)) || ((_arg1.angle == 180)))){
return (checkLineHorizontal(_arg1, _arg2, _arg3, speedx, speedy, _arg6));
};
if ((((_arg1.angle == 90)) || ((_arg1.angle == 270)))){
return (checkLineVerticle(_arg1, _arg2, _arg3, speedx, speedy, _arg6));
};
return (checkLineOuter(_arg1, _arg2, _arg3, speedx, speedy, _arg6));
}
public function checkRecoveryTime():Boolean{
recoveryTime = (recoveryTime - 1);
if ((((recoveryTime <= 0)) && (!((this.currentFrame == HURT))))){
isRecoveryInProgress = false;
recoveryTime = 0;
return (true);
};
return (false);
}
public function setGetupType(){
if (((!((currentFrame == FALL))) && (!((currentFrame == FALL2))))){
if ((((this.scaleX > 0)) && ((this.x > 350)))){
getupType = 1;
} else {
if ((((this.scaleX < 0)) && ((this.x < 350)))){
getupType = 1;
} else {
if (Math.random() < 0.5){
getupType = 2;
} else {
getupType = 1;
};
};
};
};
}
public function pushBack(_arg1:Number=0):Boolean{
var _local2:Number;
var _local3:Number;
if ((((behaviourType == 1)) && ((movebackKey > 0)))){
_arg1 = 5;
} else {
if (_arg1 == 0){
_arg1 = currentSpeed;
} else {
};
if (_arg1 > 5){
_arg1 = 5;
};
};
_local2 = (Math.cos(((moveAwayAngle * Math.PI) / 180)) * _arg1);
_local3 = (Math.sin(((moveAwayAngle * Math.PI) / 180)) * _arg1);
if (movement(_local2, _local3) == true){
return (true);
};
return (false);
}
public function handleWalkingTrainee():Boolean{
if ((this as childClass).currentFrame == Fighter.WALK){
if ((this as childClass).walk.currentFrame == (this as childClass).walk.totalFrames){
gotoStand();
return (false);
};
this.x = (this.x + speedx);
this.y = (this.y + speedy);
};
return (true);
}
public function validatePositionTrainee(_arg1:Number, _arg2:Number):Boolean{
var _local3:Boolean;
_local3 = true;
if (boundaryCheckTrainee(_arg1, _arg2) == true){
return (true);
};
return (false);
}
public function canApplyAction():Boolean{
if ((((((((((((((opponent.currentFrame == BLOCK)) || ((opponent.currentFrame == FALL)))) || ((opponent.currentFrame == FALL2)))) || ((currentFrame == FALL)))) || ((currentFrame == FALL2)))) || ((currentFrame == GETUP)))) || ((currentFrame == GETUP2)))){
return (false);
};
return (areAtAttackDist());
}
public function chooseDirection(_arg1:int, _arg2:int){
if ((((x < 369)) && ((y < 300)))){
if (_arg2 < 0){
setAngle(345);
} else {
if (_arg1 < 0){
setAngle(160);
} else {
if (_arg2 > 0){
setAngle(15);
} else {
if (_arg1 > 0){
setAngle(20);
};
};
};
};
};
if ((((x < 357)) && ((y >= 300)))){
if (_arg2 > 0){
setAngle(25);
} else {
if (_arg1 < 0){
setAngle(205);
} else {
if (_arg1 > 0){
setAngle(325);
} else {
if (_arg2 < 0){
setAngle(345);
};
};
};
};
};
if ((((x >= 369)) && ((y < 290)))){
if (_arg2 < 0){
setAngle(190);
} else {
if (_arg1 > 0){
setAngle(20);
} else {
if (_arg1 < 0){
setAngle(160);
} else {
if (_arg2 > 0){
setAngle(150);
};
};
};
};
};
if ((((x >= 357)) && ((y >= 290)))){
if (_arg2 > 0){
setAngle(150);
} else {
if (_arg1 > 0){
setAngle(325);
};
};
if (_arg2 < 0){
setAngle(190);
} else {
if (_arg1 < 0){
setAngle(205);
};
};
};
}
public function getWalkSpeed():int{
return (currentSpeed);
}
public function calcJabEffectOnSelf(){
var _local1:int;
_local1 = ((GParams.DEDUCT_PERC_USER_STAMINA_HIGH / 100) * maxStamina);
currentStamina = (currentStamina - _local1);
if (currentStamina < 1){
currentStamina = 1;
};
calculateDeltaRecoverySelf(GParams.SELF_RECOVERY_JAB);
}
public function calculateLowPunchEffect(_arg1:int){
var _local2:int;
var _local3:int;
_local2 = ((GParams.DEDUCT_OPPONENT_STAMINA_LOW / 100) * _arg1);
_local3 = ((GParams.DEDUCT_OPPONENT_HEALTH_LOW / 100) * _arg1);
currentStamina = (currentStamina - _local2);
currentHealth = (currentHealth - _local3);
if (currentStamina < 1){
currentStamina = 1;
};
if (currentHealth < 1){
currentHealth = 1;
};
calculateDeltaRecoverySelf(GParams.OPPONENT_RECOVERY_LPUNCH);
}
public function gotoFall(){
continuesMovebacks = 0;
continuesHitsCount = 0;
setGetupType();
if (getupType == 1){
gotoAndStop("fall");
} else {
gotoAndStop("fall2");
};
}
public function getCurrentPower():Number{
var _local1:Number;
_local1 = ((maxStamina * maxStrength) / 100);
return (_local1);
}
public function setAngle(_arg1:int){
moveAwayAngle = _arg1;
}
public function calculatePowerPunchEffect(_arg1:int){
var _local2:int;
var _local3:int;
_local2 = ((GParams.DEDUCT_OPPONENT_STAMINA_MEDIUM / 100) * _arg1);
_local3 = ((GParams.DEDUCT_OPPONENT_HEALTH_HIGH / 100) * _arg1);
currentStamina = (currentStamina - _local2);
currentHealth = (currentHealth - _local3);
if (currentStamina < 1){
currentStamina = 1;
};
if (currentHealth < 1){
currentHealth = 1;
};
calculateDeltaRecoverySelf(GParams.OPPONENT_RECOVERY_PPUNCH);
}
public function checkForcibleGetup():Boolean{
var _local1:int;
var _local2:int;
_local1 = Math.ceil(((100 - Math.round(((100 * currentHealth) / maxStrength))) + 1));
_local2 = Math.ceil(((100 - Math.round(((100 * currentStamina) / maxStamina))) + 1));
if ((((currentStamina >= GParams.GET_UP_ACTION_STAMINA)) && ((currentHealth >= GParams.GET_UP_ACTION_HEALTH)))){
if (currentFrame == Fighter.GASP){
gotoStand();
} else {
(this.parent.parent as Container).removeCountdown();
gotoGetup();
};
return (true);
};
return (false);
}
public function gotoJab(){
continuesMovebacks = 0;
continuesHitsCount = (continuesHitsCount + 1);
if (currentFrame != JAB){
gotoAndStop("jab");
};
}
public function arePlayersCloseby(_arg1:Number=0, _arg2:Number=0):Boolean{
var _local3:int;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:Number;
_local3 = (this.x + _arg1);
_local4 = (this.y + _arg2);
_local5 = Math.abs((_local3 - opponent.x));
_local6 = Math.abs((_local4 - opponent.y));
_local7 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
if ((((((((opponent.currentFrame == FALL)) || ((opponent.currentFrame == FALL2)))) || ((opponent.currentFrame == GETUP)))) || ((opponent.currentFrame == GETUP2)))){
if (opponent.hitTestPoint(this.x, this.y) == true){
return (false);
};
if (opponent.hitTestPoint(_local3, _local4)){
return (true);
};
return (false);
} else {
if ((((_local5 <= GParams.actionDistMin.x)) && ((_local6 <= 15)))){
_local5 = Math.abs((this.x - opponent.x));
_local6 = Math.abs((this.y - opponent.y));
_local8 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
if (_local7 > _local8){
return (false);
};
return (true);
};
};
return (false);
}
private function calculateDeltaRecoverySelf(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = (maxStamina - currentStamina);
_local3 = (100 - currentHealth);
_local4 = (maxSpeed - currentSpeed);
_local5 = ((currentStamina + currentHealth) + maxSpeed);
_local6 = ((100 + 100) + GParams.SPEED_MAX);
_local7 = (_arg1 + (((100 - currentHealth) / 100) * 30));
_local7 = 0;
recoveryTime = (recoveryTime + _local7);
}
public function setObjectClass(_arg1:Class){
childClass = _arg1;
}
public function boundaryCheckTrainee(_arg1:int=0, _arg2:int=0, _arg3:Boolean=true):Boolean{
var _local4:Number;
var _local5:Number;
var _local6:TrainingContainer;
var _local7:int;
var _local8:int;
var _local9:int;
_local4 = (this.x + _arg1);
_local5 = (this.y + _arg2);
_local6 = (this.parent.parent as TrainingContainer);
_local7 = 0;
while (_local7 < _local6.lineArray.length) {
if (checkLine(_local6.lineArray[_local7], _local4, _local5, _arg1, _arg2, _arg3) == true){
_local8 = _local7;
_local9 = 0;
while (_local9 < (_local6.lineArray.length - 1)) {
_local8 = ((_local8 + 1) % _local6.lineArray.length);
if (checkLine(_local6.lineArray[_local8], this.x, this.y, 0, 0, _arg3) == true){
return (false);
};
_local9++;
};
if (_arg3 == true){
return (true);
};
return (false);
};
if ((this.parent.parent as TrainingContainer).traineeScreen.platform.hitTestPoint(_local4, _local5, true) == false){
return (false);
};
_local7++;
};
if (_arg3 == true){
this.x = (this.x + _arg1);
this.y = (this.y + _arg2);
};
return (true);
}
public function gotoWalk(){
continuesHitsCount = 0;
if (currentFrame != WALK){
gotoAndStop("walk");
};
}
public function setOpponent(_arg1:Fighter){
var _local2:Number;
this.opponent = _arg1;
_local2 = (maxStamina - opponent.maxStamina);
if (_local2 > 0){
restFrequency = (((GParams.STAMINA_MAX - maxStamina) / GParams.STAMINA_MAX) * 0.5);
} else {
restFrequency = ((GParams.STAMINA_MAX - maxStamina) / GParams.STAMINA_MAX);
};
}
public function checkGetupAction():Boolean{
var _local1:int;
var _local2:int;
var _local3:Number;
_local1 = Math.ceil(((100 - Math.round(((100 * currentHealth) / maxStrength))) + 1));
_local2 = Math.ceil(((100 - Math.round(((100 * currentStamina) / maxStamina))) + 1));
if (isRecoveryInProgress == false){
if ((((currentStamina >= maxStamina)) && ((currentHealth >= GParams.GET_UP_ACTION_HEALTH)))){
if ((this as childClass).currentFrame == Fighter.GASP){
gotoStand();
} else {
(this.parent.parent as Container).removeCountdown();
gotoGetup();
};
return (true);
} else {
if ((this as childClass).currentFrame == Fighter.GASP){
_local3 = (currentStamina / maxStamina);
if (_local3 > GParams.MIN_STAMINA_STAND){
gotoStand();
return (true);
};
};
};
};
return (false);
}
public function setParameters(_arg1:int, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Number){
var _local6:int;
this.behaviourType = _arg1;
this.x = _arg2.x;
this.y = _arg2.y;
if (_arg1 == 0){
dir = -1;
} else {
dir = 1;
};
movebackKey = 0;
this.maxStamina = _arg4;
this.maxStrength = _arg5;
if (_arg1 == GParams.BEHAVIOUR_HERO){
if (_arg3 > 8){
_arg3 = 8;
};
};
this.maxSpeed = _arg3;
this.currentStamina = maxStamina;
this.currentHealth = 100;
this.walkSpeed = _arg3;
this.fixedSpeed = (_arg3 / 2);
this.currentSpeed = maxSpeed;
deltaRegenrateStamina = ((maxStrength / 100) * 0.5);
blockFrequency = ((0.9 * (maxSpeed / GParams.SPEED_MAX)) * 1.5);
moveAwayFrequency = (0.9 * ((maxSpeed / GParams.SPEED_MAX) + ((100 - maxStamina) / 100)));
dummyActionFrequency = (((maxStamina / GParams.STAMINA_MAX) * maxSpeed) / GParams.SPEED_MAX);
hitbackFrequency = ((maxStrength / GParams.STRENGTH_MAX) * 0.85);
if (blockFrequency > hitbackFrequency){
hitBackAfterBlockFrequency = blockFrequency;
} else {
hitBackAfterBlockFrequency = hitbackFrequency;
};
if (behaviourType == GParams.BEHAVIOUR_AI){
if (blockFrequency > moveAwayFrequency){
GParams.AI_MAX_VARIABLE_IDLETIME = (GParams.frameRate * (1 - blockFrequency));
} else {
GParams.AI_MAX_VARIABLE_IDLETIME = (GParams.frameRate * (1 - moveAwayFrequency));
};
if (GParams.AI_MAX_VARIABLE_IDLETIME < 0){
GParams.AI_MAX_VARIABLE_IDLETIME = 1;
};
_local6 = Math.round((30 * (1 - blockFrequency)));
if (_local6 < 0){
_local6 = 1;
};
GParams.PUSHBACK_LENGTH_ON_OPPONENT_FALL = (10 + _local6);
GParams.PUSHBACK_LENGTH_WHEN_CLOSE = (4 + _local6);
GParams.PUSHBACK_LENGTH_WHEN_WALK = (15 + _local6);
GParams.PUSHBACK_LENGTH_HURT = (2 + _local6);
GParams.PUSHBACK_LENGTH_BLOCK = (2 + _local6);
};
previousPunch = 0;
totalPunches = 0;
actualPunches = 0;
continuesHitsCount = 0;
actualLPunch = 0;
actualPPunch = 0;
actualJab = 0;
movebackKey = 0;
continuesMovebacks = 0;
}
public function actionPowerPunch(){
totalPunches = (totalPunches + 1);
if (canApplyAction() == true){
actualPPunch = (actualPPunch + 1);
actualPunches = (actualPunches + 1);
opponent.calculatePowerPunchEffect(getCurrentPower());
opponent.gotoHurt(PPUNCH);
if (MainClass.isSoundOn == true){
MainClass.pp.play();
};
} else {
if (MainClass.isSoundOn == true){
if (opponent.currentFrame == Fighter.BLOCK){
MainClass.bls.play();
} else {
MainClass.mp.play();
};
};
};
}
}
}//package
Section 58
//FighterFactory (FighterFactory)
package {
public class FighterFactory {
public function getFighter(_arg1:int):Fighter{
return (null);
}
}
}//package
Section 59
//FightModeMain (FightModeMain)
package {
import flash.display.*;
public class FightModeMain extends MovieClip {
public var profileButton:SimpleButton;
public var fightButton:SimpleButton;
public var trainingButton:SimpleButton;
public var albumopponent:Album;
public var albumhero:Album;
public function init(){
}
}
}//package
Section 60
//FS (FS)
package {
import flash.media.*;
public dynamic class FS extends Sound {
}
}//package
Section 61
//GameModeSelection (GameModeSelection)
package {
import flash.display.*;
public dynamic class GameModeSelection extends MovieClip {
public var streetBrawlText:MovieClip;
public var streetBrawlButton:SimpleButton;
public var gangWarButton:SimpleButton;
public var gangWarText:MovieClip;
public var backButton:SimpleButton;
}
}//package
Section 62
//GameOver (GameOver)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class GameOver extends MovieClip {
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
public var endFrame:Boolean;// = false
private static var gameOver:GameOver = null;
public function GameOver(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
endFrame = false;
super();
}
public function init(){
gotoAndStop(1);
}
public function removeAllListener(){
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public static function getInstance():GameOver{
if (gameOver == null){
gameOver = new (GameOver);
};
return (gameOver);
}
}
}//package
Section 63
//GameOverGangWar (GameOverGangWar)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class GameOverGangWar extends MovieClip {
public var playerName:TextField;
public var errormesg:TextField;
public var matches:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
public var submitScore:SimpleButton;
public var punches:TextField;
public var hits:TextField;
public var playMore:SimpleButton;
public var totalScore:TextField;
public var playAgain:SimpleButton;
public var box:MovieClip;
private static var gameOverGangWar:GameOverGangWar = null;
public function GameOverGangWar(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
playMore.addEventListener(MouseEvent.CLICK, handleClick);
playerName.addEventListener(MouseEvent.CLICK, onTextFieldClick);
addEventListener(MouseEvent.CLICK, checkName);
}
public function getPlayerName():String{
var _local1:String;
_local1 = this.playerName.text;
if (_local1 == null){
return (null);
};
this.errormesg.text = "";
return (_local1);
}
public function updateScores(_arg1:Number, _arg2:Number, _arg3:Number){
this.matches.text = _arg3.toString();
this.punches.text = _arg1.toString();
this.hits.text = _arg2.toString();
box.visible = false;
playerName.text = GParams.playerName;
this.playerName.selectable = false;
this.totalScore.text = GParams.totalScore.toString();
}
public function resetData(){
}
public function onTextFieldClick(_arg1:MouseEvent){
playerName.text = "";
}
private function checkName(_arg1:MouseEvent){
trace(_arg1.target.name);
if (_arg1.target.name == "playerName"){
box.visible = false;
} else {
if (_arg1.target.name == "playMore"){
handleClick(null);
} else {
if ((((_arg1.target.name == "submitScore")) || ((_arg1.target.name == "playAgain")))){
} else {
if (playerName.text == ""){
box.visible = true;
};
};
};
};
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function setErrorMesg(_arg1:String){
this.errormesg.text = _arg1;
}
public static function getInstance():GameOverGangWar{
if (gameOverGangWar == null){
gameOverGangWar = new (GameOverGangWar);
};
return (gameOverGangWar);
}
}
}//package
Section 64
//GameOverStreetBrawl (GameOverStreetBrawl)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class GameOverStreetBrawl extends MovieClip {
public var playerName:TextField;
public var errormesg:TextField;
public var bonus:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
public var punches:TextField;
public var submitScore:SimpleButton;
public var hits:TextField;
public var score:TextField;
public var playMore:SimpleButton;
public var playAgain:SimpleButton;
public var box:MovieClip;
private static var gameOverStreetBrawl:GameOverStreetBrawl = null;
public function GameOverStreetBrawl(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
playMore.addEventListener(MouseEvent.CLICK, handleClick);
playerName.addEventListener(MouseEvent.CLICK, onTextFieldClick);
addEventListener(MouseEvent.CLICK, checkName);
}
public function getPlayerName():String{
var _local1:String;
_local1 = this.playerName.text;
if (_local1 == null){
return (null);
};
this.errormesg.text = "";
return (_local1);
}
public function updateScores(_arg1:Number, _arg2:Number){
this.punches.text = _arg1.toString();
this.hits.text = _arg2.toString();
trace((((" totalPunch :" + _arg1) + " totalHits : ") + _arg2));
playerName.text = "";
box.visible = true;
this.score.text = GParams.levelScore.toString();
this.bonus.text = GParams.levelBonus.toString();
}
public function onTextFieldClick(_arg1:MouseEvent){
playerName.text = "";
}
public function resetData(){
}
private function checkName(_arg1:MouseEvent){
var _local2:String;
trace(_arg1.target.name);
if (_arg1.target.name == "playerName"){
box.visible = false;
} else {
if (_arg1.target.name == "playMore"){
handleClick(null);
} else {
if ((((_arg1.target.name == "submitScore")) || ((_arg1.target.name == "playAgain")))){
} else {
_local2 = new String();
if (playerName.text != null){
_local2 = MainClass.stringHelper.trim(playerName.text, " ");
};
if (_local2.length <= 0){
box.visible = true;
};
};
};
};
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function setErrorMesg(_arg1:String){
this.errormesg.text = _arg1;
}
public static function getInstance():GameOverStreetBrawl{
if (gameOverStreetBrawl == null){
gameOverStreetBrawl = new (GameOverStreetBrawl);
};
return (gameOverStreetBrawl);
}
}
}//package
Section 65
//GangSelectionScreen (GangSelectionScreen)
package {
import flash.display.*;
public dynamic class GangSelectionScreen extends MovieClip {
public var warriersButton:SimpleButton;
public var grizzliesButton:SimpleButton;
public var wolvoniersButton:SimpleButton;
public var immortalsButton:SimpleButton;
public var backButton:SimpleButton;
}
}//package
Section 66
//GangWarProfileScreen (GangWarProfileScreen)
package {
import flash.display.*;
public class GangWarProfileScreen extends MovieClip {
public var createButton:SimpleButton;
public var checkStats:SimpleButton;
public var continueButton:SimpleButton;
public var backButton:SimpleButton;
}
}//package
Section 67
//GParams (GParams)
package {
import flash.geom.*;
public class GParams {
public static var recoveryTimeMax:int = (5 * GParams.frameRate);
public static var stageDimension:Point = new Point(750, 500);
public static var pointsAlloted:int = 0;
public static var minPlayerDist:int = 0;
public static var AI_AUTOBLOCK_DIST:int = (actionDistMin.x + 50);
public static var PLAYER_IMMORTALS:int = 4;
public static var jabValue:int = 20;
public static var GAMEMODE_GANGWAR:int = 1;
public static var MAX_DURATION:int = 120;
public static var PLAYER_DIST_ONFALL:int = 200;
public static var STRENGTH_LOW:int = 50;
public static var maxIdleTime:int = (0.5 * GParams.frameRate);
public static var STRENGTH_MAX:int = 100;
public static var playerStats:Array = new Array(new Player(PLAYER_GRIZZLIES, 3, 71, 91), new Player(PLAYER_GRIZZLIES, 3.5, 73, 93), new Player(PLAYER_GRIZZLIES, 5, 75, 95), new Player(PLAYER_GRIZZLIES, 4.5, 77, 97), new Player(PLAYER_GRIZZLIES, 5, 79, 99), new Player(PLAYER_WOLVENIERS, 4, 71, 61), new Player(PLAYER_WOLVENIERS, 4.5, 73, 63), new Player(PLAYER_WOLVENIERS, 5, 75, 65), new Player(PLAYER_WOLVENIERS, 5.5, 77, 67), new Player(PLAYER_WOLVENIERS, 6, 79, 69), new Player(PLAYER_WARRIERS, 5, 71, 51), new Player(PLAYER_WARRIERS, 5.5, 73, 53), new Player(PLAYER_WARRIERS, 6, 75, 55), new Player(PLAYER_WARRIERS, 6.5, 77, 57), new Player(PLAYER_WARRIERS, 7, 79, 59), new Player(PLAYER_IMMORTALS, 4, 91, 61), new Player(PLAYER_IMMORTALS, 4.5, 93, 63), new Player(PLAYER_IMMORTALS, 5, 95, 65), new Player(PLAYER_IMMORTALS, 5.5, 97, 67), new Player(PLAYER_IMMORTALS, 6, 99, 69));
public static var DEDUCT_OPPONENT_HEALTH_MEDIUM:int = 10;
public static var SELF_RECOVERY_JAB:int = (0.25 * GParams.frameRate);
public static var PUSHBACK_LENGTH_BLOCK:int = 3;
public static var BEHAVIOUR_HERO:int = 1;
public static var playersScalePercent:Number = 0.6;
public static var paltformRadius:int = Math.sqrt(((paltformRadiusX * paltformRadiusX) + (paltformRadiusY * paltformRadiusY)));
public static var selectedGameMode:int = 0;
public static var SPEED_HIGHEST:Number = 8.5;
public static var healthValue:int = 10;
public static var lPunchValue:int = 10;
public static var totalPunches:int = 0;
public static var AI_IDLETIME_AFTER_HURT:int = (0.5 * GParams.frameRate);
public static var RED_ZONE_START:int = 10;
public static var MIN_STAMINA_STAND:Number = 0.5;
public static var STRENGTH_HIGHEST:int = 80;
public static var PLAYER_GRIZZLIES:int = 1;
public static var DEDUCT_PERC_USER_STAMINA_LOW:int = 15;
public static var deltaIncrement:int = 2;
public static var gangWarPlayerStat:Array = new Array(new Player(PLAYER_GRIZZLIES, 3, 75, 70), new Player(PLAYER_GRIZZLIES, 3.4, 70, 75), new Player(PLAYER_GRIZZLIES, 3.8, 67, 80), new Player(PLAYER_GRIZZLIES, 4, 64, 85), new Player(PLAYER_GRIZZLIES, 4.2, 60, 90), new Player(PLAYER_WOLVENIERS, 4, 70, 60), new Player(PLAYER_WOLVENIERS, 4.4, 66, 64), new Player(PLAYER_WOLVENIERS, 4.8, 62, 68), new Player(PLAYER_WOLVENIERS, 5, 58, 72), new Player(PLAYER_WOLVENIERS, 5.4, 54, 76), new Player(PLAYER_WARRIERS, 5, 60, 60), new Player(PLAYER_WARRIERS, 5.4, 64, 56), new Player(PLAYER_WARRIERS, 5.8, 68, 52), new Player(PLAYER_WARRIERS, 6.2, 72, 48), new Player(PLAYER_WARRIERS, 6.6, 76, 44), new Player(PLAYER_IMMORTALS, 4, 90, 50), new Player(PLAYER_IMMORTALS, 4.4, 86, 54), new Player(PLAYER_IMMORTALS, 4.8, 82, 58), new Player(PLAYER_IMMORTALS, 5.2, 78, 62), new Player(PLAYER_IMMORTALS, 5.6, 74, 66));
public static var YELLOW_ZONE_START:int = 30;
public static var STAMINA_HIGHEST:int = 80;
public static var selectedHeroIndex:int = 1;
public static var GET_UP_ACTION_STAMINA:int = (YELLOW_ZONE_START + 10);
public static var totalHits:int = 0;
public static var SPEED_MEDIUM:Number = 6;
public static var platformCenter:Point = new Point(355, 325);
public static var selectedOpponentIndex:int = 2;
public static var playerDistMin:Point = new Point(60, 25);
public static var maxHitsCount:int = 3;
public static var counterSec:int = 30;
public static var DEDUCT_OPPONENT_STAMINA_HIGH:int = 40;
public static var SPEED_HIGH:Number = 7.5;
public static var SPEED_CALC_HELPER:Number = 12.5;
public static var HIGHEST_START:int = 90;
public static var actionDistMinAt100:Point = new Point(120, 16);
public static var GREEN_ZONE_START:int = 100;
public static var DUMMY_ACTION_STAMINA_MIN:Number = 0.8;
public static var GETUP_COUNTDOWN_MAX:int = 6;
public static var SPEED_LOWEST:Number = 3;
public static var GASPING_INTERVAL_MAX:int = 3;
public static var STRENGTH_HIGH:int = 70;
public static var playerDistMinAt100:Point = new Point(100, 25);
public static var levelBonus:int = 0;
public static var AI_MAX_FIXED_IDLETIME:int = (0.25 * GParams.frameRate);
public static var MEDIUM_START:int = 70;
public static var gangWarClickedPlayerStat:Array = new Array(3);
public static var DEDUCT_OPPONENT_STAMINA_MEDIUM:int = 30;
public static var playerName:String = null;
public static var BEHAVIOUR_AI:int = 2;
public static var MAX_HITS_COUNT:int = 4;
public static var minDistTotal:int = 0;
public static var gangWarSelectedHeroStats:Array = new Array();
public static var SPEED_LOW:Number = 4.5;
public static var pointsGained:int = 0;
public static var YELLOW_ZONE_END:int = 11;
public static var SPEED_MAX:int = 10;
public static var STRENGTH_MEDIUM:int = 60;
public static var PUSHBACK_LENGTH_WHEN_WALK:int = 20;
public static var SELF_RECOVERY_LPUNCH:int = (0.5 * GParams.frameRate);
public static var PUSHBACK_DIST_HURT_AI:int = 5;
public static var playerAreaRadius:Array = new Array("dummy", new Point(50, 7), new Point(37, 4), new Point(40, 4), new Point(40, 4));
public static var selectedTraineeIndex:int = 1;
public static var STAMINA_LOW:int = 50;
public static var selectedGang:int = 0;
public static var OPPONENT_RECOVERY_LPUNCH:int = (0.5 * GParams.frameRate);
public static var STAMINA_MAX:int = 100;
public static var DEFAULT_HERO:int = 1;
public static var DEDUCT_OPPONENT_STAMINA_LOW:int = 15;
public static var playedOpponentIndex:Array = new Array();
public static var HIGH_START:int = 80;
public static var DEDUCT_PERC_USER_STAMINA_HIGH:int = 40;
public static var levelScore:int = 0;
public static var pPunchValue:int = 30;
public static var STAMINA_MEDIUM:int = 60;
public static var LOWEST_START:int = 50;
public static var DEDUCT_OPPONENT_HEALTH_LOW:int = 5;
public static var DEDUCT_PERC_USER_STAMINA_MEDIUM:int = 30;
public static var DUMMY_ACTION_HEALTH_MIN:int = 50;
public static var GREEN_ZONE_END:int = 100;
public static var PLAYER_WARRIERS:int = 3;
public static var PLAYER_WOLVENIERS:int = 2;
public static var STRENGTH_LOWEST:int = 40;
public static var PUSHBACK_LENGTH_HURT:int = 5;
public static var LOW_START:int = 60;
public static var STAMINA_HIGH:int = 70;
public static var fightsWonCount:int = 0;
public static var STAMINA_LOWEST:int = 40;
public static var flippingDist:Point = new Point(25, 10);
public static var totalScore:int = 0;
public static var SELF_RECOVERY_PPUNCH:int = (1 * GParams.frameRate);
public static var actionDistMin:Point = new Point(80, 20);
public static var PUSHBACK_LENGTH_ON_OPPONENT_FALL:int = 30;
public static var GAMEMODE_STREETBRAWL:int = 0;
public static var DEFAULT_OPPONENT:int = 2;
public static var RED_ZONE_END:int = 1;
public static var DEDUCT_OPPONENT_HEALTH_HIGH:int = 15;
public static var OPPONENT_RECOVERY_PPUNCH:int = (1 * GParams.frameRate);
public static var paltformRadiusX:int = 200;
public static var paltformRadiusY:int = 100;
public static var PUSHBACK_LENGTH_WHEN_CLOSE:int = 10;
public static var GET_UP_ACTION_HEALTH:int = (YELLOW_ZONE_END - 5);
public static var dummyActionInterval:int = (5 * GParams.frameRate);
public static var OPPONENT_RECOVERY_JAB:int = (0.25 * GParams.frameRate);
public static var PUSHBACK_LENGTH:int = 25;
public static var frameRate:int = 20;
public static var AI_MAX_VARIABLE_IDLETIME:int = (1 * GParams.frameRate);
public static function getPlayerParameters(_arg1:int, _arg2:int, _arg3:int){
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
_arg2 = (_arg2 % 5);
if (_arg1 == PLAYER_GRIZZLIES){
_local5 = (STAMINA_MEDIUM + (_arg3 * 2.5));
_local6 = (STRENGTH_HIGH + (_arg3 * 2));
_local7 = (SPEED_LOW + (_arg3 * 0.2));
} else {
if (_arg1 == PLAYER_WOLVENIERS){
_local5 = (STAMINA_MEDIUM + (_arg3 * 2));
_local6 = (STRENGTH_MEDIUM + (_arg3 * 2.5));
_local7 = SPEED_MEDIUM;
} else {
if (_arg1 == PLAYER_WARRIERS){
_local5 = (STAMINA_MEDIUM + (_arg3 * 2));
_local6 = (STRENGTH_LOWEST + (_arg3 * 3));
_local7 = SPEED_HIGHEST;
} else {
_local5 = (STAMINA_HIGHEST + (_arg3 * 2));
_local6 = (STRENGTH_LOW + (_arg3 * 3));
_local7 = SPEED_HIGH;
};
};
};
_local4 = 1;
gangWarClickedPlayerStat[1] = (_local5 + (_arg2 * _local4));
gangWarClickedPlayerStat[2] = (_local6 - (_arg2 * _local4));
gangWarClickedPlayerStat[0] = (_local7 + ((_arg2 * _local4) / 5));
}
}
}//package
Section 68
//GrizzliesFive (GrizzliesFive)
package {
import flash.display.*;
public class GrizzliesFive extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 69
//GrizzliesFour (GrizzliesFour)
package {
import flash.display.*;
public class GrizzliesFour extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 70
//GrizzliesOne (GrizzliesOne)
package {
import flash.display.*;
public class GrizzliesOne extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
public function GrizzliesOne(){
playerId = 1;
}
}
}//package
Section 71
//GrizzliesThree (GrizzliesThree)
package {
import flash.display.*;
public class GrizzliesThree extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 72
//GrizzliesTwo (GrizzliesTwo)
package {
import flash.display.*;
public class GrizzliesTwo extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 73
//Gym (Gym)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Gym extends MovieClip {
public var pointsAlloted:TextField;
public var playerName:TextField;
public var gymSpeedBar:MovieClip;
public var pointsGained:TextField;
private var fixedSpeed:Number;// = 0
public var gymStaminaBar:MovieClip;
public var varStamina:Number;// = 0
public var gymStrengthBar:MovieClip;
private var fixedStamina:int;// = 0
public var actualPunch:Number;// = 0
public var staminaminus:SimpleButton;
public var totalPunch:Number;// = 0
public var strengthPlus:SimpleButton;
public var availablePoints:int;// = 0
public var speedPlus:SimpleButton;
public var allocatedPoints:int;// = 0
public var speedminus:SimpleButton;
public var varSpeed:Number;// = 0
public var photoframe:Album;
public var pointsEarn:int;// = 0
public var staminaPlus:SimpleButton;
public var continueButton:SimpleButton;
public var varStrength:Number;// = 0
private var fighter:Fighter;// = null
public var strengthminus:SimpleButton;
private var fixedStrength:int;// = 0
public function Gym(){
fixedSpeed = 0;
fixedStamina = 0;
fixedStrength = 0;
varSpeed = 0;
varStamina = 0;
varStrength = 0;
availablePoints = 0;
allocatedPoints = 0;
pointsEarn = 0;
fighter = null;
totalPunch = 0;
actualPunch = 0;
super();
}
public function onClickStrengthPlus(_arg1:MouseEvent){
if ((((availablePoints > 0)) && ((varStrength < GParams.STRENGTH_MAX)))){
if (MainClass.isSoundOn == true){
MainClass.cas.play();
};
varStrength = (varStrength + 1);
this.gymStrengthBar.gotoAndStop(((100 - varStrength) + 1));
addMinusListeners();
availablePoints = (availablePoints - 1);
allocatedPoints = (allocatedPoints + 1);
this.pointsAlloted.text = allocatedPoints.toString();
this.pointsGained.text = availablePoints.toString();
};
if (availablePoints <= 0){
resetPlusListeners();
addMinusListeners();
};
}
public function init(){
fixedSpeed = this.fighter.maxSpeed;
fixedStamina = this.fighter.maxStamina;
fixedStrength = this.fighter.maxStrength;
availablePoints = this.fighter.pointsGained;
pointsEarn = this.fighter.pointsGained;
addPlusListeners();
updateBar();
showPlayerImage();
varSpeed = fixedSpeed;
varStamina = fixedStamina;
varStrength = fixedStrength;
this.pointsGained.text = this.fighter.pointsGained.toString();
this.pointsAlloted.text = allocatedPoints.toString();
totalPunch = this.fighter.totalPunches;
actualPunch = this.fighter.actualPunches;
this.playerName.text = GParams.playerName;
}
public function removeListeners(){
if (speedPlus.hasEventListener(MouseEvent.CLICK) == true){
speedPlus.removeEventListener(MouseEvent.CLICK, onClickSpeedPlus);
};
if (staminaPlus.hasEventListener(MouseEvent.CLICK) == true){
staminaPlus.removeEventListener(MouseEvent.CLICK, onClickStaminaPlus);
};
if (strengthPlus.hasEventListener(MouseEvent.CLICK) == true){
strengthPlus.removeEventListener(MouseEvent.CLICK, onClickStrengthPlus);
};
if (speedminus.hasEventListener(MouseEvent.CLICK) == true){
speedminus.removeEventListener(MouseEvent.CLICK, onClickSpeedMinus);
};
if (staminaminus.hasEventListener(MouseEvent.CLICK) == true){
staminaminus.removeEventListener(MouseEvent.CLICK, onClickStaminaMinus);
};
if (strengthminus.hasEventListener(MouseEvent.CLICK) == true){
strengthminus.removeEventListener(MouseEvent.CLICK, onClickStrengthMinus);
};
}
public function onClickStaminaPlus(_arg1:MouseEvent){
if ((((availablePoints > 0)) && ((varStamina < GParams.STAMINA_MAX)))){
if (MainClass.isSoundOn == true){
MainClass.cas.play();
};
varStamina = (varStamina + 1);
this.gymStaminaBar.gotoAndStop(((100 - varStamina) + 1));
addMinusListeners();
availablePoints = (availablePoints - 1);
allocatedPoints = (allocatedPoints + 1);
this.pointsAlloted.text = allocatedPoints.toString();
this.pointsGained.text = availablePoints.toString();
};
if (availablePoints <= 0){
resetPlusListeners();
addMinusListeners();
};
}
public function onClickSpeedMinus(_arg1:MouseEvent){
var _local2:Number;
if (varSpeed > fixedSpeed){
if (availablePoints < this.fighter.pointsGained){
if (MainClass.isSoundOn == true){
MainClass.cas.play();
};
varSpeed = (varSpeed - 0.08);
_local2 = Math.ceil((varSpeed * 12.5));
addPlusListeners();
this.gymSpeedBar.gotoAndStop(((100 - _local2) + 1));
availablePoints = (availablePoints + 1);
allocatedPoints = (allocatedPoints - 1);
this.pointsAlloted.text = allocatedPoints.toString();
this.fighter.maxSpeed = varSpeed;
this.pointsGained.text = availablePoints.toString();
};
if (availablePoints >= this.fighter.pointsGained){
addPlusListeners();
};
};
}
public function onClickStrengthMinus(_arg1:MouseEvent){
if (varStrength > fixedStrength){
if (availablePoints < this.fighter.pointsGained){
if (MainClass.isSoundOn == true){
MainClass.cas.play();
};
varStrength = (varStrength - 1);
addPlusListeners();
this.gymStrengthBar.gotoAndStop(((100 - varStrength) + 1));
availablePoints = (availablePoints + 1);
allocatedPoints = (allocatedPoints - 1);
this.pointsAlloted.text = allocatedPoints.toString();
this.pointsGained.text = availablePoints.toString();
};
if (availablePoints >= this.fighter.pointsGained){
addPlusListeners();
};
};
}
public function onClickSpeedPlus(_arg1:MouseEvent){
var _local2:Number;
if ((((availablePoints > 0)) && ((varSpeed < 8)))){
if (MainClass.isSoundOn == true){
MainClass.cas.play();
};
varSpeed = (varSpeed + 0.08);
_local2 = Math.floor((varSpeed * 12.5));
this.gymSpeedBar.gotoAndStop(((100 - _local2) + 1));
availablePoints = (availablePoints - 1);
allocatedPoints = (allocatedPoints + 1);
this.pointsAlloted.text = allocatedPoints.toString();
addMinusListeners();
this.fighter.maxSpeed = varSpeed;
this.pointsGained.text = availablePoints.toString();
};
if (availablePoints <= 0){
resetPlusListeners();
addMinusListeners();
};
}
public function addMinusListeners(){
if (speedminus.hasEventListener(MouseEvent.CLICK) == false){
speedminus.addEventListener(MouseEvent.CLICK, onClickSpeedMinus);
};
if (staminaminus.hasEventListener(MouseEvent.CLICK) == false){
staminaminus.addEventListener(MouseEvent.CLICK, onClickStaminaMinus);
};
if (strengthminus.hasEventListener(MouseEvent.CLICK) == false){
strengthminus.addEventListener(MouseEvent.CLICK, onClickStrengthMinus);
};
}
public function addPlusListeners(){
if (speedPlus.hasEventListener(MouseEvent.CLICK) == false){
speedPlus.addEventListener(MouseEvent.CLICK, onClickSpeedPlus);
};
if (staminaPlus.hasEventListener(MouseEvent.CLICK) == false){
staminaPlus.addEventListener(MouseEvent.CLICK, onClickStaminaPlus);
};
if (strengthPlus.hasEventListener(MouseEvent.CLICK) == false){
strengthPlus.addEventListener(MouseEvent.CLICK, onClickStrengthPlus);
};
}
public function updateBar(){
var _local1:int;
_local1 = (fixedSpeed * 12.5);
this.gymSpeedBar.gotoAndStop(((100 - _local1) + 1));
this.gymStaminaBar.gotoAndStop(((100 - fixedStamina) + 1));
this.gymStrengthBar.gotoAndStop(((100 - fixedStrength) + 1));
this.photoframe.gotoAndStop(GParams.selectedHeroIndex);
}
public function onClickStaminaMinus(_arg1:MouseEvent){
if (varStamina > fixedStamina){
if (availablePoints < this.fighter.pointsGained){
if (MainClass.isSoundOn == true){
MainClass.cas.play();
};
varStamina = (varStamina - 1);
addPlusListeners();
this.gymStaminaBar.gotoAndStop(((100 - varStamina) + 1));
availablePoints = (availablePoints + 1);
allocatedPoints = (allocatedPoints - 1);
this.pointsAlloted.text = allocatedPoints.toString();
this.pointsGained.text = availablePoints.toString();
};
if (availablePoints >= this.fighter.pointsGained){
addPlusListeners();
};
};
}
public function setFighter(_arg1:Fighter){
this.fighter = _arg1;
}
public function showPlayerImage(){
}
public function resetPlusListeners(){
speedPlus.removeEventListener(MouseEvent.CLICK, onClickSpeedPlus);
staminaPlus.removeEventListener(MouseEvent.CLICK, onClickStaminaPlus);
strengthPlus.removeEventListener(MouseEvent.CLICK, onClickStrengthPlus);
}
}
}//package
Section 74
//HeroProfile (HeroProfile)
package {
import flash.display.*;
import flash.events.*;
public class HeroProfile extends PlayerProfile {
public var nextButton:SimpleButton;
public var strengthBar:MovieClip;
public var speedBar:MovieClip;
private var a:Array;
public var br10:MovieClip;
public var br11:MovieClip;
public var br12:MovieClip;
public var br14:MovieClip;
public var br15:MovieClip;
public var br16:MovieClip;
public var br17:MovieClip;
public var br18:MovieClip;
public var br19:MovieClip;
public var br13:MovieClip;
public var p10:SimpleButton;
public var p11:SimpleButton;
public var p12:SimpleButton;
public var p15:SimpleButton;
public var p16:SimpleButton;
public var p17:SimpleButton;
public var p18:SimpleButton;
public var p19:SimpleButton;
public var p13:SimpleButton;
public var p14:SimpleButton;
public var br20:MovieClip;
public var p20:SimpleButton;
public var backButton:SimpleButton;
public var albumHero:Album;
public var gangname:MovieClip;
public var staminaBar:MovieClip;
public var p1:SimpleButton;
public var p2:SimpleButton;
public var p3:SimpleButton;
public var p4:SimpleButton;
public var p5:SimpleButton;
public var p9:SimpleButton;
public var p8:SimpleButton;
public var p6:SimpleButton;
public var p7:SimpleButton;
public var br1:MovieClip;
public var br2:MovieClip;
public var br3:MovieClip;
public var br4:MovieClip;
public var br5:MovieClip;
public var br6:MovieClip;
public var br7:MovieClip;
public var br8:MovieClip;
public var br9:MovieClip;
public function HeroProfile(){
a = new Array("name");
super();
init();
}
public function removeListeners(){
var _local1:int;
var _local2:SimpleButton;
_local1 = 1;
while (_local1 <= GParams.playerStats.length) {
_local2 = (this.getChildByName(("p" + _local1)) as SimpleButton);
if (_local2.hasEventListener(MouseEvent.CLICK) == true){
_local2.removeEventListener(MouseEvent.CLICK, onClick);
};
_local2.enabled = false;
_local1++;
};
}
public function showSelectedPlayerStats(){
var _local1:int;
var _local2:int;
var _local3:int;
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
if (GParams.playedOpponentIndex.length == 0){
GParams.getPlayerParameters(GParams.selectedGang, GParams.selectedHeroIndex, GParams.playedOpponentIndex.length);
_local1 = ((GParams.gangWarPlayerStat[(GParams.selectedHeroIndex - 1)].speed / GParams.SPEED_MAX) * 100);
_local2 = ((GParams.gangWarPlayerStat[(GParams.selectedHeroIndex - 1)].stamina / GParams.STAMINA_MAX) * 100);
_local3 = ((GParams.gangWarPlayerStat[(GParams.selectedHeroIndex - 1)].streng / GParams.STRENGTH_MAX) * 100);
speedBar.gotoAndStop(((100 - _local1) + 1));
staminaBar.gotoAndStop(((100 - _local2) + 1));
strengthBar.gotoAndStop(((100 - _local3) + 1));
};
} else {
if ((((GParams.selectedHeroIndex > 0)) && ((GParams.selectedHeroIndex <= GParams.playerStats.length)))){
_local1 = ((GParams.playerStats[(GParams.selectedHeroIndex - 1)].speed / GParams.SPEED_MAX) * 100);
_local2 = ((GParams.playerStats[(GParams.selectedHeroIndex - 1)].stamina / GParams.STAMINA_MAX) * 100);
_local3 = ((GParams.playerStats[(GParams.selectedHeroIndex - 1)].streng / GParams.STAMINA_MAX) * 100);
speedBar.gotoAndStop(((100 - _local1) + 1));
staminaBar.gotoAndStop(((100 - _local2) + 1));
strengthBar.gotoAndStop(((100 - _local3) + 1));
};
};
albumHero.gotoAndStop(GParams.selectedHeroIndex);
}
public function onClick(_arg1:MouseEvent){
var _local2:String;
var _local3:int;
var _local4:SimpleButton;
var _local5:MovieClip;
_local2 = _arg1.target.name;
_local2 = _local2.substring(1, _local2.length);
_local3 = int(_local2);
if ((((GParams.selectedHeroIndex > 0)) && ((GParams.selectedHeroIndex <= GParams.playerStats.length)))){
if (MainClass.isSoundOn == true){
MainClass.scs.play();
};
_local4 = (this.getChildByName(("p" + GParams.selectedHeroIndex)) as SimpleButton);
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
_local4.alpha = 1;
} else {
_local4.alpha = 1;
};
_local5 = (this.getChildByName(("br" + GParams.selectedHeroIndex)) as MovieClip);
_local5.visible = false;
GParams.selectedHeroIndex = _local3;
_local4 = (this.getChildByName(("p" + GParams.selectedHeroIndex)) as SimpleButton);
_local4.alpha = 1;
_local5 = (this.getChildByName(("br" + GParams.selectedHeroIndex)) as MovieClip);
_local5.visible = true;
showSelectedPlayerStats();
albumHero.gotoAndStop(GParams.selectedHeroIndex);
this.gangname.gotoAndStop(GParams.playerStats[(GParams.selectedHeroIndex - 1)].playerType);
};
}
override public function init(){
var _local1:int;
var _local2:MovieClip;
var _local3:int;
var _local4:SimpleButton;
_local1 = 1;
while (_local1 <= GParams.playerStats.length) {
_local2 = (this.getChildByName(("br" + _local1)) as MovieClip);
_local2.visible = false;
_local1++;
};
trace((" GParams.selectedHeroIndex :" + GParams.selectedHeroIndex));
this.gangname.gotoAndStop(GParams.playerStats[(GParams.selectedHeroIndex - 1)].playerType);
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
_local3 = 1;
while (_local3 <= GParams.playerStats.length) {
_local4 = (this.getChildByName(("p" + _local3)) as SimpleButton);
_local4.alpha = 1;
if (GParams.playerStats[(_local3 - 1)].playerType == GParams.selectedGang){
if (GParams.selectedGang == 1){
GParams.selectedHeroIndex = 1;
};
if (GParams.selectedGang == 2){
GParams.selectedHeroIndex = 6;
};
if (GParams.selectedGang == 3){
GParams.selectedHeroIndex = 11;
};
if (GParams.selectedGang == 4){
GParams.selectedHeroIndex = 16;
};
if (_local4.hasEventListener(MouseEvent.CLICK) == false){
_local4.addEventListener(MouseEvent.CLICK, onClick);
_local4.enabled = true;
_local4.alpha = 1;
};
} else {
_local4.alpha = 0.5;
if (_local4.hasEventListener(MouseEvent.CLICK) == true){
_local4.removeEventListener(MouseEvent.CLICK, onClick);
};
_local4.enabled = false;
};
if (GParams.selectedHeroIndex == _local3){
_local4.alpha = 1;
_local2 = (this.getChildByName(("br" + GParams.selectedHeroIndex)) as MovieClip);
_local2.visible = true;
};
_local3++;
};
showSelectedPlayerStats();
albumHero.gotoAndStop(GParams.selectedHeroIndex);
} else {
_local3 = 1;
while (_local3 <= GParams.playerStats.length) {
_local4 = (this.getChildByName(("p" + _local3)) as SimpleButton);
_local4.alpha = 1;
if (_local4.hasEventListener(MouseEvent.CLICK) == false){
_local4.addEventListener(MouseEvent.CLICK, onClick);
_local4.enabled = true;
};
if (GParams.selectedHeroIndex == _local3){
_local4.alpha = 1;
_local2 = (this.getChildByName(("br" + GParams.selectedHeroIndex)) as MovieClip);
_local2.visible = true;
};
_local3++;
};
showSelectedPlayerStats();
trace((" GParams.selectedHeroIndex : " + GParams.selectedHeroIndex));
albumHero.gotoAndStop(GParams.selectedHeroIndex);
};
}
public function applyTint(){
}
}
}//package
Section 75
//IGS (IGS)
package {
import flash.media.*;
public dynamic class IGS extends Sound {
}
}//package
Section 76
//ImmortalFive (ImmortalFive)
package {
import flash.display.*;
public class ImmortalFive extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 77
//ImmortalFour (ImmortalFour)
package {
import flash.display.*;
public class ImmortalFour extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 78
//ImmortalOne (ImmortalOne)
package {
import flash.display.*;
public class ImmortalOne extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 79
//ImmortalThree (ImmortalThree)
package {
import flash.display.*;
public class ImmortalThree extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 80
//ImmortalTwo (ImmortalTwo)
package {
import flash.display.*;
public class ImmortalTwo extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 81
//JS (JS)
package {
import flash.media.*;
public dynamic class JS extends Sound {
}
}//package
Section 82
//LevelInfo (LevelInfo)
package {
public class LevelInfo {
public var playedOpponentIndex:Array;
public function LevelInfo(){
playedOpponentIndex = new Array();
super();
}
}
}//package
Section 83
//LineParticle (LineParticle)
package {
import flash.display.*;
import flash.geom.*;
public class LineParticle extends Sprite {
public var len:Number;// = 0
private var isCenter:Boolean;// = false
public var cType:int;// = 0
public var min:Point;
private var color:Number;// = 0
public var max:Point;
private var a:Number;// = 0
private var thickness;// = 5
public var bounds:Rectangle;// = null
public function LineParticle(_arg1:Number, _arg2:Number, _arg3:int=0){
len = 0;
color = 0;
thickness = 5;
isCenter = false;
a = 0;
min = new Point();
max = new Point();
cType = 0;
bounds = null;
super();
this.len = _arg1;
a = _arg2;
cType = _arg3;
}
public function setParameters(_arg1:Number, _arg2:Number, _arg3:Boolean=false){
this.x = _arg1;
this.y = _arg2;
this.isCenter = _arg3;
draw();
this.rotation = a;
}
public function setMinimum(_arg1:Point){
min.x = _arg1.x;
min.y = _arg1.y;
}
public function setMaximun(_arg1:Point){
if (_arg1.x < min.x){
max.x = min.x;
min.x = _arg1.x;
} else {
max.x = _arg1.x;
};
if (_arg1.y < min.y){
max.y = min.y;
min.y = _arg1.y;
} else {
max.y = _arg1.y;
};
}
public function draw(){
if (isCenter == false){
graphics.lineStyle(thickness, color, 5);
graphics.moveTo((-(len) / 2), 0);
graphics.lineTo((len / 2), 0);
alpha = 0.5;
visible = false;
} else {
graphics.lineStyle(thickness, color, 5);
graphics.moveTo(0, 0);
graphics.lineTo(len, 0);
visible = false;
};
bounds = getBounds(this);
}
public function set angle(_arg1:int){
this.rotation = _arg1;
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number){
x = _arg1;
y = _arg2;
this.rotation = _arg3;
}
public function get angle():int{
return (a);
}
public function get length():int{
return (len);
}
}
}//package
Section 84
//LPS (LPS)
package {
import flash.media.*;
public dynamic class LPS extends Sound {
}
}//package
Section 85
//MainClass (MainClass)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.net.*;
public class MainClass extends MovieClip {
public var newStrength:Number;// = 0
private var gymScreen:Gym;// = null
private var fightModeMain:FightModeMain;// = null
public var newSpeed:Number;// = 0
private var gangSelectionScreen:GangSelectionScreen;// = null
private var container:Container;// = null
private var gameOverStreetBrawl:GameOverStreetBrawl;// = null
private var gangWarScreen:GangWarProfileScreen;// = null
public var cfdPoints:Number;// = 0
public var newStamina:Number;// = 0
private var trainingContainer:TrainingContainer;// = null
private var bgs:BGS;// = null
private var ws:WS;// = null
private var playerStatistics:PlayerStatistics;// = null
private var youWinStreetBrawl:YouWinStreetBrawl;// = null
var sharedObejct:SharedObject;
private var yws:YWS;// = null
private var igs:IGS;// = null
private var gameOverGangWar:GameOverGangWar;// = null
private var welcomePage:Welcome;// = null
public var currentSound:Sound;// = null
private var storableInfo:StorableInfo;// = null
private var opponentProfileScreen:OpponentProfile;// = null
private var maxTick:int;
private var youWin:YouWin;// = null
public var newSound:Sound;// = null
private var userProfileScreen:HeroProfile;// = null
private var yls:YLS;// = null
private var enterNameScreen:EnterNameScreen;// = null
private var youWinGangWar:YouWinGangWar;// = null
private var gameModeSelectScreen:GameModeSelection;// = null
private var gameOver:GameOver;// = null
var _channel:SoundChannel;
public static var aKeyDown:Boolean = false;
public static var aHappened:Boolean = false;
public static var dHappened:Boolean = false;
public static var upKeyDown:Boolean = false;
public static var js:JS = null;
public static var lp:LPS = null;
public static var pp:PPS = null;
public static var isSoundOn:Boolean = true;
public static var cas:CAS = null;
public static var wHappened:Boolean = false;
public static var leftKeyDown:Boolean = false;
public static var dKeyDown:Boolean = false;
public static var downKeyDown:Boolean = false;
public static var rightKeyDown:Boolean = false;
public static var stringHelper:StringHelper = null;
public static var ywc:YWC = null;
public static var bs:BS = null;
public static var wKeyDown:Boolean = false;
public static var sKeyDown:Boolean = false;
public static var fs:FS = null;
public static var mp:MP = null;
public static var blockHappened:Boolean = false;
public static var ylc:YLC = null;
public static var bls:BLS = null;
public static var scs:SCS = null;
public function MainClass(){
container = null;
trainingContainer = null;
welcomePage = null;
gameModeSelectScreen = null;
userProfileScreen = null;
opponentProfileScreen = null;
fightModeMain = null;
gymScreen = null;
maxTick = (GParams.MAX_DURATION * GParams.frameRate);
gameOver = null;
youWin = null;
youWinStreetBrawl = null;
gameOverStreetBrawl = null;
gameOverGangWar = null;
youWinGangWar = null;
gangWarScreen = null;
gangSelectionScreen = null;
playerStatistics = null;
enterNameScreen = null;
storableInfo = null;
newSpeed = 0;
newStrength = 0;
newStamina = 0;
cfdPoints = 0;
sharedObejct = SharedObject.getLocal("STREETBASH");
ws = null;
bgs = null;
yws = null;
yls = null;
igs = null;
currentSound = null;
newSound = null;
super();
if (welcomePage == null){
ws = new WS();
bgs = new BGS();
yws = new YWS();
yls = new YLS();
pp = new PPS();
lp = new LPS();
js = new JS();
mp = new MP();
igs = new IGS();
scs = new SCS();
bs = new BS();
ywc = new YWC();
ylc = new YLC();
cas = new CAS();
fs = new FS();
bls = new BLS();
createWelcome();
stringHelper = new StringHelper();
};
}
public function hideGangWarText(_arg1:MouseEvent){
gameModeSelectScreen.gangWarText.visible = false;
}
public function gotoSelectGameMode(_arg1:MouseEvent){
if (isSoundOn == true){
scs.play();
};
if (gameModeSelectScreen == null){
gameModeSelectScreen = new GameModeSelection();
};
newSound = ws;
playLoop();
gameModeSelectScreen.streetBrawlText.visible = false;
gameModeSelectScreen.gangWarText.visible = false;
gameModeSelectScreen.streetBrawlButton.addEventListener(MouseEvent.CLICK, gotoStreetBrawl);
gameModeSelectScreen.streetBrawlButton.addEventListener(MouseEvent.MOUSE_OVER, showStreetBrawlText);
gameModeSelectScreen.streetBrawlButton.addEventListener(MouseEvent.MOUSE_OUT, hideStreetBrawlText);
gameModeSelectScreen.gangWarButton.addEventListener(MouseEvent.CLICK, gotoGangWar);
gameModeSelectScreen.gangWarButton.addEventListener(MouseEvent.MOUSE_OVER, showGangWarText);
gameModeSelectScreen.gangWarButton.addEventListener(MouseEvent.MOUSE_OUT, hideGangWarText);
gameModeSelectScreen.backButton.addEventListener(MouseEvent.CLICK, gotoWelcome);
addChild(gameModeSelectScreen);
}
public function gotoTrainingScreen(_arg1:MouseEvent){
newSound = ws;
playLoop();
if (isSoundOn == true){
scs.play();
};
clearGraphics();
if (trainingContainer == null){
trainingContainer = new TrainingContainer();
};
trainingContainer.init();
addChild(trainingContainer);
trainingContainer.createHero();
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
stage.focus = this;
stage.stageFocusRect = false;
addEventListener(MouseEvent.CLICK, checkMouseClick);
trainingContainer.backButton.addEventListener(MouseEvent.CLICK, playWelcome);
}
public function clearSharedObjectData(){
sharedObejct.clear();
GParams.totalScore = 0;
GParams.selectedHeroIndex = 0;
GParams.playedOpponentIndex.splice(0, GParams.playedOpponentIndex.length);
}
public function createYouWinGangWar(){
clearGraphics();
newSound = yws;
playLoop();
youWinGangWar = YouWinGangWar.getInstance();
addChild(youWinGangWar);
youWinGangWar.updateScores(container.playerArray[0].totalMatchesPunches, container.playerArray[0].totalMatchesHits, GParams.playedOpponentIndex.length, GParams.selectedHeroIndex);
youWinGangWar.playAgain.addEventListener(MouseEvent.CLICK, clickPlayAgain);
youWinGangWar.submitScore.addEventListener(MouseEvent.CLICK, submitScoreWinGang);
youWinGangWar.setErrorMesg("");
}
public function submitScoreWin(_arg1:MouseEvent){
var _local2:String;
var _local3:Number;
var _local4:int;
youWinStreetBrawl.setErrorMesg("");
_local2 = null;
_local2 = youWinStreetBrawl.getPlayerName();
_local3 = GParams.totalScore;
if ((((_local2 == null)) || ((_local2 == "")))){
youWinStreetBrawl.setErrorMesg("Please enter your name");
} else {
if (_local3 <= 0){
youWinStreetBrawl.setErrorMesg("Invalid score");
} else {
_local4 = sendData(_local2, _local3);
if (_local4 < 2){
};
displayHighScoreScreen();
};
};
}
public function gotoCheckStats(_arg1:MouseEvent){
clearGraphics();
newSound = ws;
playLoop();
if (isSoundOn == true){
scs.play();
};
if (playerStatistics == null){
playerStatistics = new PlayerStatistics();
};
addChild(playerStatistics);
playerStatistics.continueButton.addEventListener(MouseEvent.CLICK, continueFight);
playerStatistics.backButton.addEventListener(MouseEvent.CLICK, gotoGangWar);
fetchStoredDetails();
loadPlayerStatistics();
}
public function soundLoop(_arg1:Event){
if (((!((currentSound == null))) && (!((_channel == null))))){
_channel.removeEventListener(Event.SOUND_COMPLETE, soundLoop);
if (isSoundOn == true){
_channel = currentSound.play();
_channel.addEventListener(Event.SOUND_COMPLETE, soundLoop);
};
};
}
public function checkLocalInfoExists():Boolean{
if (sharedObejct.size != 0){
if (sharedObejct.data.defeatedOppIndex.length >= 15){
clearSharedObjectData();
return (false);
};
return (true);
//unresolved jump
};
return (false);
}
public function fetchHighScore(_arg1:MouseEvent){
var _local2:URLRequest;
var _local3:URLLoader;
var _local4:URLVariables;
welcomePage.setChildIndex(welcomePage.hs, 1);
welcomePage.emptyScores();
_local2 = new URLRequest("http://www.flasharcade.com/getscoresas3.php");
_local2.method = URLRequestMethod.POST;
_local3 = new URLLoader();
_local3.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4 = new URLVariables();
_local4.gameId = "ace044";
_local2.data = _local4;
_local3.load(_local2);
_local3.addEventListener(Event.COMPLETE, completeHandler);
}
private function gotoWelcome(_arg1:MouseEvent){
createWelcome();
}
public function gotoLoadProfile(_arg1:MouseEvent){
}
public function createYouLooseStreetBrawl(){
clearGraphics();
newSound = yls;
playLoop();
gameOverStreetBrawl = GameOverStreetBrawl.getInstance();
addChild(gameOverStreetBrawl);
gameOverStreetBrawl.updateScores(container.playerArray[0].totalPunches, container.playerArray[0].actualPunches);
gameOverStreetBrawl.playAgain.addEventListener(MouseEvent.CLICK, clickPlayAgain);
gameOverStreetBrawl.submitScore.addEventListener(MouseEvent.CLICK, submitScoreLoose);
gameOverStreetBrawl.setErrorMesg("");
}
private function gotoSelectNewGang(_arg1:MouseEvent){
GParams.playerName = "";
gotoSelectGangScreen(null);
}
public function hideStreetBrawlText(_arg1:MouseEvent){
gameModeSelectScreen.streetBrawlText.visible = false;
}
public function onClickEnterName(_arg1:MouseEvent){
var _local2:String;
var _local3:String;
_local2 = _arg1.target.name;
if (_local2 == "playerName"){
enterNameScreen.main.box.visible = false;
} else {
if (_local2 == "backButton"){
gotoGangWar(null);
} else {
if (_local2 == "nextButton"){
_local3 = new String();
if (enterNameScreen.main.playerName.text != null){
_local3 = stringHelper.trim(enterNameScreen.main.playerName.text, " ");
};
if (_local3.length <= 0){
enterNameScreen.main.box.visible = true;
} else {
enterNameScreen.main.visible = false;
enterNameScreen.main.mouseEnabled = false;
enterNameScreen.main.removeEventListener(MouseEvent.CLICK, onClickEnterName);
GParams.playerName = _local3;
};
} else {
_local3 = new String();
if (enterNameScreen.main.playerName.text != null){
_local3 = stringHelper.trim(enterNameScreen.main.playerName.text, " ");
};
if (_local3.length <= 0){
enterNameScreen.main.box.visible = true;
};
};
};
};
}
public function instruction(_arg1:MouseEvent){
}
private function initGameParameters(){
GParams.selectedHeroIndex = GParams.DEFAULT_HERO;
GParams.selectedOpponentIndex = GParams.DEFAULT_OPPONENT;
}
public function onClickFight(_arg1:MouseEvent){
if (isSoundOn == true){
scs.play();
};
clearGraphics();
init();
}
public function updateSharedObjectPoints(){
if (sharedObejct.data.totalPointsGained == undefined){
sharedObejct.data.totalPointsGained = 0;
};
sharedObejct.data.totalPointsGained = (sharedObejct.data.totalPointsGained + gymScreen.pointsEarn);
if (sharedObejct.data.totalPointsAllocated == undefined){
sharedObejct.data.totalPointsAllocated = 0;
};
sharedObejct.data.totalPointsAllocated = (sharedObejct.data.totalPointsAllocated + gymScreen.allocatedPoints);
sharedObejct.flush();
}
public function createYouLooseGangWar(){
clearGraphics();
newSound = yls;
playLoop();
gameOverGangWar = GameOverGangWar.getInstance();
addChild(gameOverGangWar);
gameOverGangWar.updateScores(container.playerArray[0].totalPunches, container.playerArray[0].actualPunches, GParams.playedOpponentIndex.length);
gameOverGangWar.playAgain.addEventListener(MouseEvent.CLICK, clickPlayAgain);
gameOverGangWar.submitScore.addEventListener(MouseEvent.CLICK, submitScoreLooseGang);
gameOverGangWar.setErrorMesg("");
}
public function gotoNextFight(_arg1:MouseEvent){
if (container != null){
if (contains(container)){
container.clearContainerGraphics();
removeChild(container);
};
};
setNewSSS(gymScreen.varSpeed, gymScreen.varStamina, gymScreen.varStrength);
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
updateSharedObject();
updateSharedObjectPoints();
};
gotoOpponentProfile(_arg1);
}
public function onEnterFrame(_arg1:Event){
container.handleActions();
container.updateHUDBars();
container.AIHandler();
}
public function fetchStoredDetails(){
GParams.selectedGameMode = GParams.GAMEMODE_GANGWAR;
GParams.selectedHeroIndex = sharedObejct.data.currentHeroIndex;
GParams.playedOpponentIndex = sharedObejct.data.defeatedOppIndex;
this.newSpeed = sharedObejct.data.speed;
this.newStamina = sharedObejct.data.stamina;
this.newStrength = sharedObejct.data.stren;
this.cfdPoints = sharedObejct.data.availablePoints;
GParams.playerName = sharedObejct.data.playerName;
GParams.totalScore = sharedObejct.data.totalScore;
GParams.totalPunches = sharedObejct.data.totalPunch;
GParams.totalHits = sharedObejct.data.actualPunch;
}
public function createWelcome(){
clearGraphics();
if (container != null){
if (contains(container)){
container.clearContainerGraphics();
removeChild(container);
};
};
welcomePage = Welcome.getInstance();
addChild(welcomePage);
if (checkLocalInfoExists()){
welcomePage.ipwelcome.fightMode.addEventListener(MouseEvent.CLICK, gotoSelectGameMode);
welcomePage.ipwelcome.intro.addEventListener(MouseEvent.CLICK, gotoTrainingScreen);
welcomePage.ipwelcome.highscore.addEventListener(MouseEvent.CLICK, fetchHighScore);
welcomePage.ipwelcome.continuebtn.enabled = true;
welcomePage.ipwelcome.continuebtn.alpha = 1;
welcomePage.ipwelcome.continuebtn.addEventListener(MouseEvent.CLICK, continueFight);
} else {
welcomePage.ipwelcome.continuebtn.enabled = false;
welcomePage.ipwelcome.continuebtn.alpha = 0.5;
welcomePage.ipwelcome.fightMode.addEventListener(MouseEvent.CLICK, gotoSelectGameMode);
welcomePage.ipwelcome.intro.addEventListener(MouseEvent.CLICK, gotoTrainingScreen);
welcomePage.ipwelcome.highscore.addEventListener(MouseEvent.CLICK, fetchHighScore);
};
welcomePage.hs.backhs.addEventListener(MouseEvent.CLICK, playWelcome);
welcomePage.setChildIndex(welcomePage.ipwelcome, 1);
newSound = ws;
playLoop();
}
public function gotoDeleteProfile(_arg1:MouseEvent){
}
public function gotoHeroProfile(_arg1:MouseEvent){
if (GParams.selectedHeroIndex < 1){
GParams.selectedHeroIndex = 1;
};
newSound = ws;
playLoop();
if (isSoundOn == true){
scs.play();
};
clearGraphics();
if (userProfileScreen == null){
userProfileScreen = new HeroProfile();
};
userProfileScreen.backButton.addEventListener(MouseEvent.CLICK, gotoSelectGameMode);
userProfileScreen.nextButton.addEventListener(MouseEvent.CLICK, gotoOpponentProfile);
addChild(userProfileScreen);
userProfileScreen.init();
userProfileScreen.x = (GParams.stageDimension.x / 2);
userProfileScreen.y = (GParams.stageDimension.y / 2);
}
public function gotoGangWar(_arg1:MouseEvent){
newSound = ws;
playLoop();
if (isSoundOn == true){
scs.play();
};
GParams.selectedGameMode = GParams.GAMEMODE_GANGWAR;
clearGraphics();
if (gangWarScreen == null){
gangWarScreen = new GangWarProfileScreen();
};
gangWarScreen.createButton.addEventListener(MouseEvent.CLICK, gotoSelectNewGang);
if (checkLocalInfoExists()){
gangWarScreen.continueButton.enabled = true;
gangWarScreen.continueButton.alpha = 1;
gangWarScreen.continueButton.addEventListener(MouseEvent.CLICK, continueFight);
gangWarScreen.checkStats.enabled = true;
gangWarScreen.checkStats.alpha = 1;
gangWarScreen.checkStats.addEventListener(MouseEvent.CLICK, gotoCheckStats);
} else {
gangWarScreen.continueButton.enabled = false;
gangWarScreen.continueButton.alpha = 0.5;
gangWarScreen.checkStats.enabled = false;
gangWarScreen.checkStats.alpha = 0.5;
};
gangWarScreen.backButton.addEventListener(MouseEvent.CLICK, gotoSelectGameMode);
addChild(gangWarScreen);
}
public function gotoStreetBrawl(_arg1:MouseEvent){
if (isSoundOn == true){
scs.play();
};
newSound = ws;
playLoop();
GParams.selectedGameMode = GParams.GAMEMODE_STREETBRAWL;
gotoHeroProfile(_arg1);
}
public function gotoFightModePlay(){
}
private function checkMouseClick(_arg1:MouseEvent){
stage.focus = this;
stage.stageFocusRect = false;
}
public function init(){
if (isSoundOn == true){
scs.play();
};
clearGraphics();
if (container == null){
container = new Container();
};
container.init();
addChild(container);
container.createHero();
container.createOpponent();
container.setOpponents();
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
stage.focus = this;
stage.stageFocusRect = false;
addEventListener(MouseEvent.CLICK, checkMouseClick);
newSound = igs;
playLoop();
}
private function resetWelcome(){
welcomePage.ipwelcome.fightMode.removeEventListener(MouseEvent.CLICK, gotoSelectGameMode);
welcomePage.ipwelcome.intro.removeEventListener(MouseEvent.CLICK, gotoTrainingScreen);
welcomePage.ipwelcome.highscore.removeEventListener(MouseEvent.CLICK, fetchHighScore);
welcomePage.ipwelcome.continuebtn.removeEventListener(MouseEvent.CLICK, continueFight);
}
private function initPlayerStats(){
var _local1:int;
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = GParams.deltaIncrement;
_local2 = (_local1 / 12.5);
_local3 = _local1;
_local4 = _local1;
_local5 = 0;
while (_local5 < GParams.playerStats.length) {
if ((_local5 % 5) == 0){
if (GParams.playerStats[_local5].playerType == GParams.PLAYER_GRIZZLIES){
GParams.playerStats[_local5].speed = (GParams.LOWEST_START / 12.5);
GParams.playerStats[_local5].stamina = GParams.MEDIUM_START;
GParams.playerStats[_local5].streng = GParams.HIGHEST_START;
};
if (GParams.playerStats[_local5].playerType == GParams.PLAYER_WOLVENIERS){
GParams.playerStats[_local5].speed = (GParams.MEDIUM_START / 12.5);
GParams.playerStats[_local5].stamina = GParams.MEDIUM_START;
GParams.playerStats[_local5].streng = GParams.MEDIUM_START;
};
if (GParams.playerStats[_local5].playerType == GParams.PLAYER_WARRIERS){
GParams.playerStats[_local5].speed = (GParams.HIGHEST_START / 12.5);
GParams.playerStats[_local5].stamina = GParams.MEDIUM_START;
GParams.playerStats[_local5].streng = GParams.LOWEST_START;
};
if (GParams.playerStats[_local5].playerType == GParams.PLAYER_IMMORTALS){
GParams.playerStats[_local5].speed = (GParams.MEDIUM_START / 12.5);
GParams.playerStats[_local5].stamina = GParams.HIGHEST_START;
GParams.playerStats[_local5].streng = GParams.LOW_START;
};
} else {
GParams.playerStats[_local5].speed = (GParams.playerStats[(_local5 - 1)].speed + _local2);
GParams.playerStats[_local5].stamina = (GParams.playerStats[(_local5 - 1)].stamina + _local3);
GParams.playerStats[_local5].streng = (GParams.playerStats[(_local5 - 1)].streng + _local4);
};
_local5++;
};
}
public function onClickImmortals(_arg1:MouseEvent){
clearGraphics();
if (isSoundOn == true){
scs.play();
};
GParams.selectedGang = GParams.PLAYER_IMMORTALS;
GParams.selectedHeroIndex = 16;
showUserProfileScreen(null);
}
public function getOponentDetails(){
}
public function sendData(_arg1:String, _arg2:Number):int{
var request:URLRequest;
var variables:URLVariables;
var playerName = _arg1;
var score = _arg2;
request = new URLRequest("http://www.flasharcade.com/setscores.php");
request.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.scoreName = playerName;
variables.scoreText = score;
variables.gameId = "ace044";
variables.gameName = "SmashBoxing";
request.data = variables;
try {
sendToURL(request);
} catch(e:Error) {
return (0);
} catch(e:SecurityError) {
return (1);
};
return (2);
}
public function setNewSSS(_arg1:Number, _arg2:Number, _arg3:Number){
this.newSpeed = _arg1;
this.newStamina = _arg2;
this.newStrength = _arg3;
this.cfdPoints = gymScreen.availablePoints;
}
public function gotoGym(){
if (isSoundOn == true){
scs.play();
};
clearGraphics();
newSound = ws;
playLoop();
if (gymScreen == null){
gymScreen = new Gym();
};
addChild(gymScreen);
gymScreen.x = (GParams.stageDimension.x / 2);
gymScreen.y = (GParams.stageDimension.y / 2);
gymScreen.setFighter(this.container.playerArray[0]);
gymScreen.init();
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
updateSharedObject();
};
if (gymScreen.continueButton.hasEventListener(MouseEvent.CLICK) == false){
gymScreen.continueButton.addEventListener(MouseEvent.CLICK, gotoNextFight);
};
}
public function createYouWinStreetBrawl(){
clearGraphics();
newSound = yws;
stage.focus = null;
playLoop();
youWinStreetBrawl = YouWinStreetBrawl.getInstance();
addChild(youWinStreetBrawl);
youWinStreetBrawl.updateScores(container.playerArray[0].totalPunches, container.playerArray[0].actualPunches, GParams.selectedHeroIndex);
youWinStreetBrawl.playAgain.addEventListener(MouseEvent.CLICK, clickPlayAgain);
youWinStreetBrawl.submitScore.addEventListener(MouseEvent.CLICK, submitScoreWin);
youWinStreetBrawl.setErrorMesg("");
}
public function submitScoreLoose(_arg1:MouseEvent){
var namep:String;
var score:Number;
var ret:int;
var event = _arg1;
gameOverStreetBrawl.setErrorMesg("");
namep = null;
namep = gameOverStreetBrawl.getPlayerName();
score = GParams.totalScore;
if ((((namep == null)) || ((namep == "")))){
gameOverStreetBrawl.setErrorMesg("Please enter your name");
} else {
if (score <= 0){
gameOverStreetBrawl.setErrorMesg("Invalid score");
} else {
try {
ret = sendData(namep, score);
} catch(e:Error) {
} catch(e1:SecurityError) {
};
if (ret < 2){
};
displayHighScoreScreen();
};
};
}
public function updateSharedObject(){
var _local1:Array;
_local1 = new Array();
_local1 = GParams.playedOpponentIndex;
sharedObejct.data.currentHeroIndex = GParams.selectedHeroIndex;
sharedObejct.data.defeatedOppIndex = _local1;
sharedObejct.data.speed = gymScreen.varSpeed;
sharedObejct.data.stamina = gymScreen.varStamina;
sharedObejct.data.stren = gymScreen.varStrength;
sharedObejct.data.pointsGained = gymScreen.pointsEarn;
sharedObejct.data.pointsAllocated = gymScreen.allocatedPoints;
sharedObejct.data.availablePoints = gymScreen.availablePoints;
sharedObejct.data.totalPunch = GParams.totalPunches;
sharedObejct.data.actualPunch = GParams.totalHits;
sharedObejct.data.totalScore = GParams.totalScore;
sharedObejct.data.playerName = GParams.playerName;
sharedObejct.flush();
}
public function onClickWolvoniers(_arg1:MouseEvent){
clearGraphics();
if (isSoundOn == true){
scs.play();
};
GParams.selectedGang = GParams.PLAYER_WOLVENIERS;
GParams.selectedHeroIndex = 6;
showUserProfileScreen(null);
}
public function keyUpEvent(_arg1:KeyboardEvent){
var _local2:Number;
_local2 = _arg1.keyCode;
switch (_local2){
case 37:
leftKeyDown = false;
break;
case 38:
upKeyDown = false;
break;
case 40:
downKeyDown = false;
break;
case 39:
rightKeyDown = false;
break;
case 65:
aKeyDown = false;
aHappened = false;
break;
case 87:
wKeyDown = false;
wHappened = false;
break;
case 68:
dKeyDown = false;
dHappened = false;
break;
case 83:
sKeyDown = false;
blockHappened = false;
break;
};
_arg1.updateAfterEvent();
}
public function showStreetBrawlText(_arg1:MouseEvent){
gameModeSelectScreen.streetBrawlText.visible = true;
}
public function displayHighScore(_arg1:MouseEvent){
}
public function submitScoreWinGang(_arg1:MouseEvent){
var _local2:String;
var _local3:Number;
youWinGangWar.setErrorMesg("");
_local2 = null;
_local2 = youWinGangWar.getPlayerName();
_local3 = GParams.totalScore;
clearSharedObjectData();
if ((((_local2 == null)) || ((_local2 == "")))){
youWinGangWar.setErrorMesg("Please enter your name");
} else {
if (_local3 <= 0){
youWinGangWar.setErrorMesg("Invalid score");
} else {
if (sendData(_local2, _local3) < 2){
};
displayHighScoreScreen();
};
};
}
public function keyDownEvent(_arg1:KeyboardEvent){
var _local2:Number;
_local2 = _arg1.keyCode;
switch (_local2){
case 37:
leftKeyDown = true;
break;
case 38:
upKeyDown = true;
break;
case 40:
downKeyDown = true;
break;
case 39:
rightKeyDown = true;
break;
case 65:
if (aHappened == false){
aKeyDown = true;
aHappened = true;
};
break;
case 87:
if (wHappened == false){
wKeyDown = true;
wHappened = true;
};
break;
case 68:
if (dHappened == false){
dKeyDown = true;
dHappened = true;
};
break;
case 83:
if (blockHappened == false){
sKeyDown = true;
blockHappened = true;
};
break;
};
_arg1.updateAfterEvent();
}
public function showResult(_arg1:Boolean=false){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
container.removePlayerEvents();
container.cheerupAnimation(3);
container.calculateScore(_arg1);
if (_arg1 == true){
GParams.totalPunches = (GParams.totalPunches + container.playerArray[0].totalPunches);
GParams.totalHits = (GParams.totalHits + container.playerArray[0].actualPunches);
};
if (GParams.selectedGameMode == GParams.GAMEMODE_STREETBRAWL){
if (_arg1 == true){
ywc.play();
container.youwintext.gotoAndPlay(1);
};
if (_arg1 == false){
ylc.play();
container.youloosetext.gotoAndPlay(1);
};
};
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
if (_arg1 == false){
ylc.play();
container.youloosetext.gotoAndPlay(1);
};
if (_arg1 == true){
GParams.playedOpponentIndex.push(GParams.selectedOpponentIndex);
ywc.play();
container.youwintext.gotoAndPlay(1);
};
};
}
public function startGame(){
if (isSoundOn == true){
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
container.playerArray[1].stop();
}
public function showGangWarText(_arg1:MouseEvent){
gameModeSelectScreen.gangWarText.visible = true;
}
public function displayHighScoreScreen(){
createWelcome();
fetchHighScore(null);
welcomePage.setChildIndex(welcomePage.hs, 1);
}
public function playWelcome(_arg1:MouseEvent){
if (isSoundOn == true){
scs.play();
};
if (trainingContainer != null){
trainingContainer.removeListeners();
if (contains(trainingContainer)){
removeChild(trainingContainer);
};
};
createWelcome();
}
public function submitScoreLooseGang(_arg1:MouseEvent){
var _local2:String;
var _local3:Number;
gameOverGangWar.setErrorMesg("");
_local2 = null;
_local2 = gameOverGangWar.getPlayerName();
_local3 = GParams.totalScore;
if ((((_local2 == null)) || ((_local2 == "")))){
gameOverGangWar.setErrorMesg("Please enter your name");
} else {
if (_local3 <= 0){
gameOverGangWar.setErrorMesg("Invalid score");
} else {
if (sendData(_local2, _local3) < 2){
};
displayHighScoreScreen();
};
};
}
public function onClickGrizzlies(_arg1:MouseEvent){
clearGraphics();
if (isSoundOn == true){
scs.play();
};
GParams.selectedGang = GParams.PLAYER_GRIZZLIES;
GParams.selectedHeroIndex = 1;
showUserProfileScreen(null);
}
public function gotoOpponentProfile(_arg1:MouseEvent){
newSound = ws;
playLoop();
if (isSoundOn == true){
scs.play();
};
clearGraphics();
if (container != null){
container = null;
};
if (opponentProfileScreen == null){
opponentProfileScreen = new OpponentProfile();
};
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
if (GParams.playedOpponentIndex.length == 0){
opponentProfileScreen.backButton.visible = true;
opponentProfileScreen.backButton.addEventListener(MouseEvent.CLICK, showUserProfileScreen);
} else {
if (GParams.playedOpponentIndex.length > 0){
opponentProfileScreen.backButton.visible = false;
} else {
opponentProfileScreen.backButton.visible = false;
};
};
} else {
opponentProfileScreen.backButton.addEventListener(MouseEvent.CLICK, gotoHeroProfile);
};
opponentProfileScreen.fightButton.addEventListener(MouseEvent.CLICK, onClickFight);
addChild(opponentProfileScreen);
opponentProfileScreen.init();
opponentProfileScreen.x = (GParams.stageDimension.x / 2);
opponentProfileScreen.y = (GParams.stageDimension.y / 2);
}
public function gotoFightMode(_arg1:MouseEvent){
clearGraphics();
if (isSoundOn == true){
scs.play();
};
if (contains(welcomePage)){
removeChild(welcomePage);
};
if (fightModeMain == null){
fightModeMain = new FightModeMain();
fightModeMain.fightButton.addEventListener(MouseEvent.CLICK, onClickFight);
fightModeMain.profileButton.addEventListener(MouseEvent.CLICK, gotoHeroProfile);
fightModeMain.trainingButton.addEventListener(MouseEvent.CLICK, gotoTrainingScreen);
};
fightModeMain.albumopponent.gotoAndStop(GParams.selectedOpponentIndex);
fightModeMain.albumhero.gotoAndStop(GParams.selectedHeroIndex);
addChild(fightModeMain);
fightModeMain.x = 350;
fightModeMain.y = 250;
}
public function continueFight(_arg1:MouseEvent){
if (isSoundOn == true){
scs.play();
};
clearGraphics();
if (container != null){
if (contains(container)){
container.clearContainerGraphics();
removeChild(container);
};
};
fetchStoredDetails();
gotoOpponentProfile(_arg1);
}
private function completeHandler(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:URLLoader;
var _local5:String;
var _local6:Array;
_local3 = 0;
_local4 = URLLoader(_arg1.target);
_local5 = "";
_local6 = null;
if (_local4.data.data0 != undefined){
_local6 = _local4.data.data0.split("|", 3);
welcomePage.hs.player1.text = _local6[0];
welcomePage.hs.score1.text = _local6[1];
welcomePage.hs.date1.text = _local6[2];
};
if (_local4.data.data1 != undefined){
_local6 = _local4.data.data1.split("|", 3);
welcomePage.hs.player2.text = _local6[0];
welcomePage.hs.score2.text = _local6[1];
welcomePage.hs.date2.text = _local6[2];
};
if (_local4.data.data2 != undefined){
_local6 = _local4.data.data2.split("|", 3);
welcomePage.hs.player3.text = _local6[0];
welcomePage.hs.score3.text = _local6[1];
welcomePage.hs.date3.text = _local6[2];
};
if (_local4.data.data3 != undefined){
_local6 = _local4.data.data3.split("|", 3);
welcomePage.hs.player4.text = _local6[0];
welcomePage.hs.score4.text = _local6[1];
welcomePage.hs.date4.text = _local6[2];
};
if (_local4.data.data4 != undefined){
_local6 = _local4.data.data4.split("|", 3);
welcomePage.hs.player5.text = _local6[0];
welcomePage.hs.score5.text = _local6[1];
welcomePage.hs.date5.text = _local6[2];
};
if (_local4.data.data5 != undefined){
_local6 = _local4.data.data5.split("|", 3);
welcomePage.hs.player6.text = _local6[0];
welcomePage.hs.score6.text = _local6[1];
welcomePage.hs.date6.text = _local6[2];
};
if (_local4.data.data6 != undefined){
_local6 = _local4.data.data6.split("|", 3);
welcomePage.hs.player7.text = _local6[0];
welcomePage.hs.score7.text = _local6[1];
welcomePage.hs.date7.text = _local6[2];
};
if (_local4.data.data7 != undefined){
_local6 = _local4.data.data7.split("|", 3);
welcomePage.hs.player8.text = _local6[0];
welcomePage.hs.score8.text = _local6[1];
welcomePage.hs.date8.text = _local6[2];
};
if (_local4.data.data8 != undefined){
_local6 = _local4.data.data8.split("|", 3);
welcomePage.hs.player9.text = _local6[0];
welcomePage.hs.score9.text = _local6[1];
welcomePage.hs.date9.text = _local6[2];
};
if (_local4.data.data9 != undefined){
_local6 = _local4.data.data9.split("|", 3);
welcomePage.hs.player10.text = _local6[0];
welcomePage.hs.score10.text = _local6[1];
welcomePage.hs.date10.text = _local6[2];
};
}
public function gotoGym1(_arg1:MouseEvent){
newSound = ws;
playLoop();
if (isSoundOn == true){
scs.play();
};
clearGraphics();
if (gymScreen == null){
gymScreen = new Gym();
};
addChild(gymScreen);
gymScreen.x = (GParams.stageDimension.x / 2);
gymScreen.y = (GParams.stageDimension.y / 2);
gymScreen.setFighter(this.container.playerArray[0]);
gymScreen.init();
if (gymScreen.continueButton.hasEventListener(MouseEvent.CLICK) == false){
gymScreen.continueButton.addEventListener(MouseEvent.CLICK, gotoOpponentProfile);
};
}
public function clickPlayAgain(_arg1:MouseEvent){
if (isSoundOn == true){
scs.play();
};
SoundMixer.stopAll();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
clearGraphics();
container.clearContainerGraphics();
createWelcome();
}
public function showUserProfileScreen(_arg1:MouseEvent){
newSound = ws;
playLoop();
if (isSoundOn == true){
scs.play();
};
clearGraphics();
if (userProfileScreen == null){
userProfileScreen = new HeroProfile();
};
userProfileScreen.backButton.addEventListener(MouseEvent.CLICK, gotoSelectGangScreen);
userProfileScreen.nextButton.addEventListener(MouseEvent.CLICK, gotoOpponentProfile);
addChild(userProfileScreen);
userProfileScreen.init();
userProfileScreen.x = (GParams.stageDimension.x / 2);
userProfileScreen.y = (GParams.stageDimension.y / 2);
}
public function onClickWarriers(_arg1:MouseEvent){
clearGraphics();
if (isSoundOn == true){
scs.play();
};
GParams.selectedGang = GParams.PLAYER_WARRIERS;
GParams.selectedHeroIndex = 11;
showUserProfileScreen(null);
}
public function playLoop(){
if (isSoundOn == true){
if (currentSound != newSound){
if (_channel != null){
_channel.stop();
};
currentSound = newSound;
if (currentSound != null){
_channel = currentSound.play();
_channel.addEventListener(Event.SOUND_COMPLETE, soundLoop);
};
};
};
}
public function loadPlayerStatistics(){
var _local1:int;
var _local2:int;
if (isSoundOn == true){
scs.play();
};
_local1 = sharedObejct.data.defeatedOppIndex.length;
playerStatistics.matchesWon.text = _local1.toString();
playerStatistics.punches.text = GParams.totalPunches.toString();
playerStatistics.hits.text = GParams.totalHits.toString();
_local2 = (sharedObejct.data.speed * 10);
playerStatistics.speedBar.gotoAndStop(((100 - _local2) + 1));
playerStatistics.strengthBar.gotoAndStop(((100 - sharedObejct.data.stren) + 1));
playerStatistics.staminaBar.gotoAndStop(((100 - sharedObejct.data.stamina) + 1));
playerStatistics.album.gotoAndStop(sharedObejct.data.currentHeroIndex);
playerStatistics.playerName.text = sharedObejct.data.playerName.toString();
}
public function gotoSelectGangScreen(_arg1:MouseEvent){
var _local2:String;
clearGraphics();
newSound = ws;
playLoop();
if (isSoundOn == true){
scs.play();
};
clearSharedObjectData();
if (gangSelectionScreen == null){
gangSelectionScreen = new GangSelectionScreen();
};
GParams.selectedGameMode = GParams.GAMEMODE_GANGWAR;
GParams.selectedGang = 0;
gangSelectionScreen.grizzliesButton.addEventListener(MouseEvent.CLICK, onClickGrizzlies);
gangSelectionScreen.warriersButton.addEventListener(MouseEvent.CLICK, onClickWarriers);
gangSelectionScreen.wolvoniersButton.addEventListener(MouseEvent.CLICK, onClickWolvoniers);
gangSelectionScreen.immortalsButton.addEventListener(MouseEvent.CLICK, onClickImmortals);
gangSelectionScreen.backButton.addEventListener(MouseEvent.CLICK, gotoGangWar);
addChild(gangSelectionScreen);
_local2 = stringHelper.trim(GParams.playerName, " ");
if (_local2.length <= 0){
if (enterNameScreen == null){
enterNameScreen = new EnterNameScreen();
};
enterNameScreen.main.mouseEnabled = true;
enterNameScreen.main.visible = true;
enterNameScreen.addEventListener(MouseEvent.CLICK, onClickEnterName);
if (!gangSelectionScreen.contains(enterNameScreen)){
addChild(enterNameScreen);
enterNameScreen.x = (gangSelectionScreen.width / 2);
enterNameScreen.y = (gangSelectionScreen.height / 2);
};
enterNameScreen.main.playerName.text = "";
enterNameScreen.main.box.visible = true;
} else {
enterNameScreen.main.visible = false;
enterNameScreen.main.mouseEnabled = false;
};
}
public function clearGraphics(){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
if (stage != null){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
stage.focus = null;
};
removeEventListener(MouseEvent.CLICK, checkMouseClick);
playLoop();
rightKeyDown = false;
leftKeyDown = false;
upKeyDown = false;
downKeyDown = false;
leftKeyDown = false;
wKeyDown = false;
aKeyDown = false;
dKeyDown = false;
sKeyDown = false;
aHappened = false;
wHappened = false;
dHappened = false;
blockHappened = false;
if (welcomePage != null){
resetWelcome();
if (this.contains(welcomePage)){
removeChild(welcomePage);
};
};
if (gameModeSelectScreen != null){
if (this.contains(gameModeSelectScreen)){
gameModeSelectScreen.streetBrawlButton.removeEventListener(MouseEvent.CLICK, gotoStreetBrawl);
gameModeSelectScreen.gangWarButton.removeEventListener(MouseEvent.CLICK, gotoGangWar);
gameModeSelectScreen.backButton.removeEventListener(MouseEvent.CLICK, gotoWelcome);
gameModeSelectScreen.streetBrawlButton.removeEventListener(MouseEvent.MOUSE_OVER, showStreetBrawlText);
gameModeSelectScreen.streetBrawlButton.removeEventListener(MouseEvent.MOUSE_OUT, hideStreetBrawlText);
gameModeSelectScreen.gangWarButton.removeEventListener(MouseEvent.MOUSE_OVER, showGangWarText);
gameModeSelectScreen.gangWarButton.removeEventListener(MouseEvent.MOUSE_OUT, hideGangWarText);
removeChild(gameModeSelectScreen);
};
};
if (gangWarScreen != null){
if (this.contains(gangWarScreen)){
gangWarScreen.createButton.removeEventListener(MouseEvent.CLICK, gotoSelectGangScreen);
gangWarScreen.continueButton.removeEventListener(MouseEvent.CLICK, continueFight);
gangWarScreen.checkStats.removeEventListener(MouseEvent.CLICK, gotoCheckStats);
gangWarScreen.backButton.removeEventListener(MouseEvent.CLICK, gotoSelectGameMode);
removeChild(gangWarScreen);
};
};
if (gangSelectionScreen != null){
if (this.contains(gangSelectionScreen)){
gangSelectionScreen.grizzliesButton.removeEventListener(MouseEvent.CLICK, onClickGrizzlies);
gangSelectionScreen.warriersButton.removeEventListener(MouseEvent.CLICK, onClickWarriers);
gangSelectionScreen.wolvoniersButton.removeEventListener(MouseEvent.CLICK, onClickWolvoniers);
gangSelectionScreen.immortalsButton.removeEventListener(MouseEvent.CLICK, onClickImmortals);
gangSelectionScreen.backButton.removeEventListener(MouseEvent.CLICK, gotoGangWar);
removeChild(gangSelectionScreen);
};
};
if (userProfileScreen != null){
if (this.contains(userProfileScreen)){
userProfileScreen.removeListeners();
if (GParams.selectedGameMode == GParams.GAMEMODE_STREETBRAWL){
userProfileScreen.backButton.removeEventListener(MouseEvent.CLICK, gotoSelectGameMode);
} else {
userProfileScreen.backButton.removeEventListener(MouseEvent.CLICK, gotoSelectGangScreen);
};
userProfileScreen.nextButton.removeEventListener(MouseEvent.CLICK, gotoOpponentProfile);
removeChild(userProfileScreen);
};
};
if (opponentProfileScreen != null){
if (contains(opponentProfileScreen)){
opponentProfileScreen.removeListeners();
opponentProfileScreen.fightButton.removeEventListener(MouseEvent.CLICK, onClickFight);
opponentProfileScreen.backButton.removeEventListener(MouseEvent.CLICK, gotoHeroProfile);
removeChild(opponentProfileScreen);
};
};
if (fightModeMain != null){
if (contains(fightModeMain)){
removeChild(fightModeMain);
};
};
if (gymScreen != null){
if (contains(gymScreen)){
gymScreen.removeListeners();
removeChild(gymScreen);
gymScreen.allocatedPoints = 0;
};
};
if (playerStatistics != null){
if (contains(playerStatistics)){
playerStatistics.continueButton.removeEventListener(MouseEvent.CLICK, continueFight);
playerStatistics.backButton.removeEventListener(MouseEvent.CLICK, gotoGangWar);
removeChild(playerStatistics);
};
};
if (trainingContainer != null){
if (contains(trainingContainer)){
removeChild(trainingContainer);
};
};
if (youWinStreetBrawl != null){
if (contains(youWinStreetBrawl)){
youWinStreetBrawl.playAgain.removeEventListener(MouseEvent.CLICK, clickPlayAgain);
youWinStreetBrawl.submitScore.removeEventListener(MouseEvent.CLICK, submitScoreWin);
removeChild(youWinStreetBrawl);
};
};
if (gameOverStreetBrawl != null){
if (contains(gameOverStreetBrawl)){
gameOverStreetBrawl.playAgain.removeEventListener(MouseEvent.CLICK, clickPlayAgain);
gameOverStreetBrawl.submitScore.removeEventListener(MouseEvent.CLICK, submitScoreLoose);
removeChild(gameOverStreetBrawl);
};
};
if (gameOverGangWar != null){
if (contains(gameOverGangWar)){
gameOverGangWar.playAgain.removeEventListener(MouseEvent.CLICK, clickPlayAgain);
gameOverGangWar.submitScore.removeEventListener(MouseEvent.CLICK, submitScoreLoose);
removeChild(gameOverGangWar);
};
};
if (youWinGangWar != null){
if (contains(youWinGangWar)){
youWinGangWar.playAgain.removeEventListener(MouseEvent.CLICK, clickPlayAgain);
youWinGangWar.submitScore.removeEventListener(MouseEvent.CLICK, submitScoreLoose);
removeChild(youWinGangWar);
};
};
}
}
}//package
Section 86
//MP (MP)
package {
import flash.media.*;
public dynamic class MP extends Sound {
}
}//package
Section 87
//OpponentProfile (OpponentProfile)
package {
import flash.display.*;
import flash.events.*;
public class OpponentProfile extends PlayerProfile {
public var strengthBar:MovieClip;
public var speedBar:MovieClip;
private var a:Array;
public var br10:MovieClip;
public var br11:MovieClip;
public var br12:MovieClip;
public var br14:MovieClip;
public var br15:MovieClip;
public var br16:MovieClip;
public var br17:MovieClip;
public var br18:MovieClip;
public var br19:MovieClip;
public var br13:MovieClip;
public var p10:SimpleButton;
public var p11:SimpleButton;
public var p12:SimpleButton;
public var p15:SimpleButton;
public var p16:SimpleButton;
public var p17:SimpleButton;
public var p18:SimpleButton;
public var p19:SimpleButton;
public var p13:SimpleButton;
public var p14:SimpleButton;
public var br20:MovieClip;
public var p20:SimpleButton;
public var cr10:MovieClip;
public var cr11:MovieClip;
public var cr12:MovieClip;
public var cr13:MovieClip;
public var cr14:MovieClip;
public var cr15:MovieClip;
public var cr16:MovieClip;
public var cr17:MovieClip;
public var cr18:MovieClip;
public var cr19:MovieClip;
private var selectedPlayerIndex:int;// = 1
public var cr20:MovieClip;
public var backButton:SimpleButton;
public var albumOpponent:Album;
private var opponentArray:Array;
public var gangname:MovieClip;
public var staminaBar:MovieClip;
private var actualOpponentOrderArray;
public var fightButton:SimpleButton;
private var index1:int;
public var cr3:MovieClip;
public var cr5:MovieClip;
public var cr6:MovieClip;
public var cr7:MovieClip;
public var cr8:MovieClip;
public var cr9:MovieClip;
public var cr4:MovieClip;
public var cr2:MovieClip;
public var cr1:MovieClip;
public var p1:SimpleButton;
public var p2:SimpleButton;
public var p3:SimpleButton;
public var p5:SimpleButton;
public var p9:SimpleButton;
public var p8:SimpleButton;
public var p6:SimpleButton;
public var p7:SimpleButton;
public var br1:MovieClip;
public var br2:MovieClip;
public var br3:MovieClip;
public var br4:MovieClip;
public var br5:MovieClip;
public var br6:MovieClip;
public var br7:MovieClip;
public var br8:MovieClip;
public var br9:MovieClip;
public var p4:SimpleButton;
public function OpponentProfile(){
a = new Array("name");
opponentArray = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20);
actualOpponentOrderArray = new Array(1, 6, 11, 16, 2, 7, 12, 17, 3, 8, 13, 18, 4, 9, 14, 19, 5, 10, 15, 20);
selectedPlayerIndex = 1;
super();
}
public function removeListeners(){
var _local1:int;
var _local2:SimpleButton;
_local1 = 1;
while (_local1 <= GParams.playerStats.length) {
_local2 = (this.getChildByName(("p" + _local1)) as SimpleButton);
if (_local2.hasEventListener(MouseEvent.CLICK) == true){
_local2.removeEventListener(MouseEvent.CLICK, onClick);
};
_local2.enabled = false;
_local1++;
};
}
public function showSelectedPlayerStats(){
var _local1:SimpleButton;
var _local2:int;
var _local3:int;
var _local4:int;
if ((((GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR)) && ((GParams.playedOpponentIndex.length == 0)))){
if ((((GParams.selectedOpponentIndex > 0)) && ((GParams.selectedOpponentIndex <= GParams.playerStats.length)))){
GParams.getPlayerParameters(GParams.playerStats[(GParams.selectedOpponentIndex - 1)].playerType, GParams.selectedOpponentIndex, GParams.playedOpponentIndex.length);
_local2 = ((GParams.gangWarClickedPlayerStat[0] / GParams.SPEED_MAX) * 100);
_local3 = ((GParams.gangWarClickedPlayerStat[1] / GParams.STAMINA_MAX) * 100);
_local4 = ((GParams.gangWarClickedPlayerStat[2] / GParams.STRENGTH_MAX) * 100);
speedBar.gotoAndStop(((100 - _local2) + 1));
staminaBar.gotoAndStop(((100 - _local3) + 1));
strengthBar.gotoAndStop(((100 - _local4) + 1));
albumOpponent.gotoAndStop(GParams.selectedOpponentIndex);
this.gangname.gotoAndStop(GParams.playerStats[(GParams.selectedOpponentIndex - 1)].playerType);
};
} else {
if ((((GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR)) && ((GParams.playedOpponentIndex.length > 0)))){
if ((((GParams.selectedOpponentIndex > 0)) && ((GParams.selectedOpponentIndex <= GParams.playerStats.length)))){
GParams.getPlayerParameters(GParams.playerStats[(GParams.selectedOpponentIndex - 1)].playerType, GParams.selectedOpponentIndex, GParams.playedOpponentIndex.length);
_local2 = ((GParams.gangWarClickedPlayerStat[0] / GParams.SPEED_MAX) * 100);
_local3 = ((GParams.gangWarClickedPlayerStat[1] / GParams.STAMINA_MAX) * 100);
_local4 = ((GParams.gangWarClickedPlayerStat[2] / GParams.STRENGTH_MAX) * 100);
speedBar.gotoAndStop(((100 - _local2) + 1));
staminaBar.gotoAndStop(((100 - _local3) + 1));
strengthBar.gotoAndStop(((100 - _local4) + 1));
albumOpponent.gotoAndStop(GParams.selectedOpponentIndex);
this.gangname.gotoAndStop(GParams.playerStats[(GParams.selectedOpponentIndex - 1)].playerType);
};
} else {
if ((((GParams.selectedOpponentIndex > 0)) && ((GParams.selectedOpponentIndex <= GParams.playerStats.length)))){
_local2 = ((GParams.playerStats[(GParams.selectedOpponentIndex - 1)].speed / GParams.SPEED_MAX) * 100);
_local3 = ((GParams.playerStats[(GParams.selectedOpponentIndex - 1)].stamina / GParams.STAMINA_MAX) * 100);
_local4 = ((GParams.playerStats[(GParams.selectedOpponentIndex - 1)].streng / GParams.STAMINA_MAX) * 100);
speedBar.gotoAndStop(((100 - _local2) + 1));
staminaBar.gotoAndStop(((100 - _local3) + 1));
strengthBar.gotoAndStop(((100 - _local4) + 1));
albumOpponent.gotoAndStop(GParams.selectedOpponentIndex);
this.gangname.gotoAndStop(GParams.playerStats[(GParams.selectedOpponentIndex - 1)].playerType);
};
};
};
_local1 = (this.getChildByName(("p" + GParams.selectedHeroIndex)) as SimpleButton);
if (_local1.hasEventListener(MouseEvent.CLICK) == true){
_local1.removeEventListener(MouseEvent.CLICK, onClick);
_local1.enabled = false;
_local1.alpha = 0.5;
};
}
public function onClick(_arg1:MouseEvent){
var _local2:String;
var _local3:int;
var _local4:SimpleButton;
var _local5:MovieClip;
_local2 = _arg1.target.name;
_local2 = _local2.substring(1, _local2.length);
_local3 = int(_local2);
if ((((GParams.selectedOpponentIndex > 0)) && ((GParams.selectedOpponentIndex <= GParams.playerStats.length)))){
if (MainClass.isSoundOn == true){
MainClass.scs.play();
};
_local4 = (this.getChildByName(("p" + GParams.selectedOpponentIndex)) as SimpleButton);
_local4.alpha = 1;
_local5 = (this.getChildByName(("br" + GParams.selectedOpponentIndex)) as MovieClip);
_local5.visible = false;
GParams.selectedOpponentIndex = _local3;
_local4 = (this.getChildByName(("p" + GParams.selectedOpponentIndex)) as SimpleButton);
_local4.alpha = 1;
_local5 = (this.getChildByName(("br" + GParams.selectedOpponentIndex)) as MovieClip);
_local5.visible = true;
showSelectedPlayerStats();
albumOpponent.gotoAndStop(GParams.selectedOpponentIndex);
this.gangname.gotoAndStop(GParams.playerStats[(GParams.selectedOpponentIndex - 1)].playerType);
};
}
override public function init(){
var _local1:int;
var _local2:int;
var _local3:MovieClip;
var _local4:MovieClip;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:MovieClip;
var _local9:Number;
var _local10:SimpleButton;
var _local11:Number;
_local1 = 1;
while (_local1 <= GParams.playerStats.length) {
_local3 = (this.getChildByName(("cr" + _local1)) as MovieClip);
_local3.visible = false;
_local1++;
};
_local2 = 1;
while (_local2 <= GParams.playerStats.length) {
_local4 = (this.getChildByName(("br" + _local2)) as MovieClip);
_local4.visible = false;
_local2++;
};
this.gangname.gotoAndStop(GParams.playerStats[(GParams.selectedOpponentIndex - 1)].playerType);
if (GParams.selectedGameMode == GParams.GAMEMODE_GANGWAR){
if (GParams.playedOpponentIndex.length == 0){
_local6 = 0;
if (GParams.selectedGang == GParams.PLAYER_GRIZZLIES){
_local6 = 1;
};
GParams.selectedOpponentIndex = actualOpponentOrderArray[_local6];
} else {
_local7 = 0;
while (_local7 < GParams.playedOpponentIndex.length) {
_local8 = (this.getChildByName(("cr" + GParams.playedOpponentIndex[_local7])) as MovieClip);
_local8.visible = true;
if (_local7 == (GParams.playedOpponentIndex.length - 1)){
_local9 = (actualOpponentOrderArray.indexOf(GParams.playedOpponentIndex[(GParams.playedOpponentIndex.length - 1)]) + 1);
if (GParams.gangWarPlayerStat[(actualOpponentOrderArray[_local9] - 1)].playerType == GParams.gangWarPlayerStat[(GParams.selectedHeroIndex - 1)].playerType){
_local9 = (actualOpponentOrderArray.indexOf(GParams.playedOpponentIndex[(GParams.playedOpponentIndex.length - 1)]) + 2);
};
if (_local9 >= 20){
_local9 = 0;
};
GParams.selectedOpponentIndex = actualOpponentOrderArray[_local9];
};
_local7++;
};
};
_local5 = 1;
while (_local5 <= GParams.playerStats.length) {
_local10 = (this.getChildByName(("p" + _local5)) as SimpleButton);
_local10.alpha = 0.5;
if (GParams.playerStats[(_local5 - 1)].playerType == GParams.selectedGang){
if (_local10.hasEventListener(MouseEvent.CLICK) == true){
_local10.removeEventListener(MouseEvent.CLICK, onClick);
};
_local10.enabled = false;
} else {
if (_local10.hasEventListener(MouseEvent.CLICK) == true){
_local10.removeEventListener(MouseEvent.CLICK, onClick);
};
_local10.enabled = false;
};
if (GParams.selectedOpponentIndex == _local5){
_local10.alpha = 1;
_local4 = (this.getChildByName(("br" + GParams.selectedOpponentIndex)) as MovieClip);
_local4.visible = true;
};
_local5++;
};
showSelectedPlayerStats();
albumOpponent.gotoAndStop(GParams.selectedOpponentIndex);
} else {
_local5 = 1;
while (_local5 <= GParams.playerStats.length) {
_local10 = (this.getChildByName(("p" + _local5)) as SimpleButton);
_local10.alpha = 1;
_local11 = (GParams.selectedHeroIndex + 5);
if (_local11 > 20){
_local11 = (_local11 - 20);
};
GParams.selectedOpponentIndex = _local11;
if (_local10.hasEventListener(MouseEvent.CLICK) == false){
_local10.addEventListener(MouseEvent.CLICK, onClick);
_local10.enabled = true;
};
if (GParams.selectedOpponentIndex == _local5){
_local10.alpha = 1;
_local4 = (this.getChildByName(("br" + GParams.selectedOpponentIndex)) as MovieClip);
_local4.visible = true;
};
_local5++;
};
showSelectedPlayerStats();
albumOpponent.gotoAndStop(GParams.selectedOpponentIndex);
};
}
public function applyTint(){
}
}
}//package
Section 88
//Player (Player)
package {
public class Player {
public var streng:Number;// = 0
public var speed:Number;// = 0
public var stamina:Number;// = 0
public var playerType:int;// = 0
public function Player(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number){
speed = 0;
stamina = 0;
streng = 0;
playerType = 0;
super();
this.speed = _arg2;
this.stamina = _arg3;
this.streng = _arg4;
this.playerType = _arg1;
}
}
}//package
Section 89
//PlayerProfile (PlayerProfile)
package {
import flash.display.*;
public class PlayerProfile extends MovieClip {
public function init(){
}
}
}//package
Section 90
//PlayerStatistics (PlayerStatistics)
package {
import flash.display.*;
import flash.text.*;
public dynamic class PlayerStatistics extends MovieClip {
public var strengthBar:MovieClip;
public var playerName:TextField;
public var staminaBar:MovieClip;
public var speedBar:MovieClip;
public var matchesWon:TextField;
public var punches:TextField;
public var hits:TextField;
public var album:Album;
public var continueButton:SimpleButton;
public var backButton:SimpleButton;
}
}//package
Section 91
//PPS (PPS)
package {
import flash.media.*;
public dynamic class PPS extends Sound {
}
}//package
Section 92
//Preloader (Preloader)
package {
import flash.display.*;
import flash.events.*;
import CPMStar.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
public class Preloader extends MovieClip {
private var percentText:TextField;
var button:StartButton;// = null
var urlPlayMore:String;// = "http://www.flasharcade.com"
var timer:Timer;
var requestPlayMore:URLRequest;// = null
public var initComplete:Boolean;// = false
public var mainBar:MovieClip;
private var progressBar:Sprite;
public var adBox:MovieClip;
var CPMStarSubPoolID:int;// = 17
var CPMStarPoolID:int;// = 2299
public static const startFrame:Number = 3;
public static const mainClass:String = "MainClass";
public function Preloader(){
var _local1:DisplayObject;
requestPlayMore = null;
urlPlayMore = "http://www.flasharcade.com";
CPMStarPoolID = 2299;
CPMStarSubPoolID = 17;
button = null;
initComplete = false;
addFrameScript(0, frame1, 2, frame3);
stop();
super();
requestPlayMore = new URLRequest(urlPlayMore);
timer = new Timer(100, 0);
timer.addEventListener(TimerEvent.TIMER, afterSecond);
timer.start();
_local1 = AdLoader.LoadAd(CPMStarPoolID, CPMStarSubPoolID);
adBox.addChild(_local1);
initSecondFrame();
}
private function enterFrameHandler(_arg1:Event):void{
if (currentFrame >= _slot1.startFrame){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
initApp();
};
}
public function initSecondFrame(){
progressBar = (mainBar.getChildByName("percentbar") as Sprite);
percentText = (mainBar.getChildByName("percent") as TextField);
if (((!((progressBar == null))) && (!((percentText == null))))){
progressBar.scaleX = 0;
percentText.text = "0";
initComplete = true;
};
}
function frame3(){
stop();
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function afterSecond(_arg1:TimerEvent){
var _local2:uint;
var _local3:uint;
var _local4:Number;
_local2 = loaderInfo.bytesLoaded;
_local3 = loaderInfo.bytesTotal;
_local4 = (_local2 / _local3);
if (currentFrame == 1){
if (initComplete){
progressBar.scaleX = ((_local2 / _local3) * 4);
percentText.text = (Math.round((_local4 * 100)).toString() + "%");
if (_local2 >= _local3){
timer.stop();
if (button == null){
button = new StartButton();
button.addEventListener(MouseEvent.CLICK, onClickStart);
};
addChild(button);
button.x = 300;
button.y = 430;
mainBar.visible = false;
};
} else {
initSecondFrame();
};
};
}
function frame1(){
stop();
}
private function showProgress(_arg1:ProgressEvent):void{
var _local2:uint;
var _local3:uint;
var _local4:Number;
_local2 = _arg1.bytesLoaded;
_local3 = _arg1.bytesTotal;
_local4 = (_local2 / _local3);
progressBar.scaleX = ((_local2 / _local3) * 4);
percentText.text = (Math.round((_local4 * 100)).toString() + "%");
}
private function initApp():void{
var _local1:Boolean;
var _local2:Class;
var _local3:Sprite;
_local1 = loaderInfo.applicationDomain.hasDefinition(_slot1.mainClass);
_local2 = (loaderInfo.applicationDomain.getDefinition(_slot1.mainClass) as Class);
_local3 = (new (_local2) as Sprite);
addChild(_local3);
}
public function onClickStart(_arg1:MouseEvent){
button.removeEventListener(MouseEvent.CLICK, onClickStart);
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
if (contains(button)){
removeChild(button);
};
if (contains(adBox)){
removeChild(adBox);
};
}
}
}//package
Section 93
//SCS (SCS)
package {
import flash.media.*;
public dynamic class SCS extends Sound {
}
}//package
Section 94
//StartButton (StartButton)
package {
import flash.display.*;
public dynamic class StartButton extends SimpleButton {
}
}//package
Section 95
//StorableInfo (StorableInfo)
package {
public class StorableInfo {
private var defeatedOpponent:Array;
private var heroStamina:int;// = 0
private var heroIndex:int;// = 0
private var heroStrength:int;// = 0
public var levelDetails:Array;
public function StorableInfo(){
heroIndex = 0;
heroStamina = 0;
heroStrength = 0;
defeatedOpponent = new Array();
levelDetails = new Array();
super();
}
public function setDefeatedOpponent(_arg1:int){
defeatedOpponent.push(_arg1);
}
public function getHeroIndex():int{
return (heroIndex);
}
public function getDefeatedOpponent():Array{
return (defeatedOpponent);
}
public function getLevelDetails():Array{
return (levelDetails);
}
public function setHeroIndex(_arg1:int){
heroIndex = _arg1;
}
public function addLevelDetails(_arg1:LevelInfo){
levelDetails.push(_arg1);
}
}
}//package
Section 96
//StringHelper (StringHelper)
package {
class StringHelper {
public function trim(_arg1:String, _arg2:String):String{
return (trimBack(trimFront(_arg1, _arg2), _arg2));
}
public function replace(_arg1:String, _arg2:String, _arg3:String):String{
return (_arg1.split(_arg2).join(_arg3));
}
public function trimBack(_arg1:String, _arg2:String):String{
_arg2 = stringToCharacter(_arg2);
if (_arg1.charAt((_arg1.length - 1)) == _arg2){
_arg1 = trimBack(_arg1.substring(0, (_arg1.length - 1)), _arg2);
};
return (_arg1);
}
public function stringToCharacter(_arg1:String):String{
if (_arg1.length == 1){
return (_arg1);
};
return (_arg1.slice(0, 1));
}
public function trimFront(_arg1:String, _arg2:String):String{
_arg2 = stringToCharacter(_arg2);
if (_arg1.charAt(0) == _arg2){
_arg1 = trimFront(_arg1.substring(1), _arg2);
};
return (_arg1);
}
}
}//package
Section 97
//TrainingContainer (TrainingContainer)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
public class TrainingContainer extends MovieClip {
private var startP:Point;
public var traineeScreen:MovieClip;
public var traineeUP:MovieClip;
public var traineeFRONT:MovieClip;
private var lastActionTime:int;// = 0
public var traineeDOWN:MovieClip;
public var traineeA:MovieClip;
public var traineeBACK:MovieClip;
private var opponentPushbackCounter:int;// = 0
public var traineeW:MovieClip;
public var dias:MovieClip;
private var playerPos:Array;
public var platform:MovieClip;
public var traineeS:MovieClip;
public var traineeD:MovieClip;
private var playerDistMin:Point;
public var lineArray:Array;
private var heroClass:Class;// = null
public var backButton:SimpleButton;
private var classNameArray:Array;
public var playerArray:Array;
public function TrainingContainer(){
playerPos = new Array(new Point(400, 270), new Point(280, 315));
playerDistMin = new Point(65, 25);
lastActionTime = 0;
opponentPushbackCounter = 0;
heroClass = null;
playerArray = new Array(2);
classNameArray = new Array("dummy", "GrizzliesOne", "GrizzliesTwo", "GrizzliesThree", "GrizzliesFour", "GrizzliesFive", "WovlverinOne", "WovlverinTwo", "WovlverinThree", "WovlverinFour", "WovlverinFive", "WarrierOne", "WarrierTwo", "WarrierThree", "WarrierFour", "WarrierFive", "ImmortalOne", "ImmortalTwo", "ImmortalThree", "ImmortalFour", "ImmortalFive");
lineArray = new Array(new LineParticle(250.2, 343.51, 1), new LineParticle(124, 0, 1), new LineParticle(250.2, 16.69, 1), new LineParticle(270.14, 152.68, 1), new LineParticle(124, 180, 0), new LineParticle(270.14, 207.32, 1));
startP = new Point(65, 232);
super();
}
public function init(){
GParams.selectedTraineeIndex = Math.floor(((Math.random() * 20) + 1));
this.traineeW.gotoAndStop(1);
this.traineeA.gotoAndStop(1);
this.traineeS.gotoAndStop(1);
this.traineeD.gotoAndStop(1);
this.traineeUP.gotoAndStop(1);
this.traineeDOWN.gotoAndStop(1);
this.traineeBACK.gotoAndStop(1);
this.traineeFRONT.gotoAndStop(1);
createSurface();
}
public function removeListeners(){
if (playerArray[0] == null){
return;
};
if (dias.contains(playerArray[0])){
dias.removeChild(playerArray[0]);
};
if (playerArray[0].hasEventListener(Event.ENTER_FRAME)){
playerArray[0].removeEventListener(Event.ENTER_FRAME, onEnterFrameHero);
};
playerArray[0] = null;
}
public function createHero(_arg1:int=0, _arg2:int=0, _arg3:int=5, _arg4:int=80, _arg5:int=60){
heroClass = (loaderInfo.applicationDomain.getDefinition(classNameArray[GParams.selectedTraineeIndex]) as Class);
if (playerArray[0] == null){
playerArray[0] = new heroClass();
playerArray[0].setParameters(GParams.playerStats[(GParams.selectedTraineeIndex - 1)].playerType, playerPos[0], GParams.playerStats[(GParams.selectedTraineeIndex - 1)].speed, GParams.playerStats[(GParams.selectedTraineeIndex - 1)].streng, GParams.playerStats[(GParams.selectedTraineeIndex - 1)].stamina);
playerArray[0].setObjectClass(heroClass);
playerArray[0].scaleX = (playerArray[0].scaleX * GParams.playersScalePercent);
playerArray[0].scaleY = (playerArray[0].scaleY * GParams.playersScalePercent);
playerArray[0].init();
};
this.dias.addChild(playerArray[0]);
playerArray[0].addEventListener(Event.ENTER_FRAME, onEnterFrameHero);
}
private function createSurface(){
var _local1:Point;
var _local2:uint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = new Point();
_local1.x = startP.x;
_local1.y = startP.y;
_local2 = 0;
while (_local2 < lineArray.length) {
_local3 = ((lineArray[_local2].angle * Math.PI) / 180);
lineArray[_local2].setMinimum(_local1);
_local4 = ((Math.cos(_local3) * lineArray[_local2].length) / 2);
_local5 = ((Math.sin(_local3) * lineArray[_local2].length) / 2);
_local1.x = (_local1.x + _local4);
_local1.y = (_local1.y + _local5);
lineArray[_local2].setParameters(_local1.x, _local1.y);
addChild(lineArray[_local2]);
_local1.x = (_local1.x + _local4);
_local1.y = (_local1.y + _local5);
lineArray[_local2].setMaximun(_local1);
_local2++;
};
}
public function handleActions(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Boolean;
_local1 = 0;
_local2 = 0;
_local3 = playerArray[0].getWalkSpeed();
if ((((((((playerArray[0].currentFrame == Fighter.JAB)) || ((playerArray[0].currentFrame == Fighter.LPUNCH)))) || ((playerArray[0].currentFrame == Fighter.PPUNCH)))) || ((playerArray[0].currentFrame == Fighter.BLOCK)))){
return;
};
if (MainClass.aKeyDown == true){
MainClass.aKeyDown = false;
playerArray[0].gotoAndStop("ppunch");
this.traineeA.gotoAndPlay(1);
};
if (MainClass.wKeyDown == true){
MainClass.wKeyDown = false;
playerArray[0].gotoAndStop("lpunch");
this.traineeW.gotoAndPlay(1);
};
if (MainClass.dKeyDown == true){
MainClass.dKeyDown = false;
playerArray[0].gotoAndStop("jab");
this.traineeD.gotoAndPlay(1);
};
if (MainClass.sKeyDown == true){
MainClass.sKeyDown = false;
playerArray[0].gotoAndStop("block");
this.traineeS.gotoAndPlay(1);
};
if (MainClass.leftKeyDown == true){
_local1 = (_local1 - _local3);
if (playerArray[0].scaleX < 0){
playerArray[0].scaleX = (playerArray[0].scaleX * -1);
};
this.traineeFRONT.gotoAndPlay(2);
} else {
if (MainClass.rightKeyDown == true){
_local1 = (_local1 + _local3);
if (playerArray[0].scaleX > 0){
playerArray[0].scaleX = (playerArray[0].scaleX * -1);
};
this.traineeBACK.gotoAndPlay(2);
};
};
if (MainClass.upKeyDown == true){
_local2 = (_local2 - _local3);
this.traineeUP.gotoAndPlay(2);
} else {
if (MainClass.downKeyDown == true){
_local2 = (_local2 + _local3);
this.traineeDOWN.gotoAndPlay(2);
};
};
if (((!((_local1 == 0))) || (!((_local2 == 0))))){
_local4 = playerArray[0].movementTrainee(_local1, _local2);
if (_local4 == true){
if (playerArray[0].currentFrame != Fighter.WALK){
playerArray[0].gotoAndStop("walk");
};
} else {
playerArray[0].gotoAndStop("stand");
};
} else {
if (playerArray[0].currentFrame == Fighter.WALK){
playerArray[0].gotoAndStop("stand");
};
};
}
public function onEnterFrameHero(_arg1:Event){
handleActions();
if (playerArray[0].currentFrame == Fighter.LPUNCH){
if (playerArray[0].lpunch != null){
if (playerArray[0].lpunch.currentFrame == playerArray[0].lpunch.totalFrames){
playerArray[0].lpunch.gotoAndStop(1);
playerArray[0].gotoAndStop("stand");
this.traineeW.gotoAndStop(1);
};
};
} else {
if (playerArray[0].currentFrame == Fighter.PPUNCH){
if (playerArray[0].ppunch != null){
if (playerArray[0].ppunch.currentFrame == playerArray[0].ppunch.totalFrames){
playerArray[0].ppunch.gotoAndStop(1);
playerArray[0].gotoAndStop("stand");
this.traineeA.gotoAndStop(1);
};
};
} else {
if (playerArray[0].currentFrame == Fighter.JAB){
if (playerArray[0].jab != null){
if (playerArray[0].jab.currentFrame == playerArray[0].jab.totalFrames){
playerArray[0].jab.gotoAndStop(1);
playerArray[0].gotoAndStop("stand");
this.traineeD.gotoAndStop(1);
};
};
} else {
if (playerArray[0].currentFrame == Fighter.BLOCK){
if (playerArray[0].block != null){
if (playerArray[0].block.currentFrame == playerArray[0].block.totalFrames){
playerArray[0].block.gotoAndStop(1);
playerArray[0].gotoAndStop("stand");
this.traineeS.gotoAndStop(1);
};
};
} else {
if (playerArray[0].currentFrame == Fighter.WALK){
if (playerArray[0].walk != null){
if (playerArray[0].walk.currentFrame == playerArray[0].walk.totalFrames){
playerArray[0].walk.gotoAndStop(1);
playerArray[0].gotoAndStop("stand");
};
};
};
};
};
};
};
}
}
}//package
Section 98
//WarrierFive (WarrierFive)
package {
import flash.display.*;
public class WarrierFive extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 99
//WarrierFour (WarrierFour)
package {
import flash.display.*;
public class WarrierFour extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 100
//WarrierOne (WarrierOne)
package {
import flash.display.*;
public class WarrierOne extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 101
//WarrierThree (WarrierThree)
package {
import flash.display.*;
public class WarrierThree extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 102
//WarrierTwo (WarrierTwo)
package {
import flash.display.*;
public class WarrierTwo extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 103
//Welcome (Welcome)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class Welcome extends MovieClip {
public var hs:MovieClip;
var requestAddMore:URLRequest;// = null
var urlPlayMore:String;// = "http://www.flasharcade.com"
public var ipwelcome:MovieClip;
var requestPlayMore:URLRequest;// = null
var urlAddMoreGames:String;// = "http://www.flasharcade.com/flash-games/"
private static var welcome:Welcome = null;
public function Welcome(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
urlAddMoreGames = "http://www.flasharcade.com/flash-games/";
requestAddMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
requestAddMore = new URLRequest(urlAddMoreGames);
ipwelcome.playMore.addEventListener(MouseEvent.CLICK, handleClick);
ipwelcome.addMore.addEventListener(MouseEvent.CLICK, handleClickAddMore);
hs.playMore.addEventListener(MouseEvent.CLICK, handleClick);
}
public function handleClickAddMore(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestAddMore, "_blank");
} catch(e:Error) {
};
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function emptyScores(){
var _local1:String;
_local1 = "";
hs.player1.text = _local1;
hs.score1.text = _local1;
hs.date1.text = _local1;
hs.player2.text = _local1;
hs.score2.text = _local1;
hs.date2.text = _local1;
hs.player3.text = _local1;
hs.score3.text = _local1;
hs.date3.text = _local1;
hs.player4.text = _local1;
hs.score4.text = _local1;
hs.date4.text = _local1;
hs.player5.text = _local1;
hs.score5.text = _local1;
hs.date5.text = _local1;
hs.player6.text = _local1;
hs.score6.text = _local1;
hs.date6.text = _local1;
hs.player7.text = _local1;
hs.score7.text = _local1;
hs.date7.text = _local1;
hs.player8.text = _local1;
hs.score8.text = _local1;
hs.date8.text = _local1;
hs.player9.text = _local1;
hs.score9.text = _local1;
hs.date9.text = _local1;
hs.player10.text = _local1;
hs.score10.text = _local1;
hs.date10.text = _local1;
}
public static function getInstance():Welcome{
if (welcome == null){
welcome = new (Welcome);
};
return (welcome);
}
}
}//package
Section 104
//WovlverinFive (WovlverinFive)
package {
import flash.display.*;
public class WovlverinFive extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 105
//WovlverinFour (WovlverinFour)
package {
import flash.display.*;
public class WovlverinFour extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 106
//WovlverinOne (WovlverinOne)
package {
import flash.display.*;
public class WovlverinOne extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 107
//WovlverinThree (WovlverinThree)
package {
import flash.display.*;
public class WovlverinThree extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 108
//WovlverinTwo (WovlverinTwo)
package {
import flash.display.*;
public class WovlverinTwo extends Fighter {
public var jab:MovieClip;
public var hurt:MovieClip;
public var fall2:MovieClip;
public var moveback:MovieClip;
public var lpunch:MovieClip;
public var getup:MovieClip;
public var ppunch:MovieClip;
public var block:MovieClip;
public var fall:MovieClip;
public var walk:MovieClip;
public var gasping:MovieClip;
public var stand:MovieClip;
public var getup2:MovieClip;
}
}//package
Section 109
//WS (WS)
package {
import flash.media.*;
public dynamic class WS extends Sound {
}
}//package
Section 110
//YLC (YLC)
package {
import flash.media.*;
public dynamic class YLC extends Sound {
}
}//package
Section 111
//YLS (YLS)
package {
import flash.media.*;
public dynamic class YLS extends Sound {
}
}//package
Section 112
//YouWin (YouWin)
package {
import flash.display.*;
import flash.net.*;
public class YouWin extends MovieClip {
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
private static var youWin:YouWin = null;
public function YouWin(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
}
public function init(){
gotoAndStop(1);
}
public static function getInstance():YouWin{
if (youWin == null){
youWin = new (YouWin);
};
return (youWin);
}
}
}//package
Section 113
//YouWinGangWar (YouWinGangWar)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class YouWinGangWar extends MovieClip {
public var playerName:TextField;
public var errormesg:TextField;
public var matches:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
public var punches:TextField;
public var submitScore:SimpleButton;
public var hits:TextField;
public var photos:Album;
public var playMore:SimpleButton;
public var playAgain:SimpleButton;
public var totalscore:TextField;
public var box:MovieClip;
private static var youWinGangWar:YouWinGangWar = null;
public function YouWinGangWar(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
playMore.addEventListener(MouseEvent.CLICK, handleClick);
playerName.addEventListener(MouseEvent.CLICK, onTextFieldClick);
addEventListener(MouseEvent.CLICK, checkName);
}
public function getPlayerName():String{
var _local1:String;
_local1 = this.playerName.text;
if (_local1 == null){
return (null);
};
this.errormesg.text = "";
return (_local1);
}
public function updateScores(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.photos.gotoAndStop(_arg4);
this.matches.text = _arg3.toString();
this.punches.text = GParams.totalPunches.toString();
this.hits.text = GParams.totalHits.toString();
this.totalscore.text = GParams.totalScore.toString();
this.playerName.text = GParams.playerName;
this.playerName.selectable = false;
box.visible = false;
}
public function resetData(){
}
public function onTextFieldClick(_arg1:MouseEvent){
playerName.text = "";
}
private function checkName(_arg1:MouseEvent){
trace(_arg1.target.name);
if (_arg1.target.name == "playerName"){
box.visible = false;
} else {
if (_arg1.target.name == "playMore"){
handleClick(null);
} else {
if ((((_arg1.target.name == "submitScore")) || ((_arg1.target.name == "playAgain")))){
} else {
if (playerName.text == ""){
box.visible = true;
};
};
};
};
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function setErrorMesg(_arg1:String){
this.errormesg.text = _arg1;
}
public static function getInstance():YouWinGangWar{
if (youWinGangWar == null){
youWinGangWar = new (YouWinGangWar);
};
return (youWinGangWar);
}
}
}//package
Section 114
//YouWinStreetBrawl (YouWinStreetBrawl)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class YouWinStreetBrawl extends MovieClip {
public var playerName:TextField;
public var errormesg:TextField;
public var bonus:TextField;
var urlPlayMore:String;// = "http://www.flasharcade.com"
var requestPlayMore:URLRequest;// = null
public var punches:TextField;
public var submitScore:SimpleButton;
public var hits:TextField;
public var photos:Album;
public var score:TextField;
public var playMore:SimpleButton;
public var playAgain:SimpleButton;
public var box:MovieClip;
private static var youWinStreetBrawl:YouWinStreetBrawl = null;
public function YouWinStreetBrawl(){
urlPlayMore = "http://www.flasharcade.com";
requestPlayMore = null;
super();
requestPlayMore = new URLRequest(urlPlayMore);
playMore.addEventListener(MouseEvent.CLICK, handleClick);
playerName.addEventListener(MouseEvent.CLICK, onTextFieldClick);
addEventListener(MouseEvent.CLICK, checkName);
}
public function getPlayerName():String{
var _local1:String;
_local1 = this.playerName.text;
if (_local1 == null){
return (null);
};
this.errormesg.text = "";
return (_local1);
}
public function updateScores(_arg1:Number, _arg2:Number, _arg3:Number){
this.photos.gotoAndStop(_arg3);
this.punches.text = _arg1.toString();
this.hits.text = _arg2.toString();
playerName.text = "";
box.visible = true;
this.bonus.text = GParams.levelBonus.toString();
this.score.text = GParams.levelScore.toString();
}
public function onTextFieldClick(_arg1:MouseEvent){
playerName.text = "";
}
public function resetData(){
}
private function checkName(_arg1:MouseEvent){
var _local2:String;
if (_arg1.target.name == "playerName"){
box.visible = false;
} else {
if (_arg1.target.name == "playMore"){
handleClick(null);
} else {
if ((((_arg1.target.name == "submitScore")) || ((_arg1.target.name == "playAgain")))){
} else {
_local2 = new String();
if (playerName.text != null){
_local2 = MainClass.stringHelper.trim(playerName.text, " ");
};
if (_local2.length <= 0){
box.visible = true;
};
};
};
};
}
public function handleClick(_arg1:MouseEvent){
var event = _arg1;
try {
navigateToURL(requestPlayMore, "_blank");
} catch(e:Error) {
};
}
public function setErrorMesg(_arg1:String){
this.errormesg.text = _arg1;
}
public static function getInstance():YouWinStreetBrawl{
if (youWinStreetBrawl == null){
youWinStreetBrawl = new (YouWinStreetBrawl);
};
return (youWinStreetBrawl);
}
}
}//package
Section 115
//YWC (YWC)
package {
import flash.media.*;
public dynamic class YWC extends Sound {
}
}//package
Section 116
//YWS (YWS)
package {
import flash.media.*;
public dynamic class YWS extends Sound {
}
}//package