Section 1
//AchievementAlert (Achievements.AchievementAlert)
package Achievements {
import flash.display.*;
public class AchievementAlert extends Sprite {
public var moment:int;// = 0
private var iconType:int;
private var myValue:int;
private var layout:AchievementAlertImage;
private var achievement:AchievementIcon;
public function AchievementAlert(_arg1:String, _arg2:String, _arg3:int){
layout = new AchievementAlertImage();
layout.inside.nameText.text = _arg1;
layout.inside.descText.text = _arg2;
layout.inside.value.text = _arg3.toString();
achievement = new AchievementIcon();
achievement.x = layout.inside.imageSlot.x;
achievement.y = layout.inside.imageSlot.y;
achievement.stop();
layout.inside.addChild(achievement);
myValue = _arg3;
addChild(layout);
alpha = 0;
}
public function update(_arg1:Number):void{
var _local2:Number = (_arg1 - y);
if (moment == 0){
if (alpha < 1){
alpha = (alpha + 0.18);
} else {
alpha = 1.8;
moment = 1;
Main(parent).playSoundEffect("achievement");
achievement.play();
};
} else {
if (moment == 1){
if (alpha > 0){
alpha = (alpha - 0.004);
if (alpha < 0.8){
_arg1 = (_arg1 + 34);
alpha = (alpha - 0.04);
};
} else {
Main(parent).totalAchievementScore = (Main(parent).totalAchievementScore + myValue);
Main(parent).calculatePlayerPatentCode();
moment = 2;
};
};
};
if (y != _arg1){
_local2 = (_arg1 - y);
y = (y + (_local2 / 10));
if (int(y) == int(_arg1)){
y = _arg1;
};
};
}
}
}//package Achievements
Section 2
//AchievementShow (Achievements.AchievementShow)
package Achievements {
import flash.display.*;
public class AchievementShow extends Sprite {
private var layout:AchievementShowLayout;
public var myDesc:String;
public function AchievementShow(_arg1:String, _arg2:String, _arg3:int, _arg4:Boolean, _arg5:int){
var _local6:String;
super();
layout = new AchievementShowLayout();
myDesc = _arg2;
layout.inside.nameText.text = _arg1;
if (_arg5 < 10){
_local6 = ("0" + _arg5);
} else {
_local6 = _arg5.toString();
};
layout.inside.position.text = _local6;
layout.inside.value.text = (_arg3.toString() + " pts");
if (_arg4){
layout.inside.icon.gotoAndStop(2);
} else {
layout.inside.icon.gotoAndStop(1);
};
addChild(layout);
}
}
}//package Achievements
Section 3
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public class PropTween {
public var priority:int;
public var start:Number;
public var prevNode:PropTween;
public var change:Number;
public var target:Object;
public var name:String;
public var property:String;
public var nextNode:PropTween;
public var isPlugin:Boolean;
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 4
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
public var autoRemoveChildren:Boolean;
protected var _lastChild:TweenCore;
protected var _firstChild:TweenCore;
public function SimpleTimeline(_arg1:Object=null){
super(0, _arg1);
}
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 addChild(_arg1:TweenCore):void{
if (((!(_arg1.gc)) && (_arg1.timeline))){
_arg1.timeline.remove(_arg1, true);
};
_arg1.timeline = this;
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
if (_firstChild){
_firstChild.prevNode = _arg1;
};
_arg1.nextNode = _firstChild;
_firstChild = _arg1;
_arg1.prevNode = null;
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.gc){
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;
};
};
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
}
}//package com.greensock.core
Section 5
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
public var initted:Boolean;
protected var _hasUpdate:Boolean;
public var active:Boolean;
protected var _delay:Number;
public var cachedTime:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var cachedTotalTime:Number;
public var timeline:SimpleTimeline;
public var data;
public var cachedStartTime:Number;
public var prevNode:TweenCore;
public var cachedDuration:Number;
public var gc:Boolean;
protected var _pauseTime:Number;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var cachedTimeScale:Number;
public var cachedTotalDuration:Number;
public static const version:Number = 1.13;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
this.vars = ((_arg2) || ({}));
this.cachedDuration = (this.cachedTotalDuration = ((_arg1) || (0)));
_delay = ((this.vars.delay) || (0));
this.cachedTimeScale = ((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;
this.cachedStartTime = (_local3.cachedTotalTime + _delay);
_local3.addChild(this);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
}
public function get delay():Number{
return (_delay);
}
public function get duration():Number{
return (this.cachedDuration);
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
public function set reversed(_arg1:Boolean):void{
if (_arg1 != this.cachedReversed){
this.cachedReversed = _arg1;
setTotalTime(this.cachedTotalTime, true);
};
}
public function set startTime(_arg1:Number):void{
var _local2:Boolean = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc)))));
this.cachedStartTime = _arg1;
if (_local2){
this.timeline.addChild(this);
};
}
public function set delay(_arg1:Number):void{
this.startTime = (this.startTime + (_arg1 - _delay));
_delay = _arg1;
}
public function resume():void{
this.paused = false;
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function set duration(_arg1:Number):void{
this.cachedDuration = (this.cachedTotalDuration = _arg1);
setDirtyCache(false);
}
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.cachedTotalDuration, _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 get totalTime():Number{
return (this.cachedTotalTime);
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function set currentTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
protected function setDirtyCache(_arg1:Boolean=true):void{
var _local2:TweenCore = (_arg1) ? this : this.timeline;
while (_local2) {
_local2.cacheIsDirty = true;
_local2 = _local2.timeline;
};
}
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 set paused(_arg1:Boolean):void{
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){
if (_arg1){
_pauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime));
_pauseTime = 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);
};
}
public function kill():void{
setEnabled(false, false);
}
public function set totalTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get currentTime():Number{
return (this.cachedTime);
}
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
if (this.timeline){
_local3 = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : 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 pause():void{
this.paused = true;
}
public function set totalDuration(_arg1:Number):void{
this.duration = _arg1;
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.gc))){
this.timeline.addChild(this);
};
} else {
this.active = false;
if (!_arg2){
this.timeline.remove(this, true);
};
};
this.gc = !(_arg1);
return (false);
}
}
}//package com.greensock.core
Section 6
//TweenEvent (com.greensock.events.TweenEvent)
package com.greensock.events {
import flash.events.*;
public class TweenEvent extends Event {
public static const COMPLETE:String = "complete";
public static const START:String = "start";
public static const UPDATE:String = "change";
public static const REVERSE_COMPLETE:String = "reverseComplete";
public static const INIT:String = "init";
public static const VERSION:Number = 1.1;
public static const REPEAT:String = "repeat";
public function TweenEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new TweenEvent(this.type, this.bubbles, this.cancelable));
}
}
}//package com.greensock.events
Section 7
//AutoAlphaPlugin (com.greensock.plugins.AutoAlphaPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _target:Object;
protected var _ignoreVisible:Boolean;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_ignoreVisible = Boolean(("visible" in _arg1));
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (!_ignoreVisible){
_target.visible = Boolean(!((_target.alpha == 0)));
};
}
}
}//package com.greensock.plugins
Section 8
//BevelFilterPlugin (com.greensock.plugins.BevelFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["distance", "angle", "highlightColor", "highlightAlpha", "shadowColor", "shadowAlpha", "blurX", "blurY", "strength", "quality"];
public function BevelFilterPlugin(){
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BevelFilter;
initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 9
//BezierPlugin (com.greensock.plugins.BezierPlugin)
package com.greensock.plugins {
import com.greensock.*;
import com.greensock.core.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _target:Object;
protected var _beziers:Object;
public static const API:Number = 1;
protected static const _RAD2DEG:Number = 57.2957795130823;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local6:int;
var _local7:String;
var _local8:Object;
_target = _arg1.target;
var _local4:Object = ((_arg1.vars.isTV)==true) ? _arg1.vars.exposedVars : _arg1.vars;
if (_local4.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0, 0.01]];
_orient = true;
} else {
if ((_local4.orientToBezier is Array)){
_orientData = _local4.orientToBezier;
_orient = true;
};
};
var _local5:Object = {};
_local6 = 0;
while (_local6 < _arg2.length) {
for (_local7 in _arg2[_local6]) {
if (_local5[_local7] == undefined){
_local5[_local7] = [_arg1.target[_local7]];
};
if (typeof(_arg2[_local6][_local7]) == "number"){
_local5[_local7].push(_arg2[_local6][_local7]);
} else {
_local5[_local7].push((_arg1.target[_local7] + Number(_arg2[_local6][_local7])));
};
};
_local6++;
};
for (_local7 in _local5) {
this.overwriteProps[this.overwriteProps.length] = _local7;
if (_local4[_local7] != undefined){
if (typeof(_local4[_local7]) == "number"){
_local5[_local7].push(_local4[_local7]);
} else {
_local5[_local7].push((_arg1.target[_local7] + Number(_local4[_local7])));
};
_local8 = {};
_local8[_local7] = true;
_arg1.killVars(_local8, false);
delete _local4[_local7];
};
};
_beziers = parseBeziers(_local5, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:Object;
var _local9:Number;
var _local10:Number;
var _local11:Array;
var _local12:Number;
var _local13:Object;
var _local14:Boolean;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = int((_local6 * _arg1));
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
_target[_local3] = ((_local7)>0) ? int((_local7 + 0.5)) : int((_local7 - 0.5));
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local2 = _orientData.length;
_local8 = {};
while (_local2--) {
_local11 = _orientData[_local2];
_local8[_local11[0]] = _target[_local11[0]];
_local8[_local11[1]] = _target[_local11[1]];
};
_local13 = _target;
_local14 = this.round;
_target = _future;
this.round = false;
_orient = false;
_local2 = _orientData.length;
while (_local2--) {
_local11 = _orientData[_local2];
this.changeFactor = (_arg1 + ((_local11[4]) || (0.01)));
_local12 = ((_local11[3]) || (0));
_local9 = (_future[_local11[0]] - _local8[_local11[0]]);
_local10 = (_future[_local11[1]] - _local8[_local11[1]]);
_local13[_local11[2]] = ((Math.atan2(_local10, _local9) * _RAD2DEG) + _local12);
};
_target = _local13;
this.round = _local14;
_orient = true;
};
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3++;
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3++;
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package com.greensock.plugins
Section 10
//BezierThroughPlugin (com.greensock.plugins.BezierThroughPlugin)
package com.greensock.plugins {
import com.greensock.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const API:Number = 1;
public function BezierThroughPlugin(){
this.propName = "bezierThrough";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), true);
return (true);
}
}
}//package com.greensock.plugins
Section 11
//BlurFilterPlugin (com.greensock.plugins.BlurFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["blurX", "blurY", "quality"];
public function BlurFilterPlugin(){
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BlurFilter;
initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 12
//ColorMatrixFilterPlugin (com.greensock.plugins.ColorMatrixFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
private static var _propNames:Array = [];
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = ColorMatrixFilter;
var _local4:Object = _arg2;
initFilter({remove:_arg2.remove, index:_arg2.index, addFilter:_arg2.addFilter}, new ColorMatrixFilter(_idMatrix.slice()), _propNames);
_matrix = ColorMatrixFilter(_filter).matrix;
var _local5:Array = [];
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_local5 = _local4.matrix;
} else {
if (_local4.relative == true){
_local5 = _matrix.slice();
} else {
_local5 = _idMatrix.slice();
};
_local5 = setBrightness(_local5, _local4.brightness);
_local5 = setContrast(_local5, _local4.contrast);
_local5 = setHue(_local5, _local4.hue);
_local5 = setSaturation(_local5, _local4.saturation);
_local5 = setThreshold(_local5, _local4.threshold);
if (!isNaN(_local4.colorize)){
_local5 = colorize(_local5, _local4.colorize, _local4.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
_matrixTween.changeFactor = _arg1;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = _arg1;
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
}
}//package com.greensock.plugins
Section 13
//ColorTransformPlugin (com.greensock.plugins.ColorTransformPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.geom.*;
public class ColorTransformPlugin extends TintPlugin {
public static const API:Number = 1;
public function ColorTransformPlugin(){
this.propName = "colorTransform";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local5:String;
var _local6:Number;
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = _arg1.transform.colorTransform;
for (_local5 in _arg2) {
if ((((_local5 == "tint")) || ((_local5 == "color")))){
if (_arg2[_local5] != null){
_local4.color = int(_arg2[_local5]);
};
} else {
if ((((((_local5 == "tintAmount")) || ((_local5 == "exposure")))) || ((_local5 == "brightness")))){
} else {
_local4[_local5] = _arg2[_local5];
};
};
};
if (!isNaN(_arg2.tintAmount)){
_local6 = (_arg2.tintAmount / (1 - (((_local4.redMultiplier + _local4.greenMultiplier) + _local4.blueMultiplier) / 3)));
_local4.redOffset = (_local4.redOffset * _local6);
_local4.greenOffset = (_local4.greenOffset * _local6);
_local4.blueOffset = (_local4.blueOffset * _local6);
_local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = (1 - _arg2.tintAmount)));
} else {
if (!isNaN(_arg2.exposure)){
_local4.redOffset = (_local4.greenOffset = (_local4.blueOffset = (0xFF * (_arg2.exposure - 1))));
_local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = 1));
} else {
if (!isNaN(_arg2.brightness)){
_local4.redOffset = (_local4.greenOffset = (_local4.blueOffset = Math.max(0, ((_arg2.brightness - 1) * 0xFF))));
_local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = (1 - Math.abs((_arg2.brightness - 1)))));
};
};
};
_ignoreAlpha = Boolean(((!((_arg3.vars.alpha == undefined))) && ((_arg2.alphaMultiplier == undefined))));
init((_arg1 as DisplayObject), _local4);
return (true);
}
}
}//package com.greensock.plugins
Section 14
//DropShadowFilterPlugin (com.greensock.plugins.DropShadowFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["distance", "angle", "color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout", "hideObject"];
public function DropShadowFilterPlugin(){
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = DropShadowFilter;
initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 15
//EndArrayPlugin (com.greensock.plugins.EndArrayPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init(_arg1:Array, _arg2:Array):void{
_a = _arg1;
var _local3:int = _arg2.length;
while (_local3--) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local2:int = _info.length;
if (this.round){
while (_local2--) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_a[_local3.index] = ((_local4)>0) ? int((_local4 + 0.5)) : int((_local4 - 0.5));
};
} else {
while (_local2--) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
};
};
}
}
}//package com.greensock.plugins
class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
private function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
Section 16
//FilterPlugin (com.greensock.plugins.FilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
import com.greensock.core.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 2.03;
public static const API:Number = 1;
public function onCompleteTween():void{
var _local1:Array;
var _local2:int;
if (_remove){
_local1 = _target.filters;
if (!(_local1[_index] is _type)){
_local2 = _local1.length;
while (_local2--) {
if ((_local1[_local2] is _type)){
_local1.splice(_local2, 1);
break;
};
};
} else {
_local1.splice(_index, 1);
};
_target.filters = _local1;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter, _arg3:Array):void{
var _local5:String;
var _local6:int;
var _local7:HexColorsPlugin;
var _local4:Array = _target.filters;
var _local8:Object = ((_arg1 is BitmapFilter)) ? {} : _arg1;
_index = -1;
if (_local8.index != null){
_index = _local8.index;
} else {
_local6 = _local4.length;
while (_local6--) {
if ((_local4[_local6] is _type)){
_index = _local6;
break;
};
};
};
if ((((((_index == -1)) || ((_local4[_index] == null)))) || ((_local8.addFilter == true)))){
_index = ((_local8.index)!=null) ? _local8.index : _local4.length;
_local4[_index] = _arg2;
_target.filters = _local4;
};
_filter = _local4[_index];
if (_local8.remove == true){
_remove = true;
this.onComplete = onCompleteTween;
};
_local6 = _arg3.length;
while (_local6--) {
_local5 = _arg3[_local6];
if ((((_local5 in _arg1)) && (!((_filter[_local5] == _arg1[_local5]))))){
if ((((((_local5 == "color")) || ((_local5 == "highlightColor")))) || ((_local5 == "shadowColor")))){
_local7 = new HexColorsPlugin();
_local7.initColor(_filter, _local5, _filter[_local5], _arg1[_local5]);
_tweens[_tweens.length] = new PropTween(_local7, "changeFactor", 0, 1, _local5, false);
} else {
if ((((((((_local5 == "quality")) || ((_local5 == "inner")))) || ((_local5 == "knockout")))) || ((_local5 == "hideObject")))){
_filter[_local5] = _arg1[_local5];
} else {
addTween(_filter, _local5, _filter[_local5], _arg1[_local5], _local5);
};
};
};
};
}
override public function set changeFactor(_arg1:Number):void{
var _local3:PropTween;
var _local2:int = _tweens.length;
var _local4:Array = _target.filters;
while (_local2--) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
};
if (!(_local4[_index] is _type)){
_local2 = (_index = _local4.length);
while (_local2--) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
}
}//package com.greensock.plugins
Section 17
//FrameLabelPlugin (com.greensock.plugins.FrameLabelPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class FrameLabelPlugin extends FramePlugin {
public static const API:Number = 1;
public function FrameLabelPlugin(){
this.propName = "frameLabel";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if ((!(_arg3.target) is MovieClip)){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
var _local4:Array = _target.currentLabels;
var _local5:String = _arg2;
var _local6:int = _target.currentFrame;
var _local7:int = _local4.length;
while (_local7--) {
if (_local4[_local7].name == _local5){
_local6 = _local4[_local7].frame;
break;
};
};
if (this.frame != _local6){
addTween(this, "frame", this.frame, _local6, "frame");
};
return (true);
}
}
}//package com.greensock.plugins
Section 18
//FramePlugin (com.greensock.plugins.FramePlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame", "frameLabel"];
this.round = true;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
}
}//package com.greensock.plugins
Section 19
//GlowFilterPlugin (com.greensock.plugins.GlowFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout"];
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 20
//HexColorsPlugin (com.greensock.plugins.HexColorsPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps(_arg1:Object):void{
var _local2:int = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
}
}//package com.greensock.plugins
Section 21
//RemoveTintPlugin (com.greensock.plugins.RemoveTintPlugin)
package com.greensock.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package com.greensock.plugins
Section 22
//RoundPropsPlugin (com.greensock.plugins.RoundPropsPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const API:Number = 1;
public function RoundPropsPlugin(){
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package com.greensock.plugins
Section 23
//ShortRotationPlugin (com.greensock.plugins.ShortRotationPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const API:Number = 1;
public function ShortRotationPlugin(){
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
if (typeof(_arg2) == "number"){
return (false);
};
for (_local4 in _arg2) {
initRotation(_arg1, _local4, _arg1[_local4], ((typeof(_arg2[_local4]))=="number") ? Number(_arg2[_local4]) : (_arg1[_local4] + Number(_arg2[_local4])));
};
return (true);
}
public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
var _local5:Number = ((_arg4 - _arg3) % 360);
if (((_arg4 - _arg3) % 360) != (_local5 % 180)){
_local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360);
};
addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package com.greensock.plugins
Section 24
//TintPlugin (com.greensock.plugins.TintPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.geom.*;
import com.greensock.core.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _transform:Transform;
protected var _ignoreAlpha:Boolean;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.vars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_transform.colorTransform = _ct;
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local4:String;
_transform = _arg1.transform;
_ct = _transform.colorTransform;
var _local3:int = _props.length;
while (_local3--) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new PropTween(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
};
}
}
}//package com.greensock.plugins
Section 25
//TransformMatrixPlugin (com.greensock.plugins.TransformMatrixPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.geom.*;
public class TransformMatrixPlugin extends TweenPlugin {
protected var _dChange:Number;
protected var _txStart:Number;
protected var _cStart:Number;
protected var _matrix:Matrix;
protected var _tyStart:Number;
protected var _aStart:Number;
protected var _angleChange:Number;// = 0
protected var _transform:Transform;
protected var _aChange:Number;
protected var _bChange:Number;
protected var _tyChange:Number;
protected var _txChange:Number;
protected var _cChange:Number;
protected var _dStart:Number;
protected var _bStart:Number;
public static const API:Number = 1;
private static const _DEG2RAD:Number = 0.0174532925199433;
private static const _RAD2DEG:Number = 57.2957795130823;
public function TransformMatrixPlugin(){
this.propName = "transformMatrix";
this.overwriteProps = ["x", "y", "scaleX", "scaleY", "rotation", "transformMatrix", "transformAroundPoint", "transformAroundCenter"];
}
override public function set changeFactor(_arg1:Number):void{
_matrix.a = (_aStart + (_arg1 * _aChange));
_matrix.b = (_bStart + (_arg1 * _bChange));
_matrix.c = (_cStart + (_arg1 * _cChange));
_matrix.d = (_dStart + (_arg1 * _dChange));
if (_angleChange){
_matrix.rotate((_angleChange * _arg1));
};
_matrix.tx = (_txStart + (_arg1 * _txChange));
_matrix.ty = (_tyStart + (_arg1 * _tyChange));
_transform.matrix = _matrix;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_transform = (_arg1.transform as Transform);
_matrix = _transform.matrix;
var _local4:Matrix = _matrix.clone();
_txStart = _local4.tx;
_tyStart = _local4.ty;
_aStart = _local4.a;
_bStart = _local4.b;
_cStart = _local4.c;
_dStart = _local4.d;
if (("x" in _arg2)){
_txChange = ((typeof(_arg2.x))=="number") ? (_arg2.x - _txStart) : Number(_arg2.x);
} else {
if (("tx" in _arg2)){
_txChange = (_arg2.tx - _txStart);
} else {
_txChange = 0;
};
};
if (("y" in _arg2)){
_tyChange = ((typeof(_arg2.y))=="number") ? (_arg2.y - _tyStart) : Number(_arg2.y);
} else {
if (("ty" in _arg2)){
_tyChange = (_arg2.ty - _tyStart);
} else {
_tyChange = 0;
};
};
_aChange = (("a" in _arg2)) ? (_arg2.a - _aStart) : 0;
_bChange = (("b" in _arg2)) ? (_arg2.b - _bStart) : 0;
_cChange = (("c" in _arg2)) ? (_arg2.c - _cStart) : 0;
_dChange = (("d" in _arg2)) ? (_arg2.d - _dStart) : 0;
if (((((((((((((((("rotation" in _arg2)) || (("scale" in _arg2)))) || (("scaleX" in _arg2)))) || (("scaleY" in _arg2)))) || (("skewX" in _arg2)))) || (("skewY" in _arg2)))) || (("skewX2" in _arg2)))) || (("skewY2" in _arg2)))){
_local7 = Math.sqrt(((_local4.a * _local4.a) + (_local4.b * _local4.b)));
if ((((_local4.a < 0)) && ((_local4.d > 0)))){
_local7 = -(_local7);
};
_local8 = Math.sqrt(((_local4.c * _local4.c) + (_local4.d * _local4.d)));
if ((((_local4.d < 0)) && ((_local4.a > 0)))){
_local8 = -(_local8);
};
_local9 = Math.atan2(_local4.b, _local4.a);
if ((((_local4.a < 0)) && ((_local4.d >= 0)))){
_local9 = (_local9 + ((_local9)<=0) ? Math.PI : -(Math.PI));
};
_local10 = (Math.atan2(-(_matrix.c), _matrix.d) - _local9);
_local11 = (("rotation" in _arg2)) ? ((typeof(_arg2.rotation))=="number") ? (_arg2.rotation * _DEG2RAD) : ((Number(_arg2.rotation) * _DEG2RAD) + _local9) : _local9;
_local12 = (("skewX" in _arg2)) ? ((typeof(_arg2.skewX))=="number") ? (Number(_arg2.skewX) * _DEG2RAD) : ((Number(_arg2.skewX) * _DEG2RAD) + _local10) : 0;
if (("skewY" in _arg2)){
_local13 = ((typeof(_arg2.skewY))=="number") ? (_arg2.skewY * _DEG2RAD) : ((Number(_arg2.skewY) * _DEG2RAD) - _local10);
_local11 = (_local11 + (_local13 + _local10));
_local12 = (_local12 - _local13);
};
if (_local11 != _local9){
if (("rotation" in _arg2)){
_angleChange = (_local11 - _local9);
_local11 = _local9;
} else {
_local4.rotate((_local11 - _local9));
};
};
if (("scale" in _arg2)){
_local5 = (Number(_arg2.scale) / _local7);
_local6 = (Number(_arg2.scale) / _local8);
if (typeof(_arg2.scale) != "number"){
_local5 = (_local5 + 1);
_local6 = (_local6 + 1);
};
} else {
if (("scaleX" in _arg2)){
_local5 = (Number(_arg2.scaleX) / _local7);
if (typeof(_arg2.scaleX) != "number"){
_local5 = (_local5 + 1);
};
};
if (("scaleY" in _arg2)){
_local6 = (Number(_arg2.scaleY) / _local8);
if (typeof(_arg2.scaleY) != "number"){
_local6 = (_local6 + 1);
};
};
};
if (_local12 != _local10){
_local4.c = (-(_local8) * Math.sin((_local12 + _local11)));
_local4.d = (_local8 * Math.cos((_local12 + _local11)));
};
if (("skewX2" in _arg2)){
if (typeof(_arg2.skewX2) == "number"){
_local4.c = Math.tan((0 - (_arg2.skewX2 * _DEG2RAD)));
} else {
_local4.c = (_local4.c + Math.tan((0 - (Number(_arg2.skewX2) * _DEG2RAD))));
};
};
if (("skewY2" in _arg2)){
if (typeof(_arg2.skewY2) == "number"){
_local4.b = Math.tan((_arg2.skewY2 * _DEG2RAD));
} else {
_local4.b = (_local4.b + Math.tan((Number(_arg2.skewY2) * _DEG2RAD)));
};
};
if (_local5){
_local4.a = (_local4.a * _local5);
_local4.b = (_local4.b * _local5);
};
if (_local6){
_local4.c = (_local4.c * _local6);
_local4.d = (_local4.d * _local6);
};
_aChange = (_local4.a - _aStart);
_bChange = (_local4.b - _bStart);
_cChange = (_local4.c - _cStart);
_dChange = (_local4.d - _dStart);
};
return (true);
}
}
}//package com.greensock.plugins
Section 26
//TweenPlugin (com.greensock.plugins.TweenPlugin)
package com.greensock.plugins {
import com.greensock.*;
import com.greensock.core.*;
public class TweenPlugin {
public var activeDisable:Boolean;
protected var _changeFactor:Number;// = 0
protected var _tweens:Array;
public var onDisable:Function;
public var propName:String;
public var round:Boolean;
public var onEnable:Function;
public var priority:int;// = 0
public var overwriteProps:Array;
public var onComplete:Function;
public static const VERSION:Number = 1.31;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(_arg1:Number):void{
var _local3:PropTween;
var _local4:Number;
var _local2:int = _tweens.length;
if (this.round){
while (_local2--) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local3.target[_local3.property] = ((_local4)>0) ? int((_local4 + 0.5)) : int((_local4 - 0.5));
};
} else {
while (_local2--) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
};
};
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (Number(_arg4) - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new PropTween(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function get changeFactor():Number{
return (_changeFactor);
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function killProps(_arg1:Object):void{
var _local2:int = this.overwriteProps.length;
while (_local2--) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
};
_local2 = _tweens.length;
while (_local2--) {
if ((PropTween(_tweens[_local2]).name in _arg1)){
_tweens.splice(_local2, 1);
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
public static function activate(_arg1:Array):Boolean{
var _local3:Object;
TweenLite.onPluginEvent = TweenPlugin.onTweenEvent;
var _local2:int = _arg1.length;
while (_local2--) {
if (_arg1[_local2].hasOwnProperty("API")){
_local3 = new ((_arg1[_local2] as Class));
TweenLite.plugins[_local3.propName] = _arg1[_local2];
};
};
return (true);
}
private static function onTweenEvent(_arg1:String, _arg2:TweenLite):Boolean{
var _local4:Boolean;
var _local5:Array;
var _local6:int;
var _local3:PropTween = _arg2.cachedPT1;
if (_arg1 == "onInit"){
_local5 = [];
while (_local3) {
_local5[_local5.length] = _local3;
_local3 = _local3.nextNode;
};
_local5.sortOn("priority", (Array.NUMERIC | Array.DESCENDING));
_local6 = _local5.length;
while (_local6--) {
PropTween(_local5[_local6]).nextNode = _local5[(_local6 + 1)];
PropTween(_local5[_local6]).prevNode = _local5[(_local6 - 1)];
};
_arg2.cachedPT1 = _local5[0];
} else {
while (_local3) {
if (((_local3.isPlugin) && (_local3.target[_arg1]))){
if (_local3.target.activeDisable){
_local4 = true;
};
var _local7 = _local3.target;
_local7[_arg1]();
};
_local3 = _local3.nextNode;
};
};
return (_local4);
}
}
}//package com.greensock.plugins
Section 27
//VisiblePlugin (com.greensock.plugins.VisiblePlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _initVal:Boolean;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_initVal = _target.visible;
_visible = Boolean(_arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
if ((((_arg1 == 1)) && ((((_tween.cachedDuration == _tween.cachedTime)) || ((_tween.cachedTime == 0)))))){
_target.visible = _visible;
} else {
_target.visible = _initVal;
};
}
}
}//package com.greensock.plugins
Section 28
//VolumePlugin (com.greensock.plugins.VolumePlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
}
}//package com.greensock.plugins
Section 29
//OverwriteManager (com.greensock.OverwriteManager)
package com.greensock {
import com.greensock.core.*;
public class OverwriteManager {
public static const ALL_ONSTART:int = 4;
public static const CONCURRENT:int = 3;
public static const ALL_IMMEDIATE:int = 1;
public static const PREEXISTING:int = 5;
public static const AUTO:int = 2;
public static const version:Number = 6;
public static const NONE:int = 0;
public static var enabled:Boolean;
public static var mode:int;
public static function getGlobalPaused(_arg1:TweenCore):Boolean{
while (_arg1) {
if (_arg1.cachedPaused){
return (true);
};
_arg1 = _arg1.timeline;
};
return (false);
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 11.099994){
throw (new Error("Warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com."));
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Object, _arg3:Array, _arg4:uint):Boolean{
var _local5:int;
var _local6:Boolean;
var _local7:TweenLite;
var _local13:uint;
var _local14:Number;
var _local15:Number;
var _local16:TweenCore;
var _local17:Number;
var _local18:SimpleTimeline;
if (_arg4 >= 4){
_local13 = _arg3.length;
_local5 = 0;
while (_local5 < _local13) {
_local7 = _arg3[_local5];
if (_local7 != _arg1){
if (_local7.setEnabled(false, false)){
_local6 = true;
};
} else {
if (_arg4 == 5){
break;
};
};
_local5++;
};
return (_local6);
};
var _local8:Number = _arg1.startTime;
var _local9:Array = [];
var _local10:Array = [];
var _local11:uint;
var _local12:uint;
_local5 = _arg3.length;
while (_local5--) {
_local7 = _arg3[_local5];
if ((((_local7 == _arg1)) || (_local7.gc))){
} else {
if (_local7.timeline != _arg1.timeline){
if (!getGlobalPaused(_local7)){
var _temp1 = _local11;
_local11 = (_local11 + 1);
var _local19 = _temp1;
_local10[_local19] = _local7;
};
} else {
if ((((((_local7.startTime <= _local8)) && (((_local7.startTime + _local7.totalDuration) > _local8)))) && (!(getGlobalPaused(_local7))))){
var _temp2 = _local12;
_local12 = (_local12 + 1);
_local19 = _temp2;
_local9[_local19] = _local7;
};
};
};
};
if (_local11 != 0){
_local14 = _arg1.cachedTimeScale;
_local15 = _local8;
_local18 = _arg1.timeline;
while (_local18) {
_local14 = (_local14 * _local18.cachedTimeScale);
_local15 = (_local15 + _local18.startTime);
_local18 = _local18.timeline;
};
_local8 = (_local14 * _local15);
_local5 = _local11;
while (_local5--) {
_local16 = _local10[_local5];
_local14 = _local16.cachedTimeScale;
_local15 = _local16.startTime;
_local18 = _local16.timeline;
while (_local18) {
_local14 = (_local14 * _local18.cachedTimeScale);
_local15 = (_local15 + _local18.startTime);
_local18 = _local18.timeline;
};
_local17 = (_local14 * _local15);
if ((((_local17 <= _local8)) && (((((_local17 + (_local16.totalDuration * _local14)) > _local8)) || ((_local16.cachedDuration == 0)))))){
var _temp3 = _local12;
_local12 = (_local12 + 1);
_local19 = _temp3;
_local9[_local19] = _local16;
};
};
};
if (_local12 == 0){
return (_local6);
};
_local5 = _local12;
if (_arg4 == 2){
while (_local5--) {
_local7 = _local9[_local5];
if (_local7.killVars(_arg2)){
_local6 = true;
};
if ((((_local7.cachedPT1 == null)) && (_local7.initted))){
_local7.setEnabled(false, false);
};
};
} else {
while (_local5--) {
if (TweenLite(_local9[_local5]).setEnabled(false, false)){
_local6 = true;
};
};
};
return (_local6);
}
}
}//package com.greensock
Section 30
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.events.*;
import flash.display.*;
import com.greensock.core.*;
import flash.utils.*;
import com.greensock.plugins.*;
public class TweenLite extends TweenCore {
protected var _hasPlugins:Boolean;
public var propTweenLookup:Object;
public var cachedPT1:PropTween;
protected var _overwrite:uint;
protected var _ease:Function;
public var target:Object;
public var ratio:Number;// = 0
protected var _overwrittenProps:Object;
protected var _notifyPluginsOfEnabled:Boolean;
public static const version:Number = 11.3;
public static var rootTimeline:SimpleTimeline;
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var rootFramesTimeline:SimpleTimeline;
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var masterList:Dictionary = new Dictionary(false);
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
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, roundProps: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);
this.target = _arg1;
if ((((this.target is TweenCore)) && (("timeScale" in this.vars)))){
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 easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
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))))) && (!(_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){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
};
}
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 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--) {
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("onInit", 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;
}
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 (_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){
_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 = {};
}
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 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--) {
_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];
};
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenLite(_arg1, _arg2, _arg3));
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (1 - (_arg1 / _arg4));
return ((1 - (_arg1 * _arg1)));
}
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++;
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--) {
if (TweenLite(_local4[_local5]).gc){
_local4.splice(_local5, 1);
};
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.greensock
Section 31
//TweenMax (com.greensock.TweenMax)
package com.greensock {
import flash.events.*;
import flash.display.*;
import com.greensock.core.*;
import flash.utils.*;
import com.greensock.plugins.*;
import com.greensock.events.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _cyclesComplete:uint;// = 0
protected var _dispatcher:EventDispatcher;
protected var _hasUpdateListener:Boolean;
protected var _easeType:uint;
protected var _repeatDelay:Number;// = 0
public var yoyo:Boolean;
protected var _easePower:uint;
protected var _repeat:int;// = 0
public static const version:Number = 11.2;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(2);
;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (TweenLite.version < 11.2){
throw (new Error("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com."));
};
this.yoyo = Boolean(this.vars.yoyo);
_repeat = ((this.vars.repeat) || (0));
_repeatDelay = ((this.vars.repeatDelay) || (0));
this.cacheIsDirty = true;
if (((((((((((this.vars.onCompleteListener) || (this.vars.onInitListener))) || (this.vars.onUpdateListener))) || (this.vars.onStartListener))) || (this.vars.onRepeatListener))) || (this.vars.onReverseCompleteListener))){
initDispatcher();
if ((((_arg2 == 0)) && ((_delay == 0)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
};
};
if (((("timeScale" in this.vars)) && (!((this.target is TweenCore))))){
this.cachedTimeScale = this.vars.timeScale;
};
}
public function dispatchEvent(_arg1:Event):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.dispatchEvent(_arg1));
}
public function set timeScale(_arg1:Number):void{
if (_arg1 == 0){
_arg1 = 0.0001;
};
var _local2:Number = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
this.cachedStartTime = (_local2 - (((_local2 - this.cachedStartTime) * this.cachedTimeScale) / _arg1));
this.cachedTimeScale = _arg1;
setDirtyCache(false);
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
var _local10:Number;
var _local11:uint;
var _local12:Number;
var _local4:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
var _local5:Number = this.cachedTime;
if (_arg1 >= _local4){
this.cachedTotalTime = _local4;
this.cachedTime = this.cachedDuration;
this.ratio = 1;
_local6 = true;
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
_arg3 = true;
_local6 = true;
};
_rawPrevTime = _arg1;
};
};
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local6 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
_local8 = true;
};
};
if (_repeat != 0){
_local10 = (this.cachedDuration + _repeatDelay);
if (_local6){
if (((this.yoyo) && ((_repeat % 2)))){
this.cachedTime = (this.ratio = 0);
};
} else {
if (_arg1 > 0){
if (_cyclesComplete != (_cyclesComplete = int((this.cachedTotalTime / _local10)))){
_local7 = true;
};
this.cachedTime = (((this.cachedTotalTime / _local10) - _cyclesComplete) * _local10);
if (((this.yoyo) && ((_cyclesComplete % 2)))){
this.cachedTime = (this.cachedDuration - this.cachedTime);
} else {
if (this.cachedTime >= this.cachedDuration){
this.cachedTime = this.cachedDuration;
this.ratio = 1;
_local8 = false;
};
};
if (this.cachedTime <= 0){
this.cachedTime = (this.ratio = 0);
_local8 = false;
};
};
};
};
if ((((_local5 == this.cachedTime)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if (_local8){
if (_easeType){
_local11 = _easePower;
_local12 = (this.cachedTime / this.cachedDuration);
if (_easeType == 2){
_local12 = (1 - _local12);
this.ratio = _local12;
while (_local11--) {
this.ratio = (_local12 * this.ratio);
};
this.ratio = (1 - this.ratio);
} else {
if (_easeType == 1){
this.ratio = _local12;
while (_local11--) {
this.ratio = (_local12 * this.ratio);
};
} else {
if (_local12 < 0.5){
_local12 = (_local12 * 2);
this.ratio = _local12;
while (_local11--) {
this.ratio = (_local12 * this.ratio);
};
this.ratio = (this.ratio * 0.5);
} else {
_local12 = ((1 - _local12) * 2);
this.ratio = _local12;
while (_local11--) {
this.ratio = (_local12 * this.ratio);
};
this.ratio = (1 - (0.5 * this.ratio));
};
};
};
} else {
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if ((((((_local5 == 0)) && (!((this.cachedTotalTime == 0))))) && (!(_arg2)))){
if (this.vars.onStart){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
};
};
var _local9:PropTween = this.cachedPT1;
while (_local9) {
_local9.target[_local9.property] = (_local9.start + (this.ratio * _local9.change));
_local9 = _local9.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (((_hasUpdateListener) && (!(_arg2)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
};
if (_local6){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
} else {
if (((_local7) && (!(_arg2)))){
if (this.vars.onRepeat){
this.vars.onRepeat.apply(null, this.vars.onRepeatParams);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT));
};
};
};
}
override public function set totalDuration(_arg1:Number):void{
if (_repeat == -1){
return;
};
this.duration = ((_arg1 - (_repeat * _repeatDelay)) / (_repeat + 1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if (_arg1 == TweenEvent.UPDATE){
_hasUpdateListener = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
protected function insertPropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String, _arg6:Boolean, _arg7:PropTween):PropTween{
var _local9:Array;
var _local10:int;
var _local8:PropTween = new PropTween(_arg1, _arg2, _arg3, ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4), _arg5, _arg6, _arg7);
if (((_arg6) && ((_arg5 == "_MULTIPLE_")))){
_local9 = _arg1.overwriteProps;
_local10 = _local9.length;
while (_local10--) {
this.propTweenLookup[_local9[_local10]] = _local8;
};
} else {
this.propTweenLookup[_arg5] = _local8;
};
return (_local8);
}
override protected function init():void{
var _local1:TweenMax;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:Array;
var _local6:Object;
var _local7:PropTween;
var _local8:PropTween;
var _local9:int;
if (this.vars.startAt){
this.vars.startAt.overwrite = 0;
this.vars.startAt.immediateRender = true;
_local1 = new TweenMax(this.target, 0, this.vars.startAt);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.INIT));
};
super.init();
if ((_ease in fastEaseLookup)){
_easeType = fastEaseLookup[_ease][0];
_easePower = fastEaseLookup[_ease][1];
};
if (((!((this.vars.roundProps == null))) && (("roundProps" in TweenLite.plugins)))){
_local5 = this.vars.roundProps;
_local9 = _local5.length;
while (_local9--) {
_local3 = _local5[_local9];
_local8 = this.cachedPT1;
while (_local8) {
if (_local8.name == _local3){
if (_local8.isPlugin){
_local8.target.round = true;
} else {
if (_local6 == null){
_local6 = new TweenLite.plugins.roundProps();
_local6.add(_local8.target, _local3, _local8.start, _local8.change);
_hasPlugins = true;
_local7 = insertPropTween(_local6, "changeFactor", 0, 1, "_MULTIPLE_", true, this.cachedPT1);
this.cachedPT1 = _local7;
} else {
_local6.add(_local8.target, _local3, _local8.start, _local8.change);
};
this.removePropTween(_local8);
this.propTweenLookup[_local3] = _local7;
};
} else {
if (((((_local8.isPlugin) && ((_local8.name == "_MULTIPLE_")))) && (!(_local8.target.round)))){
_local4 = ((" " + _local8.target.overwriteProps.join(" ")) + " ");
if (_local4.indexOf(((" " + _local3) + " ")) != -1){
_local8.target.round = true;
};
};
};
_local8 = _local8.nextNode;
};
};
};
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local4:Object = {};
_local4[_arg1] = _arg2;
updateTo(_local4, !(_arg3));
}
public function willTrigger(_arg1:String):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.willTrigger(_arg1));
}
public function hasEventListener(_arg1:String):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.hasEventListener(_arg1));
}
protected function initDispatcher():void{
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
};
if ((this.vars.onInitListener is Function)){
_dispatcher.addEventListener(TweenEvent.INIT, this.vars.onInitListener, false, 0, true);
};
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
_hasUpdateListener = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
if ((this.vars.onRepeatListener is Function)){
_dispatcher.addEventListener(TweenEvent.REPEAT, this.vars.onRepeatListener, false, 0, true);
};
if ((this.vars.onReverseCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.REVERSE_COMPLETE, this.vars.onReverseCompleteListener, false, 0, true);
};
}
public function set currentProgress(_arg1:Number):void{
if (_cyclesComplete == 0){
setTotalTime((this.duration * _arg1), false);
} else {
setTotalTime(((this.duration * _arg1) + (_cyclesComplete * this.cachedDuration)), false);
};
}
public function get totalProgress():Number{
return ((this.cachedTotalTime / this.totalDuration));
}
public function set totalProgress(_arg1:Number):void{
setTotalTime((this.totalDuration * _arg1), false);
}
protected function removePropTween(_arg1:PropTween):Boolean{
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (this.cachedPT1 == _arg1){
this.cachedPT1 = _arg1.nextNode;
};
};
if (((_arg1.isPlugin) && (_arg1.target.onDisable))){
_arg1.target.onDisable();
if (_arg1.target.activeDisable){
return (true);
};
};
return (false);
}
public function get currentProgress():Number{
return ((this.cachedTime / this.duration));
}
public function get repeat():int{
return (_repeat);
}
public function updateTo(_arg1:Object, _arg2:Boolean=false):void{
var _local4:String;
var _local5:Number;
var _local6:PropTween;
var _local7:Number;
var _local3:Number = this.ratio;
if (((((_arg2) && (!((this.timeline == null))))) && ((this.cachedStartTime < this.timeline.cachedTime)))){
this.cachedStartTime = this.timeline.cachedTime;
this.setDirtyCache(false);
if (this.gc){
this.setEnabled(true, false);
} else {
this.timeline.addChild(this);
};
};
for (_local4 in _arg1) {
this.vars[_local4] = _arg1[_local4];
};
if (this.initted){
this.initted = false;
if (!_arg2){
init();
if (((((!(_arg2)) && ((this.cachedTime > 0)))) && ((this.cachedTime < this.cachedDuration)))){
_local5 = (1 / (1 - _local3));
_local6 = this.cachedPT1;
while (_local6) {
_local7 = (_local6.start + _local6.change);
_local6.change = (_local6.change * _local5);
_local6.start = (_local7 - _local6.change);
_local6 = _local6.nextNode;
};
};
};
};
}
override public function set currentTime(_arg1:Number):void{
if (_cyclesComplete == 0){
} else {
if (((this.yoyo) && (((_cyclesComplete % 2) == 1)))){
_arg1 = ((this.duration - _arg1) + (_cyclesComplete * (this.cachedDuration + _repeatDelay)));
} else {
_arg1 = (_arg1 + (_cyclesComplete * (this.duration + _repeatDelay)));
};
};
setTotalTime(_arg1, false);
}
public function get repeatDelay():Number{
return (_repeatDelay);
}
public function killProperties(_arg1:Array):void{
var _local2:Object = {};
var _local3:int = _arg1.length;
while (_local3--) {
_local2[_arg1[_local3]] = true;
};
killVars(_local2);
}
public function set repeatDelay(_arg1:Number):void{
_repeatDelay = _arg1;
setDirtyCache(true);
}
public function set repeat(_arg1:int):void{
_repeat = _arg1;
setDirtyCache(true);
}
override public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
super.complete(_arg1, _arg2);
if (((!(_arg2)) && (_dispatcher))){
if ((((this.cachedTotalTime == this.cachedTotalDuration)) && (!(this.cachedReversed)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
} else {
if (((this.cachedReversed) && ((this.cachedTotalTime == 0)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE));
};
};
};
}
override public function invalidate():void{
this.yoyo = Boolean((this.vars.yoyo == true));
_repeat = ((this.vars.repeat) || (0));
_repeatDelay = ((this.vars.repeatDelay) || (0));
_hasUpdateListener = false;
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
};
setDirtyCache(true);
super.invalidate();
}
public function get timeScale():Number{
return (this.cachedTimeScale);
}
override public function get totalDuration():Number{
if (this.cacheIsDirty){
this.cachedTotalDuration = ((_repeat)==-1) ? 999999999999 : ((this.cachedDuration * (_repeat + 1)) + (_repeatDelay * _repeat));
this.cacheIsDirty = false;
};
return (this.cachedTotalDuration);
}
public static function set globalTimeScale(_arg1:Number):void{
if (_arg1 == 0){
_arg1 = 0.0001;
};
if (TweenLite.rootTimeline == null){
TweenLite.to({}, 0, {});
};
var _local2:SimpleTimeline = TweenLite.rootTimeline;
var _local3:Number = (getTimer() * 0.001);
_local2.cachedStartTime = (_local3 - (((_local3 - _local2.cachedStartTime) * _local2.cachedTimeScale) / _arg1));
_local2 = TweenLite.rootFramesTimeline;
_local3 = TweenLite.rootFrame;
_local2.cachedStartTime = (_local3 - (((_local3 - _local2.cachedStartTime) * _local2.cachedTimeScale) / _arg1));
TweenLite.rootFramesTimeline.cachedTimeScale = (TweenLite.rootTimeline.cachedTimeScale = _arg1);
}
public static function fromTo(_arg1:Object, _arg2:Number, _arg3:Object, _arg4:Object):TweenMax{
_arg4.startAt = _arg3;
if (_arg3.immediateRender){
_arg4.immediateRender = true;
};
return (new TweenMax(_arg1, _arg2, _arg4));
}
public static function allFromTo(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Object, _arg5:Number=0, _arg6:Function=null, _arg7:Array=null):Array{
_arg4.startAt = _arg3;
if (_arg3.immediateRender){
_arg4.immediateRender = true;
};
return (allTo(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7));
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=true):void{
changePause(true, _arg1, _arg2);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:int;
var _local5:uint;
var _local2:Array = masterList[_arg1];
var _local3:Array = [];
if (_local2){
_local4 = _local2.length;
_local5 = 0;
while (_local4--) {
if (!_local2[_local4].gc){
var _temp1 = _local5;
_local5 = (_local5 + 1);
var _local6 = _temp1;
_local3[_local6] = _local2[_local4];
};
};
};
return (_local3);
}
public static function get globalTimeScale():Number{
return (((TweenLite.rootTimeline)==null) ? 1 : TweenLite.rootTimeline.cachedTimeScale);
}
public static function killChildTweensOf(_arg1:DisplayObjectContainer, _arg2:Boolean=false):void{
var _local4:Object;
var _local5:DisplayObjectContainer;
var _local3:Array = getAllTweens();
var _local6:int = _local3.length;
while (_local6--) {
_local4 = _local3[_local6].target;
if ((_local4 is DisplayObject)){
_local5 = _local4.parent;
while (_local5) {
if (_local5 == _arg1){
if (_arg2){
_local3[_local6].complete(false);
} else {
_local3[_local6].setEnabled(false, false);
};
};
_local5 = _local5.parent;
};
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local4:TweenLite;
var _local2:Array = getTweensOf(_arg1);
var _local3:int = _local2.length;
while (_local3--) {
_local4 = _local2[_local3];
if (((_local4.active) || ((((_local4.cachedStartTime == _local4.timeline.cachedTime)) && (_local4.timeline.active))))){
return (true);
};
};
return (false);
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = _local4.length;
while (_local6--) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
} else {
_local4[_local6].setEnabled(false, false);
};
};
};
}
private static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = _local4.length;
while (_local6--) {
_local5 = (TweenLite(_local4[_local6]).target == TweenLite(_local4[_local6]).vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
TweenCore(_local4[_local6]).paused = _arg1;
};
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function allFrom(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null):Array{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (allTo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6));
}
public static function getAllTweens():Array{
var _local4:Array;
var _local5:int;
var _local1:Dictionary = masterList;
var _local2:uint;
var _local3:Array = [];
for each (_local4 in _local1) {
_local5 = _local4.length;
while (_local5--) {
if (!TweenLite(_local4[_local5]).gc){
var _temp1 = _local2;
_local2 = (_local2 + 1);
var _local8 = _temp1;
_local3[_local8] = _local4[_local5];
};
};
};
return (_local3);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=true):void{
changePause(false, _arg1, _arg2);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function allTo(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null):Array{
var i:int;
var varsDup:Object;
var p:String;
var onCompleteProxy:Function;
var onCompleteParamsProxy:Array;
var targets = _arg1;
var duration = _arg2;
var vars = _arg3;
var stagger = _arg4;
var onCompleteAll = _arg5;
var onCompleteAllParams = _arg6;
var l:uint = targets.length;
var a:Array = [];
var curDelay:Number = ((vars.delay) || (0));
onCompleteProxy = vars.onComplete;
onCompleteParamsProxy = vars.onCompleteParams;
var lastIndex:int = ((stagger)<=0) ? 0 : (l - 1);
i = 0;
while (i < l) {
varsDup = {};
for (p in vars) {
varsDup[p] = vars[p];
};
varsDup.delay = curDelay;
if ((((i == lastIndex)) && (!((onCompleteAll == null))))){
varsDup.onComplete = function ():void{
if (onCompleteProxy != null){
onCompleteProxy.apply(null, onCompleteParamsProxy);
};
onCompleteAll.apply(null, onCompleteAllParams);
};
};
a[a.length] = new TweenMax(targets[i], duration, varsDup);
curDelay = (curDelay + stagger);
i = (i + 1);
};
return (a);
}
TweenPlugin.activate([AutoAlphaPlugin, EndArrayPlugin, FramePlugin, RemoveTintPlugin, TintPlugin, VisiblePlugin, VolumePlugin, BevelFilterPlugin, BezierPlugin, BezierThroughPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, ColorTransformPlugin, DropShadowFilterPlugin, FrameLabelPlugin, GlowFilterPlugin, HexColorsPlugin, RoundPropsPlugin, ShortRotationPlugin, {}]);
}
}//package com.greensock
Section 32
//HitTest (com.HitTest)
package com {
import flash.display.*;
import flash.geom.*;
public class HitTest {
protected static function getDrawMatrix(_arg1:DisplayObject, _arg2:Rectangle, _arg3:Number):Matrix{
var _local4:Point;
var _local5:Matrix;
var _local6:Matrix = _arg1.root.transform.concatenatedMatrix;
_local4 = _arg1.localToGlobal(new Point());
_local5 = _arg1.transform.concatenatedMatrix;
_local5.tx = (_local4.x - _arg2.x);
_local5.ty = (_local4.y - _arg2.y);
_local5.a = (_local5.a / _local6.a);
_local5.d = (_local5.d / _local6.d);
if (_arg3 != 1){
_local5.scale(_arg3, _arg3);
};
return (_local5);
}
public static function complexHitTestObject(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Number=1):Boolean{
return (!((complexIntersectionRectangle(_arg1, _arg2, _arg3).width == 0)));
}
public static function complexIntersectionRectangle(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Number=1):Rectangle{
if (_arg3 <= 0){
throw (new Error("ArgumentError: Error #5001: Invalid value for accurracy", 5001));
};
if (!_arg1.hitTestObject(_arg2)){
return (new Rectangle());
};
var _local4:Rectangle = intersectionRectangle(_arg1, _arg2);
if (((((_local4.width * _arg3) < 1)) || (((_local4.height * _arg3) < 1)))){
return (new Rectangle());
};
var _local5:BitmapData = new BitmapData((_local4.width * _arg3), (_local4.height * _arg3), false, 0);
_local5.draw(_arg1, HitTest.getDrawMatrix(_arg1, _local4, _arg3), new ColorTransform(1, 1, 1, 1, 0xFF, -255, -255, 0xFF));
_local5.draw(_arg2, HitTest.getDrawMatrix(_arg2, _local4, _arg3), new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0xFF), BlendMode.DIFFERENCE);
var _local6:Rectangle = _local5.getColorBoundsRect(4294967295, 4278255615);
_local5.dispose();
if (_arg3 != 1){
_local6.x = (_local6.x / _arg3);
_local6.y = (_local6.y / _arg3);
_local6.width = (_local6.width / _arg3);
_local6.height = (_local6.height / _arg3);
};
_local6.x = (_local6.x + _local4.x);
_local6.y = (_local6.y + _local4.y);
return (_local6);
}
public static function intersectionRectangle(_arg1:DisplayObject, _arg2:DisplayObject):Rectangle{
if (((((!(_arg1.root)) || (!(_arg2.root)))) || (!(_arg1.hitTestObject(_arg2))))){
return (new Rectangle());
};
var _local3:Rectangle = _arg1.getBounds(_arg1.root);
var _local4:Rectangle = _arg2.getBounds(_arg2.root);
var _local5:Rectangle = new Rectangle();
_local5.x = Math.max(_local3.x, _local4.x);
_local5.y = Math.max(_local3.y, _local4.y);
_local5.width = Math.min(((_local3.x + _local3.width) - _local5.x), ((_local4.x + _local4.width) - _local5.x));
_local5.height = Math.min(((_local3.y + _local3.height) - _local5.y), ((_local4.y + _local4.height) - _local5.y));
return (_local5);
}
}
}//package com
Section 33
//KeyCodes (com.KeyCodes)
package com {
public class KeyCodes {
public static const NumpadMinus:int = 109;
public static const RightBrace:int = 221;
public static const Question:int = 191;
public static const NumpadSlash:int = 111;
public static const Equal:int = 187;
public static const keyNames:Array = new Array();
public static const Left:int = 37;
public static const Control:int = 17;
public static const A:int = 65;
public static const B:int = 66;
public static const C:int = 67;
public static const D:int = 68;
public static const E:int = 69;
public static const F:int = 70;
public static const G:int = 71;
public static const H:int = 72;
public static const I:int = 73;
public static const J:int = 74;
public static const K:int = 75;
public static const L:int = 76;
public static const M:int = 77;
public static const N:int = 78;
public static const O:int = 79;
public static const P:int = 80;
public static const Q:int = 81;
public static const S:int = 83;
public static const T:int = 84;
public static const U:int = 85;
public static const V:int = 86;
public static const W:int = 87;
public static const X:int = 88;
public static const R:int = 82;
public static const Z:int = 90;
public static const NumpadStar:int = 106;
public static const Y:int = 89;
public static const Numpad0:int = 96;
public static const Numpad1:int = 97;
public static const Numpad2:int = 98;
public static const Numpad3:int = 99;
public static const Numpad4:int = 100;
public static const Numpad5:int = 101;
public static const Numpad6:int = 102;
public static const Numpad7:int = 103;
public static const Numpad8:int = 104;
public static const Numpad9:int = 105;
public static const Shift:int = 16;
public static const ScrLck:int = 145;
public static const Spacebar:int = 32;
public static const Tab:int = 9;
public static const Backspace:int = 8;
public static const SemiColon:int = 186;
public static const LeftBrace:int = 219;
public static const Minus:int = 189;
public static const Keyb0:int = 48;
public static const Keyb2:int = 50;
public static const Keyb4:int = 52;
public static const Keyb6:int = 54;
public static const Keyb1:int = 49;
public static const Keyb3:int = 51;
public static const Keyb5:int = 53;
public static const Keyb7:int = 55;
public static const Keyb9:int = 57;
public static const NumpadPlus:int = 107;
public static const Esc:int = 27;
public static const F1:int = 112;
public static const Keyb8:int = 56;
public static const F5:int = 116;
public static const F7:int = 118;
public static const F2:int = 113;
public static const F4:int = 115;
public static const F6:int = 117;
public static const Enter:int = 13;
public static const F8:int = 119;
public static const F9:int = 120;
public static const NumpadPeriod:int = 110;
public static const F3:int = 114;
public static const NumLck:int = 144;
public static const PauseBreak:int = 19;
public static const Delete:int = 46;
public static const Comma:int = 188;
public static const Down:int = 40;
public static const End:int = 35;
public static const Insert:int = 45;
public static const Period:int = 190;
public static const PageUp:int = 33;
public static const CapsLock:int = 20;
public static const F11:int = 122;
public static const F12:int = 123;
public static const F13:int = 124;
public static const F14:int = 125;
public static const F15:int = 126;
public static const BackQuote:int = 192;
public static const Pipe:int = 220;
public static const Up:int = 38;
public static const PageDown:int = 34;
public static const SingleQuote:int = 222;
public static const Right:int = 39;
public static const Home:int = 36;
keyNames[A] = "A";
keyNames[B] = "B";
keyNames[C] = "C";
keyNames[D] = "D";
keyNames[E] = "E";
keyNames[F] = "F";
keyNames[G] = "G";
keyNames[H] = "H";
keyNames[I] = "I";
keyNames[J] = "J";
keyNames[K] = "K";
keyNames[L] = "L";
keyNames[M] = "M";
keyNames[N] = "N";
keyNames[O] = "O";
keyNames[P] = "P";
keyNames[Q] = "Q";
keyNames[R] = "R";
keyNames[S] = "S";
keyNames[T] = "T";
keyNames[U] = "U";
keyNames[V] = "V";
keyNames[W] = "W";
keyNames[X] = "X";
keyNames[Y] = "Y";
keyNames[Z] = "Z";
keyNames[Keyb0] = "0";
keyNames[Keyb1] = "1";
keyNames[Keyb2] = "2";
keyNames[Keyb3] = "3";
keyNames[Keyb4] = "4";
keyNames[Keyb5] = "5";
keyNames[Keyb6] = "6";
keyNames[Keyb7] = "7";
keyNames[Keyb8] = "8";
keyNames[Keyb9] = "9";
keyNames[Numpad0] = "Numpad 0";
keyNames[Numpad1] = "Numpad 1";
keyNames[Numpad2] = "Numpad 2";
keyNames[Numpad3] = "Numpad 3";
keyNames[Numpad4] = "Numpad 4";
keyNames[Numpad5] = "Numpad 5";
keyNames[Numpad6] = "Numpad 6";
keyNames[Numpad7] = "Numpad 7";
keyNames[Numpad8] = "Numpad 8";
keyNames[Numpad9] = "Numpad 9";
keyNames[NumpadStar] = "Numpad *";
keyNames[NumpadPlus] = "Numpad +";
keyNames[NumpadMinus] = "Numpad -";
keyNames[NumpadPeriod] = "Numpad .";
keyNames[NumpadSlash] = "Numpad /";
keyNames[F1] = "F1";
keyNames[F2] = "F2";
keyNames[F3] = "F3";
keyNames[F4] = "F4";
keyNames[F5] = "F5";
keyNames[F6] = "F6";
keyNames[F7] = "F7";
keyNames[F8] = "F8";
keyNames[F9] = "F9";
keyNames[F11] = "F11";
keyNames[F12] = "F12";
keyNames[F13] = "F13";
keyNames[F14] = "F14";
keyNames[F15] = "F15";
keyNames[Backspace] = "Backspace";
keyNames[Tab] = "Tab";
keyNames[Enter] = "Enter";
keyNames[Shift] = "Shift";
keyNames[Control] = "Control";
keyNames[PauseBreak] = "Pause/Break";
keyNames[CapsLock] = "Caps Lock";
keyNames[Esc] = "Esc";
keyNames[Spacebar] = "Spacebar";
keyNames[PageUp] = "Page Up";
keyNames[PageDown] = "Page Down";
keyNames[End] = "End";
keyNames[Home] = "Home";
keyNames[Left] = "Left Arrow";
keyNames[Up] = "Up Arrow";
keyNames[Right] = "Right Arrow";
keyNames[Down] = "Down Arrow";
keyNames[Insert] = "Insert";
keyNames[Delete] = "Delete";
keyNames[NumLck] = "NumLck";
keyNames[ScrLck] = "ScrLck";
keyNames[SemiColon] = ";";
keyNames[Equal] = "=";
keyNames[Comma] = ",";
keyNames[Minus] = "-";
keyNames[Period] = ".";
keyNames[Question] = "?";
keyNames[BackQuote] = "`";
keyNames[LeftBrace] = "[";
keyNames[Pipe] = "|";
keyNames[RightBrace] = "]";
keyNames[SingleQuote] = "'";
}
}//package com
Section 34
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var cpmstarLoader:Loader;
private var contentspotid:String;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
private function addedHandler(_arg1:Event):void{
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
var _local2 = "http://server.cpmstar.com/adviewas3.swf";
var _local3:DisplayObjectContainer = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
}
}//package CPMStar
Section 35
//Boss (GamePlay.Boss)
package GamePlay {
import flash.display.*;
import flash.utils.*;
public class Boss extends Sprite {
private var currentGun;
public var myGraphic;
public var spread1:int;// = 90
public var amountOfGuns:int;
private var spreadWork1:int;// = 0
public var powerMultiplier:Number;
public var gun10Info:Array;
public var gun0Info:Array;
public var gun1Info:Array;
public var gun2Info:Array;
public var gun3Info:Array;
public var gun4Info:Array;
private var actionCode:int;// = 0
public var gun6Info:Array;
public var gun7Info:Array;
public var gun8Info:Array;
public var gun9Info:Array;
private var graphic1:BossImage1;
private var graphic2:BossImage2;
private var graphic3:BossImage3;
private var graphic4:BossImage4;
private var graphic5:BossImage5;
public var amountOfGunsLeft:int;
public var gun5Info:Array;
private var yEdge:int;
public var createShotSuperArray:Array;
private var i:int;
private var j:int;
private var myParent:Level;
public function Boss(_arg1:Level, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int=0, _arg8:int=0, _arg9:int=0, _arg10:int=0, _arg11:int=0, _arg12:int=0, _arg13:int=0){
var _local16:int;
gun0Info = new Array(0, 0, 0);
gun1Info = new Array(0, 0, 0);
gun2Info = new Array(0, 0, 0);
gun3Info = new Array(0, 0, 0);
gun4Info = new Array(0, 0, 0);
gun5Info = new Array(0, 0, 0);
gun6Info = new Array(0, 0, 0);
gun7Info = new Array(0, 0, 0);
gun8Info = new Array(0, 0, 0);
gun9Info = new Array(0, 0, 0);
gun10Info = new Array(0, 0, 0);
createShotSuperArray = new Array();
super();
myParent = _arg1;
var _local14 = 1;
this.amountOfGuns = (amountOfGunsLeft = _arg4);
while (_local14 <= amountOfGuns) {
switch (_local14){
case 1:
_local16 = _arg5;
break;
case 2:
_local16 = _arg6;
break;
case 3:
_local16 = _arg7;
break;
case 4:
_local16 = _arg8;
break;
case 5:
_local16 = _arg9;
break;
case 6:
_local16 = _arg10;
break;
case 7:
_local16 = _arg11;
break;
case 8:
_local16 = _arg12;
break;
case 9:
_local16 = _arg13;
break;
};
switch (_local16){
case 31:
this[(("gun" + _local14) + "Info")] = [_local16, 25, 4100];
break;
case 41:
this[(("gun" + _local14) + "Info")] = [_local16, 35, 1800];
break;
case 51:
this[(("gun" + _local14) + "Info")] = [_local16, 30, 2800];
break;
case 61:
this[(("gun" + _local14) + "Info")] = [_local16, 25, 1300];
break;
case 81:
this[(("gun" + _local14) + "Info")] = [_local16, 35, 5000];
break;
case 91:
this[(("gun" + _local14) + "Info")] = [_local16, 37, 10000];
break;
};
this[(("gun" + _local14) + "Info")][2] = int((this[(("gun" + _local14) + "Info")][2] * _arg2));
_local14++;
};
yEdge = _arg3;
powerMultiplier = (1 + ((_arg2 - 1) * 0.3));
var _local15:Class = (getDefinitionByName(("BossImage" + _arg2)) as Class);
myGraphic = this[("graphic" + _arg2)];
myGraphic = new (_local15);
addChild(myGraphic);
}
public function updateGun(_arg1:int):void{
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (this[(("gun" + _arg1) + "Info")][2] > 0){
if (this[(("gun" + _arg1) + "Info")][1] > 0){
var _local8 = this[(("gun" + _arg1) + "Info")];
var _local9 = 1;
var _local10 = (_local8[_local9] - 1);
_local8[_local9] = _local10;
} else {
_local2 = ((myGraphic[("gun" + _arg1)].x * myParent.screenProportion) + x);
_local3 = ((myGraphic[("gun" + _arg1)].y * myParent.screenProportion) + y);
switch (this[(("gun" + _arg1) + "Info")][0]){
case 31:
case 91:
this[(("gun" + _arg1) + "Info")][1] = (32 / ((1 / amountOfGunsLeft) + 1));
_local5 = (myParent.hero.x - _local2);
_local6 = (myParent.hero.y - _local3);
myGraphic[("gun" + _arg1)].rotation = (((Math.atan2(_local6, _local5) * 180) / Math.PI) - 90);
break;
case 41:
this[(("gun" + _arg1) + "Info")][1] = (35 / ((1 / amountOfGunsLeft) + 1));
if (spreadWork1 == 0){
if (myGraphic[("gun" + _arg1)].rotation > 45){
myGraphic[("gun" + _arg1)].rotation = (myGraphic[("gun" + _arg1)].rotation - 15);
} else {
spreadWork1 = 1;
};
} else {
if (myGraphic[("gun" + _arg1)].rotation < 135){
myGraphic[("gun" + _arg1)].rotation = (myGraphic[("gun" + _arg1)].rotation + 15);
} else {
spreadWork1 = 0;
};
};
break;
case 51:
this[(("gun" + _arg1) + "Info")][1] = (38 / ((1 / amountOfGunsLeft) + 1));
break;
case 61:
this[(("gun" + _arg1) + "Info")][1] = (25 / ((1 / amountOfGunsLeft) + 1));
break;
case 81:
this[(("gun" + _arg1) + "Info")][1] = (35 / ((1 / amountOfGunsLeft) + 1));
break;
case 91:
this[(("gun" + _arg1) + "Info")][1] = (75 / ((1 / amountOfGunsLeft) + 1));
break;
};
switch (this[(("gun" + _arg1) + "Info")][0]){
case 11:
_local4 = "down";
break;
case 21:
_local4 = "leftDown";
break;
case 22:
_local4 = "down";
break;
case 23:
_local4 = "rightDown";
break;
case 31:
_local4 = "aimed";
break;
case 51:
_local4 = "downWave";
break;
case 41:
case 61:
_local4 = "faced";
break;
case 81:
_local4 = "facedWave";
break;
case 91:
_local4 = "megaLaser";
break;
};
if (_local4 == "megaLaser"){
myParent.createNewMegaLaser(_local2, _local3, (myGraphic[("gun" + _arg1)].rotation + 90), 400);
} else {
_local7 = (1 + (powerMultiplier * 0.2));
myParent.createNewEnemyShot(_local7, _local2, _local3, _local4, myGraphic[("gun" + _arg1)].rotation);
};
};
};
}
public function update():void{
if (actionCode == 0){
if (y < yEdge){
y = (y + 2.8);
myParent.setQualityLevel(2);
} else {
myParent.setQualityLevel(3);
actionCode = 1;
};
} else {
if (powerMultiplier == 2.2){
myParent.setQualityLevel(1);
};
i = 1;
while (i <= amountOfGuns) {
updateGun(i);
i++;
};
};
}
}
}//package GamePlay
Section 36
//Bullet (GamePlay.Bullet)
package GamePlay {
import flash.display.*;
import flash.utils.*;
public class Bullet extends Sprite {
public var type:int;
private var graphic31:BulletImage31;
private var graphic32:BulletImage32;
private var graphic33:BulletImage33;
private var graphic34:BulletImage34;
private var graphic13:BulletImage13;
private var graphic11:BulletImage11;
public var target;
private var angle:Number;
public var speed:Number;
private var graphic12:BulletImage12;
public var ySpeed:Number;// = 0
private var graphic21:BulletImage21;
private var graphic22:BulletImage22;
private var graphic23:BulletImage23;
public var lastEnemy;
private var totalTargetDistance:Number;
public var xSpeed:Number;// = 0
public var damage:Number;
public var halfHeight:Number;
public var valid:Boolean;// = true
public var myParent:Level;
private var xTargetDistance:Number;
private var yTargetDistance:Number;
public function Bullet(_arg1:int, _arg2:int){
type = _arg1;
damage = _arg2;
var _local3:Class = (getDefinitionByName(("BulletImage" + type)) as Class);
this[("graphic" + type)] = new (_local3);
addChild(this[("graphic" + type)]);
halfHeight = (height * 0.5);
}
public function update(_arg1:Number):void{
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if ((((type > 20)) && ((type < 30)))){
if (((((!((target == null))) && ((target.hp > 0)))) && ((y < 150)))){
xTargetDistance = (target.x - x);
yTargetDistance = (target.y - y);
totalTargetDistance = Math.sqrt(((xTargetDistance * xTargetDistance) + (yTargetDistance * yTargetDistance)));
angle = ((Math.atan2(yTargetDistance, xTargetDistance) * 180) / Math.PI);
xSpeed = (xSpeed + ((Math.cos((angle * (Math.PI / 180))) * speed) / 2));
ySpeed = (ySpeed + ((Math.sin((angle * (Math.PI / 180))) * speed) / 2));
xSpeed = (xSpeed * 0.7);
ySpeed = (ySpeed * 0.7);
} else {
if (myParent.arrayOfEnemy.length > 0){
_local2 = 999;
_local3 = (myParent.arrayOfEnemy.length - 1);
while (_local3 > -1) {
_local4 = (myParent.arrayOfEnemy[_local3].x - x);
_local5 = (myParent.arrayOfEnemy[_local3].y - y);
_local6 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local2 > _local6){
_local2 = _local6;
target = myParent.arrayOfEnemy[_local3];
};
_local3--;
};
};
};
rotation = ((Math.atan2(ySpeed, xSpeed) * 180) / Math.PI);
};
if (type > 30){
halfHeight = (height * 0.5);
};
x = (x + (xSpeed * _arg1));
y = (y + (ySpeed * _arg1));
}
}
}//package GamePlay
Section 37
//Enemy (GamePlay.Enemy)
package GamePlay {
import flash.display.*;
import flash.utils.*;
public class Enemy extends Sprite {
private var graphic91:EnemyImage91;
private var graphic92:EnemyImage92;
private var insideFunction:int;
private var graphic51:EnemyImage51;
private var graphic52:EnemyImage52;
private var graphic12:EnemyImage12;
private var graphic11:EnemyImage11;
public var shooter:Boolean;// = false
public var hp:int;
public var mySpeed:Number;
public var realTimeToShot:int;
private var graphic61:EnemyImage61;
private var graphic62:EnemyImage62;
public var howIsShoot:String;// = "down"
private var graphic21:EnemyImage21;
private var graphic22:EnemyImage22;
public var breakIntoPieces:int;
public var piecesType:int;
public var xSpeed:Number;// = 0
public var basicTimeToShot:int;
private var totalDistHero:Number;
public var shootNow:Boolean;// = false
public var type:Number;// = 1
public var halfHeight:Number;
private var graphic71:EnemyImage71;
private var graphic72:EnemyImage72;
private var graphic31:EnemyImage31;
private var graphic32:EnemyImage32;
public var initialHP:int;
public var ySpeed:Number;// = 0
private var xDistHero:Number;
public var breakable:Boolean;// = false
public var halfWidth:Number;
private var yDistHero:Number;
private var graphic81:EnemyImage81;
private var graphic82:EnemyImage82;
private var graphic41:EnemyImage41;
private var graphic42:EnemyImage42;
public var myHero:Hero;
public var dropRate:Number;
private var slower:Number;
public var valid:Boolean;// = true
public var direction:String;
public function Enemy(_arg1:Level, _arg2:int, _arg3:Number=1, _arg4:Number=1){
type = _arg2;
myHero = _arg1.hero;
_arg1.enemiesCreated++;
var _local5:Class = (getDefinitionByName(("EnemyImage" + type)) as Class);
this[("graphic" + type)] = new (_local5);
addChild(this[("graphic" + type)]);
switch (type){
case 11:
hp = 50;
dropRate = 0.25;
break;
case 12:
hp = 100;
dropRate = 0.3;
break;
case 21:
hp = 30;
dropRate = 0.25;
break;
case 22:
hp = 70;
dropRate = 0.3;
break;
case 31:
hp = 180;
dropRate = 0.2;
break;
case 32:
hp = 250;
dropRate = 0.25;
break;
case 41:
hp = 280;
dropRate = 0.32;
break;
case 42:
hp = 350;
dropRate = 0.38;
break;
case 51:
hp = 1000;
dropRate = 0.38;
break;
case 52:
hp = 1200;
dropRate = 0.42;
break;
case 61:
hp = 400;
dropRate = 0.34;
break;
case 62:
hp = 600;
dropRate = 0.38;
break;
case 71:
hp = 720;
dropRate = 0.25;
break;
case 72:
hp = 980;
dropRate = 0.3;
break;
case 81:
hp = 500;
dropRate = 0.25;
break;
case 82:
hp = 750;
dropRate = 0.4;
break;
case 91:
hp = 520;
dropRate = 0.25;
insideFunction = Math.floor((Math.random() * 2));
break;
case 92:
hp = 680;
dropRate = 0.3;
insideFunction = Math.floor((Math.random() * 2));
break;
};
slower = _arg4;
var _local6:Number = ((Math.random() * 0.35) + 0.85);
scaleX = (scaleY = ((_local6 * slower) * (0.9 + (_arg3 * 0.1))));
hp = ((hp * _local6) * _arg3);
initialHP = hp;
updateHalfs();
}
public function aimToHero():void{
xDistHero = (myHero.x - x);
yDistHero = (myHero.y - y);
var _local1:Number = ((Math.atan2(yDistHero, xDistHero) * 180) / Math.PI);
rotation = _local1;
xSpeed = (Math.cos((_local1 * (Math.PI / 180))) * mySpeed);
ySpeed = (Math.sin((_local1 * (Math.PI / 180))) * mySpeed);
updateHalfs();
}
public function update():void{
x = (x + (xSpeed * slower));
y = (y + (ySpeed * slower));
if (shooter){
if (realTimeToShot < 0){
realTimeToShot = basicTimeToShot;
shootNow = true;
} else {
realTimeToShot--;
};
};
switch (type){
case 11:
case 12:
rotation = (rotation + (xSpeed * -4));
break;
case 21:
case 22:
if (y > -150){
if (direction == "left"){
xSpeed = (xSpeed - 0.03);
ySpeed = (ySpeed - 0.03);
rotation = (((Math.atan2(ySpeed, xSpeed) * 180) / Math.PI) - 90);
};
if (direction == "right"){
xSpeed = (xSpeed + 0.03);
ySpeed = (ySpeed - 0.03);
rotation = (((Math.atan2(ySpeed, xSpeed) * 180) / Math.PI) - 90);
};
};
break;
case 31:
case 32:
mySpeed = (mySpeed * 1.02);
xSpeed = (xSpeed * 1.02);
ySpeed = (ySpeed * 1.02);
break;
case 41:
case 42:
xDistHero = (myHero.x - x);
if (xDistHero > 5){
xSpeed = (xSpeed + 0.12);
rotation = ((Math.atan2(ySpeed, xSpeed) * 180) / Math.PI);
};
if (xDistHero < -5){
xSpeed = (xSpeed - 0.12);
rotation = ((Math.atan2(ySpeed, xSpeed) * 180) / Math.PI);
};
break;
case 51:
ySpeed = (ySpeed - 0.09);
xSpeed = 0;
break;
case 52:
ySpeed = (ySpeed - 0.085);
xSpeed = (xSpeed * 1.001);
break;
case 71:
if (alpha < 1){
alpha = (alpha + 0.15);
};
break;
case 81:
if ((hp / initialHP) > 0.1){
hp = (hp + 5);
scaleX = (scaleY = ((slower * hp) / initialHP));
} else {
hp = -50;
};
rotation = (rotation + (xSpeed * -4));
break;
case 82:
if ((hp / initialHP) > 0.1){
hp = (hp + 8);
scaleX = (scaleY = (hp / initialHP));
} else {
hp = -50;
};
rotation = (rotation + (xSpeed * -4));
break;
case 91:
case 92:
if (insideFunction == 0){
if (xSpeed > -6){
xSpeed = (xSpeed - 0.7);
rotation = ((Math.atan2(ySpeed, xSpeed) * 180) / Math.PI);
} else {
insideFunction = 1;
};
} else {
if (xSpeed < 6){
xSpeed = (xSpeed + 0.7);
rotation = ((Math.atan2(ySpeed, xSpeed) * 180) / Math.PI);
} else {
insideFunction = 0;
};
};
ySpeed = (ySpeed * 1.025);
break;
};
}
public function updateHalfs():void{
halfHeight = (height * 0.5);
halfWidth = (width * 0.5);
}
}
}//package GamePlay
Section 38
//EnemyBullet (GamePlay.EnemyBullet)
package GamePlay {
import flash.display.*;
import flash.utils.*;
public class EnemyBullet extends Sprite {
public var halfHeight:Number;
public var xSpeed:Number;// = 0
private var graphic1:EnemyBulletImage1;
private var graphic2:EnemyBulletImage2;
private var graphic3:EnemyBulletImage3;
private var graphic4:EnemyBulletImage4;
public var ySpeed:Number;// = 0
public var damage:Number;
public var valid:Boolean;// = true
public var type:int;
public function EnemyBullet(_arg1:int, _arg2:int){
type = _arg1;
damage = _arg2;
var _local3:Class = (getDefinitionByName(("EnemyBulletImage" + type)) as Class);
this[("graphic" + type)] = new (_local3);
addChild(this[("graphic" + type)]);
halfHeight = (height * 0.5);
}
public function update(_arg1:Number):void{
x = (x + (xSpeed * _arg1));
y = (y + (ySpeed * _arg1));
}
}
}//package GamePlay
Section 39
//FinalBoss (GamePlay.FinalBoss)
package GamePlay {
import flash.display.*;
public class FinalBoss extends Sprite {
public var level:int;// = 1
private var lastAttackCode:int;
public var droppedLoot:int;
private var numberOfAttacks:Array;
private var arrayOfAttack11:Array;
private var arrayOfAttack12:Array;
private var arrayOfAttack13:Array;
private var arrayOfAttack14:Array;
private var arrayOfAttack15:Array;
public var myGraphic:FinalBossImage;
public var killMe:Boolean;// = false
public var realHP:int;
private var randomXPoint:Number;
private var randomInt:int;
private var powerMultiplier:Number;// = 1
private var shipFrontY:Number;
private var halfHeight:Number;
private var arrayOfAttack25:Array;
private var arrayOfAttack26:Array;
private var arrayOfAttack21:Array;
private var arrayOfAttack23:Array;
private var arrayOfAttack24:Array;
private var isShowing:Boolean;// = true
public var basicHP:Array;
private var arrayOfAttack22:Array;
private var powersRunning:int;
private var arrayOfAttack31:Array;
private var arrayOfAttack32:Array;
private var arrayOfAttack33:Array;
private var arrayOfAttack34:Array;
private var arrayOfAttack35:Array;
private var arrayOfAttack36:Array;
private var arrayOfAttack37:Array;
private var i:int;
private var myParent:Level;
private var relaxTime:int;
public function FinalBoss(_arg1:Level){
arrayOfAttack11 = [0, 0, 0, 50];
arrayOfAttack12 = [0, 0, 0, 20];
arrayOfAttack13 = [0, 0, 0, 14];
arrayOfAttack14 = [0, 0, 0, 10];
arrayOfAttack15 = [0, 0, 0, 20];
arrayOfAttack21 = [0, 0, 0, 30];
arrayOfAttack22 = [0, 0, 0, 20];
arrayOfAttack23 = [0, 0, 0, 9];
arrayOfAttack24 = [0, 0, 0, 4];
arrayOfAttack25 = [0, 0, 0, 6];
arrayOfAttack26 = [0, 0, 0, 18];
arrayOfAttack31 = [0, 0, 0, 15];
arrayOfAttack32 = [0, 0, 0, 15];
arrayOfAttack33 = [0, 0, 0, 8];
arrayOfAttack34 = [0, 0, 0, 5];
arrayOfAttack35 = [0, 0, 0, 20];
arrayOfAttack36 = [0, 0, 0, 6];
arrayOfAttack37 = [0, 0, 0, 15];
numberOfAttacks = [5, 6, 7];
basicHP = [120000, 180000, 250000];
super();
myGraphic = new FinalBossImage();
myGraphic.gotoAndStop(1);
addChild(myGraphic);
myParent = _arg1;
realHP = basicHP[0];
}
private function attack37():void{
if (arrayOfAttack37[1] < ((14 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack37;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack37;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack37[0] == 0){
powersRunning--;
};
arrayOfAttack37[1] = 0;
if (Math.random() > 0.5){
myParent.createNewMegaLaser(((Math.random() * 280) - 140), shipFrontY, 90, 315);
} else {
myParent.createNewMegaLaser(-150, (shipFrontY + (Math.random() * 310)), 0, 380);
};
};
}
private function attack12():void{
if (arrayOfAttack12[1] < int(((2 / powerMultiplier) + 0.5))){
var _local1 = arrayOfAttack12;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack12;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack12[0] == 0){
powersRunning--;
};
arrayOfAttack12[1] = 0;
myParent.createNewEnemyShot(2, ((arrayOfAttack12[2] + 3) * 7), shipFrontY, "down", 0, 2);
myParent.createNewEnemyShot(2, ((arrayOfAttack12[2] + 3) * -7), shipFrontY, "down", 0, 2);
_local1 = arrayOfAttack12;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
}
private function attack21():void{
if (arrayOfAttack21[1] < ((1 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack21;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack21;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack21[0] == 0){
powersRunning--;
};
arrayOfAttack21[1] = 0;
if (((arrayOfAttack21[2] / 2) is int)){
myParent.createNewEnemyShot(2, -150, (shipFrontY + (Math.random() * 300)), "faced", 0, 1.6);
} else {
myParent.createNewEnemyShot(2, 150, (shipFrontY + (Math.random() * 300)), "faced", 180, 1.6);
};
_local1 = arrayOfAttack21;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
}
private function attack23():void{
if (arrayOfAttack23[1] < ((25 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack23;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack23;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack23[0] == 0){
powersRunning--;
};
arrayOfAttack23[1] = 0;
myParent.createNewEnemyShot(4, -150, myParent.hero.y, "facedWave", 0, 1.45);
myParent.createNewEnemyShot(4, myParent.hero.x, shipFrontY, "facedWave", 90, 1.45);
};
}
private function attack24():void{
if (arrayOfAttack24[1] < ((28 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack24;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack24;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack24[0] == 0){
powersRunning--;
};
arrayOfAttack24[1] = 0;
if (((arrayOfAttack24[2] / 2) is int)){
myParent.createNewEnemyShot(4, -150, -10, "faced", 320, 2);
myParent.createNewEnemyShot(4, -150, -10, "faced", 330, 2);
myParent.createNewEnemyShot(4, -150, -10, "faced", 340, 2);
myParent.createNewEnemyShot(4, -150, -10, "faced", 350, 2);
myParent.createNewEnemyShot(4, -150, -10, "faced", 0, 2);
myParent.createNewEnemyShot(4, -150, -10, "faced", 10, 2);
myParent.createNewEnemyShot(4, -150, -10, "faced", 20, 2);
myParent.createNewEnemyShot(4, -150, -10, "faced", 30, 2);
myParent.createNewEnemyShot(4, -150, -10, "faced", 40, 2);
} else {
myParent.createNewEnemyShot(4, 150, 90, "faced", 140, 2);
myParent.createNewEnemyShot(4, 150, 90, "faced", 150, 2);
myParent.createNewEnemyShot(4, 150, 90, "faced", 160, 2);
myParent.createNewEnemyShot(4, 150, 90, "faced", 170, 2);
myParent.createNewEnemyShot(4, 150, 90, "faced", 180, 2);
myParent.createNewEnemyShot(4, 150, 90, "faced", 190, 2);
myParent.createNewEnemyShot(4, 150, 90, "faced", 200, 2);
myParent.createNewEnemyShot(4, 150, 90, "faced", 210, 2);
myParent.createNewEnemyShot(4, 150, 90, "faced", 220, 2);
};
_local1 = arrayOfAttack24;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
}
private function attack26():void{
if (arrayOfAttack26[1] < ((1.5 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack26;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack26;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack26[0] == 0){
powersRunning--;
};
arrayOfAttack26[1] = 0;
myParent.createNewEnemyShot(4.3, 150, -10, "faced", (168.5 + (Math.random() * 45)), 2);
myParent.createNewEnemyShot(4.3, -150, 90, "faced", (-22.5 + (Math.random() * 45)), 2);
_local1 = arrayOfAttack26;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
}
private function attack22():void{
if (arrayOfAttack22[1] < ((1 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack22;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack22;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack22[0] == 0){
powersRunning--;
};
arrayOfAttack22[1] = 0;
if (((((((!((arrayOfAttack22[2] == 6))) && (!((arrayOfAttack22[2] == 7))))) && (!((arrayOfAttack22[2] == 12))))) && (!((arrayOfAttack22[2] == 13))))){
myParent.createNewEnemyShot(4, -150, 0, "faced", (-50 + (5 * arrayOfAttack22[2])), 2);
myParent.createNewEnemyShot(4, 150, 0, "faced", (130 + (5 * arrayOfAttack22[2])), 2);
};
_local1 = arrayOfAttack22;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
}
public function updatePowerMultiplier():void{
if (realHP <= 0){
if (level < 3){
levelUpBoss();
} else {
killMe = true;
};
};
powerMultiplier = (2 - (realHP / basicHP[(level - 1)]));
}
private function attack32():void{
if (arrayOfAttack32[1] < ((4.2 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack32;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack32;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack32[0] == 0){
powersRunning--;
};
arrayOfAttack32[1] = 0;
if (arrayOfAttack32[2] != 9){
myParent.createNewEnemyShot(5.2, 5, shipFrontY, "faced", (45 + (5 * arrayOfAttack32[2])), 1.5);
myParent.createNewEnemyShot(5.2, -5, shipFrontY, "faced", (135 - (5 * arrayOfAttack32[2])), 1.5);
};
myParent.createNewEnemyShot(5.2, 5, 190, "faced", (250 - (3 * arrayOfAttack32[2])), 1.5);
myParent.createNewEnemyShot(5.2, -5, 190, "faced", (290 + (3 * arrayOfAttack32[2])), 1.5);
_local1 = arrayOfAttack32;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
}
private function attack33():void{
if (arrayOfAttack33[1] < ((24 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack33;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack33;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack33[0] == 0){
powersRunning--;
};
arrayOfAttack33[1] = 0;
myParent.createNewEnemyShot(4.5, -150, myParent.hero.y, "faced", 0, 1.2);
myParent.createNewEnemyShot(4.5, 150, myParent.hero.y, "faced", 180, 1.2);
myParent.createNewEnemyShot(4.5, myParent.hero.x, shipFrontY, "faced", 90, 1.2);
myParent.createNewEnemyShot(4.5, myParent.hero.x, 190, "faced", 270, 1.2);
};
}
private function attack34():void{
if (arrayOfAttack34[1] < ((35 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack34;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack34;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack34[0] == 0){
powersRunning--;
};
arrayOfAttack34[1] = 0;
myParent.createNewEnemyShot(4.5, myParent.hero.x, 190, "faced", 250, 1);
myParent.createNewEnemyShot(4.5, myParent.hero.x, 190, "faced", 270, 1);
myParent.createNewEnemyShot(4.5, myParent.hero.x, 190, "faced", 290, 1);
myParent.createNewEnemyShot(4.5, myParent.hero.x, shipFrontY, "faced", 60, 1);
myParent.createNewEnemyShot(4.5, myParent.hero.x, shipFrontY, "faced", 80, 1);
myParent.createNewEnemyShot(4.5, myParent.hero.x, shipFrontY, "faced", 100, 1);
myParent.createNewEnemyShot(4.5, myParent.hero.x, shipFrontY, "faced", 120, 1);
};
}
private function attack36():void{
if (arrayOfAttack36[1] < ((14 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack36;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack36;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack36[0] == 0){
powersRunning--;
};
arrayOfAttack36[1] = 0;
myParent.createNewEnemyShot(5.2, 150, shipFrontY, "aimed", 0, 1.4);
myParent.createNewEnemyShot(5.2, -150, shipFrontY, "aimed", 0, 1.4);
myParent.createNewEnemyShot(5.2, -150, 190, "aimed", 0, 1.4);
myParent.createNewEnemyShot(5.2, 150, 190, "aimed", 0, 1.4);
};
}
private function attack35():void{
if (arrayOfAttack35[1] < ((7.5 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack35;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack35;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack35[0] == 0){
powersRunning--;
};
arrayOfAttack35[1] = 0;
myParent.createNewEnemyShot(5.2, -120, 190, "facedWave", (260 + (Math.random() * 20)), 1.6);
myParent.createNewEnemyShot(5.2, 120, 190, "facedWave", (260 + (Math.random() * 20)), 1.6);
myParent.createNewEnemyShot(5.2, 0, shipFrontY, "facedWave", (80 + (Math.random() * 20)), 1.6);
};
}
private function attack31():void{
if (arrayOfAttack31[1] < ((2.5 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack31;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack31;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack31[0] == 0){
powersRunning--;
};
arrayOfAttack31[1] = 0;
myParent.createNewEnemyShot(4.3, 25, shipFrontY, "facedWave", (45 + (3 * arrayOfAttack31[2])), 2.5);
myParent.createNewEnemyShot(4.3, -25, shipFrontY, "facedWave", (135 - (3 * arrayOfAttack31[2])), 2.5);
myParent.createNewEnemyShot(4.3, 0, 190, "facedWave", 270, 1.5);
_local1 = arrayOfAttack31;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
}
public function update():void{
if (isShowing){
if (y < ((height * 0.5) - 200)){
y = (y + 2.2);
myParent.setQualityLevel(1);
} else {
isShowing = false;
halfHeight = (height * 0.5);
shipFrontY = (y + halfHeight);
};
} else {
myParent.setQualityLevel(1);
i = 1;
while (i <= numberOfAttacks[(level - 1)]) {
if (this[(("arrayOfAttack" + level) + i)][0] > 0){
var _local1 = this;
_local1[(("attack" + level) + i)]();
};
i++;
};
if (powersRunning < 1){
if (relaxTime > 0){
relaxTime--;
} else {
randomInt = int(((Math.random() * numberOfAttacks[(level - 1)]) + 1));
while (randomInt == lastAttackCode) {
randomInt = int(((Math.random() * numberOfAttacks[(level - 1)]) + 1));
};
lastAttackCode = randomInt;
this[(("arrayOfAttack" + level) + randomInt)][0] = this[(("arrayOfAttack" + level) + randomInt)][3];
this[(("arrayOfAttack" + level) + randomInt)][1] = (this[(("arrayOfAttack" + level) + randomInt)][2] = 0);
powersRunning++;
relaxTime = int((20 / powerMultiplier));
};
};
};
}
private function attack15():void{
if (arrayOfAttack15[1] < int(((4 / powerMultiplier) + 0.5))){
var _local1 = arrayOfAttack15;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack15;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack15[0] == 0){
powersRunning--;
};
arrayOfAttack15[1] = 0;
if (((!((arrayOfAttack15[2] == 5))) && (!((arrayOfAttack15[2] == 6))))){
myParent.createNewEnemyShot(4, -100, shipFrontY, "faced", (40 + (5 * arrayOfAttack15[2])), 1.5);
myParent.createNewEnemyShot(4, 100, shipFrontY, "faced", (140 - (5 * arrayOfAttack15[2])), 1.5);
};
_local1 = arrayOfAttack15;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
}
public function levelUpBoss():void{
powersRunning = 0;
level++;
realHP = basicHP[(level - 1)];
myGraphic.gotoAndStop(level);
droppedLoot = 0;
myParent.playWarningEffect();
}
private function attack11():void{
if (arrayOfAttack11[1] < ((1 / powerMultiplier) + 0.5)){
var _local1 = arrayOfAttack11;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack11;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack11[0] == 0){
powersRunning--;
};
arrayOfAttack11[1] = 0;
_local1 = arrayOfAttack11;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
if (arrayOfAttack11[2] < 25){
myParent.createNewEnemyShot(2, (-165 + (arrayOfAttack11[2] * 10)), shipFrontY, "down", 0, 2);
} else {
myParent.createNewEnemyShot(2, ((160 + 250) - (arrayOfAttack11[2] * 10)), shipFrontY, "down", 0, 2);
};
};
}
private function attack13():void{
if (arrayOfAttack13[1] < int(((18 / powerMultiplier) + 0.5))){
var _local1 = arrayOfAttack13;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack13;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack13[0] == 0){
powersRunning--;
};
arrayOfAttack13[1] = 0;
randomXPoint = ((x + (Math.random() * 250)) - 125);
myParent.createNewEnemyShot(3, randomXPoint, shipFrontY, "faced", 66, 2);
myParent.createNewEnemyShot(3, randomXPoint, shipFrontY, "faced", 74, 2);
myParent.createNewEnemyShot(3, randomXPoint, shipFrontY, "faced", 82, 2);
myParent.createNewEnemyShot(3, randomXPoint, shipFrontY, "faced", 90, 2);
myParent.createNewEnemyShot(3, randomXPoint, shipFrontY, "faced", 98, 2);
myParent.createNewEnemyShot(3, randomXPoint, shipFrontY, "faced", 106, 2);
myParent.createNewEnemyShot(3, randomXPoint, shipFrontY, "faced", 114, 2);
};
}
private function attack14():void{
if (arrayOfAttack14[1] < int(((6 / powerMultiplier) + 0.5))){
var _local1 = arrayOfAttack14;
var _local2 = 1;
var _local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
} else {
_local1 = arrayOfAttack14;
_local2 = 0;
_local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
if (arrayOfAttack14[0] == 0){
powersRunning--;
};
arrayOfAttack14[1] = 0;
myParent.createNewEnemyShot(3, (-150 + (arrayOfAttack14[2] * 15)), shipFrontY, "downWave", 0, 2.4);
myParent.createNewEnemyShot(3, (10 + (arrayOfAttack14[2] * 15)), shipFrontY, "downWave", 0, 2.4);
_local1 = arrayOfAttack14;
_local2 = 2;
_local3 = (_local1[_local2] + 1);
_local1[_local2] = _local3;
};
}
private function attack25():void{
var _local1:Number;
if (arrayOfAttack25[1] < ((8 / powerMultiplier) + 0.5)){
var _local2 = arrayOfAttack25;
var _local3 = 1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
} else {
_local2 = arrayOfAttack25;
_local3 = 0;
_local4 = (_local2[_local3] - 1);
_local2[_local3] = _local4;
if (arrayOfAttack25[0] == 0){
powersRunning--;
};
arrayOfAttack25[1] = 0;
_local1 = (1 + (arrayOfAttack25[2] * 0.05));
myParent.createNewEnemyShot(4.5, 150, ((shipFrontY + (Math.random() * 310)) + 10), "aimed", 0, _local1);
myParent.createNewEnemyShot(4.5, -150, ((shipFrontY + (Math.random() * 310)) + 10), "aimed", 0, _local1);
_local2 = arrayOfAttack25;
_local3 = 2;
_local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
};
}
}
}//package GamePlay
Section 40
//FPSCounter (GamePlay.FPSCounter)
package GamePlay {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class FPSCounter extends Sprite {
public var tf:TextField;
private var ticks:uint;// = 0
public var lastPerformance:Number;// = 30
private var last:uint;
public function FPSCounter(_arg1:int=555, _arg2:int=585, _arg3:uint=0xFFFFFF, _arg4:Boolean=false, _arg5:uint=0){
last = getTimer();
super();
addEventListener(Event.ENTER_FRAME, tick, false, 0, true);
}
public function tick(_arg1:Event):void{
ticks++;
var _local2:uint = getTimer();
var _local3:uint = (_local2 - last);
if (_local3 >= 100){
lastPerformance = ((ticks / _local3) * 1000);
ticks = 0;
last = _local2;
};
}
}
}//package GamePlay
Section 41
//Hero (GamePlay.Hero)
package GamePlay {
import flash.events.*;
import flash.display.*;
public class Hero extends Sprite {
private var SbasicFireDelay2:int;
public var powerGauge:Number;// = 0
public var gunCode1:int;// = 11
public var maxAmountOfBombs:int;// = 4
public var level:int;// = 1
public var repairRate:int;
public var experiencePoints:int;// = 0
public var holdingBombs:int;// = 3
public var realFireDelay1:int;
public var realFireDelay2:int;
public var realShield:int;
public var MbasicFireDelay2:int;
public var realTimeToloseMultiplier:int;
public var realHP:int;
public var xSpeed:Number;// = 0
public var orderOfGunUpgrades:Array;
public var movePower:Number;
private var realMovePower:Number;
public var basicShield:int;
public var halfHeight:Number;
public var magnetPower:Number;// = 1
public var ship:HeroImage;
public var basicHP:int;
public var multiplier:int;// = 1
public var MbasicFireDelay1:int;
public var shipCode:int;
public var gunDamageModifier:Number;// = 1
public var ySpeed:Number;// = 0
public var MgunDamage1:int;
public var MgunDamage2:int;
public var halfWidth:Number;
public var pitagoras:Boolean;// = false
public var neededXPToLevelUp:Array;
public var basicTimeToLoseMultiplier:int;
private var SgunDamage1:int;
private var SgunDamage2:int;
public var fireDelayModifier:Number;// = 1
public var myparent:Level;
public var bulletSpeed1:Number;
public var bulletSpeed2:Number;
public var powerIsActive:Boolean;// = false
private var friction:Number;// = 0.85
private var SbasicFireDelay1:int;
public function Hero(_arg1:Level, _arg2:int){
neededXPToLevelUp = new Array(150, 2400, 6000, 14000, 25000, 39000, 55000);
orderOfGunUpgrades = new Array("primaryGun", "newWingman", "primaryGun", "activeShield", "primaryGun", "newWingman", "primaryGun");
super();
myparent = _arg1;
shipCode = _arg2;
ship = new HeroImage();
ship.gotoAndStop(shipCode);
addChild(ship);
halfWidth = (width * 0.5);
halfHeight = (height * 0.5);
switch (shipCode){
case 1:
movePower = 1.9;
basicHP = (realHP = 2100);
basicShield = (realShield = 400);
repairRate = 1.2;
SbasicFireDelay1 = 8;
SbasicFireDelay2 = 15;
SgunDamage1 = 100;
SgunDamage2 = 120;
bulletSpeed1 = 15;
bulletSpeed2 = 10;
break;
case 2:
movePower = 1.5;
basicHP = (realHP = 2600);
basicShield = (realShield = 500);
repairRate = 1.6;
SbasicFireDelay1 = 10;
SbasicFireDelay2 = 20;
SgunDamage1 = 240;
SgunDamage2 = 200;
bulletSpeed1 = 8;
bulletSpeed2 = 10;
break;
};
addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
}
public function resetMultiplierTime():void{
realTimeToloseMultiplier = (basicTimeToLoseMultiplier = (110 - multiplier));
}
public function update():void{
xSpeed = (xSpeed * friction);
ySpeed = (ySpeed * friction);
x = (x + (xSpeed * myparent.screenProportion));
y = (y + (ySpeed * myparent.screenProportion));
rotation = xSpeed;
if (x < (-170 + halfWidth)){
x = (-170 + halfWidth);
};
if (x > (170 - halfWidth)){
x = (170 - halfWidth);
};
if (y < (-195 + halfHeight)){
y = (-195 + halfHeight);
};
if (y > (195 - halfHeight)){
y = (195 - halfHeight);
};
if (realFireDelay1 > 0){
realFireDelay1--;
};
if (realFireDelay2 > 0){
realFireDelay2--;
};
if (realShield < basicShield){
realShield = (realShield + repairRate);
};
if (myparent.changingScreenProportion != 0){
scaleX = myparent.screenProportion;
scaleY = myparent.screenProportion;
updateHalfSize();
};
if (multiplier > 1){
if (realTimeToloseMultiplier > 0){
realTimeToloseMultiplier--;
} else {
multiplier--;
resetMultiplierTime();
myparent.updateHUD("multiplier");
};
myparent.updateHUD("multiplierTime");
};
if (powerIsActive){
if (powerGauge > 0){
powerGauge = (powerGauge - 2.5);
myparent.updateHUD("power");
} else {
myparent.heroPowerBar.filler.gotoAndStop(2);
if (shipCode == 1){
bulletSpeed2 = (bulletSpeed2 / 1.5);
};
ship.model.gotoAndStop(1);
updateHalfSize();
myparent.energyShield.gotoAndStop(1);
ship.model.gotoAndPlay(11);
magnetPower = (magnetPower / 1.5);
fireDelayModifier = (fireDelayModifier / 1.5);
gunDamageModifier = (gunDamageModifier / 1.5);
bulletSpeed1 = (bulletSpeed1 / 1.5);
movePower = (movePower / 1.5);
powerIsActive = false;
updateGuns();
};
};
}
private function onAddToStage(_arg1:Event):void{
movePower = (movePower * myparent.patentBonus);
basicHP = (basicHP * myparent.patentBonus);
realHP = (realHP * myparent.patentBonus);
SgunDamage1 = (SgunDamage1 * myparent.patentBonus);
SgunDamage2 = (SgunDamage2 * myparent.patentBonus);
updateGuns();
removeEventListener(Event.ADDED_TO_STAGE, onAddToStage);
}
public function checkLevelUp():void{
if (((!(powerIsActive)) && ((experiencePoints >= neededXPToLevelUp[(level - 1)])))){
switch (shipCode){
case 1:
gunDamageModifier = (gunDamageModifier * 1.065);
basicHP = (basicHP * 1.08);
if (!myparent.isChallengeMode){
realHP = (realHP + (basicHP * 0.12));
} else {
realHP = (realHP + (basicHP * 0.8));
};
fireDelayModifier = (fireDelayModifier * 1.06);
break;
case 2:
gunDamageModifier = (gunDamageModifier * 1.085);
basicHP = (basicHP * 1.14);
if (!myparent.isChallengeMode){
realHP = (realHP + (basicHP * 0.18));
} else {
realHP = (realHP + (basicHP * 0.14));
};
fireDelayModifier = (fireDelayModifier * 1.04);
break;
};
myparent.updateHUD("hp");
magnetPower = (magnetPower * 1.07);
movePower = (movePower * 1.03);
myparent.shieldMaxTolerance = int((basicHP * 0.2));
switch (orderOfGunUpgrades[(level - 1)]){
case "primaryGun":
gunCode1++;
break;
case "newWingman":
myparent.newWingman();
break;
case "activeShield":
myparent.activeShield();
break;
};
updateGuns();
if (holdingBombs < 3){
holdingBombs++;
myparent.updateHUD("bomb");
};
experiencePoints = (experiencePoints - neededXPToLevelUp[(level - 1)]);
level++;
myparent.levelUpFlashActive();
};
}
public function movement(_arg1:String):void{
realMovePower = movePower;
if (pitagoras){
realMovePower = (realMovePower * 0.707);
};
switch (_arg1){
case "left":
xSpeed = (xSpeed - realMovePower);
break;
case "right":
xSpeed = (xSpeed + realMovePower);
break;
case "up":
ySpeed = (ySpeed - (realMovePower * 0.76));
break;
case "down":
ySpeed = (ySpeed + (realMovePower * 0.76));
break;
};
}
public function updateHalfSize():void{
halfWidth = (width * 0.5);
halfHeight = (height * 0.5);
}
public function updateGuns():void{
MbasicFireDelay1 = int((SbasicFireDelay1 / fireDelayModifier));
MbasicFireDelay2 = int((SbasicFireDelay2 / fireDelayModifier));
MgunDamage1 = int((SgunDamage1 * gunDamageModifier));
MgunDamage2 = int((SgunDamage2 * gunDamageModifier));
}
}
}//package GamePlay
Section 42
//Level (GamePlay.Level)
package GamePlay {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import flash.net.*;
import SWFStats.*;
import com.*;
import com.greensock.plugins.*;
import flash.ui.*;
public class Level extends Sprite {
private var currentMegaLaser:MegaLaser;
private var pauseScreen:PauseScreen;
private var finalBoss:FinalBoss;
private var stageGame:StageImage;
public var energyShield:EnergyShield;
private var last10Performances:Array;
private var angleLoot:Number;
private var iShake:int;
public var screenProportion:Number;// = 1
private var xDistHeroLoot:Number;
private var parallax1b:ParallaxEffectLv1;
private var leftKeyPressed:Boolean;// = false
private var parallax1a:ParallaxEffectLv1;
private var playerTension:int;
private var gameOverPicture:GameOverPicture;
private var laserTarget:Enemy;
private var parallax2a:ParallaxEffectLv2;
private var dKeyPressed:Boolean;// = false
public var shipCode:int;
private var arrayOfMegaLasers:Array;
private var shieldFunctional:Boolean;// = false
private var parallax2b:ParallaxEffectLv2;
private var levelUpIcon:LevelUpIcon;
private var parallax3a:ParallaxEffectLv3;
private var parallax3b:ParallaxEffectLv3;
private var spaceKeyPressed:Boolean;// = false
private var j:int;
private var l:int;
private var laserShot2:Laser;
private var bombFlash:BombFlash;
private var i:int;
private var currentTarget;
private var laserShot1:Laser;
private var arrayOfEnemyBullet:Array;
private var lowHealthAlert:LowHealthAlert;
private var arrayOfParticles:Array;
private var instructionTime:int;// = 40
private var realTimeToNextEnemy2:Number;// = 0
private var currentBoss;
private var score:int;// = 0
private var damageTaken:int;
private var yDistHeroLoot:Number;
private var wingman1:Wingman;
private var wingman2:Wingman;
public var shieldTension:Number;// = 0
public var changingScreenProportion:int;// = 0
private var framesSpentInBoss:int;
private var fightingABoss:Boolean;// = false
private var newBullet:Bullet;
private var durationOfWaves:Array;
private var checkParticlestime:int;
private var fpsCounter:FPSCounter;
private var checkQuality:int;// = 0
private var arrayOfLoot:Array;
public var heroPowerBar:HeroPowerBar;
private var newEnemyBullet:EnemyBullet;
private var totalDistHeroLoot:Number;
private var haveShield:Boolean;// = false
public var graphicQuality:int;// = 4
private var dangerAlert:DangerAlert;
private var downKeyPressed:Boolean;// = false
private var heroLevelIKnow:int;// = 1
public var shieldMaxTolerance:int;
private var currentParticle:Particle;
private var lootCreated:int;
private var wingmanNotice:WingmanONOFF;
private var bossHealthBar:BossHealthBar;
private var arrayOfBullet:Array;
public var paused:Boolean;// = false
private var nShake:int;
private var heroHealthBar:HeroHealthBar;
private var wingmanLevel:int;// = 0
public var arrayOfEnemy:Array;
private var enemiesDefeated:int;
private var areWingmanActive:Boolean;// = true
private var currentEnemyBullet:EnemyBullet;
private var relaxTime:int;// = 40
private var zoomLevel:Number;// = 1
private var lootCollected:int;
private var distHeroLoot:Number;
private var dynamicMovingTimeDuration:int;// = 0
private var currentEnemy:Enemy;
private var sKeyPressed:Boolean;// = false
private var bonusEXPWave:Array;
public var isChallengeMode:Boolean;
private var instructionPart:int;// = 1
private var waveNumber:int;// = 1
private var realTimeToNextEnemy:Number;// = 0
public var patentBonus:Number;// = 1
private var upKeyPressed:Boolean;// = false
private var currentLoot:Loot;
private var hittedEnemy:Boolean;// = false
private var orderOfWaves:Array;
private var nextWaveText:NextWaveText;
private var dynamicMovingTime:int;// = 0
private var currentBullet:Bullet;
private var finalBossMoment:Boolean;
private var gameOver:Boolean;// = false
public var enemiesCreated:int;
private var levelUpFlash:LevelUpFlash;
public var hero:Hero;
private var rightKeyPressed:Boolean;// = false
public function Level(_arg1:int){
arrayOfBullet = new Array();
arrayOfEnemyBullet = new Array();
arrayOfEnemy = new Array();
arrayOfLoot = new Array();
arrayOfParticles = new Array();
arrayOfMegaLasers = new Array();
orderOfWaves = new Array(11, 13, 21, 41, 14, 22, 16, 42, 17, 15, 110, 43, 23, 19, 18, 44, 111, 112, 24, 45, 50);
durationOfWaves = new Array(400, 320, 320, 10, 320, 320, 320, 10, 320, 320, 320, 10, 320, 320, 320, 10, 320, 320, 300, 10, 10);
bonusEXPWave = new Array(100, 130, 170, 230, 300, 400, 530, 700, 920, 1200, 1600, 2100, 2800, 3700, 4900, 0x1900, 8500, 11000, 15000, 30000, 30000);
last10Performances = new Array();
super();
Mouse.hide();
shipCode = _arg1;
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, TransformMatrixPlugin, GlowFilterPlugin]);
stageGame = new StageImage();
addChild(stageGame);
stageGame.gamePlace.gamePlaceInside.mask = stageGame.gamePlace.gamePlaceInside.yellowMask;
stageGame.hintSystem.gotoAndStop(1);
parallax1a = new ParallaxEffectLv1();
parallax1b = new ParallaxEffectLv1();
parallax2a = new ParallaxEffectLv2();
parallax2b = new ParallaxEffectLv2();
parallax3a = new ParallaxEffectLv3();
parallax3b = new ParallaxEffectLv3();
stageGame.gamePlace.gamePlaceInside.addChild(parallax1a);
stageGame.gamePlace.gamePlaceInside.addChild(parallax1b);
stageGame.gamePlace.gamePlaceInside.addChild(parallax2a);
stageGame.gamePlace.gamePlaceInside.addChild(parallax2b);
stageGame.gamePlace.gamePlaceInside.addChild(parallax3a);
stageGame.gamePlace.gamePlaceInside.addChild(parallax3b);
parallax1a.y = (parallax2a.y = (parallax3a.y = -200));
parallax1b.y = (parallax2b.y = (parallax3b.y = -850));
parallax1a.alpha = (parallax1b.alpha = 0.5);
parallax2a.alpha = (parallax2b.alpha = 0.5);
parallax3a.alpha = (parallax3b.alpha = 0.5);
parallax1a.x = (parallax1b.x = (parallax2a.x = (parallax2b.x = (parallax3a.x = (parallax3b.x = -165)))));
hero = new Hero(this, shipCode);
hero.y = 140;
TweenMax.to(hero, 0, {glowFilter:{color:6750207, alpha:1, blurX:6, blurY:6}});
stageGame.gamePlace.gamePlaceInside.addChild(hero);
heroHealthBar = new HeroHealthBar();
heroHealthBar.alpha = 1.5;
stageGame.gamePlace.gamePlaceInside.addChild(heroHealthBar);
heroPowerBar = new HeroPowerBar();
heroPowerBar.alpha = 1.5;
stageGame.gamePlace.gamePlaceInside.addChild(heroPowerBar);
wingman1 = new Wingman();
wingman1.visible = false;
wingman1.x = -300;
wingman1.gotoAndStop(shipCode);
stageGame.gamePlace.gamePlaceInside.addChild(wingman1);
wingman2 = new Wingman();
wingman2.visible = false;
wingman2.x = -300;
wingman2.gotoAndStop(shipCode);
stageGame.gamePlace.gamePlaceInside.addChild(wingman2);
wingmanNotice = new WingmanONOFF();
wingmanNotice.alpha = 0;
stageGame.gamePlace.gamePlaceInside.addChild(wingmanNotice);
energyShield = new EnergyShield();
energyShield.visible = false;
energyShield.x = -300;
TweenMax.to(energyShield, 0, {glowFilter:{color:6750207, alpha:1, blurX:8, blurY:8}});
stageGame.gamePlace.gamePlaceInside.addChild(energyShield);
if (shipCode == 2){
laserShot1 = new Laser();
laserShot1.alpha = 0;
stageGame.gamePlace.gamePlaceInside.addChild(laserShot1);
laserShot2 = new Laser();
laserShot2.alpha = 0;
stageGame.gamePlace.gamePlaceInside.addChild(laserShot2);
};
bombFlash = new BombFlash();
bombFlash.alpha = 0;
stageGame.gamePlace.gamePlaceInside.addChild(bombFlash);
levelUpFlash = new LevelUpFlash();
levelUpFlash.alpha = 0;
stageGame.addChild(levelUpFlash);
levelUpIcon = new LevelUpIcon();
levelUpIcon.alpha = 0;
TweenMax.to(levelUpIcon, 0, {glowFilter:{color:0xFFFFFF, alpha:1, blurX:4, blurY:4}});
stageGame.gamePlace.gamePlaceInside.addChild(levelUpIcon);
lowHealthAlert = new LowHealthAlert();
lowHealthAlert.alpha = 0;
lowHealthAlert.text.alpha = 6;
stageGame.addChild(lowHealthAlert);
dangerAlert = new DangerAlert();
dangerAlert.alpha = 0;
stageGame.addChild(dangerAlert);
nextWaveText = new NextWaveText();
nextWaveText.alpha = 0;
nextWaveText.x = 300;
nextWaveText.y = 350;
stageGame.addChild(nextWaveText);
pauseScreen = new PauseScreen();
pauseScreen.alpha = 0;
pauseScreen.x = 700;
addChild(pauseScreen);
fpsCounter = new FPSCounter();
stageGame.turnONWingman.alpha = 0;
stageGame.bossHint.alpha = 0;
stageGame.pressDMessage.visible = false;
stageGame.warningMessage.gotoAndStop(1);
updateHUD("experiencePoints");
updateHUD("multiplier");
updateHUD("multiplierTime");
updateHUD("bomb");
updateHUD("power");
updateHUD("score");
updateHUD("waveNumber");
addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
addEventListener(Event.ENTER_FRAME, onTick, false, 0, true);
}
public function createNewEnemyShot(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:String, _arg5:Number=0, _arg6:Number=1):void{
var _local7:EnemyBullet;
var _local8:Number;
var _local9:Number;
var _local10:Number;
switch (_arg4){
case "down":
case "leftDown":
case "rightDown":
_local7 = new EnemyBullet(1, (30 * _arg1));
if ((((graphicQuality >= 2)) && ((screenProportion >= 0.95)))){
TweenMax.to(_local7, 0, {glowFilter:{color:0xFF6600, alpha:1, blurX:3, blurY:3}});
};
break;
case "aimed":
_local7 = new EnemyBullet(2, (30 * _arg1));
if ((((graphicQuality >= 2)) && ((screenProportion >= 0.95)))){
TweenMax.to(_local7, 0, {glowFilter:{color:6671615, alpha:1, blurX:4, blurY:4}});
};
break;
case "angled1":
_local7 = new EnemyBullet(3, (20 * _arg1));
if ((((graphicQuality >= 2)) && ((screenProportion >= 0.95)))){
TweenMax.to(_local7, 0, {glowFilter:{color:6671615, alpha:1, blurX:3, blurY:3}});
};
break;
case "downWave":
case "facedWave":
_local7 = new EnemyBullet(4, (40 * _arg1));
if ((((graphicQuality >= 2)) && ((screenProportion >= 0.95)))){
TweenMax.to(_local7, 0, {glowFilter:{color:0xFFFFFF, alpha:1, blurX:8, blurY:8}});
};
break;
case "faced":
_local7 = new EnemyBullet(1, (30 * _arg1));
if ((((graphicQuality >= 2)) && ((screenProportion >= 0.95)))){
TweenMax.to(_local7, 0, {glowFilter:{color:0xFF6600, alpha:1, blurX:3, blurY:3}});
};
break;
};
_local7.x = _arg2;
_local7.y = _arg3;
stageGame.gamePlace.gamePlaceInside.addChild(_local7);
arrayOfEnemyBullet.push(_local7);
switch (_arg4){
case "down":
_local7.xSpeed = 0;
_local7.ySpeed = 5;
break;
case "downWave":
_local7.xSpeed = 0;
_local7.ySpeed = 7.5;
_local7.rotation = 90;
break;
case "leftDown":
_local7.xSpeed = (-5 * Math.sin(7));
_local7.ySpeed = (5 * Math.cos(7));
break;
case "rightDown":
_local7.xSpeed = (5 * Math.sin(7));
_local7.ySpeed = (5 * Math.cos(7));
break;
case "aimed":
_local9 = (hero.x - _local7.x);
_local10 = (hero.y - _local7.y);
_local8 = ((Math.atan2(_local10, _local9) * 180) / Math.PI);
_local7.rotation = _local8;
_local7.xSpeed = (Math.cos((_local8 * (Math.PI / 180))) * 8);
_local7.ySpeed = (Math.sin((_local8 * (Math.PI / 180))) * 8);
break;
case "angled1":
_local8 = currentBoss.spread1;
_local7.rotation = _local8;
_local7.xSpeed = (Math.cos((_local8 * (Math.PI / 180))) * 6);
_local7.ySpeed = Math.abs((Math.sin((_local8 * (Math.PI / 180))) * 6));
break;
case "faced":
case "facedWave":
_local8 = _arg5;
_local7.rotation = _local8;
_local7.xSpeed = (Math.cos((_local8 * (Math.PI / 180))) * 6);
_local7.ySpeed = (Math.sin((_local8 * (Math.PI / 180))) * 6);
break;
};
_local7.xSpeed = (_local7.xSpeed * _arg6);
_local7.ySpeed = (_local7.ySpeed * _arg6);
_local7.scaleX = (_local7.scaleY = screenProportion);
_local7.update(screenProportion);
}
public function damageHero(_arg1:int):void{
Main(parent).playSoundEffect("takeDamage");
hero.realHP = (hero.realHP - _arg1);
damageTaken = (damageTaken + _arg1);
hero.multiplier = (hero.multiplier * 0.9);
if (graphicQuality > 1){
shakeScreen(2);
TweenLite.to(hero, 0, {tint:0xFF0000});
TweenLite.to(hero, 0.5, {removeTint:true});
};
updateHUD("hp");
updateHUD("multiplier");
playerTension = (playerTension + 1000);
if (hero.realHP <= 0){
lowHealthAlert.alpha = 0;
Main(parent).createAnAchievement(8);
heroHealthBar.alpha = 0;
heroPowerBar.alpha = 0;
if (wingmanLevel >= 1){
createParticlesExplosion(wingman1);
wingman1.alpha = 0;
if (wingman2.visible){
createParticlesExplosion(wingman2);
wingman2.alpha = 0;
};
};
energyShield.visible = false;
stageGame.pressDMessage.visible = false;
playerTension = 0;
gameOver = true;
gameOverPicture = new GameOverPicture();
addChild(gameOverPicture);
createParticlesExplosion(hero);
Main(parent).stopGameLoop();
Main(parent).playSoundEffect("bigNuke");
shakeScreen(3);
stageGame.gamePlace.gamePlaceInside.removeChild(hero);
};
}
public function activeShield():void{
Main(parent).playSoundEffect("shieldActivate");
haveShield = true;
shieldMaxTolerance = int((hero.basicHP * 0.2));
energyShield.visible = true;
shieldFunctional = true;
}
private function shotLaser(_arg1:Number, _arg2:Number, _arg3:int):void{
var _local4:Laser;
var _local5:Number;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
if (((fightingABoss) || (finalBossMoment))){
newBullet = new Bullet(31, hero.MgunDamage1);
newBullet.x = _arg1;
newBullet.y = (_arg2 - newBullet.halfHeight);
newBullet.ySpeed = -(hero.bulletSpeed1);
if ((((graphicQuality >= 3)) && ((screenProportion >= 0.8)))){
TweenMax.to(newBullet, 0, {glowFilter:{color:0xFFFFFF, alpha:1, blurX:8, blurY:8}});
};
stageGame.gamePlace.gamePlaceInside.addChild(newBullet);
arrayOfBullet.push(newBullet);
} else {
if (_arg3 == 1){
_local4 = laserShot1;
} else {
_local4 = laserShot2;
};
_local4.rotation = 0;
_local4.alpha = 1;
_local4.x = _arg1;
_local4.y = _arg2;
_local5 = 999;
_local6 = (arrayOfEnemy.length - 1);
while (_local6 > -1) {
_local7 = (arrayOfEnemy[_local6].x - _arg1);
_local8 = (arrayOfEnemy[_local6].y - _arg2);
_local9 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
if (_local5 > _local9){
_local5 = _local9;
laserTarget = arrayOfEnemy[_local6];
};
_local6--;
};
_local7 = (laserTarget.x - _arg1);
_local8 = (laserTarget.y - _arg2);
laserTarget.xSpeed = (laserTarget.xSpeed * 0.5);
laserTarget.ySpeed = (laserTarget.ySpeed * 0.5);
if (laserTarget.xSpeed < 0){
_local10 = -(laserTarget.xSpeed);
} else {
_local10 = laserTarget.xSpeed;
};
if (int((_local10 + laserTarget.ySpeed)) == 0){
laserTarget.hp = -10;
createParticlesExplosion(laserTarget);
} else {
laserTarget.hp = (laserTarget.hp - hero.MgunDamage2);
};
_local9 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local4.width = _local9;
_local11 = ((Math.atan2(_local8, _local7) * 180) / Math.PI);
_local4.rotation = _local11;
if (graphicQuality >= 2){
shakeScreen(1);
};
if (laserTarget.hp <= 0){
hero.multiplier++;
updateHUD("multiplier");
createParticlesExplosion(laserTarget);
} else {
TweenLite.to(laserTarget, 0, {tint:0xFFFFFF});
TweenLite.to(laserTarget, 0.5, {removeTint:true});
};
};
}
private function onTick(_arg1:Event):void{
var _local2:Boolean;
var _local3:int;
var _local4:int;
var _local5:String;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Enemy;
var _local14:Enemy;
if (paused){
return;
};
if (!gameOver){
Main(parent).timeSpentInGame = (Main(parent).timeSpentInGame + 33);
if (Main(parent).firstTimePlaying){
if (instructionPart < 7){
if (instructionTime < 120){
instructionTime++;
} else {
instructionTime = 0;
instructionPart++;
stageGame.hintSystem.gotoAndStop(instructionPart);
};
} else {
Main(parent).firstTimePlaying = false;
stageGame.hintSystem.visible = false;
};
};
if (stageGame.bossHint.alpha > 0){
stageGame.bossHint.alpha = (stageGame.bossHint.alpha - 0.05);
};
hero.pitagoras = false;
if (upKeyPressed){
if (((leftKeyPressed) || (rightKeyPressed))){
hero.pitagoras = true;
};
hero.movement("up");
};
if (downKeyPressed){
if (((leftKeyPressed) || (rightKeyPressed))){
hero.pitagoras = true;
};
hero.movement("down");
};
if (leftKeyPressed){
hero.movement("left");
};
if (rightKeyPressed){
hero.movement("right");
};
hero.update();
if (changingScreenProportion == 1){
if (hero.x < 1){
hero.x = (hero.x - 0.5);
};
if (hero.x > 1){
hero.x = (hero.x + 0.5);
};
};
if (changingScreenProportion == -1){
if (hero.x < 1){
hero.x = (hero.x + 0.5);
};
if (hero.x > 1){
hero.x = (hero.x - 0.5);
};
};
if (((sKeyPressed) && ((hero.realFireDelay1 <= 0)))){
if (shipCode == 1){
createHeroBullet(hero.gunCode1);
Main(parent).playSoundEffect("shot1");
};
if (shipCode == 2){
if (!hero.powerIsActive){
Main(parent).playSoundEffect("laserShot1");
createHeroLaser(hero.gunCode1);
} else {
Main(parent).playSoundEffect("laserShot2Super");
createLaserShot(34, 0);
};
};
hero.realFireDelay1 = hero.MbasicFireDelay1;
};
if (wingmanLevel >= 1){
wingman1.x = ((hero.x - hero.halfWidth) - (wingman1.width * screenProportion));
wingman1.y = hero.y;
wingman1.rotation = hero.rotation;
if (wingman2.visible){
wingman2.x = ((hero.x + hero.halfWidth) + (wingman2.width * screenProportion));
wingman2.y = hero.y;
wingman2.rotation = hero.rotation;
};
if (sKeyPressed){
if (((((finalBossMoment) || (fightingABoss))) || ((arrayOfEnemy.length > 0)))){
if (hero.realFireDelay2 <= 0){
hero.realFireDelay2 = hero.MbasicFireDelay2;
Main(parent).playSoundEffect("missileShot1");
if (shipCode == 1){
createAMissile(wingman1.x, (wingman1.y - (wingman1.height * 0.5)));
} else {
shotLaser(wingman1.x, wingman1.y, 1);
};
if (wingman2.visible){
if (shipCode == 1){
createAMissile(wingman2.x, (wingman2.y - (wingman1.height * 0.5)));
} else {
shotLaser(wingman2.x, wingman2.y, 2);
};
};
};
};
};
};
};
if ((((((hero.holdingBombs >= 1)) && (!(fightingABoss)))) && (!(finalBossMoment)))){
if (playerTension > 0){
if (stageGame.pressDMessage.visible){
playerTension = (playerTension - 80);
} else {
playerTension = (playerTension - 10);
};
if (playerTension >= 3000){
stageGame.pressDMessage.visible = true;
};
};
if (playerTension <= 500){
stageGame.pressDMessage.visible = false;
playerTension = 0;
};
} else {
stageGame.pressDMessage.visible = false;
};
qualityCheck();
if (((!(fightingABoss)) && (!(finalBossMoment)))){
if (dynamicMovingTimeDuration > 1){
dynamicMovingTimeDuration--;
} else {
if (dynamicMovingTimeDuration == 1){
dynamicMovingTime = 0;
dynamicMovingTimeDuration = 0;
if (!isChallengeMode){
stageGame.gamePlace.play();
};
};
};
};
if (fightingABoss){
currentBoss.update();
if (HitTest.complexHitTestObject(currentBoss, hero, 3)){
createParticlesExplosion(hero);
Main(parent).createAnAchievement(12);
damageHero(400);
hero.ySpeed = 10;
};
if (currentBoss.amountOfGunsLeft <= 0){
hero.experiencePoints = hero.neededXPToLevelUp[(hero.level - 1)];
hero.checkLevelUp();
if (!isChallengeMode){
massLootDrop(currentBoss);
transfromBulletsIntoLoot();
};
currentBoss.scaleX = 0.3;
createParticlesExplosion(currentBoss);
if (!isChallengeMode){
nextWaveFlash(bonusEXPWave[(waveNumber - 1)]);
};
relaxTime = 90;
waveNumber++;
if (!isChallengeMode){
if (waveNumber == 5){
Main(parent).createAnAchievement(17);
Main(parent).createAnAchievement(13);
};
if (waveNumber == 9){
Main(parent).createAnAchievement(18);
};
if (waveNumber == 13){
Main(parent).createAnAchievement(19);
};
if (waveNumber == 17){
Main(parent).createAnAchievement(20);
};
};
updateHUD("waveNumber");
fightingABoss = false;
if (((!((currentBoss.powerMultiplier == 5))) && (!(isChallengeMode)))){
realTimeToNextEnemy = 20;
changingScreenProportion = 1;
};
stageGame.gamePlace.gamePlaceInside.removeChild(currentBoss);
currentBoss = null;
};
};
if (gameOver){
gameOverPicture.play();
if (gameOverPicture.currentFrame == 60){
Main(parent).playSoundEffect("gameOver");
};
if (gameOverPicture.currentFrame == 90){
Main(parent).bruteSCore = score;
stage.quality = StageQuality.HIGH;
removeEventListener(Event.ENTER_FRAME, onTick);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPress);
stage.removeEventListener(KeyboardEvent.KEY_UP, onKeyRelease);
stage.removeEventListener(Event.ACTIVATE, flashActive);
stage.removeEventListener(Event.DEACTIVATE, flashDeactive);
Main(parent).addAMenuScreen("gameOver");
return;
};
};
if (nShake > 0){
iShake++;
nShake--;
stageGame.gamePlace.x = (300 + (Math.sin(iShake) * nShake));
stageGame.gamePlace.y = (300 + (Math.sin(iShake) * nShake));
};
updateParallax("1a", 3);
updateParallax("1b", 3);
updateParallax("2a", 1);
updateParallax("2b", 1);
if (graphicQuality >= 1){
updateParallax("3a", 0.4);
updateParallax("3b", 0.4);
};
if (haveShield){
energyShield.x = hero.x;
energyShield.y = (hero.y - hero.halfHeight);
energyShield.scaleX = (energyShield.scaleY = screenProportion);
};
i = (arrayOfEnemyBullet.length - 1);
while (i > -1) {
currentEnemyBullet = arrayOfEnemyBullet[i];
currentEnemyBullet.update(screenProportion);
if (((shieldFunctional) && (HitTest.complexHitTestObject(currentEnemyBullet, energyShield, 1)))){
Main(parent).createAnAchievement(3);
damageShield(currentEnemyBullet.damage);
currentEnemyBullet.valid = false;
};
if (HitTest.complexHitTestObject(hero, currentEnemyBullet, 1)){
damageHero(currentEnemyBullet.damage);
currentEnemyBullet.valid = false;
};
if (((((((((!(currentEnemyBullet.valid)) || ((currentEnemyBullet.y > (220 + currentEnemyBullet.halfHeight))))) || ((currentEnemyBullet.y < (-220 + currentEnemyBullet.halfHeight))))) || ((currentEnemyBullet.x < (-180 - currentEnemyBullet.halfHeight))))) || ((currentEnemyBullet.x > (180 + currentEnemyBullet.halfHeight))))){
stageGame.gamePlace.gamePlaceInside.removeChild(arrayOfEnemyBullet[i]);
arrayOfEnemyBullet[i] = null;
arrayOfEnemyBullet.splice(i, 1);
};
i--;
};
if (arrayOfMegaLasers.length > 0){
l = (arrayOfMegaLasers.length - 1);
while (l > -1) {
currentMegaLaser = arrayOfMegaLasers[l];
currentMegaLaser.update();
if (currentMegaLaser.makeSound){
currentMegaLaser.makeSound = false;
Main(parent).playSoundEffect("laserShot2Super");
};
if ((((currentMegaLaser.alpha >= 0.75)) && (HitTest.complexHitTestObject(currentMegaLaser, hero, 1)))){
damageHero(350);
currentMegaLaser.alpha = 0.7;
currentMegaLaser.action = 1;
createParticlesExplosion(hero);
};
if (currentMegaLaser.alpha <= 0){
stageGame.gamePlace.gamePlaceInside.removeChild(arrayOfMegaLasers[l]);
arrayOfMegaLasers[l] = null;
arrayOfMegaLasers.splice(l, 1);
};
l--;
};
};
if (((finalBossMoment) || (fightingABoss))){
framesSpentInBoss++;
if (isChallengeMode){
_local3 = int((framesSpentInBoss / 1800));
_local4 = int(((framesSpentInBoss - (_local3 * 1800)) / 30));
if (_local4 < 10){
_local5 = ("0" + _local4.toString());
} else {
_local5 = _local4.toString();
};
stageGame.bossTimer.text = ((_local3 + ":") + _local5);
};
};
if (finalBossMoment){
if (HitTest.complexHitTestObject(finalBoss.myGraphic, hero, 2)){
_local6 = -(hero.x);
_local7 = -(hero.y);
_local8 = ((Math.atan2(_local7, _local6) * 180) / Math.PI);
hero.xSpeed = (Math.cos((_local8 * (Math.PI / 180))) * 18);
hero.ySpeed = (Math.sin((_local8 * (Math.PI / 180))) * 18);
createParticlesExplosion(hero);
Main(parent).createAnAchievement(12);
damageHero(200);
};
finalBoss.update();
};
i = (arrayOfBullet.length - 1);
while (i > -1) {
currentBullet = arrayOfBullet[i];
currentBullet.scaleX = screenProportion;
currentBullet.scaleY = screenProportion;
if (currentBullet.type > 30){
currentBullet.halfHeight = (currentBullet.halfHeight * 1.08);
currentBullet.ySpeed = (currentBullet.ySpeed * 1.08);
currentBullet.height = (currentBullet.height * 1.08);
currentBullet.width = (currentBullet.width / 1.02);
};
currentBullet.update(screenProportion);
if (screenProportion != 1){
currentBullet.scaleX = screenProportion;
currentBullet.scaleY = screenProportion;
};
if (fightingABoss){
j = 1;
while (j <= currentBoss.amountOfGuns) {
if (currentBoss[(("gun" + j) + "Info")][2] > 0){
currentTarget = currentBoss.myGraphic[("gun" + j)];
if (HitTest.complexHitTestObject(currentTarget, currentBullet, 8)){
currentBoss[(("gun" + j) + "Info")][2] = (currentBoss[(("gun" + j) + "Info")][2] - currentBullet.damage);
TweenLite.to(currentTarget, 0, {tint:0xFFFFFF});
TweenLite.to(currentTarget, 0.5, {removeTint:true});
currentBullet.valid = false;
};
if (currentBoss[(("gun" + j) + "Info")][2] <= 0){
Main(parent).playSoundEffect("explosion");
shakeScreen(1);
hero.multiplier++;
score = (score + int((hero.multiplier * 500)));
updateHUD("score");
updateHUD("multiplier");
createParticlesExplosion(currentTarget, currentBoss.x, currentBoss.y, true);
currentTarget.gotoAndStop(2);
currentBoss.amountOfGunsLeft--;
if ((((Math.random() < 0.5)) && (!(isChallengeMode)))){
createLoot(21, (hero.basicHP * 0.12), ((currentTarget.x * screenProportion) + currentBoss.x), ((currentTarget.y * screenProportion) + currentBoss.y));
};
};
};
j++;
};
};
if (finalBossMoment){
if (finalBoss.realHP > 0){
if (currentBullet.hitTestObject(finalBoss.myGraphic.main)){
finalBoss.realHP = (finalBoss.realHP - int((currentBullet.damage * 0.7)));
if (finalBoss.droppedLoot < int(((4 - ((finalBoss.realHP / finalBoss.basicHP[(finalBoss.level - 1)]) * 4)) + 0.5))){
createLoot(21, (hero.basicHP * 0.12), currentBullet.x, currentBullet.y);
finalBoss.droppedLoot++;
if (isChallengeMode){
finalBoss.droppedLoot++;
};
};
finalBoss.updatePowerMultiplier();
updateHUD("bossHealth");
currentBullet.valid = false;
};
} else {
TweenLite.to(finalBoss, 0, {tint:0xFFFFFF});
TweenLite.to(finalBoss, 3, {removeTint:true});
if (finalBoss.killMe){
stage.quality = StageQuality.HIGH;
Main(parent).stopGameLoop();
removeEventListener(Event.ENTER_FRAME, onTick);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPress);
stage.removeEventListener(KeyboardEvent.KEY_UP, onKeyRelease);
stage.removeEventListener(Event.ACTIVATE, flashActive);
stage.removeEventListener(Event.DEACTIVATE, flashDeactive);
Main(parent).collectedLootPercent = int(((lootCollected / lootCreated) * 100));
Main(parent).defeatedEnemiesPercent = int(((enemiesDefeated / enemiesCreated) * 100));
Main(parent).timeSpentInBosses = framesSpentInBoss;
Main(parent).damageTaken = damageTaken;
Main(parent).bruteSCore = score;
if (isChallengeMode){
Main(parent).addAMenuScreen("challengeClear");
} else {
Main(parent).createAnAchievement(7);
Main(parent).addScene("winning");
};
return;
};
};
};
j = (arrayOfEnemy.length - 1);
while (j > -1) {
currentEnemy = arrayOfEnemy[j];
if (currentEnemy.hp > 0){
hittedEnemy = false;
if (currentBullet.lastEnemy != currentEnemy){
if (shipCode == 1){
if (currentBullet.hitTestObject(currentEnemy)){
hittedEnemy = true;
};
} else {
if (HitTest.complexHitTestObject(currentEnemy, currentBullet, 3)){
hittedEnemy = true;
};
};
if (hittedEnemy){
currentEnemy.hp = (currentEnemy.hp - currentBullet.damage);
if (currentEnemy.hp <= 0){
if (currentEnemy.type != 72){
if ((((currentEnemy.type == 11)) || ((currentEnemy.type == 12)))){
Main(parent).playSoundEffect("hit2");
} else {
if (Math.random() > 0.5){
Main(parent).playSoundEffect("hit1");
} else {
Main(parent).playSoundEffect("explosion");
};
};
};
hero.multiplier++;
score = (score + int((hero.multiplier * currentEnemy.initialHP)));
updateHUD("score");
updateHUD("multiplier");
if (graphicQuality > 1){
createParticlesExplosion(currentEnemy);
};
} else {
if ((((((currentEnemy.type == 32)) && ((currentBullet.type < 20)))) && ((currentBullet.type > 30)))){
currentEnemy.aimToHero();
};
TweenLite.to(currentEnemy, 0, {tint:0xFFFFFF});
TweenLite.to(currentEnemy, 0.5, {removeTint:true});
};
if ((((currentBullet.type > 10)) && ((currentBullet.type < 20)))){
_local9 = (currentBullet.x - currentEnemy.x);
if (_local9 > 0){
currentBullet.xSpeed = (currentBullet.ySpeed * Math.sin(((-20 * Math.PI) / 180)));
} else {
currentBullet.xSpeed = (currentBullet.ySpeed * Math.sin(((20 * Math.PI) / 180)));
};
currentBullet.ySpeed = (currentBullet.ySpeed * Math.cos(((20 * Math.PI) / 180)));
currentBullet.lastEnemy = currentEnemy;
};
if ((((currentBullet.type > 20)) && ((currentBullet.type < 30)))){
currentBullet.valid = false;
};
if ((((currentBullet.type > 30)) && ((currentBullet.type < 40)))){
currentEnemy.scaleY = (currentEnemy.scaleY / 20);
createParticlesExplosion(currentEnemy);
currentEnemy.scaleY = (currentEnemy.scaleY * 20);
currentBullet.lastEnemy = currentEnemy;
} else {
if (currentEnemy.hp > 0){
createParticlesExplosion(currentBullet);
};
};
};
};
};
j--;
};
if ((((((((currentBullet.y < (-200 - currentBullet.halfHeight))) || (!(currentBullet.valid)))) || ((currentBullet.x < (-200 - currentBullet.halfHeight))))) || ((currentBullet.x > (200 + currentBullet.halfHeight))))){
stageGame.gamePlace.gamePlaceInside.removeChild(arrayOfBullet[i]);
arrayOfBullet[i] = null;
arrayOfBullet.splice(i, 1);
};
i--;
};
i = (arrayOfEnemy.length - 1);
while (i > -1) {
currentEnemy = arrayOfEnemy[i];
_local2 = false;
currentEnemy.update();
if (currentEnemy.shootNow){
currentEnemy.shootNow = false;
if (currentEnemy.howIsShoot == "3Spread"){
createNewEnemyShot(1, currentEnemy.x, currentEnemy.y, "leftDown");
createNewEnemyShot(1, currentEnemy.x, currentEnemy.y, "rightDown");
createNewEnemyShot(1, currentEnemy.x, currentEnemy.y, "down");
} else {
createNewEnemyShot(1, currentEnemy.x, currentEnemy.y, currentEnemy.howIsShoot);
};
stageGame.gamePlace.gamePlaceInside.setChildIndex(currentEnemy, (stageGame.gamePlace.gamePlaceInside.numChildren - 1));
};
if (((((haveShield) && (shieldFunctional))) && (HitTest.complexHitTestObject(energyShield, currentEnemy, 1)))){
if (graphicQuality > 1){
createParticlesExplosion(currentEnemy);
};
Main(parent).createAnAchievement(3);
damageShield(currentEnemy.hp);
currentEnemy.hp = 0;
_local2 = true;
};
if (HitTest.complexHitTestObject(currentEnemy, hero, 1)){
if (graphicQuality > 1){
createParticlesExplosion(currentEnemy);
};
Main(parent).createAnAchievement(2);
damageHero(currentEnemy.hp);
currentEnemy.hp = 0;
_local2 = true;
};
if ((((((currentEnemy.y > (200 + currentEnemy.halfHeight))) || ((currentEnemy.x > (180 + currentEnemy.halfWidth))))) || ((currentEnemy.x < (-180 - currentEnemy.halfWidth))))){
currentEnemy.valid = false;
};
if (currentEnemy.hp <= 0){
currentEnemy.valid = false;
if (Math.random() < currentEnemy.dropRate){
_local10 = Math.random();
if (_local10 > 0.3){
_local11 = int(((currentEnemy.initialHP * ((hero.multiplier / 10) + 1)) / 10));
_local12 = 11;
} else {
if ((((_local10 > 0.15)) && ((_local10 <= 0.3)))){
_local11 = (hero.basicHP * 0.25);
_local12 = 21;
} else {
if ((((_local10 > 0.1)) && ((_local10 <= 0.15)))){
if ((((shieldTension >= shieldMaxTolerance)) && (haveShield))){
_local11 = 500;
_local12 = 41;
} else {
_local11 = int(((currentEnemy.initialHP * ((hero.multiplier / 10) + 1)) / 10));
_local12 = 11;
};
} else {
if (_local10 <= 0.1){
_local11 = 20;
_local12 = 31;
};
};
};
};
createLoot(_local12, _local11, currentEnemy.x, currentEnemy.y);
};
};
if (!currentEnemy.valid){
if (((currentEnemy.breakable) && ((_local2 == false)))){
switch (currentEnemy.breakIntoPieces){
case 2:
_local13 = new Enemy(this, 71);
_local13.x = (currentEnemy.x - currentEnemy.halfWidth);
_local13.y = currentEnemy.y;
_local13.xSpeed = -0.8;
_local13.ySpeed = (3.5 * ((Math.random() * 0.4) + 1));
_local13.rotation = ((Math.atan2(_local13.ySpeed, _local13.xSpeed) * 180) / Math.PI);
_local13.alpha = 0;
stageGame.gamePlace.gamePlaceInside.addChild(_local13);
arrayOfEnemy.push(_local13);
_local14 = new Enemy(this, 71);
_local14.x = (currentEnemy.x + currentEnemy.halfWidth);
_local14.y = currentEnemy.y;
_local14.xSpeed = 0.8;
_local14.ySpeed = (3.5 * ((Math.random() * 0.4) + 1));
_local14.rotation = ((Math.atan2(_local14.ySpeed, _local14.xSpeed) * 180) / Math.PI);
_local14.alpha = 0;
_local13.scaleX = (_local13.scaleY = (_local14.scaleX = (_local14.scaleY = screenProportion)));
stageGame.gamePlace.gamePlaceInside.addChild(_local14);
arrayOfEnemy.push(_local14);
break;
case 25:
createNewEnemyShot(1, currentEnemy.x, currentEnemy.y, "faced", 20);
createNewEnemyShot(1, currentEnemy.x, currentEnemy.y, "faced", 55);
createNewEnemyShot(1, currentEnemy.x, currentEnemy.y, "faced", 90);
createNewEnemyShot(1, currentEnemy.x, currentEnemy.y, "faced", 125);
createNewEnemyShot(1, currentEnemy.x, currentEnemy.y, "faced", 160);
break;
};
};
currentEnemy.hp = 0;
enemiesDefeated++;
stageGame.gamePlace.gamePlaceInside.removeChild(arrayOfEnemy[i]);
arrayOfEnemy[i] = null;
arrayOfEnemy.splice(i, 1);
};
i--;
};
i = (arrayOfLoot.length - 1);
while (i > -1) {
currentLoot = arrayOfLoot[i];
if (screenProportion != 1){
currentLoot.scaleX = screenProportion;
currentLoot.scaleY = screenProportion;
};
xDistHeroLoot = (hero.x - currentLoot.x);
yDistHeroLoot = (hero.y - currentLoot.y);
if (currentLoot.falling){
if (currentLoot.timeToCalcDist == 0){
currentLoot.timeToCalcDist = 10;
totalDistHeroLoot = Math.sqrt(((xDistHeroLoot * xDistHeroLoot) + (yDistHeroLoot * yDistHeroLoot)));
if (totalDistHeroLoot < ((60 * screenProportion) * hero.magnetPower)){
currentLoot.falling = false;
};
};
currentLoot.xSpeed = (xDistHeroLoot / (80 / hero.magnetPower));
currentLoot.ySpeed = (currentLoot.ySpeed + 0.1);
} else {
angleLoot = ((Math.atan2(yDistHeroLoot, xDistHeroLoot) * 180) / Math.PI);
currentLoot.xSpeed = (currentLoot.xSpeed + (Math.cos((angleLoot * (Math.PI / 180))) * 2.6));
currentLoot.ySpeed = (currentLoot.ySpeed + (Math.sin((angleLoot * (Math.PI / 180))) * 2.6));
currentLoot.xSpeed = (currentLoot.xSpeed * 0.7);
currentLoot.ySpeed = (currentLoot.ySpeed * 0.7);
};
if (changingScreenProportion == 1){
if (currentLoot.x < 1){
currentLoot.x = (currentLoot.x - 0.5);
};
if (currentLoot.x > 1){
currentLoot.x = (currentLoot.x + 0.5);
};
};
if (!gameOver){
currentLoot.update(screenProportion);
};
if (((((HitTest.complexHitTestObject(currentLoot, hero, 2)) || (HitTest.complexHitTestObject(currentLoot, wingman1, 2)))) || (HitTest.complexHitTestObject(currentLoot, wingman2, 2)))){
switch (currentLoot.type){
case 11:
if (currentLoot.makeSound){
Main(parent).playSoundEffect("expLoot");
};
hero.experiencePoints = (hero.experiencePoints + currentLoot.value);
hero.checkLevelUp();
updateHUD("experiencePoints");
break;
case 21:
if (currentLoot.makeSound){
Main(parent).playSoundEffect("armorLoot");
};
hero.realHP = (hero.realHP + currentLoot.value);
updateHUD("hp");
break;
case 31:
Main(parent).playSoundEffect("powerLoot");
hero.powerGauge = (hero.powerGauge + 167);
if ((((hero.powerGauge >= 1000)) && (hero.powerIsActive))){
hero.powerGauge = 1000;
};
if ((((hero.powerGauge >= 1000)) && (!(hero.powerIsActive)))){
heroPowerBar.filler.gotoAndStop(2);
if (shipCode == 1){
Main(parent).createAnAchievement(4);
hero.bulletSpeed2 = (hero.bulletSpeed2 * 1.5);
} else {
Main(parent).createAnAchievement(5);
};
energyShield.gotoAndStop(2);
hero.ship.model.gotoAndPlay(2);
hero.updateHalfSize();
hero.powerIsActive = true;
hero.magnetPower = (hero.magnetPower * 1.5);
hero.fireDelayModifier = (hero.fireDelayModifier * 1.5);
hero.gunDamageModifier = (hero.gunDamageModifier * 1.5);
hero.bulletSpeed1 = (hero.bulletSpeed1 * 1.5);
hero.movePower = (hero.movePower * 1.5);
hero.updateGuns();
};
updateHUD("power");
break;
case 41:
Main(parent).playSoundEffect("shieldActivate");
shieldTension = 0;
shieldFunctional = true;
energyShield.alpha = 1;
break;
};
TweenLite.to(hero, 0, {tint:0xFFFFFF});
TweenLite.to(hero, 1, {removeTint:true});
lootCollected++;
currentLoot.valid = false;
};
if ((((currentLoot.y > (210 + currentLoot.halfHeight))) || ((currentLoot.y < -250)))){
currentLoot.valid = false;
};
if (!currentLoot.valid){
stageGame.gamePlace.gamePlaceInside.removeChild(arrayOfLoot[i]);
arrayOfLoot[i] = null;
arrayOfLoot.splice(i, 1);
};
i--;
};
if (checkParticlestime > 30){
checkParticlestime++;
} else {
i = (arrayOfParticles.length - 1);
while (i > -1) {
currentParticle = arrayOfParticles[i];
if (currentParticle.alpha <= 0){
stageGame.gamePlace.gamePlaceInside.removeChild(currentParticle);
arrayOfParticles[i] = null;
arrayOfParticles.splice(i, 1);
};
i--;
};
};
if (heroHealthBar.alpha > 0){
if (lowHealthAlert.alpha == 0){
heroHealthBar.alpha = (heroHealthBar.alpha - 0.04);
};
heroHealthBar.y = ((hero.y + hero.halfHeight) + 5);
heroHealthBar.x = hero.x;
};
if (lowHealthAlert.alpha == 1){
if (lowHealthAlert.text.alpha > 0){
lowHealthAlert.text.alpha = (lowHealthAlert.text.alpha - 0.05);
};
};
if (wingmanNotice.alpha > 0){
wingmanNotice.x = hero.x;
wingmanNotice.y = (((hero.y - hero.halfHeight) - 20) + (wingmanNotice.alpha * 10));
wingmanNotice.alpha = (wingmanNotice.alpha - 0.05);
};
if (heroPowerBar.alpha > 0){
heroPowerBar.alpha = (heroPowerBar.alpha - 0.04);
if (heroHealthBar.alpha > 0){
heroPowerBar.y = ((hero.y + hero.halfHeight) + 15);
} else {
heroPowerBar.y = ((hero.y + hero.halfHeight) + 5);
};
heroPowerBar.x = hero.x;
};
if (nextWaveText.alpha > 0){
nextWaveText.alpha = (nextWaveText.alpha - 0.05);
if (nextWaveText.alpha < 1){
nextWaveText.scaleX = (nextWaveText.scaleX + 0.2);
nextWaveText.scaleY = (nextWaveText.scaleY + 0.2);
};
};
if (levelUpIcon.alpha > 0){
levelUpIcon.x = hero.x;
levelUpIcon.y = ((hero.y - hero.halfWidth) - 8);
levelUpIcon.alpha = (levelUpIcon.alpha - 0.1);
};
if (levelUpFlash.alpha > 0){
levelUpFlash.alpha = (levelUpFlash.alpha - 0.1);
};
if (dangerAlert.alpha > 0){
dangerAlert.alpha = (dangerAlert.alpha - 0.075);
};
if (bombFlash.alpha >= 0){
bombFlash.alpha = (bombFlash.alpha - 0.2);
};
if (shipCode == 2){
if (laserShot1.alpha > 0){
laserShot1.alpha = (laserShot1.alpha - 0.33);
};
if (laserShot2.alpha > 0){
laserShot2.alpha = (laserShot2.alpha - 0.33);
};
};
updateWave();
checkProportions();
}
public function onKeyPress(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.UP:
upKeyPressed = true;
break;
case Keyboard.DOWN:
downKeyPressed = true;
break;
case Keyboard.LEFT:
leftKeyPressed = true;
break;
case Keyboard.RIGHT:
rightKeyPressed = true;
break;
case Keyboard.SPACE:
spaceKeyPressed = true;
break;
case KeyCodes.S:
sKeyPressed = true;
break;
};
}
private function blowABomb():void{
var _local1:Boolean;
var _local2:int;
if (hero.holdingBombs >= 1){
_local1 = true;
playerTension = 0;
Main(parent).playSoundEffect("nuke1");
stageGame.gamePlace.gamePlaceInside.setChildIndex(bombFlash, (stageGame.gamePlace.gamePlaceInside.numChildren - 1));
bombFlash.alpha = 1;
shakeScreen(3);
if (fightingABoss){
_local2 = int((500 * (1 - (currentBoss.amountOfGunsLeft / currentBoss.amountOfGuns))));
i = 1;
while (i <= currentBoss.amountOfGuns) {
if (currentBoss[(("gun" + i) + "Info")][2] > 0){
_local1 = false;
currentBoss[(("gun" + i) + "Info")][2] = (currentBoss[(("gun" + i) + "Info")][2] - _local2);
if (currentBoss[(("gun" + i) + "Info")][2] <= 0){
currentBoss[(("gun" + i) + "Info")][2] = 1;
};
TweenLite.to(currentBoss.myGraphic[("gun" + i)], 0, {tint:0xFFFFFF});
TweenLite.to(currentBoss.myGraphic[("gun" + i)], 0.5, {removeTint:true});
};
i++;
};
};
i = (arrayOfEnemyBullet.length - 1);
while (i > -1) {
_local1 = false;
arrayOfEnemyBullet[i].valid = false;
i--;
};
i = (arrayOfEnemy.length - 1);
while (i > -1) {
currentEnemy = arrayOfEnemy[i];
if ((currentEnemy is Enemy)){
_local1 = false;
currentEnemy.breakable = false;
currentEnemy.hp = -10;
score = (score + int((hero.multiplier * currentEnemy.initialHP)));
hero.multiplier++;
updateHUD("multiplier");
updateHUD("score");
if (graphicQuality > 1){
createParticlesExplosion(currentEnemy);
};
};
i--;
};
if (_local1 == true){
Main(parent).createAnAchievement(11);
};
hero.holdingBombs--;
updateHUD("bomb");
};
}
private function createObliqueShot(_arg1:int, _arg2:int, _arg3:int):void{
newBullet = new Bullet(_arg1, hero.MgunDamage1);
newBullet.x = (hero.x + (_arg3 * screenProportion));
newBullet.y = (hero.y - hero.halfHeight);
if (hero.powerIsActive){
newBullet.scaleX = (newBullet.scaleY = 1.5);
};
newBullet.xSpeed = (hero.bulletSpeed1 * Math.sin((_arg2 / 57.3)));
newBullet.ySpeed = (-(hero.bulletSpeed1) * Math.cos((_arg2 / 57.3)));
if ((((graphicQuality >= 3)) && ((screenProportion >= 0.8)))){
TweenMax.to(newBullet, 0, {glowFilter:{color:0xFFFFFF, alpha:1, blurX:4, blurY:4}});
};
stageGame.gamePlace.gamePlaceInside.addChild(newBullet);
arrayOfBullet.push(newBullet);
}
public function levelUpFlashActive():void{
if (!isChallengeMode){
Main(parent).playSoundEffect("levelUp");
};
TweenLite.to(hero, 0, {tint:0xFFFFFF});
TweenLite.to(hero, 7, {removeTint:true});
levelUpIcon.alpha = 8;
levelUpFlash.alpha = 1;
if (!isChallengeMode){
if (hero.level == 2){
Main(parent).createAnAchievement(21);
};
if (hero.level == 4){
Main(parent).createAnAchievement(22);
};
if (hero.level == 6){
Main(parent).createAnAchievement(23);
};
if (hero.level == 8){
Main(parent).createAnAchievement(24);
};
};
stageGame.setChildIndex(levelUpFlash, (stageGame.numChildren - 1));
stageGame.level.text = hero.level.toString();
}
public function positiveOrNegative():int{
var _local1:int = int((Math.random() * 2));
if (_local1 == 0){
_local1 = -1;
};
return (_local1);
}
private function createAMissile(_arg1:int, _arg2:int):void{
newBullet = new Bullet(21, hero.MgunDamage2);
newBullet.x = _arg1;
newBullet.y = _arg2;
newBullet.rotation = -90;
newBullet.myParent = this;
newBullet.xSpeed = 0;
newBullet.ySpeed = -(hero.bulletSpeed2);
newBullet.speed = hero.bulletSpeed2;
if (graphicQuality >= 3){
TweenMax.to(newBullet, 0, {glowFilter:{color:0xFFFFFF, alpha:1, blurX:4, blurY:4}});
};
stageGame.gamePlace.gamePlaceInside.addChild(newBullet);
arrayOfBullet.push(newBullet);
}
private function bossFight(_arg1:int):void{
stageGame.gamePlace.gotoAndStop(stageGame.gamePlace.currentFrame);
dynamicMovingTimeDuration = 50;
dynamicMovingTime = _arg1;
switch (_arg1){
case 1:
currentBoss = new Boss(this, 1, -150, 6, 61, 61, 61, 61, 51, 51);
zoomLevel = 0.8;
break;
case 2:
currentBoss = new Boss(this, 2, -140, 7, 31, 51, 51, 61, 61, 61, 61);
zoomLevel = 0.7;
break;
case 3:
currentBoss = new Boss(this, 3, -150, 7, 31, 31, 51, 51, 51, 61, 61);
zoomLevel = 0.65;
break;
case 4:
currentBoss = new Boss(this, 4, -110, 8, 31, 31, 41, 41, 61, 61, 51, 51);
zoomLevel = 0.57;
break;
case 5:
currentBoss = new Boss(this, 5, -150, 9, 31, 31, 61, 61, 81, 81, 81, 81, 91);
zoomLevel = 0.5;
break;
};
changingScreenProportion = -1;
stageGame.gamePlace.gamePlaceInside.addChild(currentBoss);
currentBoss.x = 0;
currentBoss.y = (-205 - (currentBoss.height * 0.5));
fightingABoss = true;
if (!isChallengeMode){
stageGame.warningMessage.play();
stageGame.warningMessage.alpha = 1;
Main(parent).playSoundEffect("warning");
};
stageGame.gamePlace.gamePlaceInside.setChildIndex(hero, (stageGame.gamePlace.gamePlaceInside.numChildren - 1));
}
public function onAddToStage(_arg1:Event):void{
stage.focus = stage;
isChallengeMode = Main(parent).isChallengeModeActive;
if (Main(parent).firstTimePlaying == false){
stageGame.hintSystem.visible = false;
};
if (isChallengeMode){
stageGame.waveNumber.alpha = (stageGame.multiplierClock.alpha = (stageGame.level.alpha = (stageGame.levelText.alpha = 0)));
stageGame.multiplierText.alpha = (stageGame.expBar.alpha = (stageGame.waveText.alpha = (stageGame.waveNumber.alpha = 0)));
stageGame.scoreField.alpha = 0;
orderOfWaves = new Array(41, 42, 43, 44, 45, 50);
durationOfWaves = new Array(10, 10, 10, 10, 10, 10);
while (hero.level < 3) {
hero.experiencePoints = hero.neededXPToLevelUp[(hero.level - 1)];
hero.checkLevelUp();
};
hero.realHP = hero.basicHP;
heroHealthBar.filler.scaleX = (hero.realHP / hero.basicHP);
stageGame.gamePlace.x = (stageGame.gamePlace.y = 300);
stageGame.gamePlace.rotation = 0;
stageGame.gamePlace.scaleX = (stageGame.gamePlace.scaleY = 1.5);
stageGame.gamePlace.gotoAndStop(60);
instructionPart = 7;
} else {
stageGame.bossTimer.alpha = 0;
};
Main(parent).loopsArePlaying = true;
Main(parent).totalNumberOfTries++;
Main(parent).starNewGameLoop("game");
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPress, false, 0, true);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyRelease, false, 0, true);
if (Main(parent).totalNumberOfTries == 3){
Main(parent).createAnAchievement(9);
};
if (((Main(parent).triedShipA) && (Main(parent).triedShipB))){
Main(parent).createAnAchievement(10);
};
patentBonus = Main(parent).calcPatentBonus();
stage.addEventListener(Event.ACTIVATE, flashActive, false, 0, true);
stage.addEventListener(Event.DEACTIVATE, flashDeactive, false, 0, true);
Log.Play();
}
private function nextWaveFlash(_arg1:int):void{
Main(parent).playSoundEffect("waveUp");
var _local2:int = int(((Math.random() * 9) + 1));
switch (_local2){
case 1:
nextWaveText.message.text = "Good!";
break;
case 2:
nextWaveText.message.text = "Great!";
break;
case 3:
nextWaveText.message.text = "Awesome!";
break;
case 4:
nextWaveText.message.text = "Nice!";
break;
case 5:
nextWaveText.message.text = "Wow!";
break;
case 6:
nextWaveText.message.text = "Incredible!";
break;
case 7:
nextWaveText.message.text = "Fantastic!";
break;
case 8:
nextWaveText.message.text = "Yeah!";
break;
case 9:
nextWaveText.message.text = "Well Done!";
break;
};
Main(parent).countWaveReached(waveNumber);
hero.experiencePoints = (hero.experiencePoints + bonusEXPWave[(waveNumber - 1)]);
hero.checkLevelUp();
updateHUD("experiencePoints");
nextWaveText.bonusEXP.text = (("+ " + _arg1) + " EXP");
nextWaveText.scaleX = (nextWaveText.scaleY = 1);
nextWaveText.alpha = 3;
}
private function massLootDrop(_arg1):void{
var _local3:int;
var _local5:Number;
var _local6:int;
var _local7:int;
var _local8:Loot;
var _local2:Number = _arg1.rotation;
_arg1.rotation = 0;
_arg1.rotation = _local2;
_local3 = int(((((_arg1.height * _arg1.width) / 1200) / (screenProportion * screenProportion)) + 1));
var _local4:int;
while (_local4 < _local3) {
_local5 = Math.random();
if (_local5 > 0.1){
_local6 = int(((150 * ((hero.multiplier / 10) + 1)) / 10));
_local7 = 11;
} else {
if (_local5 <= 0.1){
_local6 = (hero.basicHP * 0.25);
_local7 = 21;
};
};
_local4++;
lootCreated++;
_local8 = new Loot(_local7, _local6, false);
_local8.x = (_arg1.x + (((_arg1.width * Math.random()) * 0.5) * positiveOrNegative()));
_local8.y = (_arg1.y + (((_arg1.height * Math.random()) * 0.5) * positiveOrNegative()));
stageGame.gamePlace.gamePlaceInside.addChild(_local8);
arrayOfLoot.push(_local8);
};
}
private function createLaserShot(_arg1:int, _arg2:int):void{
newBullet = new Bullet(_arg1, hero.MgunDamage1);
newBullet.x = (hero.x + (_arg2 * screenProportion));
newBullet.y = ((hero.y - hero.halfHeight) - (newBullet.halfHeight * screenProportion));
newBullet.ySpeed = -(hero.bulletSpeed1);
if (graphicQuality >= 3){
TweenMax.to(newBullet, 0, {glowFilter:{color:0xFFFFFF, alpha:1, blurX:4, blurY:4}});
};
stageGame.gamePlace.gamePlaceInside.addChild(newBullet);
arrayOfBullet.push(newBullet);
}
public function createNewMegaLaser(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int):void{
var _local5:MegaLaser = new MegaLaser();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.width = _arg4;
_local5.rotation = _arg3;
_local5.alpha = 0.01;
stageGame.gamePlace.gamePlaceInside.addChild(_local5);
arrayOfMegaLasers.push(_local5);
if (fightingABoss){
stageGame.gamePlace.gamePlaceInside.setChildIndex(currentBoss, (stageGame.gamePlace.gamePlaceInside.numChildren - 1));
};
}
private function flashDeactive(_arg1:Event):void{
Main(parent).stopGameLoop();
pauseScreen.alpha = 1;
pauseScreen.x = 0;
paused = true;
Main(parent).createAnAchievement(1);
stageGame.gamePlace.stop();
}
private function createNewEnemy(_arg1:int, _arg2:Number=1):void{
var _local3:int;
var _local5:Enemy;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
if (Math.random() > 0.7){
_local3 = 2;
} else {
_local3 = 1;
};
var _local4:int = ((_arg1 * 10) + _local3);
_local5 = new Enemy(this, _local4, _arg2);
switch (_arg1){
case 1:
_local5.x = ((_local5.halfWidth + (Math.random() * (320 - (_local5.width * 2)))) - 160);
_local5.y = (-200 - _local5.halfHeight);
_local5.xSpeed = ((0.5 * ((Math.random() * 0.4) + 1)) * positiveOrNegative());
_local5.ySpeed = (2.8 * ((Math.random() * 0.4) + 1));
_local5.rotation = (Math.random() * 360);
break;
case 3:
_local5.x = ((_local5.halfWidth + (Math.random() * (320 - (_local5.width * 2)))) - 160);
_local5.y = (-200 - _local5.halfHeight);
_local7 = (hero.x - _local5.x);
_local8 = (hero.y - _local5.y);
_local9 = ((Math.atan2(_local8, _local7) * 180) / Math.PI);
_local5.rotation = _local9;
_local5.updateHalfs();
_local6 = (2.8 * ((Math.random() * 0.4) + 1));
_local5.xSpeed = (Math.cos((_local9 * (Math.PI / 180))) * _local6);
_local5.ySpeed = (Math.sin((_local9 * (Math.PI / 180))) * _local6);
_local5.myHero = hero;
_local5.mySpeed = _local6;
break;
case 4:
_local5.x = ((_local5.halfWidth + (Math.random() * (320 - (_local5.width * 2)))) - 160);
_local5.y = (-250 - _local5.halfHeight);
_local6 = (7.5 * ((Math.random() * 0.4) + 1));
_local5.xSpeed = 0;
_local5.ySpeed = _local6;
_local5.rotation = 90;
_local5.myHero = hero;
_local5.mySpeed = _local6;
break;
case 5:
_local5.x = ((_local5.halfWidth + (Math.random() * (320 - (_local5.width * 2)))) - 150);
_local5.y = (-200 - _local5.halfHeight);
_local5.ySpeed = (5.7 * ((Math.random() * 0.4) + 1));
_local5.shooter = true;
if (_local4 == 52){
_local5.xSpeed = ((0.25 * ((Math.random() * 0.4) + 1)) * positiveOrNegative());
_local5.basicTimeToShot = 40;
_local5.realTimeToShot = 35;
_local5.howIsShoot = "3Spread";
} else {
_local5.howIsShoot = "down";
_local5.basicTimeToShot = 70;
_local5.realTimeToShot = 35;
};
case 7:
_local5.x = ((_local5.halfWidth + (Math.random() * (320 - (_local5.width * 2)))) - 150);
_local5.y = (-200 - _local5.halfHeight);
if (_local4 == 72){
_local5.breakable = true;
_local5.breakIntoPieces = 2;
_local5.ySpeed = (1.5 * ((Math.random() * 0.4) + 1));
} else {
_local5.ySpeed = (3.5 * ((Math.random() * 0.4) + 1));
};
_local5.rotation = 90;
break;
case 8:
_local5.x = ((_local5.halfWidth + (Math.random() * (320 - (_local5.width * 2)))) - 160);
_local5.y = (-200 - _local5.halfHeight);
_local5.breakable = true;
_local5.breakIntoPieces = 25;
_local5.xSpeed = ((0.5 * ((Math.random() * 0.4) + 1)) * positiveOrNegative());
_local5.ySpeed = (2.8 * ((Math.random() * 0.4) + 1));
_local5.rotation = (Math.random() * 360);
break;
case 9:
_local5.x = ((_local5.halfWidth + (Math.random() * (310 - (_local5.width * 2)))) - 150);
_local5.y = (-200 - _local5.halfHeight);
_local5.xSpeed = 0;
_local5.ySpeed = (2 * ((Math.random() * 0.4) + 1));
_local5.rotation = 90;
break;
};
stageGame.gamePlace.gamePlaceInside.addChild(_local5);
arrayOfEnemy.push(_local5);
}
private function checkProportions():void{
if (changingScreenProportion == -1){
if (screenProportion > zoomLevel){
screenProportion = (screenProportion * 0.98);
} else {
screenProportion = zoomLevel;
changingScreenProportion = 0;
};
};
if (changingScreenProportion == 1){
if (screenProportion < 1){
screenProportion = (screenProportion * 1.05);
} else {
screenProportion = 1;
changingScreenProportion = 0;
};
};
if (screenProportion != 1){
if (wingman1.visible){
wingman1.scaleX = screenProportion;
wingman1.scaleY = screenProportion;
};
if (wingman2.visible){
wingman2.scaleX = screenProportion;
wingman2.scaleY = screenProportion;
};
if (fightingABoss){
currentBoss.scaleX = screenProportion;
currentBoss.scaleY = screenProportion;
};
if (finalBossMoment){
finalBoss.scaleX = screenProportion;
finalBoss.scaleY = screenProportion;
};
};
}
private function createParticlesExplosion(_arg1, _arg2:Number=0, _arg3:Number=0, _arg4:Boolean=false):void{
var _local6:int;
var _local8:Particle;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:Number;
var _local5:Number = _arg1.rotation;
_arg1.rotation = 0;
switch (graphicQuality){
case 4:
_local6 = int(((_arg1.height * _arg1.width) * 0.008));
break;
case 3:
_local6 = int(((_arg1.height * _arg1.width) * 0.004));
break;
case 2:
_local6 = int(((_arg1.height * _arg1.width) * 0.002));
break;
case 1:
_local6 = 2;
break;
};
_arg1.rotation = _local5;
var _local7:int;
while (_local7 < _local6) {
_local8 = new Particle();
_local9 = positiveOrNegative();
_local10 = positiveOrNegative();
_local8.x = (((_arg1.x * screenProportion) + _arg2) + (((_arg1.width * Math.random()) * 0.5) * _local9));
_local8.y = (((_arg1.y * screenProportion) + _arg3) + (((_arg1.height * Math.random()) * 0.5) * _local10));
_local8.height = (_local8.width = ((5 * ((Math.random() * 0.8) + 1)) + (_local6 * 0.05)));
if (screenProportion != 1){
_local8.scaleX = screenProportion;
_local8.scaleY = screenProportion;
};
_local11 = (_local8.x + (((Math.random() * _local6) * 12) * _local9));
_local12 = (_local8.y + (((Math.random() * _local6) * 12) * _local10));
_local8.rotation = (Math.random() * 360);
_local13 = ((Math.random() * 0.3) + 0.8);
TweenMax.to(_local8, _local13, {transformMatrix:{x:_local11, y:_local12}});
TweenLite.to(_local8, (_local13 - 0.1), {autoAlpha:0});
stageGame.gamePlace.gamePlaceInside.addChild(_local8);
arrayOfParticles.push(_local8);
_local7++;
};
}
private function flashActive(_arg1:Event):void{
Mouse.hide();
}
private function shakeScreen(_arg1:int):void{
switch (_arg1){
case 1:
nShake = 4;
iShake = (Math.random() * 3);
break;
case 2:
nShake = 6;
iShake = (Math.random() * 5);
break;
case 3:
nShake = 8;
iShake = (Math.random() * 9);
break;
};
}
private function changeQuality(_arg1:int):void{
graphicQuality = (graphicQuality + _arg1);
setQualityLevel(graphicQuality);
}
private function transfromBulletsIntoLoot():void{
while (arrayOfEnemyBullet.length > 0) {
createLoot(11, 100, arrayOfEnemyBullet[0].x, arrayOfEnemyBullet[0].y);
stageGame.gamePlace.gamePlaceInside.removeChild(arrayOfEnemyBullet[0]);
arrayOfEnemyBullet[0] = null;
arrayOfEnemyBullet.splice(0, 1);
};
}
public function setQualityLevel(_arg1:int):void{
graphicQuality = _arg1;
switch (_arg1){
case 1:
stage.quality = StageQuality.LOW;
break;
case 2:
case 3:
case 4:
stage.quality = StageQuality.MEDIUM;
break;
};
}
private function visitSponsor():void{
Main(parent).createAnAchievement(42);
var url = "http://www.dwarfgames.com/?utm_source=ingame&utm_medium=sponsoredgames&utm_campaign=nokkians2/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function createHeroLaser(_arg1:int):void{
switch (_arg1){
case 11:
createLaserShot(31, 0);
break;
case 12:
createLaserShot(31, -5);
createLaserShot(31, 5);
break;
case 13:
createLaserShot(32, -8);
createLaserShot(32, 8);
break;
case 14:
createLaserShot(32, -13);
createLaserShot(32, 0);
createLaserShot(32, 13);
break;
case 15:
createLaserShot(33, -18);
createLaserShot(33, 0);
createLaserShot(33, 18);
break;
};
}
private function updateWave():void{
if (relaxTime > 0){
relaxTime--;
playerTension = 0;
} else {
if (((!(fightingABoss)) && (!(finalBossMoment)))){
if (durationOfWaves[(waveNumber - 1)] > 0){
var _local1 = durationOfWaves;
var _local2 = (waveNumber - 1);
var _local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
} else {
if (((!(gameOver)) && (!(isChallengeMode)))){
nextWaveFlash(bonusEXPWave[(waveNumber - 1)]);
};
waveNumber++;
updateHUD("waveNumber");
if (((!(gameOver)) && (!(isChallengeMode)))){
if (waveNumber == 10){
Main(parent).createAnAchievement(14);
};
if (waveNumber == 15){
Main(parent).createAnAchievement(15);
};
if (waveNumber == 20){
Main(parent).createAnAchievement(16);
};
};
if ((((((((((waveNumber == 4)) || ((waveNumber == 8)))) || ((waveNumber == 12)))) || ((waveNumber == 16)))) || ((waveNumber == 20)))){
relaxTime = 50;
i = (arrayOfEnemy.length - 1);
while (i > -1) {
currentEnemy = arrayOfEnemy[i];
if ((currentEnemy is Enemy)){
currentEnemy.breakable = false;
currentEnemy.hp = -10;
if (graphicQuality >= 1){
createParticlesExplosion(currentEnemy);
};
};
i--;
};
} else {
relaxTime = 30;
};
realTimeToNextEnemy = 20;
return;
};
switch (orderOfWaves[(waveNumber - 1)]){
case 11:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((8 * ((Math.random() * 0.25) + 1)));
createNewEnemy(1, 1);
} else {
realTimeToNextEnemy--;
};
break;
case 12:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((5 * ((Math.random() * 0.25) + 1)));
createNewEnemy(1);
} else {
realTimeToNextEnemy--;
};
break;
case 13:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((9 * ((Math.random() * 0.25) + 1)));
createNewEnemy(3);
} else {
realTimeToNextEnemy--;
};
break;
case 14:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((7 * ((Math.random() * 0.25) + 1)));
createNewEnemy(4);
} else {
realTimeToNextEnemy--;
};
break;
case 15:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((12 * ((Math.random() * 0.25) + 1)));
createNewEnemy(5);
} else {
realTimeToNextEnemy--;
};
break;
case 16:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((6 * ((Math.random() * 0.25) + 1)));
createNewEnemy(3, 1.5);
} else {
realTimeToNextEnemy--;
};
if (realTimeToNextEnemy2 == 0){
realTimeToNextEnemy2 = int((12 * ((Math.random() * 0.25) + 1)));
createNewEnemy(1, 2);
} else {
realTimeToNextEnemy2--;
};
break;
case 17:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((10 * ((Math.random() * 0.25) + 1)));
createNewEnemy(7);
} else {
realTimeToNextEnemy--;
};
break;
case 18:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((18 * ((Math.random() * 0.25) + 1)));
createNewEnemy(8);
} else {
realTimeToNextEnemy--;
};
break;
case 19:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((10 * ((Math.random() * 0.25) + 1)));
createNewEnemy(9, 2.5);
} else {
realTimeToNextEnemy--;
};
break;
case 110:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((8 * ((Math.random() * 0.25) + 1)));
createNewEnemy(4);
} else {
realTimeToNextEnemy--;
};
if (realTimeToNextEnemy2 == 0){
realTimeToNextEnemy2 = int((17 * ((Math.random() * 0.25) + 1)));
createNewEnemy(5);
} else {
realTimeToNextEnemy2--;
};
break;
case 111:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((20 * ((Math.random() * 0.25) + 1)));
createNewEnemy(8, 1.5);
} else {
realTimeToNextEnemy--;
};
if (realTimeToNextEnemy2 == 0){
realTimeToNextEnemy2 = int((15 * ((Math.random() * 0.25) + 1)));
createNewEnemy(9, 1.5);
} else {
realTimeToNextEnemy2--;
};
break;
case 112:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((20 * ((Math.random() * 0.25) + 1)));
createNewEnemy(7, 2.4);
} else {
realTimeToNextEnemy--;
};
if (realTimeToNextEnemy2 == 0){
realTimeToNextEnemy2 = int((18 * ((Math.random() * 0.25) + 1)));
createNewEnemy(9, 2.4);
} else {
realTimeToNextEnemy2--;
};
break;
case 21:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((30 * ((Math.random() * 0.25) + 1)));
createNewEnemyGroup(21);
} else {
realTimeToNextEnemy--;
};
break;
case 22:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((20 * ((Math.random() * 0.25) + 1)));
createNewEnemyGroup(221);
} else {
realTimeToNextEnemy--;
};
if (realTimeToNextEnemy2 == 0){
realTimeToNextEnemy2 = int((35 * ((Math.random() * 0.25) + 1)));
createNewEnemyGroup(222);
} else {
realTimeToNextEnemy2--;
};
break;
case 23:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((20 * ((Math.random() * 0.25) + 1)));
createNewEnemyGroup(21, 3);
} else {
realTimeToNextEnemy--;
};
if (realTimeToNextEnemy2 == 0){
createNewEnemyGroup(222, 2);
createNewEnemyGroup(221, 2);
realTimeToNextEnemy2 = int((34 * ((Math.random() * 0.25) + 1)));
} else {
realTimeToNextEnemy2--;
};
break;
case 24:
if (realTimeToNextEnemy == 0){
realTimeToNextEnemy = int((30 * ((Math.random() * 0.25) + 1)));
createNewEnemyGroup(23, 2);
} else {
realTimeToNextEnemy--;
};
if (realTimeToNextEnemy2 == 0){
createNewEnemyGroup(24, 1.5);
realTimeToNextEnemy2 = int((44 * ((Math.random() * 0.25) + 1)));
} else {
realTimeToNextEnemy2--;
};
break;
case 41:
if (!fightingABoss){
bossFight(1);
stageGame.bossHint.alpha = 15;
};
break;
case 42:
if (!fightingABoss){
bossFight(2);
};
break;
case 43:
if (!fightingABoss){
bossFight(3);
};
break;
case 44:
if (!fightingABoss){
bossFight(4);
};
break;
case 45:
if (!fightingABoss){
bossFight(5);
Main(parent).starNewGameLoop("bossA");
};
break;
case 50:
if (!finalBossMoment){
while (hero.level < 8) {
hero.experiencePoints = hero.neededXPToLevelUp[(hero.level - 1)];
hero.checkLevelUp();
};
stageGame.gamePlace.gotoAndStop((stageGame.gamePlace.currentFrame + 1));
dynamicMovingTimeDuration = 50;
dynamicMovingTime = 6;
changingScreenProportion = -1;
zoomLevel = 0.5;
finalBoss = new FinalBoss(this);
stageGame.gamePlace.gamePlaceInside.addChild(finalBoss);
stageGame.gamePlace.gamePlaceInside.setChildIndex(hero, (stageGame.gamePlace.gamePlaceInside.numChildren - 1));
finalBoss.x = 0;
finalBoss.y = (-205 - (finalBoss.height * 0.5));
finalBossMoment = true;
Main(parent).starNewGameLoop("bossB");
bossHealthBar = new BossHealthBar();
stageGame.gamePlace.gamePlaceInside.addChild(bossHealthBar);
bossHealthBar.y = 182;
updateHUD("bossHealth");
dangerAlert.alpha = 1;
stageGame.waveNumber.alpha = (stageGame.multiplierClock.alpha = (stageGame.level.alpha = (stageGame.levelText.alpha = 0)));
stageGame.multiplierText.alpha = (stageGame.expBar.alpha = (stageGame.waveText.alpha = (stageGame.waveNumber.alpha = 0)));
};
};
};
};
}
private function qualityCheck():void{
var _local2:Number;
var _local1:Boolean;
if (checkQuality > 0){
if (fpsCounter.lastPerformance != last10Performances[(checkQuality - 1)]){
_local1 = true;
};
} else {
_local1 = true;
};
if (_local1){
last10Performances[checkQuality] = fpsCounter.lastPerformance;
checkQuality++;
if (checkQuality == 10){
checkQuality = 0;
_local2 = 0;
i = 0;
while (i <= 9) {
_local2 = (_local2 + last10Performances[i]);
i++;
};
_local2 = (_local2 / 10);
if ((((((_local2 < 28)) && ((_local2 > 22)))) && ((graphicQuality > 1)))){
changeQuality(-1);
};
if (_local2 <= 22){
if (graphicQuality > 2){
changeQuality(-2);
} else {
if (graphicQuality > 1){
changeQuality(-1);
};
};
};
if (((fightingABoss) || (finalBossMoment))){
if ((((_local2 >= 30)) && ((graphicQuality < 2)))){
changeQuality(1);
};
} else {
if ((((_local2 >= 29.75)) && ((graphicQuality < 4)))){
changeQuality(1);
};
};
};
};
}
public function updateHUD(_arg1:String):void{
switch (_arg1){
case "bomb":
if (hero.holdingBombs >= 1){
stageGame.bomb1.gotoAndStop(2);
} else {
stageGame.bomb1.gotoAndStop(1);
};
if (hero.holdingBombs >= 2){
stageGame.bomb2.gotoAndStop(2);
} else {
stageGame.bomb2.gotoAndStop(1);
};
if (hero.holdingBombs >= 3){
stageGame.bomb3.gotoAndStop(2);
} else {
stageGame.bomb3.gotoAndStop(1);
};
break;
case "hp":
if (hero.realHP > hero.basicHP){
hero.realHP = hero.basicHP;
};
heroHealthBar.filler.scaleX = (hero.realHP / hero.basicHP);
heroHealthBar.alpha = 1.75;
if ((hero.realHP / hero.basicHP) <= 0.5){
lowHealthAlert.alpha = 1;
heroHealthBar.filler.gotoAndStop(2);
} else {
heroHealthBar.filler.gotoAndStop(1);
lowHealthAlert.alpha = 0;
if (lowHealthAlert.text.alpha > 0){
lowHealthAlert.text.alpha = 6;
};
};
break;
case "power":
heroPowerBar.filler.scaleX = (hero.powerGauge / 1000);
heroPowerBar.alpha = 1.5;
break;
case "experiencePoints":
stageGame.expBar.content.scaleX = (hero.experiencePoints / hero.neededXPToLevelUp[(hero.level - 1)]);
break;
case "multiplier":
stageGame.multiplierText.text = (hero.multiplier.toString() + "x");
if (hero.multiplier >= 90){
Main(parent).createAnAchievement(6);
};
hero.resetMultiplierTime();
break;
case "multiplierTime":
stageGame.multiplierClock.gotoAndStop(int((((hero.basicTimeToLoseMultiplier - hero.realTimeToloseMultiplier) / hero.basicTimeToLoseMultiplier) * 25)));
break;
case "score":
stageGame.scoreField.text = score.toString();
break;
case "waveNumber":
if (waveNumber > 10){
stageGame.waveNumber.text = waveNumber.toString();
} else {
stageGame.waveNumber.text = ("0" + waveNumber.toString());
};
break;
case "bossHealth":
bossHealthBar.filler.scaleX = (finalBoss.realHP / finalBoss.basicHP[(finalBoss.level - 1)]);
break;
};
}
public function playWarningEffect():void{
stageGame.warningMessage.play();
stageGame.warningMessage.alpha = 1;
Main(parent).playSoundEffect("warning");
}
private function updateParallax(_arg1, _arg2:Number):void{
this[("parallax" + _arg1)].y = (this[("parallax" + _arg1)].y + _arg2);
if (this[("parallax" + _arg1)].y > 200){
this[("parallax" + _arg1)].y = -850;
};
}
public function damageShield(_arg1:int):void{
hero.multiplier = (hero.multiplier * 0.8);
updateHUD("multiplier");
if ((shieldTension + _arg1) > shieldMaxTolerance){
if (energyShield.alpha > 0.1){
Main(parent).playSoundEffect("shieldDown");
};
shieldTension = (shieldMaxTolerance + 50);
shieldFunctional = false;
updateHUD("hp");
} else {
Main(parent).playSoundEffect("takeDamage");
if (graphicQuality > 1){
TweenLite.to(energyShield, 0, {tint:0xFF0000});
TweenLite.to(energyShield, 0.5, {removeTint:true});
shakeScreen(1);
};
shieldTension = (shieldTension + (_arg1 * 0.5));
hero.realHP = (hero.realHP - (_arg1 * 0.5));
};
energyShield.alpha = ((500 - shieldTension) / 500);
playerTension = (playerTension + 1000);
}
private function createHeroBullet(_arg1:int):void{
switch (_arg1){
case 11:
createObliqueShot(11, 0, 0);
break;
case 12:
createObliqueShot(11, 0, -8);
createObliqueShot(11, 0, 8);
break;
case 13:
createObliqueShot(12, -6, -8);
createObliqueShot(11, 0, 0);
createObliqueShot(12, 6, 8);
break;
case 14:
createObliqueShot(12, -6, -22);
createObliqueShot(11, 0, -8);
createObliqueShot(11, 0, 8);
createObliqueShot(12, 6, 22);
break;
case 15:
createObliqueShot(13, -6, -26);
createObliqueShot(12, 0, -16);
createObliqueShot(12, 0, 0);
createObliqueShot(12, 0, 16);
createObliqueShot(13, 6, 26);
break;
};
}
public function newWingman():void{
wingmanLevel++;
switch (wingmanLevel){
case 1:
wingman1.visible = true;
break;
case 2:
wingman2.visible = true;
break;
};
}
private function createLoot(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number):void{
lootCreated++;
var _local5:Loot = new Loot(_arg1, _arg2);
_local5.x = _arg3;
_local5.y = _arg4;
stageGame.gamePlace.gamePlaceInside.addChild(_local5);
arrayOfLoot.push(_local5);
}
public function onKeyRelease(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.UP:
upKeyPressed = false;
break;
case Keyboard.DOWN:
downKeyPressed = false;
break;
case Keyboard.LEFT:
leftKeyPressed = false;
break;
case Keyboard.RIGHT:
rightKeyPressed = false;
break;
case KeyCodes.P:
case Keyboard.SPACE:
if (!gameOver){
if (pauseScreen.alpha == 0){
Main(parent).stopGameLoop();
pauseScreen.alpha = 1;
pauseScreen.x = 0;
paused = true;
Main(parent).createAnAchievement(1);
stageGame.gamePlace.stop();
} else {
Main(parent).returnGameLoop();
pauseScreen.alpha = 0;
pauseScreen.x = 700;
paused = false;
if ((((((dynamicMovingTime == 0)) && (!(finalBossMoment)))) && (!(fightingABoss)))){
stageGame.gamePlace.play();
};
};
};
break;
case KeyCodes.S:
sKeyPressed = false;
if (pauseScreen.alpha == 1){
visitSponsor();
};
break;
case KeyCodes.E:
if (pauseScreen.alpha == 1){
stage.quality = StageQuality.HIGH;
removeEventListener(Event.ENTER_FRAME, onTick);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPress);
stage.removeEventListener(KeyboardEvent.KEY_UP, onKeyRelease);
stage.removeEventListener(Event.ACTIVATE, flashActive);
stage.removeEventListener(Event.DEACTIVATE, flashDeactive);
Main(parent).stopGameLoop();
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("main");
};
break;
case KeyCodes.D:
if (((((!(paused)) && (!(gameOver)))) && ((bombFlash.alpha <= 0)))){
blowABomb();
};
break;
};
}
private function createNewEnemyGroup(_arg1:int, _arg2:Number=1):void{
var _local3:Enemy;
var _local4:Enemy;
var _local5:Enemy;
var _local6:Number;
var _local7:Number;
switch (_arg1){
case 21:
_local6 = 3.6;
_local3 = new Enemy(this, 22, _arg2);
_local3.y = (-200 - _local3.halfHeight);
_local3.ySpeed = _local6;
_local4 = new Enemy(this, 21, _arg2);
_local4.y = ((-200 - _local4.halfHeight) - 15);
_local4.ySpeed = _local6;
_local4.direction = "left";
_local5 = new Enemy(this, 21, _arg2);
_local5.y = ((-200 - _local4.halfHeight) - 15);
_local5.ySpeed = _local6;
_local5.direction = "right";
_local7 = (-120 + (Math.random() * 250));
_local3.x = _local7;
_local4.x = (((_local7 - _local3.halfWidth) - _local4.halfWidth) - 5);
_local5.x = (((_local7 + _local3.halfWidth) + _local5.halfWidth) + 5);
_local3.shooter = (_local4.shooter = (_local5.shooter = true));
_local3.basicTimeToShot = (_local3.realTimeToShot = 20);
_local4.basicTimeToShot = (_local5.basicTimeToShot = (_local4.realTimeToShot = (_local5.realTimeToShot = 35)));
_local3.howIsShoot = (_local4.howIsShoot = (_local5.howIsShoot = "down"));
stageGame.gamePlace.gamePlaceInside.addChild(_local3);
arrayOfEnemy.push(_local3);
stageGame.gamePlace.gamePlaceInside.addChild(_local4);
arrayOfEnemy.push(_local4);
stageGame.gamePlace.gamePlaceInside.addChild(_local5);
arrayOfEnemy.push(_local5);
break;
case 221:
_local4 = new Enemy(this, 61, _arg2);
_local4.y = -100;
_local4.x = (165 + _local4.halfWidth);
_local4.xSpeed = -2.4;
_local4.rotation = -180;
_local4.shooter = true;
_local4.basicTimeToShot = 70;
_local4.realTimeToShot = (30 * Math.random());
stageGame.gamePlace.gamePlaceInside.addChild(_local4);
arrayOfEnemy.push(_local4);
break;
case 222:
_local3 = new Enemy(this, 62, _arg2);
_local3.y = -150;
_local3.x = (-165 - _local3.halfWidth);
_local3.xSpeed = 2.8;
_local3.shooter = true;
_local3.basicTimeToShot = 100;
_local3.realTimeToShot = (20 * Math.random());
_local3.howIsShoot = "3Spread";
stageGame.gamePlace.gamePlaceInside.addChild(_local3);
arrayOfEnemy.push(_local3);
break;
case 23:
_local3 = new Enemy(this, 72, _arg2);
_local3.y = (-200 - _local3.halfHeight);
_local3.x = 0;
_local3.ySpeed = 3.7;
_local4 = new Enemy(this, 71, _arg2);
_local4.x = -100;
_local5 = new Enemy(this, 71, _arg2);
_local4.y = (_local5.y = ((-200 - _local5.halfHeight) - 15));
_local5.x = 100;
_local4.ySpeed = (_local5.ySpeed = 3);
_local3.rotation = (_local4.rotation = (_local5.rotation = 90));
stageGame.gamePlace.gamePlaceInside.addChild(_local3);
arrayOfEnemy.push(_local3);
stageGame.gamePlace.gamePlaceInside.addChild(_local4);
arrayOfEnemy.push(_local4);
stageGame.gamePlace.gamePlaceInside.addChild(_local5);
arrayOfEnemy.push(_local5);
break;
case 24:
_local3 = new Enemy(this, 82, _arg2);
_local3.x = 50;
_local3.xSpeed = 0.3;
_local4 = new Enemy(this, 82, _arg2);
_local3.y = (_local4.y = ((-200 - _local4.halfHeight) - 15));
_local4.x = -50;
_local3.ySpeed = (_local4.ySpeed = 2.5);
_local4.xSpeed = -0.3;
stageGame.gamePlace.gamePlaceInside.addChild(_local3);
arrayOfEnemy.push(_local3);
stageGame.gamePlace.gamePlaceInside.addChild(_local4);
arrayOfEnemy.push(_local4);
break;
};
}
}
}//package GamePlay
Section 43
//Loot (GamePlay.Loot)
package GamePlay {
import flash.display.*;
import flash.utils.*;
public class Loot extends Sprite {
public var makeSound:Boolean;
private var graphic31:LootImage31;
public var falling:Boolean;// = true
private var graphic11:LootImage11;
public var halfHeight:Number;
public var ySpeed:Number;
public var timeToCalcDist:int;// = 10
private var graphic41:LootImage41;
private var graphic21:LootImage21;
public var xSpeed:Number;// = 0
public var value:int;
public var type:int;
public var valid:Boolean;// = true
public function Loot(_arg1:int, _arg2:int, _arg3:Boolean=true){
type = _arg1;
value = _arg2;
makeSound = _arg3;
ySpeed = ((-2 * Math.random()) - 1);
var _local4:Class = (getDefinitionByName(("LootImage" + type)) as Class);
this[("graphic" + type)] = new (_local4);
addChild(this[("graphic" + type)]);
halfHeight = (height * 0.5);
}
public function update(_arg1:Number):void{
if (timeToCalcDist > 0){
timeToCalcDist--;
};
y = (y + (ySpeed * _arg1));
x = (x + (xSpeed * _arg1));
}
}
}//package GamePlay
Section 44
//MegaLaser (GamePlay.MegaLaser)
package GamePlay {
import flash.display.*;
public class MegaLaser extends Sprite {
public var makeSound:Boolean;// = false
public var action:int;
private var graphic:MegaLaserImage;
public function MegaLaser(){
graphic = new MegaLaserImage();
graphic.gotoAndStop(1);
addChild(graphic);
}
public function update():void{
if (action == 0){
if (alpha < 0.5){
alpha = (alpha + 0.02);
} else {
alpha = 1;
action = 1;
graphic.gotoAndStop(2);
makeSound = true;
};
};
if (action == 1){
if (alpha > 0){
alpha = (alpha - 0.08);
} else {
alpha = 0;
action = 2;
};
};
}
}
}//package GamePlay
Section 45
//PauseScreen (GamePlay.PauseScreen)
package GamePlay {
import flash.display.*;
public class PauseScreen extends Sprite {
private var image:PauseScreenImage;
public function PauseScreen(){
image = new PauseScreenImage();
super();
addChild(image);
}
}
}//package GamePlay
Section 46
//AchievementsScreen (Menus.AchievementsScreen)
package Menus {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import Achievements.*;
import com.greensock.plugins.*;
public class AchievementsScreen extends Sprite {
private var line:int;
private var base:AchievementsScreenBase;
private var positionNumber:int;// = 1
private var arrayOfDisplayedAchieves:Array;
private var column:int;
private var calculatedX:int;
private var calculatedY:int;
private var messageBalloon:MessageBalloon;
public function AchievementsScreen(){
arrayOfDisplayedAchieves = new Array();
super();
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
base = new AchievementsScreenBase();
addChild(base);
}
private function removeAllListeners():void{
var _local2:AchievementShow;
var _local1:int = (arrayOfDisplayedAchieves.length - 1);
while (_local1 > -1) {
_local2 = arrayOfDisplayedAchieves[_local1];
_local2.removeEventListener(MouseEvent.ROLL_OVER, showDesc);
_local2.removeEventListener(MouseEvent.ROLL_OUT, removeDesc);
removeChild(_local2);
_local2 = null;
_local1--;
};
base.aboutBonus.removeEventListener(MouseEvent.ROLL_OVER, showDesc);
base.aboutBonus.removeEventListener(MouseEvent.ROLL_OUT, removeDesc);
base.mainMenu.removeEventListener(MouseEvent.ROLL_OVER, shineButton);
base.mainMenu.removeEventListener(MouseEvent.ROLL_OUT, removeDesc);
base.mainMenu.removeEventListener(MouseEvent.CLICK, gotoMainMenu);
}
private function update(_arg1:Event):void{
if (messageBalloon.visible){
messageBalloon.updatePos(mouseX, mouseY);
};
}
private function calculateNextPlace():void{
if (line < 21){
line++;
} else {
line = 1;
column++;
};
calculatedX = (24 + (column * 282));
calculatedY = ((line * 22) + 32);
}
private function onAddToStage(_arg1:Event):void{
var _local3:int;
calculateNextPlace();
showAchievement(1);
showAchievement(2);
showAchievement(3);
showAchievement(8);
showAchievement(11);
showAchievement(12);
showAchievement(5);
showAchievement(4);
showAchievement(9);
showAchievement(10);
showAchievement(6);
showAchievement(7);
showAchievement(37);
showAchievement(38);
showAchievement(39);
showAchievement(40);
showAchievement(13);
showAchievement(14);
showAchievement(15);
showAchievement(16);
showAchievement(41);
showAchievement(17);
showAchievement(18);
showAchievement(19);
showAchievement(20);
showAchievement(21);
showAchievement(22);
showAchievement(23);
showAchievement(24);
showAchievement(25);
showAchievement(26);
showAchievement(27);
showAchievement(28);
showAchievement(29);
showAchievement(30);
showAchievement(31);
showAchievement(32);
showAchievement(33);
showAchievement(34);
showAchievement(35);
showAchievement(36);
showAchievement(42);
messageBalloon = new MessageBalloon();
addChild(messageBalloon);
var _local2:int = Main(parent).calculatePlayerPatentCode();
base.patentImage.gotoAndStop((_local2 + 1));
base.scoreText.text = Main(parent).totalAchievementScore.toString();
if (Main(parent).totalAchievementsNumber < 10){
base.gottenText.text = ("0" + Main(parent).totalAchievementsNumber);
} else {
base.gottenText.text = Main(parent).totalAchievementsNumber.toString();
};
switch (_local2){
case 0:
_local3 = 0;
break;
case 1:
_local3 = 3;
break;
case 2:
_local3 = 8;
break;
case 3:
_local3 = 15;
break;
case 4:
_local3 = 25;
break;
};
base.bonusPatent.text = (("+" + _local3.toString()) + "% BONUS POWER");
base.aboutBonus.addEventListener(MouseEvent.ROLL_OVER, showDesc, false, 0, true);
base.aboutBonus.addEventListener(MouseEvent.ROLL_OUT, removeDesc, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OUT, removeDesc, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.CLICK, gotoMainMenu, false, 0, true);
}
private function showDesc(_arg1:MouseEvent):void{
if ((_arg1.target is AchievementShow)){
messageBalloon.newMessage(_arg1.target.myDesc);
} else {
messageBalloon.newMessage("Your patent level gives you a bonus\r power in any game mode");
};
Main(parent).playSoundEffect("button1");
TweenLite.to(_arg1.target, 0, {tint:0xFF0000});
}
private function showAchievement(_arg1:int):void{
var _local2:Array = Main(parent).achievementList(_arg1);
var _local3:AchievementShow = new AchievementShow(_local2[0], _local2[1], _local2[2], Main(parent).arrayBooleanOfAchievements[_arg1], positionNumber);
_local3.x = calculatedX;
_local3.y = calculatedY;
addChild(_local3);
arrayOfDisplayedAchieves.push(_local3);
TweenLite.to(AchievementShow, 0.8, {removeTint:true});
_local3.addEventListener(MouseEvent.ROLL_OVER, showDesc, false, 0, true);
_local3.addEventListener(MouseEvent.ROLL_OUT, removeDesc, false, 0, true);
positionNumber++;
calculateNextPlace();
}
private function removeDesc(_arg1:MouseEvent):void{
messageBalloon.turnOff = true;
TweenLite.to(_arg1.target, 1, {removeTint:true});
}
private function gotoMainMenu(_arg1:MouseEvent):void{
removeAllListeners();
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("main");
}
private function shineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.2, {tint:0xFF0000});
Main(parent).playSoundEffect("button1");
}
}
}//package Menus
Section 47
//ChallengeClear (Menus.ChallengeClear)
package Menus {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import mochi.as3.*;
import flash.net.*;
import com.greensock.plugins.*;
public class ChallengeClear extends Sprite {
private var base:ChallengeClearBase;
private var totalTimeInFrames:int;
public function ChallengeClear(){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
base = new ChallengeClearBase();
addChild(base);
addEventListener(Event.ADDED_TO_STAGE, addedToStage);
base.logoSpo.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
base.submitScore.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.submitScore.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.submitScore.addEventListener(MouseEvent.CLICK, submitScore, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.CLICK, gotoMainMenu, false, 0, true);
base.playAgain.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.playAgain.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.playAgain.addEventListener(MouseEvent.CLICK, gotoGame, false, 0, true);
}
private function gotoGame(_arg1:MouseEvent):void{
Main(parent).stopSoundChannel();
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("selectSpaceship");
}
private function submitScore(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
var o:Object = {n:[8, 0, 13, 13, 15, 12, 3, 7, 2, 5, 14, 5, 6, 12, 12, 3], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:int(((totalTimeInFrames * 1000) / 30))});
}
private function removeShineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.8, {removeTint:true});
}
private function addedToStage(_arg1:Event):void{
var _local5:String;
var _local7:String;
Main(parent).startMenuLoop(2);
totalTimeInFrames = Main(parent).timeSpentInBosses;
var _local2:int = int((totalTimeInFrames / 1800));
var _local3:int = int(((totalTimeInFrames - (_local2 * 1800)) / 30));
var _local4:Number = ((totalTimeInFrames - (_local2 * 1800)) / 30);
if (_local3 < 10){
_local5 = ("0" + _local3.toString());
} else {
_local5 = _local3.toString();
};
var _local6:int = ((_local4 - _local3) * 1000);
if (_local6 < 100){
_local7 = ("0" + _local6.toString());
} else {
_local7 = _local6.toString();
};
base.timeText.text = ((((_local2 + ":") + _local5) + ".") + _local6);
}
private function gotoMainMenu(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("main");
}
private function shineButton(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button1");
TweenLite.to(_arg1.target, 0.15, {tint:0xFF0000});
}
private function visitSponsor(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
Main(parent).createAnAchievement(42);
var url = "http://www.dwarfgames.com/?utm_source=ingame&utm_medium=sponsoredgames&utm_campaign=nokkians2/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
}
}//package Menus
Section 48
//ChallengeStart (Menus.ChallengeStart)
package Menus {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import flash.net.*;
import com.greensock.plugins.*;
public class ChallengeStart extends Sprite {
private var base:ChallengeStartBase;
public function ChallengeStart(){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
base = new ChallengeStartBase();
addChild(base);
base.mainMenu.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.CLICK, gotoMainMenu, false, 0, true);
addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
}
private function onAddToStage(_arg1:Event):void{
if (Main(parent).challengeUnlocked == true){
base.shieldButton.gotoAndStop(1);
} else {
base.shieldButton.gotoAndStop(2);
};
base.shieldButton.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.shieldButton.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.shieldButton.addEventListener(MouseEvent.CLICK, tryToPlay, false, 0, true);
}
private function removeShineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.8, {removeTint:true});
}
private function tryToPlay(_arg1:MouseEvent):void{
var url:String;
var request:URLRequest;
var mouseEvent = _arg1;
if (Main(parent).challengeUnlocked == true){
Main(parent).isChallengeModeActive = true;
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("selectSpaceship");
} else {
Main(parent).wantedToPlayChallenge();
Main(parent).createAnAchievement(42);
url = "http://www.dwarfgames.com/game/1707/the-nokkians-2.html";
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
};
}
private function gotoMainMenu(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("main");
}
private function shineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.15, {tint:0xFF0000});
Main(parent).playSoundEffect("button1");
}
}
}//package Menus
Section 49
//CreditsScreen (Menus.CreditsScreen)
package Menus {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import flash.net.*;
import com.greensock.plugins.*;
public class CreditsScreen extends Sprite {
private var base:CreditsMenuBase;
public function CreditsScreen(){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
base = new CreditsMenuBase();
addChild(base);
base.mainMenu.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OUT, removeDesc, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.CLICK, gotoMainMenu, false, 0, true);
base.logoDev.addEventListener(MouseEvent.CLICK, visitAwokerGames, false, 0, true);
base.nokkians1.addEventListener(MouseEvent.CLICK, playNokkians1, false, 0, true);
base.sponsorClick.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
}
private function removeDesc(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.8, {removeTint:true});
}
private function playNokkians1(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
Main(parent).createAnAchievement(42);
var url = "http://www.kongregate.com/games/Awoke/the-nokkians-i/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function visitAwokerGames(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
Main(parent).createAnAchievement(41);
var url = "http://www.awokergames.com/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function gotoMainMenu(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("main");
}
private function shineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.2, {tint:0xFF0000});
Main(parent).playSoundEffect("button1");
}
private function visitSponsor(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
Main(parent).createAnAchievement(42);
var url = "http://www.dwarfgames.com/?utm_source=ingame&utm_medium=sponsoredgames&utm_campaign=nokkians2/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
}
}//package Menus
Section 50
//GameOverScreen (Menus.GameOverScreen)
package Menus {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import mochi.as3.*;
import flash.net.*;
import com.greensock.plugins.*;
public class GameOverScreen extends Sprite {
private var base:GameOverBase;
public var bruteScore:int;
public function GameOverScreen(){
base = new GameOverBase();
addChild(base);
base.logoSpo.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
base.playMore.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
base.mainMenuButton.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.mainMenuButton.addEventListener(MouseEvent.ROLL_OUT, removeDesc, false, 0, true);
base.mainMenuButton.addEventListener(MouseEvent.CLICK, gotoMainMenu, false, 0, true);
base.retryButton.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.retryButton.addEventListener(MouseEvent.ROLL_OUT, removeDesc, false, 0, true);
base.retryButton.addEventListener(MouseEvent.CLICK, gotoGame, false, 0, true);
base.submitScore.addEventListener(MouseEvent.CLICK, submitScore, false, 0, true);
base.submitScore.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.submitScore.addEventListener(MouseEvent.ROLL_OUT, removeDesc, false, 0, true);
addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
}
private function onAddToStage(_arg1:Event):void{
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
if (Main(parent).newPatentLevel){
Main(parent).newPatentLevel = false;
} else {
base.patentUpgrade.visible = false;
};
if (Main(parent).isChallengeModeActive){
base.score.visible = false;
base.submitScore.visible = false;
};
bruteScore = Main(parent).bruteSCore;
base.score.text = bruteScore.toString();
}
private function removeDesc(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.8, {removeTint:true});
}
private function gotoGame(_arg1:MouseEvent):void{
Main(parent).stopSoundChannel();
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("selectSpaceship");
}
public function submitScore(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
var o:Object = {n:[3, 0, 14, 8, 2, 10, 15, 0, 6, 11, 5, 8, 2, 5, 11, 5], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:bruteScore});
}
private function gotoMainMenu(_arg1:MouseEvent):void{
Main(parent).stopSoundChannel();
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("main");
}
private function shineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.2, {tint:0xFF0000});
Main(parent).playSoundEffect("button1");
}
private function visitSponsor(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
Main(parent).createAnAchievement(42);
var url = "http://www.dwarfgames.com/?utm_source=ingame&utm_medium=sponsoredgames&utm_campaign=nokkians2/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
}
}//package Menus
Section 51
//MainMenuScreen (Menus.MainMenuScreen)
package Menus {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import flash.net.*;
import com.greensock.plugins.*;
public class MainMenuScreen extends Sprite {
private var base:MainMenuBase;
public function MainMenuScreen(){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
base = new MainMenuBase();
addChild(base);
base.storyMode.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.storyMode.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.storyMode.addEventListener(MouseEvent.CLICK, gotoStoryMode, false, 0, true);
base.challengeMode.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.challengeMode.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.challengeMode.addEventListener(MouseEvent.CLICK, gotoChallengeMode, false, 0, true);
base.achievementsRoom.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.achievementsRoom.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.achievementsRoom.addEventListener(MouseEvent.CLICK, gotoAchievementsRoom, false, 0, true);
base.credits.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.credits.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.credits.addEventListener(MouseEvent.CLICK, gotoCredits, false, 0, true);
base.logoSpo.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
base.playMoreGames.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
base.yourSite.addEventListener(MouseEvent.CLICK, yourSite, false, 0, true);
base.jayIsGames.addEventListener(MouseEvent.CLICK, visitJay, false, 0, true);
addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
}
private function onAddToStage(_arg1:Event):void{
Main(parent).startMenuLoop(1);
}
private function gotoChallengeMode(_arg1:MouseEvent):void{
removeAllListeners();
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("challengeStart");
}
private function removeAllListeners():void{
base.storyMode.removeEventListener(MouseEvent.ROLL_OVER, shineButton);
base.storyMode.removeEventListener(MouseEvent.ROLL_OUT, removeShineButton);
base.storyMode.removeEventListener(MouseEvent.CLICK, gotoStoryMode);
base.challengeMode.removeEventListener(MouseEvent.ROLL_OVER, shineButton);
base.challengeMode.removeEventListener(MouseEvent.ROLL_OUT, removeShineButton);
base.challengeMode.removeEventListener(MouseEvent.CLICK, gotoChallengeMode);
base.achievementsRoom.removeEventListener(MouseEvent.ROLL_OVER, shineButton);
base.achievementsRoom.removeEventListener(MouseEvent.ROLL_OUT, removeShineButton);
base.achievementsRoom.removeEventListener(MouseEvent.CLICK, gotoAchievementsRoom);
base.credits.removeEventListener(MouseEvent.ROLL_OVER, shineButton);
base.credits.removeEventListener(MouseEvent.ROLL_OUT, removeShineButton);
base.credits.removeEventListener(MouseEvent.CLICK, gotoCredits);
}
private function visitSponsor(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
Main(parent).createAnAchievement(42);
var url = "http://www.dwarfgames.com/?utm_source=ingame&utm_medium=sponsoredgames&utm_campaign=nokkians2/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function yourSite(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
var url = "http://www.flobmedia.com/games-for-you-website";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function gotoStoryMode(_arg1:MouseEvent):void{
removeAllListeners();
Main(parent).isChallengeModeActive = false;
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("storyStart");
}
private function visitJay(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
var url = "http://jayisgames.com/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function removeShineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.8, {removeTint:true});
}
private function gotoAchievementsRoom(_arg1:MouseEvent):void{
removeAllListeners();
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("achievement");
}
private function shineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.15, {tint:0xFF0000});
Main(parent).playSoundEffect("button1");
}
private function gotoCredits(_arg1:MouseEvent):void{
removeAllListeners();
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("credits");
}
}
}//package Menus
Section 52
//PerformanceScreen (Menus.PerformanceScreen)
package Menus {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import mochi.as3.*;
import flash.net.*;
import com.greensock.plugins.*;
public class PerformanceScreen extends Sprite {
private var TSBest:int;// = 10000
private var relaxTime:int;// = 15
private var DTBest:int;// = 8000
private var totalTimeCalculating:int;
private var KEValue:int;
private var TSValue:int;
private var LCValue:int;
private var totalModifier:Number;// = 0
private var KEWorst:int;// = 50
private var finalScore:int;
private var LCWorst:int;// = 50
private var DTValue:int;
private var DTWorst:int;// = 22000
private var base:PerformanceScreenBase;
private var TSWorst:int;// = 25000
private var actionInt:int;// = 1
private var yellowFlash:YellowFlash;
private var KEBest:int;// = 99
private var scoreReached:int;
private var bruteScore:Number;
private var timeCalculated:int;
private var LCBest:int;// = 99
public function PerformanceScreen(){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
base = new PerformanceScreenBase();
addChild(base);
yellowFlash = new YellowFlash();
yellowFlash.alpha = 0;
addChild(yellowFlash);
yellowFlash.x = 600;
base.finalScoreValue.alpha = 0;
base.finalScoreText.alpha = 0;
base.newHighscore.alpha = 0;
base.newPatentLevel.alpha = 0;
base.submitScoreButton.alpha = 0;
base.continueButton.alpha = 0;
base.submitScoreButton.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.submitScoreButton.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.submitScoreButton.addEventListener(MouseEvent.CLICK, submitScore, false, 0, true);
base.continueButton.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.continueButton.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.continueButton.addEventListener(MouseEvent.CLICK, gotoAchievementsRoom, false, 0, true);
base.logoSpo.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
base.playMoreGames.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
base.yourSite.addEventListener(MouseEvent.CLICK, yourSite, false, 0, true);
base["KEBar"].scaleX = (base["LCBar"].scaleX = (base["TSBar"].scaleX = (base["DTBar"].scaleX = 0)));
addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
addEventListener(Event.ENTER_FRAME, onTick, false, 0, true);
}
private function shineButton(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button1");
TweenLite.to(_arg1.target, 0.15, {tint:0xFF0000});
}
private function yourSite(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
var url = "http://www.flobmedia.com/games-for-you-website";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function onTick(_arg1:Event):void{
var _local2:int;
if ((((yellowFlash.alpha > 0)) && ((actionInt == 8)))){
yellowFlash.alpha = (yellowFlash.alpha - 0.07);
if (yellowFlash.alpha <= 0){
yellowFlash.x = 600;
removeChild(yellowFlash);
};
};
if (relaxTime > 0){
relaxTime--;
} else {
if (actionInt <= 4){
switch (actionInt){
case 1:
updateCalcule("KE");
break;
case 2:
updateCalcule("LC");
break;
case 3:
updateCalcule("TS");
break;
case 4:
updateCalcule("DT");
break;
};
} else {
if (actionInt < 10){
switch (actionInt){
case 5:
Main(parent).playSoundEffect("levelUp");
TweenLite.to(base.totalModifier.inside, 0.2, {tint:0xFFFFFF});
TweenLite.to(base.totalModifier.inside, 2, {removeTint:true});
actionInt++;
relaxTime = 30;
break;
case 6:
base.finalScoreText.alpha = 1;
TweenLite.to(base.finalScoreText, 0, {tint:0xFFFF00});
TweenLite.to(base.finalScoreText, 2, {removeTint:true});
relaxTime = 10;
actionInt++;
Main(parent).playSoundEffect("armorLoot");
totalTimeCalculating = 60;
timeCalculated = 0;
if (totalModifier >= 40){
Main(parent).createAnAchievement(29);
};
if (totalModifier >= 60){
Main(parent).createAnAchievement(30);
};
if (totalModifier >= 80){
Main(parent).createAnAchievement(31);
};
if (totalModifier >= 95){
Main(parent).createAnAchievement(32);
};
break;
case 7:
if (timeCalculated == 0){
base.finalScoreValue.alpha = 1;
TweenLite.to(base.finalScoreValue, 0, {tint:0xFFFF00});
TweenLite.to(base.finalScoreValue, 2, {removeTint:true});
finalScore = int((bruteScore * (1 + (totalModifier / 100))));
base.finalScoreValue.text = "0";
};
if (timeCalculated === totalTimeCalculating){
relaxTime = 20;
actionInt++;
TweenLite.to(base.finalScoreValue, 0, {tint:0xFFFF00});
TweenLite.to(base.finalScoreValue, 2, {removeTint:true});
Main(parent).playSoundEffect("button3");
base.finalScoreValue.text = finalScore.toString();
if (finalScore > Main(parent).currentHighScore){
base.newHighscore.alpha = 1;
Main(parent).currentHighScore = finalScore;
};
if (Main(parent).newPatentLevel){
base.newPatentLevel.alpha = 1;
Main(parent).newPatentLevel = false;
};
yellowFlash.alpha = 1;
} else {
timeCalculated++;
TweenLite.to(base.finalScoreValue, 0, {tint:0xFFFF00});
TweenLite.to(base.finalScoreValue, 2, {removeTint:true});
_local2 = int(((timeCalculated / totalTimeCalculating) * finalScore));
base.finalScoreValue.text = _local2.toString();
};
break;
case 8:
base.submitScoreButton.alpha = 1;
TweenLite.to(base.submitScoreButton, 0, {tint:0xFFFF00});
TweenLite.to(base.submitScoreButton, 2, {removeTint:true});
relaxTime = 80;
actionInt++;
Main(parent).playSoundEffect("armorLoot");
break;
case 9:
base.continueButton.alpha = 1;
TweenLite.to(base.continueButton, 0, {tint:0xFFFF00});
TweenLite.to(base.continueButton, 2, {removeTint:true});
relaxTime = 0;
actionInt++;
Main(parent).playSoundEffect("armorLoot");
break;
};
};
};
};
}
private function onAddToStage(_arg1:Event):void{
Main(parent).startMenuLoop(2);
KEValue = Main(parent).defeatedEnemiesPercent;
LCValue = Main(parent).collectedLootPercent;
TSValue = Main(parent).timeSpentInBosses;
DTValue = Main(parent).damageTaken;
bruteScore = Main(parent).bruteSCore;
calculateScore("KE");
}
private function gotoAchievementsRoom(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("achievement");
}
private function updateCalcule(_arg1:String):void{
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:String;
if (timeCalculated < totalTimeCalculating){
timeCalculated++;
base[(_arg1 + "Bar")].scaleX = (((timeCalculated / totalTimeCalculating) * scoreReached) * 0.2);
_local2 = base[(_arg1 + "Bar")].scaleX;
switch (_arg1){
case "KE":
base[(_arg1 + "Value")].text = ((int(((this[(_arg1 + "Value")] * _local2) * 10)) / 10) + "%");
break;
case "LC":
base[(_arg1 + "Value")].text = ((int(((this[(_arg1 + "Value")] * _local2) * 10)) / 10) + "%");
break;
case "TS":
_local3 = int(((this[(_arg1 + "Value")] * _local2) / 1800));
_local4 = int((((this[(_arg1 + "Value")] * _local2) - (_local3 * 1800)) / 30));
if (_local4 < 10){
_local5 = ("0" + _local4.toString());
} else {
_local5 = _local4.toString();
};
base[(_arg1 + "Value")].text = ((("0" + _local3) + ":") + _local5);
break;
case "DT":
base[(_arg1 + "Value")].text = ((int((this[(_arg1 + "Value")] * _local2)) / 10) + " pts");
break;
};
if ((((_local2 < 0.2)) && (!((base[(_arg1 + "Grade")].text == "E"))))){
base[(_arg1 + "Grade")].text = "E";
};
if ((((((_local2 >= 0.2)) && ((_local2 < 0.4)))) && (!((base[(_arg1 + "Grade")].text == "D"))))){
setNewGradeValue(_arg1, "D");
};
if ((((((_local2 >= 0.4)) && ((_local2 < 0.6)))) && (!((base[(_arg1 + "Grade")].text == "C"))))){
setNewGradeValue(_arg1, "C");
};
if ((((((_local2 >= 0.6)) && ((_local2 < 0.8)))) && (!((base[(_arg1 + "Grade")].text == "B"))))){
setNewGradeValue(_arg1, "B");
TweenLite.to(base[(_arg1 + "Bar")], 0.2, {tint:0xFF});
};
if ((((((_local2 >= 0.8)) && ((_local2 < 1)))) && (!((base[(_arg1 + "Grade")].text == "A"))))){
setNewGradeValue(_arg1, "A");
TweenLite.to(base[(_arg1 + "Bar")], 0.2, {tint:0xFF00});
};
if ((((_local2 >= 1)) && (!((base[(_arg1 + "Grade")].text == "S"))))){
switch (_arg1){
case "KE":
Main(parent).createAnAchievement(37);
break;
case "LC":
Main(parent).createAnAchievement(38);
break;
case "TS":
Main(parent).createAnAchievement(39);
break;
case "DT":
Main(parent).createAnAchievement(40);
break;
};
setNewGradeValue(_arg1, "S");
TweenLite.to(base[(_arg1 + "Bar")], 0.2, {tint:0xFFFF00});
};
} else {
Main(parent).playSoundEffect("interface2");
actionInt++;
if (actionInt <= 4){
relaxTime = 30;
timeCalculated = 0;
switch (actionInt){
case 2:
calculateScore("LC");
break;
case 3:
calculateScore("TS");
break;
case 4:
calculateScore("DT");
break;
};
} else {
actionInt = 5;
relaxTime = 20;
totalModifier = (totalModifier * 5);
base.totalModifier.gotoAndPlay(2);
if (totalModifier < 20){
base.totalModifier.inside.value.text = "E";
};
if ((((totalModifier >= 20)) && ((totalModifier < 40)))){
base.totalModifier.inside.value.text = "D";
};
if ((((totalModifier >= 40)) && ((totalModifier < 60)))){
base.totalModifier.inside.value.text = "C";
};
if ((((totalModifier >= 60)) && ((totalModifier < 80)))){
base.totalModifier.inside.value.text = "B";
};
if ((((totalModifier >= 80)) && ((totalModifier < 95)))){
base.totalModifier.inside.value.text = "A";
};
if (totalModifier >= 95){
base.totalModifier.inside.value.text = "S";
};
};
};
}
private function calculateScore(_arg1:String):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local2:int = this[(_arg1 + "Value")];
var _local3:int = this[(_arg1 + "Worst")];
var _local7:int = this[(_arg1 + "Best")];
if ((((_arg1 == "KE")) || ((_arg1 == "LC")))){
_local4 = 88;
_local5 = 92;
_local6 = 95;
if (_local2 < _local3){
scoreReached = 0;
};
if ((((_local2 >= _local3)) && ((_local2 < _local4)))){
scoreReached = 1;
};
if ((((_local2 >= _local4)) && ((_local2 < _local5)))){
scoreReached = 2;
};
if ((((_local2 >= _local5)) && ((_local2 < _local6)))){
scoreReached = 3;
};
if ((((_local2 >= _local6)) && ((_local2 < _local7)))){
scoreReached = 4;
};
if (_local2 >= _local7){
scoreReached = 5;
};
};
if ((((_arg1 == "TS")) || ((_arg1 == "DT")))){
if (_arg1 == "TS"){
_local4 = 19000;
_local5 = 15000;
_local6 = 11000;
};
if (_arg1 == "DT"){
_local4 = 19000;
_local5 = 14500;
_local6 = 10000;
};
if (_local2 > _local3){
scoreReached = 0;
};
if ((((_local2 <= _local3)) && ((_local2 > _local4)))){
scoreReached = 1;
};
if ((((_local2 <= _local4)) && ((_local2 > _local5)))){
scoreReached = 2;
};
if ((((_local2 <= _local5)) && ((_local2 > _local6)))){
scoreReached = 3;
};
if ((((_local2 <= _local6)) && ((_local2 > _local7)))){
scoreReached = 4;
};
if (_local2 <= _local7){
scoreReached = 5;
};
};
totalModifier = (totalModifier + scoreReached);
totalTimeCalculating = ((15 * scoreReached) + 10);
}
private function visitSponsor(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
Main(parent).createAnAchievement(42);
var url = "http://www.dwarfgames.com/?utm_source=ingame&utm_medium=sponsoredgames&utm_campaign=nokkians2/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function setNewGradeValue(_arg1:String, _arg2:String):void{
base[(_arg1 + "Grade")].text = _arg2;
if (timeCalculated != totalTimeCalculating){
Main(parent).playSoundEffect("interface1");
};
}
private function submitScore(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
var o:Object = {n:[3, 0, 14, 8, 2, 10, 15, 0, 6, 11, 5, 8, 2, 5, 11, 5], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:finalScore});
}
private function removeShineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.8, {removeTint:true});
}
}
}//package Menus
Section 53
//SelectSpaceshipScreen (Menus.SelectSpaceshipScreen)
package Menus {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import flash.net.*;
import com.greensock.plugins.*;
public class SelectSpaceshipScreen extends Sprite {
private var base:SelectSpacecraftScreenBase;
public function SelectSpaceshipScreen(){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
base = new SelectSpacecraftScreenBase();
addChild(base);
base.shipAButton.addEventListener(MouseEvent.CLICK, selectA, false, 0, true);
base.shipBButton.addEventListener(MouseEvent.CLICK, selectB, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.CLICK, gotoMainMenu, false, 0, true);
base.logoSpo.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
}
private function selectA(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button3");
Main(parent).lastChosenShip = 1;
Main(parent).triedShipA = true;
Main(parent).startLevel();
}
private function selectB(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button3");
Main(parent).lastChosenShip = 2;
Main(parent).triedShipB = true;
Main(parent).startLevel();
}
private function onAddToStage(_arg1:Event):void{
var _local3:int;
var _local2:int = Main(parent).calculatePlayerPatentCode();
base.patentImage.gotoAndStop((_local2 + 1));
switch (_local2){
case 0:
_local3 = 0;
break;
case 1:
_local3 = 3;
break;
case 2:
_local3 = 8;
break;
case 3:
_local3 = 15;
break;
case 4:
_local3 = 25;
break;
};
base.bonusPatent.text = (("+" + _local3.toString()) + "% Bonus power");
}
private function removeShineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.8, {removeTint:true});
}
private function gotoMainMenu(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("main");
}
private function shineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.15, {tint:0xFF0000});
Main(parent).playSoundEffect("button1");
}
private function visitSponsor(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
Main(parent).createAnAchievement(42);
var url = "http://www.dwarfgames.com/?utm_source=ingame&utm_medium=sponsoredgames&utm_campaign=nokkians2/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
}
}//package Menus
Section 54
//SponsorSplash (Menus.SponsorSplash)
package Menus {
import flash.events.*;
import flash.display.*;
public class SponsorSplash extends Sprite {
private var base:SponsorSplashBase;
public function SponsorSplash(){
base = new SponsorSplashBase();
addChild(base);
base.x = (base.y = 300);
addEventListener(Event.ENTER_FRAME, onTick, false, 0, true);
}
private function onTick(_arg1:Event):void{
if (base.currentFrame == 300){
Main(parent).addAMenuScreen("main");
base.stop();
removeChild(base);
base = null;
removeEventListener(Event.ENTER_FRAME, onTick);
};
}
}
}//package Menus
Section 55
//StoryStart (Menus.StoryStart)
package Menus {
import flash.events.*;
import flash.display.*;
import com.greensock.*;
import com.greensock.plugins.*;
public class StoryStart extends Sprite {
private var base:StoryStartBase;
public function StoryStart(){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin]);
base = new StoryStartBase();
addChild(base);
base.startButton.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.startButton.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.startButton.addEventListener(MouseEvent.CLICK, gotoSelectShip, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OVER, shineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.ROLL_OUT, removeShineButton, false, 0, true);
base.mainMenu.addEventListener(MouseEvent.CLICK, gotoMainMenu, false, 0, true);
}
private function removeShineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.8, {removeTint:true});
}
private function gotoSelectShip(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("selectSpaceship");
}
private function gotoMainMenu(_arg1:MouseEvent):void{
Main(parent).playSoundEffect("button3");
Main(parent).addAMenuScreen("main");
}
private function shineButton(_arg1:MouseEvent):void{
TweenLite.to(_arg1.target, 0.15, {tint:0xFF0000});
Main(parent).playSoundEffect("button1");
}
}
}//package Menus
Section 56
//WinningScene (Menus.WinningScene)
package Menus {
import flash.events.*;
import flash.display.*;
public class WinningScene extends Sprite {
private var base:WinningSceneBase;
public function WinningScene(){
base = new WinningSceneBase();
addChild(base);
base.gotoAndPlay(1);
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
private function update(_arg1:Event):void{
if (base.currentFrame == 117){
Main(parent).playSoundEffect("effect1");
};
if (base.currentFrame == 167){
Main(parent).playSoundEffect("effect1");
};
if (base.currentFrame == 217){
Main(parent).playSoundEffect("effect1");
};
if (base.currentFrame == 259){
Main(parent).playSoundEffect("effect2");
};
if (base.currentFrame == 570){
removeEventListener(Event.ENTER_FRAME, update);
Main(parent).addAMenuScreen("perfCalc");
};
}
}
}//package Menus
Section 57
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function requestFunding(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", _arg1);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 58
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 59
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 60
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
}
}//package mochi.as3
Section 61
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (((_arg1.privateProperties) && (_arg1.privateProperties.consumable))){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[(_local2 + KEY_SALT)].value);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 62
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 63
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _callbacks[cb];
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
private static function detach(_arg1:Event):void{
var _local2:LoaderInfo = LoaderInfo(_arg1.target);
_local2.removeEventListener(Event.COMPLETE, detach);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
private static function loadLCBridgeComplete(_arg1:Event):void{
var _local2:Loader = LoaderInfo(_arg1.target).loader;
_mochiLocalConnection = MovieClip(_local2.content);
listen();
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.9.1 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "services":
MochiServices.triggerEvent(_arg1.event, _arg1.args);
break;
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "social":
MochiSocial.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function get childClip():Object{
return (_clip);
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
private static function loadLCBridge(_arg1:Object):void{
var _local2:Loader = new Loader();
var _local3:String = (_servURL + _mochiLC);
var _local4:URLRequest = new URLRequest(_local3);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local2.load(_local4);
_arg1.addChild(_local2);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local3:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:URLVariables = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
}
}//package mochi.as3
Section 64
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const ACTION_CANCELED:String = "onCancel";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_COMPLETE:String = "onComplete";
public static const LOGIN_SHOW:String = "LoginShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const USER_INFO:String = "UserInfo";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static var _user_info:Object = null;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function requestFan(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", _arg1);
}
public static function postToStream(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", _arg1);
}
public static function getFriendsList(_arg1:Object=null):void{
MochiServices.send("social_getFriendsList", _arg1);
}
public static function requestLogin(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", _arg1);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("social_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function inviteFriends(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:_arg1});
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 65
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 66
//BombIcon_19 (Nokkians2_fla.BombIcon_19)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BombIcon_19 extends MovieClip {
public function BombIcon_19(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 67
//BossGun11_119 (Nokkians2_fla.BossGun11_119)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun11_119 extends MovieClip {
public function BossGun11_119(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 68
//BossGun12_117 (Nokkians2_fla.BossGun12_117)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun12_117 extends MovieClip {
public function BossGun12_117(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 69
//BossGun13_124 (Nokkians2_fla.BossGun13_124)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun13_124 extends MovieClip {
public function BossGun13_124(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 70
//BossGun14_127 (Nokkians2_fla.BossGun14_127)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun14_127 extends MovieClip {
public function BossGun14_127(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 71
//BossGun21_32 (Nokkians2_fla.BossGun21_32)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun21_32 extends MovieClip {
public function BossGun21_32(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 72
//BossGun22_115 (Nokkians2_fla.BossGun22_115)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun22_115 extends MovieClip {
public function BossGun22_115(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 73
//BossGun23_122 (Nokkians2_fla.BossGun23_122)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun23_122 extends MovieClip {
public function BossGun23_122(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 74
//BossGun24_128 (Nokkians2_fla.BossGun24_128)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun24_128 extends MovieClip {
public function BossGun24_128(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 75
//BossGun32_121 (Nokkians2_fla.BossGun32_121)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun32_121 extends MovieClip {
public function BossGun32_121(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 76
//BossGun41_113 (Nokkians2_fla.BossGun41_113)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun41_113 extends MovieClip {
public function BossGun41_113(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 77
//BossGun42_116 (Nokkians2_fla.BossGun42_116)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun42_116 extends MovieClip {
public function BossGun42_116(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 78
//BossGun43_123 (Nokkians2_fla.BossGun43_123)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun43_123 extends MovieClip {
public function BossGun43_123(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 79
//BossGun81_126 (Nokkians2_fla.BossGun81_126)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun81_126 extends MovieClip {
public function BossGun81_126(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 80
//BossGun91_129 (Nokkians2_fla.BossGun91_129)
package Nokkians2_fla {
import flash.display.*;
public dynamic class BossGun91_129 extends MovieClip {
public function BossGun91_129(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 81
//FillerBar_54 (Nokkians2_fla.FillerBar_54)
package Nokkians2_fla {
import flash.display.*;
public dynamic class FillerBar_54 extends MovieClip {
public function FillerBar_54(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 82
//HintSystem_24 (Nokkians2_fla.HintSystem_24)
package Nokkians2_fla {
import flash.display.*;
public dynamic class HintSystem_24 extends MovieClip {
public var image:MovieClip;
public function HintSystem_24(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 83
//IntructionsImages_25 (Nokkians2_fla.IntructionsImages_25)
package Nokkians2_fla {
import flash.display.*;
public dynamic class IntructionsImages_25 extends MovieClip {
public function IntructionsImages_25(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 84
//PatentImage_86 (Nokkians2_fla.PatentImage_86)
package Nokkians2_fla {
import flash.display.*;
public dynamic class PatentImage_86 extends MovieClip {
public function PatentImage_86(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 85
//SpacecraftB_152 (Nokkians2_fla.SpacecraftB_152)
package Nokkians2_fla {
import flash.display.*;
public dynamic class SpacecraftB_152 extends MovieClip {
public function SpacecraftB_152(){
addFrameScript(0, this.frame1, 8, this.frame9);
}
function frame1(){
stop();
}
function frame9(){
stop();
}
}
}//package Nokkians2_fla
Section 86
//SpaceshipA_151 (Nokkians2_fla.SpaceshipA_151)
package Nokkians2_fla {
import flash.display.*;
public dynamic class SpaceshipA_151 extends MovieClip {
public function SpaceshipA_151(){
addFrameScript(0, this.frame1, 9, this.frame10);
}
function frame1(){
stop();
}
function frame10(){
stop();
}
}
}//package Nokkians2_fla
Section 87
//TotalPercentagemAnimation_60 (Nokkians2_fla.TotalPercentagemAnimation_60)
package Nokkians2_fla {
import flash.display.*;
public dynamic class TotalPercentagemAnimation_60 extends MovieClip {
public var inside:MovieClip;
public function TotalPercentagemAnimation_60(){
addFrameScript(0, this.frame1, 27, this.frame28);
}
function frame1(){
stop();
}
function frame28(){
stop();
}
}
}//package Nokkians2_fla
Section 88
//WarningMessage_21 (Nokkians2_fla.WarningMessage_21)
package Nokkians2_fla {
import flash.display.*;
public dynamic class WarningMessage_21 extends MovieClip {
public function WarningMessage_21(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package Nokkians2_fla
Section 89
//Log (SWFStats.Log)
package SWFStats {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.external.*;
public final class Log {
private static const PingR:Timer = new Timer(30000);
private static const PingF:Timer = new Timer(60000);
public static var GUID:String = "";
private static var Plays:int = 0;
public static var Enabled:Boolean = false;
private static var Request:LogRequest = new LogRequest();
private static var Pings:int = 0;
public static var Queue:Boolean = true;
public static var SourceUrl:String;
private static var HighestGoal:int = 0;
private static var FirstPing:Boolean = true;
public static var SWFID:int = 0;
private static function SaveCookie(_arg1:String, _arg2:int):void{
var _local3:SharedObject = SharedObject.getLocal("swfstats");
_local3.data[_arg1] = _arg2.toString();
_local3.flush();
}
public static function View(_arg1:int=0, _arg2:String="", _arg3:String=""):void{
if (SWFID > 0){
return;
};
SWFID = _arg1;
GUID = _arg2;
Enabled = true;
if ((((SWFID == 0)) || ((GUID == "")))){
Enabled = false;
return;
};
if (((((!((_arg3.indexOf("http://") == 0))) && (!((Security.sandboxType == "localWithNetwork"))))) && (!((Security.sandboxType == "localTrusted"))))){
Enabled = false;
return;
};
SourceUrl = GetUrl(_arg3);
if ((((SourceUrl == null)) || ((SourceUrl == "")))){
Enabled = false;
return;
};
Security.allowDomain("http://tracker.swfstats.com/");
Security.allowInsecureDomain("http://tracker.swfstats.com/");
Security.loadPolicyFile("http://tracker.swfstats.com/crossdomain.xml");
Security.allowDomain("http://utils.swfstats.com/");
Security.allowInsecureDomain("http://utils.swfstats.com/");
Security.loadPolicyFile("http://utils.swfstats.com/crossdomain.xml");
var _local4:int = GetCookie("views");
_local4++;
SaveCookie("views", _local4);
Send(("v/" + _local4), true);
PingF.addEventListener(TimerEvent.TIMER, PingServer);
PingF.start();
}
public static function LevelCounterMetric(_arg1:String, _arg2):void{
if (!Enabled){
return;
};
Send(((("lc/" + Clean(_arg1)) + "/") + Clean(_arg2)));
}
private static function Clean(_arg1:String):String{
return (escape(_arg1.replace("/", "\\").replace("~", "-")));
}
public static function Play():void{
if (!Enabled){
return;
};
Plays++;
Send(("p/" + Plays));
}
private static function Send(_arg1:String, _arg2:Boolean=false):void{
Request.Queue(_arg1);
if (((((Request.Ready) || (_arg2))) || (!(Queue)))){
Request.Send();
Request = new LogRequest();
};
}
private static function GetUrl(_arg1:String):String{
var url:String;
var defaulturl = _arg1;
if (ExternalInterface.available){
try {
url = String(ExternalInterface.call("window.location.href.toString"));
} catch(s:Error) {
url = defaulturl;
};
} else {
if (defaulturl.indexOf("http://") == 0){
url = defaulturl;
};
};
if ((((((url == null)) || ((url == "")))) || ((url == "null")))){
if ((((Security.sandboxType == "localWithNetwork")) || ((Security.sandboxType == "localTrusted")))){
url = "http://local-testing/";
} else {
url = null;
};
};
return (url);
}
public static function LevelRangedMetric(_arg1:String, _arg2, _arg3:int):void{
if (!Enabled){
return;
};
Send(((((("lr/" + Clean(_arg1)) + "/") + Clean(_arg2)) + "/") + _arg3));
}
private static function GetCookie(_arg1:String):int{
var _local2:SharedObject = SharedObject.getLocal("swfstats");
if (_local2.data[_arg1] == undefined){
return (0);
};
return (int(_local2.data[_arg1]));
}
public static function Goal(_arg1:int, _arg2:String):void{
}
private static function PingServer(... _args):void{
if (!Enabled){
return;
};
Pings++;
Send(((("t/" + (FirstPing) ? "y" : "n") + "/") + Pings), true);
if (FirstPing){
PingF.stop();
PingR.addEventListener(TimerEvent.TIMER, PingServer);
PingR.start();
FirstPing = false;
};
}
public static function LevelAverageMetric(_arg1:String, _arg2, _arg3:int):void{
if (!Enabled){
return;
};
Send(((((("la/" + Clean(_arg1)) + "/") + Clean(_arg2)) + "/") + _arg3));
}
public static function CustomMetric(_arg1:String, _arg2:String=null):void{
if (!Enabled){
return;
};
if (_arg2 == null){
_arg2 = "";
};
Send(((("c/" + Clean(_arg1)) + "/") + Clean(_arg2)));
}
}
}//package SWFStats
Section 90
//LogRequest (SWFStats.LogRequest)
package SWFStats {
import flash.events.*;
import flash.net.*;
public final class LogRequest {
private var Data:String;// = ""
public var Ready:Boolean;// = false
private var Pieces:int;
private static var Failed:int = 0;
private function IOErrorHandler(_arg1:IOErrorEvent):void{
Failed++;
}
public function Queue(_arg1:String):void{
if (Failed > 3){
return;
};
this.Pieces++;
this.Data = (this.Data + (((this.Data == "")) ? "" : "~" + _arg1));
if ((((this.Pieces == 8)) || ((this.Data.length > 300)))){
this.Ready = true;
};
}
private function SecurityErrorHandler(_arg1:SecurityErrorEvent):void{
}
private function StatusChange(_arg1:HTTPStatusEvent):void{
}
public function Send():void{
var _local1:URLLoader = new URLLoader();
_local1.addEventListener(IOErrorEvent.IO_ERROR, this.IOErrorHandler);
_local1.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.StatusChange);
_local1.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.SecurityErrorHandler);
_local1.load(new URLRequest((((((((((("http://tracker.swfstats.com/Games/q.aspx?guid=" + Log.GUID) + "&swfid=") + Log.SWFID) + "&q=") + this.Data) + "&url=") + Log.SourceUrl) + "&") + Math.random()) + "z")));
trace((((((((((("http://tracker.swfstats.com/Games/q.aspx?guid=" + Log.GUID) + "&swfid=") + Log.SWFID) + "&q=") + this.Data) + "&url=") + Log.SourceUrl) + "&") + Math.random()) + "z"));
}
}
}//package SWFStats
Section 91
//AchievementAlertImage (AchievementAlertImage)
package {
import flash.display.*;
public dynamic class AchievementAlertImage extends MovieClip {
public var inside:MovieClip;
}
}//package
Section 92
//AchievementIcon (AchievementIcon)
package {
import flash.display.*;
public dynamic class AchievementIcon extends MovieClip {
public function AchievementIcon(){
addFrameScript(13, this.frame14);
}
function frame14(){
stop();
}
}
}//package
Section 93
//AchievementShowLayout (AchievementShowLayout)
package {
import flash.display.*;
public dynamic class AchievementShowLayout extends MovieClip {
public var inside:MovieClip;
}
}//package
Section 94
//AchievementSound (AchievementSound)
package {
import flash.media.*;
public dynamic class AchievementSound extends Sound {
}
}//package
Section 95
//AchievementsScreenBase (AchievementsScreenBase)
package {
import flash.display.*;
import flash.text.*;
public dynamic class AchievementsScreenBase extends MovieClip {
public var gottenText:TextField;
public var aboutBonus:MovieClip;
public var scoreText:TextField;
public var patentImage:MovieClip;
public var mainMenu:SimpleButton;
public var bonusPatent:TextField;
}
}//package
Section 96
//ArmorLootCollected (ArmorLootCollected)
package {
import flash.media.*;
public dynamic class ArmorLootCollected extends Sound {
}
}//package
Section 97
//BigNukeSound (BigNukeSound)
package {
import flash.media.*;
public dynamic class BigNukeSound extends Sound {
}
}//package
Section 98
//BombFlash (BombFlash)
package {
import flash.display.*;
public dynamic class BombFlash extends Sprite {
}
}//package
Section 99
//BossHealthBar (BossHealthBar)
package {
import flash.display.*;
public dynamic class BossHealthBar extends MovieClip {
public var filler:MovieClip;
}
}//package
Section 100
//BossImage1 (BossImage1)
package {
import flash.display.*;
public dynamic class BossImage1 extends MovieClip {
public var gun4:MovieClip;
public var gun5:MovieClip;
public var gun6:MovieClip;
public var gun1:MovieClip;
public var gun2:MovieClip;
public var gun3:MovieClip;
}
}//package
Section 101
//BossImage2 (BossImage2)
package {
import flash.display.*;
public dynamic class BossImage2 extends MovieClip {
public var gun4:MovieClip;
public var gun5:MovieClip;
public var gun6:MovieClip;
public var gun7:MovieClip;
public var gun1:MovieClip;
public var gun2:MovieClip;
public var gun3:MovieClip;
}
}//package
Section 102
//BossImage3 (BossImage3)
package {
import flash.display.*;
public dynamic class BossImage3 extends MovieClip {
public var gun4:MovieClip;
public var gun5:MovieClip;
public var gun6:MovieClip;
public var gun7:MovieClip;
public var gun1:MovieClip;
public var gun2:MovieClip;
public var gun3:MovieClip;
}
}//package
Section 103
//BossImage4 (BossImage4)
package {
import flash.display.*;
public dynamic class BossImage4 extends MovieClip {
public var gun4:MovieClip;
public var gun5:MovieClip;
public var gun6:MovieClip;
public var gun7:MovieClip;
public var gun8:MovieClip;
public var gun1:MovieClip;
public var gun2:MovieClip;
public var gun3:MovieClip;
public function BossImage4(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package
Section 104
//BossImage5 (BossImage5)
package {
import flash.display.*;
public dynamic class BossImage5 extends MovieClip {
public var gun4:MovieClip;
public var gun5:MovieClip;
public var gun6:MovieClip;
public var gun7:MovieClip;
public var gun8:MovieClip;
public var gun9:MovieClip;
public var gun1:MovieClip;
public var gun2:MovieClip;
public var gun3:MovieClip;
}
}//package
Section 105
//BossLoopA (BossLoopA)
package {
import flash.media.*;
public dynamic class BossLoopA extends Sound {
}
}//package
Section 106
//BossLoopB (BossLoopB)
package {
import flash.media.*;
public dynamic class BossLoopB extends Sound {
}
}//package
Section 107
//BulletImage11 (BulletImage11)
package {
import flash.display.*;
public dynamic class BulletImage11 extends Sprite {
}
}//package
Section 108
//BulletImage12 (BulletImage12)
package {
import flash.display.*;
public dynamic class BulletImage12 extends Sprite {
}
}//package
Section 109
//BulletImage13 (BulletImage13)
package {
import flash.display.*;
public dynamic class BulletImage13 extends Sprite {
}
}//package
Section 110
//BulletImage21 (BulletImage21)
package {
import flash.display.*;
public dynamic class BulletImage21 extends Sprite {
}
}//package
Section 111
//BulletImage22 (BulletImage22)
package {
import flash.display.*;
public dynamic class BulletImage22 extends Sprite {
}
}//package
Section 112
//BulletImage23 (BulletImage23)
package {
import flash.display.*;
public dynamic class BulletImage23 extends Sprite {
}
}//package
Section 113
//BulletImage31 (BulletImage31)
package {
import flash.display.*;
public dynamic class BulletImage31 extends Sprite {
}
}//package
Section 114
//BulletImage32 (BulletImage32)
package {
import flash.display.*;
public dynamic class BulletImage32 extends Sprite {
}
}//package
Section 115
//BulletImage33 (BulletImage33)
package {
import flash.display.*;
public dynamic class BulletImage33 extends Sprite {
}
}//package
Section 116
//BulletImage34 (BulletImage34)
package {
import flash.display.*;
public dynamic class BulletImage34 extends Sprite {
}
}//package
Section 117
//ButtonSound1 (ButtonSound1)
package {
import flash.media.*;
public dynamic class ButtonSound1 extends Sound {
}
}//package
Section 118
//ButtonSound2 (ButtonSound2)
package {
import flash.media.*;
public dynamic class ButtonSound2 extends Sound {
}
}//package
Section 119
//ButtonSound3 (ButtonSound3)
package {
import flash.media.*;
public dynamic class ButtonSound3 extends Sound {
}
}//package
Section 120
//ChallengeClearBase (ChallengeClearBase)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ChallengeClearBase extends MovieClip {
public var timeText:TextField;
public var mainMenu:SimpleButton;
public var submitScore:SubmitTime;
public var playAgain:SimpleButton;
public var logoSpo:MovieClip;
}
}//package
Section 121
//ChallengeStartBase (ChallengeStartBase)
package {
import flash.display.*;
public dynamic class ChallengeStartBase extends MovieClip {
public var shieldButton:MovieClip;
public var mainMenu:SimpleButton;
}
}//package
Section 122
//ClockImage (ClockImage)
package {
import flash.display.*;
public dynamic class ClockImage extends MovieClip {
public function ClockImage(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package
Section 123
//CreditsMenuBase (CreditsMenuBase)
package {
import flash.display.*;
public dynamic class CreditsMenuBase extends MovieClip {
public var sponsorClick:SimpleButton;
public var logoDev:SimpleButton;
public var nokkians1:SimpleButton;
public var mainMenu:SimpleButton;
}
}//package
Section 124
//DangerAlert (DangerAlert)
package {
import flash.display.*;
public dynamic class DangerAlert extends MovieClip {
}
}//package
Section 125
//EffectSound1 (EffectSound1)
package {
import flash.media.*;
public dynamic class EffectSound1 extends Sound {
}
}//package
Section 126
//EffectSound2 (EffectSound2)
package {
import flash.media.*;
public dynamic class EffectSound2 extends Sound {
}
}//package
Section 127
//EnemyBulletImage1 (EnemyBulletImage1)
package {
import flash.display.*;
public dynamic class EnemyBulletImage1 extends Sprite {
}
}//package
Section 128
//EnemyBulletImage2 (EnemyBulletImage2)
package {
import flash.display.*;
public dynamic class EnemyBulletImage2 extends Sprite {
}
}//package
Section 129
//EnemyBulletImage3 (EnemyBulletImage3)
package {
import flash.display.*;
public dynamic class EnemyBulletImage3 extends Sprite {
}
}//package
Section 130
//EnemyBulletImage4 (EnemyBulletImage4)
package {
import flash.display.*;
public dynamic class EnemyBulletImage4 extends Sprite {
}
}//package
Section 131
//EnemyImage11 (EnemyImage11)
package {
import flash.display.*;
public dynamic class EnemyImage11 extends Sprite {
}
}//package
Section 132
//EnemyImage12 (EnemyImage12)
package {
import flash.display.*;
public dynamic class EnemyImage12 extends Sprite {
}
}//package
Section 133
//EnemyImage21 (EnemyImage21)
package {
import flash.display.*;
public dynamic class EnemyImage21 extends Sprite {
}
}//package
Section 134
//EnemyImage22 (EnemyImage22)
package {
import flash.display.*;
public dynamic class EnemyImage22 extends Sprite {
}
}//package
Section 135
//EnemyImage31 (EnemyImage31)
package {
import flash.display.*;
public dynamic class EnemyImage31 extends Sprite {
}
}//package
Section 136
//EnemyImage32 (EnemyImage32)
package {
import flash.display.*;
public dynamic class EnemyImage32 extends Sprite {
}
}//package
Section 137
//EnemyImage41 (EnemyImage41)
package {
import flash.display.*;
public dynamic class EnemyImage41 extends Sprite {
}
}//package
Section 138
//EnemyImage42 (EnemyImage42)
package {
import flash.display.*;
public dynamic class EnemyImage42 extends Sprite {
}
}//package
Section 139
//EnemyImage51 (EnemyImage51)
package {
import flash.display.*;
public dynamic class EnemyImage51 extends Sprite {
}
}//package
Section 140
//EnemyImage52 (EnemyImage52)
package {
import flash.display.*;
public dynamic class EnemyImage52 extends Sprite {
}
}//package
Section 141
//EnemyImage61 (EnemyImage61)
package {
import flash.display.*;
public dynamic class EnemyImage61 extends Sprite {
}
}//package
Section 142
//EnemyImage62 (EnemyImage62)
package {
import flash.display.*;
public dynamic class EnemyImage62 extends Sprite {
}
}//package
Section 143
//EnemyImage71 (EnemyImage71)
package {
import flash.display.*;
public dynamic class EnemyImage71 extends Sprite {
}
}//package
Section 144
//EnemyImage72 (EnemyImage72)
package {
import flash.display.*;
public dynamic class EnemyImage72 extends Sprite {
}
}//package
Section 145
//EnemyImage81 (EnemyImage81)
package {
import flash.display.*;
public dynamic class EnemyImage81 extends Sprite {
}
}//package
Section 146
//EnemyImage82 (EnemyImage82)
package {
import flash.display.*;
public dynamic class EnemyImage82 extends Sprite {
}
}//package
Section 147
//EnemyImage91 (EnemyImage91)
package {
import flash.display.*;
public dynamic class EnemyImage91 extends Sprite {
}
}//package
Section 148
//EnemyImage92 (EnemyImage92)
package {
import flash.display.*;
public dynamic class EnemyImage92 extends Sprite {
}
}//package
Section 149
//EnergyShield (EnergyShield)
package {
import flash.display.*;
public dynamic class EnergyShield extends MovieClip {
public function EnergyShield(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package
Section 150
//ExpLootCollected (ExpLootCollected)
package {
import flash.media.*;
public dynamic class ExpLootCollected extends Sound {
}
}//package
Section 151
//Explosion2 (Explosion2)
package {
import flash.media.*;
public dynamic class Explosion2 extends Sound {
}
}//package
Section 152
//FinalBossImage (FinalBossImage)
package {
import flash.display.*;
public dynamic class FinalBossImage extends MovieClip {
public var main:MovieClip;
}
}//package
Section 153
//GameLoop (GameLoop)
package {
import flash.media.*;
public dynamic class GameLoop extends Sound {
}
}//package
Section 154
//GameOverBase (GameOverBase)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GameOverBase extends MovieClip {
public var score:TextField;
public var playMore:SimpleButton;
public var patentUpgrade:TextField;
public var retryButton:SimpleButton;
public var submitScore:SubmitTime;
public var mainMenuButton:SimpleButton;
public var logoSpo:SimpleButton;
}
}//package
Section 155
//GameOverPicture (GameOverPicture)
package {
import flash.display.*;
public dynamic class GameOverPicture extends MovieClip {
public function GameOverPicture(){
addFrameScript(90, this.frame91);
}
function frame91(){
stop();
}
}
}//package
Section 156
//GameOverSound (GameOverSound)
package {
import flash.media.*;
public dynamic class GameOverSound extends Sound {
}
}//package
Section 157
//HeroHealthBar (HeroHealthBar)
package {
import flash.display.*;
public dynamic class HeroHealthBar extends MovieClip {
public var filler:MovieClip;
}
}//package
Section 158
//HeroImage (HeroImage)
package {
import flash.display.*;
public dynamic class HeroImage extends MovieClip {
public var model:MovieClip;
}
}//package
Section 159
//HeroPowerBar (HeroPowerBar)
package {
import flash.display.*;
public dynamic class HeroPowerBar extends MovieClip {
public var filler:MovieClip;
}
}//package
Section 160
//HitSound1 (HitSound1)
package {
import flash.media.*;
public dynamic class HitSound1 extends Sound {
}
}//package
Section 161
//HitSound2 (HitSound2)
package {
import flash.media.*;
public dynamic class HitSound2 extends Sound {
}
}//package
Section 162
//InterfaceSound1 (InterfaceSound1)
package {
import flash.media.*;
public dynamic class InterfaceSound1 extends Sound {
}
}//package
Section 163
//InterfaceSound2 (InterfaceSound2)
package {
import flash.media.*;
public dynamic class InterfaceSound2 extends Sound {
}
}//package
Section 164
//Laser (Laser)
package {
import flash.display.*;
public dynamic class Laser extends Sprite {
}
}//package
Section 165
//LaserShot1 (LaserShot1)
package {
import flash.media.*;
public dynamic class LaserShot1 extends Sound {
}
}//package
Section 166
//LaserShot2 (LaserShot2)
package {
import flash.media.*;
public dynamic class LaserShot2 extends Sound {
}
}//package
Section 167
//LaserShot2Super (LaserShot2Super)
package {
import flash.media.*;
public dynamic class LaserShot2Super extends Sound {
}
}//package
Section 168
//LevelUpFlash (LevelUpFlash)
package {
import flash.display.*;
public dynamic class LevelUpFlash extends Sprite {
}
}//package
Section 169
//LevelUpIcon (LevelUpIcon)
package {
import flash.display.*;
public dynamic class LevelUpIcon extends MovieClip {
}
}//package
Section 170
//LevelUpSound (LevelUpSound)
package {
import flash.media.*;
public dynamic class LevelUpSound extends Sound {
}
}//package
Section 171
//LoadingScreenBase (LoadingScreenBase)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LoadingScreenBase extends MovieClip {
public var loadingFiller:MovieClip;
public var adbox:MovieClip;
public var playNow:SimpleButton;
public var logoDev:SimpleButton;
public var logoSpo:SimpleButton;
public var loadedValue:TextField;
}
}//package
Section 172
//LootImage11 (LootImage11)
package {
import flash.display.*;
public dynamic class LootImage11 extends Sprite {
}
}//package
Section 173
//LootImage21 (LootImage21)
package {
import flash.display.*;
public dynamic class LootImage21 extends Sprite {
}
}//package
Section 174
//LootImage31 (LootImage31)
package {
import flash.display.*;
public dynamic class LootImage31 extends Sprite {
}
}//package
Section 175
//LootImage41 (LootImage41)
package {
import flash.display.*;
public dynamic class LootImage41 extends Sprite {
}
}//package
Section 176
//LowHealthAlert (LowHealthAlert)
package {
import flash.display.*;
public dynamic class LowHealthAlert extends Sprite {
public var text:MovieClip;
}
}//package
Section 177
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import GamePlay.*;
import flash.utils.*;
import Menus.*;
import flash.media.*;
import flash.net.*;
import Achievements.*;
import SWFStats.*;
import com.*;
import flash.ui.*;
public class Main extends Sprite {
public var totalAchievementScore:int;
private var selectSpacecraftScreen:SelectSpaceshipScreen;
public var arrayBooleanOfAchievements:Array;
public var lastChosenShip:int;
private var gameIsMuted:Boolean;// = false
private var levelUpSound:LevelUpSound;
private var waveUpSound:WaveUp;
private var bigNukeSound:BigNukeSound;
private var achievementSound:AchievementSound;
public var timeSpentInBosses:int;
private var silenceChannel:SoundChannel;
public var triedShipB:Boolean;// = false
private var shieldDownSound:ShieldDown;
private var soundEffectChannelNormal:SoundChannel;
public var triedShipA:Boolean;// = false
public var defeatedEnemiesPercent:int;
private var _timePassed:int;
public var newPatentLevel:Boolean;// = false
private var secondLoopCode:String;
private var mainLoopChannel:SoundChannel;
private var currentMenuLoopCode:int;
private var currentScreen;
private var _newTime:int;
public var so:SharedObject;
private var expLootCollected:ExpLootCollected;
public var challengeUnlocked:Boolean;// = false
private var _oldTime:int;
private var secondLoopSoundTransform:SoundTransform;
private var hitSound2:HitSound2;
private var mainLoopVolume:Number;// = 0.55
private var secondLoopVolume:Number;// = 0
private var mainLoopSoundTransform:SoundTransform;
public var collectedLootPercent:int;
private var shieldActivate:ShieldActivate;
private var soundEffectChannelExplosion2:SoundChannel;
private var soundEffectChannelExplosion3:SoundChannel;
private var armorLootCollected:ArmorLootCollected;
private var powerLootCollected:PowerLootCollected;
public var level:Level;
private var hitSound1:HitSound1;
private var mainLoopCode:String;
public var totalNumberOfTries:int;
public var currentHighScore:int;
private var interfaceSound1:InterfaceSound1;
private var shotSound1:ShotSound1;
public var arrayOfAchievementAlert:Array;
public var damageTaken:int;
private var winLoop:WinSong;
private var interfaceSound2:InterfaceSound2;
public var changingLoopFocus:int;// = 0
private var secondLoopChannel:SoundChannel;
public var patentBonus:Number;// = 1
private var bossLoopB:BossLoopB;
private var gameLoop:GameLoop;
private var bossLoopA:BossLoopA;
private var laserShotSuperSound2:LaserShot2Super;
private var soundEffectVolume:Number;// = 1
public var timePlayingMainLoop:int;
public var timeSpentInGame:int;
public var timePlayingSecondLoop:int;
private var nukeSound1:NukeSound1;
private var laserShotSound1:LaserShot1;
private var laserShotSound2:LaserShot2;
private var gameOverSound:GameOverSound;
public var currentPatentLevel:int;
private var soundEffectTransform:SoundTransform;
public var isChallengeModeActive:Boolean;// = false
private var silentSoundTransform:SoundTransform;
private var warningSound:WarningSound;
private var buttonSound1:ButtonSound1;
private var buttonSound2:ButtonSound2;
private var buttonSound3:ButtonSound3;
public var acessToArrays:int;
private var takeDamageSound:TakeDamage;
public var firstTimePlaying:Boolean;// = true
private var menuLoop1:Menu1Loop;
public var loopsArePlaying:Boolean;// = false
private var missileShot1:MissileShot1;
private var soundEffectChannelExplosion:SoundChannel;
private var effectSound1:EffectSound1;
private var effectSound2:EffectSound2;
private var silenceSound:Silence;
public var totalAchievementsNumber:int;
private var explosionSound:Explosion2;
public var bruteSCore:int;
public var currentAchievement:AchievementAlert;
public function Main(){
shotSound1 = new ShotSound1();
laserShotSound1 = new LaserShot1();
laserShotSound2 = new LaserShot2();
laserShotSuperSound2 = new LaserShot2Super();
missileShot1 = new MissileShot1();
nukeSound1 = new NukeSound1();
hitSound1 = new HitSound1();
hitSound2 = new HitSound2();
explosionSound = new Explosion2();
takeDamageSound = new TakeDamage();
shieldDownSound = new ShieldDown();
expLootCollected = new ExpLootCollected();
armorLootCollected = new ArmorLootCollected();
powerLootCollected = new PowerLootCollected();
shieldActivate = new ShieldActivate();
levelUpSound = new LevelUpSound();
waveUpSound = new WaveUp();
achievementSound = new AchievementSound();
warningSound = new WarningSound();
bigNukeSound = new BigNukeSound();
gameOverSound = new GameOverSound();
silenceSound = new Silence();
silentSoundTransform = new SoundTransform(0);
interfaceSound1 = new InterfaceSound1();
interfaceSound2 = new InterfaceSound2();
buttonSound1 = new ButtonSound1();
buttonSound2 = new ButtonSound2();
buttonSound3 = new ButtonSound3();
effectSound1 = new EffectSound1();
effectSound2 = new EffectSound2();
soundEffectChannelExplosion = new SoundChannel();
soundEffectChannelExplosion2 = new SoundChannel();
soundEffectChannelExplosion3 = new SoundChannel();
soundEffectChannelNormal = new SoundChannel();
soundEffectTransform = new SoundTransform();
mainLoopSoundTransform = new SoundTransform(1);
secondLoopSoundTransform = new SoundTransform(0);
menuLoop1 = new Menu1Loop();
winLoop = new WinSong();
gameLoop = new GameLoop();
bossLoopA = new BossLoopA();
bossLoopB = new BossLoopB();
mainLoopChannel = new SoundChannel();
secondLoopChannel = new SoundChannel();
super();
soundEffectTransform.volume = 1;
arrayOfAchievementAlert = new Array();
arrayBooleanOfAchievements = new Array(false, false, false, false, false, false, false);
addEventListener(Event.ENTER_FRAME, onTick, false, 0, true);
silenceChannel = silenceSound.play(0, 999999, silentSoundTransform);
addEventListener(Event.ADDED_TO_STAGE, onAddToStage, false, 0, true);
addEventListener(Event.ENTER_FRAME, onTick, false, 0, true);
}
public function saveSavedData():void{
so.data.arrayBooleanOfAchievements = arrayBooleanOfAchievements;
so.data.totalAchievementScore = totalAchievementScore;
so.data.totalAchievementsNumber = totalAchievementsNumber;
so.data.currentHighscore = currentHighScore;
so.data.timeSpentInGame = timeSpentInGame;
so.data.firstTimePlaying = firstTimePlaying;
so.data.totalNumberOfTries = totalNumberOfTries;
so.flush();
}
public function retrieveSavedData():void{
so = SharedObject.getLocal("userData");
if (so.data.arrayBooleanOfAchievements == null){
so.data.arrayBooleanOfAchievements = new Array();
so.data.totalAchievementScore = new int();
so.data.totalAchievementsNumber = new int();
so.data.currentHighscore = new int();
so.data.timeSpentInGame = new int();
so.data.firstTimePlaying = new Boolean(true);
so.data.totalNumberOfTries = new int();
so.flush();
};
arrayBooleanOfAchievements = so.data.arrayBooleanOfAchievements;
totalAchievementScore = so.data.totalAchievementScore;
totalAchievementsNumber = so.data.totalAchievementsNumber;
currentHighScore = so.data.currentHighscore;
timeSpentInGame = so.data.timeSpentInGame;
firstTimePlaying = so.data.firstTimePlaying;
totalNumberOfTries = so.data.totalNumberOfTries;
}
public function calcPatentBonus():Number{
var _local1:int;
calculatePlayerPatentCode();
switch (currentPatentLevel){
case 0:
_local1 = 1;
break;
case 1:
_local1 = 1.03;
break;
case 2:
_local1 = 1.08;
break;
case 3:
_local1 = 1.15;
break;
case 4:
_local1 = 1.25;
break;
};
return (_local1);
}
public function stopSoundChannel():void{
soundEffectChannelNormal.stop();
}
private function onTick(_arg1:Event):void{
if (_oldTime == 0){
_oldTime = getTimer();
};
_newTime = getTimer();
_timePassed = (_newTime - _oldTime);
_oldTime = _newTime;
if (timeSpentInGame >= 180000){
createAnAchievement(25);
};
if (timeSpentInGame >= 420000){
createAnAchievement(26);
};
if (timeSpentInGame >= 720000){
createAnAchievement(27);
};
if (timeSpentInGame >= 1200000){
createAnAchievement(28);
};
if (loopsArePlaying){
timePlayingMainLoop = (timePlayingMainLoop + _timePassed);
if ((((mainLoopCode == "game")) && ((timePlayingMainLoop >= gameLoop.length)))){
timePlayingMainLoop = (timePlayingMainLoop - gameLoop.length);
mainLoopChannel = gameLoop.play(timePlayingMainLoop, 1, mainLoopSoundTransform);
};
if ((((mainLoopCode == "bossA")) && ((timePlayingMainLoop >= bossLoopA.length)))){
timePlayingMainLoop = (timePlayingMainLoop - bossLoopA.length);
mainLoopChannel = bossLoopA.play(timePlayingMainLoop, 1, mainLoopSoundTransform);
};
if ((((mainLoopCode == "bossB")) && ((timePlayingMainLoop >= bossLoopB.length)))){
timePlayingMainLoop = (timePlayingMainLoop - bossLoopB.length);
mainLoopChannel = bossLoopB.play(timePlayingMainLoop, 1, mainLoopSoundTransform);
};
};
acessToArrays = (arrayOfAchievementAlert.length - 1);
while (acessToArrays > -1) {
currentAchievement = arrayOfAchievementAlert[acessToArrays];
if ((currentAchievement is AchievementAlert)){
currentAchievement.update((586 - (34 * acessToArrays)));
if (currentAchievement.moment == 2){
removeChild(arrayOfAchievementAlert[acessToArrays]);
arrayOfAchievementAlert[acessToArrays] = null;
arrayOfAchievementAlert.splice(acessToArrays, 1);
};
};
acessToArrays--;
};
}
public function wantedToPlayChallenge():void{
Log.CustomMetric("Wanted to Play Challenge Mode");
}
public function createAnAchievement(_arg1:int):void{
if (arrayBooleanOfAchievements[_arg1]){
return;
};
var _local2:Array = achievementList(_arg1);
var _local3:AchievementAlert = new AchievementAlert(_local2[0], _local2[1], _local2[2]);
arrayBooleanOfAchievements[_arg1] = true;
addChild(_local3);
_local3.x = 141;
_local3.y = -34;
totalAchievementsNumber++;
Log.LevelCounterMetric("Achievements", totalAchievementsNumber);
arrayOfAchievementAlert.push(_local3);
saveSavedData();
}
public function startMenuLoop(_arg1:int):void{
if (currentMenuLoopCode != _arg1){
mainLoopChannel.stop();
switch (_arg1){
case 1:
mainLoopChannel = menuLoop1.play(0, 99, mainLoopSoundTransform);
break;
case 2:
mainLoopChannel = winLoop.play(0, 99, mainLoopSoundTransform);
break;
};
currentMenuLoopCode = _arg1;
mainLoopSoundTransform.volume = mainLoopVolume;
mainLoopChannel.soundTransform = mainLoopSoundTransform;
};
}
public function removeLastScreen(_arg1):void{
trace(currentScreen);
if (currentScreen != null){
removeChild(currentScreen);
currentScreen = null;
};
trace(currentScreen);
currentScreen = _arg1;
}
public function startLevel():void{
level = new Level(lastChosenShip);
addChild(level);
removeLastScreen(level);
}
public function returnGameLoop():void{
switch (mainLoopCode){
case "game":
mainLoopChannel = gameLoop.play(timePlayingMainLoop, 1, mainLoopSoundTransform);
break;
case "bossA":
mainLoopChannel = bossLoopA.play(timePlayingMainLoop, 1, mainLoopSoundTransform);
break;
case "bossB":
mainLoopChannel = bossLoopB.play(timePlayingMainLoop, 1, mainLoopSoundTransform);
break;
};
loopsArePlaying = true;
}
public function checkUrl(_arg1:Array):Boolean{
var _local2:String = stage.loaderInfo.url;
var _local3:int = (_arg1.length - 1);
while (_local3 >= 0) {
if (_local2.indexOf(_arg1[_local3]) != -1){
return (true);
};
_local3--;
};
return (false);
}
public function addScene(_arg1:String):void{
var _local2:*;
switch (_arg1){
case "winning":
_local2 = new WinningScene();
break;
};
addChild(_local2);
removeLastScreen(_local2);
}
public function deleteSavedData():void{
so.data.arrayBooleanOfAchievements = new Array();
so.data.totalAchievementScore = new int();
so.data.totalAchievementsNumber = new int();
so.data.currentHighscore = new int();
so.data.timeSpentInGame = new int();
so.flush();
retrieveSavedData();
}
public function achievementList(_arg1:int):Array{
var _local2:Array;
switch (_arg1){
case 1:
_local2 = ["Taking a Break", "Paused the game", 5];
break;
case 2:
_local2 = ["Crashed", "Hit an enemy", 5];
break;
case 3:
_local2 = ["Shield Defense", "Hit an enemy using your shield", 10];
break;
case 4:
_local2 = ["Feel My Power!", "Use NighStar's supreme power", 20];
break;
case 5:
_local2 = ["Giant Laser Shot", "Use OmniLaser's supreme power", 20];
break;
case 6:
_local2 = ["Multiplier Master", "Get multiplier level of 90", 40];
break;
case 7:
_local2 = ["You are a Winner!", "Beat the Story mode", 500];
break;
case 8:
_local2 = ["Die with Honor", "Die in game", 10];
break;
case 9:
_local2 = ["Persistent", "Retry 3 times", 20];
break;
case 10:
_local2 = ["Cool Spaceships", "Use all spaceships", 20];
break;
case 11:
_local2 = ["Timing Fail", "Use a nuke at incorrect time", 10];
break;
case 12:
_local2 = ["Ouch!", "Crash at a Boss", 10];
break;
case 13:
_local2 = ["Yes I can!", "Reach Wave 5", 25];
break;
case 14:
_local2 = ["Prepared for Action", "Reach Wave 10", 50];
break;
case 15:
_local2 = ["Adventurer", "Reach Wave 15", 100];
break;
case 16:
_local2 = ["True Hero", "Reach Wave 20", 200];
break;
case 17:
_local2 = ["For Beginners", "Defeat Boss 1", 25];
break;
case 18:
_local2 = ["Not That Easy", "Defeat Boss 2", 50];
break;
case 19:
_local2 = ["Advanced", "Defeat Boss 3", 100];
break;
case 20:
_local2 = ["Ghost Boss", "Defeat Boss 4", 200];
break;
case 21:
_local2 = ["Starting the Fun", "Reach Level 2", 25];
break;
case 22:
_local2 = ["Nice Spacecraft", "Reach Level 4", 50];
break;
case 23:
_local2 = ["Professional Spacecraft", "Reach Level 6", 100];
break;
case 24:
_local2 = ["Supreme Spacecraft", "Reach Level 8", 200];
break;
case 25:
_local2 = ["3 Minutes of Fun", "Play for 3 minutes", 25];
break;
case 26:
_local2 = ["7 Minutes of Fun", "Play for 7 minutes", 50];
break;
case 27:
_local2 = ["12 Minutes of Fun", "Play for 12 minutes", 100];
break;
case 28:
_local2 = ["20 Minutes of Fun", "Play for 20 minutes", 200];
break;
case 29:
_local2 = ["C", "Get final rank C", 25];
break;
case 30:
_local2 = ["B", "Get final rank B", 50];
break;
case 31:
_local2 = ["A", "Get final rank A", 100];
break;
case 32:
_local2 = ["S", "Get final rank S", 200];
break;
case 33:
_local2 = ["Novice", "Get 'Novice' Patent", 25];
break;
case 34:
_local2 = ["Regular", "Get 'Regular' Patent", 50];
break;
case 35:
_local2 = ["Expert", "Get 'Expert' Patent", 100];
break;
case 36:
_local2 = ["Lord Nokkian", "Get 'Lord' Patent", 200];
break;
case 37:
_local2 = ["Killer", "Get grade S in 'Killed Enemies Performance'", 100];
break;
case 38:
_local2 = ["Looter", "Get grade S in 'Collected Loot Performance'", 100];
break;
case 39:
_local2 = ["Quick Man", "Get grade S in 'Spent Time Performance'", 100];
break;
case 40:
_local2 = ["Avoider", "Get grade S in 'Taken Damage Performance'", 100];
break;
case 41:
_local2 = ["Supporter", "Visit AwokerGames.com", 20];
break;
case 42:
_local2 = ["Supporter II", "Visit Sponsor's Homepage", 20];
break;
};
return (_local2);
}
public function addAMenuScreen(_arg1:String):void{
var _local2:*;
Mouse.show();
switch (_arg1){
case "selectSpaceship":
_local2 = new SelectSpaceshipScreen();
break;
case "achievement":
_local2 = new AchievementsScreen();
break;
case "main":
_local2 = new MainMenuScreen();
break;
case "perfCalc":
_local2 = new PerformanceScreen();
break;
case "credits":
_local2 = new CreditsScreen();
break;
case "gameOver":
_local2 = new GameOverScreen();
break;
case "challengeClear":
_local2 = new ChallengeClear();
break;
case "challengeStart":
_local2 = new ChallengeStart();
break;
case "storyStart":
_local2 = new StoryStart();
break;
case "splash":
_local2 = new SponsorSplash();
break;
};
addChild(_local2);
removeLastScreen(_local2);
}
public function playSoundEffect(_arg1:String):void{
if (((!((soundEffectTransform.volume == 0))) && (!((soundEffectChannelNormal == null))))){
switch (_arg1){
case "shot1":
soundEffectChannelNormal = shotSound1.play();
break;
case "laserShot1":
soundEffectChannelNormal = laserShotSound1.play();
break;
case "laserShot2Super":
soundEffectChannelNormal = laserShotSuperSound2.play();
break;
case "missileShot1":
soundEffectChannelNormal = missileShot1.play();
break;
case "nuke1":
soundEffectChannelNormal = nukeSound1.play();
break;
case "hit1":
if (Math.random() > 0.5){
if (soundEffectChannelExplosion != null){
soundEffectChannelExplosion = hitSound1.play();
soundEffectChannelExplosion.soundTransform = soundEffectTransform;
};
} else {
if (soundEffectChannelExplosion2 != null){
soundEffectChannelExplosion2 = hitSound1.play();
soundEffectChannelExplosion2.soundTransform = soundEffectTransform;
};
};
break;
case "hit2":
if (Math.random() > 0.5){
if (soundEffectChannelExplosion != null){
soundEffectChannelExplosion = hitSound2.play();
soundEffectChannelExplosion.soundTransform = soundEffectTransform;
};
} else {
if (soundEffectChannelExplosion2 != null){
soundEffectChannelExplosion2 = hitSound2.play();
soundEffectChannelExplosion2.soundTransform = soundEffectTransform;
};
};
break;
case "explosion":
if (soundEffectChannelExplosion3 != null){
soundEffectChannelExplosion3 = explosionSound.play();
soundEffectChannelExplosion3.soundTransform = soundEffectTransform;
};
break;
case "takeDamage":
soundEffectChannelNormal = takeDamageSound.play();
break;
case "expLoot":
soundEffectChannelNormal = expLootCollected.play();
break;
case "armorLoot":
soundEffectChannelNormal = armorLootCollected.play();
break;
case "powerLoot":
soundEffectChannelNormal = powerLootCollected.play();
break;
case "shieldActivate":
soundEffectChannelNormal = shieldActivate.play();
break;
case "shieldDown":
soundEffectChannelNormal = shieldDownSound.play();
break;
case "levelUp":
soundEffectChannelNormal = levelUpSound.play();
break;
case "waveUp":
soundEffectChannelNormal = waveUpSound.play();
break;
case "achievement":
soundEffectChannelNormal = achievementSound.play();
break;
case "warning":
soundEffectChannelNormal = warningSound.play();
break;
case "bigNuke":
soundEffectChannelNormal = bigNukeSound.play();
break;
case "gameOver":
soundEffectChannelNormal = gameOverSound.play(0, 1, soundEffectTransform);
break;
case "interface1":
soundEffectChannelNormal = interfaceSound1.play();
break;
case "interface2":
soundEffectChannelNormal = interfaceSound2.play();
break;
case "button1":
soundEffectChannelNormal = buttonSound1.play();
break;
case "button2":
soundEffectChannelNormal = buttonSound2.play();
break;
case "button3":
soundEffectChannelNormal = buttonSound3.play();
break;
case "effect1":
soundEffectChannelNormal = effectSound1.play();
break;
case "effect2":
soundEffectChannelNormal = effectSound2.play();
break;
};
};
soundEffectChannelNormal.soundTransform = soundEffectTransform;
}
public function calculatePlayerPatentCode():int{
var _local5:int;
var _local1 = 300;
var _local2 = 800;
var _local3 = 1700;
var _local4 = 2800;
if (totalAchievementScore < 0){
_local5 = 0;
};
if ((((totalAchievementScore >= _local1)) && ((totalAchievementScore < _local2)))){
createAnAchievement(33);
_local5 = 1;
};
if ((((totalAchievementScore >= _local2)) && ((totalAchievementScore < _local3)))){
createAnAchievement(34);
_local5 = 2;
};
if ((((totalAchievementScore >= _local3)) && ((totalAchievementScore < _local4)))){
createAnAchievement(35);
_local5 = 3;
};
if (totalAchievementScore >= _local4){
createAnAchievement(36);
_local5 = 4;
};
if (_local5 > currentPatentLevel){
currentPatentLevel = _local5;
newPatentLevel = true;
};
return (_local5);
}
public function starNewGameLoop(_arg1:String):void{
currentMenuLoopCode = 0;
mainLoopChannel.stop();
switch (_arg1){
case "game":
mainLoopChannel = gameLoop.play(0, 1, mainLoopSoundTransform);
break;
case "bossA":
mainLoopChannel = bossLoopA.play(0, 1, mainLoopSoundTransform);
break;
case "bossB":
mainLoopChannel = bossLoopB.play(0, 1, mainLoopSoundTransform);
break;
};
mainLoopCode = _arg1;
timePlayingMainLoop = 0;
mainLoopSoundTransform.volume = mainLoopVolume;
mainLoopChannel.soundTransform = mainLoopSoundTransform;
}
private function onAddToStage(_arg1:Event):void{
var _local2:String = stage.loaderInfo.url;
var _local3:Number = (_local2.indexOf("://") + 3);
var _local4:Number = _local2.indexOf("/", _local3);
var _local5:String = _local2.substring(_local3, _local4);
var _local6:Number = (_local5.lastIndexOf(".") - 1);
var _local7:Number = (_local5.lastIndexOf(".", _local6) + 1);
_local5 = _local5.substring(_local7, _local5.length);
if (_local5 == "flashgamelicense.com"){
challengeUnlocked = true;
addAMenuScreen("main");
} else {
addAMenuScreen("splash");
};
if (checkUrl(["dwarfgames.com", "flash.dwarfgames.com"])){
challengeUnlocked = true;
};
retrieveSavedData();
MochiServices.connect("6c82dceb5618d3ab", root);
Log.View(236, "11fba893-ad88-4469-b1bd-1e3f1170cf5b", root.loaderInfo.loaderURL);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyRelease, false, 0, true);
}
public function countWaveReached(_arg1:int):void{
Log.LevelCounterMetric("Wave Reached", _arg1);
}
public function stopGameLoop():void{
loopsArePlaying = false;
mainLoopChannel.soundTransform = silentSoundTransform;
}
private function onKeyRelease(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case KeyCodes.M:
if (mainLoopSoundTransform.volume == 0.55){
gameIsMuted = true;
mainLoopVolume = 0;
mainLoopSoundTransform.volume = mainLoopVolume;
mainLoopChannel.soundTransform = mainLoopSoundTransform;
} else {
gameIsMuted = false;
mainLoopVolume = 0.55;
mainLoopSoundTransform.volume = mainLoopVolume;
mainLoopChannel.soundTransform = mainLoopSoundTransform;
};
if ((currentScreen is Level)){
} else {
soundEffectTransform.volume = 0;
soundEffectChannelExplosion.soundTransform = soundEffectTransform;
};
break;
case KeyCodes.N:
if (soundEffectTransform.volume == 1){
soundEffectTransform.volume = 0;
} else {
soundEffectTransform.volume = soundEffectVolume;
};
soundEffectChannelExplosion.soundTransform = soundEffectTransform;
break;
};
}
}
}//package
Section 178
//MainMenuBase (MainMenuBase)
package {
import flash.display.*;
public dynamic class MainMenuBase extends MovieClip {
public var yourSite:MovieClip;
public var storyMode:SimpleButton;
public var credits:SimpleButton;
public var jayIsGames:SimpleButton;
public var playMoreGames:SimpleButton;
public var achievementsRoom:SimpleButton;
public var logoSpo:SimpleButton;
public var challengeMode:SimpleButton;
}
}//package
Section 179
//MegaLaserImage (MegaLaserImage)
package {
import flash.display.*;
public dynamic class MegaLaserImage extends MovieClip {
}
}//package
Section 180
//Menu1Loop (Menu1Loop)
package {
import flash.media.*;
public dynamic class Menu1Loop extends Sound {
}
}//package
Section 181
//MessageBallonLayout (MessageBallonLayout)
package {
import flash.display.*;
public dynamic class MessageBallonLayout extends MovieClip {
public var inside:MovieClip;
}
}//package
Section 182
//MessageBalloon (MessageBalloon)
package {
import flash.display.*;
import flash.text.*;
public class MessageBalloon extends Sprite {
public var turnOff:Boolean;// = false
private var graphic:MessageBallonLayout;
private var rightLimitX:Number;
private var halfHeight:Number;
public function MessageBalloon(){
graphic = new MessageBallonLayout();
addChild(graphic);
visible = false;
halfHeight = (height * 0.5);
graphic.inside.textMessage.autoSize = TextFieldAutoSize.LEFT;
}
public function newMessage(_arg1:String):void{
visible = true;
alpha = 1;
turnOff = false;
graphic.inside.textMessage.text = _arg1;
graphic.inside.back.width = (graphic.inside.textMessage.textWidth + 8);
graphic.inside.back.height = (graphic.inside.textMessage.textHeight + 4);
rightLimitX = (590 - graphic.inside.back.width);
}
public function updatePos(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
if (y < halfHeight){
graphic.inside.y = (halfHeight - y);
} else {
graphic.inside.y = 0;
};
if (x > rightLimitX){
graphic.inside.x = (-10 - graphic.inside.back.width);
} else {
graphic.inside.x = 10;
};
if (turnOff){
if (alpha > 0){
alpha = (alpha - 0.1);
} else {
turnOff = false;
visible = false;
};
};
}
}
}//package
Section 183
//MissileShot1 (MissileShot1)
package {
import flash.media.*;
public dynamic class MissileShot1 extends Sound {
}
}//package
Section 184
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 185
//NextWaveText (NextWaveText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class NextWaveText extends MovieClip {
public var bonusEXP:TextField;
public var message:TextField;
}
}//package
Section 186
//Nokkians2 (Nokkians2)
package {
import flash.events.*;
import flash.display.*;
import CPMStar.*;
import flash.net.*;
public class Nokkians2 extends Preloader {
public var ad:DisplayObject;
public var fakeloading:Number;
public var adTime:int;// = 300
public var base:LoadingScreenBase;
public var sitelockAds:Boolean;// = false
override protected function endLoading():void{
}
override protected function updateLoading(_arg1:Number):void{
var _local2:String;
var _local3:String;
if (base != null){
if (adTime > 0){
adTime--;
};
fakeloading = ((_arg1 * (300 - adTime)) / 300);
if (fakeloading < 0.99){
base.loadingFiller.scaleX = fakeloading;
_local2 = ((("(" + int((fakeloading * 100)).toString()) + "%") + ")");
_local3 = (((int(((loaderInfo.bytesTotal * fakeloading) / 0x0400)).toString() + "/") + int((loaderInfo.bytesTotal / 0x0400)).toString()) + " KB");
base.loadedValue.text = ((_local3 + " ") + _local2);
} else {
if (base.playNow.alpha == 0){
stage.focus = stage;
base.playNow.alpha = 1;
base.playNow.addEventListener(MouseEvent.CLICK, startGame, false, 0, true);
base.loadingFiller.scaleX = 1;
};
};
};
}
private function visitSponsor(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
var url = "http://www.dwarfgames.com/?utm_source=ingame&utm_medium=sponsoredgames&utm_campaign=nokkians2/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function startGame(_arg1:MouseEvent):void{
base.playNow.removeEventListener(MouseEvent.CLICK, startGame);
base.logoDev.removeEventListener(MouseEvent.CLICK, visitAwokerGames);
base.logoSpo.removeEventListener(MouseEvent.CLICK, visitSponsor);
MochiBot.track(this, "2ddf95b7");
removeChild(base);
base = null;
_adFinished = true;
}
public function checkUrl(_arg1:Array):Boolean{
var _local2:String = stage.loaderInfo.url;
var _local3:int = (_arg1.length - 1);
while (_local3 >= 0) {
if (_local2.indexOf(_arg1[_local3]) != -1){
return (true);
};
_local3--;
};
return (false);
}
private function visitAwokerGames(_arg1:MouseEvent):void{
var mouseEvent = _arg1;
var url = "http://www.awokergames.com/";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
override protected function beginLoading():void{
var _local7:String;
base = new LoadingScreenBase();
addChild(base);
base.playNow.alpha = 0;
base.logoDev.addEventListener(MouseEvent.CLICK, visitAwokerGames, false, 0, true);
base.logoSpo.addEventListener(MouseEvent.CLICK, visitSponsor, false, 0, true);
var _local1:String = stage.loaderInfo.url;
var _local2:Number = (_local1.indexOf("://") + 3);
var _local3:Number = _local1.indexOf("/", _local2);
var _local4:String = _local1.substring(_local2, _local3);
var _local5:Number = (_local4.lastIndexOf(".") - 1);
var _local6:Number = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
if ((((((((_local4 == "flashgamelicense.com")) || ((_local4 == "chat.kongregate.com")))) || ((_local4 == "kongregate.com")))) || ((_local4 == "addictinggames.com")))){
sitelockAds = true;
adTime = 0;
};
if (checkUrl(["dwarfgames.com", "flash.dwarfgames.com", "www.flash.dwarfgames.com"])){
sitelockAds = true;
adTime = 0;
};
if (sitelockAds == false){
_local7 = "3244QA573CF33";
ad = new AdLoader(_local7);
base.adbox.addChild(ad);
};
}
}
}//package
Section 187
//NukeSound1 (NukeSound1)
package {
import flash.media.*;
public dynamic class NukeSound1 extends Sound {
}
}//package
Section 188
//ParallaxEffectLv1 (ParallaxEffectLv1)
package {
import flash.display.*;
public dynamic class ParallaxEffectLv1 extends Sprite {
}
}//package
Section 189
//ParallaxEffectLv2 (ParallaxEffectLv2)
package {
import flash.display.*;
public dynamic class ParallaxEffectLv2 extends Sprite {
}
}//package
Section 190
//ParallaxEffectLv3 (ParallaxEffectLv3)
package {
import flash.display.*;
public dynamic class ParallaxEffectLv3 extends Sprite {
}
}//package
Section 191
//Particle (Particle)
package {
import flash.display.*;
public dynamic class Particle extends Sprite {
}
}//package
Section 192
//PauseScreenImage (PauseScreenImage)
package {
import flash.display.*;
public dynamic class PauseScreenImage extends MovieClip {
public var image:MovieClip;
public var logoSpo:MovieClip;
}
}//package
Section 193
//PerformanceScreenBase (PerformanceScreenBase)
package {
import flash.display.*;
import flash.text.*;
public dynamic class PerformanceScreenBase extends MovieClip {
public var KEValue:TextField;
public var DTValue:TextField;
public var DTGrade:TextField;
public var LCGrade:TextField;
public var LCValue:TextField;
public var finalScoreValue:TextField;
public var continueButton:SimpleButton;
public var TSBar:MovieClip;
public var yourSite:SimpleButton;
public var newHighscore:TextField;
public var newPatentLevel:TextField;
public var finalScoreText:TextField;
public var KEBar:MovieClip;
public var playMoreGames:SimpleButton;
public var submitScoreButton:SimpleButton;
public var TSGrade:TextField;
public var TSValue:TextField;
public var DTBar:MovieClip;
public var LCBar:MovieClip;
public var logoSpo:SimpleButton;
public var totalModifier:MovieClip;
public var KEGrade:TextField;
}
}//package
Section 194
//PowerLootCollected (PowerLootCollected)
package {
import flash.media.*;
public dynamic class PowerLootCollected extends Sound {
}
}//package
Section 195
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Preloader extends MovieClip {
protected var _adFinished:Boolean;
private var _firstFrame:Boolean;
public function Preloader(){
_firstFrame = true;
_adFinished = false;
addEventListener(Event.ENTER_FRAME, checkFrames);
}
protected function endLoading():void{
}
protected function updateLoading(_arg1:Number):void{
}
protected function get mainClassName():String{
return ("Main");
}
protected function beginLoading():void{
}
private function startup():void{
stop();
if (!_firstFrame){
endLoading();
};
var _local1:Class = (getDefinitionByName(mainClassName) as Class);
if (_local1 == null){
throw (new Error((("Preloading error. There was no class matching [" + mainClassName) + "]. You may need to override Preloader::mainClassName")));
};
var _local2:DisplayObject = (new (_local1) as DisplayObject);
if (_local2 == null){
throw (new Error((("Error in Preloader::startup. [" + mainClassName) + "] must inherit from Sprite or MovieClip")));
};
addChild(_local2);
}
private function checkFrames(_arg1:Event):void{
if ((((currentFrame == totalFrames)) && (_adFinished))){
removeEventListener(Event.ENTER_FRAME, checkFrames);
startup();
return;
};
if (_firstFrame){
beginLoading();
_firstFrame = false;
return;
};
var _local2:Number = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
updateLoading(_local2);
}
}
}//package
Section 196
//SelectSpacecraftScreenBase (SelectSpacecraftScreenBase)
package {
import flash.display.*;
import flash.text.*;
public dynamic class SelectSpacecraftScreenBase extends MovieClip {
public var shipBButton:SimpleButton;
public var shipAButton:SimpleButton;
public var patentImage:MovieClip;
public var mainMenu:SimpleButton;
public var bonusPatent:TextField;
public var logoSpo:SimpleButton;
}
}//package
Section 197
//ShieldActivate (ShieldActivate)
package {
import flash.media.*;
public dynamic class ShieldActivate extends Sound {
}
}//package
Section 198
//ShieldDown (ShieldDown)
package {
import flash.media.*;
public dynamic class ShieldDown extends Sound {
}
}//package
Section 199
//ShotSound1 (ShotSound1)
package {
import flash.media.*;
public dynamic class ShotSound1 extends Sound {
}
}//package
Section 200
//Silence (Silence)
package {
import flash.media.*;
public dynamic class Silence extends Sound {
}
}//package
Section 201
//SponsorSplashBase (SponsorSplashBase)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class SponsorSplashBase extends MovieClip {
public function SponsorSplashBase(){
addFrameScript(0, this.frame1);
}
public function loadURL(_arg1:String="", _arg2:String=null){
if (_arg1){
navigateToURL(new URLRequest(_arg1), _arg2);
};
}
public function e_linkClick(_arg1:MouseEvent){
this.loadURL("http://www.dwarfgames.com/");
}
function frame1(){
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, this.e_linkClick);
}
}
}//package
Section 202
//StageGameImage (StageGameImage)
package {
import flash.display.*;
public dynamic class StageGameImage extends MovieClip {
public var gamePlaceInside:MovieClip;
}
}//package
Section 203
//StageImage (StageImage)
package {
import flash.display.*;
import flash.text.*;
public dynamic class StageImage extends MovieClip {
public var bomb1:MovieClip;
public var bossHint:MovieClip;
public var bomb2:MovieClip;
public var bomb3:MovieClip;
public var scoreField:TextField;
public var levelText:TextField;
public var waveNumber:TextField;
public var bossTimer:TextField;
public var multiplierClock:ClockImage;
public var gamePlace:StageGameImage;
public var turnONWingman:MovieClip;
public var pressDMessage:MovieClip;
public var waveText:TextField;
public var warningMessage:MovieClip;
public var level:TextField;
public var multiplierText:TextField;
public var hintSystem:MovieClip;
public var expBar:MovieClip;
}
}//package
Section 204
//StoryStartBase (StoryStartBase)
package {
import flash.display.*;
public dynamic class StoryStartBase extends MovieClip {
public var startButton:SimpleButton;
public var mainMenu:SimpleButton;
}
}//package
Section 205
//SubmitTime (SubmitTime)
package {
import flash.display.*;
public dynamic class SubmitTime extends MovieClip {
}
}//package
Section 206
//TakeDamage (TakeDamage)
package {
import flash.media.*;
public dynamic class TakeDamage extends Sound {
}
}//package
Section 207
//WarningSound (WarningSound)
package {
import flash.media.*;
public dynamic class WarningSound extends Sound {
}
}//package
Section 208
//WaveUp (WaveUp)
package {
import flash.media.*;
public dynamic class WaveUp extends Sound {
}
}//package
Section 209
//Wingman (Wingman)
package {
import flash.display.*;
public dynamic class Wingman extends MovieClip {
}
}//package
Section 210
//WingmanONOFF (WingmanONOFF)
package {
import flash.display.*;
public dynamic class WingmanONOFF extends MovieClip {
public function WingmanONOFF(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package
Section 211
//WinningSceneBase (WinningSceneBase)
package {
import flash.display.*;
public dynamic class WinningSceneBase extends MovieClip {
}
}//package
Section 212
//WinSong (WinSong)
package {
import flash.media.*;
public dynamic class WinSong extends Sound {
}
}//package
Section 213
//YellowFlash (YellowFlash)
package {
import flash.display.*;
public dynamic class YellowFlash extends MovieClip {
}
}//package