Section 1
//MemoryCrypto (com.electrotank.util.MemoryCrypto)
package com.electrotank.util {
public class MemoryCrypto {
private static var ciao:Number;
public static function incrementValue(_arg1:String, _arg2:Number):Number{
ciao = (ciao + _arg2);
return (ciao);
}
public static function divideValue(_arg1:String, _arg2:Number):Number{
ciao = (ciao / _arg2);
return (ciao);
}
public static function getValue(_arg1:String):Number{
return (ciao);
}
public static function multiplyValue(_arg1:String, _arg2:Number):Number{
ciao = (ciao * _arg2);
return (ciao);
}
public static function decrementValue(_arg1:String, _arg2:Number):Number{
ciao = (ciao - _arg2);
return (ciao);
}
public static function setValue(_arg1:String, _arg2:Number):Number{
ciao = _arg2;
return (_arg2);
}
}
}//package com.electrotank.util
Section 2
//PathFinder (FoofaAI.PathFinder)
package FoofaAI {
import flash.geom.*;
import FoofaDataTypes.*;
public class PathFinder {
private var _found:Boolean;
private var _visitedNodes:Array_Contains;
private var _maxStep:uint;
private var _queue:PriorityQueue_DirectAccess;
private var _currentObject:Object;
private var _findingInProgress:Boolean;
private var _map:PathFindingGrid;
private var _start:Point;
private var _currentNode:PathfindingNode;
private var _target:Point;
private var _neighbourhood:Array;
public function PathFinder(_arg1:PathFindingGrid, _arg2:Number){
if (_arg2 <= 0){
_maxStep = uint.MAX_VALUE;
} else {
_maxStep = _arg2;
};
_map = _arg1;
_queue = new PriorityQueue_DirectAccess();
_visitedNodes = new Array_Contains();
_neighbourhood = new Array();
_findingInProgress = false;
_found = false;
_start = new Point();
_target = new Point();
_currentNode = new PathfindingNode(new Point(0, 0));
}
private function GetDirection(_arg1:Point, _arg2:Point):Point{
var _local3:Point;
if (_arg1 == _arg2){
return (new Point(0, 0));
};
_local3 = new Point(Math.round((_arg1.x - _arg2.x)), Math.round((_arg1.y - _arg2.y)));
return (_local3);
}
private function GetNeighbourhood(_arg1:Number, _arg2:Number):Number{
_neighbourhood.splice(0, _neighbourhood.length);
return (_map.GetNeighbourhood(_arg1, _arg2, _neighbourhood));
}
public function Move(_arg1:Point, _arg2:Point, _arg3:Array):Number{
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Number;
var _local9:Number;
if (!_findingInProgress){
_queue.clear();
_visitedNodes.clear();
_arg3.splice(0, _arg3.length);
_findingInProgress = true;
_found = false;
_start.x = _map.FromPixelPosToGridX(_arg1);
_start.y = _map.FromPixelPosToGridY(_arg1);
_target.x = _map.FromPixelPosToGridX(_arg2);
_target.y = _map.FromPixelPosToGridY(_arg2);
if ((((_map.IsWalkableEx(_target.x, _target.y) == false)) || ((_map.IsWalkableEx(_start.x, _start.y) == false)))){
return (-1);
};
_currentNode = new PathfindingNode(_start);
_currentNode.g = 0;
_currentNode.h = GetHeuristic(_start, _target);
_currentNode.f = _currentNode.h;
_currentNode.SetParentCoords(PathfindingNode.DUMMYPARENT);
_queue.Insert(_currentNode, _currentNode.f);
} else {
if (((((((!((_target.x == _map.FromPixelPosToGridX(_arg2)))) && (!((_target.y == _map.FromPixelPosToGridY(_arg2)))))) && (!((_map.FromPixelPosToGridX(_arg1) == _start.x))))) && (!((_map.FromPixelPosToGridY(_arg1) == _start.y))))){
_findingInProgress = true;
_found = false;
_queue.clear();
_visitedNodes.clear();
};
};
this.SingleMovement();
if (_visitedNodes.Size() > this._maxStep){
return (-1);
};
if (!_findingInProgress){
if (_found){
_local5 = new Point();
_local5.x = _currentNode.GetPosition().x;
_local5.y = _currentNode.GetPosition().y;
while (!((((_currentNode.GetParentCoords().x == PathfindingNode.DUMMYPARENT.x)) && ((_currentNode.GetParentCoords().y == PathfindingNode.DUMMYPARENT.y))))) {
_local4 = new Point(_currentNode.GetParentCoords().x, _currentNode.GetParentCoords().y);
_local8 = _queue.Find(_local4);
_local9 = _visitedNodes.Find(_local4);
_local6 = GetDirection(_local5, _currentNode.GetPosition());
_local7 = GetDirection(_currentNode.GetPosition(), _local4);
if (_local6 != _local7){
_arg3[_arg3.length] = new Point(_currentNode.c.x, _currentNode.c.y);
};
_local5.x = _currentNode.GetPosition().x;
_local5.y = _currentNode.GetPosition().y;
_currentNode.SetPosition(_local4);
_currentNode.SetParentCoords(_visitedNodes.GetElementAt(_local9).GetParentCoords());
};
_arg3[_arg3.length] = new Point(_currentNode.c.x, _currentNode.c.y);
_queue.clear();
_visitedNodes.clear();
return (1);
} else {
_queue.clear();
_visitedNodes.clear();
return (-1);
};
};
return (0);
}
private function SingleMovement(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:PathfindingNode;
var _local6:Number;
if (!_queue.IsEmpty()){
_currentObject = new Object();
_currentObject = _queue.RemoveTop();
_currentNode = new PathfindingNode(new Point(0, 0));
_currentNode.SetFromObject(_currentObject);
_visitedNodes.push(_currentNode);
if (_visitedNodes.Size() > 1000){
return (-1);
};
if ((((_currentNode.GetPosition().x == _target.x)) && ((_currentNode.GetPosition().y == _target.y)))){
_findingInProgress = false;
_found = true;
return;
};
_local1 = GetNeighbourhood(_currentNode.GetPosition().x, _currentNode.GetPosition().y);
if (_local1 < 0){
} else {
if (_local1 > 8){
};
};
_local6 = 0;
while (_local6 < _local1) {
_local2 = _queue.Find(_neighbourhood[_local6]);
_local3 = _visitedNodes.Find2(_neighbourhood[_local6]);
if ((((_local2 == -1)) && ((_local3 == -1)))){
_local5 = new PathfindingNode(_neighbourhood[_local6]);
_local5.g = GetMovementCost(_currentNode.c, _local5.c);
_local5.h = GetHeuristic(_local5.c, _target);
_local5.f = (_local5.g + _local5.h);
_local5.SetParentCoords(_currentNode.c);
_queue.Insert(_local5, _local5.f);
} else {
if (_local3 == -1){
_local4 = GetMovementCost(_currentNode.c, _neighbourhood[_local6]);
if (_local4 < _queue.GetElementAt(_local2).g){
_local5 = new PathfindingNode(_queue.GetElementAt(_local2).c);
_local5.SetParentCoords(_currentNode.c);
_local5.g = _local4;
_local5.g = _queue.GetElementAt(_local2).h;
_local5.f = (_local5.g + _local5.h);
_queue.SetElementAt(_local2, _local5);
};
};
};
_local6++;
};
} else {
_found = false;
_findingInProgress = false;
};
}
private function GetMovementCost(_arg1:Point, _arg2:Point){
if ((((_arg1.x == _arg2.x)) && ((_arg1.y == _arg2.y)))){
return (0);
};
if ((((((_arg1.x == _arg2.x)) && (!((_arg1.y == _arg2.y))))) || ((((_arg1.y == _arg2.y)) && (!((_arg1.x == _arg2.x))))))){
return (10);
};
return (14);
}
private function GetHeuristic(_arg1:Point, _arg2:Point){
return ((10 * (Math.abs((_arg1.x - _arg2.x)) + Math.abs((_arg1.y - _arg2.y)))));
}
public function ShowNeighbourhood(_arg1:Point):void{
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:uint;
var _local6:uint;
_local2 = _map.FromPixelPosToGridX(_arg1);
_local3 = _map.FromPixelPosToGridY(_arg1);
_local4 = GetNeighbourhood(_local2, _local3);
_local6 = 0;
while (_local6 < _local4) {
_local5 = _map.FromGridPosToGridIndex(_neighbourhood[_local6].x, _neighbourhood[_local6].x);
_local6++;
};
}
}
}//package FoofaAI
Section 3
//PathFindingGrid (FoofaAI.PathFindingGrid)
package FoofaAI {
import FoofaGeom.*;
import flash.geom.*;
public class PathFindingGrid extends SpatialGrid {
public function PathFindingGrid(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Array){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function RasterLineEx(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5):void{
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:Number;
var _local13:Boolean;
var _local14:Number;
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg3 < 0){
_arg3 = 0;
};
if (_arg2 < 0){
_arg2 = 0;
};
if (_arg4 < 0){
_arg4 = 0;
};
_local13 = (Math.abs((_arg4 - _arg2)) > Math.abs((_arg3 - _arg1)));
if (_local13){
_local14 = _arg1;
_arg1 = _arg2;
_arg2 = _local14;
_local14 = _arg3;
_arg3 = _arg4;
_arg4 = _local14;
};
if (_arg1 > _arg3){
_local14 = _arg1;
_arg1 = _arg3;
_arg3 = _local14;
_local14 = _arg2;
_arg2 = _arg4;
_arg4 = _local14;
};
_local7 = (_arg3 - _arg1);
_local8 = Math.abs((_arg4 - _arg2));
_local9 = (-(_local7) / 2);
_local12 = _arg2;
if (_arg2 < _arg4){
_local10 = 1;
} else {
_local10 = -1;
};
_local11 = _arg1;
while (_local11 <= _arg3) {
if (_local13){
if ((((((((_local12 < xCellCount)) && ((_local12 >= 0)))) && ((_local11 < yCellCount)))) && ((_local11 >= 0)))){
SetCellEx(_local12, _local11, _arg5);
};
} else {
if ((((((((_local11 < xCellCount)) && ((_local11 >= 0)))) && ((_local12 < yCellCount)))) && ((_local12 >= 0)))){
SetCellEx(_local11, _local12, _arg5);
};
};
_local9 = (_local9 + _local8);
if (_local9 > 0){
_local12 = (_local12 + _local10);
_local9 = (_local9 - _local7);
};
_local11++;
};
}
public function SetWalkable(_arg1:Point, _arg2:Boolean):void{
var _local3:uint;
var _local4:uint;
_local3 = FromPixelPosToGridX(_arg1);
_local4 = FromPixelPosToGridY(_arg1);
SetWalkableEx(_local3, _local4, _arg2);
}
public function DrawRectangleWT(_arg1:Array, _arg2):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:Number;
var _local8:Number;
var _local9:uint;
var _local10:Array;
var _local11:*;
var _local12:*;
var _local13:Array;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:Boolean;
var _local18:uint;
var _local19:*;
var _local20:Number;
var _local21:uint;
var _local22:uint;
var _local23:Point;
var _local24:Point;
var _local25:Boolean;
var _local26:Boolean;
var _local27:*;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = _arg1[0].y;
_local8 = _arg1[0].y;
_local9 = 1;
while (_local9 < _arg1.length) {
if (_arg1[_local9].y < _local8){
_local4 = _local9;
_local8 = _arg1[_local9].y;
};
_local9++;
};
switch (_local4){
case 0:
_local3 = 2;
_local5 = 1;
_local6 = 3;
break;
case 1:
_local3 = 3;
_local5 = 2;
_local6 = 0;
break;
case 2:
_local3 = 0;
_local5 = 3;
_local6 = 1;
break;
case 3:
_local3 = 1;
_local5 = 0;
_local6 = 2;
break;
};
if (_arg1[_local5].x > _arg1[_local6].x){
_local27 = _local5;
_local5 = _local6;
_local6 = _local27;
};
_local10 = new Array();
_local10[0] = new Point(FromPixelPosToGridX(_arg1[_local3]), FromPixelPosToGridY(_arg1[_local3]));
_local10[2] = new Point(FromPixelPosToGridX(_arg1[_local4]), FromPixelPosToGridY(_arg1[_local4]));
_local10[1] = new Point(FromPixelPosToGridX(_arg1[_local5]), FromPixelPosToGridY(_arg1[_local5]));
_local10[3] = new Point(FromPixelPosToGridX(_arg1[_local6]), FromPixelPosToGridY(_arg1[_local6]));
_local11 = _local10[1].y;
_local12 = _local10[3].y;
if (_local11 < _local12){
_local11 = _local10[3].y;
_local12 = _local10[1].y;
};
_local13 = new Array();
_local14 = new Array();
_local15 = new Array();
_local16 = new Array();
_local17 = false;
_local18 = 0;
GetRasterLineWT(_local10[0], _local10[1], _local13);
GetRasterLineWT(_local10[0], _local10[3], _local15);
GetRasterLineWT(_local10[1], _local10[2], _local14);
GetRasterLineWT(_local10[3], _local10[2], _local16);
if ((((_local13[0].x == _local13[(_local13.length - 1)].x)) && ((_local14[0].y == _local14[(_local14.length - 1)].y)))){
_local17 = true;
_local15 = _local16;
} else {
if ((((_local13[0].y == _local13[(_local13.length - 1)].y)) && ((_local14[0].x == _local14[(_local14.length - 1)].x)))){
_local17 = true;
_local13 = _local14;
};
};
_local21 = 0;
_local22 = 0;
_local23 = new Point();
_local24 = new Point();
_local25 = true;
_local26 = true;
_local20 = _local10[0].y;
while (_local20 >= _local10[2].y) {
if (!_local17){
if (_local20 >= _local10[1].y){
while (((!((_local21 == _local13.length))) && ((_local13[_local21].y == _local20)))) {
_local21++;
};
if (_local21 == _local13.length){
_local23.y = _local20;
_local23.x = _local13[(_local13.length - 1)].x;
_local13 = _local14;
_local21 = 0;
while (((!((_local21 == _local13.length))) && ((_local13[_local21].y == _local20)))) {
_local21++;
};
} else {
_local23.y = _local20;
_local23.x = _local13[(_local21 - 1)].x;
};
} else {
_local23.y = _local20;
_local23.x = _local13[_local21].x;
while (((!((_local21 == _local13.length))) && ((_local13[_local21].y == _local20)))) {
_local21++;
};
};
if (_local20 >= _local10[3].y){
while (((!((_local22 == _local15.length))) && ((_local15[_local22].y == _local20)))) {
_local22++;
};
if (_local22 == _local15.length){
_local15 = _local16;
_local22 = 1;
};
_local24.y = _local20;
_local24.x = _local15[(_local22 - 1)].x;
} else {
_local24.y = _local20;
_local24.x = _local15[_local22].x;
while (((!((_local22 == _local15.length))) && ((_local15[_local22].y >= _local20)))) {
_local22++;
};
};
} else {
_local23.y = _local20;
_local24.y = _local20;
if (_local13[_local18].x < _local15[_local18].x){
_local23.x = _local13[_local18].x;
_local24.x = _local15[_local18].x;
} else {
_local24.x = _local13[_local18].x;
_local23.x = _local15[_local18].x;
};
_local18++;
};
_local19 = _local23.x;
while (_local19 <= _local24.x) {
if ((((((((_local19 < xCellCount)) && ((_local19 > 0)))) && ((_local20 < yCellCount)))) && ((_local20 > 0)))){
SetCellEx(_local19, _local20, _arg2);
};
_local19++;
};
_local20--;
};
}
public function GetCellCostPt(_arg1:Point):Object{
return (cellArray[FromPixelPosToGridIndex(_arg1)].cost);
}
public function GetCellCostGrid(_arg1:uint, _arg2:uint):Object{
return (cellArray[FromGridPosToGridIndex(_arg1, _arg2)].cost);
}
private function GetRasterLineWT(_arg1:Point, _arg2:Point, _arg3:Array):Boolean{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Number;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:Number;
var _local15:Boolean;
var _local16:Boolean;
var _local17:Number;
var _local18:Array;
_local11 = _arg1.x;
_local12 = _arg2.x;
_local13 = _arg1.y;
_local14 = _arg2.y;
if (_local12 > 10000){
return (false);
};
_local15 = false;
_local16 = (Math.abs((_local14 - _local13)) > Math.abs((_local12 - _local11)));
if (_local16){
_local17 = _local11;
_local11 = _local13;
_local13 = _local17;
_local17 = _local12;
_local12 = _local14;
_local14 = _local17;
};
if (_local11 > _local12){
_local15 = true;
_local17 = _local11;
_local11 = _local12;
_local12 = _local17;
_local17 = _local13;
_local13 = _local14;
_local14 = _local17;
};
_local5 = (_local12 - _local11);
_local6 = Math.abs((_local14 - _local13));
_local7 = (-(_local5) / 2);
_local10 = _local13;
if (_local13 < _local14){
_local8 = 1;
} else {
_local8 = -1;
};
_local9 = _local11;
while (_local9 <= _local12) {
_local7 = (_local7 + _local6);
if (_local7 > 0){
if (_local16){
_arg3[_arg3.length] = new Point(_local10, _local9);
_arg3[_arg3.length] = new Point((_local10 + _local8), _local9);
_arg3[_arg3.length] = new Point(_local10, (_local9 + 1));
} else {
_arg3[_arg3.length] = new Point(_local9, _local10);
_arg3[_arg3.length] = new Point((_local9 + 1), _local10);
_arg3[_arg3.length] = new Point(_local9, (_local10 + _local8));
};
_local10 = (_local10 + _local8);
_local7 = (_local7 - _local5);
} else {
if (_local16){
_arg3[_arg3.length] = new Point(_local10, _local9);
} else {
_arg3[_arg3.length] = new Point(_local9, _local10);
};
};
_local9++;
};
if (_local15){
_local18 = _arg3.reverse();
_arg3 = _local18;
};
return (_local15);
}
public function SetWalkableEx(_arg1:Number, _arg2:Number, _arg3:Boolean):void{
if ((((((((_arg1 >= xCellCount)) || ((_arg1 < 0)))) || ((_arg2 >= yCellCount)))) || ((_arg2 < 0)))){
return;
};
cellArray[FromGridPosToGridIndex(_arg1, _arg2)].walkable = _arg3;
}
public function GetCellEx(_arg1:Number, _arg2:Number):Object{
if ((((((((_arg1 >= xCellCount)) || ((_arg1 < 0)))) || ((_arg2 >= yCellCount)))) || ((_arg2 < 0)))){
};
return (cellArray[FromGridPosToGridIndex(_arg1, _arg2)]);
}
public function IsWalkable(_arg1:Point):Boolean{
var _local2:uint;
var _local3:uint;
_local2 = FromPixelPosToGridX(_arg1);
_local3 = FromPixelPosToGridY(_arg1);
return (IsWalkableEx(_local2, _local3));
}
public function SetCellEx(_arg1:Number, _arg2:Number, _arg3){
if ((((((((_arg1 >= xCellCount)) || ((_arg1 < 0)))) || ((_arg2 >= yCellCount)))) || ((_arg2 < 0)))){
return;
};
cellArray[FromGridPosToGridIndex(_arg1, _arg2)] = _arg3;
}
public function RasterLineWTEx(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5):void{
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:Number;
var _local13:Boolean;
var _local14:Number;
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg3 < 0){
_arg3 = 0;
};
if (_arg2 < 0){
_arg2 = 0;
};
if (_arg4 < 0){
_arg4 = 0;
};
_local13 = (Math.abs((_arg4 - _arg2)) > Math.abs((_arg3 - _arg1)));
if (_local13){
_local14 = _arg1;
_arg1 = _arg2;
_arg2 = _local14;
_local14 = _arg3;
_arg3 = _arg4;
_arg4 = _local14;
};
if (_arg1 > _arg3){
_local14 = _arg1;
_arg1 = _arg3;
_arg3 = _local14;
_local14 = _arg2;
_arg2 = _arg4;
_arg4 = _local14;
};
_local7 = (_arg3 - _arg1);
_local8 = Math.abs((_arg4 - _arg2));
_local9 = (-(_local7) / 2);
_local12 = _arg2;
if (_arg2 < _arg4){
_local10 = 1;
} else {
_local10 = -1;
};
_local11 = _arg1;
while (_local11 <= _arg3) {
if (_local13){
if ((((((((_local12 < xCellCount)) && ((_local12 >= 0)))) && ((_local11 < yCellCount)))) && ((_local11 >= 0)))){
SetCellEx(_local12, _local11, _arg5);
};
} else {
if ((((((((_local11 < xCellCount)) && ((_local11 >= 0)))) && ((_local12 < yCellCount)))) && ((_local12 >= 0)))){
SetCellEx(_local11, _local12, _arg5);
};
};
_local9 = (_local9 + _local8);
if (_local9 > 0){
if (_local13){
if ((((((((_local12 < xCellCount)) && ((_local12 >= 0)))) && ((_local11 < yCellCount)))) && ((_local11 >= 0)))){
SetCellEx(_local12, (_local11 + 1), _arg5);
};
if (((((((((_local12 + _local10) < xCellCount)) && (((_local12 + _local10) >= 0)))) && ((_local11 < yCellCount)))) && ((_local11 >= 0)))){
SetCellEx((_local12 + _local10), _local11, _arg5);
};
} else {
if (((((((((_local11 + 1) < xCellCount)) && (((_local11 + 1) >= 0)))) && ((_local12 < yCellCount)))) && ((_local12 >= 0)))){
SetCellEx((_local11 + 1), _local12, _arg5);
};
if ((((((((_local11 < xCellCount)) && ((_local11 >= 0)))) && (((_local12 + _local10) < yCellCount)))) && ((_local12 >= 0)))){
SetCellEx(_local11, (_local12 + _local10), _arg5);
};
};
_local12 = (_local12 + _local10);
_local9 = (_local9 - _local7);
};
_local11++;
};
}
public function DrawCircle(_arg1:Circle, _arg2):void{
var _local3:Number;
var _local4:Number;
var _local5:uint;
var _local6:Number;
var _local7:*;
var _local8:Number;
_local3 = FromPixelXToGridX(_arg1.x);
_local4 = FromPixelYToGridY(_arg1.y);
_local5 = (FromPixelXToGridX((_arg1.x + _arg1.radius)) - _local3);
_local6 = (3 - (2 * _local5));
_local7 = 0;
_local8 = _local5;
while (_local7 <= _local8) {
RasterLineEx((_local3 + _local7), (_local4 + _local8), (_local3 - _local7), (_local4 + _local8), _arg2);
RasterLineEx((_local3 + _local8), (_local4 + _local7), (_local3 - _local8), (_local4 + _local7), _arg2);
RasterLineEx((_local3 + _local8), (_local4 - _local7), (_local3 - _local8), (_local4 - _local7), _arg2);
RasterLineEx((_local3 - _local7), (_local4 - _local8), (_local3 + _local7), (_local4 - _local8), _arg2);
if (_local6 < 0){
_local6 = (_local6 + ((4 * _local7) + 6));
} else {
_local6 = (_local6 + ((4 * (_local7 - _local8)) + 10));
_local8--;
};
_local7++;
};
}
public function SetCell(_arg1:Point, _arg2){
var _local3:uint;
var _local4:uint;
_local3 = FromPixelPosToGridX(_arg1);
_local4 = FromPixelPosToGridY(_arg1);
SetCellEx(_local3, _local4, _arg2);
}
private function GetRasterLine(_arg1:Point, _arg2:Point, _arg3:Array):Boolean{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Number;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:Number;
var _local15:Boolean;
var _local16:Boolean;
var _local17:Number;
var _local18:Array;
_local11 = _arg1.x;
_local12 = _arg2.x;
_local13 = _arg1.y;
_local14 = _arg2.y;
if (_local12 > 10000){
return (false);
};
_local15 = false;
_local16 = (Math.abs((_local14 - _local13)) > Math.abs((_local12 - _local11)));
if (_local16){
_local17 = _local11;
_local11 = _local13;
_local13 = _local17;
_local17 = _local12;
_local12 = _local14;
_local14 = _local17;
};
if (_local11 > _local12){
_local15 = true;
_local17 = _local11;
_local11 = _local12;
_local12 = _local17;
_local17 = _local13;
_local13 = _local14;
_local14 = _local17;
};
_local5 = (_local12 - _local11);
_local6 = Math.abs((_local14 - _local13));
_local7 = (-(_local5) / 2);
_local10 = _local13;
if (_local13 < _local14){
_local8 = 1;
} else {
_local8 = -1;
};
_local9 = _local11;
while (_local9 <= _local12) {
if (_local16){
_arg3[_arg3.length] = new Point(_local10, _local9);
} else {
_arg3[_arg3.length] = new Point(_local9, _local10);
};
_local7 = (_local7 + _local6);
if (_local7 > 0){
_local10 = (_local10 + _local8);
_local7 = (_local7 - _local5);
};
_local9++;
};
if (_local15){
_local18 = _arg3.reverse();
_arg3 = _local18;
};
return (_local15);
}
public function IsLineWalkable(_arg1:Point, _arg2:Point, _arg3):Boolean{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:Number;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:Number;
var _local15:Boolean;
var _local16:Number;
_local11 = FromPixelPosToGridX(_arg1);
_local12 = FromPixelPosToGridX(_arg2);
_local13 = FromPixelPosToGridY(_arg1);
_local14 = FromPixelPosToGridY(_arg2);
_local15 = (Math.abs((_local14 - _local13)) > Math.abs((_local12 - _local11)));
if (_local15){
_local16 = _local11;
_local11 = _local13;
_local13 = _local16;
_local16 = _local12;
_local12 = _local14;
_local14 = _local16;
};
if (_local11 > _local12){
_local16 = _local11;
_local11 = _local12;
_local12 = _local16;
_local16 = _local13;
_local13 = _local14;
_local14 = _local16;
};
_local5 = (_local12 - _local11);
_local6 = Math.abs((_local14 - _local13));
_local7 = (-(_local5) / 2);
_local10 = _local13;
if (_local13 < _local14){
_local8 = 1;
} else {
_local8 = -1;
};
_local9 = _local11;
while (_local9 <= _local12) {
if (_local15){
if (!IsWalkableEx(_local10, _local9)){
return (false);
};
if (!IsWalkableEx(_local9, _local10)){
return (false);
};
};
_local7 = (_local7 + _local6);
if (_local7 > 0){
_local10 = (_local10 + _local8);
_local7 = (_local7 - _local5);
};
_local9++;
};
return (true);
}
public function GetNeighbourhood(_arg1:Number, _arg2:Number, _arg3:Array):Number{
var _local4:uint;
var _local5:Number;
var _local6:Number;
if (!IsWalkableEx(_arg1, _arg2)){
return (0);
};
_local4 = 0;
_local5 = _arg1;
_local6 = _arg2;
if (IsWalkableEx((_arg1 - 1), _arg2)){
_arg3[_local4] = new Point((_arg1 - 1), _arg2);
_local4++;
};
if (IsWalkableEx((_arg1 + 1), _arg2)){
_arg3[_local4] = new Point((_arg1 + 1), _arg2);
_local4++;
};
if (((((IsWalkableEx((_arg1 - 1), (_arg2 - 1))) && (IsWalkableEx(_arg1, (_arg2 - 1))))) && (IsWalkableEx((_arg1 - 1), _arg2)))){
_arg3[_local4] = new Point((_arg1 - 1), (_arg2 - 1));
_local4++;
};
if (((((IsWalkableEx((_arg1 - 1), (_arg2 + 1))) && (IsWalkableEx(_arg1, (_arg2 + 1))))) && (IsWalkableEx((_arg1 - 1), _arg2)))){
_arg3[_local4] = new Point((_arg1 - 1), (_arg2 + 1));
_local4++;
};
if (((((IsWalkableEx((_arg1 + 1), (_arg2 - 1))) && (IsWalkableEx(_arg1, (_arg2 - 1))))) && (IsWalkableEx((_arg1 + 1), _arg2)))){
_arg3[_local4] = new Point((_arg1 + 1), (_arg2 - 1));
_local4++;
};
if (((((IsWalkableEx((_arg1 + 1), (_arg2 + 1))) && (IsWalkableEx(_arg1, (_arg2 + 1))))) && (IsWalkableEx((_arg1 + 1), _arg2)))){
_arg3[_local4] = new Point((_arg1 + 1), (_arg2 + 1));
_local4++;
};
if (IsWalkableEx(_arg1, (_arg2 - 1))){
_arg3[_local4] = new Point(_arg1, (_arg2 - 1));
_local4++;
};
if (IsWalkableEx(_arg1, (_arg2 + 1))){
_arg3[_local4] = new Point(_arg1, (_arg2 + 1));
_local4++;
};
return (_local4);
}
public function DrawRectangle(_arg1:Array, _arg2):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:Number;
var _local8:Number;
var _local9:uint;
var _local10:Array;
var _local11:*;
var _local12:*;
var _local13:Array;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:Boolean;
var _local18:uint;
var _local19:*;
var _local20:Number;
var _local21:uint;
var _local22:uint;
var _local23:Point;
var _local24:Point;
var _local25:Boolean;
var _local26:Boolean;
var _local27:*;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = _arg1[0].y;
_local8 = _arg1[0].y;
_local9 = 1;
while (_local9 < _arg1.length) {
if (_arg1[_local9].y < _local8){
_local4 = _local9;
_local8 = _arg1[_local9].y;
};
_local9++;
};
switch (_local4){
case 0:
_local3 = 2;
_local5 = 1;
_local6 = 3;
break;
case 1:
_local3 = 3;
_local5 = 2;
_local6 = 0;
break;
case 2:
_local3 = 0;
_local5 = 3;
_local6 = 1;
break;
case 3:
_local3 = 1;
_local5 = 0;
_local6 = 2;
break;
};
if (_arg1[_local5].x > _arg1[_local6].x){
_local27 = _local5;
_local5 = _local6;
_local6 = _local27;
};
_local10 = new Array();
_local10[0] = new Point(FromPixelPosToGridX(_arg1[_local3]), FromPixelPosToGridY(_arg1[_local3]));
_local10[2] = new Point(FromPixelPosToGridX(_arg1[_local4]), FromPixelPosToGridY(_arg1[_local4]));
_local10[1] = new Point(FromPixelPosToGridX(_arg1[_local5]), FromPixelPosToGridY(_arg1[_local5]));
_local10[3] = new Point(FromPixelPosToGridX(_arg1[_local6]), FromPixelPosToGridY(_arg1[_local6]));
_local11 = _local10[1].y;
_local12 = _local10[3].y;
if (_local11 < _local12){
_local11 = _local10[3].y;
_local12 = _local10[1].y;
};
_local13 = new Array();
_local14 = new Array();
_local15 = new Array();
_local16 = new Array();
_local17 = false;
_local18 = 0;
GetRasterLine(_local10[0], _local10[1], _local13);
GetRasterLine(_local10[0], _local10[3], _local15);
GetRasterLine(_local10[1], _local10[2], _local14);
GetRasterLine(_local10[3], _local10[2], _local16);
if ((((_local13[0].x == _local13[(_local13.length - 1)].x)) && ((_local14[0].y == _local14[(_local14.length - 1)].y)))){
_local17 = true;
_local15 = _local16;
} else {
if ((((_local13[0].y == _local13[(_local13.length - 1)].y)) && ((_local14[0].x == _local14[(_local14.length - 1)].x)))){
_local17 = true;
_local13 = _local14;
};
};
_local21 = 0;
_local22 = 0;
_local23 = new Point();
_local24 = new Point();
_local25 = true;
_local26 = true;
_local20 = _local10[0].y;
while (_local20 >= _local10[2].y) {
if (!_local17){
if (_local20 >= _local10[1].y){
while (((!((_local21 == _local13.length))) && ((_local13[_local21].y == _local20)))) {
_local21++;
};
if (_local21 == _local13.length){
_local23.y = _local20;
_local23.x = _local13[(_local13.length - 1)].x;
_local13 = _local14;
_local21 = 0;
while (((!((_local21 == _local13.length))) && ((_local13[_local21].y == _local20)))) {
_local21++;
};
} else {
_local23.y = _local20;
_local23.x = _local13[(_local21 - 1)].x;
};
} else {
_local23.y = _local20;
_local23.x = _local13[_local21].x;
while (((!((_local21 == _local13.length))) && ((_local13[_local21].y == _local20)))) {
_local21++;
};
};
if (_local20 >= _local10[3].y){
while (((!((_local22 == _local15.length))) && ((_local15[_local22].y == _local20)))) {
_local22++;
};
if (_local22 == _local15.length){
_local15 = _local16;
_local22 = 1;
};
_local24.y = _local20;
_local24.x = _local15[(_local22 - 1)].x;
} else {
_local24.y = _local20;
_local24.x = _local15[_local22].x;
while (((!((_local22 == _local15.length))) && ((_local15[_local22].y >= _local20)))) {
_local22++;
};
};
} else {
_local23.y = _local20;
_local24.y = _local20;
if (_local13[_local18].x < _local15[_local18].x){
_local23.x = _local13[_local18].x;
_local24.x = _local15[_local18].x;
} else {
_local24.x = _local13[_local18].x;
_local23.x = _local15[_local18].x;
};
_local18++;
};
_local19 = _local23.x;
while (_local19 <= _local24.x) {
if ((((((((_local19 < xCellCount)) && ((_local19 > 0)))) && ((_local20 < yCellCount)))) && ((_local20 > 0)))){
SetCellEx(_local19, _local20, _arg2);
};
_local19++;
};
_local20--;
};
}
public function IsWalkableEx(_arg1:Number, _arg2:Number):Boolean{
var _local3:uint;
if ((((((((_arg1 >= xCellCount)) || ((_arg1 < 0)))) || ((_arg2 >= yCellCount)))) || ((_arg2 < 0)))){
return (false);
};
_local3 = FromGridPosToGridIndex(_arg1, _arg2);
if (_local3 >= cellArray.length){
return (false);
};
return (cellArray[_local3].walkable);
}
public function Init(_arg1):void{
var _local2:int;
var _local3:uint;
var _local4:uint;
_local2 = 0;
_local3 = 0;
while (_local3 < xCellCount) {
_local2++;
_arg1.cell_boh = _local2;
_local4 = 0;
while (_local4 < yCellCount) {
SetCellEx(_local3, _local4, _arg1);
_local4++;
};
_local3++;
};
}
public function RasterLine(_arg1:Point, _arg2:Point, _arg3):void{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:Number;
_local4 = FromPixelPosToGridX(_arg1);
_local5 = FromPixelPosToGridX(_arg2);
_local6 = FromPixelPosToGridY(_arg1);
_local7 = FromPixelPosToGridY(_arg2);
RasterLineEx(_local4, _local6, _local5, _local7, _arg3);
}
public function GetCellCostInd(_arg1:uint):Object{
return (cellArray[_arg1].cost);
}
}
}//package FoofaAI
Section 4
//PathfindingNode (FoofaAI.PathfindingNode)
package FoofaAI {
import flash.geom.*;
public class PathfindingNode {
public var c:Point;
public var g:Number;
public var h:Number;
private var _parentNode:Point;
public var f:Number;
public function PathfindingNode(_arg1:Point){
c = new Point(_arg1.x, _arg1.y);
g = 0;
h = 0;
f = 0;
_parentNode = new Point(0, 0);
}
public function IsEqualTo(_arg1:Point):Boolean{
return ((((c.x == _arg1.x)) && ((c.y == _arg1.y))));
}
public function SetParentCoords(_arg1:Point):void{
_parentNode.x = _arg1.x;
_parentNode.y = _arg1.y;
}
public function SetFromObject(_arg1){
c = _arg1.c;
g = _arg1.g;
h = _arg1.h;
f = _arg1.f;
_parentNode.x = _arg1.GetParentCoords().x;
_parentNode.y = _arg1.GetParentCoords().y;
}
public function SetPosition(_arg1:Point){
c.x = _arg1.x;
c.y = _arg1.y;
}
public function GetParentCoords():Point{
return (_parentNode);
}
public function GetPosition():Point{
return (c);
}
static function get DUMMYPARENT():Point{
return (new Point(-1, -1));
}
}
}//package FoofaAI
Section 5
//FoofaApplication (FoofaCore.FoofaApplication)
package FoofaCore {
import flash.utils.*;
public class FoofaApplication extends FSM {
public function FoofaApplication():void{
}
public function GetCPULag():int{
var _local1:Timer;
var _local2:Number;
_local1 = new Timer(1);
_local2 = 0;
_local1.start();
while (Number(_local2) < 5000) {
_local2 = (Number(_local2) + 1);
};
_local1.stop();
return (_local1.currentCount);
}
}
}//package FoofaCore
Section 6
//FrameRateCounter (FoofaCore.FrameRateCounter)
package FoofaCore {
import flash.utils.*;
public class FrameRateCounter {
private var _frameCount:uint;
private var _paused:Boolean;
private var _initialized:Boolean;
private var _totalPauseTime:int;
private var _tempTime:int;
private var _lastTime:int;
private var _deltaTime:int;
private var _totalRunningTime:int;
public function FrameRateCounter(){
_paused = false;
_initialized = false;
_frameCount = 0;
_totalRunningTime = 0;
_deltaTime = 0;
_tempTime = 0;
_lastTime = 0;
}
public function get averageFps():Number{
return (((1000 * _frameCount) / _totalRunningTime));
}
public function Play():void{
if (!_initialized){
_initialized = true;
_totalPauseTime = getTimer();
_lastTime = _totalPauseTime;
};
_paused = false;
}
public function OnFrameStep():void{
_tempTime = getTimer();
_deltaTime = (_tempTime - _lastTime);
if (!_paused){
_frameCount++;
_totalRunningTime = (_tempTime - _totalPauseTime);
} else {
_totalPauseTime = (_tempTime - _totalRunningTime);
};
_lastTime = _tempTime;
}
public function get fps():Number{
return ((1000 / _deltaTime));
}
public function get paused():Boolean{
return (_paused);
}
public function Stop():void{
_paused = true;
}
}
}//package FoofaCore
Section 7
//FSM (FoofaCore.FSM)
package FoofaCore {
public class FSM {
private var _skipStep:Boolean;
private var _initialized:Boolean;
private var _currentState:FSM_State;
public function FSM(){
_initialized = false;
_skipStep = false;
}
public function Loop():void{
if (!_skipStep){
_currentState.Step();
};
}
public function ChangeState(_arg1:FSM_State):void{
if (_initialized){
_currentState.End();
_currentState = null;
};
_initialized = true;
_currentState = _arg1;
_currentState.Init();
}
public function get currentState():FSM_State{
return (_currentState);
}
}
}//package FoofaCore
Section 8
//FSM_State (FoofaCore.FSM_State)
package FoofaCore {
public interface FSM_State {
function Init():void;
function End():void;
function Step():void;
}
}//package FoofaCore
Section 9
//Key (FoofaCore.Key)
package FoofaCore {
import flash.display.*;
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(_arg1:Stage):void{
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
ClearKeys();
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
public static function ClearKeys():void{
keysDown = new Object();
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package FoofaCore
Section 10
//Trigger (FoofaCore.Trigger)
package FoofaCore {
import flash.display.*;
import ThisGame.*;
public class Trigger extends MovieClip {
public var active:Boolean;
public function Trigger():void{
active = false;
}
public function Step(_arg1:State_InGame):void{
}
public function Init(_arg1:State_InGame):void{
}
public function Check(_arg1:State_InGame):Boolean{
return (false);
}
}
}//package FoofaCore
Section 11
//TriggerManager (FoofaCore.TriggerManager)
package FoofaCore {
import ThisGame.*;
public class TriggerManager {
private var j:int;
private var index:int;
private var triggers:Array;
public function TriggerManager():void{
triggers = new Array();
index = 0;
}
public function RemoveTrigger(_arg1:Trigger):void{
j = 0;
while (j < triggers.length) {
if (triggers[j] == _arg1){
triggers.splice(j, 1);
index--;
break;
};
j++;
};
}
public function Update(_arg1:State_InGame):void{
index = 0;
while (index < triggers.length) {
if ((((triggers[index].active == false)) && (triggers[index].Check(_arg1)))){
triggers[index].active = true;
triggers[index].Init(_arg1);
};
if (triggers[index].active == true){
triggers[index].Step(_arg1);
};
index++;
};
}
public function Clear():void{
triggers.splice(0, triggers.length);
}
public function AddTrigger(_arg1:Trigger):void{
triggers.push(_arg1);
}
}
}//package FoofaCore
Section 12
//Array_Contains (FoofaDataTypes.Array_Contains)
package FoofaDataTypes {
public class Array_Contains {
private var _container:Array;
public function Array_Contains(){
_container = new Array();
}
public function GetElementAt(_arg1:Number):Object{
return (_container[_arg1]);
}
public function Find(_arg1):Number{
var _local2:Number;
_local2 = 0;
while (_local2 < _container.length) {
if (_container[_local2].IsEqualTo(_arg1)){
return (_local2);
};
_local2++;
};
return (-1);
}
public function SetElementAt(_arg1:Number, _arg2){
_container[_arg1] = _arg2;
}
public function Size():uint{
return (_container.length);
}
public function clear(){
_container.splice(0, _container.length);
}
public function Find2(_arg1):Number{
var _local2:Number;
if (_container.length > 1000){
};
_local2 = 0;
while (_local2 < _container.length) {
if (_container[_local2].IsEqualTo(_arg1)){
return (_local2);
};
_local2++;
};
return (-1);
}
public function push(_arg1){
_container[_container.length] = _arg1;
}
}
}//package FoofaDataTypes
Section 13
//PriorityQueue (FoofaDataTypes.PriorityQueue)
package FoofaDataTypes {
public class PriorityQueue {
protected var _idInc:Number;
protected var _heap:Array;
protected var _map:Object;
public function PriorityQueue(){
init();
}
protected function _filterDown(_arg1:Number):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local2 = _arg1;
if (_local2 < ((_heap.length - 1) / 2)){
_local3 = ((2 * _local2) + 1);
_local4 = ((2 * _local2) + 2);
if (_local4 >= _heap.length){
_local5 = _local3;
_local4 = _local3;
} else {
if (_heap[_local3].priority < _heap[_local4].priority){
_local5 = _local3;
} else {
if (_heap[_local3].priority == _heap[_local4].priority){
if (_heap[_local3].id < _heap[_local4].id){
_local5 = _local3;
} else {
_local5 = _local4;
};
} else {
_local5 = _local4;
};
};
};
if (_heap[_local2].priority > _heap[_local5].priority){
_local6 = _heap[_local2];
_heap[_local2] = _heap[_local5];
_heap[_local5] = _local6;
_heap[_local2].pos = _local2;
_heap[_local5].pos = _local5;
_filterDown(_local5);
} else {
if (_heap[_local2].priority == _heap[_local5].priority){
if (_heap[_local2].id > _heap[_local5].id){
_local7 = _heap[_local2];
_heap[_local2] = _heap[_local5];
_heap[_local5] = _local7;
_heap[_local2].pos = _local2;
_heap[_local5].pos = _local5;
_filterDown(_local5);
};
};
};
};
}
public function IsEmpty():Boolean{
return ((_heap.length == 0));
}
public function SetPriority(_arg1:Number, _arg2:Number){
var _local3:*;
var _local4:*;
var _local5:*;
_local3 = _map[_arg1];
_local4 = _local3.pos;
_local5 = _local3.priority;
_local3.priority = _arg2;
if (_local5 > _local3.priority){
_filterUp(_local4);
} else {
_filterDown(_local4);
};
}
public function GetTopPriority():Number{
return (_heap[0].priority);
}
public function IsQueued(_arg1:Number):Boolean{
return (!((_map[_arg1] == null)));
}
public function clear(){
_heap.splice(0, _heap.length);
}
function init(){
_heap = [];
_map = {};
_idInc = 0;
}
public function RemoveTop():Object{
var _local1:*;
if (_heap.length == 0){
return (false);
};
_local1 = _heap[0].data;
delete _map[_heap[0].id];
delete _heap[0];
if (_heap.length > 1){
_heap[0] = _heap[(_heap.length - 1)];
_heap[0].pos = 0;
_heap.splice((_heap.length - 1), 1);
_filterDown(0);
} else {
_heap.splice((_heap.length - 1), 1);
};
return (_local1);
}
public function GetPriority(_arg1:Number):Number{
return (_map[_arg1].priority);
}
protected function _filterUp(_arg1:Number):void{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = _arg1;
while ((((_local2 > 0)) && ((_heap[int(((_local2 - 1) / 2))].priority > _heap[_local2].priority)))) {
_local3 = Math.floor(((_local2 - 1) / 2));
_local4 = _heap[_local2];
_heap[_local2] = _heap[_local3];
_heap[_local3] = _local4;
_heap[_local2].pos = _local2;
_heap[_local3].pos = _local3;
_local2 = _local3;
};
}
public function Insert(_arg1, _arg2:Number):Number{
var _local3:Number;
var _local4:*;
var _local5:Object;
_local3 = _heap.length;
_local4 = _idInc++;
_local5 = {priority:_arg2, data:_arg1, id:_local4, pos:_local3};
_map[_local4] = _local5;
_heap[_local3] = _local5;
_filterUp(_local3);
return (_local4);
}
public function Remove(_arg1:Number):Boolean{
var _local2:*;
if (!IsQueued(_arg1)){
return (false);
};
_local2 = _map[_arg1].pos;
delete _map[_arg1];
delete _heap[_local2];
_heap[_local2] = _heap[(_heap.length - 1)];
_heap[0].pos = 0;
_heap.splice((_heap.length - 1), 1);
return (true);
}
public function GetTop():Object{
return (_heap[0].priority);
}
}
}//package FoofaDataTypes
Section 14
//PriorityQueue_DirectAccess (FoofaDataTypes.PriorityQueue_DirectAccess)
package FoofaDataTypes {
public class PriorityQueue_DirectAccess extends PriorityQueue {
public function Find(_arg1):Number{
var _local2:Number;
_local2 = 0;
while (_local2 < _heap.length) {
if (_heap[_local2].data.IsEqualTo(_arg1)){
return (_local2);
};
_local2++;
};
return (-1);
}
public function SetElementAt(_arg1:Number, _arg2){
_heap[_arg1] = _arg2;
_filterDown(0);
}
public function GetElementAt(_arg1:Number):Object{
return (_heap[_arg1]);
}
}
}//package FoofaDataTypes
Section 15
//AABB (FoofaGeom.AABB)
package FoofaGeom {
public class AABB {
public var yMax:Number;
public var xMax:Number;
public var yMin:Number;
public var xMin:Number;
public function AABB(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.xMin = _arg1;
this.xMax = _arg2;
this.yMin = _arg3;
this.yMax = _arg4;
}
public function toString():String{
return ([xMin, xMax, yMin, yMax].toString());
}
public function intersect(_arg1:AABB):Boolean{
if ((((xMin > _arg1.xMax)) || ((xMax < _arg1.xMin)))){
return (false);
};
if ((((yMin > _arg1.yMax)) || ((yMax < _arg1.yMin)))){
return (false);
};
return (true);
}
}
}//package FoofaGeom
Section 16
//Circle (FoofaGeom.Circle)
package FoofaGeom {
import flash.display.*;
public class Circle {
public var vx:Number;// = 0
public var vy:Number;// = 0
public var radius:Number;
protected var aabb:AABB;
public var r2:Number;
public var mass:Number;// = 0
public var x:Number;
public var y:Number;
public function Circle(_arg1:Number, _arg2:Number, _arg3:Number){
vx = 0;
vy = 0;
mass = 0;
super();
this.x = _arg1;
this.y = _arg2;
this.radius = _arg3;
r2 = (_arg3 * _arg3);
computeAABB();
}
public function PointIsInside(_arg1:Number, _arg2:Number):Boolean{
return (((((_arg1 - x) * (_arg1 - x)) + ((_arg2 - y) * (_arg2 - y))) <= r2));
}
private function computeAABB():void{
aabb = new AABB((x - radius), (x + radius), (y - radius), (y + radius));
}
public function draw(_arg1:Graphics):void{
_arg1.drawCircle(x, y, radius);
_arg1.drawCircle(x, y, 0.5);
}
public function getAABB():AABB{
return (aabb);
}
}
}//package FoofaGeom
Section 17
//CollisionCircleCircle (FoofaGeom.CollisionCircleCircle)
package FoofaGeom {
import flash.geom.*;
public class CollisionCircleCircle {
private var _back:Vector2;
private var _py:Number;
private var _normal:Vector2;
private var _px:Number;
private var _obstacle:Circle;
private var _circle:Circle;
public function CollisionCircleCircle(){
_normal = new Vector2();
_back = new Vector2();
}
public function getNormal():Vector2{
return (_normal);
}
public function test(_arg1:Circle, _arg2:Circle, _arg3:Point):Boolean{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_circle = _arg2;
_obstacle = _arg1;
_local4 = (_arg2.radius + _arg1.radius);
_local5 = (_arg2.x - _arg1.x);
_local6 = (_arg2.y - _arg1.y);
_local7 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
if (_local4 > _local7){
_local5 = (_local5 / _local7);
_local6 = (_local6 / _local7);
_normal.x = _local5;
_normal.y = _local6;
_back.x = (_normal.x * _local4);
_back.y = (_normal.y * _local4);
return (true);
};
return (false);
}
public function solve(_arg1:Boolean, _arg2:Boolean):void{
if ((((_arg2 == true)) && ((_arg1 == false)))){
_circle.vx = (_obstacle.x + _back.x);
_circle.vy = (_obstacle.y + _back.y);
};
}
public function getBack():Vector2{
return (new Vector2((_obstacle.x + _back.x), (_obstacle.y + _back.y)));
}
}
}//package FoofaGeom
Section 18
//CollisionConvexPolyCircle (FoofaGeom.CollisionConvexPolyCircle)
package FoofaGeom {
import flash.geom.*;
public class CollisionConvexPolyCircle {
private var p3:Vector2;
private var refPos:Vector2;
private var poly:ConvexPoly;
private var BOUNCE:Number;
private var p2:Vector2;
private var p1:Vector2;
private var newPosn:Vector2;
private var circle:Circle;
private var posn:Vector2;
private var c:Number;
private var oldposn:Vector2;
private var surfNorm:Vector2;
private var s:Number;
private var FRICTION:Number;
private var dt:Number;
public function CollisionConvexPolyCircle(){
BOUNCE = 0;
FRICTION = 0.05;
newPosn = new Vector2();
refPos = new Vector2();
surfNorm = new Vector2();
p1 = new Vector2();
p2 = new Vector2();
p3 = new Vector2();
posn = new Vector2();
oldposn = new Vector2();
}
function ProjCircle_Full(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11):Boolean{
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
if (_arg3 == 0){
if (_arg4 == 0){
if (_arg1 < _arg2){
_local12 = (_arg5.x - _arg8);
if (_local12 < 0){
return (ReportCollisionVsWorld(-(_arg1), 0, -1, 0, _arg5, _arg6, _arg8, _arg9, _arg10, _arg11));
};
return (ReportCollisionVsWorld(_arg1, 0, 1, 0, _arg5, _arg6, _arg8, _arg9, _arg10, _arg11));
} else {
_local13 = (_arg5.y - _arg9);
if (_local13 < 0){
return (ReportCollisionVsWorld(0, -(_arg2), 0, -1, _arg5, _arg6, _arg8, _arg9, _arg10, _arg11));
};
return (ReportCollisionVsWorld(0, _arg2, 0, 1, _arg5, _arg6, _arg8, _arg9, _arg10, _arg11));
};
} else {
return (ReportCollisionVsWorld(0, (_arg2 * _arg4), 0, _arg4, _arg5, _arg6, _arg8, _arg9, _arg10, _arg11));
};
} else {
if (_arg4 == 0){
return (ReportCollisionVsWorld((_arg1 * _arg3), 0, _arg3, 0, _arg5, _arg6, _arg8, _arg9, _arg10, _arg11));
};
_local14 = (_arg8 + (_arg3 * _arg10));
_local15 = (_arg9 + (_arg4 * _arg11));
_local12 = (_arg5.x - _local14);
_local13 = (_arg5.y - _local15);
_local16 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13)));
_local17 = (_arg7 - _local16);
if (0 < _local17){
if (_local16 == 0){
_local12 = (_arg3 / Math.SQRT2);
_local13 = (_arg4 / Math.SQRT2);
} else {
_local12 = (_local12 / _local16);
_local13 = (_local13 / _local16);
};
return (ReportCollisionVsWorld((_local12 * _local17), (_local13 * _local17), _local12, _local13, _arg5, _arg6, _arg8, _arg9, _arg10, _arg11));
};
};
return (false);
}
public function test(_arg1:ConvexPoly, _arg2:Circle, _arg3:Point):Boolean{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Vector2;
var _local9:Number;
_local4 = _arg1.particles;
_local5 = _arg2.x;
_local6 = _arg2.y;
_local7 = _arg2.radius;
refPos.x = _local4[0].x;
refPos.y = _local4[0].y;
this.circle = _arg2;
this.poly = _arg1;
p1.x = (_local4[1].x - _local4[0].x);
p1.y = (_local4[1].y - _local4[0].y);
p2.x = (_local4[2].x - _local4[0].x);
p2.y = (_local4[2].y - _local4[0].y);
p3.x = (_local4[3].x - _local4[0].x);
p3.y = (_local4[3].y - _local4[0].y);
posn.x = (_arg2.x - _local4[0].x);
posn.y = (_arg2.y - _local4[0].y);
oldposn.x = (_arg3.x - _local4[0].x);
oldposn.y = (_arg3.y - _local4[0].y);
_local8 = new Vector2(1, 0);
_local9 = FoofaGeomUtils.AngleBetweenVectors2Rad(p3, _local8);
if (p3.x >= 0){
_local9 = (_local9 * -1);
} else {
if ((((p3.x < 0)) && ((p3.y > 0)))){
_local9 = (_local9 * -1);
} else {
if ((((p3.x < 0)) && ((p3.y <= 0)))){
_local9 = (_local9 * -1);
};
};
};
return (CheckCollision(posn, oldposn, _arg2.radius, p1, p3, p2, _local9));
}
public function setCollisionTime(_arg1:Number):void{
this.dt = _arg1;
}
public function SetPhysicsParam(_arg1:Number, _arg2:Number){
BOUNCE = _arg1;
FRICTION = _arg2;
}
public function getCollisionTime():Number{
return (dt);
}
public function CheckCollision(_arg1:Vector2, _arg2:Vector2, _arg3:Number, _arg4:Vector2, _arg5:Vector2, _arg6:Vector2, _arg7:Number):Boolean{
var _local8:Vector2;
var _local9:Vector2;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Vector2;
var _local18:Vector2;
var _local19:Boolean;
_local8 = new Vector2(_arg4.x, _arg4.y);
_local9 = new Vector2(_arg5.x, _arg5.y);
_local10 = _local9.length;
_local11 = _local8.length;
_local12 = (_arg7 * -1);
c = Math.cos(_arg7);
s = Math.sin(_arg7);
_local13 = Math.cos(_local12);
_local14 = Math.sin(_local12);
_local15 = (_local10 / 2);
_local16 = (_local11 / 2);
_local17 = new Vector2();
_local17.x = ((_arg1.x * _local13) - (_arg1.y * _local14));
_local17.y = ((_arg1.x * _local14) + (_arg1.y * _local13));
_local18 = new Vector2();
_local18.x = ((_arg2.x * _local13) - (_arg2.y * _local14));
_local18.y = ((_arg2.x * _local14) + (_arg2.y * _local13));
_local19 = this.CollideCircleVsTile(_local17, _local18, _arg3, _local15, _local16, (_local10 / 2), (_local11 / 2));
newPosn.x = ((_local17.x * c) - (_local17.y * s));
newPosn.y = ((_local17.x * s) + (_local17.y * c));
return (_local19);
}
public function getNormal():Vector2{
var _local1:Number;
var _local2:Number;
_local1 = ((surfNorm.x * c) - (surfNorm.y * s));
_local2 = ((surfNorm.x * s) + (surfNorm.y * c));
return (new Vector2(_local1, _local2));
}
public function getBack():Vector2{
return (new Vector2((newPosn.x + refPos.x), (newPosn.y + refPos.y)));
}
function ReportCollisionVsWorld(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10):Boolean{
var _local11:Boolean;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
var _local19:*;
var _local20:*;
var _local21:*;
var _local22:*;
var _local23:*;
var _local24:*;
var _local25:*;
var _local26:*;
surfNorm.x = _arg3;
surfNorm.y = _arg4;
_local11 = false;
_local12 = _arg5;
_local13 = _arg6;
_local14 = (_local12.x - _local13.x);
_local15 = (_local12.y - _local13.y);
_local16 = ((_local14 * _arg3) + (_local15 * _arg4));
_local17 = (_local16 * _arg3);
_local18 = (_local16 * _arg4);
_local19 = (_local14 - _local17);
_local20 = (_local15 - _local18);
if (_local16 < 0){
_local24 = FRICTION;
_local25 = (_local19 * _local24);
_local26 = (_local20 * _local24);
_local21 = (1 + BOUNCE);
_local22 = (_local17 * _local21);
_local23 = (_local18 * _local21);
_local11 = true;
} else {
_local26 = 0;
_local25 = _local26;
_local23 = _local25;
_local22 = _local23;
};
_local12.x = (_local12.x + _arg1);
_local12.y = (_local12.y + _arg2);
_local13.x = (_local13.x + ((_arg1 + _local22) + _local25));
_local13.y = (_local13.y + ((_arg2 + _local23) + _local26));
_arg5 = _local12;
_arg6 = _local13;
return (_local11);
}
public function CollideCircleVsTile(_arg1:Vector2, _arg2:Vector2, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Boolean{
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
_local8 = (_arg1.x - _arg4);
_local9 = ((_arg6 + _arg3) - Math.abs(_local8));
if (0 < _local9){
_local10 = (_arg1.y - _arg5);
_local11 = ((_arg7 + _arg3) - Math.abs(_local10));
if (0 < _local11){
_local12 = 0;
_local13 = 0;
if (_local8 < -(_arg6)){
_local12 = -1;
} else {
if (_arg6 < _local8){
_local12 = 1;
};
};
if (_local10 < -(_arg7)){
_local13 = -1;
} else {
if (_arg7 < _local10){
_local13 = 1;
};
};
return (ProjCircle_Full(_local9, _local11, _local12, _local13, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
};
};
return (false);
}
public function solve(_arg1:Boolean, _arg2:Boolean):void{
if ((((_arg2 == true)) && ((_arg1 == false)))){
circle.vx = (newPosn.x + refPos.x);
circle.vy = (newPosn.y + refPos.y);
};
}
}
}//package FoofaGeom
Section 19
//ConvexPoly (FoofaGeom.ConvexPoly)
package FoofaGeom {
import flash.display.*;
import flash.geom.*;
public class ConvexPoly {
protected var aabb:AABB;
public var particles:Array;
public function ConvexPoly(_arg1:Array){
this.particles = _arg1;
computeAABB();
}
public function draw(_arg1:Graphics):void{
var _local2:int;
var _local3:Particle;
var _local4:Particle;
_local3 = particles[0];
_arg1.moveTo(_local3.x, _local3.y);
_local2 = 1;
while (_local2 < particles.length) {
_local4 = Particle(particles[_local2]);
_arg1.lineTo(_local4.x, _local4.y);
_local2++;
};
_arg1.lineTo(_local3.x, _local3.y);
}
public function getAABB():AABB{
return (aabb);
}
private function computeAABB():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Particle;
_local1 = Number.POSITIVE_INFINITY;
_local2 = Number.POSITIVE_INFINITY;
_local3 = Number.NEGATIVE_INFINITY;
_local4 = Number.NEGATIVE_INFINITY;
for each (_local5 in particles) {
if (_local5.x < _local1){
_local1 = _local5.x;
};
if (_local5.x > _local3){
_local3 = _local5.x;
};
if (_local5.y < _local2){
_local2 = _local5.y;
};
if (_local5.y > _local4){
_local4 = _local5.y;
};
};
aabb = new AABB(_local1, _local3, _local2, _local4);
}
public function GetPointArray():Array{
var _local1:int;
var _local2:Array;
_local2 = new Array(particles.length);
_local1 = 0;
while (_local1 < particles.length) {
_local2[_local1] = new Point(particles[_local1].x, particles[_local1].y);
_local1++;
};
return (_local2);
}
}
}//package FoofaGeom
Section 20
//FoofaGeomUtils (FoofaGeom.FoofaGeomUtils)
package FoofaGeom {
import flash.geom.*;
public class FoofaGeomUtils {
private static var x1:Number;
private static var ynew:Number;
private static var poly:Array = new Array(4);
private static var y2:Number;
private static var yold:Number;
private static var y1:Number;
private static var turnCDA:Number;
private static var turnCDB:Number;
private static var turnABC:Number;
private static var turnABD:Number;
private static var xnew:Number;
private static var i:Number;
private static var xold:Number;
private static var x2:Number;
private static var inside:Boolean;
public static function Trim(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
_local4 = _arg1;
if (_arg1 < _arg2){
_local4 = _arg2;
} else {
if (_arg1 > _arg3){
_local4 = _arg3;
};
};
return (_local4);
}
public static function ComputeTurn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (((((((_arg2 * _arg3) - (_arg4 * _arg1)) + (_arg6 * _arg1)) - (_arg2 * _arg5)) + (_arg4 * _arg5)) - (_arg6 * _arg3)));
}
public static function CrossProduct2DMagnitude(_arg1:Vector2, _arg2:Vector2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function GetRandomBetween(_arg1:Number, _arg2:Number):Number{
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function DotProd2(_arg1:Vector2, _arg2:Vector2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function Distance(_arg1:Point, _arg2:Point):Number{
return (Math.sqrt((((_arg1.x - _arg2.x) * (_arg1.x - _arg2.x)) + ((_arg1.y - _arg2.y) * (_arg1.y - _arg2.y)))));
}
public static function AngleFromDir(_arg1:Number, _arg2:Number):Number{
return (Math.atan2(_arg1, _arg2));
}
public static function ReflectVectorOnLine(_arg1:Vector2, _arg2:Vector2):Vector2{
var _local3:Number;
var _local4:Vector2;
_local3 = DotProd2(_arg2, _arg1);
_local4 = new Vector2();
_local4.x = (_arg1.x - ((2 * _arg2.x) * _local3));
_local4.y = (_arg1.y - ((2 * _arg2.y) * _local3));
return (_local4);
}
public static function ProjectAonB(_arg1:Vector2, _arg2:Vector2):Vector2{
var _local3:Number;
var _local4:Number;
var _local5:Vector2;
_local3 = DotProd2(_arg1, _arg2);
_local4 = _arg2.squaredLength;
_local5 = new Vector2(((_local3 / _local4) * _arg2.x), ((_local3 / _local4) * _arg2.y));
return (_local5);
}
public static function SquaredDistance(_arg1:Point, _arg2:Point):Number{
return ((((_arg1.x - _arg2.x) * (_arg1.x - _arg2.x)) + ((_arg1.y - _arg2.y) * (_arg1.y - _arg2.y))));
}
public static function GetSign(_arg1:Number):Number{
if (_arg1 >= 0){
return (1);
};
return (-1);
}
public static function Turn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
var _local7:Number;
_local7 = ComputeTurn(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
if (_local7 > 0.001){
return (1);
};
if (_local7 < -0.001){
return (-1);
};
return (0);
}
public static function AngleBetweenVectors2Deg(_arg1:Vector2, _arg2:Vector2):Number{
return (((AngleBetweenVectors2Rad(_arg1, _arg2) * 90) / Math.PI));
}
public static function InPoly(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point, _arg5:Point):Boolean{
inside = false;
poly[0] = _arg1;
poly[1] = _arg2;
poly[2] = _arg3;
poly[3] = _arg4;
xold = poly[3].x;
yold = poly[3].y;
i = 0;
while (i < poly.length) {
xnew = poly[i].x;
ynew = poly[i].y;
if (xnew > xold){
x1 = xold;
x2 = xnew;
y1 = yold;
y2 = ynew;
} else {
x1 = xnew;
x2 = xold;
y1 = ynew;
y2 = yold;
};
if (((((xnew < _arg5.x) == (_arg5.x <= xold))) && ((((_arg5.y - y1) * (x2 - x1)) < ((y2 - y1) * (_arg5.x - x1)))))){
inside = !(inside);
};
xold = xnew;
yold = ynew;
i++;
};
return (inside);
}
public static function Vector2Sum(_arg1:Vector2, _arg2:Vector2):Vector2{
var _local3:Vector2;
_local3 = new Vector2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function FromRadiansToDiplayObjectRotation(_arg1:Number):Number{
return ((((_arg1 * 180) / Math.PI) + 90));
}
public static function AngleBetweenVectors2Rad(_arg1:Vector2, _arg2:Vector2):Number{
return ((Math.atan2(_arg2.y, _arg2.x) - Math.atan2(_arg1.y, _arg1.x)));
}
}
}//package FoofaGeom
Section 21
//Particle (FoofaGeom.Particle)
package FoofaGeom {
import flash.geom.*;
public class Particle {
public var vx:Number;
public var vy:Number;
var ty:Number;
var tx:Number;
public var x:Number;
public var y:Number;
public function Particle(_arg1:Number, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
vx = (vy = 0);
}
public function integrate(_arg1:Number):void{
x = (tx + (vx * _arg1));
y = (ty + (vy * _arg1));
}
public function update():void{
tx = x;
ty = y;
}
public function move():void{
tx = x;
ty = y;
x = (x + vx);
y = (y + vy);
}
public function toPoint():Point{
return (new Point(x, y));
}
public function getVector(_arg1:Particle):Vector2{
return (new Vector2((x - _arg1.x), (y - _arg1.y)));
}
}
}//package FoofaGeom
Section 22
//SpatialGrid (FoofaGeom.SpatialGrid)
package FoofaGeom {
import flash.geom.*;
public class SpatialGrid {
private var _cellPixelWidth:Number;
private var _cellPixelHeight:Number;
private var _xCellCount:Number;
protected var cellArray:Array;
private var _yCellCount:Number;
public function SpatialGrid(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Array){
_cellPixelWidth = _arg1;
_cellPixelHeight = _arg2;
_xCellCount = Math.floor(_arg3);
_yCellCount = Math.floor(_arg4);
cellArray = _arg5;
}
public function get cellPixelHeight():Number{
return (_cellPixelHeight);
}
public function FromGridPosToGridIndex(_arg1:uint, _arg2:uint):uint{
return (((_arg2 * (_xCellCount - 1)) + _arg1));
}
public function FromIndexToGridY(_arg1:uint):Number{
return ((Math.floor((_arg1 / _xCellCount)) - 1));
}
public function FromPixelPosToGridIndexEx(_arg1:int, _arg2:int):uint{
return (((Math.floor((_arg2 / _cellPixelHeight)) * _xCellCount) + Math.floor((_arg1 / _xCellCount))));
}
public function FromIndexToGridX(_arg1:uint):Number{
return (((_arg1 % _xCellCount) - 1));
}
public function get yCellCount():Number{
return (_yCellCount);
}
public function FromPixelPosToGridX(_arg1:Point):Number{
return (Math.floor((_arg1.x / _cellPixelWidth)));
}
public function FromPixelPosToGridY(_arg1:Point):Number{
return (Math.floor((_arg1.y / _cellPixelHeight)));
}
public function get cellPixelWidth():Number{
return (_cellPixelWidth);
}
public function FromPixelYToGridY(_arg1:int):Number{
return (Math.floor((_arg1 / _cellPixelHeight)));
}
public function get xCellCount():Number{
return (_xCellCount);
}
public function FromPixelPosToGridIndex(_arg1:Point):uint{
return (((Math.floor((_arg1.y / _cellPixelHeight)) * _xCellCount) + Math.floor((_arg1.x / _xCellCount))));
}
public function FromPixelXToGridX(_arg1:int):Number{
return (Math.floor((_arg1 / _cellPixelWidth)));
}
}
}//package FoofaGeom
Section 23
//Vector2 (FoofaGeom.Vector2)
package FoofaGeom {
import flash.geom.*;
public class Vector2 extends Point {
public function Vector2(_arg1:Number=0, _arg2:Number=0){
super(_arg1, _arg2);
}
public function CloneVector():Vector2{
return (new Vector2(x, y));
}
public function get rightNormal():Vector2{
var _local1:Vector2;
_local1 = new Vector2(-(y), x);
return (_local1);
}
public function TraceMe():void{
}
public function get leftNormal():Vector2{
var _local1:Vector2;
_local1 = new Vector2(y, -(x));
return (_local1);
}
public function Copy(_arg1:Vector2):void{
x = _arg1.x;
y = _arg1.y;
}
public function get squaredLength():Number{
return (((x * x) + (y * y)));
}
}
}//package FoofaGeom
Section 24
//Camera2d (FoofaView.Camera2d)
package FoofaView {
import flash.geom.*;
public interface Camera2d {
function Update():void;
function get centerPosition():Point;
}
}//package FoofaView
Section 25
//Camera2d_FollowTargetInBounds (FoofaView.Camera2d_FollowTargetInBounds)
package FoofaView {
import flash.display.*;
import flash.geom.*;
public class Camera2d_FollowTargetInBounds implements Camera2d {
private var shakingIntencity:Number;
private var shaking:Boolean;
private var tempX:Number;
private var tempY:Number;
private var shakingCount:Number;
protected var target:Point;
private var shakingForce:Number;
private var scrollX:Number;
private var scrollY:Number;
protected var worldObject:DisplayObject;
protected var screenHeight:int;
private var bounds:Rectangle;
private var shakingDuration:Number;
protected var screenWidth:int;
public function Camera2d_FollowTargetInBounds(_arg1:DisplayObject, _arg2:Point, _arg3:int, _arg4:int, _arg5:Rectangle):void{
target = _arg2;
worldObject = _arg1;
screenWidth = _arg3;
screenHeight = _arg4;
bounds = _arg5;
scrollX = 0;
scrollY = 0;
shaking = false;
SetBounds(bounds.left, bounds.right, bounds.top, bounds.bottom);
}
public function get rightBound():Number{
return (bounds.right);
}
public function set rightBound(_arg1:Number):void{
bounds.right = _arg1;
}
public function set topBound(_arg1:Number):void{
bounds.top = _arg1;
}
public function get bottomBound():Number{
return (bounds.bottom);
}
public function ShakingEffect(_arg1:Number, _arg2:Number, _arg3:Number){
shaking = true;
shakingCount = -1;
shakingDuration = _arg1;
shakingForce = _arg2;
shakingIntencity = _arg3;
}
public function SetBounds(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
bounds.left = _arg1;
bounds.right = _arg2;
bounds.top = _arg3;
bounds.bottom = _arg4;
}
public function set bottomBound(_arg1:Number):void{
bounds.bottom = _arg1;
}
public function get centerPosition():Point{
return (target);
}
public function IsShaking():Boolean{
return (shaking);
}
public function get topBound():Number{
return (bounds.top);
}
public function Update():void{
tempX = (-(target.x) + (screenWidth / 2));
tempY = (-(target.y) + (screenHeight / 2));
if ((((-(tempX) > bounds.left)) && ((-(tempX) < (bounds.right - screenWidth))))){
scrollX = tempX;
} else {
if (-(tempX) >= (bounds.right - screenWidth)){
scrollX = -((bounds.right - screenWidth));
} else {
if (-(tempX) <= bounds.left){
scrollX = -(bounds.left);
};
};
};
if ((((-(tempY) > bounds.top)) && ((-(tempY) < (bounds.bottom - screenHeight))))){
scrollY = tempY;
} else {
if (-(tempY) >= (bounds.bottom - screenHeight)){
scrollY = -((bounds.bottom - screenHeight));
} else {
if (-(tempX) <= bounds.top){
scrollY = -(bounds.top);
};
};
};
if (shaking){
if ((shakingCount % (shakingIntencity * 2)) == 0){
scrollX = (scrollX + shakingForce);
scrollY = (scrollY + shakingForce);
} else {
if ((shakingCount % (shakingIntencity * 2)) == shakingIntencity){
scrollX = (scrollX - shakingForce);
scrollY = (scrollY - shakingForce);
};
};
shakingCount++;
if (shakingCount > shakingDuration){
shaking = false;
};
};
worldObject.scrollRect = new Rectangle(-(scrollX), -(scrollY), screenWidth, screenHeight);
}
public function set centerPosition(_arg1:Point):void{
target = _arg1;
}
public function set leftBound(_arg1:Number):void{
bounds.left = _arg1;
}
public function get leftBound():Number{
return (bounds.left);
}
}
}//package FoofaView
Section 26
//barravita_179 (fooWarrior_fla.barravita_179)
package fooWarrior_fla {
import flash.display.*;
public dynamic class barravita_179 extends MovieClip {
public var maskLife:MovieClip;
}
}//package fooWarrior_fla
Section 27
//CMG_Logo_Animation_1 (fooWarrior_fla.CMG_Logo_Animation_1)
package fooWarrior_fla {
import flash.display.*;
public dynamic class CMG_Logo_Animation_1 extends MovieClip {
public var mc_preloader:MovieClip;
public var cgm_logo:MovieClip;
public function CMG_Logo_Animation_1(){
addFrameScript(0, frame1, 80, frame81);
}
function frame81(){
stop();
}
function frame1(){
}
}
}//package fooWarrior_fla
Section 28
//flyFireGranade_197 (fooWarrior_fla.flyFireGranade_197)
package fooWarrior_fla {
import flash.display.*;
public dynamic class flyFireGranade_197 extends MovieClip {
public function flyFireGranade_197(){
addFrameScript(32, frame33);
}
function frame33(){
stop();
}
}
}//package fooWarrior_fla
Section 29
//flyGranade_195 (fooWarrior_fla.flyGranade_195)
package fooWarrior_fla {
import flash.display.*;
public dynamic class flyGranade_195 extends MovieClip {
public function flyGranade_195(){
addFrameScript(32, frame33);
}
function frame33(){
stop();
}
}
}//package fooWarrior_fla
Section 30
//INTROFOOFASTUDIOS_231 (fooWarrior_fla.INTROFOOFASTUDIOS_231)
package fooWarrior_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class INTROFOOFASTUDIOS_231 extends MovieClip {
public var mcBtn_foofaz:pulsanteschermataintro;
public var mcBtn_xploredz:pulsanteschermataintro;
public var btn_xplored:DisplayObject;
public var btn_foofa:DisplayObject;
public var mcXploredBtn:SimpleButton;
public function INTROFOOFASTUDIOS_231(){
addFrameScript(0, frame1, 106, frame107, 142, frame143);
}
function frame143(){
}
public function onClickXplored(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.xplored.com/play/"), "_blank");
}
function frame107(){
}
function frame1(){
btn_xplored = getChildByName("mcBtn_xploredz");
btn_foofa = getChildByName("mcBtn_foofaz");
btn_foofa.addEventListener(MouseEvent.MOUSE_UP, onClickFoofa);
btn_xplored.addEventListener(MouseEvent.MOUSE_UP, onClickXplored);
}
public function onClickFoofa(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.foofa.net"), "_blank");
}
}
}//package fooWarrior_fla
Section 31
//load_barMC_12 (fooWarrior_fla.load_barMC_12)
package fooWarrior_fla {
import flash.display.*;
public dynamic class load_barMC_12 extends MovieClip {
public var bar:MovieClip;
}
}//package fooWarrior_fla
Section 32
//MainTimeline (fooWarrior_fla.MainTimeline)
package fooWarrior_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
public dynamic class MainTimeline extends MovieClip {
public var g_UrlLoader:URLLoader;
public var txt:TextField;
public var cgm_logoclip:MovieClip;
public var cgmClip:MovieClip;
public var preloader_bar:MovieClip;
public var barz:MovieClip;
public var perc:Number;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 24, frame25, 25, frame26, 26, frame27, 27, frame28, 28, frame29, 29, frame30, 30, frame31, 31, frame32, 32, frame33, 33, frame34, 34, frame35, 35, frame36, 36, frame37, 37, frame38, 38, frame39, 39, frame40, 40, frame41, 41, frame42, 185, frame186);
}
public function goToUrl(_arg1:String):void{
var success:Boolean;
var url = _arg1;
success = false;
if (((ExternalInterface.available) && (!((Capabilities.playerType == "External"))))){
try {
ExternalInterface.call("window.open", url, "win", "");
success = true;
} catch(error:Error) {
} catch(error:SecurityError) {
};
};
if (success != true){
navigateToURL(new URLRequest(url), "_BLANK");
};
}
function frame38(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
public function onClickOnPlay(_arg1:MouseEvent){
preloader_bar.removeEventListener(MouseEvent.MOUSE_UP, onClickOnPlay);
this.gotoAndPlay(2);
}
public function onRootLoaderInit(_arg1:Event):void{
cgm_logoclip = MovieClip(MovieClip(this.getChildByName("cgmClip")).getChildByName("cgm_logo"));
preloader_bar = MovieClip(MovieClip(this.getChildByName("cgmClip")).getChildByName("mc_preloader"));
barz = MovieClip(MovieClip(preloader_bar.getChildByName("mc_loadingBar")).getChildByName("bar"));
cgm_logoclip.addEventListener(MouseEvent.MOUSE_UP, onClickCGM);
cgm_logoclip.useHandCursor = true;
cgm_logoclip.buttonMode = true;
}
public function onRootLoaderComplete(_arg1:Event):void{
if (preloader_bar.currentFrame != 2){
preloader_bar.gotoAndStop(2);
};
}
public function onRootLoaderProgress(_arg1:ProgressEvent):void{
perc = (_arg1.bytesLoaded / _arg1.bytesTotal);
barz.scaleX = perc;
if (this.loaderInfo.bytesLoaded >= this.loaderInfo.bytesTotal){
preloader_bar.gotoAndStop(2);
this.removeEventListener("enterFrame", onEnterFrame);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onRootLoaderProgress);
preloader_bar.addEventListener(MouseEvent.MOUSE_UP, onClickOnPlay);
};
}
function frame10(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame14(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame18(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame12(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame3(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame6(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame1(){
this.stage.frameRate = 24;
this.loaderInfo.addEventListener(Event.INIT, onRootLoaderInit);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onRootLoaderProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onRootLoaderComplete);
this.addEventListener("enterFrame", onEnterFrame);
stop();
g_UrlLoader = null;
}
function frame19(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame17(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame4(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame5(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame9(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame13(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame16(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame8(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame21(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame2(){
while (this.numChildren > 0) {
this.removeChildAt((this.numChildren - 1));
};
gotoAndPlay((currentFrame + 1));
}
function frame15(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame23(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame7(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame20(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame30(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame22(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame25(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame27(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame11(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame34(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame35(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame24(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame37(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame29(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame33(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame40(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame41(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame39(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame26(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame28(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame42(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
public function onEnterFrame(_arg1:Event){
if (this.loaderInfo.bytesLoaded >= this.loaderInfo.bytesTotal){
preloader_bar.gotoAndPlay(2);
this.removeEventListener("enterFrame", onEnterFrame);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onRootLoaderProgress);
preloader_bar.addEventListener(MouseEvent.MOUSE_UP, onClickOnPlay);
};
}
function frame36(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame32(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame31(){
SoundMixer.stopAll();
gotoAndPlay((currentFrame + 1));
}
function frame186(){
stop();
}
public function onClickCGM(_arg1:MouseEvent){
goToUrl("http://crazymonkeygames.com");
}
}
}//package fooWarrior_fla
Section 33
//monkey_blink_18 (fooWarrior_fla.monkey_blink_18)
package fooWarrior_fla {
import flash.display.*;
public dynamic class monkey_blink_18 extends MovieClip {
public function monkey_blink_18(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package fooWarrior_fla
Section 34
//pallina_mappa_94 (fooWarrior_fla.pallina_mappa_94)
package fooWarrior_fla {
import flash.display.*;
public dynamic class pallina_mappa_94 extends MovieClip {
public function pallina_mappa_94(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package fooWarrior_fla
Section 35
//popup_181 (fooWarrior_fla.popup_181)
package fooWarrior_fla {
import flash.display.*;
public dynamic class popup_181 extends MovieClip {
public function popup_181(){
addFrameScript(0, frame1, 57, frame58);
}
function frame1(){
stop();
}
function frame58(){
stop();
}
}
}//package fooWarrior_fla
Section 36
//Preloader_2 (fooWarrior_fla.Preloader_2)
package fooWarrior_fla {
import flash.display.*;
public dynamic class Preloader_2 extends MovieClip {
public var mc_loadingBar:MovieClip;
public function Preloader_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package fooWarrior_fla
Section 37
//rafficaContinue_214 (fooWarrior_fla.rafficaContinue_214)
package fooWarrior_fla {
import flash.display.*;
public dynamic class rafficaContinue_214 extends MovieClip {
public function rafficaContinue_214(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package fooWarrior_fla
Section 38
//rafficaHall_216 (fooWarrior_fla.rafficaHall_216)
package fooWarrior_fla {
import flash.display.*;
public dynamic class rafficaHall_216 extends MovieClip {
public function rafficaHall_216(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package fooWarrior_fla
Section 39
//rafficaMore_218 (fooWarrior_fla.rafficaMore_218)
package fooWarrior_fla {
import flash.display.*;
public dynamic class rafficaMore_218 extends MovieClip {
public function rafficaMore_218(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package fooWarrior_fla
Section 40
//rafficaNew_228 (fooWarrior_fla.rafficaNew_228)
package fooWarrior_fla {
import flash.display.*;
public dynamic class rafficaNew_228 extends MovieClip {
public function rafficaNew_228(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package fooWarrior_fla
Section 41
//rafficaNew_91 (fooWarrior_fla.rafficaNew_91)
package fooWarrior_fla {
import flash.display.*;
public dynamic class rafficaNew_91 extends MovieClip {
public function rafficaNew_91(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package fooWarrior_fla
Section 42
//rafficaNextMission_83 (fooWarrior_fla.rafficaNextMission_83)
package fooWarrior_fla {
import flash.display.*;
public dynamic class rafficaNextMission_83 extends MovieClip {
public function rafficaNextMission_83(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package fooWarrior_fla
Section 43
//Soundbutton_85 (fooWarrior_fla.Soundbutton_85)
package fooWarrior_fla {
import flash.display.*;
public dynamic class Soundbutton_85 extends MovieClip {
public var soundFxOffBtn:SimpleButton;
public var soundFxOnBtn:SimpleButton;
public function Soundbutton_85(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package fooWarrior_fla
Section 44
//torretta_carro_armato_gigante_174 (fooWarrior_fla.torretta_carro_armato_gigante_174)
package fooWarrior_fla {
import flash.display.*;
public dynamic class torretta_carro_armato_gigante_174 extends MovieClip {
public function torretta_carro_armato_gigante_174(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
}
function frame158(){
stop();
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame188(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
function frame38(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
function frame68(){
stop();
}
}
}//package fooWarrior_fla
Section 45
//AmmoCrate (ThisGame.AmmoCrate)
package ThisGame {
import flash.display.*;
public class AmmoCrate extends MovieClip {
public var toDispose:Boolean;
public function AmmoCrate():void{
toDispose = false;
}
}
}//package ThisGame
Section 46
//AmmoCrate10 (ThisGame.AmmoCrate10)
package ThisGame {
public class AmmoCrate10 extends AmmoCrate {
const packValue:Number = 2;
const squaredRadius:Number = 200;
const weaponNumber:Number = 10;
public function AmmoCrate10():void{
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.PlaySound(_arg1.box);
_arg1.player.AddAmmo(_arg1, weaponNumber, packValue);
toDispose = true;
};
}
}
}//package ThisGame
Section 47
//AmmoCrate2 (ThisGame.AmmoCrate2)
package ThisGame {
public class AmmoCrate2 extends AmmoCrate {
const packValue:Number = 100;
const squaredRadius:Number = 200;
const weaponNumber:Number = 2;
public function AmmoCrate2():void{
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.PlaySound(_arg1.box);
_arg1.player.AddAmmo(_arg1, weaponNumber, packValue);
toDispose = true;
};
}
}
}//package ThisGame
Section 48
//AmmoCrate3 (ThisGame.AmmoCrate3)
package ThisGame {
public class AmmoCrate3 extends AmmoCrate {
const packValue:Number = 40;
const squaredRadius:Number = 200;
const weaponNumber:Number = 3;
public function AmmoCrate3():void{
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.PlaySound(_arg1.box);
_arg1.player.AddAmmo(_arg1, weaponNumber, packValue);
toDispose = true;
};
}
}
}//package ThisGame
Section 49
//AmmoCrate4 (ThisGame.AmmoCrate4)
package ThisGame {
public class AmmoCrate4 extends AmmoCrate {
const packValue:Number = 100;
const squaredRadius:Number = 200;
const weaponNumber:Number = 4;
public function AmmoCrate4():void{
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.PlaySound(_arg1.box);
_arg1.player.AddAmmo(_arg1, weaponNumber, packValue);
toDispose = true;
};
}
}
}//package ThisGame
Section 50
//AmmoCrate5 (ThisGame.AmmoCrate5)
package ThisGame {
public class AmmoCrate5 extends AmmoCrate {
const packValue:Number = 10;
const squaredRadius:Number = 200;
const weaponNumber:Number = 5;
public function AmmoCrate5():void{
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.PlaySound(_arg1.box);
_arg1.player.AddAmmo(_arg1, weaponNumber, packValue);
toDispose = true;
};
}
}
}//package ThisGame
Section 51
//AmmoCrate6 (ThisGame.AmmoCrate6)
package ThisGame {
public class AmmoCrate6 extends AmmoCrate {
const packValue:Number = 15;
const squaredRadius:Number = 200;
const weaponNumber:Number = 6;
public function AmmoCrate6():void{
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.PlaySound(_arg1.box);
_arg1.player.AddAmmo(_arg1, weaponNumber, packValue);
toDispose = true;
};
}
}
}//package ThisGame
Section 52
//AmmoCrate7 (ThisGame.AmmoCrate7)
package ThisGame {
public class AmmoCrate7 extends AmmoCrate {
const packValue:Number = 15;
const squaredRadius:Number = 200;
const weaponNumber:Number = 7;
public function AmmoCrate7():void{
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.PlaySound(_arg1.box);
_arg1.player.AddAmmo(_arg1, weaponNumber, packValue);
toDispose = true;
};
}
}
}//package ThisGame
Section 53
//AmmoCrate8 (ThisGame.AmmoCrate8)
package ThisGame {
public class AmmoCrate8 extends AmmoCrate {
const packValue:Number = 10;
const squaredRadius:Number = 200;
const weaponNumber:Number = 8;
public function AmmoCrate8():void{
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.PlaySound(_arg1.box);
_arg1.player.AddAmmo(_arg1, weaponNumber, packValue);
toDispose = true;
};
}
}
}//package ThisGame
Section 54
//AmmoCrate9 (ThisGame.AmmoCrate9)
package ThisGame {
public class AmmoCrate9 extends AmmoCrate {
const packValue:Number = 2;
const squaredRadius:Number = 200;
const weaponNumber:Number = 9;
public function AmmoCrate9():void{
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.PlaySound(_arg1.box);
_arg1.player.AddAmmo(_arg1, weaponNumber, packValue);
toDispose = true;
};
}
}
}//package ThisGame
Section 55
//AmmoInfo (ThisGame.AmmoInfo)
package ThisGame {
class AmmoInfo {
public var ammoCount:Number;
public var gunEnabled:Boolean;
public var maxCount:Number;
}
}//package ThisGame
Section 56
//Artillery (ThisGame.Artillery)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Artillery extends MovieClip {
const lifeTime:int = 10000;
const squaredRadius:int = 8000;
const flyTime:int = 1100;
public var senderIsPlayer:Boolean;
private var explosionCount:int;
public var toDispose:Boolean;
public var flyG:DisplayObject;
var speed:Number;
var dTime:int;
var vSpeed:Number;
var startTime:int;
var startPos:Point;
var dir:Vector2;
public function Artillery():void{
dir = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
}
public function Step(_arg1:State_InGame):void{
var _local2:BigExplosion;
var _local3:BigExplosion;
var _local4:int;
var _local5:Point;
var _local6:BigExplosion;
var _local7:BigExplosion;
var _local8:BigExplosion;
dTime = (_arg1._time - startTime);
if (dTime <= lifeTime){
if ((((dTime > 6100)) && ((explosionCount == 5)))){
explosionCount++;
_local2 = new BigExplosion();
_local2.x = 350;
_local2.y = ((startPos.y - 760) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = new BigExplosion();
_local3.x = 590;
_local3.y = ((startPos.y - 760) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 6000)) && ((explosionCount == 4)))){
explosionCount++;
_local2 = new BigExplosion();
_local2.x = 250;
_local2.y = ((startPos.y - 760) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = new BigExplosion();
_local3.x = 450;
_local3.y = ((startPos.y - 760) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 5800)) && ((explosionCount == 3)))){
explosionCount++;
_local2 = new BigExplosion();
_local2.x = 180;
_local2.y = ((startPos.y - 720) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = new BigExplosion();
_local3.x = 520;
_local3.y = ((startPos.y - 720) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 5600)) && ((explosionCount == 2)))){
explosionCount++;
_local2 = new BigExplosion();
_local2.x = 350;
_local2.y = ((startPos.y - 680) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local6 = new BigExplosion();
_local6.x = 250;
_local6.y = ((startPos.y - 680) - (Math.random() * 200));
_local6.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local6);
_arg1.isoObjectActiveArray.push(_local6);
_local7 = new BigExplosion();
_local7.x = 50;
_local7.y = ((startPos.y - 680) - (Math.random() * 200));
_local7.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local8 = new BigExplosion();
_local8.x = 450;
_local8.y = ((startPos.y - 680) - (Math.random() * 200));
_local8.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local8);
_arg1.isoObjectActiveArray.push(_local8);
_local3 = new BigExplosion();
_local3.x = 600;
_local3.y = ((startPos.y - 680) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local6.x) * (_local5.x - _local6.x)) + ((_local5.y - _local6.y) * (_local5.y - _local6.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local7.x) * (_local5.x - _local7.x)) + ((_local5.y - _local7.y) * (_local5.y - _local7.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local8.x) * (_local5.x - _local8.x)) + ((_local5.y - _local8.y) * (_local5.y - _local8.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 5200)) && ((explosionCount == 1)))){
explosionCount++;
_local2 = new BigExplosion();
_local2.x = 350;
_local2.y = ((startPos.y - 520) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = new BigExplosion();
_local3.x = 550;
_local3.y = ((startPos.y - 520) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 5100)) && ((explosionCount == 0)))){
explosionCount++;
_local2 = new BigExplosion();
_local2.x = 350;
_local2.y = ((startPos.y - 500) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local6 = new BigExplosion();
_local6.x = 250;
_local6.y = ((startPos.y - 500) - (Math.random() * 200));
_local6.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local6);
_arg1.isoObjectActiveArray.push(_local6);
_local7 = new BigExplosion();
_local7.x = 50;
_local7.y = ((startPos.y - 500) - (Math.random() * 200));
_local7.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local8 = new BigExplosion();
_local8.x = 450;
_local8.y = ((startPos.y - 500) - (Math.random() * 200));
_local8.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local8);
_arg1.isoObjectActiveArray.push(_local8);
_local3 = new BigExplosion();
_local3.x = 550;
_local3.y = ((startPos.y - 500) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local6.x) * (_local5.x - _local6.x)) + ((_local5.y - _local6.y) * (_local5.y - _local6.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local7.x) * (_local5.x - _local7.x)) + ((_local5.y - _local7.y) * (_local5.y - _local7.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local8.x) * (_local5.x - _local8.x)) + ((_local5.y - _local8.y) * (_local5.y - _local8.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 4100)) && ((explosionCount == -1)))){
explosionCount = 0;
_arg1.PlaySound(_arg1.weapon10_boom);
} else {
if ((((dTime > 500)) && ((explosionCount == -2)))){
explosionCount = -1;
_arg1.PlaySound(_arg1.weapon10_fire);
};
};
};
};
};
};
};
};
} else {
if (dTime > lifeTime){
toDispose = true;
};
};
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
dir.x = _arg2;
dir.y = _arg3;
startTime = _arg1._time;
speed = 3.6;
vSpeed = -6;
startPos = new Point(x, y);
explosionCount = -2;
}
}
}//package ThisGame
Section 57
//B52 (ThisGame.B52)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class B52 extends MovieClip {
const lifeTime:int = 10000;
const squaredRadius:int = 8000;
const flyTime:int = 1100;
public var senderIsPlayer:Boolean;
private var explosionCount:int;
public var toDispose:Boolean;
public var flyG:DisplayObject;
var speed:Number;
var dTime:int;
var vSpeed:Number;
var startTime:int;
var startPos:Point;
var dir:Vector2;
public function B52():void{
dir = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
}
public function Step(_arg1:State_InGame):void{
var _local2:FireExplosion;
var _local3:FireExplosion;
var _local4:int;
var _local5:Point;
var _local6:FireExplosion;
var _local7:FireExplosion;
var _local8:FireExplosion;
dTime = (_arg1._time - startTime);
if (dTime <= lifeTime){
if (_arg1.camera.IsShaking() == false){
_arg1.camera.ShakingEffect(10, 1, 1);
};
x = (x + (dir.x * speed));
y = (y + (dir.y * speed));
if (explosionCount > 5){
scaleX = (scaleX * 0.99);
scaleY = (scaleY * 0.99);
speed = (speed * 1.05);
} else {
if ((((dTime > 6100)) && ((explosionCount == 5)))){
explosionCount++;
_local2 = new FireExplosion();
_local2.x = 350;
_local2.y = ((startPos.y - 760) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = new FireExplosion();
_local3.x = 590;
_local3.y = ((startPos.y - 760) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 6000)) && ((explosionCount == 4)))){
explosionCount++;
_local2 = new FireExplosion();
_local2.x = 250;
_local2.y = ((startPos.y - 760) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = new FireExplosion();
_local3.x = 450;
_local3.y = ((startPos.y - 760) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 5800)) && ((explosionCount == 3)))){
explosionCount++;
_local2 = new FireExplosion();
_local2.x = 180;
_local2.y = ((startPos.y - 720) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = new FireExplosion();
_local3.x = 520;
_local3.y = ((startPos.y - 720) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 5600)) && ((explosionCount == 2)))){
explosionCount++;
_local2 = new FireExplosion();
_local2.x = 350;
_local2.y = ((startPos.y - 680) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local6 = new FireExplosion();
_local6.x = 250;
_local6.y = ((startPos.y - 680) - (Math.random() * 200));
_local6.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local6);
_arg1.isoObjectActiveArray.push(_local6);
_local7 = new FireExplosion();
_local7.x = 50;
_local7.y = ((startPos.y - 680) - (Math.random() * 200));
_local7.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local8 = new FireExplosion();
_local8.x = 450;
_local8.y = ((startPos.y - 680) - (Math.random() * 200));
_local8.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local8);
_arg1.isoObjectActiveArray.push(_local8);
_local3 = new FireExplosion();
_local3.x = 600;
_local3.y = ((startPos.y - 680) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local6.x) * (_local5.x - _local6.x)) + ((_local5.y - _local6.y) * (_local5.y - _local6.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local7.x) * (_local5.x - _local7.x)) + ((_local5.y - _local7.y) * (_local5.y - _local7.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local8.x) * (_local5.x - _local8.x)) + ((_local5.y - _local8.y) * (_local5.y - _local8.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 5200)) && ((explosionCount == 1)))){
explosionCount++;
_local2 = new FireExplosion();
_local2.x = 350;
_local2.y = ((startPos.y - 520) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = new FireExplosion();
_local3.x = 550;
_local3.y = ((startPos.y - 520) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
_local4++;
};
_arg1.camera.ShakingEffect(10, 10, 1);
} else {
if ((((dTime > 5100)) && ((explosionCount == 0)))){
explosionCount++;
_local2 = new FireExplosion();
_local2.x = 350;
_local2.y = ((startPos.y - 500) - (Math.random() * 200));
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local6 = new FireExplosion();
_local6.x = 250;
_local6.y = ((startPos.y - 500) - (Math.random() * 200));
_local6.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local6);
_arg1.isoObjectActiveArray.push(_local6);
_local7 = new FireExplosion();
_local7.x = 50;
_local7.y = ((startPos.y - 500) - (Math.random() * 200));
_local7.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local8 = new FireExplosion();
_local8.x = 450;
_local8.y = ((startPos.y - 500) - (Math.random() * 200));
_local8.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local8);
_arg1.isoObjectActiveArray.push(_local8);
_local3 = new FireExplosion();
_local3.x = 550;
_local3.y = ((startPos.y - 500) - (Math.random() * 200));
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - _local2.x) * (_local5.x - _local2.x)) + ((_local5.y - _local2.y) * (_local5.y - _local2.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local6.x) * (_local5.x - _local6.x)) + ((_local5.y - _local6.y) * (_local5.y - _local6.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local7.x) * (_local5.x - _local7.x)) + ((_local5.y - _local7.y) * (_local5.y - _local7.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local8.x) * (_local5.x - _local8.x)) + ((_local5.y - _local8.y) * (_local5.y - _local8.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
if ((((_local5.x - _local3.x) * (_local5.x - _local3.x)) + ((_local5.y - _local3.y) * (_local5.y - _local3.y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 2);
};
_local4++;
};
_arg1.PlaySound(_arg1.weapon9_boom);
_arg1.camera.ShakingEffect(10, 10, 1);
};
};
};
};
};
};
};
} else {
toDispose = true;
};
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
dir.x = _arg2;
dir.y = _arg3;
startTime = _arg1._time;
speed = 3.6;
vSpeed = -6;
startPos = new Point(x, y);
explosionCount = 0;
_arg1.PlaySound(_arg1.weapon9_fire);
}
}
}//package ThisGame
Section 58
//Barrel (ThisGame.Barrel)
package ThisGame {
import FoofaGeom.*;
import flash.geom.*;
public class Barrel extends Png {
const squaredRadius:int = 6000;
public function Barrel(){
addFrameScript(0, frame1, 1, frame2);
dieMode = false;
gotoAndStop(1);
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:BigExplosion;
var _local4:int;
var _local5:Point;
if (dieMode == true){
gotoAndStop(2);
_local3 = new BigExplosion();
_local3.x = x;
_local3.y = y;
_local3.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local4 = 0;
while (_local4 < _arg1.enemyActiveArray.length) {
_local5 = new Point(_arg1.enemyActiveArray[_local4].x, _arg1.enemyActiveArray[_local4].y);
if ((((_local5.x - x) * (_local5.x - x)) + ((_local5.y - y) * (_local5.y - y))) < squaredRadius){
_arg1.enemyActiveArray[_local4].OnHit(_arg1, 3);
};
_local4++;
};
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.player.OnHit(_arg1, 3);
};
toDispose = true;
_arg1.PlaySound(_arg1.weapon6_boom);
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
};
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
dieMode = true;
}
function frame1(){
stop();
}
function frame2(){
y = (y - 200);
stop();
}
}
}//package ThisGame
Section 59
//BigExplosion (ThisGame.BigExplosion)
package ThisGame {
import flash.display.*;
public class BigExplosion extends MovieClip {
public var senderIsPlayer:Boolean;
public var toDispose:Boolean;
public function BigExplosion():void{
addFrameScript(25, frame26);
toDispose = false;
senderIsPlayer = false;
}
public function Step(_arg1:State_InGame):void{
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
}
function frame26(){
toDispose = true;
}
}
}//package ThisGame
Section 60
//Bullet (ThisGame.Bullet)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Bullet extends MovieClip {
const speed:Number = 6;
public var senderIsPlayer:Boolean;
public var flyHighBullet:Boolean;
public var toDispose:Boolean;
var startTime:int;
var dir:Vector2;
public var lifeTime:int;
public function Bullet():void{
dir = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
flyHighBullet = false;
}
public function Step(_arg1:State_InGame):void{
if ((_arg1._time - startTime) < lifeTime){
if (senderIsPlayer){
x = (x + (dir.x * speed));
y = (y + (dir.y * speed));
} else {
x = (x + ((dir.x * speed) * 0.5));
y = (y + ((dir.y * speed) * 0.5));
};
ComputeCollisions(_arg1);
} else {
toDispose = true;
};
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
dir.x = _arg2;
dir.y = _arg3;
startTime = _arg1._time;
lifeTime = 2000;
}
private function CollisionWithRectangle(_arg1:ConvexPoly):Boolean{
return (FoofaGeomUtils.InPoly(_arg1.particles[0].toPoint(), _arg1.particles[1].toPoint(), _arg1.particles[2].toPoint(), _arg1.particles[3].toPoint(), new Point(x, y)));
}
private function CollisionWithCircle(_arg1:Circle):Boolean{
return (_arg1.PointIsInside(x, y));
}
private function ComputeCollisions(_arg1:State_InGame):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.solidActiveArray.length) {
if ((((((_arg1.solidActiveArray[_local2] is CollisionCircle)) && ((CollisionWithCircle(_arg1.solidActiveArray[_local2].collisionCircle) == true)))) || (((((_arg1.solidActiveArray[_local2] is CollisionCircle) == false)) && ((CollisionWithRectangle(_arg1.solidActiveArray[_local2].collisionPoly) == true)))))){
if ((((flyHighBullet == false)) || ((_arg1.solidActiveArray[_local2].h > 15)))){
toDispose = true;
};
};
_local2++;
};
if (senderIsPlayer){
_local2 = 0;
while (_local2 < _arg1.enemyActiveArray.length) {
if (_arg1.enemyActiveArray[_local2].collisionCircle.PointIsInside(x, y) == true){
_arg1.enemyActiveArray[_local2].OnHit(_arg1, 1);
toDispose = true;
};
_local2++;
};
} else {
if (_arg1.player.collisionCircle.PointIsInside(x, y) == true){
_arg1.player.OnHit(_arg1, 1);
toDispose = true;
};
};
}
}
}//package ThisGame
Section 61
//Bullet_fire (ThisGame.Bullet_fire)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Bullet_fire extends MovieClip {
public var senderIsPlayer:Boolean;
public var fireParticle:MovieClip;
public var toDispose:Boolean;
var speed:Number;
var startTime:int;
public var particle:DisplayObject;
var dir:Vector2;
public var lifeTime:int;
static var count = 0;
public function Bullet_fire():void{
dir = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
speed = 3;
lifeTime = 1200;
}
public function Step(_arg1:State_InGame):void{
if ((_arg1._time - startTime) < lifeTime){
x = (x + (dir.x * speed));
y = (y + (dir.y * speed));
if (particle.scaleX < 3.5){
particle.scaleX = (particle.scaleX * 1.02);
particle.scaleY = (particle.scaleY * 1.02);
};
ComputeCollisions(_arg1);
} else {
toDispose = true;
};
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
dir.x = _arg2;
dir.y = _arg3;
count++;
if ((count % 2) == 0){
x = (x + (2 * dir.rightNormal.x));
y = (y + (2 * dir.rightNormal.y));
} else {
x = (x + (2 * dir.leftNormal.x));
y = (y + (2 * dir.leftNormal.y));
};
startTime = _arg1._time;
particle = this.getChildByName("fireParticle");
}
private function CollisionWithRectangle(_arg1:ConvexPoly):Boolean{
return (FoofaGeomUtils.InPoly(_arg1.particles[0].toPoint(), _arg1.particles[1].toPoint(), _arg1.particles[2].toPoint(), _arg1.particles[3].toPoint(), new Point(x, y)));
}
private function CollisionWithCircle(_arg1:Circle):Boolean{
return (_arg1.PointIsInside(x, y));
}
private function ComputeCollisions(_arg1:State_InGame):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.solidActiveArray.length) {
if ((((((_arg1.solidActiveArray[_local2] is CollisionCircle)) && ((CollisionWithCircle(_arg1.solidActiveArray[_local2].collisionCircle) == true)))) || (((((_arg1.solidActiveArray[_local2] is CollisionCircle) == false)) && ((CollisionWithRectangle(_arg1.solidActiveArray[_local2].collisionPoly) == true)))))){
toDispose = true;
};
_local2++;
};
if (senderIsPlayer){
_local2 = 0;
while (_local2 < _arg1.enemyActiveArray.length) {
if (_arg1.enemyActiveArray[_local2].collisionCircle.PointIsInside(x, y) == true){
_arg1.enemyActiveArray[_local2].OnHit(_arg1, 2);
toDispose = true;
};
_local2++;
};
} else {
if (_arg1.player.collisionCircle.PointIsInside(x, y) == true){
_arg1.player.OnHit(_arg1, 2);
toDispose = true;
};
};
}
}
}//package ThisGame
Section 62
//Bullet_rocket (ThisGame.Bullet_rocket)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Bullet_rocket extends MovieClip {
const maxSpeed:Number = 15;
const squaredRadius:int = 5500;
const acceleration:Number = 0.2;
const radius:int;
const lifeTime:int = 2600;
var refVec:Vector2;
public var senderIsPlayer:Boolean;
public var toDispose:Boolean;
var speed:Number;
var startTime:int;
var dir:Vector2;
var stepCount:Number;
public function Bullet_rocket():void{
radius = Math.sqrt(squaredRadius);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
dir = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
speed = 0.2;
stepCount = 0;
}
public function Step(_arg1:State_InGame):void{
var _local2:Bullet_smoke;
stepCount++;
if (speed < maxSpeed){
speed = (speed + acceleration);
};
if ((_arg1._time - startTime) < lifeTime){
if (senderIsPlayer){
x = (x + (dir.x * speed));
y = (y + (dir.y * speed));
} else {
x = (x + ((dir.x * speed) * 0.5));
y = (y + ((dir.y * speed) * 0.5));
};
if ((stepCount % 2) == 0){
_local2 = new Bullet_smoke();
_local2.x = x;
_local2.y = y;
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
};
ComputeCollisions(_arg1);
} else {
Detonate(_arg1);
};
}
function frame2(){
stop();
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
dir.x = _arg2;
dir.y = _arg3;
startTime = _arg1._time;
refVec = new Vector2(0, 1);
_local4 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, dir) + (Math.PI / 2));
while (_local4 < 0) {
_local4 = (_local4 + (2 * Math.PI));
};
while (_local4 > (2 * Math.PI)) {
_local4 = (_local4 - (2 * Math.PI));
};
_local5 = ((_local4 * 180) / Math.PI);
_local5 = (_local5 % 360);
while (_local5 < 0) {
_local5 = (_local5 + 360);
};
_local6 = Math.round((_local5 / 45));
_local6 = (_local6 % 8);
this.gotoAndStop((_local6 + 1));
}
private function CollisionWithRectangle(_arg1:ConvexPoly):Boolean{
return (FoofaGeomUtils.InPoly(_arg1.particles[0].toPoint(), _arg1.particles[1].toPoint(), _arg1.particles[2].toPoint(), _arg1.particles[3].toPoint(), new Point(x, y)));
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
public function Detonate(_arg1:State_InGame):void{
var _local2:BigExplosion;
var _local3:int;
var _local4:Point;
_local2 = new BigExplosion();
_local2.x = x;
_local2.y = y;
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = 0;
while (_local3 < _arg1.enemyActiveArray.length) {
_local4 = new Point(_arg1.enemyActiveArray[_local3].x, _arg1.enemyActiveArray[_local3].y);
if ((((_local4.x - x) * (_local4.x - x)) + ((_local4.y - y) * (_local4.y - y))) < ((_arg1.enemyActiveArray[_local3].collisionCircle.radius + radius) * (_arg1.enemyActiveArray[_local3].collisionCircle.radius + radius))){
_arg1.enemyActiveArray[_local3].OnHit(_arg1, 3);
};
_local3++;
};
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.player.OnHit(_arg1, 2);
toDispose = true;
};
_arg1.PlaySound(_arg1.weapon6_boom);
_arg1.camera.ShakingEffect(10, 10, 1);
toDispose = true;
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame8(){
stop();
}
private function CollisionWithCircle(_arg1:Circle):Boolean{
return (_arg1.PointIsInside(x, y));
}
private function ComputeCollisions(_arg1:State_InGame):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.solidActiveArray.length) {
if ((((((_arg1.solidActiveArray[_local2] is CollisionCircle)) && ((CollisionWithCircle(_arg1.solidActiveArray[_local2].collisionCircle) == true)))) || (((((_arg1.solidActiveArray[_local2] is CollisionCircle) == false)) && ((CollisionWithRectangle(_arg1.solidActiveArray[_local2].collisionPoly) == true)))))){
Detonate(_arg1);
toDispose = true;
};
_local2++;
};
if (senderIsPlayer){
_local2 = 0;
while (_local2 < _arg1.enemyActiveArray.length) {
if (_arg1.enemyActiveArray[_local2].collisionCircle.PointIsInside(x, y) == true){
Detonate(_arg1);
toDispose = true;
};
_local2++;
};
} else {
if (_arg1.player.collisionCircle.PointIsInside(x, y) == true){
Detonate(_arg1);
toDispose = true;
};
};
}
}
}//package ThisGame
Section 63
//Bullet_smartRocket (ThisGame.Bullet_smartRocket)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Bullet_smartRocket extends MovieClip {
const maxSpeed:Number = 10;
const squaredRadius:int = 3000;
const acceleration:Number = 0.2;
const lifeTime:int = 7200;
var refVec:Vector2;
public var senderIsPlayer:Boolean;
public var toDispose:Boolean;
var tempVector:Vector2;
var speed:Number;
var startTime:int;
var dir:Vector2;
var stepCount:Number;
public function Bullet_smartRocket():void{
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8);
dir = new Vector2(0, 0);
tempVector = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
speed = 0.2;
stepCount = 0;
}
public function Step(_arg1:State_InGame):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Bullet_smoke;
stepCount++;
if (speed < maxSpeed){
speed = (speed + acceleration);
};
if ((_arg1._time - startTime) < lifeTime){
if (senderIsPlayer){
x = (x + (dir.x * speed));
y = (y + (dir.y * speed));
} else {
if ((_arg1._time - startTime) > 800){
tempVector.x = ((_arg1.player.x + dir.x) - x);
tempVector.y = ((_arg1.player.y + dir.y) - y);
if (tempVector.length < 0.025){
dir.x = (dir.x + tempVector.x);
dir.y = (dir.y + tempVector.y);
} else {
tempVector.normalize(1);
dir.x = (dir.x + (tempVector.x * 0.025));
dir.y = (dir.y + (tempVector.y * 0.025));
};
dir.normalize(1);
};
x = (x + ((dir.x * speed) * 0.3));
y = (y + ((dir.y * speed) * 0.3));
};
if ((stepCount % 3) == 0){
_local5 = new Bullet_smoke();
_local5.x = x;
_local5.y = y;
_local5.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local5);
_arg1.isoObjectActiveArray.push(_local5);
};
ComputeCollisions(_arg1);
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, dir) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
this.gotoAndStop((_local4 + 1));
} else {
Detonate(_arg1);
};
}
function frame2(){
stop();
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
dir.x = _arg2;
dir.y = _arg3;
startTime = _arg1._time;
refVec = new Vector2(0, 1);
}
private function CollisionWithRectangle(_arg1:ConvexPoly):Boolean{
return (FoofaGeomUtils.InPoly(_arg1.particles[0].toPoint(), _arg1.particles[1].toPoint(), _arg1.particles[2].toPoint(), _arg1.particles[3].toPoint(), new Point(x, y)));
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
public function Detonate(_arg1:State_InGame):void{
var _local2:BigExplosion;
var _local3:int;
_local2 = new BigExplosion();
_local2.x = x;
_local2.y = y;
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.player.OnHit(_arg1, 2);
toDispose = true;
};
_arg1.PlaySound(_arg1.weapon6_boom, 0.5);
_arg1.camera.ShakingEffect(10, 10, 1);
toDispose = true;
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame8(){
stop();
}
private function CollisionWithCircle(_arg1:Circle):Boolean{
return (_arg1.PointIsInside(x, y));
}
private function ComputeCollisions(_arg1:State_InGame):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.solidActiveArray.length) {
if ((((((_arg1.solidActiveArray[_local2] is CollisionCircle)) && ((CollisionWithCircle(_arg1.solidActiveArray[_local2].collisionCircle) == true)))) || (((((_arg1.solidActiveArray[_local2] is CollisionCircle) == false)) && ((CollisionWithRectangle(_arg1.solidActiveArray[_local2].collisionPoly) == true)))))){
Detonate(_arg1);
toDispose = true;
};
_local2++;
};
if (senderIsPlayer){
_local2 = 0;
while (_local2 < _arg1.enemyActiveArray.length) {
if (_arg1.enemyActiveArray[_local2].collisionCircle.PointIsInside(x, y) == true){
Detonate(_arg1);
toDispose = true;
};
_local2++;
};
} else {
if (_arg1.player.collisionCircle.PointIsInside(x, y) == true){
Detonate(_arg1);
toDispose = true;
};
};
}
}
}//package ThisGame
Section 64
//Bullet_smoke (ThisGame.Bullet_smoke)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Bullet_smoke extends MovieClip {
const lifeTime:int = 300;
public var senderIsPlayer:Boolean;
public var fireParticle:MovieClip;
public var toDispose:Boolean;
var speed:Number;
var startTime:int;
public var particle:DisplayObject;
var dir:Vector2;
static var count = 0;
public function Bullet_smoke():void{
dir = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
speed = 3;
}
public function Step(_arg1:State_InGame):void{
if ((_arg1._time - startTime) < lifeTime){
x = (x + (dir.x * speed));
y = (y + (dir.y * speed));
if (particle.scaleX < 4.5){
particle.scaleX = (particle.scaleX * 1.09);
particle.scaleY = (particle.scaleY * 1.09);
};
} else {
toDispose = true;
};
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
dir.x = _arg2;
dir.y = _arg3;
count++;
if ((count % 2) == 0){
x = (x + (2 * dir.rightNormal.x));
y = (y + (2 * dir.rightNormal.y));
} else {
x = (x + (2 * dir.leftNormal.x));
y = (y + (2 * dir.leftNormal.y));
};
startTime = _arg1._time;
particle = this.getChildByName("fireParticle");
particle.scaleX = 0.6;
particle.scaleY = 0.6;
}
private function CollisionWithRectangle(_arg1:ConvexPoly):Boolean{
return (FoofaGeomUtils.InPoly(_arg1.particles[0].toPoint(), _arg1.particles[1].toPoint(), _arg1.particles[2].toPoint(), _arg1.particles[3].toPoint(), new Point(x, y)));
}
}
}//package ThisGame
Section 65
//BulletFly (ThisGame.BulletFly)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class BulletFly extends MovieClip {
const lifeTime:int = 2000;
const speed:Number = 6;
public var senderIsPlayer:Boolean;
public var toDispose:Boolean;
public var flyG:DisplayObject;
public var flyBullet:MovieClip;
var startTime:int;
public var h:Number;
var dir:Vector2;
public var vSpeed:Number;
public function BulletFly():void{
dir = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
vSpeed = 0;
h = -20;
}
public function Step(_arg1:State_InGame):void{
if ((_arg1._time - startTime) < lifeTime){
flyG.y = (flyG.y + vSpeed);
if (flyG.y > 0){
flyG.y = 0;
toDispose = true;
};
if (senderIsPlayer){
x = (x + (dir.x * speed));
y = (y + (dir.y * speed));
} else {
x = (x + ((dir.x * speed) * 0.5));
y = (y + ((dir.y * speed) * 0.5));
};
ComputeCollisions(_arg1);
} else {
toDispose = true;
};
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
dir.x = _arg2;
dir.y = _arg3;
startTime = _arg1._time;
flyG = this.getChildByName("flyBullet");
flyG.y = h;
}
private function CollisionWithRectangle(_arg1:ConvexPoly):Boolean{
return (FoofaGeomUtils.InPoly(_arg1.particles[0].toPoint(), _arg1.particles[1].toPoint(), _arg1.particles[2].toPoint(), _arg1.particles[3].toPoint(), new Point(x, y)));
}
private function CollisionWithCircle(_arg1:Circle):Boolean{
return (_arg1.PointIsInside(x, y));
}
private function ComputeCollisions(_arg1:State_InGame):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.solidActiveArray.length) {
if ((((((_arg1.solidActiveArray[_local2] is CollisionCircle)) && ((CollisionWithCircle(_arg1.solidActiveArray[_local2].collisionCircle) == true)))) || (((((_arg1.solidActiveArray[_local2] is CollisionCircle) == false)) && ((CollisionWithRectangle(_arg1.solidActiveArray[_local2].collisionPoly) == true)))))){
if (_arg1.solidActiveArray[_local2].h > h){
toDispose = true;
};
};
_local2++;
};
if (senderIsPlayer){
_local2 = 0;
while (_local2 < _arg1.enemyActiveArray.length) {
if (_arg1.enemyActiveArray[_local2].collisionCircle.PointIsInside(x, y) == true){
_arg1.enemyActiveArray[_local2].OnHit(_arg1, 1);
toDispose = true;
};
_local2++;
};
} else {
if (_arg1.player.collisionCircle.PointIsInside(x, y) == true){
_arg1.player.OnHit(_arg1, 1);
toDispose = true;
};
};
}
}
}//package ThisGame
Section 66
//CollisionCircle (ThisGame.CollisionCircle)
package ThisGame {
import FoofaGeom.*;
public class CollisionCircle extends CollisionObject {
public var collisionCircle:Circle;
public function CollisionCircle():void{
collisionCircle = new Circle(x, y, (width / 2));
}
public function Step(_arg1:State_InGame):void{
}
}
}//package ThisGame
Section 67
//CollisionClip (ThisGame.CollisionClip)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class CollisionClip extends CollisionObject {
public var collisionPoly:ConvexPoly;
public var p1:point;
public var p2:point;
public var p3:point;
public var p4:point;
public function CollisionClip():void{
var _local1:Point;
var _local2:Point;
var _local3:Point;
var _local4:Point;
super();
_local1 = new Point(MovieClip(this.getChildByName("p1")).x, MovieClip(this.getChildByName("p1")).y);
_local2 = new Point(MovieClip(this.getChildByName("p2")).x, MovieClip(this.getChildByName("p2")).y);
_local3 = new Point(MovieClip(this.getChildByName("p3")).x, MovieClip(this.getChildByName("p3")).y);
_local4 = new Point(MovieClip(this.getChildByName("p4")).x, MovieClip(this.getChildByName("p4")).y);
_local1 = localToGlobal(_local1);
_local2 = localToGlobal(_local2);
_local3 = localToGlobal(_local3);
_local4 = localToGlobal(_local4);
_local1.x = (_local1.x - this.parent.x);
_local1.y = (_local1.y - this.parent.y);
_local2.x = (_local2.x - this.parent.x);
_local2.y = (_local2.y - this.parent.y);
_local3.x = (_local3.x - this.parent.x);
_local3.y = (_local3.y - this.parent.y);
_local4.x = (_local4.x - this.parent.x);
_local4.y = (_local4.y - this.parent.y);
collisionPoly = new ConvexPoly(new Array(new Particle(_local1.x, _local1.y), new Particle(_local2.x, _local2.y), new Particle(_local3.x, _local3.y), new Particle(_local4.x, _local4.y)));
}
public function Step(_arg1:State_InGame):void{
}
}
}//package ThisGame
Section 68
//CollisionObject (ThisGame.CollisionObject)
package ThisGame {
import flash.display.*;
public class CollisionObject extends MovieClip {
public var toDispose:Boolean;
public var h:Number;
public function CollisionObject():void{
h = Number.POSITIVE_INFINITY;
toDispose = false;
}
}
}//package ThisGame
Section 69
//FireExplosion (ThisGame.FireExplosion)
package ThisGame {
import flash.display.*;
public class FireExplosion extends MovieClip {
public var senderIsPlayer:Boolean;
public var toDispose:Boolean;
public function FireExplosion():void{
addFrameScript(25, frame26);
toDispose = false;
senderIsPlayer = false;
}
public function Step(_arg1:State_InGame):void{
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
}
function frame26(){
toDispose = true;
}
}
}//package ThisGame
Section 70
//FireGranade (ThisGame.FireGranade)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class FireGranade extends MovieClip {
const lifeTime:int = 2000;
const squaredRadius:int = 8000;
const flyTime:int = 1100;
public var senderIsPlayer:Boolean;
public var toDispose:Boolean;
public var flyG:DisplayObject;
public var flyGranade:MovieClip;
var speed:Number;
var dTime:int;
var vSpeed:Number;
var startTime:int;
var dir:Vector2;
var lastPos:Point;
public function FireGranade():void{
dir = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
}
public function Step(_arg1:State_InGame):void{
var _local2:FireExplosion;
var _local3:int;
var _local4:Point;
dTime = (_arg1._time - startTime);
if (dTime <= lifeTime){
vSpeed = (vSpeed + 0.3);
flyG.y = (flyG.y + vSpeed);
if (flyG.y > 0){
flyG.y = 0;
vSpeed = (-(vSpeed) * 0.5);
speed = (speed * 0.6);
};
lastPos.x = x;
lastPos.y = y;
x = (x + (dir.x * speed));
y = (y + (dir.y * speed));
ComputeSolidCollisions(_arg1);
} else {
if (dTime > lifeTime){
_local2 = new FireExplosion();
_local2.x = x;
_local2.y = y;
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = 0;
while (_local3 < _arg1.enemyActiveArray.length) {
_local4 = new Point(_arg1.enemyActiveArray[_local3].x, _arg1.enemyActiveArray[_local3].y);
if ((((_local4.x - x) * (_local4.x - x)) + ((_local4.y - y) * (_local4.y - y))) < squaredRadius){
_arg1.enemyActiveArray[_local3].OnHit(_arg1, 2);
};
_local3++;
};
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.player.OnHit(_arg1, 2);
toDispose = true;
};
_arg1.PlaySound(_arg1.weapon7_boom);
_arg1.camera.ShakingEffect(5, 5, 1);
ComputeEnemyCollisions(_arg1);
toDispose = true;
};
};
}
private function ComputeEnemyCollisions(_arg1:State_InGame):void{
var _local2:int;
if (senderIsPlayer){
_local2 = 0;
while (_local2 < _arg1.enemyActiveArray.length) {
if (_arg1.enemyActiveArray[_local2].collisionCircle.PointIsInside(x, y) == true){
toDispose = true;
};
_local2++;
};
} else {
if (_arg1.player.collisionCircle.PointIsInside(x, y) == true){
toDispose = true;
};
};
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
dir.x = _arg2;
dir.y = _arg3;
startTime = _arg1._time;
flyG = this.getChildByName("flyGranade");
speed = 3.6;
vSpeed = -6;
flyG.y = -15;
lastPos = new Point();
}
private function CollisionWithRectangle(_arg1:ConvexPoly):Boolean{
return (FoofaGeomUtils.InPoly(_arg1.particles[0].toPoint(), _arg1.particles[1].toPoint(), _arg1.particles[2].toPoint(), _arg1.particles[3].toPoint(), new Point(x, y)));
}
private function ComputeSolidCollisions(_arg1:State_InGame):void{
var _local2:int;
var _local3:CollisionCircleCircle;
var _local4:Vector2;
var _local5:CollisionConvexPolyCircle;
_local2 = 0;
while (_local2 < _arg1.solidActiveArray.length) {
if ((_arg1.solidActiveArray[_local2] is CollisionCircle)){
_local3 = new CollisionCircleCircle();
if (_local3.test(_arg1.solidActiveArray[_local2].collisionCircle, new Circle(x, y, 1), lastPos) == true){
if (-(flyG.y) < _arg1.solidActiveArray[_local2].h){
_local4 = _local3.getNormal();
_local4 = FoofaGeomUtils.ReflectVectorOnLine(dir, _local4);
dir.x = _local4.x;
dir.y = _local4.y;
};
};
} else {
_local5 = new CollisionConvexPolyCircle();
if (_local5.test(_arg1.solidActiveArray[_local2].collisionPoly, new Circle(x, y, 1), lastPos) == true){
if (-(flyG.y) < _arg1.solidActiveArray[_local2].h){
_local4 = _local5.getNormal();
_local4 = FoofaGeomUtils.ReflectVectorOnLine(dir, _local4);
dir.x = _local4.x;
dir.y = _local4.y;
};
};
};
_local2++;
};
}
}
}//package ThisGame
Section 71
//GiantPanzer (ThisGame.GiantPanzer)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class GiantPanzer extends Png {
const fire1Rate:Number = 800;
const frame_morte:int = 9;
const sleepTime:Number = 10000;
const frame_walk_lenght:int = 0;
const killTime:Number = 20000;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
const fire2Rate:Number = 4500;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var placeToAppear:int;
var normalDir:Vector2;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var actionTimer:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
var fire2Timer:Number;
public function GiantPanzer(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 130;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
normalDir = new Vector2(1, 0);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 90);
iaStatus = 0;
startX = 0;
startY = 0;
fire2Timer = 0;
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame4(){
stop();
}
function frame8(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
function frame68(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
var _local8:Bullet_smartRocket;
var _local9:Bullet_smartRocket;
var _local10:Bullet_smartRocket;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 0;
movingDir.y = 1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((((((((movingDir.x > 0)) && (((x - startX) < 300)))) || ((((movingDir.x < 0)) && (((startX - x) < 300)))))) || ((((movingDir.x == 0)) && (((y - startY) < 400)))))){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
actionTimer = _arg1._time;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - actionTimer) > killTime){
iaStatus = 4;
} else {
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon2, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
normalDir.x = movingDir.leftNormal.x;
normalDir.y = movingDir.leftNormal.y;
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
};
if ((_arg1._time - fire2Timer) > fire2Rate){
_arg1.PlaySound(_arg1.e_weapon_rocket, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(movingDir.x, movingDir.y);
_local5 = (x - (Math.sin(_local4) * 40));
_local6 = (y - (Math.cos(_local4) * 40));
fire2Timer = _arg1._time;
_local8 = new Bullet_smartRocket();
_local8.x = _local5;
_local8.y = _local6;
_local8.Init(_arg1, (-(movingDir.x) + movingDir.leftNormal.x), (-(movingDir.y) + movingDir.leftNormal.y));
_arg1.bulletArray.push(_local8);
_arg1.isoObjectActiveArray.push(_local8);
_local9 = new Bullet_smartRocket();
_local9.x = _local5;
_local9.y = _local6;
_local9.Init(_arg1, (-(movingDir.x) + movingDir.rightNormal.x), (-(movingDir.y) + movingDir.rightNormal.y));
_arg1.bulletArray.push(_local9);
_arg1.isoObjectActiveArray.push(_local9);
_local10 = new Bullet_smartRocket();
_local10.x = _local5;
_local10.y = _local6;
_local10.Init(_arg1, -(movingDir.x), -(movingDir.y));
_arg1.bulletArray.push(_local10);
_arg1.isoObjectActiveArray.push(_local10);
};
break;
case 4:
if ((y - startY) > 0){
x = (x - movingDir.x);
y = (y - movingDir.y);
} else {
actionTimer = _arg1._time;
iaStatus = 5;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 5:
if ((_arg1._time - actionTimer) > sleepTime){
actionTimer = _arg1._time;
if (movingDir.x > 0){
x = 800;
movingDir.x = -1;
} else {
if (movingDir.x < 0){
x = 400;
movingDir.x = 0;
} else {
if (movingDir.x == 0){
x = -60;
movingDir.x = 1;
};
};
};
startX = x;
collisionCircle.x = x;
collisionCircle.y = y;
iaStatus = 1;
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
angleFrame = FoofaGeomUtils.Trim((FromVectorToFrameAngle(movingDir) - 1), 0, 2);
this.gotoAndPlay((frameToGo + ((frame_morte_lenght + 1) * angleFrame)));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
MemoryCrypto.incrementValue(_arg1.app.sounds, 1000);
};
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
}
}//package ThisGame
Section 72
//Granade (ThisGame.Granade)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Granade extends MovieClip {
const lifeTime:int = 2000;
const squaredRadius:int = 8000;
const flyTime:int = 1100;
public var senderIsPlayer:Boolean;
public var toDispose:Boolean;
public var flyG:DisplayObject;
public var flyGranade:MovieClip;
var speed:Number;
var dTime:int;
var vSpeed:Number;
var startTime:int;
var dir:Vector2;
var lastPos:Point;
public function Granade():void{
dir = new Vector2(0, 0);
toDispose = false;
senderIsPlayer = false;
}
public function Step(_arg1:State_InGame):void{
var _local2:BigExplosion;
var _local3:int;
var _local4:Point;
dTime = (_arg1._time - startTime);
if (dTime <= lifeTime){
vSpeed = (vSpeed + 0.3);
flyG.y = (flyG.y + vSpeed);
if (flyG.y > 0){
flyG.y = 0;
vSpeed = (-(vSpeed) * 0.5);
speed = (speed * 0.6);
};
lastPos.x = x;
lastPos.y = y;
x = (x + (dir.x * speed));
y = (y + (dir.y * speed));
ComputeSolidCollisions(_arg1);
} else {
if (dTime > lifeTime){
_local2 = new BigExplosion();
_local2.x = x;
_local2.y = y;
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = 0;
while (_local3 < _arg1.enemyActiveArray.length) {
_local4 = new Point(_arg1.enemyActiveArray[_local3].x, _arg1.enemyActiveArray[_local3].y);
if ((((_local4.x - x) * (_local4.x - x)) + ((_local4.y - y) * (_local4.y - y))) < squaredRadius){
_arg1.enemyActiveArray[_local3].OnHit(_arg1, 3);
};
_local3++;
};
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.player.OnHit(_arg1, 3);
toDispose = true;
};
_arg1.PlaySound(_arg1.weapon6_boom);
_arg1.camera.ShakingEffect(10, 10, 1);
ComputeEnemyCollisions(_arg1);
toDispose = true;
};
};
}
private function ComputeEnemyCollisions(_arg1:State_InGame):void{
var _local2:int;
if (senderIsPlayer){
_local2 = 0;
while (_local2 < _arg1.enemyActiveArray.length) {
if (_arg1.enemyActiveArray[_local2].collisionCircle.PointIsInside(x, y) == true){
toDispose = true;
};
_local2++;
};
} else {
if (_arg1.player.collisionCircle.PointIsInside(x, y) == true){
toDispose = true;
};
};
}
public function Init(_arg1:State_InGame, _arg2:Number, _arg3:Number):void{
dir.x = _arg2;
dir.y = _arg3;
startTime = _arg1._time;
flyG = this.getChildByName("flyGranade");
speed = 3.6;
vSpeed = -6;
flyG.y = -15;
lastPos = new Point();
}
private function CollisionWithRectangle(_arg1:ConvexPoly):Boolean{
return (FoofaGeomUtils.InPoly(_arg1.particles[0].toPoint(), _arg1.particles[1].toPoint(), _arg1.particles[2].toPoint(), _arg1.particles[3].toPoint(), new Point(x, y)));
}
private function ComputeSolidCollisions(_arg1:State_InGame):void{
var _local2:int;
var _local3:CollisionCircleCircle;
var _local4:Vector2;
var _local5:CollisionConvexPolyCircle;
_local2 = 0;
while (_local2 < _arg1.solidActiveArray.length) {
if ((_arg1.solidActiveArray[_local2] is CollisionCircle)){
_local3 = new CollisionCircleCircle();
if (_local3.test(_arg1.solidActiveArray[_local2].collisionCircle, new Circle(x, y, 1), lastPos) == true){
if (-(flyG.y) < _arg1.solidActiveArray[_local2].h){
_local4 = _local3.getNormal();
_local4 = FoofaGeomUtils.ReflectVectorOnLine(dir, _local4);
dir.x = _local4.x;
dir.y = _local4.y;
};
};
} else {
_local5 = new CollisionConvexPolyCircle();
if (_local5.test(_arg1.solidActiveArray[_local2].collisionPoly, new Circle(x, y, 1), lastPos) == true){
if (-(flyG.y) < _arg1.solidActiveArray[_local2].h){
_local4 = _local5.getNormal();
_local4 = FoofaGeomUtils.ReflectVectorOnLine(dir, _local4);
dir.x = _local4.x;
dir.y = _local4.y;
};
};
};
_local2++;
};
}
}
}//package ThisGame
Section 73
//GunProperties (ThisGame.GunProperties)
package ThisGame {
class GunProperties {
public var rotSpeed:Number;
public var fireRate:Number;
public var firstReloadTime:Number;
}
}//package ThisGame
Section 74
//IsoObject (ThisGame.IsoObject)
package ThisGame {
import flash.display.*;
public class IsoObject extends MovieClip {
public function IsoObject():void{
}
}
}//package ThisGame
Section 75
//Jeep (ThisGame.Jeep)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Jeep extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
public var gun:MovieClip;
var fire1Timer:Number;
var angleRad:Number;
var deadlyWeapon:int;
var frameToSkip:int;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var angleGrad:Number;
var hitTime:Number;
var frameToGo:int;
public function Jeep(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 10;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
if (x > 800){
movingDir.x = -(movingDir.x);
} else {
if (x < -100){
movingDir.x = -(movingDir.x);
};
};
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_machinegun, 0.3);
fire1Timer = _arg1._time;
_local4 = new Bullet();
_local4.x = x;
_local4.y = y;
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 1:
movingDir.x = (_arg1.player.x - x);
movingDir.y = (_arg1.player.y - y);
movingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
switch (angleFrame){
case 0:
movingDir.x = 1;
movingDir.y = 0;
break;
case 1:
movingDir.x = 1;
movingDir.y = 1;
break;
case 2:
movingDir.x = 0;
movingDir.y = 1;
break;
case 3:
movingDir.x = -1;
movingDir.y = 1;
break;
case 4:
movingDir.x = -1;
movingDir.y = 0;
break;
case 5:
movingDir.x = -1;
movingDir.y = -1;
break;
case 6:
movingDir.x = 0;
movingDir.y = -1;
break;
case 7:
movingDir.x = 1;
movingDir.y = -1;
break;
};
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 50);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame188(){
stop();
}
function frame158(){
stop();
}
function frame218(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 16);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame5(){
stop();
}
function frame38(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
function frame128(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame248(){
stop();
}
function frame68(){
stop();
}
}
}//package ThisGame
Section 76
//Jeep_dx_centre (ThisGame.Jeep_dx_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Jeep_dx_centre extends Png {
const fire1Rate:Number = 500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Jeep_dx_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 10;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = -1;
movingDir.y = 0;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((startX - x) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_machinegun, 0.3);
fire1Timer = _arg1._time;
_local4 = new Bullet();
_local4.x = x;
_local4.y = y;
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_arg1.PlaySound(_arg1.e_crash);
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 50);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 16);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 77
//Jeep_dx_sx (ThisGame.Jeep_dx_sx)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Jeep_dx_sx extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
public var gun:MovieClip;
var fire1Timer:Number;
var angleRad:Number;
var deadlyWeapon:int;
var frameToSkip:int;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var angleGrad:Number;
var hitTime:Number;
var frameToGo:int;
public function Jeep_dx_sx(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 10;
dieMode = false;
movingDir = new Vector2(-1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
if (x > 800){
movingDir.x = -(movingDir.x);
} else {
if (x < -100){
movingDir.x = -(movingDir.x);
};
};
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_machinegun, 0.3);
fire1Timer = _arg1._time;
_local4 = new Bullet();
_local4.x = x;
_local4.y = y;
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 1:
movingDir.x = (_arg1.player.x - x);
movingDir.y = (_arg1.player.y - y);
movingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
switch (angleFrame){
case 0:
movingDir.x = 1;
movingDir.y = 0;
break;
case 1:
movingDir.x = 1;
movingDir.y = 1;
break;
case 2:
movingDir.x = 0;
movingDir.y = 1;
break;
case 3:
movingDir.x = -1;
movingDir.y = 1;
break;
case 4:
movingDir.x = -1;
movingDir.y = 0;
break;
case 5:
movingDir.x = -1;
movingDir.y = -1;
break;
case 6:
movingDir.x = 0;
movingDir.y = -1;
break;
case 7:
movingDir.x = 1;
movingDir.y = -1;
break;
};
break;
};
};
if (dieMode == true){
_arg1.PlaySound(_arg1.e_crash);
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 50);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame188(){
stop();
}
function frame158(){
stop();
}
function frame218(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 16);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame5(){
stop();
}
function frame38(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
function frame128(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame248(){
stop();
}
function frame68(){
stop();
}
}
}//package ThisGame
Section 78
//Jeep_dxdown_centre (ThisGame.Jeep_dxdown_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Jeep_dxdown_centre extends Png {
const fire1Rate:Number = 500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Jeep_dxdown_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 10;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = -1;
movingDir.y = -1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) > -350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_machinegun, 0.3);
fire1Timer = _arg1._time;
_local4 = new Bullet();
_local4.x = x;
_local4.y = y;
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_arg1.PlaySound(_arg1.e_crash);
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 50);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 16);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 79
//Jeep_dxup_centre (ThisGame.Jeep_dxup_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Jeep_dxup_centre extends Png {
const fire1Rate:Number = 500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Jeep_dxup_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 10;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = -1;
movingDir.y = 1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) > -350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_machinegun, 0.3);
fire1Timer = _arg1._time;
_local4 = new Bullet();
_local4.x = x;
_local4.y = y;
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_arg1.PlaySound(_arg1.e_crash);
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 50);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 16);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 80
//Jeep_sx_centre (ThisGame.Jeep_sx_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Jeep_sx_centre extends Png {
const fire1Rate:Number = 500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Jeep_sx_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 10;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 1;
movingDir.y = 0;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_machinegun, 0.3);
fire1Timer = _arg1._time;
_local4 = new Bullet();
_local4.x = x;
_local4.y = y;
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_arg1.PlaySound(_arg1.e_crash);
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 50);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 16);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 81
//Jeep_sxdown_centre (ThisGame.Jeep_sxdown_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Jeep_sxdown_centre extends Png {
const fire1Rate:Number = 500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Jeep_sxdown_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 10;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 1;
movingDir.y = -1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) < 350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_machinegun, 0.3);
fire1Timer = _arg1._time;
_local4 = new Bullet();
_local4.x = x;
_local4.y = y;
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_arg1.PlaySound(_arg1.e_crash);
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 50);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 16);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 82
//Jeep_sxup_centre (ThisGame.Jeep_sxup_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Jeep_sxup_centre extends Png {
const fire1Rate:Number = 500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Jeep_sxup_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 10;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 1;
movingDir.y = 1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) < 350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_machinegun, 0.3);
fire1Timer = _arg1._time;
_local4 = new Bullet();
_local4.x = x;
_local4.y = y;
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_arg1.PlaySound(_arg1.e_crash);
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 50);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 16);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 83
//Locomotive (ThisGame.Locomotive)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Locomotive extends Png {
const fire1Rate:Number = 2000;
const frame_morte:int = 9;
const frame_walk:int = 1;
const fire2Rate:Number = 35;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var gun3:Vector2;
var gun1:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
var deadlyWeapon:int;
var fire1Timer:Number;
var angleRad:Number;
var gunClip3:MovieClip;
var fire3Timer:Number;
var frameToSkip:int;
var gunClip:MovieClip;
var lookingDir:Vector2;
var energy:Number;
var angleGrad:Number;
var gunClip2:MovieClip;
var frameToGo:int;
var hitTime:Number;
var fire2Timer:Number;
var gun2:Vector2;
public function Locomotive(){
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(-1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
fire1Timer = 0;
fire2Timer = 350;
fire3Timer = 700;
collisionCircle.radius = 70;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
collisionCircle.x = x;
collisionCircle.y = y;
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
this.gotoAndPlay(frameToGo);
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
};
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
return;
case 3:
energy = (energy - 21);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
}
}//package ThisGame
Section 84
//Main_Application (ThisGame.Main_Application)
package ThisGame {
import flash.display.*;
import FoofaCore.*;
import flash.events.*;
import flash.media.*;
import com.electrotank.util.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
public class Main_Application extends FoofaApplication {
public var maxLevel:Number;
public var bridge:Sound;
public var sounds:String;// = "bkg.wav"
public var thisLevel:Number;
public var killCount:int;
public var menuMusic:Sound;
public var sound:Boolean;
public var gameMusic:Sound;
public var bridgeMusic:Sound;
public var musicVolume;
public var points:Number;
public var music:Boolean;
var g_UrlLoader:URLLoader;// = null
private var so:SharedObject;
public var musicChannel:SoundChannel;
public var nextMusic:Sound;
public static const maxGunCount:Number = 11;
public static var ammoInfoArray:Array;
public function Main_Application():void{
var _local1:Number;
sounds = "bkg.wav";
g_UrlLoader = null;
super();
points = 0;
thisLevel = 1;
maxLevel = 6;
music = true;
sound = true;
musicVolume = 1;
MemoryCrypto.setValue(sounds, 0);
Load();
_local1 = 0;
}
private function soundCompleteHandler(_arg1:Event):void{
if (bridge == null){
musicChannel = nextMusic.play(0, 1, new SoundTransform(musicVolume));
} else {
musicChannel = bridge.play(0, 1, new SoundTransform(musicVolume));
bridge = null;
};
musicChannel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
}
function random(_arg1:int):int{
return (int((Math.random() * _arg1)));
}
public function InitMusics():void{
}
public function Save():void{
var _local1:Number;
if (ammoInfoArray.length == maxGunCount){
so = SharedObject.getLocal("fith");
so.data.thisLevel = thisLevel;
so.data.ammos = new Array(maxGunCount);
_local1 = 0;
while (_local1 < maxGunCount) {
so.data.ammos[_local1] = new AmmoInfo();
so.data.ammos[_local1].gunEnabled = ammoInfoArray[_local1].gunEnabled;
so.data.ammos[_local1].ammoCount = ammoInfoArray[_local1].ammoCount;
so.data.ammos[_local1].maxCount = ammoInfoArray[_local1].maxCount;
_local1++;
};
so.flush();
};
}
public function Load():void{
var _local1:Number;
so = SharedObject.getLocal("fith");
if (((((!((so.data.thisLevel == null))) && (!((so.data.ammos == null))))) && ((so.data.ammos.length == maxGunCount)))){
ammoInfoArray = new Array(maxGunCount);
thisLevel = so.data.thisLevel;
_local1 = 0;
while (_local1 < maxGunCount) {
ammoInfoArray[_local1] = new AmmoInfo();
ammoInfoArray[_local1].gunEnabled = so.data.ammos[_local1].gunEnabled;
ammoInfoArray[_local1].ammoCount = so.data.ammos[_local1].ammoCount;
ammoInfoArray[_local1].maxCount = so.data.ammos[_local1].maxCount;
_local1++;
};
} else {
ammoInfoArray = new Array(maxGunCount);
thisLevel = 1;
};
}
public function goToUrl(_arg1:String):void{
var success:Boolean;
var url = _arg1;
success = false;
if (((ExternalInterface.available) && (!((Capabilities.playerType == "External"))))){
try {
ExternalInterface.call("window.open", url, "win", "");
success = true;
} catch(error:Error) {
} catch(error:SecurityError) {
};
};
if (success != true){
navigateToURL(new URLRequest(url), "_BLANK");
};
}
public function ChangeMusic(_arg1:Sound):void{
bridge = null;
nextMusic = _arg1;
if (musicChannel != null){
musicChannel.stop();
};
musicChannel = _arg1.play(0, 1, new SoundTransform(musicVolume));
musicChannel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
}
public function submitOurScore(_arg1:String, _arg2:uint, _arg3:Function):Boolean{
var allOk:Boolean;
var url_data:*;
var url:URLRequest;
var url_loader:URLLoader;
var playerName = _arg1;
var playerScore = _arg2;
var onErrorFunction = _arg3;
allOk = true;
url_data = new URLVariables();
url_data.name = playerName;
url_data.score = playerScore;
url_data.gameId = "279";
url_data.gameVersion = "1.0";
url_data.key = (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((random(5).toString() + random(6).toString()) + random(7).toString()) + random(4).toString()) + random(7).toString()) + random(6).toString()) + random(4).toString()) + random(7).toString()) + random(9).toString()) + random(1).toString()) + random(1).toString()) + random(0).toString()) + random(4).toString()) + random(4).toString()) + random(2).toString()) + random(1).toString()) + random(8).toString()) + random(1).toString()) + random(5).toString()) + random(4).toString()) + random(3).toString()) + random(1).toString()) + random(9).toString()) + random(3).toString()) + random(2).toString()) + random(5).toString()) + random(6).toString()) + random(5).toString()) + random(3).toString()) + random(7).toString()) + random(5).toString()) + random(8).toString()) + random(4).toString()) + random(3).toString()) + random(3).toString()) + random(2).toString()) + random(9).toString()) + random(7).toString()) + random(9).toString()) + random(8).toString()) + random(8).toString()) + random(0).toString()) + random(9).toString()) + random(2).toString()) + random(5).toString()) + random(2).toString()) + random(4).toString()) + random(3).toString()) + random(4).toString()) + random(0).toString()) + random(8).toString()) + random(8).toString()) + random(1).toString()) + random(8).toString()) + random(1).toString()) + random(3).toString()) + random(3).toString()) + random(8).toString()) + random(9).toString()) + random(7).toString()) + random(5).toString()) + random(5).toString()) + random(6).toString()) + random(0).toString()) + random(8).toString()) + random(9).toString()) + random(2).toString()) + random(8).toString()) + random(6).toString()) + random(1).toString()) + random(6).toString()) + random(5).toString()) + random(2).toString()) + random(6).toString()) + random(8).toString()) + random(8).toString()) + random(8).toString()) + random(2).toString()) + random(2).toString()) + random(2).toString()) + random(3).toString()) + random(0).toString()) + random(0).toString()) + random(5).toString()) + random(9).toString()) + random(2).toString()) + random(9).toString()) + random(2).toString()) + random(0).toString()) + random(8).toString()) + random(0).toString()) + random(6).toString()) + random(4).toString()) + random(6).toString()) + random(6).toString()) + random(3).toString()) + random(5).toString()) + random(9).toString()) + random(1).toString()) + random(2).toString()) + random(0).toString()) + random(8).toString()) + random(7).toString()) + random(3).toString()) + random(4).toString()) + random(6).toString()) + random(1).toString()) + random(3).toString()) + random(9).toString()) + random(3).toString()) + random(6).toString()) + random(2).toString()) + random(4).toString()) + random(7).toString()) + random(8).toString()) + random(3).toString()) + random(9).toString()) + random(7).toString()) + random(6).toString()) + random(0).toString()) + random(6).toString()) + random(6).toString()) + random(6).toString()) + random(0).toString()) + random(2).toString()) + random(3).toString()) + random(3).toString()) + random(8).toString());
url = new URLRequest("http://scores.crazymonkeygames.com/hs/regscores.php");
url.method = URLRequestMethod.POST;
url.data = url_data;
url_loader = new URLLoader();
g_UrlLoader = url_loader;
url_loader.addEventListener("complete", function (_arg1:Event){
var _local2:URLVariables;
_local2 = new URLVariables(url_loader.data.replace("&", ""));
if (_local2.ok == 1){
goToUrl("http://scores.crazymonkeygames.com/hs/listscores.php?id=279");
} else {
if (_local2.ok == 0){
} else {
if (_local2.ok == 2){
goToUrl("http://scores.crazymonkeygames.com/hs/pleaseupdate.php");
};
};
};
});
url_loader.addEventListener("ioError", onErrorFunction);
url_loader.load(url);
return (allOk);
}
public function GotoPlayState(_arg1:DisplayObjectContainer):void{
var _local2:MovieClip;
var _local3:Number;
switch (thisLevel){
case 0:
case 1:
_local3 = 0;
while (_local3 < Main_Application.ammoInfoArray.length) {
Main_Application.ammoInfoArray[_local3] = new AmmoInfo();
Main_Application.ammoInfoArray[_local3].gunEnabled = false;
Main_Application.ammoInfoArray[_local3].ammoCount = 0;
Main_Application.ammoInfoArray[_local3].maxCount = 999;
_local3++;
};
Main_Application.ammoInfoArray[1].gunEnabled = true;
Main_Application.ammoInfoArray[6].gunEnabled = true;
Main_Application.ammoInfoArray[1].ammoCount = 999;
Main_Application.ammoInfoArray[6].ammoCount = 10;
_local2 = MovieClip(new Level_1());
break;
case 2:
_local2 = MovieClip(new Level_2());
break;
case 3:
_local2 = MovieClip(new Level_3());
break;
case 4:
_local2 = MovieClip(new Level_4());
break;
case 5:
_local2 = MovieClip(new Level_5());
break;
case 6:
_local2 = MovieClip(new Level_6());
break;
};
Save();
ChangeState(new State_InGame(this, _arg1, _local2));
_local2 = null;
}
}
}//package ThisGame
Section 85
//Medipack (ThisGame.Medipack)
package ThisGame {
import flash.display.*;
public class Medipack extends MovieClip {
const packValue:Number = 20;
const squaredRadius:Number = 200;
public var toDispose:Boolean;
public function Medipack():void{
toDispose = false;
}
public function Step(_arg1:State_InGame):void{
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.player.energy = (_arg1.player.energy + packValue);
if (_arg1.player.energy > _arg1.player.maxEnergy){
_arg1.player.energy = _arg1.player.maxEnergy;
};
toDispose = true;
};
}
}
}//package ThisGame
Section 86
//Mine (ThisGame.Mine)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Mine extends MovieClip {
const squaredRadius:int = 8000;
const squaredActivationRadius:int = 400;
public var senderIsPlayer:Boolean;
var kabooming:Boolean;
public var toDispose:Boolean;
var vSpeed:Number;
var startTime:int;
public function Mine():void{
toDispose = false;
senderIsPlayer = false;
kabooming = false;
}
public function Step(_arg1:State_InGame):void{
var _local2:BigExplosion;
var _local3:int;
var _local4:Point;
if (kabooming == false){
ComputeEnemyCollisions(_arg1);
} else {
_local2 = new BigExplosion();
_local2.x = x;
_local2.y = y;
_local2.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local2);
_arg1.isoObjectActiveArray.push(_local2);
_local3 = 0;
while (_local3 < _arg1.enemyActiveArray.length) {
_local4 = new Point(_arg1.enemyActiveArray[_local3].x, _arg1.enemyActiveArray[_local3].y);
if ((((_local4.x - x) * (_local4.x - x)) + ((_local4.y - y) * (_local4.y - y))) < squaredRadius){
_arg1.enemyActiveArray[_local3].OnHit(_arg1, 3);
};
_local3++;
};
if ((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredRadius){
_arg1.player.OnHit(_arg1, 3);
};
_arg1.PlaySound(_arg1.weapon6_boom);
_arg1.camera.ShakingEffect(10, 10, 1);
toDispose = true;
};
}
private function ComputeEnemyCollisions(_arg1:State_InGame):void{
var _local2:int;
var _local3:Point;
if (senderIsPlayer){
_local2 = 0;
while (_local2 < _arg1.enemyActiveArray.length) {
_local3 = new Point(_arg1.enemyActiveArray[_local2].x, _arg1.enemyActiveArray[_local2].y);
if ((((_local3.x - x) * (_local3.x - x)) + ((_local3.y - y) * (_local3.y - y))) < squaredActivationRadius){
kabooming = true;
};
_local2++;
};
if (((((_arg1._time - startTime) > 3000)) && (((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) < squaredActivationRadius)))){
kabooming = true;
};
};
}
public function Init(_arg1:State_InGame, _arg2:Number=0, _arg3:Number=0):void{
startTime = _arg1._time;
}
}
}//package ThisGame
Section 87
//Panzer1_dx_centre (ThisGame.Panzer1_dx_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer1_dx_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer1_dx_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 30;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = -1;
movingDir.y = 0;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((startX - x) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 88
//Panzer1_dx_sx (ThisGame.Panzer1_dx_sx)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer1_dx_sx extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
public var gun:MovieClip;
var fire1Timer:Number;
var angleRad:Number;
var deadlyWeapon:int;
var frameToSkip:int;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var angleGrad:Number;
var hitTime:Number;
var frameToGo:int;
public function Panzer1_dx_sx(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 30;
dieMode = false;
movingDir = new Vector2(-1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
if (x > 800){
movingDir.x = -(movingDir.x);
} else {
if (x < -100){
movingDir.x = -(movingDir.x);
};
};
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 1:
movingDir.x = (_arg1.player.x - x);
movingDir.y = (_arg1.player.y - y);
movingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
switch (angleFrame){
case 0:
movingDir.x = 1;
movingDir.y = 0;
break;
case 1:
movingDir.x = 1;
movingDir.y = 1;
break;
case 2:
movingDir.x = 0;
movingDir.y = 1;
break;
case 3:
movingDir.x = -1;
movingDir.y = 1;
break;
case 4:
movingDir.x = -1;
movingDir.y = 0;
break;
case 5:
movingDir.x = -1;
movingDir.y = -1;
break;
case 6:
movingDir.x = 0;
movingDir.y = -1;
break;
case 7:
movingDir.x = 1;
movingDir.y = -1;
break;
};
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame188(){
stop();
}
function frame158(){
stop();
}
function frame218(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
return;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame5(){
stop();
}
function frame38(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
function frame128(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame248(){
stop();
}
function frame68(){
stop();
}
}
}//package ThisGame
Section 89
//Panzer1_dxdown_centre (ThisGame.Panzer1_dxdown_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer1_dxdown_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer1_dxdown_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 30;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = -1;
movingDir.y = -1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((startX - x) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 90
//Panzer1_dxup_centre (ThisGame.Panzer1_dxup_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer1_dxup_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer1_dxup_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 30;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = -1;
movingDir.y = 1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((startX - x) < 350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 91
//Panzer1_sx_centre (ThisGame.Panzer1_sx_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer1_sx_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer1_sx_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 30;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 1;
movingDir.y = 0;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 92
//Panzer1_sx_dx (ThisGame.Panzer1_sx_dx)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer1_sx_dx extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
public var gun:MovieClip;
var fire1Timer:Number;
var angleRad:Number;
var deadlyWeapon:int;
var frameToSkip:int;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var angleGrad:Number;
var hitTime:Number;
var frameToGo:int;
public function Panzer1_sx_dx(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 30;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
if (x > 800){
movingDir.x = -(movingDir.x);
} else {
if (x < -100){
movingDir.x = -(movingDir.x);
};
};
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 1:
movingDir.x = (_arg1.player.x - x);
movingDir.y = (_arg1.player.y - y);
movingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
switch (angleFrame){
case 0:
movingDir.x = 1;
movingDir.y = 0;
break;
case 1:
movingDir.x = 1;
movingDir.y = 1;
break;
case 2:
movingDir.x = 0;
movingDir.y = 1;
break;
case 3:
movingDir.x = -1;
movingDir.y = 1;
break;
case 4:
movingDir.x = -1;
movingDir.y = 0;
break;
case 5:
movingDir.x = -1;
movingDir.y = -1;
break;
case 6:
movingDir.x = 0;
movingDir.y = -1;
break;
case 7:
movingDir.x = 1;
movingDir.y = -1;
break;
};
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame188(){
stop();
}
function frame158(){
stop();
}
function frame218(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
return;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame5(){
stop();
}
function frame38(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
function frame128(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame248(){
stop();
}
function frame68(){
stop();
}
}
}//package ThisGame
Section 93
//Panzer1_sxdown_centre (ThisGame.Panzer1_sxdown_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer1_sxdown_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer1_sxdown_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 30;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 1;
movingDir.y = -1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) < 350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 94
//Panzer1_sxup_centre (ThisGame.Panzer1_sxup_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer1_sxup_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer1_sxup_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 30;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 1;
movingDir.y = 1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) < 350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 95
//Panzer1_up_centre (ThisGame.Panzer1_up_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer1_up_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer1_up_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 30;
dieMode = false;
movingDir = new Vector2(0, 1);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 0;
movingDir.y = 1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((y - startY) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 11);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 96
//Panzer2_dx_centre (ThisGame.Panzer2_dx_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer2_dx_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer2_dx_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = -1;
movingDir.y = 0;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((startX - x) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 21);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 97
//Panzer2_dx_sx (ThisGame.Panzer2_dx_sx)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer2_dx_sx extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
public var gun:MovieClip;
var fire1Timer:Number;
var angleRad:Number;
var deadlyWeapon:int;
var frameToSkip:int;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var angleGrad:Number;
var hitTime:Number;
var frameToGo:int;
public function Panzer2_dx_sx(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(-1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
if (x > 800){
movingDir.x = -(movingDir.x);
} else {
if (x < -100){
movingDir.x = -(movingDir.x);
};
};
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 1:
movingDir.x = (_arg1.player.x - x);
movingDir.y = (_arg1.player.y - y);
movingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
switch (angleFrame){
case 0:
movingDir.x = 1;
movingDir.y = 0;
break;
case 1:
movingDir.x = 1;
movingDir.y = 1;
break;
case 2:
movingDir.x = 0;
movingDir.y = 1;
break;
case 3:
movingDir.x = -1;
movingDir.y = 1;
break;
case 4:
movingDir.x = -1;
movingDir.y = 0;
break;
case 5:
movingDir.x = -1;
movingDir.y = -1;
break;
case 6:
movingDir.x = 0;
movingDir.y = -1;
break;
case 7:
movingDir.x = 1;
movingDir.y = -1;
break;
};
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame188(){
stop();
}
function frame158(){
stop();
}
function frame218(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
return;
case 3:
energy = (energy - 21);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame5(){
stop();
}
function frame38(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
function frame128(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame248(){
stop();
}
function frame68(){
stop();
}
}
}//package ThisGame
Section 98
//Panzer2_dxdown_centre (ThisGame.Panzer2_dxdown_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer2_dxdown_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer2_dxdown_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = -1;
movingDir.y = -1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((startX - x) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 21);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 99
//Panzer2_dxup_centre (ThisGame.Panzer2_dxup_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer2_dxup_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer2_dxup_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 10;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = -1;
movingDir.y = 1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((startX - x) < 350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 16);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 100
//Panzer2_sx_centre (ThisGame.Panzer2_sx_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer2_sx_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer2_sx_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 1;
movingDir.y = 0;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy--;
break;
case 3:
energy = (energy - 21);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 101
//Panzer2_sx_dx (ThisGame.Panzer2_sx_dx)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer2_sx_dx extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
public var gun:MovieClip;
var fire1Timer:Number;
var angleRad:Number;
var deadlyWeapon:int;
var frameToSkip:int;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var angleGrad:Number;
var hitTime:Number;
var frameToGo:int;
public function Panzer2_sx_dx(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
if (x > 800){
movingDir.x = -(movingDir.x);
} else {
if (x < -100){
movingDir.x = -(movingDir.x);
};
};
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 1:
movingDir.x = (_arg1.player.x - x);
movingDir.y = (_arg1.player.y - y);
movingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
switch (angleFrame){
case 0:
movingDir.x = 1;
movingDir.y = 0;
break;
case 1:
movingDir.x = 1;
movingDir.y = 1;
break;
case 2:
movingDir.x = 0;
movingDir.y = 1;
break;
case 3:
movingDir.x = -1;
movingDir.y = 1;
break;
case 4:
movingDir.x = -1;
movingDir.y = 0;
break;
case 5:
movingDir.x = -1;
movingDir.y = -1;
break;
case 6:
movingDir.x = 0;
movingDir.y = -1;
break;
case 7:
movingDir.x = 1;
movingDir.y = -1;
break;
};
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame188(){
stop();
}
function frame158(){
stop();
}
function frame218(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
return;
case 3:
energy = (energy - 21);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame5(){
stop();
}
function frame38(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
function frame128(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame248(){
stop();
}
function frame68(){
stop();
}
}
}//package ThisGame
Section 102
//Panzer2_sxdown_centre (ThisGame.Panzer2_sxdown_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer2_sxdown_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer2_sxdown_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 1;
movingDir.y = -1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) < 350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 21);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 103
//Panzer2_sxup_centre (ThisGame.Panzer2_sxup_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer2_sxup_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer2_sxup_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 1;
movingDir.y = 1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((x - startX) < 350){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 21);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 104
//Panzer2_up_centre (ThisGame.Panzer2_up_centre)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Panzer2_up_centre extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
var angleGunFrame:Number;
var refVec:Vector2;
var startTimer:Number;
var startY:Number;
var startX:Number;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var hitTime:Number;
var iaStatus:int;
public var gun:MovieClip;
var movingDir:Vector2;
var fire1Timer:Number;
var angleGrad:Number;
var frameToGo:int;
public function Panzer2_up_centre(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 37, frame38, 67, frame68, 97, frame98, 127, frame128, 157, frame158, 187, frame188, 217, frame218, 247, frame248);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(0, 1);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
startX = 0;
startY = 0;
}
function frame158(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame188(){
stop();
}
function frame4(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame38(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
startTimer = _arg1._time;
iaStatus = 1;
movingDir.x = 0;
movingDir.y = 1;
collisionCircle.x = x;
collisionCircle.y = y;
startX = x;
startY = y;
break;
case 1:
if ((_arg1._time - startTimer) > 2500){
iaStatus = 2;
};
break;
case 2:
if ((y - startY) < 400){
if (_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] != id){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
};
x = (x + movingDir.x);
y = (y + movingDir.y);
} else {
iaStatus = 3;
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 3:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon1, 0.3);
_local4 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local5 = (x + (Math.sin(_local4) * 20));
_local6 = (y + (Math.cos(_local4) * 20));
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, lookingDir.x, lookingDir.y);
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.1)), Math.cos((_local4 + 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.1)), Math.cos((_local4 - 0.1)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 + 0.05)), Math.cos((_local4 + 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
_local7 = new Bullet();
_local7.x = _local5;
_local7.y = _local6;
_local7.Init(_arg1, Math.sin((_local4 - 0.05)), Math.cos((_local4 - 0.05)));
_local7.flyHighBullet = true;
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 100);
};
_arg1.lastDeathTime = _arg1._time;
};
}
function frame68(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
break;
case 3:
energy = (energy - 21);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame98(){
stop();
}
function frame218(){
stop();
}
function frame248(){
stop();
}
function frame128(){
stop();
}
}
}//package ThisGame
Section 105
//Player (ThisGame.Player)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class Player extends MovieClip {
const frame_morte_bruciato_lenght:int = 0;
const frame_walk_start:Number = 1;
const frame_morte_esplosione1:int = 91;
const frame_stand:Number = 13;
const frame_morte_colpo1:int = 58;
const frame_walk_lenght:Number = 35;
const frame_sequence_lenght:Number = 156;
const maxGunCount:Number = 11;
const maxEnergy:Number = 30;
const frame_morte_esplosione1_lenght:int = 66;
const frame_morte_bruciato:int = 124;
const frame_morte_colpo1_lenght:int = 33;
const walkSpeed:Number = 5;
var fireAngleGrad:Number;
var fire1Rate:Number;
public var dieMode:Boolean;
var godModeTimer:Number;
var angleRad:Number;
var deadlyWeapon:int;
public var selectedWeapon2:Number;
var reloadTimer2:Number;
var reloadTimer1:Number;
var energy:Number;
public var selectedWeapon:Number;
public var collisionCircle:Circle;
var lookingDir:Vector2;
var fire1Pressed:Boolean;
var hitTime:Number;
var weaponRotatingSpeed:Number;
var ammoInfoArray:Array;
var movingDir:Vector2;
var fire1Timer:Number;
public var dieTime:Number;
var walking:Boolean;
var fire2Rate:Number;
var angleGrad:Number;
var fire2Pressed:Boolean;
var frameDir:int;
var fire2Timer:Number;
var lastFireThrowerTime:Number;
public function Player():void{
movingDir = new Vector2(0, -1);
lookingDir = new Vector2(0, -1);
angleRad = 0;
angleGrad = 0;
fireAngleGrad = 180;
fire1Pressed = false;
fire1Timer = 0;
fire2Pressed = false;
fire2Timer = 0;
selectedWeapon = 0;
selectedWeapon2 = 0;
godModeTimer = 0;
weaponRotatingSpeed = 5;
collisionCircle = new Circle(x, y, 15);
reloadTimer1 = 0;
ammoInfoArray = Main_Application.ammoInfoArray;
energy = maxEnergy;
hitTime = 0;
lastFireThrowerTime = 0;
}
public function SelectWeapon(_arg1:Number):Boolean{
var _local2:GunProperties;
if (ammoInfoArray[_arg1].gunEnabled == false){
return (false);
};
if (_arg1 < 6){
if (selectedWeapon != _arg1){
_local2 = WeaponFactory.GetWeaponProperties(_arg1);
selectedWeapon = _arg1;
fire1Rate = _local2.fireRate;
reloadTimer1 = _local2.firstReloadTime;
weaponRotatingSpeed = _local2.rotSpeed;
};
} else {
if (selectedWeapon2 != _arg1){
_local2 = WeaponFactory.GetWeaponProperties(_arg1);
selectedWeapon2 = _arg1;
fire2Rate = _local2.fireRate;
reloadTimer2 = _local2.firstReloadTime;
weaponRotatingSpeed = _local2.rotSpeed;
};
};
return (true);
}
public function UpdateInput(_arg1:Boolean, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean, _arg7:Boolean):void{
if (dieMode == true){
return;
};
if ((((_arg3 == true)) && ((_arg4 == true)))){
_arg3 = false;
_arg4 = false;
} else {
if ((((_arg1 == true)) && ((_arg2 == true)))){
_arg1 = false;
_arg2 = false;
} else {
if ((((_arg3 == true)) && ((_arg1 == true)))){
movingDir.x = -0.5;
movingDir.y = -0.5;
} else {
if ((((_arg4 == true)) && ((_arg1 == true)))){
movingDir.x = 0.5;
movingDir.y = -0.5;
} else {
if ((((_arg3 == true)) && ((_arg2 == true)))){
movingDir.x = -0.5;
movingDir.y = 0.5;
} else {
if ((((_arg4 == true)) && ((_arg2 == true)))){
movingDir.x = 0.5;
movingDir.y = 0.5;
} else {
if (_arg3 == true){
movingDir.x = -0.707;
movingDir.y = 0;
} else {
if (_arg4 == true){
movingDir.x = 0.707;
movingDir.y = 0;
} else {
if (_arg1 == true){
movingDir.x = 0;
movingDir.y = -0.707;
} else {
if (_arg2 == true){
movingDir.x = 0;
movingDir.y = 0.707;
};
};
};
};
};
};
};
};
};
};
if (_arg7 == false){
lookingDir.x = movingDir.x;
lookingDir.y = movingDir.y;
};
walking = false;
if ((((((((_arg3 == true)) || ((_arg4 == true)))) || ((_arg1 == true)))) || ((_arg2 == true)))){
x = (x + (movingDir.x * walkSpeed));
y = (y + (movingDir.y * walkSpeed));
walking = true;
};
angleRad = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
fire1Pressed = _arg5;
fire2Pressed = _arg6;
}
private function UpdateCollisionBounds(){
collisionCircle.vx = (x - collisionCircle.x);
collisionCircle.vy = (y - collisionCircle.y);
collisionCircle.x = x;
collisionCircle.y = y;
}
public function Fire(_arg1:State_InGame, _arg2:Number):void{
var _local3:Bullet;
var _local4:Bullet_fire;
var _local5:Bullet_rocket;
var _local6:GranadeMovie;
var _local7:FireGranade;
var _local8:MineMovie;
var _local9:B52Movie;
var _local10:Artillery;
if ((((ammoInfoArray[_arg2].ammoCount > 0)) || ((_arg2 == 1)))){
if (_arg2 != 1){
ammoInfoArray[_arg2].ammoCount--;
};
switch (_arg2){
case 1:
_arg1.PlaySound(_arg1.weapon1_fire);
fire1Timer = _arg1._time;
_local3 = new Bullet();
_local3.senderIsPlayer = true;
_local3.x = (x - (Math.sin(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.y = (y + (Math.cos(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.Init(_arg1, -(Math.sin(((fireAngleGrad * Math.PI) / 180))), Math.cos(((fireAngleGrad * Math.PI) / 180)));
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
break;
case 2:
_arg1.PlaySound(_arg1.weapon2_fire);
fire1Timer = _arg1._time;
_local3 = new Bullet();
_local3.senderIsPlayer = true;
_local3.x = (x - (Math.sin(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.y = (y + (Math.cos(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.Init(_arg1, -(Math.sin(((fireAngleGrad * Math.PI) / 180))), Math.cos(((fireAngleGrad * Math.PI) / 180)));
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
break;
case 3:
_arg1.PlaySound(_arg1.weapon3_fire);
fire1Timer = _arg1._time;
_local3 = new Bullet();
_local3.senderIsPlayer = true;
_local3.x = (x - (Math.sin(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.y = (y + (Math.cos(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.Init(_arg1, -(Math.sin(((fireAngleGrad * Math.PI) / 180))), Math.cos(((fireAngleGrad * Math.PI) / 180)));
_local3.lifeTime = 500;
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local3 = new Bullet();
_local3.senderIsPlayer = true;
_local3.x = (x - (Math.sin(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.y = (y + (Math.cos(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.Init(_arg1, -(Math.sin((((fireAngleGrad + 5) * Math.PI) / 180))), Math.cos((((fireAngleGrad + 5) * Math.PI) / 180)));
_local3.lifeTime = 500;
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local3 = new Bullet();
_local3.senderIsPlayer = true;
_local3.x = (x - (Math.sin(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.y = (y + (Math.cos(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.Init(_arg1, -(Math.sin((((fireAngleGrad - 5) * Math.PI) / 180))), Math.cos((((fireAngleGrad - 5) * Math.PI) / 180)));
_local3.lifeTime = 500;
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local3 = new Bullet();
_local3.senderIsPlayer = true;
_local3.x = (x - (Math.sin(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.y = (y + (Math.cos(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.Init(_arg1, -(Math.sin((((fireAngleGrad + 10) * Math.PI) / 180))), Math.cos((((fireAngleGrad + 10) * Math.PI) / 180)));
_local3.lifeTime = 500;
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
_local3 = new Bullet();
_local3.senderIsPlayer = true;
_local3.x = (x - (Math.sin(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.y = (y + (Math.cos(((fireAngleGrad * Math.PI) / 180)) * 20));
_local3.Init(_arg1, -(Math.sin((((fireAngleGrad - 10) * Math.PI) / 180))), Math.cos((((fireAngleGrad - 10) * Math.PI) / 180)));
_local3.lifeTime = 500;
_arg1.bulletArray.push(_local3);
_arg1.isoObjectActiveArray.push(_local3);
break;
case 4:
if ((_arg1._time - lastFireThrowerTime) > 1000){
_arg1.PlaySound(_arg1.weapon4_fire);
lastFireThrowerTime = _arg1._time;
};
fire1Timer = _arg1._time;
_local4 = new Bullet_fire();
_local4.senderIsPlayer = true;
_local4.x = (x - (Math.sin(((fireAngleGrad * Math.PI) / 180)) * 20));
_local4.y = (y + (Math.cos(((fireAngleGrad * Math.PI) / 180)) * 20));
_local4.Init(_arg1, -(Math.sin(((fireAngleGrad * Math.PI) / 180))), Math.cos(((fireAngleGrad * Math.PI) / 180)));
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
break;
case 5:
_arg1.PlaySound(_arg1.weapon5_fire);
fire1Timer = _arg1._time;
_local5 = new Bullet_rocket();
_local5.senderIsPlayer = true;
_local5.x = (x - (Math.sin(((fireAngleGrad * Math.PI) / 180)) * 20));
_local5.y = (y + (Math.cos(((fireAngleGrad * Math.PI) / 180)) * 20));
_local5.Init(_arg1, -(Math.sin(((fireAngleGrad * Math.PI) / 180))), Math.cos(((fireAngleGrad * Math.PI) / 180)));
_arg1.bulletArray.push(_local5);
_arg1.isoObjectActiveArray.push(_local5);
break;
case 6:
fire2Timer = _arg1._time;
_local6 = new GranadeMovie();
_local6.senderIsPlayer = true;
_local6.x = x;
_local6.y = y;
_local6.Init(_arg1, -(Math.sin(((fireAngleGrad * Math.PI) / 180))), Math.cos(((fireAngleGrad * Math.PI) / 180)));
_arg1.bulletArray.push(_local6);
_arg1.isoObjectActiveArray.push(_local6);
break;
case 7:
fire2Timer = _arg1._time;
_local7 = new FireGranade();
_local7.senderIsPlayer = true;
_local7.x = x;
_local7.y = y;
_local7.Init(_arg1, -(Math.sin(((fireAngleGrad * Math.PI) / 180))), Math.cos(((fireAngleGrad * Math.PI) / 180)));
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
break;
case 8:
fire2Timer = _arg1._time;
_local8 = new MineMovie();
_local8.senderIsPlayer = true;
_local8.x = x;
_local8.y = y;
_local8.Init(_arg1, 0, 0);
_arg1.bulletArray.push(_local8);
_arg1.isoObjectActiveArray.push(_local8);
break;
case 9:
fire2Timer = _arg1._time;
_local9 = new B52Movie();
_local9.senderIsPlayer = true;
_local9.x = (x + 350);
_local9.y = (y + 550);
_local9.Init(_arg1, -0.3, -0.8);
_local9.y = (y + 850);
_arg1.bulletArray.push(_local9);
_arg1.worldObject.addChild(_local9);
_arg1.isoObjectActiveArray.push(_local9);
break;
case 10:
fire2Timer = _arg1._time;
_local10 = new Artillery();
_local10.senderIsPlayer = true;
_local10.x = (x + 350);
_local10.y = (y + 550);
_local10.Init(_arg1, -0.3, -0.8);
_arg1.bulletArray.push(_local10);
break;
};
} else {
switch (_arg2){
case 2:
case 3:
case 4:
case 5:
fire1Timer = _arg1._time;
_arg1.PlaySound(_arg1.fai_cilecca);
break;
case 6:
case 7:
case 8:
case 9:
fire2Timer = _arg1._time;
_arg1.PlaySound(_arg1.fai_cilecca);
break;
};
};
}
public function AddAmmo(_arg1:State_InGame, _arg2:int, _arg3:int):void{
if (ammoInfoArray[_arg2].gunEnabled == false){
ammoInfoArray[_arg2].gunEnabled = true;
_arg1.gui_weaponPopup.getChildByName("weapon_2").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_3").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_4").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_5").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_7").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_8").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_9").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_10").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_2").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_3").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_4").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_5").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_6").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_7").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_8").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_9").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_10").visible = false;
switch (_arg2){
case 2:
_arg1.gui_weaponPopup.getChildByName("weapon_2").visible = true;
break;
case 3:
_arg1.gui_weaponPopup.getChildByName("weapon_3").visible = true;
break;
case 4:
_arg1.gui_weaponPopup.getChildByName("weapon_4").visible = true;
break;
case 5:
_arg1.gui_weaponPopup.getChildByName("weapon_5").visible = true;
break;
case 7:
_arg1.gui_weaponPopup.getChildByName("weapon_7").visible = true;
break;
case 8:
_arg1.gui_weaponPopup.getChildByName("weapon_8").visible = true;
break;
case 9:
_arg1.gui_weaponPopup.getChildByName("weapon_9").visible = true;
break;
case 10:
_arg1.gui_weaponPopup.getChildByName("weapon_10").visible = true;
break;
};
_arg1.ShowWeaponPopup();
} else {
_arg1.gui_weaponPopup.getChildByName("recharge_2").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_3").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_4").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_5").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_6").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_7").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_8").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_9").visible = false;
_arg1.gui_weaponPopup.getChildByName("recharge_10").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_2").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_3").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_4").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_5").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_7").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_8").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_9").visible = false;
_arg1.gui_weaponPopup.getChildByName("weapon_10").visible = false;
switch (_arg2){
case 2:
_arg1.gui_weaponPopup.getChildByName("recharge_2").visible = true;
break;
case 3:
_arg1.gui_weaponPopup.getChildByName("recharge_3").visible = true;
break;
case 4:
_arg1.gui_weaponPopup.getChildByName("recharge_4").visible = true;
break;
case 5:
_arg1.gui_weaponPopup.getChildByName("recharge_5").visible = true;
break;
case 6:
_arg1.gui_weaponPopup.getChildByName("recharge_6").visible = trace;
break;
case 7:
_arg1.gui_weaponPopup.getChildByName("recharge_7").visible = true;
break;
case 8:
_arg1.gui_weaponPopup.getChildByName("recharge_8").visible = true;
break;
case 9:
_arg1.gui_weaponPopup.getChildByName("recharge_9").visible = true;
break;
case 10:
_arg1.gui_weaponPopup.getChildByName("recharge_10").visible = true;
break;
};
_arg1.ShowWeaponPopup();
};
ammoInfoArray[_arg2].ammoCount = (ammoInfoArray[_arg2].ammoCount + _arg3);
if (ammoInfoArray[_arg2].ammoCount > ammoInfoArray[_arg2].maxCount){
ammoInfoArray[_arg2].ammoCount = ammoInfoArray[_arg2].maxCount;
};
}
public function Step(_arg1:State_InGame):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:int;
var _local6:ColorTransform;
if (reloadTimer1 > 0){
reloadTimer1--;
};
if (reloadTimer2 > 0){
reloadTimer2--;
};
if ((((dieMode == true)) || (((_arg1._time - hitTime) > 100)))){
_local6 = new ColorTransform();
this.transform.colorTransform = _local6;
_local6 = null;
};
if (dieMode == true){
return;
};
angleGrad = ((-(angleRad) * 180) / Math.PI);
angleGrad = (angleGrad % 360);
while (angleGrad < 0) {
angleGrad = (angleGrad + 360);
};
fireAngleGrad = (fireAngleGrad % 360);
while (fireAngleGrad < 0) {
fireAngleGrad = (fireAngleGrad + 360);
};
_local2 = (fireAngleGrad - angleGrad);
_local3 = Math.abs(_local2);
if (_local3 < 180){
_local4 = (_local3 / 32);
} else {
_local4 = ((360 - _local3) / 32);
};
if (_local4 < 1){
_local4 = 1;
};
if (fire1Pressed == false){
fireAngleGrad = angleGrad;
} else {
if (_local3 < 5){
fireAngleGrad = angleGrad;
} else {
if (_local3 < 180){
if (_local2 < 0){
fireAngleGrad = (fireAngleGrad + (weaponRotatingSpeed * _local4));
} else {
fireAngleGrad = (fireAngleGrad - (weaponRotatingSpeed * _local4));
};
} else {
if (_local2 < 0){
fireAngleGrad = (fireAngleGrad - (weaponRotatingSpeed * _local4));
} else {
fireAngleGrad = (fireAngleGrad + (weaponRotatingSpeed * _local4));
};
};
};
};
frameDir = (((90 + angleGrad) / 45) % 8);
_local5 = (((currentFrame % frame_sequence_lenght) + (frame_sequence_lenght * frameDir)) + 1);
if (walking){
if (_local5 >= (((frame_sequence_lenght * frameDir) + frame_walk_start) + frame_walk_lenght)){
_local5 = ((frame_sequence_lenght * frameDir) + frame_walk_start);
};
} else {
_local5 = ((frame_sequence_lenght * frameDir) + frame_stand);
};
this.gotoAndPlay(_local5);
if ((((((fire1Pressed == true)) && ((reloadTimer1 <= 0)))) && (((_arg1._time - fire1Timer) > fire1Rate)))){
Fire(_arg1, selectedWeapon);
};
if ((((((fire2Pressed == true)) && ((reloadTimer2 <= 0)))) && (((_arg1._time - fire2Timer) > fire2Rate)))){
Fire(_arg1, selectedWeapon2);
};
UpdateCollisionBounds();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:int;
var _local4:ColorTransform;
if (godModeTimer == 0){
energy--;
if ((((dieMode == false)) && ((energy < 0)))){
_arg1.PlaySound(_arg1.vieni_ucciso);
dieMode = true;
deadlyWeapon = _arg2;
dieTime = _arg1._time;
switch (deadlyWeapon){
case 1:
_local3 = frame_morte_colpo1;
break;
case 2:
_local3 = frame_morte_bruciato;
break;
case 3:
_local3 = frame_morte_esplosione1;
break;
default:
_local3 = frame_morte_colpo1;
break;
};
this.gotoAndPlay((_local3 + (frame_sequence_lenght * frameDir)));
} else {
if (dieMode == false){
_arg1.PlaySound(_arg1.vieni_colpito);
hitTime = _arg1._time;
_local4 = new ColorTransform(5);
this.transform.colorTransform = _local4;
_local4 = null;
};
};
};
}
public function GetAmmoForSelectedSecondaryWeapon():Number{
return (ammoInfoArray[selectedWeapon2].ammoCount);
}
public function GetAmmoForSelectedPrimaryWeapon():Number{
return (ammoInfoArray[selectedWeapon].ammoCount);
}
}
}//package ThisGame
Section 106
//Png (ThisGame.Png)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
public class Png extends MovieClip {
var id:int;
public var toDispose:Boolean;
public var dieMode:Boolean;
public var health:Number;
public var collisionCircle:Circle;
static var refcount:int = 0;
public function Png():void{
toDispose = false;
collisionCircle = new Circle(x, y, 15);
refcount++;
id = refcount;
dieMode = false;
}
public function StopSoundLoops(_arg1:State_InGame){
}
}
}//package ThisGame
Section 107
//Png_man1 (ThisGame.Png_man1)
package ThisGame {
import FoofaGeom.*;
import FoofaAI.*;
import flash.geom.*;
import flash.media.*;
import com.electrotank.util.*;
public class Png_man1 extends Png {
const frame_morte_esplosione2_lenght:int = 34;
const fire1Rate:Number = 1500;
const frame_morte_colpo4_lenght:int = 26;
const frame_agonia_lenght:int = 27;
const frame_morte_agonia_brucia:int = 409;
const frame_morte_esplosione1:int = 1045;
const frame_morte_colpo2_lenght:int = 29;
const frame_morte_colpo2:int = 649;
const frame_morte_colpo3:int = 769;
const frame_morte_colpo4:int = 889;
const frame_morte_esplosione2:int = 1165;
const frame_morte_colpo1:int = 529;
const frame_morte_agonia_colpo_lenght:int = 11;
const frame_walk_lenght:int = 36;
const frame_morte_agonia_brucia_lenght:int = 29;
const frame_morte_agonia_colpo:int = 997;
const frame_morte_esplosione1_lenght:int = 29;
const frame_walk:int = 1;
const frame_morte_colpo3_lenght:int = 29;
const frame_morte_bruciato:int = 289;
const frame_agonia:int = 1305;
const frame_morte_colpo1_lenght:int = 29;
const frame_morte_bruciato_lenght:int = 29;
var refVec:Vector2;
var path:Array;
var agonyMode:Boolean;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var targetPoint:Point;
var pfCell:Object;
var energy:Number;
var res:Number;
var lookingDir:Vector2;
var agonySwitch:Boolean;
var hitTime:Number;
var lastPfUpdate:Number;
var iaStatus:int;
var movingDir:Vector2;
var fire1Timer:Number;
public var agony_loop:SoundChannel;
var deadType:int;
var angleGrad:Number;
var frameToGo:int;
var pf:PathFinder;
static var deadTypeCount:int = 0;
public function Png_man1(){
addFrameScript(35, frame36, 71, frame72, 107, frame108, 143, frame144, 179, frame180, 215, frame216, 251, frame252, 287, frame288, 315, frame316, 317, frame318, 345, frame346, 347, frame348, 375, frame376, 377, frame378, 405, frame406, 407, frame408, 435, frame436, 437, frame438, 465, frame466, 467, frame468, 495, frame496, 497, frame498, 525, frame526, 527, frame528, 555, frame556, 557, frame558, 585, frame586, 587, frame588, 615, frame616, 617, frame618, 645, frame646, 647, frame648, 675, frame676, 677, frame678, 705, frame706, 707, frame708, 735, frame736, 737, frame738, 765, frame766, 767, frame768, 795, frame796, 797, frame798, 825, frame826, 827, frame828, 855, frame856, 857, frame858, 885, frame886, 887, frame888, 914, frame915, 941, frame942, 968, frame969, 995, frame996, 1005, frame1006, 1007, frame1008, 1017, frame1018, 1019, frame1020, 1029, frame1030, 1031, frame1032, 1041, frame1042, 1043, frame1044, 1071, frame1072, 1073, frame1074, 1101, frame1102, 1103, frame1104, 1131, frame1132, 1133, frame1134, 1161, frame1162, 1163, frame1164, 1196, frame1197, 1198, frame1199, 1231, frame1232, 1233, frame1234, 1266, frame1267, 1268, frame1269, 1301, frame1302, 1303, frame1304, 1331, frame1332, 1359, frame1360, 1387, frame1388, 1415, frame1416);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 1;
dieMode = false;
agonyMode = false;
agonySwitch = false;
movingDir = new Vector2(0, 1);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
hitTime = 0;
iaStatus = 0;
path = new Array();
}
function frame1072(){
y = (y - 650);
}
function frame1074(){
stop();
}
function frame1197(){
y = (y - 650);
}
function frame288(){
gotoAndPlay(253);
}
function frame1199(){
stop();
}
function frame969(){
gotoAndPlay(1361);
}
function frame618(){
stop();
}
function frame616(){
y = (y - 650);
}
function frame180(){
gotoAndPlay(145);
}
function frame856(){
y = (y - 650);
}
function frame858(){
stop();
}
function frame738(){
stop();
}
function frame1416(){
gotoAndPlay(1389);
}
function frame36(){
gotoAndPlay(1);
}
function frame1302(){
y = (y - 650);
}
function frame996(){
gotoAndPlay(1389);
}
function frame736(){
y = (y - 650);
}
function frame526(){
y = (y - 650);
}
function frame406(){
y = (y - 650);
}
function frame408(){
stop();
}
function frame768(){
stop();
}
function frame528(){
stop();
}
function frame766(){
y = (y - 650);
}
function frame886(){
y = (y - 650);
}
function frame646(){
y = (y - 650);
}
function frame648(){
stop();
}
function frame1304(){
stop();
}
function frame888(){
stop();
}
function frame1332(){
gotoAndPlay(1305);
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:int;
var _local6:*;
var _local7:Bullet;
var _local8:int;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((((dieMode == true)) || (((_arg1._time - hitTime) > 100)))){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleRad = ((FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, movingDir) + (Math.PI / 4)) + (Math.PI / 8));
while (angleRad < 0) {
angleRad = (angleRad + (2 * Math.PI));
};
while (angleRad > (2 * Math.PI)) {
angleRad = (angleRad - (2 * Math.PI));
};
angleGrad = (((angleRad * 180) / Math.PI) + 22.5);
angleGrad = (angleGrad % 360);
while (angleGrad < 0) {
angleGrad = (angleGrad + 360);
};
angleFrame = Math.round((angleGrad / 45));
angleFrame = (angleFrame % 8);
if ((((dieMode == false)) && ((agonyMode == false)))){
_local4 = (((x - _arg1.player.x) * (x - _arg1.player.x)) + ((y - _arg1.player.y) * (y - _arg1.player.y)));
switch (iaStatus){
case 0:
pf = new PathFinder(_arg1.pfGrid, 300);
res = 0;
iaStatus = 1;
break;
case 1:
if (_local4 < 40000){
iaStatus = 3;
break;
};
lastPfUpdate = _arg1._time;
targetPoint = new Point(x, y);
res = 0;
while (res == 0) {
res = pf.Move(new Point(x, y), new Point(((_arg1.player.x + (Math.random() * 180)) - 90), ((_arg1.player.y + (Math.random() * 180)) - 90)), path);
};
iaStatus = 2;
break;
case 2:
if ((_arg1._time - lastPfUpdate) > 1500){
iaStatus = 1;
break;
} else {
if ((((targetPoint.x - x) * (targetPoint.x - x)) + ((targetPoint.y - y) * (targetPoint.y - y))) > 100){
movingDir.x = (targetPoint.x - x);
movingDir.y = (targetPoint.y - y);
movingDir.normalize(1);
if (((_arg1.pfGrid.IsWalkable(new Point((x + movingDir.x), (y + movingDir.y)))) && ((((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == -1)) || ((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == id)))))){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
x = (x + movingDir.x);
y = (y + movingDir.y);
_local5 = (((currentFrame % frame_walk_lenght) + (frame_walk_lenght * angleFrame)) + 1);
if (_local5 >= (((frame_walk_lenght * angleFrame) + frame_walk) + frame_walk_lenght)){
_local5 = ((frame_walk_lenght * angleFrame) + frame_walk);
};
this.gotoAndPlay(_local5);
} else {
movingDir = movingDir.rightNormal;
_local6 = _arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))];
if (((_arg1.pfGrid.IsWalkable(new Point((x + movingDir.x), (y + movingDir.y)))) && ((((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == -1)) || ((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == id)))))){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
x = (x + movingDir.x);
y = (y + movingDir.y);
_local5 = (((currentFrame % frame_walk_lenght) + (frame_walk_lenght * angleFrame)) + 1);
if (_local5 >= (((frame_walk_lenght * angleFrame) + frame_walk) + frame_walk_lenght)){
_local5 = ((frame_walk_lenght * angleFrame) + frame_walk);
};
this.gotoAndPlay(_local5);
} else {
movingDir = movingDir.leftNormal;
};
};
} else {
if (path.length > 0){
targetPoint = path.pop();
targetPoint.x = ((targetPoint.x * _arg1.pfGrid.cellPixelWidth) + (_arg1.pfGrid.cellPixelWidth / 2));
targetPoint.y = ((targetPoint.y * _arg1.pfGrid.cellPixelHeight) + (_arg1.pfGrid.cellPixelHeight / 2));
};
};
collisionCircle.x = x;
collisionCircle.y = y;
};
break;
case 3:
if (_local4 > 50000){
iaStatus = 1;
break;
};
movingDir.x = (_arg1.player.x - x);
movingDir.y = (_arg1.player.y - y);
movingDir.normalize(1);
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.weapon1_fire, 0.3);
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = x;
_local7.y = y;
_local7.Init(_arg1, movingDir.x, movingDir.y);
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
};
if (dieMode == true){
if (((agonyMode) && (agony_loop))){
_arg1.StopLoop(agony_loop);
};
_local8 = 1;
if ((deadTypeCount % 16) > 8){
_local8 = 2;
};
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
if (agonyMode == true){
switch (deadlyWeapon){
case 2:
frameToGo = frame_morte_agonia_brucia;
frameToSkip = frame_morte_agonia_brucia_lenght;
break;
default:
frameToGo = frame_morte_agonia_colpo;
frameToSkip = frame_morte_agonia_colpo_lenght;
break;
};
} else {
switch (deadlyWeapon){
case 1:
switch ((deadType % 3)){
case 0:
frameToGo = frame_morte_colpo1;
frameToSkip = frame_morte_colpo1_lenght;
if (_local8 == 1){
_arg1.PlaySound(_arg1.pain_11);
} else {
_arg1.PlaySound(_arg1.pain_14);
};
break;
case 1:
frameToGo = frame_morte_colpo2;
frameToSkip = frame_morte_colpo2_lenght;
if (_local8 == 1){
_arg1.PlaySound(_arg1.pain_05);
} else {
_arg1.PlaySound(_arg1.pain_06);
};
break;
case 2:
frameToGo = frame_morte_colpo3;
frameToSkip = frame_morte_colpo3_lenght;
if (_local8 == 1){
_arg1.PlaySound(_arg1.pain_08);
} else {
_arg1.PlaySound(_arg1.pain_07);
};
break;
};
break;
case 2:
_arg1.PlaySound(_arg1.pain_15);
frameToGo = frame_morte_bruciato;
frameToSkip = frame_morte_bruciato_lenght;
break;
case 3:
switch ((deadType % 2)){
case 0:
frameToGo = frame_morte_esplosione1;
frameToSkip = frame_morte_esplosione1_lenght;
break;
case 1:
frameToGo = frame_morte_esplosione2;
frameToSkip = frame_morte_esplosione2_lenght;
_arg1.PlaySound(_arg1.pain_10);
break;
};
break;
default:
frameToGo = frame_morte_colpo1;
frameToSkip = frame_morte_colpo1_lenght;
_arg1.PlaySound(_arg1.pain_11);
break;
};
};
this.gotoAndPlay((frameToGo + (Math.floor((angleFrame / 2)) * (frameToSkip + 1))));
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 20);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 10);
};
_arg1.lastDeathTime = _arg1._time;
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
_arg1.app.killCount++;
} else {
if (agonyMode == true){
if (agonySwitch == true){
agony_loop = _arg1.PlayLoop(_arg1.grida_medic);
agonySwitch = false;
frameToGo = frame_morte_colpo4;
frameToSkip = frame_morte_colpo4_lenght;
this.gotoAndPlay((frameToGo + (Math.floor((angleFrame / 2)) * (frameToSkip + 1))));
switch ((deadTypeCount % 4)){
case 0:
_arg1.PlaySound(_arg1.pain_01);
break;
case 1:
_arg1.PlaySound(_arg1.pain_02);
break;
case 2:
_arg1.PlaySound(_arg1.pain_03);
break;
case 3:
_arg1.PlaySound(_arg1.pain_04);
break;
};
} else {
if (((agony_loop) && (((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) > 200000)))){
_arg1.StopLoop(agony_loop);
};
};
};
};
}
function frame72(){
gotoAndPlay(37);
}
function frame556(){
y = (y - 650);
}
function frame316(){
y = (y - 650);
}
function frame318(){
stop();
}
function frame796(){
y = (y - 650);
}
function frame558(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy = (energy - 2);
break;
case 3:
energy = (energy - 6);
break;
};
if ((((((agonyMode == false)) && ((dieMode == false)))) && ((energy < 0)))){
if ((((((agonyMode == false)) && ((_arg2 == 1)))) && ((Math.random() < 0.25)))){
agonyMode = true;
agonySwitch = true;
} else {
dieMode = true;
deadlyWeapon = _arg2;
deadTypeCount++;
deadType = deadTypeCount;
};
} else {
if ((((agonyMode == true)) && ((agonySwitch == false)))){
dieMode = true;
deadlyWeapon = _arg2;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame436(){
y = (y - 650);
}
function frame1102(){
y = (y - 650);
}
function frame676(){
y = (y - 650);
}
function frame678(){
stop();
}
function frame1104(){
stop();
}
function frame798(){
stop();
}
function frame1234(){
stop();
}
function frame438(){
stop();
}
function frame1232(){
y = (y - 650);
}
function frame1360(){
gotoAndPlay(1333);
}
function frame1006(){
y = (y - 650);
}
function frame1008(){
stop();
}
function frame586(){
y = (y - 650);
}
function frame468(){
stop();
}
function frame348(){
stop();
}
function frame466(){
y = (y - 650);
}
function frame108(){
gotoAndPlay(73);
}
function frame1134(){
stop();
}
function frame1018(){
y = (y - 650);
}
function frame1132(){
y = (y - 650);
}
function frame216(){
gotoAndPlay(181);
}
function frame346(){
y = (y - 650);
}
function frame1267(){
y = (y - 650);
}
function frame915(){
gotoAndPlay(1305);
}
function frame1020(){
stop();
}
function frame588(){
stop();
}
function frame1269(){
stop();
}
function frame1388(){
gotoAndPlay(1361);
}
function frame1030(){
y = (y - 650);
}
function frame1032(){
stop();
}
function frame252(){
gotoAndPlay(217);
}
function frame376(){
y = (y - 650);
}
function frame1162(){
y = (y - 650);
}
function frame1042(){
y = (y - 650);
}
function frame1044(){
stop();
}
function frame498(){
stop();
}
function frame378(){
stop();
}
function frame1164(){
stop();
}
function frame144(){
gotoAndPlay(109);
}
function frame496(){
y = (y - 650);
}
function frame826(){
y = (y - 650);
}
function frame706(){
y = (y - 650);
}
function frame828(){
stop();
}
function frame708(){
stop();
}
function frame942(){
gotoAndPlay(1333);
}
}
}//package ThisGame
Section 108
//Png_man2 (ThisGame.Png_man2)
package ThisGame {
import FoofaGeom.*;
import FoofaAI.*;
import flash.geom.*;
import flash.media.*;
import com.electrotank.util.*;
public class Png_man2 extends Png {
const frame_morte_esplosione2_lenght:int = 34;
const fire1Rate:Number = 500;
const frame_morte_colpo4_lenght:int = 26;
const frame_agonia_lenght:int = 27;
const frame_morte_agonia_brucia:int = 409;
const frame_morte_esplosione1:int = 1045;
const frame_morte_colpo2_lenght:int = 29;
const frame_morte_colpo2:int = 649;
const frame_morte_colpo3:int = 769;
const frame_morte_colpo4:int = 889;
const frame_morte_esplosione2:int = 1165;
const frame_morte_colpo1:int = 529;
const frame_morte_agonia_colpo_lenght:int = 11;
const frame_walk_lenght:int = 36;
const frame_morte_agonia_brucia_lenght:int = 29;
const frame_morte_agonia_colpo:int = 997;
const frame_morte_esplosione1_lenght:int = 29;
const frame_walk:int = 1;
const frame_morte_colpo3_lenght:int = 29;
const frame_morte_bruciato:int = 289;
const frame_agonia:int = 1305;
const frame_morte_colpo1_lenght:int = 29;
const frame_morte_bruciato_lenght:int = 29;
var refVec:Vector2;
var path:Array;
var agonyMode:Boolean;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var targetPoint:Point;
var pfCell:Object;
var energy:Number;
var res:Number;
var lookingDir:Vector2;
var agonySwitch:Boolean;
var hitTime:Number;
var lastPfUpdate:Number;
var iaStatus:int;
var movingDir:Vector2;
var fire1Timer:Number;
var agony_loop:SoundChannel;
var deadType:int;
var angleGrad:Number;
var frameToGo:int;
var pf:PathFinder;
static var deadTypeCount:int = 0;
public function Png_man2(){
addFrameScript(35, frame36, 71, frame72, 107, frame108, 143, frame144, 179, frame180, 215, frame216, 251, frame252, 287, frame288, 315, frame316, 317, frame318, 345, frame346, 347, frame348, 375, frame376, 377, frame378, 405, frame406, 407, frame408, 435, frame436, 437, frame438, 465, frame466, 467, frame468, 495, frame496, 497, frame498, 525, frame526, 527, frame528, 555, frame556, 557, frame558, 585, frame586, 587, frame588, 615, frame616, 617, frame618, 645, frame646, 647, frame648, 675, frame676, 677, frame678, 705, frame706, 707, frame708, 735, frame736, 737, frame738, 765, frame766, 767, frame768, 795, frame796, 797, frame798, 825, frame826, 827, frame828, 855, frame856, 857, frame858, 885, frame886, 887, frame888, 912, frame913, 914, frame915, 939, frame940, 941, frame942, 966, frame967, 968, frame969, 995, frame996, 1005, frame1006, 1007, frame1008, 1017, frame1018, 1019, frame1020, 1029, frame1030, 1031, frame1032, 1041, frame1042, 1043, frame1044, 1071, frame1072, 1073, frame1074, 1101, frame1102, 1103, frame1104, 1131, frame1132, 1133, frame1134, 1161, frame1162, 1163, frame1164, 1196, frame1197, 1198, frame1199, 1231, frame1232, 1233, frame1234, 1266, frame1267, 1268, frame1269, 1301, frame1302, 1303, frame1304, 1331, frame1332, 1359, frame1360, 1387, frame1388, 1415, frame1416);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 1;
dieMode = false;
agonyMode = false;
agonySwitch = false;
movingDir = new Vector2(0, 1);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
hitTime = 0;
iaStatus = 0;
path = new Array();
}
function frame1072(){
y = (y - 650);
}
function frame1074(){
stop();
}
function frame1197(){
y = (y - 650);
}
function frame288(){
gotoAndPlay(253);
}
function frame967(){
}
function frame1199(){
stop();
}
function frame969(){
gotoAndPlay(1361);
}
function frame618(){
stop();
}
function frame616(){
y = (y - 650);
}
function frame180(){
gotoAndPlay(145);
}
function frame856(){
y = (y - 650);
}
function frame858(){
stop();
}
function frame738(){
stop();
}
function frame1416(){
gotoAndPlay(1389);
}
function frame36(){
gotoAndPlay(1);
}
function frame1302(){
y = (y - 650);
}
function frame996(){
gotoAndPlay(1389);
}
function frame736(){
y = (y - 650);
}
function frame526(){
y = (y - 650);
}
function frame406(){
y = (y - 650);
}
function frame408(){
stop();
}
function frame768(){
stop();
}
function frame528(){
stop();
}
function frame766(){
y = (y - 650);
}
function frame886(){
y = (y - 650);
}
function frame646(){
y = (y - 650);
}
function frame648(){
stop();
}
function frame1304(){
stop();
}
function frame888(){
stop();
}
function frame1332(){
gotoAndPlay(1305);
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:int;
var _local6:*;
var _local7:Bullet;
var _local8:int;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((((dieMode == true)) || (((_arg1._time - hitTime) > 100)))){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleRad = ((FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, movingDir) + (Math.PI / 4)) + (Math.PI / 8));
while (angleRad < 0) {
angleRad = (angleRad + (2 * Math.PI));
};
while (angleRad > (2 * Math.PI)) {
angleRad = (angleRad - (2 * Math.PI));
};
angleGrad = (((angleRad * 180) / Math.PI) + 22.5);
angleGrad = (angleGrad % 360);
while (angleGrad < 0) {
angleGrad = (angleGrad + 360);
};
angleFrame = Math.round((angleGrad / 45));
angleFrame = (angleFrame % 8);
if ((((dieMode == false)) && ((agonyMode == false)))){
_local4 = (((x - _arg1.player.x) * (x - _arg1.player.x)) + ((y - _arg1.player.y) * (y - _arg1.player.y)));
switch (iaStatus){
case 0:
pf = new PathFinder(_arg1.pfGrid, 300);
res = 0;
iaStatus = 1;
break;
case 1:
if (_local4 < 40000){
iaStatus = 3;
break;
};
lastPfUpdate = _arg1._time;
targetPoint = new Point(x, y);
res = 0;
while (res == 0) {
res = pf.Move(new Point(x, y), new Point(((_arg1.player.x + (Math.random() * 180)) - 90), ((_arg1.player.y + (Math.random() * 180)) - 90)), path);
};
iaStatus = 2;
break;
case 2:
if ((_arg1._time - lastPfUpdate) > 1500){
iaStatus = 1;
break;
} else {
if ((((targetPoint.x - x) * (targetPoint.x - x)) + ((targetPoint.y - y) * (targetPoint.y - y))) > 100){
movingDir.x = (targetPoint.x - x);
movingDir.y = (targetPoint.y - y);
movingDir.normalize(1);
if (((_arg1.pfGrid.IsWalkable(new Point((x + movingDir.x), (y + movingDir.y)))) && ((((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == -1)) || ((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == id)))))){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
x = (x + movingDir.x);
y = (y + movingDir.y);
_local5 = (((currentFrame % frame_walk_lenght) + (frame_walk_lenght * angleFrame)) + 1);
if (_local5 >= (((frame_walk_lenght * angleFrame) + frame_walk) + frame_walk_lenght)){
_local5 = ((frame_walk_lenght * angleFrame) + frame_walk);
};
this.gotoAndPlay(_local5);
} else {
movingDir = movingDir.rightNormal;
_local6 = _arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))];
if (((_arg1.pfGrid.IsWalkable(new Point((x + movingDir.x), (y + movingDir.y)))) && ((((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == -1)) || ((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == id)))))){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
x = (x + movingDir.x);
y = (y + movingDir.y);
_local5 = (((currentFrame % frame_walk_lenght) + (frame_walk_lenght * angleFrame)) + 1);
if (_local5 >= (((frame_walk_lenght * angleFrame) + frame_walk) + frame_walk_lenght)){
_local5 = ((frame_walk_lenght * angleFrame) + frame_walk);
};
this.gotoAndPlay(_local5);
} else {
movingDir = movingDir.leftNormal;
};
};
} else {
if (path.length > 0){
targetPoint = path.pop();
targetPoint.x = ((targetPoint.x * _arg1.pfGrid.cellPixelWidth) + (_arg1.pfGrid.cellPixelWidth / 2));
targetPoint.y = ((targetPoint.y * _arg1.pfGrid.cellPixelHeight) + (_arg1.pfGrid.cellPixelHeight / 2));
};
};
collisionCircle.x = x;
collisionCircle.y = y;
};
break;
case 3:
if (_local4 > 50000){
iaStatus = 1;
break;
};
movingDir.x = (_arg1.player.x - x);
movingDir.y = (_arg1.player.y - y);
movingDir.normalize(1);
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.weapon2_fire, 0.3);
fire1Timer = _arg1._time;
_local7 = new Bullet();
_local7.x = x;
_local7.y = y;
_local7.Init(_arg1, movingDir.x, movingDir.y);
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
};
break;
};
};
if (dieMode == true){
if (((agonyMode) && (agony_loop))){
_arg1.StopLoop(agony_loop);
};
_local8 = 1;
if ((deadTypeCount % 16) > 8){
_local8 = 2;
};
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
if (agonyMode == true){
switch (deadlyWeapon){
case 2:
frameToGo = frame_morte_agonia_brucia;
frameToSkip = frame_morte_agonia_brucia_lenght;
break;
default:
frameToGo = frame_morte_agonia_colpo;
frameToSkip = frame_morte_agonia_colpo_lenght;
break;
};
} else {
switch (deadlyWeapon){
case 1:
switch ((deadType % 3)){
case 0:
frameToGo = frame_morte_colpo1;
frameToSkip = frame_morte_colpo1_lenght;
if (_local8 == 1){
_arg1.PlaySound(_arg1.pain_11);
} else {
_arg1.PlaySound(_arg1.pain_14);
};
break;
case 1:
frameToGo = frame_morte_colpo2;
frameToSkip = frame_morte_colpo2_lenght;
if (_local8 == 1){
_arg1.PlaySound(_arg1.pain_05);
} else {
_arg1.PlaySound(_arg1.pain_06);
};
break;
case 2:
frameToGo = frame_morte_colpo3;
frameToSkip = frame_morte_colpo3_lenght;
if (_local8 == 1){
_arg1.PlaySound(_arg1.pain_08);
} else {
_arg1.PlaySound(_arg1.pain_07);
};
break;
};
break;
case 2:
_arg1.PlaySound(_arg1.pain_15);
frameToGo = frame_morte_bruciato;
frameToSkip = frame_morte_bruciato_lenght;
break;
case 3:
switch ((deadType % 2)){
case 0:
frameToGo = frame_morte_esplosione1;
frameToSkip = frame_morte_esplosione1_lenght;
break;
case 1:
frameToGo = frame_morte_esplosione2;
frameToSkip = frame_morte_esplosione2_lenght;
_arg1.PlaySound(_arg1.pain_10);
break;
};
break;
default:
frameToGo = frame_morte_colpo1;
frameToSkip = frame_morte_colpo1_lenght;
_arg1.PlaySound(_arg1.pain_11);
break;
};
};
this.gotoAndPlay((frameToGo + (Math.floor((angleFrame / 2)) * (frameToSkip + 1))));
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 20);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 10);
};
_arg1.lastDeathTime = _arg1._time;
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
_arg1.app.killCount++;
} else {
if (agonyMode == true){
if (agonySwitch == true){
agony_loop = _arg1.PlayLoop(_arg1.grida_medic);
agonySwitch = false;
frameToGo = frame_morte_colpo4;
frameToSkip = frame_morte_colpo4_lenght;
this.gotoAndPlay((frameToGo + (Math.floor((angleFrame / 2)) * (frameToSkip + 1))));
switch ((deadTypeCount % 4)){
case 0:
_arg1.PlaySound(_arg1.pain_01);
break;
case 1:
_arg1.PlaySound(_arg1.pain_02);
break;
case 2:
_arg1.PlaySound(_arg1.pain_03);
break;
case 3:
_arg1.PlaySound(_arg1.pain_04);
break;
};
} else {
if (((agony_loop) && (((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) > 200000)))){
_arg1.StopLoop(agony_loop);
};
};
};
};
}
function frame72(){
gotoAndPlay(37);
}
function frame556(){
y = (y - 650);
}
function frame316(){
y = (y - 650);
}
function frame318(){
stop();
}
function frame796(){
y = (y - 650);
}
function frame558(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy = (energy - 2);
break;
case 3:
energy = (energy - 6);
break;
};
if ((((((agonyMode == false)) && ((dieMode == false)))) && ((energy < 0)))){
if ((((((agonyMode == false)) && ((_arg2 == 1)))) && ((Math.random() < 0.25)))){
agonyMode = true;
agonySwitch = true;
} else {
dieMode = true;
deadlyWeapon = _arg2;
deadTypeCount++;
deadType = deadTypeCount;
};
} else {
if ((((agonyMode == true)) && ((agonySwitch == false)))){
dieMode = true;
deadlyWeapon = _arg2;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame436(){
y = (y - 650);
}
function frame1102(){
y = (y - 650);
}
function frame676(){
y = (y - 650);
}
function frame678(){
stop();
}
function frame1104(){
stop();
}
function frame798(){
stop();
}
function frame1234(){
stop();
}
function frame438(){
stop();
}
function frame1232(){
y = (y - 650);
}
function frame1360(){
gotoAndPlay(1333);
}
function frame1006(){
y = (y - 650);
}
function frame1008(){
stop();
}
function frame586(){
y = (y - 650);
}
function frame468(){
stop();
}
function frame348(){
stop();
}
function frame466(){
y = (y - 650);
}
function frame108(){
gotoAndPlay(73);
}
function frame1134(){
stop();
}
function frame1018(){
y = (y - 650);
}
function frame1132(){
y = (y - 650);
}
function frame216(){
gotoAndPlay(181);
}
function frame346(){
y = (y - 650);
}
function frame913(){
}
function frame1267(){
y = (y - 650);
}
function frame915(){
gotoAndPlay(1305);
}
function frame1020(){
stop();
}
function frame588(){
stop();
}
function frame1269(){
stop();
}
function frame1388(){
gotoAndPlay(1361);
}
function frame1030(){
y = (y - 650);
}
function frame1032(){
stop();
}
function frame252(){
gotoAndPlay(217);
}
function frame376(){
y = (y - 650);
}
function frame1162(){
y = (y - 650);
}
function frame1042(){
y = (y - 650);
}
function frame1044(){
stop();
}
function frame498(){
stop();
}
function frame378(){
stop();
}
function frame1164(){
stop();
}
function frame144(){
gotoAndPlay(109);
}
function frame496(){
y = (y - 650);
}
function frame940(){
}
function frame826(){
y = (y - 650);
}
function frame706(){
y = (y - 650);
}
function frame828(){
stop();
}
function frame708(){
stop();
}
function frame942(){
gotoAndPlay(1333);
}
}
}//package ThisGame
Section 109
//Png_man2_fire (ThisGame.Png_man2_fire)
package ThisGame {
import FoofaGeom.*;
import FoofaAI.*;
import flash.geom.*;
import flash.media.*;
import com.electrotank.util.*;
public class Png_man2_fire extends Png {
const frame_morte_esplosione2_lenght:int = 34;
const fire1Rate:Number = 80;
const frame_morte_colpo4_lenght:int = 26;
const frame_agonia_lenght:int = 27;
const frame_morte_agonia_brucia:int = 409;
const frame_morte_esplosione1:int = 1045;
const frame_morte_colpo2_lenght:int = 29;
const frame_morte_colpo2:int = 649;
const frame_morte_colpo3:int = 769;
const frame_morte_colpo4:int = 889;
const frame_morte_esplosione2:int = 1165;
const frame_morte_colpo1:int = 529;
const frame_morte_agonia_colpo_lenght:int = 11;
const frame_walk_lenght:int = 36;
const frame_morte_agonia_brucia_lenght:int = 29;
const frame_morte_agonia_colpo:int = 997;
const frame_morte_esplosione1_lenght:int = 29;
const frame_walk:int = 1;
const frame_morte_colpo3_lenght:int = 29;
const frame_morte_bruciato:int = 289;
const frame_agonia:int = 1305;
const frame_morte_colpo1_lenght:int = 29;
const frame_morte_bruciato_lenght:int = 29;
var refVec:Vector2;
var path:Array;
var agonyMode:Boolean;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var targetPoint:Point;
var pfCell:Object;
var energy:Number;
var res:Number;
var lookingDir:Vector2;
var agonySwitch:Boolean;
var hitTime:Number;
var lastPfUpdate:Number;
var iaStatus:int;
var movingDir:Vector2;
var fire1Timer:Number;
var agony_loop:SoundChannel;
var deadType:int;
var angleGrad:Number;
var frameToGo:int;
var lastFireThrowerTime:int;
var pf:PathFinder;
static var deadTypeCount:int = 0;
public function Png_man2_fire(){
addFrameScript(35, frame36, 71, frame72, 107, frame108, 143, frame144, 179, frame180, 215, frame216, 251, frame252, 287, frame288, 315, frame316, 317, frame318, 345, frame346, 347, frame348, 375, frame376, 377, frame378, 405, frame406, 407, frame408, 435, frame436, 437, frame438, 465, frame466, 467, frame468, 495, frame496, 497, frame498, 525, frame526, 527, frame528, 555, frame556, 557, frame558, 585, frame586, 587, frame588, 615, frame616, 617, frame618, 645, frame646, 647, frame648, 675, frame676, 677, frame678, 705, frame706, 707, frame708, 735, frame736, 737, frame738, 765, frame766, 767, frame768, 795, frame796, 797, frame798, 825, frame826, 827, frame828, 855, frame856, 857, frame858, 885, frame886, 887, frame888, 912, frame913, 914, frame915, 939, frame940, 941, frame942, 966, frame967, 968, frame969, 995, frame996, 1005, frame1006, 1007, frame1008, 1017, frame1018, 1019, frame1020, 1029, frame1030, 1031, frame1032, 1041, frame1042, 1043, frame1044, 1071, frame1072, 1073, frame1074, 1101, frame1102, 1103, frame1104, 1131, frame1132, 1133, frame1134, 1161, frame1162, 1163, frame1164, 1196, frame1197, 1198, frame1199, 1231, frame1232, 1233, frame1234, 1266, frame1267, 1268, frame1269, 1301, frame1302, 1303, frame1304, 1331, frame1332, 1359, frame1360, 1387, frame1388, 1415, frame1416);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 1;
dieMode = false;
agonyMode = false;
agonySwitch = false;
movingDir = new Vector2(0, 1);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
hitTime = 0;
iaStatus = 0;
path = new Array();
}
function frame1072(){
y = (y - 650);
}
function frame1074(){
stop();
}
function frame1197(){
y = (y - 650);
}
function frame288(){
gotoAndPlay(253);
}
function frame967(){
}
function frame1199(){
stop();
}
function frame969(){
gotoAndPlay(1361);
}
function frame618(){
stop();
}
function frame616(){
y = (y - 650);
}
function frame180(){
gotoAndPlay(145);
}
function frame856(){
y = (y - 650);
}
function frame858(){
stop();
}
function frame738(){
stop();
}
function frame1416(){
gotoAndPlay(1389);
}
function frame36(){
gotoAndPlay(1);
}
function frame1302(){
y = (y - 650);
}
function frame996(){
gotoAndPlay(1389);
}
function frame736(){
y = (y - 650);
}
function frame526(){
y = (y - 650);
}
function frame406(){
y = (y - 650);
}
function frame408(){
stop();
}
function frame768(){
stop();
}
function frame528(){
stop();
}
function frame766(){
y = (y - 650);
}
function frame886(){
y = (y - 650);
}
function frame646(){
y = (y - 650);
}
function frame648(){
stop();
}
function frame1304(){
stop();
}
function frame888(){
stop();
}
function frame1332(){
gotoAndPlay(1305);
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:int;
var _local6:*;
var _local7:Bullet_fire;
var _local8:int;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((((dieMode == true)) || (((_arg1._time - hitTime) > 100)))){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleRad = ((FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, movingDir) + (Math.PI / 4)) + (Math.PI / 8));
while (angleRad < 0) {
angleRad = (angleRad + (2 * Math.PI));
};
while (angleRad > (2 * Math.PI)) {
angleRad = (angleRad - (2 * Math.PI));
};
angleGrad = (((angleRad * 180) / Math.PI) + 22.5);
angleGrad = (angleGrad % 360);
while (angleGrad < 0) {
angleGrad = (angleGrad + 360);
};
angleFrame = Math.round((angleGrad / 45));
angleFrame = (angleFrame % 8);
if ((((dieMode == false)) && ((agonyMode == false)))){
_local4 = (((x - _arg1.player.x) * (x - _arg1.player.x)) + ((y - _arg1.player.y) * (y - _arg1.player.y)));
switch (iaStatus){
case 0:
pf = new PathFinder(_arg1.pfGrid, 300);
res = 0;
iaStatus = 1;
break;
case 1:
if (_local4 < 25000){
iaStatus = 3;
break;
};
lastPfUpdate = _arg1._time;
targetPoint = new Point(x, y);
res = 0;
while (res == 0) {
res = pf.Move(new Point(x, y), new Point(((_arg1.player.x + (Math.random() * 180)) - 90), ((_arg1.player.y + (Math.random() * 180)) - 90)), path);
};
iaStatus = 2;
break;
case 2:
if ((_arg1._time - lastPfUpdate) > 1500){
iaStatus = 1;
break;
} else {
if ((((targetPoint.x - x) * (targetPoint.x - x)) + ((targetPoint.y - y) * (targetPoint.y - y))) > 100){
movingDir.x = (targetPoint.x - x);
movingDir.y = (targetPoint.y - y);
movingDir.normalize(1);
if (((_arg1.pfGrid.IsWalkable(new Point((x + movingDir.x), (y + movingDir.y)))) && ((((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == -1)) || ((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == id)))))){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
x = (x + movingDir.x);
y = (y + movingDir.y);
_local5 = (((currentFrame % frame_walk_lenght) + (frame_walk_lenght * angleFrame)) + 1);
if (_local5 >= (((frame_walk_lenght * angleFrame) + frame_walk) + frame_walk_lenght)){
_local5 = ((frame_walk_lenght * angleFrame) + frame_walk);
};
this.gotoAndPlay(_local5);
} else {
movingDir = movingDir.rightNormal;
_local6 = _arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))];
if (((_arg1.pfGrid.IsWalkable(new Point((x + movingDir.x), (y + movingDir.y)))) && ((((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == -1)) || ((_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point((x + movingDir.x), (y + movingDir.y)))] == id)))))){
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
x = (x + movingDir.x);
y = (y + movingDir.y);
_local5 = (((currentFrame % frame_walk_lenght) + (frame_walk_lenght * angleFrame)) + 1);
if (_local5 >= (((frame_walk_lenght * angleFrame) + frame_walk) + frame_walk_lenght)){
_local5 = ((frame_walk_lenght * angleFrame) + frame_walk);
};
this.gotoAndPlay(_local5);
} else {
movingDir = movingDir.leftNormal;
};
};
} else {
if (path.length > 0){
targetPoint = path.pop();
targetPoint.x = ((targetPoint.x * _arg1.pfGrid.cellPixelWidth) + (_arg1.pfGrid.cellPixelWidth / 2));
targetPoint.y = ((targetPoint.y * _arg1.pfGrid.cellPixelHeight) + (_arg1.pfGrid.cellPixelHeight / 2));
};
};
collisionCircle.x = x;
collisionCircle.y = y;
};
break;
case 3:
if (_local4 > 30000){
iaStatus = 1;
break;
};
movingDir.x = (_arg1.player.x - x);
movingDir.y = (_arg1.player.y - y);
movingDir.normalize(1);
this.gotoAndPlay((frame_walk + ((frame_walk_lenght + 1) * angleFrame)));
if ((_arg1._time - fire1Timer) > fire1Rate){
if ((_arg1._time - lastFireThrowerTime) > 1000){
_arg1.PlaySound(_arg1.weapon4_fire, 0.3);
lastFireThrowerTime = _arg1._time;
};
fire1Timer = _arg1._time;
_local7 = new Bullet_fire();
_local7.x = x;
_local7.y = y;
_local7.lifeTime = 700;
_local7.senderIsPlayer = false;
_local7.Init(_arg1, movingDir.x, movingDir.y);
_arg1.bulletArray.push(_local7);
_arg1.isoObjectActiveArray.push(_local7);
break;
};
break;
};
};
if (dieMode == true){
if (((agonyMode) && (agony_loop))){
_arg1.StopLoop(agony_loop);
};
_local8 = 1;
if ((deadTypeCount % 16) > 8){
_local8 = 2;
};
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
if (agonyMode == true){
switch (deadlyWeapon){
case 2:
frameToGo = frame_morte_agonia_brucia;
frameToSkip = frame_morte_agonia_brucia_lenght;
break;
default:
frameToGo = frame_morte_agonia_colpo;
frameToSkip = frame_morte_agonia_colpo_lenght;
break;
};
} else {
switch (deadlyWeapon){
case 1:
switch ((deadType % 3)){
case 0:
frameToGo = frame_morte_colpo1;
frameToSkip = frame_morte_colpo1_lenght;
if (_local8 == 1){
_arg1.PlaySound(_arg1.pain_11);
} else {
_arg1.PlaySound(_arg1.pain_14);
};
break;
case 1:
frameToGo = frame_morte_colpo2;
frameToSkip = frame_morte_colpo2_lenght;
if (_local8 == 1){
_arg1.PlaySound(_arg1.pain_05);
} else {
_arg1.PlaySound(_arg1.pain_06);
};
break;
case 2:
frameToGo = frame_morte_colpo3;
frameToSkip = frame_morte_colpo3_lenght;
if (_local8 == 1){
_arg1.PlaySound(_arg1.pain_08);
} else {
_arg1.PlaySound(_arg1.pain_07);
};
break;
};
break;
case 2:
_arg1.PlaySound(_arg1.pain_15);
frameToGo = frame_morte_bruciato;
frameToSkip = frame_morte_bruciato_lenght;
break;
case 3:
switch ((deadType % 2)){
case 0:
frameToGo = frame_morte_esplosione1;
frameToSkip = frame_morte_esplosione1_lenght;
break;
case 1:
frameToGo = frame_morte_esplosione2;
frameToSkip = frame_morte_esplosione2_lenght;
_arg1.PlaySound(_arg1.pain_10);
break;
};
break;
default:
frameToGo = frame_morte_colpo1;
frameToSkip = frame_morte_colpo1_lenght;
_arg1.PlaySound(_arg1.pain_11);
break;
};
};
this.gotoAndPlay((frameToGo + (Math.floor((angleFrame / 2)) * (frameToSkip + 1))));
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 20);
} else {
MemoryCrypto.incrementValue(_arg1.app.sounds, 10);
};
_arg1.lastDeathTime = _arg1._time;
_arg1.busyGrid[_arg1.pfGrid.FromPixelPosToGridIndex(new Point(x, y))] = -1;
_arg1.app.killCount++;
} else {
if (agonyMode == true){
if (agonySwitch == true){
agony_loop = _arg1.PlayLoop(_arg1.grida_medic);
agonySwitch = false;
frameToGo = frame_morte_colpo4;
frameToSkip = frame_morte_colpo4_lenght;
this.gotoAndPlay((frameToGo + (Math.floor((angleFrame / 2)) * (frameToSkip + 1))));
switch ((deadTypeCount % 4)){
case 0:
_arg1.PlaySound(_arg1.pain_01);
break;
case 1:
_arg1.PlaySound(_arg1.pain_02);
break;
case 2:
_arg1.PlaySound(_arg1.pain_03);
break;
case 3:
_arg1.PlaySound(_arg1.pain_04);
break;
};
} else {
if (((agony_loop) && (((((_arg1.player.x - x) * (_arg1.player.x - x)) + ((_arg1.player.y - y) * (_arg1.player.y - y))) > 200000)))){
_arg1.StopLoop(agony_loop);
};
};
};
};
}
function frame72(){
gotoAndPlay(37);
}
function frame556(){
y = (y - 650);
}
function frame316(){
y = (y - 650);
}
function frame318(){
stop();
}
function frame796(){
y = (y - 650);
}
function frame558(){
stop();
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy = (energy - 2);
break;
case 3:
energy = (energy - 6);
break;
};
if ((((((agonyMode == false)) && ((dieMode == false)))) && ((energy < 0)))){
if ((((((agonyMode == false)) && ((_arg2 == 1)))) && ((Math.random() < 0.25)))){
agonyMode = true;
agonySwitch = true;
} else {
dieMode = true;
deadlyWeapon = _arg2;
deadTypeCount++;
deadType = deadTypeCount;
};
} else {
if ((((agonyMode == true)) && ((agonySwitch == false)))){
dieMode = true;
deadlyWeapon = _arg2;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
}
function frame436(){
y = (y - 650);
}
function frame1102(){
y = (y - 650);
}
function frame676(){
y = (y - 650);
}
function frame678(){
stop();
}
function frame1104(){
stop();
}
function frame798(){
stop();
}
function frame1234(){
stop();
}
function frame438(){
stop();
}
function frame1232(){
y = (y - 650);
}
function frame1360(){
gotoAndPlay(1333);
}
function frame1006(){
y = (y - 650);
}
function frame1008(){
stop();
}
function frame586(){
y = (y - 650);
}
function frame468(){
stop();
}
function frame348(){
stop();
}
function frame466(){
y = (y - 650);
}
function frame108(){
gotoAndPlay(73);
}
function frame1134(){
stop();
}
function frame1018(){
y = (y - 650);
}
function frame1132(){
y = (y - 650);
}
function frame216(){
gotoAndPlay(181);
}
function frame346(){
y = (y - 650);
}
function frame913(){
}
function frame1267(){
y = (y - 650);
}
function frame915(){
gotoAndPlay(1305);
}
function frame1020(){
stop();
}
function frame588(){
stop();
}
function frame1269(){
stop();
}
function frame1388(){
gotoAndPlay(1361);
}
function frame1030(){
y = (y - 650);
}
function frame1032(){
stop();
}
function frame252(){
gotoAndPlay(217);
}
function frame376(){
y = (y - 650);
}
function frame1162(){
y = (y - 650);
}
function frame1042(){
y = (y - 650);
}
function frame1044(){
stop();
}
function frame498(){
stop();
}
function frame378(){
stop();
}
function frame1164(){
stop();
}
function frame144(){
gotoAndPlay(109);
}
function frame496(){
y = (y - 650);
}
function frame826(){
y = (y - 650);
}
function frame706(){
y = (y - 650);
}
function frame828(){
stop();
}
function frame708(){
stop();
}
function frame940(){
}
function frame942(){
gotoAndPlay(1333);
}
}
}//package ThisGame
Section 110
//State_Briefing (ThisGame.State_Briefing)
package ThisGame {
import flash.display.*;
import FoofaCore.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
public class State_Briefing implements FSM_State {
private var suono_raffica;
private var menuClip:BriefingMenu;
private var missionNum:TextField;
private var app:Main_Application;
private var puntinaClip:MovieClip;
private var i:int;
private var gameStage:DisplayObjectContainer;
private var missionBtn:Array;
private var textBriefing:TextField;
public function State_Briefing(_arg1:Main_Application, _arg2:DisplayObjectContainer):void{
app = _arg1;
gameStage = _arg2;
suono_raffica = new raffica();
}
function PlayRaffica(_arg1:MouseEvent):void{
if (app.sound){
suono_raffica.play(0, 0, new SoundTransform(1, 0));
};
}
public function End():void{
gameStage.removeChild(menuClip);
}
public function Step():void{
}
function nextButtonPressed(_arg1:MouseEvent){
app.GotoPlayState(gameStage);
}
public function Init():void{
menuClip = new BriefingMenu();
gameStage.addChild(menuClip);
menuClip.getChildByName("nextBtn").addEventListener(MouseEvent.MOUSE_UP, nextButtonPressed);
menuClip.getChildByName("backBtn").addEventListener(MouseEvent.MOUSE_UP, backButtonPressed);
textBriefing = TextField(menuClip.getChildByName("briefingText"));
missionNum = TextField(menuClip.getChildByName("missionNumberTxt"));
missionNum.text = ("" + app.thisLevel);
missionBtn = new Array();
missionBtn.push(MovieClip(menuClip.getChildByName("mission_1")));
missionBtn.push(MovieClip(menuClip.getChildByName("mission_2")));
missionBtn.push(MovieClip(menuClip.getChildByName("mission_3")));
missionBtn.push(MovieClip(menuClip.getChildByName("mission_4")));
missionBtn.push(MovieClip(menuClip.getChildByName("mission_5")));
missionBtn.push(MovieClip(menuClip.getChildByName("mission_6")));
if (app.sound){
menuClip.getChildByName("nextBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
menuClip.getChildByName("backBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
};
puntinaClip = MovieClip(menuClip.getChildByName("puntina"));
i = 0;
while (i < missionBtn.length) {
if (i < (app.thisLevel - 1)){
missionBtn[i].gotoAndStop(2);
} else {
missionBtn[i].gotoAndStop(1);
};
if (i == (app.thisLevel - 1)){
puntinaClip.x = missionBtn[i].x;
puntinaClip.y = missionBtn[i].y;
};
i++;
};
switch (app.thisLevel){
case 0:
case 1:
textBriefing.text = "Your first mission : find your way through the woods and engage the first enemy resistance";
break;
case 2:
textBriefing.text = "Find the 5 deadly turrets guarding the enemy camp and destroy them";
break;
case 3:
textBriefing.text = "Your enemy is experimenting with a new deadly weapon. Infiltrate their territory and destroy the weapon protoype";
break;
case 4:
textBriefing.text = "Free the village from enemy oppression and give it back to the civilians";
break;
case 5:
textBriefing.text = "Destroy the enemy lines to reach their headquarters";
break;
case 6:
textBriefing.text = "Blow up the deadly train: the last resistance before enemy defeat";
break;
};
}
function backButtonPressed(_arg1:MouseEvent){
app.ChangeState(new State_MainMenu(app, gameStage));
}
}
}//package ThisGame
Section 111
//State_GameOverMenu (ThisGame.State_GameOverMenu)
package ThisGame {
import flash.display.*;
import FoofaCore.*;
import flash.events.*;
import com.electrotank.util.*;
import flash.text.*;
public class State_GameOverMenu implements FSM_State {
private var menuClip:GameOverMenu;
private var textName:TextField;
private var app:Main_Application;
private var textScore:TextField;
private var submitButton:SimpleButton;
private var gameStage:DisplayObjectContainer;
public function State_GameOverMenu(_arg1:Main_Application, _arg2:DisplayObjectContainer):void{
app = _arg1;
gameStage = _arg2;
}
public function Step():void{
}
public function End():void{
gameStage.removeChild(menuClip);
}
function nextButtonPressed(_arg1:MouseEvent){
MemoryCrypto.setValue(app.sounds, 0);
app.Load();
app.GotoPlayState(gameStage);
}
function submitButtonPressed(_arg1:MouseEvent){
textName.type = TextFieldType.DYNAMIC;
menuClip.removeChild(submitButton);
textScore.text = "Submitted";
app.submitOurScore(textName.text, MemoryCrypto.getValue(app.sounds), onSubmitError);
}
function backButtonPressed(_arg1:MouseEvent){
app.ChangeState(new State_MainMenu(app, gameStage));
}
function onSubmitError(_arg1:IOErrorEvent){
textScore.text = "Sorry, error submitting score";
}
public function Init():void{
menuClip = new GameOverMenu();
gameStage.addChild(menuClip);
submitButton = SimpleButton(menuClip.getChildByName("submitBtn"));
submitButton.addEventListener(MouseEvent.MOUSE_UP, submitButtonPressed);
menuClip.getChildByName("againBtn").addEventListener(MouseEvent.MOUSE_UP, nextButtonPressed);
menuClip.getChildByName("backBtn").addEventListener(MouseEvent.MOUSE_UP, backButtonPressed);
textName = TextField(menuClip.getChildByName("nameText"));
textScore = TextField(menuClip.getChildByName("scoreText"));
textScore.text = ("" + MemoryCrypto.getValue(app.sounds));
}
}
}//package ThisGame
Section 112
//State_Info (ThisGame.State_Info)
package ThisGame {
import flash.display.*;
import FoofaCore.*;
import flash.events.*;
import flash.media.*;
public class State_Info implements FSM_State {
private var app:Main_Application;
private var gameStage:DisplayObjectContainer;
private var menuClip:InfoWnd;
private var suono_raffica;
public function State_Info(_arg1:Main_Application, _arg2:DisplayObjectContainer):void{
app = _arg1;
gameStage = _arg2;
suono_raffica = new raffica();
}
public function End():void{
gameStage.removeChild(menuClip);
}
function PlayRaffica(_arg1:MouseEvent):void{
if (app.sound){
suono_raffica.play(0, 0, new SoundTransform(1, 0));
};
}
public function Init():void{
menuClip = new InfoWnd();
gameStage.addChild(menuClip);
menuClip.getChildByName("continueBtn").addEventListener(MouseEvent.MOUSE_UP, nextButtonPressed);
if (app.sound){
menuClip.getChildByName("continueBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
};
}
function nextButtonPressed(_arg1:MouseEvent){
app.ChangeState(new State_Briefing(app, gameStage));
}
public function Step():void{
}
}
}//package ThisGame
Section 113
//State_InGame (ThisGame.State_InGame)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import FoofaAI.*;
import flash.geom.*;
import FoofaCore.*;
import flash.events.*;
import flash.media.*;
import com.electrotank.util.*;
import FoofaView.*;
import flash.text.*;
import flash.utils.*;
public class State_InGame implements FSM_State {
private const screenHeight:Number = 450;
private const screenWidth:Number = 450;
public var vieni_ucciso;
public var pain_01;
public var pain_02;
public var pain_03;
public var pain_04;
public var pain_05;
public var pain_06;
public var pain_07;
public var pain_08;
public var pain_09;
private var popUpToShow:Boolean;
private var fps_txt:TextField;
public var app:Main_Application;
public var pain_10;
public var pain_12;
public var pain_13;
private var gameStage:DisplayObjectContainer;
public var pain_15;
public var isoObjectActiveArray:Array;
public var pain_11;
public var pain_14;
private var _physicStep:Number;
public var equip;
private var overClip:MovieClip;
public var e_weapon_machinegun;
public var enemyActiveArray:Array;
public var weapon9_boom;
private var gui_ammoCounter:TextField;
public var pfGrid:PathFindingGrid;
public var _pauseTime:Number;
public var solidArray:Array;
public var weapon6_boom;
public var bulletArray:Array;
public var weapon4_fire;
public var grida_medic;
public var suono_raffica;
public var gui_score:TextField;
public var isoObjectArray:Array;
public var weapon1_fire;
private var _physicCounter:Number;
private var bounds:Rectangle;
private var pauseMode:Boolean;
private var _physicCounterRounded:Number;
private var gui_primaryWeapon:MovieClip;
public var vieni_colpito;
public var weapon10_fire;
public var e_weapon_cannon1;
private var collCircleCircle:CollisionCircleCircle;
public var e_weapon_cannon2;
public var triggerManager:TriggerManager;
private var weaponPopupTime:Number;
public var busyGrid:Array;
public var player:Player;
public var gui_weaponPopup:MovieClip;
private var lastUpdate:Number;
public var manca_weapon;
public var fai_cilecca;
public var background_loop:SoundChannel;
public var weapon7_boom;
private var coll:CollisionConvexPolyCircle;
private var abortWnd:AbortGameWnd;
public var weapon5_fire;
public var camera:Camera2d_FollowTargetInBounds;
private var _deltaTime:Number;
private var gui_ammoCounter2:TextField;
private var isoObjectsDepth:Number;
private var gui:DisplayObjectContainer;
public var weapon2_fire;
public var solidActiveArray:Array;
public var e_crash;
private var frameRateCounter:FrameRateCounter;
public var healthMask:MovieClip;
public var lastDeathTime:Number;
public var weapon10_boom;
public var worldObject:DisplayObjectContainer;
public var background_sounds;
private var groundClip:MovieClip;
public var weapon9_fire;
public var _time:Number;
public var crash;
public var enemyArray:Array;
private var gui_secondaryWeapon:MovieClip;
private var playerPos:Point;
private var soundCheckBox:MovieClip;
public var box;
public var weapon3_fire;
private var _lastFrameTime:Number;
public var _pauseBegin:Number;
public var e_weapon_rocket;
public function State_InGame(_arg1:Main_Application, _arg2:DisplayObjectContainer, _arg3:DisplayObjectContainer):void{
lastDeathTime = getTimer();
app = _arg1;
gameStage = _arg2;
worldObject = _arg3;
lastUpdate = 0;
weapon1_fire = new weapon1_rifle();
weapon2_fire = new weapon2_ak47();
weapon3_fire = new weapon3_shotgun();
weapon4_fire = new weapon4_flamethrower();
weapon5_fire = new weapon5_rocketlauncher();
weapon6_boom = new weapon6_grenade();
weapon7_boom = new weapon7_firegrenade();
weapon9_fire = new b52_Aircraft();
weapon9_boom = new b52_explosion();
weapon10_fire = new artillery_firing();
weapon10_boom = new artillery_explosions();
pain_01 = new scream_01();
pain_02 = new scream_02();
pain_03 = new scream_03();
pain_04 = new scream_04();
pain_05 = new scream_05();
pain_06 = new scream_06();
pain_07 = new scream_07();
pain_08 = new scream_08();
pain_09 = new scream_09();
pain_10 = new scream_10();
pain_11 = new scream_11();
pain_12 = new scream_12();
pain_13 = new scream_13();
pain_14 = new scream_14();
pain_15 = new scream_15();
box = new collect_crate();
equip = new collect_crate();
e_weapon_cannon1 = new enemy_cannon1();
e_weapon_cannon2 = new enemy_cannon2();
e_weapon_machinegun = new enemy_machinegun();
e_weapon_rocket = new enemy_rocket();
fai_cilecca = new cilecca();
vieni_colpito = new colpito();
vieni_ucciso = new ucciso();
background_sounds = new bkg_sounds();
grida_medic = new medic();
manca_weapon = new no_weapon();
e_crash = new enemy_crash();
suono_raffica = new raffica();
weaponPopupTime = 0;
}
public function GameOver():void{
app.ChangeMusic(app.menuMusic);
app.ChangeState(new State_GameOverMenu(app, gameStage));
}
public function PlaySound(_arg1:Sound, _arg2:Number=1){
if (app.sound){
_arg1.play(0, 0, new SoundTransform(_arg2, 0));
};
}
public function PlayLoop(_arg1:Sound, _arg2:Number=1):SoundChannel{
if (app.sound){
return (_arg1.play(0, 99999, new SoundTransform(_arg2, 0)));
};
return (new SoundChannel());
}
private function UpdateInput():void{
var _local1:Number;
var _local2:Number;
if ((((pauseMode == false)) && (Key.isDown(27)))){
_pauseBegin = _time;
pauseMode = true;
gameStage.stage.quality = StageQuality.HIGH;
gameStage.addChild(abortWnd);
} else {
if (pauseMode == false){
player.UpdateInput(Key.isDown(38), Key.isDown(40), Key.isDown(37), Key.isDown(39), Key.isDown(65), Key.isDown(83), Key.isDown(32));
_local1 = player.selectedWeapon;
_local2 = player.selectedWeapon2;
if (Key.isDown(49)){
if (player.SelectWeapon(1)){
if (_local1 != 1){
PlaySound(equip);
};
gui_primaryWeapon.gotoAndStop(1);
} else {
PlaySound(manca_weapon);
};
};
if (Key.isDown(50)){
if (player.SelectWeapon(2)){
if (_local1 != 2){
PlaySound(equip);
};
gui_primaryWeapon.gotoAndStop(2);
} else {
PlaySound(manca_weapon);
};
};
if (Key.isDown(51)){
if (player.SelectWeapon(3)){
if (_local1 != 3){
PlaySound(equip);
};
gui_primaryWeapon.gotoAndStop(3);
} else {
PlaySound(manca_weapon);
};
};
if (Key.isDown(52)){
if (player.SelectWeapon(4)){
if (_local1 != 4){
PlaySound(equip);
};
gui_primaryWeapon.gotoAndStop(4);
} else {
PlaySound(manca_weapon);
};
};
if (Key.isDown(53)){
if (player.SelectWeapon(5)){
if (_local1 != 5){
PlaySound(equip);
};
gui_primaryWeapon.gotoAndStop(5);
} else {
PlaySound(manca_weapon);
};
};
if (Key.isDown(54)){
if (player.SelectWeapon(6)){
if (_local2 != 6){
PlaySound(equip);
};
gui_secondaryWeapon.gotoAndStop(6);
} else {
PlaySound(manca_weapon);
};
};
if (Key.isDown(55)){
if (player.SelectWeapon(7)){
if (_local2 != 7){
PlaySound(equip);
};
gui_secondaryWeapon.gotoAndStop(7);
} else {
PlaySound(manca_weapon);
};
};
if (Key.isDown(56)){
if (player.SelectWeapon(8)){
if (_local2 != 8){
PlaySound(equip);
};
gui_secondaryWeapon.gotoAndStop(8);
} else {
PlaySound(manca_weapon);
};
};
if (Key.isDown(57)){
if (player.SelectWeapon(9)){
if (_local2 != 9){
PlaySound(equip);
};
gui_secondaryWeapon.gotoAndStop(9);
} else {
PlaySound(manca_weapon);
};
};
if (Key.isDown(48)){
if (player.SelectWeapon(10)){
if (_local2 != 10){
PlaySound(equip);
};
gui_secondaryWeapon.gotoAndStop(10);
} else {
PlaySound(manca_weapon);
};
};
};
};
}
public function ShowWeaponPopup():void{
popUpToShow = true;
weaponPopupTime = _time;
}
public function End():void{
var _local1:Array;
var _local2:Object;
var _local3:int;
SoundMixer.stopAll();
_local1 = new Array();
_local1.push(gameStage);
while (_local1.length > 0) {
_local2 = _local1.pop();
if ((_local2 is DisplayObjectContainer)){
_local3 = 0;
while (_local3 < _local2.numChildren) {
_local1.push(_local2.getChildAt(_local3));
_local2.removeChildAt(_local3);
_local3++;
};
};
_local2 = null;
};
_local3 = 0;
while (_local3 < bulletArray.length) {
delete bulletArray[_local3];
bulletArray[_local3] = null;
_local3++;
};
_local3 = 0;
while (_local3 < solidArray.length) {
delete solidArray[_local3];
solidArray[_local3] = null;
_local3++;
};
_local3 = 0;
while (_local3 < enemyArray.length) {
delete enemyArray[_local3];
enemyArray[_local3] = null;
_local3++;
};
_local3 = 0;
while (_local3 < isoObjectArray.length) {
delete isoObjectArray[_local3];
isoObjectArray[_local3] = null;
_local3++;
};
_local3 = 0;
while (_local3 < isoObjectActiveArray.length) {
delete isoObjectActiveArray[_local3];
isoObjectActiveArray[_local3] = null;
_local3++;
};
_local3 = 0;
while (_local3 < enemyActiveArray.length) {
delete enemyActiveArray[_local3];
enemyActiveArray[_local3] = null;
_local3++;
};
_local3 = 0;
while (_local3 < solidActiveArray.length) {
delete solidActiveArray[_local3];
solidActiveArray[_local3] = null;
_local3++;
};
bulletArray = null;
solidActiveArray = null;
enemyArray = null;
isoObjectArray = null;
isoObjectActiveArray = null;
enemyActiveArray = null;
solidActiveArray = null;
pfGrid = null;
busyGrid = null;
frameRateCounter.Stop();
gameStage.stage.quality = StageQuality.HIGH;
}
public function Step():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Circle;
var _local5:Point;
var _local6:Circle;
var _local7:Point;
var _local8:Number;
var _local9:Number;
var _local10:Vector2;
frameRateCounter.OnFrameStep();
gameStage.stage.focus = gameStage;
_time = getTimer();
_time = (_time - _pauseTime);
_deltaTime = (_time - _lastFrameTime);
camera.Update();
if ((camera.centerPosition.y + (screenHeight * 1.2)) < camera.bottomBound){
camera.bottomBound = (camera.centerPosition.y + (screenHeight * 1.2));
};
if ((((player.dieMode == true)) && (((_time - player.dieTime) > 3000)))){
app.ChangeState(new State_GameOverMenu(app, gameStage));
};
_physicCounter = (_physicCounter + (_deltaTime / _physicStep));
_physicCounterRounded = Math.floor(_physicCounter);
_physicCounter = (_physicCounter - _physicCounterRounded);
if (bulletArray == null){
return;
};
UpdateInput();
if (pauseMode == false){
_local1 = 0;
while (_local1 < _physicCounterRounded) {
player.Step(this);
_local2 = 0;
while (_local2 < bulletArray.length) {
if (bulletArray[_local2].toDispose == true){
_local3 = isoObjectActiveArray.indexOf(bulletArray[_local2]);
if (_local3 >= 0){
isoObjectActiveArray.splice(_local3, 1);
};
delete bulletArray[_local2];
bulletArray[_local2] = null;
bulletArray.splice(_local2, 1);
_local2--;
} else {
bulletArray[_local2].Step(this);
};
_local2++;
};
_local4 = new Circle(player.collisionCircle.x, player.collisionCircle.y, player.collisionCircle.radius);
_local5 = new Point(playerPos.x, playerPos.y);
_local6 = new Circle(player.collisionCircle.x, player.collisionCircle.y, player.collisionCircle.radius);
_local7 = new Point(playerPos.x, playerPos.y);
_local8 = 0;
_local9 = 0;
_local10 = new Vector2();
_local2 = 0;
while (_local2 < solidActiveArray.length) {
if ((solidActiveArray[_local2] is CollisionCircle)){
if (collCircleCircle.test(solidActiveArray[_local2].collisionCircle, _local6, _local7) == true){
_local10 = collCircleCircle.getBack();
_local8 = (_local8 + (player.x - _local10.x));
_local9 = (_local9 + (player.y - _local10.y));
};
} else {
if (coll.test(solidActiveArray[_local2].collisionPoly, _local6, _local7) == true){
_local10 = coll.getBack();
_local8 = (_local8 + (player.x - _local10.x));
_local9 = (_local9 + (player.y - _local10.y));
};
};
_local2++;
};
player.x = (player.x - _local8);
player.y = (player.y - _local9);
_local2 = 0;
while (_local2 < enemyActiveArray.length) {
if (enemyActiveArray[_local2].dieMode != true){
busyGrid[pfGrid.FromPixelPosToGridIndex(new Point(enemyActiveArray[_local2].x, enemyActiveArray[_local2].y))] = enemyActiveArray[_local2].id;
} else {
busyGrid[pfGrid.FromPixelPosToGridIndex(new Point(enemyActiveArray[_local2].x, enemyActiveArray[_local2].y))] = -1;
};
_local2++;
};
_local2 = 0;
while (_local2 < enemyActiveArray.length) {
enemyActiveArray[_local2].Step(this, _local2);
_local2++;
};
if (player.y > camera.bottomBound){
player.y = camera.bottomBound;
};
if (player.y < (camera.topBound + 50)){
player.y = (camera.topBound + 50);
};
if (player.x < camera.leftBound){
player.x = camera.leftBound;
};
if (player.x > camera.rightBound){
player.x = camera.rightBound;
};
_local1++;
};
UpdateScene();
UpdateWeaponPopup();
gui_ammoCounter.text = "";
if (player.GetAmmoForSelectedPrimaryWeapon() != 999){
gui_ammoCounter.text = ("" + player.GetAmmoForSelectedPrimaryWeapon());
};
gui_ammoCounter2.text = ("" + player.GetAmmoForSelectedSecondaryWeapon());
healthMask.scaleY = (player.energy / player.maxEnergy);
gui_score.text = ("" + MemoryCrypto.getValue(app.sounds));
playerPos.x = player.x;
playerPos.y = player.y;
triggerManager.Update(this);
};
_lastFrameTime = _time;
}
private function InitEnemyArray(){
var _local1:DisplayObject;
var _local2:int;
enemyArray = new Array();
_local2 = 0;
while (_local2 < worldObject.numChildren) {
_local1 = worldObject.getChildAt(_local2);
if ((_local1 is Png)){
worldObject.removeChild(_local1);
isoObjectArray.push(_local1);
enemyArray.push(_local1);
_local2--;
};
_local1 = null;
_local2++;
};
enemyArray.sortOn("y", (Array.NUMERIC | Array.DESCENDING));
enemyActiveArray = new Array();
}
function PlayRaffica(_arg1:MouseEvent):void{
PlaySound(suono_raffica);
}
private function InitTriggers(){
var _local1:DisplayObject;
var _local2:int;
_local2 = 0;
while (_local2 < worldObject.numChildren) {
_local1 = worldObject.getChildAt(_local2);
if ((_local1 is Trigger)){
triggerManager.AddTrigger(Trigger(_local1));
worldObject.removeChild(_local1);
_local2--;
};
_local1 = null;
_local2++;
};
}
public function AbortGame(_arg1:Event):void{
app.ChangeState(new State_MainMenu(app, gameStage));
}
private function InitBulletArray(){
var _local1:DisplayObject;
var _local2:int;
bulletArray = new Array();
_local2 = 0;
while (_local2 < worldObject.numChildren) {
_local1 = worldObject.getChildAt(_local2);
if ((((_local1 is Medipack)) || ((_local1 is AmmoCrate)))){
isoObjectArray.push(_local1);
bulletArray.push(_local1);
worldObject.removeChild(_local1);
_local2--;
};
_local2++;
};
bulletArray.sortOn("y", (Array.NUMERIC | Array.DESCENDING));
}
private function UpdateScene(){
var _local1:int;
_local1 = 0;
while (_local1 < isoObjectActiveArray.length) {
if (isoObjectActiveArray[_local1].y > (playerPos.y + ((3 * screenHeight) / 2))){
if ((isoObjectActiveArray[_local1] is Png)){
isoObjectActiveArray[_local1].toDispose = true;
};
delete isoObjectActiveArray[_local1];
isoObjectActiveArray[_local1] = null;
isoObjectActiveArray.splice(_local1, 1);
};
_local1++;
};
_local1 = 0;
while (_local1 < isoObjectArray.length) {
if ((isoObjectArray[_local1].y + (screenHeight * 1.3)) > playerPos.y){
isoObjectActiveArray.push(isoObjectArray[_local1]);
isoObjectArray.splice(_local1, 1);
} else {
break;
};
_local1++;
};
_local1 = 0;
while (_local1 < enemyArray.length) {
if ((enemyArray[_local1].y + (screenHeight * 1.3)) > playerPos.y){
enemyActiveArray.push(enemyArray[_local1]);
enemyArray.splice(_local1, 1);
} else {
break;
};
_local1++;
};
_local1 = 0;
while (_local1 < solidArray.length) {
if ((solidArray[_local1].y + (screenHeight * 1.3)) > playerPos.y){
solidActiveArray.push(solidArray[_local1]);
solidArray.splice(_local1, 1);
} else {
break;
};
_local1++;
};
_local1 = 0;
while (_local1 < solidActiveArray.length) {
if (solidActiveArray[_local1].y > (playerPos.y + ((3 * screenHeight) / 2))){
delete solidActiveArray[_local1];
solidActiveArray[_local1] = null;
solidActiveArray.splice(_local1, 1);
};
_local1++;
};
while (overClip.numChildren > 0) {
overClip.removeChildAt(0);
};
isoObjectActiveArray.sortOn("y", Array.NUMERIC);
_local1 = 0;
while (_local1 < isoObjectActiveArray.length) {
overClip.addChild(isoObjectActiveArray[_local1]);
_local1++;
};
}
public function Init():void{
var _local1:int;
gameStage.stage.quality = StageQuality.LOW;
gameStage.addChild(worldObject);
overClip = new MovieClip();
groundClip = new MovieClip();
playerPos = new Point(0, 0);
frameRateCounter = new FrameRateCounter();
fps_txt = new TextField();
fps_txt.width = 300;
player = Player(worldObject.getChildByName("mcPlayer"));
playerPos = new Point(player.x, player.y);
bounds = new Rectangle(0, 0, 700, worldObject.height);
camera = new Camera2d_FollowTargetInBounds(worldObject, playerPos, screenWidth, screenHeight, bounds);
gui = new _gui();
gui_primaryWeapon = MovieClip(gui.getChildByName("gino"));
gui_secondaryWeapon = MovieClip(gui.getChildByName("pino"));
gui_ammoCounter = TextField(gui.getChildByName("ammoCounter"));
gui_ammoCounter2 = TextField(gui.getChildByName("ammoCounter2"));
gui_score = TextField(gui.getChildByName("scoreTxt"));
healthMask = MovieClip(MovieClip(gui.getChildByName("healthBar")).getChildByName("maskLife"));
gui_weaponPopup = MovieClip(gui.getChildByName("mcPopup_weapons"));
worldObject.addChild(groundClip);
worldObject.addChild(overClip);
gameStage.addChild(gui);
this.worldObject.stage.frameRate = 30;
this.worldObject.stage.stageFocusRect = false;
Key.ClearKeys();
Key.initialize(worldObject.stage);
_lastFrameTime = getTimer();
_physicStep = 15;
_physicCounter = 0;
coll = new CollisionConvexPolyCircle();
collCircleCircle = new CollisionCircleCircle();
triggerManager = new TriggerManager();
InitSolidArray();
InitIsoObjectArray();
InitEnemyArray();
InitBulletArray();
InitTriggers();
isoObjectArray.sortOn("y", (Array.NUMERIC | Array.DESCENDING));
InitPathfinderGrid();
busyGrid = new Array((pfGrid.xCellCount * pfGrid.yCellCount));
_local1 = 0;
while (_local1 < (pfGrid.xCellCount * pfGrid.yCellCount)) {
busyGrid[_local1] = -1;
_local1++;
};
pauseMode = false;
abortWnd = new AbortGameWnd();
soundCheckBox = MovieClip(abortWnd.getChildByName("audioBtn"));
soundCheckBox.addEventListener(MouseEvent.CLICK, ToggleSound);
abortWnd.getChildByName("backBtn").addEventListener(MouseEvent.CLICK, AbortGame);
abortWnd.getChildByName("resumeBtn").addEventListener(MouseEvent.CLICK, CancelAbortGame);
if (app.sound){
abortWnd.getChildByName("backBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
abortWnd.getChildByName("resumeBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
};
frameRateCounter.Play();
_pauseTime = 0;
player.SelectWeapon(1);
player.SelectWeapon(6);
gui_primaryWeapon.gotoAndStop(1);
gui_secondaryWeapon.gotoAndStop(6);
app.killCount = 0;
_pauseTime = 0;
background_loop = PlayLoop(background_sounds);
}
public function UpdateWeaponPopup():void{
if ((_time - weaponPopupTime) > 4000){
popUpToShow = false;
};
if ((((popUpToShow == true)) && ((gui_weaponPopup.y > 350)))){
gui_weaponPopup.y = (gui_weaponPopup.y - FoofaGeomUtils.Trim(((gui_weaponPopup.y - 350) / 10), 2, 30));
if (gui_weaponPopup.y < 351){
gui_weaponPopup.y = 350;
};
} else {
if ((((popUpToShow == false)) && ((gui_weaponPopup.y < 455)))){
gui_weaponPopup.y = (gui_weaponPopup.y + FoofaGeomUtils.Trim(((455 - gui_weaponPopup.y) / 10), 3, 30));
};
};
}
public function GetEnemyByIstanceName(_arg1:String):Png{
var _local2:*;
_local2 = 0;
while (_local2 < enemyActiveArray.length) {
if (enemyActiveArray[_local2].name == _arg1){
return (enemyActiveArray[_local2]);
};
_local2++;
};
_local2 = 0;
while (_local2 < enemyArray.length) {
if (enemyArray[_local2].name == _arg1){
return (enemyArray[_local2]);
};
_local2++;
};
return (null);
}
private function InitPathfinderGrid():void{
var _local1:CollisionClip;
var _local2:Object;
var _local3:Object;
var _local4:int;
var _local5:int;
_local2 = {walkable:true, cost:1, busy:-1};
_local3 = {walkable:false, cost:1, busy:-1};
_local4 = 25;
pfGrid = new PathFindingGrid(_local4, _local4, Math.floor((worldObject.width / _local4)), Math.floor((worldObject.height / _local4)), new Array());
pfGrid.Init(_local2);
_local5 = 0;
while (_local5 < solidArray.length) {
if ((solidArray[_local5] is CollisionCircle)){
pfGrid.DrawCircle(solidArray[_local5].collisionCircle, _local3);
} else {
pfGrid.DrawRectangle(solidArray[_local5].collisionPoly.GetPointArray(), _local3);
};
_local5++;
};
}
private function InitSolidArray(){
var _local1:DisplayObject;
var _local2:int;
solidArray = new Array();
solidActiveArray = new Array();
_local2 = 0;
while (_local2 < worldObject.numChildren) {
_local1 = worldObject.getChildAt(_local2);
if ((_local1 is CollisionObject)){
solidArray.push(_local1);
worldObject.removeChild(_local1);
_local2--;
if ((_local1 is Collider_basso)){
Collider_basso(_local1).h = 15;
};
};
_local1 = null;
_local2++;
};
solidArray.sortOn("y", (Array.NUMERIC | Array.DESCENDING));
}
public function CancelAbortGame(_arg1:Event):void{
_pauseTime = (_pauseTime + (_time - _pauseBegin));
pauseMode = false;
gameStage.removeChild(abortWnd);
gameStage.stage.quality = StageQuality.LOW;
}
public function StopLoop(_arg1:SoundChannel){
if (app.sound){
if (_arg1){
_arg1.stop();
};
};
}
private function InitIsoObjectArray(){
var _local1:DisplayObject;
var _local2:int;
var _local3:int;
isoObjectArray = new Array();
_local2 = 0;
while (_local2 < worldObject.numChildren) {
_local1 = worldObject.getChildAt(_local2);
if ((_local1 is IsoObject)){
isoObjectArray.push(_local1);
};
_local2++;
};
_local3 = 0;
while (_local3 < isoObjectArray.length) {
worldObject.removeChild(isoObjectArray[_local3]);
_local3++;
};
isoObjectActiveArray = new Array();
isoObjectsDepth = worldObject.numChildren;
isoObjectActiveArray.push(player);
}
public function CompleteMission():void{
app.points = (app.points + (app.thisLevel * 100000));
if (app.thisLevel < app.maxLevel){
app.ChangeState(new State_MissionComplete(app, gameStage));
} else {
app.ChangeState(new State_WinGameOverMenu(app, gameStage));
};
}
public function ToggleSound(_arg1:Event):void{
app.sound = !(app.sound);
if (app.sound){
abortWnd.getChildByName("backBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
abortWnd.getChildByName("resumeBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
soundCheckBox.gotoAndStop(2);
background_loop = PlayLoop(background_sounds);
} else {
abortWnd.getChildByName("backBtn").removeEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
abortWnd.getChildByName("resumeBtn").removeEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
SoundMixer.stopAll();
soundCheckBox.gotoAndStop(1);
};
}
}
}//package ThisGame
Section 114
//State_MainMenu (ThisGame.State_MainMenu)
package ThisGame {
import flash.display.*;
import FoofaCore.*;
import flash.events.*;
import flash.media.*;
import com.electrotank.util.*;
import flash.net.*;
public class State_MainMenu implements FSM_State {
private var suono_raffica;
private var xploredButton:DisplayObject;
private var menuClip:DisplayObjectContainer;
private var foofaButton:DisplayObject;
private var app:Main_Application;
private var continueButton:DisplayObject;
private var gameStage:DisplayObjectContainer;
public function State_MainMenu(_arg1:Main_Application, _arg2:DisplayObjectContainer):void{
app = _arg1;
gameStage = _arg2;
menuClip = new MainMenu();
}
public function Step():void{
gameStage.addChild(menuClip);
}
public function End():void{
gameStage.removeChild(menuClip);
}
function PlayRaffica(_arg1:MouseEvent):void{
if (app.sound){
suono_raffica.play(0, 0, new SoundTransform(1, 0));
};
}
function morePressed(_arg1:MouseEvent):void{
app.goToUrl("http://www.crazymonkeygames.com/");
}
function foofaButtonPressed(_arg1:MouseEvent):void{
app.goToUrl("http://www.foofa.net/");
}
function buttonPressed(_arg1:MouseEvent){
app.thisLevel = 1;
if (app.thisLevel == 1){
app.ChangeState(new State_Info(app, gameStage));
} else {
app.ChangeState(new State_Briefing(app, gameStage));
};
}
function continuePressed(_arg1:MouseEvent){
app.ChangeState(new State_Briefing(app, gameStage));
}
function hallPressed(_arg1:MouseEvent):void{
app.goToUrl("http://scores.crazymonkeygames.com/hs/listscores.php?id=279");
}
public function Init():void{
suono_raffica = new raffica();
menuClip.getChildByName("mcBtn_xplored").addEventListener(MouseEvent.MOUSE_UP, xplorerButtonPressed);
menuClip.getChildByName("mcBtn_foofa").addEventListener(MouseEvent.MOUSE_UP, foofaButtonPressed);
menuClip.getChildByName("playBtn").addEventListener(MouseEvent.MOUSE_UP, buttonPressed);
menuClip.getChildByName("moreBtn").addEventListener(MouseEvent.MOUSE_UP, morePressed);
menuClip.getChildByName("hallBtn").addEventListener(MouseEvent.MOUSE_UP, hallPressed);
continueButton = menuClip.getChildByName("continueBtn");
app.Load();
if (app.thisLevel > 1){
continueButton.alpha = 1;
continueButton.addEventListener(MouseEvent.MOUSE_UP, continuePressed);
} else {
continueButton.alpha = 0.4;
continueButton.removeEventListener(MouseEvent.MOUSE_UP, continuePressed);
};
MemoryCrypto.setValue(app.sounds, 0);
if (app.sound){
menuClip.getChildByName("playBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
menuClip.getChildByName("continueBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
menuClip.getChildByName("hallBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
menuClip.getChildByName("moreBtn").addEventListener(MouseEvent.MOUSE_OVER, PlayRaffica);
};
}
function xplorerButtonPressed(_arg1:MouseEvent):void{
app.goToUrl("http://www.xplored.com/play/");
}
}
}//package ThisGame
Section 115
//State_MissionComplete (ThisGame.State_MissionComplete)
package ThisGame {
import flash.display.*;
import FoofaCore.*;
import flash.events.*;
import com.electrotank.util.*;
import flash.text.*;
public class State_MissionComplete implements FSM_State {
private var app:Main_Application;
private var gameStage:DisplayObjectContainer;
public var gui_score:TextField;
private var menuClip:LevelCompleteMenu;
public var gui_killed:TextField;
public function State_MissionComplete(_arg1:Main_Application, _arg2:DisplayObjectContainer):void{
app = _arg1;
gameStage = _arg2;
}
public function End():void{
gameStage.removeChild(menuClip);
if (app.thisLevel < app.maxLevel){
app.thisLevel++;
};
app.Save();
}
function nextButtonPressed(_arg1:MouseEvent){
app.ChangeState(new State_Briefing(app, gameStage));
}
public function Init():void{
menuClip = new LevelCompleteMenu();
gameStage.addChild(menuClip);
menuClip.getChildByName("nextBtn").addEventListener(MouseEvent.MOUSE_UP, nextButtonPressed);
gui_score = TextField(menuClip.getChildByName("scoreTxt"));
gui_score.text = ("" + MemoryCrypto.getValue(app.sounds));
gui_killed = TextField(menuClip.getChildByName("killedTxt"));
gui_killed.text = ("" + app.killCount);
}
public function Step():void{
}
}
}//package ThisGame
Section 116
//State_WinGameOverMenu (ThisGame.State_WinGameOverMenu)
package ThisGame {
import flash.display.*;
import FoofaCore.*;
import flash.events.*;
import com.electrotank.util.*;
import flash.text.*;
public class State_WinGameOverMenu implements FSM_State {
private var app:Main_Application;
private var textScore:TextField;
private var gameStage:DisplayObjectContainer;
private var menuClip:WinGameOverMenu;
private var submitButton:SimpleButton;
private var textName:TextField;
public function State_WinGameOverMenu(_arg1:Main_Application, _arg2:DisplayObjectContainer):void{
app = _arg1;
gameStage = _arg2;
}
function onSubmitError(_arg1:IOErrorEvent){
textScore.text = "Sorry, error submitting score";
}
function backButtonPressed(_arg1:MouseEvent){
app.ChangeState(new State_MainMenu(app, gameStage));
}
public function Init():void{
menuClip = new WinGameOverMenu();
gameStage.addChild(menuClip);
submitButton = SimpleButton(menuClip.getChildByName("submitBtn"));
submitButton.addEventListener(MouseEvent.MOUSE_UP, submitButtonPressed);
menuClip.getChildByName("backBtn").addEventListener(MouseEvent.MOUSE_UP, backButtonPressed);
textName = TextField(menuClip.getChildByName("nameText"));
textScore = TextField(menuClip.getChildByName("scoreText"));
textScore.text = ("" + MemoryCrypto.getValue(app.sounds));
}
function submitButtonPressed(_arg1:MouseEvent){
textName.type = TextFieldType.DYNAMIC;
menuClip.removeChild(submitButton);
textScore.text = "Submitted";
app.submitOurScore(textName.text, MemoryCrypto.getValue(app.sounds), onSubmitError);
}
public function Step():void{
}
public function End():void{
gameStage.removeChild(menuClip);
}
}
}//package ThisGame
Section 117
//Train (ThisGame.Train)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Train extends Png {
const fire1Rate:Number = 1500;
const frame_morte:int = 2;
const fire3Rate:Number = 1000;
const frame_walk:int = 1;
const fire2Rate:Number = 3500;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
var deadlyWeapon:int;
var fire1Timer:Number;
var angleRad:Number;
var gunClip3:MovieClip;
var fire3Timer:Number;
var frameToSkip:int;
var gunClip:MovieClip;
var lookingDir:Vector2;
var energy:Number;
var angleGrad:Number;
var gunClip2:MovieClip;
var frameToGo:int;
var thinkTime:Number;
var hitTime:Number;
var fire2Timer:Number;
var loc:Locomotive;
public function Train(){
addFrameScript(0, frame1, 10, frame11);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 40;
dieMode = false;
movingDir = new Vector2(-1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
collisionCircle = new Circle(x, y, 30);
iaStatus = -1;
fire1Timer = 0;
fire2Timer = 350;
fire3Timer = 700;
collisionCircle.radius = this.width;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet_smartRocket;
var _local5:Bullet_smartRocket;
var _local6:Bullet_smartRocket;
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
if (energy > 0){
gotoAndStop(1);
};
if (_arg1.player.y < y){
_arg1.player.y = y;
};
switch (iaStatus){
case -1:
if (this.parent == null){
break;
};
gunClip = MovieClip(this.parent.getChildByName("torretta1"));
gunClip2 = MovieClip(this.parent.getChildByName("torretta2"));
gunClip3 = MovieClip(this.parent.getChildByName("torretta3"));
loc = Locomotive(this.parent.getChildByName("locomotiva"));
if ((((((((gunClip == null)) || ((gunClip2 == null)))) || ((gunClip3 == null)))) || ((loc == null)))){
break;
};
iaStatus = 0;
break;
case 0:
if (loc.energy > 0){
x = (x + movingDir.x);
y = (y + movingDir.y);
gunClip.x = (gunClip.x + movingDir.x);
gunClip.y = (gunClip.y + movingDir.y);
gunClip2.x = (gunClip2.x + movingDir.x);
gunClip2.y = (gunClip2.y + movingDir.y);
gunClip3.x = (gunClip3.x + movingDir.x);
gunClip3.y = (gunClip3.y + movingDir.y);
loc.x = (loc.x + movingDir.x);
loc.y = (loc.y + movingDir.y);
if ((((x > 450)) && ((movingDir.x > 0)))){
movingDir.x = -(movingDir.x);
thinkTime = _arg1._time;
} else {
if (x < -400){
movingDir.x = -(movingDir.x);
iaStatus = 1;
thinkTime = _arg1._time;
gunClip.iaStatus = 1;
gunClip2.iaStatus = 1;
gunClip3.iaStatus = 1;
};
};
};
collisionCircle.x = x;
collisionCircle.y = y;
if ((_arg1._time - fire2Timer) > fire2Rate){
_arg1.PlaySound(_arg1.e_weapon_rocket, 0.3);
fire2Timer = _arg1._time;
if ((((((((loc.energy <= 0)) && ((gunClip.energy <= 0)))) && ((gunClip2.energy <= 0)))) && ((gunClip3.energy <= 0)))){
_local5 = new Bullet_smartRocket();
_local5.x = x;
_local5.y = y;
_local5.Init(_arg1, -1, -1);
_arg1.bulletArray.push(_local5);
_arg1.isoObjectActiveArray.push(_local5);
_local6 = new Bullet_smartRocket();
_local6.x = x;
_local6.y = y;
_local6.Init(_arg1, 1, -1);
_arg1.bulletArray.push(_local6);
_arg1.isoObjectActiveArray.push(_local6);
};
_local4 = new Bullet_smartRocket();
_local4.x = x;
_local4.y = y;
_local4.Init(_arg1, 0, -1);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
break;
case 1:
if ((_arg1._time - thinkTime) < 3000){
if ((_arg1._time - fire1Timer) > 10000){
fire1Timer = _arg1._time;
};
} else {
iaStatus = 0;
gunClip.iaStatus = 0;
gunClip2.iaStatus = 0;
gunClip3.iaStatus = 0;
};
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
this.gotoAndPlay(frameToGo);
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
MemoryCrypto.incrementValue(_arg1.app.sounds, 3000);
};
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
if ((((((((loc.energy <= 0)) && ((gunClip.energy <= 0)))) && ((gunClip2.energy <= 0)))) && ((gunClip3.energy <= 0)))){
switch (_arg2){
case 1:
energy--;
break;
case 2:
return;
case 3:
energy = (energy - 5);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
};
}
function frame1(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame11(){
stop();
}
}
}//package ThisGame
Section 118
//TrainGun (ThisGame.TrainGun)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
public class TrainGun extends Png {
const fire1Rate:Number = 900;
const frame_morte:int = 9;
const frame_walk_lenght:int = 0;
const frame_walk:int = 1;
const fire2Rate:Number = 45;
var angleGunFrame:Number;
var refVec:Vector2;
var angleFrame:Number;
var frameToSkip:int;
var deadlyWeapon:int;
var angleRad:Number;
var fire3Timer:Number;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var gun1:Vector2;
var gun3:Vector2;
var gun2:Vector2;
var hitTime:Number;
public var iaStatus:int;
var loc:Locomotive;
var movingDir:Vector2;
var fire1Timer:Number;
var gunClip3:MovieClip;
var gunClip2:MovieClip;
var angleGrad:Number;
var frameToGo:int;
var fire2Timer:Number;
var lastFireThrowerTime:Number;
public function TrainGun(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 32, frame33, 62, frame63, 92, frame93);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 20;
dieMode = false;
movingDir = new Vector2(-1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
collisionCircle = new Circle(x, y, 30);
iaStatus = 0;
fire1Timer = 0;
fire2Timer = 350;
fire3Timer = 700;
collisionCircle.radius = this.width;
lastFireThrowerTime = 0;
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame33(){
stop();
}
function frame63(){
stop();
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:int;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Bullet;
var _local12:Bullet_fire;
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(movingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
if (this.parent == null){
break;
};
loc = Locomotive(this.parent.getChildByName("locomotiva"));
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
_local4 = lookingDir.x;
_local5 = lookingDir.y;
lookingDir.normalize(1);
angleFrame = FromVectorToFrameAngle(movingDir);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
if (angleGunFrame < 1){
angleGunFrame = 1;
};
if (angleGunFrame > 5){
angleGunFrame = 1;
} else {
if (angleGunFrame > 3){
angleGunFrame = 3;
};
};
gotoAndStop(angleGunFrame);
_local6 = 1;
_local7 = 1;
if (((_local4 * _local4) + (_local5 * _local5)) < 20000){
_local6 = 2;
_local7 = fire2Rate;
} else {
_local6 = 1;
_local7 = fire1Rate;
};
if ((_arg1._time - fire1Timer) > _local7){
_local8 = FoofaGeomUtils.AngleFromDir(lookingDir.x, lookingDir.y);
_local9 = (x + (Math.sin(_local8) * 60));
_local10 = ((y + (Math.cos(_local8) * 60)) - 70);
if (_local6 == 1){
_arg1.PlaySound(_arg1.e_weapon_cannon2, 0.3);
fire1Timer = _arg1._time;
_local11 = new Bullet();
_local11.x = _local9;
_local11.y = _local10;
_local11.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local11);
_arg1.isoObjectActiveArray.push(_local11);
_local11 = new Bullet();
_local11.x = _local9;
_local11.y = _local10;
_local11.Init(_arg1, Math.sin((_local8 + 0.1)), Math.cos((_local8 + 0.1)));
_arg1.bulletArray.push(_local11);
_arg1.isoObjectActiveArray.push(_local11);
_local11 = new Bullet();
_local11.x = _local9;
_local11.y = _local10;
_local11.Init(_arg1, Math.sin((_local8 - 0.1)), Math.cos((_local8 - 0.1)));
_arg1.bulletArray.push(_local11);
_arg1.isoObjectActiveArray.push(_local11);
_local11 = new Bullet();
_local11.x = _local9;
_local11.y = _local10;
_local11.Init(_arg1, Math.sin((_local8 + 0.05)), Math.cos((_local8 + 0.05)));
_arg1.bulletArray.push(_local11);
_arg1.isoObjectActiveArray.push(_local11);
_local11 = new Bullet();
_local11.x = _local9;
_local11.y = _local10;
_local11.Init(_arg1, Math.sin((_local8 - 0.05)), Math.cos((_local8 - 0.05)));
_arg1.bulletArray.push(_local11);
_arg1.isoObjectActiveArray.push(_local11);
} else {
if ((_arg1._time - lastFireThrowerTime) > 1000){
_arg1.PlaySound(_arg1.weapon4_fire, 0.3);
lastFireThrowerTime = _arg1._time;
};
fire1Timer = _arg1._time;
_local12 = new Bullet_fire();
_local12.x = _local9;
_local12.y = _local10;
_local12.lifeTime = 800;
_local12.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local12);
_arg1.isoObjectActiveArray.push(_local12);
};
};
collisionCircle.x = x;
collisionCircle.y = y;
break;
case 1:
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
this.gotoAndPlay(frameToGo);
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
};
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
if (loc.energy <= 0){
switch (_arg2){
case 1:
energy--;
break;
case 2:
return;
case 3:
energy = (energy - 5);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
if (_arg2 != 2){
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
};
};
}
function frame93(){
stop();
}
}
}//package ThisGame
Section 119
//Trigger_goal_level2 (ThisGame.Trigger_goal_level2)
package ThisGame {
import FoofaCore.*;
public class Trigger_goal_level2 extends Trigger {
var i:int;
var turrets:Array;
var allDestroyed:Boolean;
public function Trigger_goal_level2():void{
}
override public function Init(_arg1:State_InGame):void{
turrets = new Array();
turrets.push(_arg1.GetEnemyByIstanceName("goal_1"));
turrets.push(_arg1.GetEnemyByIstanceName("goal_2"));
turrets.push(_arg1.GetEnemyByIstanceName("goal_3"));
turrets.push(_arg1.GetEnemyByIstanceName("goal_4"));
turrets.push(_arg1.GetEnemyByIstanceName("goal_5"));
}
override public function Check(_arg1:State_InGame):Boolean{
return ((_arg1.player.y < (y + 750)));
}
override public function Step(_arg1:State_InGame):void{
allDestroyed = true;
i = 0;
while (i < turrets.length) {
if (turrets[i].dieMode == false){
allDestroyed = false;
break;
};
i++;
};
if (allDestroyed == false){
if (_arg1.player.y < y){
_arg1.player.y = y;
};
} else {
_arg1.triggerManager.RemoveTrigger(this);
};
}
}
}//package ThisGame
Section 120
//Trigger_goal_level3 (ThisGame.Trigger_goal_level3)
package ThisGame {
import FoofaCore.*;
public class Trigger_goal_level3 extends Trigger {
var enemy;
public function Trigger_goal_level3():void{
}
override public function Init(_arg1:State_InGame):void{
enemy = _arg1.GetEnemyByIstanceName("boss");
}
override public function Check(_arg1:State_InGame):Boolean{
return ((_arg1.player.y < (y + 750)));
}
override public function Step(_arg1:State_InGame):void{
if (enemy.dieMode == true){
_arg1.triggerManager.RemoveTrigger(this);
} else {
if (_arg1.player.y < y){
_arg1.player.y = y;
};
};
}
}
}//package ThisGame
Section 121
//Trigger_test (ThisGame.Trigger_test)
package ThisGame {
import FoofaCore.*;
public class Trigger_test extends Trigger {
public function Trigger_test():void{
}
override public function Init(_arg1:State_InGame):void{
}
override public function Check(_arg1:State_InGame):Boolean{
return ((_arg1.player.y < y));
}
override public function Step(_arg1:State_InGame):void{
_arg1.triggerManager.RemoveTrigger(this);
_arg1.CompleteMission();
}
}
}//package ThisGame
Section 122
//Turret1 (ThisGame.Turret1)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Turret1 extends Png {
const reloadTime:Number = 2500;
const burstRate:Number = 12;
const fire1Rate:Number = 100;
const frame_morte:int = 2;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
public var gun:MovieClip;
var fire1Timer:Number;
var angleRad:Number;
var deadlyWeapon:int;
var frameToSkip:int;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var angleGrad:Number;
var burstCount:Number;
var hitTime:Number;
var frameToGo:int;
public function Turret1(){
addFrameScript(0, frame1, 30, frame31, 60, frame61, 90, frame91, 120, frame121, 150, frame151, 180, frame181, 210, frame211, 240, frame241);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 5;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
gotoAndStop(1);
burstCount = 0;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:Bullet;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(lookingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_machinegun, 0.3);
fire1Timer = _arg1._time;
_local4 = new Bullet();
_local4.x = (x + (Math.cos((((45 * angleGunFrame) * Math.PI) / 180)) * 40));
_local4.y = (y + (Math.sin((((45 * angleGunFrame) * Math.PI) / 180)) * 40));
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_local4.flyHighBullet = true;
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
burstCount++;
if (burstCount > burstRate){
iaStatus = 1;
};
};
break;
case 1:
if ((_arg1._time - fire1Timer) > reloadTime){
burstCount = 0;
iaStatus = 0;
};
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 400);
};
_arg1.lastDeathTime = _arg1._time;
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
};
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
energy = (energy - 2);
break;
case 3:
energy = (energy - 6);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame91(){
stop();
}
function frame211(){
stop();
}
function frame181(){
stop();
}
function frame1(){
stop();
}
function frame241(){
stop();
}
function frame121(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame31(){
stop();
}
function frame61(){
stop();
}
function frame151(){
stop();
}
}
}//package ThisGame
Section 123
//Turret2 (ThisGame.Turret2)
package ThisGame {
import FoofaGeom.*;
import flash.display.*;
import flash.geom.*;
import com.electrotank.util.*;
public class Turret2 extends Png {
const fire1Rate:Number = 450;
const frame_morte:int = 2;
const frame_walk:int = 1;
const frame_morte_lenght:int = 29;
const frame_walk_lenght:int = 0;
var angleGunFrame:Number;
var refVec:Vector2;
var iaStatus:int;
var movingDir:Vector2;
var angleFrame:Number;
public var gun:MovieClip;
var fire1Timer:Number;
var angleRad:Number;
var deadlyWeapon:int;
var frameToSkip:int;
var energy:Number;
var gunClip:MovieClip;
var lookingDir:Vector2;
var angleGrad:Number;
var burstCount:Number;
var hitTime:Number;
var frameToGo:int;
public function Turret2(){
addFrameScript(0, frame1, 30, frame31, 60, frame61, 90, frame91, 120, frame121, 150, frame151, 180, frame181, 210, frame211, 240, frame241);
health = 1;
fire1Timer = 0;
angleRad = 0;
angleGrad = 0;
energy = 5;
dieMode = false;
movingDir = new Vector2(1, 0);
lookingDir = new Vector2(0, 1);
refVec = new Vector2(0, 1);
gunClip = MovieClip(this.getChildByName("gun"));
iaStatus = 0;
collisionCircle = new Circle(x, y, 30);
gotoAndStop(1);
burstCount = 0;
}
public function Step(_arg1:State_InGame, _arg2):void{
var _local3:ColorTransform;
var _local4:BulletFly;
if (toDispose == true){
_arg1.enemyActiveArray.splice(_arg2, 1);
return;
};
if ((_arg1._time - hitTime) > 100){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
};
angleFrame = FromVectorToFrameAngle(lookingDir);
if (dieMode == false){
switch (iaStatus){
case 0:
lookingDir.x = (_arg1.player.x - x);
lookingDir.y = (_arg1.player.y - y);
lookingDir.normalize(1);
angleGunFrame = FromVectorToFrameAngle(lookingDir);
gunClip.gotoAndStop((angleGunFrame + 1));
if ((_arg1._time - fire1Timer) > fire1Rate){
_arg1.PlaySound(_arg1.e_weapon_cannon2, 0.3);
fire1Timer = _arg1._time;
_local4 = new BulletFly();
_local4.x = (x + (Math.cos((((45 * angleGunFrame) * Math.PI) / 180)) * 50));
_local4.y = (y + (Math.sin((((45 * angleGunFrame) * Math.PI) / 180)) * 50));
_local4.h = -50;
_local4.vSpeed = (-((3 * _local4.h)) / Math.sqrt((((_local4.x - _arg1.player.x) * (_local4.x - _arg1.player.x)) + ((_local4.y - _arg1.player.y) * (_local4.y - _arg1.player.y)))));
_local4.Init(_arg1, lookingDir.x, lookingDir.y);
_arg1.bulletArray.push(_local4);
_arg1.isoObjectActiveArray.push(_local4);
};
break;
case 1:
break;
};
};
if (dieMode == true){
_local3 = new ColorTransform();
this.transform.colorTransform = _local3;
frameToGo = frame_morte;
frameToSkip = frame_morte_lenght;
this.gotoAndPlay((frameToGo + (Math.floor(angleFrame) * (frameToSkip + 1))));
_arg1.camera.ShakingEffect(10, 10, 1);
_arg1.enemyActiveArray.splice(_arg2, 1);
if ((_arg1._time - _arg1.lastDeathTime) < 1000){
MemoryCrypto.incrementValue(_arg1.app.sounds, 400);
};
_arg1.lastDeathTime = _arg1._time;
MemoryCrypto.incrementValue(_arg1.app.sounds, 200);
};
}
public function OnHit(_arg1:State_InGame, _arg2:int):void{
var _local3:ColorTransform;
switch (_arg2){
case 1:
energy--;
break;
case 2:
return;
case 3:
energy = (energy - 6);
break;
};
if ((((dieMode == false)) && ((energy < 0)))){
dieMode = true;
} else {
hitTime = _arg1._time;
_local3 = new ColorTransform(5);
this.transform.colorTransform = _local3;
};
}
function frame91(){
stop();
}
function frame211(){
stop();
}
function frame181(){
stop();
}
function frame1(){
stop();
}
function frame241(){
stop();
}
function frame121(){
stop();
}
private function FromVectorToFrameAngle(_arg1:Vector2):int{
var _local2:Number;
var _local3:Number;
var _local4:int;
_local2 = (FoofaGeomUtils.AngleBetweenVectors2Rad(refVec, _arg1) + (Math.PI / 2));
while (_local2 < 0) {
_local2 = (_local2 + (2 * Math.PI));
};
while (_local2 > (2 * Math.PI)) {
_local2 = (_local2 - (2 * Math.PI));
};
_local3 = ((_local2 * 180) / Math.PI);
_local3 = (_local3 % 360);
while (_local3 < 0) {
_local3 = (_local3 + 360);
};
_local4 = Math.round((_local3 / 45));
_local4 = (_local4 % 8);
return (_local4);
}
function frame31(){
stop();
}
function frame61(){
stop();
}
function frame151(){
stop();
}
}
}//package ThisGame
Section 124
//WeaponFactory (ThisGame.WeaponFactory)
package ThisGame {
class WeaponFactory {
public static function GetWeaponProperties(_arg1:int):GunProperties{
var _local2:GunProperties;
_local2 = new GunProperties();
switch (_arg1){
case 1:
_local2.rotSpeed = 5;
_local2.fireRate = 200;
_local2.firstReloadTime = 5;
break;
case 2:
_local2.rotSpeed = 5;
_local2.fireRate = 80;
_local2.firstReloadTime = 5;
break;
case 3:
_local2.rotSpeed = 5;
_local2.fireRate = 800;
_local2.firstReloadTime = 5;
break;
case 4:
_local2.rotSpeed = 3;
_local2.fireRate = 45;
_local2.firstReloadTime = 30;
break;
case 5:
_local2.rotSpeed = 3;
_local2.fireRate = 1500;
_local2.firstReloadTime = 30;
break;
case 6:
_local2.rotSpeed = 5;
_local2.fireRate = 400;
_local2.firstReloadTime = 5;
break;
case 7:
_local2.rotSpeed = 5;
_local2.fireRate = 400;
_local2.firstReloadTime = 5;
break;
case 8:
_local2.rotSpeed = 5;
_local2.fireRate = 400;
_local2.firstReloadTime = 5;
break;
case 9:
_local2.rotSpeed = 5;
_local2.fireRate = 8000;
_local2.firstReloadTime = 5;
break;
case 10:
_local2.rotSpeed = 5;
_local2.fireRate = 9000;
_local2.firstReloadTime = 5;
break;
};
return (_local2);
}
}
}//package ThisGame
Section 125
//_gui (_gui)
package {
import flash.display.*;
import flash.text.*;
public dynamic class _gui extends MovieClip {
public var healthBar:MovieClip;
public var gino:gun1;
public var ammoCounter:TextField;
public var mcPopup_weapons:PopupWeapon;
public var pino:gun1;
public var ammoCounter2:TextField;
public var scoreTxt:TextField;
public var mcPopup:MovieClip;
}
}//package
Section 126
//AbortGameWnd (AbortGameWnd)
package {
import flash.display.*;
public dynamic class AbortGameWnd extends MovieClip {
public var backBtn:SimpleButton;
public var audioBtn:MovieClip;
public var resumeBtn:SimpleButton;
}
}//package
Section 127
//albero_1 (albero_1)
package {
import ThisGame.*;
public dynamic class albero_1 extends IsoObject {
}
}//package
Section 128
//albero_2 (albero_2)
package {
import ThisGame.*;
public dynamic class albero_2 extends IsoObject {
}
}//package
Section 129
//albero_3 (albero_3)
package {
import ThisGame.*;
public dynamic class albero_3 extends IsoObject {
}
}//package
Section 130
//Albero_secco_1 (Albero_secco_1)
package {
import ThisGame.*;
public dynamic class Albero_secco_1 extends IsoObject {
}
}//package
Section 131
//Albero_secco_2 (Albero_secco_2)
package {
import ThisGame.*;
public dynamic class Albero_secco_2 extends IsoObject {
}
}//package
Section 132
//Albero_secco_3 (Albero_secco_3)
package {
import ThisGame.*;
public dynamic class Albero_secco_3 extends IsoObject {
}
}//package
Section 133
//Albero_secco_gufo_1 (Albero_secco_gufo_1)
package {
import ThisGame.*;
public dynamic class Albero_secco_gufo_1 extends IsoObject {
}
}//package
Section 134
//Albero_secco_gufo_2 (Albero_secco_gufo_2)
package {
import ThisGame.*;
public dynamic class Albero_secco_gufo_2 extends IsoObject {
}
}//package
Section 135
//artillery_explosions (artillery_explosions)
package {
import flash.media.*;
public dynamic class artillery_explosions extends Sound {
}
}//package
Section 136
//artillery_firing (artillery_firing)
package {
import flash.media.*;
public dynamic class artillery_firing extends Sound {
}
}//package
Section 137
//b52_Aircraft (b52_Aircraft)
package {
import flash.media.*;
public dynamic class b52_Aircraft extends Sound {
}
}//package
Section 138
//b52_explosion (b52_explosion)
package {
import flash.media.*;
public dynamic class b52_explosion extends Sound {
}
}//package
Section 139
//B52Movie (B52Movie)
package {
import ThisGame.*;
public dynamic class B52Movie extends B52 {
}
}//package
Section 140
//bkg_sounds (bkg_sounds)
package {
import flash.media.*;
public dynamic class bkg_sounds extends Sound {
}
}//package
Section 141
//BriefingMenu (BriefingMenu)
package {
import flash.display.*;
import flash.text.*;
public dynamic class BriefingMenu extends MovieClip {
public var backBtn:SimpleButton;
public var missionNumberTxt:TextField;
public var mission_1:MovieClip;
public var mission_2:MovieClip;
public var mission_6:MovieClip;
public var mission_4:MovieClip;
public var nextBtn:SimpleButton;
public var mission_3:MovieClip;
public var puntina:MovieClip;
public var briefingText:TextField;
public var mission_5:MovieClip;
}
}//package
Section 142
//Casa_1_incl (Casa_1_incl)
package {
import ThisGame.*;
public dynamic class Casa_1_incl extends IsoObject {
}
}//package
Section 143
//Casa_1_oriz (Casa_1_oriz)
package {
import ThisGame.*;
public dynamic class Casa_1_oriz extends IsoObject {
}
}//package
Section 144
//Casa_1_vert (Casa_1_vert)
package {
import ThisGame.*;
public dynamic class Casa_1_vert extends IsoObject {
}
}//package
Section 145
//Casa_2_incl (Casa_2_incl)
package {
import ThisGame.*;
public dynamic class Casa_2_incl extends IsoObject {
}
}//package
Section 146
//Casa_2_oriz (Casa_2_oriz)
package {
import ThisGame.*;
public dynamic class Casa_2_oriz extends IsoObject {
}
}//package
Section 147
//Casa_2_vert (Casa_2_vert)
package {
import ThisGame.*;
public dynamic class Casa_2_vert extends IsoObject {
}
}//package
Section 148
//Casa_4_incl (Casa_4_incl)
package {
import ThisGame.*;
public dynamic class Casa_4_incl extends IsoObject {
}
}//package
Section 149
//Casa_4_oriz (Casa_4_oriz)
package {
import ThisGame.*;
public dynamic class Casa_4_oriz extends IsoObject {
}
}//package
Section 150
//Casa_4_vert (Casa_4_vert)
package {
import ThisGame.*;
public dynamic class Casa_4_vert extends IsoObject {
}
}//package
Section 151
//Casa_5_incl (Casa_5_incl)
package {
import ThisGame.*;
public dynamic class Casa_5_incl extends IsoObject {
}
}//package
Section 152
//Casa_5_oriz (Casa_5_oriz)
package {
import ThisGame.*;
public dynamic class Casa_5_oriz extends IsoObject {
}
}//package
Section 153
//Casa_5_vert (Casa_5_vert)
package {
import ThisGame.*;
public dynamic class Casa_5_vert extends IsoObject {
}
}//package
Section 154
//Cassa_medica_incl (Cassa_medica_incl)
package {
import ThisGame.*;
public dynamic class Cassa_medica_incl extends Medipack {
}
}//package
Section 155
//Cassa_medica_oriz (Cassa_medica_oriz)
package {
import ThisGame.*;
public dynamic class Cassa_medica_oriz extends Medipack {
}
}//package
Section 156
//Cassa_munizioni_10_incl (Cassa_munizioni_10_incl)
package {
import ThisGame.*;
public dynamic class Cassa_munizioni_10_incl extends AmmoCrate10 {
}
}//package
Section 157
//Cassa_munizioni_2_incl (Cassa_munizioni_2_incl)
package {
import ThisGame.*;
public dynamic class Cassa_munizioni_2_incl extends AmmoCrate2 {
}
}//package
Section 158
//Cassa_munizioni_3_incl (Cassa_munizioni_3_incl)
package {
import ThisGame.*;
public dynamic class Cassa_munizioni_3_incl extends AmmoCrate3 {
}
}//package
Section 159
//Cassa_munizioni_4_incl (Cassa_munizioni_4_incl)
package {
import ThisGame.*;
public dynamic class Cassa_munizioni_4_incl extends AmmoCrate4 {
}
}//package
Section 160
//Cassa_munizioni_5_incl (Cassa_munizioni_5_incl)
package {
import ThisGame.*;
public dynamic class Cassa_munizioni_5_incl extends AmmoCrate5 {
}
}//package
Section 161
//Cassa_munizioni_6_incl (Cassa_munizioni_6_incl)
package {
import ThisGame.*;
public dynamic class Cassa_munizioni_6_incl extends AmmoCrate6 {
}
}//package
Section 162
//Cassa_munizioni_7_incl (Cassa_munizioni_7_incl)
package {
import ThisGame.*;
public dynamic class Cassa_munizioni_7_incl extends AmmoCrate7 {
}
}//package
Section 163
//Cassa_munizioni_8_incl (Cassa_munizioni_8_incl)
package {
import ThisGame.*;
public dynamic class Cassa_munizioni_8_incl extends AmmoCrate8 {
}
}//package
Section 164
//Cassa_munizioni_9_incl (Cassa_munizioni_9_incl)
package {
import ThisGame.*;
public dynamic class Cassa_munizioni_9_incl extends AmmoCrate9 {
}
}//package
Section 165
//cilecca (cilecca)
package {
import flash.media.*;
public dynamic class cilecca extends Sound {
}
}//package
Section 166
//CircleCollider (CircleCollider)
package {
import ThisGame.*;
public dynamic class CircleCollider extends CollisionCircle {
}
}//package
Section 167
//collect_crate (collect_crate)
package {
import flash.media.*;
public dynamic class collect_crate extends Sound {
}
}//package
Section 168
//Collider (Collider)
package {
import ThisGame.*;
public dynamic class Collider extends CollisionClip {
}
}//package
Section 169
//Collider_basso (Collider_basso)
package {
import ThisGame.*;
public dynamic class Collider_basso extends CollisionClip {
}
}//package
Section 170
//colpito (colpito)
package {
import flash.media.*;
public dynamic class colpito extends Sound {
}
}//package
Section 171
//enemy_cannon1 (enemy_cannon1)
package {
import flash.media.*;
public dynamic class enemy_cannon1 extends Sound {
}
}//package
Section 172
//enemy_cannon2 (enemy_cannon2)
package {
import flash.media.*;
public dynamic class enemy_cannon2 extends Sound {
}
}//package
Section 173
//enemy_crash (enemy_crash)
package {
import flash.media.*;
public dynamic class enemy_crash extends Sound {
}
}//package
Section 174
//enemy_explosion (enemy_explosion)
package {
import flash.media.*;
public dynamic class enemy_explosion extends Sound {
}
}//package
Section 175
//enemy_machinegun (enemy_machinegun)
package {
import flash.media.*;
public dynamic class enemy_machinegun extends Sound {
}
}//package
Section 176
//enemy_rocket (enemy_rocket)
package {
import flash.media.*;
public dynamic class enemy_rocket extends Sound {
}
}//package
Section 177
//esplosione_piccola (esplosione_piccola)
package {
import flash.display.*;
public dynamic class esplosione_piccola extends MovieClip {
}
}//package
Section 178
//GameOverMenu (GameOverMenu)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GameOverMenu extends MovieClip {
public var backBtn:SimpleButton;
public var againBtn:SimpleButton;
public var submitBtn:SimpleButton;
public var nameText:TextField;
public var scoreText:TextField;
}
}//package
Section 179
//GranadeMovie (GranadeMovie)
package {
import ThisGame.*;
public dynamic class GranadeMovie extends Granade {
}
}//package
Section 180
//gun1 (gun1)
package {
import flash.display.*;
public dynamic class gun1 extends MovieClip {
public function gun1(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 181
//InfoWnd (InfoWnd)
package {
import flash.display.*;
public dynamic class InfoWnd extends MovieClip {
public var continueBtn:SimpleButton;
}
}//package
Section 182
//Level_1 (Level_1)
package {
import flash.display.*;
public dynamic class Level_1 extends MovieClip {
public var mcPlayer:MainPG;
public function Level_1(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 183
//Level_2 (Level_2)
package {
import flash.display.*;
import ThisGame.*;
public dynamic class Level_2 extends MovieClip {
public var goal_1:Turret1;
public var goal_2:Turret2;
public var goal_4:Turret2;
public var goal_5:Turret2;
public var goal_3:Turret2;
public var mcPlayer:MainPG;
public function Level_2(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 184
//Level_3 (Level_3)
package {
import flash.display.*;
import ThisGame.*;
public dynamic class Level_3 extends MovieClip {
public var mcPlayer:MainPG;
public var boss:GiantPanzer;
public function Level_3(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 185
//Level_4 (Level_4)
package {
import flash.display.*;
public dynamic class Level_4 extends MovieClip {
public var mcPlayer:MainPG;
public function Level_4(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 186
//Level_5 (Level_5)
package {
import flash.display.*;
public dynamic class Level_5 extends MovieClip {
public var mcPlayer:MainPG;
public function Level_5(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 187
//Level_6 (Level_6)
package {
import flash.display.*;
import ThisGame.*;
public dynamic class Level_6 extends MovieClip {
public var mcPlayer:MainPG;
public var torretta2:TrainGun;
public var torretta3:TrainGun;
public var locomotiva:Locomotive;
public var torretta1:TrainGun;
public function Level_6(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 188
//Level_test (Level_test)
package {
import flash.display.*;
import ThisGame.*;
public dynamic class Level_test extends MovieClip {
public var mcPlayer:MainPG;
public var torretta2:TrainGun;
public var torretta3:TrainGun;
public var locomotiva:Locomotive;
public var torretta1:TrainGun;
public function Level_test(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 189
//LevelCompleteMenu (LevelCompleteMenu)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LevelCompleteMenu extends MovieClip {
public var nextBtn:SimpleButton;
public var killedTxt:TextField;
public var scoreTxt:TextField;
}
}//package
Section 190
//MainMenu (MainMenu)
package {
import flash.display.*;
public dynamic class MainMenu extends MovieClip {
public var continueBtn:SimpleButton;
public var hallBtn:SimpleButton;
public var mcBtn_foofa:SimpleButton;
public var playBtn:SimpleButton;
public var moreBtn:SimpleButton;
public var mcBtn_xplored:SimpleButton;
}
}//package
Section 191
//MainPG (MainPG)
package {
import ThisGame.*;
public dynamic class MainPG extends Player {
public function MainPG(){
addFrameScript(35, frame36, 56, frame57, 89, frame90, 122, frame123, 155, frame156, 191, frame192, 212, frame213, 245, frame246, 278, frame279, 311, frame312, 347, frame348, 368, frame369, 401, frame402, 434, frame435, 467, frame468, 503, frame504, 524, frame525, 557, frame558, 590, frame591, 623, frame624, 659, frame660, 680, frame681, 713, frame714, 746, frame747, 779, frame780, 815, frame816, 836, frame837, 869, frame870, 902, frame903, 935, frame936, 971, frame972, 992, frame993, 1025, frame1026, 1058, frame1059, 1091, frame1092, 1127, frame1128, 1148, frame1149, 1181, frame1182, 1214, frame1215, 1247, frame1248);
}
function frame156(){
stop();
}
function frame279(){
stop();
}
function frame714(){
stop();
}
function frame1182(){
stop();
}
function frame837(){
stop();
}
function frame972(){
gotoAndPlay(937);
}
function frame624(){
stop();
}
function frame504(){
gotoAndPlay(469);
}
function frame747(){
stop();
}
function frame1092(){
stop();
}
function frame36(){
gotoAndPlay(1);
}
function frame192(){
gotoAndPlay(157);
}
function frame993(){
stop();
}
function frame525(){
stop();
}
function frame402(){
stop();
}
function frame870(){
stop();
}
function frame57(){
stop();
}
function frame780(){
stop();
}
function frame1215(){
stop();
}
function frame660(){
gotoAndPlay(625);
}
function frame435(){
stop();
}
function frame312(){
stop();
}
function frame558(){
stop();
}
function frame681(){
stop();
}
function frame213(){
stop();
}
function frame1248(){
stop();
}
function frame1128(){
gotoAndPlay(1093);
}
function frame90(){
stop();
}
function frame468(){
stop();
}
function frame348(){
gotoAndPlay(313);
}
function frame903(){
stop();
}
function frame591(){
stop();
}
function frame1026(){
stop();
}
function frame1149(){
stop();
}
function frame246(){
stop();
}
function frame369(){
stop();
}
function frame123(){
stop();
}
function frame936(){
stop();
}
function frame816(){
gotoAndPlay(781);
}
function frame1059(){
stop();
}
}
}//package
Section 192
//medic (medic)
package {
import flash.media.*;
public dynamic class medic extends Sound {
}
}//package
Section 193
//MineMovie (MineMovie)
package {
import ThisGame.*;
public dynamic class MineMovie extends Mine {
}
}//package
Section 194
//Muro_Inclinato_NORD_EST (Muro_Inclinato_NORD_EST)
package {
import ThisGame.*;
public dynamic class Muro_Inclinato_NORD_EST extends IsoObject {
}
}//package
Section 195
//Muro_Inclinato_NORD_OVEST (Muro_Inclinato_NORD_OVEST)
package {
import ThisGame.*;
public dynamic class Muro_Inclinato_NORD_OVEST extends IsoObject {
}
}//package
Section 196
//Muro_Inclinato_SUD_EST (Muro_Inclinato_SUD_EST)
package {
import ThisGame.*;
public dynamic class Muro_Inclinato_SUD_EST extends IsoObject {
}
}//package
Section 197
//Muro_Inclinato_SUD_OVEST (Muro_Inclinato_SUD_OVEST)
package {
import ThisGame.*;
public dynamic class Muro_Inclinato_SUD_OVEST extends IsoObject {
}
}//package
Section 198
//Muro_Laterale_EST (Muro_Laterale_EST)
package {
import ThisGame.*;
public dynamic class Muro_Laterale_EST extends IsoObject {
}
}//package
Section 199
//Muro_Orizzontale_NORD (Muro_Orizzontale_NORD)
package {
import ThisGame.*;
public dynamic class Muro_Orizzontale_NORD extends IsoObject {
}
}//package
Section 200
//Muro_Orizzontale_SUD (Muro_Orizzontale_SUD)
package {
import ThisGame.*;
public dynamic class Muro_Orizzontale_SUD extends IsoObject {
}
}//package
Section 201
//no_weapon (no_weapon)
package {
import flash.media.*;
public dynamic class no_weapon extends Sound {
}
}//package
Section 202
//Png_man_1_old (Png_man_1_old)
package {
import ThisGame.*;
public dynamic class Png_man_1_old extends Png_man1 {
public function Png_man_1_old(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9);
}
function frame5(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame9(){
stop();
}
function frame3(){
stop();
}
function frame8(){
stop();
}
function frame4(){
stop();
}
function frame6(){
stop();
}
}
}//package
Section 203
//point (point)
package {
import flash.display.*;
public dynamic class point extends MovieClip {
}
}//package
Section 204
//PopupRechargeWeapon (PopupRechargeWeapon)
package {
import flash.display.*;
public dynamic class PopupRechargeWeapon extends MovieClip {
public var recharge_2:MovieClip;
public var recharge_5:MovieClip;
public var recharge_7:MovieClip;
public var recharge_9:MovieClip;
public var recharge_8:MovieClip;
public var recharge_3:MovieClip;
public var recharge_10:MovieClip;
public var recharge_4:MovieClip;
}
}//package
Section 205
//PopupWeapon (PopupWeapon)
package {
import flash.display.*;
public dynamic class PopupWeapon extends MovieClip {
public var weapon_10:MovieClip;
public var recharge_2:MovieClip;
public var recharge_5:MovieClip;
public var recharge_7:MovieClip;
public var recharge_9:MovieClip;
public var recharge_6:MovieClip;
public var recharge_8:MovieClip;
public var recharge_3:MovieClip;
public var recharge_10:MovieClip;
public var recharge_4:MovieClip;
public var weapon_2:MovieClip;
public var weapon_3:MovieClip;
public var weapon_5:MovieClip;
public var weapon_7:MovieClip;
public var weapon_8:MovieClip;
public var weapon_9:MovieClip;
public var weapon_4:MovieClip;
}
}//package
Section 206
//pulsanteschermataintro (pulsanteschermataintro)
package {
import flash.display.*;
public dynamic class pulsanteschermataintro extends SimpleButton {
}
}//package
Section 207
//raffica (raffica)
package {
import flash.media.*;
public dynamic class raffica extends Sound {
}
}//package
Section 208
//Roccia_1 (Roccia_1)
package {
import ThisGame.*;
public dynamic class Roccia_1 extends IsoObject {
}
}//package
Section 209
//Roccia_2 (Roccia_2)
package {
import ThisGame.*;
public dynamic class Roccia_2 extends IsoObject {
}
}//package
Section 210
//Roccia_3 (Roccia_3)
package {
import ThisGame.*;
public dynamic class Roccia_3 extends IsoObject {
}
}//package
Section 211
//Roccia_grande_1 (Roccia_grande_1)
package {
import ThisGame.*;
public dynamic class Roccia_grande_1 extends IsoObject {
}
}//package
Section 212
//Roccia_grande_2 (Roccia_grande_2)
package {
import ThisGame.*;
public dynamic class Roccia_grande_2 extends IsoObject {
}
}//package
Section 213
//Roccia_grande_3 (Roccia_grande_3)
package {
import ThisGame.*;
public dynamic class Roccia_grande_3 extends IsoObject {
}
}//package
Section 214
//sacchi_diagonali_1 (sacchi_diagonali_1)
package {
import ThisGame.*;
public dynamic class sacchi_diagonali_1 extends IsoObject {
}
}//package
Section 215
//sacchi_diagonali_2 (sacchi_diagonali_2)
package {
import ThisGame.*;
public dynamic class sacchi_diagonali_2 extends IsoObject {
}
}//package
Section 216
//sacchi_diagonali_3 (sacchi_diagonali_3)
package {
import ThisGame.*;
public dynamic class sacchi_diagonali_3 extends IsoObject {
}
}//package
Section 217
//sacchi_diagonali_4 (sacchi_diagonali_4)
package {
import ThisGame.*;
public dynamic class sacchi_diagonali_4 extends IsoObject {
}
}//package
Section 218
//sacchi_orizzontali (sacchi_orizzontali)
package {
import ThisGame.*;
public dynamic class sacchi_orizzontali extends IsoObject {
}
}//package
Section 219
//sacchi_orizzontali_2 (sacchi_orizzontali_2)
package {
import ThisGame.*;
public dynamic class sacchi_orizzontali_2 extends IsoObject {
}
}//package
Section 220
//sacchi_verticali_1 (sacchi_verticali_1)
package {
import ThisGame.*;
public dynamic class sacchi_verticali_1 extends IsoObject {
}
}//package
Section 221
//sacchi_verticali_2 (sacchi_verticali_2)
package {
import ThisGame.*;
public dynamic class sacchi_verticali_2 extends IsoObject {
}
}//package
Section 222
//scream_01 (scream_01)
package {
import flash.media.*;
public dynamic class scream_01 extends Sound {
}
}//package
Section 223
//scream_02 (scream_02)
package {
import flash.media.*;
public dynamic class scream_02 extends Sound {
}
}//package
Section 224
//scream_03 (scream_03)
package {
import flash.media.*;
public dynamic class scream_03 extends Sound {
}
}//package
Section 225
//scream_04 (scream_04)
package {
import flash.media.*;
public dynamic class scream_04 extends Sound {
}
}//package
Section 226
//scream_05 (scream_05)
package {
import flash.media.*;
public dynamic class scream_05 extends Sound {
}
}//package
Section 227
//scream_06 (scream_06)
package {
import flash.media.*;
public dynamic class scream_06 extends Sound {
}
}//package
Section 228
//scream_07 (scream_07)
package {
import flash.media.*;
public dynamic class scream_07 extends Sound {
}
}//package
Section 229
//scream_08 (scream_08)
package {
import flash.media.*;
public dynamic class scream_08 extends Sound {
}
}//package
Section 230
//scream_09 (scream_09)
package {
import flash.media.*;
public dynamic class scream_09 extends Sound {
}
}//package
Section 231
//scream_10 (scream_10)
package {
import flash.media.*;
public dynamic class scream_10 extends Sound {
}
}//package
Section 232
//scream_11 (scream_11)
package {
import flash.media.*;
public dynamic class scream_11 extends Sound {
}
}//package
Section 233
//scream_12 (scream_12)
package {
import flash.media.*;
public dynamic class scream_12 extends Sound {
}
}//package
Section 234
//scream_13 (scream_13)
package {
import flash.media.*;
public dynamic class scream_13 extends Sound {
}
}//package
Section 235
//scream_14 (scream_14)
package {
import flash.media.*;
public dynamic class scream_14 extends Sound {
}
}//package
Section 236
//scream_15 (scream_15)
package {
import flash.media.*;
public dynamic class scream_15 extends Sound {
}
}//package
Section 237
//Symbol1 (Symbol1)
package {
import flash.display.*;
import ThisGame.*;
import flash.events.*;
import flash.ui.*;
public dynamic class Symbol1 extends MovieClip {
public var app:Main_Application;
public function Symbol1(){
addFrameScript(0, frame1);
}
public function OnEnterFrame_main(_arg1:Event):void{
app.Loop();
}
function frame1(){
contextMenu = new ContextMenu();
contextMenu.hideBuiltInItems();
app = new Main_Application();
app.ChangeState(new State_MainMenu(app, this));
this.addEventListener(Event.ENTER_FRAME, OnEnterFrame_main);
app.InitMusics();
}
}
}//package
Section 238
//Telegrafo_incl_SE (Telegrafo_incl_SE)
package {
import ThisGame.*;
public dynamic class Telegrafo_incl_SE extends IsoObject {
}
}//package
Section 239
//Telegrafo_incl_SW (Telegrafo_incl_SW)
package {
import ThisGame.*;
public dynamic class Telegrafo_incl_SW extends IsoObject {
}
}//package
Section 240
//Telegrafo_oriz (Telegrafo_oriz)
package {
import ThisGame.*;
public dynamic class Telegrafo_oriz extends IsoObject {
}
}//package
Section 241
//Tenda_militare_Front (Tenda_militare_Front)
package {
import ThisGame.*;
public dynamic class Tenda_militare_Front extends IsoObject {
}
}//package
Section 242
//Tenda_militare_Incl (Tenda_militare_Incl)
package {
import ThisGame.*;
public dynamic class Tenda_militare_Incl extends IsoObject {
}
}//package
Section 243
//Tenda_militare_Side (Tenda_militare_Side)
package {
import ThisGame.*;
public dynamic class Tenda_militare_Side extends IsoObject {
}
}//package
Section 244
//ucciso (ucciso)
package {
import flash.media.*;
public dynamic class ucciso extends Sound {
}
}//package
Section 245
//weapon1_rifle (weapon1_rifle)
package {
import flash.media.*;
public dynamic class weapon1_rifle extends Sound {
}
}//package
Section 246
//weapon2_ak47 (weapon2_ak47)
package {
import flash.media.*;
public dynamic class weapon2_ak47 extends Sound {
}
}//package
Section 247
//weapon3_shotgun (weapon3_shotgun)
package {
import flash.media.*;
public dynamic class weapon3_shotgun extends Sound {
}
}//package
Section 248
//weapon4_flamethrower (weapon4_flamethrower)
package {
import flash.media.*;
public dynamic class weapon4_flamethrower extends Sound {
}
}//package
Section 249
//weapon5_rocketlauncher (weapon5_rocketlauncher)
package {
import flash.media.*;
public dynamic class weapon5_rocketlauncher extends Sound {
}
}//package
Section 250
//weapon6_grenade (weapon6_grenade)
package {
import flash.media.*;
public dynamic class weapon6_grenade extends Sound {
}
}//package
Section 251
//weapon7_firegrenade (weapon7_firegrenade)
package {
import flash.media.*;
public dynamic class weapon7_firegrenade extends Sound {
}
}//package
Section 252
//WinGameOverMenu (WinGameOverMenu)
package {
import flash.display.*;
import flash.text.*;
public dynamic class WinGameOverMenu extends MovieClip {
public var backBtn:SimpleButton;
public var submitBtn:SimpleButton;
public var nameText:TextField;
public var scoreText:TextField;
}
}//package