Section 1
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public final class PropTween {
public var target:Object;
public var property:String;
public var start:Number;
public var change:Number;
public var name:String;
public var priority:int;
public var isPlugin:Boolean;
public var nextNode:PropTween;
public var prevNode:PropTween;
public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
if (_arg7){
_arg7.prevNode = this;
this.nextNode = _arg7;
};
this.priority = _arg8;
}
}
}//package com.greensock.core
Section 2
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
protected var _firstChild:TweenCore;
protected var _lastChild:TweenCore;
public var autoRemoveChildren:Boolean;
public function SimpleTimeline(_arg1:Object=null){
super(0, _arg1);
}
public function insert(_arg1:TweenCore, _arg2=0):TweenCore{
var _local3:SimpleTimeline = _arg1.timeline;
if (((!(_arg1.cachedOrphan)) && (_local3))){
_local3.remove(_arg1, true);
};
_arg1.timeline = this;
_arg1.cachedStartTime = (Number(_arg2) + _arg1.delay);
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
if (((_arg1.cachedPaused) && (!((_local3 == this))))){
_arg1.cachedPauseTime = (_arg1.cachedStartTime + ((this.rawTime - _arg1.cachedStartTime) / _arg1.cachedTimeScale));
};
if (_lastChild){
_lastChild.nextNode = _arg1;
} else {
_firstChild = _arg1;
};
_arg1.prevNode = _lastChild;
_lastChild = _arg1;
_arg1.nextNode = null;
_arg1.cachedOrphan = false;
return (_arg1);
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.cachedOrphan){
return;
};
if (!_arg2){
_arg1.setEnabled(false, true);
};
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
} else {
if (_lastChild == _arg1){
_lastChild = _arg1.prevNode;
};
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (_firstChild == _arg1){
_firstChild = _arg1.nextNode;
};
};
_arg1.cachedOrphan = true;
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local5:Number;
var _local6:TweenCore;
var _local4:TweenCore = _firstChild;
this.cachedTotalTime = _arg1;
this.cachedTime = _arg1;
while (_local4) {
_local6 = _local4.nextNode;
if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){
if (!_local4.cachedReversed){
_local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration;
_local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false);
};
};
_local4 = _local6;
};
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
}
}//package com.greensock.core
Section 3
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
protected var _delay:Number;
protected var _hasUpdate:Boolean;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var active:Boolean;
public var gc:Boolean;
public var initted:Boolean;
public var timeline:SimpleTimeline;
public var cachedStartTime:Number;
public var cachedTime:Number;
public var cachedTotalTime:Number;
public var cachedDuration:Number;
public var cachedTotalDuration:Number;
public var cachedTimeScale:Number;
public var cachedPauseTime:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
public var prevNode:TweenCore;
public var cachedOrphan:Boolean;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var data;
public static const version:Number = 1.64;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
this.vars = ((_arg2)!=null) ? _arg2 : {};
if (this.vars.isGSVars){
this.vars = this.vars.vars;
};
this.cachedDuration = (this.cachedTotalDuration = _arg1);
_delay = (this.vars.delay) ? Number(this.vars.delay) : 0;
this.cachedTimeScale = (this.vars.timeScale) ? Number(this.vars.timeScale) : 1;
this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.cachedTotalTime = (this.cachedTime = 0);
this.data = this.vars.data;
if (!_classInitted){
if (isNaN(TweenLite.rootFrame)){
TweenLite.initClass();
_classInitted = true;
} else {
return;
};
};
var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline;
_local3.insert(this, _local3.cachedTotalTime);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function pause():void{
this.paused = true;
}
public function resume():void{
this.paused = false;
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
public function reverse(_arg1:Boolean=true):void{
this.reversed = true;
if (_arg1){
this.paused = false;
} else {
if (this.gc){
this.setEnabled(true, false);
};
};
}
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
}
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.totalDuration, _arg2, false);
return;
};
if (this.timeline.autoRemoveChildren){
this.setEnabled(false, false);
} else {
this.active = false;
};
if (!_arg2){
if (((((this.vars.onComplete) && ((this.cachedTotalTime >= this.cachedTotalDuration)))) && (!(this.cachedReversed)))){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
} else {
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams);
};
};
};
}
public function invalidate():void{
}
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
this.gc = !(_arg1);
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.cachedOrphan))){
this.timeline.insert(this, (this.cachedStartTime - _delay));
};
} else {
this.active = false;
if (((!(_arg2)) && (!(this.cachedOrphan)))){
this.timeline.remove(this, true);
};
};
return (false);
}
public function kill():void{
setEnabled(false, false);
}
protected function setDirtyCache(_arg1:Boolean=true):void{
var _local2:TweenCore = (_arg1) ? this : this.timeline;
while (_local2) {
_local2.cacheIsDirty = true;
_local2 = _local2.timeline;
};
}
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
if (this.timeline){
_local3 = (this.cachedPaused) ? this.cachedPauseTime : this.timeline.cachedTotalTime;
if (this.cachedReversed){
_local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale));
} else {
this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale));
};
if (!this.timeline.cacheIsDirty){
setDirtyCache(false);
};
if (this.cachedTotalTime != _arg1){
renderTime(_arg1, _arg2, false);
};
};
}
public function get delay():Number{
return (_delay);
}
public function set delay(_arg1:Number):void{
this.startTime = (this.startTime + (_arg1 - _delay));
_delay = _arg1;
}
public function get duration():Number{
return (this.cachedDuration);
}
public function set duration(_arg1:Number):void{
var _local2:Number = (_arg1 / this.cachedDuration);
this.cachedDuration = (this.cachedTotalDuration = _arg1);
if (((((this.active) && (!(this.cachedPaused)))) && (!((_arg1 == 0))))){
this.setTotalTime((this.cachedTotalTime * _local2), true);
};
setDirtyCache(false);
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function set totalDuration(_arg1:Number):void{
this.duration = _arg1;
}
public function get currentTime():Number{
return (this.cachedTime);
}
public function set currentTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function set totalTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function set startTime(_arg1:Number):void{
if (((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc))))){
this.timeline.insert(this, (_arg1 - _delay));
} else {
this.cachedStartTime = _arg1;
};
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function set reversed(_arg1:Boolean):void{
if (_arg1 != this.cachedReversed){
this.cachedReversed = _arg1;
setTotalTime(this.cachedTotalTime, true);
};
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function set paused(_arg1:Boolean):void{
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){
if (_arg1){
this.cachedPauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - this.cachedPauseTime));
this.cachedPauseTime = NaN;
setDirtyCache(false);
};
this.cachedPaused = _arg1;
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
};
if (((!(_arg1)) && (this.gc))){
this.setTotalTime(this.cachedTotalTime, false);
this.setEnabled(true, false);
};
}
}
}//package com.greensock.core
Section 4
//Back (com.greensock.easing.Back)
package com.greensock.easing {
public class Back {
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 * 0.5) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package com.greensock.easing
Section 5
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import com.greensock.core.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class TweenLite extends TweenCore {
public var target:Object;
public var propTweenLookup:Object;
public var ratio:Number;// = 0
public var cachedPT1:PropTween;
protected var _ease:Function;
protected var _overwrite:int;
protected var _overwrittenProps:Object;
protected var _hasPlugins:Boolean;
protected var _notifyPluginsOfEnabled:Boolean;
public static const version:Number = 11.63;
public static var plugins:Object = {};
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var defaultEase:Function = TweenLite.easeOut;
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var rootTimeline:SimpleTimeline;
public static var rootFramesTimeline:SimpleTimeline;
public static var masterList:Dictionary = new Dictionary(false);
private static var _shape:Shape = new Shape();
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onStart:1, onStartParams:1, onInit:1, onInitParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1};
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local5:TweenLite;
super(_arg2, _arg3);
if (_arg1 == null){
throw (new Error("Cannot tween a null object."));
};
this.target = _arg1;
if ((((this.target is TweenCore)) && (this.vars.timeScale))){
this.cachedTimeScale = 1;
};
propTweenLookup = {};
_ease = defaultEase;
_overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
var _local4:Array = masterList[_arg1];
if (!_local4){
masterList[_arg1] = [this];
} else {
if (_overwrite == 1){
for each (_local5 in _local4) {
if (!_local5.gc){
_local5.setEnabled(false, false);
};
};
masterList[_arg1] = [this];
} else {
_local4[_local4.length] = this;
};
};
if (((this.active) || (this.vars.immediateRender))){
renderTime(0, false, true);
};
}
protected function init():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:Boolean;
var _local5:Array;
var _local6:PropTween;
if (this.vars.onInit){
this.vars.onInit.apply(null, this.vars.onInitParams);
};
if (typeof(this.vars.ease) == "function"){
_ease = this.vars.ease;
};
if (this.vars.easeParams){
this.vars.proxiedEase = _ease;
_ease = easeProxy;
};
this.cachedPT1 = null;
this.propTweenLookup = {};
for (_local1 in this.vars) {
if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){
} else {
if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){
this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1);
if (this.cachedPT1.name == "_MULTIPLE_"){
_local2 = _local3.overwriteProps.length;
while (--_local2 > -1) {
this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1;
};
} else {
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1;
};
if (_local3.priority){
this.cachedPT1.priority = _local3.priority;
_local4 = true;
};
if (((_local3.onDisable) || (_local3.onEnable))){
_notifyPluginsOfEnabled = true;
};
_hasPlugins = true;
} else {
this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1);
this.propTweenLookup[_local1] = this.cachedPT1;
};
};
};
if (_local4){
onPluginEvent("onInitAllProps", this);
};
if (this.vars.runBackwards){
_local6 = this.cachedPT1;
while (_local6) {
_local6.start = (_local6.start + _local6.change);
_local6.change = -(_local6.change);
_local6 = _local6.nextNode;
};
};
_hasUpdate = Boolean(!((this.vars.onUpdate == null)));
if (_overwrittenProps){
killVars(_overwrittenProps);
if (this.cachedPT1 == null){
this.setEnabled(false, false);
};
};
if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){
init();
};
};
this.initted = true;
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Boolean;
var _local5:Number = this.cachedTime;
if (_arg1 >= this.cachedDuration){
this.cachedTotalTime = (this.cachedTime = this.cachedDuration);
this.ratio = 1;
_local4 = true;
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime >= 0){
_arg3 = true;
_local4 = true;
};
_rawPrevTime = _arg1;
};
};
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local4 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
this.ratio = _ease(_arg1, 0, 1, this.cachedDuration);
};
};
if ((((this.cachedTime == _local5)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
if (((!(_local4)) && (this.cachedTime))){
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (((!((this.cachedTime == 0))) || ((this.cachedDuration == 0)))))) && (!(_arg2)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
var _local6:PropTween = this.cachedPT1;
while (_local6) {
_local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change));
_local6 = _local6.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (((_local4) && (!(this.gc)))){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
};
}
public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{
var _local3:String;
var _local4:PropTween;
var _local5:Boolean;
if (_overwrittenProps == null){
_overwrittenProps = {};
};
for (_local3 in _arg1) {
if ((_local3 in propTweenLookup)){
_local4 = propTweenLookup[_local3];
if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){
_local4.target.killProps(_arg1);
if (_local4.target.overwriteProps.length == 0){
_local4.name = "";
};
if (((!((_local3 == _local4.target.propName))) || ((_local4.name == "")))){
delete propTweenLookup[_local3];
};
};
if (_local4.name != "_MULTIPLE_"){
if (_local4.nextNode){
_local4.nextNode.prevNode = _local4.prevNode;
};
if (_local4.prevNode){
_local4.prevNode.nextNode = _local4.nextNode;
} else {
if (this.cachedPT1 == _local4){
this.cachedPT1 = _local4.nextNode;
};
};
if (((_local4.isPlugin) && (_local4.target.onDisable))){
_local4.target.onDisable();
if (_local4.target.activeDisable){
_local5 = true;
};
};
delete propTweenLookup[_local3];
};
};
if (((_arg2) && (!((_arg1 == _overwrittenProps))))){
_overwrittenProps[_local3] = 1;
};
};
return (_local5);
}
override public function invalidate():void{
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
onPluginEvent("onDisable", this);
};
this.cachedPT1 = null;
_overwrittenProps = null;
_hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false)));
this.propTweenLookup = {};
}
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
var _local3:Array;
if (_arg1){
_local3 = TweenLite.masterList[this.target];
if (!_local3){
TweenLite.masterList[this.target] = [this];
} else {
_local3[_local3.length] = this;
};
};
super.setEnabled(_arg1, _arg2);
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this));
};
return (false);
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public static function initClass():void{
rootFrame = 0;
rootTimeline = new SimpleTimeline(null);
rootFramesTimeline = new SimpleTimeline(null);
rootTimeline.cachedStartTime = (getTimer() * 0.001);
rootFramesTimeline.cachedStartTime = rootFrame;
rootTimeline.autoRemoveChildren = true;
rootFramesTimeline.autoRemoveChildren = true;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
if (_arg3.isGSVars){
_arg3 = _arg3.vars;
};
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
protected static function updateAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
var _local5:int;
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false);
rootFrame = (rootFrame + 1);
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false);
if (!(rootFrame % 60)){
_local2 = masterList;
for (_local3 in _local2) {
_local4 = _local2[_local3];
_local5 = _local4.length;
while (--_local5 > -1) {
if (TweenLite(_local4[_local5]).gc){
_local4.splice(_local5, 1);
};
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
};
}
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false, _arg3:Object=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
if ((_arg1 in masterList)){
_local4 = masterList[_arg1];
_local5 = _local4.length;
while (--_local5 > -1) {
_local6 = _local4[_local5];
if (!_local6.gc){
if (_arg2){
_local6.complete(false, false);
};
if (_arg3 != null){
_local6.killVars(_arg3);
};
if ((((_arg3 == null)) || ((((_local6.cachedPT1 == null)) && (_local6.initted))))){
_local6.setEnabled(false, false);
};
};
};
if (_arg3 == null){
delete masterList[_arg1];
};
};
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (1 - (_arg1 / _arg4));
return ((1 - (_arg1 * _arg1)));
}
}
}//package com.greensock
Section 6
//Base (com.source.Bases.Base)
package com.source.Bases {
import flash.geom.*;
import com.source.*;
import com.source.Units.*;
public class Base extends GameObject {
public var countcur:int;
public var countmax:int;// = 50
public var _index:int;// = -1
public var _force:int;// = -1
public var select:Boolean;// = false
public var type:int;// = -1
public var worth:Number;// = 1
public var ishive:Boolean;// = false
public var timeValue:Number;// = 0
public var baseValue:Number;// = 0
public var compValue:Number;// = 0
public static const FORCE_GRAY:int = -1;
public static const FORCE_RED:int = 0;
public static const FORCE_BLUE:int = 1;
public static const FORCE_GREEN:int = 2;
public static const FORCE_ORANGE:int = 3;
public function sendTo(_arg1:Base, _arg2:Boolean=false):void{
}
public function comDataUpdate(_arg1:Number):void{
}
public function comAttack():Boolean{
return (true);
}
public function selectBase():void{
if ((((_force == FORCE_BLUE)) && ((select == false)))){
select = true;
};
}
public function deselectBase():void{
if (select == true){
select = false;
};
}
public function addDamage(_arg1:Unit):void{
}
public function addDamageRocket(_arg1:int, _arg2:Boolean=false):void{
}
protected function PushCLR(_arg1:String):ColorTransform{
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.substr(0, 2);
_local3 = (parseInt(_local2, 16) / 0xFF);
_local2 = _arg1.substr(2, 2);
_local4 = (parseInt(_local2, 16) / 0xFF);
_local2 = _arg1.substr(4, 2);
_local5 = (parseInt(_local2, 16) / 0xFF);
return (new ColorTransform(_local3, _local4, _local5));
}
}
}//package com.source.Bases
Section 7
//BaseExt (com.source.Bases.BaseExt)
package com.source.Bases {
public class BaseExt extends Base {
public var conn:int;// = 0
public var base:Location;
public function BaseExt():void{
}
public function init(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
x = _arg1;
_y = _arg2;
y = (_y * ky);
type = _arg3;
conn = _arg4;
base = _universe._bases.obj[_arg4];
if (type == 0){
base.ishive = true;
if (base.extprogress == null){
base.extprogress = this;
};
};
_force = base._force;
_universe.box.addChildAt(this, 1);
}
public function capture():void{
_force = base._force;
}
public function Draw():void{
graphics.lineStyle(1, 0, 0.5);
graphics.lineTo((base.x - x), (base.y - y));
}
}
}//package com.source.Bases
Section 8
//ExtAntiair (com.source.Bases.ExtAntiair)
package com.source.Bases {
import com.source.Units.*;
public class ExtAntiair extends BaseExt {
private var delaycur:Number;// = 0
private var delaymax:Number;// = 0.5
private var ready:Boolean;// = false
private var range:Number;// = 170
private var d:Number;// = 0
private var dx:Number;// = 0
private var dy:Number;// = 0
private var body:mc_AntiairBody;
private var color:mc_AntiairColor;
private var Arr:Array;
private var target:Unit;
private var rocket:Object;
public function ExtAntiair():void{
type = 6;
worth = 0.3;
body = new mc_AntiairBody();
color = new mc_AntiairColor();
addChild(color);
addChild(body);
}
override public function capture():void{
_force = base._force;
delaycur = 0;
ready = false;
Arr = _universe._units.obj;
color.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
}
override public function update(_arg1:Number):void{
var _local2:int;
if (_force > -1){
if (ready == false){
delaycur = (delaycur + _arg1);
if (delaycur > delaymax){
delaycur = 0;
ready = true;
};
} else {
_local2 = 0;
while (_local2 < Arr.length) {
if (((((!((Arr[_local2]._force == _force))) && ((Arr[_local2]._type > 0)))) && (!((Arr[_local2]._type == 3))))){
dx = (Arr[_local2].x - x);
dy = (Arr[_local2]._y - _y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
if (d < range){
rocket = _universe._rocketstounits.add();
rocket.init(x, _y, 200, 1, Arr[_local2]);
rocket = null;
ready = false;
break;
};
};
_local2++;
};
};
};
}
public function launch(_arg1):void{
ready = false;
}
override public function free():void{
super.free();
_universe._antiair.remove(this);
}
}
}//package com.source.Bases
Section 9
//ExtBunker (com.source.Bases.ExtBunker)
package com.source.Bases {
import com.source.Units.*;
public class ExtBunker extends BaseExt {
private var delaycur:Number;// = 0
private var delaymax:Number;// = 0.4
private var ready:Boolean;// = false
private var range:Number;// = 170
private var d:Number;// = 0
private var dx:Number;// = 0
private var dy:Number;// = 0
private var body:mc_BunkerBody;
private var cap:mc_BunkerCap;
private var bags:mc_BunkerBags;
private var Arr:Array;
private var target:Unit;
private var rocket:Object;
public function ExtBunker():void{
type = 5;
worth = 0.5;
body = new mc_BunkerBody();
cap = new mc_BunkerCap();
bags = new mc_BunkerBags();
addChild(body);
addChild(bags);
addChild(cap);
}
override public function capture():void{
_force = base._force;
delaycur = 0;
cap.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
Arr = _universe._units.obj;
ready = false;
}
override public function update(_arg1:Number):void{
var _local2:int;
if (_force > -1){
if (ready == false){
delaycur = (delaycur + _arg1);
if (delaycur > delaymax){
delaycur = 0;
ready = true;
};
} else {
_local2 = 0;
while (_local2 < Arr.length) {
if (((!((Arr[_local2]._force == _force))) && ((Arr[_local2]._type == 0)))){
dx = (Arr[_local2].x - x);
dy = (Arr[_local2]._y - _y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
if (d < range){
dx = ((dx / d) * 16);
dy = ((dy / d) * 16);
rocket = _universe._rocketstounits.add();
rocket.init((x + dx), (_y + dy), 200, 1, Arr[_local2]);
rocket = null;
ready = false;
_universe.sC = _universe.s_heli_shot.play(0, 0, _universe.s_transform);
break;
};
};
_local2++;
};
};
};
}
public function launch(_arg1):void{
ready = false;
}
override public function free():void{
super.free();
_universe._bunker.remove(this);
}
}
}//package com.source.Bases
Section 10
//ExtDropport (com.source.Bases.ExtDropport)
package com.source.Bases {
import flash.events.*;
public class ExtDropport extends BaseExt {
private var count:int;
private var unit:Object;
private var ready:Boolean;
public var ring:mc_Select;
private var body:mc_Dropport;
private var color:mc_DropportColor;
private var bestValue:Number;
private var tempValue:Number;
private var bestBase:Base;
private var tempBase:Base;
private var baseArr:Array;
public function ExtDropport():void{
type = 10;
body = new mc_Dropport();
color = new mc_DropportColor();
addChild(body);
addChild(color);
ring = new mc_Select();
addEventListener(MouseEvent.CLICK, onClick);
}
override public function comAttack():Boolean{
var _local1:Base;
var _local2:Base;
var _local5:Number;
var _local6:Number;
trace("Dropport com atack");
baseArr = _universe._bases.obj;
len = baseArr.length;
countcur = base.countcur;
var _local3:Number = 0;
var _local4:Number = 1000000;
i = 0;
while (i < len) {
if (baseArr[i].type == 0){
_local1 = baseArr[i];
_local5 = (_local1.x - x);
_local6 = (_local1.y - y);
_local3 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
if (_local1._force != _force){
if (_local1.countcur > countcur){
if (_local1.coming[_force] > countcur){
_local3 = (_local3 + (_local1.coming[_force] * 5));
} else {
_local3 = (_local3 * 0.5);
};
};
} else {
_local3 = (_local3 * 5);
};
} else {
_local3 = 9999999;
};
if (_local1 != base){
if (_local3 < _local4){
_local4 = _local3;
_local2 = _local1;
};
trace(((("wp " + _local3) + " wpmax") + _local4));
};
i++;
};
if ((countcur * 0.5) > _local2.countcur){
sendTo(_local2, false);
} else {
sendTo(_local2, true);
};
return (true);
}
override public function comDataUpdate(_arg1:Number):void{
compValue = (compValue + (_arg1 * 2));
}
override public function capture():void{
_force = base._force;
count = base.countcur;
color.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
compValue = 0;
}
override public function update(_arg1:Number):void{
if (_force == 0){
comDataUpdate(_arg1);
};
}
public function onClick(_arg1:MouseEvent):void{
if (_universe.selectBase == this){
_universe.selectBase = null;
removeChild(ring);
select = false;
} else {
if (_universe.selectBase == null){
if (_force == FORCE_BLUE){
_universe.selectBase = this;
addChild(ring);
select = true;
};
} else {
_universe.selectBase.sendTo(this, _universe.selectAll);
_universe.selectBase.deselectBase();
_universe.selectBase.select = false;
_universe.selectBase = null;
};
};
}
override public function deselectBase():void{
if (select == true){
select = false;
removeChild(ring);
};
}
override public function sendTo(_arg1:Base, _arg2:Boolean=false):void{
countcur = base.countcur;
if (countcur > 0){
unit = _universe._drops.add();
if (_arg2 == true){
unit.init(this, _arg1, base.countcur);
base.countcur = 0;
} else {
unit.init(this, _arg1, Math.ceil((base.countcur * 0.5)));
base.countcur = (base.countcur - Math.ceil((base.countcur * 0.5)));
};
unit.launch(_arg1);
unit = null;
base.out();
base.ReCapture();
};
compValue = 0;
}
override public function free():void{
super.free();
if (this.contains(ring)){
select = false;
removeChild(ring);
};
_universe._dropport.remove(this);
}
}
}//package com.source.Bases
Section 11
//ExtHeliport (com.source.Bases.ExtHeliport)
package com.source.Bases {
import flash.events.*;
public class ExtHeliport extends BaseExt {
private var count:int;
private var unit:Object;
private var ready:Boolean;
public var ring:mc_Select;
private var body:mc_Heliport;
private var color:mc_HeliportColor;
private var bestValue:Number;
private var tempValue:Number;
private var bestBase:Base;
private var tempBase:Base;
private var baseArr:Array;
public function ExtHeliport():void{
type = 9;
body = new mc_Heliport();
color = new mc_HeliportColor();
addChild(body);
addChild(color);
ring = new mc_Select();
addEventListener(MouseEvent.CLICK, onClick);
}
override public function comAttack():Boolean{
var _local1:Base;
var _local2:Base;
var _local5:Number;
var _local6:Number;
baseArr = _universe._bases.obj;
len = baseArr.length;
countcur = base.countcur;
var _local3:Number = 0;
var _local4:Number = 888888;
i = 0;
while (i < len) {
if ((baseArr[i] is Location)){
_local1 = baseArr[i];
_local5 = (_local1.x - x);
_local6 = (_local1.y - y);
_local3 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
if (_local1._force != _force){
if (_local1.countcur > 0){
if (_local1.coming[_force] > _local1.countcur){
_local3 = (_local3 + (_local1.coming[_force] * 5));
} else {
_local3 = (_local3 + (_local1.countcur * 2));
};
} else {
_local3 = 999999;
};
} else {
_local3 = 999999;
};
} else {
_local3 = 999999;
};
if (((!((_local1 == base))) && ((_local3 < 999999)))){
if (_local3 < _local4){
_local4 = _local3;
_local2 = _local1;
};
trace(((("wp " + _local3) + " wpmax") + _local4));
};
i++;
};
if ((countcur * 0.5) > _local2.countcur){
sendTo(_local2, false);
} else {
sendTo(_local2, true);
};
return (true);
}
override public function comDataUpdate(_arg1:Number):void{
compValue = (compValue + (_arg1 * 3));
}
override public function capture():void{
_force = base._force;
count = base.countcur;
color.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
}
public function onClick(_arg1:MouseEvent):void{
if (_universe.selectBase == this){
_universe.selectBase = null;
removeChild(ring);
select = false;
} else {
if (_universe.selectBase == null){
if (_force == FORCE_BLUE){
_universe.selectBase = this;
addChild(ring);
select = true;
};
} else {
_universe.selectBase.sendTo(this, _universe.selectAll);
_universe.selectBase.deselectBase();
_universe.selectBase.select = false;
_universe.selectBase = null;
};
};
}
override public function deselectBase():void{
if (select == true){
select = false;
removeChild(ring);
};
}
override public function sendTo(_arg1:Base, _arg2:Boolean=false):void{
countcur = base.countcur;
if (countcur > 0){
unit = _universe._helis.add();
if (_arg2 == true){
unit.init(this, _arg1, countcur);
base.countcur = 0;
} else {
unit.init(this, _arg1, Math.ceil((countcur * 0.5)));
base.countcur = (base.countcur - Math.ceil((countcur * 0.5)));
};
unit.launch(_arg1);
unit = null;
base.out();
base.ReCapture();
};
compValue = 0;
}
override public function update(_arg1:Number):void{
if (_force == 0){
comDataUpdate(_arg1);
};
}
override public function free():void{
super.free();
if (this.contains(ring)){
select = false;
removeChild(ring);
};
_universe._heliport.remove(this);
}
}
}//package com.source.Bases
Section 12
//ExtJetport (com.source.Bases.ExtJetport)
package com.source.Bases {
import flash.events.*;
public class ExtJetport extends BaseExt {
private var delaycur:Number;// = 0
private var delaymax:Number;// = 15
private var ready:Boolean;// = false
private var unit:Object;
private var body:mc_Jetport;
private var color:mc_JetportColor;
private var radar:mc_JetportRadar;
public var ring:mc_SelectAir;
public var progress:mc_progressAir;
private var frame:int;
private var i:int;// = 0
private var bestValue:Number;
private var tempValue:Number;
private var bestBase:Base;
private var tempBase:Base;
private var baseArr:Array;
public function ExtJetport():void{
type = 8;
body = new mc_Jetport();
color = new mc_JetportColor();
radar = new mc_JetportRadar();
radar.x = 8;
radar.y = -42;
worth = 0.7;
ring = new mc_SelectAir();
progress = new mc_progressAir();
progress.x = 16;
progress.y = 13.5;
addChild(body);
addChild(color);
addChild(radar);
addChild(progress);
addEventListener(MouseEvent.CLICK, onClick);
}
override public function comAttack():Boolean{
compValue = 0;
bestValue = 0;
tempValue = 0;
bestBase = null;
i = 0;
while (i < baseArr.length) {
tempBase = baseArr[i];
if ((((tempBase.type == 0)) && ((tempBase._force == 1)))){
if (tempBase.ishive == false){
tempValue = (tempBase.countcur * 2);
} else {
tempValue = tempBase.countcur;
};
if (tempValue > bestValue){
bestBase = tempBase;
};
};
i++;
};
if (bestBase != null){
sendTo(bestBase);
return (true);
};
return (false);
}
override public function comDataUpdate(_arg1:Number):void{
if (ready == true){
compValue = (compValue + _arg1);
trace(("com jetport " + compValue));
};
}
override public function init(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
super.init(_arg1, _arg2, _arg3, _arg4);
baseArr = _universe._bases.obj;
if (_force > -1){
progress.visible = true;
} else {
progress.visible = false;
};
}
override public function capture():void{
_force = base._force;
delaycur = 0;
ready = false;
compValue = 0;
color.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
if (_force > -1){
progress.visible = true;
} else {
progress.visible = false;
};
}
override public function sendTo(_arg1:Base, _arg2:Boolean=false):void{
if (ready == true){
unit = _universe._jets.add();
unit.init(this, _arg1, 1);
unit = null;
ready = false;
compValue = 0;
};
}
override public function update(_arg1:Number):void{
if (_force == 0){
comDataUpdate(_arg1);
};
if ((((ready == false)) && ((_force > -1)))){
delaycur = (delaycur + _arg1);
frame = (((delaycur / delaymax) * 20) + 1);
progress.gotoAndStop(frame);
if (delaycur > delaymax){
delaycur = 0;
ready = true;
progress.gotoAndStop(21);
};
};
}
public function onClick(_arg1:MouseEvent):void{
if (_universe.selectBase == this){
_universe.selectBase = null;
removeChild(ring);
select = false;
} else {
if (_universe.selectBase == null){
if (_force == FORCE_BLUE){
_universe.selectBase = this;
addChild(ring);
select = true;
};
} else {
_universe.selectBase.sendTo(this, _universe.selectAll);
_universe.selectBase.deselectBase();
_universe.selectBase.select = false;
_universe.selectBase = null;
};
};
}
override public function deselectBase():void{
if (select == true){
select = false;
removeChild(ring);
};
}
public function launch(_arg1:Base):void{
ready = false;
}
override public function free():void{
super.free();
if (this.contains(ring)){
select = false;
removeChild(ring);
};
_universe._jetport.remove(this);
}
}
}//package com.source.Bases
Section 13
//ExtLaser (com.source.Bases.ExtLaser)
package com.source.Bases {
public class ExtLaser extends BaseExt {
private var delaycur:Number;// = 0
private var delaymax:Number;// = 0.5
private var ready:Boolean;// = false
private var body:mc_Laser;
public function ExtLaser():void{
type = 3;
worth = 0.2;
body = new mc_Laser();
addChild(body);
}
override public function capture():void{
_force = base._force;
delaycur = 0;
body.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
}
override public function update(_arg1:Number):void{
if ((((_force > -1)) && ((ready == false)))){
delaycur = (delaycur + _arg1);
if (delaycur > delaymax){
delaycur = 0;
ready = true;
};
};
}
public function launch(_arg1):void{
ready = false;
}
override public function free():void{
super.free();
_universe._laser.remove(this);
}
}
}//package com.source.Bases
Section 14
//ExtNuclear (com.source.Bases.ExtNuclear)
package com.source.Bases {
import flash.events.*;
import flash.display.*;
public class ExtNuclear extends BaseExt {
private var delaycur:Number;// = 0
private var delaymax:Number;// = 20
private var ready:Boolean;// = false
private var unit:Object;
private var body:MovieClip;
public var ring:mc_SelectRocket;
private var color:mc_NuclearColor;
public var progress:mc_progressRocket;
private var frame:int;
private var bestValue:Number;
private var tempValue:Number;
private var bestBase:Base;
private var tempBase:Base;
private var baseArr:Array;
public function ExtNuclear():void{
type = 7;
worth = 2;
color = new mc_NuclearColor();
body = new mc_Nuclear2();
ring = new mc_SelectRocket();
progress = new mc_progressRocket();
progress.y = 15;
addChild(color);
addChild(body);
addChild(progress);
body.gotoAndStop(1);
addEventListener(MouseEvent.CLICK, onClick);
}
override public function comAttack():Boolean{
baseArr = _universe._bases.obj;
compValue = 0;
bestValue = 0;
tempValue = 0;
bestBase = null;
i = 0;
while (i < baseArr.length) {
tempBase = baseArr[i];
if ((((tempBase.type == 0)) && ((tempBase._force == 1)))){
if (tempBase.ishive == false){
tempValue = (tempBase.countcur * 2);
} else {
tempValue = tempBase.countcur;
};
if (tempValue > bestValue){
bestBase = tempBase;
};
};
i++;
};
if (bestBase != null){
sendTo(bestBase);
return (true);
};
return (false);
}
override public function comDataUpdate(_arg1:Number):void{
if (ready == true){
compValue = (compValue + _arg1);
trace(("com jetport " + compValue));
};
}
override public function init(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
super.init(_arg1, _arg2, _arg3, _arg4);
ready = false;
delaycur = 0;
if (_force > -1){
progress.visible = true;
} else {
progress.visible = false;
};
}
override public function capture():void{
_force = base._force;
delaycur = 0;
ready = false;
color.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
body.gotoAndStop(1);
if (_force > -1){
progress.visible = true;
} else {
progress.visible = false;
};
compValue = 0;
}
override public function update(_arg1:Number):void{
if (_force == 0){
comDataUpdate(_arg1);
};
if ((((_force > -1)) && ((ready == false)))){
delaycur = (delaycur + _arg1);
if (delaycur > delaymax){
delaycur = -100;
body.gotoAndPlay(1);
progress.gotoAndStop(20);
} else {
frame = (((delaycur / delaymax) * 20) + 1);
progress.gotoAndStop(frame);
};
if (body.currentFrame == 30){
ready = true;
delaycur = 0;
progress.gotoAndStop(21);
};
};
}
override public function sendTo(_arg1:Base, _arg2:Boolean=false):void{
if (ready == true){
unit = _universe._nuclearrockets.add();
unit.init(this, _arg1, 50);
unit = null;
ready = false;
body.gotoAndPlay(31);
};
compValue = 0;
}
public function onClick(_arg1:MouseEvent):void{
if (_universe.selectBase == this){
_universe.selectBase = null;
removeChild(ring);
select = false;
} else {
if (_universe.selectBase == null){
if (_force == FORCE_BLUE){
_universe.selectBase = this;
addChild(ring);
select = true;
};
} else {
_universe.selectBase.sendTo(this, _universe.selectAll);
_universe.selectBase.deselectBase();
_universe.selectBase.select = false;
_universe.selectBase = null;
};
};
}
override public function deselectBase():void{
if (select == true){
select = false;
removeChild(ring);
ready = false;
};
}
public function launch(_arg1):void{
ready = false;
}
override public function free():void{
super.free();
if (this.contains(ring)){
select = false;
removeChild(ring);
};
_universe._nuclear.remove(this);
}
}
}//package com.source.Bases
Section 15
//ExtSupport (com.source.Bases.ExtSupport)
package com.source.Bases {
public class ExtSupport extends BaseExt {
public var delaycur:Number;// = 0
public var delaymax:Number;// = 10
public var progress:int;
public var addunits:int;// = 10
public var work:Boolean;// = true
private var body:mc_Support;
private var color:mc_SupportColor;
public function ExtSupport():void{
type = 1;
worth = 1;
body = new mc_Support();
color = new mc_SupportColor();
addChild(body);
addChild(color);
}
override public function capture():void{
_force = base._force;
delaycur = 0;
color.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
}
override public function update(_arg1:Number):void{
if ((((base.countcur < base.countmax)) && (!((base._force == -1))))){
delaycur = (delaycur + _arg1);
progress = (((delaycur / delaymax) * 100) + 1);
if (delaycur > delaymax){
delaycur = (delaycur - delaymax);
base.countcur = (base.countcur + addunits);
base.out();
};
};
}
override public function free():void{
super.free();
_universe._support.remove(this);
}
}
}//package com.source.Bases
Section 16
//Location (com.source.Bases.Location)
package com.source.Bases {
import com.greensock.*;
import flash.events.*;
import flash.text.*;
import com.source.Units.*;
import com.greensock.easing.*;
import flash.filters.*;
public class Location extends Base {
private var i:int;
private var len:int;
private var obj:Object;
public var Exts:Array;
public var size:int;
public var coming:Array;
public var tank:Object;
public var tf:TextField;
public var body:mc_Location;
public var color:mc_LocationColor;
public var ring:mc_Select;
public var atk:mc_Attack;
private var baseArr:Array;
private var distArr:Array;
private var linkArr:Array;
public var isolated:Boolean;// = true
public var progress:mc_Progres;
public var extprogress:ExtSupport;// = null
public function Location():void{
Exts = [];
coming = [0, 0, 0, 0];
super();
type = 0;
body = new mc_Location();
color = new mc_LocationColor();
progress = new mc_Progres();
progress.gotoAndStop(1);
progress.scaleX = 0.95;
progress.scaleY = 0.665;
progress.selectable = false;
tf = new TextField();
tf.selectable = false;
tf.embedFonts = true;
tf.width = 50;
tf.x = -25;
tf.height = 24;
tf.y = -15;
tf.antiAliasType = AntiAliasType.ADVANCED;
tf.defaultTextFormat = _universe.textFormatBase;
tf.filters = [new GlowFilter(0, 1, 3, 3, 2)];
ring = new mc_Select();
atk = new mc_Attack();
atk.selectable = false;
atk.visible = false;
addChild(atk);
addChild(body);
addChild(color);
addChild(progress);
addChild(tf);
}
override public function update(_arg1:Number):void{
if (_force == 0){
comDataUpdate(_arg1);
};
if (extprogress != null){
if (_force == -1){
progress.gotoAndStop(1);
} else {
progress.gotoAndStop(extprogress.progress);
};
};
}
override public function comDataUpdate(_arg1:Number):void{
if (ishive == true){
compValue = (compValue + (_arg1 * 2));
} else {
if (countcur > 25){
compValue = (compValue + _arg1);
};
};
}
override public function comAttack():Boolean{
var _local1:Location;
var _local2:Base;
trace("Location com atack");
baseArr = _universe._bases.obj;
len = baseArr.length;
distArr = _universe.D;
linkArr = _universe.L;
var _local3:Number = 0;
var _local4:Number = 1000000;
i = 0;
while (i < len) {
if ((((baseArr[i].type == 0)) && ((linkArr[baseArr[i]._index][_index] > -1)))){
trace("have path");
_local1 = baseArr[i];
_local3 = distArr[_local1._index][_index];
if (_local3 != 0){
if (_local1._force != _force){
if (_local1.countcur > _local1.coming[_force]){
if (_local1.coming[_force] > countcur){
_local3 = (_local3 + (_local1.coming[_force] * 5));
} else {
_local3 = (_local3 * 0.5);
};
};
} else {
if (_local1.ishive == true){
_local3 = (_local3 * _local1.inDanger());
} else {
_local3 = (_local3 * 3);
};
};
} else {
_local3 = 999999;
};
} else {
trace("no path");
_local3 = 999999;
};
if (ishive == true){
_local3 = (_local3 * 0.8);
};
if (_local3 < _local4){
_local4 = _local3;
_local2 = _local1;
};
i++;
};
if (_local4 < 99999){
if ((countcur * 0.5) > _local2.countcur){
sendTo(_local2, false);
} else {
sendTo(_local2, true);
};
trace("location not isolated base");
} else {
trace("location isolated base");
compValue = 0;
};
return (true);
}
public function inDanger():Number{
var _local1:Number = 0;
var _local2:int;
while (_local2 < 3) {
if (_local2 != _force){
(_local1 + coming[_local2]);
} else {
(_local1 - coming[_local2]);
};
_local2++;
};
if (_local1 > 0){
_local1 = (countcur / _local1);
} else {
_local1 = 5;
};
return (_local1);
}
public function init(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
x = _arg1;
y = _arg2;
_y = _arg2;
y = (_y * ky);
_index = _arg5;
_force = _arg3;
countcur = _arg4;
_universe.box.addChild(this);
extprogress = null;
ishive = false;
addEventListener(MouseEvent.CLICK, onClick);
addEventListener(MouseEvent.MOUSE_OVER, onOver);
addEventListener(MouseEvent.MOUSE_OUT, onOut);
baseArr = _universe._bases.obj;
len = baseArr.length;
distArr = _universe.D;
linkArr = _universe.L;
Capture();
out();
}
public function Capture():void{
progress.gotoAndStop(1);
compValue = 0;
color.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
}
public function initExts():void{
len = Exts.length;
while (len > -1) {
Exts.pop();
len--;
};
len = _universe._exts.len;
i = 0;
while (i < len) {
obj = _universe._exts.obj[i];
if (obj.conn == _index){
obj.capture();
Exts.push(obj);
};
i++;
};
len = (Exts.length - 1);
worth = 0;
while (len > -1) {
worth = (worth + Exts[len].worth);
len--;
};
len = _universe._bases.len;
}
override public function addDamage(_arg1:Unit):void{
if (_arg1._force == _force){
trace("---not captured, add");
countcur = (countcur + _arg1.count);
} else {
if (_arg1.count > countcur){
trace("---capture");
countcur = (_arg1.count - countcur);
_force = _arg1._force;
if (_force == 1){
_universe.addScore(250);
};
Capture();
i = 0;
while (i < Exts.length) {
Exts[i].capture();
i++;
};
} else {
trace("---not captured");
countcur = (countcur - _arg1.count);
if (countcur < 1){
if (ishive == false){
trace("---neutrale");
countcur = 0;
_force = -1;
};
};
Capture();
i = 0;
while (i < Exts.length) {
Exts[i].capture();
i++;
};
};
};
out();
}
override public function addDamageRocket(_arg1:int, _arg2:Boolean=false):void{
countcur = (countcur - _arg1);
if (_force == 1){
_universe.addScore((_arg1 * 10));
};
if (countcur <= 0){
countcur = 0;
if ((((ishive == false)) || ((_arg2 == true)))){
trace("loc, ishive");
_force = -1;
};
};
Capture();
i = 0;
while (i < Exts.length) {
Exts[i].capture();
i++;
};
out();
}
public function onClick(_arg1:MouseEvent):void{
if (_universe.selectBase == this){
_universe.selectBase = null;
removeChild(ring);
select = false;
} else {
if (_universe.selectBase == null){
if (_force == FORCE_BLUE){
_universe.selectBase = this;
addChild(ring);
ring.gotoAndPlay(1);
select = true;
};
} else {
if ((_universe.selectBase is Location)){
if (_universe.L[_universe.selectBase._index][this._index] > -1){
_universe.selectBase.sendTo(this, _universe.selectAll);
_universe.selectBase.deselectBase();
_universe.selectBase.select = false;
_universe.selectBase = null;
};
} else {
_universe.selectBase.sendTo(this, _universe.selectAll);
_universe.selectBase.deselectBase();
_universe.selectBase.select = false;
_universe.selectBase = null;
};
};
};
}
override public function sendTo(_arg1:Base, _arg2:Boolean=false):void{
var _local3:int;
trace("send tanks");
if ((((((countcur > 0)) && (!((_arg1 == this))))) && ((_arg1 is Location)))){
tank = _universe._tanks.add();
if (_arg2 == true){
_local3 = countcur;
} else {
_local3 = Math.ceil((countcur * 0.5));
};
tank.init(this, _arg1, _local3);
trace(((("loc, this = " + this) + " target = ") + _arg1));
countcur = (countcur - _local3);
ReCapture();
};
timeValue = 0;
baseValue = 0;
compValue = 0;
out();
}
public function onOver(_arg1:MouseEvent):void{
if (((!((_universe.selectBase == null))) && (!((_universe.selectBase == this))))){
atk.scaleX = 0.7;
atk.scaleY = 0.49;
atk.visible = true;
if (_force == FORCE_BLUE){
atk.transform.colorTransform = PushCLR(_universe.colors[2]);
} else {
atk.transform.colorTransform = PushCLR(_universe.colors[1]);
};
};
}
public function onOut(_arg1:MouseEvent):void{
atk.visible = false;
}
public function onUp(_arg1:MouseEvent):void{
_universe.SendUnitsTo(this);
deselectBase();
}
override public function selectBase():void{
if ((((_force == FORCE_BLUE)) && ((select == false)))){
addChild(ring);
ring.gotoAndPlay(1);
select = true;
};
}
override public function deselectBase():void{
if (select == true){
select = false;
removeChild(ring);
};
}
public function out():void{
tf.text = countcur.toString();
}
public function ReCapture():void{
if ((((countcur == 0)) && ((ishive == false)))){
_force = -1;
Capture();
i = 0;
while (i < Exts.length) {
Exts[i].capture();
i++;
};
};
}
public function Draw():void{
graphics.beginFill(0, 1);
graphics.drawEllipse(-20, -14, 40, 28);
graphics.endFill();
}
override public function free():void{
super.free();
_universe._locs.remove(this);
}
}
}//package com.source.Bases
Section 17
//Waypoint (com.source.Bases.Waypoint)
package com.source.Bases {
public class Waypoint extends Base {
public var coming:Array;
public function Waypoint():void{
coming = [0, 0, 0, 0];
super();
type = -1;
_force = 9;
}
public function init(_arg1:int, _arg2:int, _arg3:int):void{
x = _arg1;
_y = _arg2;
y = (_y * ky);
_index = _arg3;
_universe.box.addChild(this);
}
private function Draw():void{
graphics.beginFill(0, 1);
graphics.drawEllipse(-2.5, -1.75, 5, 3.5);
graphics.endFill();
}
override public function free():void{
super.free();
_universe._ways.remove(this);
}
}
}//package com.source.Bases
Section 18
//HeliRocket (com.source.Bullets.HeliRocket)
package com.source.Bullets {
import com.source.*;
import com.source.Bases.*;
import flash.display.*;
public class HeliRocket extends GameObject {
private var target:Base;
private var dx:Number;// = 0
private var dy:Number;// = 0
private var spd:Number;// = 350
private var d:Number;
private var dmg:int;// = 1
private var angle:Number;// = 0
private var mc:MovieClip;
public function HeliRocket():void{
mc = new mc_HeliRocket();
addChild(mc);
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:int, _arg5:Base):void{
x = _arg1;
_y = _arg2;
target = _arg5;
dx = (((target.x - x) + (Math.random() * 30)) - 15);
dy = (((target._y - _y) + (Math.random() * 30)) - 15);
angle = Math.atan2(dy, dx);
mc.rotation = ((angle * 180) / Math.PI);
d = Math.sqrt(((dx * dx) + (dy * dy)));
dx = ((dx / d) * spd);
dy = ((dy / d) * spd);
_universe.box.addChild(this);
}
override public function update(_arg1:Number):void{
var _local2:Object;
if (d > 0.3){
x = (x + (dx * _arg1));
_y = (_y + (dy * _arg1));
y = (_y * ky);
d = (d - (spd * _arg1));
} else {
target.addDamageRocket(dmg);
_local2 = _universe._blasthelirocket.add();
_local2.init(x, y);
_local2 = null;
free();
};
}
private function direction(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (Math.atan2((_arg4 - _arg2), (_arg3 - _arg1)));
}
override public function free():void{
super.free();
_universe._helirockets.remove(this);
}
}
}//package com.source.Bullets
Section 19
//Rocket (com.source.Bullets.Rocket)
package com.source.Bullets {
import com.source.*;
import com.source.Bases.*;
import flash.display.*;
import com.source.Units.*;
public class Rocket extends GameObject {
private var target:Unit;
private var targetBase:Base;
private var tx:Number;
private var ty:Number;
private var vx:Number;
private var vy:Number;
private var d:Number;
private var spd:Number;// = 100
private var obj:Object;
private var dmg:int;
private var mc:Sprite;
public function Rocket():void{
mc = new Sprite();
addChild(mc);
Draw();
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Unit):void{
target = _arg5;
spd = _arg3;
x = _arg1;
_y = _arg2;
_universe.addChild(this);
}
override public function update(_arg1:Number):void{
if (target._free == false){
tx = target.x;
ty = (target._y - target.h);
};
vx = (tx - x);
vy = (ty - _y);
d = Math.sqrt(((vx * vx) + (vy * vy)));
vx = (vx / d);
vy = (vy / d);
x = (x + ((vx * spd) * _arg1));
_y = (_y + ((vy * spd) * _arg1));
y = (_y * ky);
if (d < spd){
if (target._free == true){
free();
} else {
target.addDamage(dmg);
free();
};
};
}
private function Draw():void{
mc.graphics.beginFill(0xFFFFFF, 1);
mc.graphics.drawCircle(0, 0, 2);
mc.graphics.endFill();
}
override public function free():void{
super.free();
_universe._rockets.remove(this);
}
}
}//package com.source.Bullets
Section 20
//RocketToBase (com.source.Bullets.RocketToBase)
package com.source.Bullets {
import com.source.*;
import com.source.Bases.*;
public class RocketToBase extends GameObject {
private var target:Base;
private var dx:Number;// = 0
private var dy:Number;// = 0
private var spd:Number;// = 250
private var d:Number;
private var dmg:int;
private var angle:Number;// = 0
private var body:mc_RocketToBase;
private var smoke:Object;
public function RocketToBase():void{
body = new mc_RocketToBase();
body.mouseEnabled = false;
addChild(body);
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Base, _arg6:int):void{
x = _arg1;
_y = _arg2;
spd = _arg3;
dmg = _arg4;
target = _arg5;
dx = (target.x - x);
dy = (target._y - _y);
angle = Math.atan2(dy, dx);
body.rotation = ((angle * 180) / Math.PI);
d = Math.sqrt(((dx * dx) + (dy * dy)));
dx = ((dx / d) * spd);
dy = ((dy / d) * spd);
_universe.box.addChildAt(this, _arg6);
}
override public function update(_arg1:Number):void{
var _local2:Object;
if (d > 10){
x = (x + (dx * _arg1));
_y = (_y + (dy * _arg1));
y = (_y * ky);
d = (d - (spd * _arg1));
} else {
target.addDamageRocket(dmg);
_local2 = _universe._blastbomb.add();
_local2.init(x, y);
_local2.scaleX = 2;
_local2.scaleY = 2;
_local2 = null;
free();
};
}
override public function free():void{
super.free();
_universe._rocketstobases.remove(this);
}
}
}//package com.source.Bullets
Section 21
//RocketToUnit (com.source.Bullets.RocketToUnit)
package com.source.Bullets {
import com.source.*;
import com.source.Units.*;
public class RocketToUnit extends GameObject {
private var target:Unit;
private var dx:Number;// = 0
private var dy:Number;// = 0
private var tx:Number;
private var ty:Number;
private var vx:Number;
private var vy:Number;
private var spd:Number;// = 400
private var d:Number;
private var dmg:int;
private var angle:Number;// = 0
private var body:mc_HeliRocket;
private var smoke:Object;
public function RocketToUnit():void{
body = new mc_HeliRocket();
addChild(body);
}
public function init(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Unit):void{
x = _arg1;
_y = _arg2;
spd = _arg3;
dmg = _arg4;
target = _arg5;
_universe.box.addChild(this);
}
override public function update(_arg1:Number):void{
var _local2:Object;
if (target != null){
if (target._free == false){
tx = target.x;
ty = (target._y - target.h);
} else {
target = null;
};
};
dx = (tx - x);
dy = (ty - _y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
if (d > 10){
angle = Math.atan2(dy, dx);
body.rotation = ((angle * 180) / Math.PI);
dx = (dx / d);
dy = (dy / d);
x = (x + ((dx * spd) * _arg1));
_y = (_y + ((dy * spd) * _arg1));
y = (_y * ky);
} else {
if (target !== null){
target.addDamage(1, false);
if (target._force != 1){
_universe.addScore(10);
};
};
_local2 = _universe._blasthelirocket.add();
_local2.init(x, y);
_local2 = null;
free();
};
}
override public function free():void{
super.free();
_universe._rocketstounits.remove(this);
}
}
}//package com.source.Bullets
Section 22
//ButtonLevel (com.source.button.ButtonLevel)
package com.source.button {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class ButtonLevel extends Sprite {
private var btn:SimpleButton;
private var tf:TextField;
private var textFormat:TextFormat;
public var index:int;// = 0
private var f:Function;
public function ButtonLevel(_arg1:TextFormat, _arg2:int, _arg3:Function):void{
btn = new btn_Level();
btn.mouseEnabled = false;
btn.alpha = 0.3;
f = _arg3;
tf = new TextField();
tf.embedFonts = true;
tf.defaultTextFormat = _arg1;
tf.width = 100;
tf.y = 25;
tf.selectable = false;
tf.mouseEnabled = false;
tf.alpha = 0.3;
index = (_arg2 + 1);
if (_arg2 < 9){
tf.text = ("0" + index.toString());
} else {
tf.text = index.toString();
};
index--;
addChild(btn);
addChild(tf);
}
public function open():void{
btn.mouseEnabled = true;
btn.alpha = 1;
tf.alpha = 1;
addEventListener(MouseEvent.CLICK, onClick);
}
public function close():void{
btn.mouseEnabled = false;
btn.alpha = 0.3;
tf.alpha = 0.3;
removeEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent):void{
f(index);
}
}
}//package com.source.button
Section 23
//GameComp (com.source.Comp.GameComp)
package com.source.Comp {
import com.source.*;
import com.source.Bases.*;
public class GameComp {
protected var _universe:Universe;
private var delaycur:Number;// = 0
private var delaymax:Number;// = 1
private var delaystart:Number;// = 0
private var bestBase:Base;
private var bestBaseWaiting:Number;// = 0
private var baseArr:Array;
private var bestExt:Base;
private var bestExtWaiting:Number;// = 0
private var extArr:Array;
private var force:int;// = -2
private var i:int;// = 0
private var len:int;// = 0
public function GameComp(_arg1:int):void{
_universe = Universe.getInstance();
super();
force = _arg1;
}
public function init(_arg1:Number, _arg2:Number):void{
delaymax = _arg2;
delaycur = delaymax;
delaystart = _arg1;
}
public function update(_arg1:Number):void{
if (delaystart > 0){
delaystart = (delaystart - _arg1);
} else {
if (delaycur > 0){
delaycur = (delaycur - _arg1);
} else {
Work();
};
};
}
private function Work():void{
bestBaseWaiting = 0;
baseArr = _universe._bases.obj;
len = baseArr.length;
i = 0;
while (i < len) {
if ((((baseArr[i].type == 0)) && ((baseArr[i]._force == force)))){
if (bestBaseWaiting < baseArr[i].compValue){
bestBaseWaiting = baseArr[i].compValue;
bestBase = baseArr[i];
};
};
i++;
};
bestExtWaiting = 0;
extArr = _universe._exts.obj;
len = extArr.length;
i = 0;
while (i < len) {
if (extArr[i]._force == force){
if (bestExtWaiting < extArr[i].compValue){
bestExtWaiting = extArr[i].compValue;
bestExt = extArr[i];
};
};
i++;
};
trace(((("bestExtwait " + bestExtWaiting) + " BestBasewait ") + bestBaseWaiting));
trace(((("bestExt " + bestExt) + " BestBase ") + bestBase));
if ((((bestBaseWaiting > 0)) || ((bestExtWaiting > 0)))){
if (bestBaseWaiting >= bestExtWaiting){
if (bestBase.comAttack() == false){
delaycur = (delaymax * 0.5);
} else {
delaycur = delaymax;
};
} else {
if (bestExt.comAttack() == false){
delaycur = (delaymax * 0.5);
trace(("COM ext working end " + delaycur));
} else {
delaycur = delaymax;
trace(("COM ext working end " + delaycur));
};
};
} else {
delaycur = delaymax;
};
}
}
}//package com.source.Comp
Section 24
//Controller (com.source.controller.Controller)
package com.source.controller {
public class Controller {
public var obj:Array;
private var i:int;// = 0
public var len:int;// = 0
public function Controller():void{
obj = [];
super();
}
public function update(_arg1:Number):void{
i = (len - 1);
while (i > -1) {
obj[i].update(_arg1);
i--;
};
}
public function free():void{
i = (len - 1);
while (i > -1) {
obj[i].free();
i--;
};
}
}
}//package com.source.controller
Section 25
//Frames (com.source.frames.Frames)
package com.source.frames {
import flash.geom.*;
import flash.display.*;
public class Frames {
public var frames:Array;
public var posx:Array;
public var posy:Array;
public var totalFrames:int;
public var scale:Number;
protected static const DEST_POINT:Point = new Point(0, 0);
protected static var scratchBitmapData:BitmapData = null;
protected static var scratchSize:int = 128;
public function Frames(){
frames = new Array();
posx = new Array();
posy = new Array();
totalFrames = 0;
}
public static function createBmpFromMC(_arg1:Class, _arg2:Number=1):Frames{
var _local10:Rectangle;
var _local11:int;
var _local12:int;
var _local15:Rectangle;
var _local16:BitmapData;
var _local3:MovieClip = MovieClip(new (_arg1));
var _local4:Frames = new (Frames);
var _local5:int = _local3.totalFrames;
var _local6:Array = _local4.frames;
var _local7:Array = _local4.posx;
var _local8:Array = _local4.posy;
var _local9:Number = _arg2;
var _local13:Matrix = new Matrix();
_local13.scale(_arg2, _arg2);
var _local14 = 1;
while (_local14 <= _local5) {
_local3.gotoAndStop(_local14);
_local10 = _local3.getBounds(_local3);
_local10.width = (Math.ceil(_local10.width) + 2);
_local10.height = (Math.ceil(_local10.height) + 2);
prepareScratch(_local10);
_local11 = (Math.floor(_local10.x) - 1);
_local12 = (Math.floor(_local10.y) - 1);
_local13.tx = -(_local11);
_local13.ty = -(_local12);
scratchBitmapData.draw(_local3, _local13);
_local15 = scratchBitmapData.getColorBoundsRect(4278190080, 0, false);
scratchBitmapData.getColorBoundsRect(4278190080, 0, false).x = (_local15.x - 1);
_local15.y = (_local15.y - 1);
_local15.width = (_local15.width + 2);
_local15.height = (_local15.height + 2);
_local16 = new BitmapData(_local15.width, _local15.height, true, 0);
_local16.copyPixels(scratchBitmapData, _local15, DEST_POINT);
_local11 = (_local11 + _local15.x);
_local12 = (_local12 + _local15.y);
_local6.push(_local16);
_local7.push(_local11);
_local8.push(_local12);
_local14++;
};
_local4.totalFrames = _local4.frames.length;
trace("map created");
return (_local4);
}
public static function disposeScratch():void{
scratchBitmapData.dispose();
scratchBitmapData = null;
}
protected static function prepareScratch(_arg1:Rectangle):void{
var _local2:Boolean;
while ((((_arg1.width >= scratchSize)) || ((_arg1.height >= scratchSize)))) {
scratchSize = (scratchSize * 2);
_local2 = true;
};
if (((!((scratchBitmapData == null))) && (_local2))){
disposeScratch();
};
if (scratchBitmapData == null){
scratchBitmapData = new BitmapData(scratchSize, scratchSize, true, 0);
} else {
scratchBitmapData.fillRect(scratchBitmapData.rect, 0);
};
}
}
}//package com.source.frames
Section 26
//CCMenu (com.source.menu.CCMenu)
package com.source.menu {
import com.greensock.*;
import flash.events.*;
import com.source.*;
import flash.text.*;
import flash.display.*;
import com.greensock.easing.*;
import flash.net.*;
import com.source.button.*;
public class CCMenu extends Sprite {
private const PAGE_MENU:int = 0;
private const PAGE_MAP:int = 1;
private const PAGE_CREDITS:int = 2;
private const PAGE_GAME:int = 3;
private var _page:int;// = 0
private var _universe:Universe;
private var buttonstart:SimpleButton;
private var buttonmoregames:SimpleButton;
private var buttoncredits:SimpleButton;
private var buttonmainmenu:SimpleButton;
private var buttonsound:Sprite;
private var creditsSprite:Sprite;
private var blackout:Sprite;
private var header:Sprite;
private var backheader:Sprite;
private var background:Sprite;
public var lvlButtons:Array;
private var chosenLevel:int;// = -1
private var btn_panel:Sprite;
private var btn_soundmenuoff:SimpleButton;
private var btn_soundmenuon:SimpleButton;
private var btn_soundoff:SimpleButton;
private var btn_soundon:SimpleButton;
private var btn_pauseoff:SimpleButton;
private var btn_pauseon:SimpleButton;
private var btn_settings:SimpleButton;
private var btn_restart:SimpleButton;
private var btn_back:SimpleButton;
private var btn_gamepirate1:SimpleButton;
private var btn_gamepirate2:SimpleButton;
public function CCMenu():void{
var _local4:int;
var _local5:ButtonLevel;
_universe = Universe.getInstance();
lvlButtons = [];
super();
background = new MainmenuBackground();
header = new MainmenuLogo();
creditsSprite = new CreditsSprite();
header.x = 400;
header.y = -250;
creditsSprite.x = 400;
creditsSprite.y = 900;
blackout = new Sprite();
blackout.graphics.beginFill(0);
blackout.graphics.drawRect(0, 0, 800, 600);
blackout.graphics.endFill();
blackout.mouseEnabled = false;
buttonstart = new btn_Start();
buttonmoregames = new btn_Moregames();
buttoncredits = new btn_Credits();
buttonmainmenu = new btn_Menu();
btn_back = new btn_MBack();
btn_gamepirate1 = new piratebutton1();
btn_gamepirate2 = new piratebutton2();
buttonstart.x = 313;
buttonmoregames.x = 616;
buttoncredits.x = 10;
buttonmainmenu.x = 10;
buttonstart.y = 610;
buttonmoregames.y = 610;
buttoncredits.y = 610;
buttonmainmenu.y = 610;
btn_gamepirate1.x = 625;
btn_gamepirate1.y = 800;
btn_gamepirate2.x = 290;
btn_gamepirate2.y = 105;
btn_gamepirate2.alpha = 0;
btn_panel = new btn_Panel();
btn_pauseoff = new btn_PauseOff();
btn_pauseon = new btn_PauseOn();
btn_restart = new btn_Restart();
btn_settings = new btn_Settings();
btn_soundoff = new btn_SoundOff();
btn_soundon = new btn_SoundOn();
btn_soundmenuoff = new btn_SoundOffMenu();
btn_soundmenuon = new btn_SoundOnMenu();
btn_soundmenuoff.x = 754;
btn_soundmenuon.x = 754;
btn_soundmenuoff.y = -40;
btn_soundmenuon.y = -40;
btn_soundmenuon.visible = false;
btn_panel.x = 696;
btn_panel.y = 10;
btn_panel.visible = false;
btn_pauseoff.x = 6;
btn_pauseon.x = 6;
btn_restart.x = 26;
btn_soundoff.x = 46;
btn_soundon.x = 46;
btn_settings.x = 66;
btn_pauseoff.y = 6;
btn_pauseon.y = 6;
btn_restart.y = 6;
btn_soundoff.y = 6;
btn_soundon.y = 6;
btn_settings.y = 6;
btn_back.y = 650;
btn_back.x = 313;
addChild(background);
addChild(btn_gamepirate1);
addChild(btn_gamepirate2);
addChild(header);
addChild(buttonstart);
addChild(buttonmoregames);
addChild(buttoncredits);
addChild(creditsSprite);
addChild(btn_back);
addChild(btn_soundmenuoff);
addChild(btn_soundmenuon);
addChild(btn_panel);
btn_panel.addChild(btn_pauseoff);
btn_panel.addChild(btn_pauseon);
btn_panel.addChild(btn_restart);
btn_panel.addChild(btn_settings);
btn_panel.addChild(btn_soundoff);
btn_panel.addChild(btn_soundon);
addChild(blackout);
var _local1:TextFormat = new TextFormat("Univers Condensed");
_local1.size = 36;
_local1.color = 0xFFFFFF;
_local1.align = TextFormatAlign.CENTER;
var _local2:int;
var _local3:int;
while (_local3 < 3) {
_local4 = 0;
while (_local4 < 5) {
_local5 = new ButtonLevel(_local1, _local2, ChoseLevel);
if (_local2 < (_universe.maxlevel + 1)){
_local5.open();
};
_local2++;
_local5.x = ((_local4 * 102) + 150);
_local5.y = ((_local3 * 102) + 150);
_local5.visible = false;
_local5.alpha = 0;
addChild(_local5);
lvlButtons.push(_local5);
_local4++;
};
_local3++;
};
buttonstart.addEventListener(MouseEvent.CLICK, onClick);
buttonmainmenu.addEventListener(MouseEvent.CLICK, onClick);
buttoncredits.addEventListener(MouseEvent.CLICK, onClick);
btn_settings.addEventListener(MouseEvent.CLICK, onSettings);
btn_restart.addEventListener(MouseEvent.CLICK, onRestart);
btn_back.addEventListener(MouseEvent.CLICK, onBack);
btn_soundmenuoff.addEventListener(MouseEvent.CLICK, onSound);
btn_soundmenuon.addEventListener(MouseEvent.CLICK, onSound);
btn_soundoff.addEventListener(MouseEvent.CLICK, onSound);
btn_soundon.addEventListener(MouseEvent.CLICK, onSound);
btn_pauseoff.addEventListener(MouseEvent.CLICK, onPause);
btn_pauseon.addEventListener(MouseEvent.CLICK, onPause);
btn_gamepirate1.addEventListener(MouseEvent.CLICK, onMoreGames);
btn_gamepirate2.addEventListener(MouseEvent.CLICK, onMoreGames);
buttonmoregames.addEventListener(MouseEvent.CLICK, onMoreGames);
}
public function onMoreGames(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gamepirate.com"));
}
public function onBack(_arg1:MouseEvent):void{
changePage(0);
}
public function onSound(_arg1:MouseEvent):void{
if ((((_arg1.currentTarget == btn_soundmenuoff)) || ((_arg1.currentTarget == btn_soundoff)))){
btn_soundmenuoff.visible = false;
btn_soundmenuon.visible = true;
btn_soundoff.visible = false;
btn_soundon.visible = true;
_universe.s_transform.volume = 0;
_universe.mC.soundTransform = _universe.s_transform;
_universe.sC.soundTransform = _universe.s_transform;
_universe.mC.stop();
trace("sound off");
} else {
if ((((_arg1.currentTarget == btn_soundmenuon)) || ((_arg1.currentTarget == btn_soundon)))){
btn_soundmenuoff.visible = true;
btn_soundmenuon.visible = false;
btn_soundoff.visible = true;
btn_soundon.visible = false;
_universe.s_transform.volume = 1;
_universe.mC.soundTransform = _universe.s_transform;
_universe.sC.soundTransform = _universe.s_transform;
_universe.playNext();
trace("sound on");
};
};
}
public function onPause(_arg1:MouseEvent):void{
if (_arg1.currentTarget == btn_pauseon){
btn_pauseoff.visible = true;
btn_pauseon.visible = false;
_universe.gamepause = true;
} else {
btn_pauseoff.visible = false;
btn_pauseon.visible = true;
_universe.gamepause = false;
};
}
public function onRestart(_arg1:Event):void{
_universe.stopLevel();
_universe.startLevel(_universe.curlevel);
}
public function ChoseLevel(_arg1:int):void{
chosenLevel = _arg1;
showGame();
}
public function init():void{
blackout.alpha = 1;
showMenu();
}
public function changePage(_arg1:int):void{
switch (_page){
case PAGE_MENU:
hideMenu();
break;
case PAGE_MAP:
hideMap();
break;
case PAGE_CREDITS:
hideCredits();
break;
case PAGE_GAME:
hideGame();
break;
};
_page = _arg1;
switch (_page){
case PAGE_MENU:
showMenu();
break;
case PAGE_MAP:
showMap();
break;
case PAGE_CREDITS:
showCredits();
break;
case PAGE_GAME:
showGame();
break;
};
}
private function showMenu():void{
_page = PAGE_MENU;
blackout.visible = true;
background.visible = true;
header.visible = true;
buttonmainmenu.visible = true;
TweenLite.to(blackout, 1, {alpha:0});
TweenLite.to(header, 1, {delay:0.5, y:10});
TweenLite.to(buttonstart, 1, {delay:0.5, y:546});
TweenLite.to(buttonmoregames, 1, {delay:0.5, y:546});
TweenLite.to(buttoncredits, 1, {delay:0.5, y:546});
TweenLite.to(btn_soundmenuoff, 1, {delay:0.5, y:10});
TweenLite.to(btn_soundmenuon, 1, {delay:0.5, y:10});
TweenLite.to(btn_gamepirate1, 1, {delay:0.5, y:535});
}
private function hideMenu():void{
TweenLite.to(buttonstart, 1, {y:650});
TweenLite.to(buttonmoregames, 1, {y:650});
TweenLite.to(btn_gamepirate1, 1, {y:800});
TweenLite.to(buttoncredits, 1, {y:650});
TweenLite.to(header, 1, {y:-250});
}
private function showMap():void{
_page = PAGE_MAP;
btn_gamepirate2.visible = true;
TweenLite.to(buttonmainmenu, 1, {alpha:1});
TweenLite.to(btn_gamepirate2, 1, {alpha:1});
var _local1:int;
while (_local1 < lvlButtons.length) {
lvlButtons[_local1].visible = true;
TweenLite.to(lvlButtons[_local1], 1, {alpha:1});
_local1++;
};
trace("map showed");
}
private function hideMap():void{
TweenLite.to(buttonmainmenu, 1, {alpha:0});
TweenLite.to(btn_gamepirate2, 0.7, {alpha:0});
var _local1:int;
while (_local1 < (lvlButtons.length - 1)) {
TweenLite.to(lvlButtons[_local1], 0.3, {alpha:0});
_local1++;
};
TweenLite.to(lvlButtons[(lvlButtons.length - 1)], 0.3, {alpha:0, onComplete:invisibleMap});
}
private function invisibleMap():void{
btn_gamepirate2.visible = false;
var _local1:int;
while (_local1 < lvlButtons.length) {
lvlButtons[_local1].visible = false;
_local1++;
};
}
private function showCredits():void{
creditsSprite.alpha = 0;
creditsSprite.y = 400;
TweenLite.to(btn_back, 0.5, {delay:0.2, y:546});
TweenLite.to(creditsSprite, 0.5, {delay:0.2, y:300, alpha:1});
}
private function hideCredits():void{
TweenLite.to(btn_back, 0.5, {delay:0.2, y:650});
TweenLite.to(creditsSprite, 0.5, {delay:0.2, y:400, alpha:0});
}
private function showGame():void{
_page = PAGE_GAME;
hideMap();
btn_panel.visible = true;
btn_soundmenuoff.visible = false;
btn_soundmenuon.visible = false;
showLoading();
}
private function hideGame():void{
}
private function showLoading():void{
blackout.visible = false;
background.visible = false;
header.visible = false;
buttonmainmenu.visible = false;
trace(("ok, level = " + chosenLevel));
_universe.startLevel(chosenLevel);
trace("ok");
}
private function showPanel():void{
}
private function onSettings(_arg1:MouseEvent):void{
if (_universe.settings.opened == false){
_universe.settings.Show();
_universe.gamepause = true;
} else {
_universe.settings.Hide();
_universe.gamepause = false;
};
}
private function onClick(_arg1:MouseEvent):void{
switch (_arg1.currentTarget){
case buttonstart:
changePage(PAGE_MAP);
break;
case buttonmainmenu:
changePage(PAGE_MENU);
break;
case buttoncredits:
changePage(PAGE_CREDITS);
break;
};
}
}
}//package com.source.menu
Section 27
//Hint (com.source.menu.Hint)
package com.source.menu {
import com.greensock.*;
import com.source.*;
import flash.display.*;
import com.greensock.easing.*;
public class Hint extends Sprite {
private var hint:Sprite;
private var data:Sprite;
private var opened:Boolean;// = false
private var _universe:Universe;
public function Hint(_arg1:int, _arg2:int, _arg3:Sprite):void{
_universe = Universe.getInstance();
super();
data = _arg3;
x = _arg1;
y = _arg2;
data.x = 0;
data.y = 0;
addChild(data);
}
public function init():void{
trace("hint inited");
_universe.box.addChild(this);
}
public function free():void{
_universe.box.removeChild(this);
}
}
}//package com.source.menu
Section 28
//MenuPanel (com.source.menu.MenuPanel)
package com.source.menu {
import flash.events.*;
import com.source.*;
import flash.display.*;
public class MenuPanel extends Sprite {
public var panel:Sprite;
public var header:Sprite;
public var btnRestart:SimpleButton;
public var btnMainMenu:SimpleButton;
public var btnBack:SimpleButton;
public var btnSelectLevel:SimpleButton;
public var _universe:Universe;
public var opened:Boolean;// = false
public function MenuPanel():void{
_universe = Universe.getInstance();
super();
panel = new VicDefSprite();
header = new MenuSprite();
btnBack = new btn_MBack();
btnMainMenu = new btn_MMainmenu();
btnSelectLevel = new btn_MSelectlevel();
btnRestart = new btn_MRestart();
addChild(panel);
addChild(header);
addChild(btnBack);
addChild(btnMainMenu);
addChild(btnSelectLevel);
addChild(btnRestart);
header.x = 83;
header.y = -18;
btnBack.x = 66;
btnMainMenu.x = 66;
btnSelectLevel.x = 66;
btnRestart.x = 66;
btnBack.y = 212;
btnMainMenu.y = 160;
btnSelectLevel.y = 108;
btnRestart.y = 56;
btnBack.addEventListener(MouseEvent.CLICK, onClick);
btnMainMenu.addEventListener(MouseEvent.CLICK, onClick);
btnSelectLevel.addEventListener(MouseEvent.CLICK, onClick);
btnRestart.addEventListener(MouseEvent.CLICK, onClick);
x = 247;
y = -600;
visible = false;
}
public function onClick(_arg1:MouseEvent):void{
if (_arg1.currentTarget == btnSelectLevel){
_universe.stopLevel();
_universe.menu.changePage(1);
} else {
if (_arg1.currentTarget == btnMainMenu){
_universe.stopLevel();
_universe.menu.changePage(0);
} else {
if (_arg1.currentTarget == btnRestart){
_universe.stopLevel();
_universe.startLevel(_universe.curlevel);
} else {
_universe.gamepause = false;
};
};
};
Hide();
}
public function Show():void{
y = 166;
visible = true;
opened = true;
}
public function Hide():void{
visible = false;
y = -600;
opened = false;
}
}
}//package com.source.menu
Section 29
//VictoryDefeatPanel (com.source.menu.VictoryDefeatPanel)
package com.source.menu {
import flash.events.*;
import com.source.*;
import flash.text.*;
import flash.display.*;
public class VictoryDefeatPanel extends Sprite {
private var _universe:Universe;
private var panel:Sprite;
private var vicSprite:Sprite;
private var defSprite:Sprite;
private var btn_menu:SimpleButton;
private var btn_moregames:SimpleButton;
private var btn_replay:SimpleButton;
private var btn_next:SimpleButton;
private var levelscore:TextField;
private var totalscore:TextField;
public function VictoryDefeatPanel():void{
_universe = Universe.getInstance();
super();
this.visible = false;
this.x = 247;
this.y = -500;
panel = new VicDefSprite();
vicSprite = new VictorySprite();
defSprite = new DefeatSprite();
btn_menu = new btn_Menu();
btn_moregames = new btn_Moregames();
btn_replay = new btn_Replay();
btn_next = new btn_Next();
levelscore = new TextField();
levelscore.embedFonts = true;
levelscore.selectable = false;
levelscore.defaultTextFormat = _universe.textFormatUI;
levelscore.width = 306;
levelscore.height = 50;
levelscore.y = 48;
totalscore = new TextField();
totalscore.embedFonts = true;
totalscore.selectable = false;
totalscore.defaultTextFormat = _universe.textFormatUI;
totalscore.width = 306;
totalscore.height = 50;
totalscore.y = 90;
vicSprite.x = 34;
vicSprite.y = -24;
defSprite.x = 59;
defSprite.y = -24;
btn_menu.x = 25;
btn_moregames.x = 66;
btn_next.x = 165;
btn_replay.x = 165;
btn_menu.y = 164;
btn_moregames.y = 220;
btn_next.y = 164;
btn_replay.y = 164;
addChild(panel);
addChild(vicSprite);
addChild(defSprite);
addChild(btn_menu);
addChild(btn_moregames);
addChild(btn_next);
addChild(btn_replay);
addChild(levelscore);
addChild(totalscore);
btn_next.addEventListener(MouseEvent.CLICK, onNext);
btn_replay.addEventListener(MouseEvent.CLICK, onReplay);
btn_menu.addEventListener(MouseEvent.CLICK, onMenu);
btn_moregames.addEventListener(MouseEvent.CLICK, onMoregames);
trace("++++++++ vicdef created");
visible = false;
}
public function init():void{
}
public function FinalScene():void{
vicSprite.visible = true;
defSprite.visible = false;
btn_next.visible = false;
btn_menu.x = 95;
btn_replay.visible = false;
visible = true;
levelscore.text = ("LEVEL SCORE: " + _universe.levelscore.toString());
totalscore.text = ("TOTAL SCORE: " + _universe.totalscore.toString());
this.y = 156;
}
public function Victory():void{
vicSprite.visible = true;
defSprite.visible = false;
btn_next.visible = true;
btn_replay.visible = false;
btn_menu.x = 25;
visible = true;
levelscore.text = ("LEVEL SCORE: " + _universe.levelscore.toString());
totalscore.text = ("TOTAL SCORE: " + _universe.totalscore.toString());
this.y = 156;
if ((_universe.curlevel + 1) < 15){
_universe.menu.lvlButtons[(_universe.curlevel + 1)].open();
if (_universe.curlevel == _universe.maxlevel){
_universe.maxlevel++;
_universe.SaveLSO();
};
};
}
public function Defeat():void{
vicSprite.visible = false;
defSprite.visible = true;
btn_next.visible = false;
btn_replay.visible = true;
btn_menu.x = 25;
visible = true;
levelscore.text = ("LEVEL SCORE: " + _universe.levelscore.toString());
totalscore.text = ("TOTAL SCORE: " + _universe.totalscore.toString());
this.y = 156;
}
private function GameOver():void{
trace("game over");
}
public function Hide():void{
this.y = -500;
visible = false;
}
private function onNext(_arg1:MouseEvent):void{
_universe.stopLevel();
if (_universe.curlevel < 14){
_universe.startLevel((_universe.curlevel + 1));
};
Hide();
}
private function onMenu(_arg1:MouseEvent):void{
_universe.stopLevel();
_universe.menu.changePage(0);
Hide();
}
private function onReplay(_arg1:MouseEvent):void{
_universe.stopLevel();
_universe.startLevel(_universe.curlevel);
Hide();
}
private function onMoregames(_arg1:MouseEvent):void{
}
}
}//package com.source.menu
Section 30
//BlastBomb (com.source.Sfxs.BlastBomb)
package com.source.Sfxs {
import com.source.*;
public class BlastBomb extends GameObject {
public function BlastBomb():void{
_mc = new blast_bomb();
_mc.stop();
addChild(_mc);
}
public function init(_arg1:Number, _arg2:Number):void{
_free = false;
_universe.box.addChild(this);
x = _arg1;
y = _arg2;
scaleX = 1;
scaleY = 1;
_mc.gotoAndPlay(1);
_universe.sC = _universe.s_boom00.play(0, 0, _universe.s_transform);
}
override public function update(_arg1:Number):void{
if (_mc.currentFrame == _mc.totalFrames){
_mc.stop();
free();
};
}
override public function free():void{
super.free();
_universe._blastbomb.remove(this);
}
}
}//package com.source.Sfxs
Section 31
//BlastHeliRocket (com.source.Sfxs.BlastHeliRocket)
package com.source.Sfxs {
import com.source.*;
public class BlastHeliRocket extends GameObject {
private var frame:int;
public function BlastHeliRocket():void{
_mc = new blast_bullet();
_mc.stop();
addChild(_mc);
}
public function init(_arg1:Number, _arg2:Number):void{
_free = false;
_universe.box.addChild(this);
x = _arg1;
y = _arg2;
frame = ((Math.random() * 2) + 11);
_mc.gotoAndPlay(frame);
frame = (frame + 9);
}
override public function update(_arg1:Number):void{
if (_mc.currentFrame == frame){
_mc.stop();
free();
};
}
override public function free():void{
super.free();
_universe._blasthelirocket.remove(this);
}
}
}//package com.source.Sfxs
Section 32
//BlastTank (com.source.Sfxs.BlastTank)
package com.source.Sfxs {
import com.source.*;
public class BlastTank extends GameObject {
public function BlastTank():void{
_mc = new blast_tank();
_mc.stop();
addChild(_mc);
}
public function init(_arg1:Number, _arg2:Number):void{
_free = false;
_universe.box.addChild(this);
x = _arg1;
y = _arg2;
_mc.gotoAndPlay(1);
_universe.sC = _universe.s_boom01.play(0, 0, _universe.s_transform);
}
override public function update(_arg1:Number):void{
if (_mc.currentFrame == _mc.totalFrames){
_mc.stop();
free();
};
}
override public function free():void{
super.free();
_universe._blasttank.remove(this);
}
}
}//package com.source.Sfxs
Section 33
//Drop (com.source.Units.Drop)
package com.source.Units {
import com.source.Bases.*;
import flash.text.*;
import flash.display.*;
import flash.filters.*;
public class Drop extends Unit {
private const START:int = 0;
private const MOVING:int = 2;
private const FINISH:int = 4;
private const WAIT:int = 5;
private const DOWN:int = 6;
private var spdcur:Number;// = 0
private var spdmax:Number;// = 70
private var acs:Number;// = 0.5
private var maxh:Number;// = 50
private var dx:Number;// = 0
private var dy:Number;// = 0
private var d:Number;
private var cd:Number;
private var ld:Number;
private var md:Number;
private var rangefly:Number;// = 0
private var rangemax:Number;// = 120
private var rangecur:Number;// = 0
private var _base:Base;
private var realy:Number;
private var phase:int;// = 0
private var propeller:MovieClip;
public function Drop():void{
mc = new mc_Drop();
_type = UNIT_DROP;
propeller = new mc_DropPropeller();
propeller.y = -2;
shadow = new mc_Shadow();
mc.stop();
tf = new TextField();
tf.selectable = false;
tf.embedFonts = true;
tf.width = 30;
tf.x = -15;
tf.height = 20;
tf.y = -20;
tf.defaultTextFormat = _universe.textFormatUnit;
tf.filters = [new GlowFilter(0, 1, 2, 2, 3)];
tf.mouseEnabled = false;
propeller.mouseEnabled = false;
mc.mouseEnabled = false;
shadow.mouseEnabled = false;
mouseEnabled = false;
addChild(shadow);
addChild(mc);
addChild(propeller);
addChild(tf);
}
override public function init(_arg1:Base, _arg2:Base, _arg3:int):void{
_free = false;
_force = _arg1._force;
_base = _arg1;
x = _base.x;
_y = _base._y;
count = _arg3;
h = 0;
spdcur = 0;
_universe.box.addChild(this);
mc.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
phase = WAIT;
_universe.sC = _universe.s_heli_born.play(0, 0, _universe.s_transform);
}
override public function update(_arg1:Number):void{
if (phase != WAIT){
CalcVect();
x = (x + ((dx * spdcur) * _arg1));
_y = (_y + ((dy * spdcur) * _arg1));
y = (_y * ky);
mc.y = -(h);
propeller.y = (-(h) - 2);
tf.y = (-(h) - 15);
if (phase == START){
h = (((cd / ld) - 0.5) * 2);
h = (Math.sqrt((1 - (h * h))) * maxh);
if (spdcur < spdmax){
spdcur = (spdcur + acs);
rangefly = (rangefly + (spdcur * _arg1));
};
cd = (cd - (spdcur * _arg1));
if (cd < (ld * 0.5)){
cd = (ld * 0.5);
if (md == 0){
phase = FINISH;
} else {
phase = MOVING;
};
};
} else {
if (phase == MOVING){
if (d < (ld * 0.5)){
phase = FINISH;
};
} else {
if (phase == DOWN){
} else {
h = (((d / ld) - 0.5) * 2);
h = (Math.sqrt((1 - (h * h))) * maxh);
if (d < rangefly){
if (spdcur > 10){
spdcur = (spdcur - acs);
};
};
if (d < acs){
captureBase();
};
};
};
};
};
}
private function captureBase():void{
_target.addDamage(this);
free();
}
private function CalcVect():void{
dx = (_target.x - x);
dy = (_target._y - _y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
dx = (dx / d);
dy = (dy / d);
var _local1:int = frameDirect(dx, dy);
mc.gotoAndStop(_local1);
if (dx < 0){
mc.scaleX = -1;
} else {
mc.scaleX = 1;
};
}
public function launch(_arg1:Base):void{
if ((_arg1 is Location)){
_target = _arg1;
} else {
_target = _arg1.base;
};
dx = (_target.x - x);
dy = (_target._y - _y);
cd = Math.sqrt(((dx * dx) + (dy * dy)));
dx = (dx / cd);
dy = (dy / cd);
if (cd > rangemax){
md = (cd - rangemax);
cd = rangemax;
} else {
md = 0;
};
ld = cd;
rangefly = 0;
tf.text = count.toString();
phase = START;
}
override public function free():void{
super.free();
_universe._drops.remove(this);
}
}
}//package com.source.Units
Section 34
//Heli (com.source.Units.Heli)
package com.source.Units {
import com.source.Bases.*;
import flash.text.*;
import flash.display.*;
import flash.filters.*;
public class Heli extends Unit {
private const START:int = 0;
private const TOTARGET:int = 1;
private const ATTACK:int = 2;
private const TOBASE:int = 3;
private const FINISH:int = 4;
private const WAIT:int = 5;
private var maxh:Number;// = 40
private var spdcur:Number;// = 0
private var spdmax:Number;// = 90
private var acs:Number;// = 1
private var d:Number;
private var cd:Number;
private var ld:Number;
private var md:Number;
private var atkdelay:Number;// = 0.15
private var atkdelaymax:Number;// = 0.15
private var atkcount:int;// = 0
private var dx:Number;// = 0
private var dy:Number;// = 0
private var vx:Number;// = 0
private var vy:Number;// = 0
private var rx:Number;// = 0
private var ry:Number;// = 0
private var rr:Number;// = 0
private var rangefly:Number;
private var rangeatk:Number;// = 100
private var rangemax:Number;// = 120
private var _base:Base;
private var frameangle:int;
private var realy:Number;
private var rocket:Object;
private var phase:int;// = 0
private var propeller:MovieClip;
private var color:MovieClip;
public function Heli():void{
mc = new mc_HeliBody();
_type = UNIT_HELI;
color = new mc_HeliColor();
propeller = new mc_HeliPropeller();
propeller.y = -2;
shadow = new mc_Shadow();
mc.stop();
tf = new TextField();
tf.selectable = false;
tf.embedFonts = true;
tf.width = 30;
tf.x = -15;
tf.height = 20;
tf.y = -20;
tf.defaultTextFormat = _universe.textFormatUnit;
tf.filters = [new GlowFilter(0, 1, 2, 2, 3)];
tf2 = new TextField();
tf2.selectable = false;
tf2.embedFonts = true;
tf2.width = 30;
tf2.x = -15;
tf2.height = 20;
tf2.y = -30;
tf2.defaultTextFormat = _universe.textFormatUnit;
tf2.filters = [new GlowFilter(0, 1, 2, 2, 3)];
tf2.alpha = 0;
tf.mouseEnabled = false;
propeller.mouseEnabled = false;
mc.mouseEnabled = false;
shadow.mouseEnabled = false;
mouseEnabled = false;
addChild(shadow);
addChild(color);
addChild(mc);
addChild(propeller);
addChild(tf);
}
override public function init(_arg1:Base, _arg2:Base, _arg3:int):void{
_free = false;
_force = _arg1._force;
_base = _arg1;
x = _base.x;
_y = _base._y;
_target = _arg2;
count = _arg3;
spdcur = 0;
dx = (_arg2.x - x);
dy = (_arg2._y - _y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
vx = (dx / d);
vy = (dy / d);
tf2.alpha = 0;
_universe.box.addChild(this);
color.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
phase = START;
_universe.sC = _universe.s_heli_born.play(0, 0, _universe.s_transform);
}
public function launch(_arg1:Base):void{
if ((_arg1 is Location)){
_target = _arg1;
} else {
_target = _arg1.base;
};
spdcur = 0;
dx = (_target.x - x);
dy = (_target._y - _y);
cd = Math.sqrt(((dx * dx) + (dy * dy)));
dx = (dx / cd);
dy = (dy / cd);
frameangle = frameDirect(dx, dy);
mc.gotoAndStop(frameangle);
color.gotoAndStop(frameangle);
if (cd > rangemax){
md = (cd - rangemax);
cd = rangemax;
} else {
md = 0;
};
ld = cd;
h = 0;
rangefly = 0;
atkcount = _base.countcur;
atkdelay = atkdelaymax;
tf.text = count.toString();
phase = START;
_universe.sC = _universe.s_heli_born.play(0, 0, _universe.s_transform);
}
override public function update(_arg1:Number):void{
if (phase != WAIT){
_delta = _arg1;
CalcVect();
x = (x + ((dx * spdcur) * _arg1));
_y = (_y + ((dy * spdcur) * _arg1));
y = (_y * ky);
mc.y = -(h);
color.y = -(h);
propeller.y = (-(h) - 2);
tf.y = (-(h) - 20);
tf.y = (-(h) - 30);
if (phase == START){
h = (((cd / ld) - 0.5) * 2);
h = (Math.sqrt((1 - (h * h))) * maxh);
if (spdcur < spdmax){
spdcur = (spdcur + acs);
rangefly = (rangefly + (spdcur * _arg1));
};
cd = (cd - (spdcur * _arg1));
if (cd < (ld * 0.5)){
cd = (ld * 0.5);
if (md == 0){
phase = ATTACK;
} else {
phase = TOTARGET;
};
};
} else {
if (phase == TOTARGET){
if (d < rangeatk){
phase = ATTACK;
rx = dx;
ry = dy;
rr = 0;
};
} else {
if (phase == ATTACK){
if (spdcur > 0){
spdcur = (spdcur - acs);
};
if ((((atkcount > 0)) && (!((_force == _target._force))))){
if (atkdelay > 0){
atkdelay = (atkdelay - _arg1);
} else {
atkdelay = atkdelaymax;
atkcount--;
launchRocket();
};
} else {
_target = _base;
CalcVect();
phase = TOBASE;
};
} else {
if (phase == TOBASE){
rotating();
if (spdcur < spdmax){
spdcur = (spdcur + acs);
};
if (d < (ld * 0.5)){
cd = (ld * 0.5);
phase = FINISH;
};
} else {
h = (((d / ld) - 0.5) * 2);
h = (Math.sqrt((1 - (h * h))) * maxh);
if ((((rangefly > d)) && ((spdcur > (acs * 2))))){
spdcur = (spdcur - acs);
rangefly = (rangefly - (spdcur * _arg1));
};
if (d < acs){
finishFlying();
};
};
};
};
};
};
}
private function rotating():void{
var _local1:Number;
var _local2:Number;
var _local3:int;
if (rr < 180){
_local1 = (60 * _delta);
rr = (rr + _local1);
_local1 = ((_local1 * Math.PI) / 180);
_local2 = ((Math.cos(_local1) * rx) + (Math.sin(_local1) * ry));
ry = ((Math.cos(_local1) * ry) - (Math.sin(_local1) * rx));
rx = _local2;
_local3 = frameDirect(rx, ry);
trace(((((((("rr = " + rr) + " ") + rx) + " ") + ry) + " frm ") + _local3));
mc.gotoAndStop(_local3);
color.gotoAndStop(_local3);
if (rx < 0){
mc.scaleX = -1;
color.scaleX = -1;
} else {
mc.scaleX = 1;
color.scaleX = 1;
};
};
}
private function CalcVect():void{
dx = (_target.x - x);
dy = (_target._y - _y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
dx = (dx / d);
dy = (dy / d);
var _local1:int = frameDirect(dx, dy);
mc.gotoAndStop(_local1);
if (dx < 0){
mc.scaleX = -1;
color.scaleX = -1;
} else {
mc.scaleX = 1;
color.scaleX = 1;
};
}
private function finishFlying():void{
x = _base.x;
_y = _base._y;
y = (_y * ky);
mc.y = 0;
if (_target._force == _force){
_target.base.countcur = (_target.base.countcur + count);
_target.base.out();
} else {
_target.base.addDamage(this);
};
phase = WAIT;
free();
}
private function launchRocket():void{
rocket = _universe._helirockets.add();
rocket.init(x, (_y + mc.y), 200, 1, _target);
rocket = null;
_universe.sC = _universe.s_heli_shot.play(0, 0, _universe.s_transform);
}
override public function free():void{
super.free();
_universe._helis.remove(this);
}
}
}//package com.source.Units
Section 35
//Jet (com.source.Units.Jet)
package com.source.Units {
import com.source.Bases.*;
public class Jet extends Unit {
private var dx:Number;
private var dy:Number;
private var vx:Number;
private var vy:Number;
private var d:Number;
private var ready:Boolean;// = true
private var range:Number;// = 100
private var rocket:Object;
public function Jet():void{
mc = new mc_Jet();
_type = UNIT_JET;
shadow = new mc_Shadow();
shadow.mouseEnabled = false;
mc.mouseEnabled = false;
mouseEnabled = false;
addChild(shadow);
addChild(mc);
mc.y = -50;
_spd = 500;
}
override public function init(_arg1:Base, _arg2:Base, _arg3:int):void{
_force = _arg1._force;
_target = _arg2;
x = _arg1.x;
_y = _arg1._y;
ready = true;
mc.scaleX = 1;
mc.scaleY = 1;
dx = (_target.x / 800);
dy = (_target.y / 600);
if (dx < 0.5){
if (dy < 0.5){
x = (_target.x + 800);
_y = (_target._y + 800);
mc.gotoAndStop(2);
mc.scaleX = 1;
} else {
x = (_target.x + 800);
_y = (_target._y - 800);
mc.gotoAndStop(1);
mc.scaleX = 1;
};
} else {
if (dy < 0.5){
x = (_target.x - 800);
_y = (_target._y + 800);
mc.gotoAndStop(2);
mc.scaleX = -1;
} else {
x = (_target.x - 800);
_y = (_target._y - 800);
mc.gotoAndStop(1);
mc.scaleX = -1;
};
};
dx = (_target.x - x);
dy = (_target._y - _y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
vx = (dx / d);
vy = (dy / d);
mc.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
_universe.box.addChild(this);
_universe.sC = _universe.s_jet_fly.play(0, 0, _universe.s_transform);
}
override public function update(_arg1:Number):void{
x = (x + ((vx * _spd) * _arg1));
_y = (_y + ((vy * _spd) * _arg1));
y = (_y * ky);
if (ready == true){
dx = (_target.x - x);
dy = (_target.y - y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
if (d < range){
rocket = _universe._rocketstobases.add();
rocket.init(x, (_y + mc.y), 300, 25, _target, _universe.box.getChildIndex(this));
ready = false;
trace("drop bomb");
};
} else {
if ((((((((x < -50)) || ((x > 850)))) || ((y < -50)))) || ((y > 800)))){
free();
};
};
}
override public function free():void{
super.free();
_universe._jets.remove(this);
}
}
}//package com.source.Units
Section 36
//RocketBall (com.source.Units.RocketBall)
package com.source.Units {
import com.source.Bases.*;
public class RocketBall extends Unit {
private var maxh:Number;
private var spdcur:Number;// = 0
private var spdmax:Number;// = 100
private var acs:Number;// = 1
private var cd:Number;
private var ld:Number;
private var md:Number;
private var dx:Number;
private var dy:Number;
public function RocketBall():void{
_type = UNIT_ROCKET;
count = 20;
shadow = new mc_Shadow();
addChild(shadow);
}
override public function init(_arg1:Base, _arg2:Base, _arg3:int):void{
_free = false;
_force = _arg1._force;
_target = _arg2;
x = _arg1.x;
y = _arg1.y;
h = 0;
spdcur = 0;
dx = (_target.x - x);
dy = (_target.y - y);
cd = Math.sqrt(((dx * dx) + (dy * dy)));
dx = (dx / cd);
dy = (dy / cd);
maxh = (cd * 0.5);
ld = cd;
md = (cd + 10);
trace(("maxh " + maxh));
_universe.box.addChild(this);
}
override public function update(_arg1:Number):void{
if (spdcur < spdmax){
spdcur = (spdcur + acs);
};
x = (x + ((dx * spdcur) * _arg1));
y = (y + ((dy * spdcur) * _arg1));
h = (((cd / ld) - 0.5) * 2);
h = (Math.sqrt((1 - (h * h))) * maxh);
mc.y = -(h);
CalcVect();
if (cd < (spdcur * _arg1)){
_target.addDamageRocket(count);
free();
};
}
private function CalcVect():void{
dx = (_target.x - x);
dy = (_target.y - y);
cd = Math.sqrt(((dx * dx) + (dy * dy)));
dx = (dx / cd);
dy = (dy / cd);
}
override public function free():void{
super.free();
_universe._rocketrockets.remove(this);
}
}
}//package com.source.Units
Section 37
//RocketNuclear (com.source.Units.RocketNuclear)
package com.source.Units {
import com.source.Bases.*;
public class RocketNuclear extends Unit {
private const START:int = 0;
private const FINISH:int = 1;
private var spdcur:Number;// = 0
private var spdmax:Number;// = 300
private var acs:Number;// = 2
private var timermaxspd:Number;// = 0
private var range:int;// = 200
private var tx:int;
private var ty:int;
private var phase:int;// = 0
public function RocketNuclear():void{
mc = new mc_NuclearRocket();
addChild(mc);
}
override public function init(_arg1:Base, _arg2:Base, _arg3:int):void{
_force = _arg1._force;
_target = _arg2;
_type = UNIT_NUKE;
x = _arg1.x;
_y = _arg1._y;
y = (_y * ky);
tx = _arg2.x;
ty = _arg2._y;
spdcur = 0;
timermaxspd = 0;
mc.scaleY = 1;
mc.y = 0;
phase = START;
_universe.box.addChild(this);
}
override public function update(_arg1:Number):void{
if (phase == START){
if (spdcur < spdmax){
spdcur = (spdcur + acs);
timermaxspd = (timermaxspd + _arg1);
} else {
trace(((("time on start = " + timermaxspd) + " spd = ") + spdcur));
};
mc.y = (mc.y - (spdcur * _arg1));
if (mc.y < -600){
x = tx;
y = (ty * ky);
mc.scaleY = -1;
phase = FINISH;
timermaxspd = 0;
};
} else {
timermaxspd = (timermaxspd + _arg1);
mc.y = (mc.y + (spdcur * _arg1));
if (mc.y > -20){
trace(((("time on finish = " + timermaxspd) + " spd = ") + spdcur));
killAll();
};
};
}
private function killAll():void{
_target.addDamageRocket(300, true);
var _local1:Object = _universe._blastbomb.add();
_local1.init(x, y);
_local1.scaleX = 3;
_local1.scaleY = 3;
_local1 = null;
free();
}
override public function free():void{
super.free();
_universe._nuclearrockets.remove(this);
}
}
}//package com.source.Units
Section 38
//Tank (com.source.Units.Tank)
package com.source.Units {
import com.source.controller.*;
import com.greensock.*;
import com.source.Bases.*;
import flash.text.*;
import com.greensock.easing.*;
import flash.filters.*;
public class Tank extends Unit {
private var tx:Number;
private var ty:Number;
private var vx:Number;
private var vy:Number;
private var dx:Number;
private var dy:Number;
public var d:Number;
private var ld:Number;
private var range:Number;// = 30
private var enemy:Unit;
private var delaymax:Number;// = 0.5
private var delayfind:Number;
private var enemys:Controller;
private var L:Array;
private var D:Array;
private var Bases:Array;
private var waylen:int;
private var arrlen:int;
private var cpoint:int;
private var npoint:int;
private var tpoint:int;
private var curframe:Number;// = 0
private var maxframe:int;// = 8
private var body:mc_TankBody;
private var tower:mc_TankTower;
public function Tank():void{
_type = UNIT_TANK;
mouseEnabled = false;
tf = new TextField();
tf.mouseEnabled = false;
tf.selectable = false;
tf.embedFonts = true;
tf.width = 30;
tf.x = -18;
tf.height = 20;
tf.y = -25;
tf.defaultTextFormat = _universe.textFormatUnit;
tf.filters = [new GlowFilter(0, 1, 2, 2, 3)];
tf2 = new TextField();
tf2.mouseEnabled = false;
tf2.selectable = false;
tf2.embedFonts = true;
tf2.width = 30;
tf2.x = -18;
tf2.height = 20;
tf2.y = -35;
tf2.alpha = 0;
tf2.defaultTextFormat = _universe.textFormatUnit;
tf2.filters = [new GlowFilter(0, 1, 2, 2, 3)];
body = new mc_TankBody();
body.mouseEnabled = false;
tower = new mc_TankTower();
tower.mouseEnabled = false;
tower.y = -7;
addChild(body);
addChild(tower);
addChild(tf);
addChild(tf2);
enemys = _universe._units;
range = (range * range);
}
override public function init(_arg1:Base, _arg2:Base, _arg3:int):void{
_free = false;
Bases = _universe._bases.obj;
L = _universe.L;
D = _universe.D;
arrlen = _universe._bases.len;
delayfind = delaymax;
_force = _arg1._force;
_target = _arg2;
_universe.box.addChild(this);
count = _arg3;
cpoint = _arg1._index;
tpoint = _arg2._index;
x = Bases[cpoint].x;
_y = Bases[cpoint]._y;
nextBase();
body.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
tower.transform.colorTransform = PushCLR(_universe.colors[(_force + 1)]);
tf.text = count.toString();
CalcVector();
Reborn();
if (_force == 1){
_universe.sC = _universe.s_tank_born.play(0, 0, _universe.s_transform);
};
}
private function Reborn():void{
if (vx < 0){
body.scaleX = -0.1;
body.scaleY = 0.1;
tower.scaleX = -0.1;
tower.scaleY = 0.1;
tower.y = -0.7;
TweenLite.to(body, 0.3, {scaleX:-1, scaleY:1, ease:Back.easeOut});
TweenLite.to(tower, 0.3, {scaleX:-1, scaleY:1, y:-7, ease:Back.easeOut});
} else {
body.scaleX = 0.1;
body.scaleY = 0.1;
tower.scaleX = 0.1;
tower.scaleY = 0.1;
tower.y = -0.7;
TweenLite.to(body, 0.3, {scaleX:1, scaleY:1, ease:Back.easeOut});
TweenLite.to(tower, 0.3, {scaleX:1, scaleY:1, y:-7, ease:Back.easeOut});
};
}
private function CalcVector():void{
tx = Bases[npoint].x;
ty = Bases[npoint]._y;
dx = (tx - x);
dy = (ty - _y);
d = Math.sqrt(((dx * dx) + (dy * dy)));
vx = (dx / d);
vy = (dy / d);
var _local1:int = frameDirect(vx, vy);
body.gotoAndStop(_local1);
tower.gotoAndStop(_local1);
if (vx < 0){
body.scaleX = -1;
tower.scaleX = -1;
} else {
body.scaleX = 1;
tower.scaleX = 1;
};
dx = (vx * _spd);
dy = (vy * _spd);
}
private function nextBase():void{
Bases[npoint].coming[_force] = (Bases[npoint].coming[_force] - count);
if (L[cpoint][tpoint] == 1){
npoint = tpoint;
} else {
waylen = 999999;
trace(arrlen);
i = 0;
while (i < arrlen) {
if (L[cpoint][i] == 1){
if ((((D[i][tpoint] > 1)) && ((D[i][tpoint] < waylen)))){
npoint = i;
waylen = D[i][tpoint];
};
};
i++;
};
};
Bases[npoint].coming[_force] = (Bases[npoint].coming[_force] + count);
}
override public function update(_arg1:Number):void{
var _local2:int;
var _local3:Number;
_delta = _arg1;
x = (x + (dx * _delta));
_y = (_y + (dy * _delta));
y = (_y * ky);
d = (d - (_spd * _delta));
if (tf2.alpha > 0){
tf2.alpha = (tf2.alpha - _delta);
};
if (d < 0.1){
cpoint = npoint;
if (cpoint == tpoint){
Bases[cpoint].addDamage(this);
free();
} else {
nextBase();
CalcVector();
};
};
delayfind = (delayfind - _delta);
if (delayfind < 0){
_local2 = 0;
while (_local2 < enemys.len) {
enemy = enemys.obj[_local2];
if (((!((enemy == this))) && ((enemy._type == UNIT_TANK)))){
_local3 = (((x - enemy.x) * (x - enemy.x)) + ((y - enemy.y) * (y - enemy.y)));
if (_local3 < range){
if (_force != enemy._force){
AttackEnemy();
} else {
if (_target == enemy._target){
Union();
};
};
};
};
_local2++;
};
delayfind = delaymax;
};
if ((((((((x < -10)) && ((x > 810)))) && ((y < -10)))) && ((y > 610)))){
free();
};
}
private function Union():void{
if (d < enemy.d){
count = (count + enemy.count);
tf.text = count.toString();
tf2.text = ("+" + enemy.count.toString());
tf2.alpha = 1;
tf2.textColor = 0xFF00;
enemy.free();
} else {
enemy.count = (enemy.count + count);
enemy.tf.text = enemy.count.toString();
enemy.tf2.text = ("+" + enemy.count.toString());
enemy.tf2.alpha = 1;
enemy.tf2.textColor = 0xFF00;
free();
};
}
private function AttackEnemy():void{
var _local1:int = enemy.count;
var _local2:int = count;
enemy.addDamage(_local2);
addDamage(_local1);
}
override public function changeinfo():void{
Bases[npoint].coming[_force] = (Bases[npoint].coming[_force] + count);
}
public function Draw():void{
graphics.beginFill(0xFFFFFF, 1);
graphics.drawRect(-14, -9, 28, 18);
graphics.endFill();
addChild(tf);
}
override public function free():void{
super.free();
Bases[npoint].coming[_force] = (Bases[npoint].coming[_force] - count);
_universe._tanks.remove(this);
}
public static function direction(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (Math.atan2((_arg4 - _arg2), (_arg3 - _arg1)));
}
}
}//package com.source.Units
Section 39
//Unit (com.source.Units.Unit)
package com.source.Units {
import flash.geom.*;
import com.source.*;
import com.source.Bases.*;
import flash.text.*;
import flash.display.*;
public class Unit extends GameObject {
public var i:int;
public var h:Number;// = 2
public var count:int;// = 0
public var _type:int;// = 0
public var _force:int;
public var _target:Base;
public var _dmg:int;// = 0
public var _hp:int;// = 0
public var _armor:int;// = 0
public var _range:Number;// = 10
public var _spd:Number;// = 40
public var mc:MovieClip;
public var shadow:MovieClip;
public var tf:TextField;
public var tf2:TextField;
public static const UNIT_TANK:int = 0;
public static const UNIT_HELI:int = 1;
public static const UNIT_DROP:int = 2;
public static const UNIT_JET:int = 3;
public static const UNIT_ROCKET:int = 4;
public static const UNIT_NUKE:int = 5;
public function Unit():void{
}
public function init(_arg1:Base, _arg2:Base, _arg3:int):void{
_force = _arg1._force;
_target = _arg2;
count = _arg3;
}
public function addDamage(_arg1:int, _arg2:Boolean=true):void{
var _local3:Object;
count = (count - _arg1);
if (count < 1){
_local3 = _universe._blasttank.add();
_local3.init(x, y);
_local3 = null;
free();
} else {
tf.text = count.toString();
if (_force == 1){
_universe.addScore((_arg1 * 10));
};
if (_arg2 == true){
tf2.text = ("-" + _arg1.toString());
tf2.alpha = 1;
tf2.textColor = 0xFF0000;
};
};
}
public function changeinfo():void{
}
public function frameDirect(_arg1:Number, _arg2:Number):int{
var _local3:int = (((Math.atan2(_arg2, Math.abs(_arg1)) * 180) / Math.PI) + 90);
if (_local3 > 180){
_local3 = (180 - (_local3 - 180));
};
_local3 = (Math.ceil((_local3 / 22.5)) + 1);
return (_local3);
}
protected function PushCLR(_arg1:String):ColorTransform{
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.substr(0, 2);
_local3 = (parseInt(_local2, 16) / 0xFF);
_local2 = _arg1.substr(2, 2);
_local4 = (parseInt(_local2, 16) / 0xFF);
_local2 = _arg1.substr(4, 2);
_local5 = (parseInt(_local2, 16) / 0xFF);
return (new ColorTransform(_local3, _local4, _local5));
}
protected function dist(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number = (_arg3 - _arg1);
var _local6:Number = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
}
}//package com.source.Units
Section 40
//Game (com.source.Game)
package com.source {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Game extends MovieClip {
public var Logo:MovieClip;
public var GotoPortal:SimpleButton;
public var Pre:Preloader;
public var _universe:Universe;
public function Game():void{
addFrameScript(0, frame1, 1, frame2);
}
public function onGotoPortal(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gamepirate.com"));
}
public function init(_arg1:Event=null):void{
trace("init Game");
_universe = Universe.getInstance();
addChild(_universe);
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyboardDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyboardUp);
}
private function onMouseMove(_arg1:MouseEvent):void{
}
private function onKeyboardDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == 16)) || ((_arg1.keyCode == 17)))){
_universe.selectAll = true;
} else {
if ((((_arg1.keyCode == 32)) || ((_arg1.keyCode == 27)))){
_universe.deselectBases();
};
};
}
private function onKeyboardUp(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 16){
_universe.selectAll = false;
};
}
function frame1(){
GotoPortal.addEventListener(MouseEvent.CLICK, onGotoPortal);
Logo.addEventListener(MouseEvent.CLICK, onGotoPortal);
}
function frame2(){
stop();
}
}
}//package com.source
Section 41
//GameObject (com.source.GameObject)
package com.source {
import flash.display.*;
public class GameObject extends Sprite {
protected var _universe:Universe;
protected var _mc:MovieClip;
protected var _delta:Number;// = 0
public var _free:Boolean;// = false
public var _y:Number;// = 0
public var ky:Number;// = 0.7
public function GameObject():void{
_universe = Universe.getInstance();
super();
}
public function update(_arg1:Number):void{
}
public function free():void{
if (_universe.box.contains(this)){
_universe.box.removeChild(this);
};
x = -1000;
y = -1000;
_free = true;
}
}
}//package com.source
Section 42
//LevelDataFromSprite (com.source.LevelDataFromSprite)
package com.source {
import flash.display.*;
import com.source.menu.*;
public class LevelDataFromSprite {
private const ky:Number = 0.7;
private var curSprite:Sprite;
private var BaseArray:Array;
private var BMPData:Array;
public var data:Array;
public var hint:Array;
public var dataCOM0:Array;
public var dataCOM2:Array;
public var dataCOM3:Array;
private var i:int;// = 0
private var si:int;// = 0
private var j:int;// = 0
private var ai:int;// = 0
private var aj:int;// = 0
private var obj:Object;
private var k:int;
private var l:int;
private var d:int;// = 0
private var totalChilds:int;// = 0
private var numlinks:int;// = 0
private var isobj:Boolean;// = false
public function LevelDataFromSprite(_arg1:Array):void{
BaseArray = [];
BMPData = [];
data = [];
hint = [];
dataCOM0 = [];
dataCOM2 = [];
dataCOM3 = [];
super();
trace("Parsing sprites");
si = 0;
while (si < _arg1.length) {
curSprite = _arg1[si];
FillArrays();
si++;
};
hint.push(new Hint(126, 45, new Hint00A()));
hint.push(new Hint(373, 241, new Hint02()));
hint.push(new Hint(388, 142, new Hint04()));
hint.push(new Hint(386, 390, new Hint05()));
hint.push(new Hint(210, 115, new Hint06()));
hint.push(new Hint(2224, 243, new Hint00()));
hint.push(new Hint(204, 82, new Hint07()));
hint.push(new Hint(120, 84, new Hint08()));
hint.push(new Hint(2224, 243, new Hint00()));
hint.push(new Hint(2224, 243, new Hint00()));
hint.push(new Hint(2224, 243, new Hint00()));
hint.push(new Hint(2224, 243, new Hint00()));
hint.push(new Hint(2224, 243, new Hint00()));
hint.push(new Hint(2224, 243, new Hint00()));
hint.push(new Hint(2224, 243, new Hint00()));
trace("all good");
}
private function FillArrays():void{
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local13:Number;
var _local14:Number;
var _local15:Object;
var _local16:int;
var _local17:int;
var _local18:int;
var _local1:Array = [];
var _local2:Array = [];
var _local3:Array = [];
var _local4:Array = [];
var _local5:Array = [];
var _local6:BitmapData = new BitmapData(800, 600);
totalChilds = curSprite.numChildren;
i = (totalChilds - 1);
numlinks = 0;
trace(("totalChilds " + totalChilds));
while (i > -1) {
isobj = true;
obj = curSprite.getChildAt(i);
if ((obj as _data_Location)){
_local2.push({x:obj.x, y:(obj.y / ky), force:-1, count:0});
} else {
if ((obj as _data_Point)){
_local2.push({x:obj.x, y:(obj.y / ky), force:9, count:0});
} else {
if ((obj as Link)){
if (obj.transform.matrix.a > 0){
_local13 = (obj.x + obj.width);
} else {
_local13 = (obj.x - obj.width);
};
if (obj.transform.matrix.d > 0){
_local14 = (obj.y + obj.height);
} else {
_local14 = (obj.y - obj.height);
};
_local1.push({x:obj.x, y:(obj.y / ky), ex:_local13, ey:(_local14 / ky)});
} else {
if ((obj as _dataESupport)){
_local5.push({x:obj.x, y:(obj.y / ky), type:0, conn:-1});
} else {
if ((obj as _dataEAntiAir)){
_local5.push({x:obj.x, y:(obj.y / ky), type:6, conn:-1});
} else {
if ((obj as _dataEBunker)){
_local5.push({x:obj.x, y:(obj.y / ky), type:5, conn:-1});
} else {
if ((obj as _dataEHeliPort)){
_local5.push({x:obj.x, y:(obj.y / ky), type:9, conn:-1});
} else {
if ((obj as _dataEDropPort)){
_local5.push({x:obj.x, y:(obj.y / ky), type:10, conn:-1});
} else {
if ((obj as _dataEJetPort)){
_local5.push({x:obj.x, y:(obj.y / ky), type:8, conn:-1});
} else {
if ((obj as _dataENuclear)){
_local5.push({x:obj.x, y:(obj.y / ky), type:7, conn:-1});
} else {
if ((obj as _dataCOM)){
_local15 = {red:obj.transform.colorTransform.redOffset, green:obj.transform.colorTransform.greenOffset, blue:obj.transform.colorTransform.blueOffset};
if ((((((_local15.red > 200)) && ((_local15.green < 50)))) && ((_local15.blue < 50)))){
dataCOM0.push([(obj.width - 1), (obj.height - 1)]);
} else {
if ((((((_local15.red < 50)) && ((_local15.green > 200)))) && ((_local15.blue < 50)))){
dataCOM2.push([(obj.width - 1), (obj.height - 1)]);
} else {
if ((((((_local15.red > 200)) && ((_local15.green > 200)))) && ((_local15.blue < 50)))){
dataCOM3.push([(obj.width - 1), (obj.height - 1)]);
};
};
};
} else {
isobj = false;
};
};
};
};
};
};
};
};
};
};
};
if (isobj == true){
curSprite.removeChild((obj as DisplayObject));
};
obj = null;
i--;
};
i = 0;
while (i < _local2.length) {
_local3.push([]);
_local4.push([]);
j = 0;
while (j < _local2.length) {
_local3[i].push(int(-2));
_local4[i].push(0);
j++;
};
i++;
};
i = 0;
while (i < _local3.length) {
trace(_local3[i].join(" | "));
i++;
};
out();
i = (curSprite.numChildren - 1);
while (i > 0) {
obj = curSprite.getChildAt(i);
j = 0;
while (j < _local2.length) {
d = distance(obj.x, (obj.y / ky), _local2[j].x, _local2[j].y);
if (d < 30){
_local2[j].count = (obj.width - 1);
_local15 = {red:obj.transform.colorTransform.redOffset, green:obj.transform.colorTransform.greenOffset, blue:obj.transform.colorTransform.blueOffset};
if ((((((_local15.red > 200)) && ((_local15.green < 50)))) && ((_local15.blue < 50)))){
_local2[j].force = 0;
} else {
if ((((((_local15.red < 50)) && ((_local15.green > 200)))) && ((_local15.blue < 50)))){
_local2[j].force = 2;
} else {
if ((((((_local15.red < 50)) && ((_local15.green < 50)))) && ((_local15.blue > 200)))){
_local2[j].force = 1;
} else {
if ((((((_local15.red > 200)) && ((_local15.green > 200)))) && ((_local15.blue < 50)))){
_local2[j].force = 3;
} else {
_local2[j].force = -1;
};
};
};
};
_local15 = null;
};
j++;
};
if ((obj as Hint)){
} else {
curSprite.removeChild((obj as DisplayObject));
obj = null;
};
i--;
};
_local6.draw(curSprite);
curSprite = null;
var _local11:Number = 0;
var _local12:Number = 0;
i = 0;
while (i < _local1.length) {
obj = _local1[i];
_local7 = -1;
_local8 = -1;
j = 0;
while (j < _local2.length) {
if (_local7 < 0){
d = distance(obj.x, obj.y, _local2[j].x, _local2[j].y);
if (d < 20){
_local7 = j;
};
};
if (_local8 < 0){
d = distance(obj.ex, obj.ey, _local2[j].x, _local2[j].y);
if (d < 20){
_local8 = j;
};
};
j++;
};
if ((((_local7 > -1)) && ((_local8 > -1)))){
d = distance(_local2[_local7].x, _local2[_local7].y, _local2[_local8].x, _local2[_local8].y);
numlinks++;
_local3[_local7][_local8] = 1;
_local3[_local8][_local7] = 1;
_local4[_local7][_local8] = d;
_local4[_local8][_local7] = d;
} else {
_local9 = -1;
_local10 = -1;
j = 0;
while (j < _local5.length) {
if (_local9 < 0){
d = distance(obj.x, obj.y, _local5[j].x, _local5[j].y);
if (d < 20){
_local9 = j;
};
};
if (_local10 < 0){
d = distance(obj.ex, obj.ey, _local5[j].x, _local5[j].y);
if (d < 20){
_local10 = j;
};
};
j++;
};
if (_local9 > -1){
if (_local7 > -1){
_local5[_local9].conn = _local7;
} else {
if (_local8 > -1){
_local5[_local9].conn = _local8;
};
};
} else {
if (_local10 > -1){
if (_local7 > -1){
_local5[_local10].conn = _local7;
} else {
if (_local8 > -1){
_local5[_local10].conn = _local8;
};
};
};
};
};
i++;
};
while (numlinks > 0) {
_local16 = -1;
_local17 = -1;
i = 0;
while (i < _local3.length) {
_local16 = -1;
_local17 = -1;
j = 0;
while (j < _local3.length) {
if (_local3[i][j] > -1){
_local16 = j;
k = _local16;
while (k < _local3.length) {
_local17 = k;
if ((((_local3[i][_local17] > 0)) && (!((_local16 == _local17))))){
_local18 = (_local4[i][_local16] + _local4[i][_local17]);
if (_local4[_local16][_local17] > 0){
if (_local18 < _local4[_local16][_local17]){
_local4[_local16][_local17] = _local18;
_local4[_local17][_local16] = _local18;
};
} else {
_local4[_local16][_local17] = _local18;
_local4[_local17][_local16] = _local18;
};
};
k++;
};
};
j++;
};
i++;
};
i = 0;
while (i < _local4.length) {
j = 0;
while (j < _local4.length) {
if ((((_local4[i][j] > 0)) && ((_local3[i][j] < 0)))){
_local3[i][j] = 0;
};
j++;
};
i++;
};
numlinks--;
};
trace("new links");
i = 0;
while (i < _local3.length) {
trace(_local3[i].join(" | "));
i++;
};
i = 0;
while (i < _local4.length) {
trace(_local4[i].join(" | "));
i++;
};
data.push([_local2, _local5, _local3, _local4, _local6]);
}
private function GenerateLevelData():void{
data.push([]);
}
public function CalcConnections():void{
}
public function outData(_arg1:int):void{
trace("");
var _local2:Array = data[_arg1][0];
trace("Bases");
i = 0;
while (i < _local2.length) {
trace((((((((("Base x: " + _local2[i].x) + " y: ") + _local2[i].y) + " ") + " count: ") + _local2[i].count) + " force: ") + _local2[i].force));
i++;
};
trace("Extensions");
_local2 = data[_arg1][1];
i = 0;
while (i < _local2.length) {
trace((((((((("Ext x: " + _local2[i].x) + " y: ") + _local2[i].y) + " ") + " conn: ") + _local2[i].conn) + " type: ") + _local2[i].type));
i++;
};
_local2 = data[_arg1][2];
trace("Links");
i = 0;
while (i < _local2.length) {
trace(_local2[i].join(" | "));
i++;
};
trace("Distances");
_local2 = data[_arg1][3];
i = 0;
while (i < _local2.length) {
trace(_local2[i].join(" | "));
i++;
};
_local2 = null;
}
public function out():void{
}
public static function distance(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number = (_arg3 - _arg1);
var _local6:Number = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
}
}//package com.source
Section 43
//Link (com.source.Link)
package com.source {
import flash.display.*;
import com.utils.*;
public class Link extends Sprite {
public var sx:int;
public var sy:int;
public var ex:int;
public var ey:int;
public var indexa:int;
public var indexb:int;
public var basea:Object;
public var baseb:Object;
public var arra:Array;
public var arrb:Array;
public var linka:Boolean;// = false
public var linkb:Boolean;// = false
public var baseA:Boolean;// = false
public var baseB:Boolean;// = false
public var _sy:Number;// = 0
public var _ey:Number;// = 0
public var ky:Number;// = 0.7
public function Link():void{
sx = x;
sy = y;
ex = (x + (transform.matrix.a * 100));
ey = (y + (transform.matrix.d * 100));
visible = false;
_sy = (sy / ky);
_ey = (ey / ky);
}
public function FindBases(_arg1:Array, _arg2:Array):void{
var _local3:int;
var _local4:int;
var _local5:int;
linka = false;
linkb = false;
_local3 = 0;
while (_local3 < _arg1.length) {
_local5 = Amath.distance(sx, _sy, _arg1[_local3].x, (_arg1[_local3].y / ky));
if (_local5 <= 20){
linka = true;
indexa = _local3;
arra = _arg1;
basea = _arg1[_local3];
baseA = true;
break;
};
_local3++;
};
if (linka == false){
_local3 = 0;
while (_local3 < _arg2.length) {
_local5 = Amath.distance(sx, _sy, _arg2[_local3].x, (_arg2[_local3].y / ky));
if (_local5 <= 20){
linka = true;
indexa = _local3;
arra = _arg2;
basea = _arg2[_local3];
baseA = false;
break;
};
_local3++;
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
_local5 = Amath.distance(ex, _ey, _arg1[_local3].x, (_arg1[_local3].y / ky));
if (_local5 <= 20){
linkb = true;
indexb = _local3;
arrb = _arg1;
baseb = _arg1[_local3];
baseB = true;
break;
};
_local3++;
};
if (linkb == false){
_local3 = 0;
while (_local3 < _arg2.length) {
_local5 = Amath.distance(ex, _ey, _arg2[_local3].x, (_arg2[_local3].y / ky));
if (_local5 <= 20){
linkb = true;
indexb = _local3;
arrb = _arg2;
baseb = _arg2[_local3];
baseB = false;
break;
};
_local3++;
};
};
trace(((("find bases: " + indexa) + " ") + indexb));
}
}
}//package com.source
Section 44
//Universe (com.source.Universe)
package com.source {
import com.source.controller.*;
import com.source.frames.*;
import flash.events.*;
import com.source.Bases.*;
import flash.text.*;
import flash.display.*;
import com.source.Units.*;
import com.utils.*;
import com.source.Comp.*;
import flash.media.*;
import flash.net.*;
import com.source.menu.*;
import com.source.Bullets.*;
import com.source.Sfxs.*;
import flash.utils.*;
import flash.filters.*;
public class Universe extends Sprite {
public var groundImages:Array;
public var colors:Array;
public var COMS:Array;
public var frames_tankbody:Frames;
public var frames_tanktower:Frames;
public var frames_heli:Frames;
public var frames_jets:Frames;
public var frames_drops:Frames;
public var debugText:TextField;
public var box:Sprite;
public var gui:Sprite;
public var fon:Sprite;
private var _delta:Number;// = 0
private var _lastTick:int;// = 0
private var _maxDelta:Number;// = 0.05
public var gamepause:Boolean;// = false
private var i:int;// = 0
private var j:int;// = 0
private var _obj:Object;
public var _ground:Bitmap;
public var so:SharedObject;
public var sC:SoundChannel;
public var mC:SoundChannel;
public var s_transform:SoundTransform;
public var s_boom00:Sound;
public var s_boom01:Sound;
public var s_heli_shot:Sound;
public var s_tank_born:Sound;
public var s_heli_born:Sound;
public var s_jet_fly:Sound;
public var s_mus1:Sound;
public var s_mus2:Sound;
public var s_mus3:Sound;
public var sound_num:int;
public var soundOn:Boolean;
public var musicOn:Boolean;
public var soundnum:int;
public var L:Array;
public var D:Array;
public var curlevel:int;// = 0
public var maxlevel:int;// = 1
public var victorydelay:Number;// = 0
public var _bases:Controller;
public var _exts:Controller;
public var len:int;
public var _locs:GArray;
public var _ways:GArray;
public var _support:GArray;
public var _jetport:GArray;
public var _heliport:GArray;
public var _dropport:GArray;
public var _nuclear:GArray;
public var _antiair:GArray;
public var _bunker:GArray;
public var _laser:GArray;
public var _rocket:GArray;
public var _units:Controller;
public var _tanks:GArray;
public var _helis:GArray;
public var _jets:GArray;
public var _drops:GArray;
public var _bullets:Controller;
public var _rockets:GArray;
public var _rocketstounits:GArray;
public var _rocketstobases:GArray;
public var _helirockets:GArray;
public var _jetrockets:GArray;
public var _rocketrockets:GArray;
public var _nuclearrockets:GArray;
public var _bunkerbullets:GArray;
public var _antiairrockets:GArray;
public var _explosions:Controller;
public var _blastbomb:GArray;
public var _blasttank:GArray;
public var _blasthelirocket:GArray;
public var key:int;
public var keyLEFT:Boolean;// = false
public var keyRIGHT:Boolean;// = false
public var keyA:Boolean;// = false
public var keyD:Boolean;// = false
public var selectBase:Base;// = null
public var selectAll:Boolean;// = false
public var mainfont:Font;
public var textFormatBase:TextFormat;
public var textFormatUnit:TextFormat;
public var textFormatUI:TextFormat;
public var menu:CCMenu;
public var vicdefpanel:VictoryDefeatPanel;
public var settings:MenuPanel;
public var leveldata:LevelDataFromSprite;
public var totalscore:int;// = 0
public var levelscore:int;// = 0
public var arrayscore:Array;
public var score:TextField;
public var scoreadd:TextField;
private var btn_gamepirate3:SimpleButton;
private static var instance:Universe;
public function Universe():void{
colors = ["A8A8A8", "D91D1D", "4396C6", "71A839", "F0A024"];
debugText = new TextField();
super();
if (instance != null){
throw ("universe alredy created");
};
instance = this;
trace(("instanse geted = " + instance));
init();
trace("Universe inited");
}
private function init():void{
leveldata = new LevelDataFromSprite([new level00(), new level01(), new level02(), new level03(), new level04(), new level05(), new level06(), new level07(), new level08(), new level09(), new level10(), new level11(), new level12(), new level13(), new level14()]);
arrayscore = [];
LoadLSO();
var _local1:FPSMemCounter = new FPSMemCounter();
mainfont = (new Mainfont() as Font);
textFormatBase = new TextFormat(mainfont.fontName);
trace((("font name: " + mainfont.fontName) + " :"));
textFormatBase.size = 20;
textFormatBase.color = 0xFFFFFF;
textFormatBase.align = TextFormatAlign.CENTER;
textFormatUnit = new TextFormat(mainfont.fontName);
textFormatUnit.size = 16;
textFormatUnit.align = TextFormatAlign.CENTER;
textFormatUnit.color = 0xFFFFFF;
textFormatUI = new TextFormat(mainfont.fontName);
textFormatUI.size = 26;
textFormatUI.align = TextFormatAlign.CENTER;
textFormatUI.color = 0xFFFFFF;
COMS = new Array();
COMS.push(new GameComp(0));
COMS.push(new GameComp(2));
COMS[0].init(10, 300);
COMS[1].init(4, 3);
box = new Sprite();
gui = new Sprite();
fon = new Sprite();
score = new TextField();
score.embedFonts = true;
score.selectable = false;
score.mouseEnabled = false;
score.defaultTextFormat = textFormatUI;
score.filters = [new GlowFilter(0, 1, 3, 3, 3)];
score.width = 400;
score.height = 50;
score.x = 200;
score.y = 5;
scoreadd = new TextField();
scoreadd.embedFonts = true;
scoreadd.selectable = false;
scoreadd.mouseEnabled = false;
scoreadd.defaultTextFormat = textFormatBase;
scoreadd.filters = [new GlowFilter(0, 1, 2, 2, 3)];
scoreadd.width = 400;
scoreadd.height = 30;
scoreadd.x = 200;
scoreadd.y = 30;
scoreadd.alpha = 0;
btn_gamepirate3 = new piratebutton3();
btn_gamepirate3.x = 0;
btn_gamepirate3.y = 546;
btn_gamepirate3.addEventListener(MouseEvent.CLICK, onMoreGames);
btn_gamepirate3.visible = false;
_ground = new Bitmap();
frames_tankbody = Frames.createBmpFromMC(mc_TankBody);
frames_tanktower = Frames.createBmpFromMC(mc_TankTower);
_bases = new Controller();
_exts = new Controller();
_units = new Controller();
_bullets = new Controller();
_locs = new GArray(Location, 4, _bases);
_ways = new GArray(Waypoint, 4, _bases);
_support = new GArray(ExtSupport, 2, _exts);
_heliport = new GArray(ExtHeliport, 2, _exts);
_dropport = new GArray(ExtDropport, 2, _exts);
_jetport = new GArray(ExtJetport, 2, _exts);
_bunker = new GArray(ExtBunker, 2, _exts);
_laser = new GArray(ExtLaser, 2, _exts);
_antiair = new GArray(ExtAntiair, 2, _exts);
_nuclear = new GArray(ExtNuclear, 2, _exts);
_tanks = new GArray(Tank, 4, _units);
_helis = new GArray(Heli, 2, _units);
_drops = new GArray(Drop, 2, _units);
_jets = new GArray(Jet, 1, _units);
_explosions = new Controller();
_blastbomb = new GArray(BlastBomb, 2, _explosions);
_blasttank = new GArray(BlastTank, 2, _explosions);
_blasthelirocket = new GArray(BlastHeliRocket, 2, _explosions);
_rockets = new GArray(Rocket, 2, _bullets);
_rocketstounits = new GArray(RocketToUnit, 2, _bullets);
_rocketstobases = new GArray(RocketToBase, 2, _bullets);
_rocketrockets = new GArray(RocketBall, 4, _units);
_nuclearrockets = new GArray(RocketNuclear, 1, _units);
_helirockets = new GArray(HeliRocket, 4, _bullets);
vicdefpanel = new VictoryDefeatPanel();
settings = new MenuPanel();
addChild(_ground);
addChild(box);
addChild(gui);
gui.addChild(score);
gui.addChild(scoreadd);
gui.addChild(vicdefpanel);
gui.addChild(settings);
gui.addChild(btn_gamepirate3);
initSounds();
menu = new CCMenu();
menu.init();
addChild(menu);
}
private function initSounds():void{
sound_num = 0;
soundOn = true;
musicOn = true;
mC = new SoundChannel();
sC = new SoundChannel();
s_transform = new SoundTransform();
mC.soundTransform = s_transform;
sC.soundTransform = s_transform;
s_boom00 = new boom00();
s_boom01 = new boom01();
s_heli_born = new heli_born();
s_heli_shot = new heli_shot();
s_jet_fly = new jet_fly();
s_tank_born = new tank_born();
s_mus1 = new main_music1();
s_mus2 = new main_music2();
s_mus3 = new main_music3();
mC = s_mus1.play(0, 9999, s_transform);
}
public function addScore(_arg1:int=0):void{
levelscore = (levelscore + _arg1);
score.text = ("SCORE:" + levelscore.toString());
scoreadd.text = ("+" + _arg1.toString());
scoreadd.alpha = 1;
}
public function playNext():void{
mC.stop();
trace(((((("playNext " + mC.soundTransform.volume) + " ") + mC.position) + " ") + sound_num));
if (sound_num == 0){
mC = s_mus1.play(0, 9999, s_transform);
} else {
if (sound_num == 1){
mC = s_mus2.play(0, 9999, s_transform);
} else {
mC = s_mus3.play(0, 9999, s_transform);
sound_num = 0;
};
};
sound_num++;
}
public function startLevel(_arg1:int=0):void{
playNext();
score.text = "SCORE: 0";
scoreadd.alpha = 0;
curlevel = _arg1;
COMS[0].init(leveldata.dataCOM0[curlevel][0], leveldata.dataCOM0[curlevel][1]);
COMS[1].init(leveldata.dataCOM2[curlevel][0], leveldata.dataCOM2[curlevel][1]);
len = leveldata.data[curlevel][0].length;
leveldata.outData(curlevel);
var _local2:Object;
_ground.bitmapData = leveldata.data[curlevel][4];
i = 0;
while (i < len) {
if (leveldata.data[curlevel][0][i].force < 5){
_local2 = _locs.add();
_local2.init(leveldata.data[curlevel][0][i].x, leveldata.data[curlevel][0][i].y, leveldata.data[curlevel][0][i].force, leveldata.data[curlevel][0][i].count, i);
_local2 = null;
} else {
_local2 = _ways.add();
_local2.init(leveldata.data[curlevel][0][i].x, leveldata.data[curlevel][0][i].y, i);
_local2 = null;
};
i++;
};
trace("Bases ready");
len = leveldata.data[curlevel][1].length;
i = 0;
while (i < len) {
switch (leveldata.data[curlevel][1][i].type){
case 0:
_local2 = _support.add();
break;
case 3:
_local2 = _laser.add();
break;
case 5:
_local2 = _bunker.add();
break;
case 6:
_local2 = _antiair.add();
break;
case 7:
_local2 = _nuclear.add();
break;
case 8:
_local2 = _jetport.add();
break;
case 9:
_local2 = _heliport.add();
break;
case 10:
_local2 = _dropport.add();
break;
case 15:
_local2 = _rocket.add();
break;
};
_local2.init(leveldata.data[curlevel][1][i].x, leveldata.data[curlevel][1][i].y, leveldata.data[curlevel][1][i].type, leveldata.data[curlevel][1][i].conn);
_local2 = null;
i++;
};
trace("Exts ready");
len = leveldata.data[curlevel][0].length;
i = 0;
while (i < len) {
if (_bases.obj[i]._force < 5){
_bases.obj[i].initExts();
};
i++;
};
L = leveldata.data[curlevel][2];
D = leveldata.data[curlevel][3];
box.addChild(leveldata.hint[curlevel]);
leveldata.hint[curlevel].init();
addEventListener(Event.ENTER_FRAME, update);
gamepause = false;
if (curlevel == 2){
btn_gamepirate3.visible = true;
} else {
btn_gamepirate3.visible = false;
};
}
public function openNextLevel():void{
if (curlevel < leveldata.data.length){
menu.lvlButtons[(curlevel + 1)].open();
};
}
public function DrawBasesLinks():void{
var _local2:int;
box.graphics.clear();
box.graphics.lineStyle(1, 0, 1);
var _local1:int;
while (_local1 < L.length) {
_local2 = 0;
while (_local2 < L.length) {
if (L[_local1][_local2] == 1){
box.graphics.moveTo(_bases.obj[_local1].x, _bases.obj[_local1].y);
box.graphics.lineTo(_bases.obj[_local2].x, _bases.obj[_local2].y);
};
_local2++;
};
_local1++;
};
}
public function stopLevel():void{
var _local1:Object;
gamepause = true;
var _local2:int;
while (_local2 < box.numChildren) {
_local1 = box.getChildAt(_local2);
if ((_local1 is Hint)){
_local1.free();
trace("hint free");
};
_local2++;
};
deselectBases();
_bullets.free();
_units.free();
_exts.free();
_bases.free();
}
private function onGroundClick(_arg1:MouseEvent):void{
i = 0;
while (i < len) {
i++;
};
}
public function showArrays():void{
var _local1:int;
_local1 = 0;
while (_local1 < L[0].length) {
trace(L[_local1].join("\t"));
_local1++;
};
_local1 = 0;
while (_local1 < L[0].length) {
trace(D[_local1].join("\t"));
_local1++;
};
}
public function SendUnitsTo(_arg1:Base, _arg2:Boolean=false):void{
var _local3:int = leveldata.data[curlevel][0].length;
i = 0;
while (i < _local3) {
if ((((_bases.obj[i].select == true)) && ((L[_bases.obj[i]._index][_arg1._index] > -1)))){
_bases.obj[i].sendTo(_arg1, _arg2);
trace("sended");
};
i++;
};
}
public function deselectBases():void{
var _local1:int = leveldata.data[curlevel][0].length;
i = 0;
while (i < _local1) {
if (_bases.obj[i].select == true){
_bases.obj[i].deselectBase();
trace("deselected");
};
i++;
};
selectBase = null;
}
private function DrawLinks():void{
var _local1:int = leveldata.data[curlevel][0].length;
fon.graphics.lineStyle(1, 0xFFFF, 1);
i = 0;
while (i < _local1) {
j = 0;
while (j < _local1) {
if (L[i][j] == 1){
fon.graphics.moveTo(_bases.obj[i].x, _bases.obj[i].y);
fon.graphics.lineTo(_bases.obj[j].x, _bases.obj[j].y);
};
j++;
};
i++;
};
}
private function update(_arg1:Event):void{
scoreadd.alpha = (scoreadd.alpha - 0.01);
if (gamepause == false){
_delta = ((getTimer() - _lastTick) * 0.001);
_delta = ((_delta)>_maxDelta) ? _maxDelta : _delta;
_lastTick = getTimer();
_bases.update(_delta);
_exts.update(_delta);
_units.update(_delta);
_bullets.update(_delta);
_explosions.update(_delta);
i = 0;
while (i < COMS.length) {
COMS[i].update(_delta);
i++;
};
debugText.text = (((("Mouse x: " + mouseX.toString()) + " y: ") + mouseY.toString()) + "\n");
victorydelay = (victorydelay + _delta);
if (victorydelay > 5){
victorydelay = 0;
checkVictory();
};
};
}
private function checkVictory():void{
var _local3:int;
var _local1:int;
var _local2:int;
_local3 = 0;
while (_local3 < _bases.len) {
if (_bases.obj[_local3]._force == 1){
_local1++;
} else {
if ((((_bases.obj[_local3]._force > -1)) && ((_bases.obj[_local3]._force < 5)))){
_local2++;
};
};
_local3++;
};
_local3 = 0;
while (_local3 < _units.len) {
if (_units.obj[_local3]._force == 1){
_local1++;
} else {
_local2++;
};
_local3++;
};
if (_local1 < 1){
levelscore = 0;
totalscore = 0;
_local3 = 0;
while (_local3 < arrayscore.length) {
totalscore = (totalscore + arrayscore[_local3]);
_local3++;
};
vicdefpanel.Defeat();
gamepause = true;
} else {
if (_local2 < 1){
if (arrayscore[curlevel] < levelscore){
arrayscore[curlevel] = levelscore;
};
totalscore = 0;
_local3 = 0;
while (_local3 < arrayscore.length) {
if (arrayscore[_local3] != undefined){
totalscore = (totalscore + arrayscore[_local3]);
};
_local3++;
};
if (curlevel == 14){
vicdefpanel.FinalScene();
} else {
vicdefpanel.Victory();
};
levelscore = 0;
gamepause = true;
};
};
}
private function initDebugText():void{
debugText.x = 20;
debugText.y = 20;
debugText.width = 800;
debugText.height = 20;
debugText.selectable = false;
addChild(debugText);
}
public function LoadLSO():void{
var i:int;
try {
so = SharedObject.getLocal("LocalConflicts");
} catch(e:Error) {
trace("shared obj not found");
} finally {
trace(("------------ lvl lso " + so.data.maxlevel));
trace(leveldata.data.length);
if ((((so.data.maxlevel == undefined)) || ((so.data.maxlevel > 14)))){
so.data.maxlevel = 0;
i = 0;
while (i < 15) {
arrayscore[i] = 0;
i = (i + 1);
};
so.data.arrayscore = arrayscore;
trace(arrayscore);
trace(("undefined = " + so.data.maxlevel));
} else {
maxlevel = so.data.maxlevel;
arrayscore = so.data.arrayscore;
trace(arrayscore);
trace(("savelevel = " + maxlevel));
};
};
so.close();
}
public function SaveLSO():void{
so = SharedObject.getLocal("LocalConflicts");
so.data.maxlevel = maxlevel;
var _local1:int;
while (_local1 < leveldata.data.length) {
so.data.arrayscore[_local1] = arrayscore[_local1];
_local1++;
};
trace(("SaveLSO save level : " + so.data.maxlevel));
so.flush();
so.close();
}
public function onMoreGames(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.gamepirate.com"));
}
public function free():void{
removeEventListener(Event.ENTER_FRAME, update);
}
public static function getInstance():Universe{
return (((instance)==null) ? new (Universe) : instance);
}
}
}//package com.source
Section 45
//Amath (com.utils.Amath)
package com.utils {
public class Amath {
public static const PI:Number = 3.1415926536;
public static const PI18:Number = 0.01745329252;
public static const PI36:Number = 0.00872664626;
public static const RAD:Number = 0.0027777777777;
function DistanceFromPointToLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
var _local7:Number = (((_arg1 - _arg3) * (_arg5 - _arg3)) + ((_arg2 - _arg4) * (_arg6 - _arg4)));
var _local8:Number = (((_arg5 - _arg3) * (_arg5 - _arg3)) + ((_arg6 - _arg4) * (_arg6 - _arg4)));
var _local9:Number = (_local7 / _local8);
var _local10:Number = (_arg3 + (_local9 * (_arg5 - _arg3)));
var _local11:Number = (_arg4 + (_local9 * (_arg6 - _arg4)));
var _local12:Number = ((((_arg4 - _arg2) * (_arg5 - _arg3)) - ((_arg3 - _arg1) * (_arg6 - _arg4))) / _local8);
var _local13:* = (Math.abs(_local12) * Math.sqrt(_local8));
return (_local13);
}
public static function abs(_arg1:Number):Number{
return (((_arg1)<0) ? -(_arg1) : _arg1);
}
public static function direction(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (Math.atan2((_arg4 - _arg2), (_arg3 - _arg1)));
}
public static function half(_arg1:Number, _arg2:Number):Number{
return (((_arg1 + _arg2) * 0.5));
}
public static function len(_arg1:Number, _arg2:Number):Number{
return ((((_arg1 - _arg2))>0) ? (_arg1 - _arg2) : -((_arg1 - _arg2)));
}
public static function distance(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number = (_arg3 - _arg1);
var _local6:Number = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public static function equal(_arg1:Number, _arg2:Number, _arg3:Number=0.0001):Boolean{
return ((abs((_arg1 - _arg2)) <= _arg3));
}
public static function getAngleDeg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=false):Number{
var _local6:Number = (_arg3 - _arg1);
var _local7:Number = (_arg4 - _arg2);
var _local8:Number = (Math.atan2(_local7, _local6) / 565.486677646);
if (_arg5){
if (_local8 >= 0){
_local8 = (_local8 - floor((_local8 * 0.0027777777777)));
} else {
if (_local8 < 0){
_local8 = ((360 + _local8) - floor((_local8 * 0.0027777777777)));
};
};
};
return (_local8);
}
public static function ceil(_arg1:Number):int{
var _local2:int = _arg1;
return (((_arg1)>_local2) ? (_local2 + 1) : _local2);
}
public static function floor(_arg1:Number):int{
var _local2:int = _arg1;
return (((_arg1)<_local2) ? (_local2 - 1) : _local2);
}
public static function round(_arg1:Number, _arg2:Number=1):Number{
return (Number((int((_arg1 / _arg2)) * _arg2)));
}
public static function not(_arg1:Number):Number{
return ((~(_arg1) + 1));
}
public static function toDeg(_arg1:Number):Number{
return (((_arg1 * 180) / PI));
}
public static function toRad(_arg1:Number):Number{
return ((_arg1 * PI18));
}
public static function myRotation(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number = Math.abs((_arg2 - _arg1));
while (_local4 >= 360) {
_local4 = (_local4 - 360);
};
if (_local4 > 180){
_local4 = (360 - _local4);
};
_local4 = ((_local4)>0) ? _local4 : -(_local4);
var _local5:Number = Math.sin(((_arg2 - _arg1) * PI18));
if (_arg1 != _arg2){
_arg1 = (_arg1 + (Math.min(_arg3, _local4) * _local5));
};
return (_arg1);
}
public static function RoratePoint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local6:Number = (_arg3 - _arg1);
var _local7:Number = (_arg4 - _arg2);
_local6 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_arg3 = (_local6 * Math.cos(_arg5));
_arg4 = (_local6 * Math.sin(_arg5));
}
public static function WherePoint(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6):int{
var _local7:Number = (((_arg3 - _arg1) * (_arg6 - _arg2)) - ((_arg4 - _arg2) * (_arg5 - _arg1)));
if (_local7 > 0){
return (1);
};
if (_local7 < 0){
return (-1);
};
return (0);
}
public static function PointToR(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local6:Number = (_arg4 - _arg1);
var _local7:Number = (_arg5 - _arg2);
var _local8:Number = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local6 = ((_local6 / _local8) * _arg3);
_local7 = ((_local7 / _local8) * _arg3);
_arg4 = (_arg1 + _local6);
_arg5 = (_arg2 + _local7);
}
public static function vectorsAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number = (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))) + Math.sqrt(((_arg3 * _arg3) + (_arg4 * _arg4))));
return (Math.acos((((_arg1 * _arg3) + (_arg2 * _arg4)) / _local5)));
}
public static function PerAngle(_arg1:Number, _arg2:Number):Number{
return ((((PI * _arg1) * _arg2) * 0.0055555555));
}
public static function AnglePer(_arg1:Number, _arg2:Number):Number{
return (((180 * _arg2) / (PI * _arg1)));
}
public static function sqrt(_arg1:Number):Number{
var _local3:Number;
var _local4:Number;
var _local2:Number = (_arg1 * 0.25);
do {
_local4 = (_arg1 / _local2);
_local2 = ((_local2 + _local4) * 0.5);
_local3 = (_local2 - _local4);
if (_local3 < 0){
_local3 = -(_local3);
};
} while (_local3 > 1E-5);
return (_local2);
}
}
}//package com.utils
Section 46
//FPSMemCounter (com.utils.FPSMemCounter)
package com.utils {
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class FPSMemCounter extends TextField {
private var fontSize:Number;
private var lastUpdate:Number;
private var frameCount:Number;
private var currentTime:Number;
private static const UPDATE_INTERVAL:Number = 1000;
public function FPSMemCounter(_arg1:Number=0xFFFFFF, _arg2:Number=25):void{
this.textColor = _arg1;
this.fontSize = 12;
autoSize = TextFieldAutoSize.LEFT;
selectable = false;
mouseEnabled = false;
addEventListener(Event.ADDED_TO_STAGE, setFPSUpdate);
addEventListener(Event.REMOVED_FROM_STAGE, clearFPSUpdate);
}
private function setFPSUpdate(_arg1:Event):void{
addEventListener(Event.ENTER_FRAME, updateFPS);
frameCount = 0;
updateText(frameCount);
lastUpdate = getTimer();
}
private function clearFPSUpdate(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, updateFPS);
}
private function updateFPS(_arg1:Event):void{
currentTime = getTimer();
frameCount++;
if (currentTime >= (lastUpdate + UPDATE_INTERVAL)){
lastUpdate = currentTime;
updateText(frameCount);
frameCount = 0;
};
}
private function updateText(_arg1:Number):void{
var _local2 = (Number(((System.totalMemory / 0x0400) / 0x0400)).toFixed(2) + "Mb");
htmlText = (((("<span><strong>FPS : </strong>" + _arg1) + " fps<strong> Memory : </strong>") + _local2) + "</span>");
}
}
}//package com.utils
Section 47
//GArray (com.utils.GArray)
package com.utils {
import com.source.controller.*;
import com.source.*;
public class GArray {
private var _universe:Universe;
private var _array:Array;
private var len:int;// = 0
private var i:int;// = 0
private var _obj:Object;
private var _cobj:Controller;
private var _class:Class;
private var _curIndex:int;// = 0
private var _cache:Array;
public function GArray(_arg1:Class, _arg2:int, _arg3:Controller):void{
_universe = Universe.getInstance();
_cache = [];
super();
_class = _arg1;
_cobj = _arg3;
_array = _cobj.obj;
_cache = [];
_curIndex = 0;
while (_curIndex < _arg2) {
_cache[_curIndex] = new _class();
_curIndex++;
};
_curIndex = (_arg2 - 1);
Out();
}
public function add():Object{
_obj = get();
_array[_array.length] = _obj;
_cobj.len = _array.length;
return (_obj);
}
public function remove(_arg1:Object):void{
i = _array.length;
while (i > -1) {
if (_array[i] == _arg1){
set(_arg1);
_array[i] = null;
_array.splice(i, 1);
_cobj.len = _array.length;
};
i--;
};
}
public function getItem(_arg1:int):Object{
if (_arg1 <= _cache.length){
return (_cache[_arg1]);
};
return (null);
}
public function set(_arg1:Object):void{
_curIndex++;
_cache[_curIndex] = _arg1;
}
public function get():Object{
if (_curIndex >= 0){
_curIndex--;
return (_cache[(_curIndex + 1)]);
};
return (new _class());
}
public function Out():void{
trace(((((((("GArray cashe: " + _curIndex) + " ") + _class) + " length: ") + _cache.length) + " _array.len: ") + _cobj.len));
}
}
}//package com.utils
Section 48
//Hint (com.utils.Hint)
package com.utils {
import flash.text.*;
import flash.display.*;
public class Hint extends Sprite {
private var border:int;// = 6
private var txt:TextField;
private var format:TextFormat;
private var fon:Sprite;
private var shift:int;
public function Hint():void{
txt = new TextField();
format = new TextFormat("Calibri", 12, 0xFFFFFF);
txt.antiAliasType = AntiAliasType.ADVANCED;
txt.defaultTextFormat = format;
txt.embedFonts = true;
txt.autoSize = TextFieldAutoSize.LEFT;
txt.wordWrap = true;
fon = new Sprite();
addChild(fon);
addChild(txt);
visible = false;
x = -1000;
y = -1000;
mouseEnabled = false;
}
public function show(_arg1:int, _arg2:int, _arg3:String, _arg4:int=150, _arg5:Number=0.7, _arg6:int=20):void{
x = _arg1;
y = _arg2;
shift = _arg6;
trace(((("show hint " + x) + " ") + y));
visible = true;
txt.width = _arg4;
txt.htmlText = _arg3;
if (_arg1 > 600){
fon.scaleX = -1;
txt.x = (-(txt.width) - (border * 2));
} else {
txt.x = (border * 2);
fon.scaleX = 1;
};
txt.y = ((-(border) * 2) - int(txt.height));
fon.graphics.clear();
fon.graphics.beginFill(0, _arg5);
fon.graphics.lineTo(border, (-(border) * 2));
fon.graphics.lineTo(border, txt.y);
fon.graphics.curveTo(border, (txt.y - border), (border * 2), (txt.y - border));
fon.graphics.lineTo((txt.x + _arg4), (txt.y - border));
fon.graphics.curveTo((_arg4 + (border * 3)), (txt.y - border), (_arg4 + (border * 3)), txt.y);
fon.graphics.lineTo((_arg4 + (border * 3)), (border * -2));
fon.graphics.curveTo((_arg4 + (border * 3)), -(border), (_arg4 + (border * 2)), -(border));
fon.graphics.lineTo((border * 2), -(border));
fon.graphics.lineTo(0, 0);
fon.graphics.endFill();
txt.x = (txt.x + shift);
txt.y = (txt.y - shift);
fon.x = shift;
fon.y = -(shift);
}
public function hide():void{
visible = false;
x = -1000;
y = -1000;
}
}
}//package com.utils
Section 49
//gpirate_Symbool3_1 (PMCC_fla.gpirate_Symbool3_1)
package PMCC_fla {
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.media.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import flash.filters.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class gpirate_Symbool3_1 extends MovieClip {
public function gpirate_Symbool3_1(){
addFrameScript(0, frame1, 189, frame190);
}
function frame1(){
stop();
}
function frame190(){
MovieClip(parent).gotoAndStop(2);
MovieClip(parent).init();
}
}
}//package PMCC_fla
Section 50
//_data_Location (_data_Location)
package {
import flash.display.*;
public dynamic class _data_Location extends Sprite {
}
}//package
Section 51
//_data_Point (_data_Point)
package {
import flash.display.*;
public dynamic class _data_Point extends Sprite {
}
}//package
Section 52
//_dataCOM (_dataCOM)
package {
import flash.display.*;
public dynamic class _dataCOM extends Sprite {
}
}//package
Section 53
//_dataCount (_dataCount)
package {
import flash.display.*;
public dynamic class _dataCount extends Sprite {
}
}//package
Section 54
//_dataEAntiAir (_dataEAntiAir)
package {
import flash.display.*;
public dynamic class _dataEAntiAir extends Sprite {
}
}//package
Section 55
//_dataEBunker (_dataEBunker)
package {
import flash.display.*;
public dynamic class _dataEBunker extends Sprite {
}
}//package
Section 56
//_dataEDropPort (_dataEDropPort)
package {
import flash.display.*;
public dynamic class _dataEDropPort extends Sprite {
}
}//package
Section 57
//_dataEHeliPort (_dataEHeliPort)
package {
import flash.display.*;
public dynamic class _dataEHeliPort extends Sprite {
}
}//package
Section 58
//_dataEJetPort (_dataEJetPort)
package {
import flash.display.*;
public dynamic class _dataEJetPort extends Sprite {
}
}//package
Section 59
//_dataENuclear (_dataENuclear)
package {
import flash.display.*;
public dynamic class _dataENuclear extends Sprite {
}
}//package
Section 60
//_dataESupport (_dataESupport)
package {
import flash.display.*;
public dynamic class _dataESupport extends Sprite {
}
}//package
Section 61
//AllResources (AllResources)
package {
import flash.display.*;
public dynamic class AllResources extends MovieClip {
}
}//package
Section 62
//blast_bomb (blast_bomb)
package {
import flash.display.*;
public dynamic class blast_bomb extends MovieClip {
}
}//package
Section 63
//blast_bullet (blast_bullet)
package {
import flash.display.*;
public dynamic class blast_bullet extends MovieClip {
}
}//package
Section 64
//blast_bullet00 (blast_bullet00)
package {
import flash.display.*;
public dynamic class blast_bullet00 extends MovieClip {
}
}//package
Section 65
//blast_bullet02 (blast_bullet02)
package {
import flash.display.*;
public dynamic class blast_bullet02 extends MovieClip {
}
}//package
Section 66
//blast_tank (blast_tank)
package {
import flash.display.*;
public dynamic class blast_tank extends MovieClip {
}
}//package
Section 67
//boom00 (boom00)
package {
import flash.media.*;
public dynamic class boom00 extends Sound {
}
}//package
Section 68
//boom01 (boom01)
package {
import flash.media.*;
public dynamic class boom01 extends Sound {
}
}//package
Section 69
//btn_Credits (btn_Credits)
package {
import flash.display.*;
public dynamic class btn_Credits extends SimpleButton {
}
}//package
Section 70
//btn_Level (btn_Level)
package {
import flash.display.*;
public dynamic class btn_Level extends SimpleButton {
}
}//package
Section 71
//btn_MBack (btn_MBack)
package {
import flash.display.*;
public dynamic class btn_MBack extends SimpleButton {
}
}//package
Section 72
//btn_Menu (btn_Menu)
package {
import flash.display.*;
public dynamic class btn_Menu extends SimpleButton {
}
}//package
Section 73
//btn_MMainmenu (btn_MMainmenu)
package {
import flash.display.*;
public dynamic class btn_MMainmenu extends SimpleButton {
}
}//package
Section 74
//btn_Moregames (btn_Moregames)
package {
import flash.display.*;
public dynamic class btn_Moregames extends SimpleButton {
}
}//package
Section 75
//btn_MRestart (btn_MRestart)
package {
import flash.display.*;
public dynamic class btn_MRestart extends SimpleButton {
}
}//package
Section 76
//btn_MSelectlevel (btn_MSelectlevel)
package {
import flash.display.*;
public dynamic class btn_MSelectlevel extends SimpleButton {
}
}//package
Section 77
//btn_Next (btn_Next)
package {
import flash.display.*;
public dynamic class btn_Next extends SimpleButton {
}
}//package
Section 78
//btn_Panel (btn_Panel)
package {
import flash.display.*;
public dynamic class btn_Panel extends MovieClip {
}
}//package
Section 79
//btn_PauseOff (btn_PauseOff)
package {
import flash.display.*;
public dynamic class btn_PauseOff extends SimpleButton {
}
}//package
Section 80
//btn_PauseOn (btn_PauseOn)
package {
import flash.display.*;
public dynamic class btn_PauseOn extends SimpleButton {
}
}//package
Section 81
//btn_Replay (btn_Replay)
package {
import flash.display.*;
public dynamic class btn_Replay extends SimpleButton {
}
}//package
Section 82
//btn_Restart (btn_Restart)
package {
import flash.display.*;
public dynamic class btn_Restart extends SimpleButton {
}
}//package
Section 83
//btn_Settings (btn_Settings)
package {
import flash.display.*;
public dynamic class btn_Settings extends SimpleButton {
}
}//package
Section 84
//btn_SoundOff (btn_SoundOff)
package {
import flash.display.*;
public dynamic class btn_SoundOff extends SimpleButton {
}
}//package
Section 85
//btn_SoundOffMenu (btn_SoundOffMenu)
package {
import flash.display.*;
public dynamic class btn_SoundOffMenu extends SimpleButton {
}
}//package
Section 86
//btn_SoundOn (btn_SoundOn)
package {
import flash.display.*;
public dynamic class btn_SoundOn extends SimpleButton {
}
}//package
Section 87
//btn_SoundOnMenu (btn_SoundOnMenu)
package {
import flash.display.*;
public dynamic class btn_SoundOnMenu extends SimpleButton {
}
}//package
Section 88
//btn_Start (btn_Start)
package {
import flash.display.*;
public dynamic class btn_Start extends SimpleButton {
}
}//package
Section 89
//CreditsSprite (CreditsSprite)
package {
import flash.display.*;
public dynamic class CreditsSprite extends Sprite {
}
}//package
Section 90
//DefeatSprite (DefeatSprite)
package {
import flash.display.*;
public dynamic class DefeatSprite extends Sprite {
}
}//package
Section 91
//final_label (final_label)
package {
import flash.display.*;
public dynamic class final_label extends Sprite {
}
}//package
Section 92
//FinalScreen (FinalScreen)
package {
import flash.display.*;
public dynamic class FinalScreen extends Sprite {
}
}//package
Section 93
//heli_born (heli_born)
package {
import flash.media.*;
public dynamic class heli_born extends Sound {
}
}//package
Section 94
//heli_shot (heli_shot)
package {
import flash.media.*;
public dynamic class heli_shot extends Sound {
}
}//package
Section 95
//HightLight (HightLight)
package {
import flash.display.*;
public dynamic class HightLight extends Sprite {
}
}//package
Section 96
//Hint00 (Hint00)
package {
import flash.display.*;
public dynamic class Hint00 extends MovieClip {
}
}//package
Section 97
//Hint00A (Hint00A)
package {
import flash.display.*;
public dynamic class Hint00A extends Sprite {
}
}//package
Section 98
//Hint01 (Hint01)
package {
import flash.display.*;
public dynamic class Hint01 extends Sprite {
}
}//package
Section 99
//Hint02 (Hint02)
package {
import flash.display.*;
public dynamic class Hint02 extends Sprite {
}
}//package
Section 100
//Hint04 (Hint04)
package {
import flash.display.*;
public dynamic class Hint04 extends Sprite {
}
}//package
Section 101
//Hint05 (Hint05)
package {
import flash.display.*;
public dynamic class Hint05 extends Sprite {
}
}//package
Section 102
//Hint06 (Hint06)
package {
import flash.display.*;
public dynamic class Hint06 extends Sprite {
}
}//package
Section 103
//Hint07 (Hint07)
package {
import flash.display.*;
public dynamic class Hint07 extends Sprite {
}
}//package
Section 104
//Hint08 (Hint08)
package {
import flash.display.*;
public dynamic class Hint08 extends Sprite {
}
}//package
Section 105
//HintSimbol (HintSimbol)
package {
import flash.display.*;
public dynamic class HintSimbol extends MovieClip {
}
}//package
Section 106
//jet_fly (jet_fly)
package {
import flash.media.*;
public dynamic class jet_fly extends Sound {
}
}//package
Section 107
//level00 (level00)
package {
import flash.display.*;
public dynamic class level00 extends Sprite {
}
}//package
Section 108
//level01 (level01)
package {
import flash.display.*;
public dynamic class level01 extends Sprite {
}
}//package
Section 109
//level02 (level02)
package {
import flash.display.*;
public dynamic class level02 extends Sprite {
}
}//package
Section 110
//level03 (level03)
package {
import flash.display.*;
public dynamic class level03 extends Sprite {
}
}//package
Section 111
//level04 (level04)
package {
import flash.display.*;
public dynamic class level04 extends Sprite {
}
}//package
Section 112
//level05 (level05)
package {
import flash.display.*;
public dynamic class level05 extends Sprite {
}
}//package
Section 113
//level06 (level06)
package {
import flash.display.*;
public dynamic class level06 extends Sprite {
}
}//package
Section 114
//level07 (level07)
package {
import flash.display.*;
public dynamic class level07 extends Sprite {
}
}//package
Section 115
//level08 (level08)
package {
import flash.display.*;
public dynamic class level08 extends Sprite {
}
}//package
Section 116
//level09 (level09)
package {
import flash.display.*;
public dynamic class level09 extends Sprite {
}
}//package
Section 117
//level10 (level10)
package {
import flash.display.*;
public dynamic class level10 extends Sprite {
}
}//package
Section 118
//level11 (level11)
package {
import flash.display.*;
public dynamic class level11 extends Sprite {
}
}//package
Section 119
//level12 (level12)
package {
import flash.display.*;
public dynamic class level12 extends Sprite {
}
}//package
Section 120
//level13 (level13)
package {
import flash.display.*;
public dynamic class level13 extends Sprite {
}
}//package
Section 121
//level14 (level14)
package {
import flash.display.*;
public dynamic class level14 extends Sprite {
}
}//package
Section 122
//main_music1 (main_music1)
package {
import flash.media.*;
public dynamic class main_music1 extends Sound {
}
}//package
Section 123
//main_music2 (main_music2)
package {
import flash.media.*;
public dynamic class main_music2 extends Sound {
}
}//package
Section 124
//main_music3 (main_music3)
package {
import flash.media.*;
public dynamic class main_music3 extends Sound {
}
}//package
Section 125
//Mainfont (Mainfont)
package {
import flash.text.*;
public dynamic class Mainfont extends Font {
}
}//package
Section 126
//MainmenuBackground (MainmenuBackground)
package {
import flash.display.*;
public dynamic class MainmenuBackground extends Sprite {
}
}//package
Section 127
//MainmenuLogo (MainmenuLogo)
package {
import flash.display.*;
public dynamic class MainmenuLogo extends Sprite {
}
}//package
Section 128
//mc_AntiairBody (mc_AntiairBody)
package {
import flash.display.*;
public dynamic class mc_AntiairBody extends Sprite {
}
}//package
Section 129
//mc_AntiairColor (mc_AntiairColor)
package {
import flash.display.*;
public dynamic class mc_AntiairColor extends Sprite {
}
}//package
Section 130
//mc_Attack (mc_Attack)
package {
import flash.display.*;
public dynamic class mc_Attack extends MovieClip {
}
}//package
Section 131
//mc_BunkerBags (mc_BunkerBags)
package {
import flash.display.*;
public dynamic class mc_BunkerBags extends Sprite {
}
}//package
Section 132
//mc_BunkerBody (mc_BunkerBody)
package {
import flash.display.*;
public dynamic class mc_BunkerBody extends Sprite {
}
}//package
Section 133
//mc_BunkerCap (mc_BunkerCap)
package {
import flash.display.*;
public dynamic class mc_BunkerCap extends Sprite {
}
}//package
Section 134
//mc_Drop (mc_Drop)
package {
import flash.display.*;
public dynamic class mc_Drop extends MovieClip {
}
}//package
Section 135
//mc_Dropport (mc_Dropport)
package {
import flash.display.*;
public dynamic class mc_Dropport extends MovieClip {
}
}//package
Section 136
//mc_DropportColor (mc_DropportColor)
package {
import flash.display.*;
public dynamic class mc_DropportColor extends Sprite {
}
}//package
Section 137
//mc_DropPropeller (mc_DropPropeller)
package {
import flash.display.*;
public dynamic class mc_DropPropeller extends MovieClip {
}
}//package
Section 138
//mc_HeliBody (mc_HeliBody)
package {
import flash.display.*;
public dynamic class mc_HeliBody extends MovieClip {
}
}//package
Section 139
//mc_HeliColor (mc_HeliColor)
package {
import flash.display.*;
public dynamic class mc_HeliColor extends MovieClip {
}
}//package
Section 140
//mc_Heliport (mc_Heliport)
package {
import flash.display.*;
public dynamic class mc_Heliport extends MovieClip {
}
}//package
Section 141
//mc_HeliportColor (mc_HeliportColor)
package {
import flash.display.*;
public dynamic class mc_HeliportColor extends Sprite {
}
}//package
Section 142
//mc_HeliPropeller (mc_HeliPropeller)
package {
import flash.display.*;
public dynamic class mc_HeliPropeller extends MovieClip {
}
}//package
Section 143
//mc_HeliRocket (mc_HeliRocket)
package {
import flash.display.*;
public dynamic class mc_HeliRocket extends MovieClip {
}
}//package
Section 144
//mc_Jet (mc_Jet)
package {
import flash.display.*;
public dynamic class mc_Jet extends MovieClip {
}
}//package
Section 145
//mc_Jetport (mc_Jetport)
package {
import flash.display.*;
public dynamic class mc_Jetport extends Sprite {
}
}//package
Section 146
//mc_JetportColor (mc_JetportColor)
package {
import flash.display.*;
public dynamic class mc_JetportColor extends Sprite {
}
}//package
Section 147
//mc_JetportRadar (mc_JetportRadar)
package {
import flash.display.*;
public dynamic class mc_JetportRadar extends MovieClip {
}
}//package
Section 148
//mc_Laser (mc_Laser)
package {
import flash.display.*;
public dynamic class mc_Laser extends MovieClip {
}
}//package
Section 149
//mc_Levels (mc_Levels)
package {
import flash.display.*;
public dynamic class mc_Levels extends MovieClip {
}
}//package
Section 150
//mc_Location (mc_Location)
package {
import flash.display.*;
public dynamic class mc_Location extends Sprite {
}
}//package
Section 151
//mc_LocationColor (mc_LocationColor)
package {
import flash.display.*;
public dynamic class mc_LocationColor extends Sprite {
}
}//package
Section 152
//mc_Nuclear (mc_Nuclear)
package {
import flash.display.*;
import flash.events.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;
public dynamic class mc_Nuclear extends MovieClip {
public var Rocket:mc_RocketRocket;
public function mc_Nuclear(){
addFrameScript(29, frame30, 49, frame50);
}
function frame30(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package
Section 153
//mc_Nuclear2 (mc_Nuclear2)
package {
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import flash.display.*;
import flash.media.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import flash.filters.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class mc_Nuclear2 extends MovieClip {
public var Rocket:mc_RocketRocket;
public function mc_Nuclear2(){
addFrameScript(29, frame30, 49, frame50);
}
function frame30(){
stop();
}
function frame50(){
stop();
}
}
}//package
Section 154
//mc_NuclearColor (mc_NuclearColor)
package {
import flash.display.*;
public dynamic class mc_NuclearColor extends MovieClip {
}
}//package
Section 155
//mc_NuclearRocket (mc_NuclearRocket)
package {
import flash.display.*;
public dynamic class mc_NuclearRocket extends MovieClip {
}
}//package
Section 156
//mc_Progres (mc_Progres)
package {
import flash.display.*;
public dynamic class mc_Progres extends MovieClip {
}
}//package
Section 157
//mc_progressAir (mc_progressAir)
package {
import flash.display.*;
public dynamic class mc_progressAir extends MovieClip {
}
}//package
Section 158
//mc_progressRocket (mc_progressRocket)
package {
import flash.display.*;
public dynamic class mc_progressRocket extends MovieClip {
}
}//package
Section 159
//mc_Rocket (mc_Rocket)
package {
import flash.display.*;
public dynamic class mc_Rocket extends MovieClip {
}
}//package
Section 160
//mc_RocketRocket (mc_RocketRocket)
package {
import flash.display.*;
public dynamic class mc_RocketRocket extends MovieClip {
}
}//package
Section 161
//mc_RocketToBase (mc_RocketToBase)
package {
import flash.display.*;
public dynamic class mc_RocketToBase extends Sprite {
}
}//package
Section 162
//mc_Select (mc_Select)
package {
import flash.display.*;
public dynamic class mc_Select extends MovieClip {
}
}//package
Section 163
//mc_SelectAir (mc_SelectAir)
package {
import flash.display.*;
public dynamic class mc_SelectAir extends MovieClip {
}
}//package
Section 164
//mc_SelectRocket (mc_SelectRocket)
package {
import flash.display.*;
public dynamic class mc_SelectRocket extends MovieClip {
}
}//package
Section 165
//mc_Shadow (mc_Shadow)
package {
import flash.display.*;
public dynamic class mc_Shadow extends MovieClip {
}
}//package
Section 166
//mc_Support (mc_Support)
package {
import flash.display.*;
public dynamic class mc_Support extends MovieClip {
}
}//package
Section 167
//mc_SupportColor (mc_SupportColor)
package {
import flash.display.*;
public dynamic class mc_SupportColor extends Sprite {
}
}//package
Section 168
//mc_TankBody (mc_TankBody)
package {
import flash.display.*;
public dynamic class mc_TankBody extends MovieClip {
}
}//package
Section 169
//mc_TankTower (mc_TankTower)
package {
import flash.display.*;
public dynamic class mc_TankTower extends MovieClip {
}
}//package
Section 170
//MenuSprite (MenuSprite)
package {
import flash.display.*;
public dynamic class MenuSprite extends Sprite {
}
}//package
Section 171
//piratebutton1 (piratebutton1)
package {
import flash.display.*;
public dynamic class piratebutton1 extends SimpleButton {
}
}//package
Section 172
//piratebutton2 (piratebutton2)
package {
import flash.display.*;
public dynamic class piratebutton2 extends SimpleButton {
}
}//package
Section 173
//piratebutton3 (piratebutton3)
package {
import flash.display.*;
public dynamic class piratebutton3 extends SimpleButton {
}
}//package
Section 174
//Preloader (Preloader)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class Preloader extends MovieClip {
public var txt:TextField;
public function Preloader():void{
addFrameScript(0, frame1);
txt.embedFonts = true;
addEventListener(Event.ENTER_FRAME, checkLoad);
MovieClip(parent).gotoAndStop(1);
}
public function run():void{
}
private function checkLoad(_arg1:Event):void{
BytesLoaded = stage.loaderInfo.bytesLoaded;
BytesTotal = stage.loaderInfo.bytesTotal;
percent = ((BytesLoaded / BytesTotal) * 100);
if ((((BytesLoaded == BytesTotal)) && (!((BytesTotal == 0))))){
removeEventListener(Event.ENTER_FRAME, checkLoad);
trace("loaded");
visible = false;
y = -1000;
MovieClip(parent).Logo.play();
};
this.txt.text = (("LOADING " + int(percent)) + "%");
}
function frame1(){
stop();
}
}
}//package
Section 175
//tank_born (tank_born)
package {
import flash.media.*;
public dynamic class tank_born extends Sound {
}
}//package
Section 176
//VicDefSprite (VicDefSprite)
package {
import flash.display.*;
public dynamic class VicDefSprite extends Sprite {
}
}//package
Section 177
//VictorySprite (VictorySprite)
package {
import flash.display.*;
public dynamic class VictorySprite extends Sprite {
}
}//package