Section 1
//AnimateHelper (AnimateHelper)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.geom.*;
public class AnimateHelper {
public static const FACING_UP:int = 0;
public static const ATTACK_RESOLVE_DISTANCE:int = 75;
public static const ATTACK_DURATION:int = 3000;
public static const ATTACK_DELAY:int = 50;
public static const ATTACK_RESULT_DRAW:int = 3;
public static const MOVING_DELAY:int = 50;
public static const MAX_NUM_EXPLOSIONS_OF_BUNKER:int = 2;
public static const ATTACK_SNAPTO_DISTANCE:int = 5;
public static const MOVING_SNAPTO_DISTANCE:int = 5;
public static const ATTACK_RESULT_DEFENDER_WIN:int = 2;
public static const FACING_LEFT:int = 2;
public static const FACING_RIGHT:int = 3;
public static const ATTACK_RESULT_ATTACKER_WIN:int = 1;
public static const MOVING_DURATION:int = 1000;
public static const FACING_DOWN:int = 1;
private static var attackResult:int;
private static var movingTimer:Timer;
public static var bunkerDestroyed:Boolean;
private static var movingFrom:Point;
public static var attackIsResolved:Boolean;
public static var targetUnit:Obj_Unit;
private static var numExplosionsForBunker:int;
private static var attackTimer:Timer;
public static var currentExplosions:Array = new Array();
private static var movingX_inc:Number;
private static var movingY_inc:Number;
public static var movingUnit:Obj_Unit;
private static var movingTo:Point;
public static function unitContinuingFiringAnimation(_arg1:MovieClip, _arg2:Boolean):void{
if (_arg1 == targetUnit.image){
if (_arg2){
if (_arg1.scaleX == -1){
_arg1.x = (_arg1.x + 1);
_arg1.y = (_arg1.y + 1);
} else {
_arg1.x = (_arg1.x - 1);
_arg1.y = (_arg1.y + 1);
};
} else {
if (_arg1.scaleX == -1){
_arg1.x = (_arg1.x + 1);
_arg1.y = (_arg1.y - 1);
} else {
_arg1.x = (_arg1.x - 1);
_arg1.y = (_arg1.y - 1);
};
};
};
}
public static function createDamageEffect(_arg1:MovieClip):void{
var _local2:Boolean;
if (_arg1 == movingUnit.image){
_local2 = true;
if (!attackIsResolved){
if (targetUnit.unitType == Obj_Unit.UNIT_TYPE_BUNKER){
createDamageEffectAt(targetUnit.getX(), targetUnit.getY());
attackIsResolved = true;
} else {
if (Point.distance(movingTo, movingFrom) <= ATTACK_RESOLVE_DISTANCE){
resolveAttack();
_local2 = false;
};
};
};
if (_local2){
playShooterSound(movingUnit.attackSoundType);
};
};
}
public static function moveUnitToSquare(_arg1, _arg2:Obj_Square):void{
var _local3:int;
var _local4:Number;
var _local5:Number;
if (_arg2.unit != null){
attackUnitAtSquare(_arg1, _arg2);
return;
};
riverwar.clearActionIconsLayer();
KeyboardManager.playerInputOff();
movingUnit = _arg1.unit;
setMovingPointsFrom(_arg1, _arg2);
_arg2.unit = _arg1.unit;
_arg2.unit.square = _arg2;
_arg1.unit = null;
if (movingTo.x > movingFrom.x){
updateUnitFacing(movingUnit, FACING_RIGHT);
} else {
updateUnitFacing(movingUnit, FACING_LEFT);
};
if (movingTo.y > movingFrom.y){
updateUnitFacing(movingUnit, FACING_DOWN);
} else {
updateUnitFacing(movingUnit, FACING_UP);
};
_local3 = (MOVING_DURATION / MOVING_DELAY);
_local4 = (movingTo.x - movingFrom.x);
_local5 = (movingTo.y - movingFrom.y);
movingX_inc = (_local4 / _local3);
movingY_inc = (_local5 / _local3);
movingTimer = new Timer(MOVING_DELAY);
movingTimer.addEventListener(TimerEvent.TIMER, animateMove);
movingTimer.start();
}
public static function spaceToContinuePressed():void{
if (riverwar.player_red_isHuman){
riverwar.quitToMainMenu();
} else {
if (riverwar.currentTurn == riverwar.TURN_PLAYER_BLUE){
riverwar.menuLayer.removeChildAt((riverwar.menuLayer.numChildren - 1));
MovieClip(riverwar.menuLayer.getChildAt((riverwar.menuLayer.numChildren - 1))).addEventListener(Event.ENTER_FRAME, riseGameResultText);
} else {
riverwar.quitToMainMenu();
};
};
}
private static function setMovingPointsFrom(_arg1, _arg2:Obj_Square):void{
movingTo = new Point(_arg2.getX(), _arg2.getY());
movingFrom = new Point(_arg1.getX(), _arg1.getY());
}
private static function showWinner(_arg1:int):void{
var _local2:Bitmap;
var _local3:MovieClip_WinText;
_local2 = new Bitmap(new Bitmap_BlackDot(0, 0));
_local2.scaleX = riverwar.VIEW_WIDTH;
_local2.scaleY = riverwar.VIEW_HEIGHT;
_local2.alpha = 0;
_local2.addEventListener(Event.ENTER_FRAME, fadeInDot);
riverwar.menuLayer.addChild(_local2);
_local3 = new MovieClip_WinText();
if (_arg1 == -1){
if (riverwar.player_red_isHuman){
_local3.gotoAndStop((riverwar.currentTurn + 1));
} else {
if (riverwar.currentTurn == riverwar.TURN_PLAYER_BLUE){
_local3.gotoAndStop(3);
} else {
_local3.gotoAndStop(4);
};
};
} else {
if (_arg1 >= 0){
_local3.gotoAndStop(_arg1);
};
};
_local3.x = (riverwar.VIEW_WIDTH / 2);
_local3.y = ((riverwar.VIEW_HEIGHT - _local3.height) / 2);
_local3.scaleX = 0;
_local3.alpha = 0;
_local3.addEventListener(Event.ENTER_FRAME, stretchInWinText);
riverwar.menuLayer.addChild(_local3);
}
private static function riseGameResultText(_arg1:Event):void{
var _local2:Boolean;
var _local3:int;
_local2 = false;
if (_arg1.currentTarget.y > 100){
_local3 = ((_arg1.currentTarget.y - 100) / 10);
if (_local3 > 0){
_arg1.currentTarget.y = (_arg1.currentTarget.y - _local3);
} else {
_local2 = true;
};
} else {
_local2 = true;
};
if (_local2){
_arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, riseGameResultText);
HighscoreSubmitManager.setupScoreSubmitInfo(((_arg1.currentTarget.y + _arg1.currentTarget.height) + 50));
};
}
private static function updateUnitFacing(_arg1:Obj_Unit, _arg2:int):void{
if (_arg1.unitType == Obj_Unit.UNIT_TYPE_BUNKER){
return;
};
switch (_arg2){
case FACING_UP:
_arg1.setVerticalFacing(true);
break;
case FACING_DOWN:
_arg1.setVerticalFacing(false);
break;
case FACING_LEFT:
_arg1.image.scaleX = 1;
break;
case FACING_RIGHT:
_arg1.image.scaleX = -1;
break;
};
_arg1.stopFiring();
}
public static function unitStartedFiringAnimation(_arg1:MovieClip, _arg2:Boolean):void{
if (_arg1 == targetUnit.image){
if (_arg2){
if (_arg1.scaleX == -1){
_arg1.x = (_arg1.x - 1);
_arg1.y = (_arg1.y - 1);
} else {
_arg1.x = (_arg1.x + 1);
_arg1.y = (_arg1.y - 1);
};
} else {
if (_arg1.scaleX == -1){
_arg1.x = (_arg1.x - 1);
_arg1.y = (_arg1.y + 1);
} else {
_arg1.x = (_arg1.x + 1);
_arg1.y = (_arg1.y + 1);
};
};
};
}
public static function dispose():void{
if (movingTimer != null){
movingTimer.removeEventListener(TimerEvent.TIMER, animateMove);
movingTimer = null;
};
movingTo = null;
movingFrom = null;
if (attackTimer != null){
attackTimer.removeEventListener(TimerEvent.TIMER, animateMove);
attackTimer = null;
};
targetUnit = null;
currentExplosions.splice(currentExplosions.length);
bunkerDestroyed = false;
numExplosionsForBunker = 0;
}
public static function attackUnitAtSquare(_arg1, _arg2:Obj_Square):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
riverwar.clearActionIconsLayer();
KeyboardManager.playerInputOff();
movingUnit = _arg1.unit;
setMovingPointsFrom(_arg1, _arg2);
targetUnit = _arg2.unit;
_local3 = Math.floor((Math.random() * 100));
_local4 = riverwar.getWinningPercentage(movingUnit, targetUnit);
if (_local3 <= _local4){
attackResult = ATTACK_RESULT_ATTACKER_WIN;
} else {
attackResult = ATTACK_RESULT_DEFENDER_WIN;
};
if (targetUnit.unitType == Obj_Unit.UNIT_TYPE_BUNKER){
attackResult = ATTACK_RESULT_ATTACKER_WIN;
};
if (attackResult == ATTACK_RESULT_DEFENDER_WIN){
} else {
_arg2.unit = movingUnit;
_arg2.unit.square = _arg2;
};
_arg1.unit = null;
attackIsResolved = false;
if (movingTo.x > movingFrom.x){
updateUnitFacing(movingUnit, FACING_RIGHT);
updateUnitFacing(targetUnit, FACING_LEFT);
} else {
updateUnitFacing(movingUnit, FACING_LEFT);
updateUnitFacing(targetUnit, FACING_RIGHT);
};
if (movingTo.y > movingFrom.y){
updateUnitFacing(movingUnit, FACING_DOWN);
updateUnitFacing(targetUnit, FACING_UP);
} else {
updateUnitFacing(movingUnit, FACING_UP);
updateUnitFacing(targetUnit, FACING_DOWN);
};
movingUnit.startFiring();
targetUnit.startFiring();
_local5 = (ATTACK_DURATION / ATTACK_DELAY);
_local6 = (movingTo.x - movingFrom.x);
_local7 = (movingTo.y - movingFrom.y);
movingX_inc = (_local6 / _local5);
movingY_inc = (_local7 / _local5);
attackTimer = new Timer(ATTACK_DELAY);
attackTimer.addEventListener(TimerEvent.TIMER, animateMove);
attackTimer.start();
}
public static function fadeInDot(_arg1:Event):void{
_arg1.currentTarget.alpha = (_arg1.currentTarget.alpha + 0.0375);
if (_arg1.currentTarget.alpha >= 0.75){
_arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, fadeInDot);
};
}
public static function fadeOutFastAndLight(_arg1:Event):void{
_arg1.currentTarget.alpha = (_arg1.currentTarget.alpha - 0.06);
if (_arg1.currentTarget.alpha <= 0){
_arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, fadeOutFastAndLight);
};
}
private static function createDamageEffectAt(_arg1:int, _arg2:int):void{
var _local3:Sprite;
_local3 = new MovieClip_Damage();
_local3.x = _arg1;
_local3.y = _arg2;
currentExplosions.push(_local3);
riverwar.effectsLayer.addChild(_local3);
}
private static function onComplete():void{
if (movingTimer != null){
movingTimer.removeEventListener(TimerEvent.TIMER, animateMove);
movingTimer = null;
} else {
if (attackTimer != null){
attackTimer.removeEventListener(TimerEvent.TIMER, animateMove);
attackTimer = null;
};
};
movingX_inc = 0;
movingY_inc = 0;
if (movingUnit != null){
HUDManager.updateUnitToMinimap(movingUnit);
movingUnit.stopFiring();
} else {
movingUnit = null;
};
movingTo = null;
movingFrom = null;
currentExplosions.splice(0, currentExplosions.length);
if (riverwar.activeUnit != null){
riverwar.activeUnit.unsetAsActiveUnit();
riverwar.activeUnit = null;
};
riverwar.cleareffectsLayer();
if (bunkerDestroyed){
showWinner(-1);
} else {
if (riverwar.redUnitList.length <= 1){
if (riverwar.player_red_isHuman){
showWinner(1);
} else {
showWinner(3);
};
} else {
if (riverwar.blueUnitList.length <= 1){
if (riverwar.player_red_isHuman){
showWinner(2);
} else {
showWinner(4);
};
} else {
riverwar.finishTurn();
};
};
};
}
public static function fadeInFastAndLight(_arg1:Event):void{
_arg1.currentTarget.alpha = (_arg1.currentTarget.alpha + 0.06);
if (_arg1.currentTarget.alpha >= 0.55){
_arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, fadeInFastAndLight);
};
}
private static function animateMove(_arg1:TimerEvent):void{
var _local2:Sprite;
var _local3:int;
var _local4:Sound;
if (currentExplosions.length > 0){
_local3 = (currentExplosions.length - 1);
while (_local3 >= 0) {
_local2 = Sprite(currentExplosions[_local3]);
_local2.scaleX = (_local2.scaleX + 0.5);
_local2.scaleY = (_local2.scaleY + 0.5);
_local2.alpha = (_local2.alpha - 0.1);
if (_local2.alpha <= 0){
currentExplosions.splice(_local3, 1);
};
_local3--;
};
if (movingUnit == null){
if (currentExplosions.length == 0){
onComplete();
};
} else {
if (!bunkerDestroyed){
if (currentExplosions.length == 0){
if (targetUnit.unitType == Obj_Unit.UNIT_TYPE_BUNKER){
if (numExplosionsForBunker < MAX_NUM_EXPLOSIONS_OF_BUNKER){
createDamageEffectAt(((targetUnit.getX() + (Math.random() * (targetUnit.image.width / 2))) - (Math.random() * (targetUnit.image.width / 2))), ((targetUnit.getY() + (Math.random() * (targetUnit.image.height / 2))) - (Math.random() * (targetUnit.image.height / 2))));
numExplosionsForBunker = (numExplosionsForBunker + 1);
} else {
createDamageEffectAt((targetUnit.getX() - 32), (targetUnit.getY() - 32));
createDamageEffectAt((targetUnit.getX() + 32), (targetUnit.getY() + 32));
createDamageEffectAt((targetUnit.getX() + 32), (targetUnit.getY() - 32));
createDamageEffectAt((targetUnit.getX() - 32), (targetUnit.getY() + 32));
riverwar.disposeUnit(targetUnit, false);
movingUnit.stopFiring();
targetUnit.square.turnToRubble();
bunkerDestroyed = true;
_local4 = new Sound_Explosion();
_local4.play();
};
};
};
};
};
};
if (movingUnit != null){
movingUnit.image.x = (movingUnit.image.x + movingX_inc);
movingUnit.image.y = (movingUnit.image.y + movingY_inc);
movingFrom.x = movingUnit.image.x;
movingFrom.y = movingUnit.image.y;
if (Point.distance(movingTo, movingFrom) <= MOVING_SNAPTO_DISTANCE){
movingUnit.image.x = movingTo.x;
movingUnit.image.y = movingTo.y;
onComplete();
};
};
}
private static function resolveAttack():void{
var _local1:Sound;
attackIsResolved = true;
if (attackResult == ATTACK_RESULT_DEFENDER_WIN){
createDamageEffectAt(movingUnit.getX(), movingUnit.getY());
if ((((movingUnit.sideColor == ComputerPlayer.SIDE_PLAYER_BLUE)) && (!(riverwar.player_red_isHuman)))){
riverwar.score = (riverwar.score - (movingUnit.attack * riverwar.SCORE_PENALTY_PER_UNIT_ATTACK_VALUE));
riverwar.score = Math.max(riverwar.score, 0);
HUDManager.updateScore();
};
riverwar.disposeUnit(movingUnit, false);
movingUnit = null;
targetUnit.stopFiring();
} else {
createDamageEffectAt(targetUnit.getX(), targetUnit.getY());
if ((((targetUnit.sideColor == ComputerPlayer.SIDE_PLAYER_BLUE)) && (!(riverwar.player_red_isHuman)))){
riverwar.score = (riverwar.score - (targetUnit.attack * riverwar.SCORE_PENALTY_PER_UNIT_ATTACK_VALUE));
riverwar.score = Math.max(riverwar.score, 0);
HUDManager.updateScore();
};
riverwar.disposeUnit(targetUnit, false);
movingUnit.stopFiring();
};
_local1 = new Sound_Explosion();
_local1.play();
}
private static function stretchInWinText(_arg1:Event):void{
var _local2:Bitmap;
if (_arg1.currentTarget.scaleX < 1){
_arg1.currentTarget.alpha = (_arg1.currentTarget.alpha + 0.05);
_arg1.currentTarget.scaleX = (_arg1.currentTarget.scaleX + 0.05);
} else {
_arg1.currentTarget.scaleX = 1;
_arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, stretchInWinText);
_local2 = new Bitmap(new Bitmap_SpaceToContinue(0, 0));
_local2.x = ((riverwar.VIEW_WIDTH - _local2.width) / 2);
_local2.y = ((_arg1.currentTarget.y + _arg1.currentTarget.height) + 10);
riverwar.menuLayer.addChild(_local2);
riverwar.waitingForSpacePressToMainMenu = true;
};
}
private static function playShooterSound(_arg1:int):void{
var _local2:Sound;
_local2 = null;
switch (_arg1){
case Obj_Unit.ATTACK_SOUND_TYPE_MACHINEGUN:
_local2 = new Sound_MachineGun();
_local2.play().soundTransform = new SoundTransform(0.25);
break;
case Obj_Unit.ATTACK_SOUND_TYPE_TANKSHOT:
_local2 = new Sound_Tankshot();
_local2.play();
break;
};
}
}
}//package
Section 2
//Bitmap_ActiveUnitHighlight_Enemy (Bitmap_ActiveUnitHighlight_Enemy)
package {
import flash.display.*;
public dynamic class Bitmap_ActiveUnitHighlight_Enemy extends BitmapData {
public function Bitmap_ActiveUnitHighlight_Enemy(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 3
//Bitmap_ActiveUnitHighlight_Friendly (Bitmap_ActiveUnitHighlight_Friendly)
package {
import flash.display.*;
public dynamic class Bitmap_ActiveUnitHighlight_Friendly extends BitmapData {
public function Bitmap_ActiveUnitHighlight_Friendly(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 4
//Bitmap_ActiveUnitIconHudBackground (Bitmap_ActiveUnitIconHudBackground)
package {
import flash.display.*;
public dynamic class Bitmap_ActiveUnitIconHudBackground extends BitmapData {
public function Bitmap_ActiveUnitIconHudBackground(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 5
//Bitmap_ActiveUnitInfoHudBackground (Bitmap_ActiveUnitInfoHudBackground)
package {
import flash.display.*;
public dynamic class Bitmap_ActiveUnitInfoHudBackground extends BitmapData {
public function Bitmap_ActiveUnitInfoHudBackground(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 6
//Bitmap_AttackDownLeftText (Bitmap_AttackDownLeftText)
package {
import flash.display.*;
public dynamic class Bitmap_AttackDownLeftText extends BitmapData {
public function Bitmap_AttackDownLeftText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 7
//Bitmap_AttackDownRightText (Bitmap_AttackDownRightText)
package {
import flash.display.*;
public dynamic class Bitmap_AttackDownRightText extends BitmapData {
public function Bitmap_AttackDownRightText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 8
//Bitmap_AttackUpLeftText (Bitmap_AttackUpLeftText)
package {
import flash.display.*;
public dynamic class Bitmap_AttackUpLeftText extends BitmapData {
public function Bitmap_AttackUpLeftText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 9
//Bitmap_AttackUpRightText (Bitmap_AttackUpRightText)
package {
import flash.display.*;
public dynamic class Bitmap_AttackUpRightText extends BitmapData {
public function Bitmap_AttackUpRightText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 10
//Bitmap_BackgroundDotColor (Bitmap_BackgroundDotColor)
package {
import flash.display.*;
public dynamic class Bitmap_BackgroundDotColor extends BitmapData {
public function Bitmap_BackgroundDotColor(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 11
//Bitmap_BlackDot (Bitmap_BlackDot)
package {
import flash.display.*;
public dynamic class Bitmap_BlackDot extends BitmapData {
public function Bitmap_BlackDot(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 12
//Bitmap_ComputerMovingFlash (Bitmap_ComputerMovingFlash)
package {
import flash.display.*;
public dynamic class Bitmap_ComputerMovingFlash extends BitmapData {
public function Bitmap_ComputerMovingFlash(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 13
//Bitmap_DestroyedSquare (Bitmap_DestroyedSquare)
package {
import flash.display.*;
public dynamic class Bitmap_DestroyedSquare extends BitmapData {
public function Bitmap_DestroyedSquare(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 14
//Bitmap_Error_Message (Bitmap_Error_Message)
package {
import flash.display.*;
public dynamic class Bitmap_Error_Message extends BitmapData {
public function Bitmap_Error_Message(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 15
//Bitmap_ForceOverviewBackground (Bitmap_ForceOverviewBackground)
package {
import flash.display.*;
public dynamic class Bitmap_ForceOverviewBackground extends BitmapData {
public function Bitmap_ForceOverviewBackground(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 16
//Bitmap_Highlighted_Mainmenu_Item (Bitmap_Highlighted_Mainmenu_Item)
package {
import flash.display.*;
public dynamic class Bitmap_Highlighted_Mainmenu_Item extends BitmapData {
public function Bitmap_Highlighted_Mainmenu_Item(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 17
//Bitmap_Highscore_Name_Error1 (Bitmap_Highscore_Name_Error1)
package {
import flash.display.*;
public dynamic class Bitmap_Highscore_Name_Error1 extends BitmapData {
public function Bitmap_Highscore_Name_Error1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 18
//Bitmap_Highscore_Name_Error2 (Bitmap_Highscore_Name_Error2)
package {
import flash.display.*;
public dynamic class Bitmap_Highscore_Name_Error2 extends BitmapData {
public function Bitmap_Highscore_Name_Error2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 19
//Bitmap_Hud (Bitmap_Hud)
package {
import flash.display.*;
public dynamic class Bitmap_Hud extends BitmapData {
public function Bitmap_Hud(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 20
//Bitmap_HudAlliedText (Bitmap_HudAlliedText)
package {
import flash.display.*;
public dynamic class Bitmap_HudAlliedText extends BitmapData {
public function Bitmap_HudAlliedText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 21
//Bitmap_HudEnemyText (Bitmap_HudEnemyText)
package {
import flash.display.*;
public dynamic class Bitmap_HudEnemyText extends BitmapData {
public function Bitmap_HudEnemyText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 22
//Bitmap_HudScoreText (Bitmap_HudScoreText)
package {
import flash.display.*;
public dynamic class Bitmap_HudScoreText extends BitmapData {
public function Bitmap_HudScoreText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 23
//Bitmap_HudSmall (Bitmap_HudSmall)
package {
import flash.display.*;
public dynamic class Bitmap_HudSmall extends BitmapData {
public function Bitmap_HudSmall(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 24
//Bitmap_Instructions1 (Bitmap_Instructions1)
package {
import flash.display.*;
public dynamic class Bitmap_Instructions1 extends BitmapData {
public function Bitmap_Instructions1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 25
//Bitmap_Instructions2 (Bitmap_Instructions2)
package {
import flash.display.*;
public dynamic class Bitmap_Instructions2 extends BitmapData {
public function Bitmap_Instructions2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 26
//Bitmap_Instructions3 (Bitmap_Instructions3)
package {
import flash.display.*;
public dynamic class Bitmap_Instructions3 extends BitmapData {
public function Bitmap_Instructions3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 27
//Bitmap_LoseEqualsText (Bitmap_LoseEqualsText)
package {
import flash.display.*;
public dynamic class Bitmap_LoseEqualsText extends BitmapData {
public function Bitmap_LoseEqualsText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 28
//Bitmap_Mainmenu_Background (Bitmap_Mainmenu_Background)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Background extends BitmapData {
public function Bitmap_Mainmenu_Background(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 29
//Bitmap_MainMenu_Header (Bitmap_MainMenu_Header)
package {
import flash.display.*;
public dynamic class Bitmap_MainMenu_Header extends BitmapData {
public function Bitmap_MainMenu_Header(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 30
//Bitmap_Mainmenu_Item_1Player (Bitmap_Mainmenu_Item_1Player)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_1Player extends BitmapData {
public function Bitmap_Mainmenu_Item_1Player(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 31
//Bitmap_Mainmenu_Item_2Player (Bitmap_Mainmenu_Item_2Player)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_2Player extends BitmapData {
public function Bitmap_Mainmenu_Item_2Player(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 32
//Bitmap_Mainmenu_Item_Back (Bitmap_Mainmenu_Item_Back)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_Back extends BitmapData {
public function Bitmap_Mainmenu_Item_Back(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 33
//Bitmap_Mainmenu_Item_Highscores (Bitmap_Mainmenu_Item_Highscores)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_Highscores extends BitmapData {
public function Bitmap_Mainmenu_Item_Highscores(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 34
//Bitmap_Mainmenu_Item_Homepage (Bitmap_Mainmenu_Item_Homepage)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_Homepage extends BitmapData {
public function Bitmap_Mainmenu_Item_Homepage(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 35
//Bitmap_Mainmenu_Item_Instructions (Bitmap_Mainmenu_Item_Instructions)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_Instructions extends BitmapData {
public function Bitmap_Mainmenu_Item_Instructions(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 36
//Bitmap_Mainmenu_Item_InstructionsTitle (Bitmap_Mainmenu_Item_InstructionsTitle)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_InstructionsTitle extends BitmapData {
public function Bitmap_Mainmenu_Item_InstructionsTitle(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 37
//Bitmap_Mainmenu_Item_Mainmenu (Bitmap_Mainmenu_Item_Mainmenu)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_Mainmenu extends BitmapData {
public function Bitmap_Mainmenu_Item_Mainmenu(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 38
//Bitmap_Mainmenu_Item_Next (Bitmap_Mainmenu_Item_Next)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_Next extends BitmapData {
public function Bitmap_Mainmenu_Item_Next(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 39
//Bitmap_Mainmenu_Item_Play (Bitmap_Mainmenu_Item_Play)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_Play extends BitmapData {
public function Bitmap_Mainmenu_Item_Play(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 40
//Bitmap_Mainmenu_Item_PlayTitle (Bitmap_Mainmenu_Item_PlayTitle)
package {
import flash.display.*;
public dynamic class Bitmap_Mainmenu_Item_PlayTitle extends BitmapData {
public function Bitmap_Mainmenu_Item_PlayTitle(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 41
//Bitmap_MinimapBackground (Bitmap_MinimapBackground)
package {
import flash.display.*;
public dynamic class Bitmap_MinimapBackground extends BitmapData {
public function Bitmap_MinimapBackground(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 42
//Bitmap_MinimapWindow (Bitmap_MinimapWindow)
package {
import flash.display.*;
public dynamic class Bitmap_MinimapWindow extends BitmapData {
public function Bitmap_MinimapWindow(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 43
//Bitmap_MoveDownLeftText (Bitmap_MoveDownLeftText)
package {
import flash.display.*;
public dynamic class Bitmap_MoveDownLeftText extends BitmapData {
public function Bitmap_MoveDownLeftText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 44
//Bitmap_MoveDownRightText (Bitmap_MoveDownRightText)
package {
import flash.display.*;
public dynamic class Bitmap_MoveDownRightText extends BitmapData {
public function Bitmap_MoveDownRightText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 45
//Bitmap_MoveUpLeftText (Bitmap_MoveUpLeftText)
package {
import flash.display.*;
public dynamic class Bitmap_MoveUpLeftText extends BitmapData {
public function Bitmap_MoveUpLeftText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 46
//Bitmap_MoveUpRightText (Bitmap_MoveUpRightText)
package {
import flash.display.*;
public dynamic class Bitmap_MoveUpRightText extends BitmapData {
public function Bitmap_MoveUpRightText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 47
//Bitmap_NoActiveUnitStats (Bitmap_NoActiveUnitStats)
package {
import flash.display.*;
public dynamic class Bitmap_NoActiveUnitStats extends BitmapData {
public function Bitmap_NoActiveUnitStats(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 48
//Bitmap_NoUnitSelectedHudIconText (Bitmap_NoUnitSelectedHudIconText)
package {
import flash.display.*;
public dynamic class Bitmap_NoUnitSelectedHudIconText extends BitmapData {
public function Bitmap_NoUnitSelectedHudIconText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 49
//Bitmap_Percentage_Green (Bitmap_Percentage_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage_Green extends BitmapData {
public function Bitmap_Percentage_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 50
//Bitmap_Percentage_Red (Bitmap_Percentage_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage_Red extends BitmapData {
public function Bitmap_Percentage_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 51
//Bitmap_Percentage0_Green (Bitmap_Percentage0_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage0_Green extends BitmapData {
public function Bitmap_Percentage0_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 52
//Bitmap_Percentage0_Red (Bitmap_Percentage0_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage0_Red extends BitmapData {
public function Bitmap_Percentage0_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 53
//Bitmap_Percentage1_Green (Bitmap_Percentage1_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage1_Green extends BitmapData {
public function Bitmap_Percentage1_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 54
//Bitmap_Percentage1_Red (Bitmap_Percentage1_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage1_Red extends BitmapData {
public function Bitmap_Percentage1_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 55
//Bitmap_Percentage2_Green (Bitmap_Percentage2_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage2_Green extends BitmapData {
public function Bitmap_Percentage2_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 56
//Bitmap_Percentage2_Red (Bitmap_Percentage2_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage2_Red extends BitmapData {
public function Bitmap_Percentage2_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 57
//Bitmap_Percentage3_Green (Bitmap_Percentage3_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage3_Green extends BitmapData {
public function Bitmap_Percentage3_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 58
//Bitmap_Percentage3_Red (Bitmap_Percentage3_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage3_Red extends BitmapData {
public function Bitmap_Percentage3_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 59
//Bitmap_Percentage4_Green (Bitmap_Percentage4_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage4_Green extends BitmapData {
public function Bitmap_Percentage4_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 60
//Bitmap_Percentage4_Red (Bitmap_Percentage4_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage4_Red extends BitmapData {
public function Bitmap_Percentage4_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 61
//Bitmap_Percentage5_Green (Bitmap_Percentage5_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage5_Green extends BitmapData {
public function Bitmap_Percentage5_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 62
//Bitmap_Percentage5_Red (Bitmap_Percentage5_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage5_Red extends BitmapData {
public function Bitmap_Percentage5_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 63
//Bitmap_Percentage6_Green (Bitmap_Percentage6_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage6_Green extends BitmapData {
public function Bitmap_Percentage6_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 64
//Bitmap_Percentage6_Red (Bitmap_Percentage6_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage6_Red extends BitmapData {
public function Bitmap_Percentage6_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 65
//Bitmap_Percentage7_Green (Bitmap_Percentage7_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage7_Green extends BitmapData {
public function Bitmap_Percentage7_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 66
//Bitmap_Percentage7_Red (Bitmap_Percentage7_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage7_Red extends BitmapData {
public function Bitmap_Percentage7_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 67
//Bitmap_Percentage8_Green (Bitmap_Percentage8_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage8_Green extends BitmapData {
public function Bitmap_Percentage8_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 68
//Bitmap_Percentage8_Red (Bitmap_Percentage8_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage8_Red extends BitmapData {
public function Bitmap_Percentage8_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 69
//Bitmap_Percentage9_Green (Bitmap_Percentage9_Green)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage9_Green extends BitmapData {
public function Bitmap_Percentage9_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 70
//Bitmap_Percentage9_Red (Bitmap_Percentage9_Red)
package {
import flash.display.*;
public dynamic class Bitmap_Percentage9_Red extends BitmapData {
public function Bitmap_Percentage9_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 71
//Bitmap_RandomTerrain1 (Bitmap_RandomTerrain1)
package {
import flash.display.*;
public dynamic class Bitmap_RandomTerrain1 extends BitmapData {
public function Bitmap_RandomTerrain1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 72
//Bitmap_RandomTerrain2 (Bitmap_RandomTerrain2)
package {
import flash.display.*;
public dynamic class Bitmap_RandomTerrain2 extends BitmapData {
public function Bitmap_RandomTerrain2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 73
//Bitmap_RandomTerrain3 (Bitmap_RandomTerrain3)
package {
import flash.display.*;
public dynamic class Bitmap_RandomTerrain3 extends BitmapData {
public function Bitmap_RandomTerrain3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 74
//Bitmap_RandomTerrain4 (Bitmap_RandomTerrain4)
package {
import flash.display.*;
public dynamic class Bitmap_RandomTerrain4 extends BitmapData {
public function Bitmap_RandomTerrain4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 75
//Bitmap_Score_Not_High_Enough_Message (Bitmap_Score_Not_High_Enough_Message)
package {
import flash.display.*;
public dynamic class Bitmap_Score_Not_High_Enough_Message extends BitmapData {
public function Bitmap_Score_Not_High_Enough_Message(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 76
//Bitmap_ScoreText_Num0 (Bitmap_ScoreText_Num0)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num0 extends BitmapData {
public function Bitmap_ScoreText_Num0(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 77
//Bitmap_ScoreText_Num1 (Bitmap_ScoreText_Num1)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num1 extends BitmapData {
public function Bitmap_ScoreText_Num1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 78
//Bitmap_ScoreText_Num2 (Bitmap_ScoreText_Num2)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num2 extends BitmapData {
public function Bitmap_ScoreText_Num2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 79
//Bitmap_ScoreText_Num3 (Bitmap_ScoreText_Num3)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num3 extends BitmapData {
public function Bitmap_ScoreText_Num3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 80
//Bitmap_ScoreText_Num4 (Bitmap_ScoreText_Num4)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num4 extends BitmapData {
public function Bitmap_ScoreText_Num4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 81
//Bitmap_ScoreText_Num5 (Bitmap_ScoreText_Num5)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num5 extends BitmapData {
public function Bitmap_ScoreText_Num5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 82
//Bitmap_ScoreText_Num6 (Bitmap_ScoreText_Num6)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num6 extends BitmapData {
public function Bitmap_ScoreText_Num6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 83
//Bitmap_ScoreText_Num7 (Bitmap_ScoreText_Num7)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num7 extends BitmapData {
public function Bitmap_ScoreText_Num7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 84
//Bitmap_ScoreText_Num8 (Bitmap_ScoreText_Num8)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num8 extends BitmapData {
public function Bitmap_ScoreText_Num8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 85
//Bitmap_ScoreText_Num9 (Bitmap_ScoreText_Num9)
package {
import flash.display.*;
public dynamic class Bitmap_ScoreText_Num9 extends BitmapData {
public function Bitmap_ScoreText_Num9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 86
//Bitmap_SpaceToContinue (Bitmap_SpaceToContinue)
package {
import flash.display.*;
public dynamic class Bitmap_SpaceToContinue extends BitmapData {
public function Bitmap_SpaceToContinue(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 87
//Bitmap_SpecialAbilityText_Unit0 (Bitmap_SpecialAbilityText_Unit0)
package {
import flash.display.*;
public dynamic class Bitmap_SpecialAbilityText_Unit0 extends BitmapData {
public function Bitmap_SpecialAbilityText_Unit0(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 88
//Bitmap_SpecialAbilityText_Unit1 (Bitmap_SpecialAbilityText_Unit1)
package {
import flash.display.*;
public dynamic class Bitmap_SpecialAbilityText_Unit1 extends BitmapData {
public function Bitmap_SpecialAbilityText_Unit1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 89
//Bitmap_SpecialAbilityText_Unit3 (Bitmap_SpecialAbilityText_Unit3)
package {
import flash.display.*;
public dynamic class Bitmap_SpecialAbilityText_Unit3 extends BitmapData {
public function Bitmap_SpecialAbilityText_Unit3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 90
//Bitmap_SpecialAbilityText_Unit4 (Bitmap_SpecialAbilityText_Unit4)
package {
import flash.display.*;
public dynamic class Bitmap_SpecialAbilityText_Unit4 extends BitmapData {
public function Bitmap_SpecialAbilityText_Unit4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 91
//Bitmap_StrengthIcon_Green (Bitmap_StrengthIcon_Green)
package {
import flash.display.*;
public dynamic class Bitmap_StrengthIcon_Green extends BitmapData {
public function Bitmap_StrengthIcon_Green(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 92
//Bitmap_StrengthIcon_Red (Bitmap_StrengthIcon_Red)
package {
import flash.display.*;
public dynamic class Bitmap_StrengthIcon_Red extends BitmapData {
public function Bitmap_StrengthIcon_Red(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 93
//Bitmap_Submitting_Message (Bitmap_Submitting_Message)
package {
import flash.display.*;
public dynamic class Bitmap_Submitting_Message extends BitmapData {
public function Bitmap_Submitting_Message(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 94
//Bitmap_Success_Score_Message (Bitmap_Success_Score_Message)
package {
import flash.display.*;
public dynamic class Bitmap_Success_Score_Message extends BitmapData {
public function Bitmap_Success_Score_Message(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 95
//Bitmap_Title_Mainmenu_Item (Bitmap_Title_Mainmenu_Item)
package {
import flash.display.*;
public dynamic class Bitmap_Title_Mainmenu_Item extends BitmapData {
public function Bitmap_Title_Mainmenu_Item(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 96
//Bitmap_Unhighlighted_Mainmenu_Item (Bitmap_Unhighlighted_Mainmenu_Item)
package {
import flash.display.*;
public dynamic class Bitmap_Unhighlighted_Mainmenu_Item extends BitmapData {
public function Bitmap_Unhighlighted_Mainmenu_Item(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 97
//Bitmap_Unit0_HudUnitName (Bitmap_Unit0_HudUnitName)
package {
import flash.display.*;
public dynamic class Bitmap_Unit0_HudUnitName extends BitmapData {
public function Bitmap_Unit0_HudUnitName(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 98
//Bitmap_Unit1_HudUnitName (Bitmap_Unit1_HudUnitName)
package {
import flash.display.*;
public dynamic class Bitmap_Unit1_HudUnitName extends BitmapData {
public function Bitmap_Unit1_HudUnitName(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 99
//Bitmap_Unit2_HudUnitName (Bitmap_Unit2_HudUnitName)
package {
import flash.display.*;
public dynamic class Bitmap_Unit2_HudUnitName extends BitmapData {
public function Bitmap_Unit2_HudUnitName(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 100
//Bitmap_Unit3_HudUnitName (Bitmap_Unit3_HudUnitName)
package {
import flash.display.*;
public dynamic class Bitmap_Unit3_HudUnitName extends BitmapData {
public function Bitmap_Unit3_HudUnitName(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 101
//Bitmap_Unit4_HudUnitName (Bitmap_Unit4_HudUnitName)
package {
import flash.display.*;
public dynamic class Bitmap_Unit4_HudUnitName extends BitmapData {
public function Bitmap_Unit4_HudUnitName(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 102
//Bitmap_Unit6_HudUnitName (Bitmap_Unit6_HudUnitName)
package {
import flash.display.*;
public dynamic class Bitmap_Unit6_HudUnitName extends BitmapData {
public function Bitmap_Unit6_HudUnitName(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 103
//Bitmap_Unit7_HudUnitName (Bitmap_Unit7_HudUnitName)
package {
import flash.display.*;
public dynamic class Bitmap_Unit7_HudUnitName extends BitmapData {
public function Bitmap_Unit7_HudUnitName(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 104
//Bitmap_WinEqualsText (Bitmap_WinEqualsText)
package {
import flash.display.*;
public dynamic class Bitmap_WinEqualsText extends BitmapData {
public function Bitmap_WinEqualsText(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 105
//Bitmap_YourNameIs (Bitmap_YourNameIs)
package {
import flash.display.*;
public dynamic class Bitmap_YourNameIs extends BitmapData {
public function Bitmap_YourNameIs(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 106
//Bitmap_YourScoreIs (Bitmap_YourScoreIs)
package {
import flash.display.*;
public dynamic class Bitmap_YourScoreIs extends BitmapData {
public function Bitmap_YourScoreIs(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 107
//ComputerPlayer (ComputerPlayer)
package {
import flash.events.*;
import flash.utils.*;
public class ComputerPlayer {
public static const SIDE_PLAYER_BLUE:int = 0;
public static const SCROLL_TIME_DELAY:int = 400;
public static const SIDE_PLAYER_RED:int = 1;
public static const ACTION_VIEW_BORDER:int = 125;
private static var aiDefenseMode:Boolean;
public static var actionYDistFromScreenOrigin:int;
private static var aiAutoKillMode:Boolean;
public static var actionXDistFromScreenOrigin:int;
private static var b:Number;
private static var d:Number;
private static var e:Number;
public static var squareFrom:Obj_Square;
private static var a:Number;
public static var actionX:int = 0;
public static var actionY:int = 0;
public static var scrollVerticallyFirst:Boolean;
private static var c:Number;
public static var squareTo:Obj_Square;
public static var scrollTimer:Timer;
private static function needToScrollRight():Boolean{
return ((actionXDistFromScreenOrigin >= (riverwar.VIEW_WIDTH - ACTION_VIEW_BORDER)));
}
private static function needToScrollLeft():Boolean{
return ((actionXDistFromScreenOrigin <= ACTION_VIEW_BORDER));
}
public static function disposeResources():void{
if (scrollTimer != null){
scrollTimer.removeEventListener(TimerEvent.TIMER, scrollToAction);
scrollTimer = null;
};
squareTo = null;
squareFrom = null;
}
private static function distanceToPoint(_arg1:Obj_Unit, _arg2:int, _arg3:int):Number{
return (distanceToPoint2(_arg1.getXIndex(), _arg1.getYIndex(), _arg2, _arg3));
}
private static function getScoreForSpecificMove(_arg1:Obj_Unit, _arg2:int, _arg3:int):Number{
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:Obj_Square;
var _local8:Number;
var _local9:Obj_Unit;
var _local10:Obj_Unit;
var _local11:Number;
var _local12:Number;
var _local13:int;
var _local14:Number;
var _local15:Obj_Unit;
_local4 = int.MIN_VALUE;
_local5 = (_arg1.getXIndex() + _arg2);
_local6 = (_arg1.getYIndex() + _arg3);
if ((((_local5 < 0)) || ((_local6 < 0)))){
return (_local4);
};
if (_local5 >= MapBuilderHelper.NUM_SQUARES_WIDTH){
return (_local4);
};
if (_local6 >= MapBuilderHelper.NUM_SQUARES_HEIGHT){
return (_local4);
};
_local7 = riverwar.squareAt[_local5][_local6];
if (_local7.unit != null){
if (_local7.unit.sideColor == _arg1.sideColor){
return (_local4);
};
};
if (_local7.isWaterTerrain()){
if (((!((_arg1.unitType == Obj_Unit.UNIT_TYPE_SKIMMER))) && (!((_arg1.unitType == Obj_Unit.UNIT_TYPE_COPTER))))){
return (_local4);
};
};
_local8 = distanceToPoint2(_local5, _local6, 0, 6);
_local11 = int.MAX_VALUE;
_local12 = int.MAX_VALUE;
_local13 = (riverwar.blueUnitList.length - 1);
while (_local13 >= 1) {
if (distanceToPoint(riverwar.blueUnitList[_local13], _local5, _local6) < _local11){
_local9 = riverwar.blueUnitList[_local13];
_local11 = distanceToPoint(riverwar.blueUnitList[_local13], _local5, _local6);
};
if (distanceToPoint(riverwar.blueUnitList[_local13], 0, 6) < _local12){
_local10 = riverwar.blueUnitList[_local13];
_local12 = distanceToPoint(riverwar.blueUnitList[_local13], 0, 6);
};
_local13--;
};
if ((((_local5 == 8)) && ((_local6 == 7)))){
return (int.MAX_VALUE);
};
if (_local8 > _local12){
return (-(distanceToPoint(_local10, _local5, _local6)));
};
a = (distanceToPoint(_local9, _local5, _local6) * -2);
_local4 = a;
b = ((riverwar.getWinningPercentage(_arg1, _local9) / 100) * 8);
_local4 = (_local4 + b);
_local14 = distanceToPoint2(_local5, _local6, 8, 7);
c = (_local14 * -5);
_local4 = (_local4 + c);
c = (c / -5);
_local4 = (_local4 + _arg1.attack);
_local11 = int.MAX_VALUE;
_local13 = (riverwar.redUnitList.length - 1);
while (_local13 >= 1) {
if (riverwar.redUnitList[_local13] == _arg1){
} else {
if (distanceToPoint(riverwar.redUnitList[_local13], _local5, _local6) < _local11){
_local15 = riverwar.redUnitList[_local13];
_local11 = distanceToPoint(riverwar.redUnitList[_local13], _local5, _local6);
};
};
_local13--;
};
if (aiAutoKillMode){
return ((distanceToPoint(_local10, _local5, _local6) * -1));
};
if (aiDefenseMode){
d = (distanceToPoint(_local10, _local5, _local6) * -5);
_local4 = (_local4 + d);
} else {
d = (distanceToPoint(_local10, _local5, _local6) * -1);
_local4 = (_local4 + d);
};
if ((((((_local9 == _local10)) && ((_local9.getXIndex() == _local5)))) && ((_local9.getYIndex() == _local6)))){
return ((int.MAX_VALUE - 1));
};
if (((((_local10.getXIndex() + 1) == _local5)) || (((_local10.getXIndex() - 1) == _local5)))){
if (((((_local10.getYIndex() + 1) == _local6)) || (((_local10.getYIndex() - 1) == _local6)))){
_local4 = (_local4 + 50);
};
};
if (!aiDefenseMode){
_local4 = (_local4 + (Math.random() * 10));
};
return (_local4);
}
private static function distanceToPoint2(_arg1:int, _arg2:int, _arg3:int, _arg4:int):Number{
return (Math.sqrt((Math.pow(Math.abs((_arg1 - _arg3)), 2) + Math.pow(Math.abs((_arg2 - _arg4)), 2))));
}
private static function needToScrollDown():Boolean{
return ((actionYDistFromScreenOrigin >= (riverwar.VIEW_HEIGHT - ACTION_VIEW_BORDER)));
}
private static function needToScrollUp():Boolean{
return ((actionYDistFromScreenOrigin <= ACTION_VIEW_BORDER));
}
private static function getBestMoveForUnit(_arg1:Obj_Unit):Object{
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:int;
var _local6:Object;
_local2 = int.MIN_VALUE;
_local3 = int.MIN_VALUE;
_local3 = getScoreForSpecificMove(_arg1, -1, 0);
if (_local3 > _local2){
_local2 = _local3;
_local4 = -1;
_local5 = 0;
};
_local3 = getScoreForSpecificMove(_arg1, 1, 0);
if (_local3 > _local2){
_local2 = _local3;
_local4 = 1;
_local5 = 0;
};
_local3 = getScoreForSpecificMove(_arg1, 0, -1);
if (_local3 > _local2){
_local2 = _local3;
_local4 = 0;
_local5 = -1;
};
_local3 = getScoreForSpecificMove(_arg1, 0, 1);
if (_local3 > _local2){
_local2 = _local3;
_local4 = 0;
_local5 = 1;
};
_local6 = new Object();
_local6.score = _local2;
_local6.xinc = _local4;
_local6.yinc = _local5;
return (_local6);
}
public static function performMove(_arg1:int):void{
var _local2:Obj_Square;
var _local3:Obj_Unit;
var _local4:Number;
var _local5:Number;
var _local6:Obj_Unit;
var _local7:int;
var _local8:int;
var _local9:Object;
var _local10:Number;
var _local11:Number;
var _local12:int;
var _local13:Number;
var _local14:Number;
var _local15:int;
var _local16:int;
var _local17:*;
var _local18:*;
if ((((riverwar.redUnitList.length <= 1)) || ((riverwar.blueUnitList.length <= 1)))){
return;
};
_local4 = int.MIN_VALUE;
_local10 = int.MAX_VALUE;
_local11 = int.MAX_VALUE;
_local12 = (riverwar.redUnitList.length - 1);
while (_local12 >= 1) {
_local3 = riverwar.redUnitList[_local12];
_local10 = Math.min(_local10, distanceToPoint(_local3, 0, 6));
_local11 = Math.min(_local11, distanceToPoint(_local3, 8, 7));
_local12--;
};
_local13 = int.MAX_VALUE;
_local14 = int.MAX_VALUE;
_local12 = (riverwar.blueUnitList.length - 1);
while (_local12 >= 1) {
_local3 = riverwar.blueUnitList[_local12];
_local13 = Math.min(_local13, distanceToPoint(_local3, 0, 6));
_local14 = Math.min(_local14, distanceToPoint(_local3, 8, 7));
_local12--;
};
if (_local10 >= _local13){
aiDefenseMode = true;
} else {
aiDefenseMode = false;
};
if (_local11 < _local14){
aiAutoKillMode = true;
} else {
aiAutoKillMode = false;
};
_local12 = (riverwar.redUnitList.length - 1);
while (_local12 >= 1) {
_local3 = riverwar.redUnitList[_local12];
_local9 = getBestMoveForUnit(_local3);
_local5 = _local9.score;
if (_local5 > _local4){
_local4 = _local5;
_local6 = _local3;
_local7 = _local9.xinc;
_local8 = _local9.yinc;
};
_local12--;
};
squareFrom = riverwar.squareAt[_local6.getXIndex()][_local6.getYIndex()];
squareTo = riverwar.squareAt[(_local6.getXIndex() + _local7)][(_local6.getYIndex() + _local8)];
_local15 = Math.min(squareFrom.getX(), squareTo.getX());
_local16 = Math.min(squareFrom.getY(), squareTo.getY());
actionX = (_local15 + Math.abs(((squareFrom.getX() - squareTo.getX()) / 2)));
actionY = (_local16 + Math.abs(((squareFrom.getY() - squareTo.getY()) / 2)));
_local17 = (actionX - riverwar.getGameLayerX());
_local18 = (actionY - riverwar.getGameLayerY());
if (_local17 > _local18){
scrollVerticallyFirst = false;
} else {
scrollVerticallyFirst = true;
};
scrollTimer = new Timer(SCROLL_TIME_DELAY, 0);
scrollTimer.addEventListener(TimerEvent.TIMER, scrollToAction);
scrollTimer.start();
}
private static function executeMove():void{
AnimateHelper.moveUnitToSquare(squareFrom, squareTo);
disposeResources();
}
private static function scrollToAction(_arg1:TimerEvent):void{
var _local2:Boolean;
var _local3:int;
actionXDistFromScreenOrigin = (actionX - riverwar.getGameLayerX());
actionYDistFromScreenOrigin = (actionY - riverwar.getGameLayerY());
_local2 = false;
_local3 = 0;
if (scrollVerticallyFirst){
if (((needToScrollUp()) && (KeyboardManager.canScrollUp()))){
_local3 = KeyboardManager.KEY_UP;
} else {
if (((needToScrollDown()) && (KeyboardManager.canScrollDown()))){
_local3 = KeyboardManager.KEY_DOWN;
} else {
scrollVerticallyFirst = false;
if (((needToScrollLeft()) && (KeyboardManager.canScrollLeft()))){
_local3 = KeyboardManager.KEY_LEFT;
} else {
if (((needToScrollRight()) && (KeyboardManager.canScrollRight()))){
_local3 = KeyboardManager.KEY_RIGHT;
} else {
_local2 = true;
};
};
};
};
};
if (_local2){
executeMove();
return;
};
if (_local3 != 0){
KeyboardManager.resolveKeyPress(_local3, false);
return;
};
if (!scrollVerticallyFirst){
if (((needToScrollLeft()) && (KeyboardManager.canScrollLeft()))){
_local3 = KeyboardManager.KEY_LEFT;
} else {
if (((needToScrollRight()) && (KeyboardManager.canScrollRight()))){
_local3 = KeyboardManager.KEY_RIGHT;
} else {
scrollVerticallyFirst = true;
if (((needToScrollUp()) && (KeyboardManager.canScrollUp()))){
_local3 = KeyboardManager.KEY_UP;
} else {
if (((needToScrollDown()) && (KeyboardManager.canScrollDown()))){
_local3 = KeyboardManager.KEY_DOWN;
} else {
_local2 = true;
};
};
};
};
};
if (_local2){
executeMove();
return;
};
if (_local3 != 0){
KeyboardManager.resolveKeyPress(_local3, false);
return;
};
}
}
}//package
Section 108
//HighscoreSubmitManager (HighscoreSubmitManager)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class HighscoreSubmitManager {
private static const STRING_HIGHSCORE_RESULT_FAILURE:String = "0";
public static const MAX_NICKNAME_LENGTH:int = 12;
public static const STRING_HIGHSCORE_SUBMIT_URL:String = "http://battlephase.com/riverwar/riverwar_sendhighscore.php";
private static const STRING_HIGHSCORE_RESULT_SUCCESS:String = "1";
private static var usernameField:TextField;
private static var mainMenu:MovieClip_MainMenuButton;
public static var acceptingInput:Boolean;
private static var submit:MovieClip_SubmitScoreButton;
private static var addedCommaError:Boolean;
private static var finishedNetworkRequest:Boolean;
private static var addedNonEmptyStringError:Boolean;
public static function arrowKeyUpDown():void{
if (!acceptingInput){
return;
};
if (finishedNetworkRequest){
return;
};
if (submit.currentFrame == 1){
submit.gotoAndStop(2);
mainMenu.gotoAndStop(1);
} else {
submit.gotoAndStop(1);
mainMenu.gotoAndStop(2);
};
}
private static function catchHighscoreSubmitError(_arg1:IOErrorEvent):void{
postRequestComplete(null);
}
private static function dispose():void{
addedNonEmptyStringError = false;
addedCommaError = false;
acceptingInput = false;
finishedNetworkRequest = false;
submit = null;
mainMenu = null;
usernameField = null;
}
private static function postRequestComplete(_arg1:Event):void{
var _local2:URLLoader;
var _local3:URLVariables;
var _local4:String;
var _local5:Bitmap;
var _local6:Bitmap;
riverwar.menuLayer.removeChildAt((riverwar.menuLayer.numChildren - 1));
if (_arg1 != null){
_local2 = URLLoader(_arg1.target);
_local3 = new URLVariables(_local2.data);
_local4 = _local3.gameresult;
if (_local4 == STRING_HIGHSCORE_RESULT_SUCCESS){
_local5 = new Bitmap(new Bitmap_Success_Score_Message(0, 0));
} else {
_local5 = new Bitmap(new Bitmap_Score_Not_High_Enough_Message(0, 0));
};
_local5.x = ((riverwar.VIEW_WIDTH - _local5.width) / 2);
_local5.y = (usernameField.y + 50);
riverwar.menuLayer.addChild(_local5);
} else {
_local6 = new Bitmap(new Bitmap_Error_Message(0, 0));
_local6.x = ((riverwar.VIEW_WIDTH - _local6.width) / 2);
_local6.y = (usernameField.y + 50);
riverwar.menuLayer.addChild(_local6);
};
submit.gotoAndStop(1);
mainMenu.gotoAndStop(2);
riverwar.menuLayer.addChild(mainMenu);
finishedNetworkRequest = true;
acceptingInput = true;
}
public static function enterKeyDown():void{
var username:String;
var errorBitmap:Bitmap;
var submitMessage:Bitmap;
var currentTime:Date;
var hourString:String;
var minuteString:String;
var variables:URLVariables;
var request:URLRequest;
var loader:URLLoader;
if (!acceptingInput){
return;
};
if (mainMenu.currentFrame == 2){
dispose();
riverwar.quitToMainMenu();
} else {
if (submit.currentFrame == 2){
username = trim(usernameField.text);
if (username == ""){
if (!addedNonEmptyStringError){
addedNonEmptyStringError = true;
errorBitmap = new Bitmap(new Bitmap_Highscore_Name_Error1(0, 0));
errorBitmap.x = ((usernameField.x + usernameField.width) + 10);
errorBitmap.y = (usernameField.y - 10);
riverwar.menuLayer.addChild(errorBitmap);
};
} else {
if (username.indexOf(",") != -1){
if (!addedCommaError){
addedCommaError = true;
errorBitmap = new Bitmap(new Bitmap_Highscore_Name_Error2(0, 0));
errorBitmap.x = ((usernameField.x + usernameField.width) + 10);
errorBitmap.y = (usernameField.y + 20);
riverwar.menuLayer.addChild(errorBitmap);
};
} else {
acceptingInput = false;
riverwar.menuLayer.removeChild(submit);
riverwar.menuLayer.removeChild(mainMenu);
usernameField.selectable = false;
usernameField.type = TextFieldType.DYNAMIC;
submitMessage = new Bitmap(new Bitmap_Submitting_Message(0, 0));
submitMessage.x = ((riverwar.VIEW_WIDTH - submitMessage.width) / 2);
submitMessage.y = (usernameField.y + 50);
riverwar.menuLayer.addChild(submitMessage);
currentTime = new Date();
hourString = (currentTime.hours + 100).toString().substr(1, 2);
minuteString = (currentTime.minutes + 100).toString().substr(1, 2);
variables = new URLVariables();
variables.nick = username;
variables.score = (riverwar.score + "");
variables.when = ((((hourString + " : ") + minuteString) + " ") + currentTime.toDateString());
try {
request = new URLRequest(STRING_HIGHSCORE_SUBMIT_URL);
request.data = variables;
request.method = URLRequestMethod.POST;
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, postRequestComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, catchHighscoreSubmitError);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, catchHighscoreSubmitError);
loader.load(request);
} catch(error:Error) {
postRequestComplete(null);
};
};
};
};
};
}
public static function setupScoreSubmitInfo(_arg1:int):void{
var _local2:int;
var _local3:Bitmap;
var _local4:TextField;
var _local5:TextFormat;
var _local6:TextField;
var _local7:Bitmap;
addedNonEmptyStringError = false;
addedCommaError = false;
_local2 = 10;
_local3 = new Bitmap(new Bitmap_YourScoreIs(0, 0));
_local3.y = _arg1;
_local3.x = ((riverwar.VIEW_WIDTH - _local3.width) / 2);
riverwar.menuLayer.addChild(_local3);
_arg1 = (_arg1 + (_local3.height + _local2));
_local4 = new TextField();
_local4.mouseEnabled = false;
_local4.width = 340;
_local4.height = 50;
_local4.border = true;
_local4.borderColor = 0xFFFFFF;
_local4.y = _arg1;
_local4.x = ((riverwar.VIEW_WIDTH - _local4.width) / 2);
riverwar.menuLayer.addChild(_local4);
_local5 = new TextFormat();
_local5.align = "center";
_local5.font = "Arial";
_local5.color = 0xFFFFFF;
_local5.size = 14;
_local6 = new TextField();
_local6.defaultTextFormat = _local5;
_local6.text = (riverwar.score + "");
_local6.width = _local4.width;
_local6.height = _local4.height;
_local6.x = _local4.x;
_local6.y = ((_local4.y + (_local4.height / 2)) - (_local6.textHeight / 2));
riverwar.menuLayer.addChild(_local6);
_arg1 = (_arg1 + (_local4.height + _local2));
_local7 = new Bitmap(new Bitmap_YourNameIs(0, 0));
_local7.y = _arg1;
_local7.x = ((riverwar.VIEW_WIDTH - _local7.width) / 2);
riverwar.menuLayer.addChild(_local7);
_arg1 = (_arg1 + (_local7.height + _local2));
_local4 = new TextField();
_local4.mouseEnabled = false;
_local4.width = 340;
_local4.height = 50;
_local4.border = true;
_local4.borderColor = 0xFFFFFF;
_local4.y = _arg1;
_local4.x = ((riverwar.VIEW_WIDTH - _local4.width) / 2);
riverwar.menuLayer.addChild(_local4);
_arg1 = (_arg1 + (_local4.height + _local2));
usernameField = new TextField();
usernameField.type = TextFieldType.INPUT;
usernameField.width = _local4.width;
usernameField.height = _local4.height;
usernameField.defaultTextFormat = _local5;
usernameField.x = _local4.x;
usernameField.y = ((_local4.y + (_local4.height / 2)) - (_local6.textHeight / 2));
usernameField.maxChars = MAX_NICKNAME_LENGTH;
riverwar.menuLayer.addChild(usernameField);
riverwar.stageRef.focus = usernameField;
submit = new MovieClip_SubmitScoreButton();
submit.x = ((riverwar.VIEW_WIDTH - submit.width) / 2);
submit.y = _arg1;
submit.gotoAndStop(2);
riverwar.menuLayer.addChild(submit);
_arg1 = (_arg1 + (submit.height + 50));
mainMenu = new MovieClip_MainMenuButton();
mainMenu.x = ((riverwar.VIEW_WIDTH - mainMenu.width) / 2);
mainMenu.y = _arg1;
mainMenu.gotoAndStop(1);
riverwar.menuLayer.addChild(mainMenu);
acceptingInput = true;
}
public static function trim(_arg1:String):String{
while (_arg1.charAt(0) == " ") {
_arg1 = _arg1.substring(1, _arg1.length);
};
while (_arg1.charAt((_arg1.length - 1)) == " ") {
_arg1 = _arg1.substring(0, (_arg1.length - 1));
};
return (_arg1);
}
}
}//package
Section 109
//HUDManager (HUDManager)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class HUDManager {
public static const SCORETEXT_BACKGROUND_RED_FLASH_DELAY:int = 400;
public static var whoseTurnIcon:MovieClip_WhoseTurnIcon;
public static var activeUnitLayer:Sprite;
public static var currentForceOverviewPlayer:int = -1;
public static var layer:Sprite;
private static var minimapX:int;
private static var forceOverviewX:int;
private static var forceOverviewY:int;
public static var destroyedUnitForceOverviewIcons:Array;
private static var minimapY:int;
private static var flashingComputerMoveTextFlashingOut:Boolean;
private static var startingMinimapWindowX:int;
private static var startingMinimapWindowY:int;
public static var scoreTextLayer:Sprite;
public static var forceOverviewLayer:Sprite;
private static var flashingComputerMoveText:Bitmap;
public static var minimapWindow:Bitmap;
private static function addForceOverviewIcon(_arg1:MovieClip, _arg2:MovieClip_UnitForceNumberIcon, _arg3:int):void{
_arg1.x = (forceOverviewX + ((_arg3 % 7) * (_arg1.width + 5)));
if (_arg3 > 6){
_arg1.y = (forceOverviewY + 27);
} else {
_arg1.y = forceOverviewY;
};
forceOverviewLayer.addChild(_arg1);
if (_arg1.currentFrame == Obj_Unit.FORCE_OVERVIEW_ICON_NORMAL){
_arg2.x = _arg1.x;
_arg2.y = (_arg1.y + 19);
forceOverviewLayer.addChild(_arg2);
};
}
public static function updateScore():void{
var _local1:String;
var _local2:Bitmap;
var _local3:int;
var _local4:int;
var _local5:Timer;
if (scoreTextLayer == null){
return;
};
while (scoreTextLayer.numChildren > 2) {
scoreTextLayer.removeChildAt(2);
};
_local1 = riverwar.score.toString();
_local3 = (425 + scoreTextLayer.getChildAt(1).width);
_local4 = 0;
while (_local4 < _local1.length) {
switch (_local1.charAt(_local4)){
case "0":
_local2 = new Bitmap(new Bitmap_ScoreText_Num0(0, 0));
break;
case "1":
_local2 = new Bitmap(new Bitmap_ScoreText_Num1(0, 0));
break;
case "2":
_local2 = new Bitmap(new Bitmap_ScoreText_Num2(0, 0));
break;
case "3":
_local2 = new Bitmap(new Bitmap_ScoreText_Num3(0, 0));
break;
case "4":
_local2 = new Bitmap(new Bitmap_ScoreText_Num4(0, 0));
break;
case "5":
_local2 = new Bitmap(new Bitmap_ScoreText_Num5(0, 0));
break;
case "6":
_local2 = new Bitmap(new Bitmap_ScoreText_Num6(0, 0));
break;
case "7":
_local2 = new Bitmap(new Bitmap_ScoreText_Num7(0, 0));
break;
case "8":
_local2 = new Bitmap(new Bitmap_ScoreText_Num8(0, 0));
break;
case "9":
_local2 = new Bitmap(new Bitmap_ScoreText_Num9(0, 0));
break;
};
_local2.x = _local3;
_local2.y = 14;
_local3 = (_local3 + _local2.width);
scoreTextLayer.addChild(_local2);
_local4++;
};
if (!riverwar.startingFirstTurn){
MovieClip(scoreTextLayer.getChildAt(0)).gotoAndStop(2);
_local5 = new Timer(SCORETEXT_BACKGROUND_RED_FLASH_DELAY, 1);
_local5.addEventListener(TimerEvent.TIMER_COMPLETE, turnScoreTextBackgroundBackToWhite);
_local5.start();
};
scoreTextLayer.getChildAt(0).scaleX = (_local3 - 425);
}
public static function setupForceOverviewLayer(_arg1:int):void{
var _local2:Array;
var _local3:int;
if (_arg1 == currentForceOverviewPlayer){
return;
};
currentForceOverviewPlayer = _arg1;
clearForceOverviewLayer();
if (_arg1 == riverwar.TURN_PLAYER_BLUE){
_local2 = riverwar.blueUnitList;
} else {
_local2 = riverwar.redUnitList;
};
_local3 = (_local2.length - 1);
while (_local3 >= 0) {
updateUnitToArmyOverview(_local2[_local3]);
_local3--;
};
_local3 = (destroyedUnitForceOverviewIcons.length - 1);
while (_local3 >= 0) {
if (destroyedUnitForceOverviewIcons[_local3].sideColor != _arg1){
} else {
addForceOverviewIcon(destroyedUnitForceOverviewIcons[_local3].icon, null, destroyedUnitForceOverviewIcons[_local3].unitNumber);
};
_local3--;
};
}
public static function removeMinimapDot(_arg1:Obj_Unit):void{
if (((!((layer == null))) && (layer.contains(_arg1.minimapDot)))){
layer.removeChild(_arg1.minimapDot);
};
_arg1.minimapDot = null;
}
public static function initialize():void{
var _local1:Bitmap;
var _local2:Bitmap;
var _local3:Bitmap;
var _local4:Bitmap;
var _local5:Bitmap;
var _local6:MovieClip_HudScoreTextBackground;
var _local7:Bitmap;
layer = new Sprite();
layer.alpha = 0;
_local1 = new Bitmap(new Bitmap_Hud(0, 0));
_local1.x = ((riverwar.VIEW_WIDTH - _local1.width) / 2);
_local1.y = ((riverwar.VIEW_HEIGHT - _local1.height) - 2);
layer.addChild(_local1);
_local2 = new Bitmap(new Bitmap_MinimapBackground(0, 0));
_local2.x = (((_local1.x + _local1.width) - _local2.width) - 8);
_local2.y = (((_local1.y + _local1.height) - _local2.height) - 6);
minimapX = (_local2.x + 3);
minimapY = _local2.y;
layer.addChild(_local2);
_local3 = new Bitmap(new Bitmap_ForceOverviewBackground(0, 0));
_local3.x = (_local1.x + 280);
_local3.y = minimapY;
forceOverviewX = (_local3.x + 9);
forceOverviewY = (_local3.y + 4);
layer.addChild(_local3);
_local4 = new Bitmap(new Bitmap_ActiveUnitIconHudBackground(0, 0));
_local4.x = (_local1.x + 8);
_local4.y = minimapY;
layer.addChild(_local4);
_local5 = new Bitmap(new Bitmap_ActiveUnitInfoHudBackground(0, 0));
_local5.x = ((_local4.x + _local4.width) + 6);
_local5.y = minimapY;
layer.addChild(_local5);
activeUnitLayer = new Sprite();
layer.addChild(activeUnitLayer);
_local1 = new Bitmap(new Bitmap_HudSmall(0, 0));
_local1.x = ((riverwar.VIEW_WIDTH - _local1.width) / 2);
_local1.y = 2;
layer.addChild(_local1);
if (!riverwar.player_red_isHuman){
scoreTextLayer = new Sprite();
layer.addChild(scoreTextLayer);
_local6 = new MovieClip_HudScoreTextBackground();
_local6.x = 425;
_local6.y = (_local1.y + 12);
_local6.gotoAndStop(1);
scoreTextLayer.addChild(_local6);
_local7 = new Bitmap(new Bitmap_HudScoreText(0, 0));
_local7.x = 425;
_local7.y = (_local1.y + 12);
scoreTextLayer.addChild(_local7);
_local6.scaleX = _local7.width;
_local6.scaleY = _local7.height;
};
whoseTurnIcon = new MovieClip_WhoseTurnIcon();
whoseTurnIcon.x = (((_local1.x + _local1.width) - whoseTurnIcon.width) - 9);
whoseTurnIcon.y = (_local1.y + 8);
whoseTurnIcon.gotoAndStop((riverwar.currentTurn + 1));
layer.addChild(whoseTurnIcon);
minimapWindow = new Bitmap(new Bitmap_MinimapWindow(0, 0));
startingMinimapWindowX = (minimapX + 1);
startingMinimapWindowY = (minimapY + 3);
minimapWindow.x = startingMinimapWindowX;
minimapWindow.y = startingMinimapWindowY;
layer.addChild(minimapWindow);
forceOverviewLayer = new Sprite();
layer.addChild(forceOverviewLayer);
destroyedUnitForceOverviewIcons = new Array();
}
public static function clearForceOverviewLayer():void{
while (forceOverviewLayer.numChildren > 0) {
forceOverviewLayer.removeChildAt(0);
};
}
public static function dispose():void{
while (layer.numChildren > 0) {
layer.removeChildAt(0);
};
while (activeUnitLayer.numChildren > 0) {
activeUnitLayer.removeChildAt(0);
};
activeUnitLayer = null;
whoseTurnIcon = null;
minimapWindow = null;
while (forceOverviewLayer.numChildren > 0) {
forceOverviewLayer.removeChildAt(0);
};
forceOverviewLayer = null;
if (scoreTextLayer != null){
while (scoreTextLayer.numChildren > 0) {
scoreTextLayer.removeChildAt(0);
};
scoreTextLayer = null;
};
destroyedUnitForceOverviewIcons.splice(0, destroyedUnitForceOverviewIcons.length);
destroyedUnitForceOverviewIcons = null;
}
public static function updateUnitToArmyOverview(_arg1:Obj_Unit):void{
if (_arg1.forceOverviewIcon == null){
return;
};
_arg1.forceOverviewIcon.gotoAndStop(1);
addForceOverviewIcon(_arg1.forceOverviewIcon, _arg1.forceOverviewNumberIcon, _arg1.unitNumber);
}
public static function updateWhoseTurnIconStatus():void{
whoseTurnIcon.gotoAndStop((riverwar.currentTurn + 1));
}
public static function updateMinimapWindow():void{
minimapWindow.x = (startingMinimapWindowX + ((riverwar.getGameLayerX() / (MapBuilderHelper.BOARD_WIDTH_PIXEL - riverwar.VIEW_WIDTH)) * 78));
minimapWindow.y = (startingMinimapWindowY + ((riverwar.getGameLayerY() / (((MapBuilderHelper.BOARD_HEIGHT_PIXEL - riverwar.VIEW_HEIGHT) + riverwar.HUD_HEIGHT) + riverwar.ACTION_BUBBLE_HEIGHT)) * 36));
}
public static function updateActiveUnitInfo():void{
var _local1:MovieClip;
var _local2:Bitmap;
var _local3:Bitmap;
var _local4:Bitmap;
var _local5:Bitmap;
var _local6:int;
var _local7:int;
var _local8:Bitmap;
var _local9:Bitmap;
if (flashingComputerMoveText != null){
flashingComputerMoveText.removeEventListener(Event.ENTER_FRAME, flashingComputerTextStepEvent);
flashingComputerMoveText = null;
};
while (activeUnitLayer.numChildren > 0) {
activeUnitLayer.removeChildAt(0);
};
if (riverwar.activeUnit != null){
_local1 = riverwar.activeUnit.getHudIcon();
_local1.x = 28;
_local1.y = (minimapY + 10);
_local1.gotoAndStop(Obj_Unit.FORCE_OVERVIEW_ICON_NORMAL);
activeUnitLayer.addChild(_local1);
_local2 = null;
if (riverwar.activeUnit.sideColor == riverwar.currentTurn){
_local2 = new Bitmap(new Bitmap_HudAlliedText(0, 0));
} else {
_local2 = new Bitmap(new Bitmap_HudEnemyText(0, 0));
};
_local2.x = 30;
_local2.y = ((_local1.y + _local1.height) - 3);
activeUnitLayer.addChild(_local2);
_local3 = riverwar.activeUnit.getHudUnitNameTextBitmap();
_local3.x = 14;
_local3.y = ((_local2.y + _local2.height) + 4);
activeUnitLayer.addChild(_local3);
if (((!((riverwar.activeUnit.square.squareType == Obj_Square.TYPE_TRAP))) || (riverwar.activeUnit.notAffectedByTraps))){
_local6 = 154;
_local7 = 0;
while (_local7 < riverwar.activeUnit.attack) {
_local5 = new Bitmap(new Bitmap_StrengthIcon_Green(0, 0));
_local5.y = 487;
_local5.x = _local6;
_local6 = (_local6 + (_local5.width + 4));
activeUnitLayer.addChild(_local5);
_local7++;
};
} else {
_local5 = new Bitmap(new Bitmap_StrengthIcon_Red(0, 0));
_local5.y = 487;
_local5.x = 154;
activeUnitLayer.addChild(_local5);
};
_local4 = riverwar.activeUnit.getSpecialAbilityTextIcon();
if (_local4 != null){
_local4.x = 148;
_local4.y = 508;
activeUnitLayer.addChild(_local4);
};
} else {
_local8 = new Bitmap(new Bitmap_NoActiveUnitStats(0, 0));
_local8.x = 85;
_local8.y = 487;
activeUnitLayer.addChild(_local8);
if ((((((riverwar.currentTurn == riverwar.TURN_PLAYER_BLUE)) && (!(riverwar.player_blue_isHuman)))) || ((((riverwar.currentTurn == riverwar.TURN_PLAYER_RED)) && (!(riverwar.player_red_isHuman)))))){
flashingComputerMoveText = new Bitmap(new Bitmap_ComputerMovingFlash(0, 0));
flashingComputerMoveText.x = 535;
flashingComputerMoveText.y = 430;
flashingComputerMoveText.addEventListener(Event.ENTER_FRAME, flashingComputerTextStepEvent);
activeUnitLayer.addChild(flashingComputerMoveText);
flashingComputerMoveTextFlashingOut = true;
};
_local9 = new Bitmap(new Bitmap_NoUnitSelectedHudIconText(0, 0));
_local9.x = 35;
_local9.y = (minimapY + 25);
activeUnitLayer.addChild(_local9);
};
}
private static function flashingComputerTextStepEvent(_arg1:Event):void{
var _local2:Bitmap;
_local2 = Bitmap(_arg1.currentTarget);
if (flashingComputerMoveTextFlashingOut){
_local2.alpha = (_local2.alpha - 0.1);
if (_local2.alpha <= 0){
flashingComputerMoveTextFlashingOut = false;
_local2.alpha = 0;
};
} else {
_local2.alpha = (_local2.alpha + 0.1);
if (_local2.alpha >= 1){
flashingComputerMoveTextFlashingOut = true;
_local2.alpha = 1;
};
};
}
private static function turnScoreTextBackgroundBackToWhite(_arg1:TimerEvent):void{
if (((!((scoreTextLayer == null))) && ((scoreTextLayer.numChildren > 0)))){
MovieClip(scoreTextLayer.getChildAt(0)).gotoAndStop(1);
};
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER_COMPLETE, turnScoreTextBackgroundBackToWhite);
}
public static function updateUnitToMinimap(_arg1:Obj_Unit):void{
var _local2:MovieClip;
_local2 = _arg1.minimapDot;
if (_local2 == null){
if (_arg1.sideColor == ComputerPlayer.SIDE_PLAYER_BLUE){
_local2 = new MovieClip_MinimapDot_Blue();
} else {
_local2 = new MovieClip_MinimapDot_Red();
};
_local2.gotoAndStop(2);
layer.addChild(_local2);
_arg1.minimapDot = _local2;
};
_local2.x = (minimapX + ((_arg1.getX() / MapBuilderHelper.BOARD_WIDTH_PIXEL) * 100));
_local2.y = (minimapY + ((_arg1.getY() / MapBuilderHelper.BOARD_HEIGHT_PIXEL) * 56));
}
}
}//package
Section 110
//KeyboardManager (KeyboardManager)
package {
import flash.display.*;
import flash.events.*;
public class KeyboardManager {
public static const KEY_NUM10:int = 84;
public static const KEY_NUM11:int = 89;
public static const KEY_LEFT:int = 65;
public static const KEY_NUM13:int = 71;
public static const KEY_NUM14:int = 72;
public static const KEY_NUM0:int = 48;
public static const KEY_NUM1:int = 49;
public static const KEY_NUM2:int = 50;
public static const KEY_NUM3:int = 51;
public static const KEY_NUM5:int = 53;
public static const KEY_NUM6:int = 54;
public static const KEY_NUM7:int = 55;
public static const KEY_NUM8:int = 56;
public static const KEY_NUM9:int = 57;
public static const KEY_NUM4:int = 52;
public static const KEY_DOWNRIGHT:int = 67;
public static const KEY_UP:int = 87;
public static const KEY_NUM12:int = 85;
public static const KEY_UPLEFT:int = 81;
public static const KEY_NUM15:int = 74;
public static const KEY_NUM16:int = 75;
public static const KEY_NUM18:int = 78;
public static const KEY_DOWNLEFT:int = 90;
public static const KEY_DOWN:int = 83;
public static const KEY_ENTER:int = 13;
public static const KEY_NUM17:int = 66;
public static const KEY_NUM19:int = 77;
public static const KEY_UPRIGHT:int = 69;
public static const SCROLL_SPEED_X:int = 150;
public static const SCROLL_SPEED_Y:int = 150;
public static const SCROLL_SPEED_Y_COMPUTER:int = 150;
public static const KEY_ESC:int = 27;
public static const KEY_SHIFT:int = 16;
public static const KEY_QUIT_FROM_MENU:int = 88;
public static const KEY_SPACE:int = 32;
public static const SCROLL_SPEED_X_COMPUTER:int = 150;
public static const KEY_RIGHT:int = 68;
public static var shiftDown:Boolean;
public static var playerInput:Boolean;
private static function keydown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == KEY_SHIFT){
shiftDown = true;
return;
};
if (riverwar.getGameLayer() == null){
return;
};
if (!playerInput){
if (_arg1.keyCode == KEY_SPACE){
if (riverwar.waitingForSpacePressToMainMenu){
riverwar.waitingForSpacePressToMainMenu = false;
AnimateHelper.spaceToContinuePressed();
};
} else {
if (HighscoreSubmitManager.acceptingInput){
if ((((_arg1.keyCode == MainmenuManager.KEY_ARROWUP)) || ((_arg1.keyCode == MainmenuManager.KEY_ARROWDOWN)))){
HighscoreSubmitManager.arrowKeyUpDown();
} else {
if (_arg1.keyCode == KEY_ENTER){
HighscoreSubmitManager.enterKeyDown();
};
};
};
};
return;
} else {
if (riverwar.menuScreenShowing){
if (((!((_arg1.keyCode == KEY_QUIT_FROM_MENU))) && (!((_arg1.keyCode == KEY_ESC))))){
return;
};
};
};
resolveKeyPress(_arg1.keyCode, true);
}
public static function initialize(_arg1:Stage):void{
playerInput = true;
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keydown);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyup);
}
public static function dispose(_arg1:Stage):void{
playerInput = false;
_arg1.removeEventListener(KeyboardEvent.KEY_DOWN, keydown);
_arg1.removeEventListener(KeyboardEvent.KEY_UP, keyup);
}
private static function fadeScrollArrow(_arg1:Event):void{
_arg1.currentTarget.alpha = (_arg1.currentTarget.alpha - 0.075);
if (_arg1.currentTarget.alpha <= 0){
_arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, fadeScrollArrow);
riverwar.scrollArrowLayer.removeChild(MovieClip_ScrollArrow(_arg1.currentTarget));
};
}
public static function playerInputOff():void{
playerInput = false;
}
public static function canScrollUp():Boolean{
return ((riverwar.getGameLayerY() > 0));
}
private static function keyup(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == KEY_SHIFT){
shiftDown = false;
};
}
public static function playerInputOn():void{
playerInput = true;
}
public static function resolveKeyPress(_arg1:int, _arg2:Boolean):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:MovieClip_ScrollArrow;
_local5 = riverwar.getGameLayerX();
_local6 = riverwar.getGameLayerY();
_local7 = null;
switch (_arg1){
case KEY_ENTER:
riverwar.centerOnActiveUnit();
break;
case KEY_QUIT_FROM_MENU:
if (riverwar.menuScreenShowing){
riverwar.quitToMainMenu();
};
break;
case KEY_SPACE:
riverwar.cycleThroughAvailableUnits();
break;
case KEY_ESC:
riverwar.bringInMenuScreen();
break;
case KEY_NUM0:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(0);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(0);
};
break;
case KEY_NUM1:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(1);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(1);
};
break;
case KEY_NUM2:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(2);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(2);
};
break;
case KEY_NUM3:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(3);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(3);
};
break;
case KEY_NUM4:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(4);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(4);
};
break;
case KEY_NUM5:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(5);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(5);
};
break;
case KEY_NUM6:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(6);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(6);
};
break;
case KEY_NUM7:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(7);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(7);
};
break;
case KEY_NUM8:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(8);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(8);
};
break;
case KEY_NUM9:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(9);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(9);
};
break;
case KEY_NUM10:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(10);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(10);
};
break;
case KEY_NUM11:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(11);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(11);
};
break;
case KEY_NUM12:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(12);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(12);
};
break;
case KEY_NUM13:
if (shiftDown){
riverwar.setActiveUnitWithUnitNumber(13);
} else {
riverwar.setActiveUnitOnScreenWithSelectionNumber(13);
};
break;
case KEY_NUM14:
riverwar.setActiveUnitOnScreenWithSelectionNumber(14);
break;
case KEY_NUM15:
riverwar.setActiveUnitOnScreenWithSelectionNumber(15);
break;
case KEY_NUM16:
riverwar.setActiveUnitOnScreenWithSelectionNumber(16);
break;
case KEY_NUM17:
riverwar.setActiveUnitOnScreenWithSelectionNumber(17);
break;
case KEY_NUM18:
riverwar.setActiveUnitOnScreenWithSelectionNumber(18);
break;
case KEY_NUM19:
riverwar.setActiveUnitOnScreenWithSelectionNumber(19);
break;
case KEY_UPLEFT:
if (riverwar.activeUnit != null){
if (riverwar.upLeftActionBubble != null){
riverwar.upLeftActionBubble.play();
};
};
break;
case KEY_UP:
_local4 = -(SCROLL_SPEED_Y);
_local7 = new MovieClip_ScrollArrow();
_local7.gotoAndStop(2);
_local7.x = (riverwar.VIEW_WIDTH / 2);
_local7.y = (_local7.height + 5);
break;
case KEY_UPRIGHT:
if (riverwar.activeUnit != null){
if (riverwar.upRightActionBubble != null){
riverwar.upRightActionBubble.play();
};
};
break;
case KEY_RIGHT:
_local3 = SCROLL_SPEED_X;
_local7 = new MovieClip_ScrollArrow();
_local7.gotoAndStop(1);
_local7.x = (riverwar.VIEW_WIDTH - _local7.width);
_local7.y = (riverwar.VIEW_HEIGHT / 2);
_local7.scaleX = -1;
break;
case KEY_DOWNRIGHT:
if (riverwar.activeUnit != null){
if (riverwar.downRightActionBubble != null){
riverwar.downRightActionBubble.play();
};
};
break;
case KEY_DOWN:
_local4 = SCROLL_SPEED_Y;
_local7 = new MovieClip_ScrollArrow();
_local7.gotoAndStop(2);
_local7.x = (riverwar.VIEW_WIDTH / 2);
_local7.y = ((riverwar.VIEW_HEIGHT - riverwar.HUD_HEIGHT) - _local7.height);
_local7.scaleY = -1;
break;
case KEY_DOWNLEFT:
if (riverwar.activeUnit != null){
if (riverwar.downLeftActionBubble != null){
riverwar.downLeftActionBubble.play();
};
};
break;
case KEY_LEFT:
_local3 = -(SCROLL_SPEED_X);
_local7 = new MovieClip_ScrollArrow();
_local7.gotoAndStop(1);
_local7.x = _local7.width;
_local7.y = (riverwar.VIEW_HEIGHT / 2);
break;
};
if (_local7 != null){
_local7.addEventListener(Event.ENTER_FRAME, fadeScrollArrow);
riverwar.scrollArrowLayer.addChild(_local7);
};
if (!_arg2){
if (_local3 != 0){
_local3 = (SCROLL_SPEED_X_COMPUTER * ((_local3)>0) ? 1 : -1);
} else {
if (_local4 != 0){
_local4 = (SCROLL_SPEED_Y_COMPUTER * ((_local4)>0) ? 1 : -1);
};
};
};
if (((!((_local3 == 0))) || (!((_local4 == 0))))){
_local5 = (_local5 + _local3);
_local6 = (_local6 + _local4);
riverwar.moveGameLayerTo(_local5, _local6);
if (_arg2){
riverwar.setupSelectionIconsForUnitsOnScreen();
};
HUDManager.updateMinimapWindow();
};
}
public static function canScrollRight():Boolean{
return ((riverwar.getGameLayerX() < (MapBuilderHelper.BOARD_WIDTH_PIXEL - riverwar.VIEW_WIDTH)));
}
public static function canScrollLeft():Boolean{
return ((riverwar.getGameLayerX() > 0));
}
public static function canScrollDown():Boolean{
return ((riverwar.getGameLayerY() < (((MapBuilderHelper.BOARD_HEIGHT_PIXEL - riverwar.VIEW_HEIGHT) + riverwar.HUD_HEIGHT) + riverwar.ACTION_BUBBLE_HEIGHT)));
}
}
}//package
Section 111
//MainmenuManager (MainmenuManager)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
public class MainmenuManager {
private static const ALPHA_FADE_AMOUNT:Number = 0.25;
public static const KEY_ARROWDOWN:int = 40;
private static const HIGHSCORE_URL:String = "http://battlephase.com/riverwar/riverwar_highscores.php";
private static const STATE_FIRSTMENU:int = 0;
private static const KEY_ENTER:int = 13;
private static const SWIPE_SPEED:int = 25;
public static const KEY_ARROWUP:int = 38;
private static const STATE_PLAY:int = 1;
private static const STATE_INSTRUCTIONS1:int = 2;
private static const STATE_INSTRUCTIONS2:int = 3;
private static const STATE_INSTRUCTIONS3:int = 4;
private static const HOMEPAGE_URL:String = "http://www.battlephase.com/riverwar";
private static var mainMenuIndex:int;
private static var instructionsCurrent:Bitmap;
private static var currentTopLayer:Sprite;
private static var musicChannel:SoundChannel;
private static var musicVolume:Number;
private static var music:Music_menu;
private static var musicTimer:Timer;
private static var stageRef:Stage;
private static var mainMenuState:int;
private static var instructionsNew:Bitmap;
private static var newTopLayer:Sprite;
private static var baseMenuItemX:int;
private static var layer:Sprite;
private static var playerInput:Boolean;
private static var mainmenuBg:Bitmap;
public function MainmenuManager():void{
}
private static function handlePlayMenuKeyCode(_arg1:int):void{
var _local2:int;
switch (_arg1){
case KEY_ARROWUP:
mainMenuIndex = (mainMenuIndex - 1);
if (mainMenuIndex < 0){
mainMenuIndex = 2;
};
break;
case KEY_ARROWDOWN:
mainMenuIndex = (mainMenuIndex + 1);
if (mainMenuIndex > 2){
mainMenuIndex = 0;
};
break;
case KEY_ENTER:
if (mainMenuIndex == 2){
addMainMenuItems();
playerInput = false;
} else {
if (mainMenuIndex == 1){
riverwar.player_blue_isHuman = true;
riverwar.player_red_isHuman = true;
playerInput = false;
layer.addEventListener(Event.ENTER_FRAME, fadeToGamePlay);
musicTimer = new Timer(20, 50);
musicTimer.addEventListener(TimerEvent.TIMER, fadeOutMusic);
musicTimer.start();
} else {
riverwar.player_blue_isHuman = true;
riverwar.player_red_isHuman = false;
playerInput = false;
layer.addEventListener(Event.ENTER_FRAME, fadeToGamePlay);
musicTimer = new Timer(20, 50);
musicTimer.addEventListener(TimerEvent.TIMER, fadeOutMusic);
musicTimer.start();
};
};
return;
};
_local2 = 0;
while (_local2 < currentTopLayer.numChildren) {
if ((currentTopLayer.getChildAt(_local2) is MovieClip_Mainmenu_Item)){
MovieClip_Mainmenu_Item(currentTopLayer.getChildAt(_local2)).gotoAndStop(2);
};
_local2++;
};
MovieClip_Mainmenu_Item(currentTopLayer.getChildAt(mainMenuIndex)).gotoAndStop(1);
}
private static function addInstructionMenuItems():void{
var _local1:int;
var _local2:int;
var _local3:MovieClip_Mainmenu_Item;
var _local4:Bitmap;
newTopLayer = new Sprite();
newTopLayer.x = (baseMenuItemX + 150);
_local1 = (Bitmap(layer.getChildAt(1)).y + 20);
_local2 = 75;
_local3 = new MovieClip_Mainmenu_Item();
_local3.y = (_local1 + 300);
_local3.gotoAndStop(1);
newTopLayer.addChild(_local3);
_local4 = new Bitmap(new Bitmap_Title_Mainmenu_Item(0, 0));
_local4.y = _local1;
newTopLayer.addChild(_local4);
_local4 = new Bitmap(new Bitmap_Mainmenu_Item_InstructionsTitle(0, 0));
_local4.y = (_local1 + 10);
_local4.x = 20;
newTopLayer.addChild(_local4);
_local4 = new Bitmap(new Bitmap_Mainmenu_Item_Next(0, 0));
_local4.y = ((_local1 + (_local2 * 4)) + 3);
_local4.x = 60;
newTopLayer.addChild(_local4);
instructionsCurrent = addInstructionsHelper();
newTopLayer.alpha = 0;
layer.addChild(newTopLayer);
layer.addEventListener(Event.ENTER_FRAME, swipeInInstructionsMenu);
}
private static function fadeToGamePlay(_arg1:Event):void{
layer.alpha = (layer.alpha - 0.1);
if (layer.alpha <= 0){
layer.removeEventListener(Event.ENTER_FRAME, fadeToGamePlay);
dispose();
riverwar.instance.gotoAndStop(riverwar.FRAME_GAME);
};
}
public static function initialize(_arg1:Stage):void{
var _local2:Sprite;
var _local3:int;
var _local4:int;
var _local5:MovieClip_Square;
var _local6:int;
var _local7:MovieClip;
var _local8:Bitmap;
var _local9:int;
var _local10:int;
var _local11:int;
stageRef = _arg1;
layer = new Sprite();
_local2 = new Sprite();
_local2.scrollRect = new Rectangle(0, 0, riverwar.VIEW_WIDTH, riverwar.VIEW_HEIGHT);
layer.addChild(_local2);
_local3 = (riverwar.VIEW_WIDTH - MapBuilderHelper.SQUARE_WIDTH);
_local4 = 0;
_local5 = null;
_local6 = 0;
while (_local6 < 8) {
_local3 = ((riverwar.VIEW_WIDTH - MapBuilderHelper.SQUARE_WIDTH) - ((MapBuilderHelper.SQUARE_WIDTH * 2) * _local6));
_local4 = 0;
_local11 = 0;
for (;_local11 < 10;_local11++) {
if ((((_local4 > (riverwar.VIEW_HEIGHT + MapBuilderHelper.SQUARE_HEIGHT))) || ((_local3 > riverwar.VIEW_WIDTH)))){
break;
} else {
if (_local3 < -(MapBuilderHelper.SQUARE_WIDTH)){
_local4 = (_local4 + MapBuilderHelper.SQUARE_HEIGHT);
_local3 = (_local3 + MapBuilderHelper.SQUARE_WIDTH);
continue;
};
};
_local5 = new MovieClip_Square();
_local5.x = _local3;
_local5.y = _local4;
if ((((_local6 == 5)) && ((_local11 > 1)))){
_local5.gotoAndStop(2);
} else {
_local5.gotoAndStop(1);
};
_local2.addChild(_local5);
_local4 = (_local4 + MapBuilderHelper.SQUARE_HEIGHT);
_local3 = (_local3 + MapBuilderHelper.SQUARE_WIDTH);
};
_local6++;
};
_local7 = new MovieClip_Tank1_Red();
_local7.stop();
_local7.x = 530;
_local7.y = 370;
_local2.addChild(_local7);
_local7 = new MovieClip_Tank2_Red();
_local7.stop();
_local7.scaleX = -1;
_local7.x = 140;
_local7.y = 180;
_local2.addChild(_local7);
_local7 = new MovieClip_Tank6();
_local7.gotoAndStop(18);
_local7.scaleX = -1;
_local7.x = 15;
_local7.y = 250;
_local2.addChild(_local7);
_local7 = new MovieClip_Tank2();
_local7.gotoAndStop(13);
_local7.x = 530;
_local7.y = 250;
_local2.addChild(_local7);
_local7 = new MovieClip_Tank4();
_local7.gotoAndStop(13);
_local7.scaleX = -1;
_local7.x = 135;
_local7.y = 450;
_local2.addChild(_local7);
_local2.cacheAsBitmap = true;
mainmenuBg = new Bitmap(new Bitmap_Mainmenu_Background(0, 0));
mainmenuBg.x = 200;
mainmenuBg.y = (((riverwar.VIEW_HEIGHT - mainmenuBg.height) / 2) + 50);
layer.addChild(mainmenuBg);
_local8 = new Bitmap(new Bitmap_MainMenu_Header(0, 0));
_local8.x = 85;
_local8.y = 10;
layer.addChild(_local8);
_local9 = 75;
_local10 = (mainmenuBg.y + 20);
baseMenuItemX = (mainmenuBg.x + 20);
currentTopLayer = new Sprite();
currentTopLayer.y = _local10;
currentTopLayer.x = baseMenuItemX;
layer.addChild(currentTopLayer);
addMainMenuItemsHelper(currentTopLayer);
layer.alpha = 0;
layer.addEventListener(Event.ENTER_FRAME, fadeInMainMenu);
_arg1.addChild(layer);
if (musicTimer != null){
musicTimer.removeEventListener(TimerEvent.TIMER, fadeInMusic);
musicTimer.removeEventListener(TimerEvent.TIMER, fadeOutMusic);
musicTimer = null;
if (musicChannel != null){
musicChannel.stop();
musicChannel = null;
};
};
musicVolume = 0;
music = new Music_menu();
musicChannel = music.play(0, int.MAX_VALUE);
musicChannel.soundTransform = new SoundTransform(0);
musicTimer = new Timer(20, 50);
musicTimer.addEventListener(TimerEvent.TIMER, fadeInMusic);
musicTimer.start();
}
public static function fadeInMainMenu(_arg1:Event):void{
layer.alpha = (layer.alpha + 0.1);
if (layer.getChildAt(1).alpha > 0.75){
layer.getChildAt(1).alpha = 0.75;
};
if (layer.alpha >= 1){
layer.alpha = 1;
layer.removeEventListener(Event.ENTER_FRAME, fadeInMainMenu);
stageRef.addEventListener(KeyboardEvent.KEY_DOWN, keydown);
playerInput = true;
};
}
private static function fadeOutMusic(_arg1:TimerEvent):void{
musicVolume = (musicVolume - 0.02);
musicChannel.soundTransform = new SoundTransform(musicVolume);
if (musicVolume <= 0){
musicTimer.removeEventListener(TimerEvent.TIMER, fadeOutMusic);
musicTimer = null;
musicChannel.stop();
musicChannel = null;
music = null;
};
}
private static function keydown(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.keyCode;
if (!playerInput){
return;
};
switch (mainMenuState){
case STATE_FIRSTMENU:
handleMainMenuKeyCode(_local2);
return;
case STATE_PLAY:
handlePlayMenuKeyCode(_local2);
return;
case STATE_INSTRUCTIONS1:
if (_local2 == KEY_ENTER){
mainMenuState = STATE_INSTRUCTIONS2;
};
break;
case STATE_INSTRUCTIONS2:
if (_local2 == KEY_ENTER){
mainMenuState = STATE_INSTRUCTIONS3;
};
break;
case STATE_INSTRUCTIONS3:
if (_local2 == KEY_ENTER){
addMainMenuItems();
playerInput = false;
};
return;
};
if (_local2 == KEY_ENTER){
playerInput = false;
instructionsNew = addInstructionsHelper();
layer.addEventListener(Event.ENTER_FRAME, swipeInNextInstructions);
};
}
public static function dispose():void{
if (currentTopLayer != null){
while (currentTopLayer.numChildren > 0) {
currentTopLayer.removeChildAt(0);
};
currentTopLayer = null;
};
if (newTopLayer != null){
while (newTopLayer.numChildren > 0) {
newTopLayer.removeChildAt(0);
};
newTopLayer = null;
};
mainmenuBg = null;
mainMenuIndex = 0;
mainMenuState = 0;
playerInput = false;
stageRef.removeEventListener(KeyboardEvent.KEY_DOWN, keydown);
if (layer != null){
while (layer.numChildren > 0) {
layer.removeChildAt(0);
};
stageRef.removeChild(layer);
layer = null;
};
stageRef = null;
}
private static function addPlayMenuItems():void{
var _local1:int;
var _local2:int;
var _local3:MovieClip_Mainmenu_Item;
var _local4:Bitmap;
newTopLayer = new Sprite();
newTopLayer.x = (baseMenuItemX + 150);
_local1 = (Bitmap(layer.getChildAt(1)).y + 20);
_local2 = 75;
_local3 = new MovieClip_Mainmenu_Item();
_local3.y = (_local1 + _local2);
_local3.gotoAndStop(1);
newTopLayer.addChild(_local3);
_local3 = new MovieClip_Mainmenu_Item();
_local3.y = (_local1 + (_local2 * 2));
_local3.gotoAndStop(2);
newTopLayer.addChild(_local3);
_local3 = new MovieClip_Mainmenu_Item();
_local3.y = (_local1 + (_local2 * 4));
_local3.gotoAndStop(2);
newTopLayer.addChild(_local3);
_local4 = new Bitmap(new Bitmap_Title_Mainmenu_Item(0, 0));
_local4.y = _local1;
newTopLayer.addChild(_local4);
_local4 = new Bitmap(new Bitmap_Mainmenu_Item_PlayTitle(0, 0));
_local4.y = (_local1 + 10);
_local4.x = 70;
newTopLayer.addChild(_local4);
_local4 = new Bitmap(new Bitmap_Mainmenu_Item_1Player(0, 0));
_local4.y = ((_local1 + _local2) + 2);
_local4.x = 5;
newTopLayer.addChild(_local4);
_local4 = new Bitmap(new Bitmap_Mainmenu_Item_2Player(0, 0));
_local4.y = ((_local1 + (_local2 * 2)) + 2);
_local4.x = 25;
newTopLayer.addChild(_local4);
_local4 = new Bitmap(new Bitmap_Mainmenu_Item_Back(0, 0));
_local4.y = ((_local1 + (_local2 * 4)) + 2);
_local4.x = 60;
newTopLayer.addChild(_local4);
newTopLayer.alpha = 0;
layer.addChild(newTopLayer);
layer.addEventListener(Event.ENTER_FRAME, swipeInPlayMenu);
}
private static function addInstructionsHelper():Bitmap{
var _local1:Bitmap;
_local1 = null;
if (mainMenuState == STATE_INSTRUCTIONS1){
_local1 = new Bitmap(new Bitmap_Instructions1(0, 0));
} else {
if (mainMenuState == STATE_INSTRUCTIONS2){
_local1 = new Bitmap(new Bitmap_Instructions2(0, 0));
} else {
if (mainMenuState == STATE_INSTRUCTIONS3){
_local1 = new Bitmap(new Bitmap_Instructions3(0, 0));
};
};
};
_local1.alpha = 0;
_local1.x = (baseMenuItemX + 150);
_local1.y = ((Bitmap(layer.getChildAt(1)).y + 20) + 70);
layer.addChild(_local1);
return (_local1);
}
private static function finishedSwiping(_arg1:int):void{
layer.removeChild(currentTopLayer);
while (currentTopLayer.numChildren > 0) {
currentTopLayer.removeChildAt(0);
};
currentTopLayer = newTopLayer;
newTopLayer = null;
mainMenuIndex = 0;
mainMenuState = _arg1;
playerInput = true;
}
private static function handleMainMenuKeyCode(_arg1:int):void{
var _local2:int;
var _local3:URLRequest;
switch (_arg1){
case KEY_ARROWUP:
mainMenuIndex = (mainMenuIndex - 1);
if (mainMenuIndex < 0){
mainMenuIndex = 3;
};
break;
case KEY_ARROWDOWN:
mainMenuIndex = (mainMenuIndex + 1);
if (mainMenuIndex > 3){
mainMenuIndex = 0;
};
break;
case KEY_ENTER:
if (mainMenuIndex == 0){
addPlayMenuItems();
playerInput = false;
} else {
if (mainMenuIndex == 1){
mainMenuState = STATE_INSTRUCTIONS1;
addInstructionMenuItems();
playerInput = false;
} else {
if (mainMenuIndex == 2){
_local3 = new URLRequest(HIGHSCORE_URL);
navigateToURL(_local3);
} else {
if (mainMenuIndex == 3){
_local3 = new URLRequest(HOMEPAGE_URL);
navigateToURL(_local3);
};
};
};
};
return;
};
_local2 = 0;
while (_local2 < currentTopLayer.numChildren) {
if ((currentTopLayer.getChildAt(_local2) is MovieClip_Mainmenu_Item)){
MovieClip_Mainmenu_Item(currentTopLayer.getChildAt(_local2)).gotoAndStop(2);
};
_local2++;
};
MovieClip_Mainmenu_Item(currentTopLayer.getChildAt(mainMenuIndex)).gotoAndStop(1);
}
private static function addMainMenuItems():void{
var _local1:int;
var _local2:int;
_local1 = 75;
_local2 = (layer.getChildAt(1).y + 20);
newTopLayer = new Sprite();
newTopLayer.y = _local2;
newTopLayer.x = (baseMenuItemX - 150);
addMainMenuItemsHelper(newTopLayer);
layer.addChild(newTopLayer);
if (mainMenuState == STATE_INSTRUCTIONS3){
layer.addEventListener(Event.ENTER_FRAME, swipeInMainMenuFromInstructions);
} else {
layer.addEventListener(Event.ENTER_FRAME, swipeInMainMenu);
};
}
private static function addMainMenuItemsHelper(_arg1:Sprite):void{
var _local2:int;
var _local3:MovieClip_Mainmenu_Item;
var _local4:Bitmap;
var _local5:Bitmap;
var _local6:Bitmap;
var _local7:Bitmap;
var _local8:Bitmap;
var _local9:Bitmap;
_local2 = 75;
_local3 = new MovieClip_Mainmenu_Item();
_local3.y = _local2;
if (mainMenuState == STATE_INSTRUCTIONS3){
_local3.gotoAndStop(2);
} else {
_local3.gotoAndStop(1);
};
_arg1.addChild(_local3);
_local3 = new MovieClip_Mainmenu_Item();
_local3.y = (_local2 * 2);
if (mainMenuState == STATE_INSTRUCTIONS3){
_local3.gotoAndStop(1);
} else {
_local3.gotoAndStop(2);
};
_arg1.addChild(_local3);
_local3 = new MovieClip_Mainmenu_Item();
_local3.y = (_local2 * 3);
_local3.gotoAndStop(2);
_arg1.addChild(_local3);
_local3 = new MovieClip_Mainmenu_Item();
_local3.y = (_local2 * 4);
_local3.gotoAndStop(2);
_arg1.addChild(_local3);
_local4 = new Bitmap(new Bitmap_Title_Mainmenu_Item(0, 0));
_arg1.addChild(_local4);
_local5 = new Bitmap(new Bitmap_Mainmenu_Item_Mainmenu(0, 0));
_local5.x = 20;
_local5.y = 10;
_arg1.addChild(_local5);
_local6 = new Bitmap(new Bitmap_Mainmenu_Item_Play(0, 0));
_local6.y = (_local2 + 5);
_local6.x = 15;
_arg1.addChild(_local6);
_local7 = new Bitmap(new Bitmap_Mainmenu_Item_Instructions(0, 0));
_local7.y = ((_local2 * 2) + 3);
_local7.x = 15;
_arg1.addChild(_local7);
_local8 = new Bitmap(new Bitmap_Mainmenu_Item_Highscores(0, 0));
_local8.y = ((_local2 * 3) + 3);
_local8.x = 30;
_arg1.addChild(_local8);
_local9 = new Bitmap(new Bitmap_Mainmenu_Item_Homepage(0, 0));
_local9.y = ((_local2 * 4) + 3);
_local9.x = 40;
_arg1.addChild(_local9);
}
private static function swipeInMainMenu(_arg1:Event):void{
currentTopLayer.x = (currentTopLayer.x + SWIPE_SPEED);
currentTopLayer.alpha = (currentTopLayer.alpha - ALPHA_FADE_AMOUNT);
newTopLayer.x = (newTopLayer.x + SWIPE_SPEED);
newTopLayer.alpha = (newTopLayer.alpha + ALPHA_FADE_AMOUNT);
if (newTopLayer.x >= baseMenuItemX){
newTopLayer.x = baseMenuItemX;
layer.removeEventListener(Event.ENTER_FRAME, swipeInMainMenu);
finishedSwiping(STATE_FIRSTMENU);
};
}
private static function swipeInPlayMenu(_arg1:Event):void{
currentTopLayer.x = (currentTopLayer.x - SWIPE_SPEED);
currentTopLayer.alpha = (currentTopLayer.alpha - ALPHA_FADE_AMOUNT);
newTopLayer.x = (newTopLayer.x - SWIPE_SPEED);
if (newTopLayer.x < baseMenuItemX){
newTopLayer.x = baseMenuItemX;
};
newTopLayer.alpha = (newTopLayer.alpha + ALPHA_FADE_AMOUNT);
if (newTopLayer.x <= baseMenuItemX){
layer.removeEventListener(Event.ENTER_FRAME, swipeInPlayMenu);
finishedSwiping(STATE_PLAY);
};
}
private static function swipeInInstructionsMenu(_arg1:Event):void{
currentTopLayer.x = (currentTopLayer.x - SWIPE_SPEED);
currentTopLayer.alpha = (currentTopLayer.alpha - ALPHA_FADE_AMOUNT);
newTopLayer.x = (newTopLayer.x - SWIPE_SPEED);
newTopLayer.alpha = (newTopLayer.alpha + ALPHA_FADE_AMOUNT);
instructionsCurrent.x = (instructionsCurrent.x - SWIPE_SPEED);
instructionsCurrent.alpha = (instructionsCurrent.alpha + ALPHA_FADE_AMOUNT);
if (newTopLayer.x <= baseMenuItemX){
newTopLayer.x = baseMenuItemX;
instructionsCurrent.x = baseMenuItemX;
layer.removeEventListener(Event.ENTER_FRAME, swipeInInstructionsMenu);
finishedSwiping(STATE_INSTRUCTIONS1);
};
}
private static function fadeInMusic(_arg1:TimerEvent):void{
musicVolume = (musicVolume + 0.02);
musicChannel.soundTransform = new SoundTransform(musicVolume);
if (musicVolume >= 1){
musicTimer.removeEventListener(TimerEvent.TIMER, fadeInMusic);
musicTimer = null;
};
}
private static function swipeInMainMenuFromInstructions(_arg1:Event):void{
currentTopLayer.x = (currentTopLayer.x + SWIPE_SPEED);
currentTopLayer.alpha = (currentTopLayer.alpha - ALPHA_FADE_AMOUNT);
instructionsCurrent.x = (instructionsCurrent.x + SWIPE_SPEED);
instructionsCurrent.alpha = (instructionsCurrent.alpha - ALPHA_FADE_AMOUNT);
newTopLayer.x = (newTopLayer.x + SWIPE_SPEED);
newTopLayer.alpha = (newTopLayer.alpha + ALPHA_FADE_AMOUNT);
if (newTopLayer.x >= baseMenuItemX){
newTopLayer.x = baseMenuItemX;
layer.removeEventListener(Event.ENTER_FRAME, swipeInMainMenuFromInstructions);
finishedSwiping(STATE_FIRSTMENU);
layer.removeChild(instructionsCurrent);
instructionsCurrent = null;
mainMenuIndex = 1;
};
}
private static function swipeInNextInstructions(_arg1:Event):void{
instructionsCurrent.x = (instructionsCurrent.x - SWIPE_SPEED);
instructionsCurrent.alpha = (instructionsCurrent.alpha - ALPHA_FADE_AMOUNT);
instructionsNew.x = (instructionsNew.x - SWIPE_SPEED);
instructionsNew.alpha = (instructionsNew.alpha + ALPHA_FADE_AMOUNT);
if (instructionsNew.x <= baseMenuItemX){
instructionsNew.x = baseMenuItemX;
layer.removeEventListener(Event.ENTER_FRAME, swipeInNextInstructions);
layer.removeChild(instructionsCurrent);
instructionsCurrent = instructionsNew;
instructionsNew = null;
mainMenuIndex = 0;
playerInput = true;
};
}
}
}//package
Section 112
//MapBuilderHelper (MapBuilderHelper)
package {
import flash.display.*;
public class MapBuilderHelper {
public static const TERRAIN_POSITION_VARIATION_FROM_CENTER:int = 50;
public static const SQUARE_WIDTH:int = 128;
public static const BOARD_HEIGHT_PIXEL:int = 1476;
public static const SQUARE_HEIGHT:int = 64;
public static const NUM_SQUARES_WIDTH:int = 9;
public static const NUM_SQUARES_HEIGHT:int = 14;
public static const BOARD_WIDTH_PIXEL:int = 2944;
private static function addRowofSquares(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:MovieClip, _arg6:Array):void{
var _local7:MovieClip_Square;
var _local8:Obj_Square;
var _local9:int;
var _local10:Bitmap;
var _local11:int;
var _local12:int;
var _local13:int;
_local13 = 0;
while (_local13 < _arg3) {
_local7 = new MovieClip_Square();
_local7.x = _arg1;
_local7.y = _arg2;
_arg2 = (_arg2 + SQUARE_HEIGHT);
_arg1 = (_arg1 + SQUARE_WIDTH);
_arg5.addChild(_local7);
_local8 = new Obj_Square(_arg4, _arg6.length, riverwar.MASTER_BOARD_LAYOUT[_arg4][_local13], _local7);
_arg6.push(_local8);
if (_local8.squareType == Obj_Square.TYPE_NORMAL){
_local9 = Math.ceil((Math.random() * 8));
_local10 = null;
if (_local9 <= 2){
_local10 = new Bitmap(new Bitmap_RandomTerrain1(0, 0));
} else {
if (_local9 <= 3){
_local10 = new Bitmap(new Bitmap_RandomTerrain2(0, 0));
} else {
if (_local9 <= 4){
_local10 = new Bitmap(new Bitmap_RandomTerrain3(0, 0));
} else {
if (_local9 <= 5){
_local10 = new Bitmap(new Bitmap_RandomTerrain4(0, 0));
};
};
};
};
if (_local10 != null){
_local11 = (((_local7.x - (_local10.width / 2)) + (Math.random() * TERRAIN_POSITION_VARIATION_FROM_CENTER)) - (Math.random() * TERRAIN_POSITION_VARIATION_FROM_CENTER));
_local12 = (((_local7.y - (_local10.height / 2)) + (Math.random() * TERRAIN_POSITION_VARIATION_FROM_CENTER)) - (Math.random() * TERRAIN_POSITION_VARIATION_FROM_CENTER));
_local10.x = _local11;
_local10.y = _local12;
_arg5.addChild(_local10);
};
};
_local13++;
};
}
public static function buildMap():MovieClip{
var _local1:int;
var _local2:int;
var _local3:MovieClip;
var _local4:Array;
var _local5:int;
var _local6:int;
_local1 = 1153;
_local2 = (SQUARE_HEIGHT + riverwar.ACTION_BUBBLE_HEIGHT);
_local3 = new MovieClip();
_local5 = 0;
_local6 = 0;
while (_local6 < NUM_SQUARES_WIDTH) {
_local4 = new Array();
MapBuilderHelper.addRowofSquares(_local1, _local2, NUM_SQUARES_HEIGHT, _local5, _local3, _local4);
_local1 = (_local1 - SQUARE_WIDTH);
_local2 = (_local2 + SQUARE_HEIGHT);
_local5 = (_local5 + 1);
riverwar.squareAt.push(_local4);
_local6++;
};
_local3.cacheAsBitmap = true;
return (_local3);
}
}
}//package
Section 113
//MovieClip_ActionBubble (MovieClip_ActionBubble)
package {
import flash.display.*;
public dynamic class MovieClip_ActionBubble extends MovieClip {
public function MovieClip_ActionBubble(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
riverwar.actionBubblePressedCallback(this);
}
}
}//package
Section 114
//MovieClip_Bunker_Blue (MovieClip_Bunker_Blue)
package {
import flash.display.*;
public dynamic class MovieClip_Bunker_Blue extends MovieClip {
}
}//package
Section 115
//MovieClip_Bunker_Red (MovieClip_Bunker_Red)
package {
import flash.display.*;
public dynamic class MovieClip_Bunker_Red extends MovieClip {
}
}//package
Section 116
//MovieClip_Damage (MovieClip_Damage)
package {
import flash.display.*;
public dynamic class MovieClip_Damage extends MovieClip {
}
}//package
Section 117
//MovieClip_HudScoreTextBackground (MovieClip_HudScoreTextBackground)
package {
import flash.display.*;
public dynamic class MovieClip_HudScoreTextBackground extends MovieClip {
}
}//package
Section 118
//MovieClip_LoadBar (MovieClip_LoadBar)
package {
import flash.display.*;
public dynamic class MovieClip_LoadBar extends MovieClip {
}
}//package
Section 119
//MovieClip_Mainmenu_Item (MovieClip_Mainmenu_Item)
package {
import flash.display.*;
public dynamic class MovieClip_Mainmenu_Item extends MovieClip {
}
}//package
Section 120
//MovieClip_MainMenuButton (MovieClip_MainMenuButton)
package {
import flash.display.*;
public dynamic class MovieClip_MainMenuButton extends MovieClip {
}
}//package
Section 121
//MovieClip_Menu_Screen (MovieClip_Menu_Screen)
package {
import flash.display.*;
public dynamic class MovieClip_Menu_Screen extends MovieClip {
}
}//package
Section 122
//MovieClip_MinimapDot_Blue (MovieClip_MinimapDot_Blue)
package {
import flash.display.*;
public dynamic class MovieClip_MinimapDot_Blue extends MovieClip {
}
}//package
Section 123
//MovieClip_MinimapDot_Red (MovieClip_MinimapDot_Red)
package {
import flash.display.*;
public dynamic class MovieClip_MinimapDot_Red extends MovieClip {
}
}//package
Section 124
//MovieClip_ScrollArrow (MovieClip_ScrollArrow)
package {
import flash.display.*;
public dynamic class MovieClip_ScrollArrow extends MovieClip {
}
}//package
Section 125
//MovieClip_Square (MovieClip_Square)
package {
import flash.display.*;
public dynamic class MovieClip_Square extends MovieClip {
}
}//package
Section 126
//MovieClip_SubmitScoreButton (MovieClip_SubmitScoreButton)
package {
import flash.display.*;
public dynamic class MovieClip_SubmitScoreButton extends MovieClip {
}
}//package
Section 127
//MovieClip_Tank1 (MovieClip_Tank1)
package {
import flash.display.*;
public dynamic class MovieClip_Tank1 extends MovieClip {
public function MovieClip_Tank1(){
addFrameScript(6, frame7, 9, frame10, 16, frame17, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame7(){
if (AnimateHelper.movingUnit != null){
if (AnimateHelper.movingUnit.image == this){
if (AnimateHelper.movingUnit.isFiring){
return;
};
};
};
if (AnimateHelper.targetUnit != null){
if (AnimateHelper.targetUnit.image == this){
if (AnimateHelper.targetUnit.isFiring){
return;
};
};
};
gotoAndPlay(1);
}
function frame17(){
if (AnimateHelper.movingUnit != null){
if (AnimateHelper.movingUnit.image == this){
if (AnimateHelper.movingUnit.isFiring){
return;
};
};
};
if (AnimateHelper.targetUnit != null){
if (AnimateHelper.targetUnit.image == this){
if (AnimateHelper.targetUnit.isFiring){
return;
};
};
};
gotoAndPlay(11);
}
function frame20(){
gotoAndPlay(11);
AnimateHelper.createDamageEffect(this);
}
}
}//package
Section 128
//MovieClip_Tank1_Red (MovieClip_Tank1_Red)
package {
import flash.display.*;
public dynamic class MovieClip_Tank1_Red extends MovieClip {
public function MovieClip_Tank1_Red(){
addFrameScript(6, frame7, 9, frame10, 16, frame17, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame7(){
if (AnimateHelper.movingUnit != null){
if (AnimateHelper.movingUnit.image == this){
if (AnimateHelper.movingUnit.isFiring){
return;
};
};
};
if (AnimateHelper.targetUnit != null){
if (AnimateHelper.targetUnit.image == this){
if (AnimateHelper.targetUnit.isFiring){
return;
};
};
};
gotoAndPlay(1);
}
function frame17(){
if (AnimateHelper.movingUnit != null){
if (AnimateHelper.movingUnit.image == this){
if (AnimateHelper.movingUnit.isFiring){
return;
};
};
};
if (AnimateHelper.targetUnit != null){
if (AnimateHelper.targetUnit.image == this){
if (AnimateHelper.targetUnit.isFiring){
return;
};
};
};
gotoAndPlay(11);
}
function frame20(){
gotoAndPlay(11);
AnimateHelper.createDamageEffect(this);
}
}
}//package
Section 129
//MovieClip_Tank2 (MovieClip_Tank2)
package {
import flash.display.*;
public dynamic class MovieClip_Tank2 extends MovieClip {
public function MovieClip_Tank2(){
addFrameScript(11, frame12, 23, frame24);
}
function frame12(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame24(){
gotoAndPlay(13);
AnimateHelper.createDamageEffect(this);
}
}
}//package
Section 130
//MovieClip_Tank2_Red (MovieClip_Tank2_Red)
package {
import flash.display.*;
public dynamic class MovieClip_Tank2_Red extends MovieClip {
public function MovieClip_Tank2_Red(){
addFrameScript(11, frame12, 23, frame24);
}
function frame12(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame24(){
gotoAndPlay(13);
AnimateHelper.createDamageEffect(this);
}
}
}//package
Section 131
//MovieClip_Tank3 (MovieClip_Tank3)
package {
import flash.display.*;
public dynamic class MovieClip_Tank3 extends MovieClip {
public function MovieClip_Tank3(){
addFrameScript(10, frame11, 12, frame13, 13, frame14, 26, frame27, 28, frame29, 29, frame30);
}
function frame14(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame13(){
AnimateHelper.unitContinuingFiringAnimation(this, true);
}
function frame29(){
AnimateHelper.unitContinuingFiringAnimation(this, false);
}
function frame27(){
AnimateHelper.unitStartedFiringAnimation(this, false);
}
function frame30(){
gotoAndPlay(15);
AnimateHelper.createDamageEffect(this);
}
function frame11(){
AnimateHelper.unitStartedFiringAnimation(this, true);
}
}
}//package
Section 132
//MovieClip_Tank3_Red (MovieClip_Tank3_Red)
package {
import flash.display.*;
public dynamic class MovieClip_Tank3_Red extends MovieClip {
public function MovieClip_Tank3_Red(){
addFrameScript(10, frame11, 12, frame13, 13, frame14, 26, frame27, 28, frame29, 29, frame30);
}
function frame14(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame13(){
AnimateHelper.unitContinuingFiringAnimation(this, true);
}
function frame29(){
AnimateHelper.unitContinuingFiringAnimation(this, false);
}
function frame27(){
AnimateHelper.unitStartedFiringAnimation(this, false);
}
function frame30(){
gotoAndPlay(15);
AnimateHelper.createDamageEffect(this);
}
function frame11(){
AnimateHelper.unitStartedFiringAnimation(this, true);
}
}
}//package
Section 133
//MovieClip_Tank4 (MovieClip_Tank4)
package {
import flash.display.*;
public dynamic class MovieClip_Tank4 extends MovieClip {
public function MovieClip_Tank4(){
addFrameScript(6, frame7, 9, frame10, 16, frame17, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame7(){
if (AnimateHelper.movingUnit != null){
if (AnimateHelper.movingUnit.image == this){
if (AnimateHelper.movingUnit.isFiring){
return;
};
};
};
if (AnimateHelper.targetUnit != null){
if (AnimateHelper.targetUnit.image == this){
if (AnimateHelper.targetUnit.isFiring){
return;
};
};
};
gotoAndPlay(1);
}
function frame17(){
if (AnimateHelper.movingUnit != null){
if (AnimateHelper.movingUnit.image == this){
if (AnimateHelper.movingUnit.isFiring){
return;
};
};
};
if (AnimateHelper.targetUnit != null){
if (AnimateHelper.targetUnit.image == this){
if (AnimateHelper.targetUnit.isFiring){
return;
};
};
};
gotoAndPlay(11);
}
function frame20(){
gotoAndPlay(11);
AnimateHelper.createDamageEffect(this);
}
}
}//package
Section 134
//MovieClip_Tank4_Red (MovieClip_Tank4_Red)
package {
import flash.display.*;
public dynamic class MovieClip_Tank4_Red extends MovieClip {
public function MovieClip_Tank4_Red(){
addFrameScript(6, frame7, 9, frame10, 16, frame17, 19, frame20);
}
function frame10(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame7(){
if (AnimateHelper.movingUnit != null){
if (AnimateHelper.movingUnit.image == this){
if (AnimateHelper.movingUnit.isFiring){
return;
};
};
};
if (AnimateHelper.targetUnit != null){
if (AnimateHelper.targetUnit.image == this){
if (AnimateHelper.targetUnit.isFiring){
return;
};
};
};
gotoAndPlay(1);
}
function frame17(){
if (AnimateHelper.movingUnit != null){
if (AnimateHelper.movingUnit.image == this){
if (AnimateHelper.movingUnit.isFiring){
return;
};
};
};
if (AnimateHelper.targetUnit != null){
if (AnimateHelper.targetUnit.image == this){
if (AnimateHelper.targetUnit.isFiring){
return;
};
};
};
gotoAndPlay(11);
}
function frame20(){
gotoAndPlay(11);
AnimateHelper.createDamageEffect(this);
}
}
}//package
Section 135
//MovieClip_Tank6 (MovieClip_Tank6)
package {
import flash.display.*;
public dynamic class MovieClip_Tank6 extends MovieClip {
public function MovieClip_Tank6(){
addFrameScript(13, frame14, 15, frame16, 16, frame17, 30, frame31, 32, frame33, 33, frame34);
}
function frame14(){
AnimateHelper.unitStartedFiringAnimation(this, true);
}
function frame16(){
AnimateHelper.unitContinuingFiringAnimation(this, true);
}
function frame17(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame34(){
gotoAndPlay(18);
AnimateHelper.createDamageEffect(this);
}
function frame31(){
AnimateHelper.unitStartedFiringAnimation(this, false);
}
function frame33(){
AnimateHelper.unitContinuingFiringAnimation(this, false);
}
}
}//package
Section 136
//MovieClip_Tank6_Red (MovieClip_Tank6_Red)
package {
import flash.display.*;
public dynamic class MovieClip_Tank6_Red extends MovieClip {
public function MovieClip_Tank6_Red(){
addFrameScript(13, frame14, 15, frame16, 16, frame17, 30, frame31, 32, frame33, 33, frame34);
}
function frame14(){
AnimateHelper.unitStartedFiringAnimation(this, true);
}
function frame16(){
AnimateHelper.unitContinuingFiringAnimation(this, true);
}
function frame17(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame34(){
gotoAndPlay(18);
AnimateHelper.createDamageEffect(this);
}
function frame31(){
AnimateHelper.unitStartedFiringAnimation(this, false);
}
function frame33(){
AnimateHelper.unitContinuingFiringAnimation(this, false);
}
}
}//package
Section 137
//MovieClip_Tank7 (MovieClip_Tank7)
package {
import flash.display.*;
public dynamic class MovieClip_Tank7 extends MovieClip {
public function MovieClip_Tank7(){
addFrameScript(13, frame14, 15, frame16, 16, frame17, 30, frame31, 32, frame33, 33, frame34);
}
function frame14(){
AnimateHelper.unitStartedFiringAnimation(this, true);
}
function frame16(){
AnimateHelper.unitContinuingFiringAnimation(this, true);
}
function frame17(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame34(){
gotoAndPlay(18);
AnimateHelper.createDamageEffect(this);
}
function frame31(){
AnimateHelper.unitStartedFiringAnimation(this, false);
}
function frame33(){
AnimateHelper.unitContinuingFiringAnimation(this, false);
}
}
}//package
Section 138
//MovieClip_Tank7_Red (MovieClip_Tank7_Red)
package {
import flash.display.*;
public dynamic class MovieClip_Tank7_Red extends MovieClip {
public function MovieClip_Tank7_Red(){
addFrameScript(13, frame14, 15, frame16, 16, frame17, 30, frame31, 32, frame33, 33, frame34);
}
function frame14(){
AnimateHelper.unitStartedFiringAnimation(this, true);
}
function frame16(){
AnimateHelper.unitContinuingFiringAnimation(this, true);
}
function frame17(){
gotoAndPlay(1);
AnimateHelper.createDamageEffect(this);
}
function frame34(){
gotoAndPlay(18);
AnimateHelper.createDamageEffect(this);
}
function frame31(){
AnimateHelper.unitStartedFiringAnimation(this, false);
}
function frame33(){
AnimateHelper.unitContinuingFiringAnimation(this, false);
}
}
}//package
Section 139
//MovieClip_UnitForceNumberIcon (MovieClip_UnitForceNumberIcon)
package {
import flash.display.*;
public dynamic class MovieClip_UnitForceNumberIcon extends MovieClip {
}
}//package
Section 140
//MovieClip_UnitList_Icon0 (MovieClip_UnitList_Icon0)
package {
import flash.display.*;
public dynamic class MovieClip_UnitList_Icon0 extends MovieClip {
}
}//package
Section 141
//MovieClip_UnitList_Icon1 (MovieClip_UnitList_Icon1)
package {
import flash.display.*;
public dynamic class MovieClip_UnitList_Icon1 extends MovieClip {
}
}//package
Section 142
//MovieClip_UnitList_Icon2 (MovieClip_UnitList_Icon2)
package {
import flash.display.*;
public dynamic class MovieClip_UnitList_Icon2 extends MovieClip {
}
}//package
Section 143
//MovieClip_UnitList_Icon3 (MovieClip_UnitList_Icon3)
package {
import flash.display.*;
public dynamic class MovieClip_UnitList_Icon3 extends MovieClip {
}
}//package
Section 144
//MovieClip_UnitList_Icon4 (MovieClip_UnitList_Icon4)
package {
import flash.display.*;
public dynamic class MovieClip_UnitList_Icon4 extends MovieClip {
}
}//package
Section 145
//MovieClip_UnitList_Icon6 (MovieClip_UnitList_Icon6)
package {
import flash.display.*;
public dynamic class MovieClip_UnitList_Icon6 extends MovieClip {
}
}//package
Section 146
//MovieClip_UnitList_Icon7 (MovieClip_UnitList_Icon7)
package {
import flash.display.*;
public dynamic class MovieClip_UnitList_Icon7 extends MovieClip {
}
}//package
Section 147
//MovieClip_UnitNumberIcon (MovieClip_UnitNumberIcon)
package {
import flash.display.*;
public dynamic class MovieClip_UnitNumberIcon extends MovieClip {
}
}//package
Section 148
//MovieClip_WhoseTurnIcon (MovieClip_WhoseTurnIcon)
package {
import flash.display.*;
public dynamic class MovieClip_WhoseTurnIcon extends MovieClip {
}
}//package
Section 149
//MovieClip_WinText (MovieClip_WinText)
package {
import flash.display.*;
public dynamic class MovieClip_WinText extends MovieClip {
}
}//package
Section 150
//Music_Game (Music_Game)
package {
import flash.media.*;
public dynamic class Music_Game extends Sound {
}
}//package
Section 151
//Music_menu (Music_menu)
package {
import flash.media.*;
public dynamic class Music_menu extends Sound {
}
}//package
Section 152
//Obj_Square (Obj_Square)
package {
public class Obj_Square {
public var distanceToRed:int;
public var unit:Obj_Unit;
public var distanceToBlue:int;
public var squareType:int;
public var yIndex:int;
public var xIndex:int;
public var squareImage:MovieClip_Square;
public static const TYPE_BRIDGE_DOWNRIGHT:int = 10;
public static const TYPE_RIVER_DOWNRIGHT:int = 2;
public static const TYPE_RIVER_CORNER2:int = 5;
public static const TYPE_RIVER_CORNER3:int = 6;
public static const TYPE_RIVER_CORNER4:int = 7;
public static const TYPE_RIVER_UPRIGHT:int = 3;
public static const TYPE_RIVER_CORNER1:int = 4;
public static const TYPE_NORMAL:int = 1;
public static const TYPE_DESTROYED_BUNKER:int = 8;
public static const TYPE_TRAP:int = 11;
public static const TYPE_BRIDGE_UPRIGHT:int = 9;
public function Obj_Square(_arg1:int, _arg2:int, _arg3:int, _arg4:MovieClip_Square):void{
this.xIndex = _arg1;
this.yIndex = _arg2;
this.squareType = _arg3;
this.squareImage = _arg4;
switch (_arg3){
case TYPE_NORMAL:
_arg4.gotoAndStop(1);
break;
case TYPE_RIVER_UPRIGHT:
_arg4.scaleX = -1;
case TYPE_RIVER_DOWNRIGHT:
_arg4.gotoAndStop(2);
break;
case TYPE_RIVER_CORNER2:
_arg4.scaleY = -1;
_arg4.y = (_arg4.y + 1);
case TYPE_RIVER_CORNER1:
_arg4.gotoAndStop(3);
break;
case TYPE_RIVER_CORNER4:
_arg4.scaleX = -1;
case TYPE_RIVER_CORNER3:
_arg4.gotoAndStop(4);
break;
case TYPE_BRIDGE_DOWNRIGHT:
_arg4.scaleX = -1;
case TYPE_BRIDGE_UPRIGHT:
_arg4.gotoAndStop(6);
break;
case TYPE_TRAP:
_arg4.gotoAndStop(7);
break;
};
}
public function isWaterTerrain():Boolean{
return (((((((((!((squareType == TYPE_NORMAL))) && (!((squareType == TYPE_DESTROYED_BUNKER))))) && (!((squareType == TYPE_BRIDGE_UPRIGHT))))) && (!((squareType == TYPE_BRIDGE_DOWNRIGHT))))) && (!((squareType == TYPE_TRAP)))));
}
public function turnToRubble():void{
squareImage.gotoAndStop(5);
}
public function getY():int{
return (squareImage.y);
}
public function getX():int{
return (squareImage.x);
}
}
}//package
Section 153
//Obj_Unit (Obj_Unit)
package {
import flash.display.*;
public class Obj_Unit {
public var forceOverviewNumberIcon:MovieClip_UnitForceNumberIcon;
public var sideColor:int;
public var attackSoundType:int;
public var attack:int;
public var image:MovieClip;
public var spriteStart:int;// = 1
public var unitType:int;
public var facing:int;
public var minimapDot:MovieClip;
public var selectionIcon:MovieClip_UnitNumberIcon;
public var notAffectedByTraps:Boolean;
public var forceOverviewIcon:MovieClip;
public var unitNumber:int;
public var square:Obj_Square;
public var isFiring:Boolean;
public var specialAbilityText:Bitmap;
public static const UNIT_TYPE_HUMVEE:int = 2;
public static const ATTACK_SOUND_TYPE_TANKSHOT:int = 2;
public static const HUMVEE_UP_SPRITE_START:int = 13;
public static const UNIT_TYPE_HALFTRAK:int = 3;
public static const UNIT_TYPE_COPTER:int = 1;
public static const HALFTRAK_UP_SPRITE_START:int = 15;
public static const UNIT_TYPE_BATTLETANK:int = 5;
public static const FORCE_OVERVIEW_ICON_SELECTED:int = 2;
public static const TANK_UP_SPRITE_START:int = 18;
public static const COPTER_UP_SPRITE_START:int = 11;
public static const FORCE_OVERVIEW_ICON_NORMAL:int = 1;
public static const FORCE_OVERVIEW_ICON_DESTROYED:int = 3;
public static const UNIT_TYPE_SKIMMER:int = 4;
public static const UNIT_TYPE_BUNKER:int = 7;
public static const UNIT_TYPE_SUPERTANK:int = 6;
public static const SKIMMER_UP_SPRITE_START:int = 11;
public static const SUPERTANK_UP_SPRITE_START:int = 18;
public static const ATTACK_SOUND_TYPE_MACHINEGUN:int = 1;
public function Obj_Unit(_arg1:Obj_Square, _arg2:int, _arg3):void{
var _local4:Boolean;
spriteStart = 1;
super();
this.square = _arg1;
this.square.unit = this;
this.image = image;
this.unitType = _arg3;
this.sideColor = _arg2;
_local4 = false;
if ((((((_arg2 == ComputerPlayer.SIDE_PLAYER_BLUE)) && (!(riverwar.player_blue_isHuman)))) || ((((_arg2 == ComputerPlayer.SIDE_PLAYER_RED)) && (!(riverwar.player_red_isHuman)))))){
_local4 = true;
};
if (!_local4){
forceOverviewIcon = getHudIcon();
};
switch (_arg3){
case UNIT_TYPE_SKIMMER:
attack = 4;
attackSoundType = ATTACK_SOUND_TYPE_MACHINEGUN;
if (_arg2 == ComputerPlayer.SIDE_PLAYER_BLUE){
image = new MovieClip_Tank4();
} else {
image = new MovieClip_Tank4_Red();
};
break;
case UNIT_TYPE_BATTLETANK:
attack = 6;
attackSoundType = ATTACK_SOUND_TYPE_TANKSHOT;
if (_arg2 == ComputerPlayer.SIDE_PLAYER_BLUE){
image = new MovieClip_Tank6();
} else {
image = new MovieClip_Tank6_Red();
};
break;
case UNIT_TYPE_BUNKER:
attack = 0;
if (_arg2 == ComputerPlayer.SIDE_PLAYER_BLUE){
image = new MovieClip_Bunker_Blue();
} else {
image = new MovieClip_Bunker_Red();
};
break;
case UNIT_TYPE_COPTER:
attack = 1;
if (_arg2 == ComputerPlayer.SIDE_PLAYER_BLUE){
image = new MovieClip_Tank1();
} else {
image = new MovieClip_Tank1_Red();
};
attackSoundType = ATTACK_SOUND_TYPE_MACHINEGUN;
break;
case UNIT_TYPE_HUMVEE:
attack = 2;
attackSoundType = ATTACK_SOUND_TYPE_MACHINEGUN;
if (_arg2 == ComputerPlayer.SIDE_PLAYER_BLUE){
image = new MovieClip_Tank2();
} else {
image = new MovieClip_Tank2_Red();
};
break;
case UNIT_TYPE_HALFTRAK:
attack = 3;
attackSoundType = ATTACK_SOUND_TYPE_TANKSHOT;
if (_arg2 == ComputerPlayer.SIDE_PLAYER_BLUE){
image = new MovieClip_Tank3();
} else {
image = new MovieClip_Tank3_Red();
};
notAffectedByTraps = true;
break;
case UNIT_TYPE_SUPERTANK:
attack = 7;
attackSoundType = ATTACK_SOUND_TYPE_TANKSHOT;
if (_arg2 == ComputerPlayer.SIDE_PLAYER_BLUE){
image = new MovieClip_Tank7();
} else {
image = new MovieClip_Tank7_Red();
};
break;
};
riverwar.unitList.push(this);
if (_arg2 == ComputerPlayer.SIDE_PLAYER_BLUE){
unitNumber = riverwar.blueUnitList.length;
riverwar.blueUnitList.push(this);
} else {
unitNumber = riverwar.redUnitList.length;
riverwar.redUnitList.push(this);
};
if (!_local4){
forceOverviewNumberIcon = new MovieClip_UnitForceNumberIcon();
forceOverviewNumberIcon.gotoAndStop((unitNumber + 1));
};
riverwar.unitLayer.addChild(image);
image.x = _arg1.getX();
image.y = _arg1.getY();
stopFiring();
HUDManager.updateUnitToMinimap(this);
}
public function startFiring():void{
image.gotoAndPlay(spriteStart);
isFiring = true;
}
public function unsetAsActiveUnit():void{
setForceOverviewIcon(FORCE_OVERVIEW_ICON_NORMAL);
if (minimapDot != null){
minimapDot.gotoAndStop(2);
};
}
public function getSpecialAbilityTextIcon():Bitmap{
var _local1:Bitmap;
_local1 = null;
switch (unitType){
case UNIT_TYPE_COPTER:
_local1 = new Bitmap(new Bitmap_SpecialAbilityText_Unit1(0, 0));
break;
case UNIT_TYPE_HALFTRAK:
_local1 = new Bitmap(new Bitmap_SpecialAbilityText_Unit3(0, 0));
break;
case UNIT_TYPE_SKIMMER:
_local1 = new Bitmap(new Bitmap_SpecialAbilityText_Unit4(0, 0));
break;
case UNIT_TYPE_BUNKER:
_local1 = new Bitmap(new Bitmap_SpecialAbilityText_Unit0(0, 0));
break;
};
return (_local1);
}
public function getX():int{
return (image.x);
}
public function stopFiring():void{
switch (unitType){
case UNIT_TYPE_SKIMMER:
this.image.gotoAndPlay(spriteStart);
break;
case UNIT_TYPE_HALFTRAK:
case UNIT_TYPE_SUPERTANK:
case UNIT_TYPE_BATTLETANK:
case UNIT_TYPE_HUMVEE:
this.image.gotoAndStop(spriteStart);
break;
case UNIT_TYPE_COPTER:
this.image.gotoAndPlay(spriteStart);
break;
};
isFiring = false;
}
public function getYIndex():int{
return (square.yIndex);
}
public function moveSelectionIconToMainPosition():void{
if (selectionIcon != null){
selectionIcon.x = image.x;
selectionIcon.y = (image.y - (image.height / 2));
};
}
public function setForceOverviewIcon(_arg1:int):void{
if (forceOverviewIcon != null){
if (forceOverviewIcon.currentFrame != FORCE_OVERVIEW_ICON_DESTROYED){
forceOverviewIcon.gotoAndStop(_arg1);
};
if (forceOverviewIcon.currentFrame == FORCE_OVERVIEW_ICON_NORMAL){
forceOverviewNumberIcon.visible = true;
} else {
forceOverviewNumberIcon.visible = false;
};
};
}
public function moveSelectionIconToAltPosition():void{
var _local1:int;
var _local2:Boolean;
if (selectionIcon != null){
_local1 = (image.x + riverwar.getGameLayerX());
_local2 = !((image.scaleX == -1));
if (_local1 >= (riverwar.VIEW_WIDTH - riverwar.VIEW_BORDER)){
_local2 = false;
} else {
if (_local1 < riverwar.VIEW_BORDER){
_local2 = true;
};
};
if (_local2){
selectionIcon.x = ((image.x + (image.width / 2)) + selectionIcon.width);
selectionIcon.y = image.y;
} else {
selectionIcon.x = ((image.x - (image.width / 2)) - selectionIcon.width);
selectionIcon.y = image.y;
};
};
}
public function getHudIcon():MovieClip{
var _local1:MovieClip;
_local1 = null;
switch (unitType){
case UNIT_TYPE_SKIMMER:
_local1 = new MovieClip_UnitList_Icon4();
break;
case UNIT_TYPE_HUMVEE:
_local1 = new MovieClip_UnitList_Icon2();
break;
case UNIT_TYPE_BATTLETANK:
_local1 = new MovieClip_UnitList_Icon6();
break;
case UNIT_TYPE_COPTER:
_local1 = new MovieClip_UnitList_Icon1();
break;
case UNIT_TYPE_HALFTRAK:
_local1 = new MovieClip_UnitList_Icon3();
break;
case UNIT_TYPE_SUPERTANK:
_local1 = new MovieClip_UnitList_Icon7();
break;
case UNIT_TYPE_BUNKER:
_local1 = new MovieClip_UnitList_Icon0();
break;
};
_local1.stop();
return (_local1);
}
public function getY():int{
return (image.y);
}
public function getHudUnitNameTextBitmap():Bitmap{
var _local1:Bitmap;
_local1 = null;
switch (unitType){
case UNIT_TYPE_SKIMMER:
_local1 = new Bitmap(new Bitmap_Unit4_HudUnitName(0, 0));
break;
case UNIT_TYPE_HUMVEE:
_local1 = new Bitmap(new Bitmap_Unit2_HudUnitName(0, 0));
break;
case UNIT_TYPE_BATTLETANK:
_local1 = new Bitmap(new Bitmap_Unit6_HudUnitName(0, 0));
break;
case UNIT_TYPE_COPTER:
_local1 = new Bitmap(new Bitmap_Unit1_HudUnitName(0, 0));
break;
case UNIT_TYPE_HALFTRAK:
_local1 = new Bitmap(new Bitmap_Unit3_HudUnitName(0, 0));
break;
case UNIT_TYPE_SUPERTANK:
_local1 = new Bitmap(new Bitmap_Unit7_HudUnitName(0, 0));
break;
case UNIT_TYPE_BUNKER:
_local1 = new Bitmap(new Bitmap_Unit0_HudUnitName(0, 0));
break;
};
return (_local1);
}
public function getXIndex():int{
return (square.xIndex);
}
public function setVerticalFacing(_arg1:Boolean):void{
if (!_arg1){
spriteStart = 1;
} else {
switch (unitType){
case UNIT_TYPE_SKIMMER:
spriteStart = SKIMMER_UP_SPRITE_START;
break;
case UNIT_TYPE_BATTLETANK:
spriteStart = TANK_UP_SPRITE_START;
break;
case UNIT_TYPE_HUMVEE:
spriteStart = HUMVEE_UP_SPRITE_START;
break;
case UNIT_TYPE_COPTER:
spriteStart = COPTER_UP_SPRITE_START;
break;
case UNIT_TYPE_HALFTRAK:
spriteStart = HALFTRAK_UP_SPRITE_START;
break;
case UNIT_TYPE_SUPERTANK:
spriteStart = SUPERTANK_UP_SPRITE_START;
break;
};
};
}
}
}//package
Section 154
//riverwar (riverwar)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
import flash.geom.*;
public class riverwar extends MovieClip {
public var loadText:TextField;
public var bytesLoaded:int;
public var cMenu:ContextMenu;
public var bytesTotal:int;
public var loadBar:MovieClip_LoadBar;
public var percentage:int;
public var percentageText:TextField;
public static const VIEW_HEIGHT:int = 550;
public static const VIEW_BORDER:int = 50;
public static const SCREEN_FADE_OUT_SPEED:Number = 0.08;
public static const FRAME_MENU:int = 7;
public static const TANK_HUNTER_VS_TANK_WIN_CHANCE:int = 75;
public static const TURN_PLAYER_RED:int = 1;
public static const TURN_PLAYER_BLUE:int = 0;
public static const SCORE_PENALTY_PER_UNIT_ATTACK_VALUE:int = 100;
public static const MASTER_BOARD_LAYOUT:Array = [[1, 1, 1, 1, 1, 11, 1, 11, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1], [2, 9, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 6, 2, 7, 1, 1, 5, 2, 7, 1, 1, 1, 1], [1, 1, 1, 1, 10, 1, 5, 4, 1, 10, 1, 1, 1, 1], [1, 1, 1, 1, 6, 2, 4, 1, 1, 6, 2, 7, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 9, 2], [1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 11, 1, 11, 1, 1, 1, 1, 1]];
public static const VIEW_WIDTH:int = 650;
public static const HUD_HEIGHT:int = 75;
public static const FRAME_GAME:int = 8;
public static const STARTING_SCORE:int = 4700;
public static const SCORE_PENALTY_PER_TURN:int = 1;
public static const UNIT_HIGHLIGHT_ALPHA_ON_WATER:Number = 0.55;
public static const UNIT_HIGHLIGHT_ALPHA_ON_NORMAL:Number = 0.4;
public static const ACTION_BUBBLE_HEIGHT:int = 62;
public static var player_red_isHuman:Boolean;
public static var downRightActionBubble:MovieClip_ActionBubble;
private static var musicTimer:Timer;
private static var music:Music_Game;
public static var unitLayer:Sprite;
public static var squareAt:Array;
public static var menuLayer:Sprite;
public static var actionIconsLayer:Sprite;
public static var unitList:Array;
public static var upRightActionBubble:MovieClip_ActionBubble;
private static var musicChannel:SoundChannel;
public static var effectsLayer:Sprite;
public static var waitingForSpacePressToMainMenu:Boolean;
public static var scrollArrowLayer:Sprite;
private static var gameLayer:Sprite;
public static var score:int;
public static var instance:MovieClip;
public static var menuScreenShowing:Boolean;
public static var currentTurn:int;
private static var musicVolume:Number;
public static var unitHighlightLayer:Sprite;
public static var activeUnit:Obj_Unit;
public static var stageRef:Stage;
public static var blueUnitList:Array;
public static var upLeftActionBubble:MovieClip_ActionBubble;
public static var downLeftActionBubble:MovieClip_ActionBubble;
public static var unitWithSelectionIcon:Array;
public static var player_blue_isHuman:Boolean;
public static var backgroundDotColor:Bitmap;
public static var startingFirstTurn:Boolean;
public static var redUnitList:Array;
public function riverwar():void{
addFrameScript(0, frame1, 6, frame7, 7, frame8);
super();
instance = this;
}
public function loadBarPressed(_arg1:MouseEvent):void{
gotoAndStop(FRAME_MENU);
}
function frame7(){
stage.focus = this;
stop();
MainmenuManager.initialize(stage);
}
function frame1(){
stop();
cMenu = new ContextMenu();
cMenu.builtInItems.forwardAndBack = false;
cMenu.builtInItems.loop = false;
cMenu.builtInItems.play = false;
cMenu.builtInItems.print = false;
cMenu.builtInItems.rewind = false;
cMenu.builtInItems.save = false;
cMenu.builtInItems.zoom = false;
this.contextMenu = cMenu;
stage.focus = this;
bytesLoaded = 0;
bytesTotal = (this.root.loaderInfo.bytesTotal / 1000);
percentage = 0;
loadText.selectable = false;
percentageText.selectable = false;
stage.addEventListener(Event.ENTER_FRAME, loadProgress);
}
function frame8(){
stop();
initializeGame();
}
public function loadProgress(_arg1:Event):void{
bytesLoaded = (this.root.loaderInfo.bytesLoaded / 1000);
percentage = ((bytesLoaded / bytesTotal) * 100);
percentageText.text = (percentage + " %");
loadBar.width = ((bytesLoaded / bytesTotal) * loadText.width);
if (bytesLoaded == bytesTotal){
stage.removeEventListener(Event.ENTER_FRAME, loadProgress);
loadBar.addEventListener(MouseEvent.MOUSE_DOWN, loadBarPressed);
loadBar.buttonMode = true;
loadText.text = "Click to Start";
loadText.mouseEnabled = false;
};
}
public function initializeGame():void{
stageRef = stage;
backgroundDotColor = new Bitmap(new Bitmap_BackgroundDotColor(0, 0));
backgroundDotColor.alpha = 0;
backgroundDotColor.scaleX = VIEW_WIDTH;
backgroundDotColor.scaleY = VIEW_HEIGHT;
stageRef.addChild(backgroundDotColor);
currentTurn = 1;
score = STARTING_SCORE;
HUDManager.currentForceOverviewPlayer = 1;
menuScreenShowing = false;
HUDManager.initialize();
squareAt = new Array();
unitWithSelectionIcon = new Array();
unitList = new Array();
redUnitList = new Array();
blueUnitList = new Array();
KeyboardManager.initialize(stage);
unitHighlightLayer = new Sprite();
unitLayer = new Sprite();
gameLayer = new Sprite();
gameLayer.scrollRect = new Rectangle(0, 0, VIEW_WIDTH, VIEW_HEIGHT);
gameLayer.alpha = 0;
gameLayer.addChild(MapBuilderHelper.buildMap());
gameLayer.addChild(unitHighlightLayer);
gameLayer.addChild(unitLayer);
setupUnitPlacement();
stage.addChild(gameLayer);
actionIconsLayer = new Sprite();
gameLayer.addChild(actionIconsLayer);
effectsLayer = new Sprite();
gameLayer.addChild(effectsLayer);
scrollArrowLayer = new Sprite();
stage.addChild(scrollArrowLayer);
stage.addChild(HUDManager.layer);
menuLayer = new Sprite();
stage.addChild(menuLayer);
KeyboardManager.playerInputOff();
startingFirstTurn = true;
moveGameLayerTo(((MapBuilderHelper.BOARD_WIDTH_PIXEL / 2) - (VIEW_WIDTH / 2)), ((MapBuilderHelper.BOARD_HEIGHT_PIXEL / 2) - (VIEW_HEIGHT / 2)));
HUDManager.updateMinimapWindow();
if (musicTimer != null){
musicTimer.removeEventListener(TimerEvent.TIMER, fadeOutMusic);
musicTimer.addEventListener(TimerEvent.TIMER, fadeInMusic);
musicTimer = null;
if (musicChannel != null){
musicChannel.stop();
musicChannel = null;
};
};
musicVolume = 0;
music = new Music_Game();
musicChannel = music.play(0, int.MAX_VALUE);
musicChannel.soundTransform = new SoundTransform(0);
musicTimer = new Timer(20, 50);
musicTimer.addEventListener(TimerEvent.TIMER, fadeInMusic);
musicTimer.start();
if (!player_red_isHuman){
HUDManager.updateScore();
};
finishTurn();
}
public static function cycleThroughAvailableUnits():void{
var _local1:int;
var _local2:Array;
var _local3:Boolean;
var _local4:Obj_Unit;
var _local5:int;
_local1 = -1;
_local2 = ((currentTurn)==TURN_PLAYER_RED) ? redUnitList : blueUnitList;
if (_local2.length <= 1){
if (activeUnit == null){
setActiveUnit(_local2[0]);
};
centerOnActiveUnit();
return;
};
_local3 = false;
if (activeUnit != null){
if (currentTurn == TURN_PLAYER_RED){
_local1 = redUnitList.indexOf(activeUnit);
} else {
_local1 = blueUnitList.indexOf(activeUnit);
};
} else {
_local1 = -1;
};
_local4 = null;
_local5 = (_local1 + 1);
while (_local5 < _local2.length) {
_local4 = Obj_Unit(_local2[_local5]);
if (_local5 != _local1){
_local1 = _local5;
_local3 = true;
break;
};
_local5++;
};
if (!_local3){
_local5 = 0;
while (_local5 < _local1) {
_local4 = Obj_Unit(_local2[_local5]);
if (_local5 != _local1){
_local1 = _local5;
_local3 = true;
break;
};
_local5++;
};
};
if (_local3){
if (activeUnit != null){
activeUnit.unsetAsActiveUnit();
activeUnit = null;
clearUnitHighlightLayer();
};
setActiveUnitWithUnitNumber(_local2[_local1].unitNumber);
} else {
centerOnActiveUnit();
};
_local2 = null;
_local4 = null;
}
public static function quitToMainMenu():void{
KeyboardManager.playerInputOff();
gameLayer.addEventListener(Event.ENTER_FRAME, fadeGameScreenToWhiteAndQuitToMainMenu);
musicTimer = new Timer(20, 50);
musicTimer.addEventListener(TimerEvent.TIMER, fadeOutMusic);
musicTimer.start();
}
private static function shrinkOutMenuScreen(_arg1:Event):void{
if (_arg1.currentTarget.scaleX < 1.5){
_arg1.currentTarget.scaleX = (_arg1.currentTarget.scaleX + 0.075);
_arg1.currentTarget.scaleY = (_arg1.currentTarget.scaleY + 0.075);
};
_arg1.currentTarget.alpha = (_arg1.currentTarget.alpha - 0.11);
if (_arg1.currentTarget.alpha <= 0){
_arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, shrinkOutMenuScreen);
while (menuLayer.numChildren > 0) {
menuLayer.removeChildAt(0);
};
KeyboardManager.playerInputOn();
};
}
public static function unitIsOnScreen(_arg1:Obj_Unit):Boolean{
var _local2:int;
var _local3:int;
_local2 = (_arg1.image.x - getGameLayerX());
_local3 = (_arg1.image.y - getGameLayerY());
if (_local2 <= 0){
return (false);
};
if (_local2 >= VIEW_WIDTH){
return (false);
};
if (_local3 <= 25){
return (false);
};
if (_local3 >= (VIEW_HEIGHT - HUD_HEIGHT)){
return (false);
};
return (true);
}
private static function fadeOutMusic(_arg1:TimerEvent):void{
musicVolume = (musicVolume - 0.02);
musicChannel.soundTransform = new SoundTransform(musicVolume);
if (musicVolume <= 0){
musicTimer.removeEventListener(TimerEvent.TIMER, fadeOutMusic);
musicTimer = null;
musicChannel.stop();
musicChannel = null;
music = null;
};
}
public static function setActiveUnitWithUnitNumber(_arg1:int):void{
var _local2:Obj_Unit;
var _local3:int;
_local2 = activeUnit;
if (currentTurn == TURN_PLAYER_BLUE){
_local3 = 0;
while (_local3 < blueUnitList.length) {
if (Obj_Unit(blueUnitList[_local3]).unitNumber == _arg1){
setActiveUnit(Obj_Unit(blueUnitList[_local3]));
break;
};
_local3++;
};
} else {
_local3 = 0;
while (_local3 < redUnitList.length) {
if (Obj_Unit(redUnitList[_local3]).unitNumber == _arg1){
setActiveUnit(Obj_Unit(redUnitList[_local3]));
break;
};
_local3++;
};
};
if (((!((_local2 == activeUnit))) && (!((activeUnit == null))))){
centerOnActiveUnit();
HUDManager.updateMinimapWindow();
setupSelectionIconsForUnitsOnScreen();
};
}
private static function placeActionBubbleAt(_arg1, _arg2:int):MovieClip_ActionBubble{
var _local3:MovieClip_ActionBubble;
_local3 = new MovieClip_ActionBubble();
_local3.alpha = 0.75;
_local3.gotoAndStop(1);
if (squareAt[_arg1][_arg2].isWaterTerrain()){
if (((!((activeUnit.unitType == Obj_Unit.UNIT_TYPE_SKIMMER))) && (!((activeUnit.unitType == Obj_Unit.UNIT_TYPE_COPTER))))){
return (null);
};
};
if (squareAt[_arg1][_arg2].unit == null){
_local3.x = squareAt[_arg1][_arg2].getX();
_local3.y = squareAt[_arg1][_arg2].getY();
} else {
if (squareAt[_arg1][_arg2].unit.sideColor != activeUnit.sideColor){
_local3.x = squareAt[_arg1][_arg2].unit.image.x;
_local3.y = (squareAt[_arg1][_arg2].unit.image.y - (squareAt[_arg1][_arg2].unit.image.height / 2));
if (squareAt[_arg1][_arg2].unit.selectionIcon != null){
squareAt[_arg1][_arg2].unit.moveSelectionIconToAltPosition();
};
} else {
_local3 = null;
};
};
if (_local3 != null){
actionIconsLayer.addChild(_local3);
};
return (_local3);
}
public static function showActiveUnitOptions():void{
var _local1:int;
var _local2:int;
var _local3:Boolean;
var _local4:Bitmap;
if (activeUnit == null){
return;
};
clearUnitHighlightLayer();
clearActionBubblesOnly();
_local1 = activeUnit.getXIndex();
_local2 = activeUnit.getYIndex();
_local3 = false;
if (activeUnit.sideColor == ComputerPlayer.SIDE_PLAYER_BLUE){
if ((((currentTurn == TURN_PLAYER_RED)) || (!(player_blue_isHuman)))){
_local3 = true;
};
} else {
if ((((currentTurn == TURN_PLAYER_BLUE)) || (!(player_red_isHuman)))){
_local3 = true;
};
};
_local4 = (_local3) ? new Bitmap(new Bitmap_ActiveUnitHighlight_Enemy(0, 0)) : new Bitmap(new Bitmap_ActiveUnitHighlight_Friendly(0, 0));
_local4.x = (squareAt[_local1][_local2].getX() - 129);
_local4.y = (squareAt[_local1][_local2].getY() - 64);
if (squareAt[_local1][_local2].isWaterTerrain()){
_local4.alpha = UNIT_HIGHLIGHT_ALPHA_ON_WATER;
} else {
_local4.alpha = UNIT_HIGHLIGHT_ALPHA_ON_NORMAL;
};
unitHighlightLayer.addChild(_local4);
if (((!(_local3)) && (!((activeUnit.unitType == Obj_Unit.UNIT_TYPE_BUNKER))))){
if (_local1 < 8){
downLeftActionBubble = placeActionBubbleAt((_local1 + 1), _local2);
addActionBubbleText(downLeftActionBubble, KeyboardManager.KEY_DOWNLEFT, (_local1 + 1), _local2);
};
if (_local2 < 13){
downRightActionBubble = placeActionBubbleAt(_local1, (_local2 + 1));
addActionBubbleText(downRightActionBubble, KeyboardManager.KEY_DOWNRIGHT, _local1, (_local2 + 1));
};
if (_local1 > 0){
upRightActionBubble = placeActionBubbleAt((_local1 - 1), _local2);
addActionBubbleText(upRightActionBubble, KeyboardManager.KEY_UPRIGHT, (_local1 - 1), _local2);
};
if (_local2 > 0){
upLeftActionBubble = placeActionBubbleAt(_local1, (_local2 - 1));
addActionBubbleText(upLeftActionBubble, KeyboardManager.KEY_UPLEFT, _local1, (_local2 - 1));
};
};
}
private static function setupUnitPlacement():void{
var _local1:int;
new Obj_Unit(squareAt[8][7], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_BUNKER);
new Obj_Unit(squareAt[8][10], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_SUPERTANK);
new Obj_Unit(squareAt[8][13], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_BATTLETANK);
new Obj_Unit(squareAt[8][4], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_BATTLETANK);
new Obj_Unit(squareAt[8][0], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_BATTLETANK);
new Obj_Unit(squareAt[7][1], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_COPTER);
new Obj_Unit(squareAt[6][2], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_SKIMMER);
new Obj_Unit(squareAt[6][0], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_SKIMMER);
new Obj_Unit(squareAt[7][10], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_SKIMMER);
new Obj_Unit(squareAt[7][8], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_HUMVEE);
new Obj_Unit(squareAt[7][6], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_HUMVEE);
new Obj_Unit(squareAt[6][7], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_HUMVEE);
new Obj_Unit(squareAt[7][11], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_HALFTRAK);
new Obj_Unit(squareAt[7][3], ComputerPlayer.SIDE_PLAYER_BLUE, Obj_Unit.UNIT_TYPE_HALFTRAK);
_local1 = (blueUnitList.length - 1);
while (_local1 >= 1) {
Obj_Unit(blueUnitList[_local1]).setVerticalFacing(true);
Obj_Unit(blueUnitList[_local1]).stopFiring();
Obj_Unit(blueUnitList[_local1]).image.scaleX = -1;
_local1--;
};
new Obj_Unit(squareAt[0][6], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_BUNKER);
new Obj_Unit(squareAt[0][3], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_SUPERTANK);
new Obj_Unit(squareAt[0][0], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_BATTLETANK);
new Obj_Unit(squareAt[0][9], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_BATTLETANK);
new Obj_Unit(squareAt[0][13], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_BATTLETANK);
new Obj_Unit(squareAt[1][12], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_COPTER);
new Obj_Unit(squareAt[2][11], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_SKIMMER);
new Obj_Unit(squareAt[2][13], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_SKIMMER);
new Obj_Unit(squareAt[1][3], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_SKIMMER);
new Obj_Unit(squareAt[1][5], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_HUMVEE);
new Obj_Unit(squareAt[1][7], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_HUMVEE);
new Obj_Unit(squareAt[2][6], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_HUMVEE);
new Obj_Unit(squareAt[1][2], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_HALFTRAK);
new Obj_Unit(squareAt[1][10], ComputerPlayer.SIDE_PLAYER_RED, Obj_Unit.UNIT_TYPE_HALFTRAK);
}
public static function disposeUnit(_arg1:Obj_Unit, _arg2:Boolean):void{
var _local3:Object;
unitLayer.removeChild(_arg1.image);
HUDManager.removeMinimapDot(_arg1);
_arg1.image.gotoAndStop(1);
_arg1.image = null;
if (!_arg2){
_local3 = new Object();
_local3.icon = _arg1.forceOverviewIcon;
_local3.unitNumber = _arg1.unitNumber;
_local3.sideColor = _arg1.sideColor;
HUDManager.destroyedUnitForceOverviewIcons.push(_local3);
_arg1.setForceOverviewIcon(Obj_Unit.FORCE_OVERVIEW_ICON_DESTROYED);
};
_arg1.forceOverviewIcon = null;
_arg1.forceOverviewNumberIcon = null;
unitList.splice(unitList.indexOf(_arg1), 1);
if (_arg1.sideColor == ComputerPlayer.SIDE_PLAYER_BLUE){
blueUnitList.splice(blueUnitList.indexOf(_arg1), 1);
} else {
redUnitList.splice(redUnitList.indexOf(_arg1), 1);
};
}
private static function shrinkInMenuScreen(_arg1:Event):void{
if (_arg1.currentTarget.scaleX > 1){
_arg1.currentTarget.scaleX = (_arg1.currentTarget.scaleX - 0.075);
_arg1.currentTarget.scaleY = (_arg1.currentTarget.scaleY - 0.075);
} else {
_arg1.currentTarget.scaleX = 1;
_arg1.currentTarget.scaleY = 1;
};
_arg1.currentTarget.alpha = (_arg1.currentTarget.alpha + 0.11);
if (_arg1.currentTarget.alpha >= 1){
_arg1.currentTarget.alpha = 1;
_arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, shrinkInMenuScreen);
KeyboardManager.playerInputOn();
};
}
public static function setupSelectionIconsForUnitsOnScreen():void{
var _local1:Obj_Unit;
var _local2:int;
var _local3:MovieClip_UnitNumberIcon;
var _local4:int;
clearActionIconsLayer();
_local2 = 0;
_local4 = (unitList.length - 1);
while (_local4 >= 0) {
_local1 = Obj_Unit(unitList[_local4]);
if (!unitIsOnScreen(_local1)){
} else {
unitWithSelectionIcon.push(_local1);
_local3 = new MovieClip_UnitNumberIcon();
_local3.gotoAndStop((_local2 + 1));
_local1.selectionIcon = _local3;
_local1.moveSelectionIconToMainPosition();
_local2 = (_local2 + 1);
actionIconsLayer.addChild(_local3);
};
_local4--;
};
if (activeUnit != null){
showActiveUnitOptions();
};
}
public static function cleareffectsLayer():void{
var _local1:int;
_local1 = (effectsLayer.numChildren - 1);
while (_local1 >= 0) {
effectsLayer.removeChildAt(_local1);
_local1--;
};
}
public static function bringInMenuScreen():void{
var _local1:Bitmap;
var _local2:MovieClip_Menu_Screen;
KeyboardManager.playerInputOff();
if (menuScreenShowing){
menuScreenShowing = false;
menuLayer.getChildAt(0).addEventListener(Event.ENTER_FRAME, AnimateHelper.fadeOutFastAndLight);
menuLayer.getChildAt(1).addEventListener(Event.ENTER_FRAME, shrinkOutMenuScreen);
} else {
menuScreenShowing = true;
_local1 = new Bitmap(new Bitmap_BlackDot(0, 0));
_local1.x = 0;
_local1.y = 0;
_local1.scaleX = riverwar.VIEW_WIDTH;
_local1.scaleY = riverwar.VIEW_HEIGHT;
_local1.alpha = 0;
_local1.addEventListener(Event.ENTER_FRAME, AnimateHelper.fadeInFastAndLight);
menuLayer.addChild(_local1);
_local2 = new MovieClip_Menu_Screen();
_local2.gotoAndStop(1);
_local2.x = (VIEW_WIDTH / 2);
_local2.y = (VIEW_HEIGHT / 2);
_local2.scaleX = 1.75;
_local2.scaleY = 1.75;
_local2.alpha = 0;
_local2.addEventListener(Event.ENTER_FRAME, shrinkInMenuScreen);
menuLayer.addChild(_local2);
};
}
private static function addActionBubbleText(_arg1:MovieClip_ActionBubble, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:Bitmap;
var _local6:int;
var _local7:int;
var _local8:Bitmap;
var _local9:Bitmap;
if (_arg1 == null){
return;
};
_local5 = null;
if (squareAt[_arg3][_arg4].unit == null){
switch (_arg2){
case KeyboardManager.KEY_UPLEFT:
_local5 = new Bitmap(new Bitmap_MoveUpLeftText(0, 0));
break;
case KeyboardManager.KEY_UPRIGHT:
_local5 = new Bitmap(new Bitmap_MoveUpRightText(0, 0));
break;
case KeyboardManager.KEY_DOWNLEFT:
_local5 = new Bitmap(new Bitmap_MoveDownLeftText(0, 0));
break;
case KeyboardManager.KEY_DOWNRIGHT:
_local5 = new Bitmap(new Bitmap_MoveDownRightText(0, 0));
break;
};
_local5.x = (_arg1.x - (_local5.width / 2));
_local5.y = (((_arg1.y - (_arg1.height / 2)) - (_local5.height / 2)) - 5);
} else {
switch (_arg2){
case KeyboardManager.KEY_UPLEFT:
_local5 = new Bitmap(new Bitmap_AttackUpLeftText(0, 0));
break;
case KeyboardManager.KEY_UPRIGHT:
_local5 = new Bitmap(new Bitmap_AttackUpRightText(0, 0));
break;
case KeyboardManager.KEY_DOWNLEFT:
_local5 = new Bitmap(new Bitmap_AttackDownLeftText(0, 0));
break;
case KeyboardManager.KEY_DOWNRIGHT:
_local5 = new Bitmap(new Bitmap_AttackDownRightText(0, 0));
break;
};
_local5.x = (_arg1.x - (_local5.width / 2));
_local5.y = ((_arg1.y - _arg1.height) + 3);
_local6 = getWinningPercentage(activeUnit, squareAt[_arg3][_arg4].unit);
_local7 = (100 - _local6);
_local8 = new Bitmap(new Bitmap_WinEqualsText(0, 0));
_local8.x = ((_arg1.x - (_arg1.width / 2)) + 5);
_local8.y = ((_local5.y + _local5.height) + 2);
actionIconsLayer.addChild(_local8);
addPercentageToLayer(actionIconsLayer, _local6, (_local8.x + 1), ((_local8.y + _local8.height) + 1), true);
_local9 = new Bitmap(new Bitmap_LoseEqualsText(0, 0));
_local9.x = ((_local8.x + _local8.width) + 25);
_local9.y = _local8.y;
actionIconsLayer.addChild(_local9);
addPercentageToLayer(actionIconsLayer, _local7, (_local9.x + 1), ((_local9.y + _local9.height) + 1), false);
};
actionIconsLayer.addChild(_local5);
}
private static function getPercentageDigit(_arg1:String, _arg2:Boolean):Bitmap{
var _local3:Bitmap;
_local3 = null;
if (_arg2){
switch (_arg1){
case "0":
_local3 = new Bitmap(new Bitmap_Percentage0_Green(0, 0));
break;
case "1":
_local3 = new Bitmap(new Bitmap_Percentage1_Green(0, 0));
break;
case "2":
_local3 = new Bitmap(new Bitmap_Percentage2_Green(0, 0));
break;
case "3":
_local3 = new Bitmap(new Bitmap_Percentage3_Green(0, 0));
break;
case "4":
_local3 = new Bitmap(new Bitmap_Percentage4_Green(0, 0));
break;
case "5":
_local3 = new Bitmap(new Bitmap_Percentage5_Green(0, 0));
break;
case "6":
_local3 = new Bitmap(new Bitmap_Percentage6_Green(0, 0));
break;
case "7":
_local3 = new Bitmap(new Bitmap_Percentage7_Green(0, 0));
break;
case "8":
_local3 = new Bitmap(new Bitmap_Percentage8_Green(0, 0));
break;
case "9":
_local3 = new Bitmap(new Bitmap_Percentage9_Green(0, 0));
break;
};
} else {
switch (_arg1){
case "0":
_local3 = new Bitmap(new Bitmap_Percentage0_Red(0, 0));
break;
case "1":
_local3 = new Bitmap(new Bitmap_Percentage1_Red(0, 0));
break;
case "2":
_local3 = new Bitmap(new Bitmap_Percentage2_Red(0, 0));
break;
case "3":
_local3 = new Bitmap(new Bitmap_Percentage3_Red(0, 0));
break;
case "4":
_local3 = new Bitmap(new Bitmap_Percentage4_Red(0, 0));
break;
case "5":
_local3 = new Bitmap(new Bitmap_Percentage5_Red(0, 0));
break;
case "6":
_local3 = new Bitmap(new Bitmap_Percentage6_Red(0, 0));
break;
case "7":
_local3 = new Bitmap(new Bitmap_Percentage7_Red(0, 0));
break;
case "8":
_local3 = new Bitmap(new Bitmap_Percentage8_Red(0, 0));
break;
case "9":
_local3 = new Bitmap(new Bitmap_Percentage9_Red(0, 0));
break;
};
};
return (_local3);
}
public static function getWinningPercentage(_arg1:Obj_Unit, _arg2:Obj_Unit):int{
var _local3:int;
var _local4:int;
_local3 = _arg1.attack;
if ((((_arg1.square.squareType == Obj_Square.TYPE_TRAP)) && (!(_arg1.notAffectedByTraps)))){
_local3 = 1;
};
_local4 = _arg2.attack;
if ((((_arg2.square.squareType == Obj_Square.TYPE_TRAP)) && (!(_arg2.notAffectedByTraps)))){
_local4 = 1;
};
if (_arg1.unitType == Obj_Unit.UNIT_TYPE_COPTER){
if ((((_arg2.unitType == Obj_Unit.UNIT_TYPE_BATTLETANK)) || ((_arg2.unitType == Obj_Unit.UNIT_TYPE_SUPERTANK)))){
return (TANK_HUNTER_VS_TANK_WIN_CHANCE);
};
} else {
if (_arg2.unitType == Obj_Unit.UNIT_TYPE_COPTER){
if ((((_arg1.unitType == Obj_Unit.UNIT_TYPE_BATTLETANK)) || ((_arg1.unitType == Obj_Unit.UNIT_TYPE_SUPERTANK)))){
return ((100 - TANK_HUNTER_VS_TANK_WIN_CHANCE));
};
};
};
return (Math.floor(((_local3 / (_local3 + _local4)) * 100)));
}
public static function unsetActiveUnitIfAny():void{
if (activeUnit != null){
activeUnit.unsetAsActiveUnit();
activeUnit = null;
clearUnitHighlightLayer();
setupSelectionIconsForUnitsOnScreen();
};
}
private static function fadeGameScreenToWhiteAndQuitToMainMenu(_arg1:Event):void{
backgroundDotColor.alpha = (backgroundDotColor.alpha - SCREEN_FADE_OUT_SPEED);
gameLayer.alpha = (gameLayer.alpha - SCREEN_FADE_OUT_SPEED);
menuLayer.alpha = (menuLayer.alpha - SCREEN_FADE_OUT_SPEED);
HUDManager.layer.alpha = (HUDManager.layer.alpha - SCREEN_FADE_OUT_SPEED);
if (gameLayer.alpha <= 0){
gameLayer.removeEventListener(Event.ENTER_FRAME, fadeGameScreenToWhiteAndQuitToMainMenu);
disposeGame();
riverwar.instance.gotoAndStop(FRAME_MENU);
};
}
public static function clearActionIconsLayer():void{
var _local1:int;
upLeftActionBubble = null;
upRightActionBubble = null;
downLeftActionBubble = null;
downRightActionBubble = null;
_local1 = (actionIconsLayer.numChildren - 1);
while (_local1 >= 0) {
actionIconsLayer.removeChildAt(_local1);
_local1--;
};
_local1 = (unitWithSelectionIcon.length - 1);
while (_local1 >= 0) {
unitWithSelectionIcon[_local1].selectionIcon = null;
_local1--;
};
unitWithSelectionIcon.splice(0, unitWithSelectionIcon.length);
clearUnitHighlightLayer();
}
public static function setActiveUnit(_arg1:Obj_Unit):void{
var _local2:int;
if (activeUnit != _arg1){
if (activeUnit != null){
activeUnit.unsetAsActiveUnit();
};
activeUnit = _arg1;
activeUnit.minimapDot.gotoAndStop(1);
activeUnit.setForceOverviewIcon(Obj_Unit.FORCE_OVERVIEW_ICON_SELECTED);
_local2 = (unitWithSelectionIcon.length - 1);
while (_local2 >= 0) {
unitWithSelectionIcon[_local2].moveSelectionIconToMainPosition();
_local2--;
};
} else {
unsetActiveUnitIfAny();
};
HUDManager.updateActiveUnitInfo();
}
public static function getGameLayerX():int{
return (gameLayer.scrollRect.x);
}
public static function getGameLayerY():int{
return (gameLayer.scrollRect.y);
}
private static function disposeGame():void{
var _local1:int;
stageRef.removeChild(backgroundDotColor);
backgroundDotColor = null;
currentTurn = 1;
score = 0;
AnimateHelper.dispose();
ComputerPlayer.disposeResources();
HUDManager.dispose();
squareAt.splice(0, squareAt.length);
squareAt = null;
unitWithSelectionIcon.splice(0, unitWithSelectionIcon.length);
unitWithSelectionIcon = null;
_local1 = (unitList.length - 1);
while (_local1 >= 0) {
disposeUnit(unitList[_local1], true);
_local1--;
};
unitList.splice(unitList.length);
unitList = null;
redUnitList.splice(0, redUnitList.length);
redUnitList = null;
blueUnitList.splice(0, blueUnitList.length);
blueUnitList = null;
KeyboardManager.dispose(stageRef);
while (unitHighlightLayer.numChildren > 0) {
unitHighlightLayer.removeChildAt(0);
};
unitHighlightLayer = null;
while (unitLayer.numChildren > 0) {
unitLayer.removeChildAt(0);
};
unitLayer = null;
while (gameLayer.numChildren > 0) {
gameLayer.removeChildAt(0);
};
stageRef.removeChild(gameLayer);
gameLayer = null;
while (actionIconsLayer.numChildren > 0) {
actionIconsLayer.removeChildAt(0);
};
actionIconsLayer = null;
while (effectsLayer.numChildren > 0) {
effectsLayer.removeChildAt(0);
};
effectsLayer = null;
while (scrollArrowLayer.numChildren > 0) {
scrollArrowLayer.removeChildAt(0);
};
stageRef.removeChild(scrollArrowLayer);
scrollArrowLayer = null;
stageRef.removeChild(HUDManager.layer);
HUDManager.layer = null;
while (menuLayer.numChildren > 0) {
menuLayer.removeChildAt(0);
};
stageRef.removeChild(menuLayer);
menuLayer = null;
activeUnit = null;
stageRef = null;
}
public static function finishTurn():void{
if (currentTurn == TURN_PLAYER_BLUE){
currentTurn = TURN_PLAYER_RED;
if (player_red_isHuman){
HUDManager.setupForceOverviewLayer(TURN_PLAYER_RED);
if (startingFirstTurn){
stageRef.addEventListener(Event.ENTER_FRAME, fadeInFromMainmenu);
} else {
riverwar.setupSelectionIconsForUnitsOnScreen();
KeyboardManager.playerInputOn();
};
} else {
if (startingFirstTurn){
stageRef.addEventListener(Event.ENTER_FRAME, fadeInFromMainmenu);
} else {
ComputerPlayer.performMove(ComputerPlayer.SIDE_PLAYER_RED);
};
};
} else {
currentTurn = TURN_PLAYER_BLUE;
if (player_blue_isHuman){
HUDManager.setupForceOverviewLayer(TURN_PLAYER_BLUE);
if (startingFirstTurn){
stageRef.addEventListener(Event.ENTER_FRAME, fadeInFromMainmenu);
} else {
riverwar.setupSelectionIconsForUnitsOnScreen();
KeyboardManager.playerInputOn();
if (!player_red_isHuman){
score = (score - SCORE_PENALTY_PER_TURN);
score = Math.max(score, 0);
HUDManager.updateScore();
};
};
} else {
if (startingFirstTurn){
stageRef.addEventListener(Event.ENTER_FRAME, fadeInFromMainmenu);
} else {
ComputerPlayer.performMove(ComputerPlayer.SIDE_PLAYER_BLUE);
};
};
};
HUDManager.updateWhoseTurnIconStatus();
HUDManager.updateActiveUnitInfo();
}
public static function actionBubblePressedCallback(_arg1:MovieClip_ActionBubble):void{
switch (_arg1){
case upLeftActionBubble:
AnimateHelper.moveUnitToSquare(riverwar.squareAt[riverwar.activeUnit.getXIndex()][riverwar.activeUnit.getYIndex()], riverwar.squareAt[riverwar.activeUnit.getXIndex()][(riverwar.activeUnit.getYIndex() - 1)]);
break;
case upRightActionBubble:
AnimateHelper.moveUnitToSquare(riverwar.squareAt[riverwar.activeUnit.getXIndex()][riverwar.activeUnit.getYIndex()], riverwar.squareAt[(riverwar.activeUnit.getXIndex() - 1)][riverwar.activeUnit.getYIndex()]);
break;
case downRightActionBubble:
AnimateHelper.moveUnitToSquare(riverwar.squareAt[riverwar.activeUnit.getXIndex()][riverwar.activeUnit.getYIndex()], riverwar.squareAt[riverwar.activeUnit.getXIndex()][(riverwar.activeUnit.getYIndex() + 1)]);
break;
case downLeftActionBubble:
AnimateHelper.moveUnitToSquare(riverwar.squareAt[riverwar.activeUnit.getXIndex()][riverwar.activeUnit.getYIndex()], riverwar.squareAt[(riverwar.activeUnit.getXIndex() + 1)][riverwar.activeUnit.getYIndex()]);
break;
};
}
public static function getGameLayer():Sprite{
return (gameLayer);
}
private static function fadeInFromMainmenu(_arg1:Event):void{
backgroundDotColor.alpha = (backgroundDotColor.alpha + 0.08);
gameLayer.alpha = (gameLayer.alpha + 0.08);
HUDManager.layer.alpha = (HUDManager.layer.alpha + 0.08);
if (gameLayer.alpha >= 1){
gameLayer.alpha = 1;
HUDManager.layer.alpha = 1;
stageRef.removeEventListener(Event.ENTER_FRAME, fadeInFromMainmenu);
startingFirstTurn = false;
if (currentTurn == TURN_PLAYER_BLUE){
if (player_blue_isHuman){
riverwar.setupSelectionIconsForUnitsOnScreen();
KeyboardManager.playerInputOn();
} else {
ComputerPlayer.performMove(ComputerPlayer.SIDE_PLAYER_BLUE);
};
} else {
if (player_red_isHuman){
riverwar.setupSelectionIconsForUnitsOnScreen();
KeyboardManager.playerInputOn();
} else {
ComputerPlayer.performMove(ComputerPlayer.SIDE_PLAYER_RED);
};
};
};
}
public static function clearUnitHighlightLayer():void{
var _local1:int;
_local1 = (unitHighlightLayer.numChildren - 1);
while (_local1 >= 0) {
unitHighlightLayer.removeChildAt(_local1);
_local1--;
};
}
public static function clearActionBubblesOnly():void{
var _local1:int;
upLeftActionBubble = null;
upRightActionBubble = null;
downLeftActionBubble = null;
downRightActionBubble = null;
_local1 = (actionIconsLayer.numChildren - 1);
while (_local1 >= 0) {
if (!(actionIconsLayer.getChildAt(_local1) is MovieClip_UnitNumberIcon)){
actionIconsLayer.removeChildAt(_local1);
};
_local1--;
};
}
public static function setActiveUnitOnScreenWithSelectionNumber(_arg1:int):void{
if ((unitWithSelectionIcon.length - 1) >= _arg1){
setActiveUnit(unitWithSelectionIcon[_arg1]);
};
showActiveUnitOptions();
}
public static function moveGameLayerTo(_arg1:int, _arg2:int):void{
var _local3:Rectangle;
_arg1 = Math.max(_arg1, 0);
_arg2 = Math.max(_arg2, 0);
_arg1 = Math.min((MapBuilderHelper.BOARD_WIDTH_PIXEL - riverwar.VIEW_WIDTH), _arg1);
_arg2 = Math.min((((MapBuilderHelper.BOARD_HEIGHT_PIXEL - riverwar.VIEW_HEIGHT) + riverwar.HUD_HEIGHT) + riverwar.ACTION_BUBBLE_HEIGHT), _arg2);
_local3 = riverwar.gameLayer.scrollRect;
_local3.x = _arg1;
_local3.y = _arg2;
riverwar.gameLayer.scrollRect = _local3;
}
private static function fadeInMusic(_arg1:TimerEvent):void{
musicVolume = (musicVolume + 0.02);
musicChannel.soundTransform = new SoundTransform(musicVolume);
if (musicVolume >= 0.5){
musicTimer.removeEventListener(TimerEvent.TIMER, fadeInMusic);
musicTimer = null;
};
}
public static function centerOnActiveUnit():void{
if (activeUnit == null){
return;
};
moveGameLayerTo((activeUnit.getX() - (VIEW_WIDTH / 2)), (activeUnit.getY() - (VIEW_HEIGHT / 2)));
HUDManager.updateMinimapWindow();
setupSelectionIconsForUnitsOnScreen();
}
private static function addPercentageToLayer(_arg1:Sprite, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean):void{
var _local6:String;
var _local7:Bitmap;
_local6 = _arg2.toString();
_local7 = null;
if (_arg2 == 100){
_local7 = getPercentageDigit(_local6.charAt(0), _arg5);
_local7.x = _arg3;
_local7.y = _arg4;
_arg1.addChild(_local7);
_arg3 = (_arg3 + _local7.width);
_local7 = getPercentageDigit(_local6.charAt(1), _arg5);
_local7.x = _arg3;
_local7.y = _arg4;
_arg1.addChild(_local7);
_arg3 = (_arg3 + _local7.width);
_local7 = getPercentageDigit(_local6.charAt(2), _arg5);
_local7.x = _arg3;
_local7.y = _arg4;
_arg1.addChild(_local7);
_arg3 = (_arg3 + _local7.width);
} else {
if (_arg2 >= 10){
_local7 = getPercentageDigit(_local6.charAt(0), _arg5);
_local7.x = _arg3;
_local7.y = _arg4;
_arg1.addChild(_local7);
_arg3 = (_arg3 + _local7.width);
_local7 = getPercentageDigit(_local6.charAt(1), _arg5);
_local7.x = _arg3;
_local7.y = _arg4;
_arg1.addChild(_local7);
_arg3 = (_arg3 + _local7.width);
} else {
_local7 = getPercentageDigit(_local6.charAt(0), _arg5);
_local7.x = (_arg3 + _local7.width);
_local7.y = _arg4;
_arg1.addChild(_local7);
_arg3 = (_arg3 + (_local7.width * 2));
};
};
if (_arg5){
_local7 = new Bitmap(new Bitmap_Percentage_Green(0, 0));
} else {
_local7 = new Bitmap(new Bitmap_Percentage_Red(0, 0));
};
_local7.x = _arg3;
_local7.y = _arg4;
_arg1.addChild(_local7);
}
}
}//package
Section 155
//Sound_Explosion (Sound_Explosion)
package {
import flash.media.*;
public dynamic class Sound_Explosion extends Sound {
}
}//package
Section 156
//Sound_MachineGun (Sound_MachineGun)
package {
import flash.media.*;
public dynamic class Sound_MachineGun extends Sound {
}
}//package
Section 157
//Sound_Tankshot (Sound_Tankshot)
package {
import flash.media.*;
public dynamic class Sound_Tankshot extends Sound {
}
}//package