Section 1
//png (Bat_Bottom.png)
package Bat_Bottom {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Bat_Bottom
Section 2
//png (Bat_Top.png)
package Bat_Top {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Bat_Top
Section 3
//png (Blast_Base.png)
package Blast_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Blast_Base
Section 4
//png (Blast_Mask.png)
package Blast_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Blast_Mask
Section 5
//png (Building_House_01.png)
package Building_House_01 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Building_House_01
Section 6
//png (Building_House_02.png)
package Building_House_02 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Building_House_02
Section 7
//png (Building_Townhall.png)
package Building_Townhall {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Building_Townhall
Section 8
//wav (ButtonPress.wav)
package ButtonPress {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package ButtonPress
Section 9
//png (Chakram_Base.png)
package Chakram_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Chakram_Base
Section 10
//png (Chakram_Mask.png)
package Chakram_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Chakram_Mask
Section 11
//Loop (com.gamedozer.audio.Loop)
package com.gamedozer.audio {
import flash.media.*;
public class Loop {
var m_musicChannel:SoundChannel;// = null
var m_sound:Sound;
public function Loop(_arg1:Sound){
m_musicChannel = null;
super();
initialize(_arg1);
}
public function play(){
if (m_musicChannel != null){
trace("Loop.play: Tried to play and already playing loop.");
return;
};
m_musicChannel = m_sound.play(0, 999999999);
}
public function initialize(_arg1:Sound){
m_sound = _arg1;
if (m_musicChannel != null){
m_musicChannel.stop();
};
m_musicChannel = null;
}
public function stop(){
if (m_musicChannel == null){
return;
};
m_musicChannel.stop();
m_musicChannel = null;
}
}
}//package com.gamedozer.audio
Section 12
//SoundSystem (com.gamedozer.audio.SoundSystem)
package com.gamedozer.audio {
import flash.media.*;
import flash.utils.*;
public class SoundSystem {
var m_loopChannel:SoundChannel;// = null
var m_isMuted:Boolean;// = false
static var s_singleton:SoundSystem = null;
public function SoundSystem(){
m_loopChannel = null;
m_isMuted = false;
super();
s_singleton = this;
}
function updateMute(){
if (m_isMuted){
changeVolume(0);
} else {
changeVolume(1);
};
}
public function stopLoop(){
if (m_loopChannel != null){
m_loopChannel.stop();
m_loopChannel = null;
};
}
public function isMuted():Boolean{
return (m_isMuted);
}
public function changeVolume(_arg1:Number){
var _local2:SoundTransform;
_local2 = new SoundTransform();
_local2.volume = _arg1;
SoundMixer.soundTransform = _local2;
}
public function playSoundLinkage(_arg1:String){
var _local2:Class;
var _local3:Sound;
_local2 = (getDefinitionByName(_arg1) as Class);
_local3 = (new (_local2) as Sound);
playSound(_local3);
}
public function unmute(){
m_isMuted = false;
updateMute();
}
public function toggleMute(){
m_isMuted = !(m_isMuted);
updateMute();
}
public function playLoop(_arg1:Sound){
if (m_loopChannel != null){
m_loopChannel.stop();
m_loopChannel = null;
};
m_loopChannel = _arg1.play(0, 999999999);
}
public function mute(){
m_isMuted = true;
updateMute();
}
public function playSound(_arg1:Sound){
_arg1.play();
}
public function playLoopLinkage(_arg1:String){
var _local2:Class;
var _local3:Sound;
if (m_loopChannel != null){
m_loopChannel.stop();
};
_local2 = (getDefinitionByName(_arg1) as Class);
_local3 = (new (_local2) as Sound);
playLoop(_local3);
}
public static function getSingleton():SoundSystem{
if (s_singleton == null){
return (new (SoundSystem));
};
return (s_singleton);
}
}
}//package com.gamedozer.audio
Section 13
//GameEventInterface (com.gamedozer.GameEvent.GameEventInterface)
package com.gamedozer.GameEvent {
public interface GameEventInterface {
function fire();
}
}//package com.gamedozer.GameEvent
Section 14
//GameEventQueue (com.gamedozer.GameEvent.GameEventQueue)
package com.gamedozer.GameEvent {
public class GameEventQueue {
var m_queue:Array;
public function GameEventQueue(){
m_queue = new Array();
}
private function fireEvent(){
if (m_queue.length == 0){
return;
};
m_queue[0].fire();
}
public function queueGameEvent(_arg1:GameEventInterface){
m_queue.push(_arg1);
if (m_queue.length == 1){
fireEvent();
};
}
public function signalEventComplete(){
m_queue.splice(0, 1);
fireEvent();
}
public function clearEvents(){
m_queue.splice(0);
}
}
}//package com.gamedozer.GameEvent
Section 15
//ColoredSprite (com.gamedozer.graphics.ColoredSprite)
package com.gamedozer.graphics {
import flash.display.*;
import flash.geom.*;
public class ColoredSprite extends Sprite {
var m_image:Bitmap;
public function ColoredSprite(_arg1:BitmapData, _arg2:BitmapData=null, _arg3:uint=4294967295, _arg4:String="overlay"){
loadImage(_arg1, _arg2, _arg3, _arg4);
}
private function loadImage(_arg1:BitmapData, _arg2:BitmapData, _arg3:uint, _arg4:String):void{
var _local5:BitmapData;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local5 = new BitmapData(_arg1.width, _arg1.height, _arg1.transparent);
_local5.copyPixels(_arg1, _arg1.rect, new Point(0, 0));
if (_arg2 != null){
_local6 = 1;
_local7 = (((_arg3 & 0xFF0000) >> 16) / 0xFF);
_local8 = (((_arg3 & 0xFF00) >> 8) / 0xFF);
_local9 = ((_arg3 & 0xFF) / 0xFF);
_local5.draw(_arg2, null, new ColorTransform(_local7, _local8, _local9, _local6, 0, 0, 0, 0), _arg4);
};
m_image = new Bitmap(_local5);
addChild(m_image);
}
public function dispose(){
m_image = null;
}
public function getBitmapData():BitmapData{
return (m_image.bitmapData);
}
public function change(_arg1:BitmapData, _arg2:BitmapData=null, _arg3:uint=4294967295, _arg4:String="overlay"):void{
removeChild(m_image);
loadImage(_arg1, _arg2, _arg3, _arg4);
}
}
}//package com.gamedozer.graphics
Section 16
//ColorizerEntry (com.gamedozer.graphics.ColorizerEntry)
package com.gamedozer.graphics {
class ColorizerEntry {
var rgb:uint;
}
}//package com.gamedozer.graphics
import flash.utils.*;
import com.gamedozer.utils.*;
import flash.geom.*;
import com.gamedozer.graphics.*;
class Colorizer {
var m_colorizerMap:Dictionary;
public static const kDarkGreen:String = "Dark Green";
public static const kDarthGreen:String = "Darth Green";
public static const kAlmostBlack:String = "Almost Black";
public static const kShinyBlue:String = "Shiny Blue";
public static const kRayPink:String = "Ray Pink";
public static const kGreen:String = "Green";
public static const kSilveryGrey:String = "Silvery Grey";
public static const kBlue:String = "Blue";
public static const kRed:String = "Red";
public static const kLightGreen:String = "Light Green";
public static const kGrey:String = "Grey";
public static const kGreyBrown:String = "Grey Brown";
public static const kSoftBlue:String = "Soft Blue";
public static const kLightBlue:String = "Light Blue";
public static const kEvilPurple:String = "Evil Purple";
public static const kYellow:String = "Yellow";
public function Colorizer(){
m_colorizerMap = new Dictionary(true);
createDefaultColors();
}
public function lookupTransform(_arg1:String):ColorTransform{
var _local2:ColorizerEntry;
var _local3:ColorTransform;
if (m_colorizerMap[_arg1] == null){
Console.error(("ColorizerRegistry.getColorizerTransform. No color with name: " + _arg1));
return (null);
};
_local2 = m_colorizerMap[_arg1];
_local3 = new ColorTransform();
_local3.color = _local2.rgb;
return (_local3);
}
private function createDefaultColors(){
createColorizer(kRed, 0xFF0000);
createColorizer(kBlue, 0xFF);
createColorizer(kYellow, 0xFFFF00);
createColorizer(kGreen, 0xFF00);
createColorizer(kGrey, 0x999999);
}
public function lookupRGB(_arg1:String):uint{
var _local2:ColorizerEntry;
if (m_colorizerMap[_arg1] == null){
Console.error(("ColorizerRegistry.getColorizerTransform. No color with name: " + _arg1));
return (null);
};
_local2 = m_colorizerMap[_arg1];
return (_local2.rgb);
}
public function createColorizer(_arg1:String, _arg2:uint){
var _local3:ColorizerEntry;
if (m_colorizerMap[_arg1] != null){
Console.error(("ColorizerRegistry.createColorizer Already a colorizer with name " + _arg1));
return;
};
_local3 = new ColorizerEntry();
_local3.rgb = _arg2;
m_colorizerMap[_arg1] = _local3;
}
}
Section 17
//TileSheetAnimation (com.gamedozer.graphics.TileSheetAnimation)
package com.gamedozer.graphics {
import flash.utils.*;
import flash.display.*;
public class TileSheetAnimation extends Sprite {
var m_activeFrame:int;
var m_loop:Boolean;
var m_completeCallback:Function;// = null
var m_activeAnimation:String;
var m_paused:Boolean;
var m_timeUntilNextFrame:int;
var m_animationMap:Dictionary;
var m_display:Bitmap;
var m_tileSheet:BitmapData;
public function TileSheetAnimation(_arg1:BitmapData){
m_animationMap = new Dictionary(false);
m_completeCallback = null;
super();
m_paused = false;
m_loop = true;
m_tileSheet = _arg1;
m_display = new Bitmap(m_tileSheet);
addChild(m_display);
m_timeUntilNextFrame = 0;
m_activeFrame = 0;
m_activeAnimation = "";
}
public function unpause(){
m_paused = false;
}
public function hasAnimation(_arg1:String):Boolean{
return (!((m_animationMap[_arg1] == null)));
}
public function dispose(){
m_animationMap = null;
m_tileSheet = null;
removeChild(m_display);
m_display = null;
}
function updateFrame(){
var _local1:AnimationInfo;
_local1 = m_animationMap[m_activeAnimation];
m_timeUntilNextFrame = _local1.timeBetweenFrames;
if (m_activeFrame >= _local1.rectangles.length){
if (m_loop){
m_activeFrame = 0;
} else {
m_activeFrame = (_local1.rectangles.length - 1);
};
};
m_display.scrollRect = _local1.rectangles[m_activeFrame];
}
public function onComplete(_arg1:Function){
m_completeCallback = _arg1;
}
function registerAnimation(_arg1:String, _arg2:Array, _arg3:int, _arg4:int, _arg5:int){
m_animationMap[_arg1] = new AnimationInfo(_arg2, _arg3, _arg4, _arg5);
}
public function getActiveAnimationName():String{
return (m_activeAnimation);
}
public function playAnimation(_arg1:String){
var _local2:AnimationInfo;
if (_arg1 == m_activeAnimation){
return;
};
_local2 = m_animationMap[_arg1];
if (_local2 == null){
trace(("TileSheetAnimation.playAnimation: Animation not found: " + _arg1));
return;
};
m_activeAnimation = _arg1;
m_activeFrame = 0;
m_display.x = (-(_local2.width) / 2);
m_display.y = (-(_local2.height) / 2);
updateFrame();
}
public function disableLooping(){
m_loop = false;
}
public function update(_arg1:int){
var _local2:AnimationInfo;
if (m_activeAnimation == ""){
return;
};
if (m_paused){
return;
};
m_timeUntilNextFrame = (m_timeUntilNextFrame - _arg1);
if (m_timeUntilNextFrame <= 0){
m_activeFrame++;
if (m_completeCallback != null){
_local2 = m_animationMap[m_activeAnimation];
if (m_activeFrame >= _local2.rectangles.length){
m_completeCallback.call();
if (m_animationMap == null){
return;
};
};
};
updateFrame();
};
}
public function gotoFrame(_arg1:int){
m_activeFrame = _arg1;
updateFrame();
}
public function pause(){
m_paused = true;
}
}
}//package com.gamedozer.graphics
class AnimationInfo {
private var timeBetweenFrames:int;
private var rectangles:Array;
private var width:int;
private var height:int;
private function AnimationInfo(_arg1:Array, _arg2:int, _arg3:int, _arg4:int){
rectangles = _arg1;
timeBetweenFrames = _arg2;
width = _arg3;
height = _arg4;
}
}
Section 18
//TileSheetLoader (com.gamedozer.graphics.TileSheetLoader)
package com.gamedozer.graphics {
import flash.net.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class TileSheetLoader {
var m_typeMap:Dictionary;
var m_defaultFrameCount:int;
var m_defaultHeight:int;
var m_defaultWidth:int;
public function TileSheetLoader(){
m_typeMap = new Dictionary(false);
}
public function loadFromXML(_arg1:XML){
var _local2:XMLList;
var _local3:*;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:String;
var _local9:XMLList;
var _local10:int;
var _local11:Dictionary;
var _local12:*;
var _local13:String;
var _local14:int;
var _local15:String;
var _local16:int;
var _local17:String;
var _local18:int;
var _local19:String;
var _local20:int;
var _local21:String;
var _local22:int;
var _local23:String;
var _local24:Array;
var _local25:int;
var _local26:int;
var _local27:int;
var _local28:int;
var _local29:Rectangle;
_local2 = _arg1.descendants("sheetloader");
for each (_local3 in _local2) {
_local4 = _local3.attribute("defaultFrameCount");
_local5 = _local3.attribute("defaultWidth");
_local6 = _local3.attribute("defaultHeight");
_local7 = _local3.attribute("defaultTimeBetweenFrames");
_local8 = _local3.attribute("type");
_local9 = _local3.descendants("animation");
_local10 = 0;
_local11 = new Dictionary(false);
for each (_local12 in _local9) {
_local13 = _local12.attribute("name");
_local14 = _local5;
_local15 = _local12.attribute("width");
if (_local15 != ""){
_local14 = Number(_local15);
};
_local16 = _local4;
_local17 = _local12.attribute("frameCount");
if (_local17 != ""){
_local16 = Number(_local17);
};
_local18 = _local6;
_local19 = _local12.attribute("height");
if (_local19 != ""){
_local18 = Number(_local19);
};
_local20 = _local7;
_local21 = _local12.attribute("timeBetweenFrames");
if (_local21 != ""){
_local20 = Number(_local21);
};
_local22 = 1;
_local23 = _local12.attribute("rowCount");
if (_local23 != ""){
_local22 = int(_local23);
};
_local24 = new Array();
_local25 = 0;
while (_local25 < _local22) {
_local26 = 0;
while (_local26 < _local16) {
_local27 = (_local26 * _local14);
_local28 = _local10;
_local29 = new Rectangle(_local27, _local10, _local14, _local18);
_local24.push(_local29);
_local26++;
};
_local10 = (_local10 + _local18);
_local25++;
};
_local11[_local13] = new AnimationInfo(_local24, _local20, _local14, _local18);
};
m_typeMap[_local8] = _local11;
};
}
function handleFileLoad(_arg1:Event){
loadFromXML(new XML(_arg1.target.data));
}
public function createTileSheetAnimation(_arg1:String, _arg2:BitmapData):TileSheetAnimation{
var _local3:Dictionary;
var _local4:TileSheetAnimation;
var _local5:String;
var _local6:AnimationInfo;
_local3 = m_typeMap[_arg1];
if (_local3 == null){
trace(("TileSheetLoader.createTileSheetAnimation: No tilesheet loader with type: " + _arg1));
return (null);
};
_local4 = new TileSheetAnimation(_arg2);
for (_local5 in _local3) {
_local6 = _local3[_local5];
_local4.registerAnimation(_local5, _local6.rectangles, _local6.timeBetweenFrames, _local6.width, _local6.height);
};
return (_local4);
}
public function dispose(){
var _local1:Object;
for (_local1 in m_typeMap) {
m_typeMap[_local1] = null;
};
m_typeMap = null;
}
public static function createTileSheetLoader(_arg1:String):TileSheetLoader{
var _local2:TileSheetLoader;
var _local3:URLLoader;
var _local4:URLRequest;
_local2 = new (TileSheetLoader);
_local3 = new URLLoader();
_local4 = new URLRequest(_arg1);
_local3.load(_local4);
_local3.addEventListener(Event.COMPLETE, _local2.handleFileLoad);
return (_local2);
}
}
}//package com.gamedozer.graphics
class AnimationInfo {
private var timeBetweenFrames:int;
private var rectangles:Array;
private var width:int;
private var height:int;
private function AnimationInfo(_arg1:Array, _arg2:int, _arg3:int, _arg4:int){
rectangles = _arg1;
timeBetweenFrames = _arg2;
width = _arg3;
height = _arg4;
}
}
Section 19
//Vector2 (com.gamedozer.math.Vector2)
package com.gamedozer.math {
public class Vector2 {
public var x:Number;
public var y:Number;
public function Vector2(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
}
public function isApproximatelyEqualToZero(_arg1:Number){
return ((((Math.abs(x) <= _arg1)) && ((Math.abs(y) <= _arg1))));
}
public function dividedBy(_arg1:Number):Vector2{
return (new Vector2((x / _arg1), (y / _arg1)));
}
public function projectedAlong(_arg1:Vector2):Vector2{
var _local2:Vector2;
var _local3:Number;
_local2 = _arg1.getUnitVector();
_local3 = this.dot(_local2);
return (new Vector2((_local3 * _local2.x), (_local3 * _local2.y)));
}
public function dot(_arg1:Vector2):Number{
return (((x * _arg1.x) + (y * _arg1.y)));
}
public function normalize(_arg1:Number=1){
var _local2:Number;
_local2 = (_arg1 / this.length());
x = (x * _local2);
y = (y * _local2);
}
public function minimum(_arg1:Vector2):Vector2{
var _local2:Vector2;
_local2 = new Vector2();
_local2.x = ((x < _arg1.x)) ? x : _arg1.x;
_local2.y = ((y < _arg1.y)) ? y : _arg1.y;
return (_local2);
}
public function isApproximatelyEqualTo(_arg1:Vector2, _arg2:Number){
return ((((Math.abs((x - _arg1.x)) <= _arg2)) && ((Math.abs((y - _arg1.y)) <= _arg2))));
}
public function setAngle(_arg1){
var _local2:*;
_local2 = ((_arg1 / 180) * Math.PI);
x = Math.cos(_local2);
y = Math.sin(_local2);
}
public function setEqualTo(_arg1:Vector2){
x = _arg1.x;
y = _arg1.y;
}
public function greaterThanOrEqual(_arg1:Vector2):Boolean{
return ((((x >= _arg1.x)) && ((y >= _arg1.y))));
}
public function lessThanOrEqual(_arg1:Vector2):Boolean{
return ((((x <= _arg1.x)) && ((y <= _arg1.y))));
}
public function plus(_arg1:Vector2):Vector2{
return (new Vector2((x + _arg1.x), (y + _arg1.y)));
}
public function multiplyBy(_arg1:Number){
this.x = (this.x * _arg1);
this.y = (this.y * _arg1);
}
public function getUnitVector():Vector2{
var _local1:Vector2;
_local1 = new Vector2(x, y);
_local1.normalize();
return (_local1);
}
public function equalTo(_arg1:Vector2):Boolean{
return ((((x == _arg1.x)) && ((y == _arg1.y))));
}
public function maximum(_arg1:Vector2):Vector2{
var _local2:Vector2;
_local2 = new Vector2();
_local2.x = ((x > _arg1.x)) ? x : _arg1.x;
_local2.y = ((y > _arg1.y)) ? y : _arg1.y;
return (_local2);
}
public function lengthSquared():Number{
return (((x * x) + (y * y)));
}
public function clone():Vector2{
return (new Vector2(x, y));
}
public function length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function lessThan(_arg1:Vector2):Boolean{
return ((((x < _arg1.x)) && ((y < _arg1.y))));
}
public function multipliedBy(_arg1:Number):Vector2{
return (new Vector2((x * _arg1), (y * _arg1)));
}
public function toString():String{
return ((((("<" + x) + ",") + y) + ">"));
}
public function angleTo(_arg1:Vector2):Number{
var _local2:Number;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local2 = 0;
_local3 = (this.x - _arg1.x);
_local4 = (this.y - _arg1.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
_local6 = (_local4 / _local5);
_local7 = Math.asin(_local6);
if ((((this.x < _arg1.x)) && ((this.y < _arg1.y)))){
_local2 = (270 - (_local7 / (Math.PI / 180)));
} else {
if ((((this.x > _arg1.x)) && ((this.y < _arg1.y)))){
_local2 = (90 + (_local7 / (Math.PI / 180)));
};
};
return (_local2);
}
public function getAngle():Number{
return (((Math.atan2(y, x) * 180) / Math.PI));
}
public function minus(_arg1:Vector2):Vector2{
return (new Vector2((x - _arg1.x), (y - _arg1.y)));
}
public function greaterThan(_arg1:Vector2):Boolean{
return ((((x > _arg1.x)) && ((y > _arg1.y))));
}
public function notEqualTo(_arg1:Vector2):Boolean{
return (((!((x == _arg1.x))) && (!((y == _arg1.y)))));
}
public function equals(_arg1:Vector2):Boolean{
return ((((x == _arg1.x)) && ((y == _arg1.y))));
}
}
}//package com.gamedozer.math
Section 20
//Path (com.gamedozer.misc.Path)
package com.gamedozer.misc {
import flash.geom.*;
public class Path {
protected var _length:Number;// = 0
protected var _position:Point;
protected var _moveToHasLength:Boolean;// = false
private var _lengthValid:Boolean;// = true
protected var _segments:Array;
public function Path(){
_lengthValid = true;
_length = 0;
_moveToHasLength = false;
super();
init();
}
public function draw(_arg1, _arg2:Number=0, _arg3:Number=1):void{
var _local4:Array;
var _local5:int;
var _local6:int;
_arg2 = cleant(_arg2, 0);
_arg3 = cleant(_arg3, 1);
if (_arg3 < _arg2){
draw(_arg1, _arg2, 1);
draw(_arg1, 0, _arg3);
return;
};
_local4 = getSegmentsToDraw(_arg2, _arg3);
if (_local4.length){
_arg1.moveTo(_local4[0]._start.x, _local4[0]._start.y);
_local5 = _local4.length;
_local6 = 0;
while (_local6 < _local5) {
_local4[_local6].draw(_arg1);
_local6++;
};
};
}
private function cleant(_arg1:Number, _arg2:Number=0):Number{
if (isNaN(_arg1)){
_arg1 = _arg2;
} else {
if ((((_arg1 < 0)) || ((_arg1 > 1)))){
_arg1 = (_arg1 % 1);
if (_arg1 == 0){
_arg1 = _arg2;
} else {
if (_arg1 < 0){
_arg1 = (_arg1 + 1);
};
};
};
};
return (_arg1);
}
public function clear():void{
init();
}
public function curveTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Point;
_lengthValid = false;
_local5 = new Point(_arg3, _arg4);
_segments.push(new PathCurveSegment(_position, new Point(_arg1, _arg2), _local5));
_position = _local5;
}
public function set position(_arg1:Point):void{
_position = _arg1.clone();
_segments.push(new PathSegment(_position));
}
public function get moveToHasLength():Boolean{
return (_moveToHasLength);
}
public function lineTo(_arg1:Number, _arg2:Number):void{
var _local3:Point;
_lengthValid = false;
_local3 = new Point(_arg1, _arg2);
_segments.push(new PathLineSegment(_position, _local3));
_position = _local3;
}
private function init():void{
_lengthValid = false;
_segments = new Array();
_position = new Point(0, 0);
}
private function getSegmentsToDraw(_arg1:Number, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:int;
var _local9:Number;
var _local10:Number;
var _local11:Array;
var _local12:PathSegment;
var _local13:int;
var _local14:int;
var _local15:int;
_local3 = (_arg1 * length);
_local4 = (_arg2 * length);
_local5 = 0;
_local6 = 0;
_local7 = -1;
_local8 = -1;
_local9 = 0;
_local10 = 1;
_local11 = new Array();
_local13 = _segments.length;
_local14 = 0;
for (;_local14 < _local13;_local14++) {
_local12 = _segments[_local14];
if (((((_moveToHasLength) || (!((_local12._command == "moveTo"))))) && (_local12.length))){
_local5 = (_local5 + _local12.length);
} else {
continue;
};
if ((((_local3 < _local5)) && ((_local7 == -1)))){
_local7 = _local14;
_local9 = ((_arg1)==0) ? 0 : ((_local3 - _local6) / _local12.length);
};
if (_local4 <= _local5){
_local8 = _local14;
_local10 = ((_arg2)==1) ? 1 : ((_local4 - _local6) / _local12.length);
break;
};
_local6 = _local5;
};
if ((((_local7 < 0)) || ((_local8 < 0)))){
return (_local11);
};
_local11 = _segments.slice(_local7, (_local8 + 1));
if (_local7 == _local8){
if (((!((_local9 == 0))) || (!((_local10 == 1))))){
_local11[0] = _local11[0].segment(_local9, _local10);
};
} else {
if (_local9 != 0){
_local11[0] = _local11[0].segment(_local9, 1);
};
if (_local10 != 1){
_local15 = (_local11.length - 1);
_local11[_local15] = _local11[_local15].segment(0, _local10);
};
};
return (_local11);
}
public function dispose(){
_position = null;
_segments.splice(0);
_segments = null;
}
public function pointAt(_arg1:Number):Point{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:PathSegment;
var _local6:int;
var _local7:int;
var _local8:int;
_arg1 = cleant(_arg1);
if (_arg1 == 0){
return (_segments[0].pointAt(_arg1));
};
if (_arg1 == 1){
_local8 = (_segments.length - 1);
return (_segments[_local8].pointAt(_arg1));
};
_local2 = (_arg1 * length);
_local3 = 0;
_local4 = 0;
_local6 = _segments.length;
_local7 = 0;
for (;_local7 < _local6;_local7++) {
_local5 = _segments[_local7];
if (((((_moveToHasLength) || (!((_local5._command == "moveTo"))))) && (_local5.length))){
_local3 = (_local3 + _local5.length);
} else {
continue;
};
if (_local2 <= _local3){
return (_local5.pointAt(((_local2 - _local4) / _local5.length)));
};
_local4 = _local3;
};
return (new Point(0, 0));
}
public function get length():Number{
var _local1:PathSegment;
var _local2:int;
if (!(_lengthValid)){
_lengthValid = true;
_length = 0;
_local2 = _segments.length;
while (_local2--) {
_local1 = _segments[_local2];
if (((_moveToHasLength) || (!((_local1 is PathMoveSegment))))){
_length = (_length + _local1.length);
};
};
};
return (_length);
}
public function set moveToHasLength(_arg1:Boolean):void{
_lengthValid = false;
_moveToHasLength = _arg1;
}
public function get position():Point{
return (_position.clone());
}
public function circleTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Point;
_lengthValid = false;
_local5 = new Point(_arg3, _arg4);
_segments.push(new PathCircleSegment(_position, new Point(_arg1, _arg2), _local5));
_position = _local5;
}
public function moveTo(_arg1:Number, _arg2:Number):void{
var _local3:Point;
if (_moveToHasLength){
_lengthValid = false;
};
_local3 = new Point(_arg1, _arg2);
_segments.push(new PathMoveSegment(_position, _local3));
_position = _local3;
}
public function angleAt(_arg1:Number):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:PathSegment;
var _local6:int;
var _local7:int;
_arg1 = cleant(_arg1);
_local2 = (_arg1 * length);
_local3 = 0;
_local4 = 0;
_local6 = _segments.length;
_local7 = 0;
for (;_local7 < _local6;_local7++) {
_local5 = _segments[_local7];
if (((((_moveToHasLength) || (!((_local5._command == "moveTo"))))) && (_local5.length))){
_local3 = (_local3 + _local5.length);
} else {
continue;
};
if (_local2 <= _local3){
return (_local5.angleAt(((_local2 - _local4) / _local5.length)));
};
_local4 = _local3;
};
return (0);
}
}
}//package com.gamedozer.misc
import flash.geom.*;
class PathCircleSegment extends PathLineSegment {
private var angleEnd:Number;// = 0
private var radius:Number;// = 0
private var angleStart:Number;// = 0
private var arc:Number;// = 0
private var _control:Point;
private var _center:Point;
private function PathCircleSegment(_arg1:Point, _arg2:Point, _arg3:Point){
radius = 0;
angleStart = 0;
angleEnd = 0;
arc = 0;
super(_arg1, _arg3);
_control = _arg2.clone();
_command = "circleTo";
_center = getCircleCenter(_start, _control, _end);
_constructor = prototype.constructor;
if (_center){
radius = lineLength(_start, _center);
angleStart = Math.atan2((_start.y - _center.y), (_start.x - _center.x));
angleEnd = Math.atan2((_end.y - _center.y), (_end.x - _center.x));
if (angleEnd < angleStart){
angleEnd = (angleEnd + (Math.PI * 2));
};
arc = (angleEnd - angleStart);
};
}
override private function draw(_arg1):void{
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
if (!(_center)){
return;
};
_local2 = angleStart;
_local4 = (Math.floor((arc / (Math.PI / 4))) + 1);
_local5 = (arc / (2 * _local4));
_local6 = Math.cos(_local5);
_local7 = (_local6) ? (radius / _local6) : 0;
_local8 = 0;
while (_local8 < _local4) {
_local3 = (_local2 + _local5);
_local2 = (_local3 + _local5);
_arg1.curveTo((_center.x + (Math.cos(_local3) * _local7)), (_center.y + (Math.sin(_local3) * _local7)), (_center.x + (Math.cos(_local2) * radius)), (_center.y + (Math.sin(_local2) * radius)));
_local8++;
};
}
private function getCircleCenter(_arg1:Point, _arg2:Point, _arg3:Point):Point{
var _local4:Point;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
if ((((_arg1.x == _arg2.x)) || ((_arg1.y == _arg2.y)))){
_local4 = _arg1;
_arg1 = _arg3;
_arg3 = _local4;
};
if (_arg2.x == _arg3.x){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
if ((((_arg1.x == _arg2.x)) || ((_arg2.x == _arg3.x)))){
return (null);
};
_local5 = ((_arg2.y - _arg1.y) / (_arg2.x - _arg1.x));
_local6 = ((_arg3.y - _arg2.y) / (_arg3.x - _arg2.x));
if (_local5 == _local6){
return (null);
};
_local7 = (_arg1.x + _arg2.x);
_local8 = (_arg2.x + _arg3.x);
_local9 = (((((_local5 * _local6) * (_arg1.y - _arg3.y)) + (_local6 * _local7)) - (_local5 * _local8)) / (2 * (_local6 - _local5)));
_local10 = (_local5) ? (((_arg1.y + _arg2.y) / 2) - ((_local9 - (_local7 / 2)) / _local5)) : (((_arg2.y + _arg3.y) / 2) - ((_local9 - (_local8 / 2)) / _local6));
return (new Point(_local9, _local10));
}
private function get control():Point{
return (_control.clone());
}
override private function get length():Number{
if (isNaN(_length)){
_length = circleLength();
};
return (_length);
}
override private function trim(_arg1:Number, _arg2:Boolean=false):PathSegment{
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Number;
if (_arg2){
_local4 = _start;
_local3 = _end;
} else {
_local3 = _start;
_local4 = _end;
};
_local5 = _local3;
_local7 = _local3;
_local8 = (angleStart + (_arg1 * arc));
if (_arg2){
_local5 = new Point((_center.x + (Math.cos(_local8) * radius)), (_center.y + (Math.sin(_local8) * radius)));
_local8 = ((angleEnd + _local8) / 2);
} else {
_local7 = new Point((_center.x + (Math.cos(_local8) * radius)), (_center.y + (Math.sin(_local8) * radius)));
_local8 = ((angleStart + _local8) / 2);
};
_local6 = new Point((_center.x + (Math.cos(_local8) * radius)), (_center.y + (Math.sin(_local8) * radius)));
return (new _constructor(_local5, _local6, _local7));
}
override private function pointAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Point{
var _local4:Number;
if (!(_center)){
return (_start.clone());
};
_local4 = (angleStart + (_arg1 * arc));
return (new Point((_center.x + (Math.cos(_local4) * radius)), (_center.y + (Math.sin(_local4) * radius))));
}
override private function angleAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Number{
var _local4:Number;
_local4 = (((angleStart + (_arg1 * arc)) + (Math.PI / 2)) % (Math.PI * 2));
if (_local4 > Math.PI){
_local4 = (_local4 - (Math.PI * 2));
} else {
if (_local4 < -(Math.PI)){
_local4 = (_local4 + (Math.PI * 2));
};
};
return (_local4);
}
private function circleLength():Number{
return ((radius * arc));
}
}
class PathCurveSegment extends PathLineSegment {
private var _control:Point;
private function PathCurveSegment(_arg1:Point, _arg2:Point, _arg3:Point){
super(_arg1, _arg3);
_control = _arg2.clone();
_command = "curveTo";
_constructor = prototype.constructor;
}
override private function draw(_arg1):void{
var _local2 = _arg1;
_local2[command](_control.x, _control.y, _end.x, _end.y);
}
private function get control():Point{
return (_control.clone());
}
override private function get length():Number{
if (isNaN(_length)){
_length = curveLength();
};
return (_length);
}
override private function trim(_arg1:Number, _arg2:Boolean=false):PathSegment{
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
if (_arg2){
_local4 = _start;
_local3 = _end;
_arg1 = (1 - _arg1);
} else {
_local3 = _start;
_local4 = _end;
};
_local5 = _local3;
_local7 = _local3;
_local8 = (_control.x - _local3.x);
_local9 = (_control.y - _local3.y);
_local10 = (_local4.x - _control.x);
_local11 = (_local4.y - _control.y);
_local6 = new Point((_local3.x + (_local8 * _arg1)), (_local3.y + (_local9 * _arg1)));
_local12 = ((_control.x + (_local10 * _arg1)) - _local6.x);
_local13 = ((_control.y + (_local11 * _arg1)) - _local6.y);
if (_arg2){
_local5 = new Point((_local6.x + (_local12 * _arg1)), (_local6.y + (_local13 * _arg1)));
} else {
_local7 = new Point((_local6.x + (_local12 * _arg1)), (_local6.y + (_local13 * _arg1)));
};
return (new _constructor(_local5, _local6, _local7));
}
override private function pointAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Point{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local4 = (_end.x - _start.x);
_local5 = (_end.y - _start.y);
_local6 = ((_local4)==0) ? 0 : ((_control.x - _start.x) / _local4);
_local7 = ((_local5)==0) ? 0 : ((_control.y - _start.y) / _local5);
_local8 = ((2 * _arg1) * (1 - _arg1));
_local9 = (_arg1 * _arg1);
return (new Point((_start.x + (_local4 * ((_local8 * _local6) + _local9))), (_start.y + (_local5 * ((_local8 * _local7) + _local9)))));
}
override private function angleAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Number{
_arg2 = super.pointAt(_arg1, _start, _control);
_arg3 = super.pointAt(_arg1, _control, _end);
return (super.angleAt(_arg1, _arg2, _arg3));
}
private function curveLength(_arg1:Point=null, _arg2:Point=null, _arg3:Point=null):Number{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Point;
var _local13:Point;
var _local14:int;
if (!(_arg1)){
_arg1 = _start;
};
if (!(_arg2)){
_arg2 = _control;
};
if (!(_arg3)){
_arg3 = _end;
};
_local4 = (_arg3.x - _arg1.x);
_local5 = (_arg3.y - _arg1.y);
_local6 = ((_local4)==0) ? 0 : ((_arg2.x - _arg1.x) / _local4);
_local7 = ((_local5)==0) ? 0 : ((_arg2.y - _arg1.y) / _local5);
_local11 = 0;
_local12 = _arg1;
_local14 = 1;
while (_local14 < curveAccuracy) {
_local10 = (_local14 / curveAccuracy);
_local8 = ((2 * _local10) * (1 - _local10));
_local9 = (_local10 * _local10);
_local13 = new Point((_arg1.x + (_local4 * ((_local8 * _local6) + _local9))), (_arg1.y + (_local5 * ((_local8 * _local7) + _local9))));
_local11 = (_local11 + lineLength(_local12, _local13));
_local12 = _local13;
_local14++;
};
return ((_local11 + lineLength(_local12, _arg3)));
}
}
class PathMoveSegment extends PathLineSegment {
private function PathMoveSegment(_arg1:Point, _arg2:Point){
super(_arg1, _arg2);
_command = "moveTo";
_constructor = prototype.constructor;
}
override private function pointAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Point{
if (_arg1 == 0){
return (_end);
};
return (super.pointAt(_arg1, _arg2, _arg3));
}
}
class PathLineSegment extends PathSegment {
private function PathLineSegment(_arg1:Point, _arg2:Point){
super(_arg1);
_end = _arg2.clone();
_command = "lineTo";
_constructor = prototype.constructor;
}
private function segment(_arg1:Number, _arg2:Number):PathSegment{
var _local3:PathSegment;
if (_arg2 == 1){
if (_arg1 == 0){
return (this);
};
return (trim(_arg1, true));
};
_local3 = trim(_arg2);
if (_arg1 != 0){
_local3 = _local3.trim((_arg1 / _arg2), true);
};
return (_local3);
}
override private function trim(_arg1:Number, _arg2:Boolean=false):PathSegment{
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Number;
var _local8:Number;
if (_arg2){
_local4 = _start;
_local3 = _end;
_arg1 = (1 - _arg1);
} else {
_local3 = _start;
_local4 = _end;
};
_local5 = _local3;
_local6 = _local3;
_local7 = (_local4.x - _local3.x);
_local8 = (_local4.y - _local3.y);
if (_arg2){
_local5 = new Point((_local3.x + (_local7 * _arg1)), (_local3.y + (_local8 * _arg1)));
} else {
_local6 = new Point((_local3.x + (_local7 * _arg1)), (_local3.y + (_local8 * _arg1)));
};
return (new _constructor(_local5, _local6));
}
override private function get length():Number{
if (isNaN(_length)){
_length = lineLength();
};
return (_length);
}
protected function lineLength(_arg1:Point=null, _arg2:Point=null):Number{
var _local3:Number;
var _local4:Number;
if (!(_arg1)){
_arg1 = _start;
};
if (!(_arg2)){
_arg2 = _end;
};
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
override private function pointAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Point{
var _local4:Number;
var _local5:Number;
if (_arg2 == null){
_arg2 = _start;
};
if (_arg3 == null){
_arg3 = _end;
};
_local4 = (_arg3.x - _arg2.x);
_local5 = (_arg3.y - _arg2.y);
return (new Point((_arg2.x + (_local4 * _arg1)), (_arg2.y + (_local5 * _arg1))));
}
override private function angleAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Number{
if (!(_arg2)){
_arg2 = _start;
};
if (!(_arg3)){
_arg3 = _end;
};
return (Math.atan2((_arg3.y - _arg2.y), (_arg3.x - _arg2.x)));
}
}
class PathSegment {
private var _start:Point;
protected var _length:Number;
private var _command:String;// = "moveTo"
private var _constructor:Class;
private var _end:Point;
private static var curveAccuracy:int = 5;
private function PathSegment(_arg1:Point){
_command = "moveTo";
super();
_start = _arg1.clone();
_end = _start;
_constructor = prototype.constructor;
}
private function get start():Point{
return (_start.clone());
}
private function toString():String{
return ((("[" + command) + "]"));
}
private function trim(_arg1:Number, _arg2:Boolean=false):PathSegment{
return (this);
}
private function get command():String{
return (_command);
}
private function get length():Number{
return (0);
}
private function draw(_arg1):void{
var _local2 = _arg1;
_local2[command](_end.x, _end.y);
}
private function pointAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Point{
return (_start.clone());
}
private function angleAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Number{
return (0);
}
private function get end():Point{
return (_end.clone());
}
}
Section 21
//UITable (com.gamedozer.ui.UITable)
package com.gamedozer.ui {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class UITable extends Sprite {
var m_borderIsEnabled:Boolean;// = false
var m_highlightAlpha:Number;// = 1
var m_highlightColor:uint;// = 0
var m_highlightRow:int;// = -1
var m_height:int;
var m_bgColor:uint;// = 0
var m_bgAlpha:Number;// = 1
var m_highlightColumn:int;// = -1
var m_width:int;
var m_bgColorEnabled:Boolean;// = false
var m_columnCount:int;
var m_map:Dictionary;
var m_useHighlightOnRollover:Boolean;// = false
var m_borderColor:uint;
var m_borderAlpha:Number;
var m_borderThickness:int;
var m_rowCount:int;
var m_nameMap:Dictionary;
public function UITable(_arg1:int, _arg2:int){
m_bgColorEnabled = false;
m_bgColor = 0;
m_bgAlpha = 1;
m_highlightColumn = -1;
m_highlightRow = -1;
m_highlightColor = 0;
m_highlightAlpha = 1;
m_borderIsEnabled = false;
m_useHighlightOnRollover = false;
super();
m_rowCount = 0;
m_columnCount = 0;
m_width = _arg1;
m_height = _arg2;
this.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
m_map = new Dictionary(false);
m_nameMap = new Dictionary(false);
}
public function assignName(_arg1:int, _arg2:int, _arg3:String){
var _local4:TableNode;
if (m_nameMap[_arg3] != null){
trace(("UITable.assignName Cell name must be unique. There is already a cell with name: " + _arg3));
return;
};
_local4 = getNode(_arg1, _arg2);
m_nameMap[_arg3] = _local4;
}
public function getRowFromName(_arg1:String):int{
var _local2:TableNode;
if (m_nameMap[_arg1] == null){
trace(("UITable.getRowFromName, there is no cell with name: " + _arg1));
return (-1);
};
_local2 = m_nameMap[_arg1];
return (_local2.row);
}
function handleFrame(_arg1:Event){
var _local2:int;
var _local3:int;
var _local4:TableNode;
if (!(m_useHighlightOnRollover)){
return;
};
_local2 = this.mouseX;
_local3 = this.mouseY;
_local4 = getNodeFromCoordinates(_local2, _local3);
if (_local4 != null){
if ((((_local4.column == m_highlightColumn)) && ((_local4.row == m_highlightRow)))){
} else {
updateDisplay();
};
} else {
if (((!((m_highlightColumn == -1))) || (!((m_highlightRow == -1))))){
m_highlightColumn = -1;
m_highlightRow = -1;
updateDisplay();
};
};
}
public function dispose(){
this.removeEventListener(Event.ENTER_FRAME, handleFrame);
this.removeEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
m_map = null;
m_nameMap = null;
}
public function resetCellBackgrounds(){
var _local1:Dictionary;
var _local2:TableNode;
for each (_local1 in m_map) {
for each (_local2 in _local1) {
_local2.nodeBgColorEnabled = false;
};
};
updateDisplay();
}
public function disableCellBackground(_arg1:int, _arg2:int){
var _local3:TableNode;
_local3 = getNode(_arg1, _arg2);
_local3.nodeBgColorEnabled = false;
updateDisplay();
}
public function enableHighlight(_arg1:uint, _arg2:Number){
m_highlightColor = _arg1;
m_highlightAlpha = _arg2;
}
function getNodeFromCoordinates(_arg1:int, _arg2:int){
var _local3:int;
var _local4:int;
if ((((_arg1 < 0)) || ((_arg2 < 0)))){
return (null);
};
if ((((_arg1 > m_width)) || ((_arg2 > m_height)))){
return (null);
};
_local3 = ((m_columnCount + 1) * (_arg1 / m_width));
_local4 = ((m_rowCount + 1) * (_arg2 / m_height));
if (m_map[_local3] == null){
return (null);
};
return (m_map[_local3][_local4]);
}
function getNode(_arg1:int, _arg2:int){
if (m_map[_arg1] == null){
m_map[_arg1] = new Dictionary();
};
if (m_map[_arg1][_arg2] == null){
m_map[_arg1][_arg2] = new TableNode(_arg1, _arg2, null);
};
m_columnCount = Math.max(_arg1, m_columnCount);
m_rowCount = Math.max(_arg2, m_rowCount);
return (m_map[_arg1][_arg2]);
}
public function enableCellBackground(_arg1:int, _arg2:int, _arg3:uint, _arg4:Number){
var _local5:TableNode;
_local5 = getNode(_arg1, _arg2);
_local5.nodeBgColorEnabled = true;
_local5.nodeBgColor = _arg3;
_local5.nodeBgAlpha = _arg4;
updateDisplay();
}
public function getDisplay(_arg1:int, _arg2:int):DisplayObjectContainer{
var _local3:TableNode;
_local3 = getNode(_arg1, _arg2);
if (_local3 != null){
return (_local3.display);
};
return (null);
}
public function useHighlightOnRollover(){
m_useHighlightOnRollover = true;
this.addEventListener(Event.ENTER_FRAME, handleFrame);
}
public function enableBorder(_arg1:int, _arg2:uint, _arg3:Number){
m_borderIsEnabled = true;
m_borderThickness = _arg1;
m_borderColor = _arg2;
m_borderAlpha = _arg3;
}
public function enableTableBackground(_arg1:uint, _arg2:Number){
m_bgColorEnabled = true;
m_bgColor = _arg1;
m_bgAlpha = _arg2;
updateDisplay();
}
public function clearCallback(_arg1:int, _arg2:int){
var _local3:TableNode;
_local3 = getNode(_arg1, _arg2);
if (_local3 != null){
_local3.mouseUpCallback = null;
};
}
public function enableCell(_arg1:int, _arg2:int, _arg3:DisplayObjectContainer=null, _arg4:Function=null){
var _local5:TableNode;
if ((((_arg1 < 0)) || ((_arg2 < 0)))){
trace(("UITable.enableCell: Bad location " + _arg1), _arg2);
return;
};
_local5 = getNode(_arg1, _arg2);
_local5.display = _arg3;
_local5.mouseUpCallback = _arg4;
addChild(_arg3);
updateDisplay();
}
public function getColumnFromName(_arg1:String):int{
var _local2:TableNode;
if (m_nameMap[_arg1] == null){
trace(("UITable.getColumnFromName, there is no cell with name: " + _arg1));
return (-1);
};
_local2 = m_nameMap[_arg1];
return (_local2.column);
}
private function updateDisplay(){
var _local1:int;
var _local2:int;
var _local3:Dictionary;
var _local4:int;
var _local5:int;
var _local6:TableNode;
var _local7:int;
var _local8:int;
var _local9:Boolean;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
if (m_useHighlightOnRollover){
_local4 = this.mouseX;
_local5 = this.mouseY;
_local6 = getNodeFromCoordinates(_local4, _local5);
if (_local6 != null){
m_highlightColumn = _local6.column;
m_highlightRow = _local6.row;
};
};
this.graphics.clear();
_local1 = (m_width / (m_columnCount + 1));
_local2 = (m_height / (m_rowCount + 1));
if (m_borderIsEnabled){
this.graphics.lineStyle(m_borderThickness, m_borderColor, m_borderAlpha);
_local7 = 0;
while (_local7 < m_columnCount) {
this.graphics.moveTo((_local7 * _local1), 0);
this.graphics.lineTo((_local7 * _local1), m_height);
_local7++;
};
_local8 = 0;
while (_local8 < m_rowCount) {
this.graphics.moveTo(0, (_local8 * _local2));
this.graphics.lineTo(m_width, (_local8 * _local2));
_local8++;
};
};
for each (_local3 in m_map) {
for each (_local6 in _local3) {
_local9 = false;
if ((((_local6.column == m_highlightColumn)) && ((_local6.row == m_highlightRow)))){
_local9 = true;
};
_local10 = (_local6.column * _local1);
_local11 = (_local6.row * _local2);
_local12 = (_local10 + (_local1 / 2));
_local13 = (_local11 + (_local2 / 2));
if (_local6.display != null){
_local6.display.x = _local12;
_local6.display.y = _local13;
};
if (_local9){
this.graphics.beginFill(m_highlightColor, m_highlightAlpha);
this.graphics.drawRect(_local10, _local11, _local1, _local2);
this.graphics.endFill();
} else {
if (_local6.nodeBgColorEnabled){
this.graphics.beginFill(_local6.nodeBgColor, _local6.nodeBgAlpha);
this.graphics.drawRect(_local10, _local11, _local1, _local2);
this.graphics.endFill();
} else {
if (m_bgColorEnabled){
this.graphics.beginFill(m_bgColor, m_bgAlpha);
this.graphics.drawRect(_local10, _local11, _local1, _local2);
this.graphics.endFill();
};
};
};
};
};
}
public function changeDisplay(_arg1:int, _arg2:int, _arg3:DisplayObjectContainer){
var _local4:TableNode;
_local4 = getNode(_arg1, _arg2);
if (_local4 == null){
return;
};
removeChild(_local4.display);
_local4.display = _arg3;
addChild(_arg3);
updateDisplay();
}
function handleMouseUp(_arg1:MouseEvent){
var _local2:int;
var _local3:int;
var _local4:TableNode;
_local2 = this.mouseX;
_local3 = this.mouseY;
_local4 = getNodeFromCoordinates(_local2, _local3);
if (_local4 != null){
_local4.doMouseUp();
};
}
}
}//package com.gamedozer.ui
import flash.display.*;
class TableNode {
var display:DisplayObjectContainer;
var mouseUpCallback:Function;
var column:int;
var nodeBgAlpha:Number;// = 1
var row:int;
var nodeBgColor:uint;// = 0
var nodeBgColorEnabled:Boolean;// = false
function TableNode(_arg1:int, _arg2:int, _arg3:DisplayObjectContainer, _arg4:Function=null){
nodeBgColorEnabled = false;
nodeBgColor = 0;
nodeBgAlpha = 1;
super();
row = _arg2;
column = _arg1;
display = _arg3;
mouseUpCallback = _arg4;
}
function doMouseUp(){
if (mouseUpCallback != null){
mouseUpCallback.call();
};
}
}
Section 22
//Console (com.gamedozer.utils.Console)
package com.gamedozer.utils {
public class Console {
public static function error(_arg1:String){
trace(_arg1);
}
public static function out(_arg1:String){
trace(_arg1);
}
}
}//package com.gamedozer.utils
Section 23
//Delegate (com.gamedozer.utils.Delegate)
package com.gamedozer.utils {
public class Delegate {
public static function create(_arg1, _arg2:Function, ... _args):Function{
var delegate:Function;
var target = _arg1;
var handler = _arg2;
var rest = _args;
delegate = function (... _args){
var _local2:Array;
_local2 = _args.concat(rest);
return (handler.apply(target, _local2));
};
return (delegate);
}
}
}//package com.gamedozer.utils
Section 24
//FPSCounter (com.gamedozer.utils.FPSCounter)
package com.gamedozer.utils {
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.display.*;
public class FPSCounter extends Sprite {
var m_timeOfLastUpdate:int;
var m_accumulatedFrames:int;
var m_textField:TextField;// = null
var m_framesToAccumulateBeforeUpdate:int;// = 15
public function FPSCounter(){
m_textField = null;
m_framesToAccumulateBeforeUpdate = 15;
super();
addEventListener(Event.ENTER_FRAME, handleFrame);
m_timeOfLastUpdate = getTimer();
m_accumulatedFrames = 0;
}
function handleFrame(_arg1:Event){
var _local2:int;
m_accumulatedFrames++;
if (m_accumulatedFrames == m_framesToAccumulateBeforeUpdate){
_local2 = calculateDeltaTime();
if (m_textField != null){
m_textField.text = String(int(((m_framesToAccumulateBeforeUpdate * 1000) / _local2)));
};
m_accumulatedFrames = 0;
};
this.parent.setChildIndex(this, (this.parent.numChildren - 1));
}
function createDisplay(){
var _local1:TextFormat;
_local1 = new TextFormat();
_local1.font = "Verdana";
_local1.color = 0xFFFFFF;
_local1.size = 14;
m_textField = new TextField();
m_textField.defaultTextFormat = _local1;
m_textField.text = "";
m_textField.selectable = false;
addChild(m_textField);
}
public function draw(){
createDisplay();
}
function calculateDeltaTime():int{
var _local1:int;
var _local2:int;
_local1 = getTimer();
_local2 = (_local1 - m_timeOfLastUpdate);
m_timeOfLastUpdate = _local1;
return (_local2);
}
}
}//package com.gamedozer.utils
Section 25
//ResourceManager (com.gamedozer.utils.ResourceManager)
package com.gamedozer.utils {
import flash.net.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.display.*;
public class ResourceManager {
var m_resourcesMap:Dictionary;
public function ResourceManager(){
m_resourcesMap = new Dictionary(false);
}
public function createEmbeddedBitmapResource(_arg1:String, _arg2:String){
var ClassReference:Class;
var bitmapData:BitmapData;
var resource:Resource;
var a_resourceName = _arg1;
var a_className = _arg2;
try {
ClassReference = (getDefinitionByName(a_className) as Class);
bitmapData = (new (ClassReference) as BitmapData);
resource = new Resource();
if (bitmapData == null){
Console.error((("ResourceManager:createEmbeddedBitmapResource. No bitmap class with name " + a_className) + ". Resource was not created. "));
return;
};
resource.bitmapData = bitmapData;
if (m_resourcesMap[a_resourceName] != null){
Console.error((("ResourceManager:createEmbeddedResourceFromClassName. Already a resource with name " + a_resourceName) + ". Resource was not created. "));
return;
};
m_resourcesMap[a_resourceName] = resource;
} catch(e:Error) {
trace(((("ResourceManager. Cannot create resource with name " + a_className) + ". Info: ") + e));
};
}
public function createExternalBitmapResource(_arg1:String, _arg2:String){
var _local3:Loader;
var _local4:URLRequest;
var _local5:Resource;
_local3 = new Loader();
_local4 = new URLRequest(_arg2);
_local3.load(_local4);
_local3.contentLoaderInfo.addEventListener(Event.COMPLETE, loadBitmapResource);
_local5 = new Resource();
_local5.loaderInfo = _local3.contentLoaderInfo;
if (m_resourcesMap[_arg1] != null){
Console.error((("ResourceManager:createExternalBitmapResource. Already a resource with name " + _arg1) + ". Resource was not created. "));
return;
};
m_resourcesMap[_arg1] = _local5;
}
function error(_arg1:String){
Console.error(("ResourceManager. " + _arg1));
}
function handleFileLoad(_arg1:Event){
loadFromXML(new XML(_arg1.target.data));
}
public function loadFromXML(_arg1:XML){
var _local2:String;
var _local3:XMLList;
var _local4:*;
var _local5:XMLList;
var _local6:Boolean;
var _local7:*;
var _local8:String;
var _local9:XMLList;
var _local10:*;
var _local11:String;
var _local12:String;
var _local13:String;
var _local14:String;
_local2 = "";
_local3 = _arg1.descendants("use");
for each (_local4 in _local3) {
_local2 = _local4.attribute("profile");
break;
};
_local5 = _arg1.descendants("profile");
_local6 = false;
for each (_local7 in _local5) {
_local8 = _local7.attribute("name");
if (_local8 != _local2){
} else {
_local6 = true;
_local9 = _local7.descendants("resource");
for each (_local10 in _local9) {
_local11 = _local10.attribute("type");
_local12 = _local10.attribute("name");
_local13 = _local10.attribute("external");
_local14 = _local10.attribute("internal");
if (_local11 == ""){
error(("Ignoring invalid resource: " + _local10));
} else {
if (_local12 == ""){
error(("Ignoring invalid resource: " + _local10));
} else {
if ((((_local13 == "")) && ((_local14 == "")))){
error(("Ignoring invalid resource: " + _local10));
} else {
if (((!((_local13 == ""))) && (!((_local14 == ""))))){
error(("Ignoring invalid resource: " + _local10));
} else {
if (_local11 == "bitmap"){
if (_local13 == ""){
createEmbeddedBitmapResource(_local12, _local14);
} else {
createExternalBitmapResource(_local12, _local13);
};
} else {
if (_local11 == "sound"){
if (_local13 == ""){
createEmbeddedSoundResource(_local12, _local14);
} else {
createExternalSoundResource(_local12, _local13);
};
};
};
};
};
};
};
};
};
};
if (!(_local6)){
trace(("ResourceManager. Error! Could not find matching profile: " + _local2));
};
}
public function getSoundResource(_arg1:String):Sound{
var _local2:Resource;
_local2 = m_resourcesMap[_arg1];
if (_local2 == null){
Console.error((("ResourceManager.getSoundResource: Unknown resource: [" + _arg1) + "]"));
return (null);
};
if (_local2.isLoading()){
Console.error((("ResourceManager.getSoundResource: Preemptive grab of resource [" + _arg1) + "]"));
return (null);
};
return (_local2.sound);
}
public function createExternalSoundResource(_arg1:String, _arg2:String){
var _local3:URLRequest;
var _local4:Sound;
var _local5:Resource;
_local3 = new URLRequest(_arg2);
_local4 = new Sound();
_local4.load(_local3);
if (m_resourcesMap[_arg1] != null){
Console.error((("ResourceManager:createExternalSoundResource. Already a resource with name " + _arg1) + ". Resource was not created. "));
return;
};
_local5 = new Resource();
_local5.sound = _local4;
m_resourcesMap[_arg1] = _local5;
}
public function createEmbeddedSoundResource(_arg1:String, _arg2:String){
var ClassReference:Class;
var sound:Sound;
var resource:Resource;
var a_resourceName = _arg1;
var a_className = _arg2;
try {
ClassReference = (getDefinitionByName(a_className) as Class);
sound = (new (ClassReference) as Sound);
resource = new Resource();
if (sound == null){
Console.error((("ResourceManager:createEmbeddedSoundResource. No sound class with name " + a_className) + ". Resource was not created. "));
return;
};
resource.sound = sound;
if (m_resourcesMap[a_resourceName] != null){
Console.error((("ResourceManager:createEmbeddedResourceFromClassName. Already a resource with name " + a_resourceName) + ". Resource was not created. "));
return;
};
m_resourcesMap[a_resourceName] = resource;
} catch(e:Error) {
trace(((("ResourceManager. Cannot create resource with name " + a_className) + ". Info: ") + e));
};
}
public function isLoading():Boolean{
var _local1:Boolean;
var _local2:Object;
var _local3:Resource;
_local1 = false;
for (_local2 in m_resourcesMap) {
_local1 = true;
_local3 = m_resourcesMap[_local2];
if (_local3.isLoading()){
return (true);
};
};
if (!(_local1)){
return (true);
};
return (false);
}
public function getBitmapResource(_arg1:String):BitmapData{
var _local2:Resource;
_local2 = m_resourcesMap[_arg1];
if (_local2 == null){
Console.error((("ResourceManager.getBitmapResource: Unknown resource: [" + _arg1) + "]"));
return (null);
};
if (_local2.isLoading()){
Console.error((("ResourceManager.getBitmapResource: Preemptive grab of resource [" + _arg1) + "]"));
return (null);
};
return (_local2.bitmapData);
}
public function loadBitmapResource(_arg1:Event){
var _local2:BitmapData;
var _local3:Object;
var _local4:Resource;
_local2 = _arg1.target.content.bitmapData;
for (_local3 in m_resourcesMap) {
_local4 = m_resourcesMap[_local3];
if (_local4.loaderInfo == _arg1.target){
_local4.bitmapData = _local2;
};
};
}
public function dispose(){
var _local1:Object;
for (_local1 in m_resourcesMap) {
m_resourcesMap[_local1] = null;
};
m_resourcesMap = null;
}
public static function createResourceManager(_arg1:String):ResourceManager{
var _local2:ResourceManager;
var _local3:URLLoader;
var _local4:URLRequest;
_local2 = new (ResourceManager);
_local3 = new URLLoader();
_local4 = new URLRequest(_arg1);
_local3.load(_local4);
_local3.addEventListener(Event.COMPLETE, _local2.handleFileLoad);
return (_local2);
}
}
}//package com.gamedozer.utils
import flash.media.*;
import flash.display.*;
class Resource {
private var loaderInfo:LoaderInfo;// = null
private var bitmapData:BitmapData;// = null
private var sound:Sound;// = null
private function Resource(){
bitmapData = null;
sound = null;
loaderInfo = null;
super();
}
private function isLoading():Boolean{
var _local1:Boolean;
_local1 = (((bitmapData == null)) && ((sound == null)));
return (_local1);
}
}
Section 26
//Settings (com.gamedozer.utils.Settings)
package com.gamedozer.utils {
import flash.net.*;
import flash.events.*;
import flash.utils.*;
public class Settings {
var m_keyValueMap:Dictionary;
public function Settings(){
m_keyValueMap = new Dictionary(true);
}
public function getNumber(_arg1:String, _arg2:Number):Number{
var _local3:Number;
if (!(exists(_arg1))){
return (_arg2);
};
_local3 = Number(m_keyValueMap[_arg1]);
if (isNaN(_local3)){
error((("Settings:getNumber. Key " + _arg1) + " is not a number."));
return (0);
};
return (_local3);
}
function error(_arg1:String){
trace(_arg1);
}
function handleFileLoad(_arg1:Event){
loadFromXML(new XML(_arg1.target.data));
}
public function getString(_arg1:String, _arg2:String):String{
if (!(exists(_arg1))){
return (_arg2);
};
return (String(m_keyValueMap[_arg1]));
}
public function getBoolean(_arg1:String, _arg2:Boolean):Boolean{
if (!(exists(_arg1))){
return (_arg2);
};
return (Boolean(m_keyValueMap[_arg1]));
}
function loadFromXML(_arg1:XML){
var _local2:XMLList;
var _local3:*;
var _local4:String;
var _local5:String;
_local2 = _arg1.descendants("setting");
for each (_local3 in _local2) {
_local4 = _local3.attribute("key");
_local5 = _local3.attribute("value");
if (_local4 == ""){
} else {
m_keyValueMap[_local4] = _local5;
};
};
}
public function getInt(_arg1:String, _arg2:int):int{
if (!(exists(_arg1))){
return (_arg2);
};
return (int(m_keyValueMap[_arg1]));
}
public function exists(_arg1:String):Boolean{
if (m_keyValueMap[_arg1] == null){
error((("Settings:exists. Key not found " + _arg1) + "."));
return (false);
};
return (true);
}
function dispose(){
m_keyValueMap = null;
}
public static function createSettingsFromURL(_arg1:String):Settings{
var _local2:Settings;
var _local3:URLLoader;
var _local4:URLRequest;
_local2 = new (Settings);
_local3 = new URLLoader();
_local4 = new URLRequest(_arg1);
_local3.load(_local4);
_local3.addEventListener(Event.COMPLETE, _local2.handleFileLoad);
return (_local2);
}
public static function createSettingsFromXML(_arg1:XML):Settings{
var _local2:Settings;
_local2 = new (Settings);
_local2.loadFromXML(_arg1);
return (_local2);
}
}
}//package com.gamedozer.utils
Section 27
//Storage (com.gamedozer.utils.Storage)
package com.gamedozer.utils {
import flash.net.*;
public class Storage {
var m_sharedObject:SharedObject;
public function Storage(_arg1:String){
m_sharedObject = SharedObject.getLocal(_arg1);
}
function flush(){
m_sharedObject.flush();
}
public function setBoolean(_arg1:String, _arg2:Boolean){
m_sharedObject.data[_arg1] = _arg2;
flush();
}
public function setNumber(_arg1:String, _arg2:Number){
m_sharedObject.data[_arg1] = _arg2;
flush();
}
public function clear(){
m_sharedObject.clear();
}
public function getString(_arg1:String, _arg2:String):String{
if (m_sharedObject.data[_arg1] == null){
m_sharedObject.data[_arg1] = _arg2;
return (_arg2);
};
return (String(m_sharedObject.data[_arg1]));
}
public function getBoolean(_arg1:String, _arg2:Boolean):Boolean{
if (m_sharedObject.data[_arg1] == null){
m_sharedObject.data[_arg1] = _arg2;
return (_arg2);
};
return (Boolean(m_sharedObject.data[_arg1]));
}
public function setInt(_arg1:String, _arg2:int){
m_sharedObject.data[_arg1] = _arg2;
flush();
}
public function getInt(_arg1:String, _arg2:int):int{
if (m_sharedObject.data[_arg1] == null){
m_sharedObject.data[_arg1] = _arg2;
return (_arg2);
};
return (int(m_sharedObject.data[_arg1]));
}
public function setString(_arg1:String, _arg2:String){
m_sharedObject.data[_arg1] = _arg2;
flush();
}
public function getNumber(_arg1:String, _arg2:Number):Number{
if (m_sharedObject.data[_arg1] == null){
m_sharedObject.data[_arg1] = _arg2;
return (_arg2);
};
return (Number(m_sharedObject.data[_arg1]));
}
}
}//package com.gamedozer.utils
Section 28
//StringParser (com.gamedozer.utils.StringParser)
package com.gamedozer.utils {
public class StringParser {
public static function parseBBCode(_arg1:String):String{
_arg1 = _arg1.replace(/\[b\](.*?)\[\/b\]/gi, "<b>$1</b>");
_arg1 = _arg1.replace(/\[i\](.*?)\[\/i\]/gi, "<i>$1</i>");
_arg1 = _arg1.replace(/\[u\](.*?)\[\/u\]/gi, "<u>$1</u>");
_arg1 = _arg1.replace(/\[color=(.*?)\](.*?)\[\/color\]/gi, "<font color=\"$1\">$2</font>");
return (_arg1);
}
public static function convertToClockTime(_arg1:int):String{
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:String;
var _local6:String;
_local2 = Math.floor(((_arg1 / 1000) / 60));
_local3 = (Math.floor((_arg1 / 1000)) % 60);
_local4 = ((_local2 < 10)) ? ("0" + _local2) : String(_local2);
_local5 = ((_local3 < 10)) ? ("0" + _local3) : String(_local3);
_local6 = ((_local2 + ":") + _local5);
return (_local6);
}
public static function convertToCurrency(_arg1:Number):String{
var _local2:String;
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:String;
var _local7:int;
_local2 = Math.floor(_arg1).toString();
_local3 = (Math.round(((_arg1 - Math.floor(_arg1)) * 100)) / 100).toString();
_local4 = 3;
if (_arg1 < 0){
_local4 = (_local4 + 1);
};
if (_local2.length > _local4){
_local5 = (_local2.length % 3);
if (_local5){
_local6 = (_local2.substr(0, _local5) + ",");
} else {
_local6 = "";
};
_local7 = _local5;
while (_local7 < (_local2.length - 3)) {
_local6 = (_local6 + (_local2.substr(_local7, 3) + ","));
_local7 = (_local7 + 3);
};
_local6 = (_local6 + _local2.substr(-3, 3));
} else {
_local6 = _local2;
};
while (_local3.length < 4) {
_local3 = (_local3 + "0");
};
_local3 = _local3.substr(-2, 2);
if (_local3 == "00"){
return (_local6);
};
return (((_local6 + ".") + _local3));
}
public static function parseURLs(_arg1:String, _arg2:String="_new"):String{
var _local3:String;
var _local4:String;
var _local5:RegExp;
var _local6:String;
_local3 = "(http://)";
_local4 = "([a-z0-9_-]+.[a-z0-9_-]+.[a-z0-9_-]+)";
_local5 = new RegExp((_local3 + _local4), "ig");
_arg1 = _arg1.replace(_local5, "<a href=\"http://$2\"><u>$1$2</u></a>");
_local6 = "([ >])";
_local4 = "(www.[a-z0-9_-]+.[a-z0-9_-]+)";
_local5 = new RegExp((_local6 + _local4), "ig");
_arg1 = _arg1.replace(_local5, "<a href=\"http://$2\"><u>$2</u></a>");
return (_arg1);
}
}
}//package com.gamedozer.utils
Section 29
//png (Dagger_Base.png)
package Dagger_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Dagger_Base
Section 30
//png (Dagger_Mask.png)
package Dagger_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Dagger_Mask
Section 31
//png (Disc_Base.png)
package Disc_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Disc_Base
Section 32
//png (Disc_Mask.png)
package Disc_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Disc_Mask
Section 33
//png (DoubleAxe_Base.png)
package DoubleAxe_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package DoubleAxe_Base
Section 34
//png (DoubleAxe_Mask.png)
package DoubleAxe_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package DoubleAxe_Mask
Section 35
//wav (EnemyDeath.wav)
package EnemyDeath {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package EnemyDeath
Section 36
//wav (EnemyTalk.wav)
package EnemyTalk {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package EnemyTalk
Section 37
//wav (FemaleAttack.wav)
package FemaleAttack {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package FemaleAttack
Section 38
//wav (FemaleDeath.wav)
package FemaleDeath {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package FemaleDeath
Section 39
//wav (FemaleHurt.wav)
package FemaleHurt {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package FemaleHurt
Section 40
//png (Gryphon_Bottom.png)
package Gryphon_Bottom {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Gryphon_Bottom
Section 41
//png (Gryphon_Top.png)
package Gryphon_Top {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Gryphon_Top
Section 42
//png (Gyena_Bottom.png)
package Gyena_Bottom {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Gyena_Bottom
Section 43
//png (Gyena_Top.png)
package Gyena_Top {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Gyena_Top
Section 44
//png (Hammer_Base.png)
package Hammer_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Hammer_Base
Section 45
//png (Hammer_Mask.png)
package Hammer_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Hammer_Mask
Section 46
//png (Javelin_Base.png)
package Javelin_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Javelin_Base
Section 47
//png (Javelin_Mask.png)
package Javelin_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Javelin_Mask
Section 48
//png (Kite_Bottom.png)
package Kite_Bottom {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Kite_Bottom
Section 49
//png (Kite_Top.png)
package Kite_Top {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Kite_Top
Section 50
//png (Lance_Base.png)
package Lance_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Lance_Base
Section 51
//png (Lance_Mask.png)
package Lance_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Lance_Mask
Section 52
//png (Mage_Base.png)
package Mage_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Mage_Base
Section 53
//png (Mage_Mask.png)
package Mage_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Mage_Mask
Section 54
//png (Magical_explosion.png)
package Magical_explosion {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Magical_explosion
Section 55
//wav (MaleAttack.wav)
package MaleAttack {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package MaleAttack
Section 56
//wav (MaleDeath.wav)
package MaleDeath {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package MaleDeath
Section 57
//wav (MaleHurt.wav)
package MaleHurt {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package MaleHurt
Section 58
//png (ManualTurret_Base.png)
package ManualTurret_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package ManualTurret_Base
Section 59
//png (ManualTurret_Mask.png)
package ManualTurret_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package ManualTurret_Mask
Section 60
//png (MoveableTurret.png)
package MoveableTurret {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package MoveableTurret
Section 61
//png (Obelisk.png)
package Obelisk {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Obelisk
Section 62
//png (Pegasus_Bottom.png)
package Pegasus_Bottom {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Pegasus_Bottom
Section 63
//png (Pegasus_Top.png)
package Pegasus_Top {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Pegasus_Top
Section 64
//png (Portal.png)
package Portal {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Portal
Section 65
//png (Rogue_Base.png)
package Rogue_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Rogue_Base
Section 66
//png (Rogue_Mask.png)
package Rogue_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Rogue_Mask
Section 67
//wav (RohkAttack.wav)
package RohkAttack {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package RohkAttack
Section 68
//wav (RohkWalk.wav)
package RohkWalk {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package RohkWalk
Section 69
//png (Scarlet_Base.png)
package Scarlet_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Scarlet_Base
Section 70
//png (Scarlet_Mask.png)
package Scarlet_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Scarlet_Mask
Section 71
//png (ScarletAvatar_Base.png)
package ScarletAvatar_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package ScarletAvatar_Base
Section 72
//png (ScarletAvatar_Mask_Fabric.png)
package ScarletAvatar_Mask_Fabric {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package ScarletAvatar_Mask_Fabric
Section 73
//png (ScarletAvatar_Mask_Hair.png)
package ScarletAvatar_Mask_Hair {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package ScarletAvatar_Mask_Hair
Section 74
//png (Scimitar_Base.png)
package Scimitar_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Scimitar_Base
Section 75
//png (Scimitar_Mask.png)
package Scimitar_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Scimitar_Mask
Section 76
//png (Shock.png)
package Shock {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Shock
Section 77
//png (Slag_Base.png)
package Slag_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Slag_Base
Section 78
//png (Slag_Mask.png)
package Slag_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Slag_Mask
Section 79
//png (Splatter_Base.png)
package Splatter_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Splatter_Base
Section 80
//png (Splatter_Mask.png)
package Splatter_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Splatter_Mask
Section 81
//png (Sword_Base.png)
package Sword_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Sword_Base
Section 82
//png (Sword_Mask.png)
package Sword_Mask {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Sword_Mask
Section 83
//png (Tepper_Base.png)
package Tepper_Base {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Tepper_Base
Section 84
//png (Tepper_Mask_Fabric.png)
package Tepper_Mask_Fabric {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Tepper_Mask_Fabric
Section 85
//png (Tepper_Mask_Hair.png)
package Tepper_Mask_Hair {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Tepper_Mask_Hair
Section 86
//WAV (Tepper_play.WAV)
package Tepper_play {
import flash.media.*;
public dynamic class WAV extends Sound {
}
}//package Tepper_play
Section 87
//WAV (Tepper_story.WAV)
package Tepper_story {
import flash.media.*;
public dynamic class WAV extends Sound {
}
}//package Tepper_story
Section 88
//WAV (Tepper_win.WAV)
package Tepper_win {
import flash.media.*;
public dynamic class WAV extends Sound {
}
}//package Tepper_win
Section 89
//png (Treasure.png)
package Treasure {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package Treasure
Section 90
//WAV (ui.WAV)
package ui {
import flash.media.*;
public dynamic class WAV extends Sound {
}
}//package ui
Section 91
//png (UpgradeHitpoints0.png)
package UpgradeHitpoints0 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeHitpoints0
Section 92
//png (UpgradeHitpoints1.png)
package UpgradeHitpoints1 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeHitpoints1
Section 93
//png (UpgradeHitpoints2.png)
package UpgradeHitpoints2 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeHitpoints2
Section 94
//png (UpgradeHitpoints3.png)
package UpgradeHitpoints3 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeHitpoints3
Section 95
//png (UpgradeMovementSpeed0.png)
package UpgradeMovementSpeed0 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeMovementSpeed0
Section 96
//png (UpgradeMovementSpeed1.png)
package UpgradeMovementSpeed1 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeMovementSpeed1
Section 97
//png (UpgradeMovementSpeed2.png)
package UpgradeMovementSpeed2 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeMovementSpeed2
Section 98
//png (UpgradeMovementSpeed3.png)
package UpgradeMovementSpeed3 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeMovementSpeed3
Section 99
//png (UpgradeProjectileSpeed0.png)
package UpgradeProjectileSpeed0 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeProjectileSpeed0
Section 100
//png (UpgradeProjectileSpeed1.png)
package UpgradeProjectileSpeed1 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeProjectileSpeed1
Section 101
//png (UpgradeProjectileSpeed2.png)
package UpgradeProjectileSpeed2 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeProjectileSpeed2
Section 102
//png (UpgradeProjectileSpeed3.png)
package UpgradeProjectileSpeed3 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeProjectileSpeed3
Section 103
//png (UpgradeRefireRate0.png)
package UpgradeRefireRate0 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeRefireRate0
Section 104
//png (UpgradeRefireRate1.png)
package UpgradeRefireRate1 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeRefireRate1
Section 105
//png (UpgradeRefireRate2.png)
package UpgradeRefireRate2 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeRefireRate2
Section 106
//png (UpgradeRefireRate3.png)
package UpgradeRefireRate3 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(){
super(0, 0);
}
}
}//package UpgradeRefireRate3
Section 107
//AIBrain (AIBrain)
package {
import com.gamedozer.math.*;
import com.gamedozer.misc.*;
import flash.geom.*;
public class AIBrain {
var m_timeTillPickNextTarget:Number;
var m_game:UI_Game;
var m_timeTillNextDirectionChange:Number;
var m_moveTarget:Vector2;
var m_timeTillNextFire:Number;
var m_targetPlayer:Player;
var m_player:Player;
var m_skill:Number;
public function AIBrain(_arg1:UI_Game, _arg2:Player, _arg3:Number=1){
m_game = _arg1;
m_player = _arg2;
m_targetPlayer = null;
m_moveTarget = new Vector2();
m_timeTillNextDirectionChange = (Math.random() * 300);
m_timeTillNextFire = (Math.random() * 500);
m_timeTillPickNextTarget = ((500 + Math.random()) + 4000);
m_skill = _arg3;
m_game.addBrain(this);
}
function updateDodging(_arg1:Number){
var _local2:Path;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Point;
m_timeTillNextDirectionChange = (m_timeTillNextDirectionChange - _arg1);
if (m_timeTillNextDirectionChange < 0){
m_timeTillNextDirectionChange = (200 + (Math.random() * 500));
_local2 = m_player.getPath();
_local3 = Math.random();
_local4 = 0;
_local5 = 0.5;
if (_local3 < 0.33){
m_moveTarget.x = m_targetPlayer.x;
m_moveTarget.y = m_targetPlayer.y;
m_player.updateMouse(m_moveTarget.x, m_moveTarget.y, _arg1);
return;
};
if (_local3 < 0.66){
_local4 = (1 - ((_local5 * Math.random()) * (1 - m_skill)));
} else {
_local4 = (0 + ((_local5 * Math.random()) * (1 - m_skill)));
};
_local6 = _local2.pointAt(_local4);
m_moveTarget.x = _local6.x;
m_moveTarget.y = _local6.y;
};
m_player.updateMouse(m_moveTarget.x, m_moveTarget.y, _arg1);
}
function getTarget():Player{
return (m_targetPlayer);
}
function updateFiringAndDodging(_arg1:Number){
var _local2:Vector2;
var _local3:int;
m_timeTillNextFire = (m_timeTillNextFire - _arg1);
if (m_timeTillNextFire < 0){
if (m_targetPlayer.isDead()){
return;
};
m_player.updateMouse(m_targetPlayer.x, m_targetPlayer.y, _arg1);
_local2 = new Vector2(m_targetPlayer.x, m_targetPlayer.y);
_local3 = 500;
_local2.x = (_local2.x + ((1 - m_skill) * ((Math.random() * _local3) - (_local3 / 2))));
_local2.y = (_local2.y + ((1 - m_skill) * ((Math.random() * _local3) - (_local3 / 2))));
m_player.pointTurretTo(_local2.x, _local2.y);
m_timeTillNextFire = (150 + ((Math.random() * 2000) * (1 - m_skill)));
m_player.fire(_local2.x, _local2.y);
} else {
updateDodging(_arg1);
};
}
function getPlayer():Player{
return (m_player);
}
function update(_arg1:Number){
if (m_player.isDead()){
return;
};
if ((((m_targetPlayer == null)) || (m_targetPlayer.isDead()))){
pickRandomTarget();
return;
};
updateFiringAndDodging(_arg1);
updatePickNewTarget(_arg1);
}
function dispose(){
m_game = null;
m_player = null;
m_targetPlayer = null;
}
function updatePickNewTarget(_arg1:Number){
m_timeTillPickNextTarget = (m_timeTillPickNextTarget - _arg1);
if (m_timeTillPickNextTarget < 0){
m_timeTillPickNextTarget = ((500 + Math.random()) + 4000);
pickRandomTarget();
};
}
function pickRandomTarget(){
var _local1:Array;
var _local2:int;
var _local3:int;
_local1 = m_game.getPlayers();
if (_local1.length <= 1){
trace("Please add a human before adding AIs.");
m_targetPlayer = null;
return;
};
m_targetPlayer = m_player;
_local2 = 10;
while ((((((m_targetPlayer == m_player)) || (m_targetPlayer.isDead()))) || (m_player.hasAlly(m_targetPlayer)))) {
_local3 = Math.floor((Math.random() * _local1.length));
m_targetPlayer = _local1[_local3];
_local2--;
if (_local2 <= 0){
break;
};
};
if (_local2 == 0){
m_targetPlayer = null;
};
}
function addAlly(_arg1:Player){
m_player.addAlly(_arg1);
}
}
}//package
Section 108
//ArcadeTown_SplashMC (ArcadeTown_SplashMC)
package {
import flash.display.*;
public dynamic class ArcadeTown_SplashMC extends MovieClip {
}
}//package
Section 109
//BG1MC (BG1MC)
package {
import flash.display.*;
public dynamic class BG1MC extends MovieClip {
}
}//package
Section 110
//BG2MC (BG2MC)
package {
import flash.display.*;
public dynamic class BG2MC extends MovieClip {
}
}//package
Section 111
//BG3MC (BG3MC)
package {
import flash.display.*;
public dynamic class BG3MC extends MovieClip {
public var buildingLayer_mc:MovieClip;
}
}//package
Section 112
//BMApplication (BMApplication)
package {
import flash.ui.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.media.*;
import com.gamedozer.audio.*;
public class BMApplication extends MovieClip {
var m_timer:Timer;
var k_fadeBuffer:Number;// = 100
var m_shownSponsor:Boolean;// = false
public var progress_txt:TextField;
var m_splash:MovieClip;
var k_fadeTime:Number;// = 350
var m_accruedTime:Number;
var k_showTime:Number;// = 2500
public function BMApplication(){
var _local1:ContextMenu;
k_showTime = 2500;
k_fadeTime = 350;
k_fadeBuffer = 100;
m_shownSponsor = false;
super();
addFrameScript(1, frame2, 2, frame3);
m_shownSponsor = false;
_local1 = new ContextMenu();
_local1.hideBuiltInItems();
this.contextMenu = _local1;
new InputKeyboard(this.stage);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, updateLoader);
this.loaderInfo.addEventListener(Event.COMPLETE, finishLoader);
changeVolume(0);
stop();
}
function preload(_arg1:Event){
if (ResourceLoader.isLoading()){
return;
};
this.removeEventListener(Event.ENTER_FRAME, preload);
showUrbansquallSplash();
}
function showSponsorSplash(_arg1:MovieClip){
removeChild(m_splash);
m_splash = _arg1;
addChild(m_splash);
m_shownSponsor = true;
m_accruedTime = 0;
}
function startPreloading(){
ResourceLoader.preloadResources();
this.addEventListener(Event.ENTER_FRAME, preload);
}
function updateLoader(_arg1:Event){
var _local2:Number;
var _local3:Number;
_local2 = _arg1.target.bytesLoaded;
_local3 = _arg1.target.bytesTotal;
progress_txt.text = String(Math.floor(((_local2 / _local3) * 100)));
}
function frame3(){
this.startPreloading();
stop();
}
function startGame(){
var _local1:UI_Main;
var _local2:Boolean;
changeVolume(1);
_local1 = new UI_Main();
addChild(_local1);
_local1.initialize();
_local2 = BMStorage.getSingleton().getBoolean("audio", false);
if (_local2){
SoundSystem.getSingleton().mute();
};
this.stage.stageFocusRect = false;
}
function showUrbansquallSplash(){
m_timer = new Timer(50);
m_timer.addEventListener(TimerEvent.TIMER, updateSplash);
m_timer.start();
m_splash = new Urbansquall_SplashMC();
addChild(m_splash);
m_accruedTime = 0;
}
function updateSplash(_arg1:Event){
var _local2:Number;
var _local3:String;
m_accruedTime = (m_accruedTime + 50);
if (m_accruedTime < k_showTime){
return;
};
if (m_accruedTime > ((k_fadeTime + k_showTime) + k_fadeBuffer)){
if (m_shownSponsor){
finishSplashScreens();
} else {
_local3 = this.loaderInfo.url;
if (_local3.toLowerCase().indexOf("uploads.ungrounded.net") >= 0){
showSponsorSplash(new Newgrounds_SplashMC());
} else {
showSponsorSplash(new ArcadeTown_SplashMC());
};
};
return;
};
if (m_accruedTime < (k_showTime + k_fadeBuffer)){
return;
};
_local2 = (1 - (((m_accruedTime - k_showTime) - k_fadeBuffer) / k_fadeTime));
m_splash.alpha = _local2;
}
function finishSplashScreens(){
m_timer.stop();
startGame();
}
function finishLoader(_arg1:Event){
play();
}
function frame2(){
nextFrame();
}
function changeVolume(_arg1:Number){
var _local2:SoundTransform;
_local2 = new SoundTransform();
_local2.volume = _arg1;
SoundMixer.soundTransform = _local2;
}
}
}//package
Section 113
//BMSettings (BMSettings)
package {
import com.gamedozer.utils.*;
class BMSettings {
static var m_singleton:Settings = null;
static function getSingleton():Settings{
trace("Get singleton");
return (m_singleton);
}
static function createSingleton(){
}
}
}//package
Section 114
//BMStorage (BMStorage)
package {
import com.gamedozer.utils.*;
class BMStorage {
static var m_singleton:Storage = null;
static function getSingleton():Storage{
if (m_singleton == null){
createSingleton();
};
return (m_singleton);
}
static function createSingleton(){
m_singleton = new Storage("battlemachy_tepper_2");
}
}
}//package
Section 115
//CampaignListEnd (CampaignListEnd)
package {
import flash.text.*;
import flash.display.*;
public dynamic class CampaignListEnd extends MovieClip {
public var title_txt:TextField;
}
}//package
Section 116
//CampaignListEntry (CampaignListEntry)
package {
import flash.text.*;
import flash.display.*;
public dynamic class CampaignListEntry extends MovieClip {
public var title_txt:TextField;
}
}//package
Section 117
//Collider (Collider)
package {
import com.gamedozer.math.*;
import flash.geom.*;
public class Collider implements IMovingEntity {
var m_game:UI_Game;
var m_isWaitingForDeletion:Boolean;// = false
var m_canBeCollidedByColliders:Boolean;
var m_maximumHitpoints:int;
var m_radius:Number;
var m_soundType:String;
var m_livingTime:Number;
var m_hitpointFlashTime:Number;
var m_displayObject:IManualRotate;
var m_canCollideWithColliders:Boolean;
var m_owner:Player;
var m_hitpoints:int;
var m_velocity:Vector2;
var m_facingDirection:Vector2;
var m_speed:Number;
public function Collider(_arg1:UI_Game, _arg2:Player, _arg3:IManualRotate){
m_isWaitingForDeletion = false;
super();
m_game = _arg1;
m_owner = _arg2;
m_livingTime = 4000;
m_velocity = new Vector2();
m_facingDirection = new Vector2(0, -1);
m_displayObject = _arg3;
m_maximumHitpoints = 10;
m_hitpoints = m_maximumHitpoints;
m_speed = 0.3;
m_radius = 8;
m_soundType = "";
m_canCollideWithColliders = false;
m_canBeCollidedByColliders = false;
m_hitpointFlashTime = 0;
m_game.addCollider(this);
}
public function get y():Number{
return (this.m_displayObject.y);
}
function setFacingDirection(_arg1:Number, _arg2:Number){
var _local3:Number;
_local3 = getAngle(_arg1, _arg2);
this.m_displayObject.setRotation(_local3);
m_facingDirection.x = _arg1;
m_facingDirection.y = _arg2;
}
function nominateForDeletion(){
m_isWaitingForDeletion = true;
}
function updatePosition(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Vector2;
var _local5:Array;
var _local6:Array;
var _local7:int;
var _local8:Player;
var _local9:Boolean;
var _local10:int;
var _local11:Obstacle;
var _local12:Array;
var _local13:int;
var _local14:Collider;
var _local15:int;
var _local16:Player;
if (m_velocity.lengthSquared() <= 0.001){
return;
};
_local2 = (this.x + (m_velocity.x * _arg1));
_local3 = (this.y + (m_velocity.y * _arg1));
_local4 = new Vector2(_local2, _local3);
_local5 = m_game.testCircleVersusPlayers(m_radius, _local4);
if ((((_local5.length == 1)) && ((_local5[0] == m_owner)))){
} else {
if (_local5.length != 0){
_local7 = 0;
while (_local7 < _local5.length) {
_local8 = _local5[_local7];
_local9 = false;
if (((!((m_owner == null))) && (m_owner.hasAlly(_local8)))){
_local9 = true;
};
if (!(_local9)){
_local8.respondToBulletHit(this);
};
_local7++;
};
if (isDead()){
return;
};
};
};
_local6 = m_game.testCircleVersusObstacles(m_radius, _local4);
if (_local6.length != 0){
_local10 = 0;
while (_local10 < _local6.length) {
_local11 = _local6[_local10];
_local11.respondToBulletHit(this);
if (isDead()){
return;
};
_local10++;
};
};
if (m_canCollideWithColliders){
_local12 = m_game.testCircleVersusBullets(m_radius, _local4);
_local13 = 0;
while (_local13 < _local12.length) {
_local14 = _local12[_local13];
if (!(_local14.canBeCollidedByColliders())){
} else {
if (_local14 == this){
} else {
_local15 = Math.min(_local14.getHitpoints(), this.getHitpoints());
takeDamage(_local15);
_local14.takeDamage(_local15);
_local16 = this.getOwner();
if (((!((_local16 == null))) && (_local16.isLocalPlayer()))){
m_game.getScore().ShotsHit++;
};
if (((((_local14.isDead()) && (!((_local16 == null))))) && (_local16.isLocalPlayer()))){
m_game.getScore().Kills++;
};
};
};
_local13++;
};
};
this.x = _local2;
this.y = _local3;
}
function setRadius(_arg1:Number){
m_radius = _arg1;
}
function setLivingTime(_arg1:int){
m_livingTime = _arg1;
}
function setMaximumHitpoints(_arg1:int){
if (_arg1 <= 0){
trace("Collider.setMaximumHitpoints, invalid hitpoint amount.");
return;
};
m_maximumHitpoints = _arg1;
m_hitpoints = m_maximumHitpoints;
}
function setMovementSpeed(_arg1:Number){
m_speed = _arg1;
if (Math.abs(m_speed) <= 0.001){
m_velocity.x = 0;
m_velocity.y = 0;
} else {
if (m_velocity.lengthSquared() <= 0.001){
return;
};
m_velocity.normalize(m_speed);
};
}
function dispose(){
if (!(m_isWaitingForDeletion)){
return;
};
m_displayObject.dispose();
m_game.removeCollider(this);
m_velocity = null;
m_owner = null;
m_game = null;
m_displayObject = null;
}
function getRadius():Number{
return (m_radius);
}
function getHitpoints():int{
return (m_hitpoints);
}
function setSoundType(_arg1:String){
m_soundType = _arg1;
}
function intersectsCircle(_arg1:Number, _arg2:Vector2):Boolean{
var _local3:Vector2;
_local3 = new Vector2(this.x, this.y);
if (Intersect.testCircleAndCircle(_arg1, _arg2, m_radius, _local3)){
return (true);
};
return (false);
}
function getAngle(_arg1:Number, _arg2:Number):Number{
return ((((Math.atan2(_arg2, _arg1) * 180) / Math.PI) + 90));
}
function die(){
if (m_isWaitingForDeletion){
return;
};
m_displayObject.die();
if (m_soundType != ""){
m_game.playSound((m_soundType + "Death"));
};
nominateForDeletion();
}
function getFacingDirection():Vector2{
return (m_facingDirection);
}
function initialize(){
}
function isDead():Boolean{
return ((m_hitpoints <= 0));
}
function updateHitpointFlash(_arg1:Number){
var _local2:Number;
var _local3:ColorTransform;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
if (m_hitpointFlashTime <= 0){
return;
};
m_hitpointFlashTime = (m_hitpointFlashTime - _arg1);
if (m_hitpointFlashTime <= 0){
_local7 = (m_hitpoints / m_maximumHitpoints);
if (_local7 < 0.3){
changeHitpointDisplay();
if (_local7 < 0.15){
m_hitpointFlashTime = (Player.k_timePerHitpointFlash / 2);
};
} else {
this.m_displayObject.transform.colorTransform = new ColorTransform();
};
return;
};
_local2 = (m_hitpointFlashTime / Player.k_timePerHitpointFlash);
_local3 = this.m_displayObject.transform.colorTransform;
_local4 = (_local3.redOffset * _local2);
_local5 = (_local3.greenOffset * _local2);
_local6 = (_local3.blueOffset * _local2);
_local3.redOffset = _local4;
_local3.greenOffset = _local5;
_local3.blueOffset = _local6;
this.m_displayObject.transform.colorTransform = _local3;
}
function setMovementDirection(_arg1:Number, _arg2:Number){
var _local3:Number;
m_velocity.x = _arg1;
m_velocity.y = _arg2;
m_facingDirection.x = _arg1;
m_facingDirection.y = _arg2;
if (m_velocity.lengthSquared() <= 0.001){
m_velocity.x = 0;
m_velocity.y = 0;
return;
};
_local3 = getAngle(_arg1, _arg2);
this.m_displayObject.setRotation(_local3);
m_velocity.normalize(m_speed);
}
function getVelocity():Vector2{
return (m_velocity);
}
function changeHitpointDisplay(){
var _local1:Number;
var _local2:ColorTransform;
var _local3:int;
var _local4:int;
var _local5:int;
if (isDead()){
return;
};
_local1 = (m_hitpoints / m_maximumHitpoints);
_local2 = new ColorTransform();
_local3 = Math.ceil((_local1 * 160));
_local4 = Math.ceil(((_local1 * 510) - 0xFF));
_local5 = Math.ceil(((_local1 * 510) - 0xFF));
_local2.redOffset = _local3;
_local2.greenOffset = _local4;
_local2.blueOffset = _local5;
this.m_displayObject.transform.colorTransform = _local2;
m_hitpointFlashTime = Player.k_timePerHitpointFlash;
}
function updateCollider(_arg1:Number){
if (m_livingTime > 0){
m_livingTime = (m_livingTime - _arg1);
if (m_livingTime <= 0){
nominateForDeletion();
return;
};
};
updatePosition(_arg1);
updateHitpointFlash(_arg1);
}
function takeDamage(_arg1:int){
if (m_hitpoints <= 0){
return;
};
m_hitpoints = (m_hitpoints - _arg1);
if (m_hitpoints <= 0){
die();
} else {
changeHitpointDisplay();
};
}
function setCanCollideWithColliders(){
m_canCollideWithColliders = true;
}
public function getDisplayObject():IManualRotate{
return (this.m_displayObject);
}
function setCanBeCollidedByColliders(_arg1:Boolean=true){
m_canBeCollidedByColliders = _arg1;
}
public function set y(_arg1:Number):void{
this.m_displayObject.y = _arg1;
}
function canBeCollidedByColliders():Boolean{
return (m_canBeCollidedByColliders);
}
public function set x(_arg1:Number):void{
this.m_displayObject.x = _arg1;
}
public function get x():Number{
return (this.m_displayObject.x);
}
public function set rotation(_arg1:Number):void{
this.m_displayObject.setRotation(_arg1);
}
function getOwner():Player{
return (m_owner);
}
}
}//package
Section 118
//ColorpickerBMP (ColorpickerBMP)
package {
import flash.display.*;
public dynamic class ColorpickerBMP extends BitmapData {
public function ColorpickerBMP(){
super(0, 0);
}
}
}//package
Section 119
//ComingSoon (ComingSoon)
package {
import flash.display.*;
public dynamic class ComingSoon extends MovieClip {
}
}//package
Section 120
//DefaultButton (DefaultButton)
package {
import flash.display.*;
import flash.text.*;
public dynamic class DefaultButton extends MovieClip {
public var background_mc:SimpleButton;
public var m_label_txt:TextField;
public function DefaultButton(){
addFrameScript(0, frame1);
}
function frame1(){
m_label_txt.mouseEnabled = false;
}
}
}//package
Section 121
//DynamicColor (DynamicColor)
package {
import com.gamedozer.graphics.*;
import flash.geom.*;
class DynamicColor {
static var m_colorizer:Colorizer = null;
static function initialize(){
if (m_colorizer != null){
return;
};
m_colorizer = new Colorizer();
}
static function getRGB(_arg1:String):uint{
initialize();
return (m_colorizer.lookupRGB(_arg1));
}
static function getTransform(_arg1:String):ColorTransform{
initialize();
return (m_colorizer.lookupTransform(_arg1));
}
}
}//package
Section 122
//Episode1_Level1 (Episode1_Level1)
package {
import flash.display.*;
import com.gamedozer.math.*;
import flash.utils.*;
import com.gamedozer.misc.*;
import com.gamedozer.utils.*;
import flash.media.*;
import com.gamedozer.graphics.*;
public class Episode1_Level1 extends Level implements IStateListener {
const k_captainName:String = "Oron";
const k_armyDistance:Number = 60;
const k_killLimit:Number = 5;
const k_general2Name:String = "Taur";
const k_levelDesc:String = "The Galhads are hearty warriors from the Northlands. From the wastelands of the east, an endless swarm of Gyena have begun devouring their way through Galhad land and it seems as if hope has run out. Oron the Lighthammer and his men are out on a raiding mission when they discover an enormous Gyena colony.";
const k_general2Color:uint = 0x800040;
const k_levelTitle:String = "Air Guardian";
const k_steedSize:Number = 96;
const k_halfSteedSize:Number = 48;
const k_general1Name:String = "Fallon";
const k_general1Color:uint = 32832;
const k_galhadSteed:String = "Gryphon";
var m_gameHasEnded:Boolean;
var m_radiusMap:Dictionary;
var m_playersPath:Path;
var m_stopUpdatingGyenas:Boolean;
var m_gameHasStarted:Boolean;
var m_attackingGyena:Collider;
var m_initialData:GameInitialData;
var m_pathWidth:int;
var m_killQuota:StateKillQuota;
var m_gameplayGyenas:Array;
var m_whichSwarmMap:Dictionary;
var m_swarmRotationCenterX1:int;
var m_swarmRotationCenterX2:int;
var m_timeUntilNextGyenaSpawn:int;
var m_swarmRotationCenterY2:int;
var m_swarmRotationCenterY1:int;
var m_player:Player;
public function Episode1_Level1(){
super(k_levelTitle, LevelList.k_campaignMode, 500);
setCampaignData(1, 1, k_levelDesc);
}
function getRandomGalhadColor():uint{
var _local1:int;
_local1 = Math.floor((Math.random() * 10));
switch (_local1){
case 0:
return (728516);
case 1:
return (728516);
case 2:
return (0x400080);
case 3:
return (0x5800B0);
case 4:
return (0x8000FF);
case 5:
return (32960);
case 6:
return (8421568);
case 7:
return (4868759);
case 8:
return (0x808080);
case 9:
return (0x696969);
};
return (0x696969);
}
function addPlayer(){
var _local1:String;
var _local2:String;
var _local3:String;
_local1 = m_initialData.getSteed(0);
_local2 = m_initialData.getCharacter(0);
_local3 = m_initialData.getWeapon(0);
m_player = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue), _local2, _local1, _local3);
m_player.setPathPosition((0.5 * m_playersPath.length));
m_player.setPath(m_playersPath);
m_game.makeLocalPlayer(m_player);
}
function queueDialogue(_arg1:String, _arg2:String, _arg3:Vector2){
var _local4:uint;
var _local5:uint;
_local4 = 0x804000;
_local5 = 0xFF00FF;
if (_arg1 == k_captainName){
_local4 = 0x804000;
_local5 = 0xFF;
};
if (_arg1 == k_general1Name){
_local4 = 0xCC6600;
_local5 = k_general1Color;
};
if (_arg1 == k_general2Name){
_local4 = 0xC0C0C0;
_local5 = k_general2Color;
};
m_game.queueGameEvent(new EVDialogue(m_game, k_captainName, _local5, _local4, _arg1, _arg2, (_arg1 == k_captainName), _arg3));
}
function sendGyenaAtPlayer(){
var _local1:Collider;
_local1 = m_gameplayGyenas[Math.floor((m_gameplayGyenas.length * Math.random()))];
m_attackingGyena = _local1;
}
function stopUpdatingGyenas(){
m_stopUpdatingGyenas = true;
}
function createGyenaAt(_arg1:Number, _arg2:Number, _arg3:Number=0.1):Collider{
var _local4:Collider;
_local4 = createRiderlessSteed(ResourceLoader.k_Gyena);
_local4.setSoundType("Enemy");
_local4.setMovementSpeed(_arg3);
_local4.setCanBeCollidedByColliders();
_local4.setCanCollideWithColliders();
_local4.x = _arg1;
_local4.y = _arg2;
return (_local4);
}
function setKillCount(){
m_killQuota = new StateKillQuota(m_game, k_killLimit);
m_game.addStateListener(m_killQuota);
}
public function dispose(){
}
function setColliderPositionsEqual(_arg1:Collider, _arg2:Collider){
_arg1.x = _arg2.x;
_arg1.y = _arg2.y;
}
function createFakeOronForEndSequence(){
var _local1:String;
var _local2:Collider;
var _local3:GSteed;
var _local4:uint;
var _local5:GRider;
var _local6:String;
m_player.visible = false;
_local1 = m_initialData.getSteed(0);
_local2 = createRiderlessSteed(_local1);
_local3 = (_local2.getDisplayObject() as GSteed);
_local4 = 0xFF;
_local5 = new GRider(_local4);
_local6 = m_initialData.getCharacter(0);
_local5.load(_local6);
_local3.insertRider(_local5);
_local2.setMovementDirection(0, 1);
_local2.x = m_player.x;
_local2.y = m_player.y;
}
function showFightBetweenGeneral2AndGyenas(_arg1:Collider){
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:Collider;
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _arg1.setMovementSpeed, 0.09)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _arg1.setMovementDirection, -1, -1)));
m_game.queueGameEvent(new EVDelay(m_game, 500));
_local2 = new Array();
_local3 = new Array();
_local4 = 0;
while (_local4 < 4) {
_local2.push(createGyenaAt(0, -(k_halfSteedSize)));
_local5 = createWeapon(k_general2Color, ResourceLoader.k_DoubleAxe);
_local5.x = -256;
_local5.y = -256;
_local5.setMovementSpeed(0.2);
_local5.setCanCollideWithColliders();
_local3.push(_local5);
m_game.queueGameEvent(new EVSeekTarget(m_game, _local2[_local4], _arg1, false));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, setColliderPositionsEqual, _local3[_local4], _arg1)));
m_game.queueGameEvent(new EVSeekTarget(m_game, _local3[_local4], _local2[_local4], (_local4 == 3)));
m_game.queueGameEvent(new EVSound(m_game, "MaleAttack"));
m_game.queueGameEvent(new EVDelay(m_game, 600));
_local4++;
};
_local2[0].x = 0;
_local2[0].y = -(k_halfSteedSize);
_local2[1].x = (k_steedSize * 2);
_local2[1].y = -(k_halfSteedSize);
_local2[2].x = -(k_halfSteedSize);
_local2[2].y = 0;
_local2[3].x = -(k_halfSteedSize);
_local2[3].y = (k_steedSize * 2);
}
override function populateGameImpl(){
var _local1:MovieClip;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Collider;
var _local8:int;
var _local9:int;
var _local10:Collider;
var _local11:Collider;
var _local12:Array;
var _local13:int;
var _local14:Vector2;
var _local15:Vector2;
var _local16:Vector2;
var _local17:Array;
var _local18:Array;
var _local19:Vector2;
var _local20:int;
var _local21:Collider;
var _local22:Array;
var _local23:Array;
var _local24:int;
var _local25:String;
var _local26:Collider;
var _local27:Collider;
m_game.addStateListener(this);
m_timeUntilNextGyenaSpawn = 0;
m_swarmRotationCenterX1 = (getStageWidth() / 4);
m_swarmRotationCenterY1 = 100;
m_swarmRotationCenterX2 = ((getStageWidth() * 3) / 4);
m_swarmRotationCenterY2 = 100;
m_gameHasStarted = false;
m_radiusMap = new Dictionary(false);
m_whichSwarmMap = new Dictionary(false);
m_gameplayGyenas = new Array();
m_gameHasEnded = false;
m_stopUpdatingGyenas = false;
m_initialData = m_game.getInitialData();
if (m_initialData == null){
m_initialData = getDefaultGameData();
};
_local1 = new BG1MC();
_local1.cacheAsBitmap = true;
m_game.getContainer().addChildAt(_local1, 0);
m_game.playLoop("Oron_Story");
_local2 = (getStageWidth() * 0.7);
_local3 = ((getStageWidth() - _local2) / 2);
_local4 = (getStageHeight() - 125);
m_playersPath = new Path();
m_playersPath.moveTo(_local3, _local4);
m_playersPath.lineTo((_local3 + _local2), _local4);
m_game.drawPath(m_playersPath, 0xFF);
m_game.queueGameEvent(new EVInput(m_game, false));
_local5 = (550 - k_armyDistance);
_local6 = (475 - k_armyDistance);
m_game.queueGameEvent(new EVSound(m_game, "EnemyTalk"));
_local7 = createSteedAndRider(m_initialData.getSteed(0), m_initialData.getCharacter(0), 0xFF);
_local7.x = 100;
_local7.y = 100;
_local7.setMovementSpeed(0.1);
_local7.setMovementDirection(1, 1);
_local8 = (_local5 + k_armyDistance);
_local9 = (_local6 - k_armyDistance);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local7, new Vector2(_local8, _local9), true));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local7.setMovementDirection, 0, 1)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local7.setMovementSpeed, 0)));
_local10 = createSteedAndRider(ResourceLoader.k_Pegasus, ResourceLoader.k_Warrior, 32832);
_local10.x = (_local5 + (k_armyDistance * 2));
_local10.y = _local6;
_local10.setMovementSpeed(0);
_local11 = createSteedAndRider(k_galhadSteed, ResourceLoader.k_Warrior, 0x800040);
_local11.x = _local5;
_local11.y = _local6;
_local11.setMovementSpeed(0);
_local12 = new Array();
_local13 = 1;
while (_local13 < 3) {
_local24 = 0;
while (_local24 < 3) {
_local25 = k_galhadSteed;
if ((((((_local13 == 1)) && ((_local24 == 1)))) || ((((_local13 == 2)) && ((_local24 == 1)))))){
_local25 = ResourceLoader.k_Pegasus;
};
_local26 = createSteedAndRider(_local25, ResourceLoader.k_Warrior, getRandomGalhadColor());
_local26.x = (_local5 + (k_armyDistance * _local24));
_local26.y = (_local6 + (k_armyDistance * _local13));
_local26.x = (_local26.x + (Math.round((Math.random() * 10)) - 5));
_local26.y = (_local26.y + (Math.round((Math.random() * 10)) - 5));
_local26.setMovementSpeed(0);
_local26.setMovementDirection(0, -1);
_local12.push(_local26);
_local24++;
};
_local13++;
};
_local14 = new Vector2(_local10.x, _local10.y);
_local15 = new Vector2(_local11.x, _local11.y);
_local16 = new Vector2(_local8, _local9);
queueDialogue(k_captainName, "The scouts were right. The swarm around this nest must number in the thousands.", _local16);
queueDialogue(k_general1Name, "Great Kijas! Thousands?", _local14);
queueDialogue(k_captainName, "It's the largest Gyena nest I have ever seen.", _local16);
queueDialogue(k_general1Name, "What should we do, Oron?", _local14);
queueDialogue(k_general2Name, "We have to crush them now. There's no way we can evade all of them.", _local15);
queueDialogue(k_captainName, "We haven't disturbed the nest. We can leave now and avoid any outlying Gyena. The nest will remain dormant until we can return in force.", _local16);
queueDialogue(k_general2Name, "And if they follow us back to Lihr? What then? We should fight now.", _local15);
queueDialogue(k_captainName, "If we wake them now, I'm certain they'll attack Lihr. There's no way we can defeat them all.", _local16);
queueDialogue(k_general2Name, "I thought you were a warrior, Oron. A warrior does not run from the face of danger.", _local15);
queueDialogue(k_captainName, "Don't be a fool, Taur. An attack now will alert the whole nest.", _local16);
queueDialogue(k_general2Name, "They are vermin and we should strike them down before they spread. Follow me, Galhads!", _local15);
_local17 = new Array();
_local17.push(_local12[0]);
_local17.push(_local12[1]);
_local17.push(_local12[3]);
_local18 = _local17.slice();
_local18.push(_local11);
offsetAllColliders(_local18, (-(k_steedSize) * 2), 0, 0.09);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local7.setMovementDirection, -1, 0)));
queueDialogue(k_captainName, "Stop! Stop now! You will sacrifice more than your own lives!", _local16);
_local19 = new Vector2((_local15.x - (k_steedSize * 2)), _local15.y);
queueDialogue(k_general2Name, "I do not need you cowards. Run home to your wives, let them protect you.", _local19);
offsetAllColliders(_local17, 0, 0, 0.09);
_local20 = 0;
while (_local20 < _local17.length) {
_local27 = _local17[_local20];
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local27.setMovementDirection, -1, 0)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local27.setMovementSpeed, 0)));
_local20++;
};
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local10.setMovementDirection, -1, 0)));
for each (_local21 in _local12) {
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local21.setMovementDirection, -1, 0)));
};
m_game.queueGameEvent(new EVSound(m_game, "EnemyTalk"));
showFightBetweenGeneral2AndGyenas(_local11);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local11.setCanBeCollidedByColliders)));
m_game.queueGameEvent(new EVMoveCollider(m_game, _local11, new Vector2(-100, -100), true));
m_game.queueGameEvent(new EVSound(m_game, "EnemyTalk"));
queueDialogue(k_general1Name, "Taur!", _local14);
queueDialogue(k_captainName, "The Gyena have him, Fallon. The nest is awake. Lead the men back to Lihr. Set up the defenses.", _local16);
m_game.queueGameEvent(new EVSound(m_game, "EnemyTalk"));
queueDialogue(k_captainName, "I will draw strength from the floestream to battle the Gyena and cover your escape.", _local16);
m_game.queueGameEvent(new EVSound(m_game, "EnemyTalk"));
queueDialogue(k_general1Name, "They'll rip you to shreds! We'll stay and fight with you.", _local14);
m_game.queueGameEvent(new EVSound(m_game, "EnemyTalk"));
queueDialogue(k_captainName, "No! You must warn Lihr, the Gyena will be coming! Go, quickly!", _local16);
_local22 = _local12.slice();
_local22.push(_local10);
offsetAllColliders(_local22, 0, 250, 0.09);
_local23 = new Array();
_local23.push(_local7);
offsetAllColliders(_local23, (400 - _local7.x), (_local4 - _local7.y), 0.09);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, addPlayer)));
m_game.queueGameEvent(new EVKillCollider(m_game, _local7));
m_game.queueGameEvent(new EVInput(m_game, true));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, showHowToPlay)));
m_game.queueGameEvent(new EVDelay(m_game, 7500));
m_game.queueGameEvent(new EVSound(m_game, "EnemyTalk"));
m_game.queueGameEvent(new EVDelay(m_game, 2500));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, setKillCount)));
m_game.queueGameEvent(new EVSound(m_game, "EnemyTalk"));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, startCreatingGyenas)));
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
function showHowToPlay(){
m_game.addChild(new HowToPlayAnimation());
}
function queueEndGameEvents(){
var _local1:Vector2;
var _local2:EVShowResults;
UI_Campaign.completeLevel(this);
if (m_attackingGyena != null){
m_attackingGyena = null;
};
m_game.queueGameEvent(new EVInput(m_game, false));
_local1 = new Vector2(m_player.x, m_player.y);
queueDialogue("Oron", "Lihr does not have the defenses to keep a swarm of this size at bay. I must fall back and give my aid.", _local1);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, createFakeOronForEndSequence)));
m_game.queueGameEvent(new EVDelay(m_game, 1000));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, stopUpdatingGyenas)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, sendAllGyenasSouth)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, playEndMusic)));
m_game.queueGameEvent(new EVDelay(m_game, 3000));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
_local2 = new EVShowResults(m_game, true);
m_game.queueGameEvent(_local2);
}
public function handleUpdate(_arg1:Number){
}
function playEndMusic(){
m_game.stopLoop();
m_game.playSound("Oron_Win");
}
function spawnGameplayGyena(){
var _local1:Collider;
var _local2:Number;
var _local3:Number;
_local1 = createRiderlessSteed(ResourceLoader.k_Gyena);
_local1.setMovementSpeed((0.1 + (Math.random() * 0.04)));
_local1.setCanBeCollidedByColliders();
_local1.setSoundType("Enemy");
m_gameplayGyenas.push(_local1);
_local2 = ((Math.random() * (getStageWidth() + 400)) - 200);
_local3 = -50;
m_radiusMap[_local1] = ((Math.random() * 130) + 80);
m_whichSwarmMap[_local1] = ((Math.random() < 0.5)) ? 0 : 1;
_local1.x = _local2;
_local1.y = _local3;
}
function sendAllGyenasSouth(){
var _local1:int;
var _local2:Collider;
_local1 = 0;
while (_local1 < m_gameplayGyenas.length) {
_local2 = m_gameplayGyenas[_local1];
_local2.setMovementDirection(0, 1);
_local1++;
};
}
override function updateImpl(_arg1:Number){
if (m_gameHasStarted){
if (!(m_gameHasEnded)){
if (m_killQuota.getKillsRemaining() <= 0){
m_game.removeStateListener(m_killQuota);
m_killQuota.dispose();
m_killQuota = null;
m_gameHasEnded = true;
queueEndGameEvents();
return;
};
if (m_attackingGyena == null){
sendGyenaAtPlayer();
};
if (m_gameplayGyenas.length < 14){
m_timeUntilNextGyenaSpawn = (m_timeUntilNextGyenaSpawn - _arg1);
if (m_timeUntilNextGyenaSpawn <= 0){
m_timeUntilNextGyenaSpawn = (200 + (Math.random() * 250));
spawnGameplayGyena();
};
};
};
updateGyenas(_arg1);
};
}
public function handleColliderRemoved(_arg1:Collider){
var _local2:int;
var _local3:Collider;
m_radiusMap[_arg1] = null;
if (_arg1 == m_attackingGyena){
m_attackingGyena = null;
};
_local2 = 0;
while (_local2 < m_gameplayGyenas.length) {
_local3 = m_gameplayGyenas[_local2];
if (_local3 == _arg1){
m_gameplayGyenas.splice(_local2, 1);
return;
};
_local2++;
};
}
function offsetAllColliders(_arg1:Array, _arg2:Number, _arg3:Number, _arg4:Number=0.1){
var _local5:Collider;
var _local6:Boolean;
for each (_local5 in _arg1) {
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local5.setMovementSpeed, _arg4)));
};
for each (_local5 in _arg1) {
_local6 = (_local5 == _arg1[(_arg1.length - 1)]);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local5, new Vector2((_local5.x + _arg2), (_local5.y + _arg3)), _local6));
};
for each (_local5 in _arg1) {
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, _local5.setMovementSpeed, 0)));
};
}
override function getDefaultGameDataImpl():GameInitialData{
var _local1:GameInitialData;
_local1 = new GameInitialData();
_local1.setPlayerData(k_captainName, ResourceLoader.k_Warrior, ResourceLoader.k_Gryphon, ResourceLoader.k_DoubleAxe);
return (_local1);
}
function startCreatingGyenas(){
m_game.playLoop("Oron_Play");
m_gameHasStarted = true;
spawnGameplayGyena();
spawnGameplayGyena();
spawnGameplayGyena();
spawnGameplayGyena();
spawnGameplayGyena();
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function updateGyenas(_arg1:Number){
var _local2:int;
var _local3:Vector2;
var _local4:Collider;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Vector2;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
if (m_stopUpdatingGyenas){
return;
};
if (m_attackingGyena != null){
if (!(m_player.isDead())){
_local3 = new Vector2((m_player.x - m_attackingGyena.x), (m_player.y - m_attackingGyena.y));
m_attackingGyena.setMovementDirection(_local3.x, _local3.y);
};
};
_local2 = 0;
while (_local2 < m_gameplayGyenas.length) {
_local4 = m_gameplayGyenas[_local2];
if (_local4 == m_attackingGyena){
} else {
_local5 = m_whichSwarmMap[_local4];
_local6 = ((_local5 == 0)) ? m_swarmRotationCenterX1 : m_swarmRotationCenterX2;
_local7 = ((_local5 == 0)) ? m_swarmRotationCenterY1 : m_swarmRotationCenterY2;
_local8 = new Vector2((_local6 - _local4.x), (_local7 - _local4.y));
_local9 = m_radiusMap[_local4];
_local10 = _local8.length();
if (Math.abs((_local10 - _local9)) < 5){
_local11 = _local8.getAngle();
_local12 = ((_local5 == 0)) ? -90 : 90;
_local8.setAngle((_local11 + _local12));
} else {
if (_local10 < _local9){
_local8.x = (_local8.x * -1);
_local8.y = (_local8.y * -1);
};
};
if (_local8.lengthSquared() > 0.1){
_local4.setMovementDirection(_local8.x, _local8.y);
};
};
_local2++;
};
}
override function isEquipScreenDisabled():Boolean{
return (false);
}
override function cleanupImpl(){
}
function makeSteedSafeFromShooting(_arg1:Collider){
_arg1.setCanBeCollidedByColliders(false);
}
}
}//package
Section 123
//EVCallback (EVCallback)
package {
import com.gamedozer.GameEvent.*;
public class EVCallback implements GameEventInterface {
var m_game:UI_Game;
var m_callback:Function;
public function EVCallback(_arg1:UI_Game, _arg2:Function){
m_game = _arg1;
m_callback = _arg2;
}
public function dispose(){
m_game = null;
}
public function fire(){
m_callback.call();
m_game.getGameEventQueue().signalEventComplete();
dispose();
}
}
}//package
Section 124
//EVDelay (EVDelay)
package {
import com.gamedozer.GameEvent.*;
public class EVDelay implements GameEventInterface, IStateListener {
var m_game:UI_Game;
var m_isReadyForUpdate:Boolean;
var m_delay:int;
public function EVDelay(_arg1:UI_Game, _arg2:int){
m_isReadyForUpdate = false;
m_game = _arg1;
m_delay = _arg2;
m_game.addStateListener(this);
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
function finish(){
m_game.getGameEventQueue().signalEventComplete();
dispose();
}
public function handleUpdate(_arg1:Number){
if (!(m_isReadyForUpdate)){
return;
};
m_delay = (m_delay - _arg1);
if (m_delay <= 0){
finish();
return;
};
}
public function handleColliderRemoved(_arg1:Collider){
}
public function dispose(){
m_game.removeStateListener(this);
m_game = null;
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
public function fire(){
m_isReadyForUpdate = true;
}
}
}//package
Section 125
//EVDialogue (EVDialogue)
package {
import com.gamedozer.math.*;
import com.gamedozer.GameEvent.*;
public class EVDialogue implements GameEventInterface {
var m_game:UI_Game;
var m_hairColor:uint;
var m_flipImage:Boolean;
var m_dialogue:String;
var m_avatar:String;
var m_fabricColor:uint;
var m_speaker:String;
var m_speechBubbleLocation:Vector2;
var m_dialogueDisplay:GDialogue;
public function EVDialogue(_arg1:UI_Game, _arg2:String, _arg3:uint, _arg4:uint, _arg5:String, _arg6:String, _arg7:Boolean=false, _arg8:Vector2=null){
m_game = _arg1;
m_speaker = _arg5;
m_fabricColor = _arg3;
m_hairColor = _arg4;
m_avatar = _arg2;
m_dialogue = _arg6;
m_flipImage = _arg7;
m_speechBubbleLocation = _arg8;
}
function completeDialogue(){
m_game.hideSpeechBubble();
m_game.getGameEventQueue().signalEventComplete();
dispose();
}
public function dispose(){
m_game.getUIContainer().removeChild(m_dialogueDisplay);
m_game = null;
m_speechBubbleLocation = null;
m_dialogueDisplay = null;
}
function createDialogueDisplay(){
m_dialogueDisplay = new GDialogue(this);
m_game.getUIContainer().addChild(m_dialogueDisplay);
m_dialogueDisplay.x = 0;
m_dialogueDisplay.y = 600;
m_dialogueDisplay.setName(m_speaker);
m_dialogueDisplay.setDialogue(m_dialogue);
m_dialogueDisplay.setAvatar(m_avatar, m_fabricColor, m_hairColor, m_flipImage);
}
public function fire(){
if (m_speechBubbleLocation != null){
m_game.showSpeechBubble(m_speechBubbleLocation.x, m_speechBubbleLocation.y);
} else {
m_game.hideSpeechBubble();
};
createDialogueDisplay();
}
}
}//package
Section 126
//EVFadeDisplayObject (EVFadeDisplayObject)
package {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import com.gamedozer.GameEvent.*;
public class EVFadeDisplayObject implements GameEventInterface {
var m_game:UI_Game;
var k_fadeOutTime:Number;// = 500
var m_displayObject:DisplayObject;
var m_timer:Timer;
var m_displayTime:Number;
public function EVFadeDisplayObject(_arg1:UI_Game, _arg2:DisplayObject, _arg3:Number){
k_fadeOutTime = 500;
super();
m_game = _arg1;
_arg2.visible = false;
m_displayObject = _arg2;
m_displayTime = _arg3;
if (_arg2.parent == null){
m_game.getContainer().addChild(_arg2);
};
}
public function fire(){
m_displayObject.visible = true;
m_timer = new Timer(50);
m_timer.addEventListener(TimerEvent.TIMER, update);
m_timer.start();
}
public function update(_arg1:Event){
var _local2:Number;
m_displayTime = (m_displayTime - 50);
if (m_displayTime <= -(k_fadeOutTime)){
complete();
return;
};
if (m_displayTime >= 0){
return;
};
_local2 = (1 - Math.abs((m_displayTime / k_fadeOutTime)));
m_displayObject.alpha = _local2;
}
function complete(){
m_game.getGameEventQueue().signalEventComplete();
dispose();
}
public function dispose(){
m_timer.stop();
m_timer = null;
m_displayObject.parent.removeChild(m_displayObject);
m_game = null;
m_displayObject = null;
}
}
}//package
Section 127
//EVInput (EVInput)
package {
import com.gamedozer.GameEvent.*;
public class EVInput implements GameEventInterface {
var m_game:UI_Game;
var m_action:Boolean;
public function EVInput(_arg1:UI_Game, _arg2:Boolean){
m_game = _arg1;
m_action = _arg2;
}
public function fire(){
if (m_action){
m_game.enableInput();
} else {
m_game.disableInput();
};
m_game.getGameEventQueue().signalEventComplete();
dispose();
}
public function dispose(){
m_game = null;
}
}
}//package
Section 128
//EVKillCollider (EVKillCollider)
package {
import com.gamedozer.GameEvent.*;
public class EVKillCollider implements GameEventInterface, IStateListener {
var m_game:UI_Game;
var m_collider:Collider;
public function EVKillCollider(_arg1:UI_Game, _arg2:Collider){
m_game = _arg1;
m_collider = _arg2;
m_game.addStateListener(this);
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
public function handleColliderRemoved(_arg1:Collider){
if (_arg1 == m_collider){
m_collider = null;
};
}
public function handleUpdate(_arg1:Number){
}
public function dispose(){
m_game.removeStateListener(this);
m_game = null;
m_collider = null;
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
public function fire(){
if (m_collider != null){
m_collider.nominateForDeletion();
};
complete();
dispose();
}
function complete(){
m_game.getGameEventQueue().signalEventComplete();
}
}
}//package
Section 129
//EVMoveCollider (EVMoveCollider)
package {
import com.gamedozer.math.*;
import com.gamedozer.GameEvent.*;
public class EVMoveCollider implements GameEventInterface, IStateListener {
var m_game:UI_Game;
var m_collider:Collider;
var m_hasFired:Boolean;// = false
var m_stallOtherEvents:Boolean;
var m_disposed:Boolean;// = false
var m_destination:Vector2;
public function EVMoveCollider(_arg1:UI_Game, _arg2:Collider, _arg3:Vector2, _arg4:Boolean){
m_disposed = false;
m_hasFired = false;
super();
m_game = _arg1;
m_destination = _arg3;
m_collider = _arg2;
m_stallOtherEvents = _arg4;
m_game.addStateListener(this);
}
public function fire(){
m_hasFired = true;
if (!(m_stallOtherEvents)){
complete();
};
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
public function handleColliderRemoved(_arg1:Collider){
if (_arg1 == m_collider){
m_collider = null;
};
}
function finish(){
if (m_stallOtherEvents){
complete();
};
dispose();
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
public function handleUpdate(_arg1:Number){
var _local2:Vector2;
if (!(m_hasFired)){
return;
};
if (m_collider == null){
finish();
return;
};
_local2 = new Vector2((m_destination.x - m_collider.x), (m_destination.y - m_collider.y));
m_collider.setMovementDirection(_local2.x, _local2.y);
if (_local2.length() <= 5){
m_collider.setMovementDirection(0, 0);
finish();
};
}
public function dispose(){
if (m_disposed){
return;
};
m_disposed = true;
m_game.removeStateListener(this);
m_game = null;
m_destination = null;
m_collider = null;
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function complete(){
if (!(m_disposed)){
m_game.getGameEventQueue().signalEventComplete();
};
}
}
}//package
Section 130
//EVPauseGame (EVPauseGame)
package {
import com.gamedozer.GameEvent.*;
public class EVPauseGame implements GameEventInterface {
var m_game:UI_Game;
var m_action:Boolean;
public function EVPauseGame(_arg1:UI_Game, _arg2:Boolean){
m_game = _arg1;
m_action = _arg2;
}
public function fire(){
if (m_action){
m_game.pause();
} else {
m_game.unpause();
};
m_game.getGameEventQueue().signalEventComplete();
dispose();
}
public function dispose(){
m_game = null;
}
}
}//package
Section 131
//EVSeekTarget (EVSeekTarget)
package {
import flash.utils.*;
import flash.events.*;
import com.gamedozer.math.*;
import com.gamedozer.GameEvent.*;
public class EVSeekTarget implements GameEventInterface, IStateListener {
var m_timer:Timer;
var m_game:UI_Game;
var m_collider:Collider;
var m_stallOtherEvents:Boolean;
var m_target:IMovingEntity;
public function EVSeekTarget(_arg1:UI_Game, _arg2:Collider, _arg3:IMovingEntity, _arg4:Boolean){
m_game = _arg1;
m_target = _arg3;
m_collider = _arg2;
m_stallOtherEvents = _arg4;
m_game.addStateListener(this);
}
public function fire(){
m_timer = new Timer(50);
m_timer.addEventListener(TimerEvent.TIMER, update);
m_timer.start();
if (!(m_stallOtherEvents)){
complete();
};
}
function update(_arg1:Event){
var _local2:Vector2;
if ((((m_collider == null)) || ((m_target == null)))){
finish();
return;
};
_local2 = new Vector2((m_target.x - m_collider.x), (m_target.y - m_collider.y));
m_collider.setMovementDirection(_local2.x, _local2.y);
if (_local2.length() <= 3){
finish();
};
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
public function handleUpdate(_arg1:Number){
}
function finish(){
if (m_collider != null){
m_collider.setMovementDirection(0, 0);
};
if (m_stallOtherEvents){
complete();
};
dispose();
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
public function handleColliderRemoved(_arg1:Collider){
if (_arg1 == m_collider){
m_collider = null;
};
if (_arg1 == m_target){
m_target = null;
};
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function dispose(){
m_game.removeStateListener(this);
turnOffTimer();
m_game = null;
m_target = null;
m_collider = null;
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function complete(){
m_game.getGameEventQueue().signalEventComplete();
}
function turnOffTimer(){
m_timer.stop();
m_timer.removeEventListener(TimerEvent.TIMER, update);
m_timer = null;
}
}
}//package
Section 132
//EVShowResults (EVShowResults)
package {
import com.gamedozer.GameEvent.*;
public class EVShowResults implements GameEventInterface {
var m_victory:Boolean;
var m_game:UI_Game;
public function EVShowResults(_arg1:UI_Game, _arg2:Boolean){
m_game = _arg1;
m_victory = _arg2;
}
public function dispose(){
m_game = null;
}
public function fire(){
m_game.showResultsScreen();
dispose();
}
}
}//package
Section 133
//EVSound (EVSound)
package {
import com.gamedozer.GameEvent.*;
public class EVSound implements GameEventInterface {
var m_game:UI_Game;
var m_sound:String;
public function EVSound(_arg1:UI_Game, _arg2:String){
m_game = _arg1;
m_sound = _arg2;
}
public function fire(){
m_game.playSound(m_sound);
m_game.getGameEventQueue().signalEventComplete();
dispose();
}
public function dispose(){
m_game = null;
}
}
}//package
Section 134
//EVTurnCollider (EVTurnCollider)
package {
import com.gamedozer.math.*;
import com.gamedozer.GameEvent.*;
public class EVTurnCollider implements GameEventInterface, IStateListener {
var m_desiredFacing:Vector2;
var m_collider:Collider;
var m_game:UI_Game;
var m_timeLeft:Number;
var m_stallOtherEvents:Boolean;
var m_startingFacing:Vector2;
var m_turnTime:Number;
public function EVTurnCollider(_arg1:UI_Game, _arg2:Collider, _arg3:Vector2, _arg4:Number, _arg5:Boolean){
m_game = _arg1;
m_collider = _arg2;
m_stallOtherEvents = _arg5;
m_desiredFacing = _arg3;
m_turnTime = _arg4;
m_timeLeft = 0;
m_game.addStateListener(this);
}
public function fire(){
m_timeLeft = m_turnTime;
m_startingFacing = m_collider.getFacingDirection().clone();
if (!(m_stallOtherEvents)){
complete();
};
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
public function handleUpdate(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Vector2;
if (m_timeLeft <= 0){
return;
};
if (m_collider == null){
finish();
return;
};
m_timeLeft = (m_timeLeft - _arg1);
if (m_timeLeft <= 0){
m_collider.setFacingDirection(m_desiredFacing.x, m_desiredFacing.y);
finish();
trace("---------------- FINISH -------------------- ");
return;
};
_local2 = (1 - (m_timeLeft / m_turnTime));
_local3 = (m_desiredFacing.x - m_startingFacing.x);
_local4 = (m_desiredFacing.y - m_startingFacing.y);
_local5 = new Vector2((m_startingFacing.x + (_local3 * _local2)), (m_startingFacing.y + (_local4 * _local2)));
m_collider.setFacingDirection(_local5.x, _local5.y);
}
function finish(){
if (m_stallOtherEvents){
complete();
};
dispose();
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
public function handleColliderRemoved(_arg1:Collider){
if (_arg1 == m_collider){
m_collider = null;
};
}
public function dispose(){
m_game.removeStateListener(this);
m_game = null;
m_collider = null;
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function complete(){
m_game.getGameEventQueue().signalEventComplete();
}
}
}//package
Section 135
//Explosion (Explosion)
package {
import flash.display.*;
public dynamic class Explosion extends MovieClip {
public function Explosion(){
addFrameScript(22, frame23);
}
function frame23(){
parent.removeChild(this);
stop();
}
}
}//package
Section 136
//GameInitialData (GameInitialData)
package {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import com.gamedozer.utils.*;
public class GameInitialData {
var m_index:int;// = 0
var m_playerData:Dictionary;
public function GameInitialData(){
m_playerData = new Dictionary(false);
m_index = 0;
super();
}
function getCharacter(_arg1:int){
return (m_playerData[_arg1].character);
}
function getName(_arg1:int){
return (m_playerData[_arg1].name);
}
function setPlayerData(_arg1:String, _arg2:String, _arg3:String, _arg4:String){
var _local5:PlayerData;
_local5 = new PlayerData();
_local5.name = _arg1;
_local5.index = m_index;
_local5.character = _arg2;
_local5.steed = _arg3;
_local5.weapon = _arg4;
m_playerData[m_index] = _local5;
m_index++;
}
function getWeapon(_arg1:int){
return (m_playerData[_arg1].weapon);
}
function getSteed(_arg1:int){
return (m_playerData[_arg1].steed);
}
function getPlayerCount():int{
return (m_index);
}
}
}//package
class PlayerData {
var steed:String;
var character:String;
var name:String;
var index:int;
var weapon:String;
function PlayerData(){
}
}
Section 137
//GameTimerMC (GameTimerMC)
package {
import flash.text.*;
import flash.display.*;
public dynamic class GameTimerMC extends MovieClip {
public var timeLeft_txt:TextField;
}
}//package
Section 138
//GDialogue (GDialogue)
package {
import flash.events.*;
import flash.display.*;
import com.gamedozer.graphics.*;
import flash.utils.*;
import flash.geom.*;
import flash.text.*;
public class GDialogue extends MovieClip {
var m_dialogueManager:EVDialogue;
var m_timer:Timer;
public var clickHint:MovieClip;
public var dialogue_txt:TextField;
public var name_txt:TextField;
public var bg_mc:MovieClip;
public function GDialogue(_arg1:EVDialogue){
m_dialogueManager = _arg1;
addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
clickHint.visible = false;
}
function setName(_arg1:String){
name_txt.text = (_arg1 + ":");
}
function setBackgroundColor(_arg1:uint){
var _local2:ColorTransform;
_local2 = new ColorTransform();
_local2.color = _arg1;
_local2.alphaMultiplier = 0.75;
this.bg_mc.transform.colorTransform = _local2;
}
function setAvatar(_arg1:String, _arg2:uint, _arg3:uint, _arg4:Boolean){
var _local5:String;
var _local6:String;
var _local7:String;
var _local8:BitmapData;
var _local9:BitmapData;
var _local10:BitmapData;
var _local11:ColoredSprite;
var _local12:BitmapData;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
m_timer = new Timer(5000);
m_timer.addEventListener(TimerEvent.TIMER, showClickHint);
m_timer.start();
setBackgroundColor(_arg2);
_local5 = (_arg1 + "Avatar_Base");
_local6 = (_arg1 + "Avatar_Mask_Fabric");
_local7 = (_arg1 + "Avatar_Mask_Hair");
_local8 = ResourceLoader.getBitmapData(_local5);
_local9 = ResourceLoader.getBitmapData(_local6);
_local10 = ResourceLoader.getBitmapData(_local7);
_local11 = new ColoredSprite(_local8, _local9, _arg2);
_local12 = _local11.getBitmapData();
_local11.x = 0;
_local11.y = -(_local11.height);
_local13 = 1;
_local14 = (((_arg3 & 0xFF0000) >> 16) / 0xFF);
_local15 = (((_arg3 & 0xFF00) >> 8) / 0xFF);
_local16 = ((_arg3 & 0xFF) / 0xFF);
_local12.draw(_local10, null, new ColorTransform(_local14, _local15, _local16, _local13, 0, 0, 0, 0), "overlay");
if (_arg4){
name_txt.x = 15;
dialogue_txt.x = 15;
clickHint.x = 460;
_local11.x = this.width;
_local11.scaleX = -1;
};
this.addChild(_local11);
}
function setDialogue(_arg1:String){
dialogue_txt.htmlText = _arg1;
}
function handleMouseDown(_arg1:Event){
if (m_timer != null){
m_timer.removeEventListener(TimerEvent.TIMER, showClickHint);
m_timer = null;
};
removeEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
m_dialogueManager.completeDialogue();
}
function showClickHint(_arg1:Event){
clickHint.visible = true;
clickHint.gotoAndPlay(2);
m_timer.removeEventListener(TimerEvent.TIMER, showClickHint);
m_timer = null;
}
}
}//package
Section 139
//GEffect (GEffect)
package {
import com.gamedozer.utils.*;
import flash.utils.*;
import flash.events.*;
import com.gamedozer.graphics.*;
import flash.display.*;
public class GEffect extends Sprite {
var m_animation:TileSheetAnimation;
var m_type:String;
var m_timer:Timer;
public function GEffect(_arg1:String, _arg2:String){
m_type = _arg1;
m_timer = null;
load(_arg2);
}
function onComplete(){
m_timer.stop();
m_timer = null;
m_animation.dispose();
this.parent.removeChild(this);
}
function update(_arg1:Event){
m_animation.update(100);
}
function load(_arg1:String){
m_animation = ResourceLoader.createTileSheetAnimation(_arg1, ResourceLoader.getBitmapData(m_type));
m_animation.playAnimation("default");
m_animation.onComplete(Delegate.create(this, onComplete));
addChild(m_animation);
if (m_timer == null){
m_timer = new Timer(100);
m_timer.addEventListener(TimerEvent.TIMER, update);
m_timer.start();
};
}
}
}//package
Section 140
//GObstacle (GObstacle)
package {
import com.gamedozer.graphics.*;
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.gamedozer.math.*;
class GObstacle extends Sprite {
var m_turret:GWeapon;// = null
var m_color:uint;
var m_colored:Boolean;
var m_animations:Array;
var m_type:String;
var m_timer:Timer;// = null
function GObstacle(_arg1:uint, _arg2:String, _arg3:Boolean=false){
m_turret = null;
m_timer = null;
super();
m_type = _arg2;
m_colored = _arg3;
m_color = _arg1;
m_animations = new Array();
load();
}
public function setRotation(_arg1:int){
this.rotation = _arg1;
}
function changeType(_arg1:String){
m_type = _arg1;
load();
}
public function dispose(){
parent.removeChild(this);
}
public function updateTurret(_arg1:Vector2, _arg2:int){
if (m_turret == null){
trace("GObstacle.updateTurret. No turret to update.");
};
m_turret.x = _arg1.x;
m_turret.y = _arg1.y;
m_turret.rotation = _arg2;
}
function setColor(_arg1:uint){
m_color = _arg1;
if (m_turret != null){
m_turret.setColor(_arg1);
};
load();
}
function showTurret(){
m_turret.visible = true;
}
function changeAnimation(_arg1:String){
m_animations[0].playAnimation(_arg1);
}
function update(_arg1:Event){
var _local2:int;
var _local3:TileSheetAnimation;
_local2 = 0;
while (_local2 < m_animations.length) {
_local3 = m_animations[_local2];
_local3.update(100);
_local2++;
};
}
function getAnimation():TileSheetAnimation{
return (m_animations[0]);
}
function hideTurret(){
m_turret.visible = false;
}
function attachAnimation(_arg1:String, _arg2:String){
var _local3:BitmapData;
var _local4:TileSheetAnimation;
var _local5:ColoredSprite;
if (!(m_colored)){
_local3 = ResourceLoader.getBitmapData(_arg1);
} else {
_local5 = new ColoredSprite(ResourceLoader.getBitmapData((_arg1 + "_Base")), ResourceLoader.getBitmapData((_arg1 + "_Mask")), m_color);
_local3 = _local5.getBitmapData();
};
_local4 = ResourceLoader.createTileSheetAnimation(_arg2, _local3);
_local4.playAnimation("default");
addChild(_local4);
m_animations.push(_local4);
}
function addChildTurret(_arg1:String){
m_turret = new GWeapon(0xFFFFFF, _arg1);
m_turret.disableRotations();
addChild(m_turret);
}
function load(){
var _local1:String;
var _local2:int;
var _local3:TileSheetAnimation;
if (m_animations.length != 0){
_local2 = 0;
while (_local2 < m_animations.length) {
_local3 = m_animations[_local2];
_local3.dispose();
removeChild(_local3);
_local2++;
};
m_animations.splice(0);
};
if ((((m_type == "Building_House_02")) || ((m_type == "Building_House_02_Destroyed")))){
_local1 = "small_house";
} else {
if (m_type == "Treasure"){
_local1 = "treasure";
} else {
if (m_type == "Building_Townhall"){
_local1 = "townhall";
} else {
if (m_type == "ManualTurret"){
_local1 = "turret";
} else {
if (m_type == "Obelisk"){
_local1 = "obelisk";
} else {
if (m_type == "MoveableTurret"){
_local1 = "rohk";
} else {
_local1 = "big_house";
};
};
};
};
};
};
attachAnimation(m_type, _local1);
if (m_timer == null){
m_timer = new Timer(100);
m_timer.addEventListener(TimerEvent.TIMER, update);
m_timer.start();
};
}
}
}//package
Section 141
//GRider (GRider)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import com.gamedozer.graphics.*;
public class GRider extends Sprite {
var m_color:uint;
var m_animation:TileSheetAnimation;// = null
var m_type:String;// = ""
var m_timer:Timer;
public function GRider(_arg1:uint){
m_type = "";
m_animation = null;
super();
m_color = _arg1;
}
public function setRotation(_arg1:int){
var _local2:int;
var _local3:String;
var _local4:int;
while (_arg1 >= 360) {
_arg1 = (_arg1 - 360);
};
while (_arg1 < 0) {
_arg1 = (_arg1 + 360);
};
_local2 = 1;
_local4 = 0;
if ((((_arg1 < 337)) && ((_arg1 >= 202)))){
_local2 = -1;
if ((((_arg1 < 337)) && ((_arg1 >= 292)))){
_local3 = "ne";
_local4 = (_arg1 - 315);
} else {
if ((((_arg1 < 292)) && ((_arg1 >= 247)))){
_local3 = "e";
_local4 = (_arg1 - 270);
} else {
_local3 = "se";
_local4 = (_arg1 - 225);
};
};
} else {
if ((((_arg1 >= 337)) || ((_arg1 <= 23)))){
_local3 = "n";
_local4 = _arg1;
} else {
if ((((_arg1 > 23)) && ((_arg1 <= 68)))){
_local3 = "ne";
_local4 = (_arg1 - 45);
} else {
if ((((_arg1 > 68)) && ((_arg1 <= 113)))){
_local3 = "e";
_local4 = (_arg1 - 90);
} else {
if ((((_arg1 > 113)) && ((_arg1 <= 158)))){
_local3 = "se";
_local4 = (_arg1 - 135);
} else {
_local3 = "s";
_local4 = (_arg1 - 180);
};
};
};
};
};
this.m_animation.playAnimation(_local3);
this.m_animation.scaleX = _local2;
}
public function dispose(){
disableTimer();
m_animation.dispose();
}
public function disableTimer(){
if (m_timer != null){
m_timer.stop();
m_timer.removeEventListener(TimerEvent.TIMER, update);
m_timer = null;
};
}
public function reset(){
if (m_animation != null){
m_animation.gotoFrame(0);
};
}
public function getType():String{
return (m_type);
}
function update(_arg1:Event){
m_animation.update(100);
}
public function load(_arg1:String){
var _local2:BitmapData;
var _local3:BitmapData;
var _local4:BitmapData;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
m_type = _arg1;
_local2 = ResourceLoader.getBitmapData((m_type + "_Base"));
_local3 = ResourceLoader.getBitmapData((m_type + "_Mask"));
_local4 = new BitmapData(_local2.width, _local2.height, _local2.transparent);
_local4.copyPixels(_local2, _local2.rect, new Point(0, 0));
_local5 = 1;
_local6 = (((m_color & 0xFF0000) >> 16) / 0xFF);
_local7 = (((m_color & 0xFF00) >> 8) / 0xFF);
_local8 = ((m_color & 0xFF) / 0xFF);
_local4.draw(_local3, null, new ColorTransform(_local6, _local7, _local8, _local5, 0, 0, 0, 0), "overlay");
m_animation = ResourceLoader.createTileSheetAnimation("character", _local4);
m_animation.playAnimation("n");
addChild(m_animation);
m_timer = new Timer(100);
m_timer.addEventListener(TimerEvent.TIMER, update);
m_timer.start();
}
}
}//package
Section 142
//GSplatter (GSplatter)
package {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.events.*;
import com.gamedozer.graphics.*;
public class GSplatter extends Sprite {
const k_timerStep:int = 40;
var m_rotationTimer:int;
var m_color:uint;
var m_splatter:TileSheetAnimation;
var m_radiusPercentage:Number;
var m_timer:Timer;
public function GSplatter(_arg1:uint){
m_color = _arg1;
load();
}
function setRadiusPercentage(_arg1:Number){
m_radiusPercentage = _arg1;
}
function update(_arg1:Event){
var _local2:Number;
if (this.visible == false){
return;
};
m_splatter.update(k_timerStep);
_local2 = (m_radiusPercentage * m_radiusPercentage);
m_splatter.scaleX = (0.6 + (_local2 * 2));
m_splatter.scaleY = (0.6 + (_local2 * 2));
m_splatter.alpha = ((m_radiusPercentage < 0.01)) ? 1 : (0.5 * (1 - _local2));
}
function load(){
var _local1:String;
var _local2:BitmapData;
var _local3:BitmapData;
var _local4:BitmapData;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = "Splatter";
_local2 = ResourceLoader.getBitmapData((_local1 + "_Base"));
_local3 = ResourceLoader.getBitmapData((_local1 + "_Mask"));
_local4 = new BitmapData(_local2.width, _local2.height, _local2.transparent);
_local4.copyPixels(_local2, _local2.rect, new Point(0, 0));
_local5 = 1;
_local6 = (((m_color & 0xFF0000) >> 16) / 0xFF);
_local7 = (((m_color & 0xFF00) >> 8) / 0xFF);
_local8 = ((m_color & 0xFF) / 0xFF);
_local4.draw(_local3, null, new ColorTransform(_local6, _local7, _local8, _local5, 0, 0, 0, 0), "overlay");
m_splatter = ResourceLoader.createTileSheetAnimation("splatter", _local4);
m_splatter.playAnimation("default");
addChild(m_splatter);
m_timer = new Timer(k_timerStep);
m_timer.addEventListener(TimerEvent.TIMER, update);
m_timer.start();
m_rotationTimer = 0;
update(null);
}
function show(){
this.visible = true;
}
}
}//package
Section 143
//GSteed (GSteed)
package {
import flash.filters.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import com.gamedozer.graphics.*;
public class GSteed extends Sprite implements IManualRotate {
var m_timer:Timer;// = null
var m_rider:GRider;// = null
var m_topAnimation:TileSheetAnimation;// = null
var m_riderContainer:Sprite;
var m_largeSteed:Boolean;
var m_bottomAnimation:TileSheetAnimation;// = null
var m_type:String;// = ""
public function GSteed(_arg1:Boolean=true){
var _local2:Boolean;
var _local3:DropShadowFilter;
var _local4:Array;
m_bottomAnimation = null;
m_riderContainer = new Sprite();
m_topAnimation = null;
m_rider = null;
m_type = "";
m_timer = null;
super();
m_largeSteed = false;
_local2 = BMStorage.getSingleton().getBoolean(UI_Options.k_effectsAreDisabled, false);
if (((!(_local2)) && (_arg1))){
_local3 = new DropShadowFilter(16, 90, 0, 1, 4, 4, 0.3);
_local4 = new Array();
_local4.push(_local3);
this.filters = _local4;
};
}
public function setRotation(_arg1:int){
var _local2:int;
var _local3:String;
var _local4:int;
while (_arg1 >= 360) {
_arg1 = (_arg1 - 360);
};
while (_arg1 < 0) {
_arg1 = (_arg1 + 360);
};
_local2 = 1;
_local4 = 0;
if ((((_arg1 < 337)) && ((_arg1 >= 202)))){
_local2 = -1;
if ((((_arg1 < 337)) && ((_arg1 >= 292)))){
_local3 = "ne";
_local4 = (_arg1 - 315);
} else {
if ((((_arg1 < 292)) && ((_arg1 >= 247)))){
_local3 = "e";
_local4 = (_arg1 - 270);
} else {
_local3 = "se";
_local4 = (_arg1 - 225);
};
};
} else {
if ((((_arg1 >= 337)) || ((_arg1 <= 23)))){
_local3 = "n";
_local4 = _arg1;
} else {
if ((((_arg1 > 23)) && ((_arg1 <= 68)))){
_local3 = "ne";
_local4 = (_arg1 - 45);
} else {
if ((((_arg1 > 68)) && ((_arg1 <= 113)))){
_local3 = "e";
_local4 = (_arg1 - 90);
} else {
if ((((_arg1 > 113)) && ((_arg1 <= 158)))){
_local3 = "se";
_local4 = (_arg1 - 135);
} else {
_local3 = "s";
_local4 = (_arg1 - 180);
};
};
};
};
};
this.m_bottomAnimation.scaleX = _local2;
this.m_bottomAnimation.playAnimation(_local3);
this.m_topAnimation.scaleX = _local2;
this.m_topAnimation.playAnimation(_local3);
if (m_rider != null){
m_rider.setRotation(_arg1);
};
}
public function dispose(){
disableTimer();
m_bottomAnimation.dispose();
m_bottomAnimation = null;
m_topAnimation.dispose();
m_topAnimation = null;
if (m_rider != null){
m_rider.dispose();
m_rider = null;
};
parent.removeChild(this);
}
public function disableTimer(){
if (m_timer != null){
m_timer.stop();
m_timer.removeEventListener(TimerEvent.TIMER, update);
m_timer = null;
};
}
public function insertRider(_arg1:GRider){
if (m_rider != null){
m_riderContainer.removeChild(m_rider);
m_rider.dispose();
};
m_rider = _arg1;
if (m_rider != null){
m_riderContainer.addChild(m_rider);
};
reset();
}
public function reset(){
m_bottomAnimation.gotoFrame(0);
m_topAnimation.gotoFrame(0);
if (m_rider != null){
m_rider.reset();
};
}
public function die(){
var _local1:GEffect;
_local1 = new GEffect("Magical_explosion", "magical_explosion");
_local1.alpha = 0.8;
_local1.x = this.x;
_local1.y = this.y;
this.parent.addChild(_local1);
}
public function getType():String{
return (m_type);
}
function update(_arg1:Event){
m_bottomAnimation.update(100);
m_topAnimation.update(100);
}
public function getRider():GRider{
return (m_rider);
}
public function load(_arg1:String){
var _local2:String;
if (_arg1 == "Behelmut"){
m_largeSteed = true;
} else {
m_largeSteed = false;
};
if (m_bottomAnimation != null){
removeChild(m_bottomAnimation);
m_bottomAnimation.dispose();
};
if (m_topAnimation != null){
removeChild(m_topAnimation);
m_topAnimation.dispose();
};
m_type = _arg1;
_local2 = "steed";
if (m_largeSteed){
_local2 = "largeSteed";
};
m_bottomAnimation = ResourceLoader.createTileSheetAnimation(_local2, ResourceLoader.getBitmapData((_arg1 + "_Bottom")));
m_bottomAnimation.playAnimation("n");
addChild(m_bottomAnimation);
addChild(m_riderContainer);
m_topAnimation = ResourceLoader.createTileSheetAnimation(_local2, ResourceLoader.getBitmapData((_arg1 + "_Top")));
m_topAnimation.playAnimation("n");
addChild(m_topAnimation);
if (m_timer == null){
m_timer = new Timer(100);
m_timer.addEventListener(TimerEvent.TIMER, update);
m_timer.start();
};
}
}
}//package
Section 144
//GWeapon (GWeapon)
package {
import flash.filters.*;
import flash.utils.*;
import flash.events.*;
import flash.display.*;
import com.gamedozer.graphics.*;
public class GWeapon extends Sprite implements IManualRotate {
var m_timer:Timer;
var m_color:uint;
var m_scaleDirection:Boolean;
var m_coloredSprite:ColoredSprite;// = null
var m_type:String;
var m_spin:Boolean;
public function GWeapon(_arg1:uint, _arg2:String, _arg3:Boolean=false){
var _local4:Boolean;
var _local5:DropShadowFilter;
var _local6:Array;
m_coloredSprite = null;
super();
m_color = _arg1;
m_type = _arg2;
m_spin = false;
if ((((((((((m_type == ResourceLoader.k_DoubleAxe)) || ((m_type == ResourceLoader.k_Chakram)))) || ((m_type == ResourceLoader.k_Hammer)))) || ((m_type == ResourceLoader.k_Disc)))) || ((m_type == ResourceLoader.k_Scimitar)))){
m_spin = true;
m_timer = new Timer(50);
m_timer.addEventListener(TimerEvent.TIMER, rotate);
m_timer.start();
};
_local4 = BMStorage.getSingleton().getBoolean(UI_Options.k_effectsAreDisabled, false);
if (((!(_local4)) && (!(_arg3)))){
_local5 = new DropShadowFilter(16, 90, 0, 1, 4, 4, 0.3);
_local6 = new Array();
_local6.push(_local5);
this.filters = _local6;
};
load();
addChild(m_coloredSprite);
}
public function setRotation(_arg1:int){
this.rotation = _arg1;
}
public function fancyScale(_arg1:Event){
if (m_scaleDirection){
this.scaleX = (this.scaleX - 0.1);
if (this.scaleX <= 0.45){
m_scaleDirection = false;
};
} else {
this.scaleX = (this.scaleX + 0.1);
if (this.scaleX >= 1){
m_scaleDirection = true;
};
};
}
public function dispose(){
parent.removeChild(this);
disableRotations();
m_coloredSprite.dispose();
removeChild(m_coloredSprite);
m_coloredSprite = null;
}
function setColor(_arg1:uint){
removeChild(m_coloredSprite);
m_color = _arg1;
load();
addChild(m_coloredSprite);
}
function rotate(_arg1:Event){
if (m_spin){
this.rotation = (this.rotation + 8);
};
}
public function disableRotations(){
if (!(m_spin)){
return;
};
m_spin = false;
m_timer.removeEventListener(TimerEvent.TIMER, rotate);
m_timer = null;
}
public function change(_arg1:String){
m_type = _arg1;
m_coloredSprite.dispose();
removeChild(m_coloredSprite);
load();
addChild(m_coloredSprite);
}
public function die(){
var _local1:GEffect;
_local1 = new GEffect("Shock", "shock");
_local1.x = this.x;
_local1.y = this.y;
this.parent.addChild(_local1);
}
private function load(){
var _local1:BitmapData;
var _local2:BitmapData;
_local1 = ResourceLoader.getBitmapData((m_type + "_Base"));
_local2 = ResourceLoader.getBitmapData((m_type + "_Mask"));
m_coloredSprite = new ColoredSprite(_local1, _local2, m_color);
m_coloredSprite.x = (-(m_coloredSprite.width) / 2);
m_coloredSprite.y = (-(m_coloredSprite.height) / 2);
}
}
}//package
Section 145
//HowToPlayAnimation (HowToPlayAnimation)
package {
import flash.display.*;
public dynamic class HowToPlayAnimation extends MovieClip {
public function HowToPlayAnimation(){
addFrameScript(386, frame387);
}
function frame387(){
parent.removeChild(this);
stop();
}
}
}//package
Section 146
//HowToPlayPanel (HowToPlayPanel)
package {
import flash.display.*;
public dynamic class HowToPlayPanel extends MovieClip {
}
}//package
Section 147
//IManualRotate (IManualRotate)
package {
import flash.geom.*;
interface IManualRotate {
function setRotation(_arg1:int);
function die();
function dispose();
function get transform():Transform;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function set transform(_arg1:Transform):void;
function get y():Number;
function get x():Number;
}
}//package
Section 148
//IMovingEntity (IMovingEntity)
package {
interface IMovingEntity {
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get x():Number;
function get y():Number;
}
}//package
Section 149
//InputKeyboard (InputKeyboard)
package {
import flash.events.*;
public class InputKeyboard {
protected static var keys:Array;
protected static var dispatcher:EventDispatcher;
public function InputKeyboard(_arg1:EventDispatcher){
setDispatcher(_arg1);
}
private static function keyDownHandler(_arg1:KeyboardEvent):void{
keys[_arg1.keyCode] = true;
}
public static function setDispatcher(_arg1:EventDispatcher){
if (dispatcher == null){
keys = new Array();
} else {
dispatcher.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
dispatcher.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
dispatcher = _arg1;
dispatcher.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
dispatcher.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
public static function isDown(_arg1:uint):Boolean{
return ((keys[_arg1] == true));
}
private static function keyUpHandler(_arg1:KeyboardEvent):void{
keys[_arg1.keyCode] = false;
}
}
}//package
Section 150
//InputStatusDisplayMC (InputStatusDisplayMC)
package {
import flash.display.*;
public dynamic class InputStatusDisplayMC extends MovieClip {
public function InputStatusDisplayMC(){
addFrameScript(59, frame60, 119, frame120);
}
function frame120(){
gotoAndStop(1);
}
function frame60(){
stop();
}
}
}//package
Section 151
//Intersect (Intersect)
package {
import com.gamedozer.math.*;
public class Intersect {
private static function findNormal(_arg1:Vector2, _arg2:Vector2, _arg3:Vector2):Vector2{
var _local4:Vector2;
var _local5:Vector2;
var _local6:*;
var _local7:Vector2;
var _local8:Vector2;
var _local9:Number;
var _local10:Number;
_local4 = new Vector2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
_local5 = _arg3.minus(_arg2);
_local5.normalize();
_local6 = ((_local4.x * _local5.x) + (_local4.y * _local5.y));
if (_local6 < 0){
_local7 = _local4;
} else {
_local8 = new Vector2((_arg1.x - _arg3.x), (_arg1.y - _arg3.y));
_local6 = ((_local8.x * _local5.x) + (_local8.y * _local5.y));
if (_local6 > 0){
_local7 = _local8;
} else {
_local9 = _local5.y;
_local10 = -(_local5.x);
_local6 = ((_local4.x * _local9) + (_local4.y * _local10));
_local7 = new Vector2((_local6 * _local9), (_local6 * _local10));
};
};
return (_local7);
}
public static function testCircleAndLine(_arg1:Number, _arg2:Vector2, _arg3:Vector2, _arg4:Vector2):Boolean{
var _local5:Number;
var _local6:Vector2;
var _local7:Number;
_local5 = 0.001;
_local6 = findNormal(_arg2, _arg3, _arg4);
_local7 = _local6.length();
if (_local7 >= (_arg1 - _local5)){
return (false);
};
return (true);
}
public static function testCircleAndCircle(_arg1:Number, _arg2:Vector2, _arg3:Number, _arg4:Vector2){
var _local5:Vector2;
var _local6:Number;
_local5 = _arg4.minus(_arg2);
_local6 = ((_arg1 + _arg3) - _local5.length());
if (_local6 <= 0){
return (false);
};
return (true);
}
}
}//package
Section 152
//IStateListener (IStateListener)
package {
public interface IStateListener {
function handleUpdate(_arg1:Number);
function handleColliderRemoved(_arg1:Collider);
function handlePlayerFired(_arg1:Player, _arg2:Collider);
function dispose();
function handlePlayerMoved(_arg1:Player, _arg2:Number);
function handlePlayerDied(_arg1:Player, _arg2:Collider);
function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle);
}
}//package
Section 153
//KillsRequiredMC (KillsRequiredMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class KillsRequiredMC extends MovieClip {
public var blood:MovieClip;
public var killsNeeded_txt:TextField;
public function KillsRequiredMC(){
addFrameScript(0, frame1);
}
function frame1(){
}
public function setKillsLeft(_arg1:int){
killsNeeded_txt.text = String(_arg1);
}
}
}//package
Section 154
//Level (Level)
package {
import com.gamedozer.misc.*;
public class Level {
const k_levelWidth:int = 800;
const k_levelHeight:int = 600;
var m_chapter:int;// = 0
var m_game:UI_Game;
var m_part:int;// = 0
var m_order:int;
var m_description:String;// = ""
var m_mode:int;
var m_accruedTime:Number;
var m_levelName:String;
public function Level(_arg1:String, _arg2:int, _arg3:int){
m_part = 0;
m_chapter = 0;
m_description = "";
super();
m_levelName = _arg1;
m_accruedTime = 0;
m_order = _arg3;
m_mode = _arg2;
}
function populateGame(){
populateGameImpl();
}
function updateImpl(_arg1:Number){
}
function getStageMiddleY():int{
return ((k_levelHeight / 2));
}
function createRiderlessSteed(_arg1:String):Collider{
var _local2:GSteed;
var _local3:Collider;
_local2 = new GSteed();
_local2.load(_arg1);
m_game.getContainer().addChild(_local2);
_local3 = new Collider(m_game, null, _local2);
_local3.setRadius(16);
_local3.setLivingTime(-1);
_local3.initialize();
_local3.setMovementSpeed(0.09);
return (_local3);
}
function getName():String{
return (m_levelName);
}
function tempPathOval(_arg1:Path, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
_arg1.moveTo((_arg2 - (_arg4 / 2)), (_arg3 + (_arg5 / 2)));
_arg1.curveTo((_arg2 - (_arg4 / 2)), _arg3, ((_arg2 + (_arg4 / 2)) - (_arg4 / 2)), _arg3);
_arg1.curveTo(((_arg2 + _arg4) - (_arg4 / 2)), _arg3, ((_arg2 + _arg4) - (_arg4 / 2)), (_arg3 + (_arg5 / 2)));
_arg1.curveTo(((_arg2 + _arg4) - (_arg4 / 2)), (_arg3 + _arg5), ((_arg2 + (_arg4 / 2)) - (_arg4 / 2)), (_arg3 + _arg5));
_arg1.curveTo((_arg2 - (_arg4 / 2)), (_arg3 + _arg5), (_arg2 - (_arg4 / 2)), (_arg3 + (_arg5 / 2)));
}
function getStageHeight():int{
return (k_levelHeight);
}
function getChapter():int{
return (m_chapter);
}
function getOrder():int{
return (m_order);
}
function getMode():int{
return (m_mode);
}
function cleanup(){
m_game = null;
cleanupImpl();
}
function getDefaultGameDataImpl():GameInitialData{
trace("Level::getDefaultGameDataImpl. You must override getDefaultGameDataImpl");
return (null);
}
function tempPathBinoculars(_arg1:Path, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
_arg1.moveTo(_arg2, (_arg3 + (_arg5 / 2)));
_arg1.circleTo((_arg2 - (_arg4 / 2)), _arg3, _arg2, (_arg3 - (_arg5 / 2)));
_arg1.circleTo((_arg2 + (_arg4 / 2)), _arg3, _arg2, (_arg3 + (_arg5 / 2)));
}
function createSteedAndRider(_arg1:String, _arg2:String, _arg3:uint):Collider{
var _local4:Collider;
var _local5:GRider;
var _local6:GSteed;
_local4 = createRiderlessSteed(_arg1);
_local5 = new GRider(_arg3);
_local5.load(_arg2);
_local6 = (_local4.getDisplayObject() as GSteed);
_local6.insertRider(_local5);
return (_local4);
}
function createWeapon(_arg1:uint, _arg2:String):Collider{
var _local3:GWeapon;
var _local4:Collider;
_local3 = new GWeapon(_arg1, _arg2);
m_game.getContainer().addChild(_local3);
_local4 = new Collider(m_game, null, _local3);
_local4.setRadius(16);
_local4.setLivingTime(-1);
_local4.initialize();
_local4.setMovementSpeed(0.09);
return (_local4);
}
function populateGameImpl(){
trace("Level::populateGame, class Level is an abstract class");
}
function getDescription():String{
return (m_description);
}
function update(_arg1:Number){
m_accruedTime = (m_accruedTime + _arg1);
updateImpl(_arg1);
}
function isEquipScreenDisabled():Boolean{
return (false);
}
function plotWedge(_arg1:Path, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int, _arg6:int){
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:int;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
if (_arg6 < _arg5){
_arg6 = (_arg6 + 360);
};
_local7 = (Math.PI / 180);
_local8 = Math.ceil(((_arg6 - _arg5) / 45));
_local9 = (((_arg6 - _arg5) / _local8) * _local7);
_local10 = (_arg4 / Math.cos((_local9 / 2)));
_local11 = (_arg5 * _local7);
_local12 = (_local11 - (_local9 / 2));
_arg1.moveTo(_arg2, _arg3);
_arg1.lineTo((_arg2 + (_arg4 * Math.cos(_local11))), (_arg3 + (_arg4 * Math.sin(_local11))));
_local13 = 0;
while (_local13 < _local8) {
_local11 = (_local11 + _local9);
_local12 = (_local12 + _local9);
_local14 = (_arg4 * Math.cos(_local11));
_local15 = (_arg4 * Math.sin(_local11));
_local16 = (_local10 * Math.cos(_local12));
_local17 = (_local10 * Math.sin(_local12));
_arg1.curveTo((_arg2 + _local16), (_arg3 + _local17), (_arg2 + _local14), (_arg3 + _local15));
_local13++;
};
_arg1.lineTo(_arg2, _arg3);
}
function setCampaignData(_arg1:int, _arg2:int, _arg3:String){
m_part = _arg1;
m_chapter = _arg2;
m_description = _arg3;
}
function getStageWidth():int{
return (k_levelWidth);
}
function plotCircleSegment(_arg1:Path, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int, _arg6:int, _arg7:int=30){
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
_local8 = (Math.PI / 180);
_local9 = Math.ceil(((_arg6 - _arg5) / _arg7));
_local9 = Math.abs(_local9);
_local10 = (((_arg6 - _arg5) / _local9) * _local8);
_local11 = (_arg4 / Math.cos((_local10 / 2)));
_local12 = (_arg5 * _local8);
_local13 = (_local12 - (_local10 / 2));
_arg1.moveTo((_arg2 + (_arg4 * Math.cos(_local12))), (_arg3 + (_arg4 * Math.sin(_local12))));
_local14 = 0;
while (_local14 < _local9) {
_local12 = (_local12 + _local10);
_local13 = (_local13 + _local10);
_local15 = (_arg4 * Math.cos(_local12));
_local16 = (_arg4 * Math.sin(_local12));
_local17 = (_local11 * Math.cos(_local13));
_local18 = (_local11 * Math.sin(_local13));
_arg1.curveTo((_arg2 + _local17), (_arg3 + _local18), (_arg2 + _local15), (_arg3 + _local16));
_local14++;
};
}
function cleanupImpl(){
}
function tempPathHelix(_arg1:Path, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_arg1.moveTo((_arg3 + _arg2), _arg4);
_local6 = Math.tan(((_arg5 * Math.PI) / 180));
_local7 = 45;
while (_local7 <= 360) {
_local8 = (_arg2 * Math.cos(((_local7 * Math.PI) / 180)));
_local9 = (_arg2 * Math.sin(((_local7 * Math.PI) / 180)));
_local10 = (_local8 + ((_arg2 * _local6) * Math.cos((((_local7 - 90) * Math.PI) / 180))));
_local11 = (_local9 + ((_arg2 * _local6) * Math.sin((((_local7 - 90) * Math.PI) / 180))));
_arg1.curveTo((_local10 + _arg3), (_local11 + _arg4), (_local8 + _arg3), (_local9 + _arg4));
_local7 = (_local7 + 45);
};
}
function getDefaultGameData():GameInitialData{
return (getDefaultGameDataImpl());
}
function initializeGameImpl(){
}
function getPart():int{
return (m_part);
}
function setGame(_arg1:UI_Game){
m_game = _arg1;
if (m_game != null){
initializeGameImpl();
};
}
function tempPathCicle(_arg1:Path, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local5 = 22.5;
_arg1.moveTo((_arg3 + _arg2), _arg4);
_local6 = Math.tan(((_local5 * Math.PI) / 180));
_local7 = 45;
while (_local7 <= 360) {
_local8 = (_arg2 * Math.cos(((_local7 * Math.PI) / 180)));
_local9 = (_arg2 * Math.sin(((_local7 * Math.PI) / 180)));
_local10 = (_local8 + ((_arg2 * _local6) * Math.cos((((_local7 - 90) * Math.PI) / 180))));
_local11 = (_local9 + ((_arg2 * _local6) * Math.sin((((_local7 - 90) * Math.PI) / 180))));
_arg1.curveTo((_local10 + _arg3), (_local11 + _arg4), (_local8 + _arg3), (_local9 + _arg4));
_local7 = (_local7 + 45);
};
}
function getStageMiddleX():int{
return ((k_levelWidth / 2));
}
}
}//package
Section 155
//Level_1_2 (Level_1_2)
package {
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
import flash.display.*;
import com.gamedozer.math.*;
import com.gamedozer.utils.*;
public class Level_1_2 extends Level {
var m_gameHasEnded:Boolean;
var k_tepperColor:uint;// = 0xFF00
var m_enemyPath1:Path;
var m_playersPath:Path;
var m_enemyPath2:Path;
var m_gameHasStarted:Boolean;
var m_enemy1:Player;
var m_enemy2:Player;
var m_initialData:GameInitialData;
var m_player:Player;
var k_scarletColor:uint;// = 0xFF0000
public function Level_1_2(){
k_tepperColor = 0xFF00;
k_scarletColor = 0xFF0000;
super("Tomb Raider", LevelList.k_campaignMode, 600);
setCampaignData(1, 2, "Tepper Dol Ken, master thief, emerges from a ruined temple in the midst of the Prunor Forest with a priceless artifact in hand. After taking to the skies on the back of her giant bat, Wendue, Tepper finds herself being tailed by members of the infamous Scarlet Daggers guild, and they don't want to leave empty-handed.");
}
function playEndMusic(){
m_game.playSound("Tepper_Win");
}
override function updateImpl(_arg1:Number){
if (!(m_gameHasStarted)){
return;
};
if (m_gameHasEnded){
return;
};
if (((m_enemy1.isDead()) && (m_enemy2.isDead()))){
endGame();
};
}
function makePaths(){
var _local1:int;
var _local2:int;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
m_playersPath = new Path();
plotCircleSegment(m_playersPath, _local1, _local2, 250, 145, 35, 20);
m_game.drawPath(m_playersPath, DynamicColor.getRGB(Colorizer.kGreen));
m_enemyPath1 = new Path();
plotCircleSegment(m_enemyPath1, _local1, _local2, 250, 195, 0xFF, 20);
m_game.drawPath(m_enemyPath1, DynamicColor.getRGB(Colorizer.kRed));
m_enemyPath2 = new Path();
plotCircleSegment(m_enemyPath2, _local1, _local2, 250, 285, 345, 20);
m_game.drawPath(m_enemyPath2, DynamicColor.getRGB(Colorizer.kRed));
}
function queueDialogue(_arg1:String, _arg2:String, _arg3:Vector2=null){
var _local4:String;
var _local5:uint;
var _local6:uint;
_local4 = "Tepper";
if (_arg1 != "Tepper"){
_local4 = "Scarlet";
};
_local5 = 0x804000;
if (_arg1 == "Tepper"){
_local5 = 0x804000;
};
if (_arg1 == "Anthur"){
_local5 = 0xC0C0C0;
};
_local6 = k_tepperColor;
if (_arg1 == "Tepper"){
_local6 = k_tepperColor;
};
if (_arg1 == "Anthur"){
_local6 = k_scarletColor;
};
m_game.queueGameEvent(new EVDialogue(m_game, _local4, _local6, _local5, _arg1, _arg2, (_arg1 == "Tepper"), _arg3));
}
override function getDefaultGameDataImpl():GameInitialData{
var _local1:GameInitialData;
_local1 = new GameInitialData();
_local1.setPlayerData("Tepper", ResourceLoader.k_Rogue, ResourceLoader.k_Bat, ResourceLoader.k_Dagger);
return (_local1);
}
function startGame(){
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:AIBrain;
var _local7:AIBrain;
m_game.playLoop("Tepper_Play");
m_gameHasStarted = true;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = m_initialData.getSteed(0);
_local4 = m_initialData.getCharacter(0);
_local5 = m_initialData.getWeapon(0);
m_player = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kGreen), _local4, _local3, _local5);
m_player.setPath(m_playersPath);
m_game.makeLocalPlayer(m_player);
m_enemy1 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Bat, ResourceLoader.k_Dagger);
m_enemy1.setPathPosition(0.5);
m_enemy1.setPath(m_enemyPath1);
_local6 = new AIBrain(m_game, m_enemy1, 0.1);
m_enemy2 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Bat, ResourceLoader.k_Dagger);
m_enemy2.setPathPosition(0.5);
m_enemy2.setPath(m_enemyPath2);
_local7 = new AIBrain(m_game, m_enemy2, 0.1);
_local6.addAlly(m_enemy2);
_local7.addAlly(m_enemy1);
}
function createFakeTepperForEndSequence(){
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:Collider;
m_player.visible = false;
_local1 = m_initialData.getSteed(0);
_local2 = m_initialData.getCharacter(0);
_local3 = m_initialData.getWeapon(0);
_local4 = createSteedAndRider(_local1, _local2, k_tepperColor);
_local4.setMovementDirection(1, 0);
_local4.x = m_player.x;
_local4.y = m_player.y;
}
override function populateGameImpl(){
var _local1:MovieClip;
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:String;
var _local6:String;
var _local7:Collider;
var _local8:Vector2;
var _local9:Collider;
var _local10:Collider;
var _local11:Collider;
var _local12:Collider;
var _local13:Vector2;
m_gameHasEnded = false;
m_gameHasStarted = false;
m_initialData = m_game.getInitialData();
if (m_initialData == null){
m_initialData = getDefaultGameData();
};
m_game.playLoop("Tepper_Story");
_local1 = new BG2MC();
_local1.cacheAsBitmap = true;
m_game.getContainer().addChildAt(_local1, 0);
makePaths();
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
m_game.queueGameEvent(new EVInput(m_game, false));
_local4 = m_initialData.getSteed(0);
_local5 = m_initialData.getCharacter(0);
_local6 = m_initialData.getWeapon(0);
_local7 = createSteedAndRider(_local4, _local5, k_tepperColor);
_local7.x = 97;
_local7.y = 166;
m_game.queueGameEvent(new EVMoveCollider(m_game, _local7, new Vector2(200, 300), true));
_local8 = new Vector2(200, 300);
m_game.queueGameEvent(new EVTurnCollider(m_game, _local7, new Vector2(1, 0), 3000, true));
m_game.queueGameEvent(new EVTurnCollider(m_game, _local7, new Vector2(0, 1), 3000, true));
m_game.queueGameEvent(new EVTurnCollider(m_game, _local7, new Vector2(-1, 0), 3000, true));
m_game.queueGameEvent(new EVTurnCollider(m_game, _local7, new Vector2(0, -1), 3000, true));
queueDialogue("Tepper", "Wendue! I can't even believe how easy that was. Either I'm the best thief in the world, or that was the worst booby-trapped temple ever.", _local8);
queueDialogue("Tepper", "Sorry, Wendue, I can never remember to use my inside voice around those giant ears of yours.", _local8);
queueDialogue("Tepper", "I said I was sorry, Wendue, and I'm talking quiet now. What's the problem? We have the artifact and we're heading home.", _local8);
_local9 = createSteedAndRider(_local4, ResourceLoader.k_Scarlet, k_scarletColor);
_local9.x = -100;
_local9.y = -100;
m_game.queueGameEvent(new EVMoveCollider(m_game, _local9, new Vector2(100, 100), false));
_local10 = createSteedAndRider(_local4, ResourceLoader.k_Scarlet, k_scarletColor);
_local10.x = 900;
_local10.y = -100;
m_game.queueGameEvent(new EVMoveCollider(m_game, _local10, new Vector2(700, 100), false));
_local11 = createSteedAndRider(_local4, ResourceLoader.k_Scarlet, k_scarletColor);
_local11.x = -100;
_local11.y = 700;
m_game.queueGameEvent(new EVMoveCollider(m_game, _local11, new Vector2(100, 500), false));
_local12 = createSteedAndRider(_local4, ResourceLoader.k_Scarlet, k_scarletColor);
_local12.x = 900;
_local12.y = 700;
m_game.queueGameEvent(new EVMoveCollider(m_game, _local12, new Vector2(700, 500), true));
_local13 = new Vector2(100, 100);
queueDialogue("Tepper", "So <i>that</i> was the problem. I really need to learn to speak Giant Bat.", _local8);
queueDialogue("Anthur", "The artifact.", _local13);
queueDialogue("Tepper", "Hey, Anthur. Nice night.", _local8);
queueDialogue("Anthur", "Don't be cute, Tepper. It hasn't helped you before and it won't help you now.", _local13);
queueDialogue("Tepper", "Yeah, but I'm VERY cute.", _local8);
queueDialogue("Anthur", "Give me the artifact.", _local13);
queueDialogue("Tepper", "Which one? There are so many. It's hard to keep track of them all.", _local8);
queueDialogue("Anthur", "The one you stole from our guildhouse.", _local13);
queueDialogue("Tepper", "Not the one I got from this temple? This one is really shiny. I worked super hard to get it.", _local8);
queueDialogue("Anthur", "And we worked hard to find you. You owe the Scarlet Daggers and I have come to collect. Now, give me the artifact.", _local13);
queueDialogue("Tepper", "Quick, Wendue, to the floestream! I think Anthur wants to play with us.", _local8);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local7, new Vector2(190, 440), true));
queueDialogue("Anthur", "Cala, Enbore. Return to the camp, bring the others. We'll deal with the brat until you return.", _local13);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local11, new Vector2((_local11.x + 200), (_local11.y + 200)), false));
m_game.queueGameEvent(new EVMoveCollider(m_game, _local12, new Vector2((_local12.x + 200), (_local12.y + 200)), false));
m_game.queueGameEvent(new EVMoveCollider(m_game, _local9, new Vector2(150, 245), false));
m_game.queueGameEvent(new EVMoveCollider(m_game, _local10, new Vector2(470, 55), true));
m_game.queueGameEvent(new EVKillCollider(m_game, _local9));
m_game.queueGameEvent(new EVKillCollider(m_game, _local10));
m_game.queueGameEvent(new EVKillCollider(m_game, _local7));
m_game.queueGameEvent(new EVKillCollider(m_game, _local11));
m_game.queueGameEvent(new EVKillCollider(m_game, _local12));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, startGame)));
m_game.queueGameEvent(new EVInput(m_game, true));
}
override function cleanupImpl(){
}
function endGame(){
var _local1:Vector2;
var _local2:EVShowResults;
m_gameHasEnded = true;
m_game.queueGameEvent(new EVInput(m_game, false));
_local1 = new Vector2(m_player.x, m_player.y);
queueDialogue("Tepper", "Let's get out of here, Wendue, before the rest of them return.", _local1);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, createFakeTepperForEndSequence)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, playEndMusic)));
m_game.queueGameEvent(new EVDelay(m_game, 3000));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
_local2 = new EVShowResults(m_game, true);
m_game.queueGameEvent(_local2);
UI_Campaign.completeLevel(this);
}
}
}//package
Section 156
//Level_1_3 (Level_1_3)
package {
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
import com.gamedozer.math.*;
import com.gamedozer.utils.*;
public class Level_1_3 extends Level implements IStateListener {
var m_townHallSpeechBubbleLocation:Vector2;
var m_radiusMap:Dictionary;
var m_playersPath:Path;
var m_stopUpdatingGyenas:Boolean;
var m_gameHasStarted:Boolean;
var m_attackingGyena:Collider;
var m_swarmRotationCenterX:int;
var m_swarmRotationCenterY:int;
var m_initialData:GameInitialData;
var m_pathWidth:int;
var m_base:ObstacleBase;
var m_gameplayGyenas:Array;
var m_killQuota:StateKillQuota;
var m_buildingLayer:MovieClip;
var m_pathStartX:int;
var m_pathStartY:int;
var m_gameHasEnded:Boolean;
var m_stopProducingNewGyenas:Boolean;
var k_maximumGyenas:int;// = 10
var m_player:Player;
var m_timeUntilNextGyenaSpawn:int;
public function Level_1_3(){
k_maximumGyenas = 10;
super("Siege of Lihr", LevelList.k_campaignMode, 700);
m_pathWidth = (getStageWidth() * 0.7);
m_pathStartX = ((getStageWidth() - m_pathWidth) / 2);
m_pathStartY = (getStageHeight() - 110);
setCampaignData(1, 3, "Oron the Lighthammer, almost delirious from the effort of battle and the journey back to Lihr, is met by a horrific sight. Gyena, stirred to a frenzy by Taur's headstrong attack, have outpaced Oron back to Lihr, and are destroying everything in their path.");
}
function queueDialogue(_arg1:String, _arg2:String, _arg3:Vector2){
var _local4:String;
var _local5:uint;
var _local6:uint;
_local4 = "Oron";
_local5 = 0x804000;
if (_arg1 == "Oron"){
_local5 = 0x804000;
};
if (_arg1 == "Village Elder"){
_local5 = 0xC0C0C0;
};
_local6 = 0xFF00FF;
if (_arg1 == "Oron"){
_local6 = 0xFF;
};
if (_arg1 == "Village Elder"){
_local6 = 0x5200A4;
};
m_game.queueGameEvent(new EVDialogue(m_game, _local4, _local6, _local5, _arg1, _arg2, (_arg1 == "Oron"), _arg3));
}
public function handleUpdate(_arg1:Number){
}
function stopUpdatingGyenas(){
m_stopUpdatingGyenas = true;
}
public function dispose(){
}
function createFodders(){
var _local1:String;
var _local2:String;
var _local3:int;
var _local4:int;
_local1 = "Building_House_02";
_local2 = "Building_House_01";
createFodder(2, -4, _local1);
createFodder(114, -4, _local1);
createFodder(54, 4, _local1);
createFodder(540, 75, _local1);
createFodder(132, 122, _local1);
createFodder(415, 137, _local1);
createFodder(500, 137, _local1);
createFodder(242, 187, _local1);
createFodder(109, 262, _local1);
createFodder(0x0200, 380, _local1);
createFodder(570, 380, _local1);
createFodder(237, 397, _local1);
createFodder(270, 29, _local2);
createFodder(575, 246, _local2);
createFodder(120, 340, _local2);
_local3 = getStageMiddleX();
_local4 = getStageMiddleY();
m_base = new ObstacleBase(m_game, null, "Building_Townhall");
m_base.x = _local3;
m_base.y = _local4;
}
function createFakeOronForEndSequence(){
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:Collider;
var _local5:GSteed;
var _local6:uint;
var _local7:GRider;
m_player.visible = false;
_local1 = m_initialData.getSteed(0);
_local2 = m_initialData.getCharacter(0);
_local3 = m_initialData.getWeapon(0);
_local4 = createRiderlessSteed(_local1);
_local5 = (_local4.getDisplayObject() as GSteed);
_local6 = 0xFF;
_local7 = new GRider(_local6);
_local7.load(_local2);
_local5.insertRider(_local7);
_local4.setMovementDirection(-1, 0);
_local4.x = m_player.x;
_local4.y = m_player.y;
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
override function populateGameImpl(){
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Collider;
var _local7:GSteed;
var _local8:uint;
var _local9:GRider;
var _local10:Vector2;
var _local11:Vector2;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
m_townHallSpeechBubbleLocation = new Vector2(getStageMiddleX(), getStageMiddleY());
m_game.queueGameEvent(new EVInput(m_game, false));
_local3 = m_initialData.getSteed(0);
_local4 = m_initialData.getCharacter(0);
_local5 = m_initialData.getWeapon(0);
_local6 = createRiderlessSteed(_local3);
_local7 = (_local6.getDisplayObject() as GSteed);
_local8 = 0xFF;
_local9 = new GRider(_local8);
_local9.load(_local4);
_local7.insertRider(_local9);
_local6.x = getStageMiddleX();
_local6.y = (getStageHeight() + 100);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local6, new Vector2(getStageMiddleX(), (getStageMiddleY() + 100)), true));
_local10 = new Vector2(getStageMiddleX(), (getStageMiddleY() + 100));
queueDialogue("Oron", "Fallon! Have you returned? Fallon!", _local10);
queueDialogue("Village Elder", "Oron! You have come back! The watch has seen a great cloud of Gyena approaching! They will destroy us all!", m_townHallSpeechBubbleLocation);
queueDialogue("Oron", "That fool, Taur! We could have contained that colony! Have my men returned to you, Elder?", _local10);
queueDialogue("Village Elder", "They must have fallen. Lihr is without defenses!", m_townHallSpeechBubbleLocation);
queueDialogue("Oron", "I will defend the village.", _local10);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local6, new Vector2((getStageMiddleX() + 100), getStageMiddleY()), true));
_local11 = new Vector2((getStageMiddleX() + 100), getStageMiddleY());
queueDialogue("Village Elder", "Defend the Town Hall, Oron. Our families are sheltered there. The homes can be rebuilt when this is all over.", m_townHallSpeechBubbleLocation);
queueDialogue("Oron", "Get inside, Elder. Tell the others they are safe now. I will handle the gyena.", _local11);
m_game.queueGameEvent(new EVSound(m_game, "EnemyTalk"));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, addPlayer)));
m_game.queueGameEvent(new EVKillCollider(m_game, _local6));
m_game.queueGameEvent(new EVDelay(m_game, 250));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, startCreatingGyenas)));
m_game.queueGameEvent(new EVInput(m_game, true));
}
function makePlayersPath(){
var _local1:int;
var _local2:int;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
m_playersPath = new Path();
tempPathCicle(m_playersPath, 100, _local1, _local2);
m_game.drawPath(m_playersPath, 0xFF);
}
function sendGyenaAtBase(){
var _local1:Collider;
_local1 = m_gameplayGyenas[Math.floor((m_gameplayGyenas.length * Math.random()))];
m_game.queueGameEvent(new EVSeekTarget(m_game, _local1, m_base, false));
m_attackingGyena = _local1;
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
function queueEndGameEvents(){
var _local1:Vector2;
var _local2:EVShowResults;
m_attackingGyena = null;
m_game.queueGameEvent(new EVInput(m_game, false));
_local1 = new Vector2(m_player.x, m_player.y);
queueDialogue("Oron", "The Gyena are retreating.", _local1);
queueDialogue("Village Elder", "Then we are safe for now.", m_townHallSpeechBubbleLocation);
queueDialogue("Oron", "They have destroyed our homes, my home. They have taken Lihr from me... I will tear their nest to the ground!", _local1);
queueDialogue("Village Elder", "If you can hold them back, it should give us the time to rebuild Lihr. The soldiers garrisoned at Lorghid can help you assault the nest.", m_townHallSpeechBubbleLocation);
queueDialogue("Oron", "Then I will travel to Lorghid and return with an army to drive the Gyena from our lands.", _local1);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, stopUpdatingGyenas)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, playEndMusic)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, createFakeOronForEndSequence)));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
_local2 = new EVShowResults(m_game, true);
m_game.queueGameEvent(_local2);
UI_Campaign.completeLevel(this);
}
function spawnGameplayGyena(){
var _local1:Collider;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (m_stopProducingNewGyenas){
return;
};
_local1 = createRiderlessSteed(ResourceLoader.k_Gyena);
_local1.setMovementSpeed((0.1 + (Math.random() * 0.04)));
_local1.setCanBeCollidedByColliders();
_local1.setSoundType("Enemy");
_local1.setMaximumHitpoints(10);
m_gameplayGyenas.push(_local1);
m_radiusMap[_local1] = ((Math.random() * 200) + 200);
_local2 = (Math.random() * getStageWidth());
_local3 = (Math.random() * getStageHeight());
_local4 = Math.random();
if (_local4 < 0.25){
_local2 = 0;
} else {
if (_local4 < 0.5){
_local3 = 0;
} else {
if (_local4 < 0.75){
_local2 = getStageWidth();
} else {
_local3 = getStageHeight();
};
};
};
_local1.x = _local2;
_local1.y = _local3;
}
function playEndMusic(){
m_game.playSound("Oron_Win");
}
override function updateImpl(_arg1:Number){
if (m_gameHasStarted){
if (!(m_gameHasEnded)){
if (m_killQuota.getKillsRemaining() < (k_maximumGyenas - 1)){
m_stopProducingNewGyenas = true;
};
if (m_killQuota.getKillsRemaining() <= 0){
m_gameHasEnded = true;
m_game.removeStateListener(m_killQuota);
m_killQuota.dispose();
m_killQuota = null;
queueEndGameEvents();
return;
};
if (m_attackingGyena == null){
sendGyenaAtBase();
};
if (m_gameplayGyenas.length < k_maximumGyenas){
m_timeUntilNextGyenaSpawn = (m_timeUntilNextGyenaSpawn - _arg1);
if (m_timeUntilNextGyenaSpawn <= 0){
m_timeUntilNextGyenaSpawn = (200 + (Math.random() * 250));
spawnGameplayGyena();
};
};
};
updateGyenas(_arg1);
};
}
public function handleColliderRemoved(_arg1:Collider){
var _local2:int;
var _local3:Collider;
m_radiusMap[_arg1] = null;
if (_arg1 == m_attackingGyena){
m_attackingGyena = null;
};
_local2 = 0;
while (_local2 < m_gameplayGyenas.length) {
_local3 = m_gameplayGyenas[_local2];
if (_local3 == _arg1){
m_gameplayGyenas.splice(_local2, 1);
return;
};
_local2++;
};
}
function createFodder(_arg1:int, _arg2:int, _arg3:String){
var _local4:ObstacleFodder;
var _local5:DisplayObject;
var _local6:int;
var _local7:int;
_local4 = new ObstacleFodder(m_game, _arg3);
if ("Building_House_01" == _arg3){
_local4.setRadius(32);
};
_local5 = _local4.getDisplay();
_local5.parent.removeChild(_local5);
m_buildingLayer.addChild(_local5);
_local6 = 30;
_local7 = 32;
if (_arg3 == "Building_House_01"){
_local6 = 48;
_local7 = 60;
};
_local4.x = (_arg1 + _local6);
_local4.y = (_arg2 + _local7);
}
override function getDefaultGameDataImpl():GameInitialData{
var _local1:GameInitialData;
_local1 = new GameInitialData();
_local1.setPlayerData("Oron", ResourceLoader.k_Warrior, ResourceLoader.k_Behelmut, ResourceLoader.k_DoubleAxe);
return (_local1);
}
function startCreatingGyenas(){
m_game.playLoop("Oron_Play");
setupKillQuota();
m_gameHasStarted = true;
spawnGameplayGyena();
spawnGameplayGyena();
spawnGameplayGyena();
spawnGameplayGyena();
spawnGameplayGyena();
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function updateGyenas(_arg1:Number){
var _local2:int;
var _local3:Collider;
var _local4:int;
var _local5:int;
var _local6:Vector2;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
if (m_stopUpdatingGyenas){
return;
};
_local2 = 0;
while (_local2 < m_gameplayGyenas.length) {
_local3 = m_gameplayGyenas[_local2];
if (_local3 == m_attackingGyena){
} else {
_local4 = m_swarmRotationCenterX;
_local5 = m_swarmRotationCenterY;
_local6 = new Vector2((_local4 - _local3.x), (_local5 - _local3.y));
_local7 = m_radiusMap[_local3];
_local8 = _local6.length();
if (Math.abs((_local8 - _local7)) < 5){
_local9 = _local6.getAngle();
_local10 = 90;
_local6.setAngle((_local9 + _local10));
} else {
if (_local8 < _local7){
_local6.x = (_local6.x * -1);
_local6.y = (_local6.y * -1);
};
};
if (_local6.lengthSquared() > 0.1){
_local3.setMovementDirection(_local6.x, _local6.y);
} else {
trace(((("Screwed up: " + _local8) + ", ") + _local7));
};
};
_local2++;
};
}
function setupKillQuota(){
m_killQuota = new StateKillQuota(m_game, 60);
m_game.addStateListener(m_killQuota);
}
override function initializeGameImpl(){
var _local1:MovieClip;
m_initialData = m_game.getInitialData();
if (m_initialData == null){
m_initialData = getDefaultGameData();
};
m_timeUntilNextGyenaSpawn = 0;
m_swarmRotationCenterX = getStageMiddleX();
m_swarmRotationCenterY = getStageMiddleY();
m_gameHasStarted = false;
m_radiusMap = new Dictionary(false);
m_gameplayGyenas = new Array();
m_gameHasEnded = false;
m_stopUpdatingGyenas = false;
m_base = null;
m_stopProducingNewGyenas = false;
m_game.addStateListener(this);
m_game.playLoop("Oron_Story");
_local1 = new BG3MC();
_local1.cacheAsBitmap = true;
m_game.getContainer().addChildAt(_local1, 0);
m_buildingLayer = _local1.buildingLayer_mc;
makePlayersPath();
createFodders();
}
function makeSteedSafeFromShooting(_arg1:Collider){
_arg1.setCanBeCollidedByColliders(false);
}
function addPlayer(){
var _local1:String;
var _local2:String;
var _local3:String;
_local1 = m_initialData.getSteed(0);
_local2 = m_initialData.getCharacter(0);
_local3 = m_initialData.getWeapon(0);
m_player = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue), _local2, _local1, _local3);
m_player.setPathPosition(0);
m_player.setPath(m_playersPath);
m_player.makePathWrappable();
m_game.makeLocalPlayer(m_player);
m_base.setBaseOwner(m_player);
}
override function cleanupImpl(){
trace("CLEAN UP LEVEL 1_3");
}
}
}//package
Section 157
//Level2 (Level2)
package {
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
public class Level2 extends Level {
var m_survivalState:StateSurvival;
public function Level2(){
super("Level 2", LevelList.k_campaignMode, 2000);
}
function setupSurvivalState(){
m_survivalState = new StateSurvival(m_game);
m_survivalState.setGameTime(60000);
m_game.addStateListener(m_survivalState);
}
function getPath(_arg1:int):Path{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Path;
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
_local4 = 200;
_local5 = new Path();
if (_arg1 == 0){
_local5.moveTo(150, (_local3 + _local4));
_local5.lineTo(590, (_local3 + _local4));
} else {
if (_arg1 == 1){
_local5.moveTo(590, (_local3 - _local4));
_local5.lineTo(150, (_local3 - _local4));
} else {
trace("LevelPopulator::createPath. Invalid number of players for this level");
return (null);
};
};
return (_local5);
}
override function populateGameImpl(){
var _local1:int;
var _local2:int;
var _local3:Player;
var _local4:Player;
var _local5:AIBrain;
var _local6:int;
var _local7:ObstacleManualTurret;
var _local8:ObstacleManualTurret;
var _local9:ObstaclePathShortener;
var _local10:ObstaclePathShortener;
var _local11:ObstaclePathShortener;
var _local12:ObstaclePathShortener;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue));
_local3.setPath(getPath(0));
m_game.makeLocalPlayer(_local3);
m_survivalState.addPlayer(_local3, 1, true);
_local4 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed));
_local4.setPath(getPath(1));
_local5 = new AIBrain(m_game, _local4);
_local6 = 250;
_local7 = new ObstacleManualTurret(m_game);
_local7.x = (_local1 + _local6);
_local7.y = _local2;
_local8 = new ObstacleManualTurret(m_game);
_local8.x = (_local1 - _local6);
_local8.y = _local2;
_local9 = new ObstaclePathShortener(m_game, true, _local3);
_local10 = new ObstaclePathShortener(m_game, false, _local3);
_local11 = new ObstaclePathShortener(m_game, true, _local4);
_local12 = new ObstaclePathShortener(m_game, false, _local4);
}
override function initializeGameImpl(){
setupSurvivalState();
}
}
}//package
Section 158
//Level3 (Level3)
package {
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
public class Level3 extends Level {
public function Level3(){
super("Level 3", LevelList.k_campaignMode, 3000);
}
function getPath(_arg1:int):Path{
var _local2:int;
var _local3:int;
var _local4:Path;
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
_local4 = new Path();
if (_arg1 == 0){
plotCircleSegment(_local4, _local2, _local3, 250, 135, 45, 20);
} else {
if (_arg1 == 1){
plotCircleSegment(_local4, _local2, _local3, 250, 165, 0xFF, 20);
} else {
if (_arg1 == 2){
plotCircleSegment(_local4, _local2, _local3, 250, 285, 375, 20);
} else {
trace("LevelPopulator::createPath. Invalid number of players for this level");
return (null);
};
};
};
return (_local4);
}
override function populateGameImpl(){
var _local1:int;
var _local2:int;
var _local3:Player;
var _local4:Player;
var _local5:AIBrain;
var _local6:Player;
var _local7:ObstacleSpreadFire;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue));
_local3.setPath(getPath(0));
m_game.makeLocalPlayer(_local3);
_local4 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed));
_local4.setPath(getPath(1));
_local5 = new AIBrain(m_game, _local4);
_local6 = m_game.addPlayer();
_local6.setPath(getPath(2));
_local5 = new AIBrain(m_game, _local6);
_local7 = new ObstacleSpreadFire(m_game);
_local7.x = _local1;
_local7.y = _local2;
}
}
}//package
Section 159
//Level4 (Level4)
package {
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
public class Level4 extends Level {
public function Level4(){
super("Level 4", LevelList.k_campaignMode, 4000);
}
function getPath(_arg1:int):Path{
var _local2:int;
var _local3:int;
var _local4:Path;
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
_local4 = new Path();
if (_arg1 == 0){
_local4.moveTo(150, 700);
_local4.lineTo(590, 700);
} else {
if (_arg1 == 1){
_local4.moveTo(590, 40);
_local4.lineTo(150, 40);
} else {
if (_arg1 == 2){
_local4.moveTo(40, 150);
_local4.lineTo(40, 590);
} else {
if (_arg1 == 3){
_local4.moveTo(700, 150);
_local4.lineTo(700, 590);
} else {
trace("LevelPopulator::createPath. Invalid number of players for this level");
return (null);
};
};
};
};
return (_local4);
}
override function populateGameImpl(){
var _local1:int;
var _local2:int;
var _local3:Player;
var _local4:Player;
var _local5:AIBrain;
var _local6:Player;
var _local7:Player;
var _local8:ObstacleMoveableTurret;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue));
_local3.setPath(getPath(0));
m_game.makeLocalPlayer(_local3);
_local4 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed));
_local4.setPath(getPath(1));
_local5 = new AIBrain(m_game, _local4);
_local6 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kYellow));
_local6.setPath(getPath(2));
_local5 = new AIBrain(m_game, _local6);
_local7 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kGreen));
_local7.setPath(getPath(3));
_local5 = new AIBrain(m_game, _local7);
_local8 = new ObstacleMoveableTurret(m_game);
_local8.setAnchorPoint(_local1, _local2);
_local8.x = _local1;
_local8.y = _local2;
}
}
}//package
Section 160
//LevelBinoculars (LevelBinoculars)
package {
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
public class LevelBinoculars extends Level {
var m_binocularCenterOffset:int;
var m_binocularHeight:int;
var m_binocularWidth:int;
public function LevelBinoculars(){
super("Binoculars", LevelList.k_campaignMode, 1240341);
m_binocularWidth = 700;
m_binocularHeight = 400;
m_binocularCenterOffset = (m_binocularWidth / 4);
}
override function updateImpl(_arg1:Number){
}
function getPath(_arg1:int):Path{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Path;
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
_local4 = 200;
_local5 = new Path();
if (_arg1 == 0){
tempPathBinoculars(_local5, _local2, _local3, m_binocularWidth, m_binocularHeight);
} else {
if (_arg1 == 1){
_local5.moveTo(((_local2 - m_binocularCenterOffset) + 80), _local3);
_local5.lineTo(((_local2 + m_binocularCenterOffset) - 80), _local3);
} else {
trace("LevelPopulator::createPath. Invalid number of players for this level");
return (null);
};
};
return (_local5);
}
override function populateGameImpl(){
var _local1:int;
var _local2:int;
var _local3:Player;
var _local4:Player;
var _local5:AIBrain;
var _local6:ObstacleMoveableTurret;
var _local7:ObstacleBlock;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue));
_local3.setPath(getPath(0));
_local3.makePathWrappable();
m_game.makeLocalPlayer(_local3);
_local4 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed));
_local4.setPath(getPath(1));
_local5 = new AIBrain(m_game, _local4);
_local6 = new ObstacleMoveableTurret(m_game);
_local6.x = (_local1 - (m_binocularCenterOffset + 75));
_local6.y = _local2;
_local6.setAnchorPoint(_local6.x, _local6.y);
_local6.makeAngryEvenWhenTethered();
_local6.addFriend(_local4);
_local6 = new ObstacleMoveableTurret(m_game);
_local6.x = ((_local1 + m_binocularCenterOffset) + 75);
_local6.y = _local2;
_local6.setAnchorPoint(_local6.x, _local6.y);
_local6.makeAngryEvenWhenTethered();
_local6.addFriend(_local4);
_local7 = new ObstacleBlock(m_game);
_local7.x = ((_local1 - m_binocularCenterOffset) + 50);
_local7.y = _local2;
_local7 = new ObstacleBlock(m_game);
_local7.x = ((_local1 + m_binocularCenterOffset) - 50);
_local7.y = _local2;
}
}
}//package
Section 161
//LevelCircleSurvivor (LevelCircleSurvivor)
package {
import com.gamedozer.math.*;
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
public class LevelCircleSurvivor extends Level {
var m_decreasingIntervalBetweenBadGuys:int;
var m_timerForBadGuys:int;
public function LevelCircleSurvivor(){
super("Circle survivor", LevelList.k_survivalMode, 10);
m_timerForBadGuys = 2000;
m_decreasingIntervalBetweenBadGuys = 1;
}
override function updateImpl(_arg1:Number){
var _local2:GSteed;
var _local3:Collider;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Vector2;
m_timerForBadGuys = (m_timerForBadGuys - _arg1);
if (m_timerForBadGuys <= 0){
m_decreasingIntervalBetweenBadGuys++;
m_timerForBadGuys = (Math.random() * (1000 - (m_decreasingIntervalBetweenBadGuys * 10)));
_local2 = new GSteed();
_local2.load("Gryphon");
m_game.addChild(_local2);
_local3 = new Collider(m_game, null, _local2);
_local3.setRadius(16);
_local3.initialize();
_local4 = (Math.random() * getStageWidth());
_local5 = (Math.random() * getStageHeight());
_local6 = Math.random();
if (_local6 < 0.25){
_local4 = 0;
} else {
if (_local6 < 0.5){
_local5 = 0;
} else {
if (_local6 < 0.75){
_local4 = getStageWidth();
} else {
_local5 = getStageHeight();
};
};
};
_local7 = new Vector2((getStageMiddleX() - _local4), (getStageMiddleY() - _local5));
_local3.setMovementSpeed(0.06);
_local3.setCanBeCollidedByColliders();
_local3.setMovementDirection(_local7.x, _local7.y);
_local3.x = _local4;
_local3.y = _local5;
};
}
override function populateGame(){
var _local1:int;
var _local2:int;
var _local3:Player;
var _local4:ObstacleBase;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue));
_local3.setPath(getPath(0));
_local3.makePathWrappable();
m_game.makeLocalPlayer(_local3);
_local4 = new ObstacleBase(m_game, _local3, "Building_Townhall");
_local4.x = _local1;
_local4.y = _local2;
}
function getPath(_arg1:int):Path{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Path;
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
_local4 = 200;
_local5 = new Path();
if (_arg1 == 0){
tempPathCicle(_local5, 60, _local2, _local3);
} else {
trace("LevelPopulator::createPath. Invalid number of players for this level");
return (null);
};
return (_local5);
}
}
}//package
Section 162
//LevelHintMC (LevelHintMC)
package {
import flash.text.*;
import flash.display.*;
public class LevelHintMC extends MovieClip {
public var objective_txt:TextField;
public function LevelHintMC(_arg1:String){
objective_txt.text = _arg1;
this.x = (400 - (this.width / 2));
this.y = (300 - (this.height / 2));
}
}
}//package
Section 163
//LevelList (LevelList)
package {
import flash.utils.*;
public class LevelList {
static const k_campaignMode:int = 0;
static const k_allMode:int = 2;
static const k_survivalMode:int = 1;
static var m_levelMap:Dictionary = new Dictionary(true);
static var m_isInitialized:Boolean = false;
private static function addLevel(_arg1:Level){
var _local2:String;
_local2 = _arg1.getName();
if (m_levelMap[_local2] != null){
trace(("LevelList: Error. There already exists a level with the name: " + _local2));
return;
};
m_levelMap[_local2] = _arg1;
}
public static function lookupDescription(_arg1:String):String{
var _local2:Level;
_local2 = lookupLevel(_arg1);
return (_local2.getDescription());
}
public static function getLevelList(_arg1:int, _arg2:int=-1):Array{
var _local3:Array;
var _local4:String;
var _local5:Level;
var _local6:int;
var _local7:int;
var _local8:Boolean;
var _local9:int;
var _local10:Level;
assureInitialized();
_local3 = new Array();
for (_local4 in m_levelMap) {
if (_arg1 == k_allMode){
_local3.push(_local4);
} else {
if ((((_arg1 == k_campaignMode)) || ((_arg1 == k_survivalMode)))){
_local5 = lookupLevel(_local4);
_local6 = _local5.getMode();
if (_local6 != _arg1){
} else {
if (((!((_arg2 == -1))) && (!((_arg2 == _local5.getPart()))))){
} else {
_local7 = _local5.getOrder();
if (_local7 <= 0){
} else {
_local8 = false;
_local9 = 0;
while (_local9 < _local3.length) {
_local10 = lookupLevel(_local3[_local9]);
if (_local7 < _local10.getOrder()){
_local8 = true;
_local3.splice(_local9, 0, _local4);
break;
};
_local9++;
};
if (!(_local8)){
_local3.push(_local4);
};
};
};
};
};
};
};
return (_local3);
}
public static function lookupPart(_arg1:String):int{
var _local2:Level;
_local2 = lookupLevel(_arg1);
return (_local2.getPart());
}
private static function registerLevels(){
addLevel(new LevelTepper1());
addLevel(new LevelTepper2());
addLevel(new LevelTepper3());
addLevel(new LevelTepper4());
addLevel(new LevelTepper5());
addLevel(new Episode1_Level1());
addLevel(new Level_1_2());
addLevel(new Level_1_3());
addLevel(new Level2());
addLevel(new Level3());
addLevel(new Level4());
addLevel(new LevelCircleSurvivor());
addLevel(new LevelTest1());
addLevel(new LevelSpaceInvaders());
addLevel(new LevelPerimeter());
addLevel(new LevelMoveableTurretHell());
addLevel(new LevelBinoculars());
}
public static function lookupChapter(_arg1:String):int{
var _local2:Level;
_local2 = lookupLevel(_arg1);
return (_local2.getChapter());
}
public static function lookupLevel(_arg1:String):Level{
assureInitialized();
return (m_levelMap[_arg1]);
}
private static function assureInitialized(){
if (m_isInitialized){
return;
};
m_isInitialized = true;
registerLevels();
}
}
}//package
Section 164
//LevelMoveableTurretHell (LevelMoveableTurretHell)
package {
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
public class LevelMoveableTurretHell extends Level {
public function LevelMoveableTurretHell(){
super("Auto Turret Hell", LevelList.k_campaignMode, 124051);
}
override function updateImpl(_arg1:Number){
}
function getPath(_arg1:int):Path{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Path;
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
_local4 = 200;
_local5 = new Path();
if (_arg1 == 0){
tempPathOval(_local5, _local2, (_local3 + _local4), 360, 100);
} else {
trace("LevelPopulator::createPath. Invalid number of players for this level");
return (null);
};
return (_local5);
}
override function populateGameImpl(){
var _local1:int;
var _local2:int;
var _local3:Player;
var _local4:Path;
var _local5:ObstacleManualTurret;
var _local6:ObstacleMover;
var _local7:int;
var _local8:ObstacleMoveableTurret;
var _local9:int;
var _local10:int;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue));
_local3.setPath(getPath(0));
_local3.makePathWrappable();
m_game.makeLocalPlayer(_local3);
_local4 = new Path();
tempPathCicle(_local4, 100, _local1, _local2);
_local5 = new ObstacleManualTurret(m_game);
_local5.x = _local1;
_local5.y = _local2;
_local6 = new ObstacleMover(m_game, _local5, _local4, true, 0, true, 0.03);
_local7 = -2;
while (_local7 < 3) {
_local8 = new ObstacleMoveableTurret(m_game);
_local9 = (_local1 + (_local7 * 50));
_local10 = (_local2 + (Math.abs(_local7) * 50));
_local8.x = (_local9 + (_local7 * 100));
_local8.y = (_local10 - 350);
_local8.setAnchorPoint(_local9, _local10);
_local7++;
};
}
}
}//package
Section 165
//LevelPerimeter (LevelPerimeter)
package {
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
public class LevelPerimeter extends Level {
var m_survivalState:StateSurvival;
public function LevelPerimeter(){
super("Perimeter", LevelList.k_campaignMode, 2000);
}
function setupSurvivalState(){
m_survivalState = new StateSurvival(m_game);
m_survivalState.setGameTime(60000);
m_game.addStateListener(m_survivalState);
}
function getPath(_arg1:int):Path{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Path;
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
_local4 = 200;
_local5 = new Path();
if (_arg1 == 0){
_local5.moveTo(150, (_local3 + _local4));
_local5.lineTo(590, (_local3 + _local4));
} else {
if (_arg1 == 1){
_local5.moveTo(590, (_local3 - _local4));
_local5.lineTo(150, (_local3 - _local4));
} else {
trace("LevelPopulator::createPath. Invalid number of players for this level");
return (null);
};
};
return (_local5);
}
function getPerimeterPath():Path{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Path;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = 250;
_local4 = new Path();
_local4.moveTo(100, (_local2 + _local3));
_local4.lineTo(640, (_local2 + _local3));
_local4.lineTo(640, (_local2 - _local3));
_local4.lineTo(100, (_local2 - _local3));
_local4.lineTo(100, (_local2 + _local3));
return (_local4);
}
override function populateGameImpl(){
var _local1:int;
var _local2:int;
var _local3:Player;
var _local4:Player;
var _local5:AIBrain;
var _local6:int;
var _local7:ObstacleManualTurret;
var _local8:ObstacleMover;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue));
_local3.setPath(getPath(0));
m_game.makeLocalPlayer(_local3);
m_survivalState.addPlayer(_local3, 1, true);
_local4 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed));
_local4.setPath(getPath(1));
_local5 = new AIBrain(m_game, _local4);
_local6 = 250;
_local7 = new ObstacleManualTurret(m_game);
_local7.x = _local1;
_local7.y = _local2;
_local8 = new ObstacleMover(m_game, _local7, getPerimeterPath(), true, 0, true, 0.08);
}
override function initializeGameImpl(){
setupSurvivalState();
}
}
}//package
Section 166
//LevelSpaceInvaders (LevelSpaceInvaders)
package {
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
import com.gamedozer.math.*;
public class LevelSpaceInvaders extends Level {
var m_timerForBadGuys:int;
var m_bases:Array;
public function LevelSpaceInvaders(){
m_bases = new Array();
super("Space Invaders", LevelList.k_survivalMode, 5000);
m_timerForBadGuys = 2000;
}
override function updateImpl(_arg1:Number){
var _local2:GSteed;
var _local3:Collider;
var _local4:Number;
var _local5:Number;
var _local6:ObstacleBase;
var _local7:Vector2;
m_timerForBadGuys = (m_timerForBadGuys - _arg1);
if (m_timerForBadGuys <= 0){
m_timerForBadGuys = (Math.random() * 2000);
_local2 = new GSteed();
_local2.load("Gryphon");
m_game.addChild(_local2);
_local3 = new Collider(m_game, null, _local2);
_local3.setRadius(16);
_local3.initialize();
_local4 = (Math.random() * 740);
_local5 = 0;
_local6 = pickBaseTarget();
_local7 = new Vector2((_local6.x - _local4), (_local6.y - _local5));
_local3.setMovementSpeed(0.09);
_local3.setCanBeCollidedByColliders();
_local3.setMovementDirection(_local7.x, _local7.y);
_local3.x = _local4;
_local3.y = _local5;
};
}
function getPath(_arg1:int):Path{
var _local2:int;
var _local3:int;
var _local4:Path;
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
_local4 = new Path();
if (_arg1 == 0){
_local4.moveTo(150, 700);
_local4.lineTo(590, 700);
} else {
trace("LevelPopulator::createPath. Invalid number of players for this level");
return (null);
};
return (_local4);
}
override function populateGameImpl(){
var _local1:Player;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:*;
var _local6:int;
var _local7:ObstacleBase;
_local1 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue));
_local1.setPath(getPath(0));
m_game.makeLocalPlayer(_local1);
_local2 = getStageWidth();
_local3 = ((4 * getStageHeight()) / 5);
_local4 = 4;
_local5 = (_local2 / (_local4 + 1));
_local6 = 1;
while (_local6 <= _local4) {
_local7 = new ObstacleBase(m_game, _local1, "Building_Townhall");
_local7.x = (_local6 * _local5);
_local7.y = _local3;
m_bases.push(_local7);
_local6++;
};
}
function pickBaseTarget():ObstacleBase{
var _local1:int;
var _local2:ObstacleBase;
_local1 = (Math.random() * m_bases.length);
_local2 = m_bases[_local1];
return (_local2);
}
override function cleanupImpl(){
m_bases.splice(0);
}
}
}//package
Section 167
//LevelTepper1 (LevelTepper1)
package {
import flash.display.*;
import com.gamedozer.misc.*;
import com.gamedozer.math.*;
import com.gamedozer.utils.*;
import com.gamedozer.graphics.*;
public class LevelTepper1 extends Level implements IStateListener {
const k_spawnDelay:Number = 500;
const k_killLimit:Number = 41;
const k_maximumEnemies:int = 10;
const k_levelDesc:String = "Tepper's daring raid on a Scarlet Dagger warehouse has grabbed their unwanted attention. Vicious Kites sent by the thieves guild are in hot pursuit and, laden down by their treasure, Tepper and Wendue decide to make a stand.";
const k_angleStep:Number = 5;
const k_levelTitle:String = "A Heavy Burden";
const k_startRadius:Number = 380;
var m_playersPath:Path;
var m_gameHasStarted:Boolean;
var m_swarmRotationCenterY:int;
var m_initialData:GameInitialData;
var m_swarmRotationCenterX:int;
var m_gameplayEnemies:Array;
var m_pathWidth:int;
var m_base:ObstacleBase;
var m_killQuota:StateKillQuota;
var m_stopUpdatingEnemies:Boolean;
var m_pathStartX:int;
var m_pathStartY:int;
var m_timeUntilNextSpawn:int;
var m_gameHasEnded:Boolean;
var m_player:Player;
public function LevelTepper1(){
super(k_levelTitle, LevelList.k_campaignMode, 110);
m_pathWidth = (getStageWidth() * 0.7);
m_pathStartX = ((getStageWidth() - m_pathWidth) / 2);
m_pathStartY = (getStageHeight() - 110);
setCampaignData(2, 1, k_levelDesc);
}
function queueDialogue(_arg1:String, _arg2:String, _arg3:Vector2=null){
var _local4:String;
var _local5:uint;
var _local6:uint;
_local4 = "Tepper";
if (_arg1 != "Tepper"){
_local4 = "Scarlet";
};
_local5 = 0x804000;
if (_arg1 == "Tepper"){
_local5 = 0x804000;
};
if (_arg1 == "Darius"){
_local5 = 0x242424;
};
_local6 = 0xFF00;
if (_arg1 == "Tepper"){
_local6 = 0xFF00;
};
if (_arg1 == "Darius"){
_local6 = 0xFF0000;
};
m_game.queueGameEvent(new EVDialogue(m_game, _local4, _local6, _local5, _arg1, _arg2, (_arg1 == "Tepper"), _arg3));
}
public function handleUpdate(_arg1:Number){
}
function lose(){
var _local1:EVShowResults;
m_gameHasEnded = true;
m_game.queueGameEvent(new EVInput(m_game, false));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
queueDialogue("Tepper", "We couldn't protect the treasure, Wendue. I guess we're not cut out for this job after all.", null);
_local1 = new EVShowResults(m_game, false);
m_game.queueGameEvent(_local1);
}
function updateEnemies(_arg1:Number){
var _local2:Collider;
var _local3:Vector2;
var _local4:Number;
if (m_stopUpdatingEnemies){
return;
};
for each (_local2 in m_gameplayEnemies) {
_local3 = new Vector2((m_swarmRotationCenterX - _local2.x), (m_swarmRotationCenterY - _local2.y));
if (_local3.length() <= k_startRadius){
_local4 = ((_local3.getAngle() + 90) - k_angleStep);
_local3.setAngle(_local4);
};
_local2.setMovementDirection(_local3.x, _local3.y);
};
}
public function dispose(){
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
override function populateGameImpl(){
var _local1:Vector2;
var _local2:Collider;
var _local3:HowToPlayPanel;
m_game.queueGameEvent(new EVInput(m_game, false));
_local1 = new Vector2(500, 300);
_local2 = createSteedAndRider(ResourceLoader.k_Bat, ResourceLoader.k_Rogue, 0xFF00);
_local2.setCanBeCollidedByColliders(false);
_local2.x = _local1.x;
_local2.y = _local1.y;
queueDialogue("Tepper", "Don't feel bad, Wendue. That's some pretty heavy stuff I was asking you to carry.", _local1);
queueDialogue("Tepper", "Well, you should probably feel a little bad. I mean, there are a lot of Kites on our tail and they won't respond to my charming personality. I can't exactly talk us out of this one.", _local1);
queueDialogue("Tepper", "Tell you what, let's work on keeping these Kites away from our shiny stuff, and then we'll take a long vacation. Sound good? For now, on to business.", _local1);
_local3 = new HowToPlayPanel();
_local3.x = (400 - (_local3.width / 2));
_local3.y = (300 - (_local3.height / 2));
m_game.queueGameEvent(new EVFadeDisplayObject(m_game, _local3, 4000));
m_game.queueGameEvent(new EVKillCollider(m_game, _local2));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, addPlayer)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, startCreatingEnemies)));
m_game.queueGameEvent(new EVInput(m_game, true));
}
function makePlayersPath(){
var _local1:int;
var _local2:int;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
m_playersPath = new Path();
tempPathCicle(m_playersPath, 100, _local1, _local2);
m_game.drawPath(m_playersPath, 0xFF00);
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
function spawnGameplayEnemy(){
var _local1:Collider;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (m_killQuota.getKillsRemaining() <= m_gameplayEnemies.length){
return;
};
_local1 = createRiderlessSteed(ResourceLoader.k_Kite);
_local1.setMovementSpeed((0.08 + (Math.random() * 0.04)));
_local1.setCanBeCollidedByColliders();
_local1.setSoundType("Enemy");
m_gameplayEnemies.push(_local1);
_local2 = (Math.random() * getStageWidth());
_local3 = (Math.random() * getStageHeight());
_local4 = Math.random();
if (_local4 < 0.25){
_local2 = 0;
} else {
if (_local4 < 0.5){
_local3 = 0;
} else {
if (_local4 < 0.75){
_local2 = getStageWidth();
} else {
_local3 = getStageHeight();
};
};
};
_local1.x = _local2;
_local1.y = _local3;
}
function playEndMusic(){
m_game.stopLoop();
m_game.playSound("Tepper_Win");
}
function startCreatingEnemies(){
m_game.playLoop("Tepper_Play");
setupKillQuota();
m_gameHasStarted = true;
}
override function updateImpl(_arg1:Number){
if (((!(m_gameHasStarted)) || (m_gameHasEnded))){
return;
};
if (m_killQuota.getKillsRemaining() <= 0){
m_gameHasEnded = true;
m_game.removeStateListener(m_killQuota);
m_killQuota.dispose();
m_killQuota = null;
m_game.getScore().ObjectiveAchieved = true;
queueWinningEndGameEvents();
return;
};
if (m_gameplayEnemies.length < k_maximumEnemies){
m_timeUntilNextSpawn = (m_timeUntilNextSpawn - _arg1);
if (m_timeUntilNextSpawn <= 0){
m_timeUntilNextSpawn = (k_spawnDelay + (Math.random() * 1000));
spawnGameplayEnemy();
};
};
if (m_player.isDead()){
lose();
};
if (m_base.isDead()){
lose();
return;
};
updateEnemies(_arg1);
}
public function handleColliderRemoved(_arg1:Collider){
var _local2:int;
var _local3:Collider;
_local2 = 0;
while (_local2 < m_gameplayEnemies.length) {
_local3 = m_gameplayEnemies[_local2];
if (_local3 == _arg1){
m_gameplayEnemies.splice(_local2, 1);
return;
};
_local2++;
};
}
function stopUpdatingEnemies(){
m_stopUpdatingEnemies = true;
}
override function getDefaultGameDataImpl():GameInitialData{
var _local1:GameInitialData;
_local1 = new GameInitialData();
_local1.setPlayerData("Tepper", ResourceLoader.k_Rogue, ResourceLoader.k_Bat, ResourceLoader.k_Javelin);
return (_local1);
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function setupKillQuota(){
m_killQuota = new StateKillQuota(m_game, k_killLimit);
m_game.addStateListener(m_killQuota);
}
override function initializeGameImpl(){
var _local1:MovieClip;
m_initialData = m_game.getInitialData();
if (m_initialData == null){
m_initialData = getDefaultGameData();
};
m_timeUntilNextSpawn = 0;
m_swarmRotationCenterX = getStageMiddleX();
m_swarmRotationCenterY = getStageMiddleY();
m_gameHasStarted = false;
m_gameHasEnded = false;
m_gameplayEnemies = new Array();
m_stopUpdatingEnemies = false;
m_game.addStateListener(this);
m_game.playLoop("Tepper_Story");
if (!(BMStorage.getSingleton().getBoolean(UI_Options.k_effectsAreDisabled, false))){
_local1 = new Tepper1_BGMC();
_local1.cacheAsBitmap = true;
m_game.getContainer().addChildAt(_local1, 0);
};
makePlayersPath();
m_base = new ObstacleBase(m_game, null, "Treasure");
m_base.x = getStageMiddleX();
m_base.y = getStageMiddleY();
}
override function cleanupImpl(){
}
function addPlayer(){
var _local1:String;
var _local2:String;
var _local3:String;
_local1 = m_initialData.getCharacter(0);
_local2 = m_initialData.getSteed(0);
_local3 = m_initialData.getWeapon(0);
m_player = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kGreen), _local1, _local2, _local3);
m_player.setPathPosition(0);
m_player.setPath(m_playersPath);
m_player.makePathWrappable();
m_game.makeLocalPlayer(m_player);
m_base.setBaseOwner(m_player);
}
function queueWinningEndGameEvents(){
var _local1:Vector2;
var _local2:Vector2;
var _local3:Array;
var _local4:int;
var _local5:Collider;
var _local6:EVShowResults;
var _local7:Collider;
_local1 = new Vector2(m_player.x, m_player.y);
_local2 = new Vector2(700, 100);
m_game.queueGameEvent(new EVInput(m_game, false));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, stopUpdatingEnemies)));
_local3 = new Array();
_local4 = 0;
while (_local4 < 5) {
_local7 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, 0xFF0000);
_local7.setCanBeCollidedByColliders(false);
_local7.x = (500 + (_local4 * 40));
_local7.y = -100;
m_game.queueGameEvent(new EVMoveCollider(m_game, _local7, new Vector2(_local7.x, 75), false));
_local4++;
};
_local5 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, 0xFF0000);
_local5.setCanBeCollidedByColliders(false);
_local5.x = 800;
_local5.y = -100;
m_game.queueGameEvent(new EVMoveCollider(m_game, _local5, _local2, true));
queueDialogue("Darius", "You fight well, whelp.", _local2);
queueDialogue("Tepper", "Then why stop the fun? Are you tired already?", _local1);
queueDialogue("Darius", "Tongue as sharp as your blade, eh? I think we can come to an arrangement, you and I.", _local2);
queueDialogue("Tepper", "Like, you wave goodbye to me as I fly away with this treasure?", _local1);
queueDialogue("Darius", "Not quite. I represent the Scarlet Daggers. A girl of your particular skills will have heard of us, I wager that's how you found our warehouse. We are always looking for new recruits.", _local2);
queueDialogue("Tepper", "I gather my choices here are to join the Daggers or get stabbed by them.", _local1);
queueDialogue("Darius", "More or less.", _local2);
queueDialogue("Tepper", "Well, it'd be a shame to get knife holes in this new outfit.", _local1);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, playEndMusic)));
m_game.queueGameEvent(new EVDelay(m_game, 3000));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
_local6 = new EVShowResults(m_game, true);
m_game.queueGameEvent(_local6);
UI_Campaign.completeLevel(this);
}
}
}//package
Section 168
//LevelTepper2 (LevelTepper2)
package {
import flash.display.*;
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
import com.gamedozer.math.*;
import com.gamedozer.utils.*;
public class LevelTepper2 extends Level implements IStateListener {
const k_levelDesc:String = "Tepper has been taken to the secret guild halls of the Scarlet Daggers to take part in a series of trials. Though she's wary about becoming involved with them, being a part of the Daggers would provide Tepper with all the challenges she seeks. Now she faces the final test: a duel with a pair of Scarlet Daggers.";
const k_levelTitle:String = "Trial";
var m_enemyPath1:Path;
var m_scarletColor:uint;// = 0xFF0000
var m_enemyPath2:Path;
var m_playersPath:Path;
var m_gameHasStarted:Boolean;
var k_startingEnemy1Location:Vector2;
var k_startingEnemy2Location:Vector2;
var m_initialData:GameInitialData;
var k_startingPlayerLocation:Vector2;
var m_enemy1:Player;
var m_enemy2:Player;
var m_gameHasEnded:Boolean;
var m_player:Player;
public function LevelTepper2(){
m_scarletColor = 0xFF0000;
super(k_levelTitle, LevelList.k_campaignMode, 120);
setCampaignData(2, 2, k_levelDesc);
}
function queueDialogue(_arg1:String, _arg2:String, _arg3:Vector2=null){
var _local4:String;
var _local5:uint;
var _local6:uint;
_local4 = "Tepper";
if (_arg1 != "Tepper"){
_local4 = "Scarlet";
};
_local5 = 0x804000;
if (_arg1 == "Tepper"){
_local5 = 0x804000;
};
if (_arg1 == "Darius"){
_local5 = 0x242424;
};
_local6 = 0xFF00;
if (_arg1 == "Tepper"){
_local6 = 0xFF00;
};
if (_arg1 == "Darius"){
_local6 = 0xFF0000;
};
m_game.queueGameEvent(new EVDialogue(m_game, _local4, _local6, _local5, _arg1, _arg2, (_arg1 == "Tepper"), _arg3));
}
public function handleUpdate(_arg1:Number){
}
function lose(){
var _local1:EVShowResults;
m_gameHasEnded = true;
m_game.queueGameEvent(new EVInput(m_game, false));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
queueDialogue("Tepper", "Doesn't look like we're good enough to join the Daggers, Wendue.", null);
_local1 = new EVShowResults(m_game, false);
m_game.queueGameEvent(_local1);
}
public function dispose(){
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
override function populateGameImpl(){
var _local1:Vector2;
var _local2:Collider;
var _local3:Collider;
var _local4:Collider;
var _local5:Collider;
k_startingPlayerLocation = new Vector2(100, 500);
k_startingEnemy1Location = new Vector2(250, 100);
k_startingEnemy2Location = new Vector2(200, 150);
_local1 = new Vector2(700, 100);
m_game.queueGameEvent(new EVInput(m_game, false));
_local2 = createSteedAndRider(ResourceLoader.k_Bat, ResourceLoader.k_Rogue, 0xFF00);
_local2.setCanBeCollidedByColliders(false);
_local2.x = k_startingPlayerLocation.x;
_local2.y = k_startingPlayerLocation.y;
_local3 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local3.setCanBeCollidedByColliders(false);
_local3.setFacingDirection(0, 1);
_local3.x = k_startingEnemy1Location.x;
_local3.y = k_startingEnemy1Location.y;
_local4 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local4.setCanBeCollidedByColliders(false);
_local4.setFacingDirection(0, 1);
_local4.x = k_startingEnemy2Location.x;
_local4.y = k_startingEnemy2Location.y;
_local5 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local5.setCanBeCollidedByColliders(false);
_local5.setFacingDirection(0, 1);
_local5.x = _local1.x;
_local5.y = _local1.y;
queueDialogue("Darius", "Are you ready?", _local1);
queueDialogue("Tepper", "Am I fighting you?", k_startingPlayerLocation);
queueDialogue("Darius", "I'm just here to observe the final test. I introduced you to the Daggers, and if you turn out to not be worthy, I'll throw you out with the rest of the trash.", _local1);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local5, new Vector2(900, _local1.y), true));
m_game.queueGameEvent(new EVFadeDisplayObject(m_game, new LevelHintMC("Defeat the two Scarlet Daggers."), 3000));
m_game.queueGameEvent(new EVKillCollider(m_game, _local2));
m_game.queueGameEvent(new EVKillCollider(m_game, _local3));
m_game.queueGameEvent(new EVKillCollider(m_game, _local4));
m_game.queueGameEvent(new EVKillCollider(m_game, _local5));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, startGame)));
m_game.queueGameEvent(new EVInput(m_game, true));
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
function playEndMusic(){
m_game.stopLoop();
m_game.playSound("Tepper_Win");
}
function startGame(){
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:AIBrain;
var _local5:AIBrain;
m_game.playLoop("Tepper_Play");
m_gameHasStarted = true;
_local1 = m_initialData.getSteed(0);
_local2 = m_initialData.getCharacter(0);
_local3 = m_initialData.getWeapon(0);
m_player = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kGreen), _local2, _local1, _local3);
m_player.setPath(m_playersPath);
m_game.makeLocalPlayer(m_player);
m_enemy1 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Kite, ResourceLoader.k_Javelin);
m_enemy1.setPath(m_enemyPath1);
m_enemy1.setPathPosition(0.5);
_local4 = new AIBrain(m_game, m_enemy1, 0.2);
m_enemy2 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Kite, ResourceLoader.k_Javelin);
m_enemy2.setPath(m_enemyPath2);
m_enemy2.setPathPosition(0.5);
_local5 = new AIBrain(m_game, m_enemy2, 0.2);
_local4.addAlly(m_enemy2);
_local5.addAlly(m_enemy1);
}
override function updateImpl(_arg1:Number){
if (((!(m_gameHasStarted)) || (m_gameHasEnded))){
return;
};
if (((m_enemy1.isDead()) && (m_enemy2.isDead()))){
queueWinningEndGameEvents();
};
if (m_player.isDead()){
lose();
return;
};
}
public function handleColliderRemoved(_arg1:Collider){
}
function makePaths(){
m_playersPath = new Path();
m_playersPath.moveTo(100, 500);
m_playersPath.lineTo(700, 500);
m_game.drawPath(m_playersPath, DynamicColor.getRGB(Colorizer.kGreen));
m_enemyPath1 = new Path();
m_enemyPath1.moveTo(250, 100);
m_enemyPath1.lineTo(550, 100);
m_game.drawPath(m_enemyPath1, DynamicColor.getRGB(Colorizer.kRed));
m_enemyPath2 = new Path();
m_enemyPath2.moveTo(200, 150);
m_enemyPath2.lineTo(600, 150);
m_game.drawPath(m_enemyPath2, DynamicColor.getRGB(Colorizer.kRed));
}
override function getDefaultGameDataImpl():GameInitialData{
var _local1:GameInitialData;
_local1 = new GameInitialData();
_local1.setPlayerData("Tepper", ResourceLoader.k_Rogue, ResourceLoader.k_Bat, ResourceLoader.k_Javelin);
return (_local1);
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function queueWinningEndGameEvents(){
var _local1:Collider;
var _local2:Number;
var _local3:Vector2;
var _local4:EVShowResults;
m_gameHasEnded = true;
m_game.getScore().ObjectiveAchieved = true;
m_game.queueGameEvent(new EVInput(m_game, false));
_local1 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local1.setCanBeCollidedByColliders(false);
_local1.x = 900;
_local1.y = 100;
_local2 = 700;
_local3 = new Vector2(_local2, _local1.y);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local1, new Vector2(_local2, _local3.y), true));
queueDialogue("Darius", "Well fought, Tepper.", _local3);
queueDialogue("Tepper", "Piece of cake. Am I in now? Is that finally it?", new Vector2(m_player.x, m_player.y));
queueDialogue("Darius", "You're in. Welcome to the Scarlet Daggers.", _local3);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, playEndMusic)));
m_game.queueGameEvent(new EVDelay(m_game, 3000));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
_local4 = new EVShowResults(m_game, true);
m_game.queueGameEvent(_local4);
UI_Campaign.completeLevel(this);
}
override function initializeGameImpl(){
var _local1:Score;
var _local2:MovieClip;
m_initialData = m_game.getInitialData();
if (m_initialData == null){
m_initialData = getDefaultGameData();
};
m_gameHasStarted = false;
m_gameHasEnded = false;
m_game.addStateListener(this);
m_game.playLoop("Tepper_Story");
if (!(BMStorage.getSingleton().getBoolean(UI_Options.k_effectsAreDisabled, false))){
_local2 = new Tepper2_BGMC();
_local2.cacheAsBitmap = true;
m_game.getContainer().addChildAt(_local2, 0);
};
_local1 = m_game.getScore();
_local1.ObjectiveAchievedMultiplier = 6500;
makePaths();
}
override function cleanupImpl(){
}
}
}//package
Section 169
//LevelTepper3 (LevelTepper3)
package {
import flash.display.*;
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
import com.gamedozer.math.*;
import com.gamedozer.utils.*;
public class LevelTepper3 extends Level implements IStateListener {
const k_levelDesc:String = "A rising star in the guild, Tepper is quickly made part of their most crucial operations. It's in this fashion that she learns of an on going war with a rival thieves guild, the Obsidian Fist. The Dagger leaders are focusing all their efforts on this conflict, causing many of the members to turn to petty thievery to keep themselves entertained.";
const k_levelTitle:String = "Pity The Fool";
var m_scarletColor:uint;// = 0xFF0000
var m_playersPath:Path;
var m_gameHasStarted:Boolean;
var m_enemy:Player;
var m_allyPath1:Path;
var m_allyPath2:Path;
var m_initialData:GameInitialData;
var m_enemyPath:Path;
var m_gameHasEnded:Boolean;
var m_ally2:Player;
var m_player:Player;
var m_ally1:Player;
public function LevelTepper3(){
m_scarletColor = 0xFF0000;
super(k_levelTitle, LevelList.k_campaignMode, 130);
setCampaignData(2, 3, k_levelDesc);
}
function queueDialogue(_arg1:String, _arg2:String, _arg3:Vector2=null){
var _local4:String;
var _local5:uint;
var _local6:uint;
_local4 = "Tepper";
if (_arg1 != "Tepper"){
_local4 = "Scarlet";
};
_local5 = 0x804000;
if (_arg1 == "Tepper"){
_local5 = 0x804000;
};
if (_arg1 == "Darius"){
_local5 = 0x242424;
};
_local6 = 0xFF00;
if (_arg1 == "Tepper"){
_local6 = 0xFF00;
};
if (_arg1 == "Darius"){
_local6 = 0xFF0000;
};
m_game.queueGameEvent(new EVDialogue(m_game, _local4, _local6, _local5, _arg1, _arg2, (_arg1 == "Tepper"), _arg3));
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
function lose(){
var _local1:EVShowResults;
m_gameHasEnded = true;
m_game.queueGameEvent(new EVInput(m_game, false));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
queueDialogue("Tepper", "That wizard turned out to be more than we could handle.", null);
_local1 = new EVShowResults(m_game, false);
m_game.queueGameEvent(_local1);
}
public function handleUpdate(_arg1:Number){
}
public function dispose(){
}
override function populateGameImpl(){
var _local1:Vector2;
var _local2:Vector2;
var _local3:Vector2;
var _local4:Vector2;
var _local5:Vector2;
var _local6:Collider;
var _local7:Collider;
var _local8:Collider;
var _local9:Collider;
var _local10:Collider;
_local1 = new Vector2(75, 75);
_local2 = new Vector2(405, 25);
_local3 = new Vector2(700, 310);
_local4 = new Vector2(700, 100);
_local5 = new Vector2(550, 300);
m_game.queueGameEvent(new EVInput(m_game, false));
_local6 = createSteedAndRider(ResourceLoader.k_Bat, ResourceLoader.k_Rogue, 0xFF00);
_local6.setCanBeCollidedByColliders(false);
_local6.setFacingDirection(0, 1);
_local6.x = _local1.x;
_local6.y = _local1.y;
_local7 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local7.setCanBeCollidedByColliders(false);
_local7.setFacingDirection(0, 1);
_local7.x = _local2.x;
_local7.y = _local2.y;
_local8 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local8.setCanBeCollidedByColliders(false);
_local8.setFacingDirection(0, 1);
_local8.x = _local3.x;
_local8.y = _local3.y;
_local9 = createSteedAndRider(ResourceLoader.k_Pegasus, ResourceLoader.k_Mage, 0xFF);
_local9.setCanBeCollidedByColliders(false);
_local9.setFacingDirection(0, 1);
_local9.x = _local5.x;
_local9.y = _local5.y;
_local10 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local10.setCanBeCollidedByColliders(false);
_local10.setFacingDirection(0, 1);
_local10.x = _local4.x;
_local10.y = _local4.y;
queueDialogue("Tepper", "Why are we stopping? The Fist guildhall is miles from here.", _local1);
queueDialogue("Darius", "The old man down there...", _local4);
queueDialogue("Tepper", "Yeah, he's wrinkly. What about him?", _local1);
queueDialogue("Darius", "He's old and weak and riding a very valuable pegasus.", _local4);
queueDialogue("Tepper", "Please. Stealing from a defenseless old man? There's no challenge there for someone like you.", _local1);
queueDialogue("Darius", "Which is why I'm going to make my lackies do it. Shar, kill him.", _local4);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, createBlast, _local5, _local9)));
m_game.queueGameEvent(new EVDelay(m_game, 200));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, createBlast, _local5, _local9)));
queueDialogue("Darius", "A wizard! Defend yourselves!", _local4);
queueDialogue("Tepper", "Real smooth, guys. Don't worry, I'll save you, as usual.", _local1);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local10, new Vector2(900, _local4.y), true));
m_game.queueGameEvent(new EVFadeDisplayObject(m_game, new LevelHintMC("Help the Daggers defeat the Wizard."), 3000));
m_game.queueGameEvent(new EVKillCollider(m_game, _local6));
m_game.queueGameEvent(new EVKillCollider(m_game, _local7));
m_game.queueGameEvent(new EVKillCollider(m_game, _local8));
m_game.queueGameEvent(new EVKillCollider(m_game, _local10));
m_game.queueGameEvent(new EVKillCollider(m_game, _local9));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, startGame)));
m_game.queueGameEvent(new EVInput(m_game, true));
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
function createBlast(_arg1:Vector2, _arg2:Collider){
var _local3:int;
var _local4:Collider;
m_game.playSound("MaleAttack");
_arg2.setFacingDirection(0, -1);
_local3 = 0;
while (_local3 < 5) {
_local4 = createWeapon(0xFF, ResourceLoader.k_Blast);
_local4.x = _arg1.x;
_local4.y = _arg1.y;
_local4.setMovementSpeed(0.2);
_local4.setMovementDirection((-0.2 + (_local3 * 0.1)), -1);
_local3++;
};
}
function playEndMusic(){
m_game.stopLoop();
m_game.playSound("Tepper_Win");
}
function startGame(){
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:AIBrain;
var _local5:AIBrain;
var _local6:AIBrain;
m_game.playLoop("Tepper_Play");
m_gameHasStarted = true;
_local1 = m_initialData.getSteed(0);
_local2 = m_initialData.getCharacter(0);
_local3 = m_initialData.getWeapon(0);
m_player = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kGreen), _local2, _local1, _local3);
m_player.setPath(m_playersPath);
m_game.makeLocalPlayer(m_player);
m_enemy = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue), ResourceLoader.k_Mage, ResourceLoader.k_Pegasus, ResourceLoader.k_Blast);
m_enemy.setPath(m_enemyPath);
m_enemy.setPathPosition(0.5);
m_enemy.makePathWrappable();
m_enemy.setMaximumHitpoints(400);
m_enemy.addProjectileSpeedBonus(0.2);
_local4 = new AIBrain(m_game, m_enemy, 0.6);
m_ally1 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Kite, ResourceLoader.k_Javelin);
m_ally1.setPath(m_allyPath1);
m_ally1.setPathPosition(0.5);
_local5 = new AIBrain(m_game, m_ally1, 0.1);
m_ally2 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Kite, ResourceLoader.k_Javelin);
m_ally2.setPath(m_allyPath2);
m_ally2.setPathPosition(0.75);
_local6 = new AIBrain(m_game, m_ally2, 0.1);
_local5.addAlly(m_player);
_local5.addAlly(m_ally2);
_local6.addAlly(m_player);
_local6.addAlly(m_ally1);
m_player.addAlly(m_ally1);
m_player.addAlly(m_ally2);
}
override function updateImpl(_arg1:Number){
if (((!(m_gameHasStarted)) || (m_gameHasEnded))){
return;
};
if (m_enemy.isDead()){
queueWinningEndGameEvents();
return;
};
if (m_player.isDead()){
lose();
return;
};
}
public function handleColliderRemoved(_arg1:Collider){
}
function makePaths(){
var _local1:Number;
var _local2:Number;
_local1 = 400;
_local2 = getStageMiddleY();
m_playersPath = new Path();
m_playersPath.moveTo(75, 75);
m_playersPath.lineTo(75, 525);
m_game.drawPath(m_playersPath, DynamicColor.getRGB(Colorizer.kGreen));
m_enemyPath = new Path();
tempPathCicle(m_enemyPath, 150, _local1, _local2);
m_game.drawPath(m_enemyPath, DynamicColor.getRGB(Colorizer.kBlue));
m_allyPath1 = new Path();
plotCircleSegment(m_allyPath1, (_local1 + 25), _local2, 275, -90, -5, 20);
m_game.drawPath(m_allyPath1, DynamicColor.getRGB(Colorizer.kRed));
m_allyPath2 = new Path();
plotCircleSegment(m_allyPath2, (_local1 + 25), _local2, 275, 5, 90, 20);
m_game.drawPath(m_allyPath2, DynamicColor.getRGB(Colorizer.kRed));
}
override function getDefaultGameDataImpl():GameInitialData{
var _local1:GameInitialData;
_local1 = new GameInitialData();
_local1.setPlayerData("Tepper", ResourceLoader.k_Rogue, ResourceLoader.k_Bat, ResourceLoader.k_Javelin);
return (_local1);
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function queueWinningEndGameEvents(){
var _local1:Collider;
var _local2:Number;
var _local3:Vector2;
var _local4:Vector2;
var _local5:EVShowResults;
m_gameHasEnded = true;
m_game.getScore().ObjectiveAchieved = true;
m_game.queueGameEvent(new EVInput(m_game, false));
_local1 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local1.setCanBeCollidedByColliders(false);
_local1.x = 900;
_local1.y = 100;
_local2 = 700;
_local3 = new Vector2(700, 100);
m_game.queueGameEvent(new EVMoveCollider(m_game, _local1, new Vector2(_local2, _local3.y), true));
_local4 = new Vector2(m_player.x, m_player.y);
queueDialogue("Tepper", "Attacking an old man? I thought the Daggers were better than this, that they did it all for the glory and the challenge.", _local4);
queueDialogue("Darius", "That crazy old fool was a wizard. He wasn't just an old man.", _local3);
queueDialogue("Tepper", "You didn't know that, and you almost got us killed! I'm out of here.", _local4);
queueDialogue("Darius", "You can't just leave the Scarlet Daggers, whelp.", _local3);
queueDialogue("Tepper", "Watch carefully. I'll show you how it's done.", _local4);
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, playEndMusic)));
m_game.queueGameEvent(new EVDelay(m_game, 3000));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
_local5 = new EVShowResults(m_game, true);
m_game.queueGameEvent(_local5);
UI_Campaign.completeLevel(this);
}
override function initializeGameImpl(){
var _local1:Score;
var _local2:MovieClip;
m_initialData = m_game.getInitialData();
if (m_initialData == null){
m_initialData = getDefaultGameData();
};
m_gameHasStarted = false;
m_gameHasEnded = false;
m_game.addStateListener(this);
m_game.playLoop("Tepper_Story");
if (!(BMStorage.getSingleton().getBoolean(UI_Options.k_effectsAreDisabled, false))){
_local2 = new Tepper3_BGMC();
_local2.cacheAsBitmap = true;
m_game.getContainer().addChildAt(_local2, 0);
};
_local1 = m_game.getScore();
_local1.ObjectiveAchievedMultiplier = 7500;
makePaths();
}
override function cleanupImpl(){
}
}
}//package
Section 170
//LevelTepper4 (LevelTepper4)
package {
import flash.display.*;
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
import com.gamedozer.math.*;
import com.gamedozer.utils.*;
public class LevelTepper4 extends Level implements IStateListener {
const k_levelDesc:String = "A game of cat and mouse: The Daggers send their best after Tepper, who spends her time frustrating them. When she tires of the chase, Tepper decides to ransom treasure taken from a Dagger storehouse. Finding it proves simple for Tepper, who can track the Daggers just as well as they can track her. Now it's just a matter of getting inside.";
const k_levelTitle:String = "Gatekeepers";
var m_enemyPath1:Path;
var m_scarletColor:uint;// = 0xFF0000
var m_enemyPath2:Path;
var m_playersPath:Path;
var m_gameHasStarted:Boolean;
var m_initialData:GameInitialData;
var m_turret1:ObstacleManualTurret;
var m_turret2:ObstacleManualTurret;
var m_enemy1:Player;
var m_enemy2:Player;
var m_gameHasEnded:Boolean;
var m_player:Player;
public function LevelTepper4(){
m_scarletColor = 0xFF0000;
super(k_levelTitle, LevelList.k_campaignMode, 140);
setCampaignData(2, 4, k_levelDesc);
}
function queueDialogue(_arg1:String, _arg2:String, _arg3:Vector2=null){
var _local4:String;
var _local5:uint;
var _local6:uint;
_local4 = "Tepper";
if (_arg1 != "Tepper"){
_local4 = "Scarlet";
};
_local5 = 0x804000;
if (_arg1 == "Tepper"){
_local5 = 0x804000;
};
if (_arg1 == "Guard"){
_local5 = 0x242424;
};
_local6 = 0xFF00;
if (_arg1 == "Tepper"){
_local6 = 0xFF00;
};
if (_arg1 == "Guard"){
_local6 = 0xFF0000;
};
m_game.queueGameEvent(new EVDialogue(m_game, _local4, _local6, _local5, _arg1, _arg2, (_arg1 == "Tepper"), _arg3));
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
function lose(){
var _local1:EVShowResults;
m_gameHasEnded = true;
m_game.queueGameEvent(new EVInput(m_game, false));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
queueDialogue("Tepper", "I guess we'll have to find another way to get the Daggers off our back.", null);
_local1 = new EVShowResults(m_game, false);
m_game.queueGameEvent(_local1);
}
public function handleUpdate(_arg1:Number){
}
public function dispose(){
}
override function populateGameImpl(){
var _local1:Vector2;
var _local2:Vector2;
var _local3:Vector2;
var _local4:Collider;
var _local5:Collider;
var _local6:Collider;
_local1 = new Vector2(100, 500);
_local2 = new Vector2(500, 25);
_local3 = new Vector2(25, 300);
m_game.queueGameEvent(new EVInput(m_game, false));
_local4 = createSteedAndRider(ResourceLoader.k_Bat, ResourceLoader.k_Rogue, 0xFF00);
_local4.setCanBeCollidedByColliders(false);
_local4.setFacingDirection(0, 1);
_local4.x = _local1.x;
_local4.y = _local1.y;
_local5 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local5.setCanBeCollidedByColliders(false);
_local5.setFacingDirection(0, 1);
_local5.x = _local2.x;
_local5.y = _local2.y;
_local6 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local6.setCanBeCollidedByColliders(false);
_local6.setFacingDirection(0, 1);
_local6.x = _local3.x;
_local6.y = _local3.y;
queueDialogue("Tepper", "Turrets, Wendue! If we're fast enough, we can strike them and turn them against the guards.", _local1);
queueDialogue("Guard", "Halt! What's the password?", _local3);
queueDialogue("Tepper", "Ooh. Is it: 'Out of my way or I'll slap you so hard your children will feel it'?", _local1);
queueDialogue("Guard", "Intruder! Open fire!", _local3);
queueDialogue("Tepper", "Was that not it?", _local1);
m_game.queueGameEvent(new EVFadeDisplayObject(m_game, new LevelHintMC("Capture the turrets. Use them to destroy the guards."), 3000));
m_game.queueGameEvent(new EVKillCollider(m_game, _local4));
m_game.queueGameEvent(new EVKillCollider(m_game, _local5));
m_game.queueGameEvent(new EVKillCollider(m_game, _local6));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, startGame)));
m_game.queueGameEvent(new EVInput(m_game, true));
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
function playEndMusic(){
m_game.stopLoop();
m_game.playSound("Tepper_Win");
}
function startGame(){
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:AIBrain;
var _local5:AIBrain;
m_game.playLoop("Tepper_Play");
m_gameHasStarted = true;
_local1 = m_initialData.getSteed(0);
_local2 = m_initialData.getCharacter(0);
_local3 = m_initialData.getWeapon(0);
m_player = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kGreen), _local2, _local1, _local3);
m_player.setPath(m_playersPath);
m_game.makeLocalPlayer(m_player);
m_enemy1 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Kite, ResourceLoader.k_Javelin);
m_enemy1.setPath(m_enemyPath1);
m_enemy1.setPathPosition(0.5);
_local4 = new AIBrain(m_game, m_enemy1, 0.6);
m_turret2.makeOwner(m_enemy1);
m_enemy2 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Kite, ResourceLoader.k_Javelin);
m_enemy2.setPath(m_enemyPath2);
m_enemy2.setPathPosition(0.5);
_local5 = new AIBrain(m_game, m_enemy2, 0.6);
m_turret1.makeOwner(m_enemy2);
_local4.addAlly(m_enemy2);
_local5.addAlly(m_enemy1);
}
function createFakeTepperForEndSequence(){
var _local1:String;
var _local2:Collider;
var _local3:GSteed;
var _local4:uint;
var _local5:GRider;
var _local6:String;
var _local7:Vector2;
m_player.visible = false;
_local1 = m_initialData.getSteed(0);
_local2 = createRiderlessSteed(_local1);
_local3 = (_local2.getDisplayObject() as GSteed);
_local4 = 0xFF;
_local5 = new GRider(_local4);
_local6 = m_initialData.getCharacter(0);
_local5.load(_local6);
_local3.insertRider(_local5);
_local2.x = m_player.x;
_local2.y = m_player.y;
_local7 = new Vector2((400 - _local2.x), (0 - _local2.y));
_local2.setMovementDirection(_local7.x, _local7.y);
}
override function updateImpl(_arg1:Number){
if (((!(m_gameHasStarted)) || (m_gameHasEnded))){
return;
};
if (((m_enemy1.isDead()) && (m_enemy2.isDead()))){
queueWinningEndGameEvents();
return;
};
if (m_player.isDead()){
lose();
return;
};
}
public function handleColliderRemoved(_arg1:Collider){
}
function makePaths(){
var _local1:Number;
var _local2:Number;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
m_playersPath = new Path();
m_playersPath.moveTo(100, 500);
m_playersPath.lineTo(700, 500);
m_game.drawPath(m_playersPath, DynamicColor.getRGB(Colorizer.kGreen));
m_enemyPath1 = new Path();
plotCircleSegment(m_enemyPath1, (_local1 + 100), _local2, 275, -90, -5, 20);
m_game.drawPath(m_enemyPath1, DynamicColor.getRGB(Colorizer.kRed));
m_enemyPath2 = new Path();
plotCircleSegment(m_enemyPath2, (_local1 - 100), _local2, 275, -175, -90, 20);
m_game.drawPath(m_enemyPath2, DynamicColor.getRGB(Colorizer.kRed));
}
override function getDefaultGameDataImpl():GameInitialData{
var _local1:GameInitialData;
_local1 = new GameInitialData();
_local1.setPlayerData("Tepper", ResourceLoader.k_Rogue, ResourceLoader.k_Bat, ResourceLoader.k_Javelin);
return (_local1);
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function queueWinningEndGameEvents(){
var _local1:EVShowResults;
m_gameHasEnded = true;
m_game.getScore().ObjectiveAchieved = true;
m_game.queueGameEvent(new EVInput(m_game, false));
queueDialogue("Tepper", "Piece of cake. This way to unimaginable wealth, Wendue!", new Vector2(m_player.x, m_player.y));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, createFakeTepperForEndSequence)));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, playEndMusic)));
m_game.queueGameEvent(new EVDelay(m_game, 3000));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
_local1 = new EVShowResults(m_game, true);
m_game.queueGameEvent(_local1);
UI_Campaign.completeLevel(this);
}
override function initializeGameImpl(){
var _local1:Score;
var _local2:MovieClip;
m_initialData = m_game.getInitialData();
if (m_initialData == null){
m_initialData = getDefaultGameData();
};
m_gameHasStarted = false;
m_gameHasEnded = false;
m_game.addStateListener(this);
m_game.playLoop("Tepper_Story");
if (!(BMStorage.getSingleton().getBoolean(UI_Options.k_effectsAreDisabled, false))){
_local2 = new Tepper4_BGMC();
_local2.cacheAsBitmap = true;
m_game.getContainer().addChildAt(_local2, 0);
};
_local1 = m_game.getScore();
_local1.ObjectiveAchievedMultiplier = 10000;
makePaths();
m_turret1 = new ObstacleManualTurret(m_game);
m_turret1.x = 275;
m_turret1.y = 180;
m_turret2 = new ObstacleManualTurret(m_game);
m_turret2.x = (800 - 275);
m_turret2.y = 180;
}
override function cleanupImpl(){
}
}
}//package
Section 171
//LevelTepper5 (LevelTepper5)
package {
import flash.display.*;
import flash.events.*;
import com.gamedozer.utils.*;
import flash.utils.*;
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
import com.gamedozer.math.*;
import flash.media.*;
public class LevelTepper5 extends Level implements IStateListener {
const k_levelDesc:String = "After stealing her fill, Tepper finds an old map hidden in a corner of the storehouse. She snags the map, figuring it will lead to a nice prize, and escapes. Following the map, Tepper finds an ancient temple containing a single shrine with a large stone key atop it. She pockets the key but when she turns to leave, she finds her old friends waiting for her.";
const k_levelTitle:String = "A Rohk And A Hard Place";
var m_enemyPath1:Path;
var m_scarletColor:uint;// = 0xFF0000
var m_enemyPath2:Path;
var m_playersPath:Path;
var m_gameHasStarted:Boolean;
var m_initialData:GameInitialData;
var m_rohkActivated:Boolean;
var m_obelisks:Array;
var m_rohk:ObstacleMoveableTurret;
var m_portalAnimation:TileSheetAnimation;
var m_enemy1:Player;
var m_enemy2:Player;
var m_gameHasEnded:Boolean;
var m_player:Player;
var m_timer:Timer;
public function LevelTepper5(){
m_scarletColor = 0xFF0000;
super(k_levelTitle, LevelList.k_campaignMode, 150);
setCampaignData(2, 5, k_levelDesc);
}
function queueDialogue(_arg1:String, _arg2:String, _arg3:Vector2=null){
var _local4:String;
var _local5:uint;
var _local6:uint;
_local4 = "Tepper";
if (_arg1 != "Tepper"){
_local4 = "Scarlet";
};
_local5 = 0x804000;
if (_arg1 == "Tepper"){
_local5 = 0x804000;
};
if (_arg1 == "Darius"){
_local5 = 0x242424;
};
_local6 = 0xFF00;
if (_arg1 == "Tepper"){
_local6 = 0xFF00;
};
if (_arg1 == "Darius"){
_local6 = 0xFF0000;
};
m_game.queueGameEvent(new EVDialogue(m_game, _local4, _local6, _local5, _arg1, _arg2, (_arg1 == "Tepper"), _arg3));
}
public function handleUpdate(_arg1:Number){
}
function lose(){
var _local1:EVShowResults;
m_gameHasEnded = true;
if (m_rohk != null){
m_rohk.getDisplay().getAnimation().pause();
};
m_game.queueGameEvent(new EVInput(m_game, false));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
queueDialogue("Tepper", "Maybe we bit off more than we could chew, Wendue.", null);
_local1 = new EVShowResults(m_game, false);
m_game.queueGameEvent(_local1);
}
function updateAnimations(_arg1:Event){
if (m_portalAnimation != null){
m_portalAnimation.update(100);
};
}
public function dispose(){
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
function loopPortal(){
m_portalAnimation.onComplete(null);
m_portalAnimation.playAnimation("loop");
queueWinningEndGameEvents();
}
override function populateGameImpl(){
var _local1:Vector2;
var _local2:Vector2;
var _local3:Vector2;
var _local4:Collider;
var _local5:Collider;
var _local6:Collider;
var _local7:Vector2;
_local1 = new Vector2(200, 300);
_local2 = new Vector2(500, 25);
_local3 = new Vector2(300, 575);
m_game.queueGameEvent(new EVInput(m_game, false));
_local4 = createSteedAndRider(ResourceLoader.k_Bat, ResourceLoader.k_Rogue, 0xFF00);
_local4.setCanBeCollidedByColliders(false);
_local4.setFacingDirection(0, 1);
_local4.x = _local1.x;
_local4.y = _local1.y;
_local5 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local5.setCanBeCollidedByColliders(false);
_local5.setFacingDirection(0, 1);
_local5.x = _local2.x;
_local5.y = _local2.y;
_local6 = createSteedAndRider(ResourceLoader.k_Kite, ResourceLoader.k_Scarlet, m_scarletColor);
_local6.setCanBeCollidedByColliders(false);
_local6.setFacingDirection(0, 1);
_local6.x = _local3.x;
_local6.y = _local3.y;
_local7 = _local2.clone();
_local7.y = (_local7.y + 50);
queueDialogue("Darius", "You think we wouldn't notice you'd taken the map, whelp?", _local7);
queueDialogue("Tepper", "I was actually fairly certain you wouldn't notice. You are always one step behind me, aren't you?", _local1);
queueDialogue("Darius", "No escape for you this time. Didn't you consider there was a reason we left this particular treasure alone? Even if you best us, there's no way past the guardian. ", _local7);
queueDialogue("Tepper", "There's always a way out, the only difference is how hard it is to find it.", _local1);
m_game.queueGameEvent(new EVFadeDisplayObject(m_game, new LevelHintMC("Defeat Darius and Shar."), 3000));
m_game.queueGameEvent(new EVKillCollider(m_game, _local4));
m_game.queueGameEvent(new EVKillCollider(m_game, _local5));
m_game.queueGameEvent(new EVKillCollider(m_game, _local6));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, startGame)));
m_game.queueGameEvent(new EVInput(m_game, true));
}
function playRohkWalk(){
m_game.playSound("RohkWalk");
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
function openPortal(){
m_portalAnimation = ResourceLoader.createTileSheetAnimation("portal", ResourceLoader.getBitmapData("Portal"));
m_portalAnimation.playAnimation("open");
m_portalAnimation.onComplete(Delegate.create(this, loopPortal));
m_game.getContainer().addChild(m_portalAnimation);
m_portalAnimation.x = 400;
m_portalAnimation.y = 300;
m_portalAnimation.alpha = 0.6;
m_timer = new Timer(100);
m_timer.addEventListener(TimerEvent.TIMER, updateAnimations);
m_timer.start();
}
function playEndMusic(){
m_game.stopLoop();
m_game.playSound("Tepper_Win");
}
function startGame(){
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:AIBrain;
var _local5:AIBrain;
m_game.playLoop("Tepper_Play");
m_gameHasStarted = true;
_local1 = m_initialData.getSteed(0);
_local2 = m_initialData.getCharacter(0);
_local3 = m_initialData.getWeapon(0);
m_player = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kGreen), _local2, _local1, _local3);
m_player.setPath(m_playersPath);
m_game.makeLocalPlayer(m_player);
m_enemy1 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Kite, ResourceLoader.k_Javelin);
m_enemy1.setPath(m_enemyPath1);
m_enemy1.setPathPosition(0.5);
_local4 = new AIBrain(m_game, m_enemy1, 0.8);
m_enemy2 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kRed), ResourceLoader.k_Scarlet, ResourceLoader.k_Kite, ResourceLoader.k_Javelin);
m_enemy2.setPath(m_enemyPath2);
m_enemy2.setPathPosition(0.5);
_local5 = new AIBrain(m_game, m_enemy2, 0.8);
_local4.addAlly(m_enemy2);
_local5.addAlly(m_enemy1);
}
function createFakeTepperForEndSequence(){
var _local1:String;
var _local2:Collider;
var _local3:GSteed;
var _local4:uint;
var _local5:GRider;
var _local6:String;
m_player.visible = false;
_local1 = m_initialData.getSteed(0);
_local2 = createRiderlessSteed(_local1);
_local3 = (_local2.getDisplayObject() as GSteed);
_local4 = 0xFF;
_local5 = new GRider(_local4);
_local6 = m_initialData.getCharacter(0);
_local5.load(_local6);
_local3.insertRider(_local5);
_local2.x = m_player.x;
_local2.y = m_player.y;
m_game.queueGameEvent(new EVMoveCollider(m_game, _local2, new Vector2(400, 300), true));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, finish)));
m_game.queueGameEvent(new EVKillCollider(m_game, _local2));
}
override function updateImpl(_arg1:Number){
var _local2:Boolean;
var _local3:int;
var _local4:ObstacleFodder;
if (((!(m_gameHasStarted)) || (m_gameHasEnded))){
return;
};
if (((((!(m_rohkActivated)) && (m_enemy1.isDead()))) && (m_enemy2.isDead()))){
activateRohk();
return;
};
_local2 = true;
_local3 = 0;
while (_local3 < m_obelisks.length) {
_local4 = m_obelisks[_local3];
if (!(_local4.isDead())){
_local2 = false;
};
_local3++;
};
if (_local2){
openPortal();
return;
};
if (m_player.isDead()){
lose();
return;
};
}
public function handleColliderRemoved(_arg1:Collider){
}
function activateRohk(){
var _local1:int;
var _local2:TileSheetAnimation;
var _local3:Vector2;
var _local4:ObstacleFodder;
var _local5:GObstacle;
if (m_rohkActivated){
return;
};
m_rohkActivated = true;
_local1 = 0;
while (_local1 < m_obelisks.length) {
_local4 = m_obelisks[_local1];
_local4.setInvulnerable(false);
_local5 = _local4.getDisplay();
_local2 = _local5.getAnimation();
_local2.disableLooping();
_local1++;
};
m_rohk = new ObstacleMoveableTurret(m_game);
m_rohk.makeAngryEvenWhenTethered();
m_rohk.x = 400;
m_rohk.y = -50;
m_rohk.setAnchorPoint(400, 250);
_local2 = m_rohk.getDisplay().getAnimation();
_local2.onComplete(playRohkWalk);
playRohkWalk();
m_game.queueGameEvent(new EVInput(m_game, false));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
_local3 = new Vector2(m_player.x, m_player.y);
queueDialogue("Tepper", "Oh, nuts, a Rohk beast. We'll only be able to slow him if we hit him, Wendue.", _local3);
queueDialogue("Tepper", "We've got to be able to find another way out of here.", _local3);
m_game.queueGameEvent(new EVFadeDisplayObject(m_game, new LevelHintMC("Avoid the Rohk attacks while searching for an exit."), 3000));
m_game.queueGameEvent(new EVInput(m_game, true));
m_game.queueGameEvent(new EVPauseGame(m_game, false));
}
function finish(){
var _local1:ComingSoon;
var _local2:EVShowResults;
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, playEndMusic)));
m_game.queueGameEvent(new EVDelay(m_game, 3000));
m_game.queueGameEvent(new EVPauseGame(m_game, true));
m_rohk.getDisplay().getAnimation().pause();
_local1 = new ComingSoon();
m_game.getUIContainer().addChild(_local1);
m_game.queueGameEvent(new EVFadeDisplayObject(m_game, _local1, 10000));
_local2 = new EVShowResults(m_game, true);
m_game.queueGameEvent(_local2);
UI_Campaign.completeLevel(this);
}
function makePaths(){
var _local1:Number;
var _local2:Number;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
m_playersPath = new Path();
m_playersPath.moveTo(200, _local2);
m_playersPath.lineTo(600, _local2);
m_game.drawPath(m_playersPath, DynamicColor.getRGB(Colorizer.kGreen));
m_enemyPath1 = new Path();
plotCircleSegment(m_enemyPath1, (_local1 + 100), _local2, 275, 270, 450, 20);
m_game.drawPath(m_enemyPath1, DynamicColor.getRGB(Colorizer.kRed));
m_enemyPath2 = new Path();
plotCircleSegment(m_enemyPath2, (_local1 - 100), _local2, 275, -270, -90, 20);
m_game.drawPath(m_enemyPath2, DynamicColor.getRGB(Colorizer.kRed));
}
override function getDefaultGameDataImpl():GameInitialData{
var _local1:GameInitialData;
_local1 = new GameInitialData();
_local1.setPlayerData("Tepper", ResourceLoader.k_Rogue, ResourceLoader.k_Bat, ResourceLoader.k_Javelin);
return (_local1);
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function queueWinningEndGameEvents(){
m_gameHasEnded = true;
m_game.getScore().ObjectiveAchieved = true;
m_game.queueGameEvent(new EVInput(m_game, false));
m_rohk.disable();
queueDialogue("Tepper", "Alright, Wendue! Let's get out of this place, it gives me the creeps. If Darius was willing to follow us here and risk the Rohk beast, this place must be important... and this key must lead to something. It's probably just waiting for a bold young lass such as myself find it.", new Vector2(m_player.x, m_player.y));
m_game.queueGameEvent(new EVCallback(m_game, Delegate.create(this, createFakeTepperForEndSequence)));
}
override function initializeGameImpl(){
var _local1:Score;
var _local2:int;
var _local3:ObstacleFodder;
var _local4:MovieClip;
m_initialData = m_game.getInitialData();
if (m_initialData == null){
m_initialData = getDefaultGameData();
};
m_gameHasStarted = false;
m_gameHasEnded = false;
m_rohkActivated = false;
m_portalAnimation = null;
m_game.addStateListener(this);
m_game.playLoop("Tepper_Story");
if (!(BMStorage.getSingleton().getBoolean(UI_Options.k_effectsAreDisabled, false))){
_local4 = new Tepper5_BGMC();
_local4.cacheAsBitmap = true;
m_game.getContainer().addChildAt(_local4, 0);
};
_local1 = m_game.getScore();
_local1.ObjectiveAchievedMultiplier = 10000;
makePaths();
_local2 = 150;
m_obelisks = new Array();
_local3 = new ObstacleFodder(m_game, "Obelisk");
_local3.setInvulnerable(true);
_local3.x = _local2;
_local3.y = _local2;
_local3.offsetDisplay(0, -40);
m_obelisks.push(_local3);
_local3 = new ObstacleFodder(m_game, "Obelisk");
_local3.setInvulnerable(true);
_local3.x = (800 - _local2);
_local3.y = _local2;
_local3.offsetDisplay(0, -40);
m_obelisks.push(_local3);
_local3 = new ObstacleFodder(m_game, "Obelisk");
_local3.setInvulnerable(true);
_local3.x = (800 - _local2);
_local3.y = (600 - _local2);
_local3.offsetDisplay(0, -40);
m_obelisks.push(_local3);
_local3 = new ObstacleFodder(m_game, "Obelisk");
_local3.setInvulnerable(true);
_local3.x = _local2;
_local3.y = (600 - _local2);
_local3.offsetDisplay(0, -40);
m_obelisks.push(_local3);
}
override function cleanupImpl(){
m_timer = null;
}
}
}//package
Section 172
//LevelTest1 (LevelTest1)
package {
import com.gamedozer.misc.*;
import com.gamedozer.graphics.*;
public class LevelTest1 extends Level {
public function LevelTest1(){
super("Test 1", LevelList.k_campaignMode, 1000000);
}
override function updateImpl(_arg1:Number){
}
function getPath(_arg1:int):Path{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Path;
_local2 = getStageMiddleX();
_local3 = getStageMiddleY();
_local4 = 200;
_local5 = new Path();
if (_arg1 == 0){
tempPathCicle(_local5, 60, _local2, _local3);
} else {
trace("LevelPopulator::createPath. Invalid number of players for this level");
return (null);
};
return (_local5);
}
override function populateGameImpl(){
var _local1:int;
var _local2:int;
var _local3:Player;
var _local4:Path;
var _local5:ObstacleManualTurret;
var _local6:ObstacleMover;
var _local7:ObstacleBlock;
var _local8:ObstacleShield;
var _local9:int;
var _local10:int;
var _local11:GSteed;
var _local12:Collider;
_local1 = getStageMiddleX();
_local2 = getStageMiddleY();
_local3 = m_game.addPlayer(DynamicColor.getRGB(Colorizer.kBlue));
_local3.setPath(getPath(0));
_local3.makePathWrappable();
m_game.makeLocalPlayer(_local3);
_local4 = new Path();
tempPathCicle(_local4, 100, _local1, _local2);
_local5 = new ObstacleManualTurret(m_game);
_local5.x = _local1;
_local5.y = _local2;
_local6 = new ObstacleMover(m_game, _local5, _local4, true, 0, true, 0.03);
_local7 = new ObstacleBlock(m_game);
_local7.x = 150;
_local7.y = 150;
_local8 = new ObstacleShield(m_game);
_local8.x = 350;
_local8.y = 150;
_local9 = 0;
while (_local9 < 8) {
_local10 = 0;
while (_local10 < 8) {
_local11 = new GSteed();
_local11.load("Gryphon");
m_game.addChild(_local11);
_local12 = new Collider(m_game, null, _local11);
_local12.setRadius(16);
_local12.initialize();
_local12.setMovementSpeed(0);
_local12.setMovementDirection(0, 1);
_local12.x = (_local9 * 96);
_local12.y = (_local10 * 96);
_local10++;
};
_local9++;
};
}
}
}//package
Section 173
//Newgrounds_SplashMC (Newgrounds_SplashMC)
package {
import flash.display.*;
public dynamic class Newgrounds_SplashMC extends MovieClip {
}
}//package
Section 174
//Obstacle (Obstacle)
package {
import flash.display.*;
import flash.geom.*;
import com.gamedozer.math.*;
public class Obstacle implements IMovingEntity {
var m_game:UI_Game;
var m_isWaitingForDeletion:Boolean;// = false
var m_isInvulnerable:Boolean;
var m_maximumHitpoints:int;
private var m_display:GObstacle;
var m_radius:Number;
var m_hitpointFlashTime:Number;
var m_hitpoints:int;
public function Obstacle(_arg1:UI_Game){
m_isWaitingForDeletion = false;
super();
m_hitpointFlashTime = 0;
m_maximumHitpoints = -1;
m_hitpoints = m_maximumHitpoints;
m_game = _arg1;
m_radius = 20;
m_isInvulnerable = false;
m_game.addObstacle(this);
}
function setDisplay(_arg1:GObstacle){
m_display = _arg1;
m_game.getContainer().addChild(m_display);
}
function handlePlayerFiredImpl(_arg1:Player, _arg2:Number, _arg3:Number){
}
function getRadius():Number{
return (m_radius);
}
public function set y(_arg1:Number):void{
this.m_display.y = _arg1;
}
public function get y():Number{
return (this.m_display.y);
}
function getDisplay():GObstacle{
return (m_display);
}
function setRadius(_arg1:Number){
m_radius = _arg1;
}
function handlePlayerMoved(_arg1:Player, _arg2:Number, _arg3:Number):Number{
return (handlePlayerMovedImpl(_arg1, _arg2, _arg3));
}
function setMaximumHitpoints(_arg1:int){
m_maximumHitpoints = _arg1;
m_hitpoints = m_maximumHitpoints;
}
final function dispose(){
if (!(m_isWaitingForDeletion)){
return;
};
disposeImpl();
m_display.parent.removeChild(m_display);
m_game.removeObstacle(this);
m_game = null;
}
function respondToBulletHit(_arg1:Collider){
}
public function get x():Number{
return (this.m_display.x);
}
function intersectsCircle(_arg1:Number, _arg2:Vector2):Boolean{
var _local3:Vector2;
_local3 = new Vector2(this.m_display.x, this.m_display.y);
if (Intersect.testCircleAndCircle(_arg1, _arg2, m_radius, _local3)){
return (true);
};
return (false);
}
function offsetDisplay(_arg1:Number, _arg2:Number){
var _local3:Sprite;
if (m_display.parent != m_game.getContainer()){
return;
};
_local3 = new Sprite();
_local3.x = -(_arg1);
_local3.y = -(_arg2);
m_display.parent.removeChild(m_display);
_local3.addChild(m_display);
m_game.getContainer().addChild(_local3);
}
function changeAnimation(_arg1:String){
m_display.changeAnimation(_arg1);
}
function isDead():Boolean{
return ((m_hitpoints <= 0));
}
function setInvulnerable(_arg1:Boolean){
m_isInvulnerable = _arg1;
}
function updateObstacleImpl(_arg1:Number){
}
function changeDisplayDelete(_arg1:String){
m_display.changeType(_arg1);
}
function handlePlayerFired(_arg1:Player, _arg2:Number, _arg3:Number){
handlePlayerFiredImpl(_arg1, _arg2, _arg3);
}
function updateHitpointFlash(_arg1:Number){
var _local2:Number;
var _local3:ColorTransform;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
if (m_hitpointFlashTime <= 0){
return;
};
m_hitpointFlashTime = (m_hitpointFlashTime - _arg1);
if (m_hitpointFlashTime <= 0){
_local7 = (m_hitpoints / m_maximumHitpoints);
if (_local7 < 0.3){
changeHitpointDisplay();
if (_local7 < 0.15){
m_hitpointFlashTime = (Player.k_timePerHitpointFlash / 2);
};
} else {
this.m_display.transform.colorTransform = new ColorTransform();
};
return;
};
_local2 = (m_hitpointFlashTime / Player.k_timePerHitpointFlash);
_local3 = this.m_display.transform.colorTransform;
_local4 = (_local3.redOffset * _local2);
_local5 = (_local3.greenOffset * _local2);
_local6 = (_local3.blueOffset * _local2);
_local3.redOffset = _local4;
_local3.greenOffset = _local5;
_local3.blueOffset = _local6;
this.m_display.transform.colorTransform = _local3;
}
function handlePlayerMovedImpl(_arg1:Player, _arg2:Number, _arg3:Number):Number{
return (_arg3);
}
function changeHitpointDisplay(){
var _local1:Number;
var _local2:ColorTransform;
var _local3:int;
var _local4:int;
var _local5:int;
if (isDead()){
return;
};
_local1 = (m_hitpoints / m_maximumHitpoints);
_local2 = new ColorTransform();
_local3 = Math.ceil((_local1 * 160));
_local4 = Math.ceil(((_local1 * 510) - 0xFF));
_local5 = Math.ceil(((_local1 * 510) - 0xFF));
_local2.redOffset = _local3;
_local2.greenOffset = _local4;
_local2.blueOffset = _local5;
this.m_display.transform.colorTransform = _local2;
m_hitpointFlashTime = Player.k_timePerHitpointFlash;
}
function disposeImpl(){
m_game = null;
if (m_display.parent == m_game.getContainer()){
m_game.getContainer().removeChild(m_display);
} else {
m_game.getContainer().removeChild(m_display.parent);
m_display.parent.removeChild(m_display);
};
}
function changeHitpoints(_arg1:int){
if (m_isInvulnerable){
return;
};
if ((((_arg1 > 0)) && ((m_hitpoints >= m_maximumHitpoints)))){
return;
};
m_hitpoints = (m_hitpoints + _arg1);
m_hitpoints = Math.min(m_hitpoints, m_maximumHitpoints);
trace("Changing action");
changeHitpointDisplay();
}
public function set x(_arg1:Number):void{
this.m_display.x = _arg1;
}
final function nominateForDeletion(){
m_isWaitingForDeletion = true;
}
public function set rotation(_arg1:Number):void{
this.m_display.rotation = _arg1;
}
public function get rotation():Number{
return (this.m_display.rotation);
}
function updateObstacle(_arg1:Number){
updateObstacleImpl(_arg1);
updateHitpointFlash(_arg1);
}
}
}//package
Section 175
//ObstacleBase (ObstacleBase)
package {
import com.gamedozer.graphics.*;
public class ObstacleBase extends Obstacle {
var m_maxHealth:int;
var m_owner:Player;// = null
public function ObstacleBase(_arg1:UI_Game, _arg2:Player, _arg3:String){
var _local4:GObstacle;
m_owner = null;
super(_arg1);
m_owner = _arg2;
_local4 = new GObstacle(0xFFFFFF, _arg3);
setDisplay(_local4);
setMaximumHitpoints(20);
if (m_owner == null){
_local4.setColor(DynamicColor.getRGB(Colorizer.kGrey));
} else {
_local4.setColor(m_owner.getColor());
};
}
function setBaseOwner(_arg1:Player){
m_owner = _arg1;
getDisplay().setColor(m_owner.getColor());
}
override function respondToBulletHit(_arg1:Collider){
var _local2:int;
if (m_owner.owns(_arg1)){
return;
};
_local2 = _arg1.getHitpoints();
_local2 = Math.min(_local2, m_hitpoints);
_arg1.takeDamage(_local2);
changeHealth(-(_local2));
}
function atMaximumHealth():Boolean{
return ((m_hitpoints == m_maximumHitpoints));
}
function changeHealth(_arg1:int){
changeHitpoints(_arg1);
}
override function disposeImpl(){
m_owner = null;
}
}
}//package
Section 176
//ObstacleBlock (ObstacleBlock)
package {
public class ObstacleBlock extends Obstacle {
public function ObstacleBlock(_arg1:UI_Game){
var _local2:GObstacle;
super(_arg1);
_local2 = new GObstacle(0xFFFFFF, "Base");
setDisplay(_local2);
}
}
}//package
Section 177
//ObstacleFodder (ObstacleFodder)
package {
public class ObstacleFodder extends Obstacle {
var m_exploded:Boolean;// = false
public function ObstacleFodder(_arg1:UI_Game, _arg2:String){
var _local3:GObstacle;
m_exploded = false;
super(_arg1);
_local3 = new GObstacle(0xFFFFFF, _arg2);
setDisplay(_local3);
setMaximumHitpoints(100);
}
override function respondToBulletHit(_arg1:Collider){
var _local2:int;
if (m_exploded){
return;
};
_local2 = _arg1.getHitpoints();
_local2 = Math.min(_local2, m_hitpoints);
_arg1.takeDamage(_local2);
changeHealth(-(_local2));
}
function changeHealth(_arg1:int){
changeHitpoints(_arg1);
if (m_hitpoints <= 0){
explode();
};
}
function hasExploded(){
return (m_exploded);
}
override function disposeImpl(){
}
function explode(){
if (m_exploded){
return;
};
m_exploded = true;
changeAnimation("destroyed");
}
}
}//package
Section 178
//ObstacleManualTurret (ObstacleManualTurret)
package {
import com.gamedozer.graphics.*;
import com.gamedozer.math.*;
public class ObstacleManualTurret extends Obstacle {
var m_turretRotation:int;
var m_weaponData:WeaponData;
var m_fireDistance:Number;
var m_owner:Player;// = null
var m_health:int;
public function ObstacleManualTurret(_arg1:UI_Game){
var _local2:GObstacle;
m_owner = null;
super(_arg1);
setRadius(28);
m_fireDistance = 70;
setMaximumHitpoints(100);
m_turretRotation = 0;
_local2 = new GObstacle(0xFFFFFF, "ManualTurret", true);
_local2.addChildTurret(ResourceLoader.k_Disc);
m_weaponData = WeaponDataFactory.lookup(ResourceLoader.k_Disc);
setDisplay(_local2);
changeHealth(m_maximumHitpoints);
}
override function handlePlayerFiredImpl(_arg1:Player, _arg2:Number, _arg3:Number){
var _local4:Player;
var _local5:Collider;
var _local6:Vector2;
_local4 = m_owner;
if (_local4 != null){
if (_local4.isDead()){
return;
};
if (_local4 == _arg1){
_local5 = m_weaponData.createBullet(m_game, m_owner);
_local6 = new Vector2();
_local6.setAngle((m_turretRotation - 90));
_local6.normalize(m_fireDistance);
_local5.setMovementDirection(_local6.x, _local6.y);
_local5.x = (this.x + _local6.x);
_local5.y = (this.y + _local6.y);
};
};
}
override function respondToBulletHit(_arg1:Collider){
var _local2:int;
_local2 = _arg1.getHitpoints();
if (((!((m_owner == null))) && (m_owner.owns(_arg1)))){
changeHealth((m_hitpoints + _local2));
} else {
if ((((m_owner == null)) && ((_arg1.getOwner() == null)))){
changeHealth((m_hitpoints + _local2));
} else {
changeHealth((m_hitpoints - _local2));
};
};
_arg1.takeDamage(_local2);
checkForChangeInOwnership(_arg1.getOwner());
}
function atMaximumHealth():Boolean{
return ((m_health == m_maximumHitpoints));
}
function changeHealth(_arg1:int){
m_hitpoints = _arg1;
m_hitpoints = Math.min(m_maximumHitpoints, m_hitpoints);
m_hitpoints = Math.max(0, m_hitpoints);
changeHitpoints(0);
}
override function updateObstacleImpl(_arg1:Number){
var _local2:Player;
var _local3:GObstacle;
var _local4:AIBrain;
var _local5:Player;
var _local6:Vector2;
_local2 = m_owner;
if (_local2 != null){
if (_local2.isDead()){
getDisplay().hideTurret();
return;
};
getDisplay().showTurret();
if (_local2.isLocalPlayer()){
_local3 = getDisplay();
pointTurretTo(_local3.stage.mouseX, _local3.stage.mouseY);
} else {
_local4 = m_game.lookupBrain(_local2);
_local5 = _local4.getTarget();
if (_local5 != null){
pointTurretTo(_local5.x, _local5.y);
};
};
} else {
m_turretRotation++;
_local6 = new Vector2(1, 0);
_local6.setAngle((m_turretRotation - 90));
_local6.normalize((getRadius() * 2));
_local3 = getDisplay();
_local3.updateTurret(_local6, m_turretRotation);
};
}
function pointTurretTo(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Vector2;
var _local6:GObstacle;
_local3 = (_arg1 - this.x);
_local4 = (_arg2 - this.y);
m_turretRotation = getAngle(_local3, _local4);
_local5 = new Vector2(_local3, _local4);
_local5.normalize(m_fireDistance);
_local6 = getDisplay();
_local6.updateTurret(_local5, m_turretRotation);
}
function getAngle(_arg1:Number, _arg2:Number):Number{
return ((((Math.atan2(_arg2, _arg1) * 180) / Math.PI) + 90));
}
function checkForChangeInOwnership(_arg1:Player){
if (m_hitpoints == 0){
makeOwner(_arg1);
};
}
override function disposeImpl(){
m_owner = null;
}
function makeOwner(_arg1:Player){
var _local2:GObstacle;
m_owner = _arg1;
_local2 = getDisplay();
if (m_owner == null){
_local2.setColor(DynamicColor.getRGB(Colorizer.kGrey));
} else {
_local2.setColor(m_owner.getColor());
};
}
}
}//package
Section 179
//ObstacleMoveableTurret (ObstacleMoveableTurret)
package {
import com.gamedozer.math.*;
import flash.display.*;
public class ObstacleMoveableTurret extends Obstacle {
var k_fireDelay:Number;// = 2000
var m_timeTillNextFire:Number;
var m_turretRotation:int;
var m_disabled:Boolean;
var m_tether:Shape;
var k_firePushAmount:Number;// = 3
var m_weaponData:WeaponData;
var k_showTether:Boolean;// = false
var m_anchor:Vector2;
var m_isAngry:Boolean;
var m_friends:Array;
public function ObstacleMoveableTurret(_arg1:UI_Game){
var _local2:GObstacle;
k_showTether = false;
k_fireDelay = 2000;
k_firePushAmount = 3;
super(_arg1);
setRadius(36);
m_friends = new Array();
m_isAngry = false;
m_turretRotation = 0;
m_timeTillNextFire = 0;
m_anchor = new Vector2();
m_disabled = false;
_local2 = new GObstacle(0xFFFFFF, "MoveableTurret");
_local2.addChildTurret(ResourceLoader.k_Slag);
setDisplay(_local2);
offsetDisplay(0, -50);
m_weaponData = WeaponDataFactory.lookup(ResourceLoader.k_Slag);
m_tether = null;
if (k_showTether){
createTether();
};
}
override function respondToBulletHit(_arg1:Collider){
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Vector2;
_local2 = _arg1.getHitpoints();
_arg1.takeDamage(_local2);
_local3 = (this.x - _arg1.x);
_local4 = (this.y - _arg1.y);
_local5 = new Vector2(_local3, _local4);
_local5.normalize((k_firePushAmount * _local2));
this.x = (this.x + _local5.x);
this.y = (this.y + _local5.y);
}
function setAnchorPoint(_arg1:Number, _arg2:Number){
m_anchor.x = _arg1;
m_anchor.y = _arg2;
}
function getAngle(_arg1:Number, _arg2:Number):Number{
return ((((Math.atan2(_arg2, _arg1) * 180) / Math.PI) + 90));
}
function addFriend(_arg1:Player){
m_friends.push(_arg1);
}
override function updateObstacleImpl(_arg1:Number){
var _local2:Boolean;
var _local3:Vector2;
if (m_disabled){
return;
};
m_timeTillNextFire = (m_timeTillNextFire - _arg1);
_local2 = false;
if (m_timeTillNextFire < (k_fireDelay / 2)){
_local2 = updateRotation();
};
if (((_local2) && ((m_timeTillNextFire < 0)))){
_local3 = new Vector2((m_anchor.x - this.x), (m_anchor.y - this.y));
if (((!(m_isAngry)) && ((_local3.length() <= m_radius)))){
return;
};
m_timeTillNextFire = k_fireDelay;
fire();
};
move(_arg1);
}
function updateTether(){
if (m_tether == null){
return;
};
m_tether.graphics.clear();
m_tether.graphics.lineStyle(2, 0xFFFFFF);
m_tether.graphics.moveTo(this.x, this.y);
m_tether.graphics.lineTo(m_anchor.x, m_anchor.y);
}
function makeAngryEvenWhenTethered(){
m_isAngry = true;
}
function fire(){
var _local1:Collider;
var _local2:Vector2;
m_game.playSound("RohkAttack");
_local1 = m_weaponData.createBullet(m_game, null);
_local2 = new Vector2();
_local2.setAngle((m_turretRotation - 90));
_local2.normalize(((m_radius + _local1.getRadius()) + 2));
_local1.setMovementDirection(_local2.x, _local2.y);
_local1.x = (this.x + _local2.x);
_local1.y = (this.y + _local2.y);
}
function createTether(){
m_tether = new Shape();
m_game.addChild(m_tether);
}
function move(_arg1:Number){
var _local2:Vector2;
var _local3:Number;
var _local4:Number;
_local2 = new Vector2((m_anchor.x - this.x), (m_anchor.y - this.y));
_local3 = _local2.length();
_local4 = ((_arg1 * _local3) / 5000);
if (_local3 <= _local4){
m_tether.graphics.clear();
this.x = m_anchor.x;
this.y = m_anchor.y;
return;
};
_local2.normalize(_local4);
this.x = (this.x + _local2.x);
this.y = (this.y + _local2.y);
updateTether();
}
override function disposeImpl(){
m_friends.splice(0);
m_friends = null;
if (m_tether != null){
m_game.removeChild(m_tether);
};
m_tether = null;
m_anchor = null;
}
function updateRotation():Boolean{
var _local1:Player;
var _local2:Number;
var _local3:Number;
var _local4:Vector2;
var _local5:GObstacle;
_local1 = m_game.getClosestPlayer(this.x, this.y, m_friends);
if (_local1 != null){
if (_local1.isDead()){
return (false);
};
_local2 = (_local1.x - this.x);
_local3 = (_local1.y - this.y);
m_turretRotation = getAngle(_local2, _local3);
_local4 = new Vector2(_local2, _local3);
_local4.normalize((getRadius() * 2));
_local5 = getDisplay();
_local5.updateTurret(_local4, m_turretRotation);
return (true);
};
return (false);
}
function disable(){
m_disabled = true;
}
}
}//package
Section 180
//ObstacleMover (ObstacleMover)
package {
import com.gamedozer.misc.*;
import flash.display.*;
import flash.geom.*;
public class ObstacleMover {
var m_game:UI_Game;
var m_movementSpeed:Number;
var m_obstacle:Obstacle;
var m_canWrapAround:Boolean;
var m_path:Path;
var m_pathFraction:Number;
var m_moveUp:Boolean;
public function ObstacleMover(_arg1:UI_Game, _arg2:Obstacle, _arg3:Path, _arg4:Boolean, _arg5:Number, _arg6:Boolean, _arg7:Number){
m_game = _arg1;
m_path = _arg3;
m_canWrapAround = _arg4;
m_obstacle = _arg2;
m_pathFraction = _arg5;
m_moveUp = _arg6;
m_movementSpeed = _arg7;
m_game.addMover(this);
drawPath();
}
function drawPath(){
var _local1:Graphics;
_local1 = m_game.getDrawTarget().graphics;
_local1.lineStyle(5, 0x999999, 100);
m_path.draw(_local1);
}
function updateMover(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Point;
_local2 = m_path.length;
_local3 = (m_pathFraction * _local2);
if (m_moveUp){
_local3 = (_local3 + (_arg1 * m_movementSpeed));
} else {
_local3 = (_local3 - (_arg1 * m_movementSpeed));
};
if (m_canWrapAround){
if (_local3 > _local2){
_local3 = (_local3 - _local2);
};
if (_local3 < 0){
_local3 = (_local3 + _local2);
};
} else {
if (_local3 > _local2){
m_moveUp = false;
};
if (_local3 < 0){
m_moveUp = true;
};
};
_local3 = Math.min(_local3, _local2);
_local3 = Math.max(_local3, 0);
_local4 = (_local3 / _local2);
_local5 = m_path.pointAt(_local4);
m_obstacle.x = _local5.x;
m_obstacle.y = _local5.y;
m_pathFraction = _local4;
}
function dispose(){
m_obstacle = null;
m_path = null;
m_game = null;
}
}
}//package
Section 181
//ObstaclePathShortener (ObstaclePathShortener)
package {
import com.gamedozer.graphics.*;
import com.gamedozer.misc.*;
import flash.geom.*;
import com.gamedozer.math.*;
public class ObstaclePathShortener extends Obstacle {
var m_path;// = null
var m_position:Number;
var m_wasInitializedAtBottomEnd:Boolean;
var m_owner:Player;// = null
public function ObstaclePathShortener(_arg1:UI_Game, _arg2:Boolean, _arg3:Player){
var _local4:GObstacle;
m_owner = null;
m_path = null;
super(_arg1);
m_owner = _arg3;
m_wasInitializedAtBottomEnd = _arg2;
m_position = (_arg2) ? 0 : 1;
_local4 = new GObstacle(0xFFFFFF, "PathShortener");
setDisplay(_local4);
setMaximumHitpoints(20);
updatePosition();
if (m_owner == null){
_local4.setColor(DynamicColor.getRGB(Colorizer.kGrey));
} else {
_local4.setColor(m_owner.getColor());
};
}
function updatePosition(){
var _local1:Path;
var _local2:Point;
_local1 = m_owner.getPath();
_local2 = _local1.pointAt(m_position);
this.x = _local2.x;
this.y = _local2.y;
}
override function respondToBulletHit(_arg1:Collider){
var _local2:int;
if (m_owner.owns(_arg1)){
return;
};
_local2 = _arg1.getHitpoints();
_local2 = Math.min(_local2, m_hitpoints);
_arg1.takeDamage(_local2);
changeHealth((m_hitpoints - _local2));
}
function atMaximumHealth():Boolean{
return ((m_hitpoints == m_maximumHitpoints));
}
function changeHealth(_arg1:int){
var _local2:Boolean;
m_hitpoints = _arg1;
m_hitpoints = Math.min(m_maximumHitpoints, m_hitpoints);
m_hitpoints = Math.max(0, m_hitpoints);
if (m_hitpoints == 0){
_local2 = attemptPathShorten();
if (_local2){
m_hitpoints = m_maximumHitpoints;
};
};
changeHitpoints(0);
}
function attemptPathShorten():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Path;
var _local4:Point;
var _local5:Vector2;
_local1 = m_position;
_local2 = 0.1;
if (m_wasInitializedAtBottomEnd){
_local1 = (_local1 + _local2);
} else {
_local1 = (_local1 - _local2);
};
_local1 = Math.min(_local1, 1);
_local1 = Math.max(_local1, 0);
_local3 = m_owner.getPath();
_local4 = _local3.pointAt(_local1);
_local5 = new Vector2(_local4.x, _local4.y);
if (m_owner.intersectsCircle(this.getRadius(), _local5)){
return (false);
};
m_position = _local1;
updatePosition();
return (true);
}
override function handlePlayerMovedImpl(_arg1:Player, _arg2:Number, _arg3:Number):Number{
var _local4:Boolean;
var _local5:Vector2;
if (_arg1 != m_owner){
return (_arg3);
};
_local4 = (_arg3 < _arg2);
if (((_local4) && (!(m_wasInitializedAtBottomEnd)))){
return (_arg3);
};
if (((!(_local4)) && (m_wasInitializedAtBottomEnd))){
return (_arg3);
};
_local5 = new Vector2(this.x, this.y);
if (m_owner.intersectsCircle(this.getRadius(), _local5)){
return (_arg2);
};
return (_arg3);
}
override function disposeImpl(){
m_owner = null;
}
}
}//package
Section 182
//ObstacleShield (ObstacleShield)
package {
import com.gamedozer.graphics.*;
public class ObstacleShield extends Obstacle {
var m_owner:Player;// = null
public function ObstacleShield(_arg1:UI_Game){
var _local2:GObstacle;
m_owner = null;
super(_arg1);
setMaximumHitpoints(9);
_local2 = new GObstacle(0xFFFFFF, "Shield");
setDisplay(_local2);
changeHealth(m_maximumHitpoints);
}
override function respondToBulletHit(_arg1:Collider){
var _local2:int;
_local2 = _arg1.getHitpoints();
_local2 = Math.min(_local2, m_hitpoints);
if (((!((m_owner == null))) && (m_owner.owns(_arg1)))){
if (atMaximumHealth()){
return;
};
_arg1.takeDamage(_local2);
changeHealth((m_hitpoints + _local2));
} else {
_arg1.takeDamage(_local2);
if ((((m_owner == null)) && ((_arg1.getOwner() == null)))){
changeHealth((m_hitpoints + _local2));
} else {
changeHealth((m_hitpoints - _local2));
};
};
checkForChangeInOwnership(_arg1.getOwner());
}
function atMaximumHealth():Boolean{
return ((m_hitpoints == m_maximumHitpoints));
}
function changeHealth(_arg1:int){
_arg1 = Math.min(m_maximumHitpoints, _arg1);
_arg1 = Math.max(0, _arg1);
changeHitpoints((m_hitpoints - _arg1));
}
function checkForChangeInOwnership(_arg1:Player){
var _local2:GObstacle;
if (m_hitpoints == 0){
m_owner = _arg1;
_local2 = getDisplay();
if (m_owner == null){
_local2.setColor(DynamicColor.getRGB(Colorizer.kGrey));
} else {
_local2.setColor(m_owner.getColor());
};
};
}
override function disposeImpl(){
m_owner = null;
}
}
}//package
Section 183
//ObstacleSpreadFire (ObstacleSpreadFire)
package {
import com.gamedozer.math.*;
public class ObstacleSpreadFire extends Obstacle {
var m_rotationSpeed:Number;
var m_weaponData:WeaponData;
var m_spreadVariant:Number;
var m_currentRotation:Number;
static const k_angleRange = 30;
static const k_angleMinimum = 5;
public function ObstacleSpreadFire(_arg1:UI_Game){
var _local2:GObstacle;
super(_arg1);
m_currentRotation = 0;
m_spreadVariant = 0;
m_rotationSpeed = 0.1;
_local2 = new GObstacle(0xFFFFFF, "SpreadFire");
_local2.addChildTurret(ResourceLoader.k_Scimitar);
m_weaponData = WeaponDataFactory.lookup(ResourceLoader.k_Scimitar);
setDisplay(_local2);
}
override function respondToBulletHit(_arg1:Collider){
fireSpread(_arg1.getOwner());
_arg1.takeDamage(_arg1.getHitpoints());
}
function generateBulletAtOffset(_arg1:Player, _arg2:int){
var _local3:Collider;
var _local4:Vector2;
_local3 = m_weaponData.createBullet(m_game, null);
_local4 = new Vector2();
_local4.setAngle(((m_currentRotation - 90) + _arg2));
_local4.normalize(((m_radius + _local3.getRadius()) + 2));
_local3.setMovementDirection(_local4.x, _local4.y);
_local3.x = (this.x + _local4.x);
_local3.y = (this.y + _local4.y);
}
override function updateObstacleImpl(_arg1:Number){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Vector2;
var _local6:GObstacle;
m_currentRotation = (m_currentRotation + (m_rotationSpeed * _arg1));
m_spreadVariant = (m_spreadVariant + (_arg1 / 250));
if (m_spreadVariant > (2 * k_angleRange)){
m_spreadVariant = 0;
};
_local2 = m_spreadVariant;
if (m_spreadVariant > k_angleRange){
_local2 = ((2 * k_angleRange) - m_spreadVariant);
};
_local3 = (-(k_angleMinimum) - _local2);
_local4 = (k_angleMinimum + _local2);
_local5 = new Vector2(1, 0);
_local5.setAngle((m_currentRotation - 90));
_local5.normalize((getRadius() * 2));
_local6 = getDisplay();
_local6.updateTurret(_local5, m_currentRotation);
}
function fireSpread(_arg1:Player){
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = m_spreadVariant;
if (m_spreadVariant > k_angleRange){
_local2 = ((2 * k_angleRange) - m_spreadVariant);
};
_local3 = (-(k_angleMinimum) - _local2);
_local4 = (k_angleMinimum + _local2);
generateBulletAtOffset(_arg1, _local3);
generateBulletAtOffset(_arg1, 0);
generateBulletAtOffset(_arg1, _local4);
}
override function disposeImpl(){
}
}
}//package
Section 184
//PartyMember (PartyMember)
package {
class PartyMember {
var steed:String;
var character:String;
var name:String;
var graphicalSteed:GSteed;
var weapon:String;
var graphicalWeapon:GWeapon;
}
}//package
import flash.display.*;
import com.gamedozer.ui.*;
import flash.events.*;
import com.gamedozer.utils.*;
import flash.text.*;
import com.gamedozer.math.*;
class UI_Equip extends MovieClip {
public var level_title_txt:TextField;
var m_color:uint;// = 0xFF
var m_level:Level;
var m_weaponTable:UITable;// = null
var m_partyTable:UITable;// = null
var m_upgradeTable:UITable;// = null
var m_returnTarget:DisplayObjectContainer;
public var gold_pieces_txt:TextField;
var m_goldPiecesAvailable:int;
var m_steedTable:UITable;// = null
var m_partyMembers:Array;
var m_activePartyMember:PartyMember;
static const k_partyTableCellHeight:int = 100;
public static const k_upgradeHitpoints = "UpgradeHitpoints";
public static const k_upgradeMovementSpeed = "UpgradeMovementSpeed";
public static const k_upgradeRefireRate = "UpgradeRefireRate";
public static const k_goldAvailable = "GoldAvailable";
public static const k_upgradeProjectileSpeed = "UpgradeProjectileSpeed";
static const k_partyTableWidth:int = 170;
public static const k_preferredWeaponPrefix = "PreferredWeapon";
public function UI_Equip(_arg1:DisplayObjectContainer, _arg2:String){
m_color = 0xFF;
m_weaponTable = null;
m_steedTable = null;
m_partyTable = null;
m_upgradeTable = null;
m_partyMembers = new Array();
super();
m_returnTarget = _arg1;
m_level = LevelList.lookupLevel(_arg2);
level_title_txt.text = _arg2;
m_goldPiecesAvailable = BMStorage.getSingleton().getInt(k_goldAvailable, 0);
updateGoldPiecesDisplay();
}
function displayUpgrade(_arg1:int, _arg2:int, _arg3:String, _arg4:Boolean){
var _local5:int;
var _local6:int;
var _local7:Bitmap;
var _local8:Storage;
var _local9:Boolean;
var _local10:Sprite;
var _local11:Function;
var _local12:Bitmap;
var _local13:Sprite;
var _local14:TextField;
var _local15:TextFormat;
if (_arg1 == 0){
_local12 = ResourceLoader.getBitmap((_arg3 + _arg1));
_local12.x = (_local12.x - (_local12.width / 2));
_local12.y = (_local12.y - ((_local12.height / 2) + 8));
_local13 = new Sprite();
_local13.addChild(_local12);
m_upgradeTable.enableCell(_arg1, _arg2, _local13, null);
m_upgradeTable.enableCellBackground(_arg1, _arg2, 8421631, 1);
m_upgradeTable.assignName(_arg1, _arg2, (_arg3 + _arg1));
return;
};
_local5 = _arg1;
_local6 = (2500 * (_local5 * _local5));
_local7 = ResourceLoader.getBitmap((_arg3 + _arg1));
_local8 = BMStorage.getSingleton();
_local9 = _local8.getBoolean((_arg3 + _arg1), false);
if (_local9){
m_upgradeTable.enableCellBackground(_arg1, _arg2, 8421631, 1);
};
if ((((_local6 > m_goldPiecesAvailable)) && (!(_local9)))){
_local7.alpha = 0.6;
};
if (_arg4){
_local7.alpha = 0.1;
};
_local7.x = (_local7.x - (_local7.width / 2));
_local7.y = (_local7.y - ((_local7.height / 2) + 8));
_local10 = new Sprite();
_local10.addChild(_local7);
if (((!(_arg4)) && (!(_local9)))){
_local14 = createTextField();
_local14.text = StringParser.convertToCurrency(_local6);
_local14.x = (_local14.x - (_local14.textWidth / 2));
_local14.y = 26;
_local15 = _local14.defaultTextFormat;
_local15.align = "center";
_local14.defaultTextFormat = _local15;
_local10.addChild(_local14);
};
_local11 = Delegate.create(this, purchaseUpgrade, (_arg3 + _arg1), _local6);
if ((((((_local6 > m_goldPiecesAvailable)) || (_arg4))) || (_local9))){
_local11 = null;
};
m_upgradeTable.enableCell(_arg1, _arg2, _local10, _local11);
m_upgradeTable.assignName(_arg1, _arg2, (_arg3 + _arg1));
}
function dispose(){
m_returnTarget = null;
if (m_weaponTable != null){
m_weaponTable.dispose();
};
if (m_steedTable != null){
m_steedTable.dispose();
};
if (m_partyTable != null){
m_partyTable.dispose();
};
m_partyMembers.splice(0);
m_activePartyMember = null;
}
function displaySteed(_arg1:int, _arg2:int, _arg3:String){
var _local4:GSteed;
var _local5:*;
var _local6:Sprite;
_local4 = new GSteed(false);
_local4.load(_arg3);
_local4.disableTimer();
_local4.setRotation(180);
_local4.x = -56;
_local4.y = 5;
_local5 = createTextField();
_local5.text = _arg3;
_local5.x = -5;
_local5.y = -4;
_local6 = new Sprite();
_local6.addChild(_local4);
_local6.addChild(_local5);
m_steedTable.enableCell(_arg1, _arg2, _local6, Delegate.create(this, changeActiveSteed, _arg3));
m_steedTable.assignName(_arg1, _arg2, _arg3);
}
function createTextField():TextField{
var _local1:TextFormat;
var _local2:TextField;
_local1 = new TextFormat();
_local1.font = "Book Antiqua";
_local1.color = 0xFFFFFF;
_local1.size = 14;
_local2 = new TextField();
_local2.defaultTextFormat = _local1;
_local2.embedFonts = true;
_local2.text = "";
_local2.selectable = false;
return (_local2);
}
function changeActivePartyMember(_arg1:String){
var _local2:int;
var _local3:int;
_local2 = m_partyTable.getColumnFromName(_arg1);
_local3 = m_partyTable.getRowFromName(_arg1);
m_partyTable.resetCellBackgrounds();
m_partyTable.enableCellBackground(_local2, _local3, 8421631, 1);
m_activePartyMember = m_partyMembers[_local3];
}
function updateGoldPiecesDisplay(){
gold_pieces_txt.text = StringParser.convertToCurrency(m_goldPiecesAvailable);
}
function updateUpgradeTable(){
m_upgradeTable.dispose();
removeChild(m_upgradeTable);
displayUpgrades();
}
function initialize(){
displayWeapons();
displayUpgrades();
loadParty();
if (m_level.isEquipScreenDisabled()){
beginMission(null);
return;
};
initializeButtons();
}
function changeActiveWeapon(_arg1:String){
var _local2:int;
var _local3:int;
_local2 = m_weaponTable.getColumnFromName(_arg1);
_local3 = m_weaponTable.getRowFromName(_arg1);
m_weaponTable.resetCellBackgrounds();
m_weaponTable.enableCellBackground(_local2, _local3, 8421631, 1);
m_activePartyMember.weapon = _arg1;
m_activePartyMember.graphicalWeapon.change(_arg1);
BMStorage.getSingleton().setString((m_activePartyMember.name + k_preferredWeaponPrefix), _arg1);
}
function displayCharacter(_arg1:int, _arg2:int, _arg3:String, _arg4:String, _arg5:String, _arg6:String){
var _local7:String;
var _local8:GSteed;
var _local9:GRider;
var _local10:GWeapon;
var _local11:*;
var _local12:Sprite;
var _local13:PartyMember;
_local7 = BMStorage.getSingleton().getString((_arg3 + k_preferredWeaponPrefix), _arg6);
_local8 = new GSteed(false);
_local8.load(_arg5);
_local8.disableTimer();
_local9 = new GRider(m_color);
_local9.load(_arg4);
_local9.disableTimer();
_local8.insertRider(_local9);
_local8.setRotation(180);
_local8.x = -25;
_local8.y = 5;
_local10 = new GWeapon(m_color, _local7, true);
_local10.disableRotations();
_local10.x = (_local10.x + 55);
_local11 = createTextField();
_local11.text = _arg3;
_local11.x = (-(k_partyTableWidth) / 2);
_local11.y = -45;
_local12 = new Sprite();
_local12.addChild(_local8);
_local12.addChild(_local11);
_local12.addChild(_local10);
_local13 = new PartyMember();
_local13.name = _arg3;
_local13.steed = _arg5;
_local13.weapon = _local7;
_local13.character = _arg4;
_local13.graphicalSteed = _local8;
_local13.graphicalWeapon = _local10;
m_partyMembers.push(_local13);
m_partyTable.enableCell(_arg1, _arg2, _local12, Delegate.create(this, changeActivePartyMember, _arg3));
m_partyTable.assignName(_arg1, _arg2, _arg3);
if (m_activePartyMember == null){
changeActivePartyMember(_arg3);
changeActiveWeapon(_local7);
};
}
function loadParty(){
var _local1:GameInitialData;
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:String;
var _local6:String;
var _local7:String;
_local1 = m_level.getDefaultGameData();
_local2 = _local1.getPlayerCount();
m_partyTable = new UITable(k_partyTableWidth, (_local2 * k_partyTableCellHeight));
m_partyTable.enableBorder(1, 4391804, 1);
m_partyTable.enableTableBackground(6751935, 1);
m_partyTable.enableHighlight(11360506, 1);
m_partyTable.useHighlightOnRollover();
m_partyTable.x = 25;
m_partyTable.y = 100;
addChild(m_partyTable);
_local3 = 0;
while (_local3 < _local2) {
_local4 = _local1.getName(_local3);
_local5 = _local1.getCharacter(_local3);
_local6 = _local1.getSteed(_local3);
_local7 = _local1.getWeapon(_local3);
displayCharacter(0, _local3, _local4, _local5, _local6, _local7);
_local3++;
};
}
function executeLevelLoad(_arg1:String){
var _local2:GameInitialData;
var _local3:int;
var _local4:UI_Game;
var _local5:PartyMember;
_local2 = new GameInitialData();
_local3 = 0;
while (_local3 < m_partyMembers.length) {
_local5 = m_partyMembers[_local3];
_local2.setPlayerData(_local5.name, _local5.character, _local5.steed, _local5.weapon);
_local3++;
};
_local4 = new UI_Game(m_returnTarget, _local2);
stage.addChild(_local4);
_local4.initialize(_arg1);
this.parent.removeChild(this);
dispose();
}
function changeActiveSteed(_arg1:String){
var _local2:int;
var _local3:int;
_local2 = m_steedTable.getColumnFromName(_arg1);
_local3 = m_steedTable.getRowFromName(_arg1);
m_steedTable.resetCellBackgrounds();
m_steedTable.enableCellBackground(_local2, _local3, 8421631, 1);
m_activePartyMember.steed = _arg1;
m_activePartyMember.graphicalSteed.load(_arg1);
m_activePartyMember.graphicalSteed.setRotation(180);
m_activePartyMember.graphicalSteed.disableTimer();
m_activePartyMember.graphicalSteed.reset();
}
function displayWeapon(_arg1:int, _arg2:int, _arg3:String){
var _local4:GWeapon;
var _local5:*;
var _local6:Sprite;
_local4 = new GWeapon(m_color, _arg3, true);
_local4.disableRotations();
_local4.setRotation(90);
_local4.x = (_local4.x - 45);
_local5 = createTextField();
_local5.text = _arg3;
_local5.x = -10;
_local5.y = -12;
_local6 = new Sprite();
_local6.addChild(_local4);
_local6.addChild(_local5);
m_weaponTable.enableCell(_arg1, _arg2, _local6, Delegate.create(this, changeActiveWeapon, _arg3));
m_weaponTable.assignName(_arg1, _arg2, _arg3);
}
function beginMission(_arg1:Event){
executeLevelLoad(m_level.getName());
}
function displayWeapons(){
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
m_weaponTable = new UITable(160, 160);
m_weaponTable.enableBorder(1, 4391804, 1);
m_weaponTable.enableTableBackground(6751935, 1);
m_weaponTable.enableHighlight(11360506, 1);
m_weaponTable.useHighlightOnRollover();
m_weaponTable.x = 32;
m_weaponTable.y = 300;
addChild(m_weaponTable);
var _temp1 = _local2;
_local2 = (_local2 + 1);
displayWeapon(_local1, _temp1, ResourceLoader.k_Chakram);
var _temp2 = _local2;
_local2 = (_local2 + 1);
displayWeapon(_local1, _temp2, ResourceLoader.k_Scimitar);
var _temp3 = _local2;
_local2 = (_local2 + 1);
displayWeapon(_local1, _temp3, ResourceLoader.k_Dagger);
var _temp4 = _local2;
_local2 = (_local2 + 1);
displayWeapon(_local1, _temp4, ResourceLoader.k_Javelin);
}
function initializeButtons(){
var _local1:DefaultButton;
var _local2:DefaultButton;
_local1 = new DefaultButton();
addChild(_local1);
_local1.background_mc.addEventListener(MouseEvent.CLICK, back);
_local1.x = ((_local1.width / 2) + 15);
_local1.y = ((600 - (_local1.height / 2)) - 15);
_local1.m_label_txt.text = "Back";
_local2 = new DefaultButton();
addChild(_local2);
_local2.background_mc.addEventListener(MouseEvent.CLICK, beginMission);
_local2.x = ((800 - (_local2.width / 2)) - 15);
_local2.y = ((600 - (_local2.height / 2)) - 15);
_local2.m_label_txt.text = "Begin Mission";
}
function displaySteeds(){
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
m_steedTable = new UITable(230, 320);
m_steedTable.enableBorder(1, 4391804, 1);
m_steedTable.enableTableBackground(6751935, 1);
m_steedTable.enableHighlight(11360506, 1);
m_steedTable.useHighlightOnRollover();
m_steedTable.x = 510;
m_steedTable.y = 90;
addChild(m_steedTable);
var _temp1 = _local2;
_local2 = (_local2 + 1);
displaySteed(_local1, _temp1, ResourceLoader.k_Gryphon);
var _temp2 = _local2;
_local2 = (_local2 + 1);
displaySteed(_local1, _temp2, "Pegasus");
var _temp3 = _local2;
_local2 = (_local2 + 1);
displaySteed(_local1, _temp3, "Bat");
var _temp4 = _local2;
_local2 = (_local2 + 1);
displaySteed(_local1, _temp4, "Behelmut");
}
function displayUpgrades(){
var _local1:Storage;
var _local2:int;
var _local3:String;
var _local4:Boolean;
var _local5:Boolean;
var _local6:int;
m_upgradeTable = new UITable(352, 400);
m_upgradeTable.enableBorder(1, 4391804, 1);
m_upgradeTable.enableTableBackground(6751935, 0.5);
m_upgradeTable.enableHighlight(11360506, 0.5);
m_upgradeTable.useHighlightOnRollover();
m_upgradeTable.x = 370;
m_upgradeTable.y = 100;
addChild(m_upgradeTable);
_local1 = BMStorage.getSingleton();
_local2 = 0;
while (_local2 < 4) {
if (_local2 == 0){
_local3 = k_upgradeProjectileSpeed;
} else {
if (_local2 == 1){
_local3 = k_upgradeRefireRate;
} else {
if (_local2 == 2){
_local3 = k_upgradeHitpoints;
} else {
if (_local2 == 3){
_local3 = k_upgradeMovementSpeed;
};
};
};
};
_local4 = false;
_local5 = true;
_local6 = 0;
while (_local6 < 4) {
displayUpgrade(_local6, _local2, _local3, _local4);
_local5 = ((_local1.getBoolean((_local3 + _local6), false)) || ((_local6 == 0)));
if (!(_local5)){
_local4 = true;
};
_local6++;
};
_local2++;
};
}
function back(_arg1:MouseEvent){
m_returnTarget.visible = true;
dispose();
this.parent.removeChild(this);
}
function purchaseUpgrade(_arg1:String, _arg2:int){
var _local3:Storage;
if (_arg2 > m_goldPiecesAvailable){
trace("You cannot afford this. Return.");
return;
};
_local3 = BMStorage.getSingleton();
_local3.setBoolean(_arg1, true);
m_goldPiecesAvailable = (m_goldPiecesAvailable - _arg2);
_local3.setInt(k_goldAvailable, m_goldPiecesAvailable);
updateGoldPiecesDisplay();
updateUpgradeTable();
}
}
Section 185
//PauseBTN (PauseBTN)
package {
import flash.display.*;
public dynamic class PauseBTN extends SimpleButton {
}
}//package
Section 186
//Player (Player)
package {
import com.gamedozer.math.*;
import flash.display.*;
import com.gamedozer.misc.*;
import flash.geom.*;
public class Player implements IMovingEntity {
var m_turret:GWeapon;
var m_color:uint;
var m_rider:GRider;
var m_hitpointFlashTime:Number;
var m_movementSpeedBonus:Number;// = 1
var m_movementDirection:int;// = 0
var m_hasCharged:Boolean;
var m_splatter:GSplatter;
var m_canWrapAround:Boolean;
var m_refireRateBonus:Number;// = 1
var m_avatar:DisplayObjectContainer;
var m_steed:GSteed;
var m_projectileSpeedBonus:Number;// = 1
var m_game:UI_Game;
var m_chargeRequired:int;
var m_movementSpeed:Number;// = 0.1
var m_maximumHitpoints:int;// = 100
var m_timeBeforeRespawn:int;
var m_soundType:String;
var m_turretDirection:Vector2;
var m_radius:Number;
var m_allies:Array;
var m_timeTillNextFire:Number;// = 0
var m_path_position:Number;
var m_path:Path;
var m_isDead:Boolean;
var m_hitpoints:int;
var m_weaponData:WeaponData;
static const k_moveRight:int = -1;
static const k_chargeRequired:int = 1500;
static const k_moveLeft:int = 1;
static const k_radiansToDegrees:Number = 57.2957795;
static const k_moveStop:int = 0;
public static const k_timePerHitpointFlash:int = 400;
static const k_turretOffset:Number = 50;
public function Player(_arg1:UI_Game, _arg2:uint, _arg3:String, _arg4:String, _arg5:String){
var _local6:GSteed;
m_movementDirection = k_moveStop;
m_movementSpeed = 0.1;
m_turretDirection = new Vector2();
m_timeTillNextFire = 0;
m_maximumHitpoints = 100;
m_projectileSpeedBonus = 1;
m_refireRateBonus = 1;
m_movementSpeedBonus = 1;
super();
m_timeBeforeRespawn = -1;
if ((((_arg3 == "Rogue")) || ((_arg3 == "Scarlet")))){
m_soundType = "Female";
} else {
m_soundType = "Male";
};
m_hitpointFlashTime = 0;
m_game = _arg1;
m_color = _arg2;
m_isDead = false;
m_canWrapAround = false;
m_hasCharged = false;
m_path_position = 0.5;
m_allies = new Array();
m_radius = 16;
m_hitpoints = m_maximumHitpoints;
m_chargeRequired = -1;
m_weaponData = WeaponDataFactory.lookup(_arg5);
m_avatar = new Sprite();
m_game.getContainer().addChild(m_avatar);
_local6 = new GSteed();
_local6.load(_arg4);
m_rider = new GRider(m_color);
m_rider.load(_arg3);
_local6.insertRider(m_rider);
m_steed = _local6;
m_avatar.addChild(m_steed);
m_turret = null;
createTurret();
}
function setPathPosition(_arg1:Number){
m_path_position = _arg1;
}
function createTurret(){
m_turret = new GWeapon(m_color, m_weaponData.turretResource);
m_turret.disableRotations();
m_avatar.addChild(m_turret);
m_splatter = new GSplatter(m_color);
m_turret.addChild(m_splatter);
}
function updatePlayer(_arg1:Number){
updateTimeTillNextFire(_arg1);
updateCharging(_arg1);
updateRespawn(_arg1);
updateHitpointFlash(_arg1);
}
private function getAngle(_arg1:Number, _arg2:Number):Number{
return ((((Math.atan2(_arg2, _arg1) * 180) / Math.PI) + 90));
}
function dispose(){
m_turretDirection = null;
m_path.dispose();
m_path = null;
m_steed.dispose();
m_steed = null;
m_turret.dispose();
m_turret = null;
m_game.getContainer().removeChild(m_avatar);
m_avatar = null;
m_game = null;
}
function addHitpointBonus(_arg1:Number){
setMaximumHitpoints((m_maximumHitpoints * (1 + _arg1)));
}
function moveLeftDELETE(){
m_movementDirection = k_moveLeft;
}
function intersectsCircle(_arg1:Number, _arg2:Vector2):Boolean{
var _local3:Vector2;
if (!(visible)){
return (false);
};
if (isDead()){
return (false);
};
_local3 = new Vector2(this.x, this.y);
if (Intersect.testCircleAndCircle(_arg1, _arg2, m_radius, _local3)){
return (true);
};
return (false);
}
function canFire():Boolean{
return ((m_timeTillNextFire <= 0));
}
function addProjectileSpeedBonus(_arg1:Number){
m_projectileSpeedBonus = (m_projectileSpeedBonus + _arg1);
}
function respawn(){
m_isDead = false;
this.visible = true;
m_timeBeforeRespawn = -1;
m_hitpoints = m_maximumHitpoints;
changeHitpointDisplay();
}
function getAngleOnPath():int{
var _local1:Number;
var _local2:int;
_local1 = (m_path_position / m_path.length);
_local2 = (m_path.angleAt(_local1) * k_radiansToDegrees);
return (_local2);
}
function fire(_arg1:Number, _arg2:Number):Boolean{
if (isDead()){
return (false);
};
if (!(canFire())){
return (false);
};
m_splatter.visible = false;
m_game.sendFireEvent(this, _arg1, _arg2);
m_game.playSound((m_soundType + "Attack"));
if (m_hasCharged){
trace("Reimplement charge handling logic");
} else {
fireRegular();
};
m_chargeRequired = -1;
m_timeTillNextFire = (m_weaponData.fireDelay * (1 - (m_refireRateBonus - 1)));
m_hasCharged = false;
return (true);
}
function updateRespawn(_arg1:Number){
if (m_timeBeforeRespawn >= 0){
m_timeBeforeRespawn = (m_timeBeforeRespawn - _arg1);
if (m_timeBeforeRespawn < 0){
respawn();
};
};
}
function pointTurretTo(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:DisplayObject;
var _local6:int;
_local3 = (_arg1 - this.x);
_local4 = (_arg2 - this.y);
m_turretDirection.x = _local3;
m_turretDirection.y = _local4;
m_turretDirection.normalize(k_turretOffset);
_local5 = getTurret();
if (_local5 != null){
_local5.x = m_turretDirection.x;
_local5.y = m_turretDirection.y;
_local6 = m_turretDirection.getAngle();
_local5.rotation = (_local6 + 90);
};
}
function moveRightDELETE(){
m_movementDirection = k_moveRight;
}
function addAlly(_arg1:Player){
m_allies.push(_arg1);
}
function respondToBulletHit(_arg1:Collider){
var _local2:int;
var _local3:Player;
var _local4:GEffect;
if (isDead()){
return;
};
_local2 = _arg1.getHitpoints();
_local2 = Math.min(_local2, m_hitpoints);
m_hitpoints = (m_hitpoints - _local2);
_arg1.takeDamage(_local2);
if (isLocalPlayer()){
m_game.getScore().DamageTaken = (m_game.getScore().DamageTaken + _local2);
};
_local3 = _arg1.getOwner();
if (((!((_local3 == null))) && (_local3.isLocalPlayer()))){
m_game.getScore().ShotsHit++;
};
if (m_hitpoints <= 0){
if (((!((_local3 == null))) && (_local3.isLocalPlayer()))){
m_game.getScore().Kills++;
};
_local4 = new GEffect("Magical_explosion", "magical_explosion");
_local4.alpha = 0.8;
_local4.x = this.x;
_local4.y = this.y;
m_game.addChild(_local4);
m_game.playSound((m_soundType + "Death"));
kill(_arg1);
} else {
m_game.playSound((m_soundType + "Hurt"));
};
changeHitpointDisplay();
}
function beginCharging(){
}
function getFireDirection():Vector2{
return (m_turretDirection.clone());
}
function changeHitpointDisplay(){
var _local1:Number;
var _local2:ColorTransform;
var _local3:int;
var _local4:int;
var _local5:int;
if (isDead()){
return;
};
_local1 = (m_hitpoints / m_maximumHitpoints);
_local2 = new ColorTransform();
_local3 = Math.ceil((_local1 * 160));
_local4 = Math.ceil(((_local1 * 510) - 0xFF));
_local5 = Math.ceil(((_local1 * 510) - 0xFF));
_local2.redOffset = _local3;
_local2.greenOffset = _local4;
_local2.blueOffset = _local5;
this.m_avatar.transform.colorTransform = _local2;
m_hitpointFlashTime = k_timePerHitpointFlash;
}
function getProjectileSpeedBonus():Number{
return (m_projectileSpeedBonus);
}
function updateCharging(_arg1:Number){
var _local2:int;
if (m_chargeRequired > 0){
m_chargeRequired = (m_chargeRequired - _arg1);
_local2 = (k_chargeRequired / 4);
if (m_chargeRequired < (k_chargeRequired - _local2)){
m_splatter.show();
m_splatter.setRadiusPercentage((m_chargeRequired / k_chargeRequired));
};
if (m_chargeRequired <= 0){
m_hasCharged = true;
};
};
}
function kill(_arg1:Collider){
m_isDead = true;
this.visible = false;
m_game.handlePlayerDied(this, _arg1);
}
function addRefireRateBonus(_arg1:Number){
m_refireRateBonus = (m_refireRateBonus + _arg1);
}
function updateMouse(_arg1:int, _arg2:int, _arg3:Number){
var _local4:Number;
var _local5:Number;
var _local6:Vector2;
var _local7:int;
var _local8:Vector2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Point;
var _local16:Number;
pointTurretTo(_arg1, _arg2);
_local4 = (_arg1 - this.x);
_local5 = (_arg2 - this.y);
_local6 = new Vector2(_local4, _local5);
_local7 = getAngleOnPath();
_local8 = new Vector2(1, 0);
_local8.setAngle(_local7);
_local9 = _local6.dot(_local8);
_local10 = 110;
_local10 = (_local10 * m_movementSpeedBonus);
_local9 = Math.min(_local9, _local10);
_local9 = Math.max(_local9, -(_local10));
_local11 = m_path.length;
_local12 = (m_path_position / _local11);
_local13 = m_path_position;
_local13 = (_local13 + ((_arg3 * _local9) / 1000));
if (m_canWrapAround){
if (_local13 > _local11){
_local13 = (_local13 - _local11);
};
if (_local13 < 0){
_local13 = (_local13 + _local11);
};
};
_local13 = Math.min(_local13, _local11);
_local13 = Math.max(_local13, 0);
_local14 = (_local13 / _local11);
if (_local12 != _local14){
_local14 = m_game.handlePlayerMoved(this, _local12, _local14);
};
_local15 = m_path.pointAt(_local14);
this.x = _local15.x;
this.y = _local15.y;
m_path_position = (_local14 * _local11);
_local7 = (m_path.angleAt(_local14) * k_radiansToDegrees);
_local7 = (_local7 % 180);
_local16 = 50;
if (_local9 < -(_local16)){
_local7 = (_local7 + 270);
} else {
if (_local9 > _local16){
_local7 = (_local7 + 90);
} else {
_local7 = (_local6.getAngle() + 90);
};
};
m_steed.setRotation(_local7);
}
public function get x():Number{
return (this.m_avatar.x);
}
public function get y():Number{
return (this.m_avatar.y);
}
public function get rotation():Number{
return (this.m_avatar.rotation);
}
function setMaximumHitpoints(_arg1:int){
m_maximumHitpoints = _arg1;
m_hitpoints = m_maximumHitpoints;
changeHitpointDisplay();
}
function fireRegular(){
var _local1:DisplayObject;
m_weaponData.fire(m_game, this);
_local1 = getTurret();
_local1.visible = false;
}
function getRadius():Number{
return (m_radius);
}
public function get visible():Boolean{
return (this.m_avatar.visible);
}
function scheduleRespawn(_arg1:int){
m_timeBeforeRespawn = _arg1;
}
function stopMovingDELETE(){
m_movementDirection = k_moveStop;
}
function initialize(){
}
function setPath(_arg1:Path){
m_path = _arg1;
attachToPath();
}
function isLocalPlayer():Boolean{
return ((m_game.getLocalPlayer() == this));
}
function getColor():uint{
return (m_color);
}
function isDead():Boolean{
return (m_isDead);
}
function addMovementSpeedBonus(_arg1:Number){
m_movementSpeedBonus = (m_movementSpeedBonus + _arg1);
}
function hasAlly(_arg1:Player){
var _local2:int;
_local2 = 0;
while (_local2 < m_allies.length) {
if (_arg1 == m_allies[_local2]){
return (true);
};
_local2++;
};
return (false);
}
function getPath():Path{
return (m_path);
}
function owns(_arg1:Collider){
return ((this == _arg1.getOwner()));
}
function updateHitpointFlash(_arg1:Number){
var _local2:Number;
var _local3:ColorTransform;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
if (m_hitpointFlashTime <= 0){
return;
};
m_hitpointFlashTime = (m_hitpointFlashTime - _arg1);
if (m_hitpointFlashTime <= 0){
_local7 = (m_hitpoints / m_maximumHitpoints);
if (_local7 < 0.3){
changeHitpointDisplay();
if (_local7 < 0.15){
m_hitpointFlashTime = (k_timePerHitpointFlash / 2);
};
} else {
this.m_avatar.transform.colorTransform = new ColorTransform();
};
return;
};
_local2 = (m_hitpointFlashTime / k_timePerHitpointFlash);
_local3 = this.m_avatar.transform.colorTransform;
_local4 = (_local3.redOffset * _local2);
_local5 = (_local3.greenOffset * _local2);
_local6 = (_local3.blueOffset * _local2);
_local3.redOffset = _local4;
_local3.greenOffset = _local5;
_local3.blueOffset = _local6;
this.m_avatar.transform.colorTransform = _local3;
}
function makePathWrappable(){
m_canWrapAround = true;
}
public function set visible(_arg1:Boolean):void{
this.m_avatar.visible = _arg1;
}
function attachToPath(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Point;
_local1 = m_path.length;
_local2 = (m_path_position / _local1);
_local3 = m_path_position;
if (m_canWrapAround){
if (_local3 > _local1){
_local3 = (_local3 - _local1);
};
if (_local3 < 0){
_local3 = (_local3 + _local1);
};
};
_local3 = Math.min(_local3, _local1);
_local3 = Math.max(_local3, 0);
_local4 = (_local3 / _local1);
_local5 = m_path.pointAt(_local4);
this.x = _local5.x;
this.y = _local5.y;
m_path_position = (_local4 * _local1);
}
function getTurret():DisplayObject{
return (m_turret);
}
public function set x(_arg1:Number):void{
this.m_avatar.x = _arg1;
}
public function set y(_arg1:Number):void{
this.m_avatar.y = _arg1;
}
function updateTimeTillNextFire(_arg1:Number){
var _local2:DisplayObject;
if (m_timeTillNextFire > 0){
m_timeTillNextFire = (m_timeTillNextFire - _arg1);
if (canFire()){
_local2 = getTurret();
_local2.visible = true;
};
};
}
public function set rotation(_arg1:Number):void{
this.m_avatar.rotation = _arg1;
}
}
}//package
Section 187
//PreviousLevelList (PreviousLevelList)
package {
import flash.events.*;
import com.gamedozer.utils.*;
import flash.display.*;
public class PreviousLevelList extends MovieClip {
var m_progressCompleted:CampaignListEnd;
var m_levelList:Array;
public function PreviousLevelList(){
m_progressCompleted = null;
m_levelList = new Array();
update();
}
function clear(){
var _local1:int;
_local1 = 0;
while (_local1 < m_levelList.length) {
removeChild(m_levelList[_local1]);
_local1++;
};
m_levelList.splice(0);
}
function update(){
var _local1:Array;
var _local2:int;
var _local3:Boolean;
var _local4:int;
var _local5:String;
var _local6:Level;
var _local7:CampaignListEntry;
if (m_levelList.length != 0){
clear();
};
_local1 = LevelList.getLevelList(LevelList.k_campaignMode, UI_Campaign.k_storyPart);
_local2 = 1;
_local2 = Math.min(_local1.length, _local2);
_local3 = true;
_local4 = 0;
while (_local4 < _local2) {
_local5 = _local1[_local4];
_local6 = LevelList.lookupLevel(_local5);
_local7 = new CampaignListEntry();
_local7.y = (_local4 * _local7.height);
_local7.title_txt.text = _local5;
_local7.addEventListener(MouseEvent.CLICK, Delegate.create(this, load, _local5));
m_levelList.push(_local7);
addChild(_local7);
if (_local6.getOrder() > BMStorage.getSingleton().getInt(UI_Campaign.k_lastLevelKey, 0)){
_local3 = false;
break;
};
_local4++;
};
if (((_local3) && ((m_progressCompleted == null)))){
m_progressCompleted = new CampaignListEnd();
m_progressCompleted.y = this.height;
addChild(m_progressCompleted);
};
}
function load(_arg1:Event, _arg2:String){
var _local3:MovieClip;
var _local4:UI_Campaign;
_local3 = (this.parent as MovieClip);
_local4 = (_local3.parent.parent as UI_Campaign);
_local4.showLevelInfo(_arg2);
}
}
}//package
Section 188
//ResourceLoader (ResourceLoader)
package {
import com.gamedozer.utils.*;
import com.gamedozer.graphics.*;
import flash.display.*;
import flash.media.*;
class ResourceLoader {
static const k_Blast:String = "Blast";
static const k_Dagger:String = "Dagger";
static const k_DoubleAxe:String = "DoubleAxe";
static const k_Scimitar:String = "Scimitar";
static const k_Scarlet:String = "Scarlet";
static const k_Disc:String = "Disc";
static const k_Sword:String = "Sword";
static const k_Bat:String = "Bat";
static const k_Gyena:String = "Gyena";
static const k_Slag:String = "Slag";
static const k_Javelin:String = "Javelin";
static const k_Hammer:String = "Hammer";
static const k_Kite:String = "Kite";
static const k_Lance:String = "Lance";
static const k_Warrior:String = "Warrior";
static const k_Gryphon:String = "Gryphon";
static const k_Behelmut:String = "Behelmut";
static const k_Mage:String = "Mage";
static const k_Pegasus:String = "Pegasus";
static const k_Rogue:String = "Rogue";
static const k_Chakram:String = "Chakram";
static var m_sheetLoader:TileSheetLoader;
static var m_resourceManager:ResourceManager;
static function preloadResources(){
var _local1:XML;
var _local2:XML;
_local1 = <resources>
<use profile="internal"/>
<profile name="internal">
<resource type="bitmap" name="Warrior_Base" internal="Warrior_Base.png"/>
<resource type="bitmap" name="Warrior_Mask" internal="Warrior_Mask.png"/>
<resource type="bitmap" name="Mage_Base" internal="Mage_Base.png"/>
<resource type="bitmap" name="Mage_Mask" internal="Mage_Mask.png"/>
<resource type="bitmap" name="Rogue_Base" internal="Rogue_Base.png"/>
<resource type="bitmap" name="Rogue_Mask" internal="Rogue_Mask.png"/>
<resource type="bitmap" name="Scarlet_Base" internal="Scarlet_Base.png"/>
<resource type="bitmap" name="Scarlet_Mask" internal="Scarlet_Mask.png"/>
<resource type="bitmap" name="Chakram_Base" internal="Chakram_Base.png"/>
<resource type="bitmap" name="Chakram_Mask" internal="Chakram_Mask.png"/>
<resource type="bitmap" name="DoubleAxe_Base" internal="DoubleAxe_Base.png"/>
<resource type="bitmap" name="DoubleAxe_Mask" internal="DoubleAxe_Mask.png"/>
<resource type="bitmap" name="Dagger_Base" internal="Dagger_Base.png"/>
<resource type="bitmap" name="Dagger_Mask" internal="Dagger_Mask.png"/>
<resource type="bitmap" name="Javelin_Base" internal="Javelin_Base.png"/>
<resource type="bitmap" name="Javelin_Mask" internal="Javelin_Mask.png"/>
<resource type="bitmap" name="Lance_Base" internal="Lance_Base.png"/>
<resource type="bitmap" name="Lance_Mask" internal="Lance_Mask.png"/>
<resource type="bitmap" name="Hammer_Base" internal="Hammer_Base.png"/>
<resource type="bitmap" name="Hammer_Mask" internal="Hammer_Mask.png"/>
<resource type="bitmap" name="Sword_Base" internal="Sword_Base.png"/>
<resource type="bitmap" name="Sword_Mask" internal="Sword_Mask.png"/>
<resource type="bitmap" name="Scimitar_Base" internal="Scimitar_Base.png"/>
<resource type="bitmap" name="Scimitar_Mask" internal="Scimitar_Mask.png"/>
<resource type="bitmap" name="Blast_Base" internal="Blast_Base.png"/>
<resource type="bitmap" name="Blast_Mask" internal="Blast_Mask.png"/>
<resource type="bitmap" name="Disc_Base" internal="Disc_Base.png"/>
<resource type="bitmap" name="Disc_Mask" internal="Disc_Mask.png"/>
<resource type="bitmap" name="Slag_Base" internal="Slag_Base.png"/>
<resource type="bitmap" name="Slag_Mask" internal="Slag_Mask.png"/>
<resource type="bitmap" name="Pegasus_Bottom" internal="Pegasus_Bottom.png"/>
<resource type="bitmap" name="Pegasus_Top" internal="Pegasus_Top.png"/>
<resource type="bitmap" name="Gryphon_Bottom" internal="Gryphon_Bottom.png"/>
<resource type="bitmap" name="Gryphon_Top" internal="Gryphon_Top.png"/>
<resource type="bitmap" name="Bat_Bottom" internal="Bat_Bottom.png"/>
<resource type="bitmap" name="Bat_Top" internal="Bat_Top.png"/>
<resource type="bitmap" name="Behelmut_Bottom" internal="Behelmut_Bottom.png"/>
<resource type="bitmap" name="Behelmut_Top" internal="Behelmut_Top.png"/>
<resource type="bitmap" name="Gyena_Bottom" internal="Gyena_Bottom.png"/>
<resource type="bitmap" name="Gyena_Top" internal="Gyena_Top.png"/>
<resource type="bitmap" name="Kite_Bottom" internal="Kite_Bottom.png"/>
<resource type="bitmap" name="Kite_Top" internal="Kite_Top.png"/>
<resource type="bitmap" name="Splatter_Mask" internal="Splatter_Mask.png"/>
<resource type="bitmap" name="Splatter_Base" internal="Splatter_Base.png"/>
<resource type="bitmap" name="Shock" internal="Shock.png"/>
<resource type="bitmap" name="Magical_explosion" internal="Magical_explosion.png"/>
<resource type="bitmap" name="OronAvatar_Base" internal="Oron_Base.png"/>
<resource type="bitmap" name="OronAvatar_Mask_Fabric" internal="Oron_Mask_Fabric.png"/>
<resource type="bitmap" name="OronAvatar_Mask_Hair" internal="Oron_Mask_Hair.png"/>
<resource type="bitmap" name="TepperAvatar_Base" internal="Tepper_Base.png"/>
<resource type="bitmap" name="TepperAvatar_Mask_Fabric" internal="Tepper_Mask_Fabric.png"/>
<resource type="bitmap" name="TepperAvatar_Mask_Hair" internal="Tepper_Mask_Hair.png"/>
<resource type="bitmap" name="ScarletAvatar_Base" internal="ScarletAvatar_Base.png"/>
<resource type="bitmap" name="ScarletAvatar_Mask_Fabric" internal="ScarletAvatar_Mask_Fabric.png"/>
<resource type="bitmap" name="ScarletAvatar_Mask_Hair" internal="ScarletAvatar_Mask_Hair.png"/>
<resource type="bitmap" name="Building_House_02" internal="Building_House_02.png"/>
<resource type="bitmap" name="Building_House_01" internal="Building_House_01.png"/>
<resource type="bitmap" name="Building_Townhall" internal="Building_Townhall.png"/>
<resource type="bitmap" name="Treasure" internal="Treasure.png"/>
<resource type="bitmap" name="MoveableTurret" internal="MoveableTurret.png"/>
<resource type="bitmap" name="Obelisk" internal="Obelisk.png"/>
<resource type="bitmap" name="Portal" internal="Portal.png"/>
<resource type="bitmap" name="UpgradeProjectileSpeed0" internal="UpgradeProjectileSpeed0.png"/>
<resource type="bitmap" name="UpgradeProjectileSpeed1" internal="UpgradeProjectileSpeed1.png"/>
<resource type="bitmap" name="UpgradeProjectileSpeed2" internal="UpgradeProjectileSpeed2.png"/>
<resource type="bitmap" name="UpgradeProjectileSpeed3" internal="UpgradeProjectileSpeed3.png"/>
<resource type="bitmap" name="UpgradeRefireRate0" internal="UpgradeRefireRate0.png"/>
<resource type="bitmap" name="UpgradeRefireRate1" internal="UpgradeRefireRate1.png"/>
<resource type="bitmap" name="UpgradeRefireRate2" internal="UpgradeRefireRate2.png"/>
<resource type="bitmap" name="UpgradeRefireRate3" internal="UpgradeRefireRate3.png"/>
<resource type="bitmap" name="UpgradeHitpoints0" internal="UpgradeHitpoints0.png"/>
<resource type="bitmap" name="UpgradeHitpoints1" internal="UpgradeHitpoints1.png"/>
<resource type="bitmap" name="UpgradeHitpoints2" internal="UpgradeHitpoints2.png"/>
<resource type="bitmap" name="UpgradeHitpoints3" internal="UpgradeHitpoints3.png"/>
<resource type="bitmap" name="UpgradeMovementSpeed0" internal="UpgradeMovementSpeed0.png"/>
<resource type="bitmap" name="UpgradeMovementSpeed1" internal="UpgradeMovementSpeed1.png"/>
<resource type="bitmap" name="UpgradeMovementSpeed2" internal="UpgradeMovementSpeed2.png"/>
<resource type="bitmap" name="UpgradeMovementSpeed3" internal="UpgradeMovementSpeed3.png"/>
<resource type="bitmap" name="ManualTurret_Mask" internal="ManualTurret_Mask.png"/>
<resource type="bitmap" name="ManualTurret_Base" internal="ManualTurret_Base.png"/>
<resource type="bitmap" name="Speech_Bubble" internal="SpeechBubbleBMP"/>
<resource type="sound" name="Oron_Story" internal="Oron_story.WAV"/>
<resource type="sound" name="Oron_Play" internal="Oron_play.WAV"/>
<resource type="sound" name="Oron_Win" internal="Oron_win.WAV"/>
<resource type="sound" name="Tepper_Story" internal="Tepper_story.WAV"/>
<resource type="sound" name="Tepper_Play" internal="Tepper_play.WAV"/>
<resource type="sound" name="Tepper_Win" internal="Tepper_win.WAV"/>
<resource type="sound" name="ui_music" internal="ui.WAV"/>
<resource type="sound" name="ButtonPress" internal="ButtonPress.wav"/>
<resource type="sound" name="EnemyDeath" internal="EnemyDeath.wav"/>
<resource type="sound" name="EnemyTalk" internal="EnemyTalk.wav"/>
<resource type="sound" name="FemaleAttack" internal="FemaleAttack.wav"/>
<resource type="sound" name="FemaleDeath" internal="FemaleDeath.wav"/>
<resource type="sound" name="FemaleHurt" internal="FemaleHurt.wav"/>
<resource type="sound" name="MaleAttack" internal="MaleAttack.wav"/>
<resource type="sound" name="MaleDeath" internal="MaleDeath.wav"/>
<resource type="sound" name="MaleHurt" internal="MaleHurt.wav"/>
<resource type="sound" name="RohkWalk" internal="RohkWalk.wav"/>
<resource type="sound" name="RohkAttack" internal="RohkAttack.wav"/>
</profile>
</resources>
;
m_resourceManager = new ResourceManager();
m_resourceManager.loadFromXML(_local1);
_local2 = <sheetloaders>
<sheetloader type="steed" defaultWidth="96" defaultHeight="96" defaultFrameCount="6" defaultTimeBetweenFrames="100">
<animation name="s"/>
<animation name="se"/>
<animation name="e"/>
<animation name="ne"/>
<animation name="n"/>
</sheetloader>
<sheetloader type="largeSteed" defaultWidth="128" defaultHeight="128" defaultFrameCount="6" defaultTimeBetweenFrames="100">
<animation name="s"/>
<animation name="se"/>
<animation name="e"/>
<animation name="ne"/>
<animation name="n"/>
</sheetloader>
<sheetloader type="character" defaultWidth="48" defaultHeight="48" defaultFrameCount="6" defaultTimeBetweenFrames="100">
<animation name="s"/>
<animation name="se"/>
<animation name="e"/>
<animation name="ne"/>
<animation name="n"/>
</sheetloader>
<sheetloader type="splatter" defaultWidth="128" defaultHeight="128" defaultFrameCount="3" defaultTimeBetweenFrames="100">
<animation name="default"/>
</sheetloader>
<sheetloader type="shock" defaultWidth="32" defaultHeight="32" defaultFrameCount="6" defaultTimeBetweenFrames="75">
<animation name="default"/>
</sheetloader>
<sheetloader type="small_house" defaultWidth="72" defaultHeight="120" defaultFrameCount="4" defaultTimeBetweenFrames="300">
<animation name="default"/>
<animation name="destroyed"/>
</sheetloader>
<sheetloader type="big_house" defaultWidth="96" defaultHeight="146" defaultFrameCount="4" defaultTimeBetweenFrames="300">
<animation name="default"/>
<animation name="destroyed"/>
</sheetloader>
<sheetloader type="townhall" defaultWidth="96" defaultHeight="150" defaultFrameCount="4" defaultTimeBetweenFrames="300">
<animation name="default"/>
</sheetloader>
<sheetloader type="treasure" defaultWidth="72" defaultHeight="72" defaultFrameCount="4" defaultTimeBetweenFrames="300">
<animation name="default"/>
</sheetloader>
<sheetloader type="magical_explosion" defaultWidth="96" defaultHeight="96" defaultFrameCount="6" defaultTimeBetweenFrames="75">
<animation name="default"/>
</sheetloader>
<sheetloader type="turret" defaultWidth="64" defaultHeight="64" defaultFrameCount="6" defaultTimeBetweenFrames="150">
<animation name="default"/>
</sheetloader>
<sheetloader type="obelisk" defaultWidth="48" defaultHeight="256" defaultFrameCount="4" defaultTimeBetweenFrames="150">
<animation name="default"/>
<animation name="destroyed"/>
</sheetloader>
<sheetloader type="portal" defaultWidth="100" defaultHeight="100" defaultFrameCount="4" defaultTimeBetweenFrames="150">
<animation name="loop"/>
<animation name="open"/>
</sheetloader>
<sheetloader type="rohk" defaultWidth="160" defaultHeight="250" defaultFrameCount="4" defaultTimeBetweenFrames="250">
<animation name="default" rowCount="2"/>
</sheetloader>
</sheetloaders>
;
m_sheetLoader = new TileSheetLoader();
m_sheetLoader.loadFromXML(_local2);
}
static function getBitmap(_arg1:String):Bitmap{
return (new Bitmap(m_resourceManager.getBitmapResource(_arg1)));
}
static function isLoading():Boolean{
return (m_resourceManager.isLoading());
}
static function createTileSheetAnimation(_arg1:String, _arg2:BitmapData){
return (m_sheetLoader.createTileSheetAnimation(_arg1, _arg2));
}
static function getSound(_arg1:String):Sound{
return (m_resourceManager.getSoundResource(_arg1));
}
static function getBitmapData(_arg1:String):BitmapData{
return (m_resourceManager.getBitmapResource(_arg1));
}
}
}//package
Section 189
//Score (Score)
package {
public class Score {
public var TimeToCompleteMultiplier:Number;
public var ObjectiveAchievedMultiplier:Number;
public var AccuracyMultiplier:Number;
public var ShotsFired:int;
public var KillsMultiplier:Number;
public var DamageTakenMultiplier:Number;
public var ShotsHitMultiplier:Number;
public var TimeToComplete:int;
public var ObjectiveAchieved:Boolean;
public var Kills:int;
public var ShotsFiredMultiplier:Number;
public var DamageTaken:int;
public var ShotsHit:int;
public function Score(){
ShotsFired = 0;
ShotsHit = 0;
Kills = 0;
TimeToComplete = 0;
DamageTaken = 0;
ObjectiveAchieved = false;
ShotsFiredMultiplier = -1;
ShotsHitMultiplier = 5;
KillsMultiplier = 50;
TimeToCompleteMultiplier = -0.01;
DamageTakenMultiplier = -5;
AccuracyMultiplier = 500;
ObjectiveAchievedMultiplier = 5000;
}
}
}//package
Section 190
//SpeechBubbleBMP (SpeechBubbleBMP)
package {
import flash.display.*;
public dynamic class SpeechBubbleBMP extends BitmapData {
public function SpeechBubbleBMP(){
super(0, 0);
}
}
}//package
Section 191
//StateKillQuota (StateKillQuota)
package {
import flash.utils.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import com.gamedozer.utils.*;
public class StateKillQuota implements IStateListener {
var m_killsRequired:int;
var m_game:UI_Game;
var m_ui_mc:KillsRequiredMC;
var m_killsAchieved:int;
public function StateKillQuota(_arg1:UI_Game, _arg2:int){
m_game = _arg1;
m_killsRequired = _arg2;
m_killsAchieved = 0;
m_ui_mc = new KillsRequiredMC();
m_game.getUIContainer().addChild(m_ui_mc);
m_ui_mc.x = 0;
m_ui_mc.y = 600;
updateDisplay();
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
public function handleColliderRemoved(_arg1:Collider){
if (_arg1.getOwner() != null){
return;
};
m_killsAchieved++;
updateDisplay();
}
function getKillsRemaining():int{
return ((m_killsRequired - m_killsAchieved));
}
public function handleUpdate(_arg1:Number){
}
public function dispose(){
m_game.getUIContainer().removeChild(m_ui_mc);
m_game = null;
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function updateDisplay(){
m_ui_mc.setKillsLeft(getKillsRemaining());
}
}
}//package
Section 192
//StateSurvival (StateSurvival)
package {
import flash.utils.*;
import com.gamedozer.utils.*;
public class StateSurvival implements IStateListener {
var m_game:UI_Game;
var m_playerStateMap:Dictionary;
var m_timer_mc:GameTimerMC;
var m_gameTime:int;// = -1
public function StateSurvival(_arg1:UI_Game){
m_playerStateMap = new Dictionary(true);
m_gameTime = -1;
super();
m_game = _arg1;
m_timer_mc = new GameTimerMC();
m_game.addChild(m_timer_mc);
m_timer_mc.x = 800;
m_timer_mc.y = 600;
}
public function handlePlayerFired(_arg1:Player, _arg2:Collider){
}
public function handlePlayerMoved(_arg1:Player, _arg2:Number){
}
function stopGameBecauseTimeRanOut(){
}
public function handleUpdate(_arg1:Number){
if (m_gameTime > 0){
m_gameTime = (m_gameTime - _arg1);
if (m_gameTime < 0){
m_gameTime = 0;
updateTimer();
stopGameBecauseTimeRanOut();
} else {
updateTimer();
};
};
}
function addPlayer(_arg1:Player, _arg2:int, _arg3:Boolean){
var _local4:SurvivalPlayerState;
_local4 = new SurvivalPlayerState();
_local4.lives = _arg2;
_local4.timeRunningOutMeansVictory = _arg3;
m_playerStateMap[_arg1] = _local4;
}
public function handleColliderRemoved(_arg1:Collider){
}
function setGameTime(_arg1:int){
m_gameTime = _arg1;
updateTimer();
}
public function dispose(){
m_game = null;
}
public function handlePlayerDied(_arg1:Player, _arg2:Collider){
var _local3:SurvivalPlayerState;
_local3 = m_playerStateMap[_arg1];
_local3.lives--;
if (_local3.lives < 0){
_arg1.scheduleRespawn(4000);
} else {
if (_local3.lives > 0){
_arg1.scheduleRespawn(4000);
};
};
}
public function handlePlayerControlsObstacle(_arg1:Player, _arg2:Obstacle){
}
function updateTimer(){
m_timer_mc.timeLeft_txt.text = StringParser.convertToClockTime(m_gameTime);
}
}
}//package
class SurvivalPlayerState {
private var timeRunningOutMeansVictory:Boolean;
private var lives:int;
private function SurvivalPlayerState(){
}
}
Section 193
//Tepper1_BGMC (Tepper1_BGMC)
package {
import flash.display.*;
public dynamic class Tepper1_BGMC extends MovieClip {
}
}//package
Section 194
//Tepper2_BGMC (Tepper2_BGMC)
package {
import flash.display.*;
public dynamic class Tepper2_BGMC extends MovieClip {
}
}//package
Section 195
//Tepper3_BGMC (Tepper3_BGMC)
package {
import flash.display.*;
public dynamic class Tepper3_BGMC extends MovieClip {
}
}//package
Section 196
//Tepper4_BGMC (Tepper4_BGMC)
package {
import flash.display.*;
public dynamic class Tepper4_BGMC extends MovieClip {
}
}//package
Section 197
//Tepper5_BGMC (Tepper5_BGMC)
package {
import flash.display.*;
public dynamic class Tepper5_BGMC extends MovieClip {
}
}//package
Section 198
//Timeline110_ea557c2f646ca438e4394b8e34bea1c (Timeline110_ea557c2f646ca438e4394b8e34bea1c)
package {
import flash.text.*;
import flash.display.*;
public dynamic class Timeline110_ea557c2f646ca438e4394b8e34bea1c extends MovieClip {
public var dialogue_txt:TextField;
public function Timeline110_ea557c2f646ca438e4394b8e34bea1c(){
addFrameScript(193, frame194);
}
function frame194(){
gotoAndPlay(1);
}
}
}//package
Section 199
//Timeline126_b5f03cd698b7a54c87e6eca1b9f1102b (Timeline126_b5f03cd698b7a54c87e6eca1b9f1102b)
package {
import flash.filters.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public dynamic class Timeline126_b5f03cd698b7a54c87e6eca1b9f1102b extends MovieClip {
public var blurDirection:int;
public var timer:Timer;
public var text_panel:MovieClip;
public var blurAmount:int;
public function Timeline126_b5f03cd698b7a54c87e6eca1b9f1102b(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
timer = new Timer(80);
timer.addEventListener(TimerEvent.TIMER, update);
timer.start();
blurDirection = 0;
blurAmount = 0;
}
public function blur(){
blurDirection = 1;
}
public function unblur(){
blurDirection = -1;
}
public function update(_arg1:Event){
var _local2:Array;
var _local3:BlurFilter;
if ((((blurAmount == 0)) && ((blurDirection == 0)))){
return;
};
blurAmount = (blurAmount + blurDirection);
if (blurAmount >= 20){
blurAmount = 20;
};
if (blurAmount <= 0){
blurAmount = 0;
};
_local2 = new Array();
if (blurAmount == 0){
} else {
_local3 = new BlurFilter(blurAmount, blurAmount);
_local2.push(_local3);
};
this.filters = _local2;
}
}
}//package
Section 200
//Timeline128_383e8596ab626240a0181baecdfeabd9 (Timeline128_383e8596ab626240a0181baecdfeabd9)
package {
import flash.text.*;
import flash.display.*;
public dynamic class Timeline128_383e8596ab626240a0181baecdfeabd9 extends MovieClip {
public var title_txt:TextField;
public var description_txt:TextField;
public var chapter_txt:TextField;
}
}//package
Section 201
//Timeline129_df4bc911474014fa0b553b8a1d45527 (Timeline129_df4bc911474014fa0b553b8a1d45527)
package {
import flash.display.*;
public dynamic class Timeline129_df4bc911474014fa0b553b8a1d45527 extends MovieClip {
public var scroll:MovieClip;
public function Timeline129_df4bc911474014fa0b553b8a1d45527(){
addFrameScript(27, frame28, 59, frame60);
}
function frame28(){
stop();
}
function frame60(){
gotoAndStop(1);
}
}
}//package
Section 202
//Timeline130_c37fba9a16c9f345815b96dbfba8b4b (Timeline130_c37fba9a16c9f345815b96dbfba8b4b)
package {
import flash.text.*;
import flash.display.*;
public dynamic class Timeline130_c37fba9a16c9f345815b96dbfba8b4b extends MovieClip {
public var title_txt:TextField;
public var previousLevelList:PreviousLevelList;
}
}//package
Section 203
//Timeline48_26f4c2cbb7e641963c65b73528c80 (Timeline48_26f4c2cbb7e641963c65b73528c80)
package {
import flash.display.*;
public dynamic class Timeline48_26f4c2cbb7e641963c65b73528c80 extends MovieClip {
public function Timeline48_26f4c2cbb7e641963c65b73528c80(){
addFrameScript(0, frame1);
}
function frame1(){
this.cacheAsBitmap = false;
}
}
}//package
Section 204
//Timeline58_fd577ad5c779804da32df2d26ab99cfb (Timeline58_fd577ad5c779804da32df2d26ab99cfb)
package {
import flash.display.*;
public dynamic class Timeline58_fd577ad5c779804da32df2d26ab99cfb extends MovieClip {
public function Timeline58_fd577ad5c779804da32df2d26ab99cfb(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 205
//Timeline60_d42118b371ebc94ca6cdd3c984474274 (Timeline60_d42118b371ebc94ca6cdd3c984474274)
package {
import flash.display.*;
public dynamic class Timeline60_d42118b371ebc94ca6cdd3c984474274 extends MovieClip {
public var tank:MovieClip;
}
}//package
Section 206
//Timeline62_02acd7a3168f842ab17ff53cc79a1a9 (Timeline62_02acd7a3168f842ab17ff53cc79a1a9)
package {
import flash.display.*;
public dynamic class Timeline62_02acd7a3168f842ab17ff53cc79a1a9 extends MovieClip {
public var mc1:MovieClip;
public var mc4:MovieClip;
}
}//package
Section 207
//Timeline64_1a8f92419bf1f41815d4c9878d8e9d0 (Timeline64_1a8f92419bf1f41815d4c9878d8e9d0)
package {
import flash.display.*;
public dynamic class Timeline64_1a8f92419bf1f41815d4c9878d8e9d0 extends MovieClip {
public var mc1:MovieClip;
public var mc0:MovieClip;
}
}//package
Section 208
//Timeline66_f0b0528e61acd4f8ab5b1ba4c2adb3 (Timeline66_f0b0528e61acd4f8ab5b1ba4c2adb3)
package {
import flash.display.*;
public dynamic class Timeline66_f0b0528e61acd4f8ab5b1ba4c2adb3 extends MovieClip {
public var mc0:MovieClip;
}
}//package
Section 209
//Timeline67_f3bf5755e0c8e64c9566339ef24b5b8f (Timeline67_f3bf5755e0c8e64c9566339ef24b5b8f)
package {
import flash.display.*;
public dynamic class Timeline67_f3bf5755e0c8e64c9566339ef24b5b8f extends MovieClip {
public var mc1:MovieClip;
public var mc2:MovieClip;
public var mc0:MovieClip;
}
}//package
Section 210
//Timeline71_abd594a9f5bc5f40b041e723fdf8b3ea (Timeline71_abd594a9f5bc5f40b041e723fdf8b3ea)
package {
import flash.display.*;
public dynamic class Timeline71_abd594a9f5bc5f40b041e723fdf8b3ea extends MovieClip {
public var mc1:MovieClip;
public var mc3:MovieClip;
public var mc2:MovieClip;
public var mc0:MovieClip;
}
}//package
Section 211
//Timeline76_d7ac783338cef468a8e1d9ebc36e15 (Timeline76_d7ac783338cef468a8e1d9ebc36e15)
package {
import flash.display.*;
public dynamic class Timeline76_d7ac783338cef468a8e1d9ebc36e15 extends MovieClip {
public function Timeline76_d7ac783338cef468a8e1d9ebc36e15(){
addFrameScript(53, frame54);
}
function frame54(){
stop();
}
}
}//package
Section 212
//UI_Campaign (UI_Campaign)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class UI_Campaign extends MovieClip {
public var left_scroll_mc:MovieClip;
var m_currentLevel:String;// = ""
var m_levelNames:Array;
var m_main:UI_Main;
var m_previousLevel_btn:DefaultButton;
var m_back_btn:DefaultButton;
var m_part:int;
public var right_scroll_mc:MovieClip;
public static const k_storyPart:int = 2;
static const k_lastLevelKey = "lastLevelCompleted";
static var m_lastLevelCompleted:int;
public function UI_Campaign(_arg1:UI_Main){
m_currentLevel = "";
super();
m_main = _arg1;
m_part = k_storyPart;
m_lastLevelCompleted = BMStorage.getSingleton().getInt(k_lastLevelKey, 0);
m_levelNames = LevelList.getLevelList(LevelList.k_campaignMode, k_storyPart);
right_scroll_mc.addEventListener(MouseEvent.CLICK, handleClick);
left_scroll_mc.visible = false;
}
function dispose(){
right_scroll_mc.removeEventListener(MouseEvent.CLICK, handleClick);
m_main = null;
}
function handleClick(_arg1:Event){
var _local2:UI_Equip;
_local2 = new UI_Equip(this, m_currentLevel);
stage.addChild(_local2);
_local2.initialize();
this.visible = false;
}
function initialize(){
initializeButtons();
showCampaignProgress();
}
function showCampaignProgress(){
var _local1:String;
var _local2:int;
var _local3:String;
var _local4:Level;
_local1 = "";
_local2 = 0;
while (_local2 < m_levelNames.length) {
_local3 = m_levelNames[_local2];
_local4 = LevelList.lookupLevel(_local3);
if (_local4.getPart() != m_part){
} else {
if (_local1 == ""){
_local1 = _local3;
};
if (_local4.getOrder() > m_lastLevelCompleted){
showLevelInfo(_local3);
return;
};
};
_local2++;
};
showLevelInfo(_local1);
}
function showPreviousLevels(_arg1:Event){
left_scroll_mc.visible = true;
left_scroll_mc.scroll.previousLevelList.update();
left_scroll_mc.gotoAndPlay("tweenIn");
right_scroll_mc.blur();
m_previousLevel_btn.visible = false;
}
function initializeButtons(){
var _local1:int;
m_back_btn = new DefaultButton();
addChild(m_back_btn);
m_back_btn.background_mc.addEventListener(MouseEvent.CLICK, back);
m_back_btn.x = (m_back_btn.width / 2);
m_back_btn.y = (600 - (m_back_btn.height / 2));
m_back_btn.m_label_txt.text = "Back";
m_previousLevel_btn = new DefaultButton();
addChild(m_previousLevel_btn);
m_previousLevel_btn.background_mc.addEventListener(MouseEvent.CLICK, showPreviousLevels);
m_previousLevel_btn.x = (m_previousLevel_btn.width / 2);
m_previousLevel_btn.y = (m_previousLevel_btn.height / 2);
m_previousLevel_btn.m_label_txt.text = "Previous Level";
}
function showLevelInfo(_arg1:String){
var _local2:Level;
var _local3:String;
var _local4:int;
var _local5:int;
if (left_scroll_mc.currentFrame != 1){
left_scroll_mc.gotoAndPlay("tweenOut");
};
m_previousLevel_btn.visible = true;
right_scroll_mc.unblur();
_local2 = LevelList.lookupLevel(_arg1);
m_currentLevel = _arg1;
_local3 = _local2.getDescription();
_local4 = _local2.getChapter();
_local5 = _local2.getPart();
right_scroll_mc.text_panel.description_txt.text = _local3;
right_scroll_mc.text_panel.chapter_txt.text = ("Chapter " + _local4);
right_scroll_mc.text_panel.title_txt.text = _arg1;
}
function back(_arg1:MouseEvent){
m_main.visible = true;
dispose();
stage.removeChild(this);
}
public static function completeLevel(_arg1:Level){
var _local2:int;
}
}
}//package
Section 213
//UI_CampaignList (UI_CampaignList)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class UI_CampaignList extends MovieClip {
var m_levelNames:Array;
var m_main:UI_Main;
public function UI_CampaignList(_arg1:UI_Main){
m_main = _arg1;
m_levelNames = LevelList.getLevelList(LevelList.k_campaignMode);
}
function dispose(){
m_main = null;
}
function loadLevel(_arg1:MouseEvent){
var _local2:String;
_local2 = _arg1.currentTarget.parent.m_label_txt.text;
executeLevelLoad(_local2);
}
function quit(_arg1:MouseEvent){
m_main.visible = true;
dispose();
stage.removeChild(this);
}
function initialize(){
initializeButtons();
initializePosition();
}
function executeLevelLoad(_arg1:String){
var _local2:UI_Game;
_local2 = new UI_Game(this);
stage.addChild(_local2);
_local2.initialize(_arg1);
this.visible = false;
}
function initializeButtons(){
var _local1:int;
var _local2:int;
var _local3:DefaultButton;
var _local4:String;
var _local5:DefaultButton;
_local2 = 0;
while (_local2 < m_levelNames.length) {
_local4 = m_levelNames[_local2];
_local5 = new DefaultButton();
addChild(_local5);
_local5.m_label_txt.text = _local4;
_local5.background_mc.addEventListener(MouseEvent.CLICK, loadLevel);
_local1 = (((_local2 + 0.5) * _local5.height) + 5);
_local5.x = (_local5.width / 2);
_local5.y = _local1;
_local2++;
};
_local3 = new DefaultButton();
addChild(_local3);
_local3.background_mc.addEventListener(MouseEvent.CLICK, quit);
_local3.x = (_local3.width / 2);
_local3.y = ((_local1 + _local3.height) + 5);
_local3.m_label_txt.text = "Quit";
}
function initializePosition(){
}
}
}//package
Section 214
//UI_Credits (UI_Credits)
package {
import flash.events.*;
import flash.net.*;
import flash.display.*;
public class UI_Credits extends MovieClip {
public var m_quit_btn:DisplayObject;
public var m_logo:DisplayObject;
var m_main:UI_Main;
public var m_linkButton:DisplayObject;
public function UI_Credits(_arg1:UI_Main){
m_main = _arg1;
}
function dispose(){
m_logo.removeEventListener(MouseEvent.CLICK, loadWebsite);
m_linkButton.removeEventListener(MouseEvent.CLICK, loadWebsite);
m_quit_btn.removeEventListener(MouseEvent.CLICK, quit);
m_main = null;
}
function quit(_arg1:MouseEvent){
m_main.visible = true;
dispose();
stage.removeChild(this);
}
function initialize(){
initializeButtons();
}
function initializeButtons(){
m_logo.addEventListener(MouseEvent.CLICK, loadWebsite);
m_linkButton.addEventListener(MouseEvent.CLICK, loadWebsite);
m_quit_btn.addEventListener(MouseEvent.CLICK, quit);
}
function loadWebsite(_arg1:MouseEvent){
var url:String;
var variables:URLVariables;
var request:URLRequest;
var a_event = _arg1;
url = "http://www.urbansquall.com";
variables = new URLVariables();
request = new URLRequest(url);
request.data = variables;
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
};
}
}
}//package
Section 215
//UI_Game (UI_Game)
package {
import flash.display.*;
import com.gamedozer.GameEvent.*;
import flash.events.*;
import com.gamedozer.audio.*;
import flash.media.*;
import flash.geom.*;
import com.gamedozer.misc.*;
import flash.filters.*;
import flash.utils.*;
import com.gamedozer.utils.*;
import com.gamedozer.math.*;
import flash.ui.*;
public class UI_Game extends Sprite {
var m_pauseButton:PauseBTN;
var m_endGameOnNextUpdate:Boolean;
var m_aiBrains:Array;
var m_gameEventQueue:GameEventQueue;
var m_score:Score;
var m_inputStatus_mc:MovieClip;
var m_obstacles:Array;
var m_isPaused:Boolean;
var m_speechBubble:DisplayObject;
var m_inputEnabled:Boolean;
var m_parent:DisplayObjectContainer;
var m_stateListeners:Array;
var m_drawTarget:Sprite;
var m_container:Sprite;
var m_level:Level;
var m_timeOfLastUpdate:Number;
var m_loop:Loop;
var m_pathEffect:Bitmap;
var m_localPlayer:Player;
var m_enableFiring:Boolean;
var m_uiContainer:Sprite;
var m_colliders:Array;
var m_players:Array;
var m_movers:Array;
var m_gameInitialData:GameInitialData;
static const k_radiansToDegrees:Number = 57.2957795;
public function UI_Game(_arg1:DisplayObjectContainer, _arg2:GameInitialData=null){
var _local3:BitmapData;
m_players = new Array();
m_aiBrains = new Array();
m_colliders = new Array();
m_obstacles = new Array();
m_movers = new Array();
m_stateListeners = new Array();
super();
m_parent = _arg1;
m_gameInitialData = _arg2;
m_gameEventQueue = new GameEventQueue();
m_speechBubble = null;
m_score = new Score();
m_container = new Sprite();
addChild(m_container);
m_uiContainer = new Sprite();
addChild(m_uiContainer);
m_inputStatus_mc = new InputStatusDisplayMC();
m_uiContainer.addChild(m_inputStatus_mc);
m_pauseButton = new PauseBTN();
m_uiContainer.addChild(m_pauseButton);
m_pauseButton.addEventListener(MouseEvent.CLICK, handlePauseButton);
m_pauseButton.x = (m_pauseButton.width / 2);
m_pauseButton.y = (m_pauseButton.height / 2);
m_inputEnabled = true;
m_enableFiring = true;
m_endGameOnNextUpdate = false;
m_loop = new Loop(null);
_local3 = new BitmapData(800, 600, true, 0);
m_pathEffect = new Bitmap(_local3);
m_container.addChild(m_pathEffect);
UIMusic.stop();
}
function enableInput(){
m_inputStatus_mc.play();
m_inputEnabled = true;
}
function showResultsScreen(){
stopLoop();
addChild(new UI_Results(this));
}
function handleFrame(_arg1:Event){
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:AIBrain;
var _local10:Player;
var _local11:Obstacle;
var _local12:Collider;
var _local13:ObstacleMover;
var _local14:IStateListener;
if (m_endGameOnNextUpdate){
quit();
return;
};
_local2 = calculateDeltaTime();
if (m_isPaused){
return;
};
this.stage.focus = this.stage;
m_score.TimeToComplete = (m_score.TimeToComplete + _local2);
updatePathEffect();
updateMouse(_local2);
updateKeyboard();
_local3 = 0;
while (_local3 < m_aiBrains.length) {
_local9 = m_aiBrains[_local3];
_local9.update(_local2);
_local3++;
};
_local4 = 0;
while (_local4 < m_players.length) {
_local10 = m_players[_local4];
_local10.updatePlayer(_local2);
_local4++;
};
_local5 = 0;
while (_local5 < m_obstacles.length) {
_local11 = m_obstacles[_local5];
_local11.updateObstacle(_local2);
_local5++;
};
_local6 = 0;
while (_local6 < m_colliders.length) {
_local12 = m_colliders[_local6];
_local12.updateCollider(_local2);
_local6++;
};
_local7 = 0;
while (_local7 < m_movers.length) {
_local13 = m_movers[_local7];
_local13.updateMover(_local2);
_local7++;
};
_local8 = 0;
while (_local8 < m_stateListeners.length) {
_local14 = m_stateListeners[_local8];
_local14.handleUpdate(_local2);
_local8++;
};
cleanupEntities();
m_level.update(_local2);
}
function dispose(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:AIBrain;
var _local8:Player;
var _local9:Obstacle;
var _local10:Collider;
var _local11:ObstacleMover;
var _local12:IStateListener;
m_level.cleanup();
removeEventListener(Event.ENTER_FRAME, handleFrame);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
stage.removeEventListener(Event.MOUSE_LEAVE, handleMouseLeave);
m_parent = null;
m_localPlayer = null;
_local1 = 0;
while (_local1 < m_aiBrains.length) {
_local7 = m_aiBrains[_local1];
_local7.dispose();
_local1++;
};
m_aiBrains.splice(0);
m_aiBrains = null;
_local2 = 0;
while (_local2 < m_players.length) {
_local8 = m_players[_local2];
_local8.dispose();
_local2++;
};
m_players.splice(0);
m_players = null;
_local3 = 0;
while (_local3 < m_obstacles.length) {
_local9 = m_obstacles[_local3];
_local9.dispose();
_local3++;
};
m_obstacles.splice(0);
m_obstacles = null;
_local4 = 0;
while (_local4 < m_colliders.length) {
_local10 = m_colliders[_local4];
_local10.dispose();
_local4++;
};
m_colliders.splice(0);
m_colliders = null;
_local5 = 0;
while (_local5 < m_movers.length) {
_local11 = m_movers[_local5];
_local11.dispose();
_local5++;
};
m_movers.splice(0);
m_movers = null;
_local6 = 0;
while (_local6 < m_stateListeners.length) {
_local12 = m_stateListeners[_local6];
_local12.dispose();
_local6++;
};
m_stateListeners.splice(0);
m_stateListeners = null;
m_level.setGame(null);
m_level = null;
}
function removeStateListener(_arg1:IStateListener){
var _local2:int;
var _local3:IStateListener;
_local2 = 0;
while (_local2 < m_stateListeners.length) {
_local3 = m_stateListeners[_local2];
if (_arg1 == _local3){
m_stateListeners.splice(_local2, 1);
return;
};
_local2++;
};
}
function playSound(_arg1:String){
var _local2:Sound;
_local2 = ResourceLoader.getSound(_arg1);
SoundSystem.getSingleton().playSound(_local2);
}
function addObstacle(_arg1:Obstacle){
m_obstacles.push(_arg1);
}
function showEscapeMenu(){
pause();
addChild(new UI_InGameMenu(this));
}
function quit(){
var _local1:UI_Campaign;
stopLoop();
UIMusic.play();
m_parent.visible = true;
_local1 = (m_parent as UI_Campaign);
if (_local1 != null){
trace("Showing campaign progress");
_local1.showCampaignProgress();
};
dispose();
parent.removeChild(this);
}
function hideSpeechBubble(){
if (m_speechBubble == null){
return;
};
getContainer().removeChild(m_speechBubble);
m_speechBubble = null;
}
function cleanupEntities(){
var _local1:int;
var _local2:Collider;
_local1 = (m_colliders.length - 1);
while (_local1 >= 0) {
_local2 = m_colliders[_local1];
_local2.dispose();
_local1--;
};
}
function removeCollider(_arg1:Collider){
var _local2:int;
var _local3:int;
var _local4:IStateListener;
var _local5:Collider;
_local2 = 0;
while (_local2 < m_stateListeners.length) {
_local4 = m_stateListeners[_local2];
_local4.handleColliderRemoved(_arg1);
_local2++;
};
_local3 = (m_colliders.length - 1);
while (_local3 >= 0) {
_local5 = m_colliders[_local3];
if (_local5 == _arg1){
m_colliders.splice(_local3, 1);
return;
};
_local3--;
};
}
function handlePlayerDied(_arg1:Player, _arg2:Collider){
var _local3:int;
var _local4:int;
var _local5:Collider;
var _local6:IStateListener;
_local3 = 0;
while (_local3 < m_colliders.length) {
_local5 = m_colliders[_local3];
if (_local5.getOwner() == _arg1){
_local5.die();
};
_local3++;
};
_local4 = 0;
while (_local4 < m_stateListeners.length) {
_local6 = m_stateListeners[_local4];
_local6.handlePlayerDied(_arg1, _arg2);
_local4++;
};
}
function addMover(_arg1:ObstacleMover){
m_movers.push(_arg1);
}
function addBrain(_arg1:AIBrain){
m_aiBrains.push(_arg1);
}
function handleMouseUp(_arg1:MouseEvent){
var _local2:Boolean;
if (!(m_inputEnabled)){
return;
};
if (!(m_enableFiring)){
return;
};
if (m_isPaused){
return;
};
_local2 = m_localPlayer.fire(this.stage.mouseX, this.stage.mouseY);
}
function getScore():Score{
return (m_score);
}
function addPlayer(_arg1:uint=0xFF00, _arg2:String="Warrior", _arg3:String="Gryphon", _arg4:String="DoubleAxe"):Player{
var _local5:Player;
_local5 = new Player(this, _arg1, _arg2, _arg3, _arg4);
m_players.push(_local5);
return (_local5);
}
function getLocalPlayer():Player{
return (m_localPlayer);
}
function unpause(){
m_isPaused = false;
}
function getClosestPlayer(_arg1:int, _arg2:int, _arg3:Array=null):Player{
var _local4:Player;
var _local5:Number;
var _local6:int;
var _local7:Player;
var _local8:Vector2;
var _local9:Number;
var _local10:Boolean;
var _local11:int;
var _local12:Player;
_local4 = null;
_local5 = 100000;
_local6 = 0;
while (_local6 < m_players.length) {
_local7 = m_players[_local6];
if (_local7.isDead()){
} else {
if (_arg3 != null){
_local10 = false;
_local11 = 0;
while (_local11 < _arg3.length) {
_local12 = _arg3[_local11];
if (_local12 == _local7){
_local10 = true;
break;
};
_local11++;
};
//unresolved if
} else {
_local8 = new Vector2((_local7.x - _arg1), (_local7.y - _arg2));
_local9 = _local8.length();
if (_local5 > _local9){
_local5 = _local9;
_local4 = _local7;
};
};
};
_local6++;
};
return (_local4);
}
function handlePlayerMoved(_arg1:Player, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
var _local5:int;
var _local6:Obstacle;
_local4 = _arg3;
_local5 = (m_obstacles.length - 1);
while (_local5 >= 0) {
_local6 = m_obstacles[_local5];
_local4 = _local6.handlePlayerMoved(_arg1, _arg2, _local4);
_local5--;
};
return (_local4);
}
function testCircleVersusPlayers(_arg1:Number, _arg2:Vector2):Array{
var _local3:Array;
var _local4:int;
var _local5:Player;
_local3 = new Array();
_local4 = 0;
while (_local4 < m_players.length) {
_local5 = m_players[_local4];
if (_local5.intersectsCircle(_arg1, _arg2)){
_local3.push(_local5);
};
_local4++;
};
return (_local3);
}
function getGameEventQueue():GameEventQueue{
return (m_gameEventQueue);
}
function testCircleVersusBullets(_arg1:Number, _arg2:Vector2):Array{
var _local3:Array;
var _local4:int;
var _local5:Collider;
_local3 = new Array();
_local4 = 0;
while (_local4 < m_colliders.length) {
_local5 = m_colliders[_local4];
if (_local5.intersectsCircle(_arg1, _arg2)){
_local3.push(_local5);
};
_local4++;
};
return (_local3);
}
function removeObstacle(_arg1:Obstacle){
var _local2:int;
var _local3:Obstacle;
_local2 = (m_obstacles.length - 1);
while (_local2 >= 0) {
_local3 = m_obstacles[_local2];
if (_local3 == _arg1){
m_obstacles.splice(_local2, 1);
return;
};
_local2--;
};
}
function testCircleVersusObstacles(_arg1:Number, _arg2:Vector2):Array{
var _local3:Array;
var _local4:int;
var _local5:Obstacle;
_local3 = new Array();
_local4 = 0;
while (_local4 < m_obstacles.length) {
_local5 = m_obstacles[_local4];
if (_local5.intersectsCircle(_arg1, _arg2)){
_local3.push(_local5);
};
_local4++;
};
return (_local3);
}
function getUIContainer(){
return (m_uiContainer);
}
function addStateListener(_arg1:IStateListener){
m_stateListeners.push(_arg1);
}
function sendFireEvent(_arg1:Player, _arg2:Number, _arg3:Number){
var _local4:int;
var _local5:Obstacle;
_local4 = 0;
while (_local4 < m_obstacles.length) {
_local5 = m_obstacles[_local4];
_local5.handlePlayerFired(_arg1, _arg2, _arg3);
_local4++;
};
}
function makeLocalPlayer(_arg1:Player){
var _local2:Storage;
var _local3:int;
var _local4:String;
var _local5:Boolean;
var _local6:String;
var _local7:Boolean;
var _local8:String;
var _local9:Boolean;
var _local10:String;
var _local11:Boolean;
m_localPlayer = _arg1;
_local2 = BMStorage.getSingleton();
_local3 = 1;
while (_local3 <= 3) {
_local4 = (UI_Equip.k_upgradeProjectileSpeed + _local3);
_local5 = _local2.getBoolean(_local4, false);
if (_local5){
m_localPlayer.addProjectileSpeedBonus((_local3 * 0.05));
};
_local6 = (UI_Equip.k_upgradeRefireRate + _local3);
_local7 = _local2.getBoolean(_local6, false);
if (_local7){
m_localPlayer.addRefireRateBonus((_local3 * 0.05));
};
_local8 = (UI_Equip.k_upgradeHitpoints + _local3);
_local9 = _local2.getBoolean(_local8, false);
if (_local9){
m_localPlayer.addHitpointBonus((_local3 * 0.075));
};
_local10 = (UI_Equip.k_upgradeMovementSpeed + _local3);
_local11 = _local2.getBoolean(_local10, false);
if (_local11){
m_localPlayer.addMovementSpeedBonus((_local3 * 0.1));
};
_local3++;
};
}
function updateMouse(_arg1:Number){
var _local2:Number;
var _local3:Number;
if (m_localPlayer == null){
return;
};
if (!(m_inputEnabled)){
return;
};
_local2 = this.stage.mouseX;
_local3 = this.stage.mouseY;
m_localPlayer.updateMouse(_local2, _local3, _arg1);
}
function handleMouseLeave(_arg1:Event){
trace("Mouse leave");
if (m_isPaused){
return;
};
showEscapeMenu();
}
function getIndexedPlayer(_arg1:int):Player{
return (m_players[_arg1]);
}
function getPlayers():Array{
return (m_players);
}
function drawPath(_arg1:Path, _arg2:uint){
var _local3:Graphics;
_local3 = getDrawTarget().graphics;
_local3.lineStyle(5, _arg2, 100);
_arg1.draw(_local3);
}
function handlePauseButton(_arg1:MouseEvent){
showEscapeMenu();
}
function initialize(_arg1:String){
var _local2:Array;
var _local3:GlowFilter;
addEventListener(Event.ENTER_FRAME, handleFrame);
stage.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
stage.addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
stage.addEventListener(Event.MOUSE_LEAVE, handleMouseLeave);
m_drawTarget = new Sprite();
_local2 = m_drawTarget.filters;
_local3 = new GlowFilter(0xFFFFFF);
_local2.push(_local3);
m_drawTarget.filters = _local2;
m_container.addChild(m_drawTarget);
m_timeOfLastUpdate = getTimer();
m_level = LevelList.lookupLevel(_arg1);
m_level.setGame(this);
m_level.populateGame();
m_isPaused = false;
}
function lookupBrain(_arg1:Player){
var _local2:int;
var _local3:AIBrain;
_local2 = 0;
while (_local2 < m_aiBrains.length) {
_local3 = m_aiBrains[_local2];
if (_local3.getPlayer() == _arg1){
return (_local3);
};
_local2++;
};
return (null);
}
function handleMouseDown(_arg1:MouseEvent){
if (!(m_inputEnabled)){
return;
};
if (!(m_enableFiring)){
return;
};
if (m_isPaused){
return;
};
m_localPlayer.beginCharging();
}
function signalEndGame(){
m_endGameOnNextUpdate = true;
}
function showSpeechBubble(_arg1:int, _arg2:int){
if (m_speechBubble == null){
m_speechBubble = new Bitmap(ResourceLoader.getBitmapData("Speech_Bubble"));
getContainer().addChild(m_speechBubble);
};
m_speechBubble.x = ((_arg1 - m_speechBubble.width) - 8);
m_speechBubble.y = ((_arg2 - m_speechBubble.height) - 15);
getContainer().setChildIndex(m_speechBubble, (getContainer().numChildren - 1));
}
function addCollider(_arg1:Collider){
m_colliders.push(_arg1);
}
function queueGameEvent(_arg1:GameEventInterface){
m_gameEventQueue.queueGameEvent(_arg1);
}
function disableInput(){
m_inputStatus_mc.gotoAndPlay(1);
m_inputEnabled = false;
}
function stopLoop(){
SoundSystem.getSingleton().stopLoop();
}
function updatePathEffect(){
var _local1:BitmapData;
var _local2:int;
var _local3:Matrix;
var _local4:ColorTransform;
var _local5:Sprite;
}
function updateKeyboard(){
var _local1:Boolean;
_local1 = InputKeyboard.isDown(Keyboard.ESCAPE);
if (_local1){
showEscapeMenu();
return;
};
if (!(m_inputEnabled)){
return;
};
if (m_localPlayer == null){
return;
};
}
function getContainer():Sprite{
return (m_container);
}
function getLevel():Level{
return (m_level);
}
function calculateDeltaTime():Number{
var _local1:Number;
var _local2:Number;
_local1 = getTimer();
_local2 = (_local1 - m_timeOfLastUpdate);
m_timeOfLastUpdate = _local1;
return (_local2);
}
function getInitialData():GameInitialData{
return (m_gameInitialData);
}
function getDrawTarget():Sprite{
return (m_drawTarget);
}
function pause(){
m_isPaused = true;
}
function playLoop(_arg1:String){
var _local2:Sound;
_local2 = ResourceLoader.getSound(_arg1);
SoundSystem.getSingleton().playLoop(_local2);
}
}
}//package
Section 216
//UI_InGameMenu (UI_InGameMenu)
package {
import flash.events.*;
import com.gamedozer.audio.*;
import flash.display.*;
public class UI_InGameMenu extends MovieClip {
var m_game:UI_Game;
var m_muteButton:DefaultButton;
public function UI_InGameMenu(_arg1:UI_Game){
m_game = _arg1;
initializeButtons();
}
function dispose(){
this.parent.removeChild(this);
m_game = null;
}
function returnToGame(_arg1:Event){
this.stage.focus = m_game;
m_game.unpause();
this.dispose();
}
function quit(_arg1:Event){
m_game.quit();
m_game = null;
}
function toggleMute(_arg1:Event){
SoundSystem.getSingleton().toggleMute();
m_muteButton.m_label_txt.text = (SoundSystem.getSingleton().isMuted()) ? "Unmute" : "Mute";
BMStorage.getSingleton().setBoolean("audio", SoundSystem.getSingleton().isMuted());
}
function initializeButtons(){
var _local1:Number;
var _local2:Number;
var _local3:DefaultButton;
var _local4:DefaultButton;
_local1 = 400;
_local2 = 300;
_local3 = new DefaultButton();
addChild(_local3);
_local3.m_label_txt.text = "Return to Game";
_local3.background_mc.addEventListener(MouseEvent.CLICK, returnToGame);
_local3.x = _local1;
_local3.y = _local2;
_local2 = (_local2 + _local3.height);
m_muteButton = new DefaultButton();
addChild(m_muteButton);
m_muteButton.m_label_txt.text = (SoundSystem.getSingleton().isMuted()) ? "Unmute" : "Mute";
m_muteButton.background_mc.addEventListener(MouseEvent.CLICK, toggleMute);
m_muteButton.x = _local1;
m_muteButton.y = _local2;
_local2 = (_local2 + _local3.height);
_local4 = new DefaultButton();
addChild(_local4);
_local4.background_mc.addEventListener(MouseEvent.CLICK, quit);
_local4.x = _local1;
_local4.y = _local2;
_local4.m_label_txt.text = "Quit";
}
}
}//package
Section 217
//UI_Main (UI_Main)
package {
import flash.events.*;
import flash.net.*;
import flash.display.*;
import com.gamedozer.utils.*;
public class UI_Main extends MovieClip {
public var m_campaign_btn:DisplayObject;
public var m_logo:DisplayObject;
public var m_show_assets_btn:DisplayObject;
public var m_options_btn:DisplayObject;
public var m_survival_btn:DisplayObject;
public var m_put_this_game:DisplayObject;
public var m_sponsor_logo:DisplayObject;
public var m_credits_btn:DisplayObject;
var m_fpsCounter:FPSCounter;
public var m_campaignList_btn:DisplayObject;
public function UI_Main(){
m_campaign_btn.addEventListener(MouseEvent.CLICK, loadCampaign);
m_options_btn.addEventListener(MouseEvent.CLICK, loadOptions);
m_credits_btn.addEventListener(MouseEvent.CLICK, loadCredits);
m_sponsor_logo.addEventListener(MouseEvent.CLICK, loadSponsorWebsite);
m_put_this_game.addEventListener(MouseEvent.CLICK, loadPutThisGameOnYourSite);
BMSettings.createSingleton();
BMStorage.createSingleton();
}
function loadOptions(_arg1:MouseEvent){
var _local2:UI_Options;
_local2 = new UI_Options(this);
stage.addChild(_local2);
_local2.initialize();
this.visible = false;
}
function loadPutThisGameOnYourSite(_arg1:MouseEvent){
var url:String;
var request:URLRequest;
var a_event = _arg1;
url = "http://www.arcadetown.com/free_content/index.asp";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
};
}
function loadCampaign(_arg1:MouseEvent){
var _local2:UI_Campaign;
_local2 = new UI_Campaign(this);
stage.addChild(_local2);
_local2.initialize();
this.visible = false;
}
function dispose(){
m_campaign_btn.removeEventListener(MouseEvent.CLICK, loadCampaign);
m_survival_btn.removeEventListener(MouseEvent.CLICK, loadSurvival);
m_show_assets_btn.removeEventListener(MouseEvent.CLICK, loadShowAssets);
m_campaignList_btn.removeEventListener(MouseEvent.CLICK, loadCampaignList);
m_credits_btn.removeEventListener(MouseEvent.CLICK, loadCredits);
m_logo.removeEventListener(MouseEvent.CLICK, loadWebsite);
m_sponsor_logo.removeEventListener(MouseEvent.CLICK, loadSponsorWebsite);
m_campaign_btn = null;
m_survival_btn = null;
}
function loadSurvival(_arg1:String){
var _local2:UI_Survival;
_local2 = new UI_Survival(this);
stage.addChild(_local2);
_local2.initialize();
this.visible = false;
}
function loadShowAssets(_arg1:MouseEvent){
var _local2:UI_ShowAssets;
_local2 = new UI_ShowAssets(this);
stage.addChild(_local2);
_local2.initialize();
this.visible = false;
}
function initialize(){
initializePosition();
UIMusic.play();
}
function loadSponsorWebsite(_arg1:MouseEvent){
var url:String;
var request:URLRequest;
var a_event = _arg1;
url = "http://www.arcadetown.com/index.asp?gameid=battlemachyjadebandit";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
};
}
function loadCampaignList(_arg1:MouseEvent){
var _local2:UI_CampaignList;
_local2 = new UI_CampaignList(this);
stage.addChild(_local2);
_local2.initialize();
this.visible = false;
}
function loadWebsite(_arg1:MouseEvent){
var url:String;
var request:URLRequest;
var a_event = _arg1;
url = "http://www.urbansquall.com";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
};
}
function initializePosition(){
}
function loadCredits(_arg1:MouseEvent){
var _local2:UI_Credits;
_local2 = new UI_Credits(this);
stage.addChild(_local2);
_local2.initialize();
this.visible = false;
}
}
}//package
Section 218
//UI_Options (UI_Options)
package {
import com.gamedozer.audio.*;
import flash.events.*;
import flash.display.*;
public class UI_Options extends MovieClip {
public var m_quit_btn:DisplayObject;
public var m_reset_progress_btn:DisplayObject;
var m_main:UI_Main;
var m_effectsButton:DefaultButton;
var m_effectsAreDisabled:Boolean;
var m_muteButton:DefaultButton;
public static const k_effectsAreDisabled:String = "EffectsAreDisabled";
public function UI_Options(_arg1:UI_Main){
m_main = _arg1;
m_effectsAreDisabled = BMStorage.getSingleton().getBoolean(k_effectsAreDisabled, false);
}
function toggleEffects(_arg1:Event){
m_effectsAreDisabled = !(m_effectsAreDisabled);
m_effectsButton.m_label_txt.text = (m_effectsAreDisabled) ? "Enable Effects" : "Disable Effects";
BMStorage.getSingleton().setBoolean(k_effectsAreDisabled, m_effectsAreDisabled);
}
function dispose(){
m_main = null;
}
function quit(_arg1:MouseEvent){
m_main.visible = true;
dispose();
stage.removeChild(this);
}
function initialize(){
initializeButtons();
}
function toggleMute(_arg1:Event){
SoundSystem.getSingleton().toggleMute();
m_muteButton.m_label_txt.text = (SoundSystem.getSingleton().isMuted()) ? "Unmute" : "Mute";
BMStorage.getSingleton().setBoolean("audio", SoundSystem.getSingleton().isMuted());
}
function resetProgress(_arg1:Event){
BMStorage.getSingleton().clear();
}
function initializeButtons(){
var _local1:Number;
var _local2:Number;
_local1 = 300;
_local2 = 400;
m_muteButton = new DefaultButton();
addChild(m_muteButton);
m_muteButton.m_label_txt.text = (SoundSystem.getSingleton().isMuted()) ? "Unmute" : "Mute";
m_muteButton.background_mc.addEventListener(MouseEvent.CLICK, toggleMute);
m_muteButton.x = _local2;
m_muteButton.y = _local1;
_local1 = (_local1 + m_muteButton.height);
m_effectsButton = new DefaultButton();
addChild(m_effectsButton);
m_effectsButton.m_label_txt.text = (m_effectsAreDisabled) ? "Enable Effects" : "Disable Effects";
m_effectsButton.background_mc.addEventListener(MouseEvent.CLICK, toggleEffects);
m_effectsButton.x = _local2;
m_effectsButton.y = _local1;
m_quit_btn.addEventListener(MouseEvent.CLICK, quit);
m_reset_progress_btn.addEventListener(MouseEvent.CLICK, resetProgress);
}
}
}//package
Section 219
//UI_Results (UI_Results)
package {
import flash.filters.*;
import com.gamedozer.utils.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.display.*;
public class UI_Results extends MovieClip {
public var m_accuracy_multiplier:TextField;
public var m_total_score:TextField;
var m_timer:Timer;
public var m_objective_achieved_multiplier:TextField;
public var level_title_txt:TextField;
public var m_shots_fired:TextField;
public var m_shots_fired_score:TextField;
public var m_shots_hit_score:TextField;
var m_levelNames:Array;
public var m_damage_taken_multiplier:TextField;
public var m_damage_taken_score:TextField;
public var m_time_to_complete_score:TextField;
public var m_kills:TextField;
var m_game:UI_Game;
public var m_shots_fired_multiplier:TextField;
public var m_damage_taken:TextField;
public var m_accuracy:TextField;
public var m_time_to_complete:TextField;
public var m_shots_hit:TextField;
public var m_shots_hit_multiplier:TextField;
public var m_time_to_complete_multiplier:TextField;
public var m_objective_achieved:TextField;
public var m_kills_score:TextField;
public var m_accuracy_score:TextField;
public var m_objective_achieved_score:TextField;
public var m_kills_multiplier:TextField;
public function UI_Results(_arg1:UI_Game){
var _local2:Number;
var _local3:Number;
var _local4:BlurFilter;
var _local5:Array;
var _local6:Level;
var _local7:Score;
var _local8:Number;
var _local9:int;
var _local10:int;
super();
m_game = _arg1;
_local2 = 5;
_local3 = 5;
_local4 = new BlurFilter(_local2, _local3, BitmapFilterQuality.LOW);
_local5 = new Array();
_local5.push(_local4);
m_game.getContainer().filters = _local5;
_local6 = m_game.getLevel();
level_title_txt.text = (_local6.getName() + " Score");
_local7 = m_game.getScore();
_local7.TimeToComplete = (Math.floor((_local7.TimeToComplete / 1000)) * 1000);
if (_local7.ShotsFired > 0){
_local8 = Math.floor(((100 * _local7.ShotsHit) / _local7.ShotsFired));
} else {
_local8 = 0;
};
m_shots_fired.text = StringParser.convertToCurrency(_local7.ShotsFired);
m_shots_hit.text = StringParser.convertToCurrency(_local7.ShotsHit);
m_kills.text = StringParser.convertToCurrency(_local7.Kills);
m_accuracy.text = (_local8 + "%");
m_time_to_complete.text = StringParser.convertToClockTime(_local7.TimeToComplete);
m_damage_taken.text = StringParser.convertToCurrency(_local7.DamageTaken);
m_objective_achieved.text = (_local7.ObjectiveAchieved) ? "Success" : "Failure";
m_shots_fired_multiplier.text = (" x " + _local7.ShotsFiredMultiplier);
m_shots_hit_multiplier.text = (" x " + _local7.ShotsHitMultiplier);
m_kills_multiplier.text = (" x " + _local7.KillsMultiplier);
m_accuracy_multiplier.text = (" x " + _local7.AccuracyMultiplier);
m_time_to_complete_multiplier.text = ((" x " + (_local7.TimeToCompleteMultiplier * 1000)) + " per s.");
m_damage_taken_multiplier.text = (" x " + _local7.DamageTakenMultiplier);
m_objective_achieved_multiplier.text = (" x " + _local7.ObjectiveAchievedMultiplier);
m_shots_fired_score.text = StringParser.convertToCurrency((_local7.ShotsFired * _local7.ShotsFiredMultiplier));
m_shots_hit_score.text = StringParser.convertToCurrency((_local7.ShotsHit * _local7.ShotsHitMultiplier));
m_kills_score.text = StringParser.convertToCurrency((_local7.Kills * _local7.KillsMultiplier));
m_accuracy_score.text = StringParser.convertToCurrency(((_local8 * _local7.AccuracyMultiplier) / 100));
m_time_to_complete_score.text = StringParser.convertToCurrency(Math.floor((_local7.TimeToComplete * _local7.TimeToCompleteMultiplier)));
m_damage_taken_score.text = StringParser.convertToCurrency((_local7.DamageTaken * _local7.DamageTakenMultiplier));
m_objective_achieved_score.text = (_local7.ObjectiveAchieved) ? StringParser.convertToCurrency(_local7.ObjectiveAchievedMultiplier) : "0";
_local9 = 0;
_local9 = (_local9 + (_local7.ShotsFired * _local7.ShotsFiredMultiplier));
_local9 = (_local9 + (_local7.ShotsHit * _local7.ShotsHitMultiplier));
_local9 = (_local9 + (_local7.Kills * _local7.KillsMultiplier));
_local9 = (_local9 + Math.floor(((_local7.ShotsHit / _local7.ShotsFired) * _local7.AccuracyMultiplier)));
_local9 = (_local9 + Math.floor((_local7.TimeToComplete * _local7.TimeToCompleteMultiplier)));
_local9 = (_local9 + (_local7.DamageTaken * _local7.DamageTakenMultiplier));
_local9 = (_local9 + (_local7.ObjectiveAchieved) ? _local7.ObjectiveAchievedMultiplier : 0);
if (_local9 > 0){
m_total_score.text = StringParser.convertToCurrency(_local9);
} else {
m_total_score.text = "0";
};
_local10 = BMStorage.getSingleton().getInt(UI_Equip.k_goldAvailable, 0);
if (_local9 > 0){
_local10 = (_local10 + _local9);
BMStorage.getSingleton().setInt(UI_Equip.k_goldAvailable, _local10);
};
initialize();
}
function dispose(){
m_game = null;
}
function initialize(){
initializeButtons();
this.alpha = 0;
m_timer = new Timer(50);
m_timer.addEventListener(TimerEvent.TIMER, fadeIn);
m_timer.start();
}
function finish(_arg1:MouseEvent){
m_game.signalEndGame();
dispose();
}
function fadeIn(_arg1:Event){
this.alpha = (this.alpha + 0.05);
if (this.alpha >= 1){
this.alpha = 1;
m_timer.stop();
m_timer.removeEventListener(TimerEvent.TIMER, fadeIn);
};
}
function initializeButtons(){
var _local1:DefaultButton;
_local1 = new DefaultButton();
addChild(_local1);
_local1.background_mc.addEventListener(MouseEvent.CLICK, finish);
_local1.x = (800 - (_local1.width / 2));
_local1.y = (600 - (_local1.height / 2));
_local1.m_label_txt.text = "Finish";
}
}
}//package
Section 220
//UI_ShowAssets (UI_ShowAssets)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
import com.gamedozer.math.*;
import com.gamedozer.utils.*;
public class UI_ShowAssets extends MovieClip {
var m_weapons:Array;
var m_steeds:Array;
var m_color:uint;// = 0xFF
var m_main:UI_Main;
var m_riders:Array;
var m_steedExample:GSteed;
var m_colorText:TextField;
var m_colorPicker:Sprite;
public function UI_ShowAssets(_arg1:UI_Main){
m_weapons = new Array();
m_steeds = new Array();
m_riders = new Array();
m_color = 0xFF;
super();
m_main = _arg1;
}
function handleFrame(_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:int;
var _local6:GRider;
var _local7:Number;
var _local8:Number;
var _local9:Vector2;
var _local10:int;
var _local11:int;
var _local12:GSteed;
_local2 = this.stage.mouseX;
_local3 = this.stage.mouseY;
_local4 = 0;
while (_local4 < m_riders.length) {
_local6 = m_riders[_local4];
_local7 = (_local2 - _local6.x);
_local8 = (_local3 - _local6.y);
_local9 = new Vector2(_local7, _local8);
_local10 = (_local9.getAngle() + 90);
_local11 = 45;
while (_local10 > (360 - (_local11 / 2))) {
_local10 = (_local10 - 360);
};
while (_local10 < (-(_local11) / 2)) {
_local10 = (_local10 + 360);
};
if ((((_local10 < (360 - (_local11 / 2)))) && ((_local10 >= (180 + (_local11 / 2)))))){
_local6.scaleX = -1;
if ((((_local10 < (360 - (_local11 / 2)))) && ((_local10 >= (360 - ((3 * _local11) / 2)))))){
_local10 = 45;
} else {
if ((((_local10 < (360 - ((3 * _local11) / 2)))) && ((_local10 >= (360 - ((5 * _local11) / 2)))))){
_local10 = 90;
} else {
_local10 = 135;
};
};
} else {
_local6.scaleX = 1;
};
_local6.setRotation(_local10);
_local4++;
};
_local5 = 0;
while (_local5 < m_steeds.length) {
_local12 = m_steeds[_local5];
_local7 = (_local2 - _local12.x);
_local8 = (_local3 - _local12.y);
_local9 = new Vector2(_local7, _local8);
_local10 = (_local9.getAngle() + 90);
_local12.setRotation(_local10);
_local5++;
};
}
function displayRiderAndSteed(){
var _local1:String;
var _local2:String;
var _local3:GRider;
m_steedExample = new GSteed();
addChild(m_steedExample);
_local1 = "Gryphon";
m_steedExample.load(_local1);
_local2 = "Warrior";
_local3 = new GRider(m_color);
m_steedExample.insertRider(_local3);
_local3.load(_local2);
m_steedExample.x = 500;
m_steedExample.y = 500;
m_steeds.push(m_steedExample);
}
function dispose(){
removeEventListener(Event.ENTER_FRAME, handleFrame);
m_main = null;
}
function displaySteed(_arg1:int, _arg2:int, _arg3:String){
var _local4:GSteed;
_local4 = new GSteed();
addChild(_local4);
_local4.load(_arg3);
_local4.addEventListener(MouseEvent.CLICK, Delegate.create(this, changeActiveSteed, _arg3));
_local4.x = _arg1;
_local4.y = _arg2;
m_steeds.push(_local4);
}
function changeActiveRider(_arg1:MouseEvent, _arg2:String){
var _local3:GRider;
_local3 = new GRider(m_color);
m_steedExample.insertRider(_local3);
_local3.load(_arg2);
m_steedExample.reset();
}
public function toRGB(_arg1:uint):String{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
_local2 = "";
_local3 = "";
_local4 = "";
_local5 = _arg1.toString(16);
if (_local5.length == 1){
_local5 = "000000";
} else {
if (_local5.length == 4){
_local5 = ("00" + _local5);
};
};
_local2 = parseInt(_local5.substr(0, 2), 16).toString();
_local4 = parseInt(_local5.substr(2, 2), 16).toString();
_local3 = parseInt(_local5.substr(4, 2), 16).toString();
return (((((_local2 + ",") + _local4) + ",") + _local3));
}
function quit(_arg1:MouseEvent){
m_main.visible = true;
dispose();
stage.removeChild(this);
}
function initialize(){
addEventListener(Event.ENTER_FRAME, handleFrame);
initializeButtons();
displayWeapons();
displayCharacters();
displaySteeds();
displayRiderAndSteed();
displayColorPicker();
}
function changeColor(_arg1:MouseEvent){
var _local2:Bitmap;
var _local3:uint;
var _local4:*;
var _local5:GRider;
var _local6:int;
var _local7:int;
var _local8:GWeapon;
_local2 = Bitmap(m_colorPicker.getChildAt(0));
_local3 = _local2.bitmapData.getPixel(m_colorPicker.mouseX, m_colorPicker.mouseY);
m_color = _local3;
m_colorText.text = ((String(m_color) + " = ") + toHEX(m_color));
_local4 = m_steedExample.getRider().getType();
_local5 = new GRider(m_color);
m_steedExample.insertRider(_local5);
_local5.load(_local4);
m_steedExample.reset();
_local6 = 0;
while (_local6 < m_riders.length) {
_local5 = m_riders[_local6];
removeChild(_local5);
_local6++;
};
m_riders.splice(0);
displayCharacters();
_local7 = 0;
while (_local7 < m_weapons.length) {
_local8 = m_weapons[_local7];
_local8.setColor(m_color);
_local7++;
};
}
function displayCharacter(_arg1:int, _arg2:int, _arg3:String){
var _local4:GRider;
_local4 = new GRider(m_color);
addChild(_local4);
_local4.load(_arg3);
_local4.addEventListener(MouseEvent.MOUSE_UP, Delegate.create(this, changeActiveRider, _arg3));
_local4.x = _arg1;
_local4.y = _arg2;
m_riders.push(_local4);
}
public function toHEX(_arg1:uint):String{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
_local2 = "";
_local3 = "";
_local4 = "";
_local5 = _arg1.toString(16);
if (_local5.length == 1){
_local5 = "000000";
} else {
if (_local5.length == 4){
_local5 = ("00" + _local5);
};
};
return (_local5);
}
function displayColorPicker(){
var _local1:TextFormat;
m_colorPicker = new Sprite();
m_colorPicker.addChild(new Bitmap(new ColorpickerBMP()));
addChild(m_colorPicker);
m_colorPicker.x = 50;
m_colorPicker.y = 300;
m_colorPicker.scaleX = 2;
m_colorPicker.scaleY = 2;
_local1 = new TextFormat();
_local1.font = "Verdana";
_local1.color = 0;
_local1.size = 14;
m_colorText = new TextField();
m_colorText.defaultTextFormat = _local1;
m_colorText.text = "";
m_colorText.selectable = false;
m_colorText.autoSize = "left";
m_colorText.y = 580;
addChild(m_colorText);
m_colorPicker.addEventListener(MouseEvent.CLICK, changeColor);
}
function displayWeapons(){
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = 1;
_local2 = 30;
_local3 = 35;
var _temp1 = _local1;
_local1 = (_local1 + 1);
displayWeapon((_temp1 * _local2), _local3, "DoubleAxe");
var _temp2 = _local1;
_local1 = (_local1 + 1);
displayWeapon((_temp2 * _local2), _local3, "Lance");
var _temp3 = _local1;
_local1 = (_local1 + 1);
displayWeapon((_temp3 * _local2), _local3, "Hammer");
var _temp4 = _local1;
_local1 = (_local1 + 1);
displayWeapon((_temp4 * _local2), _local3, "Sword");
var _temp5 = _local1;
_local1 = (_local1 + 1);
displayWeapon((_temp5 * _local2), _local3, "Chakram");
var _temp6 = _local1;
_local1 = (_local1 + 1);
displayWeapon((_temp6 * _local2), _local3, "Scimitar");
var _temp7 = _local1;
_local1 = (_local1 + 1);
displayWeapon((_temp7 * _local2), _local3, "Dagger");
var _temp8 = _local1;
_local1 = (_local1 + 1);
displayWeapon((_temp8 * _local2), _local3, "Javelin");
}
function displayWeapon(_arg1:int, _arg2:int, _arg3:String){
var _local4:GWeapon;
_local4 = new GWeapon(m_color, _arg3);
addChild(_local4);
_local4.x = _arg1;
_local4.y = _arg2;
m_weapons.push(_local4);
}
function changeActiveSteed(_arg1:MouseEvent, _arg2:String){
m_steedExample.load(_arg2);
m_steedExample.reset();
}
function displayCharacters(){
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = 1;
_local2 = 48;
_local3 = 150;
var _temp1 = _local1;
_local1 = (_local1 + 1);
displayCharacter((_temp1 * _local2), _local3, "Mage");
var _temp2 = _local1;
_local1 = (_local1 + 1);
displayCharacter((_temp2 * _local2), _local3, "Rogue");
var _temp3 = _local1;
_local1 = (_local1 + 1);
displayCharacter((_temp3 * _local2), _local3, "Warrior");
}
function initializeButtons(){
var _local1:DefaultButton;
_local1 = new DefaultButton();
addChild(_local1);
_local1.background_mc.addEventListener(MouseEvent.CLICK, quit);
_local1.x = (800 - _local1.width);
_local1.y = (-(_local1.height) / 2);
_local1.m_label_txt.text = "Quit";
}
function displaySteeds(){
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = 1;
_local2 = 96;
_local3 = 250;
var _temp1 = _local1;
_local1 = (_local1 + 1);
displaySteed((_temp1 * _local2), _local3, "Gryphon");
var _temp2 = _local1;
_local1 = (_local1 + 1);
displaySteed((_temp2 * _local2), _local3, "Pegasus");
var _temp3 = _local1;
_local1 = (_local1 + 1);
displaySteed((_temp3 * _local2), _local3, "Bat");
var _temp4 = _local1;
_local1 = (_local1 + 1);
displaySteed((_temp4 * _local2), _local3, "Gyena");
var _temp5 = _local1;
_local1 = (_local1 + 1);
displaySteed((_temp5 * _local2), _local3, "Kirin");
var _temp6 = _local1;
_local1 = (_local1 + 1);
displaySteed((_temp6 * _local2), _local3, "Behelmut");
}
}
}//package
Section 221
//UI_Survival (UI_Survival)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class UI_Survival extends MovieClip {
var m_levelNames:Array;
var m_main:UI_Main;
public function UI_Survival(_arg1:UI_Main){
m_main = _arg1;
m_levelNames = LevelList.getLevelList(LevelList.k_survivalMode);
}
function dispose(){
m_main = null;
}
function loadLevel(_arg1:MouseEvent){
var _local2:String;
_local2 = _arg1.currentTarget.parent.m_label_txt.text;
executeLevelLoad(_local2);
}
function quit(_arg1:MouseEvent){
m_main.visible = true;
dispose();
stage.removeChild(this);
}
function initialize(){
initializeButtons();
initializePosition();
}
function executeLevelLoad(_arg1:String){
var _local2:UI_Game;
_local2 = new UI_Game(this);
stage.addChild(_local2);
_local2.initialize(_arg1);
this.visible = false;
}
function initializeButtons(){
var _local1:int;
var _local2:int;
var _local3:DefaultButton;
var _local4:String;
var _local5:DefaultButton;
_local2 = 0;
while (_local2 < m_levelNames.length) {
_local4 = m_levelNames[_local2];
_local5 = new DefaultButton();
addChild(_local5);
_local5.m_label_txt.text = _local4;
_local5.background_mc.addEventListener(MouseEvent.CLICK, loadLevel);
_local1 = (((_local2 + 0.5) * _local5.height) + 5);
_local5.x = (_local5.width / 2);
_local5.y = _local1;
_local2++;
};
_local3 = new DefaultButton();
addChild(_local3);
_local3.background_mc.addEventListener(MouseEvent.CLICK, quit);
_local3.x = (_local3.width / 2);
_local3.y = ((_local1 + _local3.height) + 5);
_local3.m_label_txt.text = "Quit";
}
function initializePosition(){
}
}
}//package
Section 222
//UIMusic (UIMusic)
package {
import flash.media.*;
import com.gamedozer.audio.*;
public class UIMusic {
static var m_musicChannel:SoundChannel;
public static function stop(){
SoundSystem.getSingleton().stopLoop();
}
public static function play(){
var _local1:Sound;
_local1 = ResourceLoader.getSound("ui_music");
SoundSystem.getSingleton().playLoop(_local1);
}
}
}//package
Section 223
//Urbansquall_SplashMC (Urbansquall_SplashMC)
package {
import flash.display.*;
public dynamic class Urbansquall_SplashMC extends MovieClip {
public function Urbansquall_SplashMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 224
//WeaponData (WeaponData)
package {
import com.gamedozer.graphics.*;
import com.gamedozer.math.*;
public class WeaponData {
public var trailers:Array;// = null
public var turretResource:String;
public var fireDelay:Number;// = 250
public var spread:Array;// = null
public var hitpoints:int;// = 1
public var projectileResource:String;
public var projectileSpeed:Number;// = 0.3
public function WeaponData(){
projectileSpeed = 0.3;
fireDelay = 250;
spread = null;
trailers = null;
hitpoints = 1;
super();
spread = new Array();
spread.push(0);
trailers = new Array();
trailers.push(1);
}
function createBullet(_arg1:UI_Game, _arg2:Player):Collider{
var _local3:uint;
var _local4:GWeapon;
var _local5:Collider;
if (_arg2 == null){
_local3 = DynamicColor.getRGB(Colorizer.kGrey);
} else {
if (_arg2.isLocalPlayer()){
_arg1.getScore().ShotsFired++;
};
_local3 = _arg2.getColor();
};
_local4 = new GWeapon(_local3, projectileResource);
_arg1.addChild(_local4);
_local5 = new Collider(_arg1, _arg2, _local4);
_local5.initialize();
_local5.setMaximumHitpoints(hitpoints);
return (_local5);
}
function fire(_arg1:UI_Game, _arg2:Player){
var _local3:Vector2;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Collider;
_local3 = _arg2.getFireDirection();
_local4 = _local3.getAngle();
_local5 = 0;
while (_local5 < trailers.length) {
_local6 = 0;
while (_local6 < spread.length) {
_local7 = createBullet(_arg1, _arg2);
_local7.setCanCollideWithColliders();
_local3 = new Vector2(0, 0);
_local3.setAngle((_local4 + spread[_local6]));
_local7.setMovementSpeed(((projectileSpeed * trailers[_local5]) * _arg2.getProjectileSpeedBonus()));
_local7.setMovementDirection(_local3.x, _local3.y);
_local3.normalize(((_arg2.getRadius() + _local7.getRadius()) + 20));
_local7.x = (_arg2.x + _local3.x);
_local7.y = (_arg2.y + _local3.y);
_local6++;
};
_local5++;
};
}
}
}//package
Section 225
//WeaponDataFactory (WeaponDataFactory)
package {
import flash.utils.*;
public class WeaponDataFactory {
static var s_weaponDataMap:Dictionary = null;
private static function initialize(){
if (s_weaponDataMap != null){
return;
};
s_weaponDataMap = new Dictionary(false);
initializeDatas();
}
private static function initializeDatas(){
var _local1:WeaponData;
var _local2:WeaponData;
var _local3:Array;
var _local4:WeaponData;
var _local5:Array;
var _local6:WeaponData;
var _local7:WeaponData;
var _local8:WeaponData;
var _local9:WeaponData;
var _local10:WeaponData;
_local1 = new WeaponData();
_local1.turretResource = ResourceLoader.k_Scimitar;
_local1.projectileResource = ResourceLoader.k_Scimitar;
_local1.projectileSpeed = 0.2;
_local1.fireDelay = 550;
_local1.hitpoints = 20;
s_weaponDataMap[ResourceLoader.k_Scimitar] = _local1;
_local2 = new WeaponData();
_local2.turretResource = ResourceLoader.k_Dagger;
_local2.projectileResource = ResourceLoader.k_Dagger;
_local2.projectileSpeed = 0.3;
_local2.fireDelay = 750;
_local3 = new Array();
_local3.push(-15);
_local3.push(0);
_local3.push(15);
_local2.spread = _local3;
_local2.hitpoints = 10;
s_weaponDataMap[ResourceLoader.k_Dagger] = _local2;
_local4 = new WeaponData();
_local4.turretResource = ResourceLoader.k_Chakram;
_local4.projectileResource = ResourceLoader.k_Chakram;
_local4.projectileSpeed = 0.25;
_local4.fireDelay = 650;
_local5 = new Array();
_local5.push(1);
_local5.push(0.85);
_local5.push(0.7);
_local4.trailers = _local5;
_local4.hitpoints = 5;
s_weaponDataMap[ResourceLoader.k_Chakram] = _local4;
_local6 = new WeaponData();
_local6.turretResource = ResourceLoader.k_Javelin;
_local6.projectileResource = ResourceLoader.k_Javelin;
_local6.projectileSpeed = 0.25;
_local6.fireDelay = 350;
_local6.hitpoints = 10;
s_weaponDataMap[ResourceLoader.k_Javelin] = _local6;
_local7 = new WeaponData();
_local7.turretResource = ResourceLoader.k_Blast;
_local7.projectileResource = ResourceLoader.k_Blast;
_local7.projectileSpeed = 0.3;
_local7.fireDelay = 200;
_local7.hitpoints = 10;
s_weaponDataMap[ResourceLoader.k_Blast] = _local7;
_local8 = new WeaponData();
_local8.turretResource = ResourceLoader.k_DoubleAxe;
_local8.projectileResource = ResourceLoader.k_DoubleAxe;
_local8.projectileSpeed = 0.2;
_local8.fireDelay = 350;
_local8.hitpoints = 20;
s_weaponDataMap[ResourceLoader.k_DoubleAxe] = _local8;
_local9 = new WeaponData();
_local9.turretResource = ResourceLoader.k_Disc;
_local9.projectileResource = ResourceLoader.k_Disc;
_local9.projectileSpeed = 0.25;
_local9.fireDelay = 350;
_local9.hitpoints = 10;
s_weaponDataMap[ResourceLoader.k_Disc] = _local9;
_local10 = new WeaponData();
_local10.turretResource = ResourceLoader.k_Slag;
_local10.projectileResource = ResourceLoader.k_Slag;
_local10.projectileSpeed = 0.25;
_local10.fireDelay = 350;
_local10.hitpoints = 10;
s_weaponDataMap[ResourceLoader.k_Slag] = _local10;
}
static function lookup(_arg1:String):WeaponData{
var _local2:WeaponData;
initialize();
_local2 = s_weaponDataMap[_arg1];
if (_local2 != null){
return (_local2);
};
trace(("WeaponDataFactory: Unknown weapon type. " + _arg1));
return (null);
}
}
}//package